Package info.bitrich.xchangestream.bybit
Class BybitStreamingExchange
java.lang.Object
org.knowm.xchange.BaseExchange
org.knowm.xchange.bybit.BybitExchange
info.bitrich.xchangestream.bybit.BybitStreamingExchange
- All Implemented Interfaces:
StreamingExchange,Exchange
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class org.knowm.xchange.bybit.BybitExchange
SPECIFIC_PARAM_ACCOUNT_TYPE, SPECIFIC_PARAM_TESTNET, timeStampFactoryFields inherited from class org.knowm.xchange.BaseExchange
accountService, exchangeMetaData, exchangeSpecification, logger, marketDataService, tradeServiceFields inherited from interface org.knowm.xchange.Exchange
USE_SANDBOXFields inherited from interface info.bitrich.xchangestream.core.StreamingExchange
ACCEPT_ALL_CERITICATES, AUTO_RECONNECT, ENABLE_LOGGING_HANDLER, L3_ORDERBOOK, SOCKS_PROXY_HOST, SOCKS_PROXY_PORT, WS_CONNECTION_TIMEOUT, WS_IDLE_TIMEOUT, WS_RETRY_DURATION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionio.reactivex.rxjava3.core.Completableconnect(ProductSubscription... args) Connects to the WebSocket API of the exchange.io.reactivex.rxjava3.core.Observable<Object> io.reactivex.rxjava3.core.Observable<ConnectionStateModel.State> Observable for connectionState. designed to replaces connectionSuccess reconnectFailure disconnectObservableio.reactivex.rxjava3.core.Observable<ConnectionStateModel.State> io.reactivex.rxjava3.core.Observable<ConnectionStateModel.State> io.reactivex.rxjava3.core.CompletableDisconnect from the WebSocket API.Returns service that can be used to access streaming market data.Returns service that can be used to access streaming trade data.protected voidbooleanisAlive()Checks whether connection to the exchange is alive.io.reactivex.rxjava3.core.Observable<Throwable> Observable for reconnection failure event.io.reactivex.rxjava3.core.Observable<Throwable> voidvoiduseCompressedMessages(boolean compressedMessages) Set whether or not to enable compression handler.Methods inherited from class org.knowm.xchange.bybit.BybitExchange
applySpecification, getDefaultExchangeSpecification, getNonceFactory, getResilienceRegistries, remoteInit, updateExchangeMetaDataMethods inherited from class org.knowm.xchange.BaseExchange
getExchangeInstruments, getExchangeMetaData, getExchangeSpecification, getMetaDataFileName, loadExchangeMetaData, loadMetaData, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.knowm.xchange.Exchange
applySpecification, getAccountService, getDefaultExchangeSpecification, getExchangeInstruments, getExchangeMetaData, getExchangeSpecification, getMarketDataService, getNonceFactory, getResilienceRegistries, getTradeService, remoteInit, updateExchangeMetaDataMethods inherited from interface info.bitrich.xchangestream.core.StreamingExchange
applyStreamingSpecification, applyWebsocketTimeouts, connectionSuccess, disconnectObservable, getStreamingAccountService, messageDelay
-
Field Details
-
URI
- See Also:
-
TESTNET_URI
- See Also:
-
AUTH_URI
- See Also:
-
TESTNET_AUTH_URI
- See Also:
-
DEMO_AUTH_URI
- See Also:
-
TRADE_URI
- See Also:
-
TESTNET_TRADE_URI
- See Also:
-
EXCHANGE_TYPE
- See Also:
-
-
Constructor Details
-
BybitStreamingExchange
public BybitStreamingExchange()
-
-
Method Details
-
initServices
protected void initServices()- Overrides:
initServicesin classBybitExchange
-
connect
Description copied from interface:StreamingExchangeConnects to the WebSocket API of the exchange.- Specified by:
connectin interfaceStreamingExchange- Parameters:
args- Product subscription is used only in certain exchanges where you need to specify subscriptions during the connect phase.- Returns:
Completablethat completes upon successful connection.
-
disconnect
public io.reactivex.rxjava3.core.Completable disconnect()Description copied from interface:StreamingExchangeDisconnect from the WebSocket API.- Specified by:
disconnectin interfaceStreamingExchange- Returns:
Completablethat completes upon successful disconnect.
-
getStreamingTradeService
Description copied from interface:StreamingExchangeReturns service that can be used to access streaming trade data.- Specified by:
getStreamingTradeServicein interfaceStreamingExchange
-
isAlive
public boolean isAlive()Description copied from interface:StreamingExchangeChecks whether connection to the exchange is alive.- Specified by:
isAlivein interfaceStreamingExchange- Returns:
- true if connection is open, otherwise false.
-
useCompressedMessages
public void useCompressedMessages(boolean compressedMessages) Description copied from interface:StreamingExchangeSet whether or not to enable compression handler.- Specified by:
useCompressedMessagesin interfaceStreamingExchange- Parameters:
compressedMessages- Defaults to false
-
getStreamingMarketDataService
Description copied from interface:StreamingExchangeReturns service that can be used to access streaming market data.- Specified by:
getStreamingMarketDataServicein interfaceStreamingExchange
-
reconnectFailure
Description copied from interface:StreamingExchangeObservable for reconnection failure event. When this happens, it usually indicates that the server or the network is down.- Specified by:
reconnectFailurein interfaceStreamingExchange- Returns:
- Observable with the exception during reconnection.
-
reconnectFailurePrivateChannel
-
connectionStateObservable
Description copied from interface:StreamingExchangeObservable for connectionState. designed to replaces connectionSuccess reconnectFailure disconnectObservable- Specified by:
connectionStateObservablein interfaceStreamingExchange- Returns:
- Observable
-
connectionStateObservablePrivateChannel
public io.reactivex.rxjava3.core.Observable<ConnectionStateModel.State> connectionStateObservablePrivateChannel() -
connectionStateObservableTradeChannel
public io.reactivex.rxjava3.core.Observable<ConnectionStateModel.State> connectionStateObservableTradeChannel() -
resubscribeChannels
public void resubscribeChannels()- Specified by:
resubscribeChannelsin interfaceStreamingExchange
-
connectionIdle
- Specified by:
connectionIdlein interfaceStreamingExchange
-