class Emulator
implements Provider
import { Emulator } from "https://deno.land/x/lucid@0.10.10/src/provider/emulator.ts";
Constructors
new
Emulator(accounts: { address: Address; assets: Assets; outputData?: OutputData; }[], protocolParameters?: ProtocolParameters)Properties
chain: Record<RewardAddress, { registeredStake: boolean; delegation: Delegation; }>
Only stake key registrations/delegations and rewards are tracked. Other certificates are not tracked.
ledger: Record<FlatOutRef, { utxo: UTxO; spent: boolean; }>
mempool: Record<FlatOutRef, { utxo: UTxO; spent: boolean; }>
protocolParameters: ProtocolParameters
time: UnixTime
Methods
awaitBlock(height?)
awaitSlot(length?)
awaitTx(txHash: string): Promise<boolean>
distributeRewards(rewards: Lovelace)
Emulates the behaviour of the reward distribution at epoch boundaries. Stake keys need to be registered and delegated like on a real chain in order to receive rewards.
getDelegation(rewardAddress: RewardAddress): Promise<Delegation>
getProtocolParameters(): Promise<ProtocolParameters>
getUtxoByUnit(unit: string): Promise<UTxO>
getUtxos(addressOrCredential: Address | Credential): Promise<UTxO[]>
getUtxosByOutRef(outRefs: OutRef[]): Promise<UTxO[]>
getUtxosWithUnit(addressOrCredential: Address | Credential, unit: Unit): Promise<UTxO[]>
log()
submitTx(tx: Transaction): Promise<TxHash>