class Exchange \ Bit2c

All implemented interfaces:
Exchange, ExchangeInformation

Implements some basic implementations of an Exchange. Assumes there is a single API call that can be used to list all exchanges and get all rates - #fetchAllRates(). (from SimpleExchange)

An Exchange does not provide conversion functionality; this can be done naively with #getLastTrade.

This is the base interface; other interfaces will provide additional functionality as necessary. (from Exchange)


Method Summary

Name Description
fetchAllRates(Logger $logger) Return a list of rates for each supported market, e.g. array(array('currency1' => 'usd', 'currency2' => 'btc', 'last_trade' => 1, 'bid' => 2), ...)
fetchMarkets(Logger $logger) Bit2c does not have any API to list all available markets, so we hardcode this. Does not block.
getBit2cCode($str)
getCode()
getName()
getURL()

Inherited Method Summary

Name Description
fetchAsk($currency1, $currency2, Logger $logger) Get the lowest price that a seller is willing to accept for trading the given pair (also known as the buy price), or null if there is none. (from SimpleExchange)
fetchBid($currency1, $currency2, Logger $logger) Get the highest price that a buyer is willing to accept for trading the given pair (also known as the sell price), or null if there is none. (from SimpleExchange)
fetchLastTrade($currency1, $currency2, Logger $logger) Get the last traded value for the given currency pair, or null if there is none. (from SimpleExchange)
fetchRates($currency1, $currency2, Logger $logger) Fetch all rates for a given currency, returns an array of (last_trade, bid, ask, volume). Some fields may not be present for a given exchange. volume is the last 24h volume. May also return additional fields. (from SimpleExchange)
throttle(Logger $logger) This allows all exchanges to optionally throttle multiple repeated requests based on a runtime configuration value. The throttle time is selected from either the exchanges_NAME_throttle or exchanges_throttle config values, or three seconds; which is the time in seconds to wait between repeated requests. (from SimpleExchange)

public function fetchAllRates(Logger $logger)

Return a list of rates for each supported market, e.g. array(array('currency1' => 'usd', 'currency2' => 'btc', 'last_trade' => 1, 'bid' => 2), ...) (from fetchAllRates)

See:
fetchRates($currency1, $currency2, Logger $logger)

public function fetchMarkets(Logger $logger)

Bit2c does not have any API to list all available markets, so we hardcode this. Does not block.

Overrides:
fetchMarkets(Logger $logger)
Returns:
an array of (from, to) 3-character Currency codes

public function getBit2cCode($str)


public function getCode()

Returns:
a unique string representing this exchange; must be lowercase and 1-32 characters

public function getName()

Returns:
the full name of the exchange

public function getURL()

Returns:
the URL of the exchange, or null