metamask-docs icon indicating copy to clipboard operation
metamask-docs copied to clipboard

wallet_addEthereumChain does not overwrite the network config if chainId already exists

Open kentimsit opened this issue 3 years ago • 2 comments

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 ?

kentimsit avatar Mar 08 '22 19:03 kentimsit

@Gudahtt @shanejonas Any ideas on this? 🙂

BboyAkers avatar Apr 05 '22 04:04 BboyAkers

Looking into this with @shanejonas and @BelfordZ when we get some time.

httpJunkie avatar Oct 16 '22 05:10 httpJunkie