@metamask/snaps-execution-environments 6.7.0 → 6.7.1
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,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [6.7.1]
|
|
10
|
+
### Fixed
|
|
11
|
+
- Fix invalid types in type declaration in some cases ([#2714](https://github.com/MetaMask/snaps/pull/2714))
|
|
12
|
+
|
|
9
13
|
## [6.7.0]
|
|
10
14
|
### Changed
|
|
11
15
|
- Unblock `wallet_requestSnaps` ([#2661](https://github.com/MetaMask/snaps/pull/2661))
|
|
@@ -251,7 +255,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
251
255
|
- The version of the package no longer needs to match the version of all other
|
|
252
256
|
MetaMask Snaps packages.
|
|
253
257
|
|
|
254
|
-
[Unreleased]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-execution-environments@6.7.
|
|
258
|
+
[Unreleased]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-execution-environments@6.7.1...HEAD
|
|
259
|
+
[6.7.1]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-execution-environments@6.7.0...@metamask/snaps-execution-environments@6.7.1
|
|
255
260
|
[6.7.0]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-execution-environments@6.6.2...@metamask/snaps-execution-environments@6.7.0
|
|
256
261
|
[6.6.2]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-execution-environments@6.6.1...@metamask/snaps-execution-environments@6.6.2
|
|
257
262
|
[6.6.1]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-execution-environments@6.6.0...@metamask/snaps-execution-environments@6.6.1
|
|
@@ -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.1",
|
|
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",
|