@metamask/snaps-execution-environments 6.7.0 → 6.7.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 +11 -1
- package/dist/browserify/iframe/bundle.js +9 -0
- package/dist/browserify/iframe/index.html +13394 -0
- package/dist/browserify/node-process/bundle.js +13390 -0
- package/dist/browserify/node-thread/bundle.js +13390 -0
- package/dist/browserify/webview/index.html +13402 -0
- package/dist/browserify/worker-executor/bundle.js +13392 -0
- package/dist/browserify/worker-pool/bundle.js +9 -0
- package/dist/browserify/worker-pool/index.html +13394 -0
- package/dist/common/endowments/crypto.cjs +1 -1
- package/dist/common/endowments/crypto.cjs.map +1 -1
- package/dist/common/endowments/crypto.mjs +3 -1
- package/dist/common/endowments/crypto.mjs.map +1 -1
- package/package.json +4 -4
|
@@ -15,7 +15,7 @@ const createCrypto = () => {
|
|
|
15
15
|
// For now, we expose the experimental webcrypto API for Node.js execution environments
|
|
16
16
|
// TODO: Figure out if this is enough long-term or if we should use a polyfill.
|
|
17
17
|
/* eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires, n/global-require */
|
|
18
|
-
const crypto = require(
|
|
18
|
+
const crypto = require("crypto").webcrypto;
|
|
19
19
|
return {
|
|
20
20
|
crypto: harden(crypto),
|
|
21
21
|
SubtleCrypto: harden(crypto.subtle.constructor),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crypto.cjs","sourceRoot":"","sources":["../../../src/common/endowments/crypto.ts"],"names":[],"mappings":";;;AAAA,sDAAkD;AAE3C,MAAM,YAAY,GAAG,GAAG,EAAE;IAC/B,IACE,QAAQ,IAAI,8BAAe;QAC3B,OAAO,8BAAe,CAAC,MAAM,KAAK,QAAQ;QAC1C,cAAc,IAAI,8BAAe;QACjC,OAAO,8BAAe,CAAC,YAAY,KAAK,UAAU,EAClD,CAAC;QACD,OAAO;YACL,MAAM,EAAE,MAAM,CAAC,8BAAe,CAAC,MAAM,CAAC;YACtC,YAAY,EAAE,MAAM,CAAC,8BAAe,CAAC,YAAY,CAAC;SACnD,CAAC;IACJ,CAAC;IACD,uFAAuF;IACvF,+EAA+E;IAC/E,0HAA0H;IAC1H,MAAM,MAAM,GAAG,OAAO,
|
|
1
|
+
{"version":3,"file":"crypto.cjs","sourceRoot":"","sources":["../../../src/common/endowments/crypto.ts"],"names":[],"mappings":";;;AAAA,sDAAkD;AAE3C,MAAM,YAAY,GAAG,GAAG,EAAE;IAC/B,IACE,QAAQ,IAAI,8BAAe;QAC3B,OAAO,8BAAe,CAAC,MAAM,KAAK,QAAQ;QAC1C,cAAc,IAAI,8BAAe;QACjC,OAAO,8BAAe,CAAC,YAAY,KAAK,UAAU,EAClD,CAAC;QACD,OAAO;YACL,MAAM,EAAE,MAAM,CAAC,8BAAe,CAAC,MAAM,CAAC;YACtC,YAAY,EAAE,MAAM,CAAC,8BAAe,CAAC,YAAY,CAAC;SACnD,CAAC;IACJ,CAAC;IACD,uFAAuF;IACvF,+EAA+E;IAC/E,0HAA0H;IAC1H,MAAM,MAAM,GAAG,OAAO,UAAU,CAAC,SAAS,CAAC;IAC3C,OAAO;QACL,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;QACtB,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC;KACvC,CAAC;AACb,CAAC,CAAC;AApBW,QAAA,YAAY,gBAoBvB;AAEF,MAAM,eAAe,GAAG;IACtB,KAAK,EAAE,CAAC,QAAQ,EAAE,cAAc,CAAU;IAC1C,OAAO,EAAE,oBAAY;CACtB,CAAC;AACF,kBAAe,eAAe,CAAC","sourcesContent":["import { rootRealmGlobal } from '../globalObject';\n\nexport const createCrypto = () => {\n if (\n 'crypto' in rootRealmGlobal &&\n typeof rootRealmGlobal.crypto === 'object' &&\n 'SubtleCrypto' in rootRealmGlobal &&\n typeof rootRealmGlobal.SubtleCrypto === 'function'\n ) {\n return {\n crypto: harden(rootRealmGlobal.crypto),\n SubtleCrypto: harden(rootRealmGlobal.SubtleCrypto),\n };\n }\n // For now, we expose the experimental webcrypto API for Node.js execution environments\n // TODO: Figure out if this is enough long-term or if we should use a polyfill.\n /* eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires, n/global-require */\n const crypto = require('crypto').webcrypto;\n return {\n crypto: harden(crypto),\n SubtleCrypto: harden(crypto.subtle.constructor),\n } as const;\n};\n\nconst endowmentModule = {\n names: ['crypto', 'SubtleCrypto'] as const,\n factory: createCrypto,\n};\nexport default endowmentModule;\n"]}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { createRequire as $createRequire } from "module";
|
|
2
|
+
const $require = $createRequire(import.meta.url);
|
|
1
3
|
import { rootRealmGlobal } from "../globalObject.mjs";
|
|
2
4
|
export const createCrypto = () => {
|
|
3
5
|
if ('crypto' in rootRealmGlobal &&
|
|
@@ -12,7 +14,7 @@ export const createCrypto = () => {
|
|
|
12
14
|
// For now, we expose the experimental webcrypto API for Node.js execution environments
|
|
13
15
|
// TODO: Figure out if this is enough long-term or if we should use a polyfill.
|
|
14
16
|
/* eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires, n/global-require */
|
|
15
|
-
const crypto = require(
|
|
17
|
+
const crypto = $require("crypto").webcrypto;
|
|
16
18
|
return {
|
|
17
19
|
crypto: harden(crypto),
|
|
18
20
|
SubtleCrypto: harden(crypto.subtle.constructor),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crypto.mjs","sourceRoot":"","sources":["../../../src/common/endowments/crypto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,4BAAwB;AAElD,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE;IAC/B,IACE,QAAQ,IAAI,eAAe;QAC3B,OAAO,eAAe,CAAC,MAAM,KAAK,QAAQ;QAC1C,cAAc,IAAI,eAAe;QACjC,OAAO,eAAe,CAAC,YAAY,KAAK,UAAU,EAClD,CAAC;QACD,OAAO;YACL,MAAM,EAAE,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC;YACtC,YAAY,EAAE,MAAM,CAAC,eAAe,CAAC,YAAY,CAAC;SACnD,CAAC;IACJ,CAAC;IACD,uFAAuF;IACvF,+EAA+E;IAC/E,0HAA0H;IAC1H,MAAM,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"crypto.mjs","sourceRoot":"","sources":["../../../src/common/endowments/crypto.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,eAAe,EAAE,4BAAwB;AAElD,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE;IAC/B,IACE,QAAQ,IAAI,eAAe;QAC3B,OAAO,eAAe,CAAC,MAAM,KAAK,QAAQ;QAC1C,cAAc,IAAI,eAAe;QACjC,OAAO,eAAe,CAAC,YAAY,KAAK,UAAU,EAClD,CAAC;QACD,OAAO;YACL,MAAM,EAAE,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC;YACtC,YAAY,EAAE,MAAM,CAAC,eAAe,CAAC,YAAY,CAAC;SACnD,CAAC;IACJ,CAAC;IACD,uFAAuF;IACvF,+EAA+E;IAC/E,0HAA0H;IAC1H,MAAM,MAAM,GAAG,mBAAkB,SAAS,CAAC;IAC3C,OAAO;QACL,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;QACtB,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC;KACvC,CAAC;AACb,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG;IACtB,KAAK,EAAE,CAAC,QAAQ,EAAE,cAAc,CAAU;IAC1C,OAAO,EAAE,YAAY;CACtB,CAAC;AACF,eAAe,eAAe,CAAC","sourcesContent":["import { rootRealmGlobal } from '../globalObject';\n\nexport const createCrypto = () => {\n if (\n 'crypto' in rootRealmGlobal &&\n typeof rootRealmGlobal.crypto === 'object' &&\n 'SubtleCrypto' in rootRealmGlobal &&\n typeof rootRealmGlobal.SubtleCrypto === 'function'\n ) {\n return {\n crypto: harden(rootRealmGlobal.crypto),\n SubtleCrypto: harden(rootRealmGlobal.SubtleCrypto),\n };\n }\n // For now, we expose the experimental webcrypto API for Node.js execution environments\n // TODO: Figure out if this is enough long-term or if we should use a polyfill.\n /* eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires, n/global-require */\n const crypto = require('crypto').webcrypto;\n return {\n crypto: harden(crypto),\n SubtleCrypto: harden(crypto.subtle.constructor),\n } as const;\n};\n\nconst endowmentModule = {\n names: ['crypto', 'SubtleCrypto'] as const,\n factory: createCrypto,\n};\nexport default endowmentModule;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metamask/snaps-execution-environments",
|
|
3
|
-
"version": "6.7.
|
|
3
|
+
"version": "6.7.2",
|
|
4
4
|
"description": "Snap sandbox environments for executing SES javascript",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -59,8 +59,8 @@
|
|
|
59
59
|
"@metamask/post-message-stream": "^8.1.1",
|
|
60
60
|
"@metamask/providers": "^17.1.2",
|
|
61
61
|
"@metamask/rpc-errors": "^6.3.1",
|
|
62
|
-
"@metamask/snaps-sdk": "^6.
|
|
63
|
-
"@metamask/snaps-utils": "^8.1.
|
|
62
|
+
"@metamask/snaps-sdk": "^6.5.0",
|
|
63
|
+
"@metamask/snaps-utils": "^8.1.1",
|
|
64
64
|
"@metamask/superstruct": "^3.1.0",
|
|
65
65
|
"@metamask/utils": "^9.2.1",
|
|
66
66
|
"nanoid": "^3.1.31",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"@metamask/eslint-config-typescript": "^12.1.0",
|
|
83
83
|
"@swc/core": "1.3.78",
|
|
84
84
|
"@swc/jest": "^0.2.26",
|
|
85
|
-
"@ts-bridge/cli": "^0.
|
|
85
|
+
"@ts-bridge/cli": "^0.5.1",
|
|
86
86
|
"@types/express": "^4.17.17",
|
|
87
87
|
"@types/jest": "^27.5.1",
|
|
88
88
|
"@types/node": "18.14.2",
|