From 78840f115f52f41c51da60d8c07f17959816a6f6 Mon Sep 17 00:00:00 2001 From: padreug Date: Sat, 13 Sep 2025 17:57:39 +0200 Subject: [PATCH] fix: correct LNBits newFunding return format for funding page Updates the newFunding function to return the expected interface: - fundingPendingBalance: BN(0) for Lightning Network - fundingConfirmedBalance: actual wallet balance as BN object - fundingAddress: bolt11 invoice for funding This fixes the TypeError "Cannot read properties of undefined (reading 'minus')" that occurred when accessing the funding page in the admin UI. --- packages/server/lib/plugins/wallet/lnbits/lnbits.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/server/lib/plugins/wallet/lnbits/lnbits.js b/packages/server/lib/plugins/wallet/lnbits/lnbits.js index 93cdb4be..e0fa1b10 100644 --- a/packages/server/lib/plugins/wallet/lnbits/lnbits.js +++ b/packages/server/lib/plugins/wallet/lnbits/lnbits.js @@ -221,10 +221,9 @@ async function newFunding(account, cryptoCode) { const [walletBalance, fundingAddress] = await Promise.all(promises) return { - fundingAddress, - fundingAddressQr: fundingAddress, - confirmed: walletBalance.gte(0), - confirmedBalance: walletBalance.toString() + fundingPendingBalance: new BN(0), + fundingConfirmedBalance: walletBalance, + fundingAddress } }