import type { JsonRpcMiddleware } from "@metamask/json-rpc-engine"; import type { PermissionConstraint, RequestedPermissions } from "@metamask/permission-controller"; import { type CaipChainId, type Json, type JsonRpcParams } from "@metamask/utils"; export type PreinstalledSnapsMiddlewareHooks = { /** * Get all available scopes with the eip155 prefix. * * @returns A list of all available scopes. */ getEvmScopes: () => CaipChainId[]; /** * Get all accounts with the eip155 scope. * * @returns A list of all account addresses from the eip155 scope. */ getAllEvmAccounts: () => string[]; /** * Get the current permissions for the requesting origin. * * @returns An object containing the metadata about each permission. */ getPermissions: () => Record | undefined; /** * Grant the passed permissions to the origin. * * @param permissions */ grantPermissions: (permissions: RequestedPermissions) => void; }; /** * Create a middleware that automatically grants account permissions to preinstalled Snaps * that want to use the Ethereum provider endowment. * * @param hooks - The hooks used by the middleware. * @param hooks.getEvmScopes - Hook for retrieving all available EVM scopes. * @param hooks.getAllEvmAccounts - Hook for retrieving all available EVM addresses. * @param hooks.getPermissions - Hook for retrieving the permissions of the requesting origin. * @param hooks.grantPermissions - Hook for granting permissions to the requesting origin. * @returns The middleware. */ export declare function createPreinstalledSnapsMiddleware({ getEvmScopes, getAllEvmAccounts, getPermissions, grantPermissions, }: PreinstalledSnapsMiddlewareHooks): JsonRpcMiddleware; //# sourceMappingURL=preinstalled-snaps.d.cts.map