Class CoinbaseMarketDataService
- java.lang.Object
-
- org.knowm.xchange.service.BaseExchangeService
-
- org.knowm.xchange.coinbase.v2.service.CoinbaseBaseService
-
- org.knowm.xchange.coinbase.v2.service.CoinbaseMarketDataService
-
- All Implemented Interfaces:
BaseService,MarketDataService
public class CoinbaseMarketDataService extends CoinbaseBaseService implements MarketDataService
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.knowm.xchange.coinbase.v2.service.CoinbaseBaseService
CoinbaseBaseService.HttpMethod
-
-
Field Summary
-
Fields inherited from class org.knowm.xchange.coinbase.v2.service.CoinbaseBaseService
coinbase, signatureCreator2
-
Fields inherited from class org.knowm.xchange.service.BaseExchangeService
exchange
-
-
Constructor Summary
Constructors Constructor Description CoinbaseMarketDataService(Exchange exchange)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CoinbasePricegetCoinbaseBuyPrice(Currency base, Currency counter)Unauthenticated resource that tells you the price to buy one unit.Map<String,BigDecimal>getCoinbaseExchangeRates()Unauthenticated resource that returns BTC to fiat (and vice versus) exchange rates in various currencies.CoinbasePricegetCoinbaseHistoricalSpotRate(Currency base, Currency counter, Date date)Unauthenticated resource that tells you the current price of one unit.CoinbasePricegetCoinbaseSellPrice(Currency base, Currency counter)Unauthenticated resource that tells you the amount you can get if you sell one unit.CoinbasePricegetCoinbaseSpotRate(Currency base, Currency counter)Unauthenticated resource that tells you the current price of one unit.OrderBookgetOrderBook(CurrencyPair currencyPair, Object... args)TickergetTicker(CurrencyPair pair, Object... args)TradesgetTrades(CurrencyPair currencyPair, Object... args)-
Methods inherited from class org.knowm.xchange.coinbase.v2.service.CoinbaseBaseService
getCoinbaseCurrencies, getCoinbaseTime, getSignature, showCurl
-
Methods inherited from class org.knowm.xchange.service.BaseExchangeService
getClientConfig, 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
getTickers
-
-
-
-
Constructor Detail
-
CoinbaseMarketDataService
public CoinbaseMarketDataService(Exchange exchange)
-
-
Method Detail
-
getTicker
public Ticker getTicker(CurrencyPair pair, Object... args) throws IOException
- Specified by:
getTickerin interfaceMarketDataService- Throws:
IOException
-
getOrderBook
public OrderBook getOrderBook(CurrencyPair currencyPair, Object... args)
- Specified by:
getOrderBookin interfaceMarketDataService
-
getTrades
public Trades getTrades(CurrencyPair currencyPair, Object... args)
- Specified by:
getTradesin interfaceMarketDataService
-
getCoinbaseExchangeRates
public Map<String,BigDecimal> getCoinbaseExchangeRates() throws IOException
Unauthenticated resource that returns BTC to fiat (and vice versus) exchange rates in various currencies.- Returns:
- Map of lower case directional currency pairs, i.e. btc_to_xxx and xxx_to_btc, to exchange rates.
- Throws:
IOException- See Also:
- developers.coinbase.com/api/v2#exchange-rates
-
getCoinbaseBuyPrice
public CoinbasePrice getCoinbaseBuyPrice(Currency base, Currency counter) throws IOException
Unauthenticated resource that tells you the price to buy one unit.- Parameters:
pair- The currency pair.- Returns:
- The price in the desired
currencyto buy one unit. - Throws:
IOException- See Also:
- developers.coinbase.com/api/v2#get-buy-price
-
getCoinbaseSellPrice
public CoinbasePrice getCoinbaseSellPrice(Currency base, Currency counter) throws IOException
Unauthenticated resource that tells you the amount you can get if you sell one unit.- Parameters:
pair- The currency pair.- Returns:
- The price in the desired
currencyto sell one unit. - Throws:
IOException- See Also:
- developers.coinbase.com/api/v2#get-sell-price
-
getCoinbaseSpotRate
public CoinbasePrice getCoinbaseSpotRate(Currency base, Currency counter) throws IOException
Unauthenticated resource that tells you the current price of one unit. This is usually somewhere in between the buy and sell price, current to within a few minutes.- Parameters:
pair- The currency pair.- Returns:
- The price in the desired
currencyfor one unit. - Throws:
IOException- See Also:
- developers.coinbase.com/api/v2#get-spot-price
-
getCoinbaseHistoricalSpotRate
public CoinbasePrice getCoinbaseHistoricalSpotRate(Currency base, Currency counter, Date date) throws IOException
Unauthenticated resource that tells you the current price of one unit. This is usually somewhere in between the buy and sell price, current to within a few minutes.- Parameters:
pair- The currency pair.date- The given date.- Returns:
- The price in the desired
currencyont the givedatefor one unit. - Throws:
IOException- See Also:
- developers.coinbase.com/api/v2#get-spot-price
-
-