From a47a83230515e18f88013edd51843934f0d8f934 Mon Sep 17 00:00:00 2001 From: Alexandru Cobuz Date: Mon, 30 Oct 2017 13:20:16 +0200 Subject: [PATCH] Added getOrderBook - added getOrderBook method to be able to get available orders in the market. - disabled SSL validation to speed up the REST call, this reduces about 30 ms from the request --- src/Hitbtc/PublicClient.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Hitbtc/PublicClient.php b/src/Hitbtc/PublicClient.php index 4ac08e3..bb6fb2e 100644 --- a/src/Hitbtc/PublicClient.php +++ b/src/Hitbtc/PublicClient.php @@ -26,6 +26,7 @@ public function getHttpClient() if (!$this->httpClient) { $this->httpClient = new HttpClient([ 'base_uri' => $this->host, + 'verify' => false ]); } @@ -42,4 +43,15 @@ public function getTickers() { return json_decode($this->getHttpClient()->get('/api/1/public/ticker')->getBody(), true); } + + /* + * Get list of an active order book in the market + * + * @param string $ticker + * return @array + */ + public function getOderBook($ticker) + { + return json_decode($this->getHttpClient()->get('/api/1/public/'.$ticker.'/orderbook')->getBody(), true); + } }