Closed Milerius closed 3 years ago
Thanks for opening the issue! I think different GUIs can have different export formats, and it might be hard for MM2 to support all of them. So I prefer to implement the following solution:
all_swaps_uuids_by_filter
RPC, which returns all UUIDs of swaps that match selected filters (request format will be the same as for my_recent_swaps).my_swap_status
for each mapping the JSON to the GUI specific format.This will allow avoiding huge RAM usage on requesting big data set: 1 UUID in string format takes 36 bytes so maximum memory usage will be number_of_returned_swaps * 36
which seems quite acceptable even for hundreds of thousands of swaps.
I will do it today.
I've added the new RPC, docs diff: https://github.com/KomodoPlatform/developer-docs/pull/235/commits/542c76876226b0248a73a4d0adef7727628ec4d9. Release will be published by CI soon.
Is your feature request related to a problem? Please describe.
Related to #784
In the same idea since the pagination is from mm2 side now, the swaps export is no longer correct for
atomicdex-desktop
.Describe the solution you'd like
I would like to have a rpc call
export_swaps_csv
that can take same filtering parameters as #784 + a path for saving the file.I don't know how answer would look like but you can return
{"result": "success"}
in case of success or the whole csv as plain text.I will share how i implemented it in C++:
Example of a csv file:
Describe alternatives you've considered
Fetch all the swaps once, and then apply filtering myself then exporting the visible history, but with huge swaps history this cost too much memory and this is slow.
Additional context
Maybe related to the fact that MM2 plan to move DB to smth like:
embedded DB like SQLite
, will be easier to use filtering in this caseAlso related to https://github.com/KomodoPlatform/atomicDEX-Desktop/pull/621