diffOrderbookStream method

Stream<WsDiffOrderBook> diffOrderbookStream({
  1. required String symbol,
  2. bool is100ms = false,
})

Order book price and quantity depth updates used to locally manage an order book.

Implementation

Stream<WsDiffOrderBook> diffOrderbookStream({
  required String symbol,
  bool is100ms = false,
}) {
  final channel =
      subscribe('${symbol.toLowerCase()}@depth' + (is100ms ? "@100ms" : ""));
  return channel.stream
      .map<Map>(toMap)
      .map<WsDiffOrderBook>((e) => WsDiffOrderBook.fromMap(e));
}