events method

Stream<FilterEvent> events(
  1. FilterOptions options
)

Listens for logs emitted from transactions. The options can be used to apply additional filters.

The stream can only be listened to once. The subscription must be disposed properly when no longer used. Failing to do so causes a memory leak in your application and uses unnecessary resources on the connected node. See also:

Implementation

Stream<FilterEvent> events(FilterOptions options) {
  if (socketConnector != null) {
    // The real-time rpc nodes don't support listening to old data, so handle
    // that here.
    return Stream.fromFuture(getLogs(options))
        .expand((e) => e)
        .followedBy(_filters.addFilter(_EventFilter(options)));
  }

  return _filters.addFilter(_EventFilter(options));
}