bybit 1.2.0 copy "bybit: ^1.2.0" to clipboard
bybit: ^1.2.0 copied to clipboard

outdated

(Unofficial) Dart library to communicate with the bybit API over REST or WebSockets

example/lib/main.dart

import 'package:bybit/bybit.dart';

/// Read X ([count]) messages from a stream.
Future<void> readWebSocket(Stream<dynamic> stream, int count) async {
  var i = 0;
  await for (var value in stream) {
    print(value);
    i++;
    if (i >= count) return;
  }
}

void main() async {
  var bybit = ByBit(logLevel: 'ERROR');
  bybit.connect();
  bybit.subscribeToKlines(symbol: 'BTCUSD', interval: 'D');
  await readWebSocket(bybit.websocket.stream, 3);
  var symbols = await bybit.getSymbolsInfo();
  print(symbols);
  bybit.disconnect();
}
8
likes
0
pub points
43%
popularity

Publisher

unverified uploader

(Unofficial) Dart library to communicate with the bybit API over REST or WebSockets

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

crypto, http, logger, meta, sortedmap, web_socket_channel

More

Packages that depend on bybit