You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
///! 1st example export whole history between specific range
{
"userpass": "rpc_password",
"method": "export_swaps_csv",
"max": true,
"filtering": {"date_range": [1609223333, 1609225294]},
"path": "/tmp/history.csv"
}
///! 2nd example export n first elements in history that respect specific range
{
"userpass": "rpc_password",
"method": "export_swaps_csv",
"limit": 50,
"filtering": {"date_range": [1609223333, 1609225294]},
"path": "/tmp/history.csv"
}
///! 3rd example export n first elements in history that respect specific range and that have for base coin `RICK`
{
"userpass": "rpc_password",
"method": "export_swaps_csv",
"limit": 50,
"filtering": {"date_range": [1609223333, 1609225294], "pattern": "RICK/*"},
"path": "/tmp/history.csv"
}
///! 4th example export a page with 50 element
{
"userpass": "rpc_password",
"method": "export_swaps_csv",
"limit": 50,
"page": [1],
"path": "/tmp/history.csv"
}
///! 4th example export multiple pages at once with 50 elements per page (150 total)
{
"userpass": "rpc_password",
"method": "export_swaps_csv",
"limit": 50,
"page": [1, 2, 3],
"path": "/tmp/history.csv"
}
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.
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 case
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:
Add 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).
GUIs can retrieve all the UUIDs and then call 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.
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 KomodoPlatform/komodo-wallet#621
The text was updated successfully, but these errors were encountered: