import { EthereumRpcError } from 'eth-rpc-errors'; import { PermissionType } from './Permission'; declare type UnauthorizedArg = { data?: Record; }; /** * Utility function for building an "unauthorized" error. * * @param opts - Optional arguments that add extra context * @returns The built error */ export declare function unauthorized(opts: UnauthorizedArg): import("eth-rpc-errors").EthereumProviderError>; /** * Utility function for building a "method not found" error. * * @param method - The method in question. * @param data - Optional data for context. * @returns The built error */ export declare function methodNotFound(method: string, data?: unknown): EthereumRpcError; declare type InvalidParamsArg = { message?: string; data?: unknown; }; /** * Utility function for building an "invalid params" error. * * @param opts - Optional arguments that add extra context * @returns The built error */ export declare function invalidParams(opts: InvalidParamsArg): EthereumRpcError; /** * Utility function for building an "user rejected request" error. * * @param data - Optional data to add extra context * @returns The built error */ export declare function userRejectedRequest>(data?: Data): EthereumRpcError; /** * Utility function for building an internal error. * * @param message - The error message * @param data - Optional data to add extra context * @returns The built error */ export declare function internalError>(message: string, data?: Data): EthereumRpcError; export declare class InvalidSubjectIdentifierError extends Error { constructor(origin: unknown); } export declare class UnrecognizedSubjectError extends Error { constructor(origin: string); } export declare class InvalidApprovedPermissionError extends Error { data: { origin: string; target: string; approvedPermission: Record; }; constructor(origin: string, target: string, approvedPermission: Record); } export declare class PermissionDoesNotExistError extends Error { constructor(origin: string, target: string); } export declare class EndowmentPermissionDoesNotExistError extends Error { data?: { origin: string; }; constructor(target: string, origin?: string); } export declare class UnrecognizedCaveatTypeError extends Error { data: { caveatType: string; origin?: string; target?: string; }; constructor(caveatType: string); constructor(caveatType: string, origin: string, target: string); } export declare class InvalidCaveatsPropertyError extends Error { data: { origin: string; target: string; caveatsProperty: unknown; }; constructor(origin: string, target: string, caveatsProperty: unknown); } export declare class CaveatDoesNotExistError extends Error { constructor(origin: string, target: string, caveatType: string); } export declare class CaveatAlreadyExistsError extends Error { constructor(origin: string, target: string, caveatType: string); } export declare class InvalidCaveatError extends EthereumRpcError { data: { origin: string; target: string; }; constructor(receivedCaveat: unknown, origin: string, target: string); } export declare class InvalidCaveatTypeError extends Error { data: { caveat: Record; origin: string; target: string; }; constructor(caveat: Record, origin: string, target: string); } export declare class CaveatMissingValueError extends Error { data: { caveat: Record; origin: string; target: string; }; constructor(caveat: Record, origin: string, target: string); } export declare class CaveatInvalidJsonError extends Error { data: { caveat: Record; origin: string; target: string; }; constructor(caveat: Record, origin: string, target: string); } export declare class InvalidCaveatFieldsError extends Error { data: { caveat: Record; origin: string; target: string; }; constructor(caveat: Record, origin: string, target: string); } export declare class ForbiddenCaveatError extends Error { data: { caveatType: string; origin: string; target: string; }; constructor(caveatType: string, origin: string, targetName: string); } export declare class DuplicateCaveatError extends Error { data: { caveatType: string; origin: string; target: string; }; constructor(caveatType: string, origin: string, targetName: string); } export declare class CaveatSpecificationMismatchError extends Error { data: { caveatSpec: Record; permissionType: PermissionType; }; constructor(caveatSpec: Record, permissionType: PermissionType); } export declare class PermissionsRequestNotFoundError extends Error { constructor(id: string); } export {};