diff --git a/clients/js/README.md b/clients/js/README.md index 93cfa8622..51e3ea95d 100644 --- a/clients/js/README.md +++ b/clients/js/README.md @@ -161,6 +161,9 @@ $ worm evm info -c bsc -n mainnet -m TokenBridge "moonbeam": "0x0000000000000000000000000000000000000000000000000000000000000000", "neon": "0x0000000000000000000000000000000000000000000000000000000000000000", "terra2": "0xa463ad028fb79679cfc8ce1efba35ac0e77b35080a1abe9bebe83461f176b0a3", + "arbitrum": "0x0000000000000000000000000000000000000000000000000000000000000000", + "optimism": "0x0000000000000000000000000000000000000000000000000000000000000000", + "gnosis": "0x0000000000000000000000000000000000000000000000000000000000000000", "ropsten": "0x0000000000000000000000000000000000000000000000000000000000000000" } } diff --git a/clients/js/main.ts b/clients/js/main.ts index e117dab68..e085c1d71 100644 --- a/clients/js/main.ts +++ b/clients/js/main.ts @@ -521,6 +521,12 @@ yargs(hideBin(process.argv)) throw Error("SUI is not supported yet"); } else if (chain === "aptos") { throw Error("APTOS is not supported yet"); + } else if (chain === "arbitrum") { + throw Error("ARBITRUM is not supported yet"); + } else if (chain === "optimism") { + throw Error("OPTIMISM is not supported yet"); + } else if (chain === "gnosis") { + throw Error("GNOSIS is not supported yet"); } else { // If you get a type error here, hover over `chain`'s type and it tells you // which cases are not handled @@ -559,6 +565,12 @@ function parseAddress(chain: ChainName, address: string): string { throw Error("SUI is not supported yet") } else if (chain === "aptos") { throw Error("APTOS is not supported yet") + } else if (chain === "arbitrum") { + throw Error("ARBITRUM is not supported yet") + } else if (chain === "optimism") { + throw Error("OPTIMISM is not supported yet") + } else if (chain === "gnosis") { + throw Error("GNOSIS is not supported yet") } else { impossible(chain) } diff --git a/clients/js/networks.ts b/clients/js/networks.ts index 034a2b7c6..a41afd262 100644 --- a/clients/js/networks.ts +++ b/clients/js/networks.ts @@ -111,6 +111,18 @@ const MAINNET = { chain_id: "phoenix-1", key: get_env_var("TERRA_MNEMONIC"), }, + arbitrum: { + rpc: undefined, + key: undefined, + }, + optimism: { + rpc: undefined, + key: undefined, + }, + gnosis: { + rpc: undefined, + key: undefined, + }, ropsten: { rpc: `https://rpc.ankr.com/eth_ropsten`, key: get_env_var("ETH_KEY"), @@ -212,6 +224,18 @@ const TESTNET = { chain_id: "pisco-1", key: get_env_var("TERRA_MNEMONIC"), }, + arbitrum: { + rpc: undefined, + key: undefined, + }, + optimism: { + rpc: undefined, + key: undefined, + }, + gnosis: { + rpc: undefined, + key: undefined, + }, ropsten: { rpc: `https://rpc.ankr.com/eth_ropsten`, key: get_env_var("ETH_KEY_TESTNET"), @@ -313,6 +337,18 @@ const DEVNET = { chain_id: "phoenix-1", key: "notice oak worry limit wrap speak medal online prefer cluster roof addict wrist behave treat actual wasp year salad speed social layer crew genius", }, + arbitrum: { + rpc: undefined, + key: undefined, + }, + optimism: { + rpc: undefined, + key: undefined, + }, + gnosis: { + rpc: undefined, + key: undefined, + }, ropsten: { rpc: undefined, key: "0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d", diff --git a/proto/publicrpc/v1/publicrpc.proto b/proto/publicrpc/v1/publicrpc.proto index 3c3117ffd..86d2ef1c1 100644 --- a/proto/publicrpc/v1/publicrpc.proto +++ b/proto/publicrpc/v1/publicrpc.proto @@ -31,6 +31,9 @@ enum ChainID { CHAIN_ID_OSMOSIS = 20; CHAIN_ID_SUI = 21; CHAIN_ID_APTOS = 22; + CHAIN_ID_ARBITRUM = 23; + CHAIN_ID_OPTIMISM = 24; + CHAIN_ID_GNOSIS = 25; // Special case - Eth has two testnets. CHAIN_ID_ETHEREUM is Goerli, // but we also want to connect to Ropsten, so we add a separate chain. CHAIN_ID_ETHEREUM_ROPSTEN = 10001; diff --git a/sdk/js/CHANGELOG.md b/sdk/js/CHANGELOG.md index 0d1711224..a7736983e 100644 --- a/sdk/js/CHANGELOG.md +++ b/sdk/js/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 0.5.2 + +### Changed + +Added chain ids for Arbitrum, Optimism, and Gnosis + ## 0.5.1 ### Changed diff --git a/sdk/js/src/utils/consts.ts b/sdk/js/src/utils/consts.ts index 8e48dcead..76183516f 100644 --- a/sdk/js/src/utils/consts.ts +++ b/sdk/js/src/utils/consts.ts @@ -22,6 +22,9 @@ export const CHAINS = { osmosis: 20, sui: 21, aptos: 22, + arbitrum: 23, + optimism: 24, + gnosis: 25, ropsten: 10001, } as const; @@ -46,6 +49,9 @@ export type EVMChainName = | "celo" | "moonbeam" | "neon" + | "arbitrum" + | "optimism" + | "gnosis" | "ropsten"; export type TerraChainName = "terra" | "terra2"; @@ -177,6 +183,21 @@ const MAINNET = { "terra153366q50k7t8nn7gec00hg66crnhkdggpgdtaxltaq6xrutkkz3s992fw9", nft_bridge: undefined, }, + arbitrum: { + core: undefined, + token_bridge: undefined, + nft_bridge: undefined, + }, + optimism: { + core: undefined, + token_bridge: undefined, + nft_bridge: undefined, + }, + gnosis: { + core: undefined, + token_bridge: undefined, + nft_bridge: undefined, + }, ropsten: { core: undefined, token_bridge: undefined, @@ -301,6 +322,21 @@ const TESTNET = { "terra1c02vds4uhgtrmcw7ldlg75zumdqxr8hwf7npseuf2h58jzhpgjxsgmwkvk", nft_bridge: undefined, }, + arbitrum: { + core: undefined, + token_bridge: undefined, + nft_bridge: undefined, + }, + optimism: { + core: undefined, + token_bridge: undefined, + nft_bridge: undefined, + }, + gnosis: { + core: undefined, + token_bridge: undefined, + nft_bridge: undefined, + }, ropsten: { core: "0x210c5F5e2AF958B4defFe715Dc621b7a3BA888c5", token_bridge: "0xF174F9A837536C449321df1Ca093Bb96948D5386", @@ -424,6 +460,21 @@ const DEVNET = { token_bridge: undefined, nft_bridge: undefined, }, + arbitrum: { + core: undefined, + token_bridge: undefined, + nft_bridge: undefined, + }, + optimism: { + core: undefined, + token_bridge: undefined, + nft_bridge: undefined, + }, + gnosis: { + core: undefined, + token_bridge: undefined, + nft_bridge: undefined, + }, ropsten: { core: undefined, token_bridge: undefined, @@ -492,6 +543,9 @@ export const CHAIN_ID_INJECTIVE = CHAINS["injective"]; export const CHAIN_ID_OSMOSIS = CHAINS["osmosis"]; export const CHAIN_ID_SUI = CHAINS["sui"]; export const CHAIN_ID_APTOS = CHAINS["aptos"]; +export const CHAIN_ID_ARBITRUM = CHAINS["arbitrum"]; +export const CHAIN_ID_OPTIMISM = CHAINS["optimism"]; +export const CHAIN_ID_GNOSIS = CHAINS["gnosis"]; export const CHAIN_ID_ETHEREUM_ROPSTEN = CHAINS["ropsten"]; // This inverts the [[CHAINS]] object so that we can look up a chain by id @@ -603,6 +657,9 @@ export function isEVMChain( chainId === CHAIN_ID_CELO || chainId === CHAIN_ID_MOONBEAM || chainId === CHAIN_ID_NEON || + chainId === CHAIN_ID_ARBITRUM || + chainId === CHAIN_ID_OPTIMISM || + chainId === CHAIN_ID_GNOSIS || chainId === CHAIN_ID_ETHEREUM_ROPSTEN ) { return isEVM(chainId);