Skip to main content

Try it Live

Run Chain examples in the interactive playground

Metadata

Accessing chain configuration properties including network details, RPC endpoints, explorers, and native currency information.

Overview

Chain objects contain comprehensive network metadata following the Chain List standard. All properties are accessed directly on the chain object.

Core Properties

Network Identification

chain.name

Full network name.
Type: string

chain.chainId

EIP-155 chain identifier. Unique numeric ID for the network.
Type: number Note: Chain IDs are defined by EIP-155 to prevent replay attacks across chains.

chain.shortName

Short identifier for the chain.
Type: string

chain.chain

Chain family or network type identifier.
Type: string

chain.networkId

Network ID (optional). May differ from chain ID on some networks.
Type: number | undefined Note: Most modern networks use the same value for chain ID and network ID, making this property often redundant.

Native Currency

chain.nativeCurrency

Native currency details including name, symbol, and decimals.
Type: NativeCurrency

nativeCurrency.name

Full name of native currency. Type: string

nativeCurrency.symbol

Currency symbol (ticker). Type: string Common symbols:
  • ETH - Ethereum and many L2s
  • QUAI - Quai Network
  • FLR - Flare
  • RON - Ronin

nativeCurrency.decimals

Number of decimal places for the currency. Almost always 18 for EVM chains. Type: number Note: 18 decimals is the standard for EVM-compatible chains (1 token = 10^18 wei).

RPC Endpoints

chain.rpc

Array of RPC endpoint URLs for connecting to the network.
Type: string[] Note: Multiple RPC endpoints provide redundancy. If one fails, try the next.

Block Explorers

chain.explorers

Array of block explorer configurations (optional).
Type: Explorer[] | undefined

explorer.name

Human-readable name of the block explorer. Type: string Examples:
  • “Quai Explorer”
  • “Flarescan”
  • “Ronin Explorer”

explorer.url

Base URL of the block explorer. Type: string Use cases:
  • Link to transactions: ${url}/tx/${txHash}
  • Link to addresses: ${url}/address/${address}
  • Link to blocks: ${url}/block/${blockNumber}

explorer.standard

Explorer API standard (optional). Type: string | undefined Common values:
  • "EIP3091" - Standard for generating explorer URLs
  • "none" - Non-standard explorer

Additional Information

chain.infoURL

Official website or information URL (optional).
Type: string | undefined

Custom Properties

Chain objects support additional custom properties via index signature.
Type: [key: string]: any

Usage Examples

Display Chain Info

RPC Connection with Fallback

Currency Formatting

Chain Comparison

Multi-Chain Dashboard