mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
Merge pull request #154 from c9s/feature/shell-maxapi-withdraw-deposit
feature: add withdraw deposit commands to shell version maxapi
This commit is contained in:
commit
99fe8b07f1
|
@ -24,6 +24,30 @@ case "$command" in
|
|||
submitOrder order_params
|
||||
;;
|
||||
|
||||
deposits)
|
||||
declare -A params=()
|
||||
currency=$1
|
||||
if [[ -n $currency ]] ; then
|
||||
params[currency]=$currency
|
||||
fi
|
||||
|
||||
deposits params \
|
||||
| jq -r '.[] | [ .uuid, .txid, ((.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, .txid, ((.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
|
||||
|
|
|
@ -116,21 +116,33 @@ 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 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