Skip to content
On this page

addChain

Adds an EVM chain to the wallet.

Usage

ts
import { avalanche } from 'viem/chains'
import { walletClient } from './client'
 
await walletClient.addChain(avalanche) 
ts
import { createWalletClient, custom } from 'viem'

export const walletClient = createWalletClient({
  transport: custom(window.ethereum)
})

Parameters

chain

The chain to add to the wallet.

JSON-RPC Methods

eth_addEthereumChain

Released under the MIT License.