Documentation
/Constants
Constants
wagmi exposes some helpful constants to standardize frequently used values and objects.
Networks/Chains
Chain
Object containing chains by name. Useful for creating lists of specific chains, like defaultL2Chains
.
import { chain } from 'wagmi'
chain.mainnet
chain.rinkeby
chain.polygonMainnet
// ...
Chains conform to the following type:
export type Chain = {
id: number
name: string
nativeCurrency?: {
decimals: 18
name: string
symbol: string
}
rpcUrls: string[]
blockExplorers?: { name: string; url: string }[]
testnet?: boolean
}
Default Groups
wagmi has a few built-in chain groups for convenience:
import {
defaultChains, // mainnet, rinkeby, etc.
defaultL2Chains, // arbitrum, polygon, etc.
developmentChains, // localhost
} from 'wagmi'
ABIs
ERC-20
import { erc20ABI } from 'wagmi'
ERC-721
import { erc721ABI } from 'wagmi'
ERC-1155
import { erc1155ABI } from 'wagmi'