Base trait for Emulator implementations containing shared logic.
Platform-specific implementations (JVM/JS) extend this trait and provide thread-safe or single-threaded state management as appropriate.
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
trait BlockchainProvidertrait BlockchainReadertrait BlockchainProviderTF[Future]trait BlockchainReaderTF[Future]class Objecttrait Matchableclass AnyShow all
- Known subtypes
-
class Emulator
Members list
Value members
Abstract methods
Index of applied transactions by hash, for O(1) lookup. Platform-specific state.
Index of applied transactions by hash, for O(1) lookup. Platform-specific state.
Attributes
Ordered log of transactions applied to this emulator, in submission order (oldest first).
Ordered log of transactions applied to this emulator, in submission order (oldest first).
Unlike appliedTxs (hashes only), each entry retains the full transaction together with the slot it was applied at and the inputs it consumed (resolved against the pre-application UTxO set). This lets callers reconstruct chain history — e.g. walk the continuing outputs of an asset — without keeping their own submitted-transaction bookkeeping.
Ordering reflects submission order; under concurrent submission it is best-effort — the underlying ledger state transition is serialized, but the log append that follows it is not.
Attributes
Hashes of all applied transactions. Held as a materialized set (kept in sync with appliedTxIndex by the platform implementations) so access is a plain O(1) field read rather than a per-call key-set view.
Hashes of all applied transactions. Held as a materialized set (kept in sync with appliedTxIndex by the platform implementations) so access is a plain O(1) field read rather than a per-call key-set view.
Attributes
Clear the applied-transaction bookkeeping (appliedTxLog and appliedTxIndex), leaving the ledger state (utxos, certState, datums) untouched.
Clear the applied-transaction bookkeeping (appliedTxLog and appliedTxIndex), leaving the ledger state (utxos, certState, datums) untouched.
Attributes
Synchronously submit a transaction with debug scripts for diagnostic replay.
Synchronously submit a transaction with debug scripts for diagnostic replay.
Attributes
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
Returns the current slot number.
Returns the current slot number.
Attributes
Evaluator mode the emulator runs Plutus scripts in (e.g. Validate vs EvaluateAndComputeCost). Exposed so snapshots such as ImmutableEmulator.fromEmulator can preserve it rather than silently reverting to the Context default.
Evaluator mode the emulator runs Plutus scripts in (e.g. Validate vs EvaluateAndComputeCost). Exposed so snapshots such as ImmutableEmulator.fromEmulator can preserve it rather than silently reverting to the Context default.
Attributes
Emulator uses parasitic EC since all operations are synchronous.
Emulator uses parasitic EC since all operations are synchronous.
Attributes
- Definition Classes
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 the full applied-tx record (transaction + slot + spent inputs) by hash.
Look up the full applied-tx record (transaction + slot + spent inputs) by hash.
Attributes
Look up a datum by its hash. Returns None if unknown.
Look up a datum by its hash. Returns None if unknown.
Attributes
Look up a previously applied transaction by hash, or None if it was never applied.
Look up a previously applied transaction by hash, or None if it was never applied.
Attributes
Submits a transaction to the network.
Submits a transaction to the network.
Attributes
Submit a transaction with debug scripts for diagnostic replay.
Submit a transaction with debug scripts for diagnostic replay.
When a release script fails with empty logs, the evaluator replays it using the debug script to produce diagnostic output.
Value parameters
- debugScripts
-
map from release script hash to debug script for diagnostic replay
- transaction
-
the transaction to submit
Attributes
Inherited methods
Check the status of a transaction on the blockchain.
Check the status of a transaction on the blockchain.
Default implementation checks for UTxOs from the transaction. For emulators without a mempool concept, this returns either Confirmed or NotFound.
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
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