bash 中的测试示例:
#!/bin/bash
####API
APIKEY="XXXXXXXXXXXXXXXXyour api key here""
APISECRET="XXXXXXXXXXXXyour api secret here"
RECVWINDOW=5000 # 5 seconds
####GET ACCOUNT BALACE
TM=$(( $(date -u +%s) *1000))
GET_BALANCE_QUERY="recvWindow=$RECVWINDOW×tamp=$TM"
GET_BALANCE_SIG=$(echo -n "$GET_BALANCE_QUERY" | openssl dgst -sha256 -hmac $APISECRET)
echo $GET_BALANCE_SIG
GET_BALANCE_SIG="$(echo $GET_BALANCE_SIG | cut -f2 -d" ")"
echo $GET_BALANCE_SIG
curl -H "X-MBX-APIKEY: $APIKEY" -X GET "https://api.binance.com/api/v3/account?recvWindow=$RECVWINDOW×tamp=$TM&signature=$GET_BALANCE_SIG" | jq
=