@metamask/snaps-sdk 6.5.0 → 6.6.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.
Files changed (42) hide show
  1. package/CHANGELOG.md +97 -1
  2. package/dist/error-wrappers.d.cts +240 -192
  3. package/dist/error-wrappers.d.cts.map +1 -1
  4. package/dist/error-wrappers.d.mts +240 -192
  5. package/dist/error-wrappers.d.mts.map +1 -1
  6. package/dist/errors.cjs +12 -25
  7. package/dist/errors.cjs.map +1 -1
  8. package/dist/errors.mjs +12 -25
  9. package/dist/errors.mjs.map +1 -1
  10. package/dist/internals/error-wrappers.d.cts +15 -12
  11. package/dist/internals/error-wrappers.d.cts.map +1 -1
  12. package/dist/internals/error-wrappers.d.mts +15 -12
  13. package/dist/internals/error-wrappers.d.mts.map +1 -1
  14. package/dist/jsx/components/Link.cjs.map +1 -1
  15. package/dist/jsx/components/Link.d.cts +3 -1
  16. package/dist/jsx/components/Link.d.cts.map +1 -1
  17. package/dist/jsx/components/Link.d.mts +3 -1
  18. package/dist/jsx/components/Link.d.mts.map +1 -1
  19. package/dist/jsx/components/Link.mjs.map +1 -1
  20. package/dist/jsx/index.cjs +2 -1
  21. package/dist/jsx/index.cjs.map +1 -1
  22. package/dist/jsx/index.d.cts +1 -1
  23. package/dist/jsx/index.d.cts.map +1 -1
  24. package/dist/jsx/index.d.mts +1 -1
  25. package/dist/jsx/index.d.mts.map +1 -1
  26. package/dist/jsx/index.mjs +1 -1
  27. package/dist/jsx/index.mjs.map +1 -1
  28. package/dist/jsx/validation.cjs +33 -2
  29. package/dist/jsx/validation.cjs.map +1 -1
  30. package/dist/jsx/validation.d.cts +9 -0
  31. package/dist/jsx/validation.d.cts.map +1 -1
  32. package/dist/jsx/validation.d.mts +9 -0
  33. package/dist/jsx/validation.d.mts.map +1 -1
  34. package/dist/jsx/validation.mjs +32 -1
  35. package/dist/jsx/validation.mjs.map +1 -1
  36. package/dist/types/methods/notify.cjs.map +1 -1
  37. package/dist/types/methods/notify.d.cts +21 -2
  38. package/dist/types/methods/notify.d.cts.map +1 -1
  39. package/dist/types/methods/notify.d.mts +21 -2
  40. package/dist/types/methods/notify.d.mts.map +1 -1
  41. package/dist/types/methods/notify.mjs.map +1 -1
  42. package/package.json +39 -23
package/CHANGELOG.md CHANGED
@@ -1,4 +1,5 @@
1
1
  # Changelog
2
+
2
3
  All notable changes to this project will be documented in this file.
3
4
 
4
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
@@ -6,29 +7,49 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
7
 
7
8
  ## [Unreleased]
8
9
 
10
+ ## [6.6.0]
11
+
12
+ ### Added
13
+
14
+ - Add support for `metamask:` schemed URLs ([#2719](https://github.com/MetaMask/snaps/pull/2719))
15
+ - Add support for JSX in `snap_notify` notifications ([#2706](https://github.com/MetaMask/snaps/pull/2706))
16
+
17
+ ## [6.5.1]
18
+
19
+ ### Fixed
20
+
21
+ - Fix package exports ([#2737](https://github.com/MetaMask/snaps/pull/2737))
22
+
9
23
  ## [6.5.0]
24
+
10
25
  ### Added
26
+
11
27
  - Add `center` prop to `Box` component ([#2716](https://github.com/MetaMask/snaps/pull/2716))
12
28
  - Add `form` prop to `Button` component ([#2712](https://github.com/MetaMask/snaps/pull/2712))
13
29
  - This allows the `Button` component to be used outside of forms, but still
14
30
  submit a form when clicked.
15
31
 
16
32
  ### Fixed
33
+
17
34
  - Fix invalid types in type declaration in some cases ([#2714](https://github.com/MetaMask/snaps/pull/2714))
18
35
  - Fix type issue with `Field` children ([#2715](https://github.com/MetaMask/snaps/pull/2715))
19
36
  - `Field` now accepts booleans and `null` as children, in addition to the
20
37
  existing types.
21
38
 
22
39
  ## [6.4.0]
40
+
23
41
  ### Added
42
+
24
43
  - Add `Section` component ([#2672](https://github.com/MetaMask/snaps/pull/2672))
25
44
  - Add support for element before input in the `Field` component ([#2699](https://github.com/MetaMask/snaps/pull/2699))
26
45
 
27
46
  ### Changed
47
+
28
48
  - Allow CAIP-10 addresses in the `Address` component ([#2680](https://github.com/MetaMask/snaps/pull/2680))
29
49
  - Improve error messaging ([#2696](https://github.com/MetaMask/snaps/pull/2696), [#2693](https://github.com/MetaMask/snaps/pull/2693))
30
50
 
31
51
  ### Fixed
52
+
32
53
  - Allow any element as the child of the `Container` component ([#2698](https://github.com/MetaMask/snaps/pull/2698))
33
54
  - Disallow images and icons in footers ([#2676](https://github.com/MetaMask/snaps/pull/2676))
34
55
  - Fix ESM version of the package ([#2682](https://github.com/MetaMask/snaps/pull/2682))
@@ -38,29 +59,40 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
38
59
  - Bump other MetaMask dependencies ([#2703](https://github.com/MetaMask/snaps/pull/2703))
39
60
 
40
61
  ## [6.3.0]
62
+
41
63
  ### Added
64
+
42
65
  - Add `Selector` component ([#2645](https://github.com/MetaMask/snaps/pull/2645))
43
66
  - Add `Icon` component ([#2638](https://github.com/MetaMask/snaps/pull/2638))
44
67
  - Add `color` prop to `Text` component ([#2660](https://github.com/MetaMask/snaps/pull/2660))
45
68
 
46
69
  ### Changed
70
+
47
71
  - `Button` children are now allowed to be `Image` and `Icon` ([#2641](https://github.com/MetaMask/snaps/pull/2641))
48
72
 
49
73
  ## [6.2.1]
74
+
50
75
  ### Fixed
76
+
51
77
  - Add structs to `typedUnion` schema ([#2623](https://github.com/MetaMask/snaps/pull/2623))
52
78
 
53
79
  ## [6.2.0]
80
+
54
81
  ### Added
82
+
55
83
  - Add `snap_getPreferences` ([#2607](https://github.com/MetaMask/snaps/pull/2607))
56
84
  - Add `RadioGroup` component ([#2592](https://github.com/MetaMask/snaps/pull/2592))
57
85
 
58
86
  ## [6.1.1]
87
+
59
88
  ### Changed
89
+
60
90
  - Bump `@metamask/providers` from `17.0.0` to `^17.1.2` ([#2598](https://github.com/metamask/snaps/pull/2598))
61
91
 
62
92
  ## [6.1.0]
93
+
63
94
  ### Added
95
+
64
96
  - Add non-restricted RPC method `snap_resolveInterface` ([#2509](https://github.com/metamask/snaps/pull/2509))
65
97
  - This method allows a Snap to resolve a given user interface bound to a `snap_dialog` with a custom value.
66
98
  - Add new types `ResolveInterfaceParams`, `ResolveInterfaceResult`.
@@ -69,19 +101,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
69
101
  - Add `Container` and `Footer` components ([#2517](https://github.com/metamask/snaps/pull/2517))
70
102
 
71
103
  ### Changed
104
+
72
105
  - Update `RootJSXElement` to allow `Container` or `Box` at the root ([#2526](https://github.com/metamask/snaps/pull/2526))
73
106
  - Bump `@metamask/key-tree` from `^9.1.1` to `^9.1.2` ([#2445](https://github.com/MetaMask/snaps/pull/2445))
74
107
  - Bump `@metamask/rpc-errors` from `^6.2.1` to `^6.3.1` ([#2445](https://github.com/MetaMask/snaps/pull/2445))
75
108
  - Bump `@metamask/utils` from `^8.3.0` to `^9.1.0` ([#2445](https://github.com/MetaMask/snaps/pull/2445))
76
109
 
77
110
  ### Fixed
111
+
78
112
  - Replace `superstruct` with ESM-compatible `@metamask/superstruct` `^3.1.0` ([#2445](https://github.com/MetaMask/snaps/pull/2445))
79
113
  - This fixes the issue of this package being unusable by any TypeScript project that uses `Node16` or `NodeNext` as its `moduleResolution` option.
80
114
  - Set `@metamask/providers` from `^17.0.0` to `17.0.0` ([#2445](https://github.com/MetaMask/snaps/pull/2445))
81
115
  - `17.1.0` and `17.1.1` introduce regressions.
82
116
 
83
117
  ## [6.0.0]
118
+
84
119
  ### Added
120
+
85
121
  - **BREAKING:** Add `FileInput` component ([#2469](https://github.com/MetaMask/snaps/pull/2469), [#2504](https://github.com/MetaMask/snaps/pull/2504))
86
122
  - `FormSubmitEvent` may now contain values of type `File`.
87
123
  - **BREAKING:** Add `Checkbox` component ([#2501](https://github.com/MetaMask/snaps/pull/2501))
@@ -92,41 +128,55 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
92
128
  - Support conditional children in most JSX components ([#2506](https://github.com/MetaMask/snaps/pull/2506))
93
129
 
94
130
  ## [5.0.0]
131
+
95
132
  ### Added
133
+
96
134
  - Allow row tooltips ([#2483](https://github.com/MetaMask/snaps/pull/2483))
97
135
  - Support nested children in JSX ([#2482](https://github.com/MetaMask/snaps/pull/2482))
98
136
 
99
137
  ### Changed
138
+
100
139
  - Update `onNameLookup` response types ([#2484](https://github.com/MetaMask/snaps/pull/2484))
101
140
 
102
141
  ### Removed
142
+
103
143
  - **BREAKING:** Remove `parseSvg` and `isSvg` internals ([#2475](https://github.com/MetaMask/snaps/pull/2475))
104
144
 
105
145
  ### Fixed
146
+
106
147
  - Correct Row variant in JSX ([#2486](https://github.com/MetaMask/snaps/pull/2486))
107
148
  - Revert requiring at least one child in JSX components ([#2481](https://github.com/MetaMask/snaps/pull/2481), [#2470](https://github.com/MetaMask/snaps/pull/2470))
108
149
  - Correct docs for `Input` and `Dropdown` ([#2479](https://github.com/MetaMask/snaps/pull/2479))
109
150
 
110
151
  ## [4.4.2]
152
+
111
153
  ### Fixed
154
+
112
155
  - Require at least 1 child in JSX components ([#2466](https://github.com/MetaMask/snaps/pull/2466))
113
156
 
114
157
  ## [4.4.1]
158
+
115
159
  ### Fixed
160
+
116
161
  - Fix invalid `@metamask/snaps-sdk` imports ([#2452](https://github.com/MetaMask/snaps/pull/2452))
117
162
 
118
163
  ## [4.4.0]
164
+
119
165
  ### Added
166
+
120
167
  - Add origin to lifecycle hooks ([#2441](https://github.com/MetaMask/snaps/pull/2441))
121
168
  - Lifecycle hooks can now use the `origin` parameter to determine the origin
122
169
  of the installation or update.
123
170
 
124
171
  ### Changed
172
+
125
173
  - Bump `@metamask/providers` from `16.1.0` to `17.0.0` ([#2442](https://github.com/MetaMask/snaps/pull/2442))
126
174
  - Bump `@metamask/key-tree` from `9.1.0` to `9.1.1` ([#2431](https://github.com/MetaMask/snaps/pull/2431))
127
175
 
128
176
  ## [4.3.0]
177
+
129
178
  ### Added
179
+
130
180
  - Add `Value` component ([#2435](https://github.com/MetaMask/snaps/pull/2435))
131
181
  - Add `Dropdown` component ([#2420](https://github.com/MetaMask/snaps/pull/2420))
132
182
  - Add positioning props to `Box` ([#2422](https://github.com/MetaMask/snaps/pull/2422))
@@ -134,17 +184,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
134
184
  - Add `context` field to `snap_createInterface` ([#2413](https://github.com/MetaMask/snaps/pull/2413), [#2427](https://github.com/MetaMask/snaps/pull/2427))
135
185
 
136
186
  ### Fixed
187
+
137
188
  - Correct validation for children of Box component ([#2423](https://github.com/MetaMask/snaps/pull/2423))
138
189
 
139
190
  ## [4.2.0]
191
+
140
192
  ### Added
193
+
141
194
  - Add support for BIP-32-Ed25519 / CIP-3 key derivation ([#2408](https://github.com/MetaMask/snaps/pull/2408))
142
195
 
143
196
  ### Fixed
197
+
144
198
  - Add missing TypeScript declarations for JSX entry points ([#2404](https://github.com/MetaMask/snaps/pull/2404))
145
199
 
146
200
  ## [4.1.0]
201
+
147
202
  ### Added
203
+
148
204
  - Add JSX support for custom UI ([#2258](https://github.com/MetaMask/snaps/pull/2258), [#2379](https://github.com/MetaMask/snaps/pull/2379))
149
205
  - It's now possible to use JSX components from this package to build user
150
206
  interfaces for Snaps.
@@ -155,50 +211,69 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
155
211
  will be used automatically.
156
212
 
157
213
  ### Changed
214
+
158
215
  - Deprecate legacy UI components ([#2388](https://github.com/MetaMask/snaps/pull/2388))
159
216
  - Bump `@metamask/providers` from `16.0.0` to `16.1.0` ([#2386](https://github.com/MetaMask/snaps/pull/2386))
160
217
 
161
218
  ## [4.0.1]
219
+
162
220
  ### Fixed
221
+
163
222
  - Allow `null` in `FormSubmitEventStruct` form state ([#2333](https://github.com/MetaMask/snaps/pull/2333))
164
223
 
165
224
  ## [4.0.0]
225
+
166
226
  ### Removed
227
+
167
228
  - **BREAKING:** Remove broken `ethereum` properties ([#2296](https://github.com/MetaMask/snaps/pull/2296))
168
229
  - Snaps can no longer access `on` and `removeListener` on `ethereum`.
169
230
  - This feature was already non-functional.
170
231
 
171
232
  ## [3.2.0]
233
+
172
234
  ### Added
235
+
173
236
  - Add support for importing SVG, PNG, and JPEG files directly ([#2284](https://github.com/MetaMask/snaps/pull/2284))
174
237
 
175
238
  ### Changed
239
+
176
240
  - Narrow type for `endowment:name-lookup` ([#2293](https://github.com/MetaMask/snaps/pull/2293))
177
241
  - Bump MetaMask dependencies ([#2270](https://github.com/MetaMask/snaps/pull/2270))
178
242
 
179
243
  ## [3.1.1]
244
+
180
245
  ### Changed
246
+
181
247
  - Bump `@metamask/providers` to `^15.0.0` ([#2231](https://github.com/MetaMask/snaps/pull/2231))
182
248
 
183
249
  ### Fixed
250
+
184
251
  - Fix address validation in row component ([#2257](https://github.com/MetaMask/snaps/pull/2257))
185
252
 
186
253
  ## [3.1.0]
254
+
187
255
  ### Added
256
+
188
257
  - Add `InputChangeEvent` event ([#2237](https://github.com/MetaMask/snaps/pull/2237))
189
258
  - Add `error` prop to input component ([#2239](https://github.com/MetaMask/snaps/pull/2239))
190
259
 
191
260
  ## [3.0.1]
261
+
192
262
  ### Fixed
263
+
193
264
  - Fix minor build configuration problems ([#2220](https://github.com/MetaMask/snaps/pull/2220))
194
265
 
195
266
  ## [3.0.0]
267
+
196
268
  ### Changed
269
+
197
270
  - **BREAKING:** Update ESM build to be fully compliant with the ESM standard ([#2210](https://github.com/MetaMask/snaps/pull/2210))
198
271
  - Bump `@metamask/rpc-errors` to `^6.2.1` ([#2209](https://github.com/MetaMask/snaps/pull/2209))
199
272
 
200
273
  ## [2.1.0]
274
+
201
275
  ### Changed
276
+
202
277
  - Improve support for Snap errors without a message ([#2176](https://github.com/MetaMask/snaps/pull/2176))
203
278
  - You can now add data to an error without having to specify a message. For example:
204
279
  ```ts
@@ -207,55 +282,76 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
207
282
  - Strip empty `data` from Snap errors ([#2179](https://github.com/MetaMask/snaps/pull/2179))
208
283
 
209
284
  ## [2.0.0]
285
+
210
286
  ### Changed
287
+
211
288
  - **BREAKING:** Update name lookup API types ([#2113](https://github.com/MetaMask/snaps/pull/2113))
212
289
  - The return value and the permission format has changed, see [SIP-12](https://metamask.github.io/SIPs/SIPS/sip-12) for more details.
213
290
  - Add support for dynamic user interfaces ([#1465](https://github.com/MetaMask/snaps/pull/1465), [#2126](https://github.com/MetaMask/snaps/pull/2126), [#2143](https://github.com/MetaMask/snaps/pull/2143))
214
291
  - Add support for snap defined execution timeouts ([#2098](https://github.com/MetaMask/snaps/pull/2098))
215
292
 
216
293
  ### Fixed
294
+
217
295
  - Fix initial permissions types ([#2111](https://github.com/MetaMask/snaps/pull/2111))
218
296
 
219
297
  ## [1.4.0]
298
+
220
299
  ### Added
300
+
221
301
  - Add support for signature insights ([#2074](https://github.com/MetaMask/snaps/pull/2074), [#2079](https://github.com/MetaMask/snaps/pull/2079))
222
302
  - Add types for `snap_getClientStatus` ([#2051](https://github.com/MetaMask/snaps/pull/2051))
223
303
 
224
304
  ### Changed
305
+
225
306
  - Bump @metamask/utils from 8.2.1 to 8.3.0 ([#2100](https://github.com/MetaMask/snaps/pull/2100))
226
307
 
227
308
  ## [1.3.2]
309
+
228
310
  ### Fixed
311
+
229
312
  - Fix missing `sensitive` property in `Copyable` type ([#2070](https://github.com/MetaMask/snaps/pull/2070))
230
313
 
231
314
  ## [1.3.1]
315
+
232
316
  ### Fixed
317
+
233
318
  - Export error wrappers ([#2043](https://github.com/MetaMask/snaps/pull/2043))
234
319
 
235
320
  ## [1.3.0]
321
+
236
322
  ### Added
323
+
237
324
  - Add image fetching utility functions ([#1995](https://github.com/MetaMask/snaps/pull/1995))
238
325
  - This adds two functions:
239
326
  - `getImageComponent` to get an `image` component from a PNG or JPEG URL.
240
327
  - `getImageData` to get a base64 data string, which can be embedded in an SVG image.
241
328
 
242
329
  ## [1.2.0]
330
+
243
331
  ### Added
332
+
244
333
  - Add `row` and `address` component ([#1968](https://github.com/MetaMask/snaps/pull/1968))
245
334
  - Add `enumValue`, `literal` and `union` from `snaps-utils` ([#1968](https://github.com/MetaMask/snaps/pull/1968))
246
335
 
247
336
  ### Changed
337
+
248
338
  - Bump several MetaMask dependencies ([#1964](https://github.com/MetaMask/snaps/pull/1964))
249
339
 
250
340
  ## [1.1.0]
341
+
251
342
  ### Added
343
+
252
344
  - Add Snap error wrappers of JSON-RPC errors ([#1924](https://github.com/MetaMask/snaps/pull/1924))
253
345
 
254
346
  ## [1.0.0]
347
+
255
348
  ### Added
349
+
256
350
  - Initial release of this package.
257
351
 
258
- [Unreleased]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-sdk@6.5.0...HEAD
352
+ [Unreleased]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-sdk@6.6.0...HEAD
353
+ [6.6.0]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-sdk@6.5.1...@metamask/snaps-sdk@6.6.0
354
+ [6.5.1]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-sdk@6.5.0...@metamask/snaps-sdk@6.5.1
259
355
  [6.5.0]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-sdk@6.4.0...@metamask/snaps-sdk@6.5.0
260
356
  [6.4.0]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-sdk@6.3.0...@metamask/snaps-sdk@6.4.0
261
357
  [6.3.0]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-sdk@6.2.1...@metamask/snaps-sdk@6.3.0