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

gui: tx export feature #1496

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pythcoiner
Copy link
Collaborator

@pythcoiner pythcoiner commented Dec 10, 2024

This PR add a feature to export transactions:
Done:

  • Subscription to run the feature in a detached thread w/ possibility to send update about the ongoing progress.
  • Let user choose the path using rfd crate
  • Add a modal that show progress of the process
  • estimate the progress
  • cancel feature

@pythcoiner
Copy link
Collaborator Author

output format is of this kind:

Date,Label,Value,Fee,Txid,Block
2024-12-10 05:47:17,,-4556.307081010001,0,490123da60b8756ef3057489db7835ed27ba1a3a9165d1415e390c01953d0700,4474
2024-12-10 05:47:55,,-4551.73961133,0,8d14c7998237b5c363e3645397a3fa10824bf2df8a026437380821530b34fc00,4504
2024-12-10 05:48:16,,-4550.32248578,0,60b2501f9d70574e91367485b234e95ebf654e6a2510c89692f0322897684001,4508
2024-12-10 05:44:05,,0.07570141,0,4d7b801685bf5f45f585639156f0bfd45f70b6cd94b9e3fc0bf50f2d2965cf04,4414
2024-12-10 05:47:29,,-4554.703452029999,0,f121deab920efc44f91640a9f80362fe5c6c55fc9efffb0ee5dec67f590e6a05,4484
2024-12-10 05:44:05,,0.08503501,0,afb8384ca4c0842ce404c5356e049e612a9a98ddabebfb3493c80a993734fc05,4414
2024-12-10 05:47:06,,-4557.356988029999,0,05c68b3dc2a2b7853ef51e113bc78e35416c65366d1b3f0a269c88b0082b1106,4464
2024-12-10 05:47:17,,-4555.75509545,0,7cf6f654146a60b35614723447a2d0e38e5a493e9ee11b1b5fba8f2d3a01b106,4474
2024-12-10 05:47:06,,-4557.00431544,0,857885b4478df654ba5ebd4be368c9881323003d774cd0682efffe073f935f07,4464
2024-12-10 05:48:25,,-4547.699713360001,0,f366faf769ac55153d2bfd7142307fb9e4c2a38738cd6aa5ac181c0fbdb48708,4510
2024-12-10 05:46:23,,-4562.92989973,0,e50e0cb41132a70e98b94015b20aff46dac89d00bda75980e57665d906ea9d09,4424
2024-12-10 05:47:29,,-4554.39258008,0,07c577b729bddeeaf50fd09437e2d80a9e649d035af96c385918df50cde9e909,4484
2024-12-10 05:46:34,,-4562.45004093,0,4e1de4ef0ad1c61231d1f500df82f22b1654aa36120c169c40cc71b57cdb510a,4434
2024-12-10 05:47:29,,-4555.42024903,0,c65eb97af1eb0b750b7b8b99263637e8d1a91f42bdec2a9ec55e408f6ffbe90a,4484
2024-12-10 05:46:55,,-4559.26884367,0,34e0df60f41084dd8719d6ee308a6a5112672c4ccdb6b0187f958b5f38b7420b,4454
2024-12-10 05:48:16,,-4550.2741867899995,0,a2830e973c7897ffc0d5a8c5a2b6c33547ff4af47e7bca1e993a46b0ef8bb80c,4508
2024-12-10 05:48:35,"tx_label",-4546.57805264,0,75596a4a2d9125ddc9adeb559b416596921f17ae97b861473e2a045949cd1a0d,4512
2024-12-10 05:46:34,,-4562.09782068,0,b172cbfff8d68414f3a0b4419aee189849043b398edbfd8d04493ddc2367680e,4434
2024-12-10 05:47:55,,-4551.98618741,0,1ed86b3bf946675f4d89dce67ef334b60c68423be86cadb99ac1d56cae5f770e,4504
2024-12-10 05:48:35,,-4546.8183422,0,0b66304faa6c794f0538bcee2c0077aaf2b865ce99d4072da30e63e44825a50e,4512
2024-12-10 05:47:45,,-4553.24543947,0,735a85c0a29cd579f40ebf102e50c28937ee41ff7795ea4a050234b45d6aeb0e,4494
2024-12-10 05:47:17,,-4556.67268762,0,82f19fc81364a0e81a836f49975af0668c56978ad501176a9691bae95319a40f,4474
2024-12-10 05:47:17,,-4556.0801701400005,0,20613356850d17db0a7edd22e4220e6714df6c385f2bcb5cc819eeee5defa60f,4474
2024-12-10 05:46:34,,-4562.50612539,0,458e7d9042717c23f2f03b2d1f6612916ac030d23ea974a36c1dd4ca1aef9a10,4434
2024-12-10 05:47:55,,-4552.09575805,0,8160c03c683d58345c7c5ab6a3997e26f524ee5bd5d2fb6c792989c7a6dff511,4504
2024-12-10 05:47:06,,-4557.75175757,0,159ec931e9c59e451e5332f21bad87ecc6d6672cbb3c856b09e97a028db4be12,4464
2024-12-10 05:48:06,,-4550.39534451,0,25d28a012367c160b40ad009aaf565ab99e277af911295da229da9da84684d14,4506
2024-12-10 05:48:35,,-4546.88395709,0,b436128c26517fddf0f1ded028347e3f38f0b557ebc258c60bae575f8034b214,4512
2024-12-10 05:48:35,,-4547.28617754,0,a16642d97443b52810730daebb77571b7764c31bf6d4a70448bca2a7a16fca14,4512
2024-12-10 05:46:23,,-4563.71602614,0,b2d34d4e9590551a09cb54a467cc675b0ba0a4776ed7a64dfe7d0e860708e914,4424

@nondiremanuel
Copy link
Collaborator

we need to decide wich label select, for now i follow this logic:

* if there is a tx label pick it

* else if it's a single payment use the address

* else if it's a self send show "self send"

* else no label

Maybe we should just stick to the transaction label (if present), in order to not over-complicate the logic and create confusion due to the fact that sometimes you can find the address label (if it was a single payment) while sometimes not (if it was a batch payment). For this kind of detail, the user could refer to the "payment export" which will be more related to this kind of information detail. What do you think?

In such case the variable would be called "Tx Label" instead of a generic "Label" name.

@pythcoiner
Copy link
Collaborator Author

Maybe we should just stick to the transaction label (if present), in order to not over-complicate the logic and create confusion due to the fact that sometimes you can find the address label (if it was a single payment) while sometimes not (if it was a batch payment). For this kind of detail, the user could refer to the "payment export" which will be more related to this kind of information detail. What do you think?

In such case the variable would be called "Tx Label" instead of a generic "Label" name.

i'm fine w/ using only the Tx label, but i think we should keep Label name for this column, as it is the name already used by sparow (and electrum?)

@nondiremanuel
Copy link
Collaborator

Maybe we should just stick to the transaction label (if present), in order to not over-complicate the logic and create confusion due to the fact that sometimes you can find the address label (if it was a single payment) while sometimes not (if it was a batch payment). For this kind of detail, the user could refer to the "payment export" which will be more related to this kind of information detail. What do you think?
In such case the variable would be called "Tx Label" instead of a generic "Label" name.

i'm fine w/ using only the Tx label, but i think we should keep Label name for this column, as it is the name already used by sparow (and electrum?)

I'm ok with it.

@pythcoiner pythcoiner force-pushed the tx_export branch 3 times, most recently from 700803d to d1e970a Compare December 16, 2024 09:35
@pythcoiner pythcoiner marked this pull request as ready for review December 16, 2024 09:36
@pythcoiner pythcoiner changed the title [WIP] gui: tx export feature gui: tx export feature Dec 16, 2024
@pythcoiner pythcoiner force-pushed the tx_export branch 3 times, most recently from 9c6882c to 0431b72 Compare December 17, 2024 11:53
Copy link
Collaborator

@jp1ac4 jp1ac4 left a comment

Choose a reason for hiding this comment

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

I'm continuing to test & review, but adding some initial comments.

liana-gui/src/export.rs Outdated Show resolved Hide resolved
liana-gui/src/export.rs Outdated Show resolved Hide resolved
liana-gui/src/export.rs Outdated Show resolved Hide resolved
liana-gui/src/app/state/export.rs Outdated Show resolved Hide resolved
liana-gui/src/app/view/export.rs Outdated Show resolved Hide resolved
@pythcoiner pythcoiner force-pushed the tx_export branch 3 times, most recently from 3e92090 to 5309aaf Compare December 20, 2024 08:29
Copy link
Collaborator

@jp1ac4 jp1ac4 left a comment

Choose a reason for hiding this comment

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

I've tested the export with a couple of wallets and it's looking good. Added some comments.

liana-gui/src/app/state/export.rs Outdated Show resolved Hide resolved
liana-gui/src/app/state/export.rs Outdated Show resolved Hide resolved
liana-gui/src/app/state/export.rs Outdated Show resolved Hide resolved
liana-gui/src/app/state/mod.rs Outdated Show resolved Hide resolved
liana-gui/src/app/state/transactions.rs Show resolved Hide resolved
liana-gui/src/app/state/transactions.rs Outdated Show resolved Hide resolved
liana-gui/src/app/state/transactions.rs Outdated Show resolved Hide resolved
liana-gui/src/export.rs Show resolved Hide resolved
liana-gui/src/export.rs Show resolved Hide resolved
@pythcoiner pythcoiner force-pushed the tx_export branch 3 times, most recently from aeffc50 to 7ef4b7f Compare December 23, 2024 09:55
@jp1ac4
Copy link
Collaborator

jp1ac4 commented Dec 23, 2024

This needs a rebase on master.

@pythcoiner
Copy link
Collaborator Author

This needs a rebase on master.

rebased

Copy link
Collaborator

@jp1ac4 jp1ac4 left a comment

Choose a reason for hiding this comment

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

Tested ACK 22f4875.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Review
Development

Successfully merging this pull request may close these issues.

4 participants