@metamask/snaps-utils 5.1.0 → 5.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -6,6 +6,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [5.1.2]
10
+ ### Fixed
11
+ - Fix missing `global` during snap evaluation ([#2072](https://github.com/MetaMask/snaps/pull/2072))
12
+
13
+ ## [5.1.1]
14
+ ### Changed
15
+ - Fix missing export ([#2045](https://github.com/MetaMask/snaps/pull/2045))
16
+ - Bump `@metamask/permission-controller` from `6.0.0` to `7.0.0` ([#2064](https://github.com/MetaMask/snaps/pull/2064))
17
+
18
+ ### Removed
19
+ - Remove support for object-like syntax for cronjobs ([#2057](https://github.com/MetaMask/snaps/pull/2057))
20
+ - Since this never worked in the first place we aren't marking it as breaking.
21
+
9
22
  ## [5.1.0]
10
23
  ### Added
11
24
  - Add `getSnapDerivationPathName` and `getSlip44ProtocolName` to be shared across clients ([#2033](https://github.com/MetaMask/snaps/pull/2033))
@@ -129,7 +142,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
129
142
  - The version of the package no longer needs to match the version of all other
130
143
  MetaMask Snaps packages.
131
144
 
132
- [Unreleased]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-utils@5.1.0...HEAD
145
+ [Unreleased]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-utils@5.1.2...HEAD
146
+ [5.1.2]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-utils@5.1.1...@metamask/snaps-utils@5.1.2
147
+ [5.1.1]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-utils@5.1.0...@metamask/snaps-utils@5.1.1
133
148
  [5.1.0]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-utils@5.0.1...@metamask/snaps-utils@5.1.0
134
149
  [5.0.1]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-utils@5.0.0...@metamask/snaps-utils@5.0.1
135
150
  [5.0.0]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-utils@4.0.1...@metamask/snaps-utils@5.0.0
@@ -40,13 +40,7 @@ const CronjobRpcRequestStruct = (0, _superstruct.object)({
40
40
  method: (0, _superstruct.string)(),
41
41
  params: (0, _superstruct.optional)(_utils.JsonRpcParamsStruct)
42
42
  });
43
- const CronExpressionStruct = (0, _superstruct.refine)((0, _superstruct.coerce)((0, _superstruct.string)(), (0, _superstruct.object)({
44
- minute: (0, _superstruct.optional)((0, _superstruct.string)()),
45
- hour: (0, _superstruct.optional)((0, _superstruct.string)()),
46
- dayOfMonth: (0, _superstruct.optional)((0, _superstruct.string)()),
47
- month: (0, _superstruct.optional)((0, _superstruct.string)()),
48
- dayOfWeek: (0, _superstruct.optional)((0, _superstruct.string)())
49
- }), (value)=>`${value.minute ?? '*'} ${value.hour ?? '*'} ${value.dayOfMonth ?? '*'} ${value.month ?? '*'} ${value.dayOfWeek ?? '*'}`), 'CronExpression', (value)=>{
43
+ const CronExpressionStruct = (0, _superstruct.refine)((0, _superstruct.string)(), 'CronExpression', (value)=>{
50
44
  try {
51
45
  (0, _cronparser.parseExpression)(value);
52
46
  return true;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/cronjob.ts"],"sourcesContent":["import {\n JsonRpcIdStruct,\n JsonRpcParamsStruct,\n JsonRpcVersionStruct,\n} from '@metamask/utils';\nimport { parseExpression } from 'cron-parser';\nimport type { Infer } from 'superstruct';\nimport {\n array,\n coerce,\n create,\n object,\n optional,\n refine,\n string,\n} from 'superstruct';\n\nexport const CronjobRpcRequestStruct = object({\n jsonrpc: optional(JsonRpcVersionStruct),\n id: optional(JsonRpcIdStruct),\n method: string(),\n params: optional(JsonRpcParamsStruct),\n});\n\nexport type CronjobRpcRequest = Infer<typeof CronjobRpcRequestStruct>;\n\nexport const CronExpressionStruct = refine(\n coerce(\n string(),\n object({\n minute: optional(string()),\n hour: optional(string()),\n dayOfMonth: optional(string()),\n month: optional(string()),\n dayOfWeek: optional(string()),\n }),\n (value) =>\n `${value.minute ?? '*'} ${value.hour ?? '*'} ${value.dayOfMonth ?? '*'} ${\n value.month ?? '*'\n } ${value.dayOfWeek ?? '*'}`,\n ),\n 'CronExpression',\n (value) => {\n try {\n parseExpression(value);\n return true;\n } catch {\n return false;\n }\n },\n);\n\nexport type CronExpression = Infer<typeof CronExpressionStruct>;\n\n/**\n * Parses a cron expression.\n *\n * @param expression - Expression to parse.\n * @returns A CronExpression class instance.\n */\nexport function parseCronExpression(expression: string | object) {\n const ensureStringExpression = create(expression, CronExpressionStruct);\n return parseExpression(ensureStringExpression);\n}\n\nexport const CronjobSpecificationStruct = object({\n expression: CronExpressionStruct,\n request: CronjobRpcRequestStruct,\n});\nexport type CronjobSpecification = Infer<typeof CronjobSpecificationStruct>;\n\n/**\n * Check if the given value is a {@link CronjobSpecification} object.\n *\n * @param value - The value to check.\n * @returns Whether the value is a valid {@link CronjobSpecification} object.\n */\nexport function isCronjobSpecification(value: unknown): boolean {\n try {\n create(value, CronjobSpecificationStruct);\n return true;\n } catch {\n return false;\n }\n}\n\nexport const CronjobSpecificationArrayStruct = array(\n CronjobSpecificationStruct,\n);\n\n/**\n * Check if the given value is an array of {@link CronjobSpecification} objects.\n *\n * @param value - The value to check.\n * @returns Whether the value is a valid array of {@link CronjobSpecification} objects.\n */\nexport function isCronjobSpecificationArray(value: unknown): boolean {\n try {\n create(value, CronjobSpecificationArrayStruct);\n return true;\n } catch {\n return false;\n }\n}\n"],"names":["CronjobRpcRequestStruct","CronExpressionStruct","parseCronExpression","CronjobSpecificationStruct","isCronjobSpecification","CronjobSpecificationArrayStruct","isCronjobSpecificationArray","object","jsonrpc","optional","JsonRpcVersionStruct","id","JsonRpcIdStruct","method","string","params","JsonRpcParamsStruct","refine","coerce","minute","hour","dayOfMonth","month","dayOfWeek","value","parseExpression","expression","ensureStringExpression","create","request","array"],"mappings":";;;;;;;;;;;IAiBaA,uBAAuB;eAAvBA;;IASAC,oBAAoB;eAApBA;;IAkCGC,mBAAmB;eAAnBA;;IAKHC,0BAA0B;eAA1BA;;IAYGC,sBAAsB;eAAtBA;;IASHC,+BAA+B;eAA/BA;;IAUGC,2BAA2B;eAA3BA;;;uBA5FT;4BACyB;6BAUzB;AAEA,MAAMN,0BAA0BO,IAAAA,mBAAM,EAAC;IAC5CC,SAASC,IAAAA,qBAAQ,EAACC,2BAAoB;IACtCC,IAAIF,IAAAA,qBAAQ,EAACG,sBAAe;IAC5BC,QAAQC,IAAAA,mBAAM;IACdC,QAAQN,IAAAA,qBAAQ,EAACO,0BAAmB;AACtC;AAIO,MAAMf,uBAAuBgB,IAAAA,mBAAM,EACxCC,IAAAA,mBAAM,EACJJ,IAAAA,mBAAM,KACNP,IAAAA,mBAAM,EAAC;IACLY,QAAQV,IAAAA,qBAAQ,EAACK,IAAAA,mBAAM;IACvBM,MAAMX,IAAAA,qBAAQ,EAACK,IAAAA,mBAAM;IACrBO,YAAYZ,IAAAA,qBAAQ,EAACK,IAAAA,mBAAM;IAC3BQ,OAAOb,IAAAA,qBAAQ,EAACK,IAAAA,mBAAM;IACtBS,WAAWd,IAAAA,qBAAQ,EAACK,IAAAA,mBAAM;AAC5B,IACA,CAACU,QACC,CAAC,EAAEA,MAAML,MAAM,IAAI,IAAI,CAAC,EAAEK,MAAMJ,IAAI,IAAI,IAAI,CAAC,EAAEI,MAAMH,UAAU,IAAI,IAAI,CAAC,EACtEG,MAAMF,KAAK,IAAI,IAChB,CAAC,EAAEE,MAAMD,SAAS,IAAI,IAAI,CAAC,GAEhC,kBACA,CAACC;IACC,IAAI;QACFC,IAAAA,2BAAe,EAACD;QAChB,OAAO;IACT,EAAE,OAAM;QACN,OAAO;IACT;AACF;AAWK,SAAStB,oBAAoBwB,UAA2B;IAC7D,MAAMC,yBAAyBC,IAAAA,mBAAM,EAACF,YAAYzB;IAClD,OAAOwB,IAAAA,2BAAe,EAACE;AACzB;AAEO,MAAMxB,6BAA6BI,IAAAA,mBAAM,EAAC;IAC/CmB,YAAYzB;IACZ4B,SAAS7B;AACX;AASO,SAASI,uBAAuBoB,KAAc;IACnD,IAAI;QACFI,IAAAA,mBAAM,EAACJ,OAAOrB;QACd,OAAO;IACT,EAAE,OAAM;QACN,OAAO;IACT;AACF;AAEO,MAAME,kCAAkCyB,IAAAA,kBAAK,EAClD3B;AASK,SAASG,4BAA4BkB,KAAc;IACxD,IAAI;QACFI,IAAAA,mBAAM,EAACJ,OAAOnB;QACd,OAAO;IACT,EAAE,OAAM;QACN,OAAO;IACT;AACF"}
1
+ {"version":3,"sources":["../../src/cronjob.ts"],"sourcesContent":["import {\n JsonRpcIdStruct,\n JsonRpcParamsStruct,\n JsonRpcVersionStruct,\n} from '@metamask/utils';\nimport { parseExpression } from 'cron-parser';\nimport type { Infer } from 'superstruct';\nimport { array, create, object, optional, refine, string } from 'superstruct';\n\nexport const CronjobRpcRequestStruct = object({\n jsonrpc: optional(JsonRpcVersionStruct),\n id: optional(JsonRpcIdStruct),\n method: string(),\n params: optional(JsonRpcParamsStruct),\n});\n\nexport type CronjobRpcRequest = Infer<typeof CronjobRpcRequestStruct>;\n\nexport const CronExpressionStruct = refine(\n string(),\n 'CronExpression',\n (value) => {\n try {\n parseExpression(value);\n return true;\n } catch {\n return false;\n }\n },\n);\n\nexport type CronExpression = Infer<typeof CronExpressionStruct>;\n\n/**\n * Parses a cron expression.\n *\n * @param expression - Expression to parse.\n * @returns A CronExpression class instance.\n */\nexport function parseCronExpression(expression: string | object) {\n const ensureStringExpression = create(expression, CronExpressionStruct);\n return parseExpression(ensureStringExpression);\n}\n\nexport const CronjobSpecificationStruct = object({\n expression: CronExpressionStruct,\n request: CronjobRpcRequestStruct,\n});\nexport type CronjobSpecification = Infer<typeof CronjobSpecificationStruct>;\n\n/**\n * Check if the given value is a {@link CronjobSpecification} object.\n *\n * @param value - The value to check.\n * @returns Whether the value is a valid {@link CronjobSpecification} object.\n */\nexport function isCronjobSpecification(value: unknown): boolean {\n try {\n create(value, CronjobSpecificationStruct);\n return true;\n } catch {\n return false;\n }\n}\n\nexport const CronjobSpecificationArrayStruct = array(\n CronjobSpecificationStruct,\n);\n\n/**\n * Check if the given value is an array of {@link CronjobSpecification} objects.\n *\n * @param value - The value to check.\n * @returns Whether the value is a valid array of {@link CronjobSpecification} objects.\n */\nexport function isCronjobSpecificationArray(value: unknown): boolean {\n try {\n create(value, CronjobSpecificationArrayStruct);\n return true;\n } catch {\n return false;\n }\n}\n"],"names":["CronjobRpcRequestStruct","CronExpressionStruct","parseCronExpression","CronjobSpecificationStruct","isCronjobSpecification","CronjobSpecificationArrayStruct","isCronjobSpecificationArray","object","jsonrpc","optional","JsonRpcVersionStruct","id","JsonRpcIdStruct","method","string","params","JsonRpcParamsStruct","refine","value","parseExpression","expression","ensureStringExpression","create","request","array"],"mappings":";;;;;;;;;;;IASaA,uBAAuB;eAAvBA;;IASAC,oBAAoB;eAApBA;;IAqBGC,mBAAmB;eAAnBA;;IAKHC,0BAA0B;eAA1BA;;IAYGC,sBAAsB;eAAtBA;;IASHC,+BAA+B;eAA/BA;;IAUGC,2BAA2B;eAA3BA;;;uBAvET;4BACyB;6BAEgC;AAEzD,MAAMN,0BAA0BO,IAAAA,mBAAM,EAAC;IAC5CC,SAASC,IAAAA,qBAAQ,EAACC,2BAAoB;IACtCC,IAAIF,IAAAA,qBAAQ,EAACG,sBAAe;IAC5BC,QAAQC,IAAAA,mBAAM;IACdC,QAAQN,IAAAA,qBAAQ,EAACO,0BAAmB;AACtC;AAIO,MAAMf,uBAAuBgB,IAAAA,mBAAM,EACxCH,IAAAA,mBAAM,KACN,kBACA,CAACI;IACC,IAAI;QACFC,IAAAA,2BAAe,EAACD;QAChB,OAAO;IACT,EAAE,OAAM;QACN,OAAO;IACT;AACF;AAWK,SAAShB,oBAAoBkB,UAA2B;IAC7D,MAAMC,yBAAyBC,IAAAA,mBAAM,EAACF,YAAYnB;IAClD,OAAOkB,IAAAA,2BAAe,EAACE;AACzB;AAEO,MAAMlB,6BAA6BI,IAAAA,mBAAM,EAAC;IAC/Ca,YAAYnB;IACZsB,SAASvB;AACX;AASO,SAASI,uBAAuBc,KAAc;IACnD,IAAI;QACFI,IAAAA,mBAAM,EAACJ,OAAOf;QACd,OAAO;IACT,EAAE,OAAM;QACN,OAAO;IACT;AACF;AAEO,MAAME,kCAAkCmB,IAAAA,kBAAK,EAClDrB;AASK,SAASG,4BAA4BY,KAAc;IACxD,IAAI;QACFI,IAAAA,mBAAM,EAACJ,OAAOb;QACd,OAAO;IACT,EAAE,OAAM;QACN,OAAO;IACT;AACF"}
@@ -18,29 +18,20 @@ lockdown({
18
18
  // Node.js domains are deprecated.
19
19
  domainTaming: 'unsafe'
20
20
  });
21
- /**
22
- * Get mock endowments that don't do anything. This is useful for running the
23
- * eval, for snaps that try to communicate with the extension on initialisation,
24
- * for example.
25
- *
26
- * @returns The mock endowments.
27
- */ function getMockEndowments() {
28
- const endowments = (0, _mock.generateMockEndowments)();
29
- return {
30
- ...endowments,
31
- window: endowments,
32
- self: endowments
33
- };
34
- }
35
21
  const snapFilePath = process.argv[2];
36
22
  const snapModule = {
37
23
  exports: {}
38
24
  };
39
- new Compartment({
40
- ...getMockEndowments(),
25
+ const compartment = new Compartment({
26
+ ...(0, _mock.generateMockEndowments)(),
41
27
  module: snapModule,
42
28
  exports: snapModule.exports
43
- }).evaluate((0, _fs.readFileSync)(snapFilePath, 'utf8'));
29
+ });
30
+ // Mirror BaseSnapExecutor
31
+ compartment.globalThis.self = compartment.globalThis;
32
+ compartment.globalThis.global = compartment.globalThis;
33
+ compartment.globalThis.window = compartment.globalThis;
34
+ compartment.evaluate((0, _fs.readFileSync)(snapFilePath, 'utf8'));
44
35
  const invalidExports = Object.keys(snapModule.exports).filter((snapExport)=>!_handlertypes.SNAP_EXPORT_NAMES.includes(snapExport));
45
36
  if (invalidExports.length > 0) {
46
37
  // eslint-disable-next-line no-console
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/eval-worker.ts"],"sourcesContent":["// eslint-disable-next-line import/no-unassigned-import\nimport 'ses/lockdown';\n\nimport { readFileSync } from 'fs';\n\nimport type { HandlerType } from './handler-types';\nimport { SNAP_EXPORT_NAMES } from './handler-types';\nimport { generateMockEndowments } from './mock';\n\ndeclare let lockdown: any, Compartment: any;\n\nlockdown({\n consoleTaming: 'unsafe',\n errorTaming: 'unsafe',\n mathTaming: 'unsafe',\n dateTaming: 'unsafe',\n overrideTaming: 'severe',\n\n // We disable domain taming, because it does not work in certain cases when\n // running tests. This is unlikely to be a problem in production, because\n // Node.js domains are deprecated.\n domainTaming: 'unsafe',\n});\n\n/**\n * Get mock endowments that don't do anything. This is useful for running the\n * eval, for snaps that try to communicate with the extension on initialisation,\n * for example.\n *\n * @returns The mock endowments.\n */\nfunction getMockEndowments() {\n const endowments = generateMockEndowments();\n return {\n ...endowments,\n window: endowments,\n self: endowments,\n };\n}\n\nconst snapFilePath = process.argv[2];\n\nconst snapModule: { exports?: any } = { exports: {} };\n\nnew Compartment({\n ...getMockEndowments(),\n module: snapModule,\n exports: snapModule.exports,\n}).evaluate(readFileSync(snapFilePath, 'utf8'));\n\nconst invalidExports = Object.keys(snapModule.exports).filter(\n (snapExport) => !SNAP_EXPORT_NAMES.includes(snapExport as HandlerType),\n);\n\nif (invalidExports.length > 0) {\n // eslint-disable-next-line no-console\n console.warn(`Invalid snap exports detected:\\n${invalidExports.join('\\n')}`);\n}\n\nsetTimeout(() => process.exit(0), 1000); // Hack to ensure worker exits\n"],"names":["lockdown","consoleTaming","errorTaming","mathTaming","dateTaming","overrideTaming","domainTaming","getMockEndowments","endowments","generateMockEndowments","window","self","snapFilePath","process","argv","snapModule","exports","Compartment","module","evaluate","readFileSync","invalidExports","Object","keys","filter","snapExport","SNAP_EXPORT_NAMES","includes","length","console","warn","join","setTimeout","exit"],"mappings":"AAAA,uDAAuD;;;;;QAChD;oBAEsB;8BAGK;sBACK;AAIvCA,SAAS;IACPC,eAAe;IACfC,aAAa;IACbC,YAAY;IACZC,YAAY;IACZC,gBAAgB;IAEhB,2EAA2E;IAC3E,yEAAyE;IACzE,kCAAkC;IAClCC,cAAc;AAChB;AAEA;;;;;;CAMC,GACD,SAASC;IACP,MAAMC,aAAaC,IAAAA,4BAAsB;IACzC,OAAO;QACL,GAAGD,UAAU;QACbE,QAAQF;QACRG,MAAMH;IACR;AACF;AAEA,MAAMI,eAAeC,QAAQC,IAAI,CAAC,EAAE;AAEpC,MAAMC,aAAgC;IAAEC,SAAS,CAAC;AAAE;AAEpD,IAAIC,YAAY;IACd,GAAGV,mBAAmB;IACtBW,QAAQH;IACRC,SAASD,WAAWC,OAAO;AAC7B,GAAGG,QAAQ,CAACC,IAAAA,gBAAY,EAACR,cAAc;AAEvC,MAAMS,iBAAiBC,OAAOC,IAAI,CAACR,WAAWC,OAAO,EAAEQ,MAAM,CAC3D,CAACC,aAAe,CAACC,+BAAiB,CAACC,QAAQ,CAACF;AAG9C,IAAIJ,eAAeO,MAAM,GAAG,GAAG;IAC7B,sCAAsC;IACtCC,QAAQC,IAAI,CAAC,CAAC,gCAAgC,EAAET,eAAeU,IAAI,CAAC,MAAM,CAAC;AAC7E;AAEAC,WAAW,IAAMnB,QAAQoB,IAAI,CAAC,IAAI,OAAO,8BAA8B"}
1
+ {"version":3,"sources":["../../src/eval-worker.ts"],"sourcesContent":["// eslint-disable-next-line import/no-unassigned-import\nimport 'ses/lockdown';\n\nimport { readFileSync } from 'fs';\n\nimport type { HandlerType } from './handler-types';\nimport { SNAP_EXPORT_NAMES } from './handler-types';\nimport { generateMockEndowments } from './mock';\n\ndeclare let lockdown: any, Compartment: any;\n\nlockdown({\n consoleTaming: 'unsafe',\n errorTaming: 'unsafe',\n mathTaming: 'unsafe',\n dateTaming: 'unsafe',\n overrideTaming: 'severe',\n\n // We disable domain taming, because it does not work in certain cases when\n // running tests. This is unlikely to be a problem in production, because\n // Node.js domains are deprecated.\n domainTaming: 'unsafe',\n});\n\nconst snapFilePath = process.argv[2];\n\nconst snapModule: { exports?: any } = { exports: {} };\n\nconst compartment = new Compartment({\n ...generateMockEndowments(),\n module: snapModule,\n exports: snapModule.exports,\n});\n\n// Mirror BaseSnapExecutor\ncompartment.globalThis.self = compartment.globalThis;\ncompartment.globalThis.global = compartment.globalThis;\ncompartment.globalThis.window = compartment.globalThis;\n\ncompartment.evaluate(readFileSync(snapFilePath, 'utf8'));\n\nconst invalidExports = Object.keys(snapModule.exports).filter(\n (snapExport) => !SNAP_EXPORT_NAMES.includes(snapExport as HandlerType),\n);\n\nif (invalidExports.length > 0) {\n // eslint-disable-next-line no-console\n console.warn(`Invalid snap exports detected:\\n${invalidExports.join('\\n')}`);\n}\n\nsetTimeout(() => process.exit(0), 1000); // Hack to ensure worker exits\n"],"names":["lockdown","consoleTaming","errorTaming","mathTaming","dateTaming","overrideTaming","domainTaming","snapFilePath","process","argv","snapModule","exports","compartment","Compartment","generateMockEndowments","module","globalThis","self","global","window","evaluate","readFileSync","invalidExports","Object","keys","filter","snapExport","SNAP_EXPORT_NAMES","includes","length","console","warn","join","setTimeout","exit"],"mappings":"AAAA,uDAAuD;;;;;QAChD;oBAEsB;8BAGK;sBACK;AAIvCA,SAAS;IACPC,eAAe;IACfC,aAAa;IACbC,YAAY;IACZC,YAAY;IACZC,gBAAgB;IAEhB,2EAA2E;IAC3E,yEAAyE;IACzE,kCAAkC;IAClCC,cAAc;AAChB;AAEA,MAAMC,eAAeC,QAAQC,IAAI,CAAC,EAAE;AAEpC,MAAMC,aAAgC;IAAEC,SAAS,CAAC;AAAE;AAEpD,MAAMC,cAAc,IAAIC,YAAY;IAClC,GAAGC,IAAAA,4BAAsB,GAAE;IAC3BC,QAAQL;IACRC,SAASD,WAAWC,OAAO;AAC7B;AAEA,0BAA0B;AAC1BC,YAAYI,UAAU,CAACC,IAAI,GAAGL,YAAYI,UAAU;AACpDJ,YAAYI,UAAU,CAACE,MAAM,GAAGN,YAAYI,UAAU;AACtDJ,YAAYI,UAAU,CAACG,MAAM,GAAGP,YAAYI,UAAU;AAEtDJ,YAAYQ,QAAQ,CAACC,IAAAA,gBAAY,EAACd,cAAc;AAEhD,MAAMe,iBAAiBC,OAAOC,IAAI,CAACd,WAAWC,OAAO,EAAEc,MAAM,CAC3D,CAACC,aAAe,CAACC,+BAAiB,CAACC,QAAQ,CAACF;AAG9C,IAAIJ,eAAeO,MAAM,GAAG,GAAG;IAC7B,sCAAsC;IACtCC,QAAQC,IAAI,CAAC,CAAC,gCAAgC,EAAET,eAAeU,IAAI,CAAC,MAAM,CAAC;AAC7E;AAEAC,WAAW,IAAMzB,QAAQ0B,IAAI,CAAC,IAAI,OAAO,8BAA8B"}
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  _export_star(require("./errors"), exports);
7
7
  _export_star(require("./handlers"), exports);
8
8
  _export_star(require("./handler-types"), exports);
9
+ _export_star(require("./iframe"), exports);
9
10
  _export_star(require("./logging"), exports);
10
11
  _export_star(require("./namespace"), exports);
11
12
  _export_star(require("./types"), exports);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.executionenv.ts"],"sourcesContent":["// Special entrypoint for execution environments for bundle sizing reasons\nexport * from './errors';\nexport * from './handlers';\nexport * from './handler-types';\nexport * from './logging';\nexport * from './namespace';\nexport * from './types';\n"],"names":[],"mappings":"AAAA,0EAA0E;;;;;qBAC5D;qBACA;qBACA;qBACA;qBACA;qBACA"}
1
+ {"version":3,"sources":["../../src/index.executionenv.ts"],"sourcesContent":["// Special entrypoint for execution environments for bundle sizing reasons\nexport * from './errors';\nexport * from './handlers';\nexport * from './handler-types';\nexport * from './iframe';\nexport * from './logging';\nexport * from './namespace';\nexport * from './types';\n"],"names":[],"mappings":"AAAA,0EAA0E;;;;;qBAC5D;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA"}
@@ -1,19 +1,13 @@
1
1
  import { JsonRpcIdStruct, JsonRpcParamsStruct, JsonRpcVersionStruct } from '@metamask/utils';
2
2
  import { parseExpression } from 'cron-parser';
3
- import { array, coerce, create, object, optional, refine, string } from 'superstruct';
3
+ import { array, create, object, optional, refine, string } from 'superstruct';
4
4
  export const CronjobRpcRequestStruct = object({
5
5
  jsonrpc: optional(JsonRpcVersionStruct),
6
6
  id: optional(JsonRpcIdStruct),
7
7
  method: string(),
8
8
  params: optional(JsonRpcParamsStruct)
9
9
  });
10
- export const CronExpressionStruct = refine(coerce(string(), object({
11
- minute: optional(string()),
12
- hour: optional(string()),
13
- dayOfMonth: optional(string()),
14
- month: optional(string()),
15
- dayOfWeek: optional(string())
16
- }), (value)=>`${value.minute ?? '*'} ${value.hour ?? '*'} ${value.dayOfMonth ?? '*'} ${value.month ?? '*'} ${value.dayOfWeek ?? '*'}`), 'CronExpression', (value)=>{
10
+ export const CronExpressionStruct = refine(string(), 'CronExpression', (value)=>{
17
11
  try {
18
12
  parseExpression(value);
19
13
  return true;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/cronjob.ts"],"sourcesContent":["import {\n JsonRpcIdStruct,\n JsonRpcParamsStruct,\n JsonRpcVersionStruct,\n} from '@metamask/utils';\nimport { parseExpression } from 'cron-parser';\nimport type { Infer } from 'superstruct';\nimport {\n array,\n coerce,\n create,\n object,\n optional,\n refine,\n string,\n} from 'superstruct';\n\nexport const CronjobRpcRequestStruct = object({\n jsonrpc: optional(JsonRpcVersionStruct),\n id: optional(JsonRpcIdStruct),\n method: string(),\n params: optional(JsonRpcParamsStruct),\n});\n\nexport type CronjobRpcRequest = Infer<typeof CronjobRpcRequestStruct>;\n\nexport const CronExpressionStruct = refine(\n coerce(\n string(),\n object({\n minute: optional(string()),\n hour: optional(string()),\n dayOfMonth: optional(string()),\n month: optional(string()),\n dayOfWeek: optional(string()),\n }),\n (value) =>\n `${value.minute ?? '*'} ${value.hour ?? '*'} ${value.dayOfMonth ?? '*'} ${\n value.month ?? '*'\n } ${value.dayOfWeek ?? '*'}`,\n ),\n 'CronExpression',\n (value) => {\n try {\n parseExpression(value);\n return true;\n } catch {\n return false;\n }\n },\n);\n\nexport type CronExpression = Infer<typeof CronExpressionStruct>;\n\n/**\n * Parses a cron expression.\n *\n * @param expression - Expression to parse.\n * @returns A CronExpression class instance.\n */\nexport function parseCronExpression(expression: string | object) {\n const ensureStringExpression = create(expression, CronExpressionStruct);\n return parseExpression(ensureStringExpression);\n}\n\nexport const CronjobSpecificationStruct = object({\n expression: CronExpressionStruct,\n request: CronjobRpcRequestStruct,\n});\nexport type CronjobSpecification = Infer<typeof CronjobSpecificationStruct>;\n\n/**\n * Check if the given value is a {@link CronjobSpecification} object.\n *\n * @param value - The value to check.\n * @returns Whether the value is a valid {@link CronjobSpecification} object.\n */\nexport function isCronjobSpecification(value: unknown): boolean {\n try {\n create(value, CronjobSpecificationStruct);\n return true;\n } catch {\n return false;\n }\n}\n\nexport const CronjobSpecificationArrayStruct = array(\n CronjobSpecificationStruct,\n);\n\n/**\n * Check if the given value is an array of {@link CronjobSpecification} objects.\n *\n * @param value - The value to check.\n * @returns Whether the value is a valid array of {@link CronjobSpecification} objects.\n */\nexport function isCronjobSpecificationArray(value: unknown): boolean {\n try {\n create(value, CronjobSpecificationArrayStruct);\n return true;\n } catch {\n return false;\n }\n}\n"],"names":["JsonRpcIdStruct","JsonRpcParamsStruct","JsonRpcVersionStruct","parseExpression","array","coerce","create","object","optional","refine","string","CronjobRpcRequestStruct","jsonrpc","id","method","params","CronExpressionStruct","minute","hour","dayOfMonth","month","dayOfWeek","value","parseCronExpression","expression","ensureStringExpression","CronjobSpecificationStruct","request","isCronjobSpecification","CronjobSpecificationArrayStruct","isCronjobSpecificationArray"],"mappings":"AAAA,SACEA,eAAe,EACfC,mBAAmB,EACnBC,oBAAoB,QACf,kBAAkB;AACzB,SAASC,eAAe,QAAQ,cAAc;AAE9C,SACEC,KAAK,EACLC,MAAM,EACNC,MAAM,EACNC,MAAM,EACNC,QAAQ,EACRC,MAAM,EACNC,MAAM,QACD,cAAc;AAErB,OAAO,MAAMC,0BAA0BJ,OAAO;IAC5CK,SAASJ,SAASN;IAClBW,IAAIL,SAASR;IACbc,QAAQJ;IACRK,QAAQP,SAASP;AACnB,GAAG;AAIH,OAAO,MAAMe,uBAAuBP,OAClCJ,OACEK,UACAH,OAAO;IACLU,QAAQT,SAASE;IACjBQ,MAAMV,SAASE;IACfS,YAAYX,SAASE;IACrBU,OAAOZ,SAASE;IAChBW,WAAWb,SAASE;AACtB,IACA,CAACY,QACC,CAAC,EAAEA,MAAML,MAAM,IAAI,IAAI,CAAC,EAAEK,MAAMJ,IAAI,IAAI,IAAI,CAAC,EAAEI,MAAMH,UAAU,IAAI,IAAI,CAAC,EACtEG,MAAMF,KAAK,IAAI,IAChB,CAAC,EAAEE,MAAMD,SAAS,IAAI,IAAI,CAAC,GAEhC,kBACA,CAACC;IACC,IAAI;QACFnB,gBAAgBmB;QAChB,OAAO;IACT,EAAE,OAAM;QACN,OAAO;IACT;AACF,GACA;AAIF;;;;;CAKC,GACD,OAAO,SAASC,oBAAoBC,UAA2B;IAC7D,MAAMC,yBAAyBnB,OAAOkB,YAAYR;IAClD,OAAOb,gBAAgBsB;AACzB;AAEA,OAAO,MAAMC,6BAA6BnB,OAAO;IAC/CiB,YAAYR;IACZW,SAAShB;AACX,GAAG;AAGH;;;;;CAKC,GACD,OAAO,SAASiB,uBAAuBN,KAAc;IACnD,IAAI;QACFhB,OAAOgB,OAAOI;QACd,OAAO;IACT,EAAE,OAAM;QACN,OAAO;IACT;AACF;AAEA,OAAO,MAAMG,kCAAkCzB,MAC7CsB,4BACA;AAEF;;;;;CAKC,GACD,OAAO,SAASI,4BAA4BR,KAAc;IACxD,IAAI;QACFhB,OAAOgB,OAAOO;QACd,OAAO;IACT,EAAE,OAAM;QACN,OAAO;IACT;AACF"}
1
+ {"version":3,"sources":["../../src/cronjob.ts"],"sourcesContent":["import {\n JsonRpcIdStruct,\n JsonRpcParamsStruct,\n JsonRpcVersionStruct,\n} from '@metamask/utils';\nimport { parseExpression } from 'cron-parser';\nimport type { Infer } from 'superstruct';\nimport { array, create, object, optional, refine, string } from 'superstruct';\n\nexport const CronjobRpcRequestStruct = object({\n jsonrpc: optional(JsonRpcVersionStruct),\n id: optional(JsonRpcIdStruct),\n method: string(),\n params: optional(JsonRpcParamsStruct),\n});\n\nexport type CronjobRpcRequest = Infer<typeof CronjobRpcRequestStruct>;\n\nexport const CronExpressionStruct = refine(\n string(),\n 'CronExpression',\n (value) => {\n try {\n parseExpression(value);\n return true;\n } catch {\n return false;\n }\n },\n);\n\nexport type CronExpression = Infer<typeof CronExpressionStruct>;\n\n/**\n * Parses a cron expression.\n *\n * @param expression - Expression to parse.\n * @returns A CronExpression class instance.\n */\nexport function parseCronExpression(expression: string | object) {\n const ensureStringExpression = create(expression, CronExpressionStruct);\n return parseExpression(ensureStringExpression);\n}\n\nexport const CronjobSpecificationStruct = object({\n expression: CronExpressionStruct,\n request: CronjobRpcRequestStruct,\n});\nexport type CronjobSpecification = Infer<typeof CronjobSpecificationStruct>;\n\n/**\n * Check if the given value is a {@link CronjobSpecification} object.\n *\n * @param value - The value to check.\n * @returns Whether the value is a valid {@link CronjobSpecification} object.\n */\nexport function isCronjobSpecification(value: unknown): boolean {\n try {\n create(value, CronjobSpecificationStruct);\n return true;\n } catch {\n return false;\n }\n}\n\nexport const CronjobSpecificationArrayStruct = array(\n CronjobSpecificationStruct,\n);\n\n/**\n * Check if the given value is an array of {@link CronjobSpecification} objects.\n *\n * @param value - The value to check.\n * @returns Whether the value is a valid array of {@link CronjobSpecification} objects.\n */\nexport function isCronjobSpecificationArray(value: unknown): boolean {\n try {\n create(value, CronjobSpecificationArrayStruct);\n return true;\n } catch {\n return false;\n }\n}\n"],"names":["JsonRpcIdStruct","JsonRpcParamsStruct","JsonRpcVersionStruct","parseExpression","array","create","object","optional","refine","string","CronjobRpcRequestStruct","jsonrpc","id","method","params","CronExpressionStruct","value","parseCronExpression","expression","ensureStringExpression","CronjobSpecificationStruct","request","isCronjobSpecification","CronjobSpecificationArrayStruct","isCronjobSpecificationArray"],"mappings":"AAAA,SACEA,eAAe,EACfC,mBAAmB,EACnBC,oBAAoB,QACf,kBAAkB;AACzB,SAASC,eAAe,QAAQ,cAAc;AAE9C,SAASC,KAAK,EAAEC,MAAM,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,MAAM,QAAQ,cAAc;AAE9E,OAAO,MAAMC,0BAA0BJ,OAAO;IAC5CK,SAASJ,SAASL;IAClBU,IAAIL,SAASP;IACba,QAAQJ;IACRK,QAAQP,SAASN;AACnB,GAAG;AAIH,OAAO,MAAMc,uBAAuBP,OAClCC,UACA,kBACA,CAACO;IACC,IAAI;QACFb,gBAAgBa;QAChB,OAAO;IACT,EAAE,OAAM;QACN,OAAO;IACT;AACF,GACA;AAIF;;;;;CAKC,GACD,OAAO,SAASC,oBAAoBC,UAA2B;IAC7D,MAAMC,yBAAyBd,OAAOa,YAAYH;IAClD,OAAOZ,gBAAgBgB;AACzB;AAEA,OAAO,MAAMC,6BAA6Bd,OAAO;IAC/CY,YAAYH;IACZM,SAASX;AACX,GAAG;AAGH;;;;;CAKC,GACD,OAAO,SAASY,uBAAuBN,KAAc;IACnD,IAAI;QACFX,OAAOW,OAAOI;QACd,OAAO;IACT,EAAE,OAAM;QACN,OAAO;IACT;AACF;AAEA,OAAO,MAAMG,kCAAkCnB,MAC7CgB,4BACA;AAEF;;;;;CAKC,GACD,OAAO,SAASI,4BAA4BR,KAAc;IACxD,IAAI;QACFX,OAAOW,OAAOO;QACd,OAAO;IACT,EAAE,OAAM;QACN,OAAO;IACT;AACF"}
@@ -14,29 +14,20 @@ lockdown({
14
14
  // Node.js domains are deprecated.
15
15
  domainTaming: 'unsafe'
16
16
  });
17
- /**
18
- * Get mock endowments that don't do anything. This is useful for running the
19
- * eval, for snaps that try to communicate with the extension on initialisation,
20
- * for example.
21
- *
22
- * @returns The mock endowments.
23
- */ function getMockEndowments() {
24
- const endowments = generateMockEndowments();
25
- return {
26
- ...endowments,
27
- window: endowments,
28
- self: endowments
29
- };
30
- }
31
17
  const snapFilePath = process.argv[2];
32
18
  const snapModule = {
33
19
  exports: {}
34
20
  };
35
- new Compartment({
36
- ...getMockEndowments(),
21
+ const compartment = new Compartment({
22
+ ...generateMockEndowments(),
37
23
  module: snapModule,
38
24
  exports: snapModule.exports
39
- }).evaluate(readFileSync(snapFilePath, 'utf8'));
25
+ });
26
+ // Mirror BaseSnapExecutor
27
+ compartment.globalThis.self = compartment.globalThis;
28
+ compartment.globalThis.global = compartment.globalThis;
29
+ compartment.globalThis.window = compartment.globalThis;
30
+ compartment.evaluate(readFileSync(snapFilePath, 'utf8'));
40
31
  const invalidExports = Object.keys(snapModule.exports).filter((snapExport)=>!SNAP_EXPORT_NAMES.includes(snapExport));
41
32
  if (invalidExports.length > 0) {
42
33
  // eslint-disable-next-line no-console
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/eval-worker.ts"],"sourcesContent":["// eslint-disable-next-line import/no-unassigned-import\nimport 'ses/lockdown';\n\nimport { readFileSync } from 'fs';\n\nimport type { HandlerType } from './handler-types';\nimport { SNAP_EXPORT_NAMES } from './handler-types';\nimport { generateMockEndowments } from './mock';\n\ndeclare let lockdown: any, Compartment: any;\n\nlockdown({\n consoleTaming: 'unsafe',\n errorTaming: 'unsafe',\n mathTaming: 'unsafe',\n dateTaming: 'unsafe',\n overrideTaming: 'severe',\n\n // We disable domain taming, because it does not work in certain cases when\n // running tests. This is unlikely to be a problem in production, because\n // Node.js domains are deprecated.\n domainTaming: 'unsafe',\n});\n\n/**\n * Get mock endowments that don't do anything. This is useful for running the\n * eval, for snaps that try to communicate with the extension on initialisation,\n * for example.\n *\n * @returns The mock endowments.\n */\nfunction getMockEndowments() {\n const endowments = generateMockEndowments();\n return {\n ...endowments,\n window: endowments,\n self: endowments,\n };\n}\n\nconst snapFilePath = process.argv[2];\n\nconst snapModule: { exports?: any } = { exports: {} };\n\nnew Compartment({\n ...getMockEndowments(),\n module: snapModule,\n exports: snapModule.exports,\n}).evaluate(readFileSync(snapFilePath, 'utf8'));\n\nconst invalidExports = Object.keys(snapModule.exports).filter(\n (snapExport) => !SNAP_EXPORT_NAMES.includes(snapExport as HandlerType),\n);\n\nif (invalidExports.length > 0) {\n // eslint-disable-next-line no-console\n console.warn(`Invalid snap exports detected:\\n${invalidExports.join('\\n')}`);\n}\n\nsetTimeout(() => process.exit(0), 1000); // Hack to ensure worker exits\n"],"names":["readFileSync","SNAP_EXPORT_NAMES","generateMockEndowments","lockdown","consoleTaming","errorTaming","mathTaming","dateTaming","overrideTaming","domainTaming","getMockEndowments","endowments","window","self","snapFilePath","process","argv","snapModule","exports","Compartment","module","evaluate","invalidExports","Object","keys","filter","snapExport","includes","length","console","warn","join","setTimeout","exit"],"mappings":"AAAA,uDAAuD;AACvD,OAAO,eAAe;AAEtB,SAASA,YAAY,QAAQ,KAAK;AAGlC,SAASC,iBAAiB,QAAQ,kBAAkB;AACpD,SAASC,sBAAsB,QAAQ,SAAS;AAIhDC,SAAS;IACPC,eAAe;IACfC,aAAa;IACbC,YAAY;IACZC,YAAY;IACZC,gBAAgB;IAEhB,2EAA2E;IAC3E,yEAAyE;IACzE,kCAAkC;IAClCC,cAAc;AAChB;AAEA;;;;;;CAMC,GACD,SAASC;IACP,MAAMC,aAAaT;IACnB,OAAO;QACL,GAAGS,UAAU;QACbC,QAAQD;QACRE,MAAMF;IACR;AACF;AAEA,MAAMG,eAAeC,QAAQC,IAAI,CAAC,EAAE;AAEpC,MAAMC,aAAgC;IAAEC,SAAS,CAAC;AAAE;AAEpD,IAAIC,YAAY;IACd,GAAGT,mBAAmB;IACtBU,QAAQH;IACRC,SAASD,WAAWC,OAAO;AAC7B,GAAGG,QAAQ,CAACrB,aAAac,cAAc;AAEvC,MAAMQ,iBAAiBC,OAAOC,IAAI,CAACP,WAAWC,OAAO,EAAEO,MAAM,CAC3D,CAACC,aAAe,CAACzB,kBAAkB0B,QAAQ,CAACD;AAG9C,IAAIJ,eAAeM,MAAM,GAAG,GAAG;IAC7B,sCAAsC;IACtCC,QAAQC,IAAI,CAAC,CAAC,gCAAgC,EAAER,eAAeS,IAAI,CAAC,MAAM,CAAC;AAC7E;AAEAC,WAAW,IAAMjB,QAAQkB,IAAI,CAAC,IAAI,OAAO,8BAA8B"}
1
+ {"version":3,"sources":["../../src/eval-worker.ts"],"sourcesContent":["// eslint-disable-next-line import/no-unassigned-import\nimport 'ses/lockdown';\n\nimport { readFileSync } from 'fs';\n\nimport type { HandlerType } from './handler-types';\nimport { SNAP_EXPORT_NAMES } from './handler-types';\nimport { generateMockEndowments } from './mock';\n\ndeclare let lockdown: any, Compartment: any;\n\nlockdown({\n consoleTaming: 'unsafe',\n errorTaming: 'unsafe',\n mathTaming: 'unsafe',\n dateTaming: 'unsafe',\n overrideTaming: 'severe',\n\n // We disable domain taming, because it does not work in certain cases when\n // running tests. This is unlikely to be a problem in production, because\n // Node.js domains are deprecated.\n domainTaming: 'unsafe',\n});\n\nconst snapFilePath = process.argv[2];\n\nconst snapModule: { exports?: any } = { exports: {} };\n\nconst compartment = new Compartment({\n ...generateMockEndowments(),\n module: snapModule,\n exports: snapModule.exports,\n});\n\n// Mirror BaseSnapExecutor\ncompartment.globalThis.self = compartment.globalThis;\ncompartment.globalThis.global = compartment.globalThis;\ncompartment.globalThis.window = compartment.globalThis;\n\ncompartment.evaluate(readFileSync(snapFilePath, 'utf8'));\n\nconst invalidExports = Object.keys(snapModule.exports).filter(\n (snapExport) => !SNAP_EXPORT_NAMES.includes(snapExport as HandlerType),\n);\n\nif (invalidExports.length > 0) {\n // eslint-disable-next-line no-console\n console.warn(`Invalid snap exports detected:\\n${invalidExports.join('\\n')}`);\n}\n\nsetTimeout(() => process.exit(0), 1000); // Hack to ensure worker exits\n"],"names":["readFileSync","SNAP_EXPORT_NAMES","generateMockEndowments","lockdown","consoleTaming","errorTaming","mathTaming","dateTaming","overrideTaming","domainTaming","snapFilePath","process","argv","snapModule","exports","compartment","Compartment","module","globalThis","self","global","window","evaluate","invalidExports","Object","keys","filter","snapExport","includes","length","console","warn","join","setTimeout","exit"],"mappings":"AAAA,uDAAuD;AACvD,OAAO,eAAe;AAEtB,SAASA,YAAY,QAAQ,KAAK;AAGlC,SAASC,iBAAiB,QAAQ,kBAAkB;AACpD,SAASC,sBAAsB,QAAQ,SAAS;AAIhDC,SAAS;IACPC,eAAe;IACfC,aAAa;IACbC,YAAY;IACZC,YAAY;IACZC,gBAAgB;IAEhB,2EAA2E;IAC3E,yEAAyE;IACzE,kCAAkC;IAClCC,cAAc;AAChB;AAEA,MAAMC,eAAeC,QAAQC,IAAI,CAAC,EAAE;AAEpC,MAAMC,aAAgC;IAAEC,SAAS,CAAC;AAAE;AAEpD,MAAMC,cAAc,IAAIC,YAAY;IAClC,GAAGd,wBAAwB;IAC3Be,QAAQJ;IACRC,SAASD,WAAWC,OAAO;AAC7B;AAEA,0BAA0B;AAC1BC,YAAYG,UAAU,CAACC,IAAI,GAAGJ,YAAYG,UAAU;AACpDH,YAAYG,UAAU,CAACE,MAAM,GAAGL,YAAYG,UAAU;AACtDH,YAAYG,UAAU,CAACG,MAAM,GAAGN,YAAYG,UAAU;AAEtDH,YAAYO,QAAQ,CAACtB,aAAaU,cAAc;AAEhD,MAAMa,iBAAiBC,OAAOC,IAAI,CAACZ,WAAWC,OAAO,EAAEY,MAAM,CAC3D,CAACC,aAAe,CAAC1B,kBAAkB2B,QAAQ,CAACD;AAG9C,IAAIJ,eAAeM,MAAM,GAAG,GAAG;IAC7B,sCAAsC;IACtCC,QAAQC,IAAI,CAAC,CAAC,gCAAgC,EAAER,eAAeS,IAAI,CAAC,MAAM,CAAC;AAC7E;AAEAC,WAAW,IAAMtB,QAAQuB,IAAI,CAAC,IAAI,OAAO,8BAA8B"}
@@ -2,6 +2,7 @@
2
2
  export * from './errors';
3
3
  export * from './handlers';
4
4
  export * from './handler-types';
5
+ export * from './iframe';
5
6
  export * from './logging';
6
7
  export * from './namespace';
7
8
  export * from './types';
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.executionenv.ts"],"sourcesContent":["// Special entrypoint for execution environments for bundle sizing reasons\nexport * from './errors';\nexport * from './handlers';\nexport * from './handler-types';\nexport * from './logging';\nexport * from './namespace';\nexport * from './types';\n"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,cAAc,WAAW;AACzB,cAAc,aAAa;AAC3B,cAAc,kBAAkB;AAChC,cAAc,YAAY;AAC1B,cAAc,cAAc;AAC5B,cAAc,UAAU"}
1
+ {"version":3,"sources":["../../src/index.executionenv.ts"],"sourcesContent":["// Special entrypoint for execution environments for bundle sizing reasons\nexport * from './errors';\nexport * from './handlers';\nexport * from './handler-types';\nexport * from './iframe';\nexport * from './logging';\nexport * from './namespace';\nexport * from './types';\n"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,cAAc,WAAW;AACzB,cAAc,aAAa;AAC3B,cAAc,kBAAkB;AAChC,cAAc,WAAW;AACzB,cAAc,YAAY;AAC1B,cAAc,cAAc;AAC5B,cAAc,UAAU"}
@@ -1,6 +1,7 @@
1
1
  export * from './errors';
2
2
  export * from './handlers';
3
3
  export * from './handler-types';
4
+ export * from './iframe';
4
5
  export * from './logging';
5
6
  export * from './namespace';
6
7
  export * from './types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask/snaps-utils",
3
- "version": "5.1.0",
3
+ "version": "5.1.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/MetaMask/snaps.git"
@@ -69,11 +69,11 @@
69
69
  "@babel/types": "^7.23.0",
70
70
  "@metamask/base-controller": "^4.0.0",
71
71
  "@metamask/key-tree": "^9.0.0",
72
- "@metamask/permission-controller": "^6.0.0",
72
+ "@metamask/permission-controller": "^7.1.0",
73
73
  "@metamask/rpc-errors": "^6.1.0",
74
74
  "@metamask/slip44": "^3.1.0",
75
75
  "@metamask/snaps-registry": "^3.0.0",
76
- "@metamask/snaps-sdk": "^1.3.0",
76
+ "@metamask/snaps-sdk": "^1.3.2",
77
77
  "@metamask/utils": "^8.2.1",
78
78
  "@noble/hashes": "^1.3.1",
79
79
  "@scure/base": "^1.1.1",
@@ -92,7 +92,7 @@
92
92
  "@esbuild-plugins/node-globals-polyfill": "^0.2.3",
93
93
  "@esbuild-plugins/node-modules-polyfill": "^0.2.2",
94
94
  "@lavamoat/allow-scripts": "^2.5.1",
95
- "@metamask/auto-changelog": "^3.4.3",
95
+ "@metamask/auto-changelog": "^3.4.4",
96
96
  "@metamask/eslint-config": "^12.1.0",
97
97
  "@metamask/eslint-config-jest": "^12.1.0",
98
98
  "@metamask/eslint-config-nodejs": "^12.1.0",