-
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.
Merge pull request #206 from sotatek-dev/develop
Develop
- Loading branch information
Showing
13 changed files
with
119 additions
and
9 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
22 changes: 22 additions & 0 deletions
22
src/database/migrations/1730343431370-add-token-circulation.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,22 @@ | ||
import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm'; | ||
|
||
export class AddTokenCirculation1730343431370 implements MigrationInterface { | ||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
return queryRunner.addColumns('common_configuration', [ | ||
new TableColumn({ | ||
name: 'total_weth_minted', | ||
type: 'varchar', | ||
default: '0', | ||
}), | ||
new TableColumn({ | ||
name: 'total_weth_burnt', | ||
type: 'varchar', | ||
default: '0', | ||
}), | ||
]); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
return queryRunner.dropColumns('common_configuration', ['total_weth_minted', 'total_weth_burnt']); | ||
} | ||
} |
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
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
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
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
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
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
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,20 @@ | ||
import { Injectable } from '@nestjs/common'; | ||
import assert from 'assert'; | ||
|
||
import { CommonConfigRepository } from '../../../database/repositories/common-configuration.repository.js'; | ||
import { EventLogRepository } from '../../../database/repositories/event-log.repository.js'; | ||
|
||
@Injectable() | ||
export class POASync { | ||
constructor( | ||
private readonly commonConfigRepo: CommonConfigRepository, | ||
private readonly eventLogRepo: EventLogRepository, | ||
) {} | ||
public async handleSyncPOA() { | ||
const currentConfig = await this.commonConfigRepo.findOneBy({}); | ||
assert(currentConfig, 'please seed common config'); | ||
|
||
const res = await this.eventLogRepo.getTotalTokenSupply(); | ||
console.log(res); | ||
} | ||
} |
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
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
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
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