-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Metamask still does not have a consistent way of switching networks. #10597
Comments
@jordanlesich you might be interested in ethereum/EIPs#3326. While it did take us a long time to go from EIP -> implementation for |
I appreciate the information and fast reply. I'll stay subscribed to both threads. Thanks! |
This feature is definitely more and more necessary in a cross-chain/L2 world! Connext is eagerly waiting for this to improve user experience. |
Cargo is also looking forward to this feature. We will be adding support for multiple chains and while we can easily change the chain to something like xDai using |
Yeah, this is an issue for us too. We have a network switch component but currently cannot switch to the native network. |
Same issue here :( |
same issue! Switching to Matic is smooth and easy. But trying to switch back to ETH mainnet doesnt work at all. I've even tried this on sushiswap and it seems they can switch the wallet to any network but cannot switch it back to ETH. hopefully this is resolved soon! |
My current workaround - which I'm sure everyone here uses - is to catch the error at the moment and ask the user to manually switch on default MM chains. For other networks it is no problem to both add and switch them. |
Following up on this as well as it's an issue for Nerve similar to other people above. The sooner switching to ETH (and default chains) is implemented, the better the experience it'd provide to end users. |
Any updates on this? |
We'd love to be able to switch to default networks with custom URL. We're working on a tool called Automate which provides extra features via custom RPC and not being able to switch to mainnet programatically really hurts the user experience. |
hey when wallet_switchEthereumChain is available? |
we also need |
This has landed in 9.6.0 🎉 |
Is there any documentation or examples to utilize the new functionality to switch to default chains? TIA |
@snwokenk thank you! PD: the hyperlink is pointing to metamask's issues, I almost thought I got rick-rolled 😂 |
lol fixed |
@snwokenk This link still points to old documentation where it says it does not allow switching to default chain |
Futhermore, bringing this back, Is there any documentation or examples to utilize the new functionality to switch to default chains? |
Ohh, It so easy.
|
FYI, The pattern above of calling switch chain, catching a possible exception and then attempting to add the chain if needed works on desktop and works for most chains on mobile but for some chains I get the "-32602 May not specify default MetaMask chain" exception. Specifically this is happening for us when trying to add Optimism on iOS Mobile. |
I have the same issue. Have you found any way around it? |
+1 . I am also having this same issue. |
Since this issue is closed you may want to follow this issue for the problem: MetaMask/core#740 |
"wallet_addEthereumChain" was touted as a way to send requests to the wallet to switch networks.
#5101
While this does work for non-default chains, MM deliberately throws errors for default chains. This makes it difficult to build a consistent UX around this feature for multi platform apps.
If there was a way to request a network switch, I could detect whether the network to be switched is default or not and send a corresponding request. But that isn't possible under the current build.
Most experienced users will already know to switch themselves, but this is not the case for new users who might need guidance. Having this arbitrary mismatch of functionality makes having a comprehensive, consistent mechanism for switching networks impossible.
The text was updated successfully, but these errors were encountered: