Skip to main content

Midnight.js API Reference v1.0.0


Midnight.js API Reference / @midnight-ntwrk/midnight-js-testing / waitForFunds

Function: waitForFunds()

waitForFunds(wallet, env, fundFromFaucet?): Promise<bigint>

Waits for funds to be available in the wallet. If a faucet is configured, requests tokens from it.

Parameters

wallet

MidnightWallet

The wallet to check for funds

env

EnvironmentConfiguration

Environment configuration containing faucet details

fundFromFaucet?

boolean = false

Whether to request tokens from the faucet

Returns

Promise<bigint>

A promise that resolves to the wallet balance