diff --git a/clients/token_bridge/.vscode/launch.json b/clients/token_bridge/.vscode/launch.json new file mode 100644 index 000000000..bce82a429 --- /dev/null +++ b/clients/token_bridge/.vscode/launch.json @@ -0,0 +1,30 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "main.ts generate-register-chain-vaa", + "type": "node", + "request": "launch", + "args": [ + "${workspaceFolder}/main.ts", + "generate_register_chain_vaa", + "1", + "0x0000000000000000000000000290FB167208Af455bB137780163b7B7a9a10C16", + "--guardian_secret", + "cfb12303a19cde580bb4dd771639b0d26bc68353645571a8cff516ab2ee113a0,c3b2e45c422a1602333a64078aeb42637370b0f48fe385f9cfa6ad54a8e0c47e,9f790d3f08bc4b5cd910d4278f3deb406e57bb5e924906ccd52052bb078ccd47,b20cc49d6f2c82a5e6519015fc18aa3e562867f85f872c58f1277cfbd2a0c8e4", + ], + "runtimeArgs": [ + "--nolazy", + "-r", + "${workspaceRoot}/node_modules/ts-node/register" + ], + "sourceMaps": true, + "cwd": "${workspaceRoot}", + "protocol": "inspector", + }, + + ] +} diff --git a/clients/token_bridge/README.md b/clients/token_bridge/README.md new file mode 100644 index 000000000..c5170c9ae --- /dev/null +++ b/clients/token_bridge/README.md @@ -0,0 +1,9 @@ +### usage + +either build the typescript to javascript to run: + + npm run build && node main.js solana execute_governance_vaa vaaHex... + +or, run the typescript with ts-node: + + npm run main -- solana execute_governance_vaa vaaHex... diff --git a/clients/token_bridge/main.ts b/clients/token_bridge/main.ts index 2f1c65507..4f9e7ee34 100644 --- a/clients/token_bridge/main.ts +++ b/clients/token_bridge/main.ts @@ -6,13 +6,13 @@ import * as elliptic from "elliptic"; import * as ethers from "ethers"; import * as web3s from '@solana/web3.js'; -import {fromUint8Array} from "js-base64"; -import {LCDClient, MnemonicKey} from '@terra-money/terra.js'; -import {MsgExecuteContract} from "@terra-money/terra.js"; -import {PublicKey, TransactionInstruction, Keypair, Connection} from "@solana/web3.js"; -import {base58, solidityKeccak256} from "ethers/lib/utils"; +import { fromUint8Array } from "js-base64"; +import { LCDClient, MnemonicKey } from '@terra-money/terra.js'; +import { MsgExecuteContract } from "@terra-money/terra.js"; +import { PublicKey, TransactionInstruction, Keypair, Connection } from "@solana/web3.js"; +import { base58, solidityKeccak256 } from "ethers/lib/utils"; -import {setDefaultWasm, importCoreWasm, importTokenWasm, ixFromRust, BridgeImplementation__factory} from '@certusone/wormhole-sdk' +import { setDefaultWasm, importCoreWasm, importTokenWasm, ixFromRust, BridgeImplementation__factory } from '@certusone/wormhole-sdk' setDefaultWasm("node") const signAndEncodeVM = function ( @@ -43,7 +43,7 @@ const signAndEncodeVM = function ( for (let i in signers) { const ec = new elliptic.ec("secp256k1"); const key = ec.keyFromPrivate(signers[i]); - const signature = key.sign(Buffer.from(hash.substr(2), "hex"), {canonical: true}); + const signature = key.sign(Buffer.from(hash.substr(2), "hex"), { canonical: true }); const packSig = [ ethers.utils.defaultAbiCoder.encode(["uint8"], [i]).substring(2 + (64 - 2)), @@ -92,14 +92,14 @@ yargs(hideBin(process.argv)) type: "string", default: "cfb12303a19cde580bb4dd771639b0d26bc68353645571a8cff516ab2ee113a0" }) - }, async (argv: any) => { + }, async (argv) => { let data = [ "0x", "000000000000000000000000000000000000000000546f6b656e427269646765", // Token Bridge header "01", "0000", ethers.utils.defaultAbiCoder.encode(["uint16"], [argv.chain_id]).substring(2 + (64 - 4)), - ethers.utils.defaultAbiCoder.encode(["bytes32"], [fmtAddress(argv.contract_address)]).substring(2), + ethers.utils.defaultAbiCoder.encode(["bytes32"], [fmtAddress(String(argv.contract_address))]).substring(2), ].join('') const vm = signAndEncodeVM( @@ -133,13 +133,13 @@ yargs(hideBin(process.argv)) type: "string", default: "cfb12303a19cde580bb4dd771639b0d26bc68353645571a8cff516ab2ee113a0" }) - }, async (argv: any) => { + }, async (argv) => { let data = [ "0x", "000000000000000000000000000000000000000000546f6b656e427269646765", // Token Bridge header "02", ethers.utils.defaultAbiCoder.encode(["uint16"], [argv.chain_id]).substring(2 + (64 - 4)), - ethers.utils.defaultAbiCoder.encode(["bytes32"], [fmtAddress(argv.contract_address)]).substring(2), + ethers.utils.defaultAbiCoder.encode(["bytes32"], [fmtAddress(String(argv.contract_address))]).substring(2), ].join('') const vm = signAndEncodeVM( @@ -192,7 +192,7 @@ yargs(hideBin(process.argv)) description: 'Wallet Mnemonic', default: 'notice oak worry limit wrap speak medal online prefer cluster roof addict wrist behave treat actual wasp year salad speed social layer crew genius', }) - }, async (argv: any) => { + }, async (argv) => { const terra = new LCDClient({ URL: argv.rpc, chainID: argv.chain_id, @@ -203,7 +203,7 @@ yargs(hideBin(process.argv)) })); // create a simple message that moves coin balances - const vaa = Buffer.from(argv.vaa, "hex"); + const vaa = Buffer.from(String(argv.vaa), "hex"); const transaction = new MsgExecuteContract( wallet.key.accAddress, argv.token_bridge, @@ -212,7 +212,7 @@ yargs(hideBin(process.argv)) data: fromUint8Array(vaa) }, }, - {uluna: 1000} + { uluna: 1000 } ); wallet @@ -257,7 +257,7 @@ yargs(hideBin(process.argv)) description: 'Private key of the wallet', required: false }) - }, async (argv: any) => { + }, async (argv) => { const bridge = await importCoreWasm() const token_bridge = await importTokenWasm() @@ -332,7 +332,7 @@ yargs(hideBin(process.argv)) description: 'Private key of the wallet', default: "0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d" }) - }, async (argv: any) => { + }, async (argv) => { const bridge = await importCoreWasm() let provider = new ethers.providers.JsonRpcProvider(argv.rpc) @@ -340,7 +340,7 @@ yargs(hideBin(process.argv)) let t = new BridgeImplementation__factory(signer); let tb = t.attach(argv.token_bridge); - let vaa = Buffer.from(argv.vaa, "hex"); + let vaa = Buffer.from(String(argv.vaa), "hex"); let parsed_vaa = await bridge.parse_vaa(vaa); switch (parsed_vaa.payload[32]) { @@ -423,7 +423,7 @@ function setupConnection(argv: yargs.Arguments): web3s.Connection { ); } -function fmtAddress(addr: string) : string { +function fmtAddress(addr: string): string { let address = (addr.search("0x") == 0) ? addr.substring(2) : addr; return "0x" + zeroPadBytes(address, 32); } diff --git a/clients/token_bridge/package-lock.json b/clients/token_bridge/package-lock.json index 466c31266..193eacff0 100644 --- a/clients/token_bridge/package-lock.json +++ b/clients/token_bridge/package-lock.json @@ -26,6 +26,7 @@ "@types/bs58": "^4.0.1", "@types/yargs": "^17.0.2", "copy-dir": "^1.3.0", + "ts-node": "^10.7.0", "typescript": "^4.3.5" } }, @@ -529,6 +530,27 @@ "resolved": "https://registry.npmjs.org/bech32/-/bech32-2.0.0.tgz", "integrity": "sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg==" }, + "node_modules/@cspotcode/source-map-consumer": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz", + "integrity": "sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg==", + "dev": true, + "engines": { + "node": ">= 12" + } + }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.7.0.tgz", + "integrity": "sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA==", + "dev": true, + "dependencies": { + "@cspotcode/source-map-consumer": "0.8.0" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/@ethereumjs/common": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-2.4.0.tgz", @@ -1867,6 +1889,30 @@ "async-limiter": "~1.0.0" } }, + "node_modules/@tsconfig/node10": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.8.tgz", + "integrity": "sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==", + "dev": true + }, + "node_modules/@tsconfig/node12": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.9.tgz", + "integrity": "sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==", + "dev": true + }, + "node_modules/@tsconfig/node14": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.1.tgz", + "integrity": "sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==", + "dev": true + }, + "node_modules/@tsconfig/node16": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.2.tgz", + "integrity": "sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==", + "dev": true + }, "node_modules/@types/bn.js": { "version": "5.1.0", "license": "MIT", @@ -1987,6 +2033,27 @@ "node": ">= 0.6" } }, + "node_modules/acorn": { + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", + "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-walk": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/aes-js": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz", @@ -2029,6 +2096,12 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true + }, "node_modules/array-flatten": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", @@ -2959,6 +3032,12 @@ "sha.js": "^2.4.8" } }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true + }, "node_modules/cross-fetch": { "version": "2.2.5", "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-2.2.5.tgz", @@ -3116,6 +3195,15 @@ "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" }, + "node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, "node_modules/diffie-hellman": { "version": "5.0.3", "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", @@ -5119,6 +5207,12 @@ "integrity": "sha1-81ypHEk/e3PaDgdJUwTxezH4fuU=", "dev": true }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true + }, "node_modules/md5.js": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", @@ -9286,6 +9380,49 @@ "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" }, + "node_modules/ts-node": { + "version": "10.7.0", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.7.0.tgz", + "integrity": "sha512-TbIGS4xgJoX2i3do417KSaep1uRAW/Lu+WAL2doDHC0D6ummjirVOXU5/7aiZotbQ5p1Zp9tP7U6cYhA0O7M8A==", + "dev": true, + "dependencies": { + "@cspotcode/source-map-support": "0.7.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.0", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, "node_modules/tslib": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", @@ -9468,6 +9605,12 @@ "uuid": "bin/uuid" } }, + "node_modules/v8-compile-cache-lib": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.0.tgz", + "integrity": "sha512-mpSYqfsFvASnSn5qMiwrr4VKfumbPyONLCOPmsR3A6pTY/r0+tSaVbgPWSAIuzbk3lCTa+FForeTiO+wBQGkjA==", + "dev": true + }, "node_modules/varint": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/varint/-/varint-5.0.2.tgz", @@ -10130,6 +10273,15 @@ "node": ">=10" } }, + "node_modules/yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "pkg": { "name": "bridge", "version": "0.1.0", @@ -10547,6 +10699,21 @@ } } }, + "@cspotcode/source-map-consumer": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz", + "integrity": "sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg==", + "dev": true + }, + "@cspotcode/source-map-support": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.7.0.tgz", + "integrity": "sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA==", + "dev": true, + "requires": { + "@cspotcode/source-map-consumer": "0.8.0" + } + }, "@ethereumjs/common": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-2.4.0.tgz", @@ -11495,6 +11662,30 @@ } } }, + "@tsconfig/node10": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.8.tgz", + "integrity": "sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==", + "dev": true + }, + "@tsconfig/node12": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.9.tgz", + "integrity": "sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==", + "dev": true + }, + "@tsconfig/node14": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.1.tgz", + "integrity": "sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==", + "dev": true + }, + "@tsconfig/node16": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.2.tgz", + "integrity": "sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==", + "dev": true + }, "@types/bn.js": { "version": "5.1.0", "requires": { @@ -11594,6 +11785,18 @@ "negotiator": "0.6.2" } }, + "acorn": { + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", + "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", + "dev": true + }, + "acorn-walk": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "dev": true + }, "aes-js": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz", @@ -11623,6 +11826,12 @@ "color-convert": "^2.0.1" } }, + "arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true + }, "array-flatten": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", @@ -12401,6 +12610,12 @@ "sha.js": "^2.4.8" } }, + "create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true + }, "cross-fetch": { "version": "2.2.5", "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-2.2.5.tgz", @@ -12525,6 +12740,12 @@ "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" }, + "diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true + }, "diffie-hellman": { "version": "5.0.3", "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", @@ -14210,6 +14431,12 @@ "integrity": "sha1-81ypHEk/e3PaDgdJUwTxezH4fuU=", "dev": true }, + "make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true + }, "md5.js": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", @@ -17233,6 +17460,27 @@ "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" }, + "ts-node": { + "version": "10.7.0", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.7.0.tgz", + "integrity": "sha512-TbIGS4xgJoX2i3do417KSaep1uRAW/Lu+WAL2doDHC0D6ummjirVOXU5/7aiZotbQ5p1Zp9tP7U6cYhA0O7M8A==", + "dev": true, + "requires": { + "@cspotcode/source-map-support": "0.7.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.0", + "yn": "3.1.1" + } + }, "tslib": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", @@ -17372,6 +17620,12 @@ "uuid": { "version": "3.4.0" }, + "v8-compile-cache-lib": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.0.tgz", + "integrity": "sha512-mpSYqfsFvASnSn5qMiwrr4VKfumbPyONLCOPmsR3A6pTY/r0+tSaVbgPWSAIuzbk3lCTa+FForeTiO+wBQGkjA==", + "dev": true + }, "varint": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/varint/-/varint-5.0.2.tgz", @@ -17932,6 +18186,12 @@ "version": "20.2.9", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==" + }, + "yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true } } } diff --git a/clients/token_bridge/package.json b/clients/token_bridge/package.json index 2eeb880a5..891b4a400 100644 --- a/clients/token_bridge/package.json +++ b/clients/token_bridge/package.json @@ -17,7 +17,8 @@ "scripts": { "start": "tsc && node main.js", "build": "tsc", - "test": "echo \"Error: no test specified\" && exit 1" + "test": "echo \"Error: no test specified\" && exit 1", + "main": "ts-node main.ts" }, "devDependencies": { "@truffle/hdwallet-provider": "^1.4.1", @@ -25,6 +26,7 @@ "@types/bs58": "^4.0.1", "@types/yargs": "^17.0.2", "copy-dir": "^1.3.0", + "ts-node": "^10.7.0", "typescript": "^4.3.5" } }