public function setUp() { parent::setUp(); $obj = (object) ["BuyOrders" => [(object) ["OrderType" => "LimitBid", "Price" => 497.02, "Volume" => 0.01], (object) ["OrderType" => "LimitBid", "Price" => 490.0, "Volume" => 1.0]], "CreatedTimestampUtc" => "2014-08-05T06:42:11.3032208Z", "PrimaryCurrencyCode" => "Xbt", "SecondaryCurrencyCode" => "Usd", "SellOrders" => [(object) ["OrderType" => "LimitOffer", "Price" => 500.0, "Volume" => 1.0], (object) ["OrderType" => "LimitOffer", "Price" => 505.0, "Volume" => 1.0]]]; $this->order = OrderBook::createFromObject($obj); }
/** * Returns the Order Book for a given currency pair. * @param string $primaryCurrencyCode The digital currency for which to retrieve order book. * Must be a valid primary currency, which can be checked via the * getValidPrimaryCurrencyCodes() method. * @param string $secondaryCurrencyCode The fiat currency in which to retrieve order book. Must * be a valid secondary currency, which can be checked via the * getValidSecondaryCurrencyCodes() method. * @return OrderBook */ public function getOrderBook($primaryCurrencyCode, $secondaryCurrencyCode) { return OrderBook::createFromObject($this->getEndpoint('GetOrderBook', ['primaryCurrencyCode' => $primaryCurrencyCode, 'secondaryCurrencyCode' => $secondaryCurrencyCode])); }