Initial commit

This commit is contained in:
Dimitri Kaparis 2021-09-25 02:21:09 +03:00
commit a7e12f000b
2 changed files with 15 additions and 0 deletions

7
README.md Normal file
View File

@ -0,0 +1,7 @@
Electron Cash export history script
Exports CSV history in specified date range
Usage: ec-export.sh <wallet-file> <start-date> <end-date>
Example: ec-export.sh ~/.electron-cash/wallets/default_wallet 2021-08-01 2021-08-31

8
ec-export.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/bash
# ec-export.sh <wallet-file> <start-date> <end-date>
echo transaction_hash,label,confirmations,value,fee,timestamp,fiat_value_EUR,fiat_balance_EUR,fiat_fee_EUR,input_addresses,output_addresses
electron-cash history -w $1 --show_fiat --use_net |
jq -r 'map({txid,"label",confirmations,value,fee,timestamp,fiat_value,fiat_balance,fiat_fee}) | (first | keys_unsorted) as $keys | map([to_entries[] | .value]) as $rows | $keys,$rows[] | @csv' |
gawk -vFPAT='[^,]*|"[^"]*"' -v OFS="," '{ $6 = strftime("%Y-%m-%d %H:%M",$6); if($6>="'$2'" && $6<="'$3'") {print}}'