Example #1
0
 public function getQuote($base, $target)
 {
     if ($base !== 'USD') {
         throw new Exception("Only a base of USD is supported", 1);
     }
     if ($target !== 'BTC') {
         throw new Exception("Only a target of BTC is supported", 1);
     }
     $transport = new Http();
     $result = $transport->getJSON('https://www.bitstamp.net/api/ticker/');
     return $this->transformResult($result);
 }
 public function getQuote($base, $target)
 {
     if ($base !== 'USD') {
         throw new Exception("Only a base of USD is supported", 1);
     }
     if ($target !== 'BTC') {
         throw new Exception("Only a target of BTC is supported", 1);
     }
     $transport = new Http();
     $result = $transport->getJSON('https://api.bitcoinaverage.com/ticker/global/USD/');
     return $this->transformResult($result);
 }
Example #3
0
 public function getQuotes($currency_pairs)
 {
     $transport = new Http();
     $result = $transport->getJSON('https://poloniex.com/public?command=returnTicker');
     return $this->transformResult($result, $currency_pairs);
 }