@metamask/snaps-controllers 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 +570 -0
  2. package/dist/services/{offscreen/OffscreenPostMessageStream.d.ts → ProxyPostMessageStream.d.ts} +9 -9
  3. package/dist/services/ProxyPostMessageStream.js +62 -0
  4. package/dist/services/ProxyPostMessageStream.js.map +1 -0
  5. package/dist/services/browser.d.ts +2 -0
  6. package/dist/services/browser.js +4 -0
  7. package/dist/services/browser.js.map +1 -1
  8. package/dist/services/index.d.ts +2 -0
  9. package/dist/services/index.js +4 -0
  10. package/dist/services/index.js.map +1 -1
  11. package/dist/services/offscreen/OffscreenExecutionService.d.ts +2 -2
  12. package/dist/services/offscreen/OffscreenExecutionService.js +8 -3
  13. package/dist/services/offscreen/OffscreenExecutionService.js.map +1 -1
  14. package/dist/services/offscreen/index.d.ts +0 -1
  15. package/dist/services/offscreen/index.js +0 -1
  16. package/dist/services/offscreen/index.js.map +1 -1
  17. package/dist/services/webworker/WebWorkerExecutionService.d.ts +44 -0
  18. package/dist/services/webworker/WebWorkerExecutionService.js +100 -0
  19. package/dist/services/webworker/WebWorkerExecutionService.js.map +1 -0
  20. package/dist/services/webworker/index.d.ts +1 -0
  21. package/dist/services/webworker/index.js +18 -0
  22. package/dist/services/webworker/index.js.map +1 -0
  23. package/dist/snaps/SnapController.d.ts +13 -3
  24. package/dist/snaps/SnapController.js +33 -23
  25. package/dist/snaps/SnapController.js.map +1 -1
  26. package/dist/snaps/endowments/cronjob.js +1 -0
  27. package/dist/snaps/endowments/cronjob.js.map +1 -1
  28. package/dist/snaps/endowments/ethereum-provider.js +1 -0
  29. package/dist/snaps/endowments/ethereum-provider.js.map +1 -1
  30. package/dist/snaps/endowments/index.d.ts +2 -0
  31. package/dist/snaps/endowments/keyring.d.ts +2 -1
  32. package/dist/snaps/endowments/keyring.js +1 -0
  33. package/dist/snaps/endowments/keyring.js.map +1 -1
  34. package/dist/snaps/endowments/long-running.js +1 -0
  35. package/dist/snaps/endowments/long-running.js.map +1 -1
  36. package/dist/snaps/endowments/network-access.js +1 -0
  37. package/dist/snaps/endowments/network-access.js.map +1 -1
  38. package/dist/snaps/endowments/rpc.d.ts +2 -1
  39. package/dist/snaps/endowments/rpc.js +1 -0
  40. package/dist/snaps/endowments/rpc.js.map +1 -1
  41. package/dist/snaps/endowments/transaction-insight.js +1 -0
  42. package/dist/snaps/endowments/transaction-insight.js.map +1 -1
  43. package/dist/snaps/endowments/web-assembly.js +1 -0
  44. package/dist/snaps/endowments/web-assembly.js.map +1 -1
  45. package/package.json +23 -23
  46. package/dist/services/offscreen/OffscreenPostMessageStream.js +0 -66
  47. package/dist/services/offscreen/OffscreenPostMessageStream.js.map +0 -1
package/CHANGELOG.md ADDED
@@ -0,0 +1,570 @@
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
+ - Add subject type restrictions to snap-specific permissions ([#1366](https://github.com/MetaMask/snaps-monorepo/pull/1366))
12
+ - Add console endowment that prepends snap IDs to log output ([#1355](https://github.com/MetaMask/snaps-monorepo/pull/1355))
13
+ - Add `DisconnectOrigin` action ([#1329](https://github.com/MetaMask/snaps-monorepo/pull/1329))
14
+ - Add Web Worker support for snap execution ([#1320](https://github.com/MetaMask/snaps-monorepo/pull/1320))
15
+
16
+ ## [0.32.2]
17
+ ### Fixed
18
+ - Properly handle Promise in `JsonSnapsRegistry` signature verification ([#1317](https://github.com/MetaMask/snaps-monorepo/pull/1317))
19
+
20
+ ## [0.32.1]
21
+ ### Changed
22
+ - No changes this release.
23
+
24
+ ## [0.32.0]
25
+ ### Added
26
+ - Add verification of registry signature ([#1291](https://github.com/MetaMask/snaps-monorepo/pull/1291))
27
+ - Add types to result approvals ([#1288](https://github.com/MetaMask/snaps-monorepo/pull/1288))
28
+
29
+ ### Changed
30
+ - **BREAKING:** Convert registry to a caching controller ([#1305](https://github.com/MetaMask/snaps-monorepo/pull/1305))
31
+ - **BREAKING:** Require snaps to request at least one handler permission ([#1294](https://github.com/MetaMask/snaps-monorepo/pull/1294))
32
+ - Use side effects to install snaps via `wallet_snap` permission ([#1301](https://github.com/MetaMask/snaps-monorepo/pull/1301))
33
+
34
+ ### Fixed
35
+ - Fix a few issues with installation and updating ([#1308](https://github.com/MetaMask/snaps-monorepo/pull/1308))
36
+
37
+ ## [0.31.0]
38
+ ### Changed
39
+ - **BREAKING:** Target `ES2020` ([#1247](https://github.com/MetaMask/snaps-monorepo/pull/1247))
40
+ - **BREAKING:** Combine snap installation popups ([#1261](https://github.com/MetaMask/snaps-monorepo/pull/1261))
41
+ - Throw errors on failed `fetch` ([#1227](https://github.com/MetaMask/snaps-monorepo/pull/1227))
42
+ - Improve validation and sanitizing of snap IDs ([#1237](https://github.com/MetaMask/snaps-monorepo/pull/1237))
43
+
44
+ ### Fixed
45
+ - Fix smaller installation issues affecting local snaps ([#1248](https://github.com/MetaMask/snaps-monorepo/pull/1248))
46
+
47
+ ## [0.30.0]
48
+ ### Added
49
+ - Add WebAssembly permission ([#1185](https://github.com/MetaMask/snaps-monorepo/pull/1185))
50
+
51
+ ### Fixed
52
+ - Fix an issue with removing snaps ([#1194](https://github.com/MetaMask/snaps-monorepo/pull/1194))
53
+ - Previously, the `SnapController` was not requesting revocation of the `wallet_snap` permission from the `PermissionController` if an origin no longer had any permitted snaps, logic has been updated to account for this
54
+
55
+ ## [0.29.0]
56
+ ### Added
57
+ - Add method to get metadata from the Snaps registry ([#1173](https://github.com/MetaMask/snaps-monorepo/pull/1173))
58
+ - Set pre-fetch NPM tarball size limit ([#1169](https://github.com/MetaMask/snaps-monorepo/pull/1169))
59
+ - NPM packages now have a size limit of 250 MB
60
+
61
+ ### Changed
62
+ - **BREAKING:** Updated controllers to accomodate new `wallet_snap` permission ([#1182](https://github.com/MetaMask/snaps-monorepo/pull/1182))
63
+ - **BREAKING:** Change checksum calculation ([#1128](https://github.com/MetaMask/snaps-monorepo/pull/1128))
64
+ - The checksum has changed for all snaps, and needs to be updated
65
+
66
+ ## [0.28.0]
67
+ ### Added
68
+ - Add `endowment:long-running` deprecation warning ([#1126](https://github.com/MetaMask/snaps-monorepo/pull/1126))
69
+ - Add experimental offscreen execution environment ([#1082](https://github.com/MetaMask/snaps-monorepo/pull/1082))
70
+
71
+ ### Changed
72
+ - **BREAKING:** Add support for snap registries ([#1090](https://github.com/MetaMask/snaps-monorepo/pull/1090))
73
+ - This removes the `checkBlockList` constructor argument in favor of `registry`
74
+ - A registry implementation can be passed here, defaulting to a hosted JSON file
75
+ - Requiring a snap to be on the allowlist can be toggled with the feature flag `requireAllowlist`
76
+ - **BREAKING:** Disallow local snaps by default ([#1123](https://github.com/MetaMask/snaps-monorepo/pull/1123))
77
+ - They can be re-enabled by using the feature flag `allowLocalSnaps`
78
+ - Allow updating crashed snaps ([#1113](https://github.com/MetaMask/snaps-monorepo/pull/1113))
79
+ - Add safety measures for malicious tarballs ([#1116](https://github.com/MetaMask/snaps-monorepo/pull/1116))
80
+ - Make `installSnaps` throw on excluded permissions ([#1125](https://github.com/MetaMask/snaps-monorepo/pull/1125))
81
+
82
+ ### Removed
83
+ - **BREAKING:** Remove `WebSocket` endowment ([#1122](https://github.com/MetaMask/snaps-monorepo/pull/1122))
84
+
85
+ ## [0.27.1]
86
+ ### Changed
87
+ - No changes this release.
88
+
89
+ ## [0.27.0]
90
+ ### Changed
91
+ - **BREAKING:** Use SIP-6 algorithm for state encryption ([#1055](https://github.com/MetaMask/snaps-monorepo/pull/1055))
92
+ - This breaks all existing snaps that use `snap_manageState`
93
+
94
+ ## [0.26.2]
95
+ ### Changed
96
+ - No changes this release.
97
+
98
+ ## [0.26.1]
99
+ ### Fixed
100
+ - Fix some paths being wrongly normalized ([#1053](https://github.com/MetaMask/snaps-monorepo/pull/1053))
101
+ - Fix some issues with fetching snaps ([#1050](https://github.com/MetaMask/snaps-monorepo/pull/1050))
102
+
103
+ ## [0.26.0]
104
+ ### Changed
105
+ - **BREAKING:** Snap installation refactor ([#1023](https://github.com/MetaMask/snaps-monorepo/pull/1023))
106
+ - `wallet_requestSnaps` will now throw an error and roll back any changes made if installation of any snap fails
107
+
108
+ ### Fixed
109
+ - Fix an issue processing non-snap permissions ([#1044](https://github.com/MetaMask/snaps-monorepo/pull/1044))
110
+
111
+ ## [0.25.0]
112
+ ### Added
113
+ - **BREAKING:** Add JSON-RPC handler permission ([#905](https://github.com/MetaMask/snaps-monorepo/pull/905))
114
+ - Snaps are now required to request `endowment:rpc` to receive RPC requests.
115
+ - Add transaction origin caveat export ([#1010](https://github.com/MetaMask/snaps-monorepo/pull/1010))
116
+
117
+ ## [0.24.1]
118
+ ### Changed
119
+ - No changes this release.
120
+
121
+ ## [0.24.0]
122
+ ### Added
123
+ - Add transaction insight caveat for accessing transaction origin ([#902](https://github.com/MetaMask/snaps-monorepo/pull/902))
124
+
125
+ ### Changed
126
+ - **BREAKING:** Rename package to start with `snaps-` ([#937](https://github.com/MetaMask/snaps-monorepo/pull/937))
127
+ - **BREAKING:** Remove `wallet` global in favor of `snap` and `ethereum` ([#939](https://github.com/MetaMask/snaps-monorepo/pull/939))
128
+ - Add permission validation to `snap.manifest.json` ([#910](https://github.com/MetaMask/snaps-monorepo/pull/910))
129
+
130
+ ## [0.23.0]
131
+ ### Added
132
+ - Add snap cronjobs ([#651](https://github.com/MetaMask/snaps-monorepo/pull/651), [#890](https://github.com/MetaMask/snaps-monorepo/pull/890))
133
+
134
+ ### Changed
135
+ - **BREAKING:** Make `SnapController.add()` private ([#883](https://github.com/MetaMask/snaps-monorepo/pull/883))
136
+ - **BREAKING:** Stop including snap state in SnapController state ([#876](https://github.com/MetaMask/snaps-monorepo/pull/876))
137
+ - **BREAKING:** Stop including source code in SnapController state ([#861](https://github.com/MetaMask/snaps-monorepo/pull/861))
138
+ - Improve keyring endowment error messaging ([#884](https://github.com/MetaMask/snaps-monorepo/pull/884))
139
+ - Replace JSON schema validation with structs ([#862](https://github.com/MetaMask/snaps-monorepo/pull/862))
140
+
141
+ ## [0.22.3]
142
+ ### Changed
143
+ - No changes this release.
144
+
145
+ ## [0.22.2]
146
+ ### Fixed
147
+ - Fix an issue with installing snaps that request the `eth_accounts` permission ([#839](https://github.com/MetaMask/snaps-monorepo/pull/839))
148
+
149
+ ## [0.22.1]
150
+ ### Fixed
151
+ - Assert that multichain RPC methods are supported before usage ([#814](https://github.com/MetaMask/snaps-monorepo/pull/814))
152
+
153
+ ## [0.22.0]
154
+ ### Added
155
+ - Add Snap Keyring support ([#700](https://github.com/MetaMask/snaps-monorepo/pull/700), [#775](https://github.com/MetaMask/snaps-monorepo/pull/775), [#777](https://github.com/MetaMask/snaps-monorepo/pull/777), [#740](https://github.com/MetaMask/snaps-monorepo/pull/740))
156
+ - Add `endowment:keyring` permission
157
+ - Add `MultiChainController`
158
+
159
+ ### Changed
160
+ - **BREAKING:** Renamed `SnapController:getSnaps` to `SnapController:getPermittedSnaps` [#775](https://github.com/MetaMask/snaps-monorepo/pull/775)
161
+
162
+ ## [0.21.0]
163
+ ### Changed
164
+ - **BREAKING:** Add changes to support blocking snaps by shasum ([#767](https://github.com/MetaMask/snaps-monorepo/pull/767))
165
+ - **BREAKING:** Rework snap install logic ([#754](https://github.com/MetaMask/snaps-monorepo/pull/754))
166
+ - Stop including `installing` snaps in `wallet_getSnaps` ([#765](https://github.com/MetaMask/snaps-monorepo/pull/765))
167
+
168
+ ### Fixed
169
+ - Process snap permissions before snap update ([#753](https://github.com/MetaMask/snaps-monorepo/pull/753))
170
+ - Only pause running timers ([#725](https://github.com/MetaMask/snaps-monorepo/pull/725))
171
+
172
+ ## [0.20.0]
173
+ ### Added
174
+ - **BREAKING:** Add Transaction Insight API ([#642](https://github.com/MetaMask/snaps-monorepo/pull/642))
175
+ - This feature required changes to the RPC request handling functionality, hence the breaking change
176
+ - Register missing actions ([#659](https://github.com/MetaMask/snaps-monorepo/pull/659))
177
+ - All APIs accessed outside the SnapController are now registered as actions in the messaging system
178
+
179
+ ### Changed
180
+ - **BREAKING:** Simplify manifest format for permission caveats ([#705](https://github.com/MetaMask/snaps-monorepo/pull/705))
181
+ - Reduce TypeScript compilation target for `snap-controllers` ([#708](https://github.com/MetaMask/snaps-monorepo/pull/708))
182
+ - Move all internal types from `@metamask/snaps-types` to `@metamask/snaps-utils` ([#695](https://github.com/MetaMask/snaps-monorepo/pull/695))
183
+
184
+ ### Removed
185
+ - **BREAKING:** Removed ExternalResourceController ([#701](https://github.com/MetaMask/snaps-monorepo/pull/701))
186
+
187
+ ## [0.19.1]
188
+ ### Changed
189
+ - No changes this release.
190
+
191
+ ## [0.19.0]
192
+ ### Fixed
193
+ - Fixed update snap approval missing metadata ([#673](https://github.com/MetaMask/snaps-monorepo/pull/673))
194
+ - Fixed executors sending malformed JSON-RPC notifications ([#639](https://github.com/MetaMask/snaps-monorepo/pull/639))
195
+
196
+ ## [0.18.1]
197
+ ### Changed
198
+ - No changes this release.
199
+
200
+ ## [0.18.0]
201
+ ### Changed
202
+ - Reduce TypeScript compilation target to ES2017 ([#628](https://github.com/MetaMask/snaps-monorepo/pull/628))
203
+ - **BREAKING:** Add browser entrypoint for execution services ([#629](https://github.com/MetaMask/snaps-monorepo/pull/629))
204
+ - Node.js execution services are now omitted in browser environments
205
+
206
+ ## [0.17.0]
207
+ ### Added
208
+ - Add snap blocklist functionality ([#597](https://github.com/MetaMask/snaps-monorepo/pull/597))
209
+ - Add Node.js `worker_threads` execution environment ([#587](https://github.com/MetaMask/snaps-monorepo/pull/587))
210
+ - Add Node.js `child_process` execution environment ([#523](https://github.com/MetaMask/snaps-monorepo/pull/523))
211
+ - Added network endowment teardown ([#514](https://github.com/MetaMask/snaps-monorepo/pull/514))
212
+
213
+ ### Changed
214
+ - **BREAKING:** Bump minimum Node version to 16 ([#601](https://github.com/MetaMask/snaps-monorepo/pull/601))
215
+ - **BREAKING:** Remove ExecutionService actions from constructor arguments ([#486](https://github.com/MetaMask/snaps-monorepo/pull/486))
216
+ - **BREAKING:** Emit appropriate snap objects for SnapController events ([#608](https://github.com/MetaMask/snaps-monorepo/pull/608))
217
+ - **BREAKING:** Replace `getRpcMessageHandler` action with `handleRpcRequest` ([#497](https://github.com/MetaMask/snaps-monorepo/pull/497), [#557](https://github.com/MetaMask/snaps-monorepo/pull/557))
218
+ - Monitor outbound snap requests to pause request timeout ([#593](https://github.com/MetaMask/snaps-monorepo/pull/593))
219
+ - Change Update Snap `requestData` ([#614](https://github.com/MetaMask/snaps-monorepo/pull/614))
220
+
221
+ ### Removed
222
+ - Remove WebWorker implementation ([#591](https://github.com/MetaMask/snaps-monorepo/pull/591))
223
+
224
+ ## [0.16.0]
225
+ ### Added
226
+ - **BREAKING:** Encrypt Snap state by default ([#369](https://github.com/MetaMask/snaps-monorepo/pull/369))
227
+ - Breaks existing installed snaps that use `snap_manageState`. All such Snaps must be reinstalled.
228
+
229
+ ### Changed
230
+ - **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))
231
+ - The type of the function is available in `@metamask/snaps-types` as `OnRpcRequestHandler`.
232
+ - Snaps can no longer run timers outside of pending RPC requests ([#490](https://github.com/MetaMask/snaps-monorepo/pull/490))
233
+
234
+ ### Fixed
235
+ - Allow version matching with prerelease versions ([#508](https://github.com/MetaMask/snaps-monorepo/pull/508))
236
+ - Fix issue with iframe error reporting ([#501](https://github.com/MetaMask/snaps-monorepo/pull/501))
237
+ - Fix an issue with file paths with leading `./` in npm snap manifests ([#537](https://github.com/MetaMask/snaps-monorepo/pull/537))
238
+
239
+ ## [0.15.0]
240
+ ### Fixed
241
+ - Fix an issue with detecting iframe execution environment load ([#464](https://github.com/MetaMask/snaps-monorepo/pull/464))
242
+
243
+ ## [0.14.0]
244
+ ### Changed
245
+ - **BREAKING:** Increase TypeScript compilation target to ES2020 ([#449](https://github.com/MetaMask/snaps-monorepo/pull/449))
246
+ - This should not be breaking for consumers on any non-deprecated browser or Node.js version.
247
+
248
+ ## [0.13.0]
249
+ ### Added
250
+ - Add long-running endowment permission ([#386](https://github.com/MetaMask/snaps-monorepo/pull/386))
251
+ - Add `network-access` endowment from `controllers` ([#439](https://github.com/MetaMask/snaps-monorepo/pull/439))
252
+
253
+ ### Changed
254
+ - **BREAKING:** Rename SnapController constructor argument ([#435](https://github.com/MetaMask/snaps-monorepo/pull/435))
255
+
256
+ ## [0.12.0]
257
+ ### Added
258
+ - Add support for endowment teardown ([#407](https://github.com/MetaMask/snaps-monorepo/pull/407))
259
+ - Emit `snapTerminated` event ([#406](https://github.com/MetaMask/snaps-monorepo/pull/406))
260
+ - Add `IframeExecutionService` previously published via `@metamask/iframe-execution-environment-service` ([#415](https://github.com/MetaMask/snaps-monorepo/pull/415))
261
+
262
+ ### Removed
263
+ - Remove `_createWindowTimeout` ([#404](https://github.com/MetaMask/snaps-monorepo/pull/404))
264
+ - Remove unresponsive timeout ([#395](https://github.com/MetaMask/snaps-monorepo/pull/395))
265
+
266
+ ### Fixed
267
+ - Correctly categorize ungracefully terminated snaps as crashed ([#427](https://github.com/MetaMask/snaps-monorepo/pull/427))
268
+
269
+ ## [0.11.1]
270
+ ### Changed
271
+ - Always bind `fetch` by default ([#402](https://github.com/MetaMask/snaps-monorepo/pull/402))
272
+
273
+ ## [0.11.0]
274
+ ### Added
275
+ - Add clearSnapState ([#346](https://github.com/MetaMask/snaps-monorepo/pull/346))
276
+
277
+ ### Changed
278
+ - Robustify snap startup procedure and iframe error handling ([#379](https://github.com/MetaMask/snaps-monorepo/pull/379))
279
+ - Added ability to update snaps when installing them ([#322](https://github.com/MetaMask/snaps-monorepo/pull/322))
280
+ - **BREAKING:** Use PermissionController:revokePermissionForAllSubjects ([#351](https://github.com/MetaMask/snaps-monorepo/pull/351))
281
+ - Changed console.logs to console.info ([#361](https://github.com/MetaMask/snaps-monorepo/pull/361))
282
+ - Upgraded TypeScript version to minimum 4.4 ([#360](https://github.com/MetaMask/snaps-monorepo/pull/360))
283
+ - Remove cross-fetch ([#349](https://github.com/MetaMask/snaps-monorepo/pull/349))
284
+
285
+ ### Fixed
286
+ - Fix idle timeout implementation ([#385](https://github.com/MetaMask/snaps-monorepo/pull/385))
287
+
288
+ ## [0.10.7]
289
+ ### Added
290
+ - Add version history information ([#317](https://github.com/MetaMask/snaps-monorepo/pull/317))
291
+ - Add setInterval and clearInterval as default endowments ([#326](https://github.com/MetaMask/snaps-monorepo/pull/326))
292
+ - Add queue for RPC requests to starting snaps ([#288](https://github.com/MetaMask/snaps-monorepo/pull/288))
293
+ - This improves the experience of invoking a starting snap, waiting for the snap to be ready instead of throwing an error.
294
+
295
+ ### Changed
296
+ - **BREAKING:** Bump minimum Node version from 12 to 14 ([#331](https://github.com/MetaMask/snaps-monorepo/pull/331))
297
+
298
+ ## [0.10.6]
299
+ ### Fixed
300
+ - Fix ID validation during Snap installation ([#308](https://github.com/MetaMask/snaps-monorepo/pull/308))
301
+
302
+ ## [0.10.5]
303
+ ### Added
304
+ - Add updateSnap function to SnapController ([#259](https://github.com/MetaMask/snaps-monorepo/pull/259))
305
+
306
+ ### Fixed
307
+ - Fix issue where installation errors were repeatedly thrown ([#301](https://github.com/MetaMask/snaps-monorepo/pull/301))
308
+ - Fix snap crash handling ([#298](https://github.com/MetaMask/snaps-monorepo/pull/298))
309
+
310
+ ## [0.10.3]
311
+ ### Changed
312
+ - Always reinstall local snaps ([#289](https://github.com/MetaMask/snaps-monorepo/pull/289))
313
+
314
+ ## [0.10.2]
315
+ ### Fixed
316
+ - Installation failure ([#279](https://github.com/MetaMask/snaps-monorepo/pull/279))
317
+ - A faulty installation script in a dependency caused the installation of this package to fail.
318
+
319
+ ## [0.10.1]
320
+ ### Changed
321
+ - Populate `jsonrpc` field in Snap RPC requests ([#273](https://github.com/MetaMask/snaps-monorepo/pull/273))
322
+
323
+ ### Fixed
324
+ - Various bugs ([#275](https://github.com/MetaMask/snaps-monorepo/pull/275))
325
+ - Snap fetching during installation.
326
+ - Snap removal when cancelling a Snap installation request.
327
+
328
+ ## [0.10.0]
329
+ ### Added
330
+ - Allow specifying a version range when installing snap ([#250](https://github.com/MetaMask/snaps-monorepo/pull/250))
331
+ - Add more safe default endowments to snaps ([#252](https://github.com/MetaMask/snaps-monorepo/pull/252))
332
+
333
+ ### Changed
334
+ - **BREAKING:** Specify all endowments in the `SnapController` ([#252](https://github.com/MetaMask/snaps-monorepo/pull/252)), ([#266](https://github.com/MetaMask/snaps-monorepo/pull/266))
335
+ - Previously, default endowments were specified in the execution environment. Now, default endowments are specified in the `SnapController`, and the execution environment will only add endowments specified by the execution command, except for the `wallet` API object.
336
+ - Disable caching when fetching local snaps ([#227](https://github.com/MetaMask/snaps-monorepo/pull/227))
337
+ - This ensures that the `SnapController` will always fetch the latest snap manifest and source code during local development.
338
+
339
+ ### Removed
340
+ - **BREAKING:** Remove the `PermissionController` and `SubjectMetadataController` ([#261](https://github.com/MetaMask/snaps-monorepo/pull/261))
341
+ - They are part of the [`@metamask/controllers`](https://npmjs.com/package/@metamask/controllers) as of version [26.0.0](https://github.com/MetaMask/controllers/releases/tag/v26.0.0) of that package.
342
+
343
+ ### Fixed
344
+ - Prevent useless errors from being thrown when a snap is removed ([#215](https://github.com/MetaMask/snaps-monorepo/pull/215))
345
+
346
+ ## [0.9.0]
347
+ ### Added
348
+ - Make `SnapController` npm registry configurable ([#200](https://github.com/MetaMask/snaps-monorepo/pull/200))
349
+
350
+ ### Changed
351
+ - **BREAKING:** Return `null` from `SnapController.getSnapState` if the snap has no state ([#203](https://github.com/MetaMask/snaps-monorepo/pull/203))
352
+ - Previously it would return `undefined` in this case.
353
+ - `@metamask/controllers@^25.1.0` ([#207](https://github.com/MetaMask/snaps-monorepo/pull/207))
354
+
355
+ ## [0.8.1]
356
+ ### Added
357
+ - A variety of `SnapController` actions ([#199](https://github.com/MetaMask/snaps-monorepo/pull/199))
358
+
359
+ ## [0.8.0]
360
+ ### Added
361
+ - Expose more `PermissionController` functionality via actions ([#194](https://github.com/MetaMask/snaps-monorepo/pull/194))
362
+
363
+ ### Changed
364
+ - **BREAKING:** Replace `PermissionController` functions with actions in `SnapController` ([#194](https://github.com/MetaMask/snaps-monorepo/pull/194))
365
+
366
+ ## [0.7.0]
367
+ ### Changed
368
+ - **BREAKING:** Rename execution environment service class and events ([#188](https://github.com/MetaMask/snaps-monorepo/pull/188))
369
+ - `ServiceMessenger` events are now named `ExecutionService`.
370
+ - `WebWorkerExecutionEnvironmentService` is now named `WebWorkerExecutionService`.
371
+
372
+ ## [0.6.3]
373
+ ### Fixed
374
+ - Prevent `disableSnap` from throwing if the specified Snap is stopped ([#175](https://github.com/MetaMask/snaps-monorepo/pull/175))
375
+
376
+ ## [0.6.2]
377
+ ### Changed
378
+ - **BREAKING:** Rename endowment permission builder exports ([#171](https://github.com/MetaMask/snaps-monorepo/pull/171))
379
+
380
+ ### Removed
381
+ - **BREAKING:** Remove the `svgIcon` property from Snap state ([#172](https://github.com/MetaMask/snaps-monorepo/pull/172))
382
+ - The SVG icon content string is instead emitted with the `SnapController:snapAdded` event.
383
+
384
+ ## [0.6.1]
385
+ ### Changed
386
+ - No changes this release.
387
+
388
+ ## [0.6.0]
389
+ ### Added
390
+ - "Endowment" permissions ([#152](https://github.com/MetaMask/snaps-monorepo/pull/152))
391
+ - `SnapController` endowment permissions support ([#155](https://github.com/MetaMask/snaps-monorepo/pull/155))
392
+ - Network access endowment permission ([#154](https://github.com/MetaMask/snaps-monorepo/pull/154))
393
+ - Snap installation events ([#162](https://github.com/MetaMask/snaps-monorepo/pull/162))
394
+
395
+ ### Changed
396
+ - **BREAKING:** Refactor `SnapController` to support the new Snaps publishing specification ([#140](https://github.com/MetaMask/snaps-monorepo/pull/140), [#157](https://github.com/MetaMask/snaps-monorepo/pull/157), [#163](https://github.com/MetaMask/snaps-monorepo/pull/163))
397
+ - This introduces several breaking changes to how Snaps are developed, hosted, and represented at runtime. See [the specification](https://github.com/MetaMask/specifications/blob/d4a5bf5d6990bb5b02a98bd3f95a24ffb28c701c/snaps/publishing.md) and the referenced pull requests for details.
398
+ - **BREAKING:** Rename Snap `name` property to `id` ([#147](https://github.com/MetaMask/snaps-monorepo/pull/147))
399
+ - **BREAKING:** Introduce the required `permissionType` field to `PermissionController` permission specifications ([#152](https://github.com/MetaMask/snaps-monorepo/pull/152))
400
+ - Make `SubjectMetadataController` subject metadata `name` optional ([#151](https://github.com/MetaMask/snaps-monorepo/pull/151))
401
+
402
+ ### Removed
403
+ - **BREAKING:** Inline snap functionality ([#148](https://github.com/MetaMask/snaps-monorepo/pull/148))
404
+
405
+ ## [0.5.0]
406
+ ### Changed
407
+ - **BREAKING:** Update restricted RPC methods per new `PermissionController` ([#143](https://github.com/MetaMask/snaps-monorepo/pull/143))
408
+ - **BREAKING:** Convert all TypeScript `interface` declarations to `type` equivalents ([#143](https://github.com/MetaMask/snaps-monorepo/pull/143))
409
+ - Bump `@metamask/obs-store` to `7.0.0` ([#144](https://github.com/MetaMask/snaps-monorepo/pull/144))
410
+
411
+ ## [0.4.0]
412
+ ### Added
413
+ - `SubjectMetadataController` ([#61](https://github.com/MetaMask/snaps-monorepo/pull/61))
414
+ - `PermissionController` ([#132](https://github.com/MetaMask/snaps-monorepo/pull/132), [#141](https://github.com/MetaMask/snaps-monorepo/pull/141))
415
+ - **BREAKING:** `SnapController`: Add max request processing time ([#128](https://github.com/MetaMask/snaps-monorepo/pull/128))
416
+
417
+ ### Fixed
418
+ - `SnapController`: Clean up timeouts after stopping a Snap ([#139](https://github.com/MetaMask/snaps-monorepo/pull/139))
419
+ - `WebWorkerExecutionEnvironmentService`: Clean up post-termination timeouts ([#128](https://github.com/MetaMask/snaps-monorepo/pull/128))
420
+
421
+ ## [0.3.1]
422
+ ### Changed
423
+ - **BREAKING:** Update Snap initial states ([#126](https://github.com/MetaMask/snaps-monorepo/pull/126))
424
+ - The `idle` status is now named `installing`, and rehydrated snaps will have the status `stopped`.
425
+
426
+ ### Fixed
427
+ - Fix Snap execution and installation bugs ([#125](https://github.com/MetaMask/snaps-monorepo/pull/125))
428
+ - Prevent Snaps from being started before installation is finished ([#124](https://github.com/MetaMask/snaps-monorepo/pull/124))
429
+ - Correctly identify breaking changes in [0.3.0] release ([#123](https://github.com/MetaMask/snaps-monorepo/pull/123))
430
+
431
+ ## [0.3.0]
432
+ ### Added
433
+ - Allow disabling and enabling Snaps ([#116](https://github.com/MetaMask/snaps-monorepo/pull/116))
434
+ - Only enabled Snaps can be started.
435
+ - Start stopped Snaps that receive an RPC message ([#114](https://github.com/MetaMask/snaps-monorepo/pull/114))
436
+ - Add Snap max idle time ([#105](https://github.com/MetaMask/snaps-monorepo/pull/105))
437
+ - A Snap that is idle for more than the max idle time will be stopped.
438
+ - Poll Snaps for their status ([#104](https://github.com/MetaMask/snaps-monorepo/pull/104))
439
+ - If a Snap stops responding, it will be forced to stop.
440
+
441
+ ### Changed
442
+ - **BREAKING:** Enforce consistent naming for Snaps-related functionality ([#119](https://github.com/MetaMask/snaps-monorepo/pull/119))
443
+ - **BREAKING:** Use the `ControllerMessenger` to communicate between the `SnapController` and its execution environment service ([#100](https://github.com/MetaMask/snaps-monorepo/pull/100))
444
+
445
+ ## [0.2.2]
446
+ ### Added
447
+ - Add Snap error state ([#96](https://github.com/MetaMask/snaps-monorepo/pull/96))
448
+
449
+ ### Fixed
450
+ - Package script issues ([#97](https://github.com/MetaMask/snaps-monorepo/pull/97), [#98](https://github.com/MetaMask/snaps-monorepo/pull/98))
451
+
452
+ ## [0.2.0]
453
+ ### Changed
454
+ - Update publish scripts ([#92](https://github.com/MetaMask/snaps-monorepo/pull/92))
455
+
456
+ ## [0.1.2]
457
+ ### Changed
458
+ - Restore name of `handshake` method to `ping` ([#90](https://github.com/MetaMask/snaps-monorepo/pull/90))
459
+
460
+ ## [0.1.1]
461
+ ### Added
462
+ - Out of band error support ([#88](https://github.com/MetaMask/snaps-monorepo/pull/88))
463
+
464
+ ### Changed
465
+ - @metamask/controllers@17.0.0 ([#87](https://github.com/MetaMask/snaps-monorepo/pull/87))
466
+
467
+ ## [0.1.0]
468
+ ### Added
469
+ - Readme file ([#71](https://github.com/MetaMask/snaps-monorepo/pull/71))
470
+
471
+ ### Changed
472
+ - **BREAKING:** Rename package to `@metamask/snaps-controllers` ([#73](https://github.com/MetaMask/snaps-monorepo/pull/73))
473
+
474
+ ## [0.0.9]
475
+ ### Added
476
+ - `PluginController`: Always persist plugin `isRunning` state as `false` ([#64](https://github.com/MetaMask/snaps-monorepo/pull/64))
477
+ - Plugins are not automatically running on boot, and we should never persist this state as `true`.
478
+
479
+ ### Changed
480
+ - **BREAKING:** `@metamask/controllers@15.0.0` ([#66](https://github.com/MetaMask/snaps-monorepo/pull/66))
481
+ - This may cause incompatibilities with other versions of the `@metamask/controllers` package.
482
+
483
+ ## [0.0.7]
484
+ ### Fixed
485
+ - Store plugin states in the correct place ([#48](https://github.com/MetaMask/snaps-monorepo/pull/48))
486
+ - Previously, plugin states would be set as top-level keys of the `PluginController`'s state. This broke retrieving plugin states. They are now correctly stored under `state.pluginStates`.
487
+
488
+ ## [0.0.6]
489
+ ### Added
490
+ - iframe execution environment ([#33](https://github.com/MetaMask/snaps-monorepo/pull/33))
491
+ - Execution environment OpenRPC spec ([#23](https://github.com/MetaMask/snaps-monorepo/pull/23))
492
+
493
+ ### Changed
494
+ - **BREAKING:** Migrate `CommandEngine` message format to JSON-RPC ([#11](https://github.com/MetaMask/snaps-monorepo/pull/11))
495
+ - **BREAKING:** Refactor `PluginController` to use `BaseControllerV2` ([#13](https://github.com/MetaMask/snaps-monorepo/pull/13))
496
+ - **BREAKING:** Use generic execution environment interface ([#19](https://github.com/MetaMask/snaps-monorepo/pull/19))
497
+ - **BREAKING:** Restore origin parameter to `setupWorkerConnection`, rename to `setupPluginProvider` ([#20](https://github.com/MetaMask/snaps-monorepo/pull/20))
498
+ - **BREAKING:** Rename some execution environment methods ([#23](https://github.com/MetaMask/snaps-monorepo/pull/23))
499
+
500
+ ### Fixed
501
+ - Ensure that the plugin `isRunning` check always runs when a plugin is started ([#21](https://github.com/MetaMask/snaps-monorepo/pull/21))
502
+
503
+ ## [0.0.5]
504
+ ### Added
505
+ - First semi-stable release.
506
+
507
+ [Unreleased]: https://github.com/MetaMask/snaps-monorepo/compare/v0.33.0-flask.1...HEAD
508
+ [0.33.0-flask.1]: https://github.com/MetaMask/snaps-monorepo/compare/v0.32.2...v0.33.0-flask.1
509
+ [0.32.2]: https://github.com/MetaMask/snaps-monorepo/compare/v0.32.1...v0.32.2
510
+ [0.32.1]: https://github.com/MetaMask/snaps-monorepo/compare/v0.32.0...v0.32.1
511
+ [0.32.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.31.0...v0.32.0
512
+ [0.31.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.30.0...v0.31.0
513
+ [0.30.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.29.0...v0.30.0
514
+ [0.29.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.28.0...v0.29.0
515
+ [0.28.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.27.1...v0.28.0
516
+ [0.27.1]: https://github.com/MetaMask/snaps-monorepo/compare/v0.27.0...v0.27.1
517
+ [0.27.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.26.2...v0.27.0
518
+ [0.26.2]: https://github.com/MetaMask/snaps-monorepo/compare/v0.26.1...v0.26.2
519
+ [0.26.1]: https://github.com/MetaMask/snaps-monorepo/compare/v0.26.0...v0.26.1
520
+ [0.26.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.25.0...v0.26.0
521
+ [0.25.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.24.1...v0.25.0
522
+ [0.24.1]: https://github.com/MetaMask/snaps-monorepo/compare/v0.24.0...v0.24.1
523
+ [0.24.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.23.0...v0.24.0
524
+ [0.23.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.22.3...v0.23.0
525
+ [0.22.3]: https://github.com/MetaMask/snaps-monorepo/compare/v0.22.2...v0.22.3
526
+ [0.22.2]: https://github.com/MetaMask/snaps-monorepo/compare/v0.22.1...v0.22.2
527
+ [0.22.1]: https://github.com/MetaMask/snaps-monorepo/compare/v0.22.0...v0.22.1
528
+ [0.22.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.21.0...v0.22.0
529
+ [0.21.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.20.0...v0.21.0
530
+ [0.20.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.19.1...v0.20.0
531
+ [0.19.1]: https://github.com/MetaMask/snaps-monorepo/compare/v0.19.0...v0.19.1
532
+ [0.19.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.18.1...v0.19.0
533
+ [0.18.1]: https://github.com/MetaMask/snaps-monorepo/compare/v0.18.0...v0.18.1
534
+ [0.18.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.17.0...v0.18.0
535
+ [0.17.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.16.0...v0.17.0
536
+ [0.16.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.15.0...v0.16.0
537
+ [0.15.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.14.0...v0.15.0
538
+ [0.14.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.13.0...v0.14.0
539
+ [0.13.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.12.0...v0.13.0
540
+ [0.12.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.11.1...v0.12.0
541
+ [0.11.1]: https://github.com/MetaMask/snaps-monorepo/compare/v0.11.0...v0.11.1
542
+ [0.11.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.10.7...v0.11.0
543
+ [0.10.7]: https://github.com/MetaMask/snaps-monorepo/compare/v0.10.6...v0.10.7
544
+ [0.10.6]: https://github.com/MetaMask/snaps-monorepo/compare/v0.10.5...v0.10.6
545
+ [0.10.5]: https://github.com/MetaMask/snaps-monorepo/compare/v0.10.3...v0.10.5
546
+ [0.10.3]: https://github.com/MetaMask/snaps-monorepo/compare/v0.10.2...v0.10.3
547
+ [0.10.2]: https://github.com/MetaMask/snaps-monorepo/compare/v0.10.1...v0.10.2
548
+ [0.10.1]: https://github.com/MetaMask/snaps-monorepo/compare/v0.10.0...v0.10.1
549
+ [0.10.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.9.0...v0.10.0
550
+ [0.9.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.8.1...v0.9.0
551
+ [0.8.1]: https://github.com/MetaMask/snaps-monorepo/compare/v0.8.0...v0.8.1
552
+ [0.8.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.7.0...v0.8.0
553
+ [0.7.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.6.3...v0.7.0
554
+ [0.6.3]: https://github.com/MetaMask/snaps-monorepo/compare/v0.6.2...v0.6.3
555
+ [0.6.2]: https://github.com/MetaMask/snaps-monorepo/compare/v0.6.1...v0.6.2
556
+ [0.6.1]: https://github.com/MetaMask/snaps-monorepo/compare/v0.6.0...v0.6.1
557
+ [0.6.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.5.0...v0.6.0
558
+ [0.5.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.4.0...v0.5.0
559
+ [0.4.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.3.1...v0.4.0
560
+ [0.3.1]: https://github.com/MetaMask/snaps-monorepo/compare/v0.3.0...v0.3.1
561
+ [0.3.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.2.2...v0.3.0
562
+ [0.2.2]: https://github.com/MetaMask/snaps-monorepo/compare/v0.2.0...v0.2.2
563
+ [0.2.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.1.2...v0.2.0
564
+ [0.1.2]: https://github.com/MetaMask/snaps-monorepo/compare/v0.1.1...v0.1.2
565
+ [0.1.1]: https://github.com/MetaMask/snaps-monorepo/compare/v0.1.0...v0.1.1
566
+ [0.1.0]: https://github.com/MetaMask/snaps-monorepo/compare/v0.0.9...v0.1.0
567
+ [0.0.9]: https://github.com/MetaMask/snaps-monorepo/compare/v0.0.7...v0.0.9
568
+ [0.0.7]: https://github.com/MetaMask/snaps-monorepo/compare/v0.0.6...v0.0.7
569
+ [0.0.6]: https://github.com/MetaMask/snaps-monorepo/compare/v0.0.5...v0.0.6
570
+ [0.0.5]: https://github.com/MetaMask/snaps-monorepo/releases/tag/v0.0.5
@@ -1,35 +1,35 @@
1
1
  import { BasePostMessageStream } from '@metamask/post-message-stream';
2
2
  import { JsonRpcRequest } from '@metamask/utils';
3
- export declare type OffscreenPostMessageStreamArgs = {
3
+ export declare type ProxyPostMessageStreamArgs = {
4
4
  stream: BasePostMessageStream;
5
5
  jobId: string;
6
- frameUrl: string;
6
+ extra?: Record<string, unknown>;
7
7
  };
8
- export declare type OffscreenPostMessage = {
8
+ export declare type ProxyPostMessage = {
9
9
  jobId: string;
10
10
  data: JsonRpcRequest;
11
+ extra?: Record<string, unknown>;
11
12
  };
12
13
  /**
13
14
  * A post message stream that wraps messages in a job ID, before sending them
14
15
  * over the underlying stream.
15
16
  */
16
- export declare class OffscreenPostMessageStream extends BasePostMessageStream {
17
+ export declare class ProxyPostMessageStream extends BasePostMessageStream {
17
18
  #private;
18
19
  /**
19
- * Initializes a new `OffscreenPostMessageStream` instance.
20
+ * Initializes a new `ProxyPostMessageStream` instance.
20
21
  *
21
22
  * @param args - The constructor arguments.
22
23
  * @param args.stream - The underlying stream to use for communication.
23
24
  * @param args.jobId - The ID of the job this stream is associated with.
24
- * @param args.frameUrl - The URL of the frame to load inside the offscreen
25
- * document.
25
+ * @param args.extra - Extra data to include in the post message.
26
26
  */
27
- constructor({ stream, jobId, frameUrl }: OffscreenPostMessageStreamArgs);
27
+ constructor({ stream, jobId, extra }: ProxyPostMessageStreamArgs);
28
28
  /**
29
29
  * Write data to the underlying stream. This wraps the data in an object with
30
30
  * the job ID.
31
31
  *
32
32
  * @param data - The data to write.
33
33
  */
34
- _postMessage(data: OffscreenPostMessage): void;
34
+ _postMessage(data: ProxyPostMessage): void;
35
35
  }