fix: double prefix for bch and xec
This commit is contained in:
parent
343248c79f
commit
ad798d0bbf
|
|
@ -118,7 +118,7 @@ export const routes = new Elysia()
|
||||||
|
|
||||||
// Build payment URI for QR code
|
// Build payment URI for QR code
|
||||||
const coinInfo = COINS[coin];
|
const coinInfo = COINS[coin];
|
||||||
const uri = `${coinInfo.uri}:${address}?amount=${amountCrypto}`;
|
const uri = `${coinInfo.uri}:${address.replace(/^.*:/, '')}?amount=${amountCrypto}`;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
id: payment.id,
|
id: payment.id,
|
||||||
|
|
@ -160,7 +160,8 @@ export const routes = new Elysia()
|
||||||
|
|
||||||
const qrAmount = amountRemaining > 0 && amountRemaining < amountCrypto
|
const qrAmount = amountRemaining > 0 && amountRemaining < amountCrypto
|
||||||
? amountRemaining.toFixed(8) : payment.amount_crypto;
|
? 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`
|
const txs = await sql`
|
||||||
SELECT txid, amount, confirmed, detected_at
|
SELECT txid, amount, confirmed, detected_at
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue