import { OptionalDataWithOptionalCause } from "../interfaces.js"; import { EthereumProviderError, JsonRpcError } from "./error-classes.js"; type EthereumErrorOptions = { message?: string; data?: Data; }; type ServerErrorOptions = { code: number; } & EthereumErrorOptions; type CustomErrorArg = ServerErrorOptions; export type JsonRpcErrorsArg = EthereumErrorOptions | string; export declare const rpcErrors: { /** * Get a JSON RPC 2.0 Parse (-32700) error. * * @param arg - The error message or options bag. * @returns An instance of the {@link JsonRpcError} class. */ parse: (arg?: JsonRpcErrorsArg) => JsonRpcError; /** * Get a JSON RPC 2.0 Invalid Request (-32600) error. * * @param arg - The error message or options bag. * @returns An instance of the {@link JsonRpcError} class. */ invalidRequest: (arg?: JsonRpcErrorsArg) => JsonRpcError; /** * Get a JSON RPC 2.0 Invalid Params (-32602) error. * * @param arg - The error message or options bag. * @returns An instance of the {@link JsonRpcError} class. */ invalidParams: (arg?: JsonRpcErrorsArg) => JsonRpcError; /** * Get a JSON RPC 2.0 Method Not Found (-32601) error. * * @param arg - The error message or options bag. * @returns An instance of the {@link JsonRpcError} class. */ methodNotFound: (arg?: JsonRpcErrorsArg) => JsonRpcError; /** * Get a JSON RPC 2.0 Internal (-32603) error. * * @param arg - The error message or options bag. * @returns An instance of the {@link JsonRpcError} class. */ internal: (arg?: JsonRpcErrorsArg) => JsonRpcError; /** * Get a JSON RPC 2.0 Server error. * Permits integer error codes in the [ -32099 <= -32005 ] range. * Codes -32000 through -32004 are reserved by EIP-1474. * * @param opts - The error options bag. * @returns An instance of the {@link JsonRpcError} class. */ server: (opts: ServerErrorOptions) => JsonRpcError; /** * Get an Ethereum JSON RPC Invalid Input (-32000) error. * * @param arg - The error message or options bag. * @returns An instance of the {@link JsonRpcError} class. */ invalidInput: (arg?: JsonRpcErrorsArg) => JsonRpcError; /** * Get an Ethereum JSON RPC Resource Not Found (-32001) error. * * @param arg - The error message or options bag. * @returns An instance of the {@link JsonRpcError} class. */ resourceNotFound: (arg?: JsonRpcErrorsArg) => JsonRpcError; /** * Get an Ethereum JSON RPC Resource Unavailable (-32002) error. * * @param arg - The error message or options bag. * @returns An instance of the {@link JsonRpcError} class. */ resourceUnavailable: (arg?: JsonRpcErrorsArg) => JsonRpcError; /** * Get an Ethereum JSON RPC Transaction Rejected (-32003) error. * * @param arg - The error message or options bag. * @returns An instance of the {@link JsonRpcError} class. */ transactionRejected: (arg?: JsonRpcErrorsArg) => JsonRpcError; /** * Get an Ethereum JSON RPC Method Not Supported (-32004) error. * * @param arg - The error message or options bag. * @returns An instance of the {@link JsonRpcError} class. */ methodNotSupported: (arg?: JsonRpcErrorsArg) => JsonRpcError; /** * Get an Ethereum JSON RPC Limit Exceeded (-32005) error. * * @param arg - The error message or options bag. * @returns An instance of the {@link JsonRpcError} class. */ limitExceeded: (arg?: JsonRpcErrorsArg) => JsonRpcError; }; export declare const providerErrors: { /** * Get an Ethereum Provider User Rejected Request (4001) error. * * @param arg - The error message or options bag. * @returns An instance of the {@link EthereumProviderError} class. */ userRejectedRequest: (arg?: JsonRpcErrorsArg) => EthereumProviderError; /** * Get an Ethereum Provider Unauthorized (4100) error. * * @param arg - The error message or options bag. * @returns An instance of the {@link EthereumProviderError} class. */ unauthorized: (arg?: JsonRpcErrorsArg) => EthereumProviderError; /** * Get an Ethereum Provider Unsupported Method (4200) error. * * @param arg - The error message or options bag. * @returns An instance of the {@link EthereumProviderError} class. */ unsupportedMethod: (arg?: JsonRpcErrorsArg) => EthereumProviderError; /** * Get an Ethereum Provider Not Connected (4900) error. * * @param arg - The error message or options bag. * @returns An instance of the {@link EthereumProviderError} class. */ disconnected: (arg?: JsonRpcErrorsArg) => EthereumProviderError; /** * Get an Ethereum Provider Chain Not Connected (4901) error. * * @param arg - The error message or options bag. * @returns An instance of the {@link EthereumProviderError} class. */ chainDisconnected: (arg?: JsonRpcErrorsArg) => EthereumProviderError; /** * Get a custom Ethereum Provider error. * * @param opts - The error options bag. * @returns An instance of the {@link EthereumProviderError} class. */ custom: (opts: CustomErrorArg) => EthereumProviderError; }; export {};