-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: show pending and failed transactions for nwc #3292
base: master
Are you sure you want to change the base?
Conversation
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
🚮 Removed packages: npm/@getalby/[email protected], npm/@noble/[email protected], npm/@noble/[email protected], npm/[email protected], npm/[email protected], npm/[email protected] |
src/extension/background-script/connectors/connector.interface.ts
Outdated
Show resolved
Hide resolved
@@ -31,10 +31,12 @@ export interface ConnectorTransaction { | |||
/** | |||
* Settle date in UNIX milliseconds | |||
*/ | |||
settleDate: number; | |||
settleDate: number | null; | |||
creationDate?: number; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which connectors do not have a creation date? can't this be taken from the bolt11 invoice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all other connectors only pass settled transactions and we don't even need creationDate for them except for nwc. so i kept it optional and passed this field only for nwc connector. maybe we can be consistent accross and pass it for all now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for commando there is no creation date passed via api. https://docs.corelightning.org/reference/lightning-listinvoices
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it can be taken from the bolt11 invoice, can't it?
@@ -128,7 +128,7 @@ export default class LaWallet implements Connector { | |||
return { | |||
data: { | |||
transactions: parsedTransactions.sort( | |||
(a, b) => b.settleDate - a.settleDate | |||
(a, b) => (b.settleDate ?? 0) - (a.settleDate ?? 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this connector should be affected like this in this PR? if lawallet only has settled transactions, there is now extra code that does not even apply.
Can't you sort the transactions before mapping them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that was just to make typescript happy we have common type definitions for all the connectors. now settleDate can be either number | null (cause of nwc pending and failed transactions). any better approach here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't you sort the transactions before mapping them?
f245ef1
to
c44add1
Compare
show failed and pending transactions for nwc
Fixes #3291