Class CoinbaseProMarketDataService
java.lang.Object
org.knowm.xchange.service.BaseExchangeService<E>
org.knowm.xchange.service.BaseResilientExchangeService<CoinbaseProExchange>
org.knowm.xchange.coinbasepro.service.CoinbaseProBaseService
org.knowm.xchange.coinbasepro.service.CoinbaseProMarketDataServiceRaw
org.knowm.xchange.coinbasepro.service.CoinbaseProMarketDataService
- All Implemented Interfaces:
BaseService
,MarketDataService
public class CoinbaseProMarketDataService
extends CoinbaseProMarketDataServiceRaw
implements MarketDataService
-
Field Summary
Fields inherited from class org.knowm.xchange.coinbasepro.service.CoinbaseProBaseService
apiKey, coinbasePro, digest, passphrase
Fields inherited from class org.knowm.xchange.service.BaseResilientExchangeService
resilienceRegistries
Fields inherited from class org.knowm.xchange.service.BaseExchangeService
exchange
-
Constructor Summary
ConstructorsConstructorDescriptionCoinbaseProMarketDataService
(CoinbaseProExchange exchange, ResilienceRegistries resilienceRegistries) -
Method Summary
Modifier and TypeMethodDescriptiongetOrderBook
(CurrencyPair currencyPair, Object... args) Get an order book representing the current offered exchange rates (market depth)getTicker
(CurrencyPair currencyPair, Object... args) Get a ticker representing the current exchange rategetTickers
(Params params) Get the tickers representing the current exchange rate for the provided parametersgetTrades
(CurrencyPair currencyPair, Object... args) Get trades data for a specific currency pairMethods inherited from class org.knowm.xchange.coinbasepro.service.CoinbaseProMarketDataServiceRaw
checkProductExists, getCoinbaseProCurrencies, getCoinbaseProHistoricalCandles, getCoinbaseProProductOrderBook, getCoinbaseProProducts, getCoinbaseProProductStats, getCoinbaseProProductTicker, getCoinbaseProStats, getCoinbaseProTrades, getCoinbaseProTradesExtended
Methods inherited from class org.knowm.xchange.coinbasepro.service.CoinbaseProBaseService
handleError
Methods inherited from class org.knowm.xchange.service.BaseResilientExchangeService
decorateApiCall, rateLimiter, rateLimiter, retry, retry
Methods inherited from class org.knowm.xchange.service.BaseExchangeService
verifyOrder, verifyOrder, verifyOrder
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.knowm.xchange.service.marketdata.MarketDataService
getCandleStickData, getFundingRate, getFundingRates, getOrderBook, getOrderBook, getTicker, getTrades, getTrades
-
Constructor Details
-
CoinbaseProMarketDataService
public CoinbaseProMarketDataService(CoinbaseProExchange exchange, ResilienceRegistries resilienceRegistries)
-
-
Method Details
-
getTicker
public Ticker getTicker(CurrencyPair currencyPair, Object... args) throws IOException, RateLimitExceededException Description copied from interface:MarketDataService
Get a ticker representing the current exchange rate- Specified by:
getTicker
in interfaceMarketDataService
- Returns:
- The Ticker, null if some sort of error occurred. Implementers should log the error.
- Throws:
IOException
- - Indication that a networking error occurred while fetching JSON dataRateLimitExceededException
-
getTickers
Description copied from interface:MarketDataService
Get the tickers representing the current exchange rate for the provided parameters- Specified by:
getTickers
in interfaceMarketDataService
- Returns:
- The Tickers, null if some sort of error occurred. Implementers should log the error.
- Throws:
IOException
- - Indication that a networking error occurred while fetching JSON dataRateLimitExceededException
-
getOrderBook
public OrderBook getOrderBook(CurrencyPair currencyPair, Object... args) throws IOException, RateLimitExceededException Description copied from interface:MarketDataService
Get an order book representing the current offered exchange rates (market depth)- Specified by:
getOrderBook
in interfaceMarketDataService
- Parameters:
args
- Optional arguments. Exchange-specific- Returns:
- The OrderBook, null if some sort of error occurred. Implementers should log the error.
- Throws:
IOException
- - Indication that a networking error occurred while fetching JSON dataRateLimitExceededException
-
getTrades
public Trades getTrades(CurrencyPair currencyPair, Object... args) throws IOException, RateLimitExceededException Get trades data for a specific currency pairIf invoked with only the currency pair, the method will make a single api call, returning the default number (currently 100) of the most recent trades. If invoked with either optional argument the other must be specified as well.
- Specified by:
getTrades
in interfaceMarketDataService
- Parameters:
currencyPair
- Currency pair to obtain trades for (required)args
- [0] fromTradeId (Long) Return Trades with tradeIds greater than or equal to this value. Additional values may be returned. (optional)args
- [1] toTradeId (Long) Return Trades with tradeIds up to but not including this value (optional)- Returns:
- A Trades object holding the requested trades
- Throws:
IOException
- - Indication that a networking error occurred while fetching JSON dataRateLimitExceededException
-