Skip to main content

@midnight-ntwrk/midnight-js-contracts v0.2.5 • API


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

Function: deployContract()

deployContract<PSS, PSK, C>(providers, options): Promise<DeployedContract<PSS[PSK], C>>

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.

Type parameters

PSS extends PrivateStateSchema

PSK extends string

C extends Contract<PSS[PSK], Witnesses<PSS[PSK]>>

Parameters

providers: MidnightProviders<ImpureCircuitId<C>, PSS>

The providers used to manage the transaction lifecycle.

options: DeployContractOptions<PSS, PSK, C>

Configuration.

Returns

Promise<DeployedContract<PSS[PSK], C>>

Throws

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