mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-21 22:43:52 +00:00
add rewards commands
This commit is contained in:
parent
4ba510a799
commit
fd6301b780
|
@ -72,6 +72,17 @@ case "$command" in
|
|||
cancelOrder $order_id
|
||||
;;
|
||||
|
||||
rewards)
|
||||
declare -A rewards_params=()
|
||||
currency=$1
|
||||
if [[ -n $currency ]] ; then
|
||||
rewards_params[currency]=$currency
|
||||
fi
|
||||
# rewards rewards_params | jq -r '.[] | "\(.type)\t\((.amount | tonumber) * 1000 | floor / 1000)\t\(.currency) \(.state) \(.created_at | strflocaltime("%Y-%m-%dT%H:%M:%S %Z"))"'
|
||||
rewards rewards_params | jq -r '.[] | [ .type, ((.amount | tonumber) * 10000 | floor / 10000), .currency, .state, (.created_at | strflocaltime("%Y-%m-%dT%H:%M:%S %Z")) ] | @tsv' \
|
||||
| column -ts $'\t'
|
||||
;;
|
||||
|
||||
trades)
|
||||
if [[ $# < 1 ]] ; then
|
||||
echo "$0 trades [market]"
|
||||
|
|
|
@ -119,6 +119,12 @@ function myTrades()
|
|||
send_auth_request "GET" "/api/v2/trades/my" params
|
||||
}
|
||||
|
||||
function rewards()
|
||||
{
|
||||
local -n params=$1
|
||||
send_auth_request "GET" "/api/v2/rewards" params
|
||||
}
|
||||
|
||||
|
||||
# me | jq '.accounts[] | select(.currency == "usdt")'
|
||||
# me | jq '.accounts[] | select(.currency == "btc")'
|
||||
|
|
Loading…
Reference in New Issue
Block a user