Class GateioStreamingMarketDataService

java.lang.Object
GateioStreamingMarketDataService
All Implemented Interfaces:
StreamingMarketDataService

public class GateioStreamingMarketDataService extends Object implements StreamingMarketDataService
Author: Max Gao (gaamox@tutanota.com) Created: 05-05-2021
  • Constructor Details

  • Method Details

    • getOrderBook

      public io.reactivex.Observable<OrderBook> getOrderBook(CurrencyPair currencyPair, Object... args)
      Uses the limited-level snapshot method: https://www.gate.io/docs/apiv4/ws/index.html#limited-level-full-order-book-snapshot
      Specified by:
      getOrderBook in interface StreamingMarketDataService
      Parameters:
      currencyPair - Currency pair of the order book
      args - Optional maxDepth, Optional msgInterval
      Returns:
    • getTicker

      public io.reactivex.Observable<Ticker> getTicker(CurrencyPair currencyPair, Object... args)
      Description copied from interface: StreamingMarketDataService
      Get a ticker representing the current exchange rate. Emits NotConnectedException When not connected to the WebSocket API.

      Warning: There are currently no guarantees that messages will not be skipped, or that any initial state message will be sent on connection.

      Specified by:
      getTicker in interface StreamingMarketDataService
      Parameters:
      currencyPair - Currency pair of the ticker
      Returns:
      Observable that emits Ticker when exchange sends the update.
    • getTrades

      public io.reactivex.Observable<Trade> getTrades(CurrencyPair currencyPair, Object... args)
      Description copied from interface: StreamingMarketDataService
      Get the trades performed by the exchange. Emits NotConnectedException When not connected to the WebSocket API.

      Warning: There are currently no guarantees that messages will not be skipped.

      Specified by:
      getTrades in interface StreamingMarketDataService
      Parameters:
      currencyPair - Currency pair of the trades
      Returns:
      Observable that emits Trade when exchange sends the update.