@metamask/snaps-utils 0.38.0-flask.1 → 1.0.0
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 +222 -11
- package/dist/{esm/array.js → array.js} +7 -3
- package/dist/array.js.map +1 -0
- package/dist/{types/caveats.d.ts → caveats.d.ts} +4 -0
- package/dist/caveats.js +35 -0
- package/dist/caveats.js.map +1 -0
- package/dist/checksum.js +42 -0
- package/dist/checksum.js.map +1 -0
- package/dist/{types/cronjob.d.ts → cronjob.d.ts} +1 -1
- package/dist/cronjob.js +71 -0
- package/dist/cronjob.js.map +1 -0
- package/dist/deep-clone.js +9 -0
- package/dist/deep-clone.js.map +1 -0
- package/dist/{esm/default-endowments.js → default-endowments.js} +6 -3
- package/dist/default-endowments.js.map +1 -0
- package/dist/entropy.js +8 -0
- package/dist/entropy.js.map +1 -0
- package/dist/{cjs/eval-worker.js → eval-worker.js} +21 -22
- package/dist/eval-worker.js.map +1 -0
- package/dist/{types/eval.d.ts → eval.d.ts} +1 -9
- package/dist/eval.js +27 -0
- package/dist/eval.js.map +1 -0
- package/dist/{types/fs.d.ts → fs.d.ts} +2 -2
- package/dist/{esm/fs.js → fs.js} +56 -33
- package/dist/fs.js.map +1 -0
- package/dist/handlers.d.ts +105 -0
- package/dist/handlers.js +3 -0
- package/dist/handlers.js.map +1 -0
- package/dist/{types/iframe.d.ts → iframe.d.ts} +2 -3
- package/dist/{esm/iframe.js → iframe.js} +18 -16
- package/dist/iframe.js.map +1 -0
- package/dist/iframe.test.browser.js +15 -0
- package/dist/iframe.test.browser.js.map +1 -0
- package/dist/{types/index.browser.d.ts → index.browser.d.ts} +1 -5
- package/dist/index.browser.js +37 -0
- package/dist/index.browser.js.map +1 -0
- package/dist/{types/index.d.ts → index.d.ts} +1 -5
- package/dist/index.executionenv.js +22 -0
- package/dist/index.executionenv.js.map +1 -0
- package/dist/index.js +42 -0
- package/dist/index.js.map +1 -0
- package/dist/{types/json-rpc.d.ts → json-rpc.d.ts} +2 -2
- package/dist/json-rpc.js +46 -0
- package/dist/json-rpc.js.map +1 -0
- package/dist/json.d.ts +9 -0
- package/dist/json.js +18 -0
- package/dist/json.js.map +1 -0
- package/dist/{esm/logging.js → logging.js} +14 -6
- package/dist/logging.js.map +1 -0
- package/dist/manifest/index.browser.js +18 -0
- package/dist/manifest/index.browser.js.map +1 -0
- package/dist/manifest/index.js +19 -0
- package/dist/manifest/index.js.map +1 -0
- package/dist/{types/manifest → manifest}/manifest.d.ts +4 -6
- package/dist/{esm/manifest → manifest}/manifest.js +115 -101
- package/dist/manifest/manifest.js.map +1 -0
- package/dist/{types/manifest → manifest}/validation.d.ts +76 -34
- package/dist/manifest/validation.js +141 -0
- package/dist/manifest/validation.js.map +1 -0
- package/dist/{esm/mock.js → mock.js} +40 -42
- package/dist/mock.js.map +1 -0
- package/dist/namespace.d.ts +275 -0
- package/dist/namespace.js +225 -0
- package/dist/namespace.js.map +1 -0
- package/dist/notification.d.ts +66 -0
- package/dist/notification.js +58 -0
- package/dist/notification.js.map +1 -0
- package/dist/{types/npm.d.ts → npm.d.ts} +3 -2
- package/dist/npm.js +74 -0
- package/dist/npm.js.map +1 -0
- package/dist/path.js +21 -0
- package/dist/path.js.map +1 -0
- package/dist/{esm/post-process.js → post-process.js} +99 -110
- package/dist/post-process.js.map +1 -0
- package/dist/{types/snaps.d.ts → snaps.d.ts} +9 -17
- package/dist/snaps.js +202 -0
- package/dist/snaps.js.map +1 -0
- package/dist/{types/types.d.ts → types.d.ts} +22 -15
- package/dist/types.js +103 -0
- package/dist/types.js.map +1 -0
- package/dist/{types/versions.d.ts → versions.d.ts} +1 -1
- package/dist/{esm/versions.js → versions.js} +18 -15
- package/dist/versions.js.map +1 -0
- package/dist/{esm/virtual-file → virtual-file}/VirtualFile.js +33 -47
- package/dist/virtual-file/VirtualFile.js.map +1 -0
- package/dist/virtual-file/index.browser.js +18 -0
- package/dist/virtual-file/index.browser.js.map +1 -0
- package/dist/virtual-file/index.js +19 -0
- package/dist/virtual-file/index.js.map +1 -0
- package/dist/virtual-file/toVirtualFile.js +30 -0
- package/dist/virtual-file/toVirtualFile.js.map +1 -0
- package/package.json +40 -59
- package/dist/cjs/array.js +0 -23
- package/dist/cjs/array.js.map +0 -1
- package/dist/cjs/caveats.js +0 -33
- package/dist/cjs/caveats.js.map +0 -1
- package/dist/cjs/checksum.js +0 -38
- package/dist/cjs/checksum.js.map +0 -1
- package/dist/cjs/cronjob.js +0 -84
- package/dist/cjs/cronjob.js.map +0 -1
- package/dist/cjs/deep-clone.js +0 -22
- package/dist/cjs/deep-clone.js.map +0 -1
- package/dist/cjs/default-endowments.js +0 -49
- package/dist/cjs/default-endowments.js.map +0 -1
- package/dist/cjs/entropy.js +0 -23
- package/dist/cjs/entropy.js.map +0 -1
- package/dist/cjs/enum.js +0 -16
- package/dist/cjs/enum.js.map +0 -1
- package/dist/cjs/errors.js +0 -19
- package/dist/cjs/errors.js.map +0 -1
- package/dist/cjs/eval-worker.js.map +0 -1
- package/dist/cjs/eval.js +0 -77
- package/dist/cjs/eval.js.map +0 -1
- package/dist/cjs/fs.js +0 -126
- package/dist/cjs/fs.js.map +0 -1
- package/dist/cjs/handlers.js +0 -65
- package/dist/cjs/handlers.js.map +0 -1
- package/dist/cjs/icon.js +0 -37
- package/dist/cjs/icon.js.map +0 -1
- package/dist/cjs/iframe.js +0 -59
- package/dist/cjs/iframe.js.map +0 -1
- package/dist/cjs/index.browser.js +0 -43
- package/dist/cjs/index.browser.js.map +0 -1
- package/dist/cjs/index.executionenv.js +0 -24
- package/dist/cjs/index.executionenv.js.map +0 -1
- package/dist/cjs/index.js +0 -48
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/json-rpc.js +0 -46
- package/dist/cjs/json-rpc.js.map +0 -1
- package/dist/cjs/json.js +0 -16
- package/dist/cjs/json.js.map +0 -1
- package/dist/cjs/logging.js +0 -40
- package/dist/cjs/logging.js.map +0 -1
- package/dist/cjs/manifest/index.browser.js +0 -20
- package/dist/cjs/manifest/index.browser.js.map +0 -1
- package/dist/cjs/manifest/index.js +0 -21
- package/dist/cjs/manifest/index.js.map +0 -1
- package/dist/cjs/manifest/manifest.js +0 -239
- package/dist/cjs/manifest/manifest.js.map +0 -1
- package/dist/cjs/manifest/validation.js +0 -183
- package/dist/cjs/manifest/validation.js.map +0 -1
- package/dist/cjs/mock.js +0 -128
- package/dist/cjs/mock.js.map +0 -1
- package/dist/cjs/namespace.js +0 -124
- package/dist/cjs/namespace.js.map +0 -1
- package/dist/cjs/npm.js +0 -81
- package/dist/cjs/npm.js.map +0 -1
- package/dist/cjs/path.js +0 -21
- package/dist/cjs/path.js.map +0 -1
- package/dist/cjs/post-process.js +0 -328
- package/dist/cjs/post-process.js.map +0 -1
- package/dist/cjs/snaps.js +0 -230
- package/dist/cjs/snaps.js.map +0 -1
- package/dist/cjs/strings.js +0 -21
- package/dist/cjs/strings.js.map +0 -1
- package/dist/cjs/structs.js +0 -163
- package/dist/cjs/structs.js.map +0 -1
- package/dist/cjs/types.js +0 -109
- package/dist/cjs/types.js.map +0 -1
- package/dist/cjs/validation.js +0 -22
- package/dist/cjs/validation.js.map +0 -1
- package/dist/cjs/versions.js +0 -47
- package/dist/cjs/versions.js.map +0 -1
- package/dist/cjs/virtual-file/VirtualFile.js +0 -85
- package/dist/cjs/virtual-file/VirtualFile.js.map +0 -1
- package/dist/cjs/virtual-file/index.browser.js +0 -20
- package/dist/cjs/virtual-file/index.browser.js.map +0 -1
- package/dist/cjs/virtual-file/index.js +0 -21
- package/dist/cjs/virtual-file/index.js.map +0 -1
- package/dist/cjs/virtual-file/toVirtualFile.js +0 -33
- package/dist/cjs/virtual-file/toVirtualFile.js.map +0 -1
- package/dist/esm/array.js.map +0 -1
- package/dist/esm/caveats.js +0 -23
- package/dist/esm/caveats.js.map +0 -1
- package/dist/esm/checksum.js +0 -36
- package/dist/esm/checksum.js.map +0 -1
- package/dist/esm/cronjob.js +0 -66
- package/dist/esm/cronjob.js.map +0 -1
- package/dist/esm/deep-clone.js +0 -7
- package/dist/esm/deep-clone.js.map +0 -1
- package/dist/esm/default-endowments.js.map +0 -1
- package/dist/esm/entropy.js +0 -6
- package/dist/esm/entropy.js.map +0 -1
- package/dist/esm/enum.js +0 -12
- package/dist/esm/enum.js.map +0 -1
- package/dist/esm/errors.js +0 -17
- package/dist/esm/errors.js.map +0 -1
- package/dist/esm/eval-worker.js +0 -47
- package/dist/esm/eval-worker.js.map +0 -1
- package/dist/esm/eval.js +0 -65
- package/dist/esm/eval.js.map +0 -1
- package/dist/esm/fs.js.map +0 -1
- package/dist/esm/handlers.js +0 -47
- package/dist/esm/handlers.js.map +0 -1
- package/dist/esm/icon.js +0 -11
- package/dist/esm/icon.js.map +0 -1
- package/dist/esm/iframe.js.map +0 -1
- package/dist/esm/index.browser.js +0 -26
- package/dist/esm/index.browser.js.map +0 -1
- package/dist/esm/index.executionenv.js +0 -7
- package/dist/esm/index.executionenv.js.map +0 -1
- package/dist/esm/index.js +0 -31
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/json-rpc.js +0 -39
- package/dist/esm/json-rpc.js.map +0 -1
- package/dist/esm/json.js +0 -17
- package/dist/esm/json.js.map +0 -1
- package/dist/esm/logging.js.map +0 -1
- package/dist/esm/manifest/index.browser.js +0 -3
- package/dist/esm/manifest/index.browser.js.map +0 -1
- package/dist/esm/manifest/index.js +0 -4
- package/dist/esm/manifest/index.js.map +0 -1
- package/dist/esm/manifest/manifest.js.map +0 -1
- package/dist/esm/manifest/validation.js +0 -152
- package/dist/esm/manifest/validation.js.map +0 -1
- package/dist/esm/mock.js.map +0 -1
- package/dist/esm/namespace.js +0 -110
- package/dist/esm/namespace.js.map +0 -1
- package/dist/esm/npm.js +0 -70
- package/dist/esm/npm.js.map +0 -1
- package/dist/esm/path.js +0 -17
- package/dist/esm/path.js.map +0 -1
- package/dist/esm/post-process.js.map +0 -1
- package/dist/esm/snaps.js +0 -215
- package/dist/esm/snaps.js.map +0 -1
- package/dist/esm/strings.js +0 -11
- package/dist/esm/strings.js.map +0 -1
- package/dist/esm/structs.js +0 -230
- package/dist/esm/structs.js.map +0 -1
- package/dist/esm/types.js +0 -80
- package/dist/esm/types.js.map +0 -1
- package/dist/esm/validation.js +0 -17
- package/dist/esm/validation.js.map +0 -1
- package/dist/esm/versions.js.map +0 -1
- package/dist/esm/virtual-file/VirtualFile.js.map +0 -1
- package/dist/esm/virtual-file/index.browser.js +0 -3
- package/dist/esm/virtual-file/index.browser.js.map +0 -1
- package/dist/esm/virtual-file/index.js +0 -4
- package/dist/esm/virtual-file/index.js.map +0 -1
- package/dist/esm/virtual-file/toVirtualFile.js +0 -26
- package/dist/esm/virtual-file/toVirtualFile.js.map +0 -1
- package/dist/types/enum.d.ts +0 -30
- package/dist/types/errors.d.ts +0 -10
- package/dist/types/handlers.d.ts +0 -144
- package/dist/types/icon.d.ts +0 -4
- package/dist/types/json.d.ts +0 -13
- package/dist/types/namespace.d.ts +0 -124
- package/dist/types/strings.d.ts +0 -8
- package/dist/types/structs.d.ts +0 -158
- package/dist/types/validation.d.ts +0 -8
- /package/dist/{types/array.d.ts → array.d.ts} +0 -0
- /package/dist/{types/checksum.d.ts → checksum.d.ts} +0 -0
- /package/dist/{types/deep-clone.d.ts → deep-clone.d.ts} +0 -0
- /package/dist/{types/default-endowments.d.ts → default-endowments.d.ts} +0 -0
- /package/dist/{types/entropy.d.ts → entropy.d.ts} +0 -0
- /package/dist/{types/eval-worker.d.ts → eval-worker.d.ts} +0 -0
- /package/dist/{types/iframe.test.browser.d.ts → iframe.test.browser.d.ts} +0 -0
- /package/dist/{types/index.executionenv.d.ts → index.executionenv.d.ts} +0 -0
- /package/dist/{types/logging.d.ts → logging.d.ts} +0 -0
- /package/dist/{types/manifest → manifest}/index.browser.d.ts +0 -0
- /package/dist/{types/manifest → manifest}/index.d.ts +0 -0
- /package/dist/{types/mock.d.ts → mock.d.ts} +0 -0
- /package/dist/{types/path.d.ts → path.d.ts} +0 -0
- /package/dist/{types/post-process.d.ts → post-process.d.ts} +0 -0
- /package/dist/{types/virtual-file → virtual-file}/VirtualFile.d.ts +0 -0
- /package/dist/{types/virtual-file → virtual-file}/index.browser.d.ts +0 -0
- /package/dist/{types/virtual-file → virtual-file}/index.d.ts +0 -0
- /package/dist/{types/virtual-file → virtual-file}/toVirtualFile.d.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -6,20 +6,231 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
-
## [0.
|
|
9
|
+
## [1.0.0]
|
|
10
|
+
### Changed
|
|
11
|
+
- Bump semver to `^7.5.4` ([#1631](https://github.com/MetaMask/snaps/pull/1631))
|
|
12
|
+
- Move source code and snap state back to controller state ([#1634](https://github.com/MetaMask/snaps/pull/1634))
|
|
13
|
+
|
|
14
|
+
## [1.0.0-prerelease.1]
|
|
10
15
|
### Added
|
|
11
|
-
- Add
|
|
16
|
+
- Add subject type restrictions to snap-specific permissions ([#1366](https://github.com/MetaMask/snaps/pull/1366))
|
|
12
17
|
|
|
13
18
|
### Changed
|
|
14
|
-
-
|
|
15
|
-
-
|
|
19
|
+
- **BREAKING:** Disallow deriving Ethereum keys ([#1217](https://github.com/MetaMask/snaps/pull/1217))
|
|
20
|
+
- Coin type `60` is now blocked for derivation.
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
- Improve JSON parsing safety ([#1499](https://github.com/MetaMask/snaps/pull/1499))
|
|
24
|
+
|
|
25
|
+
## [0.32.2]
|
|
26
|
+
### Changed
|
|
27
|
+
- No changes this release.
|
|
28
|
+
|
|
29
|
+
## [0.32.1]
|
|
30
|
+
### Changed
|
|
31
|
+
- No changes this release.
|
|
32
|
+
|
|
33
|
+
## [0.32.0]
|
|
34
|
+
### Changed
|
|
35
|
+
- Use side effects to install snaps via `wallet_snap` permission ([#1301](https://github.com/MetaMask/snaps-monorepo/pull/1301))
|
|
36
|
+
|
|
37
|
+
## [0.31.0]
|
|
38
|
+
### Changed
|
|
39
|
+
- **BREAKING:** Target `ES2020` ([#1247](https://github.com/MetaMask/snaps-monorepo/pull/1247))
|
|
40
|
+
- Improve validation and sanitizing of snap IDs ([#1237](https://github.com/MetaMask/snaps-monorepo/pull/1237))
|
|
41
|
+
|
|
42
|
+
## [0.30.0]
|
|
43
|
+
### Changed
|
|
44
|
+
- Properly sandbox iframe and inline SES in execution bundles ([#1193](https://github.com/MetaMask/snaps-monorepo/pull/1193))
|
|
45
|
+
|
|
46
|
+
## [0.29.0]
|
|
47
|
+
### Changed
|
|
48
|
+
- Skip writing manifest if identical ([#1171](https://github.com/MetaMask/snaps-monorepo/pull/1171))
|
|
49
|
+
- This fixes a bug on Windows where the CLI could get stuck in a loop
|
|
50
|
+
|
|
51
|
+
### Removed
|
|
52
|
+
- **BREAKING:** Remove `SnapsGlobalObject` type ([#1014](https://github.com/MetaMask/snaps-monorepo/pull/1014))
|
|
53
|
+
|
|
54
|
+
## [0.28.0]
|
|
55
|
+
### Added
|
|
56
|
+
- **BREAKING:** Add support for snap registries ([#1090](https://github.com/MetaMask/snaps-monorepo/pull/1090))
|
|
57
|
+
- This removes the `checkBlockList` constructor argument in favor of `registry`
|
|
58
|
+
- A registry implementation can be passed here, defaulting to a hosted JSON file
|
|
59
|
+
- Requiring a snap to be on the allowlist can be toggled with the feature flag `requireAllowlist`
|
|
60
|
+
- Add experimental offscreen execution environment ([#1082](https://github.com/MetaMask/snaps-monorepo/pull/1082))
|
|
61
|
+
|
|
62
|
+
### Changed
|
|
63
|
+
- **BREAKING:** Bump `key-tree` to 6.2.0 and use `Uint8Array` for secret recovery phrases ([#1137](https://github.com/MetaMask/snaps-monorepo/pull/1137))
|
|
64
|
+
|
|
65
|
+
### Removed
|
|
66
|
+
- **BREAKING:** Remove `WebSocket` endowment ([#1122](https://github.com/MetaMask/snaps-monorepo/pull/1122))
|
|
67
|
+
|
|
68
|
+
### Fixed
|
|
69
|
+
- Fix missing cronjob export ([#1134](https://github.com/MetaMask/snaps-monorepo/pull/1134))
|
|
70
|
+
|
|
71
|
+
## [0.27.1]
|
|
72
|
+
### Changed
|
|
73
|
+
- No changes this release.
|
|
74
|
+
|
|
75
|
+
## [0.27.0]
|
|
76
|
+
### Changed
|
|
77
|
+
- **BREAKING:** Use SIP-6 algorithm for state encryption ([#1055](https://github.com/MetaMask/snaps-monorepo/pull/1055))
|
|
78
|
+
- This breaks all existing snaps that use `snap_manageState`
|
|
79
|
+
- **BREAKING:** Use custom UI in transaction insights ([#1047](https://github.com/MetaMask/snaps-monorepo/pull/1047))
|
|
80
|
+
- **BREAKING:** Move all internal types from `snaps-types` to `snaps-utils` ([#1060](https://github.com/MetaMask/snaps-monorepo/pull/1060))
|
|
81
|
+
|
|
82
|
+
## [0.26.2]
|
|
83
|
+
### Changed
|
|
84
|
+
- No changes this release.
|
|
85
|
+
|
|
86
|
+
## [0.26.1]
|
|
87
|
+
### Fixed
|
|
88
|
+
- Fix some paths being wrongly normalized ([#1053](https://github.com/MetaMask/snaps-monorepo/pull/1053))
|
|
89
|
+
- Fix utils browser export ([#1049](https://github.com/MetaMask/snaps-monorepo/pull/1049))
|
|
90
|
+
|
|
91
|
+
## [0.26.0]
|
|
92
|
+
### Fixed
|
|
93
|
+
- Fix post processing issue with `object.eval` ([#1040](https://github.com/MetaMask/snaps-monorepo/pull/1040))
|
|
94
|
+
|
|
95
|
+
## [0.25.0]
|
|
96
|
+
### Added
|
|
97
|
+
- **BREAKING:** Add JSON-RPC handler permission ([#905](https://github.com/MetaMask/snaps-monorepo/pull/905))
|
|
98
|
+
- Snaps are now required to request `endowment:rpc` to receive RPC requests.
|
|
99
|
+
|
|
100
|
+
## [0.24.1]
|
|
101
|
+
### Fixed
|
|
102
|
+
- Fix `snap_getBip32PublicKey` manifest validation ([#970](https://github.com/MetaMask/snaps-monorepo/pull/970))
|
|
103
|
+
|
|
104
|
+
## [0.24.0]
|
|
105
|
+
### Added
|
|
106
|
+
- Add transaction insight caveat for accessing transaction origin ([#902](https://github.com/MetaMask/snaps-monorepo/pull/902))
|
|
107
|
+
- Add `snap_getEntropy` JSON-RPC method ([#940](https://github.com/MetaMask/snaps-monorepo/pull/940))
|
|
108
|
+
- Add permission validation to `snap.manifest.json` ([#910](https://github.com/MetaMask/snaps-monorepo/pull/910))
|
|
109
|
+
- Add compile-time warning when using `Math.random` ([#950](https://github.com/MetaMask/snaps-monorepo/pull/950))
|
|
16
110
|
|
|
17
|
-
## [0.37.2-flask.1]
|
|
18
111
|
### Changed
|
|
19
|
-
-
|
|
20
|
-
|
|
21
|
-
|
|
112
|
+
- **BREAKING:** Rename package to start with `snaps-` ([#937](https://github.com/MetaMask/snaps-monorepo/pull/937))
|
|
113
|
+
- **BREAKING:** Remove `wallet` global in favor of `snap` and `ethereum` ([#939](https://github.com/MetaMask/snaps-monorepo/pull/939), [#964](https://github.com/MetaMask/snaps-monorepo/pull/964))
|
|
114
|
+
|
|
115
|
+
## [0.23.0]
|
|
116
|
+
### Added
|
|
117
|
+
- Add snap cronjobs ([#651](https://github.com/MetaMask/snaps-monorepo/pull/651))
|
|
118
|
+
|
|
119
|
+
### Changed
|
|
120
|
+
- **BREAKING:** Replace Buffer with Typed Arrays ([#878](https://github.com/MetaMask/snaps-monorepo/pull/878))
|
|
121
|
+
- Improve keyring endowment error messaging ([#884](https://github.com/MetaMask/snaps-monorepo/pull/884))
|
|
122
|
+
- Replace JSON schema validation with structs ([#862](https://github.com/MetaMask/snaps-monorepo/pull/862))
|
|
123
|
+
|
|
124
|
+
### Removed
|
|
125
|
+
- **BREAKING:** Stop including source code in SnapController state ([#861](https://github.com/MetaMask/snaps-monorepo/pull/861))
|
|
126
|
+
|
|
127
|
+
## [0.22.3]
|
|
128
|
+
### Fixed
|
|
129
|
+
- Make @babel/types a regular dependency ([#852](https://github.com/MetaMask/snaps-monorepo/pull/852))
|
|
130
|
+
|
|
131
|
+
## [0.22.2]
|
|
132
|
+
### Changed
|
|
133
|
+
- No changes this release.
|
|
134
|
+
|
|
135
|
+
## [0.22.1]
|
|
136
|
+
### Fixed
|
|
137
|
+
- Add browser entry point for `snap-utils` ([#820](https://github.com/MetaMask/snaps-monorepo/pull/820))
|
|
138
|
+
|
|
139
|
+
## [0.22.0]
|
|
140
|
+
### Added
|
|
141
|
+
- Add functionality required for Snap Keyring support ([#700](https://github.com/MetaMask/snaps-monorepo/pull/700), [#777](https://github.com/MetaMask/snaps-monorepo/pull/777))
|
|
142
|
+
|
|
143
|
+
## [0.21.0]
|
|
144
|
+
### Changed
|
|
145
|
+
- Run eval and fix manifest in bundler plugins ([#731](https://github.com/MetaMask/snaps-monorepo/pull/731))
|
|
146
|
+
|
|
147
|
+
## [0.20.0]
|
|
148
|
+
### Added
|
|
149
|
+
- **BREAKING:** Add Transaction Insight API ([#642](https://github.com/MetaMask/snaps-monorepo/pull/642))
|
|
150
|
+
- Add internal types from `@metamask/snaps-types` ([#695](https://github.com/MetaMask/snaps-monorepo/pull/695))
|
|
151
|
+
|
|
152
|
+
### Changed
|
|
153
|
+
- **BREAKING:** Simplify manifest format for permission caveats ([#705](https://github.com/MetaMask/snaps-monorepo/pull/705))
|
|
154
|
+
- Reduce TypeScript compilation target for `snap-controllers` ([#708](https://github.com/MetaMask/snaps-monorepo/pull/708))
|
|
155
|
+
|
|
156
|
+
## [0.19.1]
|
|
157
|
+
### Added
|
|
158
|
+
- Generate source maps from modified code ([#615](https://github.com/MetaMask/snaps-monorepo/pull/615))
|
|
159
|
+
|
|
160
|
+
## [0.19.0]
|
|
161
|
+
### Changed
|
|
162
|
+
- Move eval functionality to utils package ([#666](https://github.com/MetaMask/snaps-monorepo/pull/666))
|
|
163
|
+
- Move manifest handling functionality to utils ([#652](https://github.com/MetaMask/snaps-monorepo/pull/652))
|
|
164
|
+
- Move JSON schemas and controller utils to utils package ([#623](https://github.com/MetaMask/snaps-monorepo/pull/623))
|
|
165
|
+
|
|
166
|
+
### Fixed
|
|
167
|
+
- Fixed missing AbortSignal in default endowments ([#682](https://github.com/MetaMask/snaps-monorepo/pull/682))
|
|
168
|
+
|
|
169
|
+
## [0.18.1]
|
|
170
|
+
### Changed
|
|
171
|
+
- No changes this release.
|
|
172
|
+
|
|
173
|
+
## [0.18.0]
|
|
174
|
+
### Changed
|
|
175
|
+
- Reduce TypeScript compilation target to ES2017 ([#628](https://github.com/MetaMask/snaps-monorepo/pull/628))
|
|
176
|
+
|
|
177
|
+
## [0.17.0]
|
|
178
|
+
### Changed
|
|
179
|
+
- **BREAKING:** Bump minimum Node version to 16 ([#601](https://github.com/MetaMask/snaps-monorepo/pull/601))
|
|
180
|
+
|
|
181
|
+
## [0.16.0]
|
|
182
|
+
### Changed
|
|
183
|
+
- No changes this release.
|
|
184
|
+
|
|
185
|
+
## [0.15.0]
|
|
186
|
+
### Fixed
|
|
187
|
+
- Fix an issue where comment stripping would break for large files ([#468](https://github.com/MetaMask/snaps-monorepo/pull/468))
|
|
188
|
+
|
|
189
|
+
## [0.14.0]
|
|
190
|
+
### Changed
|
|
191
|
+
- **BREAKING:** Increase TypeScript compilation target to ES2020 ([#449](https://github.com/MetaMask/snaps-monorepo/pull/449))
|
|
192
|
+
- This should not be breaking for consumers on any non-deprecated browser or Node.js version.
|
|
193
|
+
|
|
194
|
+
## [0.13.0]
|
|
195
|
+
### Changed
|
|
196
|
+
- No changes this release.
|
|
197
|
+
|
|
198
|
+
## [0.12.0]
|
|
199
|
+
### Added
|
|
200
|
+
- Initial release ([#410](https://github.com/MetaMask/snaps-monorepo/pull/410), [#421](https://github.com/MetaMask/snaps-monorepo/pull/421))
|
|
22
201
|
|
|
23
|
-
[Unreleased]: https://github.com/MetaMask/snaps/compare
|
|
24
|
-
[0.
|
|
25
|
-
[0.
|
|
202
|
+
[Unreleased]: https://github.com/MetaMask/snaps/compare/v1.0.0...HEAD
|
|
203
|
+
[1.0.0]: https://github.com/MetaMask/snaps/compare/v1.0.0-prerelease.1...v1.0.0
|
|
204
|
+
[1.0.0-prerelease.1]: https://github.com/MetaMask/snaps/compare/v0.32.2...v1.0.0-prerelease.1
|
|
205
|
+
[0.32.2]: https://github.com/MetaMask/snaps/compare/v0.32.1...v0.32.2
|
|
206
|
+
[0.32.1]: https://github.com/MetaMask/snaps/compare/v0.32.0...v0.32.1
|
|
207
|
+
[0.32.0]: https://github.com/MetaMask/snaps/compare/v0.31.0...v0.32.0
|
|
208
|
+
[0.31.0]: https://github.com/MetaMask/snaps/compare/v0.30.0...v0.31.0
|
|
209
|
+
[0.30.0]: https://github.com/MetaMask/snaps/compare/v0.29.0...v0.30.0
|
|
210
|
+
[0.29.0]: https://github.com/MetaMask/snaps/compare/v0.28.0...v0.29.0
|
|
211
|
+
[0.28.0]: https://github.com/MetaMask/snaps/compare/v0.27.1...v0.28.0
|
|
212
|
+
[0.27.1]: https://github.com/MetaMask/snaps/compare/v0.27.0...v0.27.1
|
|
213
|
+
[0.27.0]: https://github.com/MetaMask/snaps/compare/v0.26.2...v0.27.0
|
|
214
|
+
[0.26.2]: https://github.com/MetaMask/snaps/compare/v0.26.1...v0.26.2
|
|
215
|
+
[0.26.1]: https://github.com/MetaMask/snaps/compare/v0.26.0...v0.26.1
|
|
216
|
+
[0.26.0]: https://github.com/MetaMask/snaps/compare/v0.25.0...v0.26.0
|
|
217
|
+
[0.25.0]: https://github.com/MetaMask/snaps/compare/v0.24.1...v0.25.0
|
|
218
|
+
[0.24.1]: https://github.com/MetaMask/snaps/compare/v0.24.0...v0.24.1
|
|
219
|
+
[0.24.0]: https://github.com/MetaMask/snaps/compare/v0.23.0...v0.24.0
|
|
220
|
+
[0.23.0]: https://github.com/MetaMask/snaps/compare/v0.22.3...v0.23.0
|
|
221
|
+
[0.22.3]: https://github.com/MetaMask/snaps/compare/v0.22.2...v0.22.3
|
|
222
|
+
[0.22.2]: https://github.com/MetaMask/snaps/compare/v0.22.1...v0.22.2
|
|
223
|
+
[0.22.1]: https://github.com/MetaMask/snaps/compare/v0.22.0...v0.22.1
|
|
224
|
+
[0.22.0]: https://github.com/MetaMask/snaps/compare/v0.21.0...v0.22.0
|
|
225
|
+
[0.21.0]: https://github.com/MetaMask/snaps/compare/v0.20.0...v0.21.0
|
|
226
|
+
[0.20.0]: https://github.com/MetaMask/snaps/compare/v0.19.1...v0.20.0
|
|
227
|
+
[0.19.1]: https://github.com/MetaMask/snaps/compare/v0.19.0...v0.19.1
|
|
228
|
+
[0.19.0]: https://github.com/MetaMask/snaps/compare/v0.18.1...v0.19.0
|
|
229
|
+
[0.18.1]: https://github.com/MetaMask/snaps/compare/v0.18.0...v0.18.1
|
|
230
|
+
[0.18.0]: https://github.com/MetaMask/snaps/compare/v0.17.0...v0.18.0
|
|
231
|
+
[0.17.0]: https://github.com/MetaMask/snaps/compare/v0.16.0...v0.17.0
|
|
232
|
+
[0.16.0]: https://github.com/MetaMask/snaps/compare/v0.15.0...v0.16.0
|
|
233
|
+
[0.15.0]: https://github.com/MetaMask/snaps/compare/v0.14.0...v0.15.0
|
|
234
|
+
[0.14.0]: https://github.com/MetaMask/snaps/compare/v0.13.0...v0.14.0
|
|
235
|
+
[0.13.0]: https://github.com/MetaMask/snaps/compare/v0.12.0...v0.13.0
|
|
236
|
+
[0.12.0]: https://github.com/MetaMask/snaps/releases/tag/v0.12.0
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isEqual = void 0;
|
|
1
4
|
/**
|
|
2
5
|
* Checks if array `a` is equal to array `b`. Note that this does not do a deep
|
|
3
6
|
* equality check. It only checks if the arrays are the same length and if each
|
|
@@ -6,8 +9,9 @@
|
|
|
6
9
|
* @param a - The first array to compare.
|
|
7
10
|
* @param b - The second array to compare.
|
|
8
11
|
* @returns `true` if the arrays are equal, `false` otherwise.
|
|
9
|
-
*/
|
|
10
|
-
|
|
12
|
+
*/
|
|
13
|
+
function isEqual(a, b) {
|
|
14
|
+
return a.length === b.length && a.every((value, index) => value === b[index]);
|
|
11
15
|
}
|
|
12
|
-
|
|
16
|
+
exports.isEqual = isEqual;
|
|
13
17
|
//# sourceMappingURL=array.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"array.js","sourceRoot":"","sources":["../src/array.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;GAQG;AACH,SAAgB,OAAO,CAAC,CAAY,EAAE,CAAY;IAChD,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;AAChF,CAAC;AAFD,0BAEC","sourcesContent":["/**\n * Checks if array `a` is equal to array `b`. Note that this does not do a deep\n * equality check. It only checks if the arrays are the same length and if each\n * element in `a` is equal to (`===`) the corresponding element in `b`.\n *\n * @param a - The first array to compare.\n * @param b - The second array to compare.\n * @returns `true` if the arrays are equal, `false` otherwise.\n */\nexport function isEqual(a: unknown[], b: unknown[]): boolean {\n return a.length === b.length && a.every((value, index) => value === b[index]);\n}\n"]}
|
|
@@ -7,6 +7,10 @@ export declare enum SnapCaveatType {
|
|
|
7
7
|
* Permitted coin types, used by `snap_getBip44Entropy`.
|
|
8
8
|
*/
|
|
9
9
|
PermittedCoinTypes = "permittedCoinTypes",
|
|
10
|
+
/**
|
|
11
|
+
* Permission to use the Snap keyring API.
|
|
12
|
+
*/
|
|
13
|
+
SnapKeyring = "snapKeyring",
|
|
10
14
|
/**
|
|
11
15
|
* Caveat specifying a snap cronjob.
|
|
12
16
|
*/
|
package/dist/caveats.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SnapCaveatType = void 0;
|
|
4
|
+
var SnapCaveatType;
|
|
5
|
+
(function (SnapCaveatType) {
|
|
6
|
+
/**
|
|
7
|
+
* Permitted derivation paths, used by `snap_getBip32Entropy`.
|
|
8
|
+
*/
|
|
9
|
+
SnapCaveatType["PermittedDerivationPaths"] = "permittedDerivationPaths";
|
|
10
|
+
/**
|
|
11
|
+
* Permitted coin types, used by `snap_getBip44Entropy`.
|
|
12
|
+
*/
|
|
13
|
+
SnapCaveatType["PermittedCoinTypes"] = "permittedCoinTypes";
|
|
14
|
+
/**
|
|
15
|
+
* Permission to use the Snap keyring API.
|
|
16
|
+
*/
|
|
17
|
+
SnapCaveatType["SnapKeyring"] = "snapKeyring";
|
|
18
|
+
/**
|
|
19
|
+
* Caveat specifying a snap cronjob.
|
|
20
|
+
*/
|
|
21
|
+
SnapCaveatType["SnapCronjob"] = "snapCronjob";
|
|
22
|
+
/**
|
|
23
|
+
* Caveat specifying access to the transaction origin, used by `endowment:transaction-insight`.
|
|
24
|
+
*/
|
|
25
|
+
SnapCaveatType["TransactionOrigin"] = "transactionOrigin";
|
|
26
|
+
/**
|
|
27
|
+
* The origins that a Snap can receive JSON-RPC messages from.
|
|
28
|
+
*/
|
|
29
|
+
SnapCaveatType["RpcOrigin"] = "rpcOrigin";
|
|
30
|
+
/**
|
|
31
|
+
* Caveat specifying the snap IDs that can be interacted with.
|
|
32
|
+
*/
|
|
33
|
+
SnapCaveatType["SnapIds"] = "snapIds";
|
|
34
|
+
})(SnapCaveatType = exports.SnapCaveatType || (exports.SnapCaveatType = {}));
|
|
35
|
+
//# sourceMappingURL=caveats.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"caveats.js","sourceRoot":"","sources":["../src/caveats.ts"],"names":[],"mappings":";;;AAAA,IAAY,cAmCX;AAnCD,WAAY,cAAc;IACxB;;OAEG;IACH,uEAAqD,CAAA;IAErD;;OAEG;IACH,2DAAyC,CAAA;IAEzC;;OAEG;IACH,6CAA2B,CAAA;IAE3B;;OAEG;IACH,6CAA2B,CAAA;IAE3B;;OAEG;IACH,yDAAuC,CAAA;IAEvC;;OAEG;IACH,yCAAuB,CAAA;IAEvB;;OAEG;IACH,qCAAmB,CAAA;AACrB,CAAC,EAnCW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAmCzB","sourcesContent":["export enum SnapCaveatType {\n /**\n * Permitted derivation paths, used by `snap_getBip32Entropy`.\n */\n PermittedDerivationPaths = 'permittedDerivationPaths',\n\n /**\n * Permitted coin types, used by `snap_getBip44Entropy`.\n */\n PermittedCoinTypes = 'permittedCoinTypes',\n\n /**\n * Permission to use the Snap keyring API.\n */\n SnapKeyring = 'snapKeyring',\n\n /**\n * Caveat specifying a snap cronjob.\n */\n SnapCronjob = 'snapCronjob',\n\n /**\n * Caveat specifying access to the transaction origin, used by `endowment:transaction-insight`.\n */\n TransactionOrigin = 'transactionOrigin',\n\n /**\n * The origins that a Snap can receive JSON-RPC messages from.\n */\n RpcOrigin = 'rpcOrigin',\n\n /**\n * Caveat specifying the snap IDs that can be interacted with.\n */\n SnapIds = 'snapIds',\n}\n"]}
|
package/dist/checksum.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.checksumFiles = exports.checksum = void 0;
|
|
4
|
+
const utils_1 = require("@metamask/utils");
|
|
5
|
+
const sha256_1 = require("@noble/hashes/sha256");
|
|
6
|
+
const VirtualFile_1 = require("./virtual-file/VirtualFile");
|
|
7
|
+
/**
|
|
8
|
+
* Calculates checksum for a single byte array.
|
|
9
|
+
*
|
|
10
|
+
* @param bytes - The byte array to calculate the checksum for.
|
|
11
|
+
* @returns A single sha-256 checksum.
|
|
12
|
+
*/
|
|
13
|
+
function checksum(bytes) {
|
|
14
|
+
const value = bytes instanceof VirtualFile_1.VirtualFile ? bytes.value : bytes;
|
|
15
|
+
return (0, sha256_1.sha256)(value);
|
|
16
|
+
}
|
|
17
|
+
exports.checksum = checksum;
|
|
18
|
+
/**
|
|
19
|
+
* Calculates checksum over multiple files in a reproducible way.
|
|
20
|
+
*
|
|
21
|
+
* 1. Sort all the files by their paths.
|
|
22
|
+
* 2. Calculate sha-256 checksum of each file separately.
|
|
23
|
+
* 3. Concatenate all the checksums into one buffer and sha-256 that buffer.
|
|
24
|
+
*
|
|
25
|
+
* The sorting of paths is done using {@link https://tc39.es/ecma262/#sec-islessthan UTF-16 Code Units}.
|
|
26
|
+
*
|
|
27
|
+
* @param files - The files over which to calculate the checksum.
|
|
28
|
+
* @returns A single sha-256 checksum.
|
|
29
|
+
*/
|
|
30
|
+
function checksumFiles(files) {
|
|
31
|
+
return checksum((0, utils_1.concatBytes)([...files]
|
|
32
|
+
.sort((a, b) => {
|
|
33
|
+
(0, utils_1.assert)(a.path !== b.path, 'Tried to sort files with non-unique paths.');
|
|
34
|
+
if (a.path < b.path) {
|
|
35
|
+
return -1;
|
|
36
|
+
}
|
|
37
|
+
return 1;
|
|
38
|
+
})
|
|
39
|
+
.map((file) => checksum(file))));
|
|
40
|
+
}
|
|
41
|
+
exports.checksumFiles = checksumFiles;
|
|
42
|
+
//# sourceMappingURL=checksum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checksum.js","sourceRoot":"","sources":["../src/checksum.ts"],"names":[],"mappings":";;;AAAA,2CAAsD;AACtD,iDAA8C;AAE9C,4DAAyD;AAEzD;;;;;GAKG;AACH,SAAgB,QAAQ,CAAC,KAAwC;IAC/D,MAAM,KAAK,GAAG,KAAK,YAAY,yBAAW,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;IACjE,OAAO,IAAA,eAAM,EAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AAHD,4BAGC;AAED;;;;;;;;;;;GAWG;AACH,SAAgB,aAAa,CAAC,KAAoB;IAChD,OAAO,QAAQ,CACb,IAAA,mBAAW,EACT,CAAC,GAAG,KAAK,CAAC;SACP,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QACb,IAAA,cAAM,EACJ,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,EACjB,4CAA4C,CAC7C,CAAC;QACF,IAAI,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE;YACnB,OAAO,CAAC,CAAC,CAAC;SACX;QACD,OAAO,CAAC,CAAC;IACX,CAAC,CAAC;SACD,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CACjC,CACF,CAAC;AACJ,CAAC;AAjBD,sCAiBC","sourcesContent":["import { assert, concatBytes } from '@metamask/utils';\nimport { sha256 } from '@noble/hashes/sha256';\n\nimport { VirtualFile } from './virtual-file/VirtualFile';\n\n/**\n * Calculates checksum for a single byte array.\n *\n * @param bytes - The byte array to calculate the checksum for.\n * @returns A single sha-256 checksum.\n */\nexport function checksum(bytes: VirtualFile | Uint8Array | string): Uint8Array {\n const value = bytes instanceof VirtualFile ? bytes.value : bytes;\n return sha256(value);\n}\n\n/**\n * Calculates checksum over multiple files in a reproducible way.\n *\n * 1. Sort all the files by their paths.\n * 2. Calculate sha-256 checksum of each file separately.\n * 3. Concatenate all the checksums into one buffer and sha-256 that buffer.\n *\n * The sorting of paths is done using {@link https://tc39.es/ecma262/#sec-islessthan UTF-16 Code Units}.\n *\n * @param files - The files over which to calculate the checksum.\n * @returns A single sha-256 checksum.\n */\nexport function checksumFiles(files: VirtualFile[]) {\n return checksum(\n concatBytes(\n [...files]\n .sort((a, b) => {\n assert(\n a.path !== b.path,\n 'Tried to sort files with non-unique paths.',\n );\n if (a.path < b.path) {\n return -1;\n }\n return 1;\n })\n .map((file) => checksum(file)),\n ),\n );\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Infer } from 'superstruct';
|
|
2
2
|
export declare const CronjobRpcRequestStruct: import("superstruct").Struct<{
|
|
3
3
|
method: string;
|
|
4
4
|
params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[] | undefined;
|
package/dist/cronjob.js
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isCronjobSpecificationArray = exports.CronjobSpecificationArrayStruct = exports.isCronjobSpecification = exports.CronjobSpecificationStruct = exports.parseCronExpression = exports.CronExpressionStruct = exports.CronjobRpcRequestStruct = void 0;
|
|
4
|
+
const utils_1 = require("@metamask/utils");
|
|
5
|
+
const cron_parser_1 = require("cron-parser");
|
|
6
|
+
const superstruct_1 = require("superstruct");
|
|
7
|
+
exports.CronjobRpcRequestStruct = (0, superstruct_1.assign)((0, superstruct_1.partial)((0, superstruct_1.pick)(utils_1.JsonRpcRequestStruct, ['id', 'jsonrpc'])), (0, superstruct_1.omit)(utils_1.JsonRpcRequestStruct, ['id', 'jsonrpc']));
|
|
8
|
+
exports.CronExpressionStruct = (0, superstruct_1.refine)((0, superstruct_1.coerce)((0, superstruct_1.string)(), (0, superstruct_1.object)({
|
|
9
|
+
minute: (0, superstruct_1.optional)((0, superstruct_1.string)()),
|
|
10
|
+
hour: (0, superstruct_1.optional)((0, superstruct_1.string)()),
|
|
11
|
+
dayOfMonth: (0, superstruct_1.optional)((0, superstruct_1.string)()),
|
|
12
|
+
month: (0, superstruct_1.optional)((0, superstruct_1.string)()),
|
|
13
|
+
dayOfWeek: (0, superstruct_1.optional)((0, superstruct_1.string)()),
|
|
14
|
+
}), (value) => `${value.minute ?? '*'} ${value.hour ?? '*'} ${value.dayOfMonth ?? '*'} ${value.month ?? '*'} ${value.dayOfWeek ?? '*'}`), 'CronExpression', (value) => {
|
|
15
|
+
try {
|
|
16
|
+
(0, cron_parser_1.parseExpression)(value);
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
/**
|
|
24
|
+
* Parses a cron expression.
|
|
25
|
+
*
|
|
26
|
+
* @param expression - Expression to parse.
|
|
27
|
+
* @returns A CronExpression class instance.
|
|
28
|
+
*/
|
|
29
|
+
function parseCronExpression(expression) {
|
|
30
|
+
const ensureStringExpression = (0, superstruct_1.create)(expression, exports.CronExpressionStruct);
|
|
31
|
+
return (0, cron_parser_1.parseExpression)(ensureStringExpression);
|
|
32
|
+
}
|
|
33
|
+
exports.parseCronExpression = parseCronExpression;
|
|
34
|
+
exports.CronjobSpecificationStruct = (0, superstruct_1.object)({
|
|
35
|
+
expression: exports.CronExpressionStruct,
|
|
36
|
+
request: exports.CronjobRpcRequestStruct,
|
|
37
|
+
});
|
|
38
|
+
/**
|
|
39
|
+
* Check if the given value is a {@link CronjobSpecification} object.
|
|
40
|
+
*
|
|
41
|
+
* @param value - The value to check.
|
|
42
|
+
* @returns Whether the value is a valid {@link CronjobSpecification} object.
|
|
43
|
+
*/
|
|
44
|
+
function isCronjobSpecification(value) {
|
|
45
|
+
try {
|
|
46
|
+
(0, superstruct_1.create)(value, exports.CronjobSpecificationStruct);
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.isCronjobSpecification = isCronjobSpecification;
|
|
54
|
+
exports.CronjobSpecificationArrayStruct = (0, superstruct_1.array)(exports.CronjobSpecificationStruct);
|
|
55
|
+
/**
|
|
56
|
+
* Check if the given value is an array of {@link CronjobSpecification} objects.
|
|
57
|
+
*
|
|
58
|
+
* @param value - The value to check.
|
|
59
|
+
* @returns Whether the value is a valid array of {@link CronjobSpecification} objects.
|
|
60
|
+
*/
|
|
61
|
+
function isCronjobSpecificationArray(value) {
|
|
62
|
+
try {
|
|
63
|
+
(0, superstruct_1.create)(value, exports.CronjobSpecificationArrayStruct);
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
exports.isCronjobSpecificationArray = isCronjobSpecificationArray;
|
|
71
|
+
//# sourceMappingURL=cronjob.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cronjob.js","sourceRoot":"","sources":["../src/cronjob.ts"],"names":[],"mappings":";;;AAAA,2CAAuD;AACvD,6CAA8C;AAC9C,6CAaqB;AAER,QAAA,uBAAuB,GAAG,IAAA,oBAAM,EAC3C,IAAA,qBAAO,EAAC,IAAA,kBAAI,EAAC,4BAAoB,EAAE,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,EACtD,IAAA,kBAAI,EAAC,4BAAoB,EAAE,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAC9C,CAAC;AAGW,QAAA,oBAAoB,GAAG,IAAA,oBAAM,EACxC,IAAA,oBAAM,EACJ,IAAA,oBAAM,GAAE,EACR,IAAA,oBAAM,EAAC;IACL,MAAM,EAAE,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC;IAC1B,IAAI,EAAE,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC;IACxB,UAAU,EAAE,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC;IAC9B,KAAK,EAAE,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC;IACzB,SAAS,EAAE,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC;CAC9B,CAAC,EACF,CAAC,KAAK,EAAE,EAAE,CACR,GAAG,KAAK,CAAC,MAAM,IAAI,GAAG,IAAI,KAAK,CAAC,IAAI,IAAI,GAAG,IAAI,KAAK,CAAC,UAAU,IAAI,GAAG,IACpE,KAAK,CAAC,KAAK,IAAI,GACjB,IAAI,KAAK,CAAC,SAAS,IAAI,GAAG,EAAE,CAC/B,EACD,gBAAgB,EAChB,CAAC,KAAK,EAAE,EAAE;IACR,IAAI;QACF,IAAA,6BAAe,EAAC,KAAK,CAAC,CAAC;QACvB,OAAO,IAAI,CAAC;KACb;IAAC,MAAM;QACN,OAAO,KAAK,CAAC;KACd;AACH,CAAC,CACF,CAAC;AAIF;;;;;GAKG;AACH,SAAgB,mBAAmB,CAAC,UAA2B;IAC7D,MAAM,sBAAsB,GAAG,IAAA,oBAAM,EAAC,UAAU,EAAE,4BAAoB,CAAC,CAAC;IACxE,OAAO,IAAA,6BAAe,EAAC,sBAAsB,CAAC,CAAC;AACjD,CAAC;AAHD,kDAGC;AAEY,QAAA,0BAA0B,GAAG,IAAA,oBAAM,EAAC;IAC/C,UAAU,EAAE,4BAAoB;IAChC,OAAO,EAAE,+BAAuB;CACjC,CAAC,CAAC;AAGH;;;;;GAKG;AACH,SAAgB,sBAAsB,CAAC,KAAc;IACnD,IAAI;QACF,IAAA,oBAAM,EAAC,KAAK,EAAE,kCAA0B,CAAC,CAAC;QAC1C,OAAO,IAAI,CAAC;KACb;IAAC,MAAM;QACN,OAAO,KAAK,CAAC;KACd;AACH,CAAC;AAPD,wDAOC;AAEY,QAAA,+BAA+B,GAAG,IAAA,mBAAK,EAClD,kCAA0B,CAC3B,CAAC;AAEF;;;;;GAKG;AACH,SAAgB,2BAA2B,CAAC,KAAc;IACxD,IAAI;QACF,IAAA,oBAAM,EAAC,KAAK,EAAE,uCAA+B,CAAC,CAAC;QAC/C,OAAO,IAAI,CAAC;KACb;IAAC,MAAM;QACN,OAAO,KAAK,CAAC;KACd;AACH,CAAC;AAPD,kEAOC","sourcesContent":["import { JsonRpcRequestStruct } from '@metamask/utils';\nimport { parseExpression } from 'cron-parser';\nimport {\n array,\n assign,\n coerce,\n create,\n Infer,\n object,\n omit,\n optional,\n partial,\n pick,\n refine,\n string,\n} from 'superstruct';\n\nexport const CronjobRpcRequestStruct = assign(\n partial(pick(JsonRpcRequestStruct, ['id', 'jsonrpc'])),\n omit(JsonRpcRequestStruct, ['id', 'jsonrpc']),\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"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.deepClone = void 0;
|
|
7
|
+
const rfdc_1 = __importDefault(require("rfdc"));
|
|
8
|
+
exports.deepClone = (0, rfdc_1.default)({ proto: false, circles: false });
|
|
9
|
+
//# sourceMappingURL=deep-clone.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deep-clone.js","sourceRoot":"","sources":["../src/deep-clone.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAEX,QAAA,SAAS,GAAG,IAAA,cAAI,EAAC,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC","sourcesContent":["import rfdc from 'rfdc';\n\nexport const deepClone = rfdc({ proto: false, circles: false });\n"]}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_ENDOWMENTS = void 0;
|
|
1
4
|
/**
|
|
2
5
|
* Global JavaScript APIs exposed by default to all snaps.
|
|
3
|
-
*/
|
|
6
|
+
*/
|
|
7
|
+
exports.DEFAULT_ENDOWMENTS = Object.freeze([
|
|
4
8
|
'atob',
|
|
5
9
|
'btoa',
|
|
6
10
|
'BigInt',
|
|
@@ -33,7 +37,6 @@
|
|
|
33
37
|
// https://github.com/MetaMask/snaps-monorepo/issues/662
|
|
34
38
|
// https://github.com/MetaMask/snaps-monorepo/discussions/678
|
|
35
39
|
'AbortController',
|
|
36
|
-
'AbortSignal'
|
|
40
|
+
'AbortSignal',
|
|
37
41
|
]);
|
|
38
|
-
|
|
39
42
|
//# sourceMappingURL=default-endowments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-endowments.js","sourceRoot":"","sources":["../src/default-endowments.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACU,QAAA,kBAAkB,GAAsB,MAAM,CAAC,MAAM,CAAC;IACjE,MAAM;IACN,MAAM;IACN,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,MAAM;IACN,MAAM;IACN,YAAY;IACZ,cAAc;IACd,cAAc;IACd,aAAa;IACb,aAAa;IACb,KAAK;IACL,aAAa;IACb,eAAe;IACf,WAAW;IACX,YAAY;IACZ,mBAAmB;IACnB,YAAY;IACZ,aAAa;IACb,YAAY;IACZ,aAAa;IACb,cAAc;IACd,cAAc;IACd,eAAe;IACf,gBAAgB;IAChB,UAAU;IACV,aAAa;IACb,qFAAqF;IACrF,wDAAwD;IACxD,6DAA6D;IAC7D,iBAAiB;IACjB,aAAa;CACd,CAAC,CAAC","sourcesContent":["/**\n * Global JavaScript APIs exposed by default to all snaps.\n */\nexport const DEFAULT_ENDOWMENTS: readonly string[] = Object.freeze([\n 'atob',\n 'btoa',\n 'BigInt',\n 'console',\n 'crypto',\n 'Date',\n 'Math',\n 'setTimeout',\n 'clearTimeout',\n 'SubtleCrypto',\n 'TextDecoder',\n 'TextEncoder',\n 'URL',\n 'setInterval',\n 'clearInterval',\n 'Int8Array',\n 'Uint8Array',\n 'Uint8ClampedArray',\n 'Int16Array',\n 'Uint16Array',\n 'Int32Array',\n 'Uint32Array',\n 'Float32Array',\n 'Float64Array',\n 'BigInt64Array',\n 'BigUint64Array',\n 'DataView',\n 'ArrayBuffer',\n // Used by fetch, but also as API for some packages that don't do network connections\n // https://github.com/MetaMask/snaps-monorepo/issues/662\n // https://github.com/MetaMask/snaps-monorepo/discussions/678\n 'AbortController',\n 'AbortSignal',\n]);\n"]}
|
package/dist/entropy.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.STATE_ENCRYPTION_MAGIC_VALUE = exports.SIP_6_MAGIC_VALUE = void 0;
|
|
4
|
+
// 0xd36e6170 - 0x80000000
|
|
5
|
+
exports.SIP_6_MAGIC_VALUE = `1399742832'`;
|
|
6
|
+
// `${bytesToNumber(keccak256('Snaps state encryption').slice(0, 4))}'`
|
|
7
|
+
exports.STATE_ENCRYPTION_MAGIC_VALUE = `572232532'`;
|
|
8
|
+
//# sourceMappingURL=entropy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entropy.js","sourceRoot":"","sources":["../src/entropy.ts"],"names":[],"mappings":";;;AAAA,0BAA0B;AACb,QAAA,iBAAiB,GAAG,aAA6B,CAAC;AAE/D,uEAAuE;AAC1D,QAAA,4BAA4B,GAAG,YAA4B,CAAC","sourcesContent":["// 0xd36e6170 - 0x80000000\nexport const SIP_6_MAGIC_VALUE = `1399742832'` as `${number}'`;\n\n// `${bytesToNumber(keccak256('Snaps state encryption').slice(0, 4))}'`\nexport const STATE_ENCRYPTION_MAGIC_VALUE = `572232532'` as `${number}'`;\n\nexport type MagicValue =\n | typeof SIP_6_MAGIC_VALUE\n | typeof STATE_ENCRYPTION_MAGIC_VALUE;\n"]}
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
// eslint-disable-next-line import/no-unassigned-import
|
|
2
1
|
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
5
|
-
});
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// eslint-disable-next-line import/no-unassigned-import
|
|
6
4
|
require("ses/lockdown");
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
5
|
+
const fs_1 = require("fs");
|
|
6
|
+
const mock_1 = require("./mock");
|
|
7
|
+
const types_1 = require("./types");
|
|
10
8
|
lockdown({
|
|
11
9
|
consoleTaming: 'unsafe',
|
|
12
10
|
errorTaming: 'unsafe',
|
|
13
11
|
mathTaming: 'unsafe',
|
|
14
12
|
dateTaming: 'unsafe',
|
|
15
13
|
overrideTaming: 'severe',
|
|
16
|
-
//
|
|
17
|
-
//
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
// TODO: See if there's an easier way to do this. This file is ran in a
|
|
15
|
+
// separate process, so we can't mock SES with Jest.
|
|
16
|
+
...(process.env.NODE_ENV === 'test'
|
|
17
|
+
? {
|
|
18
|
+
domainTaming: 'unsafe',
|
|
19
|
+
}
|
|
20
|
+
: {}),
|
|
20
21
|
});
|
|
21
22
|
/**
|
|
22
23
|
* Get mock endowments that don't do anything. This is useful for running the
|
|
@@ -24,28 +25,26 @@ lockdown({
|
|
|
24
25
|
* for example.
|
|
25
26
|
*
|
|
26
27
|
* @returns The mock endowments.
|
|
27
|
-
*/
|
|
28
|
-
|
|
28
|
+
*/
|
|
29
|
+
function getMockEndowments() {
|
|
30
|
+
const endowments = (0, mock_1.generateMockEndowments)();
|
|
29
31
|
return {
|
|
30
32
|
...endowments,
|
|
31
33
|
window: endowments,
|
|
32
|
-
self: endowments
|
|
34
|
+
self: endowments,
|
|
33
35
|
};
|
|
34
36
|
}
|
|
35
37
|
const snapFilePath = process.argv[2];
|
|
36
|
-
const snapModule = {
|
|
37
|
-
exports: {}
|
|
38
|
-
};
|
|
38
|
+
const snapModule = { exports: {} };
|
|
39
39
|
new Compartment({
|
|
40
40
|
...getMockEndowments(),
|
|
41
41
|
module: snapModule,
|
|
42
|
-
exports: snapModule.exports
|
|
43
|
-
}).evaluate((0,
|
|
44
|
-
const invalidExports = Object.keys(snapModule.exports).filter((snapExport)
|
|
42
|
+
exports: snapModule.exports,
|
|
43
|
+
}).evaluate((0, fs_1.readFileSync)(snapFilePath, 'utf8'));
|
|
44
|
+
const invalidExports = Object.keys(snapModule.exports).filter((snapExport) => !types_1.SNAP_EXPORT_NAMES.includes(snapExport));
|
|
45
45
|
if (invalidExports.length > 0) {
|
|
46
46
|
// eslint-disable-next-line no-console
|
|
47
47
|
console.warn(`Invalid snap exports detected:\n${invalidExports.join('\n')}`);
|
|
48
48
|
}
|
|
49
|
-
setTimeout(()=>process.exit(0), 1000); // Hack to ensure worker exits
|
|
50
|
-
|
|
49
|
+
setTimeout(() => process.exit(0), 1000); // Hack to ensure worker exits
|
|
51
50
|
//# sourceMappingURL=eval-worker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eval-worker.js","sourceRoot":"","sources":["../src/eval-worker.ts"],"names":[],"mappings":";;AAAA,uDAAuD;AACvD,wBAAsB;AAEtB,2BAAkC;AAElC,iCAAgD;AAChD,mCAAyD;AAIzD,QAAQ,CAAC;IACP,aAAa,EAAE,QAAQ;IACvB,WAAW,EAAE,QAAQ;IACrB,UAAU,EAAE,QAAQ;IACpB,UAAU,EAAE,QAAQ;IACpB,cAAc,EAAE,QAAQ;IAExB,uEAAuE;IACvE,oDAAoD;IACpD,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM;QACjC,CAAC,CAAC;YACE,YAAY,EAAE,QAAQ;SACvB;QACH,CAAC,CAAC,EAAE,CAAC;CACR,CAAC,CAAC;AAEH;;;;;;GAMG;AACH,SAAS,iBAAiB;IACxB,MAAM,UAAU,GAAG,IAAA,6BAAsB,GAAE,CAAC;IAC5C,OAAO;QACL,GAAG,UAAU;QACb,MAAM,EAAE,UAAU;QAClB,IAAI,EAAE,UAAU;KACjB,CAAC;AACJ,CAAC;AAED,MAAM,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAErC,MAAM,UAAU,GAAsB,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;AAEtD,IAAI,WAAW,CAAC;IACd,GAAG,iBAAiB,EAAE;IACtB,MAAM,EAAE,UAAU;IAClB,OAAO,EAAE,UAAU,CAAC,OAAO;CAC5B,CAAC,CAAC,QAAQ,CAAC,IAAA,iBAAY,EAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC;AAEhD,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,MAAM,CAC3D,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,yBAAiB,CAAC,QAAQ,CAAC,UAAyB,CAAC,CACvE,CAAC;AAEF,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE;IAC7B,sCAAsC;IACtC,OAAO,CAAC,IAAI,CAAC,mCAAmC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;CAC9E;AAED,UAAU,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,8BAA8B","sourcesContent":["// eslint-disable-next-line import/no-unassigned-import\nimport 'ses/lockdown';\n\nimport { readFileSync } from 'fs';\n\nimport { generateMockEndowments } from './mock';\nimport { HandlerType, SNAP_EXPORT_NAMES } from './types';\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 // TODO: See if there's an easier way to do this. This file is ran in a\n // separate process, so we can't mock SES with Jest.\n ...(process.env.NODE_ENV === 'test'\n ? {\n domainTaming: 'unsafe',\n }\n : {}),\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"]}
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
export declare type EvalOutput = {
|
|
2
|
-
stdout: string;
|
|
3
|
-
stderr: string;
|
|
4
|
-
};
|
|
5
|
-
export declare class SnapEvalError extends Error {
|
|
6
|
-
readonly output: EvalOutput;
|
|
7
|
-
constructor(message: string, output: EvalOutput);
|
|
8
|
-
}
|
|
9
1
|
/**
|
|
10
2
|
* Spawn a new process to run the provided bundle in.
|
|
11
3
|
*
|
|
@@ -13,4 +5,4 @@ export declare class SnapEvalError extends Error {
|
|
|
13
5
|
* @returns `null` if the worker ran successfully.
|
|
14
6
|
* @throws If the worker failed to run successfully.
|
|
15
7
|
*/
|
|
16
|
-
export declare function evalBundle(bundlePath: string): Promise<
|
|
8
|
+
export declare function evalBundle(bundlePath: string): Promise<null>;
|