Commit 8a7ea44 Jon Eyrick
authored
File tree 1 file changed +5
-1
lines changed
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -723,17 +723,21 @@ public function aggTrades(string $symbol)
723
723
* $depth = $api->depth("ETHBTC");
724
724
*
725
725
* @param $symbol string the symbol to get the depth information for
726
+ * @param $limit int set limition for number of market depth data
726
727
* @return array with error message or array of market depth
727
728
* @throws \Exception
728
729
*/
729
- public function depth (string $ symbol )
730
+ public function depth (string $ symbol, int $ limit )
730
731
{
732
+ if (isset ($ limit ) === false || is_int ($ limit ) === false )
733
+ $ limit = 100 ;
731
734
if (isset ($ symbol ) === false || is_string ($ symbol ) === false ) {
732
735
// WPCS: XSS OK.
733
736
echo "asset: expected bool false, " . gettype ($ symbol ) . " given " . PHP_EOL ;
734
737
}
735
738
$ json = $ this ->httpRequest ("v1/depth " , "GET " , [
736
739
"symbol " => $ symbol ,
740
+ "limit " => $ limit ,
737
741
]);
738
742
if (isset ($ this ->info [$ symbol ]) === false ) {
739
743
$ this ->info [$ symbol ] = [];
You can’t perform that action at this time.
0 commit comments