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