Clients: Clients governance wormhole relayer (#3103)
* clients/js uses wormhole sdk for relayer governance actions * Add improbable-eng dependency * Use SDK in clients/js for wormhole relayer * Remove invalid comment
This commit is contained in:
parent
9e61d151c6
commit
e422b48418
|
@ -10,8 +10,9 @@
|
|||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@celo-tools/celo-ethers-wrapper": "^0.1.0",
|
||||
"@certusone/wormhole-sdk": "^0.9.18",
|
||||
"@certusone/wormhole-sdk": "^0.9.19-beta.0",
|
||||
"@cosmjs/encoding": "^0.26.2",
|
||||
"@improbable-eng/grpc-web-node-http-transport": "^0.15.0",
|
||||
"@injectivelabs/networks": "^1.10.7",
|
||||
"@injectivelabs/sdk-ts": "^1.10.47",
|
||||
"@injectivelabs/utils": "^1.10.5",
|
||||
|
@ -492,16 +493,13 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@certusone/wormhole-sdk": {
|
||||
"version": "0.9.18",
|
||||
"resolved": "https://registry.npmjs.org/@certusone/wormhole-sdk/-/wormhole-sdk-0.9.18.tgz",
|
||||
"integrity": "sha512-0YtrdZmjfiUHL78Yr4FA59ywb+pIevbID/TJpJTp/EKWqm/v+9PS4YBMBEtjpDZR/PSqe6hB8MasF38fUjMGtQ==",
|
||||
"version": "0.9.19-beta.0",
|
||||
"resolved": "https://registry.npmjs.org/@certusone/wormhole-sdk/-/wormhole-sdk-0.9.19-beta.0.tgz",
|
||||
"integrity": "sha512-kON/RWR/LJK9/oUerZ0NYY2CYptwHoQTjC2RAHpDzaM57hQBDOOsKGNVzlwcXdUv8lVSBymijW9+4VXMAQiZqw==",
|
||||
"dependencies": {
|
||||
"@certusone/wormhole-sdk-proto-web": "0.0.6",
|
||||
"@certusone/wormhole-sdk-wasm": "^0.0.1",
|
||||
"@coral-xyz/borsh": "0.2.6",
|
||||
"@injectivelabs/networks": "1.10.12",
|
||||
"@injectivelabs/sdk-ts": "1.10.72",
|
||||
"@injectivelabs/utils": "1.10.12",
|
||||
"@mysten/sui.js": "0.32.2",
|
||||
"@project-serum/anchor": "^0.25.0",
|
||||
"@solana/spl-token": "^0.3.5",
|
||||
|
@ -517,6 +515,11 @@
|
|||
"elliptic": "^6.5.4",
|
||||
"js-base64": "^3.6.1",
|
||||
"near-api-js": "^1.0.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@injectivelabs/networks": "1.10.12",
|
||||
"@injectivelabs/sdk-ts": "1.10.72",
|
||||
"@injectivelabs/utils": "1.10.12"
|
||||
}
|
||||
},
|
||||
"node_modules/@certusone/wormhole-sdk-proto-web": {
|
||||
|
@ -1876,6 +1879,14 @@
|
|||
"google-protobuf": "^3.14.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@improbable-eng/grpc-web-node-http-transport": {
|
||||
"version": "0.15.0",
|
||||
"resolved": "https://registry.npmjs.org/@improbable-eng/grpc-web-node-http-transport/-/grpc-web-node-http-transport-0.15.0.tgz",
|
||||
"integrity": "sha512-HLgJfVolGGpjc9DWPhmMmXJx8YGzkek7jcCFO1YYkSOoO81MWRZentPOd/JiKiZuU08wtc4BG+WNuGzsQB5jZA==",
|
||||
"peerDependencies": {
|
||||
"@improbable-eng/grpc-web": ">=0.13.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@injectivelabs/core-proto-ts": {
|
||||
"version": "0.0.14",
|
||||
"resolved": "https://registry.npmjs.org/@injectivelabs/core-proto-ts/-/core-proto-ts-0.0.14.tgz",
|
||||
|
@ -8491,9 +8502,9 @@
|
|||
"requires": {}
|
||||
},
|
||||
"@certusone/wormhole-sdk": {
|
||||
"version": "0.9.18",
|
||||
"resolved": "https://registry.npmjs.org/@certusone/wormhole-sdk/-/wormhole-sdk-0.9.18.tgz",
|
||||
"integrity": "sha512-0YtrdZmjfiUHL78Yr4FA59ywb+pIevbID/TJpJTp/EKWqm/v+9PS4YBMBEtjpDZR/PSqe6hB8MasF38fUjMGtQ==",
|
||||
"version": "0.9.19-beta.0",
|
||||
"resolved": "https://registry.npmjs.org/@certusone/wormhole-sdk/-/wormhole-sdk-0.9.19-beta.0.tgz",
|
||||
"integrity": "sha512-kON/RWR/LJK9/oUerZ0NYY2CYptwHoQTjC2RAHpDzaM57hQBDOOsKGNVzlwcXdUv8lVSBymijW9+4VXMAQiZqw==",
|
||||
"requires": {
|
||||
"@certusone/wormhole-sdk-proto-web": "0.0.6",
|
||||
"@certusone/wormhole-sdk-wasm": "^0.0.1",
|
||||
|
@ -9363,6 +9374,12 @@
|
|||
"browser-headers": "^0.4.1"
|
||||
}
|
||||
},
|
||||
"@improbable-eng/grpc-web-node-http-transport": {
|
||||
"version": "0.15.0",
|
||||
"resolved": "https://registry.npmjs.org/@improbable-eng/grpc-web-node-http-transport/-/grpc-web-node-http-transport-0.15.0.tgz",
|
||||
"integrity": "sha512-HLgJfVolGGpjc9DWPhmMmXJx8YGzkek7jcCFO1YYkSOoO81MWRZentPOd/JiKiZuU08wtc4BG+WNuGzsQB5jZA==",
|
||||
"requires": {}
|
||||
},
|
||||
"@injectivelabs/core-proto-ts": {
|
||||
"version": "0.0.14",
|
||||
"resolved": "https://registry.npmjs.org/@injectivelabs/core-proto-ts/-/core-proto-ts-0.0.14.tgz",
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
"start": "npm run build && node ./build/main.js",
|
||||
"build": "esbuild src/main.ts --bundle --outfile=build/main.js --minify --platform=node --target=node16",
|
||||
"check": "tsc --noEmit",
|
||||
"docs":"npx tsx src/doc.ts",
|
||||
"docs": "npx tsx src/doc.ts",
|
||||
"prepublishOnly": "npm run check",
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
|
@ -30,8 +30,9 @@
|
|||
],
|
||||
"dependencies": {
|
||||
"@celo-tools/celo-ethers-wrapper": "^0.1.0",
|
||||
"@certusone/wormhole-sdk": "^0.9.18",
|
||||
"@certusone/wormhole-sdk": "^0.9.19-beta.0",
|
||||
"@cosmjs/encoding": "^0.26.2",
|
||||
"@improbable-eng/grpc-web-node-http-transport": "^0.15.0",
|
||||
"@injectivelabs/networks": "^1.10.7",
|
||||
"@injectivelabs/sdk-ts": "^1.10.47",
|
||||
"@injectivelabs/utils": "^1.10.5",
|
||||
|
|
|
@ -3,7 +3,11 @@ import {
|
|||
BridgeImplementation__factory,
|
||||
Implementation__factory,
|
||||
NFTBridgeImplementation__factory,
|
||||
WormholeRelayer__factory
|
||||
} from "@certusone/wormhole-sdk/lib/esm/ethers-contracts";
|
||||
import {
|
||||
getWormholeRelayerAddress
|
||||
} from "@certusone/wormhole-sdk/lib/esm/relayer"
|
||||
import {
|
||||
CHAINS,
|
||||
CONTRACTS,
|
||||
|
@ -430,28 +434,26 @@ export async function execute_evm(
|
|||
break;
|
||||
}
|
||||
case "WormholeRelayer":
|
||||
// TODO: Try to get contract address from SDK if it is undefined
|
||||
// Needs SDK to be published with Wormhole Relayer contract addresses
|
||||
contract_address = contract_address
|
||||
? contract_address
|
||||
: getWormholeRelayerAddress(chain, network);
|
||||
if (contract_address === undefined) {
|
||||
throw Error(`Unknown Wormhole Relayer contract on ${network} for ${chain}`)
|
||||
}
|
||||
// let rb = ethers_contracts.WormholeRelayer__factory.connect(contract_address, signer)
|
||||
let rb = WormholeRelayer__factory.connect(contract_address, signer)
|
||||
switch (payload.type) {
|
||||
case "ContractUpgrade":
|
||||
console.log("Upgrading contract")
|
||||
console.log("Error: The published NPM SDK doesn't have the typechain binding for WormholeRelayer yet")
|
||||
//console.log("Hash: " + (await rb.submitContractUpgrade(vaa, overrides)).hash)
|
||||
console.log("Hash: " + (await rb.submitContractUpgrade(vaa, overrides)).hash)
|
||||
console.log("Don't forget to verify the new implementation! See ethereum/VERIFY.md for instructions")
|
||||
break
|
||||
case "RegisterChain":
|
||||
console.log("Registering chain")
|
||||
console.log("Error: The published NPM SDK doesn't have the typechain binding for WormholeRelayer yet")
|
||||
//console.log("Hash: " + (await rb.registerWormholeRelayerContract(vaa, overrides)).hash)
|
||||
console.log("Hash: " + (await rb.registerWormholeRelayerContract(vaa, overrides)).hash)
|
||||
break
|
||||
case "SetDefaultDeliveryProvider":
|
||||
console.log("Setting default relay provider")
|
||||
console.log("Error: The published NPM SDK doesn't have the typechain binding for WormholeRelayer yet")
|
||||
//console.log("Hash: " + (await rb.setDefaultDeliveryProvider(vaa, overrides)).hash)
|
||||
console.log("Hash: " + (await rb.setDefaultDeliveryProvider(vaa, overrides)).hash)
|
||||
break
|
||||
default:
|
||||
impossible(payload)
|
||||
|
|
Loading…
Reference in New Issue