Closed LiveRock closed 6 years ago
Please see the following page
https://github.com/jaggedsoft/php-binance-api/wiki/4.-Troubleshooting
Added the line just before the api call with key and secret:
<<?php require 'vendor/autoload.php'; $api = new Binance\API("key","secret");
// PHP // Fix signedRequest error: {"code":-1022,"msg":"Signature for this request is not valid." $api->useServerTime(); .....
Still having the same error
Error now is 1022 instead of 1021
On your console, can you post the result of the following
curl -vvv https://api.binance.com
This from my OSX machine, not my server:
GET / HTTP/2 Host: api.binance.com User-Agent: curl/7.54.0 Accept: /
If you see this page, the nginx web server is successfully installed and working. Further configuration is required.
For online documentation and support please refer to
nginx.org.
Commercial support is available at
nginx.com.
Thank you for using nginx.
Hey, the output from your osx machine is no value here.
In order to find the source of the issue, there are a number of things you need to validate/fix.
By running the above command you knock 4 of the items of the list.
If you have no console access you could try somethibg like
<?php
print "<pre>";
print shell_exec ("curl -vvv https://api.binance.com 2>&1");
print "</pre>";
You are right. I copied and paste Binance API credentials again and now it works. Many thanks!
Another question not related to the issue. Is it possible for me to extract the following information at a given date/time? Cryptocurrency: for example, BTC Exchange currency: for example, USDT Volumne % change 24 hour High Low
i don't think there is a function for that or specifically exposed by the binance API.
might be a nice feature here if you want to create a full request, if i understand you correctly
psuedo code
function getPErcentageChangeBetweenDates( older, newer )
{
// get average on these dates from candle information
// minus the 2 averages
$diff = ( $older-avg/ $newer-avg ) * 100;
return $diff;
}
Error 1021
Short Description: Tried the 0.example with valid credentials with the following errors: signedRequest error: {"code":-1021,"msg":"Timestamp for this request is outside of the recvWindow."} balanceData error: Please make sure your system time is synchronized, or pass the useServerTime option.
Platform: CentOS
php version:
Long descrption Tried the 0.example with valid credentials with the following errors: signedRequest error: {"code":-1021,"msg":"Timestamp for this request is outside of the recvWindow."} balanceData error: Please make sure your system time is synchronized, or pass the useServerTime option.
code
result Price of BNB: BTC. signedRequest error: {"code":-1021,"msg":"Timestamp for this request is outside of the recvWindow."} balanceData error: Please make sure your system time is synchronized, or pass the useServerTime option. BTC owned: ETH owned: Estimated Value: 0 BTC
thank you