Skip to content

Commit

Permalink
Add limit parameter for market depth method by s-mohammad-dabir
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Eyrick authored Feb 9, 2019
2 parents db16200 + 296b80c commit 8a7ea44
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion php-binance-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -723,17 +723,21 @@ public function aggTrades(string $symbol)
* $depth = $api->depth("ETHBTC");
*
* @param $symbol string the symbol to get the depth information for
* @param $limit int set limition for number of market depth data
* @return array with error message or array of market depth
* @throws \Exception
*/
public function depth(string $symbol)
public function depth(string $symbol, int $limit)
{
if (isset($limit) === false || is_int($limit) === false)
$limit = 100;
if (isset($symbol) === false || is_string($symbol) === false) {
// WPCS: XSS OK.
echo "asset: expected bool false, " . gettype($symbol) . " given" . PHP_EOL;
}
$json = $this->httpRequest("v1/depth", "GET", [
"symbol" => $symbol,
"limit" => $limit,
]);
if (isset($this->info[$symbol]) === false) {
$this->info[$symbol] = [];
Expand Down

0 comments on commit 8a7ea44

Please sign in to comment.