ByBitWebSocket class

Constructors

ByBitWebSocket({String url = 'wss://stream.bybit.com/realtime', String key = '', String password = '', Duration? timeout, int pingPeriod = 30})
Connect to the server with a WebSocket. A ping shall be send every pingLooTimer seconds in order to keep the connection alive.

Properties

controller StreamController<Map<String, dynamic>?>?
Sream controller used to remap the websocket stream output to json data.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
key String
Your bybit api-key
final
log LoggerSingleton
For easy debugging
getter/setter pair
password String
Your api-key password
final
pingPeriod int
Ping period in seconds
final
pingTimer Timer?
Time that will ping the websocket server every X seconds.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
timeout Duration?
Timeout that triggers a reconnection.
getter/setter pair
timeoutTimer ↔ RestartableTimer?
Timer that triggers the timeout exception
getter/setter pair
transformer StreamTransformer<dynamic, Map<String, dynamic>?>?
Transformer that actually transform JSON string to Map
getter/setter pair
url String
Url to use for the WebSocket connection See https://bybit-exchange.github.io/docs/inverse/#t-websocket For a list of valid urls
final
websocket ↔ WebSocketChannel?
WebSocket that is used for the bybit communication
getter/setter pair

Methods

connect() → void
Open a WebSocket connection to the Bybit API
disconnect() → void
Disconnect the WebSocket
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
ping() → void
Send ping command to Bybit to check connection
request({required String op, List<String>? args}) → void
Send a command (op) and optional arguments to Bybit over the websocket
sign({required String secret, required int timestamp}) String
Generate a signature needed for the WebSocket authentication as defined here: https://bybit-exchange.github.io/docs/inverse/?console#t-websocketauthentication
subscribeTo({required String topic, String symbol = '', String filter = ''}) → void
send a subscribtion request to a specific topic to Bybit
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited