add timestamp to trades layout

This commit is contained in:
c9s 2020-12-02 09:40:27 +08:00
parent be79c098d4
commit fe25e38c93
2 changed files with 18 additions and 1 deletions

View File

@ -60,6 +60,16 @@ case "$command" in
orders_params[market]=$market
myOrders orders_params | jq -r '.[] | "\(.id) \(.market) \(.side) \(.price) \t \(.volume) \(.state)"'
;;
cancel)
if [[ $# < 1 ]] ; then
echo "$0 cancel [oid]"
exit
fi
order_id=$1
cancelOrder $order_id
;;
trades)
if [[ $# < 1 ]] ; then
@ -70,6 +80,6 @@ case "$command" in
market=$1
declare -A trades_params=()
trades_params[market]=$market
myTrades trades_params | jq -r '.[] | "\(.id) \(.market) \(.side) \(.price) \t \(.volume) fee = \(.fee) \(.fee_currency)"'
myTrades trades_params | jq -r '.[] | "\(.id) \(.market) \(.side) \(.price) \t \(.volume) \t fee = \( .fee | tonumber * 1000 | floor / 1000 ) \(.fee_currency)\t\( .created_at | strflocaltime("%Y-%m-%dT%H:%M:%S %Z") )"'
;;
esac

View File

@ -99,6 +99,13 @@ function submitOrder()
send_auth_request "POST" "/api/v2/orders" params
}
function cancelOrder()
{
declare -A params=()
params[id]=$1
send_auth_request "POST" "/api/v2/order/delete" params
}
function myOrders()
{
local -n params=$1