web3-onboard
web3-onboard copied to clipboard
[Bug] Onboard wallet state not updating correctly when switching chains with Coin98 wallet
Current Behavior
When switching to another chain with injected Coin98 wallet, onboard wallet state does not update correctly.
Expected Behavior
Onboard wallet state should reflect new chain and wallet address.
Steps To Reproduce
Using example in the docs
- Visit https://onboard.blocknative.com/examples/connect-wallet
- Connect with Coin98 wallet
- Using the transaction preview widget on the bottom right of the page, change to a new network
- After completing the network change request in the wallet, onboard state still shows previous chain and wallet address
Alternatively, https://github.com/rueyce/web3-onboard-vuejs-example which is just a slight modification to the docs-provided Vuejs example (I am using Vue but believe it is not framework-related)
What package is effected by this issue?
@web3-onboard/core
Is this a build or a runtime issue?
Runtime
Package Version
2.21.0
Node Version
18.17.0
What browsers are you seeing the problem on?
Chrome
Relevant log output
No response
Anything else?
Console showing wallet state changes. Logs 3 to 6 are recorded when I trigger the network change, showing that it does update but quickly reverts to the original state.
Sanity Check
- [X] If this is a build issue, I have included my build config. If this is a runtime issue, I have included reproduction steps and/or a Minimal, Reproducible Example.
hey @rueyce we'll take a look at this!
Hello, I'm also seeing this same issue with MetaMask. Perhaps this is an issue with injected wallets in general?
I am able to trigger an update consistently when switching from Mainnet => Arbitrum or between Arbitrum and Base, but it does not trigger when switching from Arbitrum => Mainnet or Arbitrum => Goerli
My version is: "@web3-onboard/core": "^2.21.2"
Update since the issue was opened by me: We're no longer encountering the issue described in the opening post. What happens now, for reference:
- Doing
onboard.setChain
to a foreign chain when connected with a chain-limited wallet now gives an error, which is expected. - Switching to another different-chain wallet directly in the extension now disconnects it from the dApp. Importantly, it's no longer using nor displaying the wrong wallet and chain as previously described.
Thanks for looking at this and please feel free to close this or as you see fit.
Versions:
"@web3-onboard/core": "^2.21.2",
"@web3-onboard/injected-wallets": "^2.10.9",
Coin98 chrome extension version 9.1.6