diff --git a/clients/js/README.md b/clients/js/README.md index 6ca8d0f4af..1511dfe80f 100644 --- a/clients/js/README.md +++ b/clients/js/README.md @@ -255,7 +255,8 @@ Options: "avalanche", "oasis", "algorand", "aurora", "fantom", "karura", "acala", "klaytn", "celo", "near", "moonbeam", "neon", "terra2", "injective", "osmosis", "sui", "aptos", "arbitrum", "optimism", "gnosis", "pythnet", - "xpla", "btc", "base", "sei", "wormchain", "sepolia"] + "xpla", "btc", "base", "sei", "rootstock", "wormchain", "cosmoshub", "evmos", + "kujira", "sepolia"] -n, --network Network [required] [choices: "mainnet", "testnet", "devnet"] -a, --contract-address Contract to submit VAA to (override config) [string] @@ -310,13 +311,15 @@ Options: "avalanche", "oasis", "algorand", "aurora", "fantom", "karura", "acala", "klaytn", "celo", "near", "moonbeam", "neon", "terra2", "injective", "osmosis", "sui", "aptos", "arbitrum", "optimism", "gnosis", "pythnet", - "xpla", "btc", "base", "sei", "wormchain", "sepolia"] + "xpla", "btc", "base", "sei", "rootstock", "wormchain", "cosmoshub", "evmos", + "kujira", "sepolia"] --dst-chain destination chain [required] [choices: "solana", "ethereum", "terra", "bsc", "polygon", "avalanche", "oasis", "algorand", "aurora", "fantom", "karura", "acala", "klaytn", "celo", "near", "moonbeam", "neon", "terra2", "injective", "osmosis", "sui", "aptos", "arbitrum", "optimism", "gnosis", "pythnet", - "xpla", "btc", "base", "sei", "wormchain", "sepolia"] + "xpla", "btc", "base", "sei", "rootstock", "wormchain", "cosmoshub", "evmos", + "kujira", "sepolia"] --dst-addr destination address [string] [required] --token-addr token address [string] [default: native token] --amount token amount [string] [required] @@ -342,16 +345,15 @@ Options: ```sh Positionals: - network Network [choices: "mainnet", "testnet", "devnet"] - chain Source chain + network Network [choices: "mainnet", "testnet", "devnet"] + chain Source chain [choices: "unset", "solana", "ethereum", "terra", "bsc", "polygon", "avalanche", "oasis", "algorand", "aurora", "fantom", "karura", "acala", "klaytn", "celo", "near", "moonbeam", "neon", "terra2", "injective", "osmosis", "sui", "aptos", "arbitrum", "optimism", "gnosis", "pythnet", - "xpla", "btc", "base", "sei", "wormchain", "sepolia"] - tx Source transaction hash [string] - block-start Starting Block Range, i.e. -2048 [string] - block-end Ending Block Range, i.e. latest [string] + "xpla", "btc", "base", "sei", "rootstock", "wormchain", "cosmoshub", "evmos", + "kujira", "sepolia"] + tx Source transaction hash [string] Options: --help Show help [boolean] diff --git a/clients/js/package-lock.json b/clients/js/package-lock.json index bf6edd85d3..016c301455 100644 --- a/clients/js/package-lock.json +++ b/clients/js/package-lock.json @@ -10,7 +10,7 @@ "license": "Apache-2.0", "dependencies": { "@celo-tools/celo-ethers-wrapper": "^0.1.0", - "@certusone/wormhole-sdk": "^0.9.24-beta.0", + "@certusone/wormhole-sdk": "^0.10.5-beta.3", "@cosmjs/encoding": "^0.26.2", "@improbable-eng/grpc-web-node-http-transport": "^0.15.0", "@injectivelabs/networks": "^1.10.7", @@ -494,9 +494,9 @@ } }, "node_modules/@certusone/wormhole-sdk": { - "version": "0.9.24-beta.0", - "resolved": "https://registry.npmjs.org/@certusone/wormhole-sdk/-/wormhole-sdk-0.9.24-beta.0.tgz", - "integrity": "sha512-SiUd9EAgPM5RfwPJ56I49K4Rgzkc5pVMqXDk2udRX+Q9dbvlaTW4d/Cu1dk+x1n6uSjAjact0pNz19C1yDebLA==", + "version": "0.10.5-beta.3", + "resolved": "https://registry.npmjs.org/@certusone/wormhole-sdk/-/wormhole-sdk-0.10.5-beta.3.tgz", + "integrity": "sha512-Q1IrWYQ/NPpLcuPs3J8MbUeRwBxBOTZFwLs3jahohgUFCQhGuBwhgpv02CdEYBR/iZpgaDrj2Eo3HOe3uNlYVA==", "dependencies": { "@certusone/wormhole-sdk-proto-web": "0.0.6", "@certusone/wormhole-sdk-wasm": "^0.0.1", @@ -550,9 +550,9 @@ "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" }, "node_modules/@certusone/wormhole-sdk-proto-web/node_modules/protobufjs": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.3.tgz", - "integrity": "sha512-TtpvOqwB5Gdz/PQmOjgsrGH1nHjAQVCN7JG4A6r1sXRWESL5rNMAiRcBQlCAdKxZcAbstExQePYG8xof/JVRgg==", + "version": "7.2.5", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.5.tgz", + "integrity": "sha512-gGXRSXvxQ7UiPgfw8gevrfRWcTlSbOFg+p/N+JVJEK5VhueL2miT6qTymqAmjr1Q5WbOCyJbyrk6JfWKwlFn6A==", "hasInstallScript": true, "dependencies": { "@protobufjs/aspromise": "^1.1.2", @@ -2995,11 +2995,11 @@ } }, "node_modules/@project-serum/anchor/node_modules/cross-fetch": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.5.tgz", - "integrity": "sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==", + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.8.tgz", + "integrity": "sha512-cvA+JwZoU0Xq+h6WkMvAUqPEYy92Obet6UdKLfW60qn99ftItKjB5T+BkyWOFWe2pUyfQ+IJHmpOTznqk1M6Kg==", "dependencies": { - "node-fetch": "2.6.7" + "node-fetch": "^2.6.12" } }, "node_modules/@project-serum/anchor/node_modules/superstruct": { @@ -3710,25 +3710,6 @@ "node-fetch": "^2.6.12" } }, - "node_modules/algosdk/node_modules/node-fetch": { - "version": "2.6.12", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.12.tgz", - "integrity": "sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g==", - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, "node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", @@ -6687,9 +6668,9 @@ "license": "MIT" }, "node_modules/node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", "dependencies": { "whatwg-url": "^5.0.0" }, @@ -8386,9 +8367,9 @@ "requires": {} }, "@certusone/wormhole-sdk": { - "version": "0.9.24-beta.0", - "resolved": "https://registry.npmjs.org/@certusone/wormhole-sdk/-/wormhole-sdk-0.9.24-beta.0.tgz", - "integrity": "sha512-SiUd9EAgPM5RfwPJ56I49K4Rgzkc5pVMqXDk2udRX+Q9dbvlaTW4d/Cu1dk+x1n6uSjAjact0pNz19C1yDebLA==", + "version": "0.10.5-beta.3", + "resolved": "https://registry.npmjs.org/@certusone/wormhole-sdk/-/wormhole-sdk-0.10.5-beta.3.tgz", + "integrity": "sha512-Q1IrWYQ/NPpLcuPs3J8MbUeRwBxBOTZFwLs3jahohgUFCQhGuBwhgpv02CdEYBR/iZpgaDrj2Eo3HOe3uNlYVA==", "requires": { "@certusone/wormhole-sdk-proto-web": "0.0.6", "@certusone/wormhole-sdk-wasm": "^0.0.1", @@ -8444,9 +8425,9 @@ "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" }, "protobufjs": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.3.tgz", - "integrity": "sha512-TtpvOqwB5Gdz/PQmOjgsrGH1nHjAQVCN7JG4A6r1sXRWESL5rNMAiRcBQlCAdKxZcAbstExQePYG8xof/JVRgg==", + "version": "7.2.5", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.5.tgz", + "integrity": "sha512-gGXRSXvxQ7UiPgfw8gevrfRWcTlSbOFg+p/N+JVJEK5VhueL2miT6qTymqAmjr1Q5WbOCyJbyrk6JfWKwlFn6A==", "requires": { "@protobufjs/aspromise": "^1.1.2", "@protobufjs/base64": "^1.1.2", @@ -10288,11 +10269,11 @@ }, "dependencies": { "cross-fetch": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.5.tgz", - "integrity": "sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==", + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.8.tgz", + "integrity": "sha512-cvA+JwZoU0Xq+h6WkMvAUqPEYy92Obet6UdKLfW60qn99ftItKjB5T+BkyWOFWe2pUyfQ+IJHmpOTznqk1M6Kg==", "requires": { - "node-fetch": "2.6.7" + "node-fetch": "^2.6.12" } }, "superstruct": { @@ -10891,14 +10872,6 @@ "requires": { "node-fetch": "^2.6.12" } - }, - "node-fetch": { - "version": "2.6.12", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.12.tgz", - "integrity": "sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g==", - "requires": { - "whatwg-url": "^5.0.0" - } } } }, @@ -13396,9 +13369,9 @@ "version": "2.0.2" }, "node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", "requires": { "whatwg-url": "^5.0.0" } diff --git a/clients/js/package.json b/clients/js/package.json index 9868d29f64..910afc7f51 100644 --- a/clients/js/package.json +++ b/clients/js/package.json @@ -30,7 +30,7 @@ ], "dependencies": { "@celo-tools/celo-ethers-wrapper": "^0.1.0", - "@certusone/wormhole-sdk": "^0.9.24-beta.0", + "@certusone/wormhole-sdk": "^0.10.5-beta.3", "@cosmjs/encoding": "^0.26.2", "@improbable-eng/grpc-web-node-http-transport": "^0.15.0", "@injectivelabs/networks": "^1.10.7", diff --git a/clients/js/src/chains/generic/getOriginalAsset.ts b/clients/js/src/chains/generic/getOriginalAsset.ts index 515bd4c4a1..36b98db7c2 100644 --- a/clients/js/src/chains/generic/getOriginalAsset.ts +++ b/clients/js/src/chains/generic/getOriginalAsset.ts @@ -110,6 +110,10 @@ export const getOriginalAsset = async ( case "osmosis": case "pythnet": case "wormchain": + case "cosmoshub": + case "evmos": + case "kujira": + case "rootstock": throw new Error(`${chainName} not supported`); default: impossible(chainName); diff --git a/clients/js/src/chains/generic/getWrappedAssetAddress.ts b/clients/js/src/chains/generic/getWrappedAssetAddress.ts index 894042897a..04046b069b 100644 --- a/clients/js/src/chains/generic/getWrappedAssetAddress.ts +++ b/clients/js/src/chains/generic/getWrappedAssetAddress.ts @@ -156,6 +156,10 @@ export const getWrappedAssetAddress = async ( case "osmosis": case "pythnet": case "wormchain": + case "cosmoshub": + case "evmos": + case "kujira": + case "rootstock": throw new Error(`${chainName} not supported`); default: impossible(chainName); diff --git a/clients/js/src/chains/generic/provider.ts b/clients/js/src/chains/generic/provider.ts index cf4b7d3473..a1390c9490 100644 --- a/clients/js/src/chains/generic/provider.ts +++ b/clients/js/src/chains/generic/provider.ts @@ -154,6 +154,10 @@ export const getProviderForChain = ( case "osmosis": case "pythnet": case "wormchain": + case "cosmoshub": + case "evmos": + case "kujira": + case "rootstock": throw new Error(`${chainName} not supported`); default: impossible(chainName); diff --git a/clients/js/src/cmds/generate.ts b/clients/js/src/cmds/generate.ts index 5d6b6e0aa6..e59530660c 100644 --- a/clients/js/src/cmds/generate.ts +++ b/clients/js/src/cmds/generate.ts @@ -311,8 +311,6 @@ function parseAddress(chain: ChainName, address: string): string { return "0x" + evm_address(address); } else if (chain === "near") { return "0x" + evm_address(address); - } else if (chain === "osmosis") { - throw Error("OSMOSIS is not supported yet"); } else if (chain === "sui") { return "0x" + evm_address(address); } else if (chain === "aptos") { @@ -321,10 +319,16 @@ function parseAddress(chain: ChainName, address: string): string { } return sha3_256(Buffer.from(address)); // address is hash of fully qualified type - } else if (chain === "wormchain") { - return "0x" + tryNativeToHexString(address, chain); } else if (chain === "btc") { throw Error("btc is not supported yet"); + } else if (chain === "cosmoshub") { + throw Error("cosmoshub is not supported yet"); + } else if (chain === "evmos") { + throw Error("evmos is not supported yet"); + } else if (chain === "kujira") { + throw Error("kujira is not supported yet"); + } else if (chain === "rootstock") { + throw Error("rootstock is not supported yet"); } else { impossible(chain); } diff --git a/clients/js/src/cmds/status.ts b/clients/js/src/cmds/status.ts index b4f1c18263..b9a4d45e8f 100644 --- a/clients/js/src/cmds/status.ts +++ b/clients/js/src/cmds/status.ts @@ -29,14 +29,6 @@ export const builder = (y: typeof yargs) => describe: "Source transaction hash", type: "string", demandOption: true, - } as const) - .positional("block-start", { - describe: "Starting Block Range, i.e. -2048", - type: "string", - } as const) - .positional("block-end", { - describe: "Ending Block Range, i.e. latest", - type: "string", } as const); export const handler = async ( argv: Awaited["argv"]> @@ -59,39 +51,16 @@ export const handler = async ( targetChainProviders.set( key as ChainName, new ethers.providers.JsonRpcProvider( - NETWORKS[network][key as ChainName].rpc + NETWORKS[network as Network][key as ChainName].rpc ) ); } - const targetChainBlockRanges = new Map< - ChainName, - [ethers.providers.BlockTag, ethers.providers.BlockTag] - >(); - const getBlockTag = (tagString: string): ethers.providers.BlockTag => { - if (+tagString) return parseInt(tagString); - return tagString; - }; - for (const key in NETWORKS[network]) { - targetChainBlockRanges.set(key as ChainName, [ - getBlockTag(argv["block-start"] || "-2048"), - getBlockTag(argv["block-end"] || "latest"), - ]); - } const info = await relayer.getWormholeRelayerInfo(chain, argv.tx, { environment: network, sourceChainProvider, targetChainProviders, - targetChainBlockRanges, }); console.log(relayer.stringifyWormholeRelayerInfo(info)); - if ( - info.targetChainStatus.events[0].status === - relayer.DeliveryStatus.DeliveryDidntHappenWithinRange - ) { - console.log( - "Try using the '--block-start' and '--block-end' flags to specify a different block range" - ); - } }; diff --git a/clients/js/src/cmds/submit.ts b/clients/js/src/cmds/submit.ts index bf1a12bc7c..8d9e4eef07 100644 --- a/clients/js/src/cmds/submit.ts +++ b/clients/js/src/cmds/submit.ts @@ -184,6 +184,14 @@ async function executeSubmit( throw Error("Wormchain is not supported yet"); } else if (chain === "btc") { throw Error("btc is not supported yet"); + } else if (chain === "cosmoshub") { + throw Error("Cosmoshub is not supported yet"); + } else if (chain === "evmos") { + throw Error("Evmos is not supported yet"); + } else if (chain === "kujira") { + throw Error("kujira is not supported yet"); + } else if (chain === "rootstock") { + throw Error("rootstock is not supported yet"); } else { // If you get a type error here, hover over `chain`'s type and it tells you // which cases are not handled diff --git a/clients/js/src/cmds/transfer.ts b/clients/js/src/cmds/transfer.ts index f12b30d246..788be3a978 100644 --- a/clients/js/src/cmds/transfer.ts +++ b/clients/js/src/cmds/transfer.ts @@ -138,6 +138,14 @@ export const handler = async ( throw Error("Wormchain is not supported yet"); } else if (srcChain === "btc") { throw Error("btc is not supported yet"); + } else if (srcChain === "cosmoshub") { + throw Error("cosmoshub is not supported yet"); + } else if (srcChain === "evmos") { + throw Error("evmos is not supported yet"); + } else if (srcChain === "kujira") { + throw Error("kujira is not supported yet"); + } else if (srcChain === "rootstock") { + throw Error("rootstock is not supported yet"); } else { // If you get a type error here, hover over `chain`'s type and it tells you // which cases are not handled diff --git a/clients/js/src/consts/networks.ts b/clients/js/src/consts/networks.ts index e10ae62471..fec5e16ed6 100644 --- a/clients/js/src/consts/networks.ts +++ b/clients/js/src/consts/networks.ts @@ -178,6 +178,21 @@ const MAINNET = { key: undefined, chain_id: undefined, }, + cosmoshub: { + rpc: undefined, + key: undefined, + chain_id: undefined, + }, + evmos: { + rpc: undefined, + key: undefined, + chain_id: undefined, + }, + kujira: { + rpc: undefined, + key: undefined, + chain_id: undefined, + }, }; const TESTNET = { @@ -343,6 +358,21 @@ const TESTNET = { key: getEnvVar("ETH_KEY_TESTNET"), chain_id: 31, }, + cosmoshub: { + rpc: undefined, + key: undefined, + chain_id: undefined, + }, + evmos: { + rpc: undefined, + key: undefined, + chain_id: undefined, + }, + kujira: { + rpc: undefined, + key: undefined, + chain_id: undefined, + }, }; const DEVNET = { @@ -488,6 +518,18 @@ const DEVNET = { rpc: undefined, key: undefined, }, + cosmoshub: { + rpc: undefined, + key: undefined, + }, + evmos: { + rpc: undefined, + key: undefined, + }, + kujira: { + rpc: undefined, + key: undefined, + }, }; /**