diff --git a/php-binance-api.php b/php-binance-api.php index d7da6fb6..04e406a3 100644 --- a/php-binance-api.php +++ b/php-binance-api.php @@ -470,15 +470,19 @@ public function account() { } /** - * prevDay get 24hr ticker price change statistics for a symbol + * prevDay get 24hr ticker price change statistics for symbols * * $prevDay = $api->prevDay("BNBBTC"); * - * @param $symbol the symbol to get the previous day change for + * @param $symbol (optional) symbol to get the previous day change for * @return array with error message or array of prevDay change */ - public function prevDay($symbol) { - return $this->httpRequest("v1/ticker/24hr", "GET", ["symbol"=>$symbol]); + public function prevDay($symbol = '') { + $additionalData = []; + if(!empty($symbol)){ + $additionalData = ['symbol' => $symbol]; + } + return $this->httpRequest("v1/ticker/24hr", "GET", $additionalData); } /**