bug: lndhub payment state

refactor: use webln package
This commit is contained in:
2023-05-18 11:17:32 +01:00
parent 7ab8eff33a
commit c52eb38833
11 changed files with 117 additions and 120 deletions

View File

@ -43,6 +43,10 @@ export default class LNDHubWallet implements LNWallet {
return this.auth !== undefined;
}
canAutoLogin(): boolean {
return true;
}
close(): Promise<boolean> {
return Promise.resolve(true);
}
@ -91,7 +95,12 @@ export default class LNDHubWallet implements LNWallet {
return {
pr: pr,
paymentHash: pRsp.payment_hash,
state: pRsp.payment_error === undefined ? WalletInvoiceState.Paid : WalletInvoiceState.Pending,
preimage: pRsp.payment_preimage,
state: pRsp.payment_error
? WalletInvoiceState.Failed
: pRsp.payment_preimage
? WalletInvoiceState.Paid
: WalletInvoiceState.Pending,
} as WalletInvoice;
}