Created
August 30, 2022 06:15
-
-
Save sfat/e8d06cb5f9d7a1e4c4b141fd5a2f01d2 to your computer and use it in GitHub Desktop.
Make binance order to testnet binance
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 | |
timestamp=$(python3 -c 'import time; print(int(time.time() * 1000))') | |
api_key="API_KEY" # change me | |
secret_key="SECRET_KEY" # change me | |
query="symbol=$1&side=$2&type=MARKET&quantity=$3&recvWindow=10000×tamp=$timestamp" | |
echo "$query" | |
signature=$(echo -n "$query" | openssl dgst -sha256 -hmac $secret_key) | |
#echo -n "$query" | |
echo "$signature" | |
echo "https://testnet.binance.vision/api/v3/order?$query&signature=$signature" | |
curl -vvv -H "X-MBX-APIKEY: $api_key" -X POST "https://testnet.binance.vision/api/v3/order?$query&signature=$signature" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment