Skip to content

Commit

Permalink
Client/JS: Add new changes
Browse files Browse the repository at this point in the history
  • Loading branch information
bruce-riley authored and evan-gray committed Mar 14, 2024
1 parent 4805183 commit d7a4a2a
Show file tree
Hide file tree
Showing 9 changed files with 106 additions and 18 deletions.
20 changes: 12 additions & 8 deletions clients/js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,9 @@ Options:
"klaytn", "celo", "near", "moonbeam", "neon", "terra2", "injective",
"osmosis", "sui", "aptos", "arbitrum", "optimism", "gnosis", "pythnet",
"xpla", "btc", "base", "sei", "rootstock", "scroll", "mantle", "wormchain",
"cosmoshub", "evmos", "kujira", "neutron", "celestia", "sepolia",
"arbitrum_sepolia", "base_sepolia", "optimism_sepolia", "holesky"]
"cosmoshub", "evmos", "kujira", "neutron", "celestia", "stargaze", "seda",
"dymension", "sepolia", "arbitrum_sepolia", "base_sepolia",
"optimism_sepolia", "holesky", "polygon_sepolia"]
-n, --network Network
[required] [choices: "mainnet", "testnet", "devnet"]
-a, --contract-address Contract to submit VAA to (override config) [string]
Expand Down Expand Up @@ -313,16 +314,18 @@ Options:
"klaytn", "celo", "near", "moonbeam", "neon", "terra2", "injective",
"osmosis", "sui", "aptos", "arbitrum", "optimism", "gnosis", "pythnet",
"xpla", "btc", "base", "sei", "rootstock", "scroll", "mantle", "wormchain",
"cosmoshub", "evmos", "kujira", "neutron", "celestia", "sepolia",
"arbitrum_sepolia", "base_sepolia", "optimism_sepolia", "holesky"]
"cosmoshub", "evmos", "kujira", "neutron", "celestia", "stargaze", "seda",
"dymension", "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", "wormchain",
"cosmoshub", "evmos", "kujira", "neutron", "celestia", "sepolia",
"arbitrum_sepolia", "base_sepolia", "optimism_sepolia", "holesky"]
"cosmoshub", "evmos", "kujira", "neutron", "celestia", "stargaze", "seda",
"dymension", "sepolia", "arbitrum_sepolia", "base_sepolia",
"optimism_sepolia", "holesky", "polygon_sepolia"]
--dst-addr destination address [string] [required]
--token-addr token address [string] [default: native token]
--amount token amount [string] [required]
Expand Down Expand Up @@ -355,8 +358,9 @@ Positionals:
"klaytn", "celo", "near", "moonbeam", "neon", "terra2", "injective",
"osmosis", "sui", "aptos", "arbitrum", "optimism", "gnosis", "pythnet",
"xpla", "btc", "base", "sei", "rootstock", "scroll", "mantle", "wormchain",
"cosmoshub", "evmos", "kujira", "neutron", "celestia", "sepolia",
"arbitrum_sepolia", "base_sepolia", "optimism_sepolia", "holesky"]
"cosmoshub", "evmos", "kujira", "neutron", "celestia", "stargaze", "seda",
"dymension", "sepolia", "arbitrum_sepolia", "base_sepolia",
"optimism_sepolia", "holesky", "polygon_sepolia"]
tx Source transaction hash [string]

Options:
Expand Down
14 changes: 7 additions & 7 deletions clients/js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion clients/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
],
"dependencies": {
"@celo-tools/celo-ethers-wrapper": "^0.1.0",
"@certusone/wormhole-sdk": "^0.10.8",
"@certusone/wormhole-sdk": "^0.10.13",
"@cosmjs/encoding": "^0.26.2",
"@improbable-eng/grpc-web-node-http-transport": "^0.15.0",
"@injectivelabs/networks": "^1.10.7",
Expand Down
4 changes: 4 additions & 0 deletions clients/js/src/chains/generic/getOriginalAsset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export const getOriginalAsset = async (
case "arbitrum_sepolia":
case "base_sepolia":
case "optimism_sepolia":
case "polygon_sepolia":
case "holesky": {
const provider = getProviderForChain(chainName, network, { rpc });
return getOriginalAssetEth(
Expand Down Expand Up @@ -121,6 +122,9 @@ export const getOriginalAsset = async (
case "kujira":
case "neutron":
case "celestia":
case "stargaze":
case "seda":
case "dymension":
case "rootstock":
throw new Error(`${chainName} not supported`);
default:
Expand Down
4 changes: 4 additions & 0 deletions clients/js/src/chains/generic/getWrappedAssetAddress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export const getWrappedAssetAddress = async (
case "arbitrum_sepolia":
case "base_sepolia":
case "optimism_sepolia":
case "polygon_sepolia":
case "holesky": {
const provider = getProviderForChain(chainName, network, { rpc });
return getForeignAssetEth(
Expand Down Expand Up @@ -168,6 +169,9 @@ export const getWrappedAssetAddress = async (
case "neutron":
case "celestia":
case "rootstock":
case "stargaze":
case "seda":
case "dymension":
throw new Error(`${chainName} not supported`);
default:
impossible(chainName);
Expand Down
4 changes: 4 additions & 0 deletions clients/js/src/chains/generic/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export const getProviderForChain = <T extends ChainId | ChainName>(
case "arbitrum_sepolia":
case "base_sepolia":
case "optimism_sepolia":
case "polygon_sepolia":
case "holesky":
return new ethers.providers.JsonRpcProvider(rpc) as ChainProvider<T>;
case "terra":
Expand Down Expand Up @@ -165,6 +166,9 @@ export const getProviderForChain = <T extends ChainId | ChainName>(
case "kujira":
case "neutron":
case "celestia":
case "stargaze":
case "seda":
case "dymension":
case "rootstock":
throw new Error(`${chainName} not supported`);
default:
Expand Down
6 changes: 6 additions & 0 deletions clients/js/src/cmds/submit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,12 @@ async function executeSubmit(
throw Error("neutron is not supported yet");
} else if (chain === "celestia") {
throw Error("celestia is not supported yet");
} else if (chain === "stargaze") {
throw Error("stargaze is not supported yet");
} else if (chain === "seda") {
throw Error("seda is not supported yet");
} else if (chain === "dymension") {
throw Error("dymension is not supported yet");
} else if (chain === "rootstock") {
throw Error("rootstock is not supported yet");
} else {
Expand Down
6 changes: 6 additions & 0 deletions clients/js/src/cmds/transfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,12 @@ export const handler = async (
throw Error("neutron is not supported yet");
} else if (srcChain === "celestia") {
throw Error("celestia is not supported yet");
} else if (srcChain === "stargaze") {
throw Error("stargaze is not supported yet");
} else if (srcChain === "seda") {
throw Error("seda is not supported yet");
} else if (srcChain === "dymension") {
throw Error("dymension is not supported yet");
} else if (srcChain === "rootstock") {
throw Error("rootstock is not supported yet");
} else {
Expand Down
64 changes: 62 additions & 2 deletions clients/js/src/consts/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,26 @@ const MAINNET = {
key: undefined,
chain_id: undefined,
},
polygon_sepolia: {
rpc: undefined,
key: undefined,
chain_id: undefined,
},
stargaze: {
rpc: undefined,
key: undefined,
chain_id: undefined,
},
seda: {
rpc: undefined,
key: undefined,
chain_id: undefined,
},
dymension: {
rpc: undefined,
key: undefined,
chain_id: undefined,
},
};

const TESTNET = {
Expand Down Expand Up @@ -434,9 +454,9 @@ const TESTNET = {
chain_id: 534353,
},
mantle: {
rpc: "https://rpc.ankr.com/mantle_testnet",
rpc: "https://mantle-sepolia.drpc.org",
key: getEnvVar("ETH_KEY_TESTNET"),
chain_id: 5001,
chain_id: 5003,
},
arbitrum_sepolia: {
rpc: "https://arbitrum-sepolia.publicnode.com",
Expand All @@ -453,6 +473,26 @@ const TESTNET = {
key: getEnvVar("ETH_KEY_TESTNET"),
chain_id: 11155420,
},
polygon_sepolia: {
rpc: "https://rpc-amoy.polygon.technology/",
key: getEnvVar("ETH_KEY_TESTNET"),
chain_id: 80002,
},
stargaze: {
rpc: undefined,
key: undefined,
chain_id: undefined,
},
seda: {
rpc: undefined,
key: undefined,
chain_id: undefined,
},
dymension: {
rpc: undefined,
key: undefined,
chain_id: undefined,
},
};

const DEVNET = {
Expand Down Expand Up @@ -649,6 +689,26 @@ const DEVNET = {
key: undefined,
chain_id: undefined,
},
polygon_sepolia: {
rpc: undefined,
key: undefined,
chain_id: undefined,
},
stargaze: {
rpc: undefined,
key: undefined,
chain_id: undefined,
},
seda: {
rpc: undefined,
key: undefined,
chain_id: undefined,
},
dymension: {
rpc: undefined,
key: undefined,
chain_id: undefined,
},
};

/**
Expand Down

0 comments on commit d7a4a2a

Please sign in to comment.