mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-21 22:43:52 +00:00
maxapi: add withdraw command
This commit is contained in:
parent
710df930a4
commit
a4a3f0fbd8
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user