Skip to content

Instantly share code, notes, and snippets.

@sfat
Created August 30, 2022 06:15
Show Gist options
  • Save sfat/e8d06cb5f9d7a1e4c4b141fd5a2f01d2 to your computer and use it in GitHub Desktop.
Save sfat/e8d06cb5f9d7a1e4c4b141fd5a2f01d2 to your computer and use it in GitHub Desktop.
Make binance order to testnet binance
#!/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&timestamp=$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