Skip to content

Commit

Permalink
Client/JS: Add Holesky support (#3638)
Browse files Browse the repository at this point in the history
  • Loading branch information
bruce-riley authored Jan 9, 2024
1 parent 81af52a commit 517c2f7
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 14 deletions.
8 changes: 4 additions & 4 deletions clients/js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ Options:
"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"]
"arbitrum_sepolia", "base_sepolia", "optimism_sepolia", "holesky"]
-n, --network Network
[required] [choices: "mainnet", "testnet", "devnet"]
-a, --contract-address Contract to submit VAA to (override config) [string]
Expand Down Expand Up @@ -314,15 +314,15 @@ Options:
"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"]
"arbitrum_sepolia", "base_sepolia", "optimism_sepolia", "holesky"]
--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"]
"arbitrum_sepolia", "base_sepolia", "optimism_sepolia", "holesky"]
--dst-addr destination address [string] [required]
--token-addr token address [string] [default: native token]
--amount token amount [string] [required]
Expand Down Expand Up @@ -356,7 +356,7 @@ Positionals:
"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"]
"arbitrum_sepolia", "base_sepolia", "optimism_sepolia", "holesky"]
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.7",
"@certusone/wormhole-sdk": "^0.10.8",
"@cosmjs/encoding": "^0.26.2",
"@improbable-eng/grpc-web-node-http-transport": "^0.15.0",
"@injectivelabs/networks": "^1.10.7",
Expand Down
3 changes: 2 additions & 1 deletion clients/js/src/chains/generic/getOriginalAsset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ export const getOriginalAsset = async (
case "sepolia":
case "arbitrum_sepolia":
case "base_sepolia":
case "optimism_sepolia": {
case "optimism_sepolia":
case "holesky": {
const provider = getProviderForChain(chainName, network, { rpc });
return getOriginalAssetEth(
tokenBridgeAddress,
Expand Down
3 changes: 2 additions & 1 deletion clients/js/src/chains/generic/getWrappedAssetAddress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ export const getWrappedAssetAddress = async (
case "sepolia":
case "arbitrum_sepolia":
case "base_sepolia":
case "optimism_sepolia": {
case "optimism_sepolia":
case "holesky": {
const provider = getProviderForChain(chainName, network, { rpc });
return getForeignAssetEth(
tokenBridgeAddress,
Expand Down
1 change: 1 addition & 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 "holesky":
return new ethers.providers.JsonRpcProvider(rpc) as ChainProvider<T>;
case "terra":
case "terra2":
Expand Down
14 changes: 14 additions & 0 deletions clients/js/src/consts/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,11 @@ const MAINNET = {
key: undefined,
chain_id: undefined,
},
holesky: {
rpc: undefined,
key: undefined,
chain_id: undefined,
},
cosmoshub: {
rpc: undefined,
key: undefined,
Expand Down Expand Up @@ -345,6 +350,11 @@ const TESTNET = {
key: getEnvVar("ETH_KEY_TESTNET"),
chain_id: 11155111,
},
holesky: {
rpc: "https://rpc.ankr.com/eth_holesky",
key: getEnvVar("ETH_KEY_TESTNET"),
chain_id: 17000,
},
btc: {
rpc: undefined,
key: undefined,
Expand Down Expand Up @@ -542,6 +552,10 @@ const DEVNET = {
rpc: undefined,
key: undefined,
},
holesky: {
rpc: undefined,
key: undefined,
},
wormchain: {
rpc: "http://localhost:1319",
chain_id: "wormchain",
Expand Down

0 comments on commit 517c2f7

Please sign in to comment.