Skip to content

wallet_addEthereumChain

Defined in EIP-3085

Requests that the wallet adds the specified chain to the wallet.

Parameters

Array<AddEthereumChainParameter>

An array containing a single object with the following fields:

FieldTypeDescription
chainIdstringThe chain ID as a 0x-prefixed hexadecimal string
chainNamestringThe name of the chain to display to the user
nativeCurrencyNativeCurrencyInformation about the chain's native currency
rpcUrlsArray<string>Array of RPC endpoint URLs for the chain
blockExplorerUrlsArray<string>(Optional) Array of block explorer URLs
iconUrlsArray<string>(Optional) Array of icon URLs for the chain's icon

The NativeCurrency object should contain:

FieldTypeDescription
namestringThe name of the native currency
symbolstringThe symbol of the native currency (2-6 characters)
decimalsnumberThe number of decimals of the native currency (e.g., 18)

Returns

null

Returns null if the request was successful.

Errors

CodeMessage
4001User rejected the request
4100Requested method not supported
4200Wallet not connected
4300Invalid parameters
4901Chain already added
4902Chain couldn't be added