-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add polygon network to monitor (#49)
* add polygon address and model event * add polling block service for polygon * update env for polygon * fix erc721 address lowercase * export event history * config polygon monitor servie * fix polygon provider * add polygon module * add polygon monitor provider * export provider * fix env * open provider * open worker provider * open polygon worker controller * update blocksync * Add provide for polygon monitor address model * update log * add await when emit transaction to catching error block --------- Co-authored-by: thong.nguyen5 <[email protected]>
- Loading branch information
1 parent
fa40821
commit c168cf5
Showing
26 changed files
with
824 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
143 changes: 0 additions & 143 deletions
143
app/apps/monitor-service/src/ethereum/dto/eth.webhook-delivery.dto.ts
This file was deleted.
Oops, something went wrong.
18 changes: 0 additions & 18 deletions
18
app/apps/monitor-service/src/ethereum/ethereum.controller.spec.ts
This file was deleted.
Oops, something went wrong.
18 changes: 0 additions & 18 deletions
18
app/apps/monitor-service/src/ethereum/ethereum.service.spec.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
app/apps/monitor-service/src/polygon/polygon.controller.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { TopicName } from '@app/utils/topicUtils'; | ||
import { Controller } from '@nestjs/common'; | ||
import { EventPattern } from '@nestjs/microservices'; | ||
import { PolygonService } from './polygon.service'; | ||
|
||
@Controller() | ||
export class PolygonController { | ||
constructor(private readonly polygon: PolygonService) {} | ||
|
||
@EventPattern(TopicName.POLYGON_NATIVE_TRANSFER) | ||
handleNativeTransfer(data: any): void { | ||
this.polygon.handleNativeTransfer(data); | ||
} | ||
|
||
@EventPattern(TopicName.POLYGON_ERC20_TRANSFER) | ||
handleErc20Transfer(data: any): void { | ||
this.polygon.handleErc20Transfer(data); | ||
} | ||
|
||
@EventPattern(TopicName.POLYGON_ERC721_TRANSFER) | ||
handleErc721Transfer(data: any): void { | ||
this.polygon.handleErc721Transfer(data); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { EventHistoryModelModule } from '@app/shared_modules/event_history/event_history.module'; | ||
import { MonitorModule } from '@app/shared_modules/monitor/monitor.module'; | ||
import { ProjectModule } from '@app/shared_modules/project/project.module'; | ||
import { WebhookModule } from '@app/shared_modules/webhook/webhook.module'; | ||
import { Module } from '@nestjs/common'; | ||
import { ClientsModule, Transport } from '@nestjs/microservices'; | ||
import { PolygonController } from './polygon.controller'; | ||
import { PolygonService } from './polygon.service'; | ||
|
||
@Module({ | ||
providers: [PolygonService], | ||
controllers: [PolygonController], | ||
exports: [PolygonService], | ||
imports: [ | ||
ClientsModule.registerAsync([ | ||
{ | ||
name: 'WEBHOOK_SERVICE', | ||
useFactory: () => ({ | ||
transport: Transport.KAFKA, | ||
options: { | ||
client: { | ||
clientId: 'webhook', | ||
brokers: process.env.KAFKA_BROKERS.split(','), | ||
}, | ||
consumer: { | ||
groupId: 'webhook-consumer', | ||
}, | ||
}, | ||
}), | ||
}, | ||
]), | ||
WebhookModule, | ||
MonitorModule, | ||
ProjectModule, | ||
EventHistoryModelModule, | ||
], | ||
}) | ||
export class PolygonModule {} |
Oops, something went wrong.