MetaMask / MetaMask/metamask-docs

wallet_addEthereumChain does not overwrite the network config if chainId already exists

Open
#421 4 comments 1 reaction 1 assignee Assigned to @vandan View on GitHub
team-wallet-api-platform wallet
Dominant language
MDX
Stars
861
Forks
2.1k
Avg merge
6d 10h
Merged PRs (30d)
10

Description

Encountering a situation where a Dapp may use wallet_addEthereumChain to switch the user's MetaMask network settings to a better performing RPC endpoint (this is for an alternative L1, i.e. not a default MetaMask chain).

Noticed that if the chainId already exists in the user's network settings in the user's MetaMask browser extension, the wallet_addEthereumChain method does not do anything, specifically it does not overwrite the existing RPC endpoint settings.

Is this on purpose, or something that could be fixed so that the method overwrite the RPC endpoint settings ?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.