notifyUtxosChanged method

Stream<UtxosChangedNotificationMessage> notifyUtxosChanged(
  1. Iterable<String> addresses
)

Implementation

Stream<UtxosChangedNotificationMessage> notifyUtxosChanged(
  Iterable<String> addresses,
) {
  final message = KaspadMessage(
    notifyUtxosChangedRequest: NotifyUtxosChangedRequestMessage(
      addresses: addresses,
    ),
  );

  final response = _streamRequest(message);

  final result = response.map((event) {
    final error = event.notifyUtxosChangedResponse.error;
    if (error.message.isNotEmpty) {
      throw RpcException(error);
    }
    return event.utxosChangedNotification;
  }).skip(1);

  return result;
}