logsSubscribe method

Stream<Logs> logsSubscribe(
  1. LogsFilter filter, {
  2. Commitment? commitment,
})

Subscribe to transaction logging.

Returns a Stream that can be used to listen for events. By cancelling the subscription returned by the Stream.listen() method of this stream client will automatically send logsUnsubscribe message;

For commitment parameter description see this document.

Commitment.processed is not supported as commitment.

Implementation

Stream<Logs> logsSubscribe(
  LogsFilter filter, {
  Commitment? commitment,
}) =>
    _subscribe<Logs>(
      'logs',
      params: <dynamic>[
        filter.when(
          all: () => 'all',
          allWithVotes: () => 'allWithVotes',
          mentions: (pubKeys) => <String, List<String>>{
            'mentions': pubKeys,
          },
        ),
        if (commitment != null)
          <String, String>{
            'commitment': commitment.value,
          },
      ],
    );