@metamask/snaps-execution-environments 0.32.2 → 0.33.0-flask.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.
Files changed (47) hide show
  1. package/CHANGELOG.md +298 -0
  2. package/dist/browserify/iframe/bundle.js +453 -665
  3. package/dist/browserify/iframe/index.html +2 -2
  4. package/dist/browserify/node-process/bundle.js +276 -488
  5. package/dist/browserify/node-thread/bundle.js +276 -488
  6. package/dist/browserify/offscreen/bundle.js +162 -416
  7. package/dist/browserify/offscreen/index.html +2 -2
  8. package/dist/browserify/worker-executor/bundle.js +17874 -0
  9. package/dist/browserify/worker-pool/bundle.js +2026 -0
  10. package/dist/browserify/worker-pool/index.html +11660 -0
  11. package/dist/common/BaseSnapExecutor.d.ts +4 -4
  12. package/dist/common/BaseSnapExecutor.js +22 -22
  13. package/dist/common/BaseSnapExecutor.js.map +1 -1
  14. package/dist/common/commands.js +2 -2
  15. package/dist/common/commands.js.map +1 -1
  16. package/dist/common/endowments/commonEndowmentFactory.d.ts +5 -1
  17. package/dist/common/endowments/commonEndowmentFactory.js +2 -1
  18. package/dist/common/endowments/commonEndowmentFactory.js.map +1 -1
  19. package/dist/common/endowments/console.d.ts +45 -0
  20. package/dist/common/endowments/console.js +103 -0
  21. package/dist/common/endowments/console.js.map +1 -0
  22. package/dist/common/endowments/crypto.d.ts +4 -0
  23. package/dist/common/endowments/crypto.js +3 -1
  24. package/dist/common/endowments/crypto.js.map +1 -1
  25. package/dist/common/endowments/index.d.ts +3 -1
  26. package/dist/common/endowments/index.js +3 -3
  27. package/dist/common/endowments/index.js.map +1 -1
  28. package/dist/common/endowments/math.js +4 -1
  29. package/dist/common/endowments/math.js.map +1 -1
  30. package/dist/common/utils.js +2 -1
  31. package/dist/common/utils.js.map +1 -1
  32. package/dist/offscreen/OffscreenSnapExecutor.js +1 -1
  33. package/dist/offscreen/OffscreenSnapExecutor.js.map +1 -1
  34. package/dist/openrpc.json +2 -2
  35. package/dist/webworker/executor/WebWorkerSnapExecutor.d.ts +13 -0
  36. package/dist/webworker/executor/WebWorkerSnapExecutor.js +37 -0
  37. package/dist/webworker/executor/WebWorkerSnapExecutor.js.map +1 -0
  38. package/dist/webworker/executor/index.d.ts +1 -0
  39. package/dist/webworker/executor/index.js +10 -0
  40. package/dist/webworker/executor/index.js.map +1 -0
  41. package/dist/webworker/pool/WebWorkerPool.d.ts +22 -0
  42. package/dist/webworker/pool/WebWorkerPool.js +168 -0
  43. package/dist/webworker/pool/WebWorkerPool.js.map +1 -0
  44. package/dist/webworker/pool/index.d.ts +1 -0
  45. package/dist/webworker/pool/index.js +10 -0
  46. package/dist/webworker/pool/index.js.map +1 -0
  47. package/package.json +21 -20
package/CHANGELOG.md ADDED
@@ -0,0 +1,298 @@
1
+ # Changelog
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [0.33.0-flask.1]
10
+ ### Changed
11
+ - **BREAKING:** Block `wallet_requestPermissions` ([#1371](https://github.com/MetaMask/snaps-monorepo/pull/1371))
12
+ - Add console endowment that prepends snap IDs to log output ([#1355](https://github.com/MetaMask/snaps-monorepo/pull/1355))
13
+ - Add Web Worker support for snap execution ([#1320](https://github.com/MetaMask/snaps-monorepo/pull/1320))
14
+
15
+ ### Fixed
16
+ - Fix Math endowment in Node.js ([#1347](https://github.com/MetaMask/snaps-monorepo/pull/1347))
17
+
18
+ ## [0.32.2]
19
+ ### Changed
20
+ - No changes this release.
21
+
22
+ ## [0.32.1]
23
+ ### Changed
24
+ - No changes this release.
25
+
26
+ ## [0.32.0]
27
+ ### Changed
28
+ - Build execution environments with Browserify and LavaMoat ([#1262](https://github.com/MetaMask/snaps-monorepo/pull/1262))
29
+ - Harden events ([#1221](https://github.com/MetaMask/snaps-monorepo/pull/1221))
30
+
31
+ ### Fixed
32
+ - Fix unbound endowments ([#1299](https://github.com/MetaMask/snaps-monorepo/pull/1299))
33
+
34
+ ## [0.31.0]
35
+ ### Changed
36
+ - **BREAKING:** Target `ES2020` ([#1247](https://github.com/MetaMask/snaps-monorepo/pull/1247))
37
+ - **BREAKING:** Disallow requesting `eth_requestAccounts` and `wallet_requestSnaps` RPC methods ([#1256](https://github.com/MetaMask/snaps-monorepo/pull/1256))
38
+ - Snaps globalThis now has proper self-referential properties ([#1174](https://github.com/MetaMask/snaps-monorepo/pull/1174))
39
+
40
+ ## [0.30.0]
41
+ ### Changed
42
+ - Harden custom endowments ([#1172](https://github.com/MetaMask/snaps-monorepo/pull/1172))
43
+ - Properly secure `snap` and `ethereum` request functions ([#1214](https://github.com/MetaMask/snaps-monorepo/pull/1214))
44
+ - Properly sandbox iframe and inline SES in execution bundles ([#1193](https://github.com/MetaMask/snaps-monorepo/pull/1193))
45
+ - SES is now inlined in `index.html`
46
+
47
+ ## [0.29.0]
48
+ ### Added
49
+ - Harden endowments ([#1058](https://github.com/MetaMask/snaps-monorepo/pull/1058))
50
+ - Constrain `Date` and timeouts ([#1118](https://github.com/MetaMask/snaps-monorepo/pull/1118))
51
+
52
+ ### Changed
53
+ - **BREAKING:** Improve request function types ([#1014](https://github.com/MetaMask/snaps-monorepo/pull/1014))
54
+ - `snap.request` is now strongly typed in line with the JSON-RPC methods in the `rpc-methods` package
55
+
56
+ ## [0.28.0]
57
+ ### Added
58
+ - Add experimental offscreen execution environment ([#1082](https://github.com/MetaMask/snaps-monorepo/pull/1082))
59
+
60
+ ### Changed
61
+ - Add proxy for `ethereum` global ([#1087](https://github.com/MetaMask/snaps-monorepo/pull/1087))
62
+
63
+ ### Removed
64
+ - **BREAKING:** Remove `WebSocket` endowment ([#1122](https://github.com/MetaMask/snaps-monorepo/pull/1122))
65
+
66
+ ## [0.27.1]
67
+ ### Changed
68
+ - No changes this release.
69
+
70
+ ## [0.27.0]
71
+ ### Changed
72
+ - **BREAKING:** Move all internal types from `snaps-types` to `snaps-utils` ([#1060](https://github.com/MetaMask/snaps-monorepo/pull/1060))
73
+
74
+ ## [0.26.2]
75
+ ### Fixed
76
+ - Fix usage of wrong `ethereum` global for `ethereum` endowment ([#1064](https://github.com/MetaMask/snaps-monorepo/pull/1064))
77
+
78
+ ## [0.26.1]
79
+ ### Changed
80
+ - No changes this release.
81
+
82
+ ## [0.26.0]
83
+ ### Changed
84
+ - No changes this release.
85
+
86
+ ## [0.25.0]
87
+ ### Changed
88
+ - No changes this release.
89
+
90
+ ## [0.24.1]
91
+ ### Changed
92
+ - No changes this release.
93
+
94
+ ## [0.24.0]
95
+ ### Added
96
+ - Add transaction insight caveat for accessing transaction origin ([#902](https://github.com/MetaMask/snaps-monorepo/pull/902))
97
+ - Add permission validation to `snap.manifest.json` ([#910](https://github.com/MetaMask/snaps-monorepo/pull/910))
98
+ - Add `Math` endowment factory ([#888](https://github.com/MetaMask/snaps-monorepo/pull/888))
99
+
100
+ ### Changed
101
+ - **BREAKING:** Rename package to start with `snaps-` ([#937](https://github.com/MetaMask/snaps-monorepo/pull/937))
102
+ - **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))
103
+
104
+ ## [0.23.0]
105
+ ### Added
106
+ - Add snap cronjobs ([#651](https://github.com/MetaMask/snaps-monorepo/pull/651))
107
+
108
+ ### Changed
109
+ - **BREAKING:** Replace Buffer with Typed Arrays ([#878](https://github.com/MetaMask/snaps-monorepo/pull/878))
110
+ - Improve execution environment type validation ([#844](https://github.com/MetaMask/snaps-monorepo/pull/844))
111
+
112
+ ## [0.22.3]
113
+ ### Fixed
114
+ - Fix missing properties on WebSocket MessageEvent ([#845](https://github.com/MetaMask/snaps-monorepo/pull/845))
115
+
116
+ ## [0.22.2]
117
+ ### Fixed
118
+ - Throw an error when response is unserializable ([#840](https://github.com/MetaMask/snaps-monorepo/pull/840))
119
+
120
+ ## [0.22.1]
121
+ ### Changed
122
+ - No changes this release.
123
+
124
+ ## [0.22.0]
125
+ ### Added
126
+ - Add Snap Keyring support ([#728](https://github.com/MetaMask/snaps-monorepo/pull/728), [#700](https://github.com/MetaMask/snaps-monorepo/pull/700))
127
+
128
+ ## [0.21.0]
129
+ ### Removed
130
+ - **BREAKING:** Remove origin parameter from transaction insight payload ([#730](https://github.com/MetaMask/snaps-monorepo/pull/730))
131
+
132
+ ## [0.20.0]
133
+ ### Added
134
+ - **BREAKING:** Add Transaction Insight API ([#642](https://github.com/MetaMask/snaps-monorepo/pull/642))
135
+ - Part of this change made changes to the execution environments to support multiple request handlers
136
+ - It also changed the exports of `@metamask/snaps-execution-environments`
137
+
138
+ ## [0.19.1]
139
+ ### Changed
140
+ - No changes this release.
141
+
142
+ ## [0.19.0]
143
+ ### Fixed
144
+ - Fixed network teardown so that snaps can't be escape by late returning promises ([#661](https://github.com/MetaMask/snaps-monorepo/pull/661))
145
+
146
+ ## [0.18.1]
147
+ ### Fixed
148
+ - Fix error serialization issues ([#637](https://github.com/MetaMask/snaps-monorepo/pull/637))
149
+
150
+ ## [0.18.0]
151
+ ### Changed
152
+ - Reduce TypeScript compilation target to ES2017 ([#628](https://github.com/MetaMask/snaps-monorepo/pull/628))
153
+
154
+ ### Fixed
155
+ - Fix `crypto` and `SubtleCrypto` endowments ([#631](https://github.com/MetaMask/snaps-monorepo/pull/631))
156
+
157
+ ## [0.17.0]
158
+ ### Added
159
+ - Add Node.js `child_process` execution environment ([#523](https://github.com/MetaMask/snaps-monorepo/pull/523))
160
+ - Add Node.js `worker_threads` execution environment ([#587](https://github.com/MetaMask/snaps-monorepo/pull/587))
161
+ - Added network endowment teardown ([#514](https://github.com/MetaMask/snaps-monorepo/pull/514))
162
+
163
+ ### Changed
164
+ - **BREAKING:** Bump minimum Node version to 16 ([#601](https://github.com/MetaMask/snaps-monorepo/pull/601))
165
+ - Monitor outbound snap requests to pause request timeout ([#593](https://github.com/MetaMask/snaps-monorepo/pull/593))
166
+
167
+ ### Removed
168
+ - Remove WebWorker implementation ([#591](https://github.com/MetaMask/snaps-monorepo/pull/591))
169
+
170
+ ## [0.16.0]
171
+ ### Changed
172
+ - **BREAKING:** Snaps are now required to export `onRpcRequest` to receive RPC requests ([#481](https://github.com/MetaMask/snaps-monorepo/pull/481), [#533](https://github.com/MetaMask/snaps-monorepo/pull/533), [#538](https://github.com/MetaMask/snaps-monorepo/pull/538), [#541](https://github.com/MetaMask/snaps-monorepo/pull/541))
173
+ - Snaps can no longer run timers outside of pending RPC requests ([#490](https://github.com/MetaMask/snaps-monorepo/pull/490))
174
+
175
+ ### Removed
176
+ - **BREAKING:** Remove `wallet.registerRpcMessageHandler` support [#481](https://github.com/MetaMask/snaps-monorepo/pull/481)
177
+
178
+ ### Fixed
179
+ - Fix issue with iframe error reporting ([#501](https://github.com/MetaMask/snaps-monorepo/pull/501))
180
+
181
+ ## [0.15.0]
182
+ ### Fixed
183
+ - Added missing properties to `WebAssembly` global ([#459](https://github.com/MetaMask/snaps-monorepo/pull/459))
184
+ - Fix interval handle leak ([#485](https://github.com/MetaMask/snaps-monorepo/pull/485))
185
+ - Fix timer handle leak ([#483](https://github.com/MetaMask/snaps-monorepo/pull/483))
186
+
187
+ ## [0.14.0]
188
+ ### Changed
189
+ - **BREAKING:** Increase TypeScript compilation target to ES2020 ([#449](https://github.com/MetaMask/snaps-monorepo/pull/449))
190
+ - This should not be breaking for consumers on any non-deprecated browser or Node.js version.
191
+
192
+ ## [0.13.0]
193
+ ### Changed
194
+ - **BREAKING:** Change `execution-environment` build output ([#424](https://github.com/MetaMask/snaps-monorepo/pull/424))
195
+
196
+ ## [0.12.0]
197
+ ### Added
198
+ - Add support for endowment teardown ([#407](https://github.com/MetaMask/snaps-monorepo/pull/407))
199
+
200
+ ## [0.11.1]
201
+ ### Changed
202
+ - No changes this release.
203
+
204
+ ## [0.11.0]
205
+ ### Changed
206
+ - Bump `ses` to `0.15.15` ([#396](https://github.com/MetaMask/snaps-monorepo/pull/396))
207
+ - Upgraded TypeScript version to minimum 4.4 ([#360](https://github.com/MetaMask/snaps-monorepo/pull/360))
208
+ - Remove cross-fetch ([#349](https://github.com/MetaMask/snaps-monorepo/pull/349))
209
+
210
+ ## [0.10.7]
211
+ ### Added
212
+ - Add setInterval and clearInterval as default endowments ([#326](https://github.com/MetaMask/snaps-monorepo/pull/326))
213
+
214
+ ### Changed
215
+ - **BREAKING:** Bump minimum Node version from 12 to 14 ([#331](https://github.com/MetaMask/snaps-monorepo/pull/331))
216
+
217
+ ### Fixed
218
+ - Fix missing properties on WebAssembly endowment ([#334](https://github.com/MetaMask/snaps-monorepo/pull/334))
219
+
220
+ ## [0.10.6]
221
+ ### Fixed
222
+ - Fix function endowment bindings ([#311](https://github.com/MetaMask/snaps-monorepo/pull/311))
223
+
224
+ ## [0.10.5]
225
+ ### Fixed
226
+ - Fix missing index.js ([#303](https://github.com/MetaMask/snaps-monorepo/pull/303))
227
+
228
+ ## [0.10.4]
229
+ ### Fixed
230
+ - Fix endowed global functions with properties ([#294](https://github.com/MetaMask/snaps-monorepo/pull/294))
231
+ - Endowments like `Date` were missing all properties except `name` and `length`, causing e.g. `Date.now` to be `undefined`. This is no longer the case.
232
+
233
+ ## [0.10.3]
234
+ ### Changed
235
+ - No changes this release.
236
+
237
+ ## [0.10.2]
238
+ ### Fixed
239
+ - Remove faulty postinstall script ([#279](https://github.com/MetaMask/snaps-monorepo/pull/279))
240
+ - The faulty script caused the installation of this package to fail for consumers.
241
+
242
+ ## [0.10.1]
243
+ ### Fixed
244
+ - Removed deprecated package ([#272](https://github.com/MetaMask/snaps-monorepo/pull/272))
245
+ - This package now uses the functionally equivalent `@metamask/providers` instead of the deprecated `@metamask/inpage-provider`.
246
+
247
+ ## [0.10.0]
248
+ ### Changed
249
+ - Initial release, made using components from the deprecated [`@metamask/snap-workers`](https://npmjs.com/package/@metamask/snap-workers) package. ([#231](https://github.com/MetaMask/snaps-monorepo/pull/231))
250
+ - Breaking changes are relative to the old package.
251
+ - **BREAKING:** Endowments must be passed to the execution environment ([#252](https://github.com/MetaMask/snaps-monorepo/pull/252)), ([#266](https://github.com/MetaMask/snaps-monorepo/pull/266))
252
+ - Previously, default endowments were specified in the execution environment itself. Now, all endowments must be specified in the `executeSnap` RPC parameters, except for the `wallet` API object.
253
+ - Add endowments to the global `self` in addition to `window` ([#263](https://github.com/MetaMask/snaps-monorepo/pull/263))
254
+
255
+ [Unreleased]: https://github.com/MetaMask/snaps-monorepo/compare/v0.33.0-flask.1...HEAD
256
+ [0.33.0-flask.1]: https://github.com/MetaMask/snaps-monorepo/compare/v0.32.2...v0.33.0-flask.1
257
+ [0.32.2]: https://github.com/MetaMask/snaps-monorepo/compare/v0.32.1...v0.32.2
258
+ [0.32.1]: https://github.com/MetaMask/snaps-monorepo/compare/v0.32.0...v0.32.1
259
+ [0.32.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.31.0...v0.32.0
260
+ [0.31.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.30.0...v0.31.0
261
+ [0.30.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.29.0...v0.30.0
262
+ [0.29.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.28.0...v0.29.0
263
+ [0.28.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.27.1...v0.28.0
264
+ [0.27.1]: https://github.com/MetaMask/snaps-monorepo/compare/v0.27.0...v0.27.1
265
+ [0.27.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.26.2...v0.27.0
266
+ [0.26.2]: https://github.com/MetaMask/snaps-monorepo/compare/v0.26.1...v0.26.2
267
+ [0.26.1]: https://github.com/MetaMask/snaps-monorepo/compare/v0.26.0...v0.26.1
268
+ [0.26.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.25.0...v0.26.0
269
+ [0.25.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.24.1...v0.25.0
270
+ [0.24.1]: https://github.com/MetaMask/snaps-monorepo/compare/v0.24.0...v0.24.1
271
+ [0.24.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.23.0...v0.24.0
272
+ [0.23.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.22.3...v0.23.0
273
+ [0.22.3]: https://github.com/MetaMask/snaps-monorepo/compare/v0.22.2...v0.22.3
274
+ [0.22.2]: https://github.com/MetaMask/snaps-monorepo/compare/v0.22.1...v0.22.2
275
+ [0.22.1]: https://github.com/MetaMask/snaps-monorepo/compare/v0.22.0...v0.22.1
276
+ [0.22.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.21.0...v0.22.0
277
+ [0.21.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.20.0...v0.21.0
278
+ [0.20.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.19.1...v0.20.0
279
+ [0.19.1]: https://github.com/MetaMask/snaps-monorepo/compare/v0.19.0...v0.19.1
280
+ [0.19.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.18.1...v0.19.0
281
+ [0.18.1]: https://github.com/MetaMask/snaps-monorepo/compare/v0.18.0...v0.18.1
282
+ [0.18.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.17.0...v0.18.0
283
+ [0.17.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.16.0...v0.17.0
284
+ [0.16.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.15.0...v0.16.0
285
+ [0.15.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.14.0...v0.15.0
286
+ [0.14.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.13.0...v0.14.0
287
+ [0.13.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.12.0...v0.13.0
288
+ [0.12.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.11.1...v0.12.0
289
+ [0.11.1]: https://github.com/MetaMask/snaps-monorepo/compare/v0.11.0...v0.11.1
290
+ [0.11.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.10.7...v0.11.0
291
+ [0.10.7]: https://github.com/MetaMask/snaps-monorepo/compare/v0.10.6...v0.10.7
292
+ [0.10.6]: https://github.com/MetaMask/snaps-monorepo/compare/v0.10.5...v0.10.6
293
+ [0.10.5]: https://github.com/MetaMask/snaps-monorepo/compare/v0.10.4...v0.10.5
294
+ [0.10.4]: https://github.com/MetaMask/snaps-monorepo/compare/v0.10.3...v0.10.4
295
+ [0.10.3]: https://github.com/MetaMask/snaps-monorepo/compare/v0.10.2...v0.10.3
296
+ [0.10.2]: https://github.com/MetaMask/snaps-monorepo/compare/v0.10.1...v0.10.2
297
+ [0.10.1]: https://github.com/MetaMask/snaps-monorepo/compare/v0.10.0...v0.10.1
298
+ [0.10.0]: https://github.com/MetaMask/snaps-monorepo/releases/tag/v0.10.0