import type { AsyncJsonRpcEngineNextCallback, JsonRpcEngineEndCallback } from "@metamask/json-rpc-engine"; import { type CaveatSpecificationConstraint, MethodNames, type PermissionController, type PermissionSpecificationConstraint } from "@metamask/permission-controller"; import type { Json, JsonRpcRequest, PendingJsonRpcResponse } from "@metamask/utils"; export declare const getPermissionsHandler: { methodNames: MethodNames[]; implementation: typeof getPermissionsImplementation; hookNames: { getPermissionsForOrigin: boolean; getAccounts: boolean; }; }; /** * Get Permissions implementation to be used in JsonRpcEngine middleware, specifically for `wallet_getPermissions` RPC method. * It makes use of a CAIP-25 endowment permission returned by `getPermissionsForOrigin` hook, if it exists. * * @param _req - The JsonRpcEngine request - unused * @param res - The JsonRpcEngine result object * @param _next - JsonRpcEngine next() callback - unused * @param end - JsonRpcEngine end() callback * @param options - Method hooks passed to the method implementation * @param options.getPermissionsForOrigin - The specific method hook needed for this method implementation * @param options.getAccounts - A hook that returns the permitted eth accounts for the origin sorted by lastSelected. * @returns A promise that resolves to nothing */ declare function getPermissionsImplementation(_req: JsonRpcRequest, res: PendingJsonRpcResponse, _next: AsyncJsonRpcEngineNextCallback, end: JsonRpcEngineEndCallback, { getPermissionsForOrigin, getAccounts, }: { getPermissionsForOrigin: () => ReturnType['getPermissions']>; getAccounts: (options?: { ignoreLock?: boolean; }) => string[]; }): Promise; export {}; //# sourceMappingURL=wallet-getPermissions.d.mts.map