Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
tsmbl committed May 25, 2022
1 parent de56e3b commit 1ce83a8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 14 deletions.
30 changes: 21 additions & 9 deletions src/monitor/farm-monitoring-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ import {
RestWeb2SubscriberRepository,
} from '@dialectlabs/monitor/lib/cjs/internal/rest-web2-subscriber.repository';
import { findAllDistinct } from '@dialectlabs/monitor/lib/cjs/internal/subsbscriber-repository-utilts';
import {
toDecimals,
} from '../saber-wars-api/saber-wars-api';
import { toDecimals } from '../saber-wars-api/saber-wars-api';
import { DialectConnection } from './dialect-connection';
import { Subject } from 'rxjs';
import { QuarryEventSubscription } from '../saber-wars-api/quarry-event-api';
Expand All @@ -33,6 +31,7 @@ export class FarmMonitoringService implements OnModuleInit, OnModuleDestroy {
private readonly numberFormat = new Intl.NumberFormat('en-US');
private readonly inMemoryWeb2SubscriberRepository: Web2SubscriberRepository;
private readonly subscriberRepository: InMemorySubscriberRepository;

constructor(private readonly dialectConnection: DialectConnection) {
this.subscriberRepository = InMemorySubscriberRepository.decorate(
new OnChainSubscriberRepository(
Expand All @@ -59,7 +58,6 @@ export class FarmMonitoringService implements OnModuleInit, OnModuleDestroy {
}

private async initFarmMonitor() {

const subscribers = await findAllDistinct(
this.subscriberRepository,
this.inMemoryWeb2SubscriberRepository,
Expand Down Expand Up @@ -127,32 +125,46 @@ export class FarmMonitoringService implements OnModuleInit, OnModuleDestroy {
message: value.message,
};
},
{ dispatch: 'unicast', to: ({ groupingKey }) => new PublicKey(groupingKey) },
{
dispatch: 'unicast',
to: ({ groupingKey }) => new PublicKey(groupingKey),
},
)
.telegram(
({ value }) => {
return {
body: `⚔️ SABER: ` + value.message,
};
},
{ dispatch: 'unicast', to: ({ groupingKey }) => new PublicKey(groupingKey) },
{
dispatch: 'unicast',
to: ({ groupingKey }) => new PublicKey(groupingKey),
},
)
.sms(
({ value }) => {
return {
body: `⚔️ SABER: ` + value.message,
};
},
{ dispatch: 'unicast', to: ({ groupingKey }) => new PublicKey(groupingKey) },
{
dispatch: 'unicast',
to: ({ groupingKey }) => new PublicKey(groupingKey),
},
)
.email(
({ value }) => {
return {
subject: `⚔️ SABER: Succesful ${value.message.includes("claimed") ? "Claim" : "Stake"}`,
subject: `⚔️ SABER: Successful ${
value.message.includes('claimed') ? 'Claim' : 'Stake'
}`,
text: value.message,
};
},
{ dispatch: 'unicast', to: ({ groupingKey }) => new PublicKey(groupingKey) },
{
dispatch: 'unicast',
to: ({ groupingKey }) => new PublicKey(groupingKey),
},
)
.and()
.build();
Expand Down
8 changes: 3 additions & 5 deletions src/monitor/whale-monitoring-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ import {
Trace,
} from '@dialectlabs/monitor';
import { Duration } from 'luxon';
import {
getWarsInfo,
PoolInfo,
} from '../saber-wars-api/saber-wars-api';
import { getWarsInfo, PoolInfo } from '../saber-wars-api/saber-wars-api';
import { NoopSubscriberRepository } from './noop-subscriber-repository';
import { Cron } from '@nestjs/schedule';
import { DialectConnection } from './dialect-connection';
Expand All @@ -29,6 +26,7 @@ export class WhaleMonitoringService implements OnModuleInit, OnModuleDestroy {
new TwitterNotificationSink();
private readonly logger = new Logger(WhaleMonitoringService.name);
private readonly numberFormat = new Intl.NumberFormat('en-US');

constructor(private readonly dialectConnection: DialectConnection) {}

private static getTriggerOutput(trace: Trace[]) {
Expand Down Expand Up @@ -121,7 +119,7 @@ Time remaining in epoch: ${epochInfo.currentEpochRemainingTime.toFormat(
{
dispatch: 'unicast',
to: (val) => new PublicKey(val.groupingKey),
}
},
)
.and()
.build();
Expand Down

0 comments on commit 1ce83a8

Please sign in to comment.