wallet_switchEthereumChain
Requests that the wallet switches its active Ethereum chain. Specified by EIP-3326.
Parameters
Chain(object)Object containing the chain ID to switch to.
Returns
This method returns null if the active chain is switched.
Errors
| Code | Description |
|---|---|
4902 | Unrecognized chain ID. Try adding the chain using wallet_addEthereumChain first. |
Example request
await provider.request({
method: "wallet_switchEthereumChain",
params: [
{
"chainId": "0x64"
}
]
});
Example response
{
"id": 1,
"jsonrpc": "2.0",
"result": null
}