WalletConnect: add redirect metadata (return to dApp after wallet approvals)

Sets metadata.redirect so mobile wallets bounce the user back to /my after each
approval instead of stranding them in the wallet app.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-09-08 08:56:10 -05:00
parent dcfc5ca86e
commit 90e33a42b5
3 changed files with 5 additions and 3 deletions
+3 -1
View File
@@ -83,7 +83,9 @@ window.IAPWallet = (function () {
projectId, optionalChains: [chainId], showQrModal: true,
rpcMap: { [chainId]: c.rpc },
metadata: { name: c.siteName || 'InstantAdPay', description: c.tagline || 'Advertise and earn, paid on-chain.',
url: location.origin, icons: [location.origin + '/logo-icon.png'] }
url: location.origin, icons: [location.origin + '/logo-icon.png'],
// ask the wallet to bounce back to the dashboard after each approval
redirect: { native: '', universal: location.origin + '/my' } }
});
}
if (!wcProvider.session) await wcProvider.connect(); // QR on desktop, opens the wallet app on mobile