Skip to main content
Version: Next

emulator.emulator.as

Home > @blaze-cardano/emulator > Emulator > as

Emulator.as() method

Executes the supplied callback in the context of a labelled wallet and Blaze client, simplifying multi-party test flows.

Signature:

as<T = void>(label: string, callback: (blaze: Blaze<EmulatorProvider, HotSingleWallet>, address: Address) => Promise<T>): Promise<T>;

Parameters

Parameter

Type

Description

label

string

Wallet label whose context should be used.

callback

(blaze: Blaze<EmulatorProvider, HotSingleWallet>, address: Address) => Promise<T>

Function executed with the wallet's Blaze client and address.

Returns:

Promise<T>

{Promise} Resolves with the callback's return value.