File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ] = [];
You can’t perform that action at this time.
0 commit comments