Created
January 20, 2021 02:53
-
-
Save rc1021/de57dbe61d65012b4a175402d1331308 to your computer and use it in GitHub Desktop.
获取所有币信息 (USER_DATA)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Set up authentication: | |
# apiUrl="https://testnet.binance.vision" | |
apiUrl="https://api.binance.com" | |
apiKey="" | |
secretKey="" | |
# Set up the request: | |
apiMethod="GET" | |
apiPath="/sapi/v1/capital/config/getall" | |
ts=$(date +%s000) | |
paramsWithTs="recvWindow=5000×tamp=$ts" | |
signature=$(echo -n "$paramsWithTs" \ | |
| openssl dgst -sha256 -hmac "$secretKey" \ | |
| awk '{print $2}' \ | |
| tr -d '\n') | |
curl -H "X-MBX-APIKEY: $apiKey" \ | |
-X $apiMethod "$apiUrl$apiPath?$paramsWithTs&signature=$signature" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment