NetworkEmulator

A simple emulated Network. This can be used to do integration tests of whole DApps. Staking is not yet supported.

Constructor

Instantiates a NetworkEmulator at slot 0. An optional seed number can be specified, from which all emulated randomness is derived.

const network = new helios.NetworkEmulator(seed: number = 0)

Methods

createWallet

Creates a new WalletEmulator and populates it with a given lovelace quantity and assets (these are taken from special genesis transactions).

network.createWallet(
    lovelace: bigint,
    assets: helios.Assets
): helios.WalletEmulator

getUtxos

Gets a complete list of UTxOs at a given address.

network.getUtxos(address: helios.Address): Promise<helios.UTxO[]>

submitTx

Validates and submits a transaction to the emulated mempool. Any input UTxOs are immediately marked as spent.

network.submitTx(tx: helios.Tx): Promise<helios.TxId>

tick

Mints a block with the current emulated mempool, and advances the head slot by nSlots.

network.tick(nSlots: bigint)