diff --git a/index.php b/index.php index 96370ad..fbb2bfb 100644 --- a/index.php +++ b/index.php @@ -13,5 +13,13 @@ //$pos = $bitmex->orderBook()->get(['symbol' => 'XBTUSD', 'depth' => 1]); -$pos = $bitmex->user()->getWallet(['currency' => 'XBt']); +$pos = $bitmex->order()->get([ + 'symbol' => 'XBTUSD', + 'count' => 100, + 'reverse' => true, + 'filter' => json_encode([ + 'ordType' => 'StopLimit', + 'ordStatus' => 'Filled', + ]), +]); var_dump($pos); \ No newline at end of file diff --git a/src/Api/Order.php b/src/Api/Order.php index 5574419..988fddf 100644 --- a/src/Api/Order.php +++ b/src/Api/Order.php @@ -32,10 +32,11 @@ public function get(array $data=[]){ $data['reverse']=$data['reverse'] ?? 'true'; $data['symbol']=$data['symbol'] ?? 'XBTUSD'; $data['count']=$data['count'] ?? '100'; + $data['filter'] = isset($data['filter']) ? $data['filter'] : null; - $this->path='/api/v1/order?reverse='.$data['reverse'].'&symbol='.$data['symbol'].'&count='.$data['count']; + $this->path='/api/v1/order?'.http_build_query($data); - + var_dump($this->path); //$this->data=$data;