-
Notifications
You must be signed in to change notification settings - Fork 25
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
14 changed files
with
3,657 additions
and
3,592 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 |
---|---|---|
|
@@ -2,6 +2,10 @@ | |
"name": "@rabbitholegg/questdk-plugin-connext", | ||
"version": "1.0.0-alpha.0", | ||
"type": "module", | ||
"exports": { | ||
"require": "./dist/cjs/index.js", | ||
"import": "./dist/esm/index.js" | ||
}, | ||
"main": "./dist/cjs/index.js", | ||
"module": "./dist/esm/index.js", | ||
"packageManager": "[email protected]", | ||
|
@@ -23,15 +27,20 @@ | |
"test:ci": "CI=true vitest --coverage", | ||
"test:typecheck": "SKIP_GLOBAL_SETUP=true vitest typecheck", | ||
"test:ui": "vitest dev --ui", | ||
"typecheck": "tsc --noEmit" | ||
"typecheck": "tsc --noEmit", | ||
"update-contract-addresses": "ts-node -P ./scripts/tsconfig.json ./scripts/update-contract-addresses.ts" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", | ||
"types": "./dist/types/index.d.ts", | ||
"typings": "./dist/types/index.d.ts", | ||
"devDependencies": { | ||
"@types/node": "^20.4.5", | ||
"@vitest/coverage-v8": "^0.33.0", | ||
"rimraf": "^5.0.1", | ||
"rome": "^12.1.3", | ||
"ts-node": "^10.9.1", | ||
"tsconfig": "workspace:*", | ||
"typescript": "^5.1.6", | ||
"vitest": "^0.33.0" | ||
|
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,12 @@ | ||
{ | ||
"compilerOptions": { | ||
"module": "CommonJS", | ||
"target": "es2017", | ||
"lib": ["es2017", "dom"], | ||
"strict": true, | ||
"esModuleInterop": true, | ||
"moduleResolution": "node", | ||
"resolveJsonModule": true | ||
}, | ||
"include": ["./**/*.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,42 @@ | ||
import connextContracts from '@connext/smart-contracts/deployments.json' | ||
import fs from 'fs' | ||
import path from 'path' | ||
import { type Abi } from 'viem' | ||
|
||
type ConnextContractsJson = { | ||
[chainId: string]: { | ||
chainId: string | ||
name: string | ||
contracts: { | ||
[name: string]: { | ||
address: string | ||
abi: Abi | ||
} | ||
} | ||
}[] | ||
} | ||
|
||
const _getContract = (chainId: number, name: string) => { | ||
const contracts = connextContracts as ConnextContractsJson | ||
return contracts[chainId][0].contracts[name] | ||
} | ||
|
||
async function main() { | ||
const _CONNEXT_CONTRACT_NAME = 'Connext' | ||
const _networks = Object.keys(connextContracts) | ||
const contractAddresses: Record<string, string> = {} | ||
|
||
for (const network of _networks) { | ||
const contract = _getContract(Number(network), _CONNEXT_CONTRACT_NAME) | ||
if (contract) { | ||
contractAddresses[network] = contract.address | ||
} | ||
} | ||
|
||
fs.writeFileSync( | ||
path.join(__dirname, '../src/contract-addresses.ts'), | ||
JSON.stringify(contractAddresses, null, 2), | ||
) | ||
} | ||
|
||
main() |
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.