@metamask/snaps-rpc-methods 8.0.0 → 8.1.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 (59) hide show
  1. package/CHANGELOG.md +6 -1
  2. package/dist/{chunk-JQ456NCC.mjs → chunk-3W4SMZFD.mjs} +3 -3
  3. package/dist/{chunk-WLDEPJGG.mjs → chunk-634BK2VP.mjs} +3 -3
  4. package/dist/chunk-634BK2VP.mjs.map +1 -0
  5. package/dist/{chunk-GP5KW5FU.js → chunk-D5WQBUZB.js} +2 -2
  6. package/dist/chunk-D5WQBUZB.js.map +1 -0
  7. package/dist/{chunk-6UY23OOZ.js → chunk-GP6TDVNT.js} +3 -3
  8. package/dist/{chunk-YS6TYXCP.mjs → chunk-GVJLWGSI.mjs} +3 -3
  9. package/dist/chunk-GVJLWGSI.mjs.map +1 -0
  10. package/dist/{chunk-GYZV5UBD.js → chunk-I7DR6BFO.js} +4 -4
  11. package/dist/chunk-I7DR6BFO.js.map +1 -0
  12. package/dist/{chunk-D6MUXDVI.js → chunk-INB4AX37.js} +5 -5
  13. package/dist/{chunk-AMBEX4N4.mjs → chunk-L675SYPP.mjs} +2 -2
  14. package/dist/{chunk-SU6KOIVB.mjs → chunk-PG32JMWC.mjs} +2 -2
  15. package/dist/{chunk-RZXF4KSR.js → chunk-RIALLTR7.js} +3 -3
  16. package/dist/{chunk-EGKFC56F.js → chunk-RX7WZZ32.js} +3 -3
  17. package/dist/{chunk-3LPBU737.js → chunk-UDB4MUXI.js} +2 -2
  18. package/dist/chunk-UDB4MUXI.js.map +1 -0
  19. package/dist/{chunk-7OMVZR5X.mjs → chunk-VNH2GKLV.mjs} +2 -2
  20. package/dist/{chunk-4SQWLI2S.mjs → chunk-X247BMMW.mjs} +6 -6
  21. package/dist/chunk-X247BMMW.mjs.map +1 -0
  22. package/dist/index.js +8 -8
  23. package/dist/index.mjs +7 -7
  24. package/dist/permissions.js +4 -4
  25. package/dist/permissions.mjs +3 -3
  26. package/dist/permitted/createInterface.js +2 -2
  27. package/dist/permitted/createInterface.mjs +1 -1
  28. package/dist/permitted/handlers.js +4 -4
  29. package/dist/permitted/handlers.mjs +3 -3
  30. package/dist/permitted/index.js +5 -5
  31. package/dist/permitted/index.mjs +4 -4
  32. package/dist/permitted/middleware.js +5 -5
  33. package/dist/permitted/middleware.mjs +4 -4
  34. package/dist/permitted/updateInterface.js +2 -2
  35. package/dist/permitted/updateInterface.mjs +1 -1
  36. package/dist/restricted/dialog.js +2 -2
  37. package/dist/restricted/dialog.mjs +1 -1
  38. package/dist/restricted/index.js +3 -3
  39. package/dist/restricted/index.mjs +2 -2
  40. package/dist/tsconfig.build.tsbuildinfo +1 -1
  41. package/dist/types/permitted/createInterface.d.ts +41 -41
  42. package/dist/types/permitted/updateInterface.d.ts +42 -42
  43. package/dist/types/restricted/dialog.d.ts +316 -148
  44. package/dist/types/restricted/manageAccounts.d.ts +1 -1
  45. package/package.json +3 -3
  46. package/dist/chunk-3LPBU737.js.map +0 -1
  47. package/dist/chunk-4SQWLI2S.mjs.map +0 -1
  48. package/dist/chunk-GP5KW5FU.js.map +0 -1
  49. package/dist/chunk-GYZV5UBD.js.map +0 -1
  50. package/dist/chunk-WLDEPJGG.mjs.map +0 -1
  51. package/dist/chunk-YS6TYXCP.mjs.map +0 -1
  52. /package/dist/{chunk-JQ456NCC.mjs.map → chunk-3W4SMZFD.mjs.map} +0 -0
  53. /package/dist/{chunk-6UY23OOZ.js.map → chunk-GP6TDVNT.js.map} +0 -0
  54. /package/dist/{chunk-D6MUXDVI.js.map → chunk-INB4AX37.js.map} +0 -0
  55. /package/dist/{chunk-AMBEX4N4.mjs.map → chunk-L675SYPP.mjs.map} +0 -0
  56. /package/dist/{chunk-SU6KOIVB.mjs.map → chunk-PG32JMWC.mjs.map} +0 -0
  57. /package/dist/{chunk-RZXF4KSR.js.map → chunk-RIALLTR7.js.map} +0 -0
  58. /package/dist/{chunk-EGKFC56F.js.map → chunk-RX7WZZ32.js.map} +0 -0
  59. /package/dist/{chunk-7OMVZR5X.mjs.map → chunk-VNH2GKLV.mjs.map} +0 -0
@@ -1,7 +1,7 @@
1
1
  import type { PermissionSpecificationBuilder, RestrictedMethodOptions } from '@metamask/permission-controller';
2
2
  import { PermissionType } from '@metamask/permission-controller';
3
3
  import { DialogType } from '@metamask/snaps-sdk';
4
- import type { DialogParams, EnumToUnion, Component, InterfaceState, SnapId } from '@metamask/snaps-sdk';
4
+ import type { DialogParams, EnumToUnion, InterfaceState, SnapId, ComponentOrElement } from '@metamask/snaps-sdk';
5
5
  import type { InferMatching } from '@metamask/snaps-utils';
6
6
  import { type NonEmptyArray } from '@metamask/utils';
7
7
  import type { Infer, Struct } from 'superstruct';
@@ -10,9 +10,9 @@ declare const methodName = "snap_dialog";
10
10
  declare const PlaceholderStruct: Struct<string | undefined, null>;
11
11
  export declare type Placeholder = Infer<typeof PlaceholderStruct>;
12
12
  declare type ShowDialog = (snapId: string, type: EnumToUnion<DialogType>, id: string, placeholder?: Placeholder) => Promise<null | boolean | string>;
13
- declare type CreateInterface = (snapId: string, content: Component) => Promise<string>;
13
+ declare type CreateInterface = (snapId: string, content: ComponentOrElement) => Promise<string>;
14
14
  declare type GetInterface = (snapId: string, id: string) => {
15
- content: Component;
15
+ content: ComponentOrElement;
16
16
  snapId: SnapId;
17
17
  state: InterfaceState;
18
18
  };
@@ -51,39 +51,7 @@ export declare const dialogBuilder: Readonly<{
51
51
  }>;
52
52
  declare const DialogParametersStruct: Struct<{
53
53
  type: "alert";
54
- content: import("@metamask/snaps-sdk").Panel | {
55
- type: import("@metamask/snaps-sdk").NodeType.Input;
56
- name: string;
57
- value?: string | undefined;
58
- error?: string | undefined;
59
- inputType?: "number" | "text" | "password" | undefined;
60
- placeholder?: string | undefined;
61
- label?: string | undefined;
62
- } | {
63
- value: string;
64
- type: import("@metamask/snaps-sdk").NodeType.Button;
65
- name?: string | undefined;
66
- variant?: "primary" | "secondary" | undefined;
67
- buttonType?: "button" | "submit" | undefined;
68
- } | {
69
- type: import("@metamask/snaps-sdk").NodeType.Form;
70
- name: string;
71
- children: ({
72
- type: import("@metamask/snaps-sdk").NodeType.Input;
73
- name: string;
74
- value?: string | undefined;
75
- error?: string | undefined;
76
- inputType?: "number" | "text" | "password" | undefined;
77
- placeholder?: string | undefined;
78
- label?: string | undefined;
79
- } | {
80
- value: string;
81
- type: import("@metamask/snaps-sdk").NodeType.Button;
82
- name?: string | undefined;
83
- variant?: "primary" | "secondary" | undefined;
84
- buttonType?: "button" | "submit" | undefined;
85
- })[];
86
- } | {
54
+ content: import("@metamask/snaps-sdk/jsx-runtime").JSXElement | import("@metamask/snaps-sdk").Panel | {
87
55
  value: string;
88
56
  type: import("@metamask/snaps-sdk").NodeType.Copyable;
89
57
  sensitive?: boolean | undefined;
@@ -119,20 +87,14 @@ declare const DialogParametersStruct: Struct<{
119
87
  type: import("@metamask/snaps-sdk").NodeType.Row;
120
88
  label: string;
121
89
  variant?: "default" | "warning" | "critical" | undefined;
122
- };
123
- } | {
124
- type: "alert";
125
- id: string;
126
- } | {
127
- type: "confirmation";
128
- content: import("@metamask/snaps-sdk").Panel | {
90
+ } | {
129
91
  type: import("@metamask/snaps-sdk").NodeType.Input;
130
92
  name: string;
131
93
  value?: string | undefined;
132
94
  error?: string | undefined;
133
- inputType?: "number" | "text" | "password" | undefined;
134
95
  placeholder?: string | undefined;
135
96
  label?: string | undefined;
97
+ inputType?: "number" | "text" | "password" | undefined;
136
98
  } | {
137
99
  value: string;
138
100
  type: import("@metamask/snaps-sdk").NodeType.Button;
@@ -141,15 +103,29 @@ declare const DialogParametersStruct: Struct<{
141
103
  buttonType?: "button" | "submit" | undefined;
142
104
  } | {
143
105
  type: import("@metamask/snaps-sdk").NodeType.Form;
106
+ /**
107
+ * The specification builder for the `snap_dialog` permission. `snap_dialog`
108
+ * lets the Snap display one of the following dialogs to the user:
109
+ * - An alert, for displaying information.
110
+ * - A confirmation, for accepting or rejecting some action.
111
+ * - A prompt, for inputting some information.
112
+ *
113
+ * @param options - The specification builder options.
114
+ * @param options.allowedCaveats - The optional allowed caveats for the
115
+ * permission.
116
+ * @param options.methodHooks - The RPC method hooks needed by the method
117
+ * implementation.
118
+ * @returns The specification for the `snap_dialog` permission.
119
+ */
144
120
  name: string;
145
121
  children: ({
146
122
  type: import("@metamask/snaps-sdk").NodeType.Input;
147
123
  name: string;
148
124
  value?: string | undefined;
149
125
  error?: string | undefined;
150
- inputType?: "number" | "text" | "password" | undefined;
151
126
  placeholder?: string | undefined;
152
127
  label?: string | undefined;
128
+ inputType?: "number" | "text" | "password" | undefined;
153
129
  } | {
154
130
  value: string;
155
131
  type: import("@metamask/snaps-sdk").NodeType.Button;
@@ -157,7 +133,13 @@ declare const DialogParametersStruct: Struct<{
157
133
  variant?: "primary" | "secondary" | undefined;
158
134
  buttonType?: "button" | "submit" | undefined;
159
135
  })[];
160
- } | {
136
+ };
137
+ } | {
138
+ type: "alert";
139
+ id: string;
140
+ } | {
141
+ type: "confirmation";
142
+ content: import("@metamask/snaps-sdk/jsx-runtime").JSXElement | import("@metamask/snaps-sdk").Panel | {
161
143
  value: string;
162
144
  type: import("@metamask/snaps-sdk").NodeType.Copyable;
163
145
  sensitive?: boolean | undefined;
@@ -193,20 +175,14 @@ declare const DialogParametersStruct: Struct<{
193
175
  type: import("@metamask/snaps-sdk").NodeType.Row;
194
176
  label: string;
195
177
  variant?: "default" | "warning" | "critical" | undefined;
196
- };
197
- } | {
198
- type: "confirmation";
199
- id: string;
200
- } | {
201
- type: "prompt";
202
- content: import("@metamask/snaps-sdk").Panel | {
178
+ } | {
203
179
  type: import("@metamask/snaps-sdk").NodeType.Input;
204
180
  name: string;
205
181
  value?: string | undefined;
206
182
  error?: string | undefined;
207
- inputType?: "number" | "text" | "password" | undefined;
208
183
  placeholder?: string | undefined;
209
184
  label?: string | undefined;
185
+ inputType?: "number" | "text" | "password" | undefined;
210
186
  } | {
211
187
  value: string;
212
188
  type: import("@metamask/snaps-sdk").NodeType.Button;
@@ -215,15 +191,29 @@ declare const DialogParametersStruct: Struct<{
215
191
  buttonType?: "button" | "submit" | undefined;
216
192
  } | {
217
193
  type: import("@metamask/snaps-sdk").NodeType.Form;
194
+ /**
195
+ * The specification builder for the `snap_dialog` permission. `snap_dialog`
196
+ * lets the Snap display one of the following dialogs to the user:
197
+ * - An alert, for displaying information.
198
+ * - A confirmation, for accepting or rejecting some action.
199
+ * - A prompt, for inputting some information.
200
+ *
201
+ * @param options - The specification builder options.
202
+ * @param options.allowedCaveats - The optional allowed caveats for the
203
+ * permission.
204
+ * @param options.methodHooks - The RPC method hooks needed by the method
205
+ * implementation.
206
+ * @returns The specification for the `snap_dialog` permission.
207
+ */
218
208
  name: string;
219
209
  children: ({
220
210
  type: import("@metamask/snaps-sdk").NodeType.Input;
221
211
  name: string;
222
212
  value?: string | undefined;
223
213
  error?: string | undefined;
224
- inputType?: "number" | "text" | "password" | undefined;
225
214
  placeholder?: string | undefined;
226
215
  label?: string | undefined;
216
+ inputType?: "number" | "text" | "password" | undefined;
227
217
  } | {
228
218
  value: string;
229
219
  type: import("@metamask/snaps-sdk").NodeType.Button;
@@ -231,7 +221,13 @@ declare const DialogParametersStruct: Struct<{
231
221
  variant?: "primary" | "secondary" | undefined;
232
222
  buttonType?: "button" | "submit" | undefined;
233
223
  })[];
234
- } | {
224
+ };
225
+ } | {
226
+ type: "confirmation";
227
+ id: string;
228
+ } | {
229
+ type: "prompt";
230
+ content: import("@metamask/snaps-sdk/jsx-runtime").JSXElement | import("@metamask/snaps-sdk").Panel | {
235
231
  value: string;
236
232
  type: import("@metamask/snaps-sdk").NodeType.Copyable;
237
233
  sensitive?: boolean | undefined;
@@ -267,22 +263,14 @@ declare const DialogParametersStruct: Struct<{
267
263
  type: import("@metamask/snaps-sdk").NodeType.Row;
268
264
  label: string;
269
265
  variant?: "default" | "warning" | "critical" | undefined;
270
- };
271
- placeholder?: string | undefined;
272
- } | {
273
- type: "prompt";
274
- id: string;
275
- placeholder?: string | undefined;
276
- }, [Struct<{
277
- type: "alert";
278
- content: import("@metamask/snaps-sdk").Panel | {
266
+ } | {
279
267
  type: import("@metamask/snaps-sdk").NodeType.Input;
280
268
  name: string;
281
269
  value?: string | undefined;
282
270
  error?: string | undefined;
283
- inputType?: "number" | "text" | "password" | undefined;
284
271
  placeholder?: string | undefined;
285
272
  label?: string | undefined;
273
+ inputType?: "number" | "text" | "password" | undefined;
286
274
  } | {
287
275
  value: string;
288
276
  type: import("@metamask/snaps-sdk").NodeType.Button;
@@ -291,15 +279,29 @@ declare const DialogParametersStruct: Struct<{
291
279
  buttonType?: "button" | "submit" | undefined;
292
280
  } | {
293
281
  type: import("@metamask/snaps-sdk").NodeType.Form;
282
+ /**
283
+ * The specification builder for the `snap_dialog` permission. `snap_dialog`
284
+ * lets the Snap display one of the following dialogs to the user:
285
+ * - An alert, for displaying information.
286
+ * - A confirmation, for accepting or rejecting some action.
287
+ * - A prompt, for inputting some information.
288
+ *
289
+ * @param options - The specification builder options.
290
+ * @param options.allowedCaveats - The optional allowed caveats for the
291
+ * permission.
292
+ * @param options.methodHooks - The RPC method hooks needed by the method
293
+ * implementation.
294
+ * @returns The specification for the `snap_dialog` permission.
295
+ */
294
296
  name: string;
295
297
  children: ({
296
298
  type: import("@metamask/snaps-sdk").NodeType.Input;
297
299
  name: string;
298
300
  value?: string | undefined;
299
301
  error?: string | undefined;
300
- inputType?: "number" | "text" | "password" | undefined;
301
302
  placeholder?: string | undefined;
302
303
  label?: string | undefined;
304
+ inputType?: "number" | "text" | "password" | undefined;
303
305
  } | {
304
306
  value: string;
305
307
  type: import("@metamask/snaps-sdk").NodeType.Button;
@@ -307,7 +309,15 @@ declare const DialogParametersStruct: Struct<{
307
309
  variant?: "primary" | "secondary" | undefined;
308
310
  buttonType?: "button" | "submit" | undefined;
309
311
  })[];
310
- } | {
312
+ };
313
+ placeholder?: string | undefined;
314
+ } | {
315
+ type: "prompt";
316
+ id: string;
317
+ placeholder?: string | undefined;
318
+ }, [Struct<{
319
+ type: "alert";
320
+ content: import("@metamask/snaps-sdk/jsx-runtime").JSXElement | import("@metamask/snaps-sdk").Panel | {
311
321
  value: string;
312
322
  type: import("@metamask/snaps-sdk").NodeType.Copyable;
313
323
  sensitive?: boolean | undefined;
@@ -343,20 +353,14 @@ declare const DialogParametersStruct: Struct<{
343
353
  type: import("@metamask/snaps-sdk").NodeType.Row;
344
354
  label: string;
345
355
  variant?: "default" | "warning" | "critical" | undefined;
346
- };
347
- } | {
348
- type: "alert";
349
- id: string;
350
- }, [Struct<{
351
- type: "alert";
352
- content: import("@metamask/snaps-sdk").Panel | {
356
+ } | {
353
357
  type: import("@metamask/snaps-sdk").NodeType.Input;
354
358
  name: string;
355
359
  value?: string | undefined;
356
360
  error?: string | undefined;
357
- inputType?: "number" | "text" | "password" | undefined;
358
361
  placeholder?: string | undefined;
359
362
  label?: string | undefined;
363
+ inputType?: "number" | "text" | "password" | undefined;
360
364
  } | {
361
365
  value: string;
362
366
  type: import("@metamask/snaps-sdk").NodeType.Button;
@@ -365,15 +369,29 @@ declare const DialogParametersStruct: Struct<{
365
369
  buttonType?: "button" | "submit" | undefined;
366
370
  } | {
367
371
  type: import("@metamask/snaps-sdk").NodeType.Form;
372
+ /**
373
+ * The specification builder for the `snap_dialog` permission. `snap_dialog`
374
+ * lets the Snap display one of the following dialogs to the user:
375
+ * - An alert, for displaying information.
376
+ * - A confirmation, for accepting or rejecting some action.
377
+ * - A prompt, for inputting some information.
378
+ *
379
+ * @param options - The specification builder options.
380
+ * @param options.allowedCaveats - The optional allowed caveats for the
381
+ * permission.
382
+ * @param options.methodHooks - The RPC method hooks needed by the method
383
+ * implementation.
384
+ * @returns The specification for the `snap_dialog` permission.
385
+ */
368
386
  name: string;
369
387
  children: ({
370
388
  type: import("@metamask/snaps-sdk").NodeType.Input;
371
389
  name: string;
372
390
  value?: string | undefined;
373
391
  error?: string | undefined;
374
- inputType?: "number" | "text" | "password" | undefined;
375
392
  placeholder?: string | undefined;
376
393
  label?: string | undefined;
394
+ inputType?: "number" | "text" | "password" | undefined;
377
395
  } | {
378
396
  value: string;
379
397
  type: import("@metamask/snaps-sdk").NodeType.Button;
@@ -381,7 +399,13 @@ declare const DialogParametersStruct: Struct<{
381
399
  variant?: "primary" | "secondary" | undefined;
382
400
  buttonType?: "button" | "submit" | undefined;
383
401
  })[];
384
- } | {
402
+ };
403
+ } | {
404
+ type: "alert";
405
+ id: string;
406
+ }, [Struct<{
407
+ type: "alert";
408
+ content: import("@metamask/snaps-sdk/jsx-runtime").JSXElement | import("@metamask/snaps-sdk").Panel | {
385
409
  value: string;
386
410
  type: import("@metamask/snaps-sdk").NodeType.Copyable;
387
411
  sensitive?: boolean | undefined;
@@ -417,17 +441,14 @@ declare const DialogParametersStruct: Struct<{
417
441
  type: import("@metamask/snaps-sdk").NodeType.Row;
418
442
  label: string;
419
443
  variant?: "default" | "warning" | "critical" | undefined;
420
- };
421
- }, {
422
- type: Struct<"alert", null>;
423
- content: Struct<import("@metamask/snaps-sdk").Panel | {
444
+ } | {
424
445
  type: import("@metamask/snaps-sdk").NodeType.Input;
425
446
  name: string;
426
447
  value?: string | undefined;
427
448
  error?: string | undefined;
428
- inputType?: "number" | "text" | "password" | undefined;
429
449
  placeholder?: string | undefined;
430
450
  label?: string | undefined;
451
+ inputType?: "number" | "text" | "password" | undefined;
431
452
  } | {
432
453
  value: string;
433
454
  type: import("@metamask/snaps-sdk").NodeType.Button;
@@ -436,15 +457,29 @@ declare const DialogParametersStruct: Struct<{
436
457
  buttonType?: "button" | "submit" | undefined;
437
458
  } | {
438
459
  type: import("@metamask/snaps-sdk").NodeType.Form;
460
+ /**
461
+ * The specification builder for the `snap_dialog` permission. `snap_dialog`
462
+ * lets the Snap display one of the following dialogs to the user:
463
+ * - An alert, for displaying information.
464
+ * - A confirmation, for accepting or rejecting some action.
465
+ * - A prompt, for inputting some information.
466
+ *
467
+ * @param options - The specification builder options.
468
+ * @param options.allowedCaveats - The optional allowed caveats for the
469
+ * permission.
470
+ * @param options.methodHooks - The RPC method hooks needed by the method
471
+ * implementation.
472
+ * @returns The specification for the `snap_dialog` permission.
473
+ */
439
474
  name: string;
440
475
  children: ({
441
476
  type: import("@metamask/snaps-sdk").NodeType.Input;
442
477
  name: string;
443
478
  value?: string | undefined;
444
479
  error?: string | undefined;
445
- inputType?: "number" | "text" | "password" | undefined;
446
480
  placeholder?: string | undefined;
447
481
  label?: string | undefined;
482
+ inputType?: "number" | "text" | "password" | undefined;
448
483
  } | {
449
484
  value: string;
450
485
  type: import("@metamask/snaps-sdk").NodeType.Button;
@@ -452,7 +487,10 @@ declare const DialogParametersStruct: Struct<{
452
487
  variant?: "primary" | "secondary" | undefined;
453
488
  buttonType?: "button" | "submit" | undefined;
454
489
  })[];
455
- } | {
490
+ };
491
+ }, {
492
+ type: Struct<"alert", null>;
493
+ content: Struct<import("@metamask/snaps-sdk/jsx-runtime").JSXElement | import("@metamask/snaps-sdk").Panel | {
456
494
  value: string;
457
495
  type: import("@metamask/snaps-sdk").NodeType.Copyable;
458
496
  sensitive?: boolean | undefined;
@@ -488,23 +526,14 @@ declare const DialogParametersStruct: Struct<{
488
526
  type: import("@metamask/snaps-sdk").NodeType.Row;
489
527
  label: string;
490
528
  variant?: "default" | "warning" | "critical" | undefined;
491
- }, null>;
492
- }>, Struct<{
493
- type: "alert";
494
- id: string;
495
- }, {
496
- type: Struct<"alert", null>;
497
- id: Struct<string, null>;
498
- }>]>, Struct<{
499
- type: "confirmation";
500
- content: import("@metamask/snaps-sdk").Panel | {
529
+ } | {
501
530
  type: import("@metamask/snaps-sdk").NodeType.Input;
502
531
  name: string;
503
532
  value?: string | undefined;
504
533
  error?: string | undefined;
505
- inputType?: "number" | "text" | "password" | undefined;
506
534
  placeholder?: string | undefined;
507
535
  label?: string | undefined;
536
+ inputType?: "number" | "text" | "password" | undefined;
508
537
  } | {
509
538
  value: string;
510
539
  type: import("@metamask/snaps-sdk").NodeType.Button;
@@ -513,15 +542,29 @@ declare const DialogParametersStruct: Struct<{
513
542
  buttonType?: "button" | "submit" | undefined;
514
543
  } | {
515
544
  type: import("@metamask/snaps-sdk").NodeType.Form;
545
+ /**
546
+ * The specification builder for the `snap_dialog` permission. `snap_dialog`
547
+ * lets the Snap display one of the following dialogs to the user:
548
+ * - An alert, for displaying information.
549
+ * - A confirmation, for accepting or rejecting some action.
550
+ * - A prompt, for inputting some information.
551
+ *
552
+ * @param options - The specification builder options.
553
+ * @param options.allowedCaveats - The optional allowed caveats for the
554
+ * permission.
555
+ * @param options.methodHooks - The RPC method hooks needed by the method
556
+ * implementation.
557
+ * @returns The specification for the `snap_dialog` permission.
558
+ */
516
559
  name: string;
517
560
  children: ({
518
561
  type: import("@metamask/snaps-sdk").NodeType.Input;
519
562
  name: string;
520
563
  value?: string | undefined;
521
564
  error?: string | undefined;
522
- inputType?: "number" | "text" | "password" | undefined;
523
565
  placeholder?: string | undefined;
524
566
  label?: string | undefined;
567
+ inputType?: "number" | "text" | "password" | undefined;
525
568
  } | {
526
569
  value: string;
527
570
  type: import("@metamask/snaps-sdk").NodeType.Button;
@@ -529,7 +572,16 @@ declare const DialogParametersStruct: Struct<{
529
572
  variant?: "primary" | "secondary" | undefined;
530
573
  buttonType?: "button" | "submit" | undefined;
531
574
  })[];
532
- } | {
575
+ }, null>;
576
+ }>, Struct<{
577
+ type: "alert";
578
+ id: string;
579
+ }, {
580
+ type: Struct<"alert", null>;
581
+ id: Struct<string, null>;
582
+ }>]>, Struct<{
583
+ type: "confirmation";
584
+ content: import("@metamask/snaps-sdk/jsx-runtime").JSXElement | import("@metamask/snaps-sdk").Panel | {
533
585
  value: string;
534
586
  type: import("@metamask/snaps-sdk").NodeType.Copyable;
535
587
  sensitive?: boolean | undefined;
@@ -565,20 +617,14 @@ declare const DialogParametersStruct: Struct<{
565
617
  type: import("@metamask/snaps-sdk").NodeType.Row;
566
618
  label: string;
567
619
  variant?: "default" | "warning" | "critical" | undefined;
568
- };
569
- } | {
570
- type: "confirmation";
571
- id: string;
572
- }, [Struct<{
573
- type: "confirmation";
574
- content: import("@metamask/snaps-sdk").Panel | {
620
+ } | {
575
621
  type: import("@metamask/snaps-sdk").NodeType.Input;
576
622
  name: string;
577
623
  value?: string | undefined;
578
624
  error?: string | undefined;
579
- inputType?: "number" | "text" | "password" | undefined;
580
625
  placeholder?: string | undefined;
581
626
  label?: string | undefined;
627
+ inputType?: "number" | "text" | "password" | undefined;
582
628
  } | {
583
629
  value: string;
584
630
  type: import("@metamask/snaps-sdk").NodeType.Button;
@@ -587,15 +633,29 @@ declare const DialogParametersStruct: Struct<{
587
633
  buttonType?: "button" | "submit" | undefined;
588
634
  } | {
589
635
  type: import("@metamask/snaps-sdk").NodeType.Form;
636
+ /**
637
+ * The specification builder for the `snap_dialog` permission. `snap_dialog`
638
+ * lets the Snap display one of the following dialogs to the user:
639
+ * - An alert, for displaying information.
640
+ * - A confirmation, for accepting or rejecting some action.
641
+ * - A prompt, for inputting some information.
642
+ *
643
+ * @param options - The specification builder options.
644
+ * @param options.allowedCaveats - The optional allowed caveats for the
645
+ * permission.
646
+ * @param options.methodHooks - The RPC method hooks needed by the method
647
+ * implementation.
648
+ * @returns The specification for the `snap_dialog` permission.
649
+ */
590
650
  name: string;
591
651
  children: ({
592
652
  type: import("@metamask/snaps-sdk").NodeType.Input;
593
653
  name: string;
594
654
  value?: string | undefined;
595
655
  error?: string | undefined;
596
- inputType?: "number" | "text" | "password" | undefined;
597
656
  placeholder?: string | undefined;
598
657
  label?: string | undefined;
658
+ inputType?: "number" | "text" | "password" | undefined;
599
659
  } | {
600
660
  value: string;
601
661
  type: import("@metamask/snaps-sdk").NodeType.Button;
@@ -603,7 +663,13 @@ declare const DialogParametersStruct: Struct<{
603
663
  variant?: "primary" | "secondary" | undefined;
604
664
  buttonType?: "button" | "submit" | undefined;
605
665
  })[];
606
- } | {
666
+ };
667
+ } | {
668
+ type: "confirmation";
669
+ id: string;
670
+ }, [Struct<{
671
+ type: "confirmation";
672
+ content: import("@metamask/snaps-sdk/jsx-runtime").JSXElement | import("@metamask/snaps-sdk").Panel | {
607
673
  value: string;
608
674
  type: import("@metamask/snaps-sdk").NodeType.Copyable;
609
675
  sensitive?: boolean | undefined;
@@ -639,17 +705,14 @@ declare const DialogParametersStruct: Struct<{
639
705
  type: import("@metamask/snaps-sdk").NodeType.Row;
640
706
  label: string;
641
707
  variant?: "default" | "warning" | "critical" | undefined;
642
- };
643
- }, {
644
- type: Struct<"confirmation", null>;
645
- content: Struct<import("@metamask/snaps-sdk").Panel | {
708
+ } | {
646
709
  type: import("@metamask/snaps-sdk").NodeType.Input;
647
710
  name: string;
648
711
  value?: string | undefined;
649
712
  error?: string | undefined;
650
- inputType?: "number" | "text" | "password" | undefined;
651
713
  placeholder?: string | undefined;
652
714
  label?: string | undefined;
715
+ inputType?: "number" | "text" | "password" | undefined;
653
716
  } | {
654
717
  value: string;
655
718
  type: import("@metamask/snaps-sdk").NodeType.Button;
@@ -658,15 +721,29 @@ declare const DialogParametersStruct: Struct<{
658
721
  buttonType?: "button" | "submit" | undefined;
659
722
  } | {
660
723
  type: import("@metamask/snaps-sdk").NodeType.Form;
724
+ /**
725
+ * The specification builder for the `snap_dialog` permission. `snap_dialog`
726
+ * lets the Snap display one of the following dialogs to the user:
727
+ * - An alert, for displaying information.
728
+ * - A confirmation, for accepting or rejecting some action.
729
+ * - A prompt, for inputting some information.
730
+ *
731
+ * @param options - The specification builder options.
732
+ * @param options.allowedCaveats - The optional allowed caveats for the
733
+ * permission.
734
+ * @param options.methodHooks - The RPC method hooks needed by the method
735
+ * implementation.
736
+ * @returns The specification for the `snap_dialog` permission.
737
+ */
661
738
  name: string;
662
739
  children: ({
663
740
  type: import("@metamask/snaps-sdk").NodeType.Input;
664
741
  name: string;
665
742
  value?: string | undefined;
666
743
  error?: string | undefined;
667
- inputType?: "number" | "text" | "password" | undefined;
668
744
  placeholder?: string | undefined;
669
745
  label?: string | undefined;
746
+ inputType?: "number" | "text" | "password" | undefined;
670
747
  } | {
671
748
  value: string;
672
749
  type: import("@metamask/snaps-sdk").NodeType.Button;
@@ -674,7 +751,10 @@ declare const DialogParametersStruct: Struct<{
674
751
  variant?: "primary" | "secondary" | undefined;
675
752
  buttonType?: "button" | "submit" | undefined;
676
753
  })[];
677
- } | {
754
+ };
755
+ }, {
756
+ type: Struct<"confirmation", null>;
757
+ content: Struct<import("@metamask/snaps-sdk/jsx-runtime").JSXElement | import("@metamask/snaps-sdk").Panel | {
678
758
  value: string;
679
759
  type: import("@metamask/snaps-sdk").NodeType.Copyable;
680
760
  sensitive?: boolean | undefined;
@@ -710,23 +790,14 @@ declare const DialogParametersStruct: Struct<{
710
790
  type: import("@metamask/snaps-sdk").NodeType.Row;
711
791
  label: string;
712
792
  variant?: "default" | "warning" | "critical" | undefined;
713
- }, null>;
714
- }>, Struct<{
715
- type: "confirmation";
716
- id: string;
717
- }, {
718
- type: Struct<"confirmation", null>;
719
- id: Struct<string, null>;
720
- }>]>, Struct<{
721
- type: "prompt";
722
- content: import("@metamask/snaps-sdk").Panel | {
793
+ } | {
723
794
  type: import("@metamask/snaps-sdk").NodeType.Input;
724
795
  name: string;
725
796
  value?: string | undefined;
726
797
  error?: string | undefined;
727
- inputType?: "number" | "text" | "password" | undefined;
728
798
  placeholder?: string | undefined;
729
799
  label?: string | undefined;
800
+ inputType?: "number" | "text" | "password" | undefined;
730
801
  } | {
731
802
  value: string;
732
803
  type: import("@metamask/snaps-sdk").NodeType.Button;
@@ -735,15 +806,29 @@ declare const DialogParametersStruct: Struct<{
735
806
  buttonType?: "button" | "submit" | undefined;
736
807
  } | {
737
808
  type: import("@metamask/snaps-sdk").NodeType.Form;
809
+ /**
810
+ * The specification builder for the `snap_dialog` permission. `snap_dialog`
811
+ * lets the Snap display one of the following dialogs to the user:
812
+ * - An alert, for displaying information.
813
+ * - A confirmation, for accepting or rejecting some action.
814
+ * - A prompt, for inputting some information.
815
+ *
816
+ * @param options - The specification builder options.
817
+ * @param options.allowedCaveats - The optional allowed caveats for the
818
+ * permission.
819
+ * @param options.methodHooks - The RPC method hooks needed by the method
820
+ * implementation.
821
+ * @returns The specification for the `snap_dialog` permission.
822
+ */
738
823
  name: string;
739
824
  children: ({
740
825
  type: import("@metamask/snaps-sdk").NodeType.Input;
741
826
  name: string;
742
827
  value?: string | undefined;
743
828
  error?: string | undefined;
744
- inputType?: "number" | "text" | "password" | undefined;
745
829
  placeholder?: string | undefined;
746
830
  label?: string | undefined;
831
+ inputType?: "number" | "text" | "password" | undefined;
747
832
  } | {
748
833
  value: string;
749
834
  type: import("@metamask/snaps-sdk").NodeType.Button;
@@ -751,7 +836,16 @@ declare const DialogParametersStruct: Struct<{
751
836
  variant?: "primary" | "secondary" | undefined;
752
837
  buttonType?: "button" | "submit" | undefined;
753
838
  })[];
754
- } | {
839
+ }, null>;
840
+ }>, Struct<{
841
+ type: "confirmation";
842
+ id: string;
843
+ }, {
844
+ type: Struct<"confirmation", null>;
845
+ id: Struct<string, null>;
846
+ }>]>, Struct<{
847
+ type: "prompt";
848
+ content: import("@metamask/snaps-sdk/jsx-runtime").JSXElement | import("@metamask/snaps-sdk").Panel | {
755
849
  value: string;
756
850
  type: import("@metamask/snaps-sdk").NodeType.Copyable;
757
851
  sensitive?: boolean | undefined;
@@ -787,22 +881,14 @@ declare const DialogParametersStruct: Struct<{
787
881
  type: import("@metamask/snaps-sdk").NodeType.Row;
788
882
  label: string;
789
883
  variant?: "default" | "warning" | "critical" | undefined;
790
- };
791
- placeholder?: string | undefined;
792
- } | {
793
- type: "prompt";
794
- id: string;
795
- placeholder?: string | undefined;
796
- }, [Struct<{
797
- type: "prompt";
798
- content: import("@metamask/snaps-sdk").Panel | {
884
+ } | {
799
885
  type: import("@metamask/snaps-sdk").NodeType.Input;
800
886
  name: string;
801
887
  value?: string | undefined;
802
888
  error?: string | undefined;
803
- inputType?: "number" | "text" | "password" | undefined;
804
889
  placeholder?: string | undefined;
805
890
  label?: string | undefined;
891
+ inputType?: "number" | "text" | "password" | undefined;
806
892
  } | {
807
893
  value: string;
808
894
  type: import("@metamask/snaps-sdk").NodeType.Button;
@@ -811,15 +897,29 @@ declare const DialogParametersStruct: Struct<{
811
897
  buttonType?: "button" | "submit" | undefined;
812
898
  } | {
813
899
  type: import("@metamask/snaps-sdk").NodeType.Form;
900
+ /**
901
+ * The specification builder for the `snap_dialog` permission. `snap_dialog`
902
+ * lets the Snap display one of the following dialogs to the user:
903
+ * - An alert, for displaying information.
904
+ * - A confirmation, for accepting or rejecting some action.
905
+ * - A prompt, for inputting some information.
906
+ *
907
+ * @param options - The specification builder options.
908
+ * @param options.allowedCaveats - The optional allowed caveats for the
909
+ * permission.
910
+ * @param options.methodHooks - The RPC method hooks needed by the method
911
+ * implementation.
912
+ * @returns The specification for the `snap_dialog` permission.
913
+ */
814
914
  name: string;
815
915
  children: ({
816
916
  type: import("@metamask/snaps-sdk").NodeType.Input;
817
917
  name: string;
818
918
  value?: string | undefined;
819
919
  error?: string | undefined;
820
- inputType?: "number" | "text" | "password" | undefined;
821
920
  placeholder?: string | undefined;
822
921
  label?: string | undefined;
922
+ inputType?: "number" | "text" | "password" | undefined;
823
923
  } | {
824
924
  value: string;
825
925
  type: import("@metamask/snaps-sdk").NodeType.Button;
@@ -827,7 +927,15 @@ declare const DialogParametersStruct: Struct<{
827
927
  variant?: "primary" | "secondary" | undefined;
828
928
  buttonType?: "button" | "submit" | undefined;
829
929
  })[];
830
- } | {
930
+ };
931
+ placeholder?: string | undefined;
932
+ } | {
933
+ type: "prompt";
934
+ id: string;
935
+ placeholder?: string | undefined;
936
+ }, [Struct<{
937
+ type: "prompt";
938
+ content: import("@metamask/snaps-sdk/jsx-runtime").JSXElement | import("@metamask/snaps-sdk").Panel | {
831
939
  value: string;
832
940
  type: import("@metamask/snaps-sdk").NodeType.Copyable;
833
941
  sensitive?: boolean | undefined;
@@ -863,18 +971,14 @@ declare const DialogParametersStruct: Struct<{
863
971
  type: import("@metamask/snaps-sdk").NodeType.Row;
864
972
  label: string;
865
973
  variant?: "default" | "warning" | "critical" | undefined;
866
- };
867
- placeholder?: string | undefined;
868
- }, {
869
- type: Struct<"prompt", null>;
870
- content: Struct<import("@metamask/snaps-sdk").Panel | {
974
+ } | {
871
975
  type: import("@metamask/snaps-sdk").NodeType.Input;
872
976
  name: string;
873
977
  value?: string | undefined;
874
978
  error?: string | undefined;
875
- inputType?: "number" | "text" | "password" | undefined;
876
979
  placeholder?: string | undefined;
877
980
  label?: string | undefined;
981
+ inputType?: "number" | "text" | "password" | undefined;
878
982
  } | {
879
983
  value: string;
880
984
  type: import("@metamask/snaps-sdk").NodeType.Button;
@@ -883,15 +987,29 @@ declare const DialogParametersStruct: Struct<{
883
987
  buttonType?: "button" | "submit" | undefined;
884
988
  } | {
885
989
  type: import("@metamask/snaps-sdk").NodeType.Form;
990
+ /**
991
+ * The specification builder for the `snap_dialog` permission. `snap_dialog`
992
+ * lets the Snap display one of the following dialogs to the user:
993
+ * - An alert, for displaying information.
994
+ * - A confirmation, for accepting or rejecting some action.
995
+ * - A prompt, for inputting some information.
996
+ *
997
+ * @param options - The specification builder options.
998
+ * @param options.allowedCaveats - The optional allowed caveats for the
999
+ * permission.
1000
+ * @param options.methodHooks - The RPC method hooks needed by the method
1001
+ * implementation.
1002
+ * @returns The specification for the `snap_dialog` permission.
1003
+ */
886
1004
  name: string;
887
1005
  children: ({
888
1006
  type: import("@metamask/snaps-sdk").NodeType.Input;
889
1007
  name: string;
890
1008
  value?: string | undefined;
891
1009
  error?: string | undefined;
892
- inputType?: "number" | "text" | "password" | undefined;
893
1010
  placeholder?: string | undefined;
894
1011
  label?: string | undefined;
1012
+ inputType?: "number" | "text" | "password" | undefined;
895
1013
  } | {
896
1014
  value: string;
897
1015
  type: import("@metamask/snaps-sdk").NodeType.Button;
@@ -899,7 +1017,11 @@ declare const DialogParametersStruct: Struct<{
899
1017
  variant?: "primary" | "secondary" | undefined;
900
1018
  buttonType?: "button" | "submit" | undefined;
901
1019
  })[];
902
- } | {
1020
+ };
1021
+ placeholder?: string | undefined;
1022
+ }, {
1023
+ type: Struct<"prompt", null>;
1024
+ content: Struct<import("@metamask/snaps-sdk/jsx-runtime").JSXElement | import("@metamask/snaps-sdk").Panel | {
903
1025
  value: string;
904
1026
  type: import("@metamask/snaps-sdk").NodeType.Copyable;
905
1027
  sensitive?: boolean | undefined;
@@ -935,6 +1057,52 @@ declare const DialogParametersStruct: Struct<{
935
1057
  type: import("@metamask/snaps-sdk").NodeType.Row;
936
1058
  label: string;
937
1059
  variant?: "default" | "warning" | "critical" | undefined;
1060
+ } | {
1061
+ type: import("@metamask/snaps-sdk").NodeType.Input;
1062
+ name: string;
1063
+ value?: string | undefined;
1064
+ error?: string | undefined;
1065
+ placeholder?: string | undefined;
1066
+ label?: string | undefined;
1067
+ inputType?: "number" | "text" | "password" | undefined;
1068
+ } | {
1069
+ value: string;
1070
+ type: import("@metamask/snaps-sdk").NodeType.Button;
1071
+ name?: string | undefined;
1072
+ variant?: "primary" | "secondary" | undefined;
1073
+ buttonType?: "button" | "submit" | undefined;
1074
+ } | {
1075
+ type: import("@metamask/snaps-sdk").NodeType.Form;
1076
+ /**
1077
+ * The specification builder for the `snap_dialog` permission. `snap_dialog`
1078
+ * lets the Snap display one of the following dialogs to the user:
1079
+ * - An alert, for displaying information.
1080
+ * - A confirmation, for accepting or rejecting some action.
1081
+ * - A prompt, for inputting some information.
1082
+ *
1083
+ * @param options - The specification builder options.
1084
+ * @param options.allowedCaveats - The optional allowed caveats for the
1085
+ * permission.
1086
+ * @param options.methodHooks - The RPC method hooks needed by the method
1087
+ * implementation.
1088
+ * @returns The specification for the `snap_dialog` permission.
1089
+ */
1090
+ name: string;
1091
+ children: ({
1092
+ type: import("@metamask/snaps-sdk").NodeType.Input;
1093
+ name: string;
1094
+ value?: string | undefined;
1095
+ error?: string | undefined;
1096
+ placeholder?: string | undefined;
1097
+ label?: string | undefined;
1098
+ inputType?: "number" | "text" | "password" | undefined;
1099
+ } | {
1100
+ value: string;
1101
+ type: import("@metamask/snaps-sdk").NodeType.Button;
1102
+ name?: string | undefined;
1103
+ variant?: "primary" | "secondary" | undefined;
1104
+ buttonType?: "button" | "submit" | undefined;
1105
+ })[];
938
1106
  }, null>;
939
1107
  placeholder: Struct<string | undefined, null>;
940
1108
  }>, Struct<{