Skip to main content

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


Midnight.js API Reference v0.1.15 / @midnight-ntwrk/midnight-js-contracts / createSubmittedCallTx

Function: createSubmittedCallTx()

createSubmittedCallTx<PSS, PSK, C, ICK>(providers, circuitId, args, contract, contractAddress, privateStateKey): Promise<SubmittedCallTx<PSS, PSK, C, ICK>>

Creates and submits a transaction for the invocation of a circuit on a given contract.

Type parameters

PSS extends PrivateStateSchema

PSK extends string | number | symbol

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

ICK extends string

Parameters

providers: MidnightProviders<ICK, PSS>

The providers used to manage the invocation lifecycle.

circuitId: ICK

The identifier of the circuit to be invoked.

args: CircuitParameters<PSS[PSK], C, ICK>

The parameters that will be used during invocation of the circuit.

contract: C

The contract to use when executing the circuit.

contractAddress: string

The ledger address of the contract.

privateStateKey: PSK

The address of the state of the witnesses of the contract.

Returns

Promise<SubmittedCallTx<PSS, PSK, C, ICK>>

A Promise that resolves with the finalized transaction data for the invocation of circuitId on contract with the given args; or rejects with an error if the invocation fails.