fix: double prefix for bch and xec

This commit is contained in:
nate 2026-03-25 22:58:31 +04:00
parent 343248c79f
commit ad798d0bbf
1 changed files with 3 additions and 2 deletions

View File

@ -118,7 +118,7 @@ export const routes = new Elysia()
// Build payment URI for QR code
const coinInfo = COINS[coin];
const uri = `${coinInfo.uri}:${address}?amount=${amountCrypto}`;
const uri = `${coinInfo.uri}:${address.replace(/^.*:/, '')}?amount=${amountCrypto}`;
return {
id: payment.id,
@ -160,7 +160,8 @@ export const routes = new Elysia()
const qrAmount = amountRemaining > 0 && amountRemaining < amountCrypto
? amountRemaining.toFixed(8) : payment.amount_crypto;
const uri = `${coinInfo.uri}:${payment.address}?amount=${qrAmount}`;
const addrPart = payment.address.includes(':') ? payment.address.split(':')[1] : payment.address;
const uri = `${coinInfo.uri}:${addrPart}?amount=${qrAmount}`;
const txs = await sql`
SELECT txid, amount, confirmed, detected_at