Chains
wagmi exports the Mainnet (mainnet) & Sepolia (sepolia) chains out-of-the-box.
import { mainnet, sepolia } from 'wagmi'If you wish to extend to other EVM-compatible chains (like Polygon, Optimism, BSC, Avalanche, etc), you can either import the chain directly from the wagmi/chains entrypoint, or build it yourself.
wagmi/chains
The wagmi/chains entrypoint proxies the viem/chains entrypoint, which contains references to popular EVM-compatible chains such as: Polygon, Optimism, Avalanche, and more.
Usage
Import your chains from the entrypoint and use them in your wagmi app:
import { configureChains } from 'wagmi'
import { avalanche, bsc, mainnet } from 'wagmi/chains'
const { chains, publicClient } = configureChains(
[mainnet, avalanche, bsc],
...
)Read more on configuring chains
Supported chains
mainnetgoerliarbitrumarbitrumGoerliarbitrumNovaauroraauroraTestnetavalancheavalancheFujibasebaseGoerlibobabronosbronosTestnetbscbscTestnetbxnbxnTestnetcantoceloceloAlfajoresclassicchronoschronosTestnetcrossbelldfkdogechainedgewareedgewareTestneteoseosTestnetektaektaTestnetevmosevmosTestnetfantomfantomTestnetfibofilecoinfilecoinCalibrationfilecoinHyperspaceflareflareTestnetfusefuseSparknetgobignosisgnosisChiadohaqqMainnethaqqTestedge2harmonyOneiotexiotexTestnetklaytnlinealineaTestnetmantlemantleTestnetmetismetisGoerlimevmevTestnetmodeTestnetmoonbaseAlphamoonbeammoonriverneonDevnetneonMainnetnexilixnexioasysokcoptimismoptimismGoerlipolygonpolygonMumbaipolygonZkEvmpolygonZkEvmTestnetpulsechainpulsechainV4qMainnetqTestnetrolluxrolluxTestnetroninsaigonscrollSepoliascrollTestnetsepoliashardeumSphinxskaleCalypsoskaleCalypsoTestnetskaleChaosTestnetskaleCryptoBladesskaleCryptoColosseumskaleEuropaskaleEuropaTestnetskaleExordeskaleHumanProtocolskaleNebulaskaleNebulaTestnetskaleRazorskaleTitanskaleTitanTestnetsyscoinsyscoinTestnetsongbirdsongbirdTestnettaikoTestnetSepoliataraxataraxaTestnettelostelosTestnetthunderTestnettitantitanTestnetwanchainwanchainTestnetxdcxdcTestnetzetachainAthensTestnetzkSynczkSyncTestnetzorazoraTestnetfoundryhardhatlocalhost
Want to add a chain that's not listed here? Head to the Viem repo and read the Contributing Guide before opening a pull request.
Build your own
You can also extend wagmi to support other EVM-compatible chains by building your own chain object that inherits the Chain type.
import { Chain } from 'wagmi'
export const avalanche = {
id: 43_114,
name: 'Avalanche',
network: 'avalanche',
nativeCurrency: {
decimals: 18,
name: 'Avalanche',
symbol: 'AVAX',
},
rpcUrls: {
public: { http: ['https://api.avax.network/ext/bc/C/rpc'] },
default: { http: ['https://api.avax.network/ext/bc/C/rpc'] },
},
blockExplorers: {
etherscan: { name: 'SnowTrace', url: 'https://snowtrace.io' },
default: { name: 'SnowTrace', url: 'https://snowtrace.io' },
},
contracts: {
multicall3: {
address: '0xca11bde05977b3631167028862be2a173976ca11',
blockCreated: 11_907_934,
},
},
} as const satisfies Chain