| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419 |
- 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: {
- rpc: `https://rpc.ankr.com/eth`,
- key: get_env_var("ETH_KEY"),
- },
- bsc: {
- rpc: "https://bsc-dataseed.binance.org/",
- key: get_env_var("ETH_KEY"),
- },
- polygon: {
- rpc: "https://rpc.ankr.com/polygon",
- key: get_env_var("ETH_KEY"),
- },
- avalanche: {
- rpc: "https://rpc.ankr.com/avalanche",
- key: get_env_var("ETH_KEY"),
- },
- algorand: {
- rpc: "https://mainnet-api.algonode.cloud",
- key: get_env_var("ALGORAND_KEY"),
- },
- 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: {
- rpc: "https://eth-rpc-acala.aca-api.network/",
- key: get_env_var("ETH_KEY"),
- },
- klaytn: {
- rpc: "https://public-node-api.klaytnapi.com/v1/cypress",
- key: get_env_var("ETH_KEY"),
- },
- celo: {
- rpc: "https://forno.celo.org",
- key: get_env_var("ETH_KEY"),
- },
- near: {
- rpc: "https://rpc.mainnet.near.org",
- key: get_env_var("NEAR_KEY"),
- networkId: "mainnet",
- deployerAccount: "85957f38de1768d6db9eab29bee9dd2a01462aff9c8d83daefb9bcd2506c32d2",
- },
- injective: {
- rpc: undefined,
- key: undefined,
- },
- osmosis: {
- rpc: undefined,
- key: undefined,
- },
- aptos: {
- rpc: undefined,
- key: undefined,
- },
- sui: {
- rpc: undefined,
- key: undefined,
- },
- pythnet: {
- rpc: "http://api.pythnet.pyth.network:8899/",
- key: get_env_var("SOLANA_KEY"),
- },
- wormholechain: {
- rpc: undefined,
- key: undefined,
- },
- moonbeam: {
- rpc: "https://rpc.api.moonbeam.network",
- key: get_env_var("ETH_KEY"),
- },
- neon: {
- rpc: undefined,
- key: undefined,
- },
- terra2: {
- rpc: "https://phoenix-lcd.terra.dev",
- chain_id: "phoenix-1",
- key: get_env_var("TERRA_MNEMONIC"),
- },
- arbitrum: {
- rpc: "https://arb1.arbitrum.io/rpc",
- key: get_env_var("ETH_KEY"),
- },
- optimism: {
- rpc: "https://mainnet.optimism.io",
- key: get_env_var("ETH_KEY"),
- },
- gnosis: {
- rpc: "https://rpc.gnosischain.com/",
- key: get_env_var("ETH_KEY"),
- },
- ropsten: {
- rpc: `https://rpc.ankr.com/eth_ropsten`,
- key: get_env_var("ETH_KEY"),
- },
- };
- const TESTNET = {
- unset: {
- rpc: undefined,
- key: undefined,
- },
- solana: {
- rpc: "https://api.devnet.solana.com",
- key: get_env_var("SOLANA_KEY_TESTNET"),
- },
- terra: {
- rpc: "https://bombay-lcd.terra.dev",
- chain_id: "bombay-12",
- key: get_env_var("TERRA_MNEMONIC"),
- },
- ethereum: {
- rpc: `https://rpc.ankr.com/eth_goerli`,
- key: get_env_var("ETH_KEY_TESTNET"),
- },
- bsc: {
- rpc: "https://data-seed-prebsc-1-s1.binance.org:8545",
- key: get_env_var("ETH_KEY_TESTNET"),
- },
- polygon: {
- rpc: `https://rpc.ankr.com/polygon_mumbai`,
- key: get_env_var("ETH_KEY_TESTNET"),
- },
- avalanche: {
- rpc: "https://rpc.ankr.com/avalanche_fuji",
- key: get_env_var("ETH_KEY_TESTNET"),
- },
- oasis: {
- rpc: "https://testnet.emerald.oasis.dev",
- key: get_env_var("ETH_KEY_TESTNET"),
- },
- algorand: {
- rpc: "https://testnet-api.algonode.cloud",
- key: get_env_var("ALGORAND_KEY_TESTNET"),
- },
- fantom: {
- rpc: "https://rpc.testnet.fantom.network",
- key: get_env_var("ETH_KEY_TESTNET"),
- },
- aurora: {
- rpc: "https://testnet.aurora.dev",
- key: get_env_var("ETH_KEY_TESTNET"),
- },
- karura: {
- rpc: "https://karura-dev.aca-dev.network/eth/http",
- key: get_env_var("ETH_KEY_TESTNET"),
- },
- acala: {
- rpc: "https://acala-dev.aca-dev.network/eth/http",
- key: get_env_var("ETH_KEY_TESTNET"),
- },
- klaytn: {
- rpc: "https://api.baobab.klaytn.net:8651",
- key: get_env_var("ETH_KEY_TESTNET"),
- },
- celo: {
- rpc: "https://alfajores-forno.celo-testnet.org",
- key: get_env_var("ETH_KEY_TESTNET"),
- },
- near: {
- rpc: "https://rpc.testnet.near.org",
- key: get_env_var("NEAR_KEY_TESTNET"),
- networkId: "testnet",
- deployerAccount: undefined,
- },
- injective: {
- rpc: "https://k8s.testnet.tm.injective.network:443",
- chain_id: "injective-888",
- key: get_env_var("ETH_KEY_TESTNET"),
- },
- osmosis: {
- rpc: undefined,
- chain_id: "osmo-test-4",
- key: get_env_var("ETH_KEY_TESTNET"),
- },
- aptos: {
- rpc: undefined,
- key: undefined,
- },
- sui: {
- rpc: undefined,
- key: undefined,
- },
- pythnet: {
- rpc: "https://api.pythtest.pyth.network/",
- key: get_env_var("SOLANA_KEY_TESTNET"),
- },
- wormholechain: {
- rpc: undefined,
- key: undefined,
- },
- moonbeam: {
- rpc: "https://rpc.api.moonbase.moonbeam.network",
- key: get_env_var("ETH_KEY_TESTNET"),
- },
- neon: {
- rpc: "https://proxy.devnet.neonlabs.org/solana",
- key: get_env_var("ETH_KEY_TESTNET"),
- },
- terra2: {
- rpc: "https://pisco-lcd.terra.dev",
- chain_id: "pisco-1",
- key: get_env_var("TERRA_MNEMONIC"),
- },
- arbitrum: {
- rpc: "https://goerli-rollup.arbitrum.io/rpc",
- key: get_env_var("ETH_KEY_TESTNET"),
- },
- optimism: {
- rpc: "https://goerli.optimism.io",
- key: get_env_var("ETH_KEY_TESTNET"),
- },
- gnosis: {
- rpc: "https://sokol.poa.network/",
- key: get_env_var("ETH_KEY_TESTNET"),
- },
- ropsten: {
- rpc: `https://rpc.ankr.com/eth_ropsten`,
- key: get_env_var("ETH_KEY_TESTNET"),
- },
- };
- 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,
- key: "0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d",
- },
- avalanche: {
- rpc: undefined,
- key: "0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d",
- },
- oasis: {
- rpc: undefined,
- key: "0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d",
- },
- algorand: {
- rpc: "http://localhost",
- key: get_env_var("ALGORAND_KEY_DEVNET"),
- },
- fantom: {
- rpc: undefined,
- key: "0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d",
- },
- aurora: {
- rpc: undefined,
- key: "0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d",
- },
- karura: {
- rpc: undefined,
- key: "0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d",
- },
- acala: {
- rpc: undefined,
- key: "0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d",
- },
- klaytn: {
- rpc: undefined,
- key: "0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d",
- },
- celo: {
- rpc: undefined,
- key: "0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d",
- },
- near: {
- rpc: undefined,
- key: undefined,
- networkId: "sandbox",
- deployerAccount: "test.near",
- },
- injective: {
- rpc: undefined,
- key: undefined,
- },
- osmosis: {
- rpc: undefined,
- key: undefined,
- },
- pythnet: {
- rpc: undefined,
- key: undefined,
- },
- wormholechain: {
- rpc: "http://localhost:1319",
- chain_id: "wormholechain",
- key: undefined,
- },
- aptos: {
- rpc: undefined,
- key: undefined,
- },
- sui: {
- rpc: undefined,
- key: undefined,
- },
- moonbeam: {
- rpc: undefined,
- key: "0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d",
- },
- neon: {
- rpc: undefined,
- key: "0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d",
- },
- terra2: {
- 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",
- },
- arbitrum: {
- rpc: undefined,
- key: undefined,
- },
- optimism: {
- rpc: undefined,
- key: undefined,
- },
- gnosis: {
- rpc: undefined,
- key: undefined,
- },
- ropsten: {
- rpc: undefined,
- key: "0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d",
- },
- };
- /**
- *
- * 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 };
|