/** * Returns a list of most recently executed trades for a given currency pair. * @note This method caches return values for 1 second. Calling it more than once per second * will result in cached data being returned. * @param string $primaryCurrencyCode The digital currency for which to retrieve recent trades. * Must be a valid primary currency, which can be checked via the * getValidPrimaryCurrencyCodes() method. * @param string $secondaryCurrencyCode The fiat currency in which to retrieve recent trades. * Must be a valid secondary currency, which can be checked via the * getValidPrimaryCurrencyCodes() method. * @param integer $numberOfRecentTradesToRetrieve How many recent trades to retrieve (maximum * is 50). * @return RecentTrades */ public function getRecentTrades($primaryCurrencyCode, $secondaryCurrencyCode, $numberOfRecentTradesToRetrieve) { return RecentTrades::createFromObject($this->getEndpoint('GetRecentTrades', ['primaryCurrencyCode' => $primaryCurrencyCode, 'secondaryCurrencyCode' => $secondaryCurrencyCode, 'numberOfRecentTradesToRetrieve' => $numberOfRecentTradesToRetrieve])); }
public function setUp() { parent::setUp(); $obj = (object) ["CreatedTimestampUtc" => "2014-08-05T09:14:39.4830696Z", "PrimaryCurrencyCode" => "Xbt", "SecondaryCurrencyCode" => "Usd", "Trades" => [(object) ["PrimaryCurrencyAmount" => 1.0, "SecondaryCurrencyTradePrice" => 510.0, "TradeTimestampUtc" => "2014-07-31T10:34:05.935412Z"], (object) ["PrimaryCurrencyAmount" => 0.01, "SecondaryCurrencyTradePrice" => 501.0, "TradeTimestampUtc" => "2014-07-31T10:33:24.8458426Z"]]]; $this->recentTrades = RecentTrades::createFromObject($obj); }