Class BinanceMarketDataService

All Implemented Interfaces:
BaseService, MarketDataService

public class BinanceMarketDataService
extends BinanceMarketDataServiceRaw
implements MarketDataService
  • Constructor Details

  • Method Details

    • getOrderBook

      public OrderBook getOrderBook​(CurrencyPair pair, Object... args) throws IOException
      Description copied from interface: MarketDataService
      Get an order book representing the current offered exchange rates (market depth)
      Specified by:
      getOrderBook in interface MarketDataService
      args - Optional arguments. Exchange-specific
      Returns:
      The OrderBook, null if some sort of error occurred. Implementers should log the error.
      Throws:
      IOException - - Indication that a networking error occurred while fetching JSON data
    • convertOrderBook

      public static OrderBook convertOrderBook​(BinanceOrderbook ob, CurrencyPair pair)
    • getTicker

      public Ticker getTicker​(CurrencyPair pair, Object... args) throws IOException
      Description copied from interface: MarketDataService
      Get a ticker representing the current exchange rate
      Specified by:
      getTicker in interface MarketDataService
      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
    • getTickers

      public List<Ticker> getTickers​(Params params) throws IOException
      Description copied from interface: MarketDataService
      Get the tickers representing the current exchange rate for the provided parameters
      Specified by:
      getTickers in interface MarketDataService
      Returns:
      The Tickers, null if some sort of error occurred. Implementers should log the error.
      Throws:
      IOException - - Indication that a networking error occurred while fetching JSON data
    • getTrades

      public Trades getTrades​(CurrencyPair pair, Object... args) throws IOException
      optional parameters provided in the args array:
      • 0: Long fromId optional, ID to get aggregate trades from INCLUSIVE.
      • 1: Long startTime optional, Timestamp in ms to get aggregate trades from INCLUSIVE.
      • 2: Long endTime optional, Timestamp in ms to get aggregate trades until INCLUSIVE.
      • 3: Integer limit optional, Default 500; max 500.

      Specified by:
      getTrades in interface MarketDataService
      args - Optional arguments. Exchange-specific
      Returns:
      The Trades, null if some sort of error occurred. Implementers should log the error.
      Throws:
      IOException - - Indication that a networking error occurred while fetching JSON data
    • getAllBookTickers

      public List<Ticker> getAllBookTickers() throws IOException
      Throws:
      IOException