bug: lndhub path

This commit is contained in:
2023-03-02 21:56:25 +00:00
parent 9c52be315e
commit 9f763c09f8
4 changed files with 27 additions and 15 deletions

View File

@ -131,14 +131,18 @@ export class LNCWallet implements LNWallet {
reversed: true,
});
console.debug(invoices);
return invoices.payments.map(a => {
const parsedInvoice = prToWalletInvoice(a.paymentRequest);
if (!parsedInvoice) {
throw new WalletError(WalletErrorCode.InvalidInvoice, `Could not parse ${a.paymentRequest}`);
}
return {
...parsedInvoice,
state: (() => {
switch (a.status) {
case Payment_PaymentStatus.SUCCEEDED:
return;
return WalletInvoiceState.Paid;
case Payment_PaymentStatus.FAILED:
return WalletInvoiceState.Failed;
default: