Skip to content

Commit 8a7ea44

Browse files
author
Jon Eyrick
authored
Add limit parameter for market depth method by s-mohammad-dabir
2 parents db16200 + 296b80c commit 8a7ea44

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

php-binance-api.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -723,17 +723,21 @@ public function aggTrades(string $symbol)
723723
* $depth = $api->depth("ETHBTC");
724724
*
725725
* @param $symbol string the symbol to get the depth information for
726+
* @param $limit int set limition for number of market depth data
726727
* @return array with error message or array of market depth
727728
* @throws \Exception
728729
*/
729-
public function depth(string $symbol)
730+
public function depth(string $symbol, int $limit)
730731
{
732+
if (isset($limit) === false || is_int($limit) === false)
733+
$limit = 100;
731734
if (isset($symbol) === false || is_string($symbol) === false) {
732735
// WPCS: XSS OK.
733736
echo "asset: expected bool false, " . gettype($symbol) . " given" . PHP_EOL;
734737
}
735738
$json = $this->httpRequest("v1/depth", "GET", [
736739
"symbol" => $symbol,
740+
"limit" => $limit,
737741
]);
738742
if (isset($this->info[$symbol]) === false) {
739743
$this->info[$symbol] = [];

0 commit comments

Comments
 (0)