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 <noreply@anthropic.com>
This commit is contained in:
parent
8a4fc3051e
commit
c2f9a07389
|
|
@ -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 =
|
||||
'<div class="success-card">' +
|
||||
'<p class="success" style="font-size:18px;font-weight:600">✅ Funds Claimed!</p>' +
|
||||
'<p style="color:#e2e8f0;margin-top:12px">Wallet <code style="background:rgba(255,255,255,0.1);padding:2px 6px;border-radius:4px">' + result.walletAddress.slice(0, 6) + '...' + result.walletAddress.slice(-4) + '</code> has been linked to your EncryptID account.</p>' +
|
||||
(result.amount ? '<p style="color:#94a3b8;margin-top:8px">$' + result.amount + ' ' + (result.currency || 'USD') + ' are now accessible.</p>' : '') +
|
||||
'<a class="btn" href="https://rflows.online" style="margin-top:20px">Go to rFlows</a>' +
|
||||
'<a class="btn" href="' + walletUrl + '" style="margin-top:20px">View in rWallet</a>' +
|
||||
'</div>';
|
||||
} else {
|
||||
document.getElementById('status').innerHTML = '<p class="error">' + (result.error || 'Claim failed') + '</p>';
|
||||
|
|
|
|||
Loading…
Reference in New Issue