2022-05-05 17:51:24 -07:00
import { ChainName } from "@certusone/wormhole-sdk" ;
require ( "dotenv" ) . config ( { path : ` ${ process . env . HOME } /.wormhole/.env ` } ) ;
function get_env_var ( env : string ) : string | undefined {
const v = process . env [ env ] ;
return v ;
}
export type Connection = {
rpc : string | undefined ;
key : string | undefined ;
} ;
export type ChainConnections = {
[ chain in ChainName ] : Connection ;
} ;
const MAINNET = {
unset : {
rpc : undefined ,
key : undefined ,
} ,
solana : {
rpc : "https://api.mainnet-beta.solana.com" ,
key : get_env_var ( "SOLANA_KEY" ) ,
} ,
terra : {
rpc : "https://lcd.terra.dev" ,
chain_id : "columbus-5" ,
key : get_env_var ( "TERRA_MNEMONIC" ) ,
} ,
ethereum : {
2022-06-25 07:01:03 -07:00
rpc : ` https://rpc.ankr.com/eth ` ,
2022-05-05 17:51:24 -07:00
key : get_env_var ( "ETH_KEY" ) ,
} ,
bsc : {
rpc : "https://bsc-dataseed.binance.org/" ,
key : get_env_var ( "ETH_KEY" ) ,
} ,
polygon : {
2022-06-25 07:01:03 -07:00
rpc : "https://rpc.ankr.com/polygon" ,
2022-05-05 17:51:24 -07:00
key : get_env_var ( "ETH_KEY" ) ,
} ,
avalanche : {
2022-06-25 07:01:03 -07:00
rpc : "https://rpc.ankr.com/avalanche" ,
2022-05-05 17:51:24 -07:00
key : get_env_var ( "ETH_KEY" ) ,
} ,
algorand : {
2022-08-22 07:39:39 -07:00
rpc : "https://mainnet-api.algonode.cloud" ,
key : get_env_var ( "ALGORAND_KEY" ) ,
2022-05-05 17:51:24 -07:00
} ,
oasis : {
rpc : "https://emerald.oasis.dev/" ,
key : get_env_var ( "ETH_KEY" ) ,
} ,
fantom : {
rpc : "https://rpc.ftm.tools/" ,
key : get_env_var ( "ETH_KEY" ) ,
} ,
aurora : {
rpc : "https://mainnet.aurora.dev" ,
key : get_env_var ( "ETH_KEY" ) ,
} ,
karura : {
rpc : "https://eth-rpc-karura.aca-api.network/" ,
key : get_env_var ( "ETH_KEY" ) ,
} ,
acala : {
2022-06-02 09:18:44 -07:00
rpc : "https://eth-rpc-acala.aca-api.network/" ,
2022-05-05 17:51:24 -07:00
key : get_env_var ( "ETH_KEY" ) ,
} ,
klaytn : {
2022-05-16 07:06:17 -07:00
rpc : "https://public-node-api.klaytnapi.com/v1/cypress" ,
2022-05-05 17:51:24 -07:00
key : get_env_var ( "ETH_KEY" ) ,
} ,
celo : {
2022-05-12 09:12:40 -07:00
rpc : "https://forno.celo.org" ,
2022-05-05 17:51:24 -07:00
key : get_env_var ( "ETH_KEY" ) ,
} ,
near : {
2022-08-26 09:46:37 -07:00
rpc : "https://rpc.mainnet.near.org" ,
key : get_env_var ( "NEAR_KEY" ) ,
networkId : "mainnet" ,
2022-10-06 12:39:34 -07:00
deployerAccount :
"85957f38de1768d6db9eab29bee9dd2a01462aff9c8d83daefb9bcd2506c32d2" ,
2022-05-05 17:51:24 -07:00
} ,
2022-07-15 06:03:03 -07:00
injective : {
rpc : undefined ,
key : undefined ,
} ,
osmosis : {
rpc : undefined ,
key : undefined ,
} ,
aptos : {
rpc : undefined ,
key : undefined ,
} ,
sui : {
rpc : undefined ,
key : undefined ,
} ,
2022-08-19 08:29:57 -07:00
pythnet : {
rpc : "http://api.pythnet.pyth.network:8899/" ,
key : get_env_var ( "SOLANA_KEY" ) ,
} ,
2022-10-11 12:30:09 -07:00
xpla : {
rpc : "https://dimension-lcd.xpla.dev" ,
chain_id : "dimension_37-1" ,
key : get_env_var ( "XPLA_KEY" ) ,
} ,
2022-08-19 08:29:57 -07:00
wormholechain : {
rpc : undefined ,
key : undefined ,
} ,
2022-05-10 10:05:43 -07:00
moonbeam : {
2022-07-21 09:52:53 -07:00
rpc : "https://rpc.api.moonbeam.network" ,
key : get_env_var ( "ETH_KEY" ) ,
2022-06-14 07:22:49 -07:00
} ,
neon : {
rpc : undefined ,
key : undefined ,
} ,
2022-06-07 08:36:21 -07:00
terra2 : {
2022-06-17 10:56:19 -07:00
rpc : "https://phoenix-lcd.terra.dev" ,
chain_id : "phoenix-1" ,
key : get_env_var ( "TERRA_MNEMONIC" ) ,
2022-06-07 08:36:21 -07:00
} ,
2022-07-19 11:05:40 -07:00
arbitrum : {
2022-07-20 11:38:16 -07:00
rpc : "https://arb1.arbitrum.io/rpc" ,
key : get_env_var ( "ETH_KEY" ) ,
2022-07-19 11:05:40 -07:00
} ,
optimism : {
2022-07-20 11:38:16 -07:00
rpc : "https://mainnet.optimism.io" ,
key : get_env_var ( "ETH_KEY" ) ,
2022-07-19 11:05:40 -07:00
} ,
gnosis : {
2022-07-20 11:38:16 -07:00
rpc : "https://rpc.gnosischain.com/" ,
key : get_env_var ( "ETH_KEY" ) ,
2022-07-19 11:05:40 -07:00
} ,
2022-05-05 17:51:24 -07:00
ropsten : {
2022-06-25 07:01:03 -07:00
rpc : ` https://rpc.ankr.com/eth_ropsten ` ,
2022-05-05 17:51:24 -07:00
key : get_env_var ( "ETH_KEY" ) ,
} ,
} ;
const TESTNET = {
unset : {
rpc : undefined ,
key : undefined ,
} ,
solana : {
rpc : "https://api.devnet.solana.com" ,
2022-08-19 08:29:57 -07:00
key : get_env_var ( "SOLANA_KEY_TESTNET" ) ,
2022-05-05 17:51:24 -07:00
} ,
terra : {
rpc : "https://bombay-lcd.terra.dev" ,
chain_id : "bombay-12" ,
key : get_env_var ( "TERRA_MNEMONIC" ) ,
} ,
ethereum : {
2022-06-25 07:01:03 -07:00
rpc : ` https://rpc.ankr.com/eth_goerli ` ,
2022-06-22 09:12:13 -07:00
key : get_env_var ( "ETH_KEY_TESTNET" ) ,
2022-05-05 17:51:24 -07:00
} ,
bsc : {
rpc : "https://data-seed-prebsc-1-s1.binance.org:8545" ,
2022-06-22 09:12:13 -07:00
key : get_env_var ( "ETH_KEY_TESTNET" ) ,
2022-05-05 17:51:24 -07:00
} ,
polygon : {
2022-06-25 07:01:03 -07:00
rpc : ` https://rpc.ankr.com/polygon_mumbai ` ,
2022-06-22 09:12:13 -07:00
key : get_env_var ( "ETH_KEY_TESTNET" ) ,
2022-05-05 17:51:24 -07:00
} ,
avalanche : {
2022-06-25 07:01:03 -07:00
rpc : "https://rpc.ankr.com/avalanche_fuji" ,
2022-06-22 09:12:13 -07:00
key : get_env_var ( "ETH_KEY_TESTNET" ) ,
2022-05-05 17:51:24 -07:00
} ,
oasis : {
rpc : "https://testnet.emerald.oasis.dev" ,
2022-06-22 09:12:13 -07:00
key : get_env_var ( "ETH_KEY_TESTNET" ) ,
2022-05-05 17:51:24 -07:00
} ,
algorand : {
2022-08-22 07:39:39 -07:00
rpc : "https://testnet-api.algonode.cloud" ,
key : get_env_var ( "ALGORAND_KEY_TESTNET" ) ,
2022-05-05 17:51:24 -07:00
} ,
fantom : {
rpc : "https://rpc.testnet.fantom.network" ,
2022-06-22 09:12:13 -07:00
key : get_env_var ( "ETH_KEY_TESTNET" ) ,
2022-05-05 17:51:24 -07:00
} ,
aurora : {
rpc : "https://testnet.aurora.dev" ,
2022-06-22 09:12:13 -07:00
key : get_env_var ( "ETH_KEY_TESTNET" ) ,
2022-05-05 17:51:24 -07:00
} ,
karura : {
2022-06-30 04:52:08 -07:00
rpc : "https://karura-dev.aca-dev.network/eth/http" ,
2022-06-22 09:12:13 -07:00
key : get_env_var ( "ETH_KEY_TESTNET" ) ,
2022-05-05 17:51:24 -07:00
} ,
acala : {
2022-06-30 04:52:08 -07:00
rpc : "https://acala-dev.aca-dev.network/eth/http" ,
2022-06-22 09:12:13 -07:00
key : get_env_var ( "ETH_KEY_TESTNET" ) ,
2022-05-05 17:51:24 -07:00
} ,
klaytn : {
rpc : "https://api.baobab.klaytn.net:8651" ,
2022-06-22 09:12:13 -07:00
key : get_env_var ( "ETH_KEY_TESTNET" ) ,
2022-05-05 17:51:24 -07:00
} ,
celo : {
2022-05-10 10:05:43 -07:00
rpc : "https://alfajores-forno.celo-testnet.org" ,
2022-06-22 09:12:13 -07:00
key : get_env_var ( "ETH_KEY_TESTNET" ) ,
2022-05-05 17:51:24 -07:00
} ,
near : {
2022-08-19 08:29:57 -07:00
rpc : "https://rpc.testnet.near.org" ,
key : get_env_var ( "NEAR_KEY_TESTNET" ) ,
networkId : "testnet" ,
2022-10-07 06:35:28 -07:00
deployerAccount : "wormhole.testnet" ,
2022-05-05 17:51:24 -07:00
} ,
2022-07-15 06:03:03 -07:00
injective : {
2022-06-29 10:09:29 -07:00
rpc : "https://k8s.testnet.tm.injective.network:443" ,
chain_id : "injective-888" ,
2022-10-06 12:39:34 -07:00
key : get_env_var ( "INJECTIVE_KEY_TESTNET" ) ,
2022-07-15 06:03:03 -07:00
} ,
osmosis : {
rpc : undefined ,
2022-06-29 10:09:29 -07:00
chain_id : "osmo-test-4" ,
2022-10-06 12:39:34 -07:00
key : get_env_var ( "OSMOSIS_KEY_TESTNET" ) ,
2022-07-15 06:03:03 -07:00
} ,
aptos : {
2022-10-13 18:21:01 -07:00
rpc : "https://fullnode.testnet.aptoslabs.com/v1" ,
key : get_env_var ( "APTOS_TESTNET" ) ,
2022-07-15 06:03:03 -07:00
} ,
sui : {
rpc : undefined ,
key : undefined ,
} ,
2022-08-19 08:29:57 -07:00
pythnet : {
rpc : "https://api.pythtest.pyth.network/" ,
key : get_env_var ( "SOLANA_KEY_TESTNET" ) ,
} ,
2022-10-11 12:30:09 -07:00
xpla : {
rpc : "https://cube-lcd.xpla.dev:443" ,
chain_id : "cube_47-5" ,
key : get_env_var ( "XPLA_KEY_TESTNET" ) ,
} ,
2022-08-19 08:29:57 -07:00
wormholechain : {
rpc : undefined ,
key : undefined ,
} ,
2022-05-10 10:05:43 -07:00
moonbeam : {
rpc : "https://rpc.api.moonbase.moonbeam.network" ,
2022-06-22 09:12:13 -07:00
key : get_env_var ( "ETH_KEY_TESTNET" ) ,
2022-06-14 07:22:49 -07:00
} ,
neon : {
rpc : "https://proxy.devnet.neonlabs.org/solana" ,
2022-06-22 09:12:13 -07:00
key : get_env_var ( "ETH_KEY_TESTNET" ) ,
2022-06-14 07:22:49 -07:00
} ,
2022-06-07 08:36:21 -07:00
terra2 : {
2022-06-17 10:56:19 -07:00
rpc : "https://pisco-lcd.terra.dev" ,
chain_id : "pisco-1" ,
key : get_env_var ( "TERRA_MNEMONIC" ) ,
2022-06-07 08:36:21 -07:00
} ,
2022-07-19 11:05:40 -07:00
arbitrum : {
2022-09-27 12:41:01 -07:00
rpc : "https://goerli-rollup.arbitrum.io/rpc" ,
2022-07-20 11:38:16 -07:00
key : get_env_var ( "ETH_KEY_TESTNET" ) ,
2022-07-19 11:05:40 -07:00
} ,
optimism : {
2022-07-20 11:38:16 -07:00
rpc : "https://goerli.optimism.io" ,
key : get_env_var ( "ETH_KEY_TESTNET" ) ,
2022-07-19 11:05:40 -07:00
} ,
gnosis : {
2022-07-20 11:38:16 -07:00
rpc : "https://sokol.poa.network/" ,
key : get_env_var ( "ETH_KEY_TESTNET" ) ,
2022-07-19 11:05:40 -07:00
} ,
2022-05-05 17:51:24 -07:00
ropsten : {
2022-06-25 07:01:03 -07:00
rpc : ` https://rpc.ankr.com/eth_ropsten ` ,
2022-06-22 09:12:13 -07:00
key : get_env_var ( "ETH_KEY_TESTNET" ) ,
2022-05-05 17:51:24 -07:00
} ,
} ;
const DEVNET = {
unset : {
rpc : undefined ,
key : undefined ,
} ,
solana : {
rpc : "http://localhost:8899" ,
key : "J2D4pwDred8P9ioyPEZVLPht885AeYpifsFGUyuzVmiKQosAvmZP4EegaKFrSprBC5vVP1xTvu61vYDWsxBNsYx" ,
} ,
terra : {
rpc : "http://localhost:1317" ,
chain_id : "columbus-5" ,
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" ,
} ,
ethereum : {
rpc : "http://localhost:8545" ,
key : "0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d" ,
} ,
bsc : {
rpc : "http://localhost:8546" ,
key : "0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d" ,
} ,
polygon : {
rpc : undefined ,
2022-06-25 07:01:03 -07:00
key : "0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d" ,
2022-05-05 17:51:24 -07:00
} ,
avalanche : {
rpc : undefined ,
2022-06-25 07:01:03 -07:00
key : "0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d" ,
2022-05-05 17:51:24 -07:00
} ,
oasis : {
rpc : undefined ,
2022-06-25 07:01:03 -07:00
key : "0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d" ,
2022-05-05 17:51:24 -07:00
} ,
algorand : {
2022-08-22 07:39:39 -07:00
rpc : "http://localhost" ,
key : get_env_var ( "ALGORAND_KEY_DEVNET" ) ,
2022-05-05 17:51:24 -07:00
} ,
fantom : {
rpc : undefined ,
2022-06-25 07:01:03 -07:00
key : "0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d" ,
2022-05-05 17:51:24 -07:00
} ,
aurora : {
rpc : undefined ,
2022-06-25 07:01:03 -07:00
key : "0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d" ,
2022-05-05 17:51:24 -07:00
} ,
karura : {
rpc : undefined ,
2022-06-25 07:01:03 -07:00
key : "0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d" ,
2022-05-05 17:51:24 -07:00
} ,
acala : {
rpc : undefined ,
2022-06-25 07:01:03 -07:00
key : "0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d" ,
2022-05-05 17:51:24 -07:00
} ,
klaytn : {
rpc : undefined ,
2022-06-25 07:01:03 -07:00
key : "0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d" ,
2022-05-05 17:51:24 -07:00
} ,
celo : {
rpc : undefined ,
2022-06-25 07:01:03 -07:00
key : "0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d" ,
2022-05-05 17:51:24 -07:00
} ,
near : {
rpc : undefined ,
key : undefined ,
2022-08-19 08:29:57 -07:00
networkId : "sandbox" ,
2022-08-26 09:46:37 -07:00
deployerAccount : "test.near" ,
2022-05-05 17:51:24 -07:00
} ,
2022-07-15 06:03:03 -07:00
injective : {
rpc : undefined ,
key : undefined ,
} ,
osmosis : {
rpc : undefined ,
key : undefined ,
} ,
2022-08-22 07:39:39 -07:00
pythnet : {
2022-07-15 06:03:03 -07:00
rpc : undefined ,
key : undefined ,
} ,
2022-10-11 12:30:09 -07:00
xpla : {
rpc : undefined ,
chain_id : undefined ,
key : undefined ,
} ,
2022-08-22 07:39:39 -07:00
wormholechain : {
2022-09-02 01:36:24 -07:00
rpc : "http://localhost:1319" ,
chain_id : "wormholechain" ,
2022-07-15 06:03:03 -07:00
key : undefined ,
} ,
2022-08-22 07:39:39 -07:00
aptos : {
2022-10-13 18:21:01 -07:00
rpc : "http://0.0.0.0:8080" ,
key : "537c1f91e56891445b491068f519b705f8c0f1a1e66111816dd5d4aa85b8113d" ,
2022-08-19 08:29:57 -07:00
} ,
2022-08-22 07:39:39 -07:00
sui : {
2022-08-19 08:29:57 -07:00
rpc : undefined ,
key : undefined ,
} ,
2022-05-10 10:05:43 -07:00
moonbeam : {
rpc : undefined ,
2022-06-25 07:01:03 -07:00
key : "0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d" ,
2022-06-14 07:22:49 -07:00
} ,
neon : {
rpc : undefined ,
2022-06-25 07:01:03 -07:00
key : "0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d" ,
2022-06-14 07:22:49 -07:00
} ,
2022-06-07 08:36:21 -07:00
terra2 : {
2022-06-17 10:56:19 -07:00
rpc : "http://localhost:1318" ,
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" ,
2022-06-07 08:36:21 -07:00
} ,
2022-07-19 11:05:40 -07:00
arbitrum : {
rpc : undefined ,
key : undefined ,
} ,
optimism : {
rpc : undefined ,
key : undefined ,
} ,
gnosis : {
rpc : undefined ,
key : undefined ,
} ,
2022-05-05 17:51:24 -07:00
ropsten : {
rpc : undefined ,
2022-06-25 07:01:03 -07:00
key : "0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d" ,
2022-05-05 17:51:24 -07:00
} ,
} ;
/ * *
*
* If you get a type error here , it means that a chain you just added does not
* have an entry in TESTNET .
* This is implemented as an ad - hoc type assertion instead of a type annotation
* on TESTNET so that e . g .
*
* ` ` ` typescript
* TESTNET [ 'solana' ] . rpc
* ` ` `
* has type 'string' instead of 'string | undefined' .
*
* ( Do not delete this declaration ! )
* /
const isTestnetConnections : ChainConnections = TESTNET ;
/ * *
*
* See [ [ isTestnetContracts ] ]
* /
const isMainnetConnections : ChainConnections = MAINNET ;
/ * *
*
* See [ [ isTestnetContracts ] ]
* /
const isDevnetConnections : ChainConnections = DEVNET ;
export const NETWORKS = { MAINNET , TESTNET , DEVNET } ;