Hi guys , i have this problem i have created in C function for time stamp and signature ,(the API i call directly in CURL without libcurl) it work perfect because when i call this function it work perfect
zioT=MyTimeStamp()
?zioT
ZioSg=BinSHA256Signature ("symbol=BNBUSDT&recvWindow=50000×tamp="+zioT+";"+SecretKeyBin)
?ZioSg
zio=BinApiAllOrders(""+ApiKeyBin+";BNBUSDT;0;0;0;0;50000;"+zioT+";"+ZioSg)
?zio
but if i call this API
zioT=MyTimeStamp()
?zioT
ZioSg=BinSHA256Signature ("symbol=NEOUSDT&recvWindow=5000×tamp="+zioT+";"+SecretKeyBin)
?ZioSg
zio=BinApiAccountTradeList(""+ApiKeyBin+";NEOUSDT;0;0;0;0;0;50000;"+zioT+";"+ZioSg)
?zio
return {“code”:-1022,“msg”:“Signature for this request is not valid.”}
i try to stamp all curl query and the function call this
curl -H "X-MBX-APIKEY: 0020222222222222222" -X GET "https://api.binance.com/api/v3/myTrades?symbol=NEOUSDT&recvWindow=50000×tamp=1647190627139&signature=1123333131313131311231313131333131332"
(i suppose is correct ask confirm about it )
for have confirm i try call API also in bash (and bash work this F… API ) this is my code
#!/bin/bash
APIKEY="121313113131313131313"
APISECRET="111333233111131333"
#sURLPART2="symbol=NEOUSDT&side=BUY&type=LIMIT"eOrderQty=10&price=270.3&newOrderRespType=FULL"
URLPART2="symbol=NEOUSDT"
RECVWINDOW=50000
RECVWINDOW="recvWindow=$RECVWINDOW"
TIMESTAMP="timestamp=$(( $(date +%s) *1000))"
QUERYSTRING="$URLPART2&$RECVWINDOW&$TIMESTAMP"
SIGNATURE=$(echo -n "$QUERYSTRING" | openssl dgst -sha256 -hmac $APISECRET | cut -c 10-)
SIGNATURE="signature=$SIGNATURE"
cat 'curl -H "X-MBX-APIKEY: '$APIKEY'" -X GET "https://api.binance.com/api/v3/myTrades?'$URLPART2'&'$RECVWINDOW'&'$TIMESTAMP'&'$SIGNATURE'"'
#curl -s -H "X-MBX-APIKEY: $APIKEY" "https://api.binance.com/api/v3/order/test?$URLPART2&$RECVWINDOW&$TIMESTAMP&$SIGNATURE"
curl -H "X-MBX-APIKEY: $APIKEY" -X GET "https://api.binance.com/api/v3/myTrades?$URLPART2&$RECVWINDOW&$TIMESTAMP&$SIGNATURE"
echo
i try also print the string of bash script and is the same that i call in C
curl -H "X-MBX-APIKEY: 11212212112222212" -X GET "https://api.binance.com/api/v3/myTrades?symbol=NEOUSDT&recvWindow=50000×tamp=1647190881000&signature=2232333131313133331"
anyone have some idea??? why if i call thesame string of curl have 2 differents results ???
the function of signature and time stamp iam sure 100% is correct because in other API that required signature and time stamp with thesame function it work
thanks at all