BlockchainStreamReader
Future-based streaming reader, mirroring BlockchainReader.
Wanted for read-only surfaces — a scenario runner's post-run reader, an emulator projection — where handing out a provider would imply a submit path that does not exist.
Attributes
- Graph
-
- Supertypes
-
trait BlockchainReadertrait BlockchainStreamReaderTF[Future]trait BlockchainReaderTF[Future]class Objecttrait Matchableclass AnyShow all
- Known subtypes
-
trait BlockchainStreamProviderclass StreamingEmulator
Members list
Value members
Inherited methods
Check the status of a transaction on the blockchain.
Check the status of a transaction on the blockchain.
Fallback implementation: look for UTxOs produced by the transaction. A provider that can answer authoritatively should override this — BlockfrostProvider asks the API, and EmulatorBase consults its applied-transaction index — because this inference has a blind spot in each direction. It cannot see a mempool, so a pending transaction reads as NotFound; and a transaction all of whose outputs have since been spent also reads as NotFound, since it produces no current UTxOs.
What it must not do is report a transaction that was never submitted as Confirmed. An empty result is therefore not a confirmation — the inherited BlockchainProviderTF.submitAndPoll builds on this answer, and "confirmed" for a transaction that never reached the chain is the one wrong answer that silently corrupts a caller's state.
Attributes
- Inherited from:
- BlockchainReader
Find a single UTxO by its transaction input.
Find a single UTxO by its transaction input.
Attributes
- Returns
-
Right(utxo) if found, Left(NotFound) otherwise
- Inherited from:
- BlockchainReaderTF
Find all UTxOs at the given address.
Find UTxOs by a set of transaction inputs (fails with NotFound if not all are found).
Find UTxOs by a set of transaction inputs (fails with NotFound if not all are found).
Attributes
- Inherited from:
- BlockchainReaderTF
Map over the Future effect using this reader's captured ExecutionContext.
Map over the Future effect using this reader's captured ExecutionContext.
Attributes
- Definition Classes
- Inherited from:
- BlockchainReader
Query UTxOs using a lambda DSL.
Query UTxOs using a lambda DSL.
Translates the lambda to a UtxoQuery at compile time and returns a builder that can be further configured before execution. Effect-polymorphic — the resulting .execute() returns the reader's own F[Either[UtxoQueryError, Utxos]], so the same call shape works on Future-typed providers (Blockfrost, JS) and direct-style providers (ox Id).
Example:
// Simple query — execute immediately
reader.queryUtxos { u =>
u.output.address == myAddress
}.execute()
// With pagination and minimum total
reader.queryUtxos { u =>
u.output.address == myAddress && u.output.value.hasAsset(policyId, assetName)
}.minTotal(Coin.ada(100)).limit(10).execute()
Supported expressions:
u.output.address == addr— query by addressu.input.transactionId == txId— query by transactionu.output.value.hasAsset(policyId, assetName)— query/filter by assetu.output.value.coin >= amount— filter by minimum lovelaceu.output.hasDatumHash(hash)— filter by datum hash&&— AND combination||— OR combination
Value parameters
- f
-
Lambda expression from Utxo to Boolean
Attributes
- Returns
-
A UtxoQueryWithReaderTF builder over this reader's effect type
- Inherited from:
- BlockchainReaderTF
Subscribe with default options.
Subscribe with default options.
Subscribe with default options.
Inherited and Abstract methods
Returns CardanoInfo for this reader.
Returns CardanoInfo for this reader.
This is always available synchronously after the reader is constructed. For emulators, this returns the current context. For remote providers like BlockfrostProvider, the CardanoInfo is fetched during async construction.
Attributes
- Inherited from:
- BlockchainReader
Attributes
- Inherited from:
- BlockchainStreamReaderTF
Returns the current slot number.
Returns the ExecutionContext captured by this reader.
Returns the ExecutionContext captured by this reader.
This is used internally by default method implementations. External code can use this when working with Futures returned by reader methods, or provide their own.
Attributes
- Inherited from:
- BlockchainReader
Fetches the latest protocol parameters from the network.
Fetches the latest protocol parameters from the network.
Attributes
- Inherited from:
- BlockchainReader
Find UTxOs using a type-safe query.
Find UTxOs using a type-safe query.
Value parameters
- query
-
The query specifying source, filters, and pagination
Attributes
- Returns
-
Either a UtxoQueryError or the matching UTxOs
- Inherited from:
- BlockchainReader
Look up a datum by its hash. Returns None if unknown.
What this provider can do. The only thing an implementation declares; per-request support is derived from it by SubscriptionSupport.of.
What this provider can do. The only thing an implementation declares; per-request support is derived from it by SubscriptionSupport.of.
Attributes
- Inherited from:
- BlockchainStreamReaderTF
Attributes
- Inherited from:
- BlockchainStreamReaderTF
Latest-value stream of protocol parameters: the current value on subscribe, then changes.
Latest-value stream of protocol parameters: the current value on subscribe, then changes.
Attributes
- Inherited from:
- BlockchainStreamReaderTF
Latest-value stream of chain-tip updates — newer wins, so a subscriber always sees the most recent tip when it pulls rather than a backlog of stale ones.
Latest-value stream of chain-tip updates — newer wins, so a subscriber always sees the most recent tip when it pulls rather than a backlog of stale ones.
Attributes
- Inherited from:
- BlockchainStreamReaderTF
Attributes
- Inherited from:
- BlockchainStreamReaderTF
Latest-value stream of one transaction's status, following it through the mempool into a block — and back out again if a rollback orphans it.
Latest-value stream of one transaction's status, following it through the mempool into a block — and back out again if a rollback orphans it.
Attributes
- Inherited from:
- BlockchainStreamReaderTF
Attributes
- Inherited from:
- BlockchainStreamReaderTF