fix: use amount_msat for amountless invoice payments to LNBits
LNBits API expects `amount_msat` (millisatoshis) not `amount` (satoshis) for amountless invoices, causing a 520 error on cash-in flows. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
84e6e81f04
commit
c28b6ddea9
1 changed files with 1 additions and 1 deletions
|
|
@ -178,7 +178,7 @@ async function sendCoins(account, tx) {
|
||||||
const invoiceAmount = decoded.satoshis
|
const invoiceAmount = decoded.satoshis
|
||||||
|
|
||||||
if (!invoiceAmount || invoiceAmount === 0) {
|
if (!invoiceAmount || invoiceAmount === 0) {
|
||||||
paymentData.amount = parseInt(cryptoAtoms.toString())
|
paymentData.amount_msat = parseInt(cryptoAtoms.toString()) * 1000
|
||||||
}
|
}
|
||||||
|
|
||||||
const endpoint = `${account.endpoint}/api/v1/payments`
|
const endpoint = `${account.endpoint}/api/v1/payments`
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue