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.
This commit is contained in:
padreug 2025-09-13 17:57:39 +02:00
parent 719f16b743
commit 8cd38f6305

View file

@ -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
}
}