web3modal icon indicating copy to clipboard operation
web3modal copied to clipboard

[bug] Web Wallet Missing Redirect URLs for Sequential Transactions

Open quocle108 opened this issue 4 months ago • 1 comments

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:

  1. Connect a web-based wallet to Uniswap (or any dApp requiring multiple sequential transactions)
  2. Initiate a swap that requires 2 transactions (e.g., token approval + swap)
  3. First transaction request opens with redirect URL: {WALLET_URL}/wc?requestId={requestId}&sessionTopic={sessionTopic}
  4. Approve first transaction and follow docs recommendation to close wallet tab
  5. Second transaction is sent via WebSocket only - no redirect URL provided ❌
  6. 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

Package Manager

[email protected]

quocle108 avatar Oct 04 '25 00:10 quocle108

APKT-4001

linear[bot] avatar Oct 04 '25 00:10 linear[bot]