You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Metamask Mobile throws an exception on wallet_switchEthereumChain for Optimism and suggests adding the chain. However NetworksChainId in NetworkControllers.ts inconsistently includes Optimism, which causes MetaMask Mobile to fail onwallet_addEthereumChain. So it appears that there is currently no way to use Optimism from MetaMask mobile.
EDIT: Note that MetaMask extension does not reference NetworkControllers in this way and does not suffer from this problem. (It is possible to add and switch to Optimism on desktop).
The text was updated successfully, but these errors were encountered:
I looked in our company Slack and it looks like this is a known issue (as of a month ago). I was looking at NetworkController recently and noticed that optimism and optimismTest aren't valid subdomains on Infura. According to https://docs.infura.io/infura/networks/optimism/getting-started/send-request, it should be optimism-mainnet and optimism-kovan. It's possible this is why it's failing.
I am not able to reproduce this. It is true that when using wallet_switchEthereumChain to switch to Optimism, the request will fail if the network is not present. However, it is possible to add the chain via wallet_addEthereumChain. It is also possible to add "OP Mainnet" from the network switcher in Mobile.
Since this issue was filed, NetworkController has been updated to use eth-json-rpc-infura to get a list of valid subdomains for the Infura RPC URL. So we aren't using optimism and optimismTest anymore. And since this commit this package has always allowed the correct subdomains for Optimism.
Metamask Mobile throws an exception on
wallet_switchEthereumChain
for Optimism and suggests adding the chain. However NetworksChainId in NetworkControllers.ts inconsistently includes Optimism, which causes MetaMask Mobile to fail onwallet_addEthereumChain
. So it appears that there is currently no way to use Optimism from MetaMask mobile.https://github.com/MetaMask/controllers/blob/365191875a22ab5c94d81b464734e8adff7dbad3/src/network/NetworkController.ts#L23-L33
EDIT: Note that MetaMask extension does not reference NetworkControllers in this way and does not suffer from this problem. (It is possible to add and switch to Optimism on desktop).
The text was updated successfully, but these errors were encountered: