Try it Live
Run Chain examples in the interactive playground
Chain
Ethereum chain configuration objects with network metadata, RPC endpoints, and explorer information.Overview
Branded type representing Ethereum chain configurations. Provides chain constants, metadata, and lookup utilities for Ethereum networks. Zero-overhead design supports both tree-shakeable namespace methods and class instances.Quick Start
Types
- class Chain
- type Chain
Chain Constants
Chain objects imported from @tevm/chains:- 800+ chain configurations from @tevm/chains
- Includes testnets, mainnets, L2s, and sidechains
- Each constant includes full metadata (RPC, explorer, currency)
API Methods
Core Operations
- fundamentals - Learn chain IDs, replay attack prevention, and network identification
- constructors - Create Chain instances from chain objects and chain IDs
- chain-lookup - Look up chains by ID using fromId() and byId record
- metadata - Access chain properties: name, chainId, RPC, explorers, currency
Advanced Features
- branded-chain - Tree-shakeable functional API for minimal bundle size
- network-comparison - Compare gas fees, costs, and characteristics across networks
Related Types
- Chain (Effect) - Effect.ts integration with Schema validation

