Skip to content
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

Frontend lightning transactions #3049

Merged

Conversation

thisconnect
Copy link
Collaborator

No description provided.

- changed to use View component
- cleaned up action-buttons
- added global banners
@NickeZ
Copy link
Collaborator

NickeZ commented Nov 14, 2024

I tested it on android and macos. It is a good improvement, but more has to be done for it to be identical to the other account pages.

@Beerosagos
Copy link
Collaborator

I don't like much the Sent to/Received to without any additional information. Could we change it, e.g. using Sent/Received?

image

.map(payment => ({ // TODO: giant hack start
internalID: payment.id,
addresses: [],
amountAtTime: {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to hide the fiat conversion, since it is not available. wdyt?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what it currently should show if fiat is not available.

We should make fiat conversion available here, but that is a backend thing. So I would keep as is and consider providing the fiat conversions.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Beerosagos added a commit to "temporary hide fiat for lightning transactions".

</span>
</TxDetail>
<TxDetail label="fee">
{payment.feeMsat} Msat
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I'd suggest to use msat instead, without the capital m

unit: 'sat' as accountApi.CoinUnit,
estimated: false
},
type: payment.paymentType === 'sent' ? 'send' : 'receive' as accountApi.TTransactionType,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is also type closedChannel

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah I know, but afaik it is currently not supported by BBApp on staging-ln branch. Something to keep in mind for later.

Or what do you suggest to do now?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

flipped it so that closedChannel will use send for now, with a TODO to properly support it in the future.

type: payment.paymentType === 'sent' ? 'send' : 'receive' as accountApi.TTransactionType,
txID: payment.id,
note: payment.description || '',
status: 'complete' as accountApi.TTransactionStatus, // always use complete?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use payment.status ?

time={new Date(payment.paymentTime * 1000).toString()}
/>
<TxDetail label="Amount">
{payment.amountMsat * 0.001} sat
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is toSat() fn available for this in utils/conversion.ts, which adds rounding

@@ -86,6 +88,7 @@ export const Lightning = () => {

const offlineErrorTextLines: string[] = [];

console.log('detailID', detailID);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we remove the log here?

onClose();
}}
payment={payment}
sign={getTxSign(payment.paymentType === 'sent' ? 'send' : 'receive')}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here about closedChannel txs, which I think should be showed as "sent"

@thisconnect
Copy link
Collaborator Author

I don't like much the Sent to/Received to without any additional information. Could we change it, e.g. using Sent/Received?

makes 100% sense, but I prefer to not change the transaction component in the staging-ln branch, if possible.

@thisconnect thisconnect force-pushed the frontend-lightning-transactions branch from beca437 to 4c4b0bb Compare November 20, 2024 13:33
Transaction component expects TTransaction data, so this is a bit
a hack but probably good enough for testing purposes.
@thisconnect thisconnect force-pushed the frontend-lightning-transactions branch from 4c4b0bb to 8ebb344 Compare November 20, 2024 14:26
@thisconnect thisconnect force-pushed the frontend-lightning-transactions branch from 8ebb344 to 5cfe465 Compare November 20, 2024 15:00
@thisconnect
Copy link
Collaborator Author

@Beerosagos I thanks for your review, think I address everything but I didn't test closedChannel.

Copy link
Collaborator

@Beerosagos Beerosagos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK 🙏

@Beerosagos
Copy link
Collaborator

I don't like much the Sent to/Received to without any additional information. Could we change it, e.g. using Sent/Received?

makes 100% sense, but I prefer to not change the transaction component in the staging-ln branch, if possible.

tACKed, but I think that it would make sense to have different objects for lightning TXs. Adapting the base chain TX object to represent LN ones looks a bit hacky to me

@thisconnect
Copy link
Collaborator Author

tACKed, but I think that it would make sense to have different objects for lightning TXs. Adapting the base chain TX object to represent LN ones looks a bit hacky to me

yeah I fully agree, hence the comment about the giant hack.

https://github.com/BitBoxSwiss/bitbox-wallet-app/pull/3049/files#diff-1a6b26c92bc1b7847269a6e97f079e7c063fe1a402cd6020d3912898398849a2R126

I'll look into how the transaction component could be refactored in the main version.

Let me know if I should merge this as is or wait.

@Beerosagos
Copy link
Collaborator

tACKed, but I think that it would make sense to have different objects for lightning TXs. Adapting the base chain TX object to represent LN ones looks a bit hacky to me

yeah I fully agree, hence the comment about the giant hack.

https://github.com/BitBoxSwiss/bitbox-wallet-app/pull/3049/files#diff-1a6b26c92bc1b7847269a6e97f079e7c063fe1a402cd6020d3912898398849a2R126

I'll look into how the transaction component could be refactored in the main version.

Let me know if I should merge this as is or wait.

Ty 🙏 I think we can merge, and we'll refactor everything before merging into master

@thisconnect thisconnect merged commit 9e864f2 into BitBoxSwiss:staging-ln Nov 25, 2024
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants