import { IDL } from '@icp-sdk/core/candid'; import type { Principal } from '@icp-sdk/core/principal'; import * as z from 'zod'; import { type RawPrincipal } from '../../schemas/principal'; /** * @see IDLType */ export declare const IDLTypeSchema: z.ZodCustom, IDL.Type>; /** * Custom validation function to verify if a value is an instance of `IDL.Type` from `@icp-sdk/core/candid`. */ export type IDLType = z.infer; /** * @see CallArg */ export declare const CallArgSchema: z.ZodTuple<[z.ZodCustom, IDL.Type>, z.ZodUnknown], null>; /** * A call argument consisting of its IDL type and corresponding value. */ export type CallArg = z.infer; /** * Schema for encoding the call arguments. * * @see CallArgs */ export declare const CallArgsSchema: z.ZodArray, IDL.Type>, z.ZodUnknown], null>>; /** * Represents the arguments for a canister call on the IC. * * Requests and responses on the IC are encoded using Candid. * This schema ensures that each argument is provided with both its type and value * for proper encoding. * * The order of arguments is preserved for the function call. */ export type CallArgs = z.infer; /** * @see CallResult */ export declare const CallResultSchema: z.ZodCustom, IDL.Type>; /** * Defines the type used to decode the result of a canister call. */ export type CallResult = z.infer; /** * @see CallParams */ export declare const CallParamsSchema: z.ZodObject<{ canisterId: z.ZodUnion<[z.ZodCustom, Uint8Array>, z.ZodPipe, z.ZodTransform>]>; method: z.ZodString; args: z.ZodOptional, IDL.Type>, z.ZodUnknown], null>>>; result: z.ZodOptional, IDL.Type>>; }, z.core.$strip>; /** * Type representing the parameters required to make a canister call. */ export interface CallParams { /** * The target canister's ID. */ canisterId: RawPrincipal | Principal; /** * The name of the method to call. Minimum one character. */ method: string; /** * The arguments, including types and values, for the canister call. */ args?: CallArgs; /** * The expected result type used for decoding the response. */ result?: CallResult; }