streamTxOsByLockAddress method

Stream<TxoLockAddressResponse> streamTxOsByLockAddress({
  1. required LockAddress address,
  2. double? confidence,
  3. CallOptions? options,
})

Streams a TxoAddressResponse object for the transaction outputs found at the given addresses and confidence.

addresses is a LockAddress representing the addresses to retrieve transaction outputs for

confidence is a double representing the confidence factor of the transaction outputs to retrieve.

options is a CallOptions object that can be used to set additional options for the RPC request.

Throws an Exception if an error occurs during the RPC request.

Implementation

Stream<TxoLockAddressResponse> streamTxOsByLockAddress({
  required LockAddress address,
  double? confidence,
  CallOptions? options,
}) async* {
  final QueryByLockAddressRequest request = QueryByLockAddressRequest(
    address: address,
    confidenceFactor: getConfidenceFactorFromDouble(confidence),
  );
  final Stream<TxoLockAddressResponse> stream =
      genusTransactionStub.getTxosByLockAddressStream(
    request,
    options: options,
  );

  await for (final TxoLockAddressResponse response in stream) {
    yield response;
  }
}