Search code examples
web3jswallet-connectwagmi

How to switch active chain in wagmi for WalletConnect wallet


Working on web3 app (js) that supports multiple chains, and before minting on specific chain it uses wagmi useSwitchNetwork hook to request wallet to switch the chain. It works fine with browser extension wallets, but not in WalletConnect mobile wallets.

In Rainbow Mobile it fails with Missing or invalid. request() method: wallet_switchEthereumChain ticket, it does not even have a concept of the active chain anywhere on UI. Any ideas on how to get it resolved it or where to ask?

Update: it looks like it's a problem with testnets only, so Rainbow Mobile cannot switch to testnets


Solution

  • the problem is caused by Rainbow mobile wallet not supporting any testnets (at the moment). It's actually able to switch to other mainets, but not to the testnet (Base Sepolia) I was using for testing