Class SubscribeStateService

java.lang.Object
xyz.felh.okx.v5.ws.SubscribeStateService

public class SubscribeStateService extends Object
This class is to handle all subscribed state
  • Constructor Details

    • SubscribeStateService

      public SubscribeStateService(OkxWsApiService okxWsApiService)
  • Method Details

    • saveLoginInfo

      public void saveLoginInfo(String apiKey, String passphrase, String secretKey)
      Save last successfully login information
      Parameters:
      apiKey - api key
      passphrase - passphrase
      secretKey - secretKey
    • hasSubscribed

      public boolean hasSubscribed(WsChannel wsChannel, WsRequestArg arg)
      Check if current channel has been subscribed successfully
      Parameters:
      wsChannel - channel
      arg - arg
      Returns:
      if current channel has been subscribed
    • addSubscribed

      public void addSubscribed(WsChannel wsChannel, WsRequestArg arg)
      Add param when call subscribe
      Parameters:
      wsChannel - channel
      arg - arg
    • confirmSubscribed

      public void confirmSubscribed(WsChannel wsChannel, WsRequestArg arg)
      confirm subscribed
      Parameters:
      wsChannel - channel
      arg - arg
    • removeSubscribed

      public void removeSubscribed(WsChannel wsChannel, WsRequestArg arg)
      remove subscribed data
      Parameters:
      wsChannel - channel
      arg - arg
    • tryLogin

      public void tryLogin()
      try login again
    • restoreSubscribed

      public void restoreSubscribed(WsChannel wsChannel)
      恢复某个channel的订阅
      Parameters:
      wsChannel - channel