Skip to content

Commit a81fab3

Browse files
committed
removed from live tests
1 parent 203fdad commit a81fab3

File tree

1 file changed

+31
-32
lines changed

1 file changed

+31
-32
lines changed

php-binance-api.php

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1448,24 +1448,27 @@ protected function curl_set_body($curl, $option, $query) {
14481448
curl_setopt($curl, $option, $query);
14491449
}
14501450

1451-
protected function spotRequest($url, $method = "GET", $params = [], $signed = false)
1451+
public function spotRequest($url, $method = "GET", $params = [], $signed = false)
14521452
{
14531453
return $this->httpRequest($url, $method, $params, $signed);
14541454
}
14551455

1456-
protected function spotWalletRequest($url, $method = "GET", $params = [], $signed = false)
1456+
public function spotWalletRequest($url, $method = "GET", $params = [], $signed = false)
14571457
{
14581458
$params['sapi'] = true;
14591459
return $this->httpRequest($url, $method, $params, $signed);
14601460
}
14611461

1462-
protected function futuresRequest($url, $method = "GET", $params = [], $signed = false)
1462+
public function futuresRequest($url, $method = "GET", $params = [], $signed = false, $recvWindow = null)
14631463
{
14641464
$params['fapi'] = true;
1465+
if ($recvWindow) {
1466+
$params['recvWindow'] = $recvWindow;
1467+
}
14651468
return $this->httpRequest($url, $method, $params, $signed);
14661469
}
14671470

1468-
protected function fapiDataRequest($url, $method = "GET", $params = [], $signed = false)
1471+
public function fapiDataRequest($url, $method = "GET", $params = [], $signed = false)
14691472
{
14701473
$params['fapiData'] = true;
14711474
return $this->httpRequest($url, $method, $params, $signed);
@@ -3360,9 +3363,9 @@ public function bswapQuote($baseAsset, $quoteAsset, $quoteQty, array $params = [
33603363
* @return array with error message or array with server time key
33613364
* @throws \Exception
33623365
*/
3363-
public function futuresTime()
3366+
public function futuresTime(array $params = [])
33643367
{
3365-
return $this->futuresRequest("v1/time", "GET");
3368+
return $this->futuresRequest("v1/time", "GET", $params);
33663369
}
33673370

33683371
/**
@@ -3377,10 +3380,10 @@ public function futuresTime()
33773380
* @return array containing the response
33783381
* @throws \Exception
33793382
*/
3380-
public function futuresExchangeInfo()
3383+
public function futuresExchangeInfo(array $params = [])
33813384
{
33823385
if (!$this->futuresExchangeInfo) {
3383-
$arr = $this->futuresRequest("v1/exchangeInfo", "GET");
3386+
$arr = $this->futuresRequest("v1/exchangeInfo", "GET", $params);
33843387
if ((is_array($arr) === false) || empty($arr)) {
33853388
echo "Error: unable to fetch futures exchange info" . PHP_EOL;
33863389
$arr = array();
@@ -3415,21 +3418,20 @@ public function futuresExchangeInfo()
34153418
* @return array with error message or array of market depth
34163419
* @throws \Exception
34173420
*/
3418-
public function futuresDepth(string $symbol, int $limit = null)
3421+
public function futuresDepth(string $symbol, int $limit = null, array $params = [])
34193422
{
34203423
if (isset($symbol) === false || is_string($symbol) === false) {
34213424
// WPCS: XSS OK.
34223425
echo "asset: expected bool false, " . gettype($symbol) . " given" . PHP_EOL;
34233426
}
34243427

3425-
$params = [
3428+
$request = [
34263429
'symbol' => $symbol,
3427-
'fapi' => true,
34283430
];
34293431
if ($limit) {
3430-
$params['limit'] = $limit;
3432+
$request['limit'] = $limit;
34313433
}
3432-
$json = $this->httpRequest("v1/depth", "GET", $params);
3434+
$json = $this->futuresRequest("v1/depth", "GET", array_merge($request, $params));
34333435
if (is_array($json) === false) {
34343436
echo "Error: unable to fetch futures depth" . PHP_EOL;
34353437
$json = [];
@@ -3461,16 +3463,15 @@ public function futuresDepth(string $symbol, int $limit = null)
34613463
* @return array containing the response
34623464
* @throws \Exception
34633465
*/
3464-
public function futuresRecentTrades(string $symbol, int $limit = null)
3466+
public function futuresRecentTrades(string $symbol, int $limit = null, array $params = [])
34653467
{
3466-
$parameters = [
3468+
$request = [
34673469
'symbol' => $symbol,
3468-
'fapi' => true,
34693470
];
34703471
if ($limit) {
3471-
$parameters['limit'] = $limit;
3472+
$request['limit'] = $limit;
34723473
}
3473-
return $this->httpRequest("v1/trades", "GET", $parameters);
3474+
return $this->futuresRequest("v1/trades", "GET", array_merge($request, $params));
34743475
}
34753476

34763477
/**
@@ -3489,19 +3490,18 @@ public function futuresRecentTrades(string $symbol, int $limit = null)
34893490
* @return array containing the response
34903491
* @throws \Exception
34913492
*/
3492-
public function futuresHistoricalTrades(string $symbol, int $limit = null, int $tradeId = null)
3493+
public function futuresHistoricalTrades(string $symbol, $limit = null, $tradeId = null, array $params = [])
34933494
{
3494-
$parameters = [
3495+
$request = [
34953496
'symbol' => $symbol,
3496-
'fapi' => true,
34973497
];
34983498
if ($limit) {
3499-
$parameters['limit'] = $limit;
3499+
$request['limit'] = $limit;
35003500
}
35013501
if ($tradeId) {
3502-
$parameters['fromId'] = $tradeId;
3502+
$request['fromId'] = $tradeId;
35033503
}
3504-
return $this->httpRequest("v1/historicalTrades", "GET", $parameters, true);
3504+
return $this->futuresRequest("v1/historicalTrades", "GET", array_merge($request, $params), true);
35053505
}
35063506

35073507
/**
@@ -3522,25 +3522,24 @@ public function futuresHistoricalTrades(string $symbol, int $limit = null, int $
35223522
* @return array with error message or array of market history
35233523
* @throws \Exception
35243524
*/
3525-
public function futuresAggTrades(string $symbol, int $fromId = null, int $startTime = null, int $endTime = null, int $limit = null)
3525+
public function futuresAggTrades(string $symbol, int $fromId = null, int $startTime = null, int $endTime = null, int $limit = null, array $params = [])
35263526
{
3527-
$parameters = [
3527+
$request = [
35283528
'symbol' => $symbol,
3529-
'fapi' => true,
35303529
];
35313530
if ($fromId) {
3532-
$parameters['fromId'] = $fromId;
3531+
$request['fromId'] = $fromId;
35333532
}
35343533
if ($startTime) {
3535-
$parameters['startTime'] = $startTime;
3534+
$request['startTime'] = $startTime;
35363535
}
35373536
if ($endTime) {
3538-
$parameters['endTime'] = $endTime;
3537+
$request['endTime'] = $endTime;
35393538
}
35403539
if ($limit) {
3541-
$parameters['limit'] = $limit;
3540+
$request['limit'] = $limit;
35423541
}
3543-
return $this->tradesData($this->httpRequest("v1/aggTrades", "GET", $parameters));
3542+
return $this->tradesData($this->futuresRequest("v1/aggTrades", "GET", array_merge($request, $params)));
35443543
}
35453544

35463545
/**

0 commit comments

Comments
 (0)