rusty-kaspa
rusty-kaspa copied to clipboard
Implement CSV export of the wallet account transaction history
We need to be able to export transactions in a CSV format.
This functionality would be a replica of the history command:
https://github.com/kaspanet/rusty-kaspa/blob/master/cli/src/modules/history.rs
where the TransactionRecord
needs to be taught to produce a CSV record (line), similarly to current format output:
https://github.com/kaspanet/rusty-kaspa/blob/master/wallet/core/src/storage/transaction.rs#L318
The accumulated data then needs to be collected and depending on the environment either made to be downloadable (KOS/web) via the download data handler:
https://github.com/workflow-rs/workflow-rs/blob/master/dom/src/download.rs
or (CLI) stored as a CSV file:
https://github.com/workflow-rs/workflow-rs/blob/master/store/src/fs.rs
The filename should be supplied via the cli command arguments.
This issue is dependent on #256 to be functional in the web environment.
The actual content generation should be made available as a part of the wallet Account API
https://github.com/kaspanet/rusty-kaspa/blob/master/wallet/core/src/runtime/account/mod.rs
So that it can be exposed to WASM SDK (which is currently WIP):
https://github.com/kaspanet/rusty-kaspa/blob/master/wallet/core/src/wasm/wallet/account.rs