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