coinbase-wallet-sdk
coinbase-wallet-sdk copied to clipboard
Bug: chainId is incorrect
Describe the bug
chainId shows 0x4, when it should be 43113
Steps
- Change network in Coinbase Wallet
- Check
window.ethereum.providers
, find CoinbaseProvider (has propertyisWalletLink: true
), check propertychainId
. - You can also run
provider.request({ method: 'eth_chainId' });
, but the result will be the same.
Expected behavior
On change network in Coinbase property chainId is also changed to the current one.
Version
3.4.0
Additional info
My dApp supports only BSC and ETH, and to make my dApp working properly I need to check chainId in wallet before start, and if it's not supported - change it.
Desktop
- MacOS 12.1
- Chrome Version 103.0.5060.134 (Official Build) (arm64)
Smartphone
No response
The same reproducing steps will lead to one more interesting behavior: chainChanged handler will not be called.
bug
I'm facing the same issue. Regardless which network I choose, I always get back chainId = 1. Coinbase Wallet desktop extension version 2.31.4.
Hi,
The Default Network tab in Coinbase Wallet corresponds to the default network the wallet will connect to when initially establishing a connection with a dapp.
Establishing a connection and then switching your default network will not update the chainId.
Instead, to switch your network and update the chainId, make a wallet_switchEthereumChain
request.
Alternatively, remove the currently established dapp connection within settings, and reconnect with your updated Default Network.
Same issue here. My app is not working as expected
Same incorrect behavior observed on our end, the chainId
doesn't reflect the selected network on the wallet.