我熟悉使用API。我有以下问题:
错误是:
Fatal error: Uncaught Larislackers\BinanceApi\Exception\BinanceApiException: [-1102]: Mandatory parameter 'timestamp' was not sent, was empty/null, or malformed. thrown in C:\Users\Francisco\vendor\larislackers\php-binance\src\BinanceApiContainer.php on line 568
我注意到这是因为TIMESTAMP是强制性的: https://www.binance.com/restapipub.html#current-open-orders-signed
有人能为我提供一个如何填写时间戳的示例吗? 到目前为止,这是我的代码:
$orders = $bac->getOpenOrders(['symbol' => 'XVGETH']);
var_dump($orders->getBody()->getContents());
答案 0 :(得分:0)
将timestamp
密钥添加到$params
阵列。
$orders = $bac->getOpenOrders(['symbol' => 'XVGETH', 'timestamp' => time()]);
time()
返回当前时间。如果您想要其他时间,可以使用许多日期时间功能。它也只是一个代表以秒为单位的时间的数字,你可以执行像time() - 86400
这样的普通算术来获取昨天的当前时间。
有关Binance API如何使用timestamp
选项,请参阅https://www.binance.com/restapipub.html。