Browse Source

clients/js: refactor worm info

heyitaki 2 years ago
parent
commit
4f13263089

+ 3 - 3
aptos/scripts/deploy

@@ -36,9 +36,9 @@ else
     usage
 fi
 
-WORMHOLE_ADDR=$(worm contract "$NETWORK" aptos Core)
-TOKEN_BRIDGE_ADDR=$(worm contract "$NETWORK" aptos TokenBridge)
-NFT_BRIDGE_ADDR=$(worm contract "$NETWORK" aptos NFTBridge)
+WORMHOLE_ADDR=$(worm info contract "$NETWORK" aptos Core)
+TOKEN_BRIDGE_ADDR=$(worm info contract "$NETWORK" aptos TokenBridge)
+NFT_BRIDGE_ADDR=$(worm info contract "$NETWORK" aptos NFTBridge)
 
 NAMED_ADDRS="wormhole=$WORMHOLE_ADDR,deployer=$DEPLOYER_ADDR,token_bridge=$TOKEN_BRIDGE_ADDR,nft_bridge=$NFT_BRIDGE_ADDR"
 

+ 1 - 1
aptos/scripts/register_devnet

@@ -24,7 +24,7 @@ done
 VAAS=$(set | grep "REGISTER_.*_NFT_BRIDGE_VAA" | grep -v APTOS | cut -d '=' -f1)
 
 # TODO: this will not be needed when the sdk is published
-NFT_BRIDGE_ADDR=$(worm contract devnet aptos NFTBridge)
+NFT_BRIDGE_ADDR=$(worm info contract devnet aptos NFTBridge)
 
 # 5. use 'worm' to submit each registration VAA
 for VAA in $VAAS

+ 4 - 4
aptos/scripts/upgrade

@@ -28,9 +28,9 @@ else
     usage
 fi
 
-WORMHOLE_ADDR=$(worm contract "$NETWORK" aptos Core)
-TOKEN_BRIDGE_ADDR=$(worm contract "$NETWORK" aptos TokenBridge)
-NFT_BRIDGE_ADDR=$(worm contract "$NETWORK" aptos NFTBridge)
+WORMHOLE_ADDR=$(worm info contract "$NETWORK" aptos Core)
+TOKEN_BRIDGE_ADDR=$(worm info contract "$NETWORK" aptos TokenBridge)
+NFT_BRIDGE_ADDR=$(worm info contract "$NETWORK" aptos NFTBridge)
 
 NAMED_ADDRS="wormhole=$WORMHOLE_ADDR,deployer=$DEPLOYER_ADDR,token_bridge=$TOKEN_BRIDGE_ADDR,nft_bridge=$NFT_BRIDGE_ADDR"
 
@@ -55,7 +55,7 @@ VAA=$(worm generate upgrade -c aptos -a "$HASH" -m "$MODULE" -g $GUARDIAN_SECRET
 echo "Submitting VAA: $VAA"
 
 # TODO: --contract-address should not be neded after the sdk has these addresses
-CONTRACT_ADDR=$(worm contract "$NETWORK" aptos "$MODULE")
+CONTRACT_ADDR=$(worm info contract "$NETWORK" aptos "$MODULE")
 worm submit --network "$NETWORK" "$VAA" --contract-address "$CONTRACT_ADDR"
 worm aptos upgrade $DIR --network "$NETWORK" --contract-address "$CONTRACT_ADDR" --named-addresses "$NAMED_ADDRS"
 worm aptos migrate --network "$NETWORK" --contract-address "$CONTRACT_ADDR"

+ 23 - 7
clients/js/src/algorand.ts

@@ -38,7 +38,13 @@ export async function execute_algorand(
 
   let target_contract: string;
   switch (payload.module) {
-    case "Core":
+    case "Core": {
+      if (!contracts.core) {
+        throw new Error(
+          `Core bridge address not defined for Algorand ${network}`
+        );
+      }
+
       target_contract = contracts.core;
       switch (payload.type) {
         case "GuardianSetUpgrade":
@@ -52,14 +58,17 @@ export async function execute_algorand(
         default:
           impossible(payload);
       }
+
       break;
-    case "NFTBridge":
-      if (contracts.nft_bridge === undefined) {
+    }
+    case "NFTBridge": {
+      if (!contracts.nft_bridge) {
         // 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
-        throw new Error("NFT bridge not supported yet for algorand");
+        throw new Error("NFT bridge not supported yet for Algorand");
       }
+
       target_contract = contracts.nft_bridge;
       switch (payload.type) {
         case "ContractUpgrade":
@@ -76,11 +85,16 @@ export async function execute_algorand(
         default:
           impossible(payload);
       }
+
       break;
-    case "TokenBridge":
-      if (contracts.token_bridge === undefined) {
-        throw new Error("contracts.token_bridge is undefined");
+    }
+    case "TokenBridge": {
+      if (!contracts.token_bridge) {
+        throw new Error(
+          `Token bridge address not defined for Algorand ${network}`
+        );
       }
+
       target_contract = contracts.token_bridge;
       switch (payload.type) {
         case "ContractUpgrade":
@@ -102,7 +116,9 @@ export async function execute_algorand(
         default:
           impossible(payload);
       }
+
       break;
+    }
     default:
       target_contract = impossible(payload);
   }

+ 1 - 1
clients/js/src/cmds/aptos.ts

@@ -24,7 +24,7 @@ import {
   RPC_OPTIONS,
 } from "../consts";
 import { NETWORKS } from "../networks";
-import { runCommand, VALIDATOR_OPTIONS } from "../start-validator";
+import { runCommand, VALIDATOR_OPTIONS } from "../startValidator";
 import { assertNetwork, checkBinary, evm_address, hex } from "../utils";
 
 const APTOS_NODE_URL = "http://0.0.0.0:8080/v1";

+ 2 - 6
clients/js/src/cmds/edit-vaa.ts → clients/js/src/cmds/editVaa.ts

@@ -22,6 +22,7 @@ import { Other } from "@certusone/wormhole-sdk/lib/esm/vaa";
 import axios from "axios";
 import { ethers } from "ethers";
 import yargs from "yargs";
+import { NETWORK_OPTIONS } from "../consts";
 import { NETWORKS } from "../networks";
 import { assertNetwork, Network } from "../utils";
 import { parse, Payload, serialiseVAA, sign, Signature, VAA } from "../vaa";
@@ -36,12 +37,7 @@ export const builder = (y: typeof yargs) =>
       type: "string",
       demandOption: true,
     })
-    .option("network", {
-      alias: "n",
-      describe: "network",
-      choices: ["mainnet", "testnet", "devnet"],
-      demandOption: true,
-    } as const)
+    .option("network", NETWORK_OPTIONS)
     .option("guardian-set-index", {
       alias: "gsi",
       describe: "guardian set index",

+ 14 - 20
clients/js/src/cmds/evm.ts

@@ -9,6 +9,7 @@ import {
 import { ethers } from "ethers";
 import { homedir } from "os";
 import yargs from "yargs";
+import { NETWORK_OPTIONS } from "../consts";
 import {
   getImplementation,
   hijack_evm,
@@ -16,7 +17,7 @@ import {
   setStorageAt,
 } from "../evm";
 import { NETWORKS } from "../networks";
-import { runCommand, VALIDATOR_OPTIONS } from "../start-validator";
+import { runCommand, VALIDATOR_OPTIONS } from "../startValidator";
 import { assertNetwork, evm_address } from "../utils";
 
 export const command = "evm";
@@ -95,24 +96,16 @@ export const builder = function (y: typeof yargs) {
           .option("chain", {
             alias: "c",
             describe: "Chain to query",
-            type: "string",
-            choices: Object.keys(CHAINS),
+            choices: Object.keys(CHAINS) as (keyof typeof CHAINS)[],
             demandOption: true,
-          })
+          } as const)
           .option("module", {
             alias: "m",
             describe: "Module to query",
-            type: "string",
             choices: ["Core", "NFTBridge", "TokenBridge"],
             demandOption: true,
-          })
-          .option("network", {
-            alias: "n",
-            describe: "network",
-            type: "string",
-            choices: ["mainnet", "testnet", "devnet"],
-            demandOption: true,
-          })
+          } as const)
+          .option("network", NETWORK_OPTIONS)
           .option("contract-address", {
             alias: "a",
             describe: "Contract to query (override config)",
@@ -127,17 +120,18 @@ export const builder = function (y: typeof yargs) {
             demandOption: false,
           }),
       async (argv) => {
-        assertChain(argv["chain"]);
-        assertEVMChain(argv["chain"]);
+        const chain = argv.chain;
+        assertChain(chain);
+        assertEVMChain(chain);
         const network = argv.network.toUpperCase();
         assertNetwork(network);
-        const module = argv["module"] as "Core" | "NFTBridge" | "TokenBridge";
-        const rpc = argv["rpc"] ?? NETWORKS[network][argv["chain"]].rpc;
+        const module = argv.module;
+        const rpc = argv.rpc ?? NETWORKS[network][chain].rpc;
         if (argv["implementation-only"]) {
           console.log(
             await getImplementation(
               network,
-              argv["chain"],
+              chain,
               module,
               argv["contract-address"],
               rpc
@@ -148,7 +142,7 @@ export const builder = function (y: typeof yargs) {
             JSON.stringify(
               await query_contract_evm(
                 network,
-                argv["chain"],
+                chain,
                 module,
                 argv["contract-address"],
                 rpc
@@ -186,7 +180,7 @@ 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,
           argv["core-contract-address"],

+ 5 - 6
clients/js/src/cmds/generate.ts

@@ -67,7 +67,7 @@ export const builder = function (y: typeof yargs) {
             .option("chain", {
               alias: "c",
               describe: "Chain to register",
-              choices: Object.keys(CHAINS),
+              choices: Object.keys(CHAINS) as (keyof typeof CHAINS)[],
               demandOption: true,
             } as const)
             .option("contract-address", {
@@ -113,7 +113,7 @@ export const builder = function (y: typeof yargs) {
             .option("chain", {
               alias: "c",
               describe: "Chain to upgrade",
-              choices: Object.keys(CHAINS),
+              choices: Object.keys(CHAINS) as (keyof typeof CHAINS)[],
               demandOption: true,
             } as const)
             .option("contract-address", {
@@ -154,7 +154,7 @@ export const builder = function (y: typeof yargs) {
             .option("emitter-chain", {
               alias: "e",
               describe: "Emitter chain of the VAA",
-              choices: Object.keys(CHAINS),
+              choices: Object.keys(CHAINS) as (keyof typeof CHAINS)[],
               demandOption: true,
             } as const)
             .option("emitter-address", {
@@ -166,10 +166,9 @@ export const builder = function (y: typeof yargs) {
             .option("chain", {
               alias: "c",
               describe: "Token's chain",
-              type: "string",
-              choices: Object.keys(CHAINS),
+              choices: Object.keys(CHAINS) as (keyof typeof CHAINS)[],
               demandOption: true,
-            })
+            } as const)
             .option("token-address", {
               alias: "a",
               describe: "Token's address",

+ 1 - 1
clients/js/src/cmds/chainId.ts → clients/js/src/cmds/info/chainId.ts

@@ -12,7 +12,7 @@ export const builder = (y: typeof yargs) => {
   return y.positional("chain", {
     describe: "Chain to query",
     type: "string",
-    choices: Object.keys(CHAINS),
+    choices: Object.keys(CHAINS) as (keyof typeof CHAINS)[],
     demandOption: true,
   } as const);
 };

+ 7 - 18
clients/js/src/cmds/contractAddress.ts → clients/js/src/cmds/info/contract.ts

@@ -3,10 +3,9 @@ import {
   assertChain,
 } from "@certusone/wormhole-sdk/lib/esm/utils/consts";
 import yargs from "yargs";
-import { CONTRACTS } from "../consts";
-import { getEmitterAddress } from "../emitter";
-import { assertNetwork } from "../utils";
-import { impossible } from "../vaa";
+import { CONTRACTS } from "../../consts";
+import { assertNetwork } from "../../utils";
+import { impossible } from "../../vaa";
 
 export const command = "contract <network> <chain> <module>";
 export const desc = "Print contract address";
@@ -19,29 +18,23 @@ export const builder = (y: typeof yargs) =>
     } as const)
     .positional("chain", {
       describe: "Chain to query",
-      choices: Object.keys(CHAINS),
+      choices: Object.keys(CHAINS) as (keyof typeof CHAINS)[],
       demandOption: true,
     } as const)
     .positional("module", {
       describe: "Module to query",
       choices: ["Core", "NFTBridge", "TokenBridge"],
       demandOption: true,
-    } as const)
-    .option("emitter", {
-      alias: "e",
-      describe: "Print in emitter address format",
-      type: "boolean",
-      default: false,
-      demandOption: false,
-    });
+    } as const);
 export const handler = async (
   argv: Awaited<ReturnType<typeof builder>["argv"]>
 ) => {
-  assertChain(argv["chain"]);
   const network = argv.network.toUpperCase();
   assertNetwork(network);
   const chain = argv["chain"];
+  assertChain(chain);
   const module = argv["module"];
+
   let addr: string | undefined;
   switch (module) {
     case "Core":
@@ -66,9 +59,5 @@ export const handler = async (
     throw new Error(`${module} not deployed on ${chain}`);
   }
 
-  if (argv["emitter"]) {
-    addr = await getEmitterAddress(chain, addr);
-  }
-
   console.log(addr);
 };

+ 6 - 8
clients/js/src/cmds/convert-to-emitter.ts → clients/js/src/cmds/info/emitter.ts

@@ -3,19 +3,19 @@ import {
   assertChain,
 } from "@certusone/wormhole-sdk/lib/esm/utils/consts";
 import yargs from "yargs";
-import { getEmitterAddress } from "../emitter";
+import { getEmitterAddress } from "../../emitter";
 
-export const command = "convert-to-emitter <chain> <address-to-convert>";
+export const command = "emitter <chain> <address>";
 export const desc = "Print address in emitter address format";
 export const builder = (y: typeof yargs) =>
   y
     .positional("chain", {
       describe: "Chain to query",
       type: "string",
-      choices: Object.keys(CHAINS),
+      choices: Object.keys(CHAINS) as (keyof typeof CHAINS)[],
       demandOption: true,
     } as const)
-    .positional("address-to-convert", {
+    .positional("address", {
       describe: "Address to be converted to emitter address format",
       type: "string",
       demandOption: true,
@@ -23,8 +23,6 @@ export const builder = (y: typeof yargs) =>
 export const handler = async (
   argv: Awaited<ReturnType<typeof builder>["argv"]>
 ) => {
-  assertChain(argv["chain"]);
-  console.log(
-    await getEmitterAddress(argv["chain"], argv["address-to-convert"])
-  );
+  assertChain(argv.chain);
+  console.log(await getEmitterAddress(argv.chain, argv.address));
 };

+ 3 - 7
clients/js/src/cmds/info.ts → clients/js/src/cmds/info/index.ts

@@ -1,16 +1,12 @@
 import yargs from "yargs";
 import * as chainId from "./chainId";
-import * as contractAddress from "./contractAddress";
-import * as convertToEmitter from "./convert-to-emitter";
+import * as contract from "./contract";
+import * as emitter from "./emitter";
 import * as rpc from "./rpc";
 
 export const command = "info";
 export const desc = "Contract, chain, rpc and address information utilities";
 // Imports modules logic from root commands, more info here -> https://github.com/yargs/yargs/blob/main/docs/advanced.md#providing-a-command-module
 export const builder = (y: typeof yargs) =>
-  y
-    .command(chainId)
-    .command(contractAddress)
-    .command(convertToEmitter)
-    .command(rpc);
+  y.command(chainId).command(contract).command(emitter).command(rpc);
 export const handler = () => {};

+ 3 - 3
clients/js/src/cmds/rpc.ts → clients/js/src/cmds/info/rpc.ts

@@ -3,8 +3,8 @@ import {
   assertChain,
 } from "@certusone/wormhole-sdk/lib/esm/utils/consts";
 import yargs from "yargs";
-import { NETWORKS } from "../networks";
-import { assertNetwork } from "../utils";
+import { NETWORKS } from "../../networks";
+import { assertNetwork } from "../../utils";
 
 export const command = "rpc <network> <chain>";
 export const desc = "Print RPC address";
@@ -17,7 +17,7 @@ export const builder = (y: typeof yargs) =>
     } as const)
     .positional("chain", {
       describe: "Chain to query",
-      choices: Object.keys(CHAINS),
+      choices: Object.keys(CHAINS) as (keyof typeof CHAINS)[],
       demandOption: true,
     } as const);
 export const handler = async (

+ 6 - 6
clients/js/src/cmds/near.ts

@@ -97,7 +97,7 @@ export const builder = function (y: typeof yargs) {
 
         const masterKey = KeyPair.fromString(key);
         const keyStore = new InMemoryKeyStore();
-        keyStore.setKey(networkId, argv["account"], masterKey);
+        keyStore.setKey(networkId, argv.account, masterKey);
         const near = await connect({
           deps: {
             keyStore,
@@ -107,7 +107,7 @@ export const builder = function (y: typeof yargs) {
           headers: {},
         });
 
-        const masterAccount = new Account(near.connection, argv["account"]);
+        const masterAccount = new Account(near.connection, argv.account);
         const result = await masterAccount.functionCall({
           contractId: target,
           methodName: "update_contract",
@@ -169,7 +169,7 @@ export const builder = function (y: typeof yargs) {
 
         const masterKey = KeyPair.fromString(key);
         const keyStore = new InMemoryKeyStore();
-        keyStore.setKey(networkId, argv["account"], masterKey);
+        keyStore.setKey(networkId, argv.account, masterKey);
         keyStore.setKey(networkId, target, masterKey);
 
         const near = await connect({
@@ -180,13 +180,13 @@ export const builder = function (y: typeof yargs) {
           nodeUrl: rpc,
           headers: {},
         });
-        const masterAccount = new Account(near.connection, argv["account"]);
+        const masterAccount = new Account(near.connection, argv.account);
         const targetAccount = new Account(near.connection, target);
         console.log({ ...argv, key, rpc, target });
 
         if (argv.attach) {
           console.log(
-            `Sending money: ${target} from ${argv["account"]} being sent ${argv["attach"]}`
+            `Sending money: ${target} from ${argv.account} being sent ${argv.attach}`
           );
           console.log(
             await masterAccount.sendMoney(target, new BN(argv.attach))
@@ -195,7 +195,7 @@ export const builder = function (y: typeof yargs) {
 
         console.log("deploying contract");
         console.log(
-          await targetAccount.deployContract(readFileSync(argv["file"]))
+          await targetAccount.deployContract(readFileSync(argv.file))
         );
       }
     );

+ 1 - 1
clients/js/src/cmds/recover.ts

@@ -21,6 +21,6 @@ export const handler = async (
   argv: Awaited<ReturnType<typeof builder>["argv"]>
 ) => {
   console.log(
-    ethers.utils.recoverAddress(hex(argv["digest"]), hex(argv["signature"]))
+    ethers.utils.recoverAddress(hex(argv.digest), hex(argv.signature))
   );
 };

+ 7 - 12
clients/js/src/cmds/submit.ts

@@ -10,6 +10,7 @@ import {
 import yargs from "yargs";
 import { execute_algorand } from "../algorand";
 import { execute_aptos } from "../aptos";
+import { NETWORK_OPTIONS } from "../consts";
 import { execute_evm } from "../evm";
 import { execute_injective } from "../injective";
 import { execute_near } from "../near";
@@ -33,15 +34,10 @@ export const builder = (y: typeof yargs) =>
     .option("chain", {
       alias: "c",
       describe: "chain name",
-      choices: Object.keys(CHAINS),
+      choices: Object.keys(CHAINS) as (keyof typeof CHAINS)[],
       demandOption: false,
     } as const)
-    .option("network", {
-      alias: "n",
-      describe: "network",
-      choices: ["mainnet", "testnet", "devnet"],
-      demandOption: true,
-    } as const)
+    .option("network", NETWORK_OPTIONS)
     .option("contract-address", {
       alias: "a",
       describe: "Contract to submit VAA to (override config)",
@@ -61,7 +57,6 @@ export const handler = async (
   const parsed_vaa = parse(buf);
 
   assertKnownPayload(parsed_vaa);
-
   console.log(parsed_vaa.payload);
 
   const network = argv.network.toUpperCase();
@@ -87,7 +82,7 @@ export const handler = async (
   const vaa_chain = toChainName(vaa_chain_id);
 
   // get chain from command line arg
-  const cli_chain = argv["chain"];
+  const cli_chain = argv.chain;
 
   let chain: ChainName;
   if (cli_chain !== undefined) {
@@ -113,7 +108,7 @@ export const handler = async (
       network,
       chain,
       argv["contract-address"],
-      argv["rpc"]
+      argv.rpc
     );
   } else if (isTerraChain(chain)) {
     await execute_terra(parsed_vaa.payload, buf, network, chain);
@@ -136,14 +131,14 @@ export const handler = async (
   } else if (chain === "osmosis") {
     throw Error("OSMOSIS is not supported yet");
   } else if (chain === "sui") {
-    await submitSui(parsed_vaa.payload, buf, network, argv["rpc"]);
+    await submitSui(parsed_vaa.payload, buf, network, argv.rpc);
   } else if (chain === "aptos") {
     await execute_aptos(
       parsed_vaa.payload,
       buf,
       network,
       argv["contract-address"],
-      argv["rpc"]
+      argv.rpc
     );
   } else if (chain === "wormchain") {
     throw Error("Wormchain is not supported yet");

+ 1 - 1
clients/js/src/cmds/sui/index.ts

@@ -3,7 +3,7 @@ import { Yargs } from "../Yargs";
 import { addBuildCommands } from "./build";
 import { addDeployCommands } from "./deploy";
 import { addInitCommands } from "./init";
-import { addPublishMessageCommands } from "./publish_message";
+import { addPublishMessageCommands } from "./publishMessage";
 import { addSetupCommands } from "./setup";
 import { addUtilsCommands } from "./utils";
 

+ 2 - 2
clients/js/src/cmds/sui/publish_message.ts → clients/js/src/cmds/sui/publishMessage.ts

@@ -61,9 +61,9 @@ export const addPublishMessageCommands: YargsAddCommandsFn = (
       const network = argv.network.toUpperCase();
       assertNetwork(network);
       const packageId = argv["package-id"];
-      const stateObjectId = argv["state"];
+      const stateObjectId = argv.state;
       const wormholeStateObjectId = argv["wormhole-state"];
-      const message = argv["message"];
+      const message = argv.message;
       const privateKey = argv["private-key"];
       const rpc = argv.rpc ?? NETWORKS[network].sui.rpc;
 

+ 1 - 2
clients/js/src/cmds/sui/utils.ts

@@ -84,11 +84,10 @@ export const addUtilsCommands: YargsAddCommandsFn = (y: typeof yargs) =>
           .option("network", {
             alias: "n",
             describe: "Network",
-            type: "string",
             choices: ["mainnet", "testnet", "devnet"],
             default: "devnet",
             demandOption: false,
-          })
+          } as const)
           .option("rpc", RPC_OPTIONS),
       async (argv) => {
         const network = argv.network.toUpperCase();

+ 2 - 6
clients/js/src/cmds/verify-vaa.ts → clients/js/src/cmds/verifyVaa.ts

@@ -4,6 +4,7 @@ import { Implementation__factory } from "@certusone/wormhole-sdk/lib/esm/ethers-
 import { CONTRACTS } from "@certusone/wormhole-sdk/lib/esm/utils/consts";
 import { ethers } from "ethers";
 import yargs from "yargs";
+import { NETWORK_OPTIONS } from "../consts";
 import { NETWORKS } from "../networks";
 import { assertNetwork } from "../utils";
 
@@ -17,12 +18,7 @@ export const builder = (y: typeof yargs) =>
       type: "string",
       demandOption: true,
     })
-    .option("network", {
-      alias: "n",
-      describe: "network",
-      choices: ["mainnet", "testnet", "devnet"],
-      demandOption: true,
-    } as const);
+    .option("network", NETWORK_OPTIONS);
 export const handler = async (
   argv: Awaited<ReturnType<typeof builder>["argv"]>
 ) => {

+ 2 - 8
clients/js/src/main.ts

@@ -6,26 +6,21 @@ import { hideBin } from "yargs/helpers";
 import "./side-effects";
 // https://github.com/yargs/yargs/blob/main/docs/advanced.md#example-command-hierarchy-using-indexmjs
 import * as aptos from "./cmds/aptos";
-import * as chainId from "./cmds/chainId";
-import * as contractAddress from "./cmds/contractAddress";
-import * as editVaa from "./cmds/edit-vaa";
+import * as editVaa from "./cmds/editVaa";
 import * as evm from "./cmds/evm";
 import * as generate from "./cmds/generate";
 import * as info from "./cmds/info";
 import * as near from "./cmds/near";
 import * as parse from "./cmds/parse";
 import * as recover from "./cmds/recover";
-import * as rpc from "./cmds/rpc";
 import * as submit from "./cmds/submit";
 import * as sui from "./cmds/sui";
-import * as verifyVaa from "./cmds/verify-vaa";
+import * as verifyVaa from "./cmds/verifyVaa";
 
 yargs(hideBin(process.argv))
   // https://github.com/yargs/yargs/blob/main/docs/advanced.md#commanddirdirectory-opts
   // can't use `.commandDir` because bundling + tree-shaking
   .command(aptos)
-  .command(chainId)
-  .command(contractAddress)
   .command(editVaa)
   .command(evm)
   .command(generate)
@@ -33,7 +28,6 @@ yargs(hideBin(process.argv))
   .command(near)
   .command(parse)
   .command(recover)
-  .command(rpc)
   .command(submit)
   .command(sui)
   .command(verifyVaa)

+ 0 - 0
clients/js/src/start-validator.ts → clients/js/src/startValidator.ts


+ 1 - 1
clients/js/tsconfig.json

@@ -9,5 +9,5 @@
     "forceConsistentCasingInFileNames": true,
     "strict": true
   },
-  "include": ["src"]
+  "include": ["src", "types"]
 }

+ 0 - 0
clients/js/src/elliptic.d.ts → clients/js/types/elliptic.d.ts


+ 0 - 0
clients/js/src/near-seed-phrase.d.ts → clients/js/types/near-seed-phrase.d.ts


+ 1 - 1
ethereum/anvil_fork

@@ -12,4 +12,4 @@ fi
 
 CHAIN_NAME="$1"
 
-DOCKER_ARGS="-p 8545:8545" ./foundry anvil --host 0.0.0.0 --base-fee 0 --fork-url $(worm rpc mainnet $CHAIN_NAME) --mnemonic "myth like bonus scare over problem client lizard pioneer submit female collect"
+DOCKER_ARGS="-p 8545:8545" ./foundry anvil --host 0.0.0.0 --base-fee 0 --fork-url $(worm info rpc mainnet $CHAIN_NAME) --mnemonic "myth like bonus scare over problem client lizard pioneer submit female collect"

File diff suppressed because it is too large
+ 0 - 0
ethereum/scripts/TokenABI.s.sol


+ 2 - 2
ethereum/simulate_upgrade

@@ -79,7 +79,7 @@ shift $((OPTIND - 1))
 [ -z "$module" ] && usage
 
 # Get core contract address
-CORE=$(worm contract mainnet "$chain_name" Core)
+CORE=$(worm info contract mainnet "$chain_name" Core)
 echo "core: $CORE"
 
 # Use the local devnet guardian key (this is not a production key)
@@ -142,7 +142,7 @@ case "$module" in
        ;;
 esac
 
-CONTRACT=$(worm contract mainnet "$chain_name" "$MODULE")
+CONTRACT=$(worm info contract mainnet "$chain_name" "$MODULE")
 
 # Step 1) Figure out the contract address depending on the flags -- either use
 # an address passed in as an argument, or use the most recent contract in the repo.

+ 1 - 1
ethereum/verify

@@ -59,7 +59,7 @@ if [[ -n $network ]]; then
     echo "worm binary could not be found. See installation instructions in clients/js/README.md"
     exit 1
   fi
-  rpc=$(worm rpc "$network" "$chain")
+  rpc=$(worm info rpc "$network" "$chain")
 fi
 
 if [[ -z $rpc ]]; then

+ 1 - 1
scripts/contract-upgrade-governance.sh

@@ -407,7 +407,7 @@ if [ "$evm" = true ]; then
 	Next, use the \`verify\` script to verify that the deployed bytecodes we are upgrading to match the build artifacts:
 
 	\`\`\`shell
-	wormhole/ethereum $ ./verify -r $(worm rpc mainnet $chain_name) -c $chain_name $(evm_artifact) $address
+	wormhole/ethereum $ ./verify -r $(worm info rpc mainnet $chain_name) -c $chain_name $(evm_artifact) $address
 	\`\`\`
 
 EOF

+ 2 - 2
scripts/register-chain-governance.sh

@@ -90,10 +90,10 @@ shift $((OPTIND - 1))
 [ -z "$module" ] && usage
 
 # Use the worm client to get the emitter address and wormhole chain ID.
-[ -z "$address" ] && address=`worm contract --emitter mainnet $chain_name $module`
+[ -z "$address" ] && address=`worm info contract --emitter mainnet $chain_name $module`
 [ -z "$address" ] && usage
 
-chain=`worm chain-id $chain_name`
+chain=`worm info chain-id $chain_name`
 [ -z "$chain" ] && usage
 
 ### The script constructs the governance proposal in two different steps. First,

Some files were not shown because too many files changed in this diff