Skip to content

MiddayClient

Defined in: src/Client.ts:258

A Midnight client handle with convenience methods.

Since

0.5.0

Properties

effect

readonly effect: object

Defined in: src/Client.ts:297

Effect versions of client methods

close()

close(): Effect<void, ClientError>

Returns

Effect<void, ClientError>

loadContract()

loadContract<M>(options): Effect<LoadedContract<InferLedger<M>, InferCircuits<M>, InferActions<M>>, ClientError>

Type Parameters
M

M extends ContractModule<unknown, string>

Parameters
options

LoadContractOptions<M>

Returns

Effect<LoadedContract<InferLedger<M>, InferCircuits<M>, InferActions<M>>, ClientError>

waitForTx()

waitForTx(txHash, options?): Effect<FinalizedTxData, ClientError | TxTimeoutError>

Parameters
txHash

string

options?

WaitForTxOptions

Returns

Effect<FinalizedTxData, ClientError | TxTimeoutError>


networkConfig

readonly networkConfig: NetworkConfig

Defined in: src/Client.ts:260

Network configuration


providers

readonly providers: BaseProviders

Defined in: src/Client.ts:262

Base providers (for advanced use — no zkConfig)

Methods

[asyncDispose]()

[asyncDispose](): Promise<void>

Defined in: src/Client.ts:294

Supports await using client = await Midday.Client.create(config);

Returns

Promise<void>

Since

0.2.9


close()

close(): Promise<void>

Defined in: src/Client.ts:287

Close the client and release all resources.

Returns

Promise<void>

Since

0.2.9


loadContract()

loadContract<M>(options): Promise<LoadedContract<InferLedger<M>, InferCircuits<M>, InferActions<M>>>

Defined in: src/Client.ts:270

Load a contract module. Returns a LoadedContract — call deploy() or join() on it to get a DeployedContract.

Type Parameters

M

M extends ContractModule<unknown, string>

Contract module type (inferred from options.module)

Parameters

options

LoadContractOptions<M>

Returns

Promise<LoadedContract<InferLedger<M>, InferCircuits<M>, InferActions<M>>>


waitForTx()

waitForTx(txHash, options?): Promise<FinalizedTxData>

Defined in: src/Client.ts:280

Wait for a transaction to be finalized.

Parameters

txHash

string

Transaction hash to watch

options?

WaitForTxOptions

Optional settings (e.g., timeout)

Returns

Promise<FinalizedTxData>

Throws

When the timeout is exceeded