diff --git a/scripts/max.sh b/scripts/max.sh index 127672b37..651bd007d 100644 --- a/scripts/max.sh +++ b/scripts/max.sh @@ -24,7 +24,31 @@ case "$command" in submitOrder order_params ;; - withdrawal-history) + deposits) + declare -A params=() + currency=$1 + if [[ -n $currency ]] ; then + params[currency]=$currency + fi + + deposits params \ + | jq -r '.[] | [ .uuid, ((.amount | tonumber) * 10000 | floor / 10000), .currency, .state, (.created_at | strflocaltime("%Y-%m-%dT%H:%M:%S %Z")), .note ] | @tsv' \ + | column -ts $'\t' + ;; + + withdrawals) + declare -A params=() + currency=$1 + if [[ -n $currency ]] ; then + params[currency]=$currency + fi + + withdrawals params \ + | jq -r '.[] | [ .uuid, ((.amount | tonumber) * 10000 | floor / 10000), .currency, ((.fee | tonumber) * 10000 | floor / 10000), .fee_currency, .state, (.created_at | strflocaltime("%Y-%m-%dT%H:%M:%S %Z")), .note ] | @tsv' \ + | column -ts $'\t' + ;; + + withdrawals) declare -A params=() currency=$1 if [[ -n $currency ]] ; then diff --git a/scripts/maxapi.sh b/scripts/maxapi.sh index ff13ea5ab..2bb68d6f3 100755 --- a/scripts/maxapi.sh +++ b/scripts/maxapi.sh @@ -133,7 +133,13 @@ function rewards() send_auth_request "GET" "/api/v2/rewards" _params } -function withdrawalHistory() +function deposits() +{ + local -n _params=$1 + send_auth_request "GET" "/api/v2/deposits" _params +} + +function withdrawals() { local -n _params=$1 send_auth_request "GET" "/api/v2/withdrawals" _params