-
Notifications
You must be signed in to change notification settings - Fork 239
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
Now the default behaviour for switching the chain is actually to try to add it, if it already exists, we're getting a prompt to switch to it. #1250
Conversation
…to add it, if it already exists, we're getting a prompt to switch to it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm trying in iOS and is not working, it tries to switch the network and add it, but I get a error:
[Web3] Failed to add and switch to the network: {"code":-32603,"message":"Request for method 'eth_chainId on https://goerli.optimism.io failed","data":{"networkErr":{}}}
ChainSafe.Gaming.Evm.Unity.<ActionWrapper>d__13:MoveNext()
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
ChainSafe.Gaming.Evm.Unity.Dispatcher:Update()
It switched to Metamask to add the network (I guess?) but nothing happen there, when I switched back to the Unity app, I got the error.
Steps
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad, Optimism Goerli is deprecated so is expected to fail.
I retried with Avalanche Fuji and is working! It added the network to my Metamask account and then switched to that network.
I also tried #1201 and is working, so we can close that issue after this gets merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice improvement for Reown! Left a couple of questions and suggestions.
src/ChainSafe.Gaming.Unity.EthereumWindow/Dto/NativeCurrency.cs
Outdated
Show resolved
Hide resolved
Packages/io.chainsafe.web3-unity/Editor/OpenPersistenDataPath.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍👍👍
This solves a HUGE UX issue we have with our current SDK. With this PR users are getting the nice prompt to add and or/ switch to the chain that's installed on their wallets.
@juans-chainsafe to test: change the network in project settings to OP Sepolia testnet or any other you prefer.
Make sure you don't have that network in your wallet.
Closes #1231