-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
1,819 additions
and
797 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"editor.defaultFormatter": "biomejs.biome", | ||
"editor.formatOnSave": true | ||
"editor.defaultFormatter": "biomejs.biome", | ||
"editor.formatOnSave": true | ||
} |
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 |
---|---|---|
@@ -1,30 +1,31 @@ | ||
{ | ||
"$schema": "https://biomejs.dev/schemas/1.4.1/schema.json", | ||
"organizeImports": { | ||
"enabled": true | ||
}, | ||
"linter": { | ||
"enabled": true, | ||
"ignore": ["out/"], | ||
"rules": { | ||
"recommended": true, | ||
"suspicious": { | ||
"noExplicitAny": "off" | ||
}, | ||
"performance": { | ||
"noDelete": "off" | ||
}, | ||
"style": { | ||
"useTemplate": "off" | ||
} | ||
} | ||
}, | ||
"formatter": { | ||
"enabled": true, | ||
"formatWithErrors": true, | ||
"indentStyle": "space", | ||
"indentWidth": 4, | ||
"lineWidth": 120, | ||
"ignore": [] | ||
"$schema": "https://biomejs.dev/schemas/1.4.1/schema.json", | ||
"organizeImports": { | ||
"enabled": true | ||
}, | ||
"linter": { | ||
"enabled": true, | ||
"ignore": ["out/"], | ||
"rules": { | ||
"recommended": true, | ||
"suspicious": { | ||
"noExplicitAny": "off" | ||
}, | ||
"performance": { | ||
"noDelete": "off" | ||
}, | ||
"style": { | ||
"useTemplate": "off", | ||
"noNonNullAssertion": "off" | ||
} | ||
} | ||
}, | ||
"formatter": { | ||
"enabled": true, | ||
"formatWithErrors": true, | ||
"indentStyle": "space", | ||
"indentWidth": 2, | ||
"lineWidth": 120, | ||
"ignore": [] | ||
} | ||
} |
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 |
---|---|---|
@@ -1,43 +1,44 @@ | ||
{ | ||
"name": "catapulta-verify", | ||
"version": "1.1.1", | ||
"author": "@kartojal <[email protected]> (https://catapulta.sh/)", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/catapulta-sh/catapulta-verify.git" | ||
}, | ||
"main": "./out/index.mjs", | ||
"private": false, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"files": [ | ||
"out/index.mjs" | ||
], | ||
"devDependencies": { | ||
"@biomejs/biome": "1.4.1", | ||
"@types/chalk": "^2.2.0", | ||
"bun-types": "latest", | ||
"chalk": "^5.3.0", | ||
"dotenv": "^16.3.1", | ||
"ts-command-line-args": "^2.5.1" | ||
}, | ||
"peerDependencies": { | ||
"typescript": "^5.0.0" | ||
}, | ||
"bin": { | ||
"catapulta-verify": "out/index.mjs" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/catapulta-sh/catapulta-verify/issues", | ||
"email": "[email protected]" | ||
}, | ||
"homepage": "https://github.com/catapulta-sh/catapulta-verify#readme", | ||
"license": "MIT", | ||
"scripts": { | ||
"build": "bun build ./src/index.ts --outfile=out/index.mjs --target node", | ||
"postbuild": "bunx rexreplace '^(#!.+\\n)?' '$1import { createRequire as createImportMetaRequire } from \"module\"; import.meta.require ||= (id) => createImportMetaRequire(import.meta.url)(id);\\n' -GM out/index.mjs", | ||
"lint:fix": "bunx @biomejs/biome check . --apply", | ||
"lint": "bunx @biomejs/biome check ." | ||
} | ||
"name": "catapulta-verify", | ||
"version": "1.1.1", | ||
"author": "@kartojal <[email protected]> (https://catapulta.sh/)", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/catapulta-sh/catapulta-verify.git" | ||
}, | ||
"main": "./out/index.mjs", | ||
"private": false, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"files": ["out/index.mjs"], | ||
"devDependencies": { | ||
"@biomejs/biome": "1.9.4", | ||
"@types/chalk": "^2.2.0", | ||
"bun-types": "1.1.36", | ||
"chalk": "^5.3.0", | ||
"dotenv": "^16.4.5", | ||
"ts-command-line-args": "^2.5.1", | ||
"typescript": "^5.6.3", | ||
"vitest": "^2.1.5" | ||
}, | ||
"bin": { | ||
"catapulta-verify": "out/index.mjs" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/catapulta-sh/catapulta-verify/issues", | ||
"email": "[email protected]" | ||
}, | ||
"homepage": "https://github.com/catapulta-sh/catapulta-verify#readme", | ||
"license": "MIT", | ||
"scripts": { | ||
"build": "bun build ./src/index.ts --outfile=out/index.mjs --target node", | ||
"postbuild": "bunx rexreplace '^(#!.+\\n)?' '$1import { createRequire as createImportMetaRequire } from \"module\"; import.meta.require ||= (id) => createImportMetaRequire(import.meta.url)(id);\\n' -GM out/index.mjs", | ||
"lint:fix": "bunx @biomejs/biome check . --write", | ||
"lint": "bunx @biomejs/biome check .", | ||
"test": "vitest" | ||
}, | ||
"dependencies": { | ||
"@bgd-labs/rpc-env": "^2.0.1" | ||
} | ||
} |
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,40 @@ | ||
import { writeFileSync } from "node:fs"; | ||
|
||
type RouteScanResponse = { | ||
items: { | ||
workspace: string; | ||
chainId: string; | ||
}[]; | ||
}; | ||
|
||
async function getRoutescan() { | ||
const result = await fetch("https://cdn-canary.routescan.io/api/evm/all/explorers"); | ||
const data = (await result.json()) as RouteScanResponse; | ||
const formatted = data.items.map((d) => ({ | ||
api: `https://api.routescan.io/v2/network/${d.workspace}/evm/${d.chainId}/etherscan`, | ||
explorer: `${d.chainId}.routescan.io`, | ||
chainId: Number(d.chainId), | ||
})); | ||
writeFileSync("src/explorers/routescan.json", JSON.stringify(formatted, null, 2)); | ||
} | ||
|
||
type EtherscanResponse = { | ||
result: { | ||
blockexplorer: string; | ||
chainid: string; | ||
apiurl: string; | ||
}[]; | ||
}; | ||
async function getEtherscan() { | ||
const result = await fetch("https://api.etherscan.io/v2/chainlist"); | ||
const data = (await result.json()) as EtherscanResponse; | ||
const formatted = data.result.map((d) => ({ | ||
api: d.apiurl, | ||
explorer: d.blockexplorer, | ||
chainId: Number(d.chainid), | ||
})); | ||
writeFileSync("src/explorers/etherscan.json", JSON.stringify(formatted, null, 2)); | ||
} | ||
|
||
getRoutescan(); | ||
getEtherscan(); |
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
Oops, something went wrong.