Skip to content

loadContractModule

loadContractModule<T>(contractPath, options): Promise<ContractLoadResult<T>>

Defined in: src/Contract.ts:1648

Load a Compact contract from a directory path.

Note: Prefer using client.loadContract({ path }) which handles this automatically. This function is useful when you need to load the module before creating a client.

Type Parameters

T

T = ContractModule<unknown, string>

Parameters

contractPath

string

Absolute path to the contract directory

options

ContractLoadOptions = {}

Optional loading configuration

Returns

Promise<ContractLoadResult<T>>

Promise resolving to the contract module and ZK config provider

Example

const { module, zkConfig } = await Midday.Contract.loadContractModule(contractPath);
const contract = await client.loadContract({ module, zkConfig });

Since

0.4.0