EIPs

EIP-3085 — wallet_addEthereumChain

eips.ethereum.org/EIPS/eip-3085

Asks the wallet to add a chain definition (chain ID, RPC URL, native currency, explorer) to its known-chain list. The user sees the proposal in a popup; on approval the chain becomes selectable.

import { wallet_add_ethereum_chain } from "@ethernauta/eip/3085";

await wallet_add_ethereum_chain({
  chain_id: "0x2105",
  chain_name: "Base",
  native_currency: { name: "Ether", symbol: "ETH", decimals: 18 },
  rpc_urls: ["https://mainnet.base.org"],
  block_explorer_urls: ["https://basescan.org"],
})(signer({ chain_id: eip155_1.chain_id }));

Surface

ExportTypePurpose
wallet_add_ethereum_chainSignable<null>Submit the chain proposal.
AddEthereumChainParameter, AddEthereumChainParameterstypesSingle + array shapes.
schemas for both above

Why a dapp would call this

L2s, sidechains, and testnets that aren’t in the wallet’s built-in registry need to be added before they can be switched to with wallet_switchEthereumChain. The typical pattern: try wallet_switchEthereumChain first; on a 4902 unrecognized_chain error, fall through to wallet_addEthereumChain then retry the switch.

See also