Skip to content

Commit

Permalink
fix ci, schema
Browse files Browse the repository at this point in the history
  • Loading branch information
rinchan01 committed Nov 26, 2024
1 parent 03147d9 commit 0e32d92
Show file tree
Hide file tree
Showing 381 changed files with 5,368 additions and 33 deletions.
7 changes: 2 additions & 5 deletions internal/checkTVL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,16 @@ const blockfrostAdapter = new SDK.BlockfrostAdapter({
});

export async function verifyTVL() {
const tokenDir = path.join(__dirname, TOKEN_DIR);
const [v1Pools, { pools: v2Pools }] = await Promise.all([getAllV1Pools(), blockfrostAdapter.getAllV2Pools()]);

fs.readdir(tokenDir, async function (error, files) {
fs.readdir(TOKEN_DIR, async function (error, files) {
if (error) {
throw error;
}
for (const file of files) {
const filePath = path.join(tokenDir, file);
const filePath = path.join(TOKEN_DIR, file);
const tokenData = <TokenMetadata>load(fs.readFileSync(filePath, "utf8"));
const tokenId = file.split('.')[0];
const newVerified = await checkTVL(v1Pools, v2Pools, tokenId);

if (newVerified === tokenData.verified) {
continue;
}
Expand Down
1 change: 1 addition & 0 deletions internal/validateTokenFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ async function validateTokenFiles(files: string[]) {
if (!validate) {
throw new Error(`Error validating token, token file: ${fileName}`);
}

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ categories:
socialLinks:
website: https://axo.trade
twitter: https://twitter.com/axotrade
discord": https://discord.com/invite/axotrade
discord: https://discord.com/invite/axotrade

verified: true

Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
"type": "module",
"scripts": {
"build": "rimraf build && rollup -c rollup.config.js",
"test": "jest && npx tsx ./internal/validateTokenFiles.ts",
"test": "jest",
"check-format": "tsx ./internal/validateTokenFiles.ts",
"check-tvl": "tsx --env-file=.env ./internal/checkTVL.ts",
"lint": "biome check --no-errors-on-unmatched --fix ."
},
"files": [
Expand Down Expand Up @@ -38,6 +40,7 @@
"rollup-plugin-copy": "^3.5.0",
"rollup-plugin-dts": "^4.2.3",
"rollup-plugin-esbuild": "^4.10.3",
"tsx": "^4.19.2",
"typescript": "^5.6.3"
},
"dependencies": {
Expand Down
Loading

0 comments on commit 0e32d92

Please sign in to comment.