Overview
The Chain types define structures for representing blockchain networks, their metadata, and provide utility functions for working with chain identifiers.Chain
Represents a blockchain network with its metadata and testnet status.Properties
ChainMetadata
required
Metadata about the blockchain. See ChainMetadata below.
boolean
required
Indicates whether this is a testnet or mainnet chain
true: Testnet (e.g., Sepolia, Mumbai)false: Mainnet (e.g., Ethereum, Polygon)
Example
ChainMetadata
Detailed metadata about a blockchain using CAIP-2 format.Properties
string
required
Human-readable chain name or identifierExamples:
"mainnet", "polygon", "optimism", "arbitrum"string
required
Blockchain ecosystem namespace following CAIP-2 standardCommon values:
"eip155"- Ethereum and EVM-compatible chains"solana"- Solana blockchain"cosmos"- Cosmos-based chains
string
required
Chain-specific identifier within the namespaceFor EIP-155 chains, this is the chain ID:
"1"- Ethereum Mainnet"137"- Polygon"8453"- Base"42161"- Arbitrum
Example
ChainConfig
Configuration for displaying chain information in user interfaces.Properties
string
required
Human-friendly display name for the chainExamples:
"Ethereum Mainnet", "Polygon", "Base", "Optimism"string
required
URL to the chain’s logo image (SVG or PNG)
Example
CHAIN_CONFIG
Pre-configured chain information for all supported networks.Supported Chains
- Ethereum & L2s
- Other EVM Chains
- Non-EVM Chains
Utility Functions
Helper functions for working with chain identifiers.getChainName
Retrieve the display name for a chain by its ID.string | number
required
The chain ID (numeric or string)
"Chain {id}" if not found
Example:
getChainLogoUrl
Retrieve the logo URL for a chain by its ID.string | number
required
The chain ID (numeric or string)
getChainConfig
Retrieve the complete configuration for a chain by its ID.string | number
required
The chain ID (numeric or string)
null if not found
Example:
extractChainIdFromCAIP
Extract the chain ID from a CAIP chain identifier.string
required
CAIP-2 format chain identifier (e.g.,
"eip155:1", "eip155:137")extractChainIdFromAssetType
Extract the chain ID from a CAIP-19 asset type identifier.string
required
CAIP-19 format asset identifier (e.g.,
"eip155:1/erc20:0x...", "eip155:137/slip44:60")