-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
How to reproduce:
- Connect metamask with QR (or wallet connect QR but with metamask mobile app)
- Put other chain data to
chainparameter inWalletConnectModal. If thechainis undefined, then don't put "locked chains" (the locked chains list below) in the first element ofchains - Switch your metamask wallet connected chain to any chain other than the "locked chains"
- Call
wallet.switchChain(...)to "locked chains". - It will cause error
May not specify default Metamask chain.

Locked Chains List
Issue Detail
In thirdweb if the chain is not included in approved list, then the flow is:
- Call
wallet_addEthereumChain - Call
wallet_switchEthereumChain
In this case, metamask will throw error if you try to call wallet_addEthereumChain with arg of either one of the locked chains.
Another Related Issue
thirdweb uses @walletconnect/ethereum-provider under the hood to create the provider that also saves the approved chains list.
This library will only include the below ids as approved:
- provided chainId from
chainprops - the current connected chain that user have in their metamask
This makes an issue where if the app is multichain, for example Sepolia and Ozean, and the app wants the user to connect to Ozean first, then we need to put Ozean as the chain props.
Which in turn will create an error when the user wants to switch to Sepolia.
Metadata
Metadata
Assignees
Labels
No labels