web3modal
web3modal copied to clipboard
[bug] Web Wallet Missing Redirect URLs for Sequential Transactions
Link to minimal reproducible example
https://github.com/quocle108/wc-webwallet-redirect-bug/blob/main/README.md
Steps to Reproduce
To Reproduce Steps to reproduce the behavior:
- Connect a web-based wallet to Uniswap (or any dApp requiring multiple sequential transactions)
- Initiate a swap that requires 2 transactions (e.g., token approval + swap)
- First transaction request opens with redirect URL:
{WALLET_URL}/wc?requestId={requestId}&sessionTopic={sessionTopic}✅ - Approve first transaction and follow docs recommendation to close wallet tab
- Second transaction is sent via WebSocket only - no redirect URL provided ❌
- User never sees second transaction request as wallet tab is closed
Expected behavior According to the WalletConnect documentation:
- All session requests should include redirect URLs in the format:
{YOUR_WALLET_URL}/wc?requestId={requestId}&sessionTopic={session.Topic} - The docs specifically recommend: "closing the web wallet tab after the user approves the request and redirecting back to the dApp"
- This pattern should work for ALL transactions, not just the first one
Summary
Web wallets do not receive redirect URLs for subsequent transactions in multi-transaction flows. Only the first transaction includes a redirect URL, while subsequent transactions are sent via WebSocket only. This breaks the recommended flow from the documentation where web wallets should "close the tab after the user approves the request and redirect back to the dApp." from this link
List of related npm package versions
node v20.18.0
Node.js Version
v20.18.0