From 8d144ed81076ad04952a20f9a6a4fbf05a0c9727 Mon Sep 17 00:00:00 2001 From: Paul Noel Date: Thu, 23 May 2024 12:09:52 -0500 Subject: [PATCH] github: change node version of cli to 20 --- .github/workflows/build.yml | 2 +- clients/js/README.md | 58 +- clients/js/info_tests/evm-1.expected | 1 + clients/js/info_tests/evm-1.test | 1 + clients/js/info_tests/generate-1.expected | 1 + clients/js/info_tests/generate-1.test | 1 + clients/js/info_tests/generate-2.expected | 1 + clients/js/info_tests/generate-2.test | 1 + clients/js/info_tests/info-1.expected | 69 + clients/js/info_tests/info-1.test | 1 + clients/js/info_tests/info-2.expected | 4 + clients/js/info_tests/info-2.test | 1 + clients/js/info_tests/info-3.expected | 1 + clients/js/info_tests/info-3.test | 1 + clients/js/info_tests/info-4.expected | 1 + clients/js/info_tests/info-4.test | 1 + clients/js/info_tests/info-5.expected | 1 + clients/js/info_tests/info-5.test | 1 + clients/js/info_tests/info-6.expected | 1 + clients/js/info_tests/info-6.test | 1 + clients/js/info_tests/info-7.expected | 5 + clients/js/info_tests/info-7.test | 1 + clients/js/package-lock.json | 1268 ++++++------- clients/js/package.json | 4 +- clients/js/run_info_tests | 69 + clients/js/src/algorand.ts | 41 +- clients/js/src/aptos.ts | 17 +- .../js/src/chains/generic/getOriginalAsset.ts | 53 +- .../chains/generic/getWrappedAssetAddress.ts | 2 +- clients/js/src/chains/generic/provider.ts | 1 - clients/js/src/chains/sei/submit.ts | 5 - clients/js/src/chains/sui/submit.ts | 11 +- clients/js/src/chains/sui/transfer.ts | 2 +- clients/js/src/chains/sui/utils.ts | 128 +- clients/js/src/cmds/aptos.ts | 12 +- clients/js/src/cmds/chains.ts | 12 + clients/js/src/cmds/evm.ts | 21 +- clients/js/src/cmds/generate.ts | 34 +- clients/js/src/cmds/index.ts | 2 + clients/js/src/cmds/info/chainId.ts | 13 +- clients/js/src/cmds/info/contract.ts | 12 +- clients/js/src/cmds/info/emitter.ts | 9 +- clients/js/src/cmds/info/origin.ts | 20 +- clients/js/src/cmds/info/registrations.ts | 5 +- clients/js/src/cmds/info/rpc.ts | 11 +- clients/js/src/cmds/info/wrapped.ts | 22 +- clients/js/src/cmds/status.ts | 95 +- clients/js/src/cmds/submit.ts | 33 +- clients/js/src/cmds/sui/setup.ts | 38 +- clients/js/src/cmds/transfer.ts | 26 +- clients/js/src/consts/contracts.ts | 56 - clients/js/src/emitter.ts | 35 +- clients/js/src/evm.ts | 2 +- clients/js/src/injective.ts | 2 +- clients/js/src/near.ts | 41 +- clients/js/src/parse_tests.test.ts | 1659 +++++++++++++++++ clients/js/src/{ => sdk}/array.ts | 253 +-- clients/js/src/sdk/sui.ts | 130 ++ clients/js/src/solana.ts | 7 +- clients/js/src/terra.ts | 2 +- clients/js/src/tests.ts.test | 76 - clients/js/src/utils.ts | 4 +- clients/js/src/xpla.ts | 2 +- scripts/guardian-set-init.sh | 28 +- 64 files changed, 2813 insertions(+), 1605 deletions(-) create mode 100644 clients/js/info_tests/evm-1.expected create mode 100644 clients/js/info_tests/evm-1.test create mode 100644 clients/js/info_tests/generate-1.expected create mode 100644 clients/js/info_tests/generate-1.test create mode 100644 clients/js/info_tests/generate-2.expected create mode 100644 clients/js/info_tests/generate-2.test create mode 100644 clients/js/info_tests/info-1.expected create mode 100644 clients/js/info_tests/info-1.test create mode 100644 clients/js/info_tests/info-2.expected create mode 100644 clients/js/info_tests/info-2.test create mode 100644 clients/js/info_tests/info-3.expected create mode 100644 clients/js/info_tests/info-3.test create mode 100644 clients/js/info_tests/info-4.expected create mode 100644 clients/js/info_tests/info-4.test create mode 100644 clients/js/info_tests/info-5.expected create mode 100644 clients/js/info_tests/info-5.test create mode 100644 clients/js/info_tests/info-6.expected create mode 100644 clients/js/info_tests/info-6.test create mode 100644 clients/js/info_tests/info-7.expected create mode 100644 clients/js/info_tests/info-7.test create mode 100755 clients/js/run_info_tests create mode 100644 clients/js/src/cmds/chains.ts create mode 100644 clients/js/src/parse_tests.test.ts rename clients/js/src/{ => sdk}/array.ts (51%) create mode 100644 clients/js/src/sdk/sui.ts delete mode 100644 clients/js/src/tests.ts.test diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b6e13df832..115fa008ed 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -244,7 +244,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: - node-version: "16" + node-version: "20" - run: | cd clients/js && make test make docs diff --git a/clients/js/README.md b/clients/js/README.md index 35b414e8bb..2e3bd44bf4 100644 --- a/clients/js/README.md +++ b/clients/js/README.md @@ -78,6 +78,16 @@ Options: ``` +
+ chains + +```sh +Options: + --help Show help [boolean] + --version Show version number [boolean] +``` +
+
edit-vaa @@ -248,16 +258,8 @@ Positionals: Options: --help Show help [boolean] --version Show version number [boolean] - -c, --chain chain name - [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", "rootstock", "scroll", "mantle", "blast", - "xlayer", "linea", "berachain", "seievm", "wormchain", "cosmoshub", "evmos", - "kujira", "neutron", "celestia", "stargaze", "seda", "dymension", - "provenance", "sepolia", "arbitrum_sepolia", "base_sepolia", - "optimism_sepolia", "holesky", "polygon_sepolia"] + -c, --chain chain name. To see a list of supported chains, run + `worm chains` [string] -n, --network Network [required] [choices: "mainnet", "testnet", "devnet"] -a, --contract-address Contract to submit VAA to (override config) [string] @@ -307,26 +309,10 @@ Options: Options: --help Show help [boolean] --version Show version number [boolean] - --src-chain source 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", "rootstock", "scroll", "mantle", "blast", - "xlayer", "linea", "berachain", "seievm", "wormchain", "cosmoshub", "evmos", - "kujira", "neutron", "celestia", "stargaze", "seda", "dymension", - "provenance", "sepolia", "arbitrum_sepolia", "base_sepolia", - "optimism_sepolia", "holesky", "polygon_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", "rootstock", "scroll", "mantle", "blast", - "xlayer", "linea", "berachain", "seievm", "wormchain", "cosmoshub", "evmos", - "kujira", "neutron", "celestia", "stargaze", "seda", "dymension", - "provenance", "sepolia", "arbitrum_sepolia", "base_sepolia", - "optimism_sepolia", "holesky", "polygon_sepolia"] + --src-chain source chain. To see a list of supported chains, run `worm + chains` [string] [required] + --dst-chain destination chain. To see a list of supported chains, run + `worm chains` [string] [required] --dst-addr destination address [string] [required] --token-addr token address [string] [default: native token] --amount token amount [string] [required] @@ -353,16 +339,8 @@ Options: ```sh Positionals: 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", "rootstock", "scroll", "mantle", "blast", - "xlayer", "linea", "berachain", "seievm", "wormchain", "cosmoshub", "evmos", - "kujira", "neutron", "celestia", "stargaze", "seda", "dymension", - "provenance", "sepolia", "arbitrum_sepolia", "base_sepolia", - "optimism_sepolia", "holesky", "polygon_sepolia"] + chain Source chain. To see a list of supported chains, run `worm chains` + [string] tx Source transaction hash [string] Options: diff --git a/clients/js/info_tests/evm-1.expected b/clients/js/info_tests/evm-1.expected new file mode 100644 index 0000000000..e956c7e72b --- /dev/null +++ b/clients/js/info_tests/evm-1.expected @@ -0,0 +1 @@ +0xbeFA429d57cD18b7F8A4d91A2da9AB4AF05d0FBe diff --git a/clients/js/info_tests/evm-1.test b/clients/js/info_tests/evm-1.test new file mode 100644 index 0000000000..a89316fdf5 --- /dev/null +++ b/clients/js/info_tests/evm-1.test @@ -0,0 +1 @@ +evm address-from-secret 0xcfb12303a19cde580bb4dd771639b0d26bc68353645571a8cff516ab2ee113a0 diff --git a/clients/js/info_tests/generate-1.expected b/clients/js/info_tests/generate-1.expected new file mode 100644 index 0000000000..12bdc68f83 --- /dev/null +++ b/clients/js/info_tests/generate-1.expected @@ -0,0 +1 @@ +0100000000010009b7c0612e950779ea6a5458800289925c02a32cca3670f497693df283b503177e757473f94adfa2d18745b9e3d01a04f6b97240459612bd8654e5f91fb3f3d5010000000100000001000100000000000000000000000000000000000000000000000000000000000000040000000005a657f60000000000000000000000000000000000000000000000004e46544272696467650100000004000000000000000000000000706abc4e45d419950511e474c7b9ed348a4a716c diff --git a/clients/js/info_tests/generate-1.test b/clients/js/info_tests/generate-1.test new file mode 100644 index 0000000000..0165371bbf --- /dev/null +++ b/clients/js/info_tests/generate-1.test @@ -0,0 +1 @@ +generate registration --module NFTBridge --chain bsc --contract-address 0x706abc4E45D419950511e474C7B9Ed348A4a716c --guardian-secret cfb12303a19cde580bb4dd771639b0d26bc68353645571a8cff516ab2ee113a0 diff --git a/clients/js/info_tests/generate-2.expected b/clients/js/info_tests/generate-2.expected new file mode 100644 index 0000000000..907c7d903c --- /dev/null +++ b/clients/js/info_tests/generate-2.expected @@ -0,0 +1 @@ +01000000000100fe357dfbb2661d594da7720bf919bcb5597776c20720065c38748a7f69bc59e30b1a3a9ed564418083162c2f9f12910a799699faafe75494ba68b5813ae4a19a0000000001000000010002000000000000000000000000000000001111111111111111111111111111111500000000051d2e300002000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800020655534443000000000000000000000000000000000000000000000000000000005553444300000000000000000000000000000000000000000000000000000000 diff --git a/clients/js/info_tests/generate-2.test b/clients/js/info_tests/generate-2.test new file mode 100644 index 0000000000..845360ed7e --- /dev/null +++ b/clients/js/info_tests/generate-2.test @@ -0,0 +1 @@ +generate attestation --emitter-chain Ethereum --emitter-address 11111111111111111111111111111115 --chain Ethereum --token-address 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 --decimals 6 --symbol USDC --name USDC --guardian-secret cfb12303a19cde580bb4dd771639b0d26bc68353645571a8cff516ab2ee113a0 diff --git a/clients/js/info_tests/info-1.expected b/clients/js/info_tests/info-1.expected new file mode 100644 index 0000000000..4bacd0ac05 --- /dev/null +++ b/clients/js/info_tests/info-1.expected @@ -0,0 +1,69 @@ +{ + "address": "0xB6F6D86a8f9879A9c87f643768d9efc38c1Da6E7", + "wormhole": "0x98f3c9e6E3fAce36bAAd05FE09d375Ef1464288B", + "implementation": "0x621199f6beB2ba6fbD962E8A52A320EA4F6D4aA3", + "isInitialized": true, + "tokenImplementation": "0x7f8C5e730121657E17E452c5a1bA3fA1eF96f22a", + "chainId": 4, + "finality": 15, + "evmChainId": "56", + "isFork": false, + "governanceChainId": 1, + "governanceContract": "0x0000000000000000000000000000000000000000000000000000000000000004", + "WETH": "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c", + "registrations": { + "Solana": "0xec7372995d5cc8732397fb0ad35c0121e0eaa90d26f828a534cab54391b3a4f5", + "Ethereum": "0x0000000000000000000000003ee18b2214aff97000d974cf647e7c347e8fa585", + "Terra": "0x0000000000000000000000007cf7b764e38a0a5e967972c1df77d432510564e2", + "Polygon": "0x0000000000000000000000005a58505a96d1dbf8df91cb21b54419fc36e93fde", + "Avalanche": "0x0000000000000000000000000e082f06ff657d94310cb8ce8b0d9a04541d8052", + "Oasis": "0x0000000000000000000000005848c791e09901b40a9ef749f2a6735b418d7564", + "Algorand": "0x67e93fa6c8ac5c819990aa7340c0c16b508abb1178be9b30d024b8ac25193d45", + "Aurora": "0x00000000000000000000000051b5123a7b0f9b2ba265f9c4c8de7d78d52f510f", + "Fantom": "0x0000000000000000000000007c9fc5741288cdfdd83ceb07f3ea7e22618d79d2", + "Karura": "0x000000000000000000000000ae9d7fe007b3327aa64a32824aaac52c42a6e624", + "Acala": "0x000000000000000000000000ae9d7fe007b3327aa64a32824aaac52c42a6e624", + "Klaytn": "0x0000000000000000000000005b08ac39eaed75c0439fc750d9fe7e1f9dd0193f", + "Celo": "0x000000000000000000000000796dff6d74f3e27060b71255fe517bfb23c93eed", + "Near": "0x148410499d3fcda4dcfd68a1ebfcdddda16ab28326448d4aae4d2f0465cdfcb7", + "Moonbeam": "0x000000000000000000000000b1731c586ca89a23809861c6103f0b96b3f57d92", + "Neon": "0x0000000000000000000000000000000000000000000000000000000000000000", + "Terra2": "0xa463ad028fb79679cfc8ce1efba35ac0e77b35080a1abe9bebe83461f176b0a3", + "Injective": "0x00000000000000000000000045dbea4617971d93188eda21530bc6503d153313", + "Osmosis": "0x0000000000000000000000000000000000000000000000000000000000000000", + "Sui": "0xccceeb29348f71bdd22ffef43a2a19c1f5b5e17c5cca5411529120182672ade5", + "Aptos": "0x0000000000000000000000000000000000000000000000000000000000000001", + "Arbitrum": "0x0000000000000000000000000b2402144bb366a632d14b83f244d2e0e21bd39c", + "Optimism": "0x0000000000000000000000001d68124e65fafc907325e3edbf8c4d84499daa8b", + "Gnosis": "0x0000000000000000000000000000000000000000000000000000000000000000", + "Pythnet": "0x0000000000000000000000000000000000000000000000000000000000000000", + "Xpla": "0x8f9cf727175353b17a5f574270e370776123d90fd74956ae4277962b4fdee24c", + "Btc": "0x0000000000000000000000000000000000000000000000000000000000000000", + "Base": "0x0000000000000000000000008d2de8d2f73f1f4cab472ac9a881c9b123c79627", + "Sei": "0x86c5fd957e2db8389553e1728f9c27964b22a8154091ccba54d75f4b10c61f5e", + "Rootstock": "0x0000000000000000000000000000000000000000000000000000000000000000", + "Scroll": "0x00000000000000000000000024850c6f61c438823f01b7a3bf2b89b72174fa9d", + "Mantle": "0x00000000000000000000000024850c6f61c438823f01b7a3bf2b89b72174fa9d", + "Blast": "0x00000000000000000000000024850c6f61c438823f01b7a3bf2b89b72174fa9d", + "Xlayer": "0x0000000000000000000000005537857664b0f9efe38c9f320f75fef23234d904", + "Linea": "0x0000000000000000000000000000000000000000000000000000000000000000", + "Berachain": "0x0000000000000000000000000000000000000000000000000000000000000000", + "Seievm": "0x0000000000000000000000000000000000000000000000000000000000000000", + "Wormchain": "0xaeb534c45c3049d380b9d9b966f9895f53abd4301bfaff407fa09dea8ae7a924", + "Cosmoshub": "0x0000000000000000000000000000000000000000000000000000000000000000", + "Evmos": "0x0000000000000000000000000000000000000000000000000000000000000000", + "Kujira": "0x0000000000000000000000000000000000000000000000000000000000000000", + "Neutron": "0x0000000000000000000000000000000000000000000000000000000000000000", + "Celestia": "0x0000000000000000000000000000000000000000000000000000000000000000", + "Stargaze": "0x0000000000000000000000000000000000000000000000000000000000000000", + "Seda": "0x0000000000000000000000000000000000000000000000000000000000000000", + "Dymension": "0x0000000000000000000000000000000000000000000000000000000000000000", + "Provenance": "0x0000000000000000000000000000000000000000000000000000000000000000", + "Sepolia": "0x0000000000000000000000000000000000000000000000000000000000000000", + "ArbitrumSepolia": "0x0000000000000000000000000000000000000000000000000000000000000000", + "BaseSepolia": "0x0000000000000000000000000000000000000000000000000000000000000000", + "OptimismSepolia": "0x0000000000000000000000000000000000000000000000000000000000000000", + "Holesky": "0x0000000000000000000000000000000000000000000000000000000000000000", + "PolygonSepolia": "0x0000000000000000000000000000000000000000000000000000000000000000" + } +} diff --git a/clients/js/info_tests/info-1.test b/clients/js/info_tests/info-1.test new file mode 100644 index 0000000000..03cb8d6ac5 --- /dev/null +++ b/clients/js/info_tests/info-1.test @@ -0,0 +1 @@ +evm info -c Bsc -n mainnet -m TokenBridge diff --git a/clients/js/info_tests/info-2.expected b/clients/js/info_tests/info-2.expected new file mode 100644 index 0000000000..fe313e8876 --- /dev/null +++ b/clients/js/info_tests/info-2.expected @@ -0,0 +1,4 @@ +Mismatches found on Ethereum Mainnet! +{ + Mantle: 'Expected null , found 0x00000000000000000000000024850c6f61c438823f01b7a3bf2b89b72174fa9d' +} diff --git a/clients/js/info_tests/info-2.test b/clients/js/info_tests/info-2.test new file mode 100644 index 0000000000..a30a259399 --- /dev/null +++ b/clients/js/info_tests/info-2.test @@ -0,0 +1 @@ +info registrations mainnet ethereum TokenBridge -v diff --git a/clients/js/info_tests/info-3.expected b/clients/js/info_tests/info-3.expected new file mode 100644 index 0000000000..8c7afd0783 --- /dev/null +++ b/clients/js/info_tests/info-3.expected @@ -0,0 +1 @@ +0x3ee18B2214AFF97000D974cf647E7C347E8fa585 diff --git a/clients/js/info_tests/info-3.test b/clients/js/info_tests/info-3.test new file mode 100644 index 0000000000..279cde6795 --- /dev/null +++ b/clients/js/info_tests/info-3.test @@ -0,0 +1 @@ +info contract mainnet ethereum TokenBridge diff --git a/clients/js/info_tests/info-4.expected b/clients/js/info_tests/info-4.expected new file mode 100644 index 0000000000..d329f3aa5d --- /dev/null +++ b/clients/js/info_tests/info-4.expected @@ -0,0 +1 @@ +0x5a58505a96D1dbf8dF91cB21B54419FC36e93fdE diff --git a/clients/js/info_tests/info-4.test b/clients/js/info_tests/info-4.test new file mode 100644 index 0000000000..d08d2430a8 --- /dev/null +++ b/clients/js/info_tests/info-4.test @@ -0,0 +1 @@ +info contract mainnet Bsc NFTBridge diff --git a/clients/js/info_tests/info-5.expected b/clients/js/info_tests/info-5.expected new file mode 100644 index 0000000000..ec428ce8dc --- /dev/null +++ b/clients/js/info_tests/info-5.expected @@ -0,0 +1 @@ +https://bsc-dataseed.binance.org/ diff --git a/clients/js/info_tests/info-5.test b/clients/js/info_tests/info-5.test new file mode 100644 index 0000000000..2d1faa1e90 --- /dev/null +++ b/clients/js/info_tests/info-5.test @@ -0,0 +1 @@ +info rpc mainnet Bsc diff --git a/clients/js/info_tests/info-6.expected b/clients/js/info_tests/info-6.expected new file mode 100644 index 0000000000..2fbf043b68 --- /dev/null +++ b/clients/js/info_tests/info-6.expected @@ -0,0 +1 @@ +0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN diff --git a/clients/js/info_tests/info-6.test b/clients/js/info_tests/info-6.test new file mode 100644 index 0000000000..ca4847410c --- /dev/null +++ b/clients/js/info_tests/info-6.test @@ -0,0 +1 @@ +info wrapped ethereum 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 sui diff --git a/clients/js/info_tests/info-7.expected b/clients/js/info_tests/info-7.expected new file mode 100644 index 0000000000..761f667074 --- /dev/null +++ b/clients/js/info_tests/info-7.expected @@ -0,0 +1,5 @@ +{ + isWrapped: true, + chainId: 2, + assetAddress: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' +} diff --git a/clients/js/info_tests/info-7.test b/clients/js/info_tests/info-7.test new file mode 100644 index 0000000000..b16ff6568b --- /dev/null +++ b/clients/js/info_tests/info-7.test @@ -0,0 +1 @@ +info origin sui 0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN diff --git a/clients/js/package-lock.json b/clients/js/package-lock.json index a50f4071f1..e0bb8fc086 100644 --- a/clients/js/package-lock.json +++ b/clients/js/package-lock.json @@ -22,7 +22,7 @@ "@solana/web3.js": "^1.22.0", "@terra-money/terra.js": "^3.1.9", "@types/config": "^3.3.0", - "@wormhole-foundation/sdk": "^0.6.7", + "@wormhole-foundation/sdk": "^0.7.0-beta.5", "@xpla/xpla.js": "^0.2.1", "algosdk": "^2.4.0", "aptos": "^1.3.16", @@ -57,7 +57,7 @@ "jest": "^29.7.0", "ts-jest": "^29.1.2", "tsx": "^4.12.0", - "typescript": "^4.6" + "typescript": "^5.4.5" } }, "node_modules/@0no-co/graphql.web": { @@ -73,6 +73,19 @@ } } }, + "node_modules/@0no-co/graphqlsp": { + "version": "1.12.5", + "resolved": "https://registry.npmjs.org/@0no-co/graphqlsp/-/graphqlsp-1.12.5.tgz", + "integrity": "sha512-YS9s8sf3XLaVdBt33u1mbUdfUSLiarQW1SFd3ITh2CLWz1nVnVTN0oCrpepuFHUJ7rt+b6Gk14sgjP4ONdeZfQ==", + "dependencies": { + "@gql.tada/internal": "^1.0.0", + "graphql": "^15.5.0 || ^16.0.0 || ^17.0.0" + }, + "peerDependencies": { + "graphql": "^15.5.0 || ^16.0.0 || ^17.0.0", + "typescript": "^5.0.0" + } + }, "node_modules/@adraffy/ens-normalize": { "version": "1.10.1", "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.10.1.tgz", @@ -1175,6 +1188,16 @@ "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.29.5.tgz", "integrity": "sha512-m7h+RXDUxOzEOGt4P+3OVPX7PuakZT3GBmaM/Y2u+abN3xZkziykD/NvedYFvvCCdQo714XcGl33bwifS9FZPQ==" }, + "node_modules/@ensdomains/ens-validation": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@ensdomains/ens-validation/-/ens-validation-0.1.0.tgz", + "integrity": "sha512-rbDh2K6GfqXvBcJUISaTTYEt3f079WA4ohTE5Lh4/8EaaPAk/9vk3EisMUQV2UVxeFIZQEEyRCIOmRTpqN0W7A==" + }, + "node_modules/@ensdomains/eth-ens-namehash": { + "version": "2.0.15", + "resolved": "https://registry.npmjs.org/@ensdomains/eth-ens-namehash/-/eth-ens-namehash-2.0.15.tgz", + "integrity": "sha512-JRDFP6+Hczb1E0/HhIg0PONgBYasfGfDheujmfxaZaAv/NAH4jE6Kf48WbqfRZdxt4IZI3jl3Ri7sZ1nP09lgw==" + }, "node_modules/@esbuild/aix-ppc64": { "version": "0.20.2", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.2.tgz", @@ -2235,6 +2258,35 @@ "@ethersproject/strings": "^5.7.0" } }, + "node_modules/@gql.tada/cli-utils": { + "version": "1.3.9", + "resolved": "https://registry.npmjs.org/@gql.tada/cli-utils/-/cli-utils-1.3.9.tgz", + "integrity": "sha512-oRb7SG/+csx9CiypSJTI21KaLfulOUnhX1vxg4FXi2snub9XShkGR2XnnlJVTAOZXY9Vcxti1NutAElxdDkycA==", + "dependencies": { + "@0no-co/graphqlsp": "^1.12.1", + "@gql.tada/internal": "1.0.0", + "@vue/compiler-dom": "^3.4.23", + "@vue/language-core": "^2.0.17", + "graphql": "^15.5.0 || ^16.0.0 || ^17.0.0", + "svelte2tsx": "^0.7.6" + }, + "peerDependencies": { + "graphql": "^15.5.0 || ^16.0.0 || ^17.0.0", + "typescript": "^5.0.0" + } + }, + "node_modules/@gql.tada/internal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@gql.tada/internal/-/internal-1.0.0.tgz", + "integrity": "sha512-B55aIYyZn5ewdgMqoJciPAwF5DKYX6HBabTU+ap/dpNH3EgJrLomc8Y8w+MCxCyOx+dXL9OduT6eWnVr7J7Eyg==", + "dependencies": { + "@0no-co/graphql.web": "^1.0.5" + }, + "peerDependencies": { + "graphql": "^15.5.0 || ^16.0.0 || ^17.0.0", + "typescript": "^5.0.0" + } + }, "node_modules/@graphql-typed-document-node/core": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/@graphql-typed-document-node/core/-/core-3.2.0.tgz", @@ -2318,9 +2370,9 @@ "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" }, "node_modules/@injectivelabs/dmm-proto-ts/node_modules/protobufjs": { - "version": "7.2.6", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.6.tgz", - "integrity": "sha512-dgJaEDDL6x8ASUZ1YqWciTRrdOuYNzoOf27oHNfdyvKqHr5i0FV7FSLU+aIeFjyFgVxrpTOtQUi0BLLBymZaBw==", + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.3.0.tgz", + "integrity": "sha512-YWD03n3shzV9ImZRX3ccbjqLxj7NokGN0V/ESiBV5xWqrommYHYiihuIyavq03pWSGqlyvYUFmfoMKd+1rPA/g==", "hasInstallScript": true, "dependencies": { "@protobufjs/aspromise": "^1.1.2", @@ -4510,17 +4562,17 @@ "dev": true }, "node_modules/@volar/language-core": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/@volar/language-core/-/language-core-2.2.4.tgz", - "integrity": "sha512-7As47GndxGxsqqYnbreLrfB5NDUeQioPM2LJKUuB4/34c0NpEJ2byVl3c9KYdjIdiEstWZ9JLtLKNTaPWb5jtA==", + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/@volar/language-core/-/language-core-2.2.5.tgz", + "integrity": "sha512-2htyAuxRrAgETmFeUhT4XLELk3LiEcqoW/B8YUXMF6BrGWLMwIR09MFaZYvrA2UhbdAeSyeQ726HaWSWkexUcQ==", "dependencies": { - "@volar/source-map": "2.2.4" + "@volar/source-map": "2.2.5" } }, "node_modules/@volar/source-map": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/@volar/source-map/-/source-map-2.2.4.tgz", - "integrity": "sha512-m92FLpR9vB1YEZfiZ+bfgpLrToL/DNkOrorWVep3pffHrwwI4Tx2oIQN+sqHJfKkiT5N3J1owC+8crhAEinfjg==", + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/@volar/source-map/-/source-map-2.2.5.tgz", + "integrity": "sha512-wrOEIiZNf4E+PWB0AxyM4tfhkfldPsb3bxg8N6FHrxJH2ohar7aGu48e98bp3pR9HUA7P/pR9VrLmkTrgCCnWQ==", "dependencies": { "muggle-string": "^0.4.0" } @@ -4596,46 +4648,46 @@ "integrity": "sha512-DL3NmY2OFlqmYYrzp39yi3LDkKxa5vZVwxWdQ3rG0ekuWscHraeIbnI8t+aZK7qhYqEqWKTUdijadunb9pnrgA==" }, "node_modules/@wormhole-foundation/sdk": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk/-/sdk-0.6.7.tgz", - "integrity": "sha512-bGT/z47mDxeoQPdm0ZuzKtllrHgl9WFEvN1Ka8iUsrbZ03/bfyuScgWujbMqmX9kWVzgarnNFrEA5A4OVeLBJw==", - "dependencies": { - "@wormhole-foundation/sdk-algorand": "0.6.7", - "@wormhole-foundation/sdk-algorand-core": "0.6.7", - "@wormhole-foundation/sdk-algorand-tokenbridge": "0.6.7", - "@wormhole-foundation/sdk-aptos": "0.6.7", - "@wormhole-foundation/sdk-aptos-core": "0.6.7", - "@wormhole-foundation/sdk-aptos-tokenbridge": "0.6.7", - "@wormhole-foundation/sdk-base": "0.6.7", - "@wormhole-foundation/sdk-connect": "0.6.7", - "@wormhole-foundation/sdk-cosmwasm": "0.6.7", - "@wormhole-foundation/sdk-cosmwasm-core": "0.6.7", - "@wormhole-foundation/sdk-cosmwasm-ibc": "0.6.7", - "@wormhole-foundation/sdk-cosmwasm-tokenbridge": "0.6.7", - "@wormhole-foundation/sdk-definitions": "0.6.7", - "@wormhole-foundation/sdk-evm": "0.6.7", - "@wormhole-foundation/sdk-evm-cctp": "0.6.7", - "@wormhole-foundation/sdk-evm-core": "0.6.7", - "@wormhole-foundation/sdk-evm-portico": "0.6.7", - "@wormhole-foundation/sdk-evm-tokenbridge": "0.6.7", - "@wormhole-foundation/sdk-solana": "0.6.7", - "@wormhole-foundation/sdk-solana-cctp": "0.6.7", - "@wormhole-foundation/sdk-solana-core": "0.6.7", - "@wormhole-foundation/sdk-solana-tokenbridge": "0.6.7", - "@wormhole-foundation/sdk-sui": "0.6.7", - "@wormhole-foundation/sdk-sui-core": "0.6.7", - "@wormhole-foundation/sdk-sui-tokenbridge": "0.6.7" + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk/-/sdk-0.7.0-beta.5.tgz", + "integrity": "sha512-0IM8xngEghx5Uf3/SnzQeBrOHBONj92GJ6/RETzuvmCx3YkZpy9gFo1ctvD9Ey4MrWbTdQk7qMnpCZOwpldWWw==", + "dependencies": { + "@wormhole-foundation/sdk-algorand": "0.7.0-beta.5", + "@wormhole-foundation/sdk-algorand-core": "0.7.0-beta.5", + "@wormhole-foundation/sdk-algorand-tokenbridge": "0.7.0-beta.5", + "@wormhole-foundation/sdk-aptos": "0.7.0-beta.5", + "@wormhole-foundation/sdk-aptos-core": "0.7.0-beta.5", + "@wormhole-foundation/sdk-aptos-tokenbridge": "0.7.0-beta.5", + "@wormhole-foundation/sdk-base": "0.7.0-beta.5", + "@wormhole-foundation/sdk-connect": "0.7.0-beta.5", + "@wormhole-foundation/sdk-cosmwasm": "0.7.0-beta.5", + "@wormhole-foundation/sdk-cosmwasm-core": "0.7.0-beta.5", + "@wormhole-foundation/sdk-cosmwasm-ibc": "0.7.0-beta.5", + "@wormhole-foundation/sdk-cosmwasm-tokenbridge": "0.7.0-beta.5", + "@wormhole-foundation/sdk-definitions": "0.7.0-beta.5", + "@wormhole-foundation/sdk-evm": "0.7.0-beta.5", + "@wormhole-foundation/sdk-evm-cctp": "0.7.0-beta.5", + "@wormhole-foundation/sdk-evm-core": "0.7.0-beta.5", + "@wormhole-foundation/sdk-evm-portico": "0.7.0-beta.5", + "@wormhole-foundation/sdk-evm-tokenbridge": "0.7.0-beta.5", + "@wormhole-foundation/sdk-solana": "0.7.0-beta.5", + "@wormhole-foundation/sdk-solana-cctp": "0.7.0-beta.5", + "@wormhole-foundation/sdk-solana-core": "0.7.0-beta.5", + "@wormhole-foundation/sdk-solana-tokenbridge": "0.7.0-beta.5", + "@wormhole-foundation/sdk-sui": "0.7.0-beta.5", + "@wormhole-foundation/sdk-sui-core": "0.7.0-beta.5", + "@wormhole-foundation/sdk-sui-tokenbridge": "0.7.0-beta.5" }, "engines": { "node": ">=16" } }, "node_modules/@wormhole-foundation/sdk-algorand": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-algorand/-/sdk-algorand-0.6.7.tgz", - "integrity": "sha512-WRNEAk1rRgPTL0h5xcThNEMAdNC+OHKANPPdrloh08mEYub1AQ7H8iwoW+/xNi7Rbxk/eg+NyH2IINwZrzvqyw==", + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-algorand/-/sdk-algorand-0.7.0-beta.5.tgz", + "integrity": "sha512-DYhinpe/41b8nu+xS9I1KmzUMUIicZYmKWH7Ea5/5KTA6pB8tM3AHTKa54cqb5g6n14VQmfbnHFbGVAUjqSL6g==", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.6.7", + "@wormhole-foundation/sdk-connect": "0.7.0-beta.5", "algosdk": "2.7.0" }, "engines": { @@ -4643,36 +4695,36 @@ } }, "node_modules/@wormhole-foundation/sdk-algorand-core": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-algorand-core/-/sdk-algorand-core-0.6.7.tgz", - "integrity": "sha512-C7GvPsPFHg0rCsYRf2apQfFqigEo2DbFgi8wdEFt4FOnIMwABtpu7x2SuLb540PnaqBsIC7Ainxm7ddBBYJY9Q==", + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-algorand-core/-/sdk-algorand-core-0.7.0-beta.5.tgz", + "integrity": "sha512-AJQEaXIViwwmg/oyn0QjgJEwv2pPbup7qb2C0KTJIPXwx40Cr4Z6jrBrgE387+svJ63+WNNBhJnC5YRl93AuKg==", "dependencies": { - "@wormhole-foundation/sdk-algorand": "0.6.7", - "@wormhole-foundation/sdk-connect": "0.6.7" + "@wormhole-foundation/sdk-algorand": "0.7.0-beta.5", + "@wormhole-foundation/sdk-connect": "0.7.0-beta.5" }, "engines": { "node": ">=16" } }, "node_modules/@wormhole-foundation/sdk-algorand-tokenbridge": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-algorand-tokenbridge/-/sdk-algorand-tokenbridge-0.6.7.tgz", - "integrity": "sha512-iwjcDCG5MY/FszjTYky69fwS2A3xDElMgpp0JP8BiVGwWghGkdZkOBSKbLHXRMLqhsQnzujGmyrSjzgLuw3zWA==", + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-algorand-tokenbridge/-/sdk-algorand-tokenbridge-0.7.0-beta.5.tgz", + "integrity": "sha512-ZozYoS948Aa+iVZWtq3b+xQMSWyh9uEklsQTfDlNLi+72P5Wz6amrweBNnSErxrpG+y/zXa9XqwVBN6grjc2gg==", "dependencies": { - "@wormhole-foundation/sdk-algorand": "0.6.7", - "@wormhole-foundation/sdk-algorand-core": "0.6.7", - "@wormhole-foundation/sdk-connect": "0.6.7" + "@wormhole-foundation/sdk-algorand": "0.7.0-beta.5", + "@wormhole-foundation/sdk-algorand-core": "0.7.0-beta.5", + "@wormhole-foundation/sdk-connect": "0.7.0-beta.5" }, "engines": { "node": ">=16" } }, "node_modules/@wormhole-foundation/sdk-aptos": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-aptos/-/sdk-aptos-0.6.7.tgz", - "integrity": "sha512-fKWbwE8wcYuonNvakgfXUnUFkJ3NanpFIIDhIZs3egQKFpU3BltT4zBShwAj51fEhI5aws0Asc8vGSgcZEgGTQ==", + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-aptos/-/sdk-aptos-0.7.0-beta.5.tgz", + "integrity": "sha512-QhCNBzoqZueTO3g8mYAszm3pogX7LUxl/STfw3xIc1xkxUzyk1Tw1UEzih3r6hObDU4C3S1g7zXM2QS5JMjK1g==", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.6.7", + "@wormhole-foundation/sdk-connect": "0.7.0-beta.5", "aptos": "1.21.0" }, "engines": { @@ -4680,24 +4732,24 @@ } }, "node_modules/@wormhole-foundation/sdk-aptos-core": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-aptos-core/-/sdk-aptos-core-0.6.7.tgz", - "integrity": "sha512-TOmIVmCR8qOwYseQB7CRnjDGOjxeYQXCoXjCR7n2/ohEMbtBGEymvfUAtTyHBpNmqvA8tustlOwB6Lmq80OkjQ==", + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-aptos-core/-/sdk-aptos-core-0.7.0-beta.5.tgz", + "integrity": "sha512-MjO/YULiKGUApDOxd7Ru5qR/D1g3Tx/Y0PAfCfBFaW1COCSeGNnnmUzTmVjE4pWlErvexiRfePZeM5a0FIjNRg==", "dependencies": { - "@wormhole-foundation/sdk-aptos": "0.6.7", - "@wormhole-foundation/sdk-connect": "0.6.7" + "@wormhole-foundation/sdk-aptos": "0.7.0-beta.5", + "@wormhole-foundation/sdk-connect": "0.7.0-beta.5" }, "engines": { "node": ">=16" } }, "node_modules/@wormhole-foundation/sdk-aptos-tokenbridge": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-aptos-tokenbridge/-/sdk-aptos-tokenbridge-0.6.7.tgz", - "integrity": "sha512-rj3Z22Np8wH+e/O3xx6YuwL/3Jef4C+CHoaWEwF7u7HP5jMJ5H33MmwecO9r4HulFjEKt4HgSpSoQBb8WC5tOQ==", + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-aptos-tokenbridge/-/sdk-aptos-tokenbridge-0.7.0-beta.5.tgz", + "integrity": "sha512-xHPeQeUQzTN8ErnNGACsE2JuZ+l0NHB6zvvk6ufc+Hsi7tLqpBf7iqI8MqsP+FbFOoMJnWukw1FkKO8G4Y/TgQ==", "dependencies": { - "@wormhole-foundation/sdk-aptos": "0.6.7", - "@wormhole-foundation/sdk-connect": "0.6.7" + "@wormhole-foundation/sdk-aptos": "0.7.0-beta.5", + "@wormhole-foundation/sdk-connect": "0.7.0-beta.5" }, "engines": { "node": ">=16" @@ -4761,20 +4813,20 @@ } }, "node_modules/@wormhole-foundation/sdk-base": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-base/-/sdk-base-0.6.7.tgz", - "integrity": "sha512-lXN7tm5O8L8nfqXD1Fhn61rTR9WjZ9khRU3tOE3b8AqjX9OxIL9/ou5BmMGaJex8AFAUgnX86pNkEEvu9Tb3hQ==", + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-base/-/sdk-base-0.7.0-beta.5.tgz", + "integrity": "sha512-QMyfGmgg+5V0Qd2SLLXAqSE7nYr2+n/Q/qyuNGmR4vLrTxYR/FdVdyRfQU3rW0Dm1cxIUYt8lUQoW/nsAebIqg==", "dependencies": { "@scure/base": "^1.1.3" } }, "node_modules/@wormhole-foundation/sdk-connect": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-connect/-/sdk-connect-0.6.7.tgz", - "integrity": "sha512-yLKxLAWUl+J/98A+BNKuqyOu0iv2TXlbbiYLTJO7iUZSB5g3dFt36UJIz4Mfvrt1TnLJbD+7Sv6t2MwIDdO3Jg==", + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-connect/-/sdk-connect-0.7.0-beta.5.tgz", + "integrity": "sha512-aIzo1o5RRX9asiI4pmMTX4NJCSP+iQHd8ZOr6WH2aW80WpnptnKUIL8p3uKEFZiBFobstvWVW3dvgPioUzBmYw==", "dependencies": { - "@wormhole-foundation/sdk-base": "0.6.7", - "@wormhole-foundation/sdk-definitions": "0.6.7", + "@wormhole-foundation/sdk-base": "0.7.0-beta.5", + "@wormhole-foundation/sdk-definitions": "0.7.0-beta.5", "axios": "^1.4.0" }, "engines": { @@ -4782,9 +4834,9 @@ } }, "node_modules/@wormhole-foundation/sdk-connect/node_modules/axios": { - "version": "1.6.8", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.8.tgz", - "integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==", + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.2.tgz", + "integrity": "sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw==", "dependencies": { "follow-redirects": "^1.15.6", "form-data": "^4.0.0", @@ -4805,15 +4857,15 @@ } }, "node_modules/@wormhole-foundation/sdk-cosmwasm": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-cosmwasm/-/sdk-cosmwasm-0.6.7.tgz", - "integrity": "sha512-tpJc1MyngHaZSJFsEy3X+M23HRJ3LTSmCtcOKRE+tpRdb9HU2Nks9mLFjg+b0sAqjdrsHwem/oF2pvjFJA0AWA==", + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-cosmwasm/-/sdk-cosmwasm-0.7.0-beta.5.tgz", + "integrity": "sha512-wYlHA0O/UmBET70JmAl95Tt4BZq0pZdG+rtWoxg2nnM0v7Qhk7B91/9YjR+e/dljHqG1y26UiZ6eLYaIoUpJKw==", "dependencies": { "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/proto-signing": "^0.32.0", "@cosmjs/stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.4", - "@wormhole-foundation/sdk-connect": "0.6.7", + "@wormhole-foundation/sdk-connect": "0.7.0-beta.5", "cosmjs-types": "^0.9.0" }, "engines": { @@ -4821,15 +4873,15 @@ } }, "node_modules/@wormhole-foundation/sdk-cosmwasm-core": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-cosmwasm-core/-/sdk-cosmwasm-core-0.6.7.tgz", - "integrity": "sha512-ZzK1CX+fJfnBXDRxHqGdpq4QpCQc5afPoBXqd5O6dMB2bWwmEo9u5rzTJMjudm/m/7bVg95qJ1p51Xia5ubQqA==", + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-cosmwasm-core/-/sdk-cosmwasm-core-0.7.0-beta.5.tgz", + "integrity": "sha512-i64jPprNhZXvrstk+pekj4Wakj21mbz0TUaPReJXy9hSuoWCbDmnG9Zud+JdAnBy55ckckJ4nWgTxXAygQ/80Q==", "dependencies": { "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.4", - "@wormhole-foundation/sdk-connect": "0.6.7", - "@wormhole-foundation/sdk-cosmwasm": "0.6.7" + "@wormhole-foundation/sdk-connect": "0.7.0-beta.5", + "@wormhole-foundation/sdk-cosmwasm": "0.7.0-beta.5" }, "engines": { "node": ">=16" @@ -5106,9 +5158,9 @@ } }, "node_modules/@wormhole-foundation/sdk-cosmwasm-core/node_modules/axios": { - "version": "1.6.8", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.8.tgz", - "integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==", + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.2.tgz", + "integrity": "sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw==", "dependencies": { "follow-redirects": "^1.15.6", "form-data": "^4.0.0", @@ -5139,9 +5191,9 @@ "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" }, "node_modules/@wormhole-foundation/sdk-cosmwasm-core/node_modules/protobufjs": { - "version": "7.2.6", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.6.tgz", - "integrity": "sha512-dgJaEDDL6x8ASUZ1YqWciTRrdOuYNzoOf27oHNfdyvKqHr5i0FV7FSLU+aIeFjyFgVxrpTOtQUi0BLLBymZaBw==", + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.3.0.tgz", + "integrity": "sha512-YWD03n3shzV9ImZRX3ccbjqLxj7NokGN0V/ESiBV5xWqrommYHYiihuIyavq03pWSGqlyvYUFmfoMKd+1rPA/g==", "hasInstallScript": true, "dependencies": { "@protobufjs/aspromise": "^1.1.2", @@ -5162,16 +5214,16 @@ } }, "node_modules/@wormhole-foundation/sdk-cosmwasm-ibc": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-cosmwasm-ibc/-/sdk-cosmwasm-ibc-0.6.7.tgz", - "integrity": "sha512-w5GQOCmG4w4m3pa+33TaD9W+z5g+qDBKvl377CnvU/0NB9RIdCcR1fNK+jwvVJPRgOO4y8Tq7hFcWBTNlqjqGA==", + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-cosmwasm-ibc/-/sdk-cosmwasm-ibc-0.7.0-beta.5.tgz", + "integrity": "sha512-R6VOGrMGyLqDvuAh9KZrwNjx5aK1aeHt36/zcWC5ZrToILjxE5h7jmUpK4dHpe6dgfh2ryZ1F7B54DdvbpS/hA==", "dependencies": { "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.4", - "@wormhole-foundation/sdk-connect": "0.6.7", - "@wormhole-foundation/sdk-cosmwasm": "0.6.7", - "@wormhole-foundation/sdk-cosmwasm-core": "0.6.7", + "@wormhole-foundation/sdk-connect": "0.7.0-beta.5", + "@wormhole-foundation/sdk-cosmwasm": "0.7.0-beta.5", + "@wormhole-foundation/sdk-cosmwasm-core": "0.7.0-beta.5", "cosmjs-types": "^0.9.0" }, "engines": { @@ -5449,9 +5501,9 @@ } }, "node_modules/@wormhole-foundation/sdk-cosmwasm-ibc/node_modules/axios": { - "version": "1.6.8", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.8.tgz", - "integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==", + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.2.tgz", + "integrity": "sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw==", "dependencies": { "follow-redirects": "^1.15.6", "form-data": "^4.0.0", @@ -5482,9 +5534,9 @@ "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" }, "node_modules/@wormhole-foundation/sdk-cosmwasm-ibc/node_modules/protobufjs": { - "version": "7.2.6", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.6.tgz", - "integrity": "sha512-dgJaEDDL6x8ASUZ1YqWciTRrdOuYNzoOf27oHNfdyvKqHr5i0FV7FSLU+aIeFjyFgVxrpTOtQUi0BLLBymZaBw==", + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.3.0.tgz", + "integrity": "sha512-YWD03n3shzV9ImZRX3ccbjqLxj7NokGN0V/ESiBV5xWqrommYHYiihuIyavq03pWSGqlyvYUFmfoMKd+1rPA/g==", "hasInstallScript": true, "dependencies": { "@protobufjs/aspromise": "^1.1.2", @@ -5505,14 +5557,14 @@ } }, "node_modules/@wormhole-foundation/sdk-cosmwasm-tokenbridge": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-cosmwasm-tokenbridge/-/sdk-cosmwasm-tokenbridge-0.6.7.tgz", - "integrity": "sha512-CVZKw1TWwi3Nxz2z+pj1Hk9Z41KlironAoCU7lGwnoko2uLCk1vleeR3feiVYznZjpEiv/UET9V5o3iI6fhiRw==", + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-cosmwasm-tokenbridge/-/sdk-cosmwasm-tokenbridge-0.7.0-beta.5.tgz", + "integrity": "sha512-/jUqme2Ajy80JyLQuUYDwhufGWjqqwJTJNvBptjDo0dBdmgiLBKIxINXS84rkykyCmkeSCzwRPreH5lLB7kvwg==", "dependencies": { "@cosmjs/cosmwasm-stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.4", - "@wormhole-foundation/sdk-connect": "0.6.7", - "@wormhole-foundation/sdk-cosmwasm": "0.6.7" + "@wormhole-foundation/sdk-connect": "0.7.0-beta.5", + "@wormhole-foundation/sdk-cosmwasm": "0.7.0-beta.5" }, "engines": { "node": ">=16" @@ -5789,9 +5841,9 @@ } }, "node_modules/@wormhole-foundation/sdk-cosmwasm-tokenbridge/node_modules/axios": { - "version": "1.6.8", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.8.tgz", - "integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==", + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.2.tgz", + "integrity": "sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw==", "dependencies": { "follow-redirects": "^1.15.6", "form-data": "^4.0.0", @@ -5822,9 +5874,9 @@ "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" }, "node_modules/@wormhole-foundation/sdk-cosmwasm-tokenbridge/node_modules/protobufjs": { - "version": "7.2.6", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.6.tgz", - "integrity": "sha512-dgJaEDDL6x8ASUZ1YqWciTRrdOuYNzoOf27oHNfdyvKqHr5i0FV7FSLU+aIeFjyFgVxrpTOtQUi0BLLBymZaBw==", + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.3.0.tgz", + "integrity": "sha512-YWD03n3shzV9ImZRX3ccbjqLxj7NokGN0V/ESiBV5xWqrommYHYiihuIyavq03pWSGqlyvYUFmfoMKd+1rPA/g==", "hasInstallScript": true, "dependencies": { "@protobufjs/aspromise": "^1.1.2", @@ -6115,9 +6167,9 @@ } }, "node_modules/@wormhole-foundation/sdk-cosmwasm/node_modules/axios": { - "version": "1.6.8", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.8.tgz", - "integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==", + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.2.tgz", + "integrity": "sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw==", "dependencies": { "follow-redirects": "^1.15.6", "form-data": "^4.0.0", @@ -6148,9 +6200,9 @@ "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" }, "node_modules/@wormhole-foundation/sdk-cosmwasm/node_modules/protobufjs": { - "version": "7.2.6", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.6.tgz", - "integrity": "sha512-dgJaEDDL6x8ASUZ1YqWciTRrdOuYNzoOf27oHNfdyvKqHr5i0FV7FSLU+aIeFjyFgVxrpTOtQUi0BLLBymZaBw==", + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.3.0.tgz", + "integrity": "sha512-YWD03n3shzV9ImZRX3ccbjqLxj7NokGN0V/ESiBV5xWqrommYHYiihuIyavq03pWSGqlyvYUFmfoMKd+1rPA/g==", "hasInstallScript": true, "dependencies": { "@protobufjs/aspromise": "^1.1.2", @@ -6171,13 +6223,13 @@ } }, "node_modules/@wormhole-foundation/sdk-definitions": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-definitions/-/sdk-definitions-0.6.7.tgz", - "integrity": "sha512-6uyfKuTHIXni4rEwoJDNW2Ahm7tABmG+Mae181TX3K4mfVznkC3YufEBlNJyt071B/RD7JJi7WZUVZ1ROG8Aow==", + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-definitions/-/sdk-definitions-0.7.0-beta.5.tgz", + "integrity": "sha512-ctkcGU4M/U5O0M/rn27KwJWs2hJdbcst/T/ybQQbeBdd4HApKJvHTDGi7sZ9ARgJAAhgmyYwvUCoHaiHFfqMXQ==", "dependencies": { "@noble/curves": "^1.4.0", "@noble/hashes": "^1.3.1", - "@wormhole-foundation/sdk-base": "0.6.7" + "@wormhole-foundation/sdk-base": "0.7.0-beta.5" } }, "node_modules/@wormhole-foundation/sdk-definitions/node_modules/@noble/hashes": { @@ -6192,11 +6244,11 @@ } }, "node_modules/@wormhole-foundation/sdk-evm": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-evm/-/sdk-evm-0.6.7.tgz", - "integrity": "sha512-coQO1HaL4/GJxQ26FsgmMHY6X1iMZgHSXnCXGPmlchs5hMWraYLsxMTQ1goFSAIWQi0ALaR7tkdDDzN5y0liRw==", + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-evm/-/sdk-evm-0.7.0-beta.5.tgz", + "integrity": "sha512-tJGuoCSRCMUvwrpktKw5cXRZO/iuRAP8Ip5HNBN6ZcLtbJjaw+7b/wP6Mj+o3rNTxGdSDN594K1mlNvAqgjGNA==", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.6.7", + "@wormhole-foundation/sdk-connect": "0.7.0-beta.5", "ethers": "^6.5.1" }, "engines": { @@ -6204,12 +6256,12 @@ } }, "node_modules/@wormhole-foundation/sdk-evm-cctp": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-evm-cctp/-/sdk-evm-cctp-0.6.7.tgz", - "integrity": "sha512-HilS6N+P4js4qh9s0kdnNlNAQB0F3mG7Mp/rPFYtdX8xhC7L7ZfjoZMZxuv99/05xY6Xdr6l4mldlCmOjFEuBA==", + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-evm-cctp/-/sdk-evm-cctp-0.7.0-beta.5.tgz", + "integrity": "sha512-42Qc1I6ztaYxQfUCUtQ6QIiGkaM3gqyy+rAhXH2+IUSUeDl11RM8MKjyu6NMwwzCGn8bkXMRKWl8UMXUJVX6UQ==", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.6.7", - "@wormhole-foundation/sdk-evm": "0.6.7", + "@wormhole-foundation/sdk-connect": "0.7.0-beta.5", + "@wormhole-foundation/sdk-evm": "0.7.0-beta.5", "ethers": "^6.5.1" }, "engines": { @@ -6296,12 +6348,12 @@ } }, "node_modules/@wormhole-foundation/sdk-evm-core": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-evm-core/-/sdk-evm-core-0.6.7.tgz", - "integrity": "sha512-L4A1RM77QBpL41gsTtS4aHuDqMD5vha3Ojym22KcxXvquWBJLzx3kFthM9v1KtN5EDnaaasutVhMDPMeqj6WIg==", + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-evm-core/-/sdk-evm-core-0.7.0-beta.5.tgz", + "integrity": "sha512-3YYRf+5pFMJ4lzfdvkkCzmDrQgP4HGS1r1RqJvfA96Wb9AitqDmx+ZmrzVbrMlycDmbX8S4S1Yblg63M2kW1Fw==", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.6.7", - "@wormhole-foundation/sdk-evm": "0.6.7", + "@wormhole-foundation/sdk-connect": "0.7.0-beta.5", + "@wormhole-foundation/sdk-evm": "0.7.0-beta.5", "ethers": "^6.5.1" }, "engines": { @@ -6388,14 +6440,14 @@ } }, "node_modules/@wormhole-foundation/sdk-evm-portico": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-evm-portico/-/sdk-evm-portico-0.6.7.tgz", - "integrity": "sha512-6QU2/9dapv7km3qmCtqd1ohN+oKMuG+vscXh3EaTgHEmyx7Nb+fDVZ0SQZV38WrxfxdoaAKyaTFE8ktldFR0Cg==", - "dependencies": { - "@wormhole-foundation/sdk-connect": "0.6.7", - "@wormhole-foundation/sdk-evm": "0.6.7", - "@wormhole-foundation/sdk-evm-core": "0.6.7", - "@wormhole-foundation/sdk-evm-tokenbridge": "0.6.7", + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-evm-portico/-/sdk-evm-portico-0.7.0-beta.5.tgz", + "integrity": "sha512-gvFHRxsg8i7vT3bPR11DVy0PNIAGLDEWCpt74KP9HFFWf6xzsEA8+qN302U6ZcXXBxojY1GtaQUcdNN++7i36Q==", + "dependencies": { + "@wormhole-foundation/sdk-connect": "0.7.0-beta.5", + "@wormhole-foundation/sdk-evm": "0.7.0-beta.5", + "@wormhole-foundation/sdk-evm-core": "0.7.0-beta.5", + "@wormhole-foundation/sdk-evm-tokenbridge": "0.7.0-beta.5", "ethers": "^6.5.1" }, "engines": { @@ -6482,13 +6534,13 @@ } }, "node_modules/@wormhole-foundation/sdk-evm-tokenbridge": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-evm-tokenbridge/-/sdk-evm-tokenbridge-0.6.7.tgz", - "integrity": "sha512-DfEjLx8W85CoA/JTWIfIbQaziGE3Cj5dm1DJ0z0InzMMJ1Lg8TicggQ4mUD1tr8uHRXX6PII007DlXJMxfW/yw==", + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-evm-tokenbridge/-/sdk-evm-tokenbridge-0.7.0-beta.5.tgz", + "integrity": "sha512-Aay8UdcjCwmkibsJLhZyy037dQTn6lli8eDnpAd9gRj9rhfCrEmqQvnCDOPMk/tE0thOeCEjxBSPxtd2IQ9EoA==", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.6.7", - "@wormhole-foundation/sdk-evm": "0.6.7", - "@wormhole-foundation/sdk-evm-core": "0.6.7", + "@wormhole-foundation/sdk-connect": "0.7.0-beta.5", + "@wormhole-foundation/sdk-evm": "0.7.0-beta.5", + "@wormhole-foundation/sdk-evm-core": "0.7.0-beta.5", "ethers": "^6.5.1" }, "engines": { @@ -6654,45 +6706,45 @@ } }, "node_modules/@wormhole-foundation/sdk-solana": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-solana/-/sdk-solana-0.6.7.tgz", - "integrity": "sha512-x+2UNqdKs6KjAF67QENc8J5YI5ZooECZtmQA0xWywM7I/aR1VQhzvLr484hxE71GP84PKDI9y6vBzgi9CV5PCg==", + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-solana/-/sdk-solana-0.7.0-beta.5.tgz", + "integrity": "sha512-s2JReAgr7zVlmoG7RlAwCriHSh4gfRxNhm7c0K0oIwu2KW0RD06K1NAxu3twoBgeRGfiY0IKYR/Ovu1LA4uRgg==", "dependencies": { "@coral-xyz/anchor": "0.29.0", "@coral-xyz/borsh": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "1.91.7", - "@wormhole-foundation/sdk-connect": "0.6.7" + "@wormhole-foundation/sdk-connect": "0.7.0-beta.5" }, "engines": { "node": ">=16" } }, "node_modules/@wormhole-foundation/sdk-solana-cctp": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-solana-cctp/-/sdk-solana-cctp-0.6.7.tgz", - "integrity": "sha512-nQMYdNT1XH7CNcB67KMSFqnAFb0/8gTBV8nKE2xUNx4ktvE81++QflRo8w8BLGJz55DtDkMi0dW3ZdKXJrgaWw==", + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-solana-cctp/-/sdk-solana-cctp-0.7.0-beta.5.tgz", + "integrity": "sha512-XJMY6XBJf1LHhw5owEZEXigXV7jmJpU3lw3xCiJL+LyHexfnnvfw2gdEEY5Un3xOIIzCaLz1+oEkQBk8yVn8zg==", "dependencies": { "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "1.91.7", - "@wormhole-foundation/sdk-connect": "0.6.7", - "@wormhole-foundation/sdk-solana": "0.6.7" + "@wormhole-foundation/sdk-connect": "0.7.0-beta.5", + "@wormhole-foundation/sdk-solana": "0.7.0-beta.5" }, "engines": { "node": ">=16" } }, "node_modules/@wormhole-foundation/sdk-solana-core": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-solana-core/-/sdk-solana-core-0.6.7.tgz", - "integrity": "sha512-yhAdiwRyej+nbObolDnvaUSsdfhNg5c97S4Ze5KpZNRGoT7F4z+tC+b6yH4n9n/drm+QtGY8tCQHHLkDFZB5pA==", + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-solana-core/-/sdk-solana-core-0.7.0-beta.5.tgz", + "integrity": "sha512-9GmktW8suxGX1O0vTBAoAnRTNdIMNgaaNOqEhDR8Ugots0+A3b+QbtWj7Tpg3uVjLE/pO0fFII0ge+ntdHglXA==", "dependencies": { "@coral-xyz/anchor": "0.29.0", "@coral-xyz/borsh": "0.29.0", "@solana/web3.js": "1.91.7", - "@wormhole-foundation/sdk-connect": "0.6.7", - "@wormhole-foundation/sdk-solana": "0.6.7" + "@wormhole-foundation/sdk-connect": "0.7.0-beta.5", + "@wormhole-foundation/sdk-solana": "0.7.0-beta.5" }, "engines": { "node": ">=16" @@ -6714,16 +6766,16 @@ } }, "node_modules/@wormhole-foundation/sdk-solana-tokenbridge": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-solana-tokenbridge/-/sdk-solana-tokenbridge-0.6.7.tgz", - "integrity": "sha512-K9poJOIr0GUhrUGOi9zARIZ9+nvg8mNFEhA17ttWtX8vK88bIp+V7JjIJYPXwl4ai1tDO6F4GbIN0v+TQNQBWg==", + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-solana-tokenbridge/-/sdk-solana-tokenbridge-0.7.0-beta.5.tgz", + "integrity": "sha512-rXQZuLZXvxpDvCcBoXeMaGCNq6kzfofY0B3IjR03uqHPz3fIsSfA5RCWGF0ZadCn4Fi2+hm3hShxC0WVImNMtw==", "dependencies": { "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "1.91.7", - "@wormhole-foundation/sdk-connect": "0.6.7", - "@wormhole-foundation/sdk-solana": "0.6.7", - "@wormhole-foundation/sdk-solana-core": "0.6.7" + "@wormhole-foundation/sdk-connect": "0.7.0-beta.5", + "@wormhole-foundation/sdk-solana": "0.7.0-beta.5", + "@wormhole-foundation/sdk-solana-core": "0.7.0-beta.5" }, "engines": { "node": ">=16" @@ -6745,72 +6797,30 @@ } }, "node_modules/@wormhole-foundation/sdk-sui": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-sui/-/sdk-sui-0.6.7.tgz", - "integrity": "sha512-NI6uuf6x/3rayKmhuwpXSQwMUQvLEo+oJWJDZkT1ecuu0VTQHjRlyyG0A7vFNitY1psRje8krq2oKmC0AbFCCw==", + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-sui/-/sdk-sui-0.7.0-beta.5.tgz", + "integrity": "sha512-fbZPJZOU0gDYkxyx3eBKuNoK7zN3hkodA6gS6imH+/U7zCjXzTzMiH/wTlTgN38uYhmxyUF5RIlFBr4jj/opQw==", "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.6.7" + "@wormhole-foundation/sdk-connect": "0.7.0-beta.5" }, "engines": { "node": ">=16" } }, "node_modules/@wormhole-foundation/sdk-sui-core": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-sui-core/-/sdk-sui-core-0.6.7.tgz", - "integrity": "sha512-hgnNwaCgvlySQaJc7mhQ1weDkCJfHVwkggxtH1xpSPMjUMViJDQsg+r9PvirasLQ4Sg4DAXyllcKGJDcGZsebA==", + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-sui-core/-/sdk-sui-core-0.7.0-beta.5.tgz", + "integrity": "sha512-0De9UjMPQ4lp0P+3Kpr/4iHFn/HVt5Nj00zdG0dhz2Msjxlkz3SqA26rZOECuvF7fmyoQkQKCPowMBfNnmyJJQ==", "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.6.7", - "@wormhole-foundation/sdk-sui": "0.6.7" + "@wormhole-foundation/sdk-connect": "0.7.0-beta.5", + "@wormhole-foundation/sdk-sui": "0.7.0-beta.5" }, "engines": { "node": ">=16" } }, - "node_modules/@wormhole-foundation/sdk-sui-core/node_modules/@0no-co/graphqlsp": { - "version": "1.12.3", - "resolved": "https://registry.npmjs.org/@0no-co/graphqlsp/-/graphqlsp-1.12.3.tgz", - "integrity": "sha512-U0hV/FmFgm2perV+mrXKe/7Z5F4/9rmOziHJYYQgKLwzUVuN5LQG0qs3cLBGxAqoosG0HfTi2cQkgMKY1CMbYQ==", - "dependencies": { - "@gql.tada/internal": "^1.0.0", - "graphql": "^15.5.0 || ^16.0.0 || ^17.0.0" - }, - "peerDependencies": { - "graphql": "^15.5.0 || ^16.0.0 || ^17.0.0", - "typescript": "^5.0.0" - } - }, - "node_modules/@wormhole-foundation/sdk-sui-core/node_modules/@gql.tada/cli-utils": { - "version": "1.3.9", - "resolved": "https://registry.npmjs.org/@gql.tada/cli-utils/-/cli-utils-1.3.9.tgz", - "integrity": "sha512-oRb7SG/+csx9CiypSJTI21KaLfulOUnhX1vxg4FXi2snub9XShkGR2XnnlJVTAOZXY9Vcxti1NutAElxdDkycA==", - "dependencies": { - "@0no-co/graphqlsp": "^1.12.1", - "@gql.tada/internal": "1.0.0", - "@vue/compiler-dom": "^3.4.23", - "@vue/language-core": "^2.0.17", - "graphql": "^15.5.0 || ^16.0.0 || ^17.0.0", - "svelte2tsx": "^0.7.6" - }, - "peerDependencies": { - "graphql": "^15.5.0 || ^16.0.0 || ^17.0.0", - "typescript": "^5.0.0" - } - }, - "node_modules/@wormhole-foundation/sdk-sui-core/node_modules/@gql.tada/internal": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@gql.tada/internal/-/internal-1.0.0.tgz", - "integrity": "sha512-B55aIYyZn5ewdgMqoJciPAwF5DKYX6HBabTU+ap/dpNH3EgJrLomc8Y8w+MCxCyOx+dXL9OduT6eWnVr7J7Eyg==", - "dependencies": { - "@0no-co/graphql.web": "^1.0.5" - }, - "peerDependencies": { - "graphql": "^15.5.0 || ^16.0.0 || ^17.0.0", - "typescript": "^5.0.0" - } - }, "node_modules/@wormhole-foundation/sdk-sui-core/node_modules/@mysten/bcs": { "version": "0.11.1", "resolved": "https://registry.npmjs.org/@mysten/bcs/-/bcs-0.11.1.tgz", @@ -6890,23 +6900,6 @@ "base-x": "^4.0.0" } }, - "node_modules/@wormhole-foundation/sdk-sui-core/node_modules/gql.tada": { - "version": "1.7.5", - "resolved": "https://registry.npmjs.org/gql.tada/-/gql.tada-1.7.5.tgz", - "integrity": "sha512-GepPTee+FWSVVZQ7GiJHzsGNo7gOb59kcn4mUPYLlkbpeJfOUwpuoB05ZNaXG0W4qZVPd1I7R2UgMHBjY1lGlQ==", - "dependencies": { - "@0no-co/graphql.web": "^1.0.5", - "@gql.tada/cli-utils": "1.3.9", - "@gql.tada/internal": "1.0.0" - }, - "bin": { - "gql-tada": "bin/cli.js", - "gql.tada": "bin/cli.js" - }, - "peerDependencies": { - "typescript": "^5.0.0" - } - }, "node_modules/@wormhole-foundation/sdk-sui-core/node_modules/superstruct": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/superstruct/-/superstruct-1.0.4.tgz", @@ -6915,75 +6908,20 @@ "node": ">=14.0.0" } }, - "node_modules/@wormhole-foundation/sdk-sui-core/node_modules/svelte2tsx": { - "version": "0.7.8", - "resolved": "https://registry.npmjs.org/svelte2tsx/-/svelte2tsx-0.7.8.tgz", - "integrity": "sha512-ABK3RDFcy59AqAiU1N5Kxu1RnKrb1GDMrQjLgNgJfE8Q+coCKpjCAPtUVKQM2HnmuqeNWcT3NqfXbE+ZmN5Pow==", - "dependencies": { - "dedent-js": "^1.0.1", - "pascal-case": "^3.1.1" - }, - "peerDependencies": { - "svelte": "^3.55 || ^4.0.0-next.0 || ^4.0 || ^5.0.0-next.0", - "typescript": "^4.9.4 || ^5.0.0" - } - }, "node_modules/@wormhole-foundation/sdk-sui-tokenbridge": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-sui-tokenbridge/-/sdk-sui-tokenbridge-0.6.7.tgz", - "integrity": "sha512-eBGlTOUAJZWoFj2LAZBrak5148TDEgHkzKRASa1KoeX4PH2T9tph27z6tGDg5tNmVykwARSM4l5Wv4+wCuGgEw==", + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-sui-tokenbridge/-/sdk-sui-tokenbridge-0.7.0-beta.5.tgz", + "integrity": "sha512-YUYrvZu6yFAULA8V/RygbQflHlDU4aB2Kx5aVqWV1qWFH4Ixfq2RUrZPCVDeDGTnnlO1otauSHfCCyAOKhTy4g==", "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.6.7", - "@wormhole-foundation/sdk-sui": "0.6.7", - "@wormhole-foundation/sdk-sui-core": "0.6.7" + "@wormhole-foundation/sdk-connect": "0.7.0-beta.5", + "@wormhole-foundation/sdk-sui": "0.7.0-beta.5", + "@wormhole-foundation/sdk-sui-core": "0.7.0-beta.5" }, "engines": { "node": ">=16" } }, - "node_modules/@wormhole-foundation/sdk-sui-tokenbridge/node_modules/@0no-co/graphqlsp": { - "version": "1.12.3", - "resolved": "https://registry.npmjs.org/@0no-co/graphqlsp/-/graphqlsp-1.12.3.tgz", - "integrity": "sha512-U0hV/FmFgm2perV+mrXKe/7Z5F4/9rmOziHJYYQgKLwzUVuN5LQG0qs3cLBGxAqoosG0HfTi2cQkgMKY1CMbYQ==", - "dependencies": { - "@gql.tada/internal": "^1.0.0", - "graphql": "^15.5.0 || ^16.0.0 || ^17.0.0" - }, - "peerDependencies": { - "graphql": "^15.5.0 || ^16.0.0 || ^17.0.0", - "typescript": "^5.0.0" - } - }, - "node_modules/@wormhole-foundation/sdk-sui-tokenbridge/node_modules/@gql.tada/cli-utils": { - "version": "1.3.9", - "resolved": "https://registry.npmjs.org/@gql.tada/cli-utils/-/cli-utils-1.3.9.tgz", - "integrity": "sha512-oRb7SG/+csx9CiypSJTI21KaLfulOUnhX1vxg4FXi2snub9XShkGR2XnnlJVTAOZXY9Vcxti1NutAElxdDkycA==", - "dependencies": { - "@0no-co/graphqlsp": "^1.12.1", - "@gql.tada/internal": "1.0.0", - "@vue/compiler-dom": "^3.4.23", - "@vue/language-core": "^2.0.17", - "graphql": "^15.5.0 || ^16.0.0 || ^17.0.0", - "svelte2tsx": "^0.7.6" - }, - "peerDependencies": { - "graphql": "^15.5.0 || ^16.0.0 || ^17.0.0", - "typescript": "^5.0.0" - } - }, - "node_modules/@wormhole-foundation/sdk-sui-tokenbridge/node_modules/@gql.tada/internal": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@gql.tada/internal/-/internal-1.0.0.tgz", - "integrity": "sha512-B55aIYyZn5ewdgMqoJciPAwF5DKYX6HBabTU+ap/dpNH3EgJrLomc8Y8w+MCxCyOx+dXL9OduT6eWnVr7J7Eyg==", - "dependencies": { - "@0no-co/graphql.web": "^1.0.5" - }, - "peerDependencies": { - "graphql": "^15.5.0 || ^16.0.0 || ^17.0.0", - "typescript": "^5.0.0" - } - }, "node_modules/@wormhole-foundation/sdk-sui-tokenbridge/node_modules/@mysten/bcs": { "version": "0.11.1", "resolved": "https://registry.npmjs.org/@mysten/bcs/-/bcs-0.11.1.tgz", @@ -7063,23 +7001,6 @@ "base-x": "^4.0.0" } }, - "node_modules/@wormhole-foundation/sdk-sui-tokenbridge/node_modules/gql.tada": { - "version": "1.7.5", - "resolved": "https://registry.npmjs.org/gql.tada/-/gql.tada-1.7.5.tgz", - "integrity": "sha512-GepPTee+FWSVVZQ7GiJHzsGNo7gOb59kcn4mUPYLlkbpeJfOUwpuoB05ZNaXG0W4qZVPd1I7R2UgMHBjY1lGlQ==", - "dependencies": { - "@0no-co/graphql.web": "^1.0.5", - "@gql.tada/cli-utils": "1.3.9", - "@gql.tada/internal": "1.0.0" - }, - "bin": { - "gql-tada": "bin/cli.js", - "gql.tada": "bin/cli.js" - }, - "peerDependencies": { - "typescript": "^5.0.0" - } - }, "node_modules/@wormhole-foundation/sdk-sui-tokenbridge/node_modules/superstruct": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/superstruct/-/superstruct-1.0.4.tgz", @@ -7088,61 +7009,6 @@ "node": ">=14.0.0" } }, - "node_modules/@wormhole-foundation/sdk-sui-tokenbridge/node_modules/svelte2tsx": { - "version": "0.7.8", - "resolved": "https://registry.npmjs.org/svelte2tsx/-/svelte2tsx-0.7.8.tgz", - "integrity": "sha512-ABK3RDFcy59AqAiU1N5Kxu1RnKrb1GDMrQjLgNgJfE8Q+coCKpjCAPtUVKQM2HnmuqeNWcT3NqfXbE+ZmN5Pow==", - "dependencies": { - "dedent-js": "^1.0.1", - "pascal-case": "^3.1.1" - }, - "peerDependencies": { - "svelte": "^3.55 || ^4.0.0-next.0 || ^4.0 || ^5.0.0-next.0", - "typescript": "^4.9.4 || ^5.0.0" - } - }, - "node_modules/@wormhole-foundation/sdk-sui/node_modules/@0no-co/graphqlsp": { - "version": "1.12.3", - "resolved": "https://registry.npmjs.org/@0no-co/graphqlsp/-/graphqlsp-1.12.3.tgz", - "integrity": "sha512-U0hV/FmFgm2perV+mrXKe/7Z5F4/9rmOziHJYYQgKLwzUVuN5LQG0qs3cLBGxAqoosG0HfTi2cQkgMKY1CMbYQ==", - "dependencies": { - "@gql.tada/internal": "^1.0.0", - "graphql": "^15.5.0 || ^16.0.0 || ^17.0.0" - }, - "peerDependencies": { - "graphql": "^15.5.0 || ^16.0.0 || ^17.0.0", - "typescript": "^5.0.0" - } - }, - "node_modules/@wormhole-foundation/sdk-sui/node_modules/@gql.tada/cli-utils": { - "version": "1.3.9", - "resolved": "https://registry.npmjs.org/@gql.tada/cli-utils/-/cli-utils-1.3.9.tgz", - "integrity": "sha512-oRb7SG/+csx9CiypSJTI21KaLfulOUnhX1vxg4FXi2snub9XShkGR2XnnlJVTAOZXY9Vcxti1NutAElxdDkycA==", - "dependencies": { - "@0no-co/graphqlsp": "^1.12.1", - "@gql.tada/internal": "1.0.0", - "@vue/compiler-dom": "^3.4.23", - "@vue/language-core": "^2.0.17", - "graphql": "^15.5.0 || ^16.0.0 || ^17.0.0", - "svelte2tsx": "^0.7.6" - }, - "peerDependencies": { - "graphql": "^15.5.0 || ^16.0.0 || ^17.0.0", - "typescript": "^5.0.0" - } - }, - "node_modules/@wormhole-foundation/sdk-sui/node_modules/@gql.tada/internal": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@gql.tada/internal/-/internal-1.0.0.tgz", - "integrity": "sha512-B55aIYyZn5ewdgMqoJciPAwF5DKYX6HBabTU+ap/dpNH3EgJrLomc8Y8w+MCxCyOx+dXL9OduT6eWnVr7J7Eyg==", - "dependencies": { - "@0no-co/graphql.web": "^1.0.5" - }, - "peerDependencies": { - "graphql": "^15.5.0 || ^16.0.0 || ^17.0.0", - "typescript": "^5.0.0" - } - }, "node_modules/@wormhole-foundation/sdk-sui/node_modules/@mysten/bcs": { "version": "0.11.1", "resolved": "https://registry.npmjs.org/@mysten/bcs/-/bcs-0.11.1.tgz", @@ -7222,23 +7088,6 @@ "base-x": "^4.0.0" } }, - "node_modules/@wormhole-foundation/sdk-sui/node_modules/gql.tada": { - "version": "1.7.5", - "resolved": "https://registry.npmjs.org/gql.tada/-/gql.tada-1.7.5.tgz", - "integrity": "sha512-GepPTee+FWSVVZQ7GiJHzsGNo7gOb59kcn4mUPYLlkbpeJfOUwpuoB05ZNaXG0W4qZVPd1I7R2UgMHBjY1lGlQ==", - "dependencies": { - "@0no-co/graphql.web": "^1.0.5", - "@gql.tada/cli-utils": "1.3.9", - "@gql.tada/internal": "1.0.0" - }, - "bin": { - "gql-tada": "bin/cli.js", - "gql.tada": "bin/cli.js" - }, - "peerDependencies": { - "typescript": "^5.0.0" - } - }, "node_modules/@wormhole-foundation/sdk-sui/node_modules/superstruct": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/superstruct/-/superstruct-1.0.4.tgz", @@ -7247,19 +7096,6 @@ "node": ">=14.0.0" } }, - "node_modules/@wormhole-foundation/sdk-sui/node_modules/svelte2tsx": { - "version": "0.7.8", - "resolved": "https://registry.npmjs.org/svelte2tsx/-/svelte2tsx-0.7.8.tgz", - "integrity": "sha512-ABK3RDFcy59AqAiU1N5Kxu1RnKrb1GDMrQjLgNgJfE8Q+coCKpjCAPtUVKQM2HnmuqeNWcT3NqfXbE+ZmN5Pow==", - "dependencies": { - "dedent-js": "^1.0.1", - "pascal-case": "^3.1.1" - }, - "peerDependencies": { - "svelte": "^3.55 || ^4.0.0-next.0 || ^4.0 || ^5.0.0-next.0", - "typescript": "^4.9.4 || ^5.0.0" - } - }, "node_modules/@wry/context": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/@wry/context/-/context-0.7.0.tgz", @@ -10133,6 +9969,23 @@ "url": "https://github.com/sindresorhus/got?sponsor=1" } }, + "node_modules/gql.tada": { + "version": "1.7.5", + "resolved": "https://registry.npmjs.org/gql.tada/-/gql.tada-1.7.5.tgz", + "integrity": "sha512-GepPTee+FWSVVZQ7GiJHzsGNo7gOb59kcn4mUPYLlkbpeJfOUwpuoB05ZNaXG0W4qZVPd1I7R2UgMHBjY1lGlQ==", + "dependencies": { + "@0no-co/graphql.web": "^1.0.5", + "@gql.tada/cli-utils": "1.3.9", + "@gql.tada/internal": "1.0.0" + }, + "bin": { + "gql-tada": "bin/cli.js", + "gql.tada": "bin/cli.js" + }, + "peerDependencies": { + "typescript": "^5.0.0" + } + }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", @@ -14017,6 +13870,19 @@ "@types/estree": "^1.0.0" } }, + "node_modules/svelte2tsx": { + "version": "0.7.9", + "resolved": "https://registry.npmjs.org/svelte2tsx/-/svelte2tsx-0.7.9.tgz", + "integrity": "sha512-Rm+0LAwg9wT4H2IsR8EaM9EWErTzi9LmuZKxkH5b1ua94XjQmwHstBP4VabLgA9AE6XmwBg+xK7Cjzwfm6ustQ==", + "dependencies": { + "dedent-js": "^1.0.1", + "pascal-case": "^3.1.1" + }, + "peerDependencies": { + "svelte": "^3.55 || ^4.0.0-next.0 || ^4.0 || ^5.0.0-next.0", + "typescript": "^4.9.4 || ^5.0.0" + } + }, "node_modules/symbol-observable": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-4.0.0.tgz", @@ -15241,6 +15107,15 @@ "integrity": "sha512-E3Qku4mTzdrlwVWGPxklDnME5ANrEGetvYw4i2GCRlppWXXE4QD66j7pwb8HelZwS6LnqEChhrSOGCXpbiu6MQ==", "requires": {} }, + "@0no-co/graphqlsp": { + "version": "1.12.5", + "resolved": "https://registry.npmjs.org/@0no-co/graphqlsp/-/graphqlsp-1.12.5.tgz", + "integrity": "sha512-YS9s8sf3XLaVdBt33u1mbUdfUSLiarQW1SFd3ITh2CLWz1nVnVTN0oCrpepuFHUJ7rt+b6Gk14sgjP4ONdeZfQ==", + "requires": { + "@gql.tada/internal": "^1.0.0", + "graphql": "^15.5.0 || ^16.0.0 || ^17.0.0" + } + }, "@adraffy/ens-normalize": { "version": "1.10.1", "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.10.1.tgz", @@ -16153,6 +16028,16 @@ "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.29.5.tgz", "integrity": "sha512-m7h+RXDUxOzEOGt4P+3OVPX7PuakZT3GBmaM/Y2u+abN3xZkziykD/NvedYFvvCCdQo714XcGl33bwifS9FZPQ==" }, + "@ensdomains/ens-validation": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@ensdomains/ens-validation/-/ens-validation-0.1.0.tgz", + "integrity": "sha512-rbDh2K6GfqXvBcJUISaTTYEt3f079WA4ohTE5Lh4/8EaaPAk/9vk3EisMUQV2UVxeFIZQEEyRCIOmRTpqN0W7A==" + }, + "@ensdomains/eth-ens-namehash": { + "version": "2.0.15", + "resolved": "https://registry.npmjs.org/@ensdomains/eth-ens-namehash/-/eth-ens-namehash-2.0.15.tgz", + "integrity": "sha512-JRDFP6+Hczb1E0/HhIg0PONgBYasfGfDheujmfxaZaAv/NAH4jE6Kf48WbqfRZdxt4IZI3jl3Ri7sZ1nP09lgw==" + }, "@esbuild/aix-ppc64": { "version": "0.20.2", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.2.tgz", @@ -16694,6 +16579,27 @@ "@ethersproject/strings": "^5.7.0" } }, + "@gql.tada/cli-utils": { + "version": "1.3.9", + "resolved": "https://registry.npmjs.org/@gql.tada/cli-utils/-/cli-utils-1.3.9.tgz", + "integrity": "sha512-oRb7SG/+csx9CiypSJTI21KaLfulOUnhX1vxg4FXi2snub9XShkGR2XnnlJVTAOZXY9Vcxti1NutAElxdDkycA==", + "requires": { + "@0no-co/graphqlsp": "^1.12.1", + "@gql.tada/internal": "1.0.0", + "@vue/compiler-dom": "^3.4.23", + "@vue/language-core": "^2.0.17", + "graphql": "^15.5.0 || ^16.0.0 || ^17.0.0", + "svelte2tsx": "^0.7.6" + } + }, + "@gql.tada/internal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@gql.tada/internal/-/internal-1.0.0.tgz", + "integrity": "sha512-B55aIYyZn5ewdgMqoJciPAwF5DKYX6HBabTU+ap/dpNH3EgJrLomc8Y8w+MCxCyOx+dXL9OduT6eWnVr7J7Eyg==", + "requires": { + "@0no-co/graphql.web": "^1.0.5" + } + }, "@graphql-typed-document-node/core": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/@graphql-typed-document-node/core/-/core-3.2.0.tgz", @@ -16768,9 +16674,9 @@ "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" }, "protobufjs": { - "version": "7.2.6", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.6.tgz", - "integrity": "sha512-dgJaEDDL6x8ASUZ1YqWciTRrdOuYNzoOf27oHNfdyvKqHr5i0FV7FSLU+aIeFjyFgVxrpTOtQUi0BLLBymZaBw==", + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.3.0.tgz", + "integrity": "sha512-YWD03n3shzV9ImZRX3ccbjqLxj7NokGN0V/ESiBV5xWqrommYHYiihuIyavq03pWSGqlyvYUFmfoMKd+1rPA/g==", "requires": { "@protobufjs/aspromise": "^1.1.2", "@protobufjs/base64": "^1.1.2", @@ -18727,17 +18633,17 @@ "dev": true }, "@volar/language-core": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/@volar/language-core/-/language-core-2.2.4.tgz", - "integrity": "sha512-7As47GndxGxsqqYnbreLrfB5NDUeQioPM2LJKUuB4/34c0NpEJ2byVl3c9KYdjIdiEstWZ9JLtLKNTaPWb5jtA==", + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/@volar/language-core/-/language-core-2.2.5.tgz", + "integrity": "sha512-2htyAuxRrAgETmFeUhT4XLELk3LiEcqoW/B8YUXMF6BrGWLMwIR09MFaZYvrA2UhbdAeSyeQ726HaWSWkexUcQ==", "requires": { - "@volar/source-map": "2.2.4" + "@volar/source-map": "2.2.5" } }, "@volar/source-map": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/@volar/source-map/-/source-map-2.2.4.tgz", - "integrity": "sha512-m92FLpR9vB1YEZfiZ+bfgpLrToL/DNkOrorWVep3pffHrwwI4Tx2oIQN+sqHJfKkiT5N3J1owC+8crhAEinfjg==", + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/@volar/source-map/-/source-map-2.2.5.tgz", + "integrity": "sha512-wrOEIiZNf4E+PWB0AxyM4tfhkfldPsb3bxg8N6FHrxJH2ohar7aGu48e98bp3pR9HUA7P/pR9VrLmkTrgCCnWQ==", "requires": { "muggle-string": "^0.4.0" } @@ -18801,71 +18707,71 @@ "integrity": "sha512-DL3NmY2OFlqmYYrzp39yi3LDkKxa5vZVwxWdQ3rG0ekuWscHraeIbnI8t+aZK7qhYqEqWKTUdijadunb9pnrgA==" }, "@wormhole-foundation/sdk": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk/-/sdk-0.6.7.tgz", - "integrity": "sha512-bGT/z47mDxeoQPdm0ZuzKtllrHgl9WFEvN1Ka8iUsrbZ03/bfyuScgWujbMqmX9kWVzgarnNFrEA5A4OVeLBJw==", - "requires": { - "@wormhole-foundation/sdk-algorand": "0.6.7", - "@wormhole-foundation/sdk-algorand-core": "0.6.7", - "@wormhole-foundation/sdk-algorand-tokenbridge": "0.6.7", - "@wormhole-foundation/sdk-aptos": "0.6.7", - "@wormhole-foundation/sdk-aptos-core": "0.6.7", - "@wormhole-foundation/sdk-aptos-tokenbridge": "0.6.7", - "@wormhole-foundation/sdk-base": "0.6.7", - "@wormhole-foundation/sdk-connect": "0.6.7", - "@wormhole-foundation/sdk-cosmwasm": "0.6.7", - "@wormhole-foundation/sdk-cosmwasm-core": "0.6.7", - "@wormhole-foundation/sdk-cosmwasm-ibc": "0.6.7", - "@wormhole-foundation/sdk-cosmwasm-tokenbridge": "0.6.7", - "@wormhole-foundation/sdk-definitions": "0.6.7", - "@wormhole-foundation/sdk-evm": "0.6.7", - "@wormhole-foundation/sdk-evm-cctp": "0.6.7", - "@wormhole-foundation/sdk-evm-core": "0.6.7", - "@wormhole-foundation/sdk-evm-portico": "0.6.7", - "@wormhole-foundation/sdk-evm-tokenbridge": "0.6.7", - "@wormhole-foundation/sdk-solana": "0.6.7", - "@wormhole-foundation/sdk-solana-cctp": "0.6.7", - "@wormhole-foundation/sdk-solana-core": "0.6.7", - "@wormhole-foundation/sdk-solana-tokenbridge": "0.6.7", - "@wormhole-foundation/sdk-sui": "0.6.7", - "@wormhole-foundation/sdk-sui-core": "0.6.7", - "@wormhole-foundation/sdk-sui-tokenbridge": "0.6.7" + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk/-/sdk-0.7.0-beta.5.tgz", + "integrity": "sha512-0IM8xngEghx5Uf3/SnzQeBrOHBONj92GJ6/RETzuvmCx3YkZpy9gFo1ctvD9Ey4MrWbTdQk7qMnpCZOwpldWWw==", + "requires": { + "@wormhole-foundation/sdk-algorand": "0.7.0-beta.5", + "@wormhole-foundation/sdk-algorand-core": "0.7.0-beta.5", + "@wormhole-foundation/sdk-algorand-tokenbridge": "0.7.0-beta.5", + "@wormhole-foundation/sdk-aptos": "0.7.0-beta.5", + "@wormhole-foundation/sdk-aptos-core": "0.7.0-beta.5", + "@wormhole-foundation/sdk-aptos-tokenbridge": "0.7.0-beta.5", + "@wormhole-foundation/sdk-base": "0.7.0-beta.5", + "@wormhole-foundation/sdk-connect": "0.7.0-beta.5", + "@wormhole-foundation/sdk-cosmwasm": "0.7.0-beta.5", + "@wormhole-foundation/sdk-cosmwasm-core": "0.7.0-beta.5", + "@wormhole-foundation/sdk-cosmwasm-ibc": "0.7.0-beta.5", + "@wormhole-foundation/sdk-cosmwasm-tokenbridge": "0.7.0-beta.5", + "@wormhole-foundation/sdk-definitions": "0.7.0-beta.5", + "@wormhole-foundation/sdk-evm": "0.7.0-beta.5", + "@wormhole-foundation/sdk-evm-cctp": "0.7.0-beta.5", + "@wormhole-foundation/sdk-evm-core": "0.7.0-beta.5", + "@wormhole-foundation/sdk-evm-portico": "0.7.0-beta.5", + "@wormhole-foundation/sdk-evm-tokenbridge": "0.7.0-beta.5", + "@wormhole-foundation/sdk-solana": "0.7.0-beta.5", + "@wormhole-foundation/sdk-solana-cctp": "0.7.0-beta.5", + "@wormhole-foundation/sdk-solana-core": "0.7.0-beta.5", + "@wormhole-foundation/sdk-solana-tokenbridge": "0.7.0-beta.5", + "@wormhole-foundation/sdk-sui": "0.7.0-beta.5", + "@wormhole-foundation/sdk-sui-core": "0.7.0-beta.5", + "@wormhole-foundation/sdk-sui-tokenbridge": "0.7.0-beta.5" } }, "@wormhole-foundation/sdk-algorand": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-algorand/-/sdk-algorand-0.6.7.tgz", - "integrity": "sha512-WRNEAk1rRgPTL0h5xcThNEMAdNC+OHKANPPdrloh08mEYub1AQ7H8iwoW+/xNi7Rbxk/eg+NyH2IINwZrzvqyw==", + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-algorand/-/sdk-algorand-0.7.0-beta.5.tgz", + "integrity": "sha512-DYhinpe/41b8nu+xS9I1KmzUMUIicZYmKWH7Ea5/5KTA6pB8tM3AHTKa54cqb5g6n14VQmfbnHFbGVAUjqSL6g==", "requires": { - "@wormhole-foundation/sdk-connect": "0.6.7", + "@wormhole-foundation/sdk-connect": "0.7.0-beta.5", "algosdk": "2.7.0" } }, "@wormhole-foundation/sdk-algorand-core": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-algorand-core/-/sdk-algorand-core-0.6.7.tgz", - "integrity": "sha512-C7GvPsPFHg0rCsYRf2apQfFqigEo2DbFgi8wdEFt4FOnIMwABtpu7x2SuLb540PnaqBsIC7Ainxm7ddBBYJY9Q==", + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-algorand-core/-/sdk-algorand-core-0.7.0-beta.5.tgz", + "integrity": "sha512-AJQEaXIViwwmg/oyn0QjgJEwv2pPbup7qb2C0KTJIPXwx40Cr4Z6jrBrgE387+svJ63+WNNBhJnC5YRl93AuKg==", "requires": { - "@wormhole-foundation/sdk-algorand": "0.6.7", - "@wormhole-foundation/sdk-connect": "0.6.7" + "@wormhole-foundation/sdk-algorand": "0.7.0-beta.5", + "@wormhole-foundation/sdk-connect": "0.7.0-beta.5" } }, "@wormhole-foundation/sdk-algorand-tokenbridge": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-algorand-tokenbridge/-/sdk-algorand-tokenbridge-0.6.7.tgz", - "integrity": "sha512-iwjcDCG5MY/FszjTYky69fwS2A3xDElMgpp0JP8BiVGwWghGkdZkOBSKbLHXRMLqhsQnzujGmyrSjzgLuw3zWA==", + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-algorand-tokenbridge/-/sdk-algorand-tokenbridge-0.7.0-beta.5.tgz", + "integrity": "sha512-ZozYoS948Aa+iVZWtq3b+xQMSWyh9uEklsQTfDlNLi+72P5Wz6amrweBNnSErxrpG+y/zXa9XqwVBN6grjc2gg==", "requires": { - "@wormhole-foundation/sdk-algorand": "0.6.7", - "@wormhole-foundation/sdk-algorand-core": "0.6.7", - "@wormhole-foundation/sdk-connect": "0.6.7" + "@wormhole-foundation/sdk-algorand": "0.7.0-beta.5", + "@wormhole-foundation/sdk-algorand-core": "0.7.0-beta.5", + "@wormhole-foundation/sdk-connect": "0.7.0-beta.5" } }, "@wormhole-foundation/sdk-aptos": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-aptos/-/sdk-aptos-0.6.7.tgz", - "integrity": "sha512-fKWbwE8wcYuonNvakgfXUnUFkJ3NanpFIIDhIZs3egQKFpU3BltT4zBShwAj51fEhI5aws0Asc8vGSgcZEgGTQ==", + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-aptos/-/sdk-aptos-0.7.0-beta.5.tgz", + "integrity": "sha512-QhCNBzoqZueTO3g8mYAszm3pogX7LUxl/STfw3xIc1xkxUzyk1Tw1UEzih3r6hObDU4C3S1g7zXM2QS5JMjK1g==", "requires": { - "@wormhole-foundation/sdk-connect": "0.6.7", + "@wormhole-foundation/sdk-connect": "0.7.0-beta.5", "aptos": "1.21.0" }, "dependencies": { @@ -18914,45 +18820,45 @@ } }, "@wormhole-foundation/sdk-aptos-core": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-aptos-core/-/sdk-aptos-core-0.6.7.tgz", - "integrity": "sha512-TOmIVmCR8qOwYseQB7CRnjDGOjxeYQXCoXjCR7n2/ohEMbtBGEymvfUAtTyHBpNmqvA8tustlOwB6Lmq80OkjQ==", + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-aptos-core/-/sdk-aptos-core-0.7.0-beta.5.tgz", + "integrity": "sha512-MjO/YULiKGUApDOxd7Ru5qR/D1g3Tx/Y0PAfCfBFaW1COCSeGNnnmUzTmVjE4pWlErvexiRfePZeM5a0FIjNRg==", "requires": { - "@wormhole-foundation/sdk-aptos": "0.6.7", - "@wormhole-foundation/sdk-connect": "0.6.7" + "@wormhole-foundation/sdk-aptos": "0.7.0-beta.5", + "@wormhole-foundation/sdk-connect": "0.7.0-beta.5" } }, "@wormhole-foundation/sdk-aptos-tokenbridge": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-aptos-tokenbridge/-/sdk-aptos-tokenbridge-0.6.7.tgz", - "integrity": "sha512-rj3Z22Np8wH+e/O3xx6YuwL/3Jef4C+CHoaWEwF7u7HP5jMJ5H33MmwecO9r4HulFjEKt4HgSpSoQBb8WC5tOQ==", + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-aptos-tokenbridge/-/sdk-aptos-tokenbridge-0.7.0-beta.5.tgz", + "integrity": "sha512-xHPeQeUQzTN8ErnNGACsE2JuZ+l0NHB6zvvk6ufc+Hsi7tLqpBf7iqI8MqsP+FbFOoMJnWukw1FkKO8G4Y/TgQ==", "requires": { - "@wormhole-foundation/sdk-aptos": "0.6.7", - "@wormhole-foundation/sdk-connect": "0.6.7" + "@wormhole-foundation/sdk-aptos": "0.7.0-beta.5", + "@wormhole-foundation/sdk-connect": "0.7.0-beta.5" } }, "@wormhole-foundation/sdk-base": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-base/-/sdk-base-0.6.7.tgz", - "integrity": "sha512-lXN7tm5O8L8nfqXD1Fhn61rTR9WjZ9khRU3tOE3b8AqjX9OxIL9/ou5BmMGaJex8AFAUgnX86pNkEEvu9Tb3hQ==", + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-base/-/sdk-base-0.7.0-beta.5.tgz", + "integrity": "sha512-QMyfGmgg+5V0Qd2SLLXAqSE7nYr2+n/Q/qyuNGmR4vLrTxYR/FdVdyRfQU3rW0Dm1cxIUYt8lUQoW/nsAebIqg==", "requires": { "@scure/base": "^1.1.3" } }, "@wormhole-foundation/sdk-connect": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-connect/-/sdk-connect-0.6.7.tgz", - "integrity": "sha512-yLKxLAWUl+J/98A+BNKuqyOu0iv2TXlbbiYLTJO7iUZSB5g3dFt36UJIz4Mfvrt1TnLJbD+7Sv6t2MwIDdO3Jg==", + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-connect/-/sdk-connect-0.7.0-beta.5.tgz", + "integrity": "sha512-aIzo1o5RRX9asiI4pmMTX4NJCSP+iQHd8ZOr6WH2aW80WpnptnKUIL8p3uKEFZiBFobstvWVW3dvgPioUzBmYw==", "requires": { - "@wormhole-foundation/sdk-base": "0.6.7", - "@wormhole-foundation/sdk-definitions": "0.6.7", + "@wormhole-foundation/sdk-base": "0.7.0-beta.5", + "@wormhole-foundation/sdk-definitions": "0.7.0-beta.5", "axios": "^1.4.0" }, "dependencies": { "axios": { - "version": "1.6.8", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.8.tgz", - "integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==", + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.2.tgz", + "integrity": "sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw==", "requires": { "follow-redirects": "^1.15.6", "form-data": "^4.0.0", @@ -18972,15 +18878,15 @@ } }, "@wormhole-foundation/sdk-cosmwasm": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-cosmwasm/-/sdk-cosmwasm-0.6.7.tgz", - "integrity": "sha512-tpJc1MyngHaZSJFsEy3X+M23HRJ3LTSmCtcOKRE+tpRdb9HU2Nks9mLFjg+b0sAqjdrsHwem/oF2pvjFJA0AWA==", + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-cosmwasm/-/sdk-cosmwasm-0.7.0-beta.5.tgz", + "integrity": "sha512-wYlHA0O/UmBET70JmAl95Tt4BZq0pZdG+rtWoxg2nnM0v7Qhk7B91/9YjR+e/dljHqG1y26UiZ6eLYaIoUpJKw==", "requires": { "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/proto-signing": "^0.32.0", "@cosmjs/stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.4", - "@wormhole-foundation/sdk-connect": "0.6.7", + "@wormhole-foundation/sdk-connect": "0.7.0-beta.5", "cosmjs-types": "^0.9.0" }, "dependencies": { @@ -19258,9 +19164,9 @@ } }, "axios": { - "version": "1.6.8", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.8.tgz", - "integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==", + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.2.tgz", + "integrity": "sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw==", "requires": { "follow-redirects": "^1.15.6", "form-data": "^4.0.0", @@ -19288,9 +19194,9 @@ "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" }, "protobufjs": { - "version": "7.2.6", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.6.tgz", - "integrity": "sha512-dgJaEDDL6x8ASUZ1YqWciTRrdOuYNzoOf27oHNfdyvKqHr5i0FV7FSLU+aIeFjyFgVxrpTOtQUi0BLLBymZaBw==", + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.3.0.tgz", + "integrity": "sha512-YWD03n3shzV9ImZRX3ccbjqLxj7NokGN0V/ESiBV5xWqrommYHYiihuIyavq03pWSGqlyvYUFmfoMKd+1rPA/g==", "requires": { "@protobufjs/aspromise": "^1.1.2", "@protobufjs/base64": "^1.1.2", @@ -19309,15 +19215,15 @@ } }, "@wormhole-foundation/sdk-cosmwasm-core": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-cosmwasm-core/-/sdk-cosmwasm-core-0.6.7.tgz", - "integrity": "sha512-ZzK1CX+fJfnBXDRxHqGdpq4QpCQc5afPoBXqd5O6dMB2bWwmEo9u5rzTJMjudm/m/7bVg95qJ1p51Xia5ubQqA==", + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-cosmwasm-core/-/sdk-cosmwasm-core-0.7.0-beta.5.tgz", + "integrity": "sha512-i64jPprNhZXvrstk+pekj4Wakj21mbz0TUaPReJXy9hSuoWCbDmnG9Zud+JdAnBy55ckckJ4nWgTxXAygQ/80Q==", "requires": { "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.4", - "@wormhole-foundation/sdk-connect": "0.6.7", - "@wormhole-foundation/sdk-cosmwasm": "0.6.7" + "@wormhole-foundation/sdk-connect": "0.7.0-beta.5", + "@wormhole-foundation/sdk-cosmwasm": "0.7.0-beta.5" }, "dependencies": { "@cosmjs/amino": { @@ -19594,9 +19500,9 @@ } }, "axios": { - "version": "1.6.8", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.8.tgz", - "integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==", + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.2.tgz", + "integrity": "sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw==", "requires": { "follow-redirects": "^1.15.6", "form-data": "^4.0.0", @@ -19624,9 +19530,9 @@ "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" }, "protobufjs": { - "version": "7.2.6", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.6.tgz", - "integrity": "sha512-dgJaEDDL6x8ASUZ1YqWciTRrdOuYNzoOf27oHNfdyvKqHr5i0FV7FSLU+aIeFjyFgVxrpTOtQUi0BLLBymZaBw==", + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.3.0.tgz", + "integrity": "sha512-YWD03n3shzV9ImZRX3ccbjqLxj7NokGN0V/ESiBV5xWqrommYHYiihuIyavq03pWSGqlyvYUFmfoMKd+1rPA/g==", "requires": { "@protobufjs/aspromise": "^1.1.2", "@protobufjs/base64": "^1.1.2", @@ -19645,16 +19551,16 @@ } }, "@wormhole-foundation/sdk-cosmwasm-ibc": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-cosmwasm-ibc/-/sdk-cosmwasm-ibc-0.6.7.tgz", - "integrity": "sha512-w5GQOCmG4w4m3pa+33TaD9W+z5g+qDBKvl377CnvU/0NB9RIdCcR1fNK+jwvVJPRgOO4y8Tq7hFcWBTNlqjqGA==", + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-cosmwasm-ibc/-/sdk-cosmwasm-ibc-0.7.0-beta.5.tgz", + "integrity": "sha512-R6VOGrMGyLqDvuAh9KZrwNjx5aK1aeHt36/zcWC5ZrToILjxE5h7jmUpK4dHpe6dgfh2ryZ1F7B54DdvbpS/hA==", "requires": { "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.4", - "@wormhole-foundation/sdk-connect": "0.6.7", - "@wormhole-foundation/sdk-cosmwasm": "0.6.7", - "@wormhole-foundation/sdk-cosmwasm-core": "0.6.7", + "@wormhole-foundation/sdk-connect": "0.7.0-beta.5", + "@wormhole-foundation/sdk-cosmwasm": "0.7.0-beta.5", + "@wormhole-foundation/sdk-cosmwasm-core": "0.7.0-beta.5", "cosmjs-types": "^0.9.0" }, "dependencies": { @@ -19932,9 +19838,9 @@ } }, "axios": { - "version": "1.6.8", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.8.tgz", - "integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==", + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.2.tgz", + "integrity": "sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw==", "requires": { "follow-redirects": "^1.15.6", "form-data": "^4.0.0", @@ -19962,9 +19868,9 @@ "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" }, "protobufjs": { - "version": "7.2.6", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.6.tgz", - "integrity": "sha512-dgJaEDDL6x8ASUZ1YqWciTRrdOuYNzoOf27oHNfdyvKqHr5i0FV7FSLU+aIeFjyFgVxrpTOtQUi0BLLBymZaBw==", + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.3.0.tgz", + "integrity": "sha512-YWD03n3shzV9ImZRX3ccbjqLxj7NokGN0V/ESiBV5xWqrommYHYiihuIyavq03pWSGqlyvYUFmfoMKd+1rPA/g==", "requires": { "@protobufjs/aspromise": "^1.1.2", "@protobufjs/base64": "^1.1.2", @@ -19983,14 +19889,14 @@ } }, "@wormhole-foundation/sdk-cosmwasm-tokenbridge": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-cosmwasm-tokenbridge/-/sdk-cosmwasm-tokenbridge-0.6.7.tgz", - "integrity": "sha512-CVZKw1TWwi3Nxz2z+pj1Hk9Z41KlironAoCU7lGwnoko2uLCk1vleeR3feiVYznZjpEiv/UET9V5o3iI6fhiRw==", + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-cosmwasm-tokenbridge/-/sdk-cosmwasm-tokenbridge-0.7.0-beta.5.tgz", + "integrity": "sha512-/jUqme2Ajy80JyLQuUYDwhufGWjqqwJTJNvBptjDo0dBdmgiLBKIxINXS84rkykyCmkeSCzwRPreH5lLB7kvwg==", "requires": { "@cosmjs/cosmwasm-stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.4", - "@wormhole-foundation/sdk-connect": "0.6.7", - "@wormhole-foundation/sdk-cosmwasm": "0.6.7" + "@wormhole-foundation/sdk-connect": "0.7.0-beta.5", + "@wormhole-foundation/sdk-cosmwasm": "0.7.0-beta.5" }, "dependencies": { "@cosmjs/amino": { @@ -20267,9 +20173,9 @@ } }, "axios": { - "version": "1.6.8", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.8.tgz", - "integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==", + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.2.tgz", + "integrity": "sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw==", "requires": { "follow-redirects": "^1.15.6", "form-data": "^4.0.0", @@ -20297,9 +20203,9 @@ "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" }, "protobufjs": { - "version": "7.2.6", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.6.tgz", - "integrity": "sha512-dgJaEDDL6x8ASUZ1YqWciTRrdOuYNzoOf27oHNfdyvKqHr5i0FV7FSLU+aIeFjyFgVxrpTOtQUi0BLLBymZaBw==", + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.3.0.tgz", + "integrity": "sha512-YWD03n3shzV9ImZRX3ccbjqLxj7NokGN0V/ESiBV5xWqrommYHYiihuIyavq03pWSGqlyvYUFmfoMKd+1rPA/g==", "requires": { "@protobufjs/aspromise": "^1.1.2", "@protobufjs/base64": "^1.1.2", @@ -20318,13 +20224,13 @@ } }, "@wormhole-foundation/sdk-definitions": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-definitions/-/sdk-definitions-0.6.7.tgz", - "integrity": "sha512-6uyfKuTHIXni4rEwoJDNW2Ahm7tABmG+Mae181TX3K4mfVznkC3YufEBlNJyt071B/RD7JJi7WZUVZ1ROG8Aow==", + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-definitions/-/sdk-definitions-0.7.0-beta.5.tgz", + "integrity": "sha512-ctkcGU4M/U5O0M/rn27KwJWs2hJdbcst/T/ybQQbeBdd4HApKJvHTDGi7sZ9ARgJAAhgmyYwvUCoHaiHFfqMXQ==", "requires": { "@noble/curves": "^1.4.0", "@noble/hashes": "^1.3.1", - "@wormhole-foundation/sdk-base": "0.6.7" + "@wormhole-foundation/sdk-base": "0.7.0-beta.5" }, "dependencies": { "@noble/hashes": { @@ -20335,11 +20241,11 @@ } }, "@wormhole-foundation/sdk-evm": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-evm/-/sdk-evm-0.6.7.tgz", - "integrity": "sha512-coQO1HaL4/GJxQ26FsgmMHY6X1iMZgHSXnCXGPmlchs5hMWraYLsxMTQ1goFSAIWQi0ALaR7tkdDDzN5y0liRw==", + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-evm/-/sdk-evm-0.7.0-beta.5.tgz", + "integrity": "sha512-tJGuoCSRCMUvwrpktKw5cXRZO/iuRAP8Ip5HNBN6ZcLtbJjaw+7b/wP6Mj+o3rNTxGdSDN594K1mlNvAqgjGNA==", "requires": { - "@wormhole-foundation/sdk-connect": "0.6.7", + "@wormhole-foundation/sdk-connect": "0.7.0-beta.5", "ethers": "^6.5.1" }, "dependencies": { @@ -20389,12 +20295,12 @@ } }, "@wormhole-foundation/sdk-evm-cctp": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-evm-cctp/-/sdk-evm-cctp-0.6.7.tgz", - "integrity": "sha512-HilS6N+P4js4qh9s0kdnNlNAQB0F3mG7Mp/rPFYtdX8xhC7L7ZfjoZMZxuv99/05xY6Xdr6l4mldlCmOjFEuBA==", + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-evm-cctp/-/sdk-evm-cctp-0.7.0-beta.5.tgz", + "integrity": "sha512-42Qc1I6ztaYxQfUCUtQ6QIiGkaM3gqyy+rAhXH2+IUSUeDl11RM8MKjyu6NMwwzCGn8bkXMRKWl8UMXUJVX6UQ==", "requires": { - "@wormhole-foundation/sdk-connect": "0.6.7", - "@wormhole-foundation/sdk-evm": "0.6.7", + "@wormhole-foundation/sdk-connect": "0.7.0-beta.5", + "@wormhole-foundation/sdk-evm": "0.7.0-beta.5", "ethers": "^6.5.1" }, "dependencies": { @@ -20444,12 +20350,12 @@ } }, "@wormhole-foundation/sdk-evm-core": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-evm-core/-/sdk-evm-core-0.6.7.tgz", - "integrity": "sha512-L4A1RM77QBpL41gsTtS4aHuDqMD5vha3Ojym22KcxXvquWBJLzx3kFthM9v1KtN5EDnaaasutVhMDPMeqj6WIg==", + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-evm-core/-/sdk-evm-core-0.7.0-beta.5.tgz", + "integrity": "sha512-3YYRf+5pFMJ4lzfdvkkCzmDrQgP4HGS1r1RqJvfA96Wb9AitqDmx+ZmrzVbrMlycDmbX8S4S1Yblg63M2kW1Fw==", "requires": { - "@wormhole-foundation/sdk-connect": "0.6.7", - "@wormhole-foundation/sdk-evm": "0.6.7", + "@wormhole-foundation/sdk-connect": "0.7.0-beta.5", + "@wormhole-foundation/sdk-evm": "0.7.0-beta.5", "ethers": "^6.5.1" }, "dependencies": { @@ -20499,14 +20405,14 @@ } }, "@wormhole-foundation/sdk-evm-portico": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-evm-portico/-/sdk-evm-portico-0.6.7.tgz", - "integrity": "sha512-6QU2/9dapv7km3qmCtqd1ohN+oKMuG+vscXh3EaTgHEmyx7Nb+fDVZ0SQZV38WrxfxdoaAKyaTFE8ktldFR0Cg==", - "requires": { - "@wormhole-foundation/sdk-connect": "0.6.7", - "@wormhole-foundation/sdk-evm": "0.6.7", - "@wormhole-foundation/sdk-evm-core": "0.6.7", - "@wormhole-foundation/sdk-evm-tokenbridge": "0.6.7", + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-evm-portico/-/sdk-evm-portico-0.7.0-beta.5.tgz", + "integrity": "sha512-gvFHRxsg8i7vT3bPR11DVy0PNIAGLDEWCpt74KP9HFFWf6xzsEA8+qN302U6ZcXXBxojY1GtaQUcdNN++7i36Q==", + "requires": { + "@wormhole-foundation/sdk-connect": "0.7.0-beta.5", + "@wormhole-foundation/sdk-evm": "0.7.0-beta.5", + "@wormhole-foundation/sdk-evm-core": "0.7.0-beta.5", + "@wormhole-foundation/sdk-evm-tokenbridge": "0.7.0-beta.5", "ethers": "^6.5.1" }, "dependencies": { @@ -20556,13 +20462,13 @@ } }, "@wormhole-foundation/sdk-evm-tokenbridge": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-evm-tokenbridge/-/sdk-evm-tokenbridge-0.6.7.tgz", - "integrity": "sha512-DfEjLx8W85CoA/JTWIfIbQaziGE3Cj5dm1DJ0z0InzMMJ1Lg8TicggQ4mUD1tr8uHRXX6PII007DlXJMxfW/yw==", + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-evm-tokenbridge/-/sdk-evm-tokenbridge-0.7.0-beta.5.tgz", + "integrity": "sha512-Aay8UdcjCwmkibsJLhZyy037dQTn6lli8eDnpAd9gRj9rhfCrEmqQvnCDOPMk/tE0thOeCEjxBSPxtd2IQ9EoA==", "requires": { - "@wormhole-foundation/sdk-connect": "0.6.7", - "@wormhole-foundation/sdk-evm": "0.6.7", - "@wormhole-foundation/sdk-evm-core": "0.6.7", + "@wormhole-foundation/sdk-connect": "0.7.0-beta.5", + "@wormhole-foundation/sdk-evm": "0.7.0-beta.5", + "@wormhole-foundation/sdk-evm-core": "0.7.0-beta.5", "ethers": "^6.5.1" }, "dependencies": { @@ -20612,15 +20518,15 @@ } }, "@wormhole-foundation/sdk-solana": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-solana/-/sdk-solana-0.6.7.tgz", - "integrity": "sha512-x+2UNqdKs6KjAF67QENc8J5YI5ZooECZtmQA0xWywM7I/aR1VQhzvLr484hxE71GP84PKDI9y6vBzgi9CV5PCg==", + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-solana/-/sdk-solana-0.7.0-beta.5.tgz", + "integrity": "sha512-s2JReAgr7zVlmoG7RlAwCriHSh4gfRxNhm7c0K0oIwu2KW0RD06K1NAxu3twoBgeRGfiY0IKYR/Ovu1LA4uRgg==", "requires": { "@coral-xyz/anchor": "0.29.0", "@coral-xyz/borsh": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "1.91.7", - "@wormhole-foundation/sdk-connect": "0.6.7" + "@wormhole-foundation/sdk-connect": "0.7.0-beta.5" }, "dependencies": { "@coral-xyz/borsh": { @@ -20635,27 +20541,27 @@ } }, "@wormhole-foundation/sdk-solana-cctp": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-solana-cctp/-/sdk-solana-cctp-0.6.7.tgz", - "integrity": "sha512-nQMYdNT1XH7CNcB67KMSFqnAFb0/8gTBV8nKE2xUNx4ktvE81++QflRo8w8BLGJz55DtDkMi0dW3ZdKXJrgaWw==", + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-solana-cctp/-/sdk-solana-cctp-0.7.0-beta.5.tgz", + "integrity": "sha512-XJMY6XBJf1LHhw5owEZEXigXV7jmJpU3lw3xCiJL+LyHexfnnvfw2gdEEY5Un3xOIIzCaLz1+oEkQBk8yVn8zg==", "requires": { "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "1.91.7", - "@wormhole-foundation/sdk-connect": "0.6.7", - "@wormhole-foundation/sdk-solana": "0.6.7" + "@wormhole-foundation/sdk-connect": "0.7.0-beta.5", + "@wormhole-foundation/sdk-solana": "0.7.0-beta.5" } }, "@wormhole-foundation/sdk-solana-core": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-solana-core/-/sdk-solana-core-0.6.7.tgz", - "integrity": "sha512-yhAdiwRyej+nbObolDnvaUSsdfhNg5c97S4Ze5KpZNRGoT7F4z+tC+b6yH4n9n/drm+QtGY8tCQHHLkDFZB5pA==", + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-solana-core/-/sdk-solana-core-0.7.0-beta.5.tgz", + "integrity": "sha512-9GmktW8suxGX1O0vTBAoAnRTNdIMNgaaNOqEhDR8Ugots0+A3b+QbtWj7Tpg3uVjLE/pO0fFII0ge+ntdHglXA==", "requires": { "@coral-xyz/anchor": "0.29.0", "@coral-xyz/borsh": "0.29.0", "@solana/web3.js": "1.91.7", - "@wormhole-foundation/sdk-connect": "0.6.7", - "@wormhole-foundation/sdk-solana": "0.6.7" + "@wormhole-foundation/sdk-connect": "0.7.0-beta.5", + "@wormhole-foundation/sdk-solana": "0.7.0-beta.5" }, "dependencies": { "@coral-xyz/borsh": { @@ -20670,57 +20576,27 @@ } }, "@wormhole-foundation/sdk-solana-tokenbridge": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-solana-tokenbridge/-/sdk-solana-tokenbridge-0.6.7.tgz", - "integrity": "sha512-K9poJOIr0GUhrUGOi9zARIZ9+nvg8mNFEhA17ttWtX8vK88bIp+V7JjIJYPXwl4ai1tDO6F4GbIN0v+TQNQBWg==", + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-solana-tokenbridge/-/sdk-solana-tokenbridge-0.7.0-beta.5.tgz", + "integrity": "sha512-rXQZuLZXvxpDvCcBoXeMaGCNq6kzfofY0B3IjR03uqHPz3fIsSfA5RCWGF0ZadCn4Fi2+hm3hShxC0WVImNMtw==", "requires": { "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "1.91.7", - "@wormhole-foundation/sdk-connect": "0.6.7", - "@wormhole-foundation/sdk-solana": "0.6.7", - "@wormhole-foundation/sdk-solana-core": "0.6.7" + "@wormhole-foundation/sdk-connect": "0.7.0-beta.5", + "@wormhole-foundation/sdk-solana": "0.7.0-beta.5", + "@wormhole-foundation/sdk-solana-core": "0.7.0-beta.5" } }, "@wormhole-foundation/sdk-sui": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-sui/-/sdk-sui-0.6.7.tgz", - "integrity": "sha512-NI6uuf6x/3rayKmhuwpXSQwMUQvLEo+oJWJDZkT1ecuu0VTQHjRlyyG0A7vFNitY1psRje8krq2oKmC0AbFCCw==", + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-sui/-/sdk-sui-0.7.0-beta.5.tgz", + "integrity": "sha512-fbZPJZOU0gDYkxyx3eBKuNoK7zN3hkodA6gS6imH+/U7zCjXzTzMiH/wTlTgN38uYhmxyUF5RIlFBr4jj/opQw==", "requires": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.6.7" + "@wormhole-foundation/sdk-connect": "0.7.0-beta.5" }, "dependencies": { - "@0no-co/graphqlsp": { - "version": "1.12.3", - "resolved": "https://registry.npmjs.org/@0no-co/graphqlsp/-/graphqlsp-1.12.3.tgz", - "integrity": "sha512-U0hV/FmFgm2perV+mrXKe/7Z5F4/9rmOziHJYYQgKLwzUVuN5LQG0qs3cLBGxAqoosG0HfTi2cQkgMKY1CMbYQ==", - "requires": { - "@gql.tada/internal": "^1.0.0", - "graphql": "^15.5.0 || ^16.0.0 || ^17.0.0" - } - }, - "@gql.tada/cli-utils": { - "version": "1.3.9", - "resolved": "https://registry.npmjs.org/@gql.tada/cli-utils/-/cli-utils-1.3.9.tgz", - "integrity": "sha512-oRb7SG/+csx9CiypSJTI21KaLfulOUnhX1vxg4FXi2snub9XShkGR2XnnlJVTAOZXY9Vcxti1NutAElxdDkycA==", - "requires": { - "@0no-co/graphqlsp": "^1.12.1", - "@gql.tada/internal": "1.0.0", - "@vue/compiler-dom": "^3.4.23", - "@vue/language-core": "^2.0.17", - "graphql": "^15.5.0 || ^16.0.0 || ^17.0.0", - "svelte2tsx": "^0.7.6" - } - }, - "@gql.tada/internal": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@gql.tada/internal/-/internal-1.0.0.tgz", - "integrity": "sha512-B55aIYyZn5ewdgMqoJciPAwF5DKYX6HBabTU+ap/dpNH3EgJrLomc8Y8w+MCxCyOx+dXL9OduT6eWnVr7J7Eyg==", - "requires": { - "@0no-co/graphql.web": "^1.0.5" - } - }, "@mysten/bcs": { "version": "0.11.1", "resolved": "https://registry.npmjs.org/@mysten/bcs/-/bcs-0.11.1.tgz", @@ -20785,72 +20661,23 @@ "base-x": "^4.0.0" } }, - "gql.tada": { - "version": "1.7.5", - "resolved": "https://registry.npmjs.org/gql.tada/-/gql.tada-1.7.5.tgz", - "integrity": "sha512-GepPTee+FWSVVZQ7GiJHzsGNo7gOb59kcn4mUPYLlkbpeJfOUwpuoB05ZNaXG0W4qZVPd1I7R2UgMHBjY1lGlQ==", - "requires": { - "@0no-co/graphql.web": "^1.0.5", - "@gql.tada/cli-utils": "1.3.9", - "@gql.tada/internal": "1.0.0" - } - }, "superstruct": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/superstruct/-/superstruct-1.0.4.tgz", "integrity": "sha512-7JpaAoX2NGyoFlI9NBh66BQXGONc+uE+MRS5i2iOBKuS4e+ccgMDjATgZldkah+33DakBxDHiss9kvUcGAO8UQ==" - }, - "svelte2tsx": { - "version": "0.7.8", - "resolved": "https://registry.npmjs.org/svelte2tsx/-/svelte2tsx-0.7.8.tgz", - "integrity": "sha512-ABK3RDFcy59AqAiU1N5Kxu1RnKrb1GDMrQjLgNgJfE8Q+coCKpjCAPtUVKQM2HnmuqeNWcT3NqfXbE+ZmN5Pow==", - "requires": { - "dedent-js": "^1.0.1", - "pascal-case": "^3.1.1" - } } } }, "@wormhole-foundation/sdk-sui-core": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-sui-core/-/sdk-sui-core-0.6.7.tgz", - "integrity": "sha512-hgnNwaCgvlySQaJc7mhQ1weDkCJfHVwkggxtH1xpSPMjUMViJDQsg+r9PvirasLQ4Sg4DAXyllcKGJDcGZsebA==", + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-sui-core/-/sdk-sui-core-0.7.0-beta.5.tgz", + "integrity": "sha512-0De9UjMPQ4lp0P+3Kpr/4iHFn/HVt5Nj00zdG0dhz2Msjxlkz3SqA26rZOECuvF7fmyoQkQKCPowMBfNnmyJJQ==", "requires": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.6.7", - "@wormhole-foundation/sdk-sui": "0.6.7" + "@wormhole-foundation/sdk-connect": "0.7.0-beta.5", + "@wormhole-foundation/sdk-sui": "0.7.0-beta.5" }, "dependencies": { - "@0no-co/graphqlsp": { - "version": "1.12.3", - "resolved": "https://registry.npmjs.org/@0no-co/graphqlsp/-/graphqlsp-1.12.3.tgz", - "integrity": "sha512-U0hV/FmFgm2perV+mrXKe/7Z5F4/9rmOziHJYYQgKLwzUVuN5LQG0qs3cLBGxAqoosG0HfTi2cQkgMKY1CMbYQ==", - "requires": { - "@gql.tada/internal": "^1.0.0", - "graphql": "^15.5.0 || ^16.0.0 || ^17.0.0" - } - }, - "@gql.tada/cli-utils": { - "version": "1.3.9", - "resolved": "https://registry.npmjs.org/@gql.tada/cli-utils/-/cli-utils-1.3.9.tgz", - "integrity": "sha512-oRb7SG/+csx9CiypSJTI21KaLfulOUnhX1vxg4FXi2snub9XShkGR2XnnlJVTAOZXY9Vcxti1NutAElxdDkycA==", - "requires": { - "@0no-co/graphqlsp": "^1.12.1", - "@gql.tada/internal": "1.0.0", - "@vue/compiler-dom": "^3.4.23", - "@vue/language-core": "^2.0.17", - "graphql": "^15.5.0 || ^16.0.0 || ^17.0.0", - "svelte2tsx": "^0.7.6" - } - }, - "@gql.tada/internal": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@gql.tada/internal/-/internal-1.0.0.tgz", - "integrity": "sha512-B55aIYyZn5ewdgMqoJciPAwF5DKYX6HBabTU+ap/dpNH3EgJrLomc8Y8w+MCxCyOx+dXL9OduT6eWnVr7J7Eyg==", - "requires": { - "@0no-co/graphql.web": "^1.0.5" - } - }, "@mysten/bcs": { "version": "0.11.1", "resolved": "https://registry.npmjs.org/@mysten/bcs/-/bcs-0.11.1.tgz", @@ -20915,73 +20742,24 @@ "base-x": "^4.0.0" } }, - "gql.tada": { - "version": "1.7.5", - "resolved": "https://registry.npmjs.org/gql.tada/-/gql.tada-1.7.5.tgz", - "integrity": "sha512-GepPTee+FWSVVZQ7GiJHzsGNo7gOb59kcn4mUPYLlkbpeJfOUwpuoB05ZNaXG0W4qZVPd1I7R2UgMHBjY1lGlQ==", - "requires": { - "@0no-co/graphql.web": "^1.0.5", - "@gql.tada/cli-utils": "1.3.9", - "@gql.tada/internal": "1.0.0" - } - }, "superstruct": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/superstruct/-/superstruct-1.0.4.tgz", "integrity": "sha512-7JpaAoX2NGyoFlI9NBh66BQXGONc+uE+MRS5i2iOBKuS4e+ccgMDjATgZldkah+33DakBxDHiss9kvUcGAO8UQ==" - }, - "svelte2tsx": { - "version": "0.7.8", - "resolved": "https://registry.npmjs.org/svelte2tsx/-/svelte2tsx-0.7.8.tgz", - "integrity": "sha512-ABK3RDFcy59AqAiU1N5Kxu1RnKrb1GDMrQjLgNgJfE8Q+coCKpjCAPtUVKQM2HnmuqeNWcT3NqfXbE+ZmN5Pow==", - "requires": { - "dedent-js": "^1.0.1", - "pascal-case": "^3.1.1" - } } } }, "@wormhole-foundation/sdk-sui-tokenbridge": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-sui-tokenbridge/-/sdk-sui-tokenbridge-0.6.7.tgz", - "integrity": "sha512-eBGlTOUAJZWoFj2LAZBrak5148TDEgHkzKRASa1KoeX4PH2T9tph27z6tGDg5tNmVykwARSM4l5Wv4+wCuGgEw==", + "version": "0.7.0-beta.5", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/sdk-sui-tokenbridge/-/sdk-sui-tokenbridge-0.7.0-beta.5.tgz", + "integrity": "sha512-YUYrvZu6yFAULA8V/RygbQflHlDU4aB2Kx5aVqWV1qWFH4Ixfq2RUrZPCVDeDGTnnlO1otauSHfCCyAOKhTy4g==", "requires": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.6.7", - "@wormhole-foundation/sdk-sui": "0.6.7", - "@wormhole-foundation/sdk-sui-core": "0.6.7" + "@wormhole-foundation/sdk-connect": "0.7.0-beta.5", + "@wormhole-foundation/sdk-sui": "0.7.0-beta.5", + "@wormhole-foundation/sdk-sui-core": "0.7.0-beta.5" }, "dependencies": { - "@0no-co/graphqlsp": { - "version": "1.12.3", - "resolved": "https://registry.npmjs.org/@0no-co/graphqlsp/-/graphqlsp-1.12.3.tgz", - "integrity": "sha512-U0hV/FmFgm2perV+mrXKe/7Z5F4/9rmOziHJYYQgKLwzUVuN5LQG0qs3cLBGxAqoosG0HfTi2cQkgMKY1CMbYQ==", - "requires": { - "@gql.tada/internal": "^1.0.0", - "graphql": "^15.5.0 || ^16.0.0 || ^17.0.0" - } - }, - "@gql.tada/cli-utils": { - "version": "1.3.9", - "resolved": "https://registry.npmjs.org/@gql.tada/cli-utils/-/cli-utils-1.3.9.tgz", - "integrity": "sha512-oRb7SG/+csx9CiypSJTI21KaLfulOUnhX1vxg4FXi2snub9XShkGR2XnnlJVTAOZXY9Vcxti1NutAElxdDkycA==", - "requires": { - "@0no-co/graphqlsp": "^1.12.1", - "@gql.tada/internal": "1.0.0", - "@vue/compiler-dom": "^3.4.23", - "@vue/language-core": "^2.0.17", - "graphql": "^15.5.0 || ^16.0.0 || ^17.0.0", - "svelte2tsx": "^0.7.6" - } - }, - "@gql.tada/internal": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@gql.tada/internal/-/internal-1.0.0.tgz", - "integrity": "sha512-B55aIYyZn5ewdgMqoJciPAwF5DKYX6HBabTU+ap/dpNH3EgJrLomc8Y8w+MCxCyOx+dXL9OduT6eWnVr7J7Eyg==", - "requires": { - "@0no-co/graphql.web": "^1.0.5" - } - }, "@mysten/bcs": { "version": "0.11.1", "resolved": "https://registry.npmjs.org/@mysten/bcs/-/bcs-0.11.1.tgz", @@ -21046,29 +20824,10 @@ "base-x": "^4.0.0" } }, - "gql.tada": { - "version": "1.7.5", - "resolved": "https://registry.npmjs.org/gql.tada/-/gql.tada-1.7.5.tgz", - "integrity": "sha512-GepPTee+FWSVVZQ7GiJHzsGNo7gOb59kcn4mUPYLlkbpeJfOUwpuoB05ZNaXG0W4qZVPd1I7R2UgMHBjY1lGlQ==", - "requires": { - "@0no-co/graphql.web": "^1.0.5", - "@gql.tada/cli-utils": "1.3.9", - "@gql.tada/internal": "1.0.0" - } - }, "superstruct": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/superstruct/-/superstruct-1.0.4.tgz", "integrity": "sha512-7JpaAoX2NGyoFlI9NBh66BQXGONc+uE+MRS5i2iOBKuS4e+ccgMDjATgZldkah+33DakBxDHiss9kvUcGAO8UQ==" - }, - "svelte2tsx": { - "version": "0.7.8", - "resolved": "https://registry.npmjs.org/svelte2tsx/-/svelte2tsx-0.7.8.tgz", - "integrity": "sha512-ABK3RDFcy59AqAiU1N5Kxu1RnKrb1GDMrQjLgNgJfE8Q+coCKpjCAPtUVKQM2HnmuqeNWcT3NqfXbE+ZmN5Pow==", - "requires": { - "dedent-js": "^1.0.1", - "pascal-case": "^3.1.1" - } } } }, @@ -23419,6 +23178,16 @@ "responselike": "^2.0.0" } }, + "gql.tada": { + "version": "1.7.5", + "resolved": "https://registry.npmjs.org/gql.tada/-/gql.tada-1.7.5.tgz", + "integrity": "sha512-GepPTee+FWSVVZQ7GiJHzsGNo7gOb59kcn4mUPYLlkbpeJfOUwpuoB05ZNaXG0W4qZVPd1I7R2UgMHBjY1lGlQ==", + "requires": { + "@0no-co/graphql.web": "^1.0.5", + "@gql.tada/cli-utils": "1.3.9", + "@gql.tada/internal": "1.0.0" + } + }, "graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", @@ -26454,6 +26223,15 @@ } } }, + "svelte2tsx": { + "version": "0.7.9", + "resolved": "https://registry.npmjs.org/svelte2tsx/-/svelte2tsx-0.7.9.tgz", + "integrity": "sha512-Rm+0LAwg9wT4H2IsR8EaM9EWErTzi9LmuZKxkH5b1ua94XjQmwHstBP4VabLgA9AE6XmwBg+xK7Cjzwfm6ustQ==", + "requires": { + "dedent-js": "^1.0.1", + "pascal-case": "^3.1.1" + } + }, "symbol-observable": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-4.0.0.tgz", diff --git a/clients/js/package.json b/clients/js/package.json index e1c9e2315e..a350d7827a 100644 --- a/clients/js/package.json +++ b/clients/js/package.json @@ -42,7 +42,7 @@ "@solana/web3.js": "^1.22.0", "@terra-money/terra.js": "^3.1.9", "@types/config": "^3.3.0", - "@wormhole-foundation/sdk": "^0.6.7", + "@wormhole-foundation/sdk": "^0.7.0-beta.5", "@xpla/xpla.js": "^0.2.1", "algosdk": "^2.4.0", "aptos": "^1.3.16", @@ -74,6 +74,6 @@ "jest": "^29.7.0", "ts-jest": "^29.1.2", "tsx": "^4.12.0", - "typescript": "^4.6" + "typescript": "^5.4.5" } } diff --git a/clients/js/run_info_tests b/clients/js/run_info_tests new file mode 100755 index 0000000000..04eebc2556 --- /dev/null +++ b/clients/js/run_info_tests @@ -0,0 +1,69 @@ +#!/bin/bash + +# This is here for ease of generating outputs. + +set -uo pipefail + +test_directory="info_tests" + +function usage() { +cat <&2 +Usage: + + $(basename "$0") [-h] [-a] -- Run info golden tests in $test_directory + + where: + -h show this help text + -a accept new results (override test files) +EOF +exit 1 +} + +accept=false +while getopts ':ha' option; do + case "$option" in + h) usage + ;; + a) accept=true + ;; + :) printf "missing argument for -%s\n" "$OPTARG" >&2 + usage + ;; + \?) printf "illegal option: -%s\n" "$OPTARG" >&2 + usage + ;; + esac +done +shift $((OPTIND - 1)) + +test_files=$(find "$test_directory" -type f | grep "\.test$") + +failed_tests=0 +for test in ${test_files[@]}; do + test_name="${test%.*}" + expected="$test_name.expected" + + result=$(mktemp) + node build/main.js $(cat "$test") > "$result" 2>&1 + if [ $accept = true ]; then + echo "Updating $test_name" + cat "$result" > "$expected" + continue + fi + + if [ ! -f "$expected" ]; then + echo "Missing '$expected' (re-run with -a flag to create)" + failed_tests=$(($failed_tests + 1)) + else + echo "Testing $test_name" + git --no-pager diff --no-index "$expected" "$result" + failed_tests=$(($failed_tests + $?)) + fi +done + +if [ ! $failed_tests = 0 ]; then + echo "$failed_tests failed test(s)" + exit 1 +else + echo "All tests passed" +fi diff --git a/clients/js/src/algorand.ts b/clients/js/src/algorand.ts index 114b1ff063..a3af35d925 100644 --- a/clients/js/src/algorand.ts +++ b/clients/js/src/algorand.ts @@ -2,17 +2,11 @@ import { _submitVAAAlgorand, signSendAndConfirmAlgorand, } from "@certusone/wormhole-sdk/lib/esm/algorand"; -import { - Account, - Algodv2, - decodeAddress, - encodeAddress, - mnemonicToSecretKey, -} from "algosdk"; +import { Account, Algodv2, mnemonicToSecretKey } from "algosdk"; import { NETWORKS } from "./consts"; import { Payload, impossible } from "./vaa"; import { transferFromAlgorand } from "@certusone/wormhole-sdk/lib/esm/token_bridge/transfer"; -import { tryNativeToHexString } from "./array"; +import { tryNativeToHexString } from "./sdk/array"; import { Chain, chainToChainId, @@ -20,7 +14,6 @@ import { Network, toChainId, } from "@wormhole-foundation/sdk-base"; -import { encoding } from "@wormhole-foundation/sdk"; export async function execute_algorand( payload: Payload, @@ -37,18 +30,14 @@ export async function execute_algorand( throw Error(`No ${network} rpc defined for Algorand`); } - const coreContract = contracts.coreBridge(network, chain); - console.log("contracts", contracts); + const coreContract = contracts.coreBridge.get(network, chain); + if (!coreContract) { + throw new Error(`Core bridge address not defined for Algorand ${network}`); + } let target_contract: string; switch (payload.module) { case "Core": { - if (!coreContract) { - throw new Error( - `Core bridge address not defined for Algorand ${network}` - ); - } - target_contract = coreContract; switch (payload.type) { case "GuardianSetUpgrade": @@ -67,9 +56,6 @@ export async function execute_algorand( } case "NFTBridge": { const nftContract = contracts.nftBridge.get(network, chain); - // NOTE: this code can safely be removed once the algorand NFT bridge is - // released, but it's fine for it to stay, as the condition will just be - // skipped once 'contracts.nft_bridge' is defined if (!nftContract) { throw new Error("NFT bridge not supported yet for Algorand"); } @@ -94,7 +80,7 @@ export async function execute_algorand( break; } case "TokenBridge": { - const tbContract = contracts.tokenBridge(network, chain); + const tbContract = contracts.tokenBridge.get(network, chain); if (!tbContract) { throw new Error( `Token bridge address not defined for Algorand ${network}` @@ -162,7 +148,6 @@ export async function transferAlgorand( if (!key) { throw Error(`No ${network} key defined for Algorand`); } - // const contracts = CONTRACTS[network].algorand; const client = getClient(network, rpc); const wallet: Account = mnemonicToSecretKey(key); const CORE_ID = BigInt(parseInt(contracts.coreBridge(network, "Algorand"))); @@ -208,15 +193,3 @@ function getClient(network: Network, rpc: string) { ); return client; } - -export function uint8ArrayToNativeStringAlgorand(a: Uint8Array): string { - return encodeAddress(a); -} - -export function hexToNativeStringAlgorand(s: string): string { - return uint8ArrayToNativeStringAlgorand(encoding.hex.decode(s)); -} - -export function nativeStringToHexAlgorand(s: string): string { - return encoding.hex.encode(decodeAddress(s).publicKey); -} diff --git a/clients/js/src/aptos.ts b/clients/js/src/aptos.ts index e552e8368a..49c98fb430 100644 --- a/clients/js/src/aptos.ts +++ b/clients/js/src/aptos.ts @@ -6,10 +6,7 @@ import { NETWORKS } from "./consts"; import { Payload, impossible } from "./vaa"; import { CHAINS, ensureHexPrefix } from "@certusone/wormhole-sdk"; import { TokenBridgeState } from "@certusone/wormhole-sdk/lib/esm/aptos/types"; -import { - generateSignAndSubmitEntryFunction, - tryNativeToUint8Array, -} from "@certusone/wormhole-sdk/lib/esm/utils"; +import { generateSignAndSubmitEntryFunction } from "@certusone/wormhole-sdk/lib/esm/utils"; import { Chain, ChainId, @@ -18,6 +15,7 @@ import { contracts, toChainId, } from "@wormhole-foundation/sdk-base"; +import { tryNativeToUint8Array } from "./sdk/array"; export async function execute_aptos( payload: Payload, @@ -35,7 +33,7 @@ export async function execute_aptos( switch (payload.module) { case "Core": { - contract = contract ?? contracts.coreBridge(network, chain); + contract = contract ?? contracts.coreBridge.get(network, chain); if (contract === undefined) { throw Error("core bridge contract is undefined"); } @@ -72,7 +70,7 @@ export async function execute_aptos( break; } case "NFTBridge": { - contract = contract ?? contracts.nftBridge(network, chain); + contract = contract ?? contracts.nftBridge.get(network, chain); if (contract === undefined) { throw Error("nft bridge contract is undefined"); } @@ -121,7 +119,7 @@ export async function execute_aptos( break; } case "TokenBridge": { - contract = contract ?? contracts.tokenBridge(network, chain); + contract = contract ?? contracts.tokenBridge.get(network, chain); if (contract === undefined) { throw Error("token bridge contract is undefined"); } @@ -259,7 +257,7 @@ export async function transferAptos( if (!rpc) { throw new Error("No rpc for aptos"); } - const token_bridge = contracts.tokenBridge(network, "Aptos"); + const token_bridge = contracts.tokenBridge.get(network, "Aptos"); if (!token_bridge) { throw new Error("token bridge contract is undefined"); } @@ -391,12 +389,11 @@ export async function queryRegistrationsAptos( ): Promise { const n = NETWORKS[network]["Aptos"]; const client = new AptosClient(n.rpc); - // const contracts = CONTRACTS[network]["aptos"]; let stateObjectId: string | undefined; switch (module) { case "TokenBridge": - stateObjectId = contracts.tokenBridge(network, "Aptos"); + stateObjectId = contracts.tokenBridge.get(network, "Aptos"); if (stateObjectId === undefined) { throw Error(`Unknown token bridge contract on ${network} for Aptos`); } diff --git a/clients/js/src/chains/generic/getOriginalAsset.ts b/clients/js/src/chains/generic/getOriginalAsset.ts index ed77b5817c..f1bfee6100 100644 --- a/clients/js/src/chains/generic/getOriginalAsset.ts +++ b/clients/js/src/chains/generic/getOriginalAsset.ts @@ -17,7 +17,6 @@ import { Chain, ChainId, Network, - chainToChainId, chainToPlatform, contracts, toChain, @@ -34,9 +33,8 @@ import algorand from "@wormhole-foundation/sdk/algorand"; import aptos from "@wormhole-foundation/sdk/aptos"; import cosmwasm from "@wormhole-foundation/sdk/cosmwasm"; import sui from "@wormhole-foundation/sdk/sui"; -// import { WormholeWrappedInfo } from "@certusone/wormhole-sdk"; -export const getOriginalAsset_old = async ( +export const getOriginalAsset = async ( chain: ChainId | Chain, network: Network, assetAddress: string, @@ -92,13 +90,6 @@ export const getOriginalAsset_old = async ( assetAddress, toChainId(chain) ); - // const wh = await wormhole(network, [evm]); - // const asset = Wormhole.tokenId(chainName, assetAddress); - // const tokenId = await wh.getOriginalAsset(asset); - // let wwi: WormholeWrappedInfo = { - // chainId: chainToChainId(chainName), - // tokenId: tokenId, - // }; } case "Terra": case "Terra2": { @@ -156,45 +147,3 @@ export const getOriginalAsset_old = async ( impossible(chainName); } }; - -export const getOriginalAsset_new = async ( - chain: ChainId | Chain, - network: Network, - assetAddress: string -): Promise => { - const chainName = toChain(chain); - const asset = Wormhole.tokenId(chainName, assetAddress); - const platform = chainToPlatform(chainName); - let wh; - wh = await wormhole(network, [solana, evm, algorand, aptos, cosmwasm, sui]); - // switch (platform) { - // case "Solana": { - // wh = await wormhole(network, [solana]); - // } - // case "Evm": { - // wh = await wormhole(network, [evm]); - // } - // case "Algorand": { - // wh = await wormhole(network, [algorand]); - // } - // case "Aptos": { - // wh = await wormhole(network, [aptos]); - // } - // case "Btc": { - // wh = await wormhole(network, [btc]); - // } - // case "Cosmwasm": { - // wh = await wormhole(network, [cosmwasm]); - // } - // case "Near": { - // wh = await wormhole(network, [near]); - // } - // case "Sui": { - // wh = await wormhole(network, [sui]); - // } - // } - // if (wh) { - return wh.getOriginalAsset(asset); - // } - throw new Error(`${platform} not supported`); -}; diff --git a/clients/js/src/chains/generic/getWrappedAssetAddress.ts b/clients/js/src/chains/generic/getWrappedAssetAddress.ts index aa31cac8b4..9d79784d8a 100644 --- a/clients/js/src/chains/generic/getWrappedAssetAddress.ts +++ b/clients/js/src/chains/generic/getWrappedAssetAddress.ts @@ -20,7 +20,7 @@ import { toChain, toChainId, } from "@wormhole-foundation/sdk-base"; -import { tryNativeToUint8Array } from "../../array"; +import { tryNativeToUint8Array } from "../../sdk/array"; export const getWrappedAssetAddress = async ( chain: ChainId | Chain, diff --git a/clients/js/src/chains/generic/provider.ts b/clients/js/src/chains/generic/provider.ts index 137b2cf914..ba4987728d 100644 --- a/clients/js/src/chains/generic/provider.ts +++ b/clients/js/src/chains/generic/provider.ts @@ -53,7 +53,6 @@ export const getProviderForChain = ( network: Network, options?: { rpc?: string; [opt: string]: any } ): ChainProvider => { - // const chainName = toChain(chain); const rpc = options?.rpc ?? NETWORKS[network][chain].rpc; if (!rpc) { throw new Error(`No ${network} rpc defined for ${chain}`); diff --git a/clients/js/src/chains/sei/submit.ts b/clients/js/src/chains/sei/submit.ts index b91130480e..cf99549dc3 100644 --- a/clients/js/src/chains/sei/submit.ts +++ b/clients/js/src/chains/sei/submit.ts @@ -15,7 +15,6 @@ export const submit = async ( network: Network, rpc?: string ) => { - // const contracts = CONTRACTS[network].Sei; const networkInfo = NETWORKS[network].Sei; rpc = rpc || networkInfo.rpc; const key = networkInfo.key; @@ -37,7 +36,6 @@ export const submit = async ( } target_contract = core; - // sigh... execute_msg = { submit_v_a_a: { vaa: vaa.toString("base64"), @@ -61,9 +59,6 @@ export const submit = async ( case "NFTBridge": { const nft = contracts.nftBridge.get(network, "Sei"); if (!nft) { - // NOTE: this code can safely be removed once the sei NFT bridge is - // released, but it's fine for it to stay, as the condition will just be - // skipped once 'contracts.nft_bridge' is defined throw new Error("NFT bridge not supported yet for Sei"); } diff --git a/clients/js/src/chains/sui/submit.ts b/clients/js/src/chains/sui/submit.ts index e879b10473..725df8b7a8 100644 --- a/clients/js/src/chains/sui/submit.ts +++ b/clients/js/src/chains/sui/submit.ts @@ -11,7 +11,6 @@ import { Payload, impossible } from "../../vaa"; import { assertSuccess, executeTransactionBlock, - getForeignAssetSui, getPackageId, getProvider, getSigner, @@ -28,6 +27,7 @@ import { contracts, deserialize, } from "@wormhole-foundation/sdk"; +import { getForeignAssetSui } from "../../sdk/sui"; export const submit = async ( payload: Payload, @@ -45,7 +45,7 @@ export const submit = async ( switch (payload.module) { case "Core": { - const coreObjectId = contracts.coreBridge(network, chain); + const coreObjectId = contracts.coreBridge.get(network, chain); if (!coreObjectId) { throw Error("Core bridge object ID is undefined"); } @@ -103,12 +103,15 @@ export const submit = async ( throw new Error("NFT bridge not supported on Sui"); } case "TokenBridge": { - const coreBridgeStateObjectId = contracts.coreBridge(network, chain); + const coreBridgeStateObjectId = contracts.coreBridge.get(network, chain); if (!coreBridgeStateObjectId) { throw Error("Core bridge object ID is undefined"); } - const tokenBridgeStateObjectId = contracts.tokenBridge(network, chain); + const tokenBridgeStateObjectId = contracts.tokenBridge.get( + network, + chain + ); if (!tokenBridgeStateObjectId) { throw Error("Token bridge object ID is undefined"); } diff --git a/clients/js/src/chains/sui/transfer.ts b/clients/js/src/chains/sui/transfer.ts index f9ec80833f..d66615658a 100644 --- a/clients/js/src/chains/sui/transfer.ts +++ b/clients/js/src/chains/sui/transfer.ts @@ -5,13 +5,13 @@ import { getSigner, setMaxGasBudgetDevnet, } from "./utils"; -import { tryNativeToUint8Array } from "@certusone/wormhole-sdk/lib/esm/utils"; import { Chain, Network, chainToChainId, contracts, } from "@wormhole-foundation/sdk-base"; +import { tryNativeToUint8Array } from "../../sdk/array"; export async function transferSui( dstChain: Chain, diff --git a/clients/js/src/chains/sui/utils.ts b/clients/js/src/chains/sui/utils.ts index ca8c96549f..79f533873d 100644 --- a/clients/js/src/chains/sui/utils.ts +++ b/clients/js/src/chains/sui/utils.ts @@ -5,19 +5,18 @@ import { PaginatedObjectsResponse, RawSigner, SUI_CLOCK_OBJECT_ID, - SuiObjectResponse, SuiTransactionBlockResponse, TransactionBlock, fromB64, getPublishedObjectChanges, - isValidSuiAddress as isValidFullSuiAddress, normalizeSuiAddress, } from "@mysten/sui.js"; import { DynamicFieldPage } from "@mysten/sui.js/dist/types/dynamic_fields"; import { NETWORKS } from "../../consts"; import { Payload, VAA, parse, serialiseVAA } from "../../vaa"; import { SuiRpcValidationError } from "./error"; -import { Chain, Network, chainToChainId } from "@wormhole-foundation/sdk"; +import { Network } from "@wormhole-foundation/sdk"; +import { isValidSuiAddress } from "../../sdk/sui"; const UPGRADE_CAP_TYPE = "0x2::package::UpgradeCap"; @@ -422,126 +421,3 @@ export const setMaxGasBudgetDevnet = ( tx.setGasBudget(10000000000); } }; - -export async function getForeignAssetSui( - provider: JsonRpcProvider, - tokenBridgeStateObjectId: string, - originChain: Chain, - originAddress: Uint8Array -): Promise { - const originChainId = chainToChainId(originChain); - return getTokenCoinType( - provider, - tokenBridgeStateObjectId, - originAddress, - originChainId - ); -} - -export const getTokenCoinType = async ( - provider: JsonRpcProvider, - tokenBridgeStateObjectId: string, - tokenAddress: Uint8Array, - tokenChain: number -): Promise => { - const tokenBridgeStateFields = await getObjectFields( - provider, - tokenBridgeStateObjectId - ); - if (!tokenBridgeStateFields) { - throw new Error("Unable to fetch object fields from token bridge state"); - } - - const coinTypes = tokenBridgeStateFields?.token_registry?.fields?.coin_types; - const coinTypesObjectId = coinTypes?.fields?.id?.id; - if (!coinTypesObjectId) { - throw new Error("Unable to fetch coin types"); - } - - const keyType = getTableKeyType(coinTypes?.type); - if (!keyType) { - throw new Error("Unable to get key type"); - } - - const response = await provider.getDynamicFieldObject({ - parentId: coinTypesObjectId, - name: { - type: keyType, - value: { - addr: [...tokenAddress], - chain: tokenChain, - }, - }, - }); - if (response.error) { - if (response.error.code === "dynamicFieldNotFound") { - return null; - } - throw new Error( - `Unexpected getDynamicFieldObject response ${response.error}` - ); - } - const fields = getFieldsFromObjectResponse(response); - return fields?.value ? trimSuiType(ensureHexPrefix(fields.value)) : null; -}; - -export const getObjectFields = async ( - provider: JsonRpcProvider, - objectId: string -): Promise | null> => { - if (!isValidSuiAddress(objectId)) { - throw new Error(`Invalid object ID: ${objectId}`); - } - - const res = await provider.getObject({ - id: objectId, - options: { - showContent: true, - }, - }); - return getFieldsFromObjectResponse(res); -}; - -export const getFieldsFromObjectResponse = (object: SuiObjectResponse) => { - const content = object.data?.content; - return content && content.dataType === "moveObject" ? content.fields : null; -}; - -export function ensureHexPrefix(x: string): string { - return x.substring(0, 2) !== "0x" ? `0x${x}` : x; -} - -/** - * This method validates any Sui address, even if it's not 32 bytes long, i.e. - * "0x2". This differs from Mysten's implementation, which requires that the - * given address is 32 bytes long. - * @param address Address to check - * @returns If given address is a valid Sui address or not - */ -export const isValidSuiAddress = (address: string): boolean => - isValidFullSuiAddress(normalizeSuiAddress(address)); - -export const getTableKeyType = (tableType: string): string | null => { - if (!tableType) return null; - const match = trimSuiType(tableType).match(/0x2::table::Table<(.*)>/); - if (!match) return null; - const [keyType] = match[1].split(","); - if (!isValidSuiType(keyType)) return null; - return keyType; -}; - -/** - * This method removes leading zeroes for types in order to normalize them - * since some types returned from the RPC have leading zeroes and others don't. - */ -export const trimSuiType = (type: string): string => - type.replace(/(0x)(0*)/g, "0x"); - -export const isValidSuiType = (type: string): boolean => { - const tokens = type.split("::"); - if (tokens.length !== 3) { - return false; - } - - return isValidSuiAddress(tokens[0]) && !!tokens[1] && !!tokens[2]; -}; diff --git a/clients/js/src/cmds/aptos.ts b/clients/js/src/cmds/aptos.ts index d8e3ef0c77..b1d326ff5a 100644 --- a/clients/js/src/cmds/aptos.ts +++ b/clients/js/src/cmds/aptos.ts @@ -1,4 +1,3 @@ -import { APTOS_DEPLOYER_ADDRESS_DEVNET } from "@certusone/wormhole-sdk"; import { BCS, FaucetClient } from "aptos"; import { spawnSync } from "child_process"; import fs from "fs"; @@ -33,6 +32,9 @@ const APTOS_FAUCET_URL = "http://0.0.0.0:8081"; const README_URL = "https://github.com/wormhole-foundation/wormhole/blob/main/aptos/README.md"; +export const APTOS_DEPLOYER_ADDRESS_DEVNET = + "277fa055b6a73c42c0662d5236c65c864ccbf2d4abd21f174a30c8b786eab84b"; + interface Package { meta_file: string; mv_files: string[]; @@ -194,9 +196,7 @@ export const builder = (y: typeof yargs) => const b = serializePackage(p); const seed = Buffer.from(argv["seed"], "ascii"); - // TODO(csongor): use deployer address from sdk (when it's there) - let module_name = - "0x277fa055b6a73c42c0662d5236c65c864ccbf2d4abd21f174a30c8b786eab84b::deployer"; + let module_name = APTOS_DEPLOYER_ADDRESS_DEVNET + "::deployer"; if (network == "Testnet" || network == "Mainnet") { module_name = "0x0108bc32f7de18a5f6e1e7d6ee7aff9f5fc858d0d87ac0da94dd8d2a5d267d6b::deployer"; @@ -227,9 +227,7 @@ export const builder = (y: typeof yargs) => async (argv) => { const network = getNetwork(argv.network); const rpc = NETWORKS[network].Aptos.rpc; - // TODO(csongor): use sdk address - let module_name = - "0x277fa055b6a73c42c0662d5236c65c864ccbf2d4abd21f174a30c8b786eab84b::sender"; + let module_name = APTOS_DEPLOYER_ADDRESS_DEVNET + "::sender"; if (network == "Testnet" || network == "Mainnet") { module_name = "0x0108bc32f7de18a5f6e1e7d6ee7aff9f5fc858d0d87ac0da94dd8d2a5d267d6b::sender"; diff --git a/clients/js/src/cmds/chains.ts b/clients/js/src/cmds/chains.ts new file mode 100644 index 0000000000..f0e73d2029 --- /dev/null +++ b/clients/js/src/cmds/chains.ts @@ -0,0 +1,12 @@ +import yargs from "yargs"; +import { chains } from "@wormhole-foundation/sdk"; + +export const command = "chains"; +export const desc = "Print the list of supported chains"; +export const builder = (y: typeof yargs) => { + // No positional parameters needed + return y; +}; +export const handler = () => { + console.log(chains); +}; diff --git a/clients/js/src/cmds/evm.ts b/clients/js/src/cmds/evm.ts index 66798ec8d5..1a1f126823 100644 --- a/clients/js/src/cmds/evm.ts +++ b/clients/js/src/cmds/evm.ts @@ -9,13 +9,13 @@ import { setStorageAt, } from "../evm"; import { runCommand, VALIDATOR_OPTIONS } from "../startValidator"; -import { assertEVMChain, evm_address, getNetwork } from "../utils"; import { - assertChain, - chains, - contracts, - platformToChains, -} from "@wormhole-foundation/sdk-base"; + assertEVMChain, + chainToChain, + evm_address, + getNetwork, +} from "../utils"; +import { contracts, platformToChains } from "@wormhole-foundation/sdk-base"; export const command = "evm"; export const desc = "EVM utilities"; @@ -87,8 +87,9 @@ export const builder = function (y: typeof yargs) { yargs .option("chain", { alias: "c", - describe: "Chain to query", - choices: chains, + describe: + "Chain to query. To see a list of supported chains, run `worm evm chains`", + type: "string", demandOption: true, } as const) .option("module", { @@ -112,8 +113,7 @@ export const builder = function (y: typeof yargs) { demandOption: false, }), async (argv) => { - const chain = argv.chain; - assertChain(chain); + const chain = chainToChain(argv.chain); assertEVMChain(chain); const network = getNetwork(argv.network); const module = argv.module; @@ -171,7 +171,6 @@ export const builder = function (y: typeof yargs) { }), async (argv) => { const guardian_addresses = argv["guardian-address"].split(","); - // let rpc = argv.rpc ?? NETWORKS.DEVNET.ethereum.rpc; let rpc = argv.rpc ?? NETWORKS.Devnet.Ethereum.rpc; await hijack_evm( rpc, diff --git a/clients/js/src/cmds/generate.ts b/clients/js/src/cmds/generate.ts index e7e9a6eacd..0b4682c557 100644 --- a/clients/js/src/cmds/generate.ts +++ b/clients/js/src/cmds/generate.ts @@ -17,9 +17,7 @@ import { } from "../vaa"; import { Chain, - assertChain, chainToPlatform, - chains, toChainId, } from "@wormhole-foundation/sdk-base"; @@ -64,8 +62,9 @@ export const builder = function (y: typeof yargs) { yargs .option("chain", { alias: "c", - describe: "Chain to register", - choices: chains, + describe: + "Chain to register. To see a list of supported chains, run `worm chains`", + type: "string", demandOption: true, } as const) .option("contract-address", { @@ -107,8 +106,9 @@ export const builder = function (y: typeof yargs) { yargs .option("chain", { alias: "c", - describe: "Chain to upgrade", - choices: chains, + describe: + "Chain to upgrade. To see a list of supported chains, run `worm chains`", + type: "string", demandOption: true, } as const) .option("contract-address", { @@ -148,8 +148,9 @@ export const builder = function (y: typeof yargs) { yargs .option("emitter-chain", { alias: "e", - describe: "Emitter chain of the VAA", - choices: chains, + describe: + "Emitter chain of the VAA. To see a list of supported chains, run `worm chains`", + type: "string", demandOption: true, } as const) .option("emitter-address", { @@ -160,8 +161,9 @@ export const builder = function (y: typeof yargs) { }) .option("chain", { alias: "c", - describe: "Token's chain", - choices: chains, + describe: + "Token's chain. To see a list of supported chains, run `worm chains`", + type: "string", demandOption: true, } as const) .option("token-address", { @@ -189,9 +191,8 @@ export const builder = function (y: typeof yargs) { demandOption: true, }), (argv) => { - const emitter_chain = argv["emitter-chain"]; + const emitter_chain = chainToChain(argv["emitter-chain"]); const chain = chainToChain(argv.chain); - const emitterChain = chainToChain(emitter_chain); const payload: TokenBridgeAttestMeta = { module: "TokenBridge", type: "AttestMeta", @@ -203,8 +204,8 @@ export const builder = function (y: typeof yargs) { name: argv["name"], }; const vaa = makeVAA( - toChainId(emitterChain), - parseAddress(emitterChain, argv["emitter-address"]), + toChainId(emitter_chain), + parseAddress(emitter_chain, argv["emitter-address"]), argv["guardian-secret"].split(","), payload ); @@ -259,8 +260,9 @@ export const builder = function (y: typeof yargs) { return yargs .option("chain", { alias: "c", - describe: "Chain of Wormhole Relayer contract", - choices: chains, + describe: + "Chain of Wormhole Relayer contract. To see a list of supported chains, run `worm chains`", + type: "string", demandOption: true, } as const) .option("delivery-provider-address", { diff --git a/clients/js/src/cmds/index.ts b/clients/js/src/cmds/index.ts index ebf9f15c68..10dcb1e937 100644 --- a/clients/js/src/cmds/index.ts +++ b/clients/js/src/cmds/index.ts @@ -1,5 +1,6 @@ // https://github.com/yargs/yargs/blob/main/docs/advanced.md#example-command-hierarchy-using-indexmjs import * as aptos from "./aptos"; +import * as chains from "./chains"; import * as editVaa from "./editVaa"; import * as evm from "./evm"; import * as generate from "./generate"; @@ -17,6 +18,7 @@ import * as status from "./status"; // Documentation about command hierarchy can be found here: https://github.com/yargs/yargs/blob/main/docs/advanced.md#example-command-hierarchy-using-indexmjs export const CLI_COMMAND_MODULES = [ aptos, + chains, editVaa, evm, generate, diff --git a/clients/js/src/cmds/info/chainId.ts b/clients/js/src/cmds/info/chainId.ts index 0c5ca41940..d0354c5bdc 100644 --- a/clients/js/src/cmds/info/chainId.ts +++ b/clients/js/src/cmds/info/chainId.ts @@ -1,18 +1,19 @@ import yargs from "yargs"; -import { CHAIN_ID_OR_NAME_CHOICES } from "../../consts"; -import { assertChain, toChain } from "@wormhole-foundation/sdk-base"; +import { chainToChain } from "../../utils"; +import { chainToChainId } from "@wormhole-foundation/sdk"; export const command = "chain-id "; export const desc = "Print the wormhole chain ID integer associated with the specified chain name"; export const builder = (y: typeof yargs) => { return y.positional("chain", { - describe: "Chain to query", - choices: CHAIN_ID_OR_NAME_CHOICES, + describe: + "Chain to query. To see a list of supported chains, run `worm chains`", + type: "string", demandOption: true, } as const); }; export const handler = (argv: Awaited["argv"]>) => { - assertChain(toChain(argv.chain)); - console.log(toChain(argv.chain)); + const inputChain = chainToChain(argv.chain); + console.log(chainToChainId(inputChain)); }; diff --git a/clients/js/src/cmds/info/contract.ts b/clients/js/src/cmds/info/contract.ts index f68c8095bf..616d149107 100644 --- a/clients/js/src/cmds/info/contract.ts +++ b/clients/js/src/cmds/info/contract.ts @@ -1,7 +1,7 @@ import yargs from "yargs"; import { impossible } from "../../vaa"; -import { assertChain, chains, contracts } from "@wormhole-foundation/sdk-base"; -import { getNetwork } from "../../utils"; +import { contracts } from "@wormhole-foundation/sdk-base"; +import { chainToChain, getNetwork } from "../../utils"; export const command = "contract "; export const desc = "Print contract address"; @@ -13,8 +13,9 @@ export const builder = (y: typeof yargs) => demandOption: true, } as const) .positional("chain", { - describe: "Chain to query", - choices: chains, + describe: + "Chain to query. To see a list of supported chains, run `worm chains`", + type: "string", demandOption: true, } as const) .positional("module", { @@ -26,8 +27,7 @@ export const handler = async ( argv: Awaited["argv"]> ) => { const network = getNetwork(argv.network); - const chain = argv.chain; - assertChain(chain); + const chain = chainToChain(argv.chain); const module = argv["module"]; let addr: string | undefined; diff --git a/clients/js/src/cmds/info/emitter.ts b/clients/js/src/cmds/info/emitter.ts index 5754fff4c6..1a155be7b7 100644 --- a/clients/js/src/cmds/info/emitter.ts +++ b/clients/js/src/cmds/info/emitter.ts @@ -1,15 +1,15 @@ import yargs from "yargs"; import { getEmitterAddress } from "../../emitter"; -import { assertChain, chains } from "@wormhole-foundation/sdk-base"; +import { chainToChain } from "../../utils"; export const command = "emitter
"; export const desc = "Print address in emitter address format"; export const builder = (y: typeof yargs) => y .positional("chain", { - describe: "Chain to query", + describe: + "Chain to query. To see a list of supported chains, run `worm chains`", type: "string", - choices: chains, demandOption: true, } as const) .positional("address", { @@ -20,6 +20,5 @@ export const builder = (y: typeof yargs) => export const handler = async ( argv: Awaited["argv"]> ) => { - assertChain(argv.chain); - console.log(await getEmitterAddress(argv.chain, argv.address)); + console.log(await getEmitterAddress(chainToChain(argv.chain), argv.address)); }; diff --git a/clients/js/src/cmds/info/origin.ts b/clients/js/src/cmds/info/origin.ts index 1042d3593e..bb091898b1 100644 --- a/clients/js/src/cmds/info/origin.ts +++ b/clients/js/src/cmds/info/origin.ts @@ -1,9 +1,8 @@ -// import { tryUint8ArrayToNative } from "@certusone/wormhole-sdk/lib/esm/utils"; import yargs from "yargs"; -import { getOriginalAsset_old } from "../../chains/generic"; -import { CHAIN_ID_OR_NAME_CHOICES, RPC_OPTIONS } from "../../consts"; -import { getNetwork } from "../../utils"; -import { tryUint8ArrayToNative } from "../../array"; +import { getOriginalAsset } from "../../chains/generic"; +import { RPC_OPTIONS } from "../../consts"; +import { getNetwork, chainToChain } from "../../utils"; +import { tryUint8ArrayToNative } from "../../sdk/array"; import { toChain } from "@wormhole-foundation/sdk-base"; export const command = "origin
"; @@ -11,8 +10,9 @@ export const desc = `Print the origin chain and address of the asset that corres export const builder = (y: typeof yargs) => y .positional("chain", { - describe: "Chain that wrapped asset came from", - choices: CHAIN_ID_OR_NAME_CHOICES, + describe: + "Chain that wrapped asset came from. To see a list of supported chains, run `worm chains`", + type: "string", demandOption: true, } as const) .positional("address", { @@ -35,7 +35,11 @@ export const handler = async ( console.warn = () => {}; const network = getNetwork(argv.network); - const res = await getOriginalAsset_old(argv.chain, network, argv.address); + const res = await getOriginalAsset( + chainToChain(argv.chain), + network, + argv.address + ); console.log({ ...res, assetAddress: tryUint8ArrayToNative(res.assetAddress, toChain(res.chainId)), diff --git a/clients/js/src/cmds/info/registrations.ts b/clients/js/src/cmds/info/registrations.ts index 30909f450c..b62d1b5927 100644 --- a/clients/js/src/cmds/info/registrations.ts +++ b/clients/js/src/cmds/info/registrations.ts @@ -25,8 +25,9 @@ export const builder = (y: typeof yargs) => { demandOption: true, } as const) .positional("chain", { - describe: "Chain to query", - choices: chains, + describe: + "Chain to query. To see a list of supported chains, run `worm chains`", + type: "string", demandOption: true, } as const) .positional("module", { diff --git a/clients/js/src/cmds/info/rpc.ts b/clients/js/src/cmds/info/rpc.ts index 78498eab20..2d13a47f1a 100644 --- a/clients/js/src/cmds/info/rpc.ts +++ b/clients/js/src/cmds/info/rpc.ts @@ -1,7 +1,6 @@ import yargs from "yargs"; import { NETWORKS } from "../../consts"; -import { assertChain, chains } from "@wormhole-foundation/sdk-base"; -import { getNetwork } from "../../utils"; +import { chainToChain, getNetwork } from "../../utils"; export const command = "rpc "; export const desc = "Print RPC address"; @@ -13,14 +12,14 @@ export const builder = (y: typeof yargs) => demandOption: true, } as const) .positional("chain", { - describe: "Chain to query", - choices: chains, + describe: + "Chain to query. To see a list of supported chains, run `worm chains`", + type: "string", demandOption: true, } as const); export const handler = async ( argv: Awaited["argv"]> ) => { - assertChain(argv.chain); const network = getNetwork(argv.network); - console.log(NETWORKS[network][argv.chain].rpc); + console.log(NETWORKS[network][chainToChain(argv.chain)].rpc); }; diff --git a/clients/js/src/cmds/info/wrapped.ts b/clients/js/src/cmds/info/wrapped.ts index 8308d972a9..20ab6898fb 100644 --- a/clients/js/src/cmds/info/wrapped.ts +++ b/clients/js/src/cmds/info/wrapped.ts @@ -1,8 +1,7 @@ -import { assertChain } from "@certusone/wormhole-sdk/lib/esm/utils/consts"; import yargs from "yargs"; import { getWrappedAssetAddress } from "../../chains/generic/getWrappedAssetAddress"; -import { CHAIN_ID_OR_NAME_CHOICES, RPC_OPTIONS } from "../../consts"; -import { getNetwork } from "../../utils"; +import { RPC_OPTIONS } from "../../consts"; +import { chainToChain, getNetwork } from "../../utils"; export const command = "wrapped "; export const desc = @@ -10,8 +9,9 @@ export const desc = export const builder = (y: typeof yargs) => y .positional("origin-chain", { - describe: "Chain that wrapped asset came from", - choices: CHAIN_ID_OR_NAME_CHOICES, + describe: + "Chain that wrapped asset came from. To see a list of supported chains, run `worm chains`", + type: "string", demandOption: true, } as const) .positional("origin-address", { @@ -20,8 +20,9 @@ export const builder = (y: typeof yargs) => demandOption: true, }) .positional("target-chain", { - describe: "Chain to query for wrapped asset address", - choices: CHAIN_ID_OR_NAME_CHOICES, + describe: + "Chain to query for wrapped asset address. To see a list of supported chains, run `worm chains`", + type: "string", demandOption: true, } as const) .option("network", { @@ -42,14 +43,11 @@ export const handler = async ( const consoleWarnTemp = console.warn; console.warn = () => {}; - const originChain = argv["origin-chain"]; + const originChain = chainToChain(argv["origin-chain"]); const originAddress = argv["origin-address"]; - const targetChain = argv["target-chain"]; + const targetChain = chainToChain(argv["target-chain"]); const network = getNetwork(argv.network); - assertChain(originChain); - assertChain(targetChain); - console.log( await getWrappedAssetAddress( targetChain, diff --git a/clients/js/src/cmds/status.ts b/clients/js/src/cmds/status.ts index 7c5ba96087..a533e3077b 100644 --- a/clients/js/src/cmds/status.ts +++ b/clients/js/src/cmds/status.ts @@ -1,57 +1,60 @@ -import { relayer } from "@certusone/wormhole-sdk"; import yargs from "yargs"; import { ethers } from "ethers"; -import { CHAIN_NAME_CHOICES, NETWORKS } from "../consts"; -import { getNetwork } from "../utils"; +import { NETWORKS } from "../consts"; +import { chainToChain, getNetwork } from "../utils"; import { Chain, assertChain, contracts } from "@wormhole-foundation/sdk-base"; +import { relayer } from "@certusone/wormhole-sdk"; export const command = "status "; export const desc = "Prints information about the automatic delivery initiated on the specified network, chain, and tx"; -// export const builder = (y: typeof yargs) => -// y -// .positional("network", { -// describe: "Network", -// choices: ["mainnet", "testnet", "devnet"], -// demandOption: true, -// } as const) -// .positional("chain", { -// describe: "Source chain", -// choices: CHAIN_NAME_CHOICES, -// demandOption: true, -// } as const) -// .positional("tx", { -// describe: "Source transaction hash", -// type: "string", -// demandOption: true, -// } as const); -// export const handler = async ( -// argv: Awaited["argv"]> -// ) => { -// const network = getNetwork(argv.network); -// const chain = argv.chain; -// assertChain(chain); +export const builder = (y: typeof yargs) => + y + .positional("network", { + describe: "Network", + choices: ["mainnet", "testnet", "devnet"], + demandOption: true, + } as const) + .positional("chain", { + describe: + "Source chain. To see a list of supported chains, run `worm chains`", + type: "string", + demandOption: true, + } as const) + .positional("tx", { + describe: "Source transaction hash", + type: "string", + demandOption: true, + } as const); +export const handler = async ( + argv: Awaited["argv"]> +) => { + const network = getNetwork(argv.network); + const chain = chainToChain(argv.chain); + assertChain(chain); -// const addr = contracts.relayer.get(network, chain); -// if (!addr) { -// throw new Error(`Wormhole Relayer not deployed on ${chain} in ${network}`); -// } + const addr = contracts.relayer.get(network, chain); + if (!addr) { + throw new Error(`Wormhole Relayer not deployed on ${chain} in ${network}`); + } -// const sourceRPC = NETWORKS[network][chain].rpc; -// const sourceChainProvider = new ethers.providers.JsonRpcProvider(sourceRPC); -// const targetChainProviders = new Map(); -// for (const key in NETWORKS[network]) { -// targetChainProviders.set( -// key as Chain, -// new ethers.providers.JsonRpcProvider(NETWORKS[network][key as Chain].rpc) -// ); -// } + const sourceRPC = NETWORKS[network][chain].rpc; + const sourceChainProvider = new ethers.providers.JsonRpcProvider(sourceRPC); + const targetChainProviders = new Map(); + for (const key in NETWORKS[network]) { + targetChainProviders.set( + key as Chain, + new ethers.providers.JsonRpcProvider(NETWORKS[network][key as Chain].rpc) + ); + } -// const info = await relayer.getWormholeRelayerInfo(chain, argv.tx, { -// environment: network, -// sourceChainProvider, -// targetChainProviders, -// }); + // TODO: Convert this over to sdkv2 + // const info = await relayer.getWormholeRelayerInfo(chain, argv.tx, { + // environment: network, + // sourceChainProvider, + // targetChainProviders, + // }); + // console.log(relayer.stringifyWormholeRelayerInfo(info)); -// console.log(relayer.stringifyWormholeRelayerInfo(info)); -// }; + console.log("Not implemented"); +}; diff --git a/clients/js/src/cmds/submit.ts b/clients/js/src/cmds/submit.ts index de526bc410..c76db5117c 100644 --- a/clients/js/src/cmds/submit.ts +++ b/clients/js/src/cmds/submit.ts @@ -3,27 +3,27 @@ import { execute_algorand } from "../algorand"; import { execute_aptos } from "../aptos"; import { submit as submitSei } from "../chains/sei"; import { submit as submitSui } from "../chains/sui"; -import { CHAIN_NAME_CHOICES, NETWORK_OPTIONS } from "../consts"; +import { NETWORK_OPTIONS } from "../consts"; import { execute_evm } from "../evm"; import { execute_injective } from "../injective"; import { execute_near } from "../near"; import { execute_solana } from "../solana"; import { execute_terra } from "../terra"; -import { assertKnownPayload, impossible, parse, Payload, VAA } from "../vaa"; +import { assertKnownPayload, parse, Payload, VAA } from "../vaa"; import { execute_xpla } from "../xpla"; import { NETWORKS } from "../consts"; -import { getNetwork } from "../utils"; +import { chainToChain, getNetwork } from "../utils"; import { Chain, Network, PlatformToChains, assertChain, assertChainId, + chainIdToChain, chainToPlatform, chains, contracts, toChain, - toChainId, } from "@wormhole-foundation/sdk"; export const command = "submit "; @@ -37,8 +37,9 @@ export const builder = (y: typeof yargs) => }) .option("chain", { alias: "c", - describe: "chain name", - choices: CHAIN_NAME_CHOICES, + describe: + "chain name. To see a list of supported chains, run `worm chains`", + type: "string", demandOption: false, } as const) .option("network", NETWORK_OPTIONS) @@ -102,22 +103,34 @@ export const handler = async ( // get VAA chain const vaa_chain_id = "chain" in parsed_vaa.payload ? parsed_vaa.payload.chain : 0; - assertChainId(vaa_chain_id); - const vaa_chain = toChain(vaa_chain_id); + + // if vaa_chain_id is 0, it means the chain is not specified in the VAA. + // We don't have a notion of an unsupported chain, so we don't want to just assert. + let vaa_chain; + if (vaa_chain_id !== 0) { + assertChainId(vaa_chain_id); + vaa_chain = chainIdToChain(vaa_chain_id); + } // get chain from command line arg - const cli_chain = argv.chain; + const cli_chain = argv.chain ? chainToChain(argv.chain) : argv.chain; let chain: Chain; if (cli_chain !== undefined) { assertChain(cli_chain); - if (cli_chain !== vaa_chain) { + if (vaa_chain && cli_chain !== vaa_chain) { throw Error( `Specified target chain (${cli_chain}) does not match VAA target chain (${vaa_chain})` ); } chain = toChain(cli_chain); } else { + if (!vaa_chain) { + throw Error( + `VAA does not specify a target chain and one was not provided, please specify one with --chain or -c` + ); + } + assertChain(vaa_chain); chain = vaa_chain; } diff --git a/clients/js/src/cmds/sui/setup.ts b/clients/js/src/cmds/sui/setup.ts index e73dcba650..4f10fbedc3 100644 --- a/clients/js/src/cmds/sui/setup.ts +++ b/clients/js/src/cmds/sui/setup.ts @@ -31,7 +31,12 @@ import { import { YargsAddCommandsFn } from "../Yargs"; import { deploy } from "./deploy"; import { initExampleApp, initTokenBridge, initWormhole } from "./init"; -import { Chain, chainIdToChain, toChainId } from "@wormhole-foundation/sdk"; +import { + Chain, + chainIdToChain, + deserialize, + toChainId, +} from "@wormhole-foundation/sdk"; export const addSetupCommands: YargsAddCommandsFn = (y: typeof yargs) => y.command( @@ -247,3 +252,34 @@ const getEmitterCapObjectId = async ( }, }) )?.emitter_cap.fields.id.id; + +// export interface ParsedTokenBridgeRegisterChainVaa +// extends ParsedGovernanceVaa, +// TokenBridgeRegisterChain {} + +// type SignedVaa = Uint8Array | Buffer; +// export function parseTokenBridgeRegisterChainVaa( +// vaa: SignedVaa // type SignedVaa = Uint8Array | Buffer +// ): ParsedTokenBridgeRegisterChainVaa { +// const rc = deserialize("TokenBridge:RegisterChain", vaa); +// const parsed = parseGovernanceVaa(vaa); +// if (parsed.action != TokenBridgeGovernanceAction.RegisterChain) { +// throw new Error( +// "parsed.action != TokenBridgeGovernanceAction.RegisterChain" +// ); +// } +// return { +// ...parsed, +// ...parseTokenBridgeRegisterChainGovernancePayload(parsed.orderPayload), +// }; +// } + +// export interface ParsedGovernanceVaa extends ParsedVaa, Governance {} + +// export function parseGovernanceVaa(vaa: SignedVaa): ParsedGovernanceVaa { +// const parsed = parseVaa(vaa); +// return { +// ...parsed, +// ...parseGovernancePayload(parsed.payload), +// }; +// } diff --git a/clients/js/src/cmds/transfer.ts b/clients/js/src/cmds/transfer.ts index 4aa174b5ba..f169455999 100644 --- a/clients/js/src/cmds/transfer.ts +++ b/clients/js/src/cmds/transfer.ts @@ -1,12 +1,6 @@ -import { - isCosmWasmChain, - isEVMChain, - isTerraChain, -} from "@certusone/wormhole-sdk/lib/esm/utils/consts"; import yargs from "yargs"; -import { impossible } from "../vaa"; import { transferEVM } from "../evm"; -import { CHAIN_NAME_CHOICES, NETWORK_OPTIONS, NETWORKS } from "../consts"; +import { NETWORK_OPTIONS, NETWORKS } from "../consts"; import { transferTerra } from "../terra"; import { transferInjective } from "../injective"; import { transferXpla } from "../xpla"; @@ -18,24 +12,25 @@ import { transferAptos } from "../aptos"; import { Chain, PlatformToChains, - chain, chainToPlatform, toChain, } from "@wormhole-foundation/sdk-base"; -import { getNetwork } from "../utils"; +import { chainToChain, getNetwork } from "../utils"; export const command = "transfer"; export const desc = "Transfer a token"; export const builder = (y: typeof yargs) => y .option("src-chain", { - describe: "source chain", - choices: CHAIN_NAME_CHOICES, + describe: + "source chain. To see a list of supported chains, run `worm chains`", + type: "string", demandOption: true, }) .option("dst-chain", { - describe: "destination chain", - choices: CHAIN_NAME_CHOICES, + describe: + "destination chain. To see a list of supported chains, run `worm chains`", + type: "string", demandOption: true, }) .option("dst-addr", { @@ -65,8 +60,8 @@ export const builder = (y: typeof yargs) => export const handler = async ( argv: Awaited["argv"]> ) => { - const srcChain: Chain = argv["src-chain"]; - const dstChain: Chain = argv["dst-chain"]; + const srcChain: Chain = chainToChain(argv["src-chain"]); + const dstChain: Chain = chainToChain(argv["dst-chain"]); // TODO: support transfers to sei if (dstChain === "Sei") { throw new Error("transfer to sei currently unsupported"); @@ -88,7 +83,6 @@ export const handler = async ( if (!rpc) { throw new Error(`No ${network} rpc defined for ${srcChain}`); } - // if (isEVMChain(srcChain)) { if (chainToPlatform(srcChain) === "Evm") { await transferEVM( srcChain as PlatformToChains<"Evm">, diff --git a/clients/js/src/consts/contracts.ts b/clients/js/src/consts/contracts.ts index 1208d81419..831b09d47c 100644 --- a/clients/js/src/consts/contracts.ts +++ b/clients/js/src/consts/contracts.ts @@ -1,61 +1,5 @@ -// import { -// CHAIN_ID_SOLANA, -// CONTRACTS as SDK_CONTRACTS, -// } from "@certusone/wormhole-sdk/lib/esm/utils/consts"; - import { chainToChainId } from "@wormhole-foundation/sdk-base"; -// const OVERRIDES = { -// MAINNET: { -// sui: { -// core: "0xaeab97f96cf9877fee2883315d459552b2b921edc16d7ceac6eab944dd88919c", -// token_bridge: -// "0xc57508ee0d4595e5a8728974a4a93a787d38f339757230d441e895422c07aba9", -// }, -// aptos: { -// token_bridge: -// "0x576410486a2da45eee6c949c995670112ddf2fbeedab20350d506328eefc9d4f", -// core: "0x5bc11445584a763c1fa7ed39081f1b920954da14e04b32440cba863d03e19625", -// nft_bridge: -// "0x1bdffae984043833ed7fe223f7af7a3f8902d04129b14f801823e64827da7130", -// }, -// }, -// TESTNET: { -// sui: { -// core: "0x31358d198147da50db32eda2562951d53973a0c0ad5ed738e9b17d88b213d790", -// token_bridge: -// "0x6fb10cdb7aa299e9a4308752dadecb049ff55a892de92992a1edbd7912b3d6da", -// }, -// aptos: { -// token_bridge: -// "0x576410486a2da45eee6c949c995670112ddf2fbeedab20350d506328eefc9d4f", -// core: "0x5bc11445584a763c1fa7ed39081f1b920954da14e04b32440cba863d03e19625", -// nft_bridge: undefined, -// }, -// }, -// DEVNET: { -// sui: { -// core: "0x12253210c90f89e7a8525e6c52d41309ff5bfb31f43f561b5fe6f50cd72f9668", // wormhole module State object ID -// token_bridge: -// "0x830ed228c6f1bcb40003bb49af3277df2cbf933d63a6bcdcb0ba4580a1a7654e", // token_bridge module State object ID -// }, -// aptos: { -// token_bridge: -// "0x84a5f374d29fc77e370014dce4fd6a55b58ad608de8074b0be5571701724da31", -// core: "0xde0036a9600559e295d5f6802ef6f3f802f510366e0c23912b0655d972166017", -// nft_bridge: -// "0x46da3d4c569388af61f951bdd1153f4c875f90c2991f6b2d0a38e2161a40852c", -// }, -// }, -// }; - -// // TODO(aki): move this to SDK at some point -// export const CONTRACTS = { -// MAINNET: { ...SDK_CONTRACTS.MAINNET, ...OVERRIDES.MAINNET }, -// TESTNET: { ...SDK_CONTRACTS.TESTNET, ...OVERRIDES.TESTNET }, -// DEVNET: { ...SDK_CONTRACTS.DEVNET, ...OVERRIDES.DEVNET }, -// }; - export const GOVERNANCE_CHAIN = chainToChainId("Solana"); export const GOVERNANCE_EMITTER = "0000000000000000000000000000000000000000000000000000000000000004"; diff --git a/clients/js/src/emitter.ts b/clients/js/src/emitter.ts index e785206435..447e04e9e3 100644 --- a/clients/js/src/emitter.ts +++ b/clients/js/src/emitter.ts @@ -1,28 +1,34 @@ -import { - getEmitterAddressAlgorand, - getEmitterAddressEth, - getEmitterAddressNear, - getEmitterAddressSolana, - getEmitterAddressTerra, -} from "@certusone/wormhole-sdk/lib/esm/bridge/getEmitterAddress"; import { Chain, ChainId, chainToPlatform, toChain, } from "@wormhole-foundation/sdk-base"; +import { decodeAddress, getApplicationAddress } from "algosdk"; +import { uint8ArrayToHex } from "./sdk/array"; +import { arrayify, sha256, zeroPad } from "ethers/lib/utils"; +import { bech32 } from "bech32"; +import { PublicKey } from "@solana/web3.js"; export async function getEmitterAddress(chain: ChainId | Chain, addr: string) { const localChain = toChain(chain); - if (localChain === "Solana" || localChain === "Pythnet") { - // TODO: Create an isSolanaChain() - addr = getEmitterAddressSolana(addr); + if (chainToPlatform(localChain) === "Solana") { + const seeds = [Buffer.from("emitter")]; + const programAddr = PublicKey.findProgramAddressSync( + seeds, + new PublicKey(addr) + )[0]; + addr = programAddr.toBuffer().toString("hex"); } else if (chainToPlatform(localChain) === "Cosmwasm") { - addr = await getEmitterAddressTerra(addr); + addr = Buffer.from( + zeroPad(bech32.fromWords(bech32.decode(addr).words), 32) + ).toString("hex"); } else if (localChain === "Algorand") { - addr = getEmitterAddressAlgorand(BigInt(addr)); + const appAddr: string = getApplicationAddress(BigInt(addr)); + const decAppAddr: Uint8Array = decodeAddress(appAddr).publicKey; + addr = uint8ArrayToHex(decAppAddr); } else if (localChain === "Near") { - addr = getEmitterAddressNear(addr); + addr = uint8ArrayToHex(arrayify(sha256(Buffer.from(addr, "utf8")))); } else if (localChain === "Aptos") { // TODO: There should be something in the SDK to do this. if ( @@ -59,7 +65,8 @@ export async function getEmitterAddress(chain: ChainId | Chain, addr: string) { throw Error(`Unsupported Sui address: ${addr}`); } } else { - addr = getEmitterAddressEth(addr); + // This is the Eth version + addr = Buffer.from(zeroPad(arrayify(addr), 32)).toString("hex"); } return addr; diff --git a/clients/js/src/evm.ts b/clients/js/src/evm.ts index 7ea4f27ad1..1cad5488bf 100644 --- a/clients/js/src/evm.ts +++ b/clients/js/src/evm.ts @@ -16,7 +16,6 @@ import { transferFromEth, transferFromEthNative, } from "@certusone/wormhole-sdk/lib/esm/token_bridge/transfer"; -import { tryNativeToUint8Array } from "@certusone/wormhole-sdk/lib/esm/utils"; import { Chain, Network, @@ -25,6 +24,7 @@ import { chains, contracts, } from "@wormhole-foundation/sdk-base"; +import { tryNativeToUint8Array } from "./sdk/array"; const _IMPLEMENTATION_SLOT = "0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc"; diff --git a/clients/js/src/injective.ts b/clients/js/src/injective.ts index 1dd7c21a9a..9b71966fd8 100644 --- a/clients/js/src/injective.ts +++ b/clients/js/src/injective.ts @@ -16,7 +16,6 @@ import { fromUint8Array } from "js-base64"; import { NETWORKS } from "./consts"; import { impossible, Payload } from "./vaa"; import { transferFromInjective } from "@certusone/wormhole-sdk/lib/esm/token_bridge/injective"; -import { tryNativeToUint8Array } from "@certusone/wormhole-sdk/lib/esm/utils"; import { Chain, chainToChainId, @@ -24,6 +23,7 @@ import { Network, } from "@wormhole-foundation/sdk-base"; import { chains } from "@wormhole-foundation/sdk"; +import { tryNativeToUint8Array } from "./sdk/array"; export async function execute_injective( payload: Payload, diff --git a/clients/js/src/near.ts b/clients/js/src/near.ts index cbaa953638..3bdc584856 100644 --- a/clients/js/src/near.ts +++ b/clients/js/src/near.ts @@ -1,21 +1,19 @@ import BN from "bn.js"; import { Account, connect, KeyPair } from "near-api-js"; import { InMemoryKeyStore } from "near-api-js/lib/key_stores"; -import { Provider } from "near-api-js/lib/providers"; -import { CodeResult } from "near-api-js/lib/providers/provider"; import { NETWORKS } from "./consts"; import { impossible, Payload } from "./vaa"; import { transferNearFromNear, transferTokenFromNear, } from "@certusone/wormhole-sdk/lib/esm/token_bridge/transfer"; -import { tryNativeToUint8Array } from "@certusone/wormhole-sdk/lib/esm/utils"; import { Chain, chainToChainId, contracts, Network, } from "@wormhole-foundation/sdk-base"; +import { tryNativeToUint8Array } from "./sdk/array"; export function keyPairToImplicitAccount(keyPair: KeyPair): string { return Buffer.from(keyPair.getPublicKey().data).toString("hex"); @@ -222,40 +220,3 @@ export async function transferNear( } } } - -export async function hashLookup( - provider: Provider, - tokenBridge: string, - hash: string -): Promise<{ found: boolean; value: string }> { - const [found, value] = await callFunctionNear( - provider, - tokenBridge, - "hash_lookup", - { - hash, - } - ); - return { - found, - value, - }; -} - -export async function callFunctionNear( - provider: Provider, - accountId: string, - methodName: string, - args?: any -) { - const response = await provider.query({ - request_type: "call_function", - account_id: accountId, - method_name: methodName, - args_base64: args - ? Buffer.from(JSON.stringify(args)).toString("base64") - : "", - finality: "final", - }); - return JSON.parse(Buffer.from(response.result).toString()); -} diff --git a/clients/js/src/parse_tests.test.ts b/clients/js/src/parse_tests.test.ts new file mode 100644 index 0000000000..76987fd2d6 --- /dev/null +++ b/clients/js/src/parse_tests.test.ts @@ -0,0 +1,1659 @@ +import exp from "constants"; + +const { exec } = require("child_process"); + +describe("Info Tests", () => { + it("worm info contract mainnet ethereum TokenBridge", (done) => { + exec( + "node build/main.js info contract mainnet ethereum TokenBridge", + (error: any, stdout: string, stderr: any) => { + if (error) { + done(`Execution error: ${error}`); + return; + } + + const expectedOutput = "0x3ee18B2214AFF97000D974cf647E7C347E8fa585"; + + expect(stdout.trim()).toBe(expectedOutput.trim()); + done(); + } + ); + }); + + it("worm info contract mainnet Bsc NFTBridge", (done) => { + exec( + "node build/main.js info contract mainnet Bsc NFTBridge", + (error: any, stdout: string, stderr: any) => { + if (error) { + done(`Execution error: ${error}`); + return; + } + + const expectedOutput = "0x5a58505a96D1dbf8dF91cB21B54419FC36e93fdE"; + + expect(stdout.trim()).toBe(expectedOutput.trim()); + done(); + } + ); + }); + + it("worm info rpc mainnet Bsc", (done) => { + exec( + "node build/main.js info rpc mainnet Bsc", + (error: any, stdout: string, stderr: any) => { + if (error) { + done(`Execution error: ${error}`); + return; + } + + const expectedOutput = "https://bsc-dataseed.binance.org/"; + + expect(stdout.trim()).toBe(expectedOutput.trim()); + done(); + } + ); + }); + + it("worm info wrapped ethereum 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 sui", (done) => { + exec( + "node build/main.js info wrapped ethereum 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 sui", + (error: any, stdout: string, stderr: any) => { + if (error) { + done(`Execution error: ${error}`); + return; + } + + const expectedOutput = + "0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN"; + + expect(stdout.trim()).toBe(expectedOutput.trim()); + done(); + } + ); + }); + + it("worm info origin sui 0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN", (done) => { + exec( + "node build/main.js info origin sui 0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN", + (error: any, stdout: string, stderr: any) => { + if (error) { + return done(new Error(`Execution error: ${error}`)); + } + + try { + // Clean up the output to make it valid JSON + const cleanedOutput = stdout + .replace(/'/g, '"') // Replace single quotes with double quotes + .replace(/(\w+):/g, '"$1":') // Add double quotes around property names + .trim(); + + const outputObject = JSON.parse(cleanedOutput); + + const expectedOutput = { + isWrapped: true, + chainId: 2, + assetAddress: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", + }; + + expect(outputObject.isWrapped).toBe(expectedOutput.isWrapped); + expect(outputObject.chainId).toBe(expectedOutput.chainId); + expect(outputObject.assetAddress).toBe(expectedOutput.assetAddress); + + done(); + } catch (e) { + done(`JSON parse error: ${e}`); + } + } + ); + }); + + it("worm info registrations mainnet ethereum TokenBridge -v", (done) => { + exec( + "node build/main.js info registrations mainnet ethereum TokenBridge -v", + (error: any, stdout: string, stderr: any) => { + try { + if (error) { + done(`Execution error: ${error}`); + return; + } + + // Use a regular expression to extract the relevant part of stdout + const regex = /succeeded|Mismatches/; + const match = stdout.match(regex); + if (!match) { + done("The command failed to execute successfully."); + } + + done(); + } catch (e) { + console.log("caught a weird error", e); + done(e); + } + } + ); + }); + + it("worm evm info -c Bsc -n mainnet -m TokenBridge", (done) => { + exec( + "node build/main.js evm info -c Bsc -n mainnet -m TokenBridge", + (error: any, stdout: string, stderr: any) => { + if (error) { + done(`Execution error: ${error}`); + return; + } + + try { + const outputObject = JSON.parse(stdout); + + const expectedOutput = { + address: "0xB6F6D86a8f9879A9c87f643768d9efc38c1Da6E7", + wormhole: "0x98f3c9e6E3fAce36bAAd05FE09d375Ef1464288B", + implementation: "0x621199f6beB2ba6fbD962E8A52A320EA4F6D4aA3", + isInitialized: true, + tokenImplementation: "0x7f8C5e730121657E17E452c5a1bA3fA1eF96f22a", + chainId: 4, + finality: 15, + evmChainId: "56", + isFork: false, + governanceChainId: 1, + governanceContract: + "0x0000000000000000000000000000000000000000000000000000000000000004", + WETH: "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c", + registrations: { + Solana: + "0xec7372995d5cc8732397fb0ad35c0121e0eaa90d26f828a534cab54391b3a4f5", + Ethereum: + "0x0000000000000000000000003ee18b2214aff97000d974cf647e7c347e8fa585", + Terra: + "0x0000000000000000000000007cf7b764e38a0a5e967972c1df77d432510564e2", + Polygon: + "0x0000000000000000000000005a58505a96d1dbf8df91cb21b54419fc36e93fde", + Avalanche: + "0x0000000000000000000000000e082f06ff657d94310cb8ce8b0d9a04541d8052", + Oasis: + "0x0000000000000000000000005848c791e09901b40a9ef749f2a6735b418d7564", + Algorand: + "0x67e93fa6c8ac5c819990aa7340c0c16b508abb1178be9b30d024b8ac25193d45", + Aurora: + "0x00000000000000000000000051b5123a7b0f9b2ba265f9c4c8de7d78d52f510f", + Fantom: + "0x0000000000000000000000007c9fc5741288cdfdd83ceb07f3ea7e22618d79d2", + Karura: + "0x000000000000000000000000ae9d7fe007b3327aa64a32824aaac52c42a6e624", + Acala: + "0x000000000000000000000000ae9d7fe007b3327aa64a32824aaac52c42a6e624", + Klaytn: + "0x0000000000000000000000005b08ac39eaed75c0439fc750d9fe7e1f9dd0193f", + Celo: "0x000000000000000000000000796dff6d74f3e27060b71255fe517bfb23c93eed", + Near: "0x148410499d3fcda4dcfd68a1ebfcdddda16ab28326448d4aae4d2f0465cdfcb7", + Moonbeam: + "0x000000000000000000000000b1731c586ca89a23809861c6103f0b96b3f57d92", + Terra2: + "0xa463ad028fb79679cfc8ce1efba35ac0e77b35080a1abe9bebe83461f176b0a3", + Injective: + "0x00000000000000000000000045dbea4617971d93188eda21530bc6503d153313", + Sui: "0xccceeb29348f71bdd22ffef43a2a19c1f5b5e17c5cca5411529120182672ade5", + Aptos: + "0x0000000000000000000000000000000000000000000000000000000000000001", + Arbitrum: + "0x0000000000000000000000000b2402144bb366a632d14b83f244d2e0e21bd39c", + Optimism: + "0x0000000000000000000000001d68124e65fafc907325e3edbf8c4d84499daa8b", + Gnosis: + "0x0000000000000000000000000000000000000000000000000000000000000000", + Pythnet: + "0x0000000000000000000000000000000000000000000000000000000000000000", + Xpla: "0x8f9cf727175353b17a5f574270e370776123d90fd74956ae4277962b4fdee24c", + Base: "0x0000000000000000000000008d2de8d2f73f1f4cab472ac9a881c9b123c79627", + Sei: "0x86c5fd957e2db8389553e1728f9c27964b22a8154091ccba54d75f4b10c61f5e", + Rootstock: + "0x0000000000000000000000000000000000000000000000000000000000000000", + Scroll: + "0x00000000000000000000000024850c6f61c438823f01b7a3bf2b89b72174fa9d", + Mantle: + "0x00000000000000000000000024850c6f61c438823f01b7a3bf2b89b72174fa9d", + Blast: + "0x00000000000000000000000024850c6f61c438823f01b7a3bf2b89b72174fa9d", + Xlayer: + "0x0000000000000000000000005537857664b0f9efe38c9f320f75fef23234d904", + }, + }; + + expect(outputObject.address).toBe(expectedOutput.address); + expect(outputObject.wormhole).toBe(expectedOutput.wormhole); + expect(outputObject.implementation).toBe( + expectedOutput.implementation + ); + expect(outputObject.isInitialized).toBe(expectedOutput.isInitialized); + expect(outputObject.tokenImplementation).toBe( + expectedOutput.tokenImplementation + ); + expect(outputObject.chainId).toBe(expectedOutput.chainId); + expect(outputObject.finality).toBe(expectedOutput.finality); + expect(outputObject.evmChainId).toBe(expectedOutput.evmChainId); + expect(outputObject.isFork).toBe(expectedOutput.isFork); + expect(outputObject.governanceChainId).toBe( + expectedOutput.governanceChainId + ); + expect(outputObject.governanceContract).toBe( + expectedOutput.governanceContract + ); + expect(outputObject.WETH).toBe(expectedOutput.WETH); + expect(outputObject.registrations).toMatchObject( + expectedOutput.registrations + ); + + done(); + } catch (e) { + done(`JSON parse error: ${e}`); + } + } + ); + }); +}); + +describe("EVM Tests", () => { + it("worm evm address-from-secret 0xcfb12303a19cde580bb4dd771639b0d26bc68353645571a8cff516ab2ee113a0", (done) => { + exec( + "node build/main.js evm address-from-secret 0xcfb12303a19cde580bb4dd771639b0d26bc68353645571a8cff516ab2ee113a0", + (error: any, stdout: string, stderr: any) => { + if (error) { + done(`Execution error: ${error}`); + return; + } + + const expectedOutput = "0xbeFA429d57cD18b7F8A4d91A2da9AB4AF05d0FBe"; + + expect(stdout.trim()).toBe(expectedOutput.trim()); + done(); + } + ); + }); +}); + +describe("Generate Tests", () => { + it("worm generate registration", (done) => { + exec( + "node build/main.js generate registration --module NFTBridge --chain bsc --contract-address 0x706abc4E45D419950511e474C7B9Ed348A4a716c --guardian-secret cfb12303a19cde580bb4dd771639b0d26bc68353645571a8cff516ab2ee113a0", + (error: any, stdout: string, stderr: any) => { + if (error) { + return done(new Error(`Execution error during generation: ${error}`)); + } + + const vaa = stdout.trim(); + expect(vaa).not.toBeNull(); + + exec( + `node build/main.js parse ${vaa}`, + (error: any, stdout: string, stderr: any) => { + if (error) { + return done(new Error(`Execution error during parse: ${error}`)); + } + try { + const outputObject = JSON.parse(stdout); + + const expectedOutput = { + version: 1, + guardianSetIndex: 0, + signatures: [ + { + guardianSetIndex: 0, + signature: + "94f4939b482834dbdd5fc4391aeb42c3cedc26a24f057d01bdebfbafac33db98712c1d8ae8f4474108cd725f2371705e2de78a3ee8267d18623a6205f47b4be100", + }, + ], + timestamp: 1, + nonce: 1, + emitterChain: 1, + emitterAddress: + "0x0000000000000000000000000000000000000000000000000000000000000004", + sequence: "8577293", + consistencyLevel: 0, + payload: { + module: "NFTBridge", + type: "RegisterChain", + chain: 0, + emitterChain: 4, + emitterAddress: + "0x000000000000000000000000706abc4e45d419950511e474c7b9ed348a4a716c", + }, + digest: + "0x662f2eef2c8522846c34d312b3e48219d73b7d0af08f16bae95a6e4d8363c8ce", + }; + + // Can't check the signature, sequence, or digest because they are different each time. + expect(outputObject.version).toBe(expectedOutput.version); + expect(outputObject.guardianSetIndex).toBe( + expectedOutput.guardianSetIndex + ); + expect(outputObject.timestamp).toBe(expectedOutput.timestamp); + expect(outputObject.nonce).toBe(expectedOutput.nonce); + expect(outputObject.emitterChain).toBe( + expectedOutput.emitterChain + ); + expect(outputObject.emitterAddress).toBe( + expectedOutput.emitterAddress + ); + expect(outputObject.consistencyLevel).toBe( + expectedOutput.consistencyLevel + ); + expect(outputObject.payload).toMatchObject( + expectedOutput.payload + ); + done(); + } catch (e) { + done(`JSON parse error: ${e}`); + return; + } + } + ); + } + ); + }); + + it("worm generate attestation", (done) => { + exec( + "node build/main.js generate attestation --emitter-chain Ethereum --emitter-address 11111111111111111111111111111115 --chain Ethereum --token-address 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 --decimals 6 --symbol USDC --name USDC --guardian-secret cfb12303a19cde580bb4dd771639b0d26bc68353645571a8cff516ab2ee113a0", + (error: any, stdout: string, stderr: any) => { + if (error) { + return done(new Error(`Execution error during generation: ${error}`)); + } + + const vaa = stdout.trim(); + expect(vaa).not.toBeNull(); + + exec( + `node build/main.js parse ${vaa}`, + (error: any, stdout: string, stderr: any) => { + if (error) { + return done(new Error(`Execution error during parse: ${error}`)); + } + try { + const outputObject = JSON.parse(stdout); + + const expectedOutput = { + version: 1, + guardianSetIndex: 0, + signatures: [ + { + guardianSetIndex: 0, + signature: + "342fc4c226d53b85d3ac15f88bca0585b0e4990f0d32a1ef69f1437bb0040d4b7c3d07f388b7c95646eaaaf5343e9af5fee5abc87e98b0c46334cd935d0c423200", + }, + ], + timestamp: 1, + nonce: 1, + emitterChain: 2, + emitterAddress: + "0x0000000000000000000000000000000011111111111111111111111111111115", + sequence: "93992518", + consistencyLevel: 0, + payload: { + module: "TokenBridge", + chain: 0, + type: "AttestMeta", + tokenAddress: + "0x000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", + tokenChain: 2, + decimals: 6, + symbol: + "USDC\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000", + name: "USDC\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000", + }, + digest: + "0x898a01e89a1757d9cdefa63af43f7b3cce0883a2365f6c2c4103b4474e741a29", + }; + + // Can't check the signature, sequence, or digest because they are different each time. + expect(outputObject.version).toBe(expectedOutput.version); + expect(outputObject.guardianSetIndex).toBe( + expectedOutput.guardianSetIndex + ); + expect(outputObject.timestamp).toBe(expectedOutput.timestamp); + expect(outputObject.nonce).toBe(expectedOutput.nonce); + expect(outputObject.emitterChain).toBe( + expectedOutput.emitterChain + ); + expect(outputObject.emitterAddress).toBe( + expectedOutput.emitterAddress + ); + expect(outputObject.consistencyLevel).toBe( + expectedOutput.consistencyLevel + ); + expect(outputObject.payload).toMatchObject( + expectedOutput.payload + ); + done(); + } catch (e) { + done(`JSON parse error: ${e}`); + return; + } + } + ); + } + ); + }); +}); + +describe("Parse Tests", () => { + it("worm parse base64-1", (done) => { + exec( + "node build/main.js parse AQAAAAENAnOvPC9VmJBBsAaKTq66j4glEGAhmW3mFDlUwG/Ez61cPxq6bKlRGI6WLxElHCXKmGKGheL8K2XsYJRQz8TmURIAAwDGLrDeerPQKJIPGOEN9/KgTQDriLiUCie7zozmbGdSaILJbMUN04G9v/MLtluTR8rf8JZ2cpBDr2DWUqC5BjAABPB7D+bKsYvnroJ/4RyomS/wtaKjLWW+lYIxv4TPaxT7XuuKUa3hxwqluLjPg6/jwi00cUgb2jiW6ipwRp+WkrgABXTUlnKd3m4ZCVmheUXofNleI8EAR6su71x9Dsb5EgjHJ52KGx9KYAadJZMqZ9ZV8tC0IFkAPedf08p5kv3RsNQBBlHwarb9/ULzI4QKgYs4z9HJnSI2bId5A7mN9Ava8qIELrjNDlnEY35qgKGZsRCM12WbqDcPb5R2tHmDmFTYwaYAB3hLN8YQPHUs2XpYa+jhzv8ipuSIQzKE/zHNkItcfYfiRNp1FtB6D6aSaE+Cbl5si0UgBCBtb+W65Gr7HCGM9Q0ACQtszOZ+1QHLIPsG3na5CD8TKa1404RRepSrjpqmAb56DwC7YDs2UEp03cNnNZyOoH9czVAidyzBV+APVBVjceQBC+HmtxKiNT5JB5KcQFfVur74DcCf67PcKTT0QEh5Xu+VTpkQbLKbGo2TU2na7LuLrkUZLvw87bxXMV1n7J6oAAoADdzATNdVapTotBjcOooA77Eo1PdvcUMSR6kuehmoM/wCIV0f1p4OWW2lMepYeuKsLzbSDzsZMwYK1u8+nX2EdboBDsdiFklJBq7Y2DEMMaXkpUXqKvjb447rdKPRTwc03SsaIbmFDqIObCykIkh4i/sXQ503q9ol1wW1aLJlsRO5dsUAEMYf5uvqYfLK6JXDNJZQcEh9Oatr8EQoNArw92mf3dPAHgyG2uqetElwEkiiT6TA/3X7YAssATS9cheR9mcRbkIAERm3nKolDnXaFILH9BJocwjRPvcA9ya5lBe7da5t0UP8YZ+MnCnHP5lJr/0WKcwoamGRfteFN1SkZwKSC3bPkOsAErC6teGosyHpL509+SQwGD5IQ+V8b4wVwi1isvjkuM3CdZ8oVLjRIqzbS02JKLh99BmcxoMBHS6bfUGpbYtIDMwBAAAAADnEunYAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEJWTS79YITfAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAVG9rZW5CcmlkZ2UCAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJgw==", + (error: any, stdout: string, stderr: any) => { + if (error) { + done(`Execution error: ${error}`); + return; + } + try { + const outputObject = JSON.parse(stdout); + + const expectedOutput = { + version: 1, + guardianSetIndex: 1, + signatures: [ + { + guardianSetIndex: 2, + signature: + "73af3c2f55989041b0068a4eaeba8f8825106021996de6143954c06fc4cfad5c3f1aba6ca951188e962f11251c25ca98628685e2fc2b65ec609450cfc4e6511200", + }, + { + guardianSetIndex: 3, + signature: + "00c62eb0de7ab3d028920f18e10df7f2a04d00eb88b8940a27bbce8ce66c67526882c96cc50dd381bdbff30bb65b9347cadff09676729043af60d652a0b9063000", + }, + { + guardianSetIndex: 4, + signature: + "f07b0fe6cab18be7ae827fe11ca8992ff0b5a2a32d65be958231bf84cf6b14fb5eeb8a51ade1c70aa5b8b8cf83afe3c22d3471481bda3896ea2a70469f9692b800", + }, + { + guardianSetIndex: 5, + signature: + "74d496729dde6e190959a17945e87cd95e23c10047ab2eef5c7d0ec6f91208c7279d8a1b1f4a60069d25932a67d655f2d0b42059003de75fd3ca7992fdd1b0d401", + }, + { + guardianSetIndex: 6, + signature: + "51f06ab6fdfd42f323840a818b38cfd1c99d22366c877903b98df40bdaf2a2042eb8cd0e59c4637e6a80a199b1108cd7659ba8370f6f9476b479839854d8c1a600", + }, + { + guardianSetIndex: 7, + signature: + "784b37c6103c752cd97a586be8e1ceff22a6e488433284ff31cd908b5c7d87e244da7516d07a0fa692684f826e5e6c8b452004206d6fe5bae46afb1c218cf50d00", + }, + { + guardianSetIndex: 9, + signature: + "0b6ccce67ed501cb20fb06de76b9083f1329ad78d384517a94ab8e9aa601be7a0f00bb603b36504a74ddc367359c8ea07f5ccd5022772cc157e00f54156371e401", + }, + { + guardianSetIndex: 11, + signature: + "e1e6b712a2353e4907929c4057d5babef80dc09febb3dc2934f44048795eef954e99106cb29b1a8d935369daecbb8bae45192efc3cedbc57315d67ec9ea8000a00", + }, + { + guardianSetIndex: 13, + signature: + "dcc04cd7556a94e8b418dc3a8a00efb128d4f76f71431247a92e7a19a833fc02215d1fd69e0e596da531ea587ae2ac2f36d20f3b1933060ad6ef3e9d7d8475ba01", + }, + { + guardianSetIndex: 14, + signature: + "c76216494906aed8d8310c31a5e4a545ea2af8dbe38eeb74a3d14f0734dd2b1a21b9850ea20e6c2ca42248788bfb17439d37abda25d705b568b265b113b976c500", + }, + { + guardianSetIndex: 16, + signature: + "c61fe6ebea61f2cae895c334965070487d39ab6bf04428340af0f7699fddd3c01e0c86daea9eb449701248a24fa4c0ff75fb600b2c0134bd721791f667116e4200", + }, + { + guardianSetIndex: 17, + signature: + "19b79caa250e75da1482c7f412687308d13ef700f726b99417bb75ae6dd143fc619f8c9c29c73f9949affd1629cc286a61917ed7853754a46702920b76cf90eb00", + }, + { + guardianSetIndex: 18, + signature: + "b0bab5e1a8b321e92f9d3df92430183e4843e57c6f8c15c22d62b2f8e4b8cdc2759f2854b8d122acdb4b4d8928b87df4199cc683011d2e9b7d41a96d8b480ccc01", + }, + ], + timestamp: 0, + nonce: 969194102, + emitterChain: 1, + emitterAddress: + "0x0000000000000000000000000000000000000000000000000000000000000004", + sequence: "2694510404604284400", + consistencyLevel: 32, + payload: { + module: "TokenBridge", + type: "ContractUpgrade", + chain: 3, + address: + "0x0000000000000000000000000000000000000000000000000000000000000983", + }, + digest: + "0x1eb0950bc47db17fbf95bf5476a83445cf5bee90fcd14ae4d8ac851c2cbd824d", + }; + + expect(outputObject.version).toBe(expectedOutput.version); + expect(outputObject.guardianSetIndex).toBe( + expectedOutput.guardianSetIndex + ); + expect(outputObject.signatures).toMatchObject( + expectedOutput.signatures + ); + expect(outputObject.timestamp).toBe(expectedOutput.timestamp); + expect(outputObject.nonce).toBe(expectedOutput.nonce); + expect(outputObject.emitterChain).toBe(expectedOutput.emitterChain); + expect(outputObject.emitterAddress).toBe( + expectedOutput.emitterAddress + ); + expect(outputObject.sequence).toBe(expectedOutput.sequence); + expect(outputObject.consistencyLevel).toBe( + expectedOutput.consistencyLevel + ); + expect(outputObject.payload).toMatchObject(expectedOutput.payload); + expect(outputObject.digest).toBe(expectedOutput.digest); + + done(); + } catch (e) { + done(`JSON parse error: ${e}`); + } + } + ); + }); + + it("worm parse base64-2", (done) => { + exec( + "node build/main.js parse AQAAAAABAOKdOtGAsVPWjD9EXXXqpi/MmWkJRbqvStBGPpzkTyf3XaPUn3lyKSCqyBuivoD2iIlfF0lC/txAO8TlzjVVt3sAYrn3kQAAAAAAAgAAAAAAAAAAAAAAAPGaKgG3BRn2etswmplOyMaaln6LAAAAAAAAAAABRnJvbTogZXZtMFxuTXNnOiBIZWxsbyBXb3JsZCE=", + (error: any, stdout: string, stderr: any) => { + if (error) { + done(`Execution error: ${error}`); + return; + } + try { + const outputObject = JSON.parse(stdout); + + const expectedOutput = { + version: 1, + guardianSetIndex: 0, + signatures: [ + { + guardianSetIndex: 0, + signature: + "e29d3ad180b153d68c3f445d75eaa62fcc99690945baaf4ad0463e9ce44f27f75da3d49f79722920aac81ba2be80f688895f174942fedc403bc4e5ce3555b77b00", + }, + ], + timestamp: 1656354705, + nonce: 0, + emitterChain: 2, + emitterAddress: + "0x000000000000000000000000f19a2a01b70519f67adb309a994ec8c69a967e8b", + sequence: "0", + consistencyLevel: 1, + payload: { + type: "Other", + hex: "46726f6d3a2065766d305c6e4d73673a2048656c6c6f20576f726c6421", + ascii: "From: evm0\\nMsg: Hello World!", + }, + digest: + "0x8b7781f662ff1eed4827b770c0e735288948f0b56611f8cd73bf65e6b2a7a8ad", + }; + + expect(outputObject.version).toBe(expectedOutput.version); + expect(outputObject.guardianSetIndex).toBe( + expectedOutput.guardianSetIndex + ); + expect(outputObject.signatures).toMatchObject( + expectedOutput.signatures + ); + expect(outputObject.timestamp).toBe(expectedOutput.timestamp); + expect(outputObject.nonce).toBe(expectedOutput.nonce); + expect(outputObject.emitterChain).toBe(expectedOutput.emitterChain); + expect(outputObject.emitterAddress).toBe( + expectedOutput.emitterAddress + ); + expect(outputObject.sequence).toBe(expectedOutput.sequence); + expect(outputObject.consistencyLevel).toBe( + expectedOutput.consistencyLevel + ); + expect(outputObject.payload).toMatchObject(expectedOutput.payload); + expect(outputObject.digest).toBe(expectedOutput.digest); + + done(); + } catch (e) { + done(`JSON parse error: ${e}`); + } + } + ); + }); + + it("worm parse big-payload-3", (done) => { + exec( + "node build/main.js parse 01000000000100fd4cdd0e5a1afd9eb6555770fb132bf03ed8fa1f9e92c6adcec7881ace2ba4ba4c1b350f79da4110d3307053ceb217e4398eaf02be5474a90bd694b0d2ccbdcc0100000000baa551d500010000000000000000000000000000000000000000000000000000000000000004a3fff7bcbfc4b4ac200300000000000000000000000000000000000000000000000000000000000f4240165809739240a0ac03b98440fe8985548e3aa683cd0d4d9df5b5659669faa30100010000000000000000000000007c4dfd6be62406e7f5a05eec96300da4048e70ff0002000000000000000000000000000000000000000000000000000000000000000000000000000005de4c6f72656d20697073756d20646f6c6f722073697420616d65742c20636f6e73656374657475722061646970697363696e6720656c69742e204375726162697475722074656d7075732c206e6571756520656765742068656e64726572697420626962656e64756d2c20616e746520616e7465206469676e697373696d2065782c207175697320616363756d73616e20656c6974206175677565206e6563206c656f2e2050726f696e207669746165206a7573746f207669746165206c6163757320706f737565726520706f72747469746f722e204d61757269732073656420736167697474697320697073756d2e204d6f726269206d61737361206d61676e612c20706f7375657265206e6f6e20696163756c697320656765742c20756c74726963696573206174206c6967756c612e20446f6e656320756c74726963696573206e697369206573742c206574206c6f626f727469732073656d2073616769747469732073697420616d65742e20446f6e6563206665756769617420646f6c6f722061206f64696f2064696374756d2c20736564206c616f72656574206d61676e6120656765737461732e205175697371756520756c7472696369657320666163696c69736973206172637520617420616363756d73616e2e20496e20696163756c697320617420707572757320696e207472697374697175652e204d616563656e617320706f72747469746f722c206e69736c20612073656d706572206d616c6573756164612c2074656c6c7573206e65717565206d616c657375616461206c656f2c2071756973206d6f6c65737469652066656c6973206e69626820696e2065726f732e20446f6e656320766976657272612061726375206e6563206e756e63207072657469756d2c206567657420756c6c616d636f7270657220707572757320706f73756572652e2053757370656e646973736520706f74656e74692e204e616d2067726176696461206c656f206e6563207175616d2074696e636964756e7420766976657272612e205072616573656e74206163207375736369706974206f7263692e20566976616d757320736f64616c6573206d6178696d757320626c616e6469742e2050656c6c656e74657371756520696d706572646965742075726e61206174206e756e63206d616c6573756164612c20696e20617563746f72206d6173736120616c697175616d2e2050656c6c656e746573717565207363656c6572697371756520657569736d6f64206f64696f20612074656d706f722e204e756c6c612073656420706f7274612070757275732c20657520706f727461206f64696f2e20457469616d207175697320706c616365726174206e756c6c612e204e756e6320696e20636f6d6d6f646f206d692c20657520736f64616c6573206e756e632e20416c697175616d206c7563747573206c6f72656d2065742074696e636964756e74206c6163696e69612e20447569732076656c20697073756d206e69736c2e205072616573656e7420636f6e76616c6c697320656c6974206c6967756c612c206e656320706f72746120657374206d6178696d75732061632e204e756c6c61207072657469756d206c696265726f206567657420616e746520756c6c616d636f72706572206d61747469732e204e756c6c616d20766f6c75747061742c2074656c6c757320736564207363656c65726973717565206566666963697475722c206e69736c2061756775652070686172657472612066656c69732c2076656c2067726176696461206d61676e612075726e6120736564207175616d2e2044756973206964207072657469756d206475692e20496e74656765722072686f6e637573206d6174746973206a7573746f20612068656e6472657269742e20467573636520646f6c6f72206d61676e612c20706f72747469746f7220616320707572757320736f64616c65732c20657569736d6f6420766573746962756c756d20746f72746f722e20416c697175616d2070686172657472612065726174206a7573746f2c20696e20756c6c616d636f72706572207175616d2e", + (error: any, stdout: string, stderr: any) => { + if (error) { + done(`Execution error: ${error}`); + return; + } + try { + const outputObject = JSON.parse(stdout); + + const expectedOutput = { + version: 1, + guardianSetIndex: 0, + signatures: [ + { + guardianSetIndex: 0, + signature: + "fd4cdd0e5a1afd9eb6555770fb132bf03ed8fa1f9e92c6adcec7881ace2ba4ba4c1b350f79da4110d3307053ceb217e4398eaf02be5474a90bd694b0d2ccbdcc01", + }, + ], + timestamp: 0, + nonce: 3131396565, + emitterChain: 1, + emitterAddress: + "0x0000000000000000000000000000000000000000000000000000000000000004", + sequence: "11817436337286722732", + consistencyLevel: 32, + payload: { + module: "TokenBridge", + type: "TransferWithPayload", + amount: "1000000", + tokenAddress: + "0x165809739240a0ac03b98440fe8985548e3aa683cd0d4d9df5b5659669faa301", + tokenChain: 1, + toAddress: + "0x0000000000000000000000007c4dfd6be62406e7f5a05eec96300da4048e70ff", + chain: 2, + fromAddress: + "0x0000000000000000000000000000000000000000000000000000000000000000", + payload: + "0x00000000000005de4c6f72656d20697073756d20646f6c6f722073697420616d65742c20636f6e73656374657475722061646970697363696e6720656c69742e204375726162697475722074656d7075732c206e6571756520656765742068656e64726572697420626962656e64756d2c20616e746520616e7465206469676e697373696d2065782c207175697320616363756d73616e20656c6974206175677565206e6563206c656f2e2050726f696e207669746165206a7573746f207669746165206c6163757320706f737565726520706f72747469746f722e204d61757269732073656420736167697474697320697073756d2e204d6f726269206d61737361206d61676e612c20706f7375657265206e6f6e20696163756c697320656765742c20756c74726963696573206174206c6967756c612e20446f6e656320756c74726963696573206e697369206573742c206574206c6f626f727469732073656d2073616769747469732073697420616d65742e20446f6e6563206665756769617420646f6c6f722061206f64696f2064696374756d2c20736564206c616f72656574206d61676e6120656765737461732e205175697371756520756c7472696369657320666163696c69736973206172637520617420616363756d73616e2e20496e20696163756c697320617420707572757320696e207472697374697175652e204d616563656e617320706f72747469746f722c206e69736c20612073656d706572206d616c6573756164612c2074656c6c7573206e65717565206d616c657375616461206c656f2c2071756973206d6f6c65737469652066656c6973206e69626820696e2065726f732e20446f6e656320766976657272612061726375206e6563206e756e63207072657469756d2c206567657420756c6c616d636f7270657220707572757320706f73756572652e2053757370656e646973736520706f74656e74692e204e616d2067726176696461206c656f206e6563207175616d2074696e636964756e7420766976657272612e205072616573656e74206163207375736369706974206f7263692e20566976616d757320736f64616c6573206d6178696d757320626c616e6469742e2050656c6c656e74657371756520696d706572646965742075726e61206174206e756e63206d616c6573756164612c20696e20617563746f72206d6173736120616c697175616d2e2050656c6c656e746573717565207363656c6572697371756520657569736d6f64206f64696f20612074656d706f722e204e756c6c612073656420706f7274612070757275732c20657520706f727461206f64696f2e20457469616d207175697320706c616365726174206e756c6c612e204e756e6320696e20636f6d6d6f646f206d692c20657520736f64616c6573206e756e632e20416c697175616d206c7563747573206c6f72656d2065742074696e636964756e74206c6163696e69612e20447569732076656c20697073756d206e69736c2e205072616573656e7420636f6e76616c6c697320656c6974206c6967756c612c206e656320706f72746120657374206d6178696d75732061632e204e756c6c61207072657469756d206c696265726f206567657420616e746520756c6c616d636f72706572206d61747469732e204e756c6c616d20766f6c75747061742c2074656c6c757320736564207363656c65726973717565206566666963697475722c206e69736c2061756775652070686172657472612066656c69732c2076656c2067726176696461206d61676e612075726e6120736564207175616d2e2044756973206964207072657469756d206475692e20496e74656765722072686f6e637573206d6174746973206a7573746f20612068656e6472657269742e20467573636520646f6c6f72206d61676e612c20706f72747469746f7220616320707572757320736f64616c65732c20657569736d6f6420766573746962756c756d20746f72746f722e20416c697175616d2070686172657472612065726174206a7573746f2c20696e20756c6c616d636f72706572207175616d2e", + }, + digest: + "0xfc3ce17da88ca9085135a7180b5da44808f04fd9b55b26ed14b45cbec96a0e58", + }; + + expect(outputObject.version).toBe(expectedOutput.version); + expect(outputObject.guardianSetIndex).toBe( + expectedOutput.guardianSetIndex + ); + expect(outputObject.signatures).toMatchObject( + expectedOutput.signatures + ); + expect(outputObject.timestamp).toBe(expectedOutput.timestamp); + expect(outputObject.nonce).toBe(expectedOutput.nonce); + expect(outputObject.emitterChain).toBe(expectedOutput.emitterChain); + expect(outputObject.emitterAddress).toBe( + expectedOutput.emitterAddress + ); + expect(outputObject.sequence).toBe(expectedOutput.sequence); + expect(outputObject.consistencyLevel).toBe( + expectedOutput.consistencyLevel + ); + expect(outputObject.payload).toMatchObject(expectedOutput.payload); + expect(outputObject.digest).toBe(expectedOutput.digest); + + done(); + } catch (e) { + done(`JSON parse error: ${e}`); + } + } + ); + }); + + it("worm parse guardian-set-upgrade-1", (done) => { + exec( + "node build/main.js parse 010000000001007ac31b282c2aeeeb37f3385ee0de5f8e421d30b9e5ae8ba3d4375c1c77a86e77159bb697d9c456d6f8c02d22a94b1279b65b0d6a9957e7d3857423845ac758e300610ac1d2000000030001000000000000000000000000000000000000000000000000000000000000000400000000000005390000000000000000000000000000000000000000000000000000000000436f7265020000000000011358cc3ae5c097b213ce3c81979e1b9f9570746aa5ff6cb952589bde862c25ef4392132fb9d4a42157114de8460193bdf3a2fcf81f86a09765f4762fd1107a0086b32d7a0977926a205131d8731d39cbeb8c82b2fd82faed2711d59af0f2499d16e726f6b211b39756c042441be6d8650b69b54ebe715e234354ce5b4d348fb74b958e8966e2ec3dbd4958a7cdeb5f7389fa26941519f0863349c223b73a6ddee774a3bf913953d695260d88bc1aa25a4eee363ef0000ac0076727b35fbea2dac28fee5ccb0fea768eaf45ced136b9d9e24903464ae889f5c8a723fc14f93124b7c738843cbb89e864c862c38cddcccf95d2cc37a4dc036a8d232b48f62cdd4731412f4890da798f6896a3331f64b48c12d1d57fd9cbe7081171aa1be1d36cafe3867910f99c09e347899c19c38192b6e7387ccd768277c17dab1b7a5027c0b3cf178e21ad2e77ae06711549cfbb1f9c7a9d8096e85e1487f35515d02a92753504a8d75471b9f49edb6fbebc898f403e4773e95feb15e80c9a99c8348d", + (error: any, stdout: string, stderr: any) => { + if (error) { + done(`Execution error: ${error}`); + return; + } + try { + const outputObject = JSON.parse(stdout); + + const expectedOutput = { + version: 1, + guardianSetIndex: 0, + signatures: [ + { + guardianSetIndex: 0, + signature: + "7ac31b282c2aeeeb37f3385ee0de5f8e421d30b9e5ae8ba3d4375c1c77a86e77159bb697d9c456d6f8c02d22a94b1279b65b0d6a9957e7d3857423845ac758e300", + }, + ], + timestamp: 1628094930, + nonce: 3, + emitterChain: 1, + emitterAddress: + "0x0000000000000000000000000000000000000000000000000000000000000004", + sequence: "1337", + consistencyLevel: 0, + payload: { + module: "Core", + type: "GuardianSetUpgrade", + chain: 0, + newGuardianSetIndex: 1, + newGuardianSetLength: 19, + newGuardianSet: [ + "58cc3ae5c097b213ce3c81979e1b9f9570746aa5", + "ff6cb952589bde862c25ef4392132fb9d4a42157", + "114de8460193bdf3a2fcf81f86a09765f4762fd1", + "107a0086b32d7a0977926a205131d8731d39cbeb", + "8c82b2fd82faed2711d59af0f2499d16e726f6b2", + "11b39756c042441be6d8650b69b54ebe715e2343", + "54ce5b4d348fb74b958e8966e2ec3dbd4958a7cd", + "eb5f7389fa26941519f0863349c223b73a6ddee7", + "74a3bf913953d695260d88bc1aa25a4eee363ef0", + "000ac0076727b35fbea2dac28fee5ccb0fea768e", + "af45ced136b9d9e24903464ae889f5c8a723fc14", + "f93124b7c738843cbb89e864c862c38cddcccf95", + "d2cc37a4dc036a8d232b48f62cdd4731412f4890", + "da798f6896a3331f64b48c12d1d57fd9cbe70811", + "71aa1be1d36cafe3867910f99c09e347899c19c3", + "8192b6e7387ccd768277c17dab1b7a5027c0b3cf", + "178e21ad2e77ae06711549cfbb1f9c7a9d8096e8", + "5e1487f35515d02a92753504a8d75471b9f49edb", + "6fbebc898f403e4773e95feb15e80c9a99c8348d", + ], + }, + digest: + "0xed3a5600d44b9dcc889daf0178dd69ab1e9356308194ba3628a7b720ae48a8d5", + }; + + expect(outputObject.version).toBe(expectedOutput.version); + expect(outputObject.guardianSetIndex).toBe( + expectedOutput.guardianSetIndex + ); + expect(outputObject.signatures).toMatchObject( + expectedOutput.signatures + ); + expect(outputObject.timestamp).toBe(expectedOutput.timestamp); + expect(outputObject.nonce).toBe(expectedOutput.nonce); + expect(outputObject.emitterChain).toBe(expectedOutput.emitterChain); + expect(outputObject.emitterAddress).toBe( + expectedOutput.emitterAddress + ); + expect(outputObject.sequence).toBe(expectedOutput.sequence); + expect(outputObject.consistencyLevel).toBe( + expectedOutput.consistencyLevel + ); + expect(outputObject.payload).toMatchObject(expectedOutput.payload); + expect(outputObject.digest).toBe(expectedOutput.digest); + + done(); + } catch (e) { + done(`JSON parse error: ${e}`); + } + } + ); + }); + + it("worm parse nft-bridge-transfer-1", (done) => { + exec( + "node build/main.js parse 010000000000000000010000000100010000000000000000000000000000000000000000000000000000000000000004000000000277bb0b0001000000000000000000000000000000000000000000000000000000000000000400010000000000000000000000000000000000000000000000000000000000464f4f0000000000000000000000000000000000000000000000000000000000424152000000000000000000000000000000000000000000000000000000000000000a0a676f6f676c652e636f6d0000000000000000000000000000000000000000000000000000000000000004000a", + (error: any, stdout: string, stderr: any) => { + if (error) { + done(`Execution error: ${error}`); + return; + } + try { + const outputObject = JSON.parse(stdout); + + const expectedOutput = { + version: 1, + guardianSetIndex: 0, + signatures: [], + timestamp: 1, + nonce: 1, + emitterChain: 1, + emitterAddress: + "0x0000000000000000000000000000000000000000000000000000000000000004", + sequence: "41401099", + consistencyLevel: 0, + payload: { + module: "NFTBridge", + type: "Transfer", + tokenAddress: + "0x0000000000000000000000000000000000000000000000000000000000000004", + tokenChain: 1, + tokenSymbol: "FOO", + tokenName: "BAR", + tokenId: "10", + tokenURI: "google.com", + toAddress: + "0x0000000000000000000000000000000000000000000000000000000000000004", + chain: 10, + }, + digest: + "0x5e09cb958c8ee111319472907c3772f63bf4cc599b7126b1ef1bbac82f2fea7a", + }; + + expect(outputObject.version).toBe(expectedOutput.version); + expect(outputObject.guardianSetIndex).toBe( + expectedOutput.guardianSetIndex + ); + expect(outputObject.signatures).toMatchObject( + expectedOutput.signatures + ); + expect(outputObject.timestamp).toBe(expectedOutput.timestamp); + expect(outputObject.nonce).toBe(expectedOutput.nonce); + expect(outputObject.emitterChain).toBe(expectedOutput.emitterChain); + expect(outputObject.emitterAddress).toBe( + expectedOutput.emitterAddress + ); + expect(outputObject.sequence).toBe(expectedOutput.sequence); + expect(outputObject.consistencyLevel).toBe( + expectedOutput.consistencyLevel + ); + expect(outputObject.payload).toMatchObject(expectedOutput.payload); + expect(outputObject.digest).toBe(expectedOutput.digest); + + done(); + } catch (e) { + done(`JSON parse error: ${e}`); + } + } + ); + }); + + it("worm parse token-bridge-attestation-1", (done) => { + exec( + "node build/main.js parse 010000000001006cd3cdd701bbd878eb403f6505b5b797544eb9c486dadf79f0c445e9b8fa5cd474de1683e3a80f7e22dbfacd53b0ddc7b040ff6f974aafe7a6571c9355b8129b00000000007ce2ea3f000195f83a27e90c622a98c037353f271fd8f5f57b4dc18ebf5ff75a934724bd0491a43a1c0020f88a3e2002000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200021200000000000000000000000000000000000000000000000000000000574554480000000000000000000000000000000000000057726170706564206574686572", + (error: any, stdout: string, stderr: any) => { + if (error) { + done(`Execution error: ${error}`); + return; + } + try { + const outputObject = JSON.parse(stdout); + + const expectedOutput = { + version: 1, + guardianSetIndex: 0, + signatures: [ + { + guardianSetIndex: 0, + signature: + "6cd3cdd701bbd878eb403f6505b5b797544eb9c486dadf79f0c445e9b8fa5cd474de1683e3a80f7e22dbfacd53b0ddc7b040ff6f974aafe7a6571c9355b8129b00", + }, + ], + timestamp: 0, + nonce: 2095245887, + emitterChain: 1, + emitterAddress: + "0x95f83a27e90c622a98c037353f271fd8f5f57b4dc18ebf5ff75a934724bd0491", + sequence: "11833801757748136510", + consistencyLevel: 32, + payload: { + module: "TokenBridge", + chain: 0, + type: "AttestMeta", + tokenAddress: + "0x000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", + tokenChain: 2, + decimals: 18, + symbol: + "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000WETH", + name: "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000Wrapped ether", + }, + digest: + "0x4bb52b9a44ff6062ba5db1c47afc40c186f7485c8972b1c6261eb070ce0b1c6e", + }; + + expect(outputObject.version).toBe(expectedOutput.version); + expect(outputObject.guardianSetIndex).toBe( + expectedOutput.guardianSetIndex + ); + expect(outputObject.signatures).toMatchObject( + expectedOutput.signatures + ); + expect(outputObject.timestamp).toBe(expectedOutput.timestamp); + expect(outputObject.nonce).toBe(expectedOutput.nonce); + expect(outputObject.emitterChain).toBe(expectedOutput.emitterChain); + expect(outputObject.emitterAddress).toBe( + expectedOutput.emitterAddress + ); + expect(outputObject.sequence).toBe(expectedOutput.sequence); + expect(outputObject.consistencyLevel).toBe( + expectedOutput.consistencyLevel + ); + expect(outputObject.payload).toMatchObject(expectedOutput.payload); + expect(outputObject.digest).toBe(expectedOutput.digest); + + done(); + } catch (e) { + done(`JSON parse error: ${e}`); + } + } + ); + }); + + it("worm parse token-bridge-registration-1", (done) => { + exec( + "node build/main.js parse 010000000001001890714264dbbc8022a58df0c12b436d588b20b6304b38c383bda1d7fc101bb2443081e6d42719bce602116a1491b10d4666967da9f8d922079759c972ed37b40100000000191428f700010000000000000000000000000000000000000000000000000000000000000004f7c884f209e7158720000000000000000000000000000000000000000000546f6b656e427269646765010000000195f83a27e90c622a98c037353f271fd8f5f57b4dc18ebf5ff75a934724bd0491", + (error: any, stdout: string, stderr: any) => { + if (error) { + done(`Execution error: ${error}`); + return; + } + try { + const outputObject = JSON.parse(stdout); + + const expectedOutput = { + version: 1, + guardianSetIndex: 0, + signatures: [ + { + guardianSetIndex: 0, + signature: + "1890714264dbbc8022a58df0c12b436d588b20b6304b38c383bda1d7fc101bb2443081e6d42719bce602116a1491b10d4666967da9f8d922079759c972ed37b401", + }, + ], + timestamp: 0, + nonce: 420751607, + emitterChain: 1, + emitterAddress: + "0x0000000000000000000000000000000000000000000000000000000000000004", + sequence: "17854666897793422727", + consistencyLevel: 32, + payload: { + module: "TokenBridge", + type: "RegisterChain", + chain: 0, + emitterChain: 1, + emitterAddress: + "0x95f83a27e90c622a98c037353f271fd8f5f57b4dc18ebf5ff75a934724bd0491", + }, + digest: + "0xe596e88c14b9cd45c350bb4811b9a29bc1fc7069300e4204e034b1ab7c23d820", + }; + + expect(outputObject.version).toBe(expectedOutput.version); + expect(outputObject.guardianSetIndex).toBe( + expectedOutput.guardianSetIndex + ); + expect(outputObject.signatures).toMatchObject( + expectedOutput.signatures + ); + expect(outputObject.timestamp).toBe(expectedOutput.timestamp); + expect(outputObject.nonce).toBe(expectedOutput.nonce); + expect(outputObject.emitterChain).toBe(expectedOutput.emitterChain); + expect(outputObject.emitterAddress).toBe( + expectedOutput.emitterAddress + ); + expect(outputObject.sequence).toBe(expectedOutput.sequence); + expect(outputObject.consistencyLevel).toBe( + expectedOutput.consistencyLevel + ); + expect(outputObject.payload).toMatchObject(expectedOutput.payload); + expect(outputObject.digest).toBe(expectedOutput.digest); + + done(); + } catch (e) { + done(`JSON parse error: ${e}`); + } + } + ); + }); + + it("worm parse token-bridge-transfer-1", (done) => { + exec( + "node build/main.js parse 010000000001007d204ad9447c4dfd6be62406e7f5a05eec96300da4048e70ff530cfb52aec44807e98194990710ff166eb1b2eac942d38bc1cd6018f93662a6578d985e87c8d0016221346b0000b8bd0001c69a1b1a65dd336bf1df6a77afb501fc25db7fc0938cb08595a9ef473265cb4f0000000000000003200100000000000000000000000000000000000000000000000000000002540be400165809739240a0ac03b98440fe8985548e3aa683cd0d4d9df5b5659669faa3010001000000000000000000000000c10820983f33456ce7beb3a046f5a83fa34f027d00020000000000000000000000000000000000000000000000000000000000000000", + (error: any, stdout: string, stderr: any) => { + if (error) { + done(`Execution error: ${error}`); + return; + } + try { + const outputObject = JSON.parse(stdout); + + const expectedOutput = { + version: 1, + guardianSetIndex: 0, + signatures: [ + { + guardianSetIndex: 0, + signature: + "7d204ad9447c4dfd6be62406e7f5a05eec96300da4048e70ff530cfb52aec44807e98194990710ff166eb1b2eac942d38bc1cd6018f93662a6578d985e87c8d001", + }, + ], + timestamp: 1646343275, + nonce: 47293, + emitterChain: 1, + emitterAddress: + "0xc69a1b1a65dd336bf1df6a77afb501fc25db7fc0938cb08595a9ef473265cb4f", + sequence: "3", + consistencyLevel: 32, + payload: { + module: "TokenBridge", + type: "Transfer", + amount: "10000000000", + tokenAddress: + "0x165809739240a0ac03b98440fe8985548e3aa683cd0d4d9df5b5659669faa301", + tokenChain: 1, + toAddress: + "0x000000000000000000000000c10820983f33456ce7beb3a046f5a83fa34f027d", + chain: 2, + fee: "0", + }, + digest: + "0x2862e5873955ea104bb3e122831bdc43bbcb413da5b1123514640b950d038967", + }; + + expect(outputObject.version).toBe(expectedOutput.version); + expect(outputObject.guardianSetIndex).toBe( + expectedOutput.guardianSetIndex + ); + expect(outputObject.signatures).toMatchObject( + expectedOutput.signatures + ); + expect(outputObject.timestamp).toBe(expectedOutput.timestamp); + expect(outputObject.nonce).toBe(expectedOutput.nonce); + expect(outputObject.emitterChain).toBe(expectedOutput.emitterChain); + expect(outputObject.emitterAddress).toBe( + expectedOutput.emitterAddress + ); + expect(outputObject.sequence).toBe(expectedOutput.sequence); + expect(outputObject.consistencyLevel).toBe( + expectedOutput.consistencyLevel + ); + expect(outputObject.payload).toMatchObject(expectedOutput.payload); + expect(outputObject.digest).toBe(expectedOutput.digest); + + done(); + } catch (e) { + done(`JSON parse error: ${e}`); + } + } + ); + }); + + it("worm parse token-bridge-transfer-2", (done) => { + exec( + "node build/main.js parse 01000000010d0078588270e30e3b4cf74572b6ad4270cdd7932079692170fddaf369c7574722b75defcecf5d372cdd8fdba0f275c6b902434259b5d7da8402e25ca852ca5affaa0003a8888cf66158970861329efa69ff2461d847078cec22fd7f62606b17a1ae283127712fa50dc365faa1e6db339fefce57b13c74c2dce7d14b79051676c74bb685000487272398eb59763bb1e2466f9ebdea4e75c290b6c0386f07c20e1296b1976cb814547378922dbc5490b7fcf7279eafc0c08bd59ca97c4dbbcbd478967e17aa2d0006dd38ecb6233f1cd872a75cc0627ded36aa8f89095436f7dbe32e6655e27f217459fda35a3d7f1d656962160bfeee4e5fc6d2e1447559e7bc3ba760416317b86c010792d27a749b398dc5f085e7bcd2e0f18d6262a1ba1916787ec01854c0ccde0a8247f8892e6dff83fad6839fc054f32734255e9037ff9adc33499514e2300ba439010989f08688ae363783bfe3f25a5960a0791ce327bab7e7593393f91395e06fe50e3f7e13862ac86b9fd1f9720669bc4504e918f7e481c395f17a2fa131da05b9e7010a097d187970710297d188a2ebaedff0ad13efd16872566bae8a56377e28466b2c3c4e47853c60fe716109e55f8b453fb03a34bb1929c96f74ebd796a476ec7ab6000b68a19d198350b3caebd3c0159b8bbce022e0f026d013a1c83e40d6100c87e8bb0d692baca89cb77f4b6832dd7aaf3f2f7c482fd50be7221c046ae668228ec013000cd6f464a174d7e34797e2869785feb5f05ab614be989d238c9bd55259dbdbab2568c14f316d1820ac766e513bf5225185f16d30f0f01a092af5fb6b072ad577f0010d663f2f3ad62baa8ad541b9c38bb9df805d2cfa7072894526505b654293bacdee5e9e8c4ded7be92a3338b964482b3ce6d5275817d6a4b6a0663e1e84dcd1de3500105f773ea1d7e74770e78c4779abe4594b6a46f9131304948265bc185dcb1cdba8114915e3b1d864f48e4c694c9578524e22752e2d898af4b8e67383d72a11856700118bdbd5b5a820ecd215faf134b698402da04cc698e64464dd8df6692342e8c44314e1ae53bfde71fb2b00cd5691dae4f9b310c6150bdb551645a72863f4ff965c011286c673c4f2213969d273b939318f93a5b50c665efa8c9e245a3b8823522dafec209b1be127e74a6d5c924831e339f8bffb769f7b0f5772ed16231700bf7eece200624092e10000f4150001ec7372995d5cc8732397fb0ad35c0121e0eaa90d26f828a534cab54391b3a4f5000000000001aec5200100000000000000000000000000000000000000000000000000000000f4610900069b8857feab8184fb687f634618c035dac439dc1aeb3b5598a0f000000000010001000000000000000000000000efd4aa8f954ebdea82b8757c029fc8475a45e9cd00020000000000000000000000000000000000000000000000000000000000000000", + (error: any, stdout: string, stderr: any) => { + if (error) { + done(`Execution error: ${error}`); + return; + } + try { + const outputObject = JSON.parse(stdout); + + const expectedOutput = { + version: 1, + guardianSetIndex: 1, + signatures: [ + { + guardianSetIndex: 0, + signature: + "78588270e30e3b4cf74572b6ad4270cdd7932079692170fddaf369c7574722b75defcecf5d372cdd8fdba0f275c6b902434259b5d7da8402e25ca852ca5affaa00", + }, + { + guardianSetIndex: 3, + signature: + "a8888cf66158970861329efa69ff2461d847078cec22fd7f62606b17a1ae283127712fa50dc365faa1e6db339fefce57b13c74c2dce7d14b79051676c74bb68500", + }, + { + guardianSetIndex: 4, + signature: + "87272398eb59763bb1e2466f9ebdea4e75c290b6c0386f07c20e1296b1976cb814547378922dbc5490b7fcf7279eafc0c08bd59ca97c4dbbcbd478967e17aa2d00", + }, + { + guardianSetIndex: 6, + signature: + "dd38ecb6233f1cd872a75cc0627ded36aa8f89095436f7dbe32e6655e27f217459fda35a3d7f1d656962160bfeee4e5fc6d2e1447559e7bc3ba760416317b86c01", + }, + { + guardianSetIndex: 7, + signature: + "92d27a749b398dc5f085e7bcd2e0f18d6262a1ba1916787ec01854c0ccde0a8247f8892e6dff83fad6839fc054f32734255e9037ff9adc33499514e2300ba43901", + }, + { + guardianSetIndex: 9, + signature: + "89f08688ae363783bfe3f25a5960a0791ce327bab7e7593393f91395e06fe50e3f7e13862ac86b9fd1f9720669bc4504e918f7e481c395f17a2fa131da05b9e701", + }, + { + guardianSetIndex: 10, + signature: + "097d187970710297d188a2ebaedff0ad13efd16872566bae8a56377e28466b2c3c4e47853c60fe716109e55f8b453fb03a34bb1929c96f74ebd796a476ec7ab600", + }, + { + guardianSetIndex: 11, + signature: + "68a19d198350b3caebd3c0159b8bbce022e0f026d013a1c83e40d6100c87e8bb0d692baca89cb77f4b6832dd7aaf3f2f7c482fd50be7221c046ae668228ec01300", + }, + { + guardianSetIndex: 12, + signature: + "d6f464a174d7e34797e2869785feb5f05ab614be989d238c9bd55259dbdbab2568c14f316d1820ac766e513bf5225185f16d30f0f01a092af5fb6b072ad577f001", + }, + { + guardianSetIndex: 13, + signature: + "663f2f3ad62baa8ad541b9c38bb9df805d2cfa7072894526505b654293bacdee5e9e8c4ded7be92a3338b964482b3ce6d5275817d6a4b6a0663e1e84dcd1de3500", + }, + { + guardianSetIndex: 16, + signature: + "5f773ea1d7e74770e78c4779abe4594b6a46f9131304948265bc185dcb1cdba8114915e3b1d864f48e4c694c9578524e22752e2d898af4b8e67383d72a11856700", + }, + { + guardianSetIndex: 17, + signature: + "8bdbd5b5a820ecd215faf134b698402da04cc698e64464dd8df6692342e8c44314e1ae53bfde71fb2b00cd5691dae4f9b310c6150bdb551645a72863f4ff965c01", + }, + { + guardianSetIndex: 18, + signature: + "86c673c4f2213969d273b939318f93a5b50c665efa8c9e245a3b8823522dafec209b1be127e74a6d5c924831e339f8bffb769f7b0f5772ed16231700bf7eece200", + }, + ], + timestamp: 1648399073, + nonce: 62485, + emitterChain: 1, + emitterAddress: + "0xec7372995d5cc8732397fb0ad35c0121e0eaa90d26f828a534cab54391b3a4f5", + sequence: "110277", + consistencyLevel: 32, + payload: { + module: "TokenBridge", + type: "Transfer", + amount: "4100000000", + tokenAddress: + "0x069b8857feab8184fb687f634618c035dac439dc1aeb3b5598a0f00000000001", + tokenChain: 1, + toAddress: + "0x000000000000000000000000efd4aa8f954ebdea82b8757c029fc8475a45e9cd", + chain: 2, + fee: "0", + }, + digest: + "0xc90519b2bdfacac401d2d2c15a329d4e33e8ca15862685f0220ddc6074d7def5", + }; + + expect(outputObject.version).toBe(expectedOutput.version); + expect(outputObject.guardianSetIndex).toBe( + expectedOutput.guardianSetIndex + ); + expect(outputObject.signatures).toMatchObject( + expectedOutput.signatures + ); + expect(outputObject.timestamp).toBe(expectedOutput.timestamp); + expect(outputObject.nonce).toBe(expectedOutput.nonce); + expect(outputObject.emitterChain).toBe(expectedOutput.emitterChain); + expect(outputObject.emitterAddress).toBe( + expectedOutput.emitterAddress + ); + expect(outputObject.sequence).toBe(expectedOutput.sequence); + expect(outputObject.consistencyLevel).toBe( + expectedOutput.consistencyLevel + ); + expect(outputObject.payload).toMatchObject(expectedOutput.payload); + expect(outputObject.digest).toBe(expectedOutput.digest); + + done(); + } catch (e) { + done(`JSON parse error: ${e}`); + } + } + ); + }); + + it("worm parse token-bridge-transfer-4", (done) => { + exec( + "node build/main.js parse 010000000001001565b62bbf9978b1f9183ae985eb34f664fd4c850ec4ad8a38533281aec75eba2456f91c9a967cf4a70901aa0afed17ba39f1d779089b32eb88a47f7ea405e4b00000000002605c517000195f83a27e90c622a98c037353f271fd8f5f57b4dc18ebf5ff75a934724bd04914e4eb08ee374efbd200100000000000000000000000000000000000000000000000000000000000186a0165809739240a0ac03b98440fe8985548e3aa683cd0d4d9df5b5659669faa3010001000000000000000000000000c10820983f33456ce7beb3a046f5a83fa34f027d0c200000000000000000000000000000000000000000000000000000000000000000", + (error: any, stdout: string, stderr: any) => { + if (error) { + done(`Execution error: ${error}`); + return; + } + try { + const outputObject = JSON.parse(stdout); + + const expectedOutput = { + version: 1, + guardianSetIndex: 0, + signatures: [ + { + guardianSetIndex: 0, + signature: + "1565b62bbf9978b1f9183ae985eb34f664fd4c850ec4ad8a38533281aec75eba2456f91c9a967cf4a70901aa0afed17ba39f1d779089b32eb88a47f7ea405e4b00", + }, + ], + timestamp: 0, + nonce: 637912343, + emitterChain: 1, + emitterAddress: + "0x95f83a27e90c622a98c037353f271fd8f5f57b4dc18ebf5ff75a934724bd0491", + sequence: "5642641510889746365", + consistencyLevel: 32, + payload: { + module: "TokenBridge", + type: "Transfer", + amount: "100000", + tokenAddress: + "0x165809739240a0ac03b98440fe8985548e3aa683cd0d4d9df5b5659669faa301", + tokenChain: 1, + toAddress: + "0x000000000000000000000000c10820983f33456ce7beb3a046f5a83fa34f027d", + chain: 3104, + fee: "0", + }, + digest: + "0x559318082f6abb8b0fcf360d2a98be84a0ccf6602044882cc0d6764a374ae44d", + }; + + expect(outputObject.version).toBe(expectedOutput.version); + expect(outputObject.guardianSetIndex).toBe( + expectedOutput.guardianSetIndex + ); + expect(outputObject.signatures).toMatchObject( + expectedOutput.signatures + ); + expect(outputObject.timestamp).toBe(expectedOutput.timestamp); + expect(outputObject.nonce).toBe(expectedOutput.nonce); + expect(outputObject.emitterChain).toBe(expectedOutput.emitterChain); + expect(outputObject.emitterAddress).toBe( + expectedOutput.emitterAddress + ); + expect(outputObject.sequence).toBe(expectedOutput.sequence); + expect(outputObject.consistencyLevel).toBe( + expectedOutput.consistencyLevel + ); + expect(outputObject.payload).toMatchObject(expectedOutput.payload); + expect(outputObject.digest).toBe(expectedOutput.digest); + + done(); + } catch (e) { + done(`JSON parse error: ${e}`); + } + } + ); + }); + + it("worm parse token-bridge-upgrade-1", (done) => { + exec( + "node build/main.js parse 01000000000100e3db309303b712a562e6aa2adc68bc10ff22328ab31ddb6a83706943a9da97bf11ba6e3b96395515868786898dc19ecd737d197b0d1a1f3f3c6aead5c1fe7009000000000100000001000100000000000000000000000000000000000000000000000000000000000000040000000004c5d05a00000000000000000000000000000000000000000000546f6b656e42726964676502000a0000000000000000000000000046da7a0320dd999438b4435dac82bf1dac13d2", + (error: any, stdout: string, stderr: any) => { + if (error) { + done(`Execution error: ${error}`); + return; + } + try { + const outputObject = JSON.parse(stdout); + + const expectedOutput = { + version: 1, + guardianSetIndex: 0, + signatures: [ + { + guardianSetIndex: 0, + signature: + "e3db309303b712a562e6aa2adc68bc10ff22328ab31ddb6a83706943a9da97bf11ba6e3b96395515868786898dc19ecd737d197b0d1a1f3f3c6aead5c1fe700900", + }, + ], + timestamp: 1, + nonce: 1, + emitterChain: 1, + emitterAddress: + "0x0000000000000000000000000000000000000000000000000000000000000004", + sequence: "80072794", + consistencyLevel: 0, + payload: { + module: "TokenBridge", + type: "ContractUpgrade", + chain: 10, + address: + "0x0000000000000000000000000046da7a0320dd999438b4435dac82bf1dac13d2", + }, + digest: + "0xf5725025d1d3f69d77d189e88b9be290618f1ceae355c1b116cb2d97d63f6029", + }; + + expect(outputObject.version).toBe(expectedOutput.version); + expect(outputObject.guardianSetIndex).toBe( + expectedOutput.guardianSetIndex + ); + expect(outputObject.signatures).toMatchObject( + expectedOutput.signatures + ); + expect(outputObject.timestamp).toBe(expectedOutput.timestamp); + expect(outputObject.nonce).toBe(expectedOutput.nonce); + expect(outputObject.emitterChain).toBe(expectedOutput.emitterChain); + expect(outputObject.emitterAddress).toBe( + expectedOutput.emitterAddress + ); + expect(outputObject.sequence).toBe(expectedOutput.sequence); + expect(outputObject.consistencyLevel).toBe( + expectedOutput.consistencyLevel + ); + expect(outputObject.payload).toMatchObject(expectedOutput.payload); + expect(outputObject.digest).toBe(expectedOutput.digest); + + done(); + } catch (e) { + done(`JSON parse error: ${e}`); + } + } + ); + }); + + it("worm parse token-bridge-upgrade-2", (done) => { + exec( + "node build/main.js parse 010000000100000000005c14b8e300010000000000000000000000000000000000000000000000000000000000000004fd81c1b1836cc25620000000000000000000000000000000000000000000546f6b656e4272696467650200030000000000000000000000000000000000000000000000000000000000000fb2", + (error: any, stdout: string, stderr: any) => { + if (error) { + done(`Execution error: ${error}`); + return; + } + try { + const outputObject = JSON.parse(stdout); + + const expectedOutput = { + version: 1, + guardianSetIndex: 1, + signatures: [], + timestamp: 0, + nonce: 1544861923, + emitterChain: 1, + emitterAddress: + "0x0000000000000000000000000000000000000000000000000000000000000004", + sequence: "18267094531749757526", + consistencyLevel: 32, + payload: { + module: "TokenBridge", + type: "ContractUpgrade", + chain: 3, + address: + "0x0000000000000000000000000000000000000000000000000000000000000fb2", + }, + digest: + "0x7c8bd53e23a704a5476810d36335d2b9d65e4182e4863af3b27bd6a1ac8825e4", + }; + + expect(outputObject.version).toBe(expectedOutput.version); + expect(outputObject.guardianSetIndex).toBe( + expectedOutput.guardianSetIndex + ); + expect(outputObject.signatures).toMatchObject( + expectedOutput.signatures + ); + expect(outputObject.timestamp).toBe(expectedOutput.timestamp); + expect(outputObject.nonce).toBe(expectedOutput.nonce); + expect(outputObject.emitterChain).toBe(expectedOutput.emitterChain); + expect(outputObject.emitterAddress).toBe( + expectedOutput.emitterAddress + ); + expect(outputObject.sequence).toBe(expectedOutput.sequence); + expect(outputObject.consistencyLevel).toBe( + expectedOutput.consistencyLevel + ); + expect(outputObject.payload).toMatchObject(expectedOutput.payload); + expect(outputObject.digest).toBe(expectedOutput.digest); + + done(); + } catch (e) { + done(`JSON parse error: ${e}`); + } + } + ); + }); + + it("worm parse token-bridge-upgrade-3", (done) => { + exec( + "node build/main.js parse 01000000010d02aa3ffb28f2c401f90b8b5fb7af57bf9249204970053b1ba06bca147c2dab31b21d50c2a7695e8ebed00b07f0b1cb9c1658f41ee59a56b9fb4b289d9c15ce838f01030976bd5450631765db2c4017f33dd8fbd61dae364d1dfd43cdb866f72f8d4a4b47960026e64560a8823c422dce7c1e2a850aa5226c6b7092606c5224b69450e20104597391bda61d86dcb900d6b0062cf72b52b1ca250d625b3f62f89981041c16ec4b457038388058cdec9c5486baf6e84c1481e124c9f809ced7d73c235fcd400d0005c3356b43ed505d26fd55841925f8dcd4ae176990c4e9654742a20fe3438e0bb7367bd35019a546afe71af895f31e6e70de33ac800f75ee48a9dedac8f9817af5000609f9b2bd1c3f06bf23ed10eca5d13762b28872e1b44dbdb5d1f079c40c396f2a2ad2ac07278bd4cb140f61b86305f89a339dd0d39862f3a1f2cd8a9b7fd3eafe000779956931cd35e5e54934cadb37d9ad530164d58d9cbf2e39dbd73826a879705350ecd93ac7e48b21f64232b24b423d2d15b897e442dc4df9be7fdb92ebbaa2c100099af9249cfc3300edb5da61fd425371244a9a30fbfc93df455a3ac59cf3e56a4900da0566b38f8b56059f1795593b92c30c833dc6106657f4554a86f501b1f6b2010badf2b90028e98eef4aea4094c4cd0d3b411837f0469e13468b5016cc955510e808b4aafaa87aea8bc07c7506f3782d0428468df405b21fc36ed2ccfb32877642010da3f78c15d55d8efd5646a31a81c9316de35d61abd2c8a2df419b888a62a5c80771cd045db60a49d4f87c42f18de743faf6883313dba558c7da4ad209254b9b83010e5f398f609913e6d39420d44eaeff12e3431778ede50b119f0aa7ddd926de1aa34d855013984f2ca785e610e0efae0ffdb424d9caedac7f2e89ada0dee9ac6acb0110e19223db4b8837625732237d3c0f6041c28794c58178c0466ca6d646b9fb6c0941db7854a2f48a2383ea46d047e76a81f06185378c0598ead8535c0b080aa55b0111d8647c197db25ada7d55f559c65a7196fbd7361e92c68203c1842544b61bfd837117a8ab1ff10937737768c7a5fa93f65a39de2bb15370d714f1e0b4e24b6ea801127ec8835b907102f92a14a259054a1914a86afdf424108e83ae6b64b1dca0b69a6e55051cdce368fac7f3b4a50c8d9affae89d4253730eb4f12f38e056f1657ef01000000002c4929070001000000000000000000000000000000000000000000000000000000000000000411c7893f86b34cf020000000000000000000000000000000000000000000546f6b656e427269646765020004000000000000000000000000ee91c335eab126df5fdb3797ea9d6ad93aec9722", + (error: any, stdout: string, stderr: any) => { + if (error) { + done(`Execution error: ${error}`); + return; + } + try { + const outputObject = JSON.parse(stdout); + + const expectedOutput = { + version: 1, + guardianSetIndex: 1, + signatures: [ + { + guardianSetIndex: 2, + signature: + "aa3ffb28f2c401f90b8b5fb7af57bf9249204970053b1ba06bca147c2dab31b21d50c2a7695e8ebed00b07f0b1cb9c1658f41ee59a56b9fb4b289d9c15ce838f01", + }, + { + guardianSetIndex: 3, + signature: + "0976bd5450631765db2c4017f33dd8fbd61dae364d1dfd43cdb866f72f8d4a4b47960026e64560a8823c422dce7c1e2a850aa5226c6b7092606c5224b69450e201", + }, + { + guardianSetIndex: 4, + signature: + "597391bda61d86dcb900d6b0062cf72b52b1ca250d625b3f62f89981041c16ec4b457038388058cdec9c5486baf6e84c1481e124c9f809ced7d73c235fcd400d00", + }, + { + guardianSetIndex: 5, + signature: + "c3356b43ed505d26fd55841925f8dcd4ae176990c4e9654742a20fe3438e0bb7367bd35019a546afe71af895f31e6e70de33ac800f75ee48a9dedac8f9817af500", + }, + { + guardianSetIndex: 6, + signature: + "09f9b2bd1c3f06bf23ed10eca5d13762b28872e1b44dbdb5d1f079c40c396f2a2ad2ac07278bd4cb140f61b86305f89a339dd0d39862f3a1f2cd8a9b7fd3eafe00", + }, + { + guardianSetIndex: 7, + signature: + "79956931cd35e5e54934cadb37d9ad530164d58d9cbf2e39dbd73826a879705350ecd93ac7e48b21f64232b24b423d2d15b897e442dc4df9be7fdb92ebbaa2c100", + }, + { + guardianSetIndex: 9, + signature: + "9af9249cfc3300edb5da61fd425371244a9a30fbfc93df455a3ac59cf3e56a4900da0566b38f8b56059f1795593b92c30c833dc6106657f4554a86f501b1f6b201", + }, + { + guardianSetIndex: 11, + signature: + "adf2b90028e98eef4aea4094c4cd0d3b411837f0469e13468b5016cc955510e808b4aafaa87aea8bc07c7506f3782d0428468df405b21fc36ed2ccfb3287764201", + }, + { + guardianSetIndex: 13, + signature: + "a3f78c15d55d8efd5646a31a81c9316de35d61abd2c8a2df419b888a62a5c80771cd045db60a49d4f87c42f18de743faf6883313dba558c7da4ad209254b9b8301", + }, + { + guardianSetIndex: 14, + signature: + "5f398f609913e6d39420d44eaeff12e3431778ede50b119f0aa7ddd926de1aa34d855013984f2ca785e610e0efae0ffdb424d9caedac7f2e89ada0dee9ac6acb01", + }, + { + guardianSetIndex: 16, + signature: + "e19223db4b8837625732237d3c0f6041c28794c58178c0466ca6d646b9fb6c0941db7854a2f48a2383ea46d047e76a81f06185378c0598ead8535c0b080aa55b01", + }, + { + guardianSetIndex: 17, + signature: + "d8647c197db25ada7d55f559c65a7196fbd7361e92c68203c1842544b61bfd837117a8ab1ff10937737768c7a5fa93f65a39de2bb15370d714f1e0b4e24b6ea801", + }, + { + guardianSetIndex: 18, + signature: + "7ec8835b907102f92a14a259054a1914a86afdf424108e83ae6b64b1dca0b69a6e55051cdce368fac7f3b4a50c8d9affae89d4253730eb4f12f38e056f1657ef01", + }, + ], + timestamp: 0, + nonce: 742992135, + emitterChain: 1, + emitterAddress: + "0x0000000000000000000000000000000000000000000000000000000000000004", + sequence: "1281143524946038000", + consistencyLevel: 32, + payload: { + module: "TokenBridge", + type: "ContractUpgrade", + chain: 4, + address: + "0x000000000000000000000000ee91c335eab126df5fdb3797ea9d6ad93aec9722", + }, + digest: + "0x353bb7417bf9d0873091e29fc07a7b776adb780981aa217b51a6a167941c211a", + }; + + expect(outputObject.version).toBe(expectedOutput.version); + expect(outputObject.guardianSetIndex).toBe( + expectedOutput.guardianSetIndex + ); + expect(outputObject.signatures).toMatchObject( + expectedOutput.signatures + ); + expect(outputObject.timestamp).toBe(expectedOutput.timestamp); + expect(outputObject.nonce).toBe(expectedOutput.nonce); + expect(outputObject.emitterChain).toBe(expectedOutput.emitterChain); + expect(outputObject.emitterAddress).toBe( + expectedOutput.emitterAddress + ); + expect(outputObject.sequence).toBe(expectedOutput.sequence); + expect(outputObject.consistencyLevel).toBe( + expectedOutput.consistencyLevel + ); + expect(outputObject.payload).toMatchObject(expectedOutput.payload); + expect(outputObject.digest).toBe(expectedOutput.digest); + + done(); + } catch (e) { + done(`JSON parse error: ${e}`); + } + } + ); + }); + + it("worm parse token-bridge-upgrade-4", (done) => { + exec( + "node build/main.js parse 01000000010d020366c80e5ee7bed9a53f73a613072f5dedf4cbee2328ea3ab654c2ee74df1bfe0f5997aeec566ac4e5b07eea776275eb11ed74421afd18ce87501a2a4a36cbda0003385d03e9ac2739c73cbbc2a4065d3dbe103b0dd530a329b99752df31d95142ca398940a090efe7bae37f5bc5d741721b5b8fc050cedcc342904fdd4cbef6cbb20004d5ab927c8c6eb4ff77665bcfe782d761dce7d11b9d790df67f7a52ed212ca29c56f0fb7dd6fe9096f10be3339968beb60271c3956678e13711371da876908eab0105586c36c58e271b08888ed096b39ac3655e32d0b4e269b1323cf8318baf48d3ce3becaa972340b21dc5fc53287c1bf88f9cd45ed42a093a0d49d68efe824a7a90000653b21ce041d5f9a5577b65ef0fead13ce1e16abc9244296ceca2bf5a43b592dd2d2bc10d717f8c636cb3e85b6a865cf328387c009df5f600fc7ea3ac478956980007fd5c6ae5916a8002c701ce307455502aae48a8da551b919751099fb40b50f4045f22b06bcad15b9dd6a2828fc25fbcdfa6ea6b4e51a5ddeac11e1353b41bea750008558751e5db02ded0953e2b6e869d9e578d667215afb9e233d11806cfc056b83604994fb1e4ef6fea787484ad023aa9e9066052cb1a70d1ad6a7c6a8465ec4e620109bdd97efa546abbd82a8628d915af619ffd150123ba4f2cd96f9aac48c5817079474ecec60176af59b1a0bf6bce95ef973c0c5d1d2d6d2045477ff2e3031d0889000be146cbb720e243afb0d06ab1b9a732b4f09c6431beaa041c15bcac66883c8d487d294fe1c99b135cd0e6f4f964263cbee995580c5ac517708d50dba433822b59000c601a2106d69e668c9154de17edbf17eaf2a206f05d87100253c37b66f7cf58f744e42510979ddfb392964adf452a25f4c4fb86c9aadb2d02a8b54296aedb4fc8010dece66ba46b1ea485ebad2e79e6bd07fc7d4e4278edfeb79c4f5fc3eb741606ae113c0440eb40c82612390c05eddf569efab00438f19302c6c5a6769614f17c65000fb1e9f4348009f06dc34eed21fbb4f3108c4b1d9f6b6636556e95aade79979df20b6800c150dd19f0772ea393827d47f78051c1bca5e92d25834397089800012b0010f23cb11b21f103cf728b7e0d9ed4b7c1da5bbca7ca64f081bf5dc9fe1235df685c4d2265f61774b9e76f087ad115be62abbe9e3216837839c5cedab8ad0babf901000000000909bab100010000000000000000000000000000000000000000000000000000000000000004056c5c69aaf09b3420000000000000000000000000000000000000000000546f6b656e42726964676502000700000000000000000000000007b5bf20487bf1703dba0222b739fa4fc921fdd1", + (error: any, stdout: string, stderr: any) => { + if (error) { + done(`Execution error: ${error}`); + return; + } + try { + const outputObject = JSON.parse(stdout); + + const expectedOutput = { + version: 1, + guardianSetIndex: 1, + signatures: [ + { + guardianSetIndex: 2, + signature: + "0366c80e5ee7bed9a53f73a613072f5dedf4cbee2328ea3ab654c2ee74df1bfe0f5997aeec566ac4e5b07eea776275eb11ed74421afd18ce87501a2a4a36cbda00", + }, + { + guardianSetIndex: 3, + signature: + "385d03e9ac2739c73cbbc2a4065d3dbe103b0dd530a329b99752df31d95142ca398940a090efe7bae37f5bc5d741721b5b8fc050cedcc342904fdd4cbef6cbb200", + }, + { + guardianSetIndex: 4, + signature: + "d5ab927c8c6eb4ff77665bcfe782d761dce7d11b9d790df67f7a52ed212ca29c56f0fb7dd6fe9096f10be3339968beb60271c3956678e13711371da876908eab01", + }, + { + guardianSetIndex: 5, + signature: + "586c36c58e271b08888ed096b39ac3655e32d0b4e269b1323cf8318baf48d3ce3becaa972340b21dc5fc53287c1bf88f9cd45ed42a093a0d49d68efe824a7a9000", + }, + { + guardianSetIndex: 6, + signature: + "53b21ce041d5f9a5577b65ef0fead13ce1e16abc9244296ceca2bf5a43b592dd2d2bc10d717f8c636cb3e85b6a865cf328387c009df5f600fc7ea3ac4789569800", + }, + { + guardianSetIndex: 7, + signature: + "fd5c6ae5916a8002c701ce307455502aae48a8da551b919751099fb40b50f4045f22b06bcad15b9dd6a2828fc25fbcdfa6ea6b4e51a5ddeac11e1353b41bea7500", + }, + { + guardianSetIndex: 8, + signature: + "558751e5db02ded0953e2b6e869d9e578d667215afb9e233d11806cfc056b83604994fb1e4ef6fea787484ad023aa9e9066052cb1a70d1ad6a7c6a8465ec4e6201", + }, + { + guardianSetIndex: 9, + signature: + "bdd97efa546abbd82a8628d915af619ffd150123ba4f2cd96f9aac48c5817079474ecec60176af59b1a0bf6bce95ef973c0c5d1d2d6d2045477ff2e3031d088900", + }, + { + guardianSetIndex: 11, + signature: + "e146cbb720e243afb0d06ab1b9a732b4f09c6431beaa041c15bcac66883c8d487d294fe1c99b135cd0e6f4f964263cbee995580c5ac517708d50dba433822b5900", + }, + { + guardianSetIndex: 12, + signature: + "601a2106d69e668c9154de17edbf17eaf2a206f05d87100253c37b66f7cf58f744e42510979ddfb392964adf452a25f4c4fb86c9aadb2d02a8b54296aedb4fc801", + }, + { + guardianSetIndex: 13, + signature: + "ece66ba46b1ea485ebad2e79e6bd07fc7d4e4278edfeb79c4f5fc3eb741606ae113c0440eb40c82612390c05eddf569efab00438f19302c6c5a6769614f17c6500", + }, + { + guardianSetIndex: 15, + signature: + "b1e9f4348009f06dc34eed21fbb4f3108c4b1d9f6b6636556e95aade79979df20b6800c150dd19f0772ea393827d47f78051c1bca5e92d25834397089800012b00", + }, + { + guardianSetIndex: 16, + signature: + "f23cb11b21f103cf728b7e0d9ed4b7c1da5bbca7ca64f081bf5dc9fe1235df685c4d2265f61774b9e76f087ad115be62abbe9e3216837839c5cedab8ad0babf901", + }, + ], + timestamp: 0, + nonce: 151632561, + emitterChain: 1, + emitterAddress: + "0x0000000000000000000000000000000000000000000000000000000000000004", + sequence: "390788876583607092", + consistencyLevel: 32, + payload: { + module: "TokenBridge", + type: "ContractUpgrade", + chain: 7, + address: + "0x00000000000000000000000007b5bf20487bf1703dba0222b739fa4fc921fdd1", + }, + digest: + "0xf56a7a71e22bf768e99150e3231e201d9e7667ee28ebfb52c91260d8937b5574", + }; + + expect(outputObject.version).toBe(expectedOutput.version); + expect(outputObject.guardianSetIndex).toBe( + expectedOutput.guardianSetIndex + ); + expect(outputObject.signatures).toMatchObject( + expectedOutput.signatures + ); + expect(outputObject.timestamp).toBe(expectedOutput.timestamp); + expect(outputObject.nonce).toBe(expectedOutput.nonce); + expect(outputObject.emitterChain).toBe(expectedOutput.emitterChain); + expect(outputObject.emitterAddress).toBe( + expectedOutput.emitterAddress + ); + expect(outputObject.sequence).toBe(expectedOutput.sequence); + expect(outputObject.consistencyLevel).toBe( + expectedOutput.consistencyLevel + ); + expect(outputObject.payload).toMatchObject(expectedOutput.payload); + expect(outputObject.digest).toBe(expectedOutput.digest); + + done(); + } catch (e) { + done(`JSON parse error: ${e}`); + } + } + ); + }); +}); diff --git a/clients/js/src/array.ts b/clients/js/src/sdk/array.ts similarity index 51% rename from clients/js/src/array.ts rename to clients/js/src/sdk/array.ts index a90e64895e..ff9f0fbead 100644 --- a/clients/js/src/array.ts +++ b/clients/js/src/sdk/array.ts @@ -7,22 +7,7 @@ import { sha256, stripZeros, } from "ethers/lib/utils"; -// import { Provider as NearProvider } from "near-api-js/lib/providers"; -// import { ethers } from "ethers"; -import { - nativeStringToHexAlgorand, - // hexToNativeAssetStringAlgorand, - // nativeStringToHexAlgorand, - uint8ArrayToNativeStringAlgorand, -} from "./algorand"; import { bech32 } from "bech32"; -// import { canonicalAddress, humanAddress } from "./cosmos"; -// import { buildTokenId } from "./cosmwasm/address"; -// import { isNativeDenom } from "./terra"; -// import { hashLookup } from "./near"; -// import { getExternalAddressFromType, isValidAptosType } from "./aptos"; -// import { isValidSuiAddress } from "@mysten/sui.js"; -// import { isValidSuiType } from "./sui"; import { Chain, ChainId, @@ -34,31 +19,37 @@ import { import { PlatformToChains, UniversalAddress, - // canonicalAddress, encoding, - platformToChains, } from "@wormhole-foundation/sdk"; +import { + chainToNativeDenoms, + CosmwasmAddress, +} from "@wormhole-foundation/sdk-cosmwasm"; import { isValidSuiAddress } from "@mysten/sui.js"; -import { isValidSuiType } from "./chains/sui"; import { sha3_256 } from "js-sha3"; +import { + nativeStringToHexAlgorand, + uint8ArrayToNativeStringAlgorand, +} from "@certusone/wormhole-sdk/lib/esm/algorand"; +import { isValidSuiType } from "@certusone/wormhole-sdk/lib/esm/sui"; -// /** -// * -// * Returns true iff the hex string represents a native Terra denom. -// * -// * Native assets on terra don't have an associated smart contract address, just -// * like eth isn't an ERC-20 contract on Ethereum. -// * -// * The difference is that the EVM implementations of Portal don't support eth -// * directly, and instead require swapping to an ERC-20 wrapped eth (WETH) -// * contract first. -// * -// * The Terra implementation instead supports Terra-native denoms without -// * wrapping to CW-20 token first. As these denoms don't have an address, they -// * are encoded in the Portal payloads by the setting the first byte to 1. This -// * encoding is safe, because the first 12 bytes of the 32-byte wormhole address -// * space are not used on Terra otherwise, as cosmos addresses are 20 bytes wide. -// */ +/** + * + * Returns true iff the hex string represents a native Terra denom. + * + * Native assets on terra don't have an associated smart contract address, just + * like eth isn't an ERC-20 contract on Ethereum. + * + * The difference is that the EVM implementations of Portal don't support eth + * directly, and instead require swapping to an ERC-20 wrapped eth (WETH) + * contract first. + * + * The Terra implementation instead supports Terra-native denoms without + * wrapping to CW-20 token first. As these denoms don't have an address, they + * are encoded in the Portal payloads by the setting the first byte to 1. This + * encoding is safe, because the first 12 bytes of the 32-byte wormhole address + * space are not used on Terra otherwise, as cosmos addresses are 20 bytes wide. + */ export const isHexNativeTerra = (h: string): boolean => h.startsWith("01"); const isLikely20ByteCosmwasm = (h: string): boolean => @@ -67,12 +58,6 @@ const isLikely20ByteCosmwasm = (h: string): boolean => export const nativeTerraHexToDenom = (h: string): string => Buffer.from(stripZeros(hexToUint8Array(h.substr(2)))).toString("ascii"); -export const isNativeDenom = (string = "") => - isNativeTerra(string) || string === "uluna"; - -export const isNativeTerra = (string = "") => - string.startsWith("u") && string.length === 4; - export const uint8ArrayToHex = (a: Uint8Array): string => encoding.hex.encode(a); @@ -83,34 +68,23 @@ export function canonicalAddress(humanAddress: string) { return new Uint8Array(bech32.fromWords(bech32.decode(humanAddress).words)); } -export function humanAddress(hrp: string, canonicalAddress: Uint8Array) { - return bech32.encode(hrp, bech32.toWords(canonicalAddress)); +export function humanAddress( + hrp: string, + canonicalAddress: Uint8Array +): string { + return CosmwasmAddress.encode(hrp, canonicalAddress); } export function buildTokenId( - chain: Exclude, "Terra">, + chain: Exclude, "Seda">, address: string ) { return ( - (isNativeCosmWasmDenom(chain, address) ? "01" : "00") + + (chainToNativeDenoms("Mainnet", chain) === address ? "01" : "00") + keccak256(Buffer.from(address, "utf-8")).substring(4) ); } -// export function buildTokenId_old( -// chain: Exclude< -// CosmWasmChainId | CosmWasmChainName, -// typeof CHAIN_ID_TERRA | "terra" -// >, -// address: string -// ) { -// const chainId: CosmWasmChainId = coalesceCosmWasmChainId(chain); -// return ( -// (isNativeCosmWasmDenom(chainId, address) ? "01" : "00") + -// keccak256(Buffer.from(address, "utf-8")).substring(4) -// ); -// } - /** * * Convert an address in a wormhole's 32-byte array representation into a chain's @@ -192,18 +166,6 @@ export const tryUint8ArrayToNative = ( } }; -// export const tryHexToNativeStringNear = async ( -// provider: NearProvider, -// tokenBridge: string, -// address: string -// ): Promise => { -// const { found, value } = await hashLookup(provider, tokenBridge, address); -// if (!found) { -// throw new Error("Address not found"); -// } -// return value; -// }; - /** * * Convert an address in a wormhole's 32-byte hex representation into a chain's native @@ -217,59 +179,6 @@ export const tryHexToNativeAssetString = (h: string, c: ChainId): string => new UniversalAddress(h).toNative("Algorand").toBigInt().toString() : new UniversalAddress(h).toNative(toChain(c)).toString(); -// /** -// * -// * Convert an address in a wormhole's 32-byte hex representation into a chain's native -// * string representation. -// * -// * @deprecated since 0.3.0, use [[tryHexToNativeString]] instead. -// */ -// export const hexToNativeAssetString = ( -// h: string | undefined, -// c: ChainId -// ): string | undefined => { -// if (!h) { -// return undefined; -// } -// try { -// return tryHexToNativeAssetString(h, c); -// } catch (e) { -// return undefined; -// } -// }; - -// /** -// * -// * Convert an address in a wormhole's 32-byte hex representation into a chain's native -// * string representation. -// * -// * @throws if address is not the right length for the given chain -// */ -// export const tryHexToNativeString = (h: string, c: ChainId | Chain): string => -// tryUint8ArrayToNative(hexToUint8Array(h), c); - -// /** -// * -// * Convert an address in a wormhole's 32-byte hex representation into a chain's native -// * string representation. -// * -// * @deprecated since 0.3.0, use [[tryHexToNativeString]] instead. -// */ -// export const hexToNativeString = ( -// h: string | undefined, -// c: ChainId | Chain -// ): string | undefined => { -// if (!h) { -// return undefined; -// } - -// try { -// return tryHexToNativeString(h, c); -// } catch (e) { -// return undefined; -// } -// }; - /** * * Convert an address in a chain's native representation into a 32-byte hex string @@ -287,7 +196,7 @@ export const tryNativeToHexString = ( } else if (chainToPlatform(chainName) === "Solana") { return uint8ArrayToHex(zeroPad(new PublicKey(address).toBytes(), 32)); } else if (chainName === "Terra") { - if (isNativeDenom(address)) { + if (chainToNativeDenoms("Mainnet", chainName) === address) { return ( "01" + uint8ArrayToHex( @@ -331,24 +240,6 @@ export const tryNativeToHexString = ( } }; -// /** -// * -// * Convert an address in a chain's native representation into a 32-byte hex string -// * understood by wormhole. -// * -// * @deprecated since 0.3.0, use [[tryNativeToHexString]] instead. -// * @throws if address is a malformed string for the given chain id -// */ -// export const nativeToHexString = ( -// address: string | undefined, -// chain: ChainId | Chain -// ): string | null => { -// if (!address) { -// return null; -// } -// return tryNativeToHexString(address, chain); -// }; - /** * * Convert an address in a chain's native representation into a 32-byte array @@ -364,82 +255,6 @@ export function tryNativeToUint8Array( return hexToUint8Array(tryNativeToHexString(address, chainId)); } -// /** -// * -// * Convert an address in a chain's native representation into a 32-byte hex string -// * understood by wormhole. -// * -// * @deprecated since 0.3.0, use [[tryUint8ArrayToNative]] instead. -// * @throws if address is a malformed string for the given chain id -// */ -// export const uint8ArrayToNative = (a: Uint8Array, chainId: ChainId) => -// hexToNativeString(uint8ArrayToHex(a), chainId); - -// export function chunks(array: T[], size: number): T[][] { -// return Array.apply( -// 0, -// new Array(Math.ceil(array.length / size)) -// ).map((_, index) => array.slice(index * size, (index + 1) * size)); -// } - -// export function textToHexString(name: string): string { -// return Buffer.from(name, "binary").toString("hex"); -// } - -// export function textToUint8Array(name: string): Uint8Array { -// return new Uint8Array(Buffer.from(name, "binary")); -// } - -// export function hex(x: string): Buffer { -// return Buffer.from( -// ethers.utils.hexlify(x, { allowMissingPrefix: true }).substring(2), -// "hex" -// ); -// } - -// export function ensureHexPrefix(x: string): string { -// return x.substring(0, 2) !== "0x" ? `0x${x}` : x; -// } - -export const isNativeDenomInjective = (denom: string) => denom === "inj"; -export const isNativeDenomXpla = (denom: string) => denom === "axpla"; -export const isNativeDenomSei = (denom: string) => denom === "usei"; -export const isNativeDenomWormchain = (denom: string) => denom === "uworm"; -export const isNativeDenomOsmosis = (denom: string) => denom === "uosmo"; -export const isNativeDenomCosmosHub = (denom: string) => denom === "uatom"; -export const isNativeDenomEvmos = (denom: string) => - denom === "aevmos" || denom === "atevmos"; -export const isNativeDenomKujira = (denom: string) => denom === "ukuji"; -export const isNativeDenomNeutron = (denom: string) => denom === "untrn"; -export const isNativeDenomCelestia = (denom: string) => denom === "utia"; -export const isNativeDenomStargaze = (denom: string) => denom === "ustars"; -export const isNativeDenomSeda = (denom: string) => denom === "aseda"; -export const isNativeDenomDymension = (denom: string) => denom === "adym"; -export const isNativeDenomProvenance = (denom: string) => denom === "nhash"; - -export function isNativeCosmWasmDenom( - chain: PlatformToChains<"Cosmwasm">, - address: string -) { - return ( - ((chain === "Terra" || chain === "Terra2") && isNativeDenom(address)) || - (chain === "Injective" && isNativeDenomInjective(address)) || - (chain === "Xpla" && isNativeDenomXpla(address)) || - (chain === "Sei" && isNativeDenomSei(address)) || - (chain === "Wormchain" && isNativeDenomWormchain(address)) || - (chain === "Osmosis" && isNativeDenomOsmosis(address)) || - (chain === "Cosmoshub" && isNativeDenomCosmosHub(address)) || - (chain === "Evmos" && isNativeDenomEvmos(address)) || - (chain === "Kujira" && isNativeDenomKujira(address)) || - (chain === "Neutron" && isNativeDenomNeutron(address)) || - (chain === "Celestia" && isNativeDenomCelestia(address)) || - (chain === "Stargaze" && isNativeDenomStargaze(address)) || - (chain === "Seda" && isNativeDenomSeda(address)) || - (chain === "Dymension" && isNativeDenomDymension(address)) || - (chain === "Provenance" && isNativeDenomProvenance(address)) - ); -} - /** * Test if given string is a valid fully qualified type of moduleAddress::moduleName::structName. * @param str String to test diff --git a/clients/js/src/sdk/sui.ts b/clients/js/src/sdk/sui.ts new file mode 100644 index 0000000000..2d199cb03c --- /dev/null +++ b/clients/js/src/sdk/sui.ts @@ -0,0 +1,130 @@ +import { + JsonRpcProvider, + SuiObjectResponse, + isValidSuiAddress as isValidFullSuiAddress, + normalizeSuiAddress, +} from "@mysten/sui.js"; +import { Chain, chainToChainId } from "@wormhole-foundation/sdk"; + +export async function getForeignAssetSui( + provider: JsonRpcProvider, + tokenBridgeStateObjectId: string, + originChain: Chain, + originAddress: Uint8Array +): Promise { + const originChainId = chainToChainId(originChain); + return getTokenCoinType( + provider, + tokenBridgeStateObjectId, + originAddress, + originChainId + ); +} + +export const getTokenCoinType = async ( + provider: JsonRpcProvider, + tokenBridgeStateObjectId: string, + tokenAddress: Uint8Array, + tokenChain: number +): Promise => { + const tokenBridgeStateFields = await getObjectFields( + provider, + tokenBridgeStateObjectId + ); + if (!tokenBridgeStateFields) { + throw new Error("Unable to fetch object fields from token bridge state"); + } + + const coinTypes = tokenBridgeStateFields?.token_registry?.fields?.coin_types; + const coinTypesObjectId = coinTypes?.fields?.id?.id; + if (!coinTypesObjectId) { + throw new Error("Unable to fetch coin types"); + } + + const keyType = getTableKeyType(coinTypes?.type); + if (!keyType) { + throw new Error("Unable to get key type"); + } + + const response = await provider.getDynamicFieldObject({ + parentId: coinTypesObjectId, + name: { + type: keyType, + value: { + addr: [...tokenAddress], + chain: tokenChain, + }, + }, + }); + if (response.error) { + if (response.error.code === "dynamicFieldNotFound") { + return null; + } + throw new Error( + `Unexpected getDynamicFieldObject response ${response.error}` + ); + } + const fields = getFieldsFromObjectResponse(response); + return fields?.value ? trimSuiType(ensureHexPrefix(fields.value)) : null; +}; + +export const getObjectFields = async ( + provider: JsonRpcProvider, + objectId: string +): Promise | null> => { + if (!isValidSuiAddress(objectId)) { + throw new Error(`Invalid object ID: ${objectId}`); + } + + const res = await provider.getObject({ + id: objectId, + options: { + showContent: true, + }, + }); + return getFieldsFromObjectResponse(res); +}; + +export const getFieldsFromObjectResponse = (object: SuiObjectResponse) => { + const content = object.data?.content; + return content && content.dataType === "moveObject" ? content.fields : null; +}; + +export function ensureHexPrefix(x: string): string { + return x.substring(0, 2) !== "0x" ? `0x${x}` : x; +} + +/** + * This method validates any Sui address, even if it's not 32 bytes long, i.e. + * "0x2". This differs from Mysten's implementation, which requires that the + * given address is 32 bytes long. + * @param address Address to check + * @returns If given address is a valid Sui address or not + */ +export const isValidSuiAddress = (address: string): boolean => + isValidFullSuiAddress(normalizeSuiAddress(address)); + +export const getTableKeyType = (tableType: string): string | null => { + if (!tableType) return null; + const match = trimSuiType(tableType).match(/0x2::table::Table<(.*)>/); + if (!match) return null; + const [keyType] = match[1].split(","); + if (!isValidSuiType(keyType)) return null; + return keyType; +}; + +/** + * This method removes leading zeroes for types in order to normalize them + * since some types returned from the RPC have leading zeroes and others don't. + */ +export const trimSuiType = (type: string): string => + type.replace(/(0x)(0*)/g, "0x"); + +export const isValidSuiType = (type: string): boolean => { + const tokens = type.split("::"); + if (tokens.length !== 3) { + return false; + } + + return isValidSuiAddress(tokens[0]) && !!tokens[1] && !!tokens[2]; +}; diff --git a/clients/js/src/solana.ts b/clients/js/src/solana.ts index d6069f33a4..f0af5d7127 100644 --- a/clients/js/src/solana.ts +++ b/clients/js/src/solana.ts @@ -25,10 +25,6 @@ import { transferFromSolana, transferNativeSol, } from "@certusone/wormhole-sdk/lib/esm/token_bridge/transfer"; -import { - hexToUint8Array, - tryNativeToUint8Array, -} from "@certusone/wormhole-sdk/lib/esm/utils"; import { PublicKey } from "@solana/web3.js"; import { getAssociatedTokenAddress } from "@solana/spl-token"; import { @@ -39,9 +35,9 @@ import { chainToPlatform, chains, contracts, - platform, platformToChains, } from "@wormhole-foundation/sdk-base"; +import { hexToUint8Array, tryNativeToUint8Array } from "./sdk/array"; export async function execute_solana( v: VAA, @@ -65,7 +61,6 @@ export async function execute_solana( const connection = setupConnection(rpc); const from = web3s.Keypair.fromSecretKey(base58.decode(key)); - // const contracts = CONTRACTS[network][chain]; const coreContract = contracts.coreBridge.get(network, chain); if (!coreContract) { throw new Error(`Core bridge address not defined for ${chain} ${network}`); diff --git a/clients/js/src/terra.ts b/clients/js/src/terra.ts index b563d7b608..30591b4197 100644 --- a/clients/js/src/terra.ts +++ b/clients/js/src/terra.ts @@ -11,7 +11,6 @@ import { fromUint8Array } from "js-base64"; import { NETWORKS } from "./consts"; import { Payload, impossible } from "./vaa"; import { transferFromTerra } from "@certusone/wormhole-sdk/lib/esm/token_bridge/transfer"; -import { tryNativeToUint8Array } from "@certusone/wormhole-sdk/lib/esm/utils"; import { Chain, Network, @@ -19,6 +18,7 @@ import { contracts, toChainId, } from "@wormhole-foundation/sdk-base"; +import { tryNativeToUint8Array } from "./sdk/array"; export async function execute_terra( payload: Payload, diff --git a/clients/js/src/tests.ts.test b/clients/js/src/tests.ts.test deleted file mode 100644 index 1b72ad7838..0000000000 --- a/clients/js/src/tests.ts.test +++ /dev/null @@ -1,76 +0,0 @@ -// > paul@W7windows:~$ worm evm info -n mainnet -c ethereum -m TokenBridge -// { -// "address": "0x3ee18B2214AFF97000D974cf647E7C347E8fa585", -// "wormhole": "0x98f3c9e6E3fAce36bAAd05FE09d375Ef1464288B", -// "implementation": "0x381752f5458282d317d12C30D2Bd4D6E1FD8841e", -// "isInitialized": true, -// "tokenImplementation": "0x0fD04a68d3c3A692d6Fa30384D1A87Ef93554eE6", -// "chainId": 2, -// "finality": 1, -// "evmChainId": "1", -// "isFork": false, -// "governanceChainId": 1, -// "governanceContract": "0x0000000000000000000000000000000000000000000000000000000000000004", -// "WETH": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", -// "registrations": { -// "solana": "0xec7372995d5cc8732397fb0ad35c0121e0eaa90d26f828a534cab54391b3a4f5", -// "terra": "0x0000000000000000000000007cf7b764e38a0a5e967972c1df77d432510564e2", -// "bsc": "0x000000000000000000000000b6f6d86a8f9879a9c87f643768d9efc38c1da6e7", -// "polygon": "0x0000000000000000000000005a58505a96d1dbf8df91cb21b54419fc36e93fde", -// "avalanche": "0x0000000000000000000000000e082f06ff657d94310cb8ce8b0d9a04541d8052", -// "oasis": "0x0000000000000000000000005848c791e09901b40a9ef749f2a6735b418d7564", -// "algorand": "0x67e93fa6c8ac5c819990aa7340c0c16b508abb1178be9b30d024b8ac25193d45", -// "aurora": "0x00000000000000000000000051b5123a7b0f9b2ba265f9c4c8de7d78d52f510f", -// "fantom": "0x0000000000000000000000007c9fc5741288cdfdd83ceb07f3ea7e22618d79d2", -// "karura": "0x000000000000000000000000ae9d7fe007b3327aa64a32824aaac52c42a6e624", -// "acala": "0x000000000000000000000000ae9d7fe007b3327aa64a32824aaac52c42a6e624", -// "klaytn": "0x0000000000000000000000005b08ac39eaed75c0439fc750d9fe7e1f9dd0193f", -// "celo": "0x000000000000000000000000796dff6d74f3e27060b71255fe517bfb23c93eed", -// "near": "0x148410499d3fcda4dcfd68a1ebfcdddda16ab28326448d4aae4d2f0465cdfcb7", -// "moonbeam": "0x000000000000000000000000b1731c586ca89a23809861c6103f0b96b3f57d92", -// "neon": "0x0000000000000000000000000000000000000000000000000000000000000000", -// "terra2": "0xa463ad028fb79679cfc8ce1efba35ac0e77b35080a1abe9bebe83461f176b0a3", -// "injective": "0x00000000000000000000000045dbea4617971d93188eda21530bc6503d153313", -// "osmosis": "0x0000000000000000000000000000000000000000000000000000000000000000", -// "sui": "0xccceeb29348f71bdd22ffef43a2a19c1f5b5e17c5cca5411529120182672ade5", -// "aptos": "0x0000000000000000000000000000000000000000000000000000000000000001", -// "arbitrum": "0x0000000000000000000000000b2402144bb366a632d14b83f244d2e0e21bd39c", -// "optimism": "0x0000000000000000000000001d68124e65fafc907325e3edbf8c4d84499daa8b", -// "gnosis": "0x0000000000000000000000000000000000000000000000000000000000000000", -// "pythnet": "0x0000000000000000000000000000000000000000000000000000000000000000", -// "xpla": "0x8f9cf727175353b17a5f574270e370776123d90fd74956ae4277962b4fdee24c", -// "btc": "0x0000000000000000000000000000000000000000000000000000000000000000", -// "base": "0x0000000000000000000000008d2de8d2f73f1f4cab472ac9a881c9b123c79627", -// "sei": "0x86c5fd957e2db8389553e1728f9c27964b22a8154091ccba54d75f4b10c61f5e", -// "rootstock": "0x0000000000000000000000000000000000000000000000000000000000000000", -// "scroll": "0x00000000000000000000000024850c6f61c438823f01b7a3bf2b89b72174fa9d", -// "mantle": "0x0000000000000000000000000000000000000000000000000000000000000000", -// "blast": "0x00000000000000000000000024850c6f61c438823f01b7a3bf2b89b72174fa9d", -// "xlayer": "0x0000000000000000000000000000000000000000000000000000000000000000", -// "linea": "0x0000000000000000000000000000000000000000000000000000000000000000", -// "berachain": "0x0000000000000000000000000000000000000000000000000000000000000000", -// "seievm": "0x0000000000000000000000000000000000000000000000000000000000000000", -// "wormchain": "0xaeb534c45c3049d380b9d9b966f9895f53abd4301bfaff407fa09dea8ae7a924", -// "cosmoshub": "0x0000000000000000000000000000000000000000000000000000000000000000", -// "evmos": "0x0000000000000000000000000000000000000000000000000000000000000000", -// "kujira": "0x0000000000000000000000000000000000000000000000000000000000000000", -// "neutron": "0x0000000000000000000000000000000000000000000000000000000000000000", -// "celestia": "0x0000000000000000000000000000000000000000000000000000000000000000", -// "stargaze": "0x0000000000000000000000000000000000000000000000000000000000000000", -// "seda": "0x0000000000000000000000000000000000000000000000000000000000000000", -// "dymension": "0x0000000000000000000000000000000000000000000000000000000000000000", -// "provenance": "0x0000000000000000000000000000000000000000000000000000000000000000", -// "sepolia": "0x0000000000000000000000000000000000000000000000000000000000000000", -// "arbitrum_sepolia": "0x0000000000000000000000000000000000000000000000000000000000000000", -// "base_sepolia": "0x0000000000000000000000000000000000000000000000000000000000000000", -// "optimism_sepolia": "0x0000000000000000000000000000000000000000000000000000000000000000", -// "holesky": "0x0000000000000000000000000000000000000000000000000000000000000000", -// "polygon_sepolia": "0x0000000000000000000000000000000000000000000000000000000000000000" -// } -// } - -// >>>worm info registrations mainnet ethereum TokenBridge -v -// Verification of ethereum MAINNET succeeded! - -// >>>paul@W7windows:~$ worm info contract mainnet ethereum TokenBridge -// 0x3ee18B2214AFF97000D974cf647E7C347E8fa585 diff --git a/clients/js/src/utils.ts b/clients/js/src/utils.ts index 3473ac7083..e7a3bec233 100644 --- a/clients/js/src/utils.ts +++ b/clients/js/src/utils.ts @@ -53,8 +53,8 @@ export function getNetwork(network: string): Network { } export function chainToChain(input: string): Chain { - if (input.length === 0) { - throw new Error("Empty chain"); + if (input.length < 2) { + throw new Error(`Invalid chain: ${input}`); } const chainStr = input[0].toUpperCase() + input.slice(1).toLowerCase(); return toChain(chainStr); diff --git a/clients/js/src/xpla.ts b/clients/js/src/xpla.ts index 90b82c86cc..966372c15d 100644 --- a/clients/js/src/xpla.ts +++ b/clients/js/src/xpla.ts @@ -10,13 +10,13 @@ import { fromUint8Array } from "js-base64"; import { NETWORKS } from "./consts"; import { Payload, impossible } from "./vaa"; import { transferFromXpla } from "@certusone/wormhole-sdk/lib/esm/token_bridge/transfer"; -import { tryNativeToUint8Array } from "@certusone/wormhole-sdk/lib/esm/utils"; import { Chain, chainToChainId, contracts, Network, } from "@wormhole-foundation/sdk-base"; +import { tryNativeToUint8Array } from "./sdk/array"; export async function execute_xpla( payload: Payload, diff --git a/scripts/guardian-set-init.sh b/scripts/guardian-set-init.sh index c901ef5983..d3bb3f123b 100755 --- a/scripts/guardian-set-init.sh +++ b/scripts/guardian-set-init.sh @@ -96,24 +96,24 @@ aptosNFTBridge=$(jq --raw-output '.chains."22".contracts.nftBridgeEmitterAddress # 4) create token bridge registration VAAs # invoke CLI commands to create registration VAAs -solTokenBridgeVAA=$(worm generate registration -m TokenBridge -c Solana -a ${solTokenBridge} -g ${guardiansPrivateCSV}) -ethTokenBridgeVAA=$(worm generate registration -m TokenBridge -c Ethereum -a ${ethTokenBridge} -g ${guardiansPrivateCSV}) -terraTokenBridgeVAA=$(worm generate registration -m TokenBridge -c Terra -a ${terraTokenBridge} -g ${guardiansPrivateCSV}) -bscTokenBridgeVAA=$(worm generate registration -m TokenBridge -c Bsc -a ${bscTokenBridge} -g ${guardiansPrivateCSV}) -algoTokenBridgeVAA=$(worm generate registration -m TokenBridge -c Algorand -a ${algoTokenBridge} -g ${guardiansPrivateCSV}) -nearTokenBridgeVAA=$(worm generate registration -m TokenBridge -c Near -a ${nearTokenBridge} -g ${guardiansPrivateCSV}) -terra2TokenBridgeVAA=$(worm generate registration -m TokenBridge -c Terra2 -a ${terra2TokenBridge} -g ${guardiansPrivateCSV}) -suiTokenBridgeVAA=$(worm generate registration -m TokenBridge -c Sui -a ${suiTokenBridge} -g ${guardiansPrivateCSV}) -aptosTokenBridgeVAA=$(worm generate registration -m TokenBridge -c Aptos -a ${aptosTokenBridge} -g ${guardiansPrivateCSV}) -wormchainTokenBridgeVAA=$(worm generate registration -m TokenBridge -c Wormchain -a ${wormchainTokenBridge} -g ${guardiansPrivateCSV}) +solTokenBridgeVAA=$(worm generate registration -m TokenBridge -c solana -a ${solTokenBridge} -g ${guardiansPrivateCSV}) +ethTokenBridgeVAA=$(worm generate registration -m TokenBridge -c ethereum -a ${ethTokenBridge} -g ${guardiansPrivateCSV}) +terraTokenBridgeVAA=$(worm generate registration -m TokenBridge -c terra -a ${terraTokenBridge} -g ${guardiansPrivateCSV}) +bscTokenBridgeVAA=$(worm generate registration -m TokenBridge -c bsc -a ${bscTokenBridge} -g ${guardiansPrivateCSV}) +algoTokenBridgeVAA=$(worm generate registration -m TokenBridge -c algorand -a ${algoTokenBridge} -g ${guardiansPrivateCSV}) +nearTokenBridgeVAA=$(worm generate registration -m TokenBridge -c near -a ${nearTokenBridge} -g ${guardiansPrivateCSV}) +terra2TokenBridgeVAA=$(worm generate registration -m TokenBridge -c terra2 -a ${terra2TokenBridge} -g ${guardiansPrivateCSV}) +suiTokenBridgeVAA=$(worm generate registration -m TokenBridge -c sui -a ${suiTokenBridge} -g ${guardiansPrivateCSV}) +aptosTokenBridgeVAA=$(worm generate registration -m TokenBridge -c aptos -a ${aptosTokenBridge} -g ${guardiansPrivateCSV}) +wormchainTokenBridgeVAA=$(worm generate registration -m TokenBridge -c wormchain -a ${wormchainTokenBridge} -g ${guardiansPrivateCSV}) # 5) create nft bridge registration VAAs echo "generating contract registration VAAs for nft bridges" -solNFTBridgeVAA=$(worm generate registration -m NFTBridge -c Solana -a ${solNFTBridge} -g ${guardiansPrivateCSV}) -ethNFTBridgeVAA=$(worm generate registration -m NFTBridge -c Ethereum -a ${ethNFTBridge} -g ${guardiansPrivateCSV}) -nearNFTBridgeVAA=$(worm generate registration -m NFTBridge -c Near -a ${nearNFTBridge} -g ${guardiansPrivateCSV}) -aptosNFTBridgeVAA=$(worm generate registration -m NFTBridge -c Aptos -a ${aptosNFTBridge} -g ${guardiansPrivateCSV}) +solNFTBridgeVAA=$(worm generate registration -m NFTBridge -c solana -a ${solNFTBridge} -g ${guardiansPrivateCSV}) +ethNFTBridgeVAA=$(worm generate registration -m NFTBridge -c ethereum -a ${ethNFTBridge} -g ${guardiansPrivateCSV}) +nearNFTBridgeVAA=$(worm generate registration -m NFTBridge -c near -a ${nearNFTBridge} -g ${guardiansPrivateCSV}) +aptosNFTBridgeVAA=$(worm generate registration -m NFTBridge -c aptos -a ${aptosNFTBridge} -g ${guardiansPrivateCSV}) # 6) write the registration VAAs to env files