rainbowkit
rainbowkit copied to clipboard
refactor: walletconnect prefetch
Changes
Optimised our wallets that use WalletConnect connector. It should now be fast and improve the UX.
Screen recordings / screenshots
Prefetching WalletConnect URI
https://github.com/user-attachments/assets/64978445-832a-4ffd-977c-aacc55e94200
(Me spamming cancel button on Safari mobile)
https://github.com/user-attachments/assets/85f1c640-2422-40a2-aecd-6b2da9c80802
What to test
Desktop:
- QR code for wallets should be generated pretty fast because we prefetch WalletConnect URI when connect modal is opened. If let's we don't get the URI before clicking on the wallet then the behaviour should be the same as it's right now. In this case we'll wait until we get the URI before displaying QR code.
- When scanning the QR code using a wallet and then clicking "Cancel" or "Reject" there should be a new QR code displayed.
- Disconnect flow should be much faster and take around 0.5 - 1 second. This is because we appended two WalletConnect connectors in
connectorsForWallets
which resulted into having the same Wagmi reconnect bug that we had with EIP-1193 connectors.
Mobile:
- Make sure on Safari mobile whenever you click a wallet -> "Cancel" (safari popup) -> then click on the same wallet again you should not get the default iOS forbidden popup.
- Whenever you click on any wallet and then reject the connection request you can go back to the browser and still get a new deep link with a new WalletConnect URI. This means you can reject as many times you want, but have the ability to connect without refeshing the page.