@metamask/snaps-rpc-methods
Version:
MetaMask Snaps JSON-RPC method implementations
31 lines • 1.19 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.webAssemblyEndowmentBuilder = void 0;
const permission_controller_1 = require("@metamask/permission-controller");
const enum_1 = require("./enum.cjs");
const permissionName = enum_1.SnapEndowments.WebAssemblyAccess;
/**
* `endowment:webassembly` returns the name of global browser API(s) that
* enable access to the WebAssembly API.
* This is intended to populate the endowments of the SES Compartment
* in which a Snap executes.
*
* @param _builderOptions - Optional specification builder options.
* @returns The specification for the WebAssembly endowment.
*/
const specificationBuilder = (_builderOptions) => {
return {
permissionType: permission_controller_1.PermissionType.Endowment,
targetName: permissionName,
allowedCaveats: null,
endowmentGetter: (_getterOptions) => {
return ['WebAssembly'];
},
subjectTypes: [permission_controller_1.SubjectType.Snap],
};
};
exports.webAssemblyEndowmentBuilder = Object.freeze({
targetName: permissionName,
specificationBuilder,
});
//# sourceMappingURL=web-assembly.cjs.map