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
Modifier and Type Method Description CoinbasePrice
getCoinbaseBuyPrice(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.CoinbasePrice
getCoinbaseHistoricalSpotRate(Currency base, Currency counter, Date date)
Unauthenticated resource that tells you the current price of one unit.CoinbasePrice
getCoinbaseSellPrice(Currency base, Currency counter)
Unauthenticated resource that tells you the amount you can get if you sell one unit.CoinbasePrice
getCoinbaseSpotRate(Currency base, Currency counter)
Unauthenticated resource that tells you the current price of one unit.OrderBook
getOrderBook(CurrencyPair currencyPair, Object... args)
Get an order book representing the current offered exchange rates (market depth)Ticker
getTicker(CurrencyPair pair, Object... args)
Get a ticker representing the current exchange rateTrades
getTrades(CurrencyPair currencyPair, Object... args)
Get the trades recently performed by the exchangeMethods inherited from class org.knowm.xchange.coinbase.v2.service.CoinbaseBaseService
getCoinbaseCurrencies, getCoinbaseTime, getSignature, showCurl
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, getTickers, getTrades, getTrades
-
Constructor Details
-
CoinbaseMarketDataService
-
-
Method Details
-
getTicker
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 data
-
getOrderBook
Description copied from interface:MarketDataService
Get an order book representing the current offered exchange rates (market depth)- Specified by:
getOrderBook
in interfaceMarketDataService
args
- Optional arguments. Exchange-specific- Returns:
- The OrderBook, null if some sort of error occurred. Implementers should log the error.
-
getTrades
Description copied from interface:MarketDataService
Get the trades recently performed by the exchange- Specified by:
getTrades
in interfaceMarketDataService
args
- Optional arguments. Exchange-specific- Returns:
- The Trades, null if some sort of error occurred. Implementers should log the error.
-
getCoinbaseExchangeRates
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
Unauthenticated resource that tells you the price to buy one unit.- Parameters:
pair
- The currency pair.- Returns:
- The price in the desired
currency
to buy one unit. - Throws:
IOException
- See Also:
- developers.coinbase.com/api/v2#get-buy-price
-
getCoinbaseSellPrice
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
currency
to sell one unit. - Throws:
IOException
- See Also:
- developers.coinbase.com/api/v2#get-sell-price
-
getCoinbaseSpotRate
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
currency
for 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 IOExceptionUnauthenticated 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
currency
ont the givedate
for one unit. - Throws:
IOException
- See Also:
- developers.coinbase.com/api/v2#get-spot-price
-