Skip to content

Commit

Permalink
public client guzzle6
Browse files Browse the repository at this point in the history
  • Loading branch information
toooni committed Jul 11, 2017
1 parent 3248725 commit ba5d336
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Hitbtc/PublicClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function getHttpClient()
{
if (!$this->httpClient) {
$this->httpClient = new HttpClient([
'base_url' => $this->host,
'base_uri' => $this->host,
]);
}

Expand All @@ -34,7 +34,12 @@ public function getHttpClient()

public function getTicker($ticker)
{
return $this->getHttpClient()->get('/api/1/public/'.$ticker.'/ticker')->json();
return json_decode($this->getHttpClient()->get('/api/1/public/'.$ticker.'/ticker')->getBody(), true);
}


public function getTickers()
{
return json_decode($this->getHttpClient()->get('/api/1/public/ticker')->getBody(), true);
}
}

0 comments on commit ba5d336

Please sign in to comment.