XCH Transaction Exporter

XCH Transaction Exporter


XCH Transaction Exporter : getxchtx [Bash Edition]   

Generate a list of transactions for Chia (XCH) into a CSV file.


getxchtx.sh - You must run this script from the command line. The script pulls all your transactions into a json file by querying the wallet db, then loops through each transaction building a CSV file. Note: You must use the 'bash' command and not 'sh'.

COMMAND OPTIONS

USAGE: bash getxchtx.sh [OPTIONS]

OPTIONS
  -y YEAR         transactions only for given 4-digit year      Default: all transactions
  -i INTERGER     Id of the wallet to use                       Default: 1
  -s INTERGER     Index of starting transaction                 Default: 0
  -e INTERGER     Index of ending transaction                   Default: 999999
  -o INTERGER     0 for ascending, 1 for descending             Default: 0
  -min AMOUNT     Only transactions greater than AMOUNT         Default: 0
  -max AMOUNT     Only transactions less than AMOUNT            Default: 999999
  -t INTERGER     -1 for all transaction types                  Default: -1
                    0 for INCOMING_TX
                    1 for OUTGOING_TX
                    2 for COINBASE_REWARD
                    3 for FEE_REWARD
                    4 for INCOMING_TRADE
                    5 for OUTGOING_TRADE
  -v              verbose output
  -h              help

  Example:
      bash getxchtx.sh -y 2021 -v

  Example for saving to file:
      bash getxchtx.sh -y 2021 >tx_list.csv

Notes:

1. Since this is pulling historical transactions, the current price column is set to 0. You will need to populate that column manually. Let me know if there is a free API that can pull historical pricing for XCH.


Prerequisites:

curl must be installed. Run the following command to see if you have it installed.

curl --version

jq must be installed. Run the following command to see if you have it installed.

jq --version

XCH Transaction Exporter : getxchtxPS [Powershell Edition]   

Generate a list of transactions for Chia (XCH) into a CSV file.


getxchtxPS.ps1 - The script pulls all your transactions into a json file by Chia CLI commands, then loops through each transaction building a CSV file.


Usage: .\getxchtxPS [OPTIONS]

Options:
  -f INTEGER       Set the fingerprint to specify which wallet to use  [required]
  -i INTEGER       Id of the wallet to use                             [default: 1; required]
  -o INTEGER       Skip transactions from the beginning of the list    [default: 0; required]
  -l INTEGER       Max number of transactions to return                [default: 4294967295]
  -y YEAR          Filter transactions to given 4-digit year (or all)  [default: all]
  -min XCH         Filter to transactions greater than XCH given       [default: 0]
  -max XCH         Filter to transactions less than XCH given          [default: 999999]
  -t INTEGER       Filter by transaction type                          [default: -1]
                          -1 All transaction types
                           0 INCOMING_TX
                           1 OUTGOING_TX
                           2 COINBASE_REWARD
                           3 FEE_REWARD
                           4 INCOMING_TRADE
                           5 OUTGOING_TRADE
  -v, --verbose
  -h, --help       Show this message and exit.

Do not use -o or -l with any of the filter options (year, min, max, type).

Example:
     .\getxchtxPS -y 2021 -v

Example for saving to file:
     .\getxchtxPS -y 2021 >tx_list.csv

Notes:

  1. You must use Windows PowerShell or Windows PowerShell ISE to execute the script.
  2. You should not use -o (offset) or -l (limit) with any of the Filter options (year, min, max, type).
  3. Since this is pulling historical transactions, the current price column is set to 0. You will need to populate that column manually.

Disclaimer: For educational purposes only.




Want to help support?

Comments

Popular posts from this blog

Digging Deep into Chia Network

How to setup a Chia Harvester

Build your own Chia Plugin for Glances on Ubuntu Linux