Skip to content

Commit

Permalink
Merge pull request getAlby#2995 from getAlby/fix/cln
Browse files Browse the repository at this point in the history
fix: getInvoices method for cln (NaN amount)
  • Loading branch information
bumi authored Jan 18, 2024
2 parents 0c166bd + 1f8945c commit 0bb5eae
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/extension/background-script/connectors/commando.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,19 @@ type CommandoListInvoiceResponse = {

type CommandoInvoice = {
label: string;
payment_hash: string;
status: string;
description: string;
amount_msat: number;
bolt11: string;
expires_at: number;
description?: string;
amount_msat?: number;
bolt11?: string;
bolt12?: string;
local_offer_id?: number;
invreq_payer_note?: string;
pay_index: number;
amount_received_msat: number;
payment_preimage: string;
paid_at: number;
payment_hash: string;
};

type CommandoPayment = {
Expand Down Expand Up @@ -241,7 +247,7 @@ export default class Commando implements Connector {
payment_hash: invoice.payment_hash,
settleDate: invoice.paid_at * 1000,
type: "received",
totalAmount: Math.floor(invoice.amount_msat / 1000),
totalAmount: Math.floor(invoice.amount_received_msat / 1000),
})
)
.filter((invoice) => invoice.settled);
Expand Down

0 comments on commit 0bb5eae

Please sign in to comment.