Class CoinbaseMarketDataService
java.lang.Object
org.knowm.xchange.service.BaseExchangeService
org.knowm.xchange.coinbase.service.CoinbaseBaseService
org.knowm.xchange.coinbase.service.CoinbaseMarketDataService
- All Implemented Interfaces:
BaseService
,MarketDataService
- Author:
- jamespedwards42
-
Field Summary
Fields inherited from class org.knowm.xchange.coinbase.service.CoinbaseBaseService
coinbase, signatureCreator
Fields inherited from class org.knowm.xchange.service.BaseExchangeService
exchange
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionUnauthenticated resource that tells you the total price in USD to buy 1 Bitcoin.getCoinbaseBuyPrice
(BigDecimal quantity) Unauthenticated resource that tells you the total price in USD to buy some quantity of Bitcoin.getCoinbaseBuyPrice
(BigDecimal quantity, String currency) Unauthenticated resource that tells you the total price to buy some quantity of Bitcoin.Unauthenticated resource that returns BTC to fiat (and vice versus) exchange rates in various currencies.Unauthenticated resource that displays historical spot rates for Bitcoin in USD.Unauthenticated resource that displays historical spot rates for Bitcoin in USD.Unauthenticated resource that tells you the total amount in USD you can get if you sell 1 Bitcoin.getCoinbaseSellPrice
(BigDecimal quantity) Unauthenticated resource that tells you the total amount in USD you can get if you sell some quantity Bitcoin.getCoinbaseSellPrice
(BigDecimal quantity, String currency) Unauthenticated resource that tells you the total amount you can get if you sell some quantity Bitcoin.getCoinbaseSpotRate
(String currency) Unauthenticated resource that tells you the current price of Bitcoin.getOrderBook
(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 rategetTrades
(CurrencyPair currencyPair, Object... args) Get the trades recently performed by the exchangeMethods inherited from class org.knowm.xchange.coinbase.service.CoinbaseBaseService
createCoinbaseToken, createCoinbaseUser, createCoinbaseUser, getCoinbaseCurrencies, handleResponse
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
Constructor- Parameters:
exchange
-
-
-
Method Details
-
getTicker
Description copied from interface:MarketDataService
Get a ticker representing the current exchange rate- Specified by:
getTicker
in interfaceMarketDataService
- Parameters:
args
- Optional Boolean. If true an additional call to retrieve the spot price history will be made and used to populate the 24 hour high and low values for the Ticker.- Returns:
- A Ticker with Coinbase's current buy price as the best ask, sell price as the best bid, spot price as the last value, and can optionally use the spot price history to find the 24 hour high and low.
- 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
- Parameters:
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
- Parameters:
args
- Optional arguments. Exchange-specific- Returns:
- The Trades, null if some sort of error occurred. Implementers should log the error.
-
getCoinbaseCurrencyExchangeRates
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:
-
getCoinbaseBuyPrice
Unauthenticated resource that tells you the total price in USD to buy 1 Bitcoin.- Returns:
- The price to buy 1 BTC.
- Throws:
IOException
- See Also:
-
getCoinbaseBuyPrice
Unauthenticated resource that tells you the total price in USD to buy some quantity of Bitcoin.- Parameters:
quantity
- The quantity of Bitcoin you would like to buy (default is 1 if null).- Returns:
- The price to buy the given
quantity
BTC. - Throws:
IOException
- See Also:
-
getCoinbaseBuyPrice
Unauthenticated resource that tells you the total price to buy some quantity of Bitcoin.- Parameters:
quantity
- The quantity of Bitcoin you would like to buy (default is 1 if null).currency
- Default is USD. Right now this is the only value allowed.- Returns:
- The price in the desired
currency
to buy the givenquantity
BTC. - Throws:
IOException
- See Also:
-
getCoinbaseSellPrice
Unauthenticated resource that tells you the total amount in USD you can get if you sell 1 Bitcoin.- Returns:
- The price to sell 1 BTC.
- Throws:
IOException
- See Also:
-
getCoinbaseSellPrice
Unauthenticated resource that tells you the total amount in USD you can get if you sell some quantity Bitcoin.- Parameters:
quantity
- The quantity of Bitcoin you would like to sell (default is 1 if null).- Returns:
- The price to sell the given
quantity
BTC. - Throws:
IOException
- See Also:
-
getCoinbaseSellPrice
Unauthenticated resource that tells you the total amount you can get if you sell some quantity Bitcoin.- Parameters:
quantity
- The quantity of Bitcoin you would like to sell (default is 1 if null).currency
- Default is USD. Right now this is the only value allowed.- Returns:
- The price in the desired
currency
to sell the givenquantity
BTC. - Throws:
IOException
- See Also:
-
getCoinbaseSpotRate
Unauthenticated resource that tells you the current price of Bitcoin. This is usually somewhere in between the buy and sell price, current to within a few minutes.- Parameters:
currency
- ISO 4217 currency code. Default is USD if null.- Returns:
- Throws:
IOException
- See Also:
-
getCoinbaseHistoricalSpotRates
Unauthenticated resource that displays historical spot rates for Bitcoin in USD. This is a paged resource and will return the first page by default.- Returns:
- One thousand historical spot prices representing page 1.
- Throws:
IOException
- See Also:
-
getCoinbaseHistoricalSpotRates
Unauthenticated resource that displays historical spot rates for Bitcoin in USD.- Parameters:
page
- Optional parameter to request a desired page of results. Will return page 1 if the supplied page is null or less than 1.- Returns:
- One thousand historical spot prices for the given page.
- Throws:
IOException
-