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
wallet_switchEthereumChain doesn't switch to a chain added manually through wallet UI, but switches successfully when the chain is added programmatically with wallet_addEthereumChain
If I first add the Optimism Local chain manually through UI and then try to execute this code, switch chain fails, even though the chain is there.
If I don't add the chain manually, then the first time the code is executed it fails as expected, since the chain is not present, and then offers to add the chain. Once programmatically added, the second time the code executes, the switching succeeds.
Also as you can see from the code, the error code for when trying to switch to an unknown chain is reported as -32603 for some reason, when it should be 4902.
Expected behavior
Switching succeeds.
Version
No response
Additional info
No response
Desktop
Chrome
Extension version: 3.25.3_0
Smartphone
No response
The text was updated successfully, but these errors were encountered:
Describe the bug
wallet_switchEthereumChain doesn't switch to a chain added manually through wallet UI, but switches successfully when the chain is added programmatically with wallet_addEthereumChain
Steps
If I first add the Optimism Local chain manually through UI and then try to execute this code, switch chain fails, even though the chain is there.
If I don't add the chain manually, then the first time the code is executed it fails as expected, since the chain is not present, and then offers to add the chain. Once programmatically added, the second time the code executes, the switching succeeds.
Also as you can see from the code, the error code for when trying to switch to an unknown chain is reported as -32603 for some reason, when it should be 4902.
Expected behavior
Switching succeeds.
Version
No response
Additional info
No response
Desktop
Smartphone
No response
The text was updated successfully, but these errors were encountered: