import type { Principal } from '@icp-sdk/core/principal'; import * as z from 'zod'; /** * @see CanisterOptions */ export declare const IcrcCanisterOptionsSchema: z.ZodObject<{ canisterId: z.ZodNonOptional, z.ZodTransform>>>; }, z.core.$strict>; /** * The options to initialize an Icrc canister. */ export type IcrcCanisterOptions = z.infer; export declare const SubaccountSchema: z.ZodCustom, Uint8Array>; export declare const AccountSchema: z.ZodObject<{ owner: z.ZodPipe, z.ZodTransform>; subaccount: z.ZodOptional, Uint8Array>>; }, z.core.$strict>; export declare const TokensSchema: z.ZodBigInt; export declare const TransferArgsSchema: z.ZodObject<{ to: z.ZodObject<{ owner: z.ZodPipe, z.ZodTransform>; subaccount: z.ZodOptional, Uint8Array>>; }, z.core.$strict>; fee: z.ZodOptional; memo: z.ZodOptional, Uint8Array>>; from_subaccount: z.ZodOptional, Uint8Array>>; created_at_time: z.ZodOptional; amount: z.ZodBigInt; }, z.core.$strict>; export declare const TransferErrorSchema: z.ZodUnion; }, z.core.$strict>, z.ZodObject<{ TemporarilyUnavailable: z.ZodNull; }, z.core.$strict>, z.ZodObject<{ BadBurn: z.ZodObject<{ min_burn_amount: z.ZodBigInt; }, z.core.$strict>; }, z.core.$strict>, z.ZodObject<{ Duplicate: z.ZodObject<{ duplicate_of: z.ZodBigInt; }, z.core.$strict>; }, z.core.$strict>, z.ZodObject<{ BadFee: z.ZodObject<{ expected_fee: z.ZodBigInt; }, z.core.$strict>; }, z.core.$strict>, z.ZodObject<{ CreatedInFuture: z.ZodObject<{ ledger_time: z.ZodBigInt; }, z.core.$strict>; }, z.core.$strict>, z.ZodObject<{ TooOld: z.ZodNull; }, z.core.$strict>, z.ZodObject<{ InsufficientFunds: z.ZodObject<{ balance: z.ZodBigInt; }, z.core.$strict>; }, z.core.$strict>]>; export declare const TransferResultSchema: z.ZodUnion, z.ZodObject<{ Err: z.ZodUnion; }, z.core.$strict>, z.ZodObject<{ TemporarilyUnavailable: z.ZodNull; }, z.core.$strict>, z.ZodObject<{ BadBurn: z.ZodObject<{ min_burn_amount: z.ZodBigInt; }, z.core.$strict>; }, z.core.$strict>, z.ZodObject<{ Duplicate: z.ZodObject<{ duplicate_of: z.ZodBigInt; }, z.core.$strict>; }, z.core.$strict>, z.ZodObject<{ BadFee: z.ZodObject<{ expected_fee: z.ZodBigInt; }, z.core.$strict>; }, z.core.$strict>, z.ZodObject<{ CreatedInFuture: z.ZodObject<{ ledger_time: z.ZodBigInt; }, z.core.$strict>; }, z.core.$strict>, z.ZodObject<{ TooOld: z.ZodNull; }, z.core.$strict>, z.ZodObject<{ InsufficientFunds: z.ZodObject<{ balance: z.ZodBigInt; }, z.core.$strict>; }, z.core.$strict>]>; }, z.core.$strict>]>; export declare const TransferFromArgsSchema: z.ZodObject<{ to: z.ZodObject<{ owner: z.ZodPipe, z.ZodTransform>; subaccount: z.ZodOptional, Uint8Array>>; }, z.core.$strict>; fee: z.ZodOptional; spender_subaccount: z.ZodOptional, Uint8Array>>; from: z.ZodObject<{ owner: z.ZodPipe, z.ZodTransform>; subaccount: z.ZodOptional, Uint8Array>>; }, z.core.$strict>; memo: z.ZodOptional, Uint8Array>>; created_at_time: z.ZodOptional; amount: z.ZodBigInt; }, z.core.$strict>; export declare const TransferFromErrorSchema: z.ZodUnion; }, z.core.$strict>, z.ZodObject<{ TemporarilyUnavailable: z.ZodNull; }, z.core.$strict>, z.ZodObject<{ InsufficientAllowance: z.ZodObject<{ allowance: z.ZodBigInt; }, z.core.$strict>; }, z.core.$strict>, z.ZodObject<{ BadBurn: z.ZodObject<{ min_burn_amount: z.ZodBigInt; }, z.core.$strict>; }, z.core.$strict>, z.ZodObject<{ Duplicate: z.ZodObject<{ duplicate_of: z.ZodBigInt; }, z.core.$strict>; }, z.core.$strict>, z.ZodObject<{ BadFee: z.ZodObject<{ expected_fee: z.ZodBigInt; }, z.core.$strict>; }, z.core.$strict>, z.ZodObject<{ CreatedInFuture: z.ZodObject<{ ledger_time: z.ZodBigInt; }, z.core.$strict>; }, z.core.$strict>, z.ZodObject<{ TooOld: z.ZodNull; }, z.core.$strict>, z.ZodObject<{ InsufficientFunds: z.ZodObject<{ balance: z.ZodBigInt; }, z.core.$strict>; }, z.core.$strict>]>; export declare const TransferFromResultSchema: z.ZodUnion, z.ZodObject<{ Err: z.ZodUnion; }, z.core.$strict>, z.ZodObject<{ TemporarilyUnavailable: z.ZodNull; }, z.core.$strict>, z.ZodObject<{ InsufficientAllowance: z.ZodObject<{ allowance: z.ZodBigInt; }, z.core.$strict>; }, z.core.$strict>, z.ZodObject<{ BadBurn: z.ZodObject<{ min_burn_amount: z.ZodBigInt; }, z.core.$strict>; }, z.core.$strict>, z.ZodObject<{ Duplicate: z.ZodObject<{ duplicate_of: z.ZodBigInt; }, z.core.$strict>; }, z.core.$strict>, z.ZodObject<{ BadFee: z.ZodObject<{ expected_fee: z.ZodBigInt; }, z.core.$strict>; }, z.core.$strict>, z.ZodObject<{ CreatedInFuture: z.ZodObject<{ ledger_time: z.ZodBigInt; }, z.core.$strict>; }, z.core.$strict>, z.ZodObject<{ TooOld: z.ZodNull; }, z.core.$strict>, z.ZodObject<{ InsufficientFunds: z.ZodObject<{ balance: z.ZodBigInt; }, z.core.$strict>; }, z.core.$strict>]>; }, z.core.$strict>]>; export declare const ApproveArgsSchema: z.ZodObject<{ fee: z.ZodOptional; memo: z.ZodOptional, Uint8Array>>; from_subaccount: z.ZodOptional, Uint8Array>>; created_at_time: z.ZodOptional; amount: z.ZodBigInt; expected_allowance: z.ZodOptional; expires_at: z.ZodOptional; spender: z.ZodObject<{ owner: z.ZodPipe, z.ZodTransform>; subaccount: z.ZodOptional, Uint8Array>>; }, z.core.$strict>; }, z.core.$strict>; export declare const ApproveErrorSchema: z.ZodUnion; }, z.core.$strict>, z.ZodObject<{ TemporarilyUnavailable: z.ZodNull; }, z.core.$strict>, z.ZodObject<{ Duplicate: z.ZodObject<{ duplicate_of: z.ZodBigInt; }, z.core.$strict>; }, z.core.$strict>, z.ZodObject<{ BadFee: z.ZodObject<{ expected_fee: z.ZodBigInt; }, z.core.$strict>; }, z.core.$strict>, z.ZodObject<{ AllowanceChanged: z.ZodObject<{ current_allowance: z.ZodBigInt; }, z.core.$strict>; }, z.core.$strict>, z.ZodObject<{ CreatedInFuture: z.ZodObject<{ ledger_time: z.ZodBigInt; }, z.core.$strict>; }, z.core.$strict>, z.ZodObject<{ TooOld: z.ZodNull; }, z.core.$strict>, z.ZodObject<{ Expired: z.ZodObject<{ ledger_time: z.ZodBigInt; }, z.core.$strict>; }, z.core.$strict>, z.ZodObject<{ InsufficientFunds: z.ZodObject<{ balance: z.ZodBigInt; }, z.core.$strict>; }, z.core.$strict>]>; export declare const ApproveResultSchema: z.ZodUnion, z.ZodObject<{ Err: z.ZodUnion; }, z.core.$strict>, z.ZodObject<{ TemporarilyUnavailable: z.ZodNull; }, z.core.$strict>, z.ZodObject<{ Duplicate: z.ZodObject<{ duplicate_of: z.ZodBigInt; }, z.core.$strict>; }, z.core.$strict>, z.ZodObject<{ BadFee: z.ZodObject<{ expected_fee: z.ZodBigInt; }, z.core.$strict>; }, z.core.$strict>, z.ZodObject<{ AllowanceChanged: z.ZodObject<{ current_allowance: z.ZodBigInt; }, z.core.$strict>; }, z.core.$strict>, z.ZodObject<{ CreatedInFuture: z.ZodObject<{ ledger_time: z.ZodBigInt; }, z.core.$strict>; }, z.core.$strict>, z.ZodObject<{ TooOld: z.ZodNull; }, z.core.$strict>, z.ZodObject<{ Expired: z.ZodObject<{ ledger_time: z.ZodBigInt; }, z.core.$strict>; }, z.core.$strict>, z.ZodObject<{ InsufficientFunds: z.ZodObject<{ balance: z.ZodBigInt; }, z.core.$strict>; }, z.core.$strict>]>; }, z.core.$strict>]>; /** * Subaccount is an arbitrary 32-byte array used to compute the source address. */ export type Subaccount = Uint8Array; /** * An ICRC account, consisting of an owner principal and an optional subaccount. */ export interface Account { /** The account owner. */ owner: Principal; /** An optional subaccount to distinguish multiple accounts for the same owner. */ subaccount?: Subaccount; } /** * Errors that can occur during an ICRC-1 transfer. */ export type TransferError = /** An error not covered by the other variants. */ { GenericError: { message: string; error_code: bigint; }; } /** The ledger is temporarily unavailable. */ | { TemporarilyUnavailable: null; } /** The burn amount is below the minimum. */ | { BadBurn: { min_burn_amount: bigint; }; } /** The transaction is a duplicate. */ | { Duplicate: { duplicate_of: bigint; }; } /** The fee does not match the expected fee. */ | { BadFee: { expected_fee: bigint; }; } /** The `created_at_time` is too far in the future. */ | { CreatedInFuture: { ledger_time: bigint; }; } /** The transaction is too old. */ | { TooOld: null; } /** The account does not have enough funds. */ | { InsufficientFunds: { balance: bigint; }; }; /** * The result of an ICRC-1 `icrc1_transfer` call. * Returns the block index of the transaction on success. */ export type TransferResult = { Ok: bigint; } | { Err: TransferError; }; /** * Arguments for the ICRC-1 `icrc1_transfer` call. */ export interface TransferArgs { /** The destination account. */ to: Account; /** An optional fee. Uses the default ledger fee if not provided. */ fee?: bigint; /** An optional memo for the transaction. */ memo?: Uint8Array; /** An optional subaccount to transfer from. Uses the default subaccount if not provided. */ from_subaccount?: Subaccount; /** An optional timestamp. Uses current IC time if not provided. */ created_at_time?: bigint; /** The amount to transfer. */ amount: bigint; } /** * Errors that can occur during an ICRC-2 transfer-from. */ export type TransferFromError = /** An error not covered by the other variants. */ { GenericError: { message: string; error_code: bigint; }; } /** The ledger is temporarily unavailable. */ | { TemporarilyUnavailable: null; } /** The spender's allowance is insufficient. */ | { InsufficientAllowance: { allowance: bigint; }; } /** The burn amount is below the minimum. */ | { BadBurn: { min_burn_amount: bigint; }; } /** The transaction is a duplicate. */ | { Duplicate: { duplicate_of: bigint; }; } /** The fee does not match the expected fee. */ | { BadFee: { expected_fee: bigint; }; } /** The `created_at_time` is too far in the future. */ | { CreatedInFuture: { ledger_time: bigint; }; } /** The transaction is too old. */ | { TooOld: null; } /** The account does not have enough funds. */ | { InsufficientFunds: { balance: bigint; }; }; /** * The result of an ICRC-2 `icrc2_transfer_from` call. * Returns the block index of the transaction on success. */ export type TransferFromResult = { Ok: bigint; } | { Err: TransferFromError; }; /** * Arguments for the ICRC-2 `icrc2_transfer_from` call. */ export interface TransferFromArgs { /** The destination account. */ to: Account; /** An optional fee. Uses the default ledger fee if not provided. */ fee?: bigint; /** An optional subaccount of the spender. */ spender_subaccount?: Subaccount; /** The account to transfer from. */ from: Account; /** An optional memo for the transaction. */ memo?: Uint8Array; /** An optional timestamp. Uses current IC time if not provided. */ created_at_time?: bigint; /** The amount to transfer. */ amount: bigint; } /** * Amount of ICRC tokens, represented as a natural number. */ export type Tokens = bigint; /** * Arguments for the ICRC-2 `icrc2_approve` call. */ export interface ApproveArgs { /** An optional fee. Uses the default ledger fee if not provided. */ fee?: bigint; /** An optional memo for the transaction. */ memo?: Uint8Array; /** An optional subaccount of the approver. */ from_subaccount?: Subaccount; /** An optional timestamp. Uses current IC time if not provided. */ created_at_time?: bigint; /** The amount to approve. */ amount: bigint; /** An optional expected current allowance for optimistic concurrency control. */ expected_allowance?: bigint; /** An optional expiry timestamp for the approval. */ expires_at?: bigint; /** The spender account being approved. */ spender: Account; } /** * Errors that can occur during an ICRC-2 approve. */ export type ApproveError = { GenericError: { message: string; error_code: bigint; }; } | { TemporarilyUnavailable: null; } | { Duplicate: { duplicate_of: bigint; }; } | { BadFee: { expected_fee: bigint; }; } | { AllowanceChanged: { current_allowance: bigint; }; } | { CreatedInFuture: { ledger_time: bigint; }; } | { TooOld: null; } | { Expired: { ledger_time: bigint; }; } | { InsufficientFunds: { balance: bigint; }; }; /** * The result of an ICRC-2 `icrc2_approve` call. * Returns the block index of the approval on success. */ export type ApproveResult = { Ok: bigint; } | { Err: ApproveError; };