Skip to content

Commit

Permalink
fix(connectors): lndhub incoming tx order #1625
Browse files Browse the repository at this point in the history
  • Loading branch information
escapedcat committed Oct 17, 2022
1 parent 42ad835 commit 17b897c
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions src/extension/background-script/connectors/lndhub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,20 @@ export default class LndHub implements Connector {
}[]
>("GET", "/getuserinvoices", undefined);

const invoices: ConnectorInvoice[] = data.map(
(invoice, index): ConnectorInvoice => ({
custom_records: invoice.custom_records,
id: `${invoice.payment_request}-${index}`,
memo: invoice.description,
preimage: "", // lndhub doesn't support preimage (yet)
settled: invoice.ispaid,
settleDate: invoice.timestamp * 1000,
totalAmount: `${invoice.amt}`,
type: "received",
})
);
const invoices: ConnectorInvoice[] = data
.map(
(invoice, index): ConnectorInvoice => ({
custom_records: invoice.custom_records,
id: `${invoice.payment_request}-${index}`,
memo: invoice.description,
preimage: "", // lndhub doesn't support preimage (yet)
settled: invoice.ispaid,
settleDate: invoice.timestamp * 1000,
totalAmount: `${invoice.amt}`,
type: "received",
})
)
.reverse();

return {
data: {
Expand Down

0 comments on commit 17b897c

Please sign in to comment.