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 c96df3af1e
commit 8c5f78c50f

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