kaspanet / rusty-kaspa

Kaspa full-node and related libraries in the Rust programming language. This is a stable version at the initial rollout phases.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Implement CSV export of the wallet account transaction history

aspect opened this issue · comments

commented

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

I would like to pick up this one. Familiarizing myself with the codebase and setting up the dev env in Windows currently, hopefully will be able to finish in a month. Just letting everyone know, so that there is no duplication of effort. Would love for someone to review the code eventually, though.