A streaming view of an scalus.cardano.node.EmulatorBase.
Every read delegates to the emulator, so the streaming and one-shot views cannot disagree — there is literally one ledger behind both. Submission additionally drives the subscription hub, so code that subscribes and reacts runs unchanged against a simulated chain.
One transaction, one block. The emulator has no notion of a block, so this wrapper synthesises one per accepted transaction and one per newEmptyBlock. Block identity is synthetic too — derived from the block number — which is why block subscriptions are declared unsupported rather than served with a fabricated header. UTxO and transaction subscriptions, which is what an application actually reacts to, are fully served.
Events only follow acceptance. A block reaches the hub only on Right(hash) from submitSync, that is, only after the emulator's validators and mutators have passed and the new state is committed. A rejected transaction produces no events.
Value parameters
- securityParam
-
settlement depth this emulator claims.
0— the default — matches its behaviour: a linear emulator never forks, so nothing ever needs to settle. Raise it to exercise a subscriber's confirmation gating.
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
trait BlockchainStreamProvidertrait BlockchainProvidertrait BlockchainStreamReadertrait BlockchainReadertrait BlockchainStreamProviderTF[Future]trait BlockchainStreamReaderTF[Future]trait BlockchainProviderTF[Future]trait BlockchainReaderTF[Future]class Objecttrait Matchableclass AnyShow all
Members list
Value members
Concrete 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
- Definition Classes
The same cell subscribeTransactionStatus reads, falling back to the emulator for transactions this provider never observed.
The same cell subscribeTransactionStatus reads, falling back to the emulator for transactions this provider never observed.
The duality between a one-shot read and its subscription is only worth anything if the two cannot disagree, and they can only be guaranteed not to by reading the same state. A transaction submitted here is Pending then Confirmed in the hub; one that predates this wrapper is answered by the ledger.
Attributes
- Definition Classes
Terminal: subscriptions end, and the provider serves no new ones and submits nothing further. A close that left the provider working would leak the very subscriptions it was called to release.
Terminal: subscriptions end, and the provider serves no new ones and submits nothing further. A close that left the provider working would leak the very subscriptions it was called to release.
Attributes
Returns the current slot number.
Returns the current slot number.
Attributes
The tip as the stream sees it — synthetic block height, and the emulator's own slot.
The tip as the stream sees it — synthetic block height, and the emulator's own slot.
Attributes
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
Fetches the latest protocol parameters from the network.
Fetches the latest protocol parameters from the network.
Attributes
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
Look up a datum by its hash. Returns None if unknown.
Look up a datum by its hash. Returns None if unknown.
Attributes
Advance the tip without a transaction.
Advance the tip without a transaction.
Attributes
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
Submits a transaction to the network.
Submits a transaction to the network.
Attributes
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
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
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 methods
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
Poll for transaction confirmation.
Poll for transaction confirmation.
Default implementation for emulators: a single check is sufficient since confirmation is instant.
Attributes
- Inherited from:
- BlockchainProvider
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
Submit a transaction and poll until confirmed.
Submit a transaction and poll until confirmed.
Default implementation composes submit and pollForConfirmation.
Attributes
- Inherited from:
- BlockchainProvider
Subscribe with default options.
Subscribe with default options.
Subscribe with default options.