mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
maxapi: add bash version withdrawal history command
This commit is contained in:
parent
00109eb464
commit
710df930a4
|
@ -24,6 +24,18 @@ case "$command" in
|
|||
submitOrder order_params
|
||||
;;
|
||||
|
||||
withdrawal-history)
|
||||
declare -A params=()
|
||||
currency=$1
|
||||
if [[ -n $currency ]] ; then
|
||||
params[currency]=$currency
|
||||
fi
|
||||
|
||||
withdrawalHistory 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'
|
||||
;;
|
||||
|
||||
limit)
|
||||
market=$1
|
||||
side=$2
|
||||
|
@ -83,7 +95,7 @@ case "$command" in
|
|||
rewards rewards_params | jq -r '.[] | [ .uuid, .type, ((.amount | tonumber) * 10000 | floor / 10000), .currency, .state, (.created_at | strflocaltime("%Y-%m-%dT%H:%M:%S %Z")), .note ] | @tsv' \
|
||||
| column -ts $'\t'
|
||||
;;
|
||||
|
||||
|
||||
trades)
|
||||
if [[ $# < 1 ]] ; then
|
||||
echo "$0 trades [market]"
|
||||
|
|
|
@ -116,21 +116,27 @@ function cancelOrder()
|
|||
|
||||
function myOrders()
|
||||
{
|
||||
local -n params=$1
|
||||
send_auth_request "GET" "/api/v2/orders" params
|
||||
local -n _params=$1
|
||||
send_auth_request "GET" "/api/v2/orders" _params
|
||||
}
|
||||
|
||||
|
||||
function myTrades()
|
||||
{
|
||||
local -n params=$1
|
||||
send_auth_request "GET" "/api/v2/trades/my" params
|
||||
local -n _params=$1
|
||||
send_auth_request "GET" "/api/v2/trades/my" _params
|
||||
}
|
||||
|
||||
function rewards()
|
||||
{
|
||||
local -n params=$1
|
||||
send_auth_request "GET" "/api/v2/rewards" params
|
||||
local -n _params=$1
|
||||
send_auth_request "GET" "/api/v2/rewards" _params
|
||||
}
|
||||
|
||||
function withdrawalHistory()
|
||||
{
|
||||
local -n _params=$1
|
||||
send_auth_request "GET" "/api/v2/withdrawals" _params
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user