Skip to content

Commit

Permalink
Merge #904: [Wallet][RPC] Export basecoin transactions to CSV file
Browse files Browse the repository at this point in the history
d5b00c3 Create exporttransactions feature that exports basecoin transactions to CSV format (supere)

Pull request description:

  ### New Feature
  Add RPC `exporttransactions` to export to a CSV file, similar to the existing `listtransactions` RPC command

  ### Solution
  Added a well tested external CSV library to the project that will make future CSV functionality trivial in the future
  Added the rpc `exporttransactions` command supporting an output filename; and filtering by account, date range, and/or basic piped separated search string

  ```
  exporttransactions (dummy filename start end categories include_watchonly)

  Exports transactions between 'start' date and 'end' date matching 'categories' to a CSV file.
  Note: To export from a specified "account", restart veild with -depreciatedrpc=accounts and
  use this RPC with an "account" argument

  Arguments:
  1. "dummy"      (string, optional) If set, should be "*" for backwards compatibility.
  2. "filename"   (string, optional) The filename with path (either absolute or relative to veild) [default=<datadir>/export/transactions.csv].
  3. "start"      (string, optional) The start date in the format YYYY-MM-DD [default=beginning of ISO8601 time].
  4. "end"        (string, optional) The end date in the format YYYY-MM-DD
   [default=present time].5. "filter"     (string, optional) A pipe(|) separated transaction filter [default=no filter]
     Allowable filter words TBD
  6. include_watchonly (bool, optional, default=false) Include transactions to watch-only addresses (see 'importaddress')
  ```

  ### Bounty Payment Address
  sv1qqp6aptgvgp9t9h8sgzkqmu6cgq2e20l9x6fsl5ask7t3ygy2jagftcpq0x5z0h522ca5h06qq3hx33pke00r7gjt3j24n896gf55y68ptrmjqqqqd8lz3

  ### Unit Testing Results
  Compare exported CSV with output of existing list transactions command. Should be identical except export CSV shows also sent basecoin transactions which were missing in listtransactions.

  ### Known issues
  - Only basecoin transactions at this time.
  - Pulls 'send' transactions from multi-destination transactions that you are a receiver.

Tree-SHA512: 38badc8e982d330787fecec3a28d40d7be548f2d548e6e9202e07c793224322f592b761af008a082142f7abb0485098ec8e4ae5198cd05ddca41746cbf69df31
  • Loading branch information
codeofalltrades committed Jun 1, 2021
2 parents 440184c + d5b00c3 commit b899ec6
Show file tree
Hide file tree
Showing 13 changed files with 3,916 additions and 21 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ include_directories(src/crypto)
include_directories(src/crypto/ctaes)
include_directories(src/crypto/external)
include_directories(src/crypto/x16r)
include_directories(src/csv)
include_directories(src/index)
include_directories(src/interfaces)
include_directories(src/leveldb/db)
Expand Down Expand Up @@ -181,6 +182,11 @@ add_executable(veil
src/crypto/sha256_sse41.cpp
src/crypto/sha512.cpp
src/crypto/sha512.h
src/csv/CSVread.cpp
src/csv/CSVwrite.cpp
src/csv/libcsv.c.cpp
src/csv/strerror.cpp
src/csv/strerror.hpp
src/index/base.cpp
src/index/base.h
src/index/txindex.cpp
Expand Down
8 changes: 8 additions & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ BITCOIN_CORE_H = \
consensus/tx_verify.h \
core_io.h \
core_memusage.h \
csv/csv.h \
csv/CSV.hpp \
cuckoocache.h \
fs.h \
httprpc.h \
Expand Down Expand Up @@ -690,6 +692,11 @@ libbitcoin_util_a_SOURCES = \
compat/glibc_sanity.cpp \
compat/glibcxx_sanity.cpp \
compat/strnlen.cpp \
csv/CSVread.cpp \
csv/CSVwrite.cpp \
csv/libcsv.c \
csv/strerror.cpp \
csv/strerror.hpp \
fs.cpp \
interfaces/handler.cpp \
interfaces/node.cpp \
Expand Down Expand Up @@ -821,6 +828,7 @@ CLEANFILES += consensus/*.gcda consensus/*.gcno
CLEANFILES += crypto/*.gcda crypto/*.gcno
CLEANFILES += crypto/randomx/*.gcda crypto/randomx/*.gcno
CLEANFILES += crypto/randomx/blake2/*.gcda crypto/randomx/blake2/*.gcno
CLEANFILES += csv/*.gcda csv/*.gcno
CLEANFILES += policy/*.gcda policy/*.gcno
CLEANFILES += primitives/*.gcda primitives/*.gcno
CLEANFILES += script/*.gcda script/*.gcno
Expand Down
Loading

0 comments on commit b899ec6

Please sign in to comment.