forked from EvergreenCrypto/docker-finance
hledger-flow: gemini: allow optional on-chain transfers
Fixes "does not exist as a named header in the given CSV data." when on-chain transfer does not (yet) exist for given year.
This commit is contained in:
@@ -50,11 +50,15 @@ function parse_transfers()
|
|||||||
|
|
||||||
if lib_preprocess::test_header "info_feeCurrency"; then
|
if lib_preprocess::test_header "info_feeCurrency"; then
|
||||||
|
|
||||||
_header="info_eid,info_timestampms,info_type,info_currency,info_feeCurrency,info_amount,info_feeAmount,info_destination,info_txHash"
|
_header="info_eid,info_timestampms,info_type,info_currency,info_feeCurrency,info_amount,info_feeAmount"
|
||||||
# Off-chain withdrawal
|
|
||||||
|
# On-chain
|
||||||
|
lib_preprocess::test_header "info_destination" && _header+=",info_destination"
|
||||||
|
lib_preprocess::test_header "info_txHash" && _header+=",info_txHash"
|
||||||
|
|
||||||
|
# Off-chain (withdrawal)
|
||||||
lib_preprocess::test_header "info_method" && _header+=",info_method"
|
lib_preprocess::test_header "info_method" && _header+=",info_method"
|
||||||
|
|
||||||
# NOTE: this hack in a sort because docker-finance's fetch (or their server's) pagination. See fetch implementation.
|
|
||||||
xsv select "$_header" "$global_in_path" \
|
xsv select "$_header" "$global_in_path" \
|
||||||
| gawk -v global_year="$global_year" -v global_subaccount="$global_subaccount" -M -v PREC=100 \
|
| gawk -v global_year="$global_year" -v global_subaccount="$global_subaccount" -M -v PREC=100 \
|
||||||
'{
|
'{
|
||||||
|
|||||||
Reference in New Issue
Block a user