/** * Zod schemas for NEAR client configuration. * * @remarks * These schemas validate network, call options, and {@link NearConfig} input. * Most applications should use the higher-level {@link Near} API and treat * these schemas as an implementation detail. */ import { z } from "zod"; import { type Amount, type Gas, type PrivateKey } from "../utils/validation.js"; /** * Schema for network presets (mainnet, testnet, localnet) */ export declare const NetworkPresetSchema: z.ZodEnum<{ mainnet: "mainnet"; testnet: "testnet"; localnet: "localnet"; betanet: "betanet"; }>; /** * Schema for custom network configuration */ export declare const CustomNetworkConfigSchema: z.ZodObject<{ rpcUrl: z.ZodString; networkId: z.ZodString; }, z.core.$strip>; /** * Schema for network configuration (preset or custom) */ export declare const NetworkConfigSchema: z.ZodUnion, z.ZodObject<{ rpcUrl: z.ZodString; networkId: z.ZodString; }, z.core.$strip>]>; export type NetworkPreset = z.infer; export type CustomNetworkConfig = z.infer; export type NetworkConfig = z.infer; /** * Schema for transaction execution status */ export declare const TxExecutionStatusSchema: z.ZodEnum<{ NONE: "NONE"; INCLUDED: "INCLUDED"; EXECUTED_OPTIMISTIC: "EXECUTED_OPTIMISTIC"; INCLUDED_FINAL: "INCLUDED_FINAL"; EXECUTED: "EXECUTED"; FINAL: "FINAL"; }>; /** * Schema for function call options */ export declare const CallOptionsSchema: z.ZodObject<{ gas: z.ZodOptional; attachedDeposit: z.ZodOptional>; signerId: z.ZodOptional; waitUntil: z.ZodOptional>; }, z.core.$strip>; export type CallOptions = { gas?: Gas; attachedDeposit?: Amount; signerId?: string; waitUntil?: z.infer; }; /** * Block reference for RPC queries * * Specify either `finality` OR `blockId` (not both). * If both are provided, `blockId` takes precedence. * * @example * ```typescript * // Query at final block (default) * await near.view('contract.near', 'get_value') * * // Query at optimistic for latest state * await near.view('contract.near', 'get_value', {}, { * finality: 'optimistic' * }) * * // Query at specific block height * await near.view('contract.near', 'get_value', {}, { * blockId: 27912554 * }) * * // Query at specific block hash * await near.view('contract.near', 'get_value', {}, { * blockId: '3Xz2wM9rigMXzA2c5vgCP8wTgFBaePucgUmVYPkMqhRL' * }) * ``` */ export declare const BlockReferenceSchema: z.ZodObject<{ finality: z.ZodOptional>; blockId: z.ZodOptional>; }, z.core.$strip>; export type BlockReference = z.infer; /** * Schema for key store configuration */ export declare const KeyStoreConfigSchema: z.ZodUnion, z.ZodAny]>; /** * Schema for signer function */ export declare const SignerSchema: z.ZodAny; /** * Schema for RPC retry configuration */ export declare const RpcRetryConfigSchema: z.ZodObject<{ maxRetries: z.ZodOptional; initialDelayMs: z.ZodOptional; }, z.core.$strip>; /** * Inferred type for RPC retry configuration input * Allows partial configuration with optional fields that can be undefined */ export type RpcRetryConfigInput = z.infer; /** * Schema for NEAR client configuration */ export declare const NearConfigSchema: z.ZodObject<{ network: z.ZodOptional, z.ZodObject<{ rpcUrl: z.ZodString; networkId: z.ZodString; }, z.core.$strip>]>>; rpcUrl: z.ZodOptional; headers: z.ZodOptional>; keyStore: z.ZodOptional, z.ZodAny]>>; signer: z.ZodOptional; privateKey: z.ZodOptional, Uint8Array>]>>; wallet: z.ZodOptional; defaultSignerId: z.ZodOptional; defaultWaitUntil: z.ZodOptional>; retryConfig: z.ZodOptional; initialDelayMs: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>; type NearConfigBase = z.infer; export type NearConfig = Omit & { privateKey?: PrivateKey | Uint8Array; }; /** * Resolve network configuration with validation */ export declare function resolveNetworkConfig(network?: NetworkConfig): { rpcUrl: string; networkId: string; }; export {}; //# sourceMappingURL=config-schemas.d.ts.map