• React
  • Constants
  • Chains & Networks

Chains & Networks

Chain and network information for use with hooks, connectors, and anywhere else you need in your app.

chain

Object containing chains by name. Useful for creating lists of specific chains, like defaultL2Chains.

import { chain } from 'wagmi'
 
const defaultL2Chains = [chain.optimism, chain.arbitrumOne]

You can also import individual chains from the tree shakeable wagmi/chains entrypoint:

import { mainnet, optimism } from 'wagmi/chains'

Default Groups

wagmi has built-in chain groups for convenience:

import {
  allChains,
  defaultChains, // mainnet, goerli
  defaultL2Chains, // arbitrum, optimism
} from 'wagmi'