Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate clients js to sdk v2 #3980

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
58 changes: 18 additions & 40 deletions clients/js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,16 @@ Options:
```
</details>

<details>
<summary> chains </summary>

```sh
Options:
--help Show help [boolean]
--version Show version number [boolean]
```
</details>

<details>
<summary> edit-vaa </summary>

Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand All @@ -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:
Expand Down
1 change: 1 addition & 0 deletions clients/js/info_tests/evm-1.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0xbeFA429d57cD18b7F8A4d91A2da9AB4AF05d0FBe
1 change: 1 addition & 0 deletions clients/js/info_tests/evm-1.test
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
evm address-from-secret 0xcfb12303a19cde580bb4dd771639b0d26bc68353645571a8cff516ab2ee113a0
1 change: 1 addition & 0 deletions clients/js/info_tests/generate-1.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0100000000010009b7c0612e950779ea6a5458800289925c02a32cca3670f497693df283b503177e757473f94adfa2d18745b9e3d01a04f6b97240459612bd8654e5f91fb3f3d5010000000100000001000100000000000000000000000000000000000000000000000000000000000000040000000005a657f60000000000000000000000000000000000000000000000004e46544272696467650100000004000000000000000000000000706abc4e45d419950511e474c7b9ed348a4a716c
1 change: 1 addition & 0 deletions clients/js/info_tests/generate-1.test
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
generate registration --module NFTBridge --chain bsc --contract-address 0x706abc4E45D419950511e474C7B9Ed348A4a716c --guardian-secret cfb12303a19cde580bb4dd771639b0d26bc68353645571a8cff516ab2ee113a0
1 change: 1 addition & 0 deletions clients/js/info_tests/generate-2.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
01000000000100fe357dfbb2661d594da7720bf919bcb5597776c20720065c38748a7f69bc59e30b1a3a9ed564418083162c2f9f12910a799699faafe75494ba68b5813ae4a19a0000000001000000010002000000000000000000000000000000001111111111111111111111111111111500000000051d2e300002000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800020655534443000000000000000000000000000000000000000000000000000000005553444300000000000000000000000000000000000000000000000000000000
1 change: 1 addition & 0 deletions clients/js/info_tests/generate-2.test
Original file line number Diff line number Diff line change
@@ -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
69 changes: 69 additions & 0 deletions clients/js/info_tests/info-1.expected
Original file line number Diff line number Diff line change
@@ -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"
}
}
1 change: 1 addition & 0 deletions clients/js/info_tests/info-1.test
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
evm info -c Bsc -n mainnet -m TokenBridge
4 changes: 4 additions & 0 deletions clients/js/info_tests/info-2.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Mismatches found on Ethereum Mainnet!
{
Mantle: 'Expected null , found 0x00000000000000000000000024850c6f61c438823f01b7a3bf2b89b72174fa9d'
}
1 change: 1 addition & 0 deletions clients/js/info_tests/info-2.test
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
info registrations mainnet ethereum TokenBridge -v
1 change: 1 addition & 0 deletions clients/js/info_tests/info-3.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0x3ee18B2214AFF97000D974cf647E7C347E8fa585
1 change: 1 addition & 0 deletions clients/js/info_tests/info-3.test
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
info contract mainnet ethereum TokenBridge
1 change: 1 addition & 0 deletions clients/js/info_tests/info-4.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0x5a58505a96D1dbf8dF91cB21B54419FC36e93fdE
1 change: 1 addition & 0 deletions clients/js/info_tests/info-4.test
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
info contract mainnet Bsc NFTBridge
1 change: 1 addition & 0 deletions clients/js/info_tests/info-5.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://bsc-dataseed.binance.org/
1 change: 1 addition & 0 deletions clients/js/info_tests/info-5.test
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
info rpc mainnet Bsc
1 change: 1 addition & 0 deletions clients/js/info_tests/info-6.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN
1 change: 1 addition & 0 deletions clients/js/info_tests/info-6.test
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
info wrapped ethereum 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 sui
5 changes: 5 additions & 0 deletions clients/js/info_tests/info-7.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
isWrapped: true,
chainId: 2,
assetAddress: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
}
1 change: 1 addition & 0 deletions clients/js/info_tests/info-7.test
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
info origin sui 0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN
Loading
Loading