@metamask/snaps-rpc-methods 7.0.2 → 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 (70) hide show
  1. package/CHANGELOG.md +12 -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-AKRFLGOS.mjs → chunk-L675SYPP.mjs} +2 -2
  14. package/dist/{chunk-7NBRKDKJ.mjs → chunk-NESDQ4PF.mjs} +9 -54
  15. package/dist/chunk-NESDQ4PF.mjs.map +1 -0
  16. package/dist/{chunk-3S7DJI4I.mjs → chunk-PG32JMWC.mjs} +3 -3
  17. package/dist/chunk-PG32JMWC.mjs.map +1 -0
  18. package/dist/{chunk-KO4MKRYZ.js → chunk-R2M4YLJ7.js} +7 -52
  19. package/dist/chunk-R2M4YLJ7.js.map +1 -0
  20. package/dist/{chunk-LVTN25J2.js → chunk-RIALLTR7.js} +5 -5
  21. package/dist/{chunk-LVTN25J2.js.map → chunk-RIALLTR7.js.map} +1 -1
  22. package/dist/{chunk-FBOZCV3C.js → chunk-RX7WZZ32.js} +3 -3
  23. package/dist/{chunk-3LPBU737.js → chunk-UDB4MUXI.js} +2 -2
  24. package/dist/chunk-UDB4MUXI.js.map +1 -0
  25. package/dist/{chunk-7OMVZR5X.mjs → chunk-VNH2GKLV.mjs} +2 -2
  26. package/dist/{chunk-4SQWLI2S.mjs → chunk-X247BMMW.mjs} +6 -6
  27. package/dist/chunk-X247BMMW.mjs.map +1 -0
  28. package/dist/index.js +9 -9
  29. package/dist/index.mjs +10 -10
  30. package/dist/permissions.js +5 -5
  31. package/dist/permissions.mjs +4 -4
  32. package/dist/permitted/createInterface.js +2 -2
  33. package/dist/permitted/createInterface.mjs +1 -1
  34. package/dist/permitted/handlers.js +4 -4
  35. package/dist/permitted/handlers.mjs +3 -3
  36. package/dist/permitted/index.js +5 -5
  37. package/dist/permitted/index.mjs +4 -4
  38. package/dist/permitted/middleware.js +5 -5
  39. package/dist/permitted/middleware.mjs +4 -4
  40. package/dist/permitted/updateInterface.js +2 -2
  41. package/dist/permitted/updateInterface.mjs +1 -1
  42. package/dist/restricted/dialog.js +2 -2
  43. package/dist/restricted/dialog.mjs +1 -1
  44. package/dist/restricted/index.js +4 -4
  45. package/dist/restricted/index.mjs +5 -5
  46. package/dist/restricted/manageState.js +2 -2
  47. package/dist/restricted/manageState.mjs +3 -3
  48. package/dist/tsconfig.build.tsbuildinfo +1 -1
  49. package/dist/types/permitted/createInterface.d.ts +8 -8
  50. package/dist/types/permitted/updateInterface.d.ts +8 -8
  51. package/dist/types/restricted/dialog.d.ts +207 -39
  52. package/dist/types/restricted/index.d.ts +1 -1
  53. package/dist/types/restricted/manageAccounts.d.ts +1 -1
  54. package/dist/types/restricted/manageState.d.ts +5 -31
  55. package/package.json +3 -4
  56. package/dist/chunk-3LPBU737.js.map +0 -1
  57. package/dist/chunk-3S7DJI4I.mjs.map +0 -1
  58. package/dist/chunk-4SQWLI2S.mjs.map +0 -1
  59. package/dist/chunk-7NBRKDKJ.mjs.map +0 -1
  60. package/dist/chunk-GP5KW5FU.js.map +0 -1
  61. package/dist/chunk-GYZV5UBD.js.map +0 -1
  62. package/dist/chunk-KO4MKRYZ.js.map +0 -1
  63. package/dist/chunk-WLDEPJGG.mjs.map +0 -1
  64. package/dist/chunk-YS6TYXCP.mjs.map +0 -1
  65. /package/dist/{chunk-JQ456NCC.mjs.map → chunk-3W4SMZFD.mjs.map} +0 -0
  66. /package/dist/{chunk-6UY23OOZ.js.map → chunk-GP6TDVNT.js.map} +0 -0
  67. /package/dist/{chunk-D6MUXDVI.js.map → chunk-INB4AX37.js.map} +0 -0
  68. /package/dist/{chunk-AKRFLGOS.mjs.map → chunk-L675SYPP.mjs.map} +0 -0
  69. /package/dist/{chunk-FBOZCV3C.js.map → chunk-RX7WZZ32.js.map} +0 -0
  70. /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,7 +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 | {
54
+ content: import("@metamask/snaps-sdk/jsx-runtime").JSXElement | import("@metamask/snaps-sdk").Panel | {
55
55
  value: string;
56
56
  type: import("@metamask/snaps-sdk").NodeType.Copyable;
57
57
  sensitive?: boolean | undefined;
@@ -92,9 +92,9 @@ declare const DialogParametersStruct: Struct<{
92
92
  name: string;
93
93
  value?: string | undefined;
94
94
  error?: string | undefined;
95
+ placeholder?: string | undefined;
95
96
  label?: string | undefined;
96
97
  inputType?: "number" | "text" | "password" | undefined;
97
- placeholder?: string | undefined;
98
98
  } | {
99
99
  value: string;
100
100
  type: import("@metamask/snaps-sdk").NodeType.Button;
@@ -103,15 +103,29 @@ declare const DialogParametersStruct: Struct<{
103
103
  buttonType?: "button" | "submit" | undefined;
104
104
  } | {
105
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
+ */
106
120
  name: string;
107
121
  children: ({
108
122
  type: import("@metamask/snaps-sdk").NodeType.Input;
109
123
  name: string;
110
124
  value?: string | undefined;
111
125
  error?: string | undefined;
126
+ placeholder?: string | undefined;
112
127
  label?: string | undefined;
113
128
  inputType?: "number" | "text" | "password" | undefined;
114
- placeholder?: string | undefined;
115
129
  } | {
116
130
  value: string;
117
131
  type: import("@metamask/snaps-sdk").NodeType.Button;
@@ -125,7 +139,7 @@ declare const DialogParametersStruct: Struct<{
125
139
  id: string;
126
140
  } | {
127
141
  type: "confirmation";
128
- content: import("@metamask/snaps-sdk").Panel | {
142
+ content: import("@metamask/snaps-sdk/jsx-runtime").JSXElement | import("@metamask/snaps-sdk").Panel | {
129
143
  value: string;
130
144
  type: import("@metamask/snaps-sdk").NodeType.Copyable;
131
145
  sensitive?: boolean | undefined;
@@ -166,9 +180,9 @@ declare const DialogParametersStruct: Struct<{
166
180
  name: string;
167
181
  value?: string | undefined;
168
182
  error?: string | undefined;
183
+ placeholder?: string | undefined;
169
184
  label?: string | undefined;
170
185
  inputType?: "number" | "text" | "password" | undefined;
171
- placeholder?: string | undefined;
172
186
  } | {
173
187
  value: string;
174
188
  type: import("@metamask/snaps-sdk").NodeType.Button;
@@ -177,15 +191,29 @@ declare const DialogParametersStruct: Struct<{
177
191
  buttonType?: "button" | "submit" | undefined;
178
192
  } | {
179
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
+ */
180
208
  name: string;
181
209
  children: ({
182
210
  type: import("@metamask/snaps-sdk").NodeType.Input;
183
211
  name: string;
184
212
  value?: string | undefined;
185
213
  error?: string | undefined;
214
+ placeholder?: string | undefined;
186
215
  label?: string | undefined;
187
216
  inputType?: "number" | "text" | "password" | undefined;
188
- placeholder?: string | undefined;
189
217
  } | {
190
218
  value: string;
191
219
  type: import("@metamask/snaps-sdk").NodeType.Button;
@@ -199,7 +227,7 @@ declare const DialogParametersStruct: Struct<{
199
227
  id: string;
200
228
  } | {
201
229
  type: "prompt";
202
- content: import("@metamask/snaps-sdk").Panel | {
230
+ content: import("@metamask/snaps-sdk/jsx-runtime").JSXElement | import("@metamask/snaps-sdk").Panel | {
203
231
  value: string;
204
232
  type: import("@metamask/snaps-sdk").NodeType.Copyable;
205
233
  sensitive?: boolean | undefined;
@@ -240,9 +268,9 @@ declare const DialogParametersStruct: Struct<{
240
268
  name: string;
241
269
  value?: string | undefined;
242
270
  error?: string | undefined;
271
+ placeholder?: string | undefined;
243
272
  label?: string | undefined;
244
273
  inputType?: "number" | "text" | "password" | undefined;
245
- placeholder?: string | undefined;
246
274
  } | {
247
275
  value: string;
248
276
  type: import("@metamask/snaps-sdk").NodeType.Button;
@@ -251,15 +279,29 @@ declare const DialogParametersStruct: Struct<{
251
279
  buttonType?: "button" | "submit" | undefined;
252
280
  } | {
253
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
+ */
254
296
  name: string;
255
297
  children: ({
256
298
  type: import("@metamask/snaps-sdk").NodeType.Input;
257
299
  name: string;
258
300
  value?: string | undefined;
259
301
  error?: string | undefined;
302
+ placeholder?: string | undefined;
260
303
  label?: string | undefined;
261
304
  inputType?: "number" | "text" | "password" | undefined;
262
- placeholder?: string | undefined;
263
305
  } | {
264
306
  value: string;
265
307
  type: import("@metamask/snaps-sdk").NodeType.Button;
@@ -275,7 +317,7 @@ declare const DialogParametersStruct: Struct<{
275
317
  placeholder?: string | undefined;
276
318
  }, [Struct<{
277
319
  type: "alert";
278
- content: import("@metamask/snaps-sdk").Panel | {
320
+ content: import("@metamask/snaps-sdk/jsx-runtime").JSXElement | import("@metamask/snaps-sdk").Panel | {
279
321
  value: string;
280
322
  type: import("@metamask/snaps-sdk").NodeType.Copyable;
281
323
  sensitive?: boolean | undefined;
@@ -316,9 +358,9 @@ declare const DialogParametersStruct: Struct<{
316
358
  name: string;
317
359
  value?: string | undefined;
318
360
  error?: string | undefined;
361
+ placeholder?: string | undefined;
319
362
  label?: string | undefined;
320
363
  inputType?: "number" | "text" | "password" | undefined;
321
- placeholder?: string | undefined;
322
364
  } | {
323
365
  value: string;
324
366
  type: import("@metamask/snaps-sdk").NodeType.Button;
@@ -327,15 +369,29 @@ declare const DialogParametersStruct: Struct<{
327
369
  buttonType?: "button" | "submit" | undefined;
328
370
  } | {
329
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
+ */
330
386
  name: string;
331
387
  children: ({
332
388
  type: import("@metamask/snaps-sdk").NodeType.Input;
333
389
  name: string;
334
390
  value?: string | undefined;
335
391
  error?: string | undefined;
392
+ placeholder?: string | undefined;
336
393
  label?: string | undefined;
337
394
  inputType?: "number" | "text" | "password" | undefined;
338
- placeholder?: string | undefined;
339
395
  } | {
340
396
  value: string;
341
397
  type: import("@metamask/snaps-sdk").NodeType.Button;
@@ -349,7 +405,7 @@ declare const DialogParametersStruct: Struct<{
349
405
  id: string;
350
406
  }, [Struct<{
351
407
  type: "alert";
352
- content: import("@metamask/snaps-sdk").Panel | {
408
+ content: import("@metamask/snaps-sdk/jsx-runtime").JSXElement | import("@metamask/snaps-sdk").Panel | {
353
409
  value: string;
354
410
  type: import("@metamask/snaps-sdk").NodeType.Copyable;
355
411
  sensitive?: boolean | undefined;
@@ -390,9 +446,9 @@ declare const DialogParametersStruct: Struct<{
390
446
  name: string;
391
447
  value?: string | undefined;
392
448
  error?: string | undefined;
449
+ placeholder?: string | undefined;
393
450
  label?: string | undefined;
394
451
  inputType?: "number" | "text" | "password" | undefined;
395
- placeholder?: string | undefined;
396
452
  } | {
397
453
  value: string;
398
454
  type: import("@metamask/snaps-sdk").NodeType.Button;
@@ -401,15 +457,29 @@ declare const DialogParametersStruct: Struct<{
401
457
  buttonType?: "button" | "submit" | undefined;
402
458
  } | {
403
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
+ */
404
474
  name: string;
405
475
  children: ({
406
476
  type: import("@metamask/snaps-sdk").NodeType.Input;
407
477
  name: string;
408
478
  value?: string | undefined;
409
479
  error?: string | undefined;
480
+ placeholder?: string | undefined;
410
481
  label?: string | undefined;
411
482
  inputType?: "number" | "text" | "password" | undefined;
412
- placeholder?: string | undefined;
413
483
  } | {
414
484
  value: string;
415
485
  type: import("@metamask/snaps-sdk").NodeType.Button;
@@ -420,7 +490,7 @@ declare const DialogParametersStruct: Struct<{
420
490
  };
421
491
  }, {
422
492
  type: Struct<"alert", null>;
423
- content: Struct<import("@metamask/snaps-sdk").Panel | {
493
+ content: Struct<import("@metamask/snaps-sdk/jsx-runtime").JSXElement | import("@metamask/snaps-sdk").Panel | {
424
494
  value: string;
425
495
  type: import("@metamask/snaps-sdk").NodeType.Copyable;
426
496
  sensitive?: boolean | undefined;
@@ -461,9 +531,9 @@ declare const DialogParametersStruct: Struct<{
461
531
  name: string;
462
532
  value?: string | undefined;
463
533
  error?: string | undefined;
534
+ placeholder?: string | undefined;
464
535
  label?: string | undefined;
465
536
  inputType?: "number" | "text" | "password" | undefined;
466
- placeholder?: string | undefined;
467
537
  } | {
468
538
  value: string;
469
539
  type: import("@metamask/snaps-sdk").NodeType.Button;
@@ -472,15 +542,29 @@ declare const DialogParametersStruct: Struct<{
472
542
  buttonType?: "button" | "submit" | undefined;
473
543
  } | {
474
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
+ */
475
559
  name: string;
476
560
  children: ({
477
561
  type: import("@metamask/snaps-sdk").NodeType.Input;
478
562
  name: string;
479
563
  value?: string | undefined;
480
564
  error?: string | undefined;
565
+ placeholder?: string | undefined;
481
566
  label?: string | undefined;
482
567
  inputType?: "number" | "text" | "password" | undefined;
483
- placeholder?: string | undefined;
484
568
  } | {
485
569
  value: string;
486
570
  type: import("@metamask/snaps-sdk").NodeType.Button;
@@ -497,7 +581,7 @@ declare const DialogParametersStruct: Struct<{
497
581
  id: Struct<string, null>;
498
582
  }>]>, Struct<{
499
583
  type: "confirmation";
500
- content: import("@metamask/snaps-sdk").Panel | {
584
+ content: import("@metamask/snaps-sdk/jsx-runtime").JSXElement | import("@metamask/snaps-sdk").Panel | {
501
585
  value: string;
502
586
  type: import("@metamask/snaps-sdk").NodeType.Copyable;
503
587
  sensitive?: boolean | undefined;
@@ -538,9 +622,9 @@ declare const DialogParametersStruct: Struct<{
538
622
  name: string;
539
623
  value?: string | undefined;
540
624
  error?: string | undefined;
625
+ placeholder?: string | undefined;
541
626
  label?: string | undefined;
542
627
  inputType?: "number" | "text" | "password" | undefined;
543
- placeholder?: string | undefined;
544
628
  } | {
545
629
  value: string;
546
630
  type: import("@metamask/snaps-sdk").NodeType.Button;
@@ -549,15 +633,29 @@ declare const DialogParametersStruct: Struct<{
549
633
  buttonType?: "button" | "submit" | undefined;
550
634
  } | {
551
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
+ */
552
650
  name: string;
553
651
  children: ({
554
652
  type: import("@metamask/snaps-sdk").NodeType.Input;
555
653
  name: string;
556
654
  value?: string | undefined;
557
655
  error?: string | undefined;
656
+ placeholder?: string | undefined;
558
657
  label?: string | undefined;
559
658
  inputType?: "number" | "text" | "password" | undefined;
560
- placeholder?: string | undefined;
561
659
  } | {
562
660
  value: string;
563
661
  type: import("@metamask/snaps-sdk").NodeType.Button;
@@ -571,7 +669,7 @@ declare const DialogParametersStruct: Struct<{
571
669
  id: string;
572
670
  }, [Struct<{
573
671
  type: "confirmation";
574
- content: import("@metamask/snaps-sdk").Panel | {
672
+ content: import("@metamask/snaps-sdk/jsx-runtime").JSXElement | import("@metamask/snaps-sdk").Panel | {
575
673
  value: string;
576
674
  type: import("@metamask/snaps-sdk").NodeType.Copyable;
577
675
  sensitive?: boolean | undefined;
@@ -612,9 +710,9 @@ declare const DialogParametersStruct: Struct<{
612
710
  name: string;
613
711
  value?: string | undefined;
614
712
  error?: string | undefined;
713
+ placeholder?: string | undefined;
615
714
  label?: string | undefined;
616
715
  inputType?: "number" | "text" | "password" | undefined;
617
- placeholder?: string | undefined;
618
716
  } | {
619
717
  value: string;
620
718
  type: import("@metamask/snaps-sdk").NodeType.Button;
@@ -623,15 +721,29 @@ declare const DialogParametersStruct: Struct<{
623
721
  buttonType?: "button" | "submit" | undefined;
624
722
  } | {
625
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
+ */
626
738
  name: string;
627
739
  children: ({
628
740
  type: import("@metamask/snaps-sdk").NodeType.Input;
629
741
  name: string;
630
742
  value?: string | undefined;
631
743
  error?: string | undefined;
744
+ placeholder?: string | undefined;
632
745
  label?: string | undefined;
633
746
  inputType?: "number" | "text" | "password" | undefined;
634
- placeholder?: string | undefined;
635
747
  } | {
636
748
  value: string;
637
749
  type: import("@metamask/snaps-sdk").NodeType.Button;
@@ -642,7 +754,7 @@ declare const DialogParametersStruct: Struct<{
642
754
  };
643
755
  }, {
644
756
  type: Struct<"confirmation", null>;
645
- content: Struct<import("@metamask/snaps-sdk").Panel | {
757
+ content: Struct<import("@metamask/snaps-sdk/jsx-runtime").JSXElement | import("@metamask/snaps-sdk").Panel | {
646
758
  value: string;
647
759
  type: import("@metamask/snaps-sdk").NodeType.Copyable;
648
760
  sensitive?: boolean | undefined;
@@ -683,9 +795,9 @@ declare const DialogParametersStruct: Struct<{
683
795
  name: string;
684
796
  value?: string | undefined;
685
797
  error?: string | undefined;
798
+ placeholder?: string | undefined;
686
799
  label?: string | undefined;
687
800
  inputType?: "number" | "text" | "password" | undefined;
688
- placeholder?: string | undefined;
689
801
  } | {
690
802
  value: string;
691
803
  type: import("@metamask/snaps-sdk").NodeType.Button;
@@ -694,15 +806,29 @@ declare const DialogParametersStruct: Struct<{
694
806
  buttonType?: "button" | "submit" | undefined;
695
807
  } | {
696
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
+ */
697
823
  name: string;
698
824
  children: ({
699
825
  type: import("@metamask/snaps-sdk").NodeType.Input;
700
826
  name: string;
701
827
  value?: string | undefined;
702
828
  error?: string | undefined;
829
+ placeholder?: string | undefined;
703
830
  label?: string | undefined;
704
831
  inputType?: "number" | "text" | "password" | undefined;
705
- placeholder?: string | undefined;
706
832
  } | {
707
833
  value: string;
708
834
  type: import("@metamask/snaps-sdk").NodeType.Button;
@@ -719,7 +845,7 @@ declare const DialogParametersStruct: Struct<{
719
845
  id: Struct<string, null>;
720
846
  }>]>, Struct<{
721
847
  type: "prompt";
722
- content: import("@metamask/snaps-sdk").Panel | {
848
+ content: import("@metamask/snaps-sdk/jsx-runtime").JSXElement | import("@metamask/snaps-sdk").Panel | {
723
849
  value: string;
724
850
  type: import("@metamask/snaps-sdk").NodeType.Copyable;
725
851
  sensitive?: boolean | undefined;
@@ -760,9 +886,9 @@ declare const DialogParametersStruct: Struct<{
760
886
  name: string;
761
887
  value?: string | undefined;
762
888
  error?: string | undefined;
889
+ placeholder?: string | undefined;
763
890
  label?: string | undefined;
764
891
  inputType?: "number" | "text" | "password" | undefined;
765
- placeholder?: string | undefined;
766
892
  } | {
767
893
  value: string;
768
894
  type: import("@metamask/snaps-sdk").NodeType.Button;
@@ -771,15 +897,29 @@ declare const DialogParametersStruct: Struct<{
771
897
  buttonType?: "button" | "submit" | undefined;
772
898
  } | {
773
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
+ */
774
914
  name: string;
775
915
  children: ({
776
916
  type: import("@metamask/snaps-sdk").NodeType.Input;
777
917
  name: string;
778
918
  value?: string | undefined;
779
919
  error?: string | undefined;
920
+ placeholder?: string | undefined;
780
921
  label?: string | undefined;
781
922
  inputType?: "number" | "text" | "password" | undefined;
782
- placeholder?: string | undefined;
783
923
  } | {
784
924
  value: string;
785
925
  type: import("@metamask/snaps-sdk").NodeType.Button;
@@ -795,7 +935,7 @@ declare const DialogParametersStruct: Struct<{
795
935
  placeholder?: string | undefined;
796
936
  }, [Struct<{
797
937
  type: "prompt";
798
- content: import("@metamask/snaps-sdk").Panel | {
938
+ content: import("@metamask/snaps-sdk/jsx-runtime").JSXElement | import("@metamask/snaps-sdk").Panel | {
799
939
  value: string;
800
940
  type: import("@metamask/snaps-sdk").NodeType.Copyable;
801
941
  sensitive?: boolean | undefined;
@@ -836,9 +976,9 @@ declare const DialogParametersStruct: Struct<{
836
976
  name: string;
837
977
  value?: string | undefined;
838
978
  error?: string | undefined;
979
+ placeholder?: string | undefined;
839
980
  label?: string | undefined;
840
981
  inputType?: "number" | "text" | "password" | undefined;
841
- placeholder?: string | undefined;
842
982
  } | {
843
983
  value: string;
844
984
  type: import("@metamask/snaps-sdk").NodeType.Button;
@@ -847,15 +987,29 @@ declare const DialogParametersStruct: Struct<{
847
987
  buttonType?: "button" | "submit" | undefined;
848
988
  } | {
849
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
+ */
850
1004
  name: string;
851
1005
  children: ({
852
1006
  type: import("@metamask/snaps-sdk").NodeType.Input;
853
1007
  name: string;
854
1008
  value?: string | undefined;
855
1009
  error?: string | undefined;
1010
+ placeholder?: string | undefined;
856
1011
  label?: string | undefined;
857
1012
  inputType?: "number" | "text" | "password" | undefined;
858
- placeholder?: string | undefined;
859
1013
  } | {
860
1014
  value: string;
861
1015
  type: import("@metamask/snaps-sdk").NodeType.Button;
@@ -867,7 +1021,7 @@ declare const DialogParametersStruct: Struct<{
867
1021
  placeholder?: string | undefined;
868
1022
  }, {
869
1023
  type: Struct<"prompt", null>;
870
- content: Struct<import("@metamask/snaps-sdk").Panel | {
1024
+ content: Struct<import("@metamask/snaps-sdk/jsx-runtime").JSXElement | import("@metamask/snaps-sdk").Panel | {
871
1025
  value: string;
872
1026
  type: import("@metamask/snaps-sdk").NodeType.Copyable;
873
1027
  sensitive?: boolean | undefined;
@@ -908,9 +1062,9 @@ declare const DialogParametersStruct: Struct<{
908
1062
  name: string;
909
1063
  value?: string | undefined;
910
1064
  error?: string | undefined;
1065
+ placeholder?: string | undefined;
911
1066
  label?: string | undefined;
912
1067
  inputType?: "number" | "text" | "password" | undefined;
913
- placeholder?: string | undefined;
914
1068
  } | {
915
1069
  value: string;
916
1070
  type: import("@metamask/snaps-sdk").NodeType.Button;
@@ -919,15 +1073,29 @@ declare const DialogParametersStruct: Struct<{
919
1073
  buttonType?: "button" | "submit" | undefined;
920
1074
  } | {
921
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
+ */
922
1090
  name: string;
923
1091
  children: ({
924
1092
  type: import("@metamask/snaps-sdk").NodeType.Input;
925
1093
  name: string;
926
1094
  value?: string | undefined;
927
1095
  error?: string | undefined;
1096
+ placeholder?: string | undefined;
928
1097
  label?: string | undefined;
929
1098
  inputType?: "number" | "text" | "password" | undefined;
930
- placeholder?: string | undefined;
931
1099
  } | {
932
1100
  value: string;
933
1101
  type: import("@metamask/snaps-sdk").NodeType.Button;
@@ -9,7 +9,7 @@ import type { ManageAccountsMethodHooks } from './manageAccounts';
9
9
  import type { ManageStateMethodHooks } from './manageState';
10
10
  import type { NotifyMethodHooks } from './notify';
11
11
  export { WALLET_SNAP_PERMISSION_KEY } from './invokeSnap';
12
- export { getEncryptionKey } from './manageState';
12
+ export { getEncryptionEntropy } from './manageState';
13
13
  export declare type RestrictedMethodHooks = DialogMethodHooks & GetBip32EntropyMethodHooks & GetBip32PublicKeyMethodHooks & GetBip44EntropyMethodHooks & GetEntropyHooks & InvokeSnapMethodHooks & ManageStateMethodHooks & NotifyMethodHooks & ManageAccountsMethodHooks & GetLocaleMethodHooks;
14
14
  export declare const restrictedMethodPermissionBuilders: {
15
15
  readonly snap_dialog: Readonly<{
@@ -6,8 +6,8 @@ import type { Json, NonEmptyArray } from '@metamask/utils';
6
6
  declare const SnapMessageStruct: import("superstruct").Struct<{
7
7
  method: string;
8
8
  } | {
9
- method: string;
10
9
  params: Record<string, Json> | Json[];
10
+ method: string;
11
11
  }, null>;
12
12
  declare type Message = InferMatching<typeof SnapMessageStruct, ManageAccountsParams>;
13
13
  export declare const methodName = "snap_manageAccounts";