@proto-kit/common • Docs


Documentation / @proto-kit/common / provableMethod

Function: provableMethod()

provableMethod(isFirstParameterPublicInput, executionContext): <Target>(target, methodName, descriptor) => TypedPropertyDescriptor<(…args) => any>

Decorates a provable method on a ‘prover class’, depending on if proofs are enabled or not, either runs the respective zkProgram prover, or simulates the method execution and issues a mock proof.

Parameters

• isFirstParameterPublicInput: boolean = true

• executionContext: ProvableMethodExecutionContext = ...

Returns

Function

Type Parameters

• Target extends ZkProgrammable<any, any> | WithZkProgrammable<any, any>

Parameters

• target: Target

• methodName: string

• descriptor: TypedPropertyDescriptor<(…args) => any>

Returns

TypedPropertyDescriptor<(…args) => any>

Defined in

packages/common/src/zkProgrammable/provableMethod.ts:84