Reference
Networks and environment
Every environment and network id you can pass as a source or destination.
Every transfer has a source and a destination network. You name them by id. To avoid loose strings, the SDK exports every id as a constant on NetworkId, and every environment on Environment.
Environment
import { Environment } from "@zethub/bridge";
Environment.TESTNET; // Circle sandbox networks
Environment.MAINNET; // production networksThe environment is chosen at construction and is immutable on an instance. Build two instances if you need both.
Referencing a network
import { NetworkId, ZetHubBridge } from "@zethub/bridge";
const sdk = new ZetHubBridge({ environment: Environment.TESTNET });
const chains = await sdk.chainDetailsMap();
const base = chains[NetworkId.BASE_SEPOLIA].network;
const stellar = chains[NetworkId.STELLAR_TESTNET].network;Testnet
| Constant | id | CCTP domain | EVM chain id |
|---|---|---|---|
NetworkId.ETHEREUM_SEPOLIA | ethereum-sepolia | 0 | 11155111 |
NetworkId.AVALANCHE_FUJI | avalanche-fuji | 1 | 43113 |
NetworkId.OPTIMISM_SEPOLIA | optimism-sepolia | 2 | 11155420 |
NetworkId.ARBITRUM_SEPOLIA | arbitrum-sepolia | 3 | 421614 |
NetworkId.BASE_SEPOLIA | base-sepolia | 6 | 84532 |
NetworkId.POLYGON_AMOY | polygon-amoy | 7 | 80002 |
NetworkId.STELLAR_TESTNET | stellar-testnet | 27 | n/a |
Mainnet
| Constant | id | CCTP domain | EVM chain id |
|---|---|---|---|
NetworkId.ETHEREUM | ethereum | 0 | 1 |
NetworkId.AVALANCHE | avalanche | 1 | 43114 |
NetworkId.OPTIMISM | optimism | 2 | 10 |
NetworkId.ARBITRUM | arbitrum | 3 | 42161 |
NetworkId.BASE | base | 6 | 8453 |
NetworkId.POLYGON | polygon | 7 | 137 |
NetworkId.UNICHAIN | unichain | 10 | 130 |
NetworkId.LINEA | linea | 11 | 59144 |
NetworkId.CODEX | codex | 12 | 81224 |
NetworkId.SONIC | sonic | 13 | 146 |
NetworkId.WORLDCHAIN | worldchain | 14 | 480 |
NetworkId.SEI | sei | 16 | 1329 |
NetworkId.HYPEREVM | hyperevm | 19 | 999 |
NetworkId.STELLAR | stellar | 27 | n/a |
The Network object
Each entry in chainDetailsMap() exposes the raw Network value under .network:
class Network {
readonly id: string;
readonly name: string;
readonly shortName: string;
readonly family: ChainFamily; // "evm" | "stellar"
readonly environment: Environment;
readonly cctpDomain: number;
readonly evmChainId?: number;
readonly stellarPassphrase?: string;
readonly tokens: readonly TokenAsset[];
readonly defaultAsset: AssetSymbol;
readonly tokenMessenger: string;
readonly messageTransmitter: string;
readonly cctpForwarder?: string;
readonly rpcUrls: readonly string[];
readonly explorerUrl: string;
readonly accentColor: string;
hasToken(symbol: AssetSymbol): boolean;
token(symbol?: AssetSymbol): TokenAsset;
isEvm(): boolean;
isStellar(): boolean;
}The contract addresses for each network are on the Contracts page.