From c58e4e330ca0c3cab6ff32845ea15302ba7aca4d Mon Sep 17 00:00:00 2001 From: padreug Date: Fri, 12 Sep 2025 23:26:14 +0200 Subject: [PATCH] fix: update LNBits payment request handling - Changed the response handling in the newAddress function to return the bolt11 invoice instead of the payment request. - Updated error message to reflect the change in response structure from LNBits. --- packages/server/lib/plugins/wallet/lnbits/lnbits.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/server/lib/plugins/wallet/lnbits/lnbits.js b/packages/server/lib/plugins/wallet/lnbits/lnbits.js index 44a0099f..93cdb4be 100644 --- a/packages/server/lib/plugins/wallet/lnbits/lnbits.js +++ b/packages/server/lib/plugins/wallet/lnbits/lnbits.js @@ -93,11 +93,11 @@ async function newAddress(account, info, tx) { const endpoint = `${account.endpoint}/api/v1/payments` const result = await request(endpoint, 'POST', invoiceData, account.adminKey) - if (!result.payment_request) { - throw new Error('LNBits did not return a payment request') + if (!result.bolt11) { + throw new Error('LNBits did not return a bolt11 invoice') } - return result.payment_request + return result.bolt11 } async function getStatus(account, tx) {