From c2f9a07389e150c4aadc6ae15e575008a226a1ab Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Fri, 6 Mar 2026 23:10:53 -0800 Subject: [PATCH] feat(encryptid): link claimed funds to rWallet with wallet address After claiming funds, the success button now links to {username}.rspace.online/rwallet?address={walletAddress} instead of rflows.online, so users can visually analyze their wallet flows. The accept endpoint now returns the username for URL construction. Co-Authored-By: Claude Opus 4.6 --- src/encryptid/server.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/encryptid/server.ts b/src/encryptid/server.ts index 318f758..b5f4605 100644 --- a/src/encryptid/server.ts +++ b/src/encryptid/server.ts @@ -2989,11 +2989,15 @@ app.post('/api/claims/:token/accept', async (c) => { const accepted = await acceptFundClaim(token, claims.sub); if (!accepted) return c.json({ error: 'Failed to accept claim' }, 500); + // Get username for redirect URL + const user = await getUserById(claims.sub); + return c.json({ success: true, walletAddress: fundClaim.walletAddress, amount: fundClaim.fiatAmount, currency: fundClaim.fiatCurrency, + username: user?.username || '', }); }); @@ -3185,12 +3189,13 @@ app.get('/claim', (c) => { }); const result = await acceptRes.json(); if (acceptRes.ok && result.success) { + var walletUrl = 'https://' + (result.username || 'demo') + '.rspace.online/rwallet?address=' + encodeURIComponent(result.walletAddress); document.getElementById('claim-info').innerHTML = '
' + '

✅ Funds Claimed!

' + '

Wallet ' + result.walletAddress.slice(0, 6) + '...' + result.walletAddress.slice(-4) + ' has been linked to your EncryptID account.

' + (result.amount ? '

$' + result.amount + ' ' + (result.currency || 'USD') + ' are now accessible.

' : '') + - 'Go to rFlows' + + 'View in rWallet' + '
'; } else { document.getElementById('status').innerHTML = '

' + (result.error || 'Claim failed') + '

';