rainbow-me / rainbowkit

The best way to connect a wallet 🌈 🧰
https://rainbowkit.com
MIT License
2.36k stars 617 forks source link

[bug] Every time we connect with walletconnect, it will connect to a different chain #2019

Open futantan opened 1 month ago

futantan commented 1 month ago

Is there an existing issue for this?

RainbowKit Version

2.1.1

wagmi Version

1.4.11

Current Behavior

Every time we connect with walletconnect, it will connect to a different chain. Even I added initialChain={137} to RainbowKitProvider component

Expected Behavior

Connect to initialChain

Steps To Reproduce

Link to Minimal Reproducible Example (CodeSandbox, StackBlitz, etc.)

No response

Anything else?

No response

magiziz commented 1 month ago

@futantan Which wallet are you using ? I tried with Rainbow wallet and works fine. You can even test it in our example dApp here https://rainbowkit-example.vercel.app

magiziz commented 1 month ago

Also if you can provide a small reproducible example that'd be super helpful

futantan commented 1 month ago

https://github.com/rainbow-me/rainbowkit/assets/6268441/0cbf4068-da56-408a-afc6-94468a570bb8

hi @magiziz thanks for your quick response, I added a video recording, I'm using OKX web3 wallet

magiziz commented 1 month ago

@futantan This seems to be a OKX wallet specific issue. For most wallets it should work fine.

futantan commented 1 month ago

hi @magiziz actually this only happen for RainbowKit 2.x, for 1.x version, it works fine. we find this after upgrading to 2.x

magiziz commented 1 month ago

@futantan I see. Seems to be either a WalletConnect issue with wagmi v2 or the way how OKX wallet handles the WalletConnect connection. Going to pass this to the wagmi team and come back to you as soon as possible 👍