tabTransactionsStream method

  1. @override
Stream<ContractFoundTransactionEvent> tabTransactionsStream(
  1. String tabId
)
override

Stream, that listens for all created contract subscriptions for browser tab with tabId and provides found transactions for every contract separately.

Implementation

@override
Stream<ContractFoundTransactionEvent> tabTransactionsStream(String tabId) =>
    _contractSubscriptions
        .expand((list) => list)
        .where(
          (c) =>
              c.tabId == tabId &&
              (c.updateSubscriptionOptions.transactions ?? false),
        )
        .flatMap(
          (c) => c.contract.onTransactionsFoundStream.map(
            (event) => ContractFoundTransactionEvent(
              address: c.address,
              transactions: event.$1,
              info: event.$2,
            ),
          ),
        );