import { Address, HttpRequestError } from 'viem'; export declare const standardErrors: { rpc: { parse: (arg?: EthErrorsArg) => EthereumRpcError; invalidRequest: (arg?: EthErrorsArg) => EthereumRpcError; invalidParams: (arg?: EthErrorsArg) => EthereumRpcError; methodNotFound: (arg?: EthErrorsArg) => EthereumRpcError; internal: (arg?: EthErrorsArg) => EthereumRpcError; server: (opts: ServerErrorOptions) => EthereumRpcError; invalidInput: (arg?: EthErrorsArg) => EthereumRpcError; resourceNotFound: (arg?: EthErrorsArg) => EthereumRpcError; resourceUnavailable: (arg?: EthErrorsArg) => EthereumRpcError; transactionRejected: (arg?: EthErrorsArg) => EthereumRpcError; methodNotSupported: (arg?: EthErrorsArg) => EthereumRpcError; limitExceeded: (arg?: EthErrorsArg) => EthereumRpcError; }; provider: { userRejectedRequest: (arg?: EthErrorsArg) => EthereumProviderError; unauthorized: (arg?: EthErrorsArg) => EthereumProviderError; unsupportedMethod: (arg?: EthErrorsArg) => EthereumProviderError; disconnected: (arg?: EthErrorsArg) => EthereumProviderError; chainDisconnected: (arg?: EthErrorsArg) => EthereumProviderError; unsupportedChain: (arg?: EthErrorsArg) => EthereumProviderError; custom: (opts: CustomErrorArg) => EthereumProviderError; }; }; interface EthereumErrorOptions { message?: string; data?: T; } interface ServerErrorOptions extends EthereumErrorOptions { code: number; } type CustomErrorArg = ServerErrorOptions; type EthErrorsArg = EthereumErrorOptions | string; declare class EthereumRpcError extends Error { code: number; data?: T; constructor(code: number, message: string, data?: T); } declare class EthereumProviderError extends EthereumRpcError { /** * Create an Ethereum Provider JSON-RPC error. * `code` must be an integer in the 1000 <= 4999 range. */ constructor(code: number, message: string, data?: T); } export type InsufficientBalanceErrorData = { type: 'INSUFFICIENT_FUNDS'; reason: 'NO_SUITABLE_SPEND_PERMISSION_FOUND' | 'SPEND_PERMISSION_ALLOWANCE_EXCEEDED'; account: { address: Address; }; /** * The amount of each token that is required to send the transaction. */ required: Record; }; declare class ActionableInsufficientBalanceError extends EthereumRpcError { } export declare function isActionableHttpRequestError(errorObject: unknown): errorObject is ActionableInsufficientBalanceError; export declare function isViemError(error: unknown): error is HttpRequestError; export declare function viemHttpErrorToProviderError(error: HttpRequestError): EthereumRpcError | null; export {}; //# sourceMappingURL=errors.d.ts.map