{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "wallet_addEthereumChain",
  "params": [{
    "chainId": "0x2105",
    "chainName": "Base Mainnet",
    "nativeCurrency": {
      "name": "Ether",
      "symbol": "ETH",
      "decimals": 18
    },
    "rpcUrls": ["https://mainnet.base.org"],
    "blockExplorerUrls": ["https://basescan.org"]
  }]
}
{
  "id": 1,
  "jsonrpc": "2.0",
  "result": null
}

Defined in EIP-3085

Requests that the wallet tracks the given chain and adds it to the wallet’s UI. This method is used to suggest new networks to the user.

Parameters

chainData
object
required

The chain data object containing network information.

Returns

result
null

Returns null if successful.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "wallet_addEthereumChain",
  "params": [{
    "chainId": "0x2105",
    "chainName": "Base Mainnet",
    "nativeCurrency": {
      "name": "Ether",
      "symbol": "ETH",
      "decimals": 18
    },
    "rpcUrls": ["https://mainnet.base.org"],
    "blockExplorerUrls": ["https://basescan.org"]
  }]
}
{
  "id": 1,
  "jsonrpc": "2.0",
  "result": null
}

Error Handling

CodeMessageDescription
4001User rejected the requestUser denied adding the chain
4100Requested method not supportedThe method is not supported by the wallet
4902Unrecognized chain IDThe chain ID is not recognized

Make sure to provide accurate RPC URLs and block explorer URLs. Incorrect URLs may cause connectivity issues.