import { RouteResponse } from "@0xsquid/squid-types"; import type { SquidRouteError, SquidStatusError, TransactionErrorWithMessage } from "../../core/types/error"; import type { TransactionParams } from "../../core/types/transaction"; interface NormalizedError { code?: string | number; message?: string; reason?: string; } /** * Normalizes different error structures into a consistent format * This helps handle different wallet error formats uniformly */ export declare const normalizeError: (error: any) => NormalizedError; export declare const transactionErrorCode: Record; /** * Detects if an error is a user rejection based on normalized error structure */ export declare const isUserRejectionError: (normalizedError: NormalizedError) => boolean; /** * Converts any transaction error into a standardized TransactionErrorWithMessage format * @param error The error to convert * @returns A standardized error object */ export declare const getTransactionError: (error: any) => TransactionErrorWithMessage; /** * Handles dispatching appropriate events based on the error type */ export declare const handleTransactionErrorEvents: ({ error, transactionParams, walletProviderName, squidRoute, }: { error: TransactionErrorWithMessage; transactionParams: Pick | undefined; walletProviderName: string | undefined; squidRoute: RouteResponse["route"] | undefined; }) => TransactionErrorWithMessage; /** * Check if the error is a Squid route error */ export declare const isSwapRouteError: (error: any) => error is SquidRouteError; export declare const isStatusError: (error: any) => error is SquidStatusError; export {};