Skip to main content

Midnight.js API Reference v1.0.0


Midnight.js API Reference / @midnight-ntwrk/midnight-js-contracts / deployContract

Function: deployContract()

Creates and submits a contract deployment transaction. This function is the entry point for the transaction construction workflow and is used to create a DeployedContract instance.

Param

The providers used to manage the transaction lifecycle.

Param

Configuration.

Throws

DeployTxFailedError If the transaction is submitted successfully but produces an error when executed by the node.

Call Signature

deployContract<C>(providers, options): Promise<DeployedContract<C>>

Type Parameters

C

C extends Contract<undefined, Witnesses<undefined>>

Parameters

providers

ContractProviders<C, ImpureCircuitId<C>, unknown>

options

DeployContractOptionsBase<C>

Returns

Promise<DeployedContract<C>>

Call Signature

deployContract<C>(providers, options): Promise<DeployedContract<C>>

Type Parameters

C

C extends Contract<any, Witnesses<any>>

Parameters

providers

ContractProviders<C>

options

DeployContractOptionsWithPrivateState<C>

Returns

Promise<DeployedContract<C>>