Skip to content

InferActions

InferActions<M> = M extends object ? { [K in keyof IC]: IC[K] extends (context: any, args: infer A) => any ? (args: A) => Promise<CallResult> : (args: unknown[]) => Promise<CallResult> } : Record<string, (…args) => Promise<CallResult>>

Defined in: src/Contract.ts:135

Infer typed action methods from a contract module.

Strips the runtime context first parameter from each circuit function and maps the return type to Promise<CallResult>.

Type Parameters

M

M

Example

// Given a contract with: increment(ctx, amount: bigint), decrement(ctx)
// InferActions<M> = { increment(amount: bigint): Promise<CallResult>; decrement(): Promise<CallResult> }

Since

0.8.0