Contract
Midnight.js API Reference v2.0.2
Midnight.js API Reference / @midnight-ntwrk/midnight-js-types / Contract
Interface: Contract<PS, W>
Interface for a contract. The data types defined in this file are generic shapes for the artifacts
produced by the compactc compiler. In other words, this Contract interface should match the shape
of any Contract class produced by compactc. Midnight.js uses it for generic constraints.
Type Parametersβ
PSβ
PS = any
The private state modified by the contract witnesses.
Wβ
W extends Witnesses<PS> = Witnesses<PS>
The contract witnesses type.
Propertiesβ
impureCircuitsβ
readonlyimpureCircuits:ImpureCircuits<PS>
The impure circuits defined in a contract. These circuits can be used to create call transactions.
witnessesβ
readonlywitnesses:W
The private oracle of the contract.
Methodsβ
initialState()β
initialState(
context, ...args):ConstructorResult<PS>
Constructs the initial public state of the public oracle of a contract. This is used during deployment transaction construction.
Parametersβ
contextβ
ConstructorContext<PS>
argsβ
...any[]
Returnsβ
ConstructorResult<PS>