Class CoinbaseProStreamingMarketDataService
java.lang.Object
info.bitrich.xchangestream.coinbasepro.CoinbaseProStreamingMarketDataService
- All Implemented Interfaces:
StreamingMarketDataService
public class CoinbaseProStreamingMarketDataService
extends Object
implements StreamingMarketDataService
Created by luca on 4/3/17.
-
Method Summary
Modifier and TypeMethodDescriptionio.reactivex.rxjava3.core.Observable<OrderBook>getOrderBook(CurrencyPair currencyPair, Object... args) Get an order book representing the current offered exchange rates (market depth).io.reactivex.rxjava3.core.Observable<CoinbaseProProductTicker>getRawTicker(CurrencyPair currencyPair, Object... args) Returns an Observable ofCoinbaseProProductTicker, not converted toTickerio.reactivex.rxjava3.core.Observable<CoinbaseProWebSocketTransaction>getRawWebSocketTransactions(CurrencyPair currencyPair, boolean filterChannelName) Web socket transactions related to the specified currency, in their raw format.io.reactivex.rxjava3.core.Observable<Ticker>getTicker(CurrencyPair currencyPair, Object... args) Returns the CoinbasePro ticker converted to the normalized XChange object.io.reactivex.rxjava3.core.Observable<Trade>getTrades(CurrencyPair currencyPair, Object... args) Get the trades performed by the exchange.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface info.bitrich.xchangestream.core.StreamingMarketDataService
getFundingRate, getFundingRates, getOrderBook, getOrderBookUpdates, getTicker, getTrades
-
Method Details
-
getOrderBook
public io.reactivex.rxjava3.core.Observable<OrderBook> getOrderBook(CurrencyPair currencyPair, Object... args) Description copied from interface:StreamingMarketDataServiceGet an order book representing the current offered exchange rates (market depth).Warning: The library will attempt to keep the snapshots returned in sync with the exchange using the approaches published by that exchange. However, there are currently no guarantees that messages will not be skipped, or that any initial state message will be sent on connection. Emits
NotConnectedExceptionwhen not connected to the WebSocket API.- Specified by:
getOrderBookin interfaceStreamingMarketDataService- Parameters:
currencyPair- Currency pair of the order book- Returns:
Observablethat emitsOrderBookwhen exchange sends the update.
-
getRawTicker
public io.reactivex.rxjava3.core.Observable<CoinbaseProProductTicker> getRawTicker(CurrencyPair currencyPair, Object... args) Returns an Observable ofCoinbaseProProductTicker, not converted toTicker- Parameters:
currencyPair- the currency pair.args- optional arguments.- Returns:
- an Observable of
CoinbaseProProductTicker.
-
getTicker
public io.reactivex.rxjava3.core.Observable<Ticker> getTicker(CurrencyPair currencyPair, Object... args) Returns the CoinbasePro ticker converted to the normalized XChange object. CoinbasePro does not directly provide ticker data via web service. As stated by: https://docs.coinbasepro.com/#get-product-ticker, we can just listen for 'match' messages.- Specified by:
getTickerin interfaceStreamingMarketDataService- Parameters:
currencyPair- Currency pair of the tickerargs- optional parameters.- Returns:
- an Observable of normalized Ticker objects.
-
getTrades
public io.reactivex.rxjava3.core.Observable<Trade> getTrades(CurrencyPair currencyPair, Object... args) Description copied from interface:StreamingMarketDataServiceGet the trades performed by the exchange. EmitsNotConnectedExceptionWhen not connected to the WebSocket API.Warning: There are currently no guarantees that messages will not be skipped.
- Specified by:
getTradesin interfaceStreamingMarketDataService- Parameters:
currencyPair- Currency pair of the trades- Returns:
Observablethat emitsTradewhen exchange sends the update.
-
getRawWebSocketTransactions
public io.reactivex.rxjava3.core.Observable<CoinbaseProWebSocketTransaction> getRawWebSocketTransactions(CurrencyPair currencyPair, boolean filterChannelName) Web socket transactions related to the specified currency, in their raw format.- Parameters:
currencyPair- The currency pair.- Returns:
- The stream.
-