/** * RPC error handling utilities * Parses NEAR RPC errors and throws appropriate typed exceptions */ import type { ExecutionOutcomeWithId, RpcMinimalTransaction, RpcTransaction } from "../types.js"; export interface RpcErrorResponse { name: string; code: number; message: string; data?: string | Record; cause?: { name: string; info?: Record; }; } /** * Extract error message from an ActionError failure object. * * @internal */ export declare function extractErrorMessage(failure: Record): string; /** * Check outcome for FunctionCallError and throw if found. * * @internal */ export declare function checkOutcomeForFunctionCallError(outcome: ExecutionOutcomeWithId, transaction: RpcTransaction | RpcMinimalTransaction | undefined): void; /** * Determine if an HTTP status code indicates a retryable error. * * @internal */ export declare function isRetryableStatus(statusCode: number): boolean; /** * Context for parsing query errors. */ interface QueryErrorContext { accountId?: string; publicKey?: string; contractId?: string; methodName?: string; } /** * Parse query result errors (from `result.error` field). * * Query methods (e.g. `view_access_key`, `call_function`) return errors in * `result.error` instead of the top-level error field. * * @internal */ export declare function parseQueryError(result: unknown, context?: QueryErrorContext): void; /** * Parse RPC error and throw appropriate typed error. * Follows NEAR RPC error documentation. * * @internal */ export declare function parseRpcError(error: RpcErrorResponse | undefined, statusCode?: number): never; export {}; //# sourceMappingURL=rpc-error-handler.d.ts.map