UNPKG

@metamask/snaps-rpc-methods

Version:
25 lines 941 B
import { PermissionType, SubjectType } from "@metamask/permission-controller"; import { SnapEndowments } from "./enum.mjs"; const permissionName = SnapEndowments.HomePage; /** * `endowment:page-home` returns nothing; it is intended to be used as a * flag by the snap controller to detect whether the snap has the capability to * use the snap home page feature. * * @param _builderOptions - Optional specification builder options. * @returns The specification for the `snap-pages` endowment. */ const specificationBuilder = (_builderOptions) => { return { permissionType: PermissionType.Endowment, targetName: permissionName, allowedCaveats: null, endowmentGetter: (_getterOptions) => null, subjectTypes: [SubjectType.Snap], }; }; export const homePageEndowmentBuilder = Object.freeze({ targetName: permissionName, specificationBuilder, }); //# sourceMappingURL=home-page.mjs.map