Class dydxStreamingService

java.lang.Object
info.bitrich.xchangestream.service.ConnectableService
info.bitrich.xchangestream.service.netty.NettyStreamingService<com.fasterxml.jackson.databind.JsonNode>
info.bitrich.xchangestream.service.netty.JsonNettyStreamingService
info.bitrich.xchangestream.dydx.dydxStreamingService

public class dydxStreamingService extends info.bitrich.xchangestream.service.netty.JsonNettyStreamingService
Author: Max Gao (gaamox@tutanota.com) Created: 20-02-2021
  • Nested Class Summary

    Nested classes/interfaces inherited from class info.bitrich.xchangestream.service.netty.NettyStreamingService

    info.bitrich.xchangestream.service.netty.NettyStreamingService.NettyWebSocketClientHandler, info.bitrich.xchangestream.service.netty.NettyStreamingService.Subscription
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     

    Fields inherited from class info.bitrich.xchangestream.service.netty.JsonNettyStreamingService

    objectMapper

    Fields inherited from class info.bitrich.xchangestream.service.netty.NettyStreamingService

    channels, DEFAULT_CONNECTION_TIMEOUT, DEFAULT_IDLE_TIMEOUT, DEFAULT_RETRY_DURATION, uri

    Fields inherited from class info.bitrich.xchangestream.service.ConnectableService

    BEFORE_CONNECTION_HANDLER
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected String
    getChannelNameFromMessage(com.fasterxml.jackson.databind.JsonNode message)
     
     
    io.reactivex.Observable<dydxWebSocketTransaction>
    getRawWebsocketTransactions(org.knowm.xchange.currency.CurrencyPair currencyPair, String baseChannelName)
    Creates an observable of a channel using the baseChannelName and currencyPair.
    getSubscribeMessage(String channelName, Object... args)
     
    getUnsubscribeMessage(String channelName, Object... args)
     
    io.reactivex.Observable<com.fasterxml.jackson.databind.JsonNode>
    subscribeChannel(String channelName, Object... args)
     
    void
     

    Methods inherited from class info.bitrich.xchangestream.service.netty.JsonNettyStreamingService

    messageHandler, processArrayMessageSeparately, sendObjectMessage

    Methods inherited from class info.bitrich.xchangestream.service.netty.NettyStreamingService

    disconnect, getChannel, getCustomHeaders, getSubscriptionUniqueId, getWebSocketClientExtensionHandler, getWebSocketClientHandler, handleChannelError, handleChannelMessage, handleError, handleIdle, handleMessage, isSocketOpen, openConnection, resubscribeChannels, sendMessage, setAcceptAllCertificates, setAutoReconnect, setEnableLoggingHandler, setLoggingHandlerLevel, setSocksProxyHost, setSocksProxyPort, subscribeConnectionState, subscribeConnectionSuccess, subscribeDisconnect, subscribeIdle, subscribeReconnectFailure, useCompressedMessages

    Methods inherited from class info.bitrich.xchangestream.service.ConnectableService

    connect, setBeforeConnectionHandler

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • dydxStreamingService

      public dydxStreamingService(String apiUri)
  • Method Details

    • getChannelNameFromMessage

      protected String getChannelNameFromMessage(com.fasterxml.jackson.databind.JsonNode message)
      Specified by:
      getChannelNameFromMessage in class info.bitrich.xchangestream.service.netty.NettyStreamingService<com.fasterxml.jackson.databind.JsonNode>
    • getProduct

      public ProductSubscription getProduct()
    • subscribeMultipleCurrencyPairs

      public void subscribeMultipleCurrencyPairs(ProductSubscription... products)
    • getRawWebsocketTransactions

      public io.reactivex.Observable<dydxWebSocketTransaction> getRawWebsocketTransactions(org.knowm.xchange.currency.CurrencyPair currencyPair, String baseChannelName)
      Creates an observable of a channel using the baseChannelName and currencyPair. For example, subscribing to the trades channel for WETH/USDC will create a new channel "trades-WETH-USDC".
      Parameters:
      currencyPair - any currency pair supported by dydx
      baseChannelName - e.g. "orderbook", "v3_orderbook", etc.
      Returns:
    • subscribeChannel

      public io.reactivex.Observable<com.fasterxml.jackson.databind.JsonNode> subscribeChannel(String channelName, Object... args)
      Overrides:
      subscribeChannel in class info.bitrich.xchangestream.service.netty.NettyStreamingService<com.fasterxml.jackson.databind.JsonNode>
    • getSubscribeMessage

      public String getSubscribeMessage(String channelName, Object... args) throws IOException
      Specified by:
      getSubscribeMessage in class info.bitrich.xchangestream.service.netty.NettyStreamingService<com.fasterxml.jackson.databind.JsonNode>
      Throws:
      IOException
    • getUnsubscribeMessage

      public String getUnsubscribeMessage(String channelName, Object... args) throws IOException
      Specified by:
      getUnsubscribeMessage in class info.bitrich.xchangestream.service.netty.NettyStreamingService<com.fasterxml.jackson.databind.JsonNode>
      Throws:
      IOException