From 1f8945c041c6025cd5be64f258f92c1f7e4cf63f Mon Sep 17 00:00:00 2001 From: pavanjoshi914 Date: Wed, 17 Jan 2024 14:44:35 +0530 Subject: [PATCH] fix: getInvoices amount --- .../background-script/connectors/commando.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/extension/background-script/connectors/commando.ts b/src/extension/background-script/connectors/commando.ts index c04488f17f..ec5a7e3090 100644 --- a/src/extension/background-script/connectors/commando.ts +++ b/src/extension/background-script/connectors/commando.ts @@ -81,13 +81,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 = { @@ -236,7 +242,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);