Function: networkInfo()
networkInfo(
selectorOrIdOrName:string|number|bigint):NetworkInfo
Defined in: networks.ts:165
Converts a chain selector, chain ID, or chain name to complete network information
Resolves against the live SELECTORS table, so chains added to it at runtime (e.g. a local devnet) resolve like bundled ones.
Parameters
| Parameter | Type | Description |
|---|---|---|
selectorOrIdOrName | string | number | bigint | Can be: - Chain selector as bigint or numeric string - Chain ID as number, bigint or string (EVM: "1", Aptos: "aptos:1", Solana: genesisHash) - Chain name as string ("ethereum-mainnet") |
Returns
Complete NetworkInfo object
Throws
CCIPChainNotFoundError if chain is not found
Example
TypeScript
import { networkInfo } from '@chainlink/ccip-sdk'
// By chain name
const sepolia = networkInfo('ethereum-testnet-sepolia')
console.log('Selector:', sepolia.chainSelector)
// By chain selector
const fuji = networkInfo(14767482510784806043n)
console.log('Name:', fuji.name) // 'avalanche-testnet-fuji'
// By chain ID
const mainnet = networkInfo(1)
console.log('Family:', mainnet.family) // 'EVM'