@metamask/snaps-rpc-methods 11.1.0 → 11.2.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.
@@ -1,14 +1,14 @@
1
1
  export declare const methodHandlers: {
2
- wallet_getAllSnaps: import("@metamask/permission-controller").PermittedHandlerExport<import("./getAllSnaps").GetAllSnapsHooks, import("@metamask/utils").JsonRpcParams, import("@metamask/snaps-sdk").GetSnapsResult>;
3
- wallet_getSnaps: import("@metamask/permission-controller").PermittedHandlerExport<import("./getSnaps").GetSnapsHooks, import("@metamask/utils").JsonRpcParams, import("@metamask/snaps-sdk").GetSnapsResult>;
4
- wallet_requestSnaps: import("@metamask/permission-controller").PermittedHandlerExport<import("./requestSnaps").RequestSnapsHooks, import("@metamask/snaps-sdk").RequestSnapsParams, import("@metamask/snaps-sdk").RequestSnapsResult>;
5
- wallet_invokeSnap: import("@metamask/permission-controller").PermittedHandlerExport<import("./invokeSnapSugar").InvokeSnapSugarHooks, import("@metamask/snaps-sdk").InvokeSnapParams, import("@metamask/utils").Json>;
6
- wallet_invokeKeyring: import("@metamask/permission-controller").PermittedHandlerExport<import("./invokeKeyring").InvokeKeyringHooks, import("@metamask/snaps-sdk").InvokeSnapParams, import("@metamask/utils").Json>;
7
- snap_getClientStatus: import("@metamask/permission-controller").PermittedHandlerExport<import("./getClientStatus").GetClientStatusHooks, import("@metamask/utils").JsonRpcParams, import("@metamask/snaps-sdk").GetClientStatusResult>;
8
- snap_getFile: import("@metamask/permission-controller").PermittedHandlerExport<import("./getFile").GetFileHooks, import("@metamask/snaps-sdk").GetFileParams, string>;
9
- snap_createInterface: import("@metamask/permission-controller").PermittedHandlerExport<import("./createInterface").CreateInterfaceMethodHooks, import("@metamask/snaps-sdk").CreateInterfaceParams, string>;
10
- snap_updateInterface: import("@metamask/permission-controller").PermittedHandlerExport<import("./updateInterface").UpdateInterfaceMethodHooks, import("@metamask/snaps-sdk").UpdateInterfaceParams, null>;
11
- snap_getInterfaceState: import("@metamask/permission-controller").PermittedHandlerExport<import("./getInterfaceState").GetInterfaceStateMethodHooks, import("@metamask/snaps-sdk").GetInterfaceStateParams, Record<string, string | boolean | {
2
+ wallet_getAllSnaps: import("@metamask/permission-controller").PermittedHandlerExport<import("./getAllSnaps.cjs").GetAllSnapsHooks, import("@metamask/utils").JsonRpcParams, import("@metamask/snaps-sdk").GetSnapsResult>;
3
+ wallet_getSnaps: import("@metamask/permission-controller").PermittedHandlerExport<import("./getSnaps.cjs").GetSnapsHooks, import("@metamask/utils").JsonRpcParams, import("@metamask/snaps-sdk").GetSnapsResult>;
4
+ wallet_requestSnaps: import("@metamask/permission-controller").PermittedHandlerExport<import("./requestSnaps.cjs").RequestSnapsHooks, import("@metamask/snaps-sdk").RequestSnapsParams, import("@metamask/snaps-sdk").RequestSnapsResult>;
5
+ wallet_invokeSnap: import("@metamask/permission-controller").PermittedHandlerExport<import("./invokeSnapSugar.cjs").InvokeSnapSugarHooks, import("@metamask/snaps-sdk").InvokeSnapParams, import("@metamask/utils").Json>;
6
+ wallet_invokeKeyring: import("@metamask/permission-controller").PermittedHandlerExport<import("./invokeKeyring.cjs").InvokeKeyringHooks, import("@metamask/snaps-sdk").InvokeSnapParams, import("@metamask/utils").Json>;
7
+ snap_getClientStatus: import("@metamask/permission-controller").PermittedHandlerExport<import("./getClientStatus.cjs").GetClientStatusHooks, import("@metamask/utils").JsonRpcParams, import("@metamask/snaps-sdk").GetClientStatusResult>;
8
+ snap_getFile: import("@metamask/permission-controller").PermittedHandlerExport<import("./getFile.cjs").GetFileHooks, import("@metamask/snaps-sdk").GetFileParams, string>;
9
+ snap_createInterface: import("@metamask/permission-controller").PermittedHandlerExport<import("./createInterface.cjs").CreateInterfaceMethodHooks, import("@metamask/snaps-sdk").CreateInterfaceParams, string>;
10
+ snap_updateInterface: import("@metamask/permission-controller").PermittedHandlerExport<import("./updateInterface.cjs").UpdateInterfaceMethodHooks, import("@metamask/snaps-sdk").UpdateInterfaceParams, null>;
11
+ snap_getInterfaceState: import("@metamask/permission-controller").PermittedHandlerExport<import("./getInterfaceState.cjs").GetInterfaceStateMethodHooks, import("@metamask/snaps-sdk").GetInterfaceStateParams, Record<string, string | boolean | {
12
12
  name: string;
13
13
  size: number;
14
14
  contentType: string;
@@ -19,9 +19,9 @@ export declare const methodHandlers: {
19
19
  contentType: string;
20
20
  contents: string;
21
21
  } | null> | null>>;
22
- snap_resolveInterface: import("@metamask/permission-controller").PermittedHandlerExport<import("./resolveInterface").ResolveInterfaceMethodHooks, import("@metamask/snaps-sdk").ResolveInterfaceParams, null>;
22
+ snap_resolveInterface: import("@metamask/permission-controller").PermittedHandlerExport<import("./resolveInterface.cjs").ResolveInterfaceMethodHooks, import("@metamask/snaps-sdk").ResolveInterfaceParams, null>;
23
23
  };
24
- export declare const handlers: (import("@metamask/permission-controller").PermittedHandlerExport<import("./createInterface").CreateInterfaceMethodHooks, import("@metamask/snaps-sdk").CreateInterfaceParams, string> | import("@metamask/permission-controller").PermittedHandlerExport<import("./getAllSnaps").GetAllSnapsHooks, import("@metamask/utils").JsonRpcParams, import("@metamask/snaps-sdk").GetSnapsResult> | import("@metamask/permission-controller").PermittedHandlerExport<import("./getClientStatus").GetClientStatusHooks, import("@metamask/utils").JsonRpcParams, import("@metamask/snaps-sdk").GetClientStatusResult> | import("@metamask/permission-controller").PermittedHandlerExport<import("./getInterfaceState").GetInterfaceStateMethodHooks, import("@metamask/snaps-sdk").GetInterfaceStateParams, Record<string, string | boolean | {
24
+ export declare const handlers: (import("@metamask/permission-controller").PermittedHandlerExport<import("./createInterface.cjs").CreateInterfaceMethodHooks, import("@metamask/snaps-sdk").CreateInterfaceParams, string> | import("@metamask/permission-controller").PermittedHandlerExport<import("./getAllSnaps.cjs").GetAllSnapsHooks, import("@metamask/utils").JsonRpcParams, import("@metamask/snaps-sdk").GetSnapsResult> | import("@metamask/permission-controller").PermittedHandlerExport<import("./getClientStatus.cjs").GetClientStatusHooks, import("@metamask/utils").JsonRpcParams, import("@metamask/snaps-sdk").GetClientStatusResult> | import("@metamask/permission-controller").PermittedHandlerExport<import("./getInterfaceState.cjs").GetInterfaceStateMethodHooks, import("@metamask/snaps-sdk").GetInterfaceStateParams, Record<string, string | boolean | {
25
25
  name: string;
26
26
  size: number;
27
27
  contentType: string;
@@ -31,5 +31,5 @@ export declare const handlers: (import("@metamask/permission-controller").Permit
31
31
  size: number;
32
32
  contentType: string;
33
33
  contents: string;
34
- } | null> | null>> | import("@metamask/permission-controller").PermittedHandlerExport<import("./getSnaps").GetSnapsHooks, import("@metamask/utils").JsonRpcParams, import("@metamask/snaps-sdk").GetSnapsResult> | import("@metamask/permission-controller").PermittedHandlerExport<import("./requestSnaps").RequestSnapsHooks, import("@metamask/snaps-sdk").RequestSnapsParams, import("@metamask/snaps-sdk").RequestSnapsResult> | import("@metamask/permission-controller").PermittedHandlerExport<import("./resolveInterface").ResolveInterfaceMethodHooks, import("@metamask/snaps-sdk").ResolveInterfaceParams, null> | import("@metamask/permission-controller").PermittedHandlerExport<import("./updateInterface").UpdateInterfaceMethodHooks, import("@metamask/snaps-sdk").UpdateInterfaceParams, null> | import("@metamask/permission-controller").PermittedHandlerExport<import("./getFile").GetFileHooks, import("@metamask/snaps-sdk").GetFileParams, string> | import("@metamask/permission-controller").PermittedHandlerExport<import("./invokeSnapSugar").InvokeSnapSugarHooks, import("@metamask/snaps-sdk").InvokeSnapParams, import("@metamask/utils").Json> | import("@metamask/permission-controller").PermittedHandlerExport<import("./invokeKeyring").InvokeKeyringHooks, import("@metamask/snaps-sdk").InvokeSnapParams, import("@metamask/utils").Json>)[];
34
+ } | null> | null>> | import("@metamask/permission-controller").PermittedHandlerExport<import("./getSnaps.cjs").GetSnapsHooks, import("@metamask/utils").JsonRpcParams, import("@metamask/snaps-sdk").GetSnapsResult> | import("@metamask/permission-controller").PermittedHandlerExport<import("./requestSnaps.cjs").RequestSnapsHooks, import("@metamask/snaps-sdk").RequestSnapsParams, import("@metamask/snaps-sdk").RequestSnapsResult> | import("@metamask/permission-controller").PermittedHandlerExport<import("./resolveInterface.cjs").ResolveInterfaceMethodHooks, import("@metamask/snaps-sdk").ResolveInterfaceParams, null> | import("@metamask/permission-controller").PermittedHandlerExport<import("./updateInterface.cjs").UpdateInterfaceMethodHooks, import("@metamask/snaps-sdk").UpdateInterfaceParams, null> | import("@metamask/permission-controller").PermittedHandlerExport<import("./getFile.cjs").GetFileHooks, import("@metamask/snaps-sdk").GetFileParams, string> | import("@metamask/permission-controller").PermittedHandlerExport<import("./invokeSnapSugar.cjs").InvokeSnapSugarHooks, import("@metamask/snaps-sdk").InvokeSnapParams, import("@metamask/utils").Json> | import("@metamask/permission-controller").PermittedHandlerExport<import("./invokeKeyring.cjs").InvokeKeyringHooks, import("@metamask/snaps-sdk").InvokeSnapParams, import("@metamask/utils").Json>)[];
35
35
  //# sourceMappingURL=handlers.d.cts.map
@@ -1,14 +1,14 @@
1
1
  export declare const methodHandlers: {
2
- wallet_getAllSnaps: import("@metamask/permission-controller").PermittedHandlerExport<import("./getAllSnaps").GetAllSnapsHooks, import("@metamask/utils").JsonRpcParams, import("@metamask/snaps-sdk").GetSnapsResult>;
3
- wallet_getSnaps: import("@metamask/permission-controller").PermittedHandlerExport<import("./getSnaps").GetSnapsHooks, import("@metamask/utils").JsonRpcParams, import("@metamask/snaps-sdk").GetSnapsResult>;
4
- wallet_requestSnaps: import("@metamask/permission-controller").PermittedHandlerExport<import("./requestSnaps").RequestSnapsHooks, import("@metamask/snaps-sdk").RequestSnapsParams, import("@metamask/snaps-sdk").RequestSnapsResult>;
5
- wallet_invokeSnap: import("@metamask/permission-controller").PermittedHandlerExport<import("./invokeSnapSugar").InvokeSnapSugarHooks, import("@metamask/snaps-sdk").InvokeSnapParams, import("@metamask/utils").Json>;
6
- wallet_invokeKeyring: import("@metamask/permission-controller").PermittedHandlerExport<import("./invokeKeyring").InvokeKeyringHooks, import("@metamask/snaps-sdk").InvokeSnapParams, import("@metamask/utils").Json>;
7
- snap_getClientStatus: import("@metamask/permission-controller").PermittedHandlerExport<import("./getClientStatus").GetClientStatusHooks, import("@metamask/utils").JsonRpcParams, import("@metamask/snaps-sdk").GetClientStatusResult>;
8
- snap_getFile: import("@metamask/permission-controller").PermittedHandlerExport<import("./getFile").GetFileHooks, import("@metamask/snaps-sdk").GetFileParams, string>;
9
- snap_createInterface: import("@metamask/permission-controller").PermittedHandlerExport<import("./createInterface").CreateInterfaceMethodHooks, import("@metamask/snaps-sdk").CreateInterfaceParams, string>;
10
- snap_updateInterface: import("@metamask/permission-controller").PermittedHandlerExport<import("./updateInterface").UpdateInterfaceMethodHooks, import("@metamask/snaps-sdk").UpdateInterfaceParams, null>;
11
- snap_getInterfaceState: import("@metamask/permission-controller").PermittedHandlerExport<import("./getInterfaceState").GetInterfaceStateMethodHooks, import("@metamask/snaps-sdk").GetInterfaceStateParams, Record<string, string | boolean | {
2
+ wallet_getAllSnaps: import("@metamask/permission-controller").PermittedHandlerExport<import("./getAllSnaps.mjs").GetAllSnapsHooks, import("@metamask/utils").JsonRpcParams, import("@metamask/snaps-sdk").GetSnapsResult>;
3
+ wallet_getSnaps: import("@metamask/permission-controller").PermittedHandlerExport<import("./getSnaps.mjs").GetSnapsHooks, import("@metamask/utils").JsonRpcParams, import("@metamask/snaps-sdk").GetSnapsResult>;
4
+ wallet_requestSnaps: import("@metamask/permission-controller").PermittedHandlerExport<import("./requestSnaps.mjs").RequestSnapsHooks, import("@metamask/snaps-sdk").RequestSnapsParams, import("@metamask/snaps-sdk").RequestSnapsResult>;
5
+ wallet_invokeSnap: import("@metamask/permission-controller").PermittedHandlerExport<import("./invokeSnapSugar.mjs").InvokeSnapSugarHooks, import("@metamask/snaps-sdk").InvokeSnapParams, import("@metamask/utils").Json>;
6
+ wallet_invokeKeyring: import("@metamask/permission-controller").PermittedHandlerExport<import("./invokeKeyring.mjs").InvokeKeyringHooks, import("@metamask/snaps-sdk").InvokeSnapParams, import("@metamask/utils").Json>;
7
+ snap_getClientStatus: import("@metamask/permission-controller").PermittedHandlerExport<import("./getClientStatus.mjs").GetClientStatusHooks, import("@metamask/utils").JsonRpcParams, import("@metamask/snaps-sdk").GetClientStatusResult>;
8
+ snap_getFile: import("@metamask/permission-controller").PermittedHandlerExport<import("./getFile.mjs").GetFileHooks, import("@metamask/snaps-sdk").GetFileParams, string>;
9
+ snap_createInterface: import("@metamask/permission-controller").PermittedHandlerExport<import("./createInterface.mjs").CreateInterfaceMethodHooks, import("@metamask/snaps-sdk").CreateInterfaceParams, string>;
10
+ snap_updateInterface: import("@metamask/permission-controller").PermittedHandlerExport<import("./updateInterface.mjs").UpdateInterfaceMethodHooks, import("@metamask/snaps-sdk").UpdateInterfaceParams, null>;
11
+ snap_getInterfaceState: import("@metamask/permission-controller").PermittedHandlerExport<import("./getInterfaceState.mjs").GetInterfaceStateMethodHooks, import("@metamask/snaps-sdk").GetInterfaceStateParams, Record<string, string | boolean | {
12
12
  name: string;
13
13
  size: number;
14
14
  contentType: string;
@@ -19,9 +19,9 @@ export declare const methodHandlers: {
19
19
  contentType: string;
20
20
  contents: string;
21
21
  } | null> | null>>;
22
- snap_resolveInterface: import("@metamask/permission-controller").PermittedHandlerExport<import("./resolveInterface").ResolveInterfaceMethodHooks, import("@metamask/snaps-sdk").ResolveInterfaceParams, null>;
22
+ snap_resolveInterface: import("@metamask/permission-controller").PermittedHandlerExport<import("./resolveInterface.mjs").ResolveInterfaceMethodHooks, import("@metamask/snaps-sdk").ResolveInterfaceParams, null>;
23
23
  };
24
- export declare const handlers: (import("@metamask/permission-controller").PermittedHandlerExport<import("./createInterface").CreateInterfaceMethodHooks, import("@metamask/snaps-sdk").CreateInterfaceParams, string> | import("@metamask/permission-controller").PermittedHandlerExport<import("./getAllSnaps").GetAllSnapsHooks, import("@metamask/utils").JsonRpcParams, import("@metamask/snaps-sdk").GetSnapsResult> | import("@metamask/permission-controller").PermittedHandlerExport<import("./getClientStatus").GetClientStatusHooks, import("@metamask/utils").JsonRpcParams, import("@metamask/snaps-sdk").GetClientStatusResult> | import("@metamask/permission-controller").PermittedHandlerExport<import("./getInterfaceState").GetInterfaceStateMethodHooks, import("@metamask/snaps-sdk").GetInterfaceStateParams, Record<string, string | boolean | {
24
+ export declare const handlers: (import("@metamask/permission-controller").PermittedHandlerExport<import("./createInterface.mjs").CreateInterfaceMethodHooks, import("@metamask/snaps-sdk").CreateInterfaceParams, string> | import("@metamask/permission-controller").PermittedHandlerExport<import("./getAllSnaps.mjs").GetAllSnapsHooks, import("@metamask/utils").JsonRpcParams, import("@metamask/snaps-sdk").GetSnapsResult> | import("@metamask/permission-controller").PermittedHandlerExport<import("./getClientStatus.mjs").GetClientStatusHooks, import("@metamask/utils").JsonRpcParams, import("@metamask/snaps-sdk").GetClientStatusResult> | import("@metamask/permission-controller").PermittedHandlerExport<import("./getInterfaceState.mjs").GetInterfaceStateMethodHooks, import("@metamask/snaps-sdk").GetInterfaceStateParams, Record<string, string | boolean | {
25
25
  name: string;
26
26
  size: number;
27
27
  contentType: string;
@@ -31,5 +31,5 @@ export declare const handlers: (import("@metamask/permission-controller").Permit
31
31
  size: number;
32
32
  contentType: string;
33
33
  contents: string;
34
- } | null> | null>> | import("@metamask/permission-controller").PermittedHandlerExport<import("./getSnaps").GetSnapsHooks, import("@metamask/utils").JsonRpcParams, import("@metamask/snaps-sdk").GetSnapsResult> | import("@metamask/permission-controller").PermittedHandlerExport<import("./requestSnaps").RequestSnapsHooks, import("@metamask/snaps-sdk").RequestSnapsParams, import("@metamask/snaps-sdk").RequestSnapsResult> | import("@metamask/permission-controller").PermittedHandlerExport<import("./resolveInterface").ResolveInterfaceMethodHooks, import("@metamask/snaps-sdk").ResolveInterfaceParams, null> | import("@metamask/permission-controller").PermittedHandlerExport<import("./updateInterface").UpdateInterfaceMethodHooks, import("@metamask/snaps-sdk").UpdateInterfaceParams, null> | import("@metamask/permission-controller").PermittedHandlerExport<import("./getFile").GetFileHooks, import("@metamask/snaps-sdk").GetFileParams, string> | import("@metamask/permission-controller").PermittedHandlerExport<import("./invokeSnapSugar").InvokeSnapSugarHooks, import("@metamask/snaps-sdk").InvokeSnapParams, import("@metamask/utils").Json> | import("@metamask/permission-controller").PermittedHandlerExport<import("./invokeKeyring").InvokeKeyringHooks, import("@metamask/snaps-sdk").InvokeSnapParams, import("@metamask/utils").Json>)[];
34
+ } | null> | null>> | import("@metamask/permission-controller").PermittedHandlerExport<import("./getSnaps.mjs").GetSnapsHooks, import("@metamask/utils").JsonRpcParams, import("@metamask/snaps-sdk").GetSnapsResult> | import("@metamask/permission-controller").PermittedHandlerExport<import("./requestSnaps.mjs").RequestSnapsHooks, import("@metamask/snaps-sdk").RequestSnapsParams, import("@metamask/snaps-sdk").RequestSnapsResult> | import("@metamask/permission-controller").PermittedHandlerExport<import("./resolveInterface.mjs").ResolveInterfaceMethodHooks, import("@metamask/snaps-sdk").ResolveInterfaceParams, null> | import("@metamask/permission-controller").PermittedHandlerExport<import("./updateInterface.mjs").UpdateInterfaceMethodHooks, import("@metamask/snaps-sdk").UpdateInterfaceParams, null> | import("@metamask/permission-controller").PermittedHandlerExport<import("./getFile.mjs").GetFileHooks, import("@metamask/snaps-sdk").GetFileParams, string> | import("@metamask/permission-controller").PermittedHandlerExport<import("./invokeSnapSugar.mjs").InvokeSnapSugarHooks, import("@metamask/snaps-sdk").InvokeSnapParams, import("@metamask/utils").Json> | import("@metamask/permission-controller").PermittedHandlerExport<import("./invokeKeyring.mjs").InvokeKeyringHooks, import("@metamask/snaps-sdk").InvokeSnapParams, import("@metamask/utils").Json>)[];
35
35
  //# sourceMappingURL=handlers.d.mts.map
@@ -128,6 +128,20 @@ declare const DialogParametersStruct: import("@metamask/superstruct").Struct<{
128
128
  } | {
129
129
  type: import("@metamask/snaps-sdk").NodeType.Form;
130
130
  name: string;
131
+ /**
132
+ * The specification builder for the `snap_dialog` permission. `snap_dialog`
133
+ * lets the Snap display one of the following dialogs to the user:
134
+ * - An alert, for displaying information.
135
+ * - A confirmation, for accepting or rejecting some action.
136
+ * - A prompt, for inputting some information.
137
+ *
138
+ * @param options - The specification builder options.
139
+ * @param options.allowedCaveats - The optional allowed caveats for the
140
+ * permission.
141
+ * @param options.methodHooks - The RPC method hooks needed by the method
142
+ * implementation.
143
+ * @returns The specification for the `snap_dialog` permission.
144
+ */
131
145
  children: ({
132
146
  type: import("@metamask/snaps-sdk").NodeType.Input;
133
147
  name: string;
@@ -214,6 +228,20 @@ declare const DialogParametersStruct: import("@metamask/superstruct").Struct<{
214
228
  } | {
215
229
  type: import("@metamask/snaps-sdk").NodeType.Form;
216
230
  name: string;
231
+ /**
232
+ * The specification builder for the `snap_dialog` permission. `snap_dialog`
233
+ * lets the Snap display one of the following dialogs to the user:
234
+ * - An alert, for displaying information.
235
+ * - A confirmation, for accepting or rejecting some action.
236
+ * - A prompt, for inputting some information.
237
+ *
238
+ * @param options - The specification builder options.
239
+ * @param options.allowedCaveats - The optional allowed caveats for the
240
+ * permission.
241
+ * @param options.methodHooks - The RPC method hooks needed by the method
242
+ * implementation.
243
+ * @returns The specification for the `snap_dialog` permission.
244
+ */
217
245
  children: ({
218
246
  type: import("@metamask/snaps-sdk").NodeType.Input;
219
247
  name: string;
@@ -301,6 +329,20 @@ declare const DialogParametersStruct: import("@metamask/superstruct").Struct<{
301
329
  } | {
302
330
  type: import("@metamask/snaps-sdk").NodeType.Form;
303
331
  name: string;
332
+ /**
333
+ * The specification builder for the `snap_dialog` permission. `snap_dialog`
334
+ * lets the Snap display one of the following dialogs to the user:
335
+ * - An alert, for displaying information.
336
+ * - A confirmation, for accepting or rejecting some action.
337
+ * - A prompt, for inputting some information.
338
+ *
339
+ * @param options - The specification builder options.
340
+ * @param options.allowedCaveats - The optional allowed caveats for the
341
+ * permission.
342
+ * @param options.methodHooks - The RPC method hooks needed by the method
343
+ * implementation.
344
+ * @returns The specification for the `snap_dialog` permission.
345
+ */
304
346
  children: ({
305
347
  type: import("@metamask/snaps-sdk").NodeType.Input;
306
348
  name: string;
@@ -386,6 +428,20 @@ declare const DialogParametersStruct: import("@metamask/superstruct").Struct<{
386
428
  } | {
387
429
  type: import("@metamask/snaps-sdk").NodeType.Form;
388
430
  name: string;
431
+ /**
432
+ * The specification builder for the `snap_dialog` permission. `snap_dialog`
433
+ * lets the Snap display one of the following dialogs to the user:
434
+ * - An alert, for displaying information.
435
+ * - A confirmation, for accepting or rejecting some action.
436
+ * - A prompt, for inputting some information.
437
+ *
438
+ * @param options - The specification builder options.
439
+ * @param options.allowedCaveats - The optional allowed caveats for the
440
+ * permission.
441
+ * @param options.methodHooks - The RPC method hooks needed by the method
442
+ * implementation.
443
+ * @returns The specification for the `snap_dialog` permission.
444
+ */
389
445
  children: ({
390
446
  type: import("@metamask/snaps-sdk").NodeType.Input;
391
447
  name: string;
@@ -1 +1 @@
1
- {"version":3,"file":"dialog.d.cts","sourceRoot":"","sources":["../../src/restricted/dialog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,8BAA8B,EAC9B,uBAAuB,EAExB,wCAAwC;AACzC,OAAO,EAAE,cAAc,EAAe,wCAAwC;AAE9E,OAAO,EACL,UAAU,EAIX,4BAA4B;AAC7B,OAAO,KAAK,EACV,YAAY,EAEZ,cAAc,EACd,MAAM,EAEN,kBAAkB,EACnB,4BAA4B;AAC7B,OAAO,KAAK,EAAE,aAAa,EAAE,8BAA8B;AAC3D,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAEnD,OAAO,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,wBAAwB;AAG3D,OAAO,EAAE,KAAK,iBAAiB,EAAE,qBAAiB;AAElD,QAAA,MAAM,UAAU,gBAAgB,CAAC;AAEjC,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,GAAG;IAC7D,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;;CAKjC,CAAC;AAEF,QAAA,MAAM,iBAAiB,kEAAkC,CAAC;AAE1D,MAAM,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IAAI,CAAC;IACxD,WAAW,EAAE,iBAAiB,CAAC;CAChC,CAAC;AA8CF,eAAO,MAAM,aAAa;;;wBA3CR,eAAe,gBAAgB;oBACnC,iBAAiB;8BACP,WAAW,8BAA8B,CAAC;wBAChD,SAAS,cAAc,MAAM,CAAC,CAAC,GAAG,IAAI;;;EA4C7C,CAAC;AAsEZ,QAAA,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA/G5B;;;;;;;;;;;;;WAaG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAbH;;;;;;;;;;;;;WAaG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAbH;;;;;;;;;;;;;WAaG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAbH;;;;;;;;;;;;;WAaG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAqHD,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,aAAa,CAC1C,OAAO,sBAAsB,EAC7B,YAAY,CACb,CAAC;AAEF;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,mBAAmB,EACnB,eAAe,EACf,YAAY,GACb,EAAE,iBAAiB,UAEV,wBAAwB,gBAAgB,CAAC,KAC9C,QAAQ,OAAO,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAAC,CAoD3C"}
@@ -128,6 +128,20 @@ declare const DialogParametersStruct: import("@metamask/superstruct").Struct<{
128
128
  } | {
129
129
  type: import("@metamask/snaps-sdk").NodeType.Form;
130
130
  name: string;
131
+ /**
132
+ * The specification builder for the `snap_dialog` permission. `snap_dialog`
133
+ * lets the Snap display one of the following dialogs to the user:
134
+ * - An alert, for displaying information.
135
+ * - A confirmation, for accepting or rejecting some action.
136
+ * - A prompt, for inputting some information.
137
+ *
138
+ * @param options - The specification builder options.
139
+ * @param options.allowedCaveats - The optional allowed caveats for the
140
+ * permission.
141
+ * @param options.methodHooks - The RPC method hooks needed by the method
142
+ * implementation.
143
+ * @returns The specification for the `snap_dialog` permission.
144
+ */
131
145
  children: ({
132
146
  type: import("@metamask/snaps-sdk").NodeType.Input;
133
147
  name: string;
@@ -214,6 +228,20 @@ declare const DialogParametersStruct: import("@metamask/superstruct").Struct<{
214
228
  } | {
215
229
  type: import("@metamask/snaps-sdk").NodeType.Form;
216
230
  name: string;
231
+ /**
232
+ * The specification builder for the `snap_dialog` permission. `snap_dialog`
233
+ * lets the Snap display one of the following dialogs to the user:
234
+ * - An alert, for displaying information.
235
+ * - A confirmation, for accepting or rejecting some action.
236
+ * - A prompt, for inputting some information.
237
+ *
238
+ * @param options - The specification builder options.
239
+ * @param options.allowedCaveats - The optional allowed caveats for the
240
+ * permission.
241
+ * @param options.methodHooks - The RPC method hooks needed by the method
242
+ * implementation.
243
+ * @returns The specification for the `snap_dialog` permission.
244
+ */
217
245
  children: ({
218
246
  type: import("@metamask/snaps-sdk").NodeType.Input;
219
247
  name: string;
@@ -301,6 +329,20 @@ declare const DialogParametersStruct: import("@metamask/superstruct").Struct<{
301
329
  } | {
302
330
  type: import("@metamask/snaps-sdk").NodeType.Form;
303
331
  name: string;
332
+ /**
333
+ * The specification builder for the `snap_dialog` permission. `snap_dialog`
334
+ * lets the Snap display one of the following dialogs to the user:
335
+ * - An alert, for displaying information.
336
+ * - A confirmation, for accepting or rejecting some action.
337
+ * - A prompt, for inputting some information.
338
+ *
339
+ * @param options - The specification builder options.
340
+ * @param options.allowedCaveats - The optional allowed caveats for the
341
+ * permission.
342
+ * @param options.methodHooks - The RPC method hooks needed by the method
343
+ * implementation.
344
+ * @returns The specification for the `snap_dialog` permission.
345
+ */
304
346
  children: ({
305
347
  type: import("@metamask/snaps-sdk").NodeType.Input;
306
348
  name: string;
@@ -386,6 +428,20 @@ declare const DialogParametersStruct: import("@metamask/superstruct").Struct<{
386
428
  } | {
387
429
  type: import("@metamask/snaps-sdk").NodeType.Form;
388
430
  name: string;
431
+ /**
432
+ * The specification builder for the `snap_dialog` permission. `snap_dialog`
433
+ * lets the Snap display one of the following dialogs to the user:
434
+ * - An alert, for displaying information.
435
+ * - A confirmation, for accepting or rejecting some action.
436
+ * - A prompt, for inputting some information.
437
+ *
438
+ * @param options - The specification builder options.
439
+ * @param options.allowedCaveats - The optional allowed caveats for the
440
+ * permission.
441
+ * @param options.methodHooks - The RPC method hooks needed by the method
442
+ * implementation.
443
+ * @returns The specification for the `snap_dialog` permission.
444
+ */
389
445
  children: ({
390
446
  type: import("@metamask/snaps-sdk").NodeType.Input;
391
447
  name: string;
@@ -1 +1 @@
1
- {"version":3,"file":"dialog.d.mts","sourceRoot":"","sources":["../../src/restricted/dialog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,8BAA8B,EAC9B,uBAAuB,EAExB,wCAAwC;AACzC,OAAO,EAAE,cAAc,EAAe,wCAAwC;AAE9E,OAAO,EACL,UAAU,EAIX,4BAA4B;AAC7B,OAAO,KAAK,EACV,YAAY,EAEZ,cAAc,EACd,MAAM,EAEN,kBAAkB,EACnB,4BAA4B;AAC7B,OAAO,KAAK,EAAE,aAAa,EAAE,8BAA8B;AAC3D,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAEnD,OAAO,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,wBAAwB;AAG3D,OAAO,EAAE,KAAK,iBAAiB,EAAE,qBAAiB;AAElD,QAAA,MAAM,UAAU,gBAAgB,CAAC;AAEjC,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,GAAG;IAC7D,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,eAAO,MA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controller").RestrictedMethodOptions<import("@metamask/snaps-sdk").DialogParams>) => Promise<import("@metamask/utils").Json>;
25
25
  allowedCaveats: readonly [string, ...string[]] | null;
26
26
  }>;
27
- readonly methodHooks: import("../utils").MethodHooksObject<DialogMethodHooks>;
27
+ readonly methodHooks: import("../utils.cjs").MethodHooksObject<DialogMethodHooks>;
28
28
  }>;
29
29
  readonly snap_getBip32Entropy: Readonly<{
30
30
  readonly targetName: "snap_getBip32Entropy";
@@ -37,7 +37,7 @@ export declare const restrictedMethodPermissionBuilders: {
37
37
  allowedCaveats: readonly [string, ...string[]] | null;
38
38
  validator: import("@metamask/permission-controller").PermissionValidatorConstraint;
39
39
  }>;
40
- readonly methodHooks: import("../utils").MethodHooksObject<GetBip32EntropyMethodHooks>;
40
+ readonly methodHooks: import("../utils.cjs").MethodHooksObject<GetBip32EntropyMethodHooks>;
41
41
  }>;
42
42
  readonly snap_getBip32PublicKey: Readonly<{
43
43
  readonly targetName: "snap_getBip32PublicKey";
@@ -50,7 +50,7 @@ export declare const restrictedMethodPermissionBuilders: {
50
50
  allowedCaveats: readonly [string, ...string[]] | null;
51
51
  validator: import("@metamask/permission-controller").PermissionValidatorConstraint;
52
52
  }>;
53
- readonly methodHooks: import("../utils").MethodHooksObject<GetBip32PublicKeyMethodHooks>;
53
+ readonly methodHooks: import("../utils.cjs").MethodHooksObject<GetBip32PublicKeyMethodHooks>;
54
54
  }>;
55
55
  readonly snap_getBip44Entropy: Readonly<{
56
56
  readonly targetName: "snap_getBip44Entropy";
@@ -63,7 +63,7 @@ export declare const restrictedMethodPermissionBuilders: {
63
63
  allowedCaveats: readonly [string, ...string[]] | null;
64
64
  validator: import("@metamask/permission-controller").PermissionValidatorConstraint;
65
65
  }>;
66
- readonly methodHooks: import("../utils").MethodHooksObject<GetBip44EntropyMethodHooks>;
66
+ readonly methodHooks: import("../utils.cjs").MethodHooksObject<GetBip44EntropyMethodHooks>;
67
67
  }>;
68
68
  readonly snap_getEntropy: Readonly<{
69
69
  readonly targetName: "snap_getEntropy";
@@ -76,7 +76,7 @@ export declare const restrictedMethodPermissionBuilders: {
76
76
  methodImplementation: (options: import("@metamask/permission-controller").RestrictedMethodOptions<import("@metamask/snaps-sdk").GetEntropyParams>) => Promise<`0x${string}`>;
77
77
  allowedCaveats: readonly [string, ...string[]] | null;
78
78
  }>;
79
- readonly methodHooks: import("../utils").MethodHooksObject<GetEntropyHooks>;
79
+ readonly methodHooks: import("../utils.cjs").MethodHooksObject<GetEntropyHooks>;
80
80
  }>;
81
81
  readonly wallet_snap: Readonly<{
82
82
  readonly targetName: "wallet_snap";
@@ -86,14 +86,14 @@ export declare const restrictedMethodPermissionBuilders: {
86
86
  }, {
87
87
  permissionType: import("@metamask/permission-controller").PermissionType.RestrictedMethod;
88
88
  targetName: "wallet_snap";
89
- methodImplementation: (options: import("@metamask/permission-controller").RestrictedMethodOptions<import("./invokeSnap").InvokeSnapParams>) => Promise<import("@metamask/utils").Json>;
89
+ methodImplementation: (options: import("@metamask/permission-controller").RestrictedMethodOptions<import("./invokeSnap.cjs").InvokeSnapParams>) => Promise<import("@metamask/utils").Json>;
90
90
  allowedCaveats: readonly [string, ...string[]] | null;
91
91
  validator: import("@metamask/permission-controller").PermissionValidatorConstraint;
92
92
  sideEffect: {
93
- onPermitted: import("@metamask/permission-controller").SideEffectHandler<import("./invokeSnap").InstallSnaps | import("./invokeSnap").GetPermittedSnaps, never>;
93
+ onPermitted: import("@metamask/permission-controller").SideEffectHandler<import("./invokeSnap.cjs").InstallSnaps | import("./invokeSnap.cjs").GetPermittedSnaps, never>;
94
94
  };
95
95
  }>;
96
- readonly methodHooks: import("../utils").MethodHooksObject<InvokeSnapMethodHooks>;
96
+ readonly methodHooks: import("../utils.cjs").MethodHooksObject<InvokeSnapMethodHooks>;
97
97
  }>;
98
98
  readonly snap_manageState: Readonly<{
99
99
  readonly targetName: "snap_manageState";
@@ -106,7 +106,7 @@ export declare const restrictedMethodPermissionBuilders: {
106
106
  methodImplementation: (options: import("@metamask/permission-controller").RestrictedMethodOptions<import("@metamask/snaps-sdk").ManageStateParams>) => Promise<import("@metamask/snaps-sdk").ManageStateResult>;
107
107
  allowedCaveats: readonly [string, ...string[]] | null;
108
108
  }>;
109
- readonly methodHooks: import("../utils").MethodHooksObject<ManageStateMethodHooks>;
109
+ readonly methodHooks: import("../utils.cjs").MethodHooksObject<ManageStateMethodHooks>;
110
110
  }>;
111
111
  readonly snap_notify: Readonly<{
112
112
  readonly targetName: "snap_notify";
@@ -119,7 +119,7 @@ export declare const restrictedMethodPermissionBuilders: {
119
119
  methodImplementation: (args: import("@metamask/permission-controller").RestrictedMethodOptions<import("@metamask/snaps-sdk").NotifyParams>) => Promise<null>;
120
120
  allowedCaveats: readonly [string, ...string[]] | null;
121
121
  }>;
122
- readonly methodHooks: import("../utils").MethodHooksObject<NotifyMethodHooks>;
122
+ readonly methodHooks: import("../utils.cjs").MethodHooksObject<NotifyMethodHooks>;
123
123
  }>;
124
124
  readonly snap_manageAccounts: Readonly<{
125
125
  readonly targetName: "snap_manageAccounts";
@@ -147,7 +147,7 @@ export declare const restrictedMethodPermissionBuilders: {
147
147
  methodImplementation: (_args: import("@metamask/permission-controller").RestrictedMethodOptions<import("@metamask/permission-controller").RestrictedMethodParameters>) => Promise<string>;
148
148
  allowedCaveats: readonly [string, ...string[]] | null;
149
149
  }>;
150
- readonly methodHooks: import("../utils").MethodHooksObject<GetLocaleMethodHooks>;
150
+ readonly methodHooks: import("../utils.cjs").MethodHooksObject<GetLocaleMethodHooks>;
151
151
  }>;
152
152
  readonly snap_getPreferences: Readonly<{
153
153
  readonly targetName: "snap_getPreferences";
@@ -160,7 +160,7 @@ export declare const restrictedMethodPermissionBuilders: {
160
160
  methodImplementation: (_args: import("@metamask/permission-controller").RestrictedMethodOptions<import("@metamask/permission-controller").RestrictedMethodParameters>) => Promise<import("@metamask/snaps-sdk").GetPreferencesResult>;
161
161
  allowedCaveats: readonly [string, ...string[]] | null;
162
162
  }>;
163
- readonly methodHooks: import("../utils").MethodHooksObject<GetPreferencesMethodHooks>;
163
+ readonly methodHooks: import("../utils.cjs").MethodHooksObject<GetPreferencesMethodHooks>;
164
164
  }>;
165
165
  };
166
166
  export * from "./caveats/index.cjs";
@@ -24,7 +24,7 @@ export declare const restrictedMethodPermissionBuilders: {
24
24
  methodImplementation: (args: import("@metamask/permission-controller").RestrictedMethodOptions<import("@metamask/snaps-sdk").DialogParams>) => Promise<import("@metamask/utils").Json>;
25
25
  allowedCaveats: readonly [string, ...string[]] | null;
26
26
  }>;
27
- readonly methodHooks: import("../utils").MethodHooksObject<DialogMethodHooks>;
27
+ readonly methodHooks: import("../utils.mjs").MethodHooksObject<DialogMethodHooks>;
28
28
  }>;
29
29
  readonly snap_getBip32Entropy: Readonly<{
30
30
  readonly targetName: "snap_getBip32Entropy";
@@ -37,7 +37,7 @@ export declare const restrictedMethodPermissionBuilders: {
37
37
  allowedCaveats: readonly [string, ...string[]] | null;
38
38
  validator: import("@metamask/permission-controller").PermissionValidatorConstraint;
39
39
  }>;
40
- readonly methodHooks: import("../utils").MethodHooksObject<GetBip32EntropyMethodHooks>;
40
+ readonly methodHooks: import("../utils.mjs").MethodHooksObject<GetBip32EntropyMethodHooks>;
41
41
  }>;
42
42
  readonly snap_getBip32PublicKey: Readonly<{
43
43
  readonly targetName: "snap_getBip32PublicKey";
@@ -50,7 +50,7 @@ export declare const restrictedMethodPermissionBuilders: {
50
50
  allowedCaveats: readonly [string, ...string[]] | null;
51
51
  validator: import("@metamask/permission-controller").PermissionValidatorConstraint;
52
52
  }>;
53
- readonly methodHooks: import("../utils").MethodHooksObject<GetBip32PublicKeyMethodHooks>;
53
+ readonly methodHooks: import("../utils.mjs").MethodHooksObject<GetBip32PublicKeyMethodHooks>;
54
54
  }>;
55
55
  readonly snap_getBip44Entropy: Readonly<{
56
56
  readonly targetName: "snap_getBip44Entropy";
@@ -63,7 +63,7 @@ export declare const restrictedMethodPermissionBuilders: {
63
63
  allowedCaveats: readonly [string, ...string[]] | null;
64
64
  validator: import("@metamask/permission-controller").PermissionValidatorConstraint;
65
65
  }>;
66
- readonly methodHooks: import("../utils").MethodHooksObject<GetBip44EntropyMethodHooks>;
66
+ readonly methodHooks: import("../utils.mjs").MethodHooksObject<GetBip44EntropyMethodHooks>;
67
67
  }>;
68
68
  readonly snap_getEntropy: Readonly<{
69
69
  readonly targetName: "snap_getEntropy";
@@ -76,7 +76,7 @@ export declare const restrictedMethodPermissionBuilders: {
76
76
  methodImplementation: (options: import("@metamask/permission-controller").RestrictedMethodOptions<import("@metamask/snaps-sdk").GetEntropyParams>) => Promise<`0x${string}`>;
77
77
  allowedCaveats: readonly [string, ...string[]] | null;
78
78
  }>;
79
- readonly methodHooks: import("../utils").MethodHooksObject<GetEntropyHooks>;
79
+ readonly methodHooks: import("../utils.mjs").MethodHooksObject<GetEntropyHooks>;
80
80
  }>;
81
81
  readonly wallet_snap: Readonly<{
82
82
  readonly targetName: "wallet_snap";
@@ -86,14 +86,14 @@ export declare const restrictedMethodPermissionBuilders: {
86
86
  }, {
87
87
  permissionType: import("@metamask/permission-controller").PermissionType.RestrictedMethod;
88
88
  targetName: "wallet_snap";
89
- methodImplementation: (options: import("@metamask/permission-controller").RestrictedMethodOptions<import("./invokeSnap").InvokeSnapParams>) => Promise<import("@metamask/utils").Json>;
89
+ methodImplementation: (options: import("@metamask/permission-controller").RestrictedMethodOptions<import("./invokeSnap.mjs").InvokeSnapParams>) => Promise<import("@metamask/utils").Json>;
90
90
  allowedCaveats: readonly [string, ...string[]] | null;
91
91
  validator: import("@metamask/permission-controller").PermissionValidatorConstraint;
92
92
  sideEffect: {
93
- onPermitted: import("@metamask/permission-controller").SideEffectHandler<import("./invokeSnap").InstallSnaps | import("./invokeSnap").GetPermittedSnaps, never>;
93
+ onPermitted: import("@metamask/permission-controller").SideEffectHandler<import("./invokeSnap.mjs").InstallSnaps | import("./invokeSnap.mjs").GetPermittedSnaps, never>;
94
94
  };
95
95
  }>;
96
- readonly methodHooks: import("../utils").MethodHooksObject<InvokeSnapMethodHooks>;
96
+ readonly methodHooks: import("../utils.mjs").MethodHooksObject<InvokeSnapMethodHooks>;
97
97
  }>;
98
98
  readonly snap_manageState: Readonly<{
99
99
  readonly targetName: "snap_manageState";
@@ -106,7 +106,7 @@ export declare const restrictedMethodPermissionBuilders: {
106
106
  methodImplementation: (options: import("@metamask/permission-controller").RestrictedMethodOptions<import("@metamask/snaps-sdk").ManageStateParams>) => Promise<import("@metamask/snaps-sdk").ManageStateResult>;
107
107
  allowedCaveats: readonly [string, ...string[]] | null;
108
108
  }>;
109
- readonly methodHooks: import("../utils").MethodHooksObject<ManageStateMethodHooks>;
109
+ readonly methodHooks: import("../utils.mjs").MethodHooksObject<ManageStateMethodHooks>;
110
110
  }>;
111
111
  readonly snap_notify: Readonly<{
112
112
  readonly targetName: "snap_notify";
@@ -119,7 +119,7 @@ export declare const restrictedMethodPermissionBuilders: {
119
119
  methodImplementation: (args: import("@metamask/permission-controller").RestrictedMethodOptions<import("@metamask/snaps-sdk").NotifyParams>) => Promise<null>;
120
120
  allowedCaveats: readonly [string, ...string[]] | null;
121
121
  }>;
122
- readonly methodHooks: import("../utils").MethodHooksObject<NotifyMethodHooks>;
122
+ readonly methodHooks: import("../utils.mjs").MethodHooksObject<NotifyMethodHooks>;
123
123
  }>;
124
124
  readonly snap_manageAccounts: Readonly<{
125
125
  readonly targetName: "snap_manageAccounts";
@@ -147,7 +147,7 @@ export declare const restrictedMethodPermissionBuilders: {
147
147
  methodImplementation: (_args: import("@metamask/permission-controller").RestrictedMethodOptions<import("@metamask/permission-controller").RestrictedMethodParameters>) => Promise<string>;
148
148
  allowedCaveats: readonly [string, ...string[]] | null;
149
149
  }>;
150
- readonly methodHooks: import("../utils").MethodHooksObject<GetLocaleMethodHooks>;
150
+ readonly methodHooks: import("../utils.mjs").MethodHooksObject<GetLocaleMethodHooks>;
151
151
  }>;
152
152
  readonly snap_getPreferences: Readonly<{
153
153
  readonly targetName: "snap_getPreferences";
@@ -160,7 +160,7 @@ export declare const restrictedMethodPermissionBuilders: {
160
160
  methodImplementation: (_args: import("@metamask/permission-controller").RestrictedMethodOptions<import("@metamask/permission-controller").RestrictedMethodParameters>) => Promise<import("@metamask/snaps-sdk").GetPreferencesResult>;
161
161
  allowedCaveats: readonly [string, ...string[]] | null;
162
162
  }>;
163
- readonly methodHooks: import("../utils").MethodHooksObject<GetPreferencesMethodHooks>;
163
+ readonly methodHooks: import("../utils.mjs").MethodHooksObject<GetPreferencesMethodHooks>;
164
164
  }>;
165
165
  };
166
166
  export * from "./caveats/index.mjs";
@@ -4,9 +4,41 @@ exports.getValidatedParams = exports.getImplementation = exports.notifyBuilder =
4
4
  const permission_controller_1 = require("@metamask/permission-controller");
5
5
  const rpc_errors_1 = require("@metamask/rpc-errors");
6
6
  const snaps_sdk_1 = require("@metamask/snaps-sdk");
7
+ const jsx_1 = require("@metamask/snaps-sdk/jsx");
7
8
  const snaps_utils_1 = require("@metamask/snaps-utils");
9
+ const superstruct_1 = require("@metamask/superstruct");
8
10
  const utils_1 = require("@metamask/utils");
9
11
  const methodName = 'snap_notify';
12
+ const NativeNotificationStruct = (0, superstruct_1.object)({
13
+ type: (0, snaps_sdk_1.enumValue)(snaps_sdk_1.NotificationType.Native),
14
+ message: (0, superstruct_1.string)(),
15
+ });
16
+ const InAppNotificationStruct = (0, superstruct_1.object)({
17
+ type: (0, snaps_sdk_1.enumValue)(snaps_sdk_1.NotificationType.InApp),
18
+ message: (0, superstruct_1.string)(),
19
+ });
20
+ const InAppNotificationWithDetailsStruct = (0, superstruct_1.object)({
21
+ type: (0, snaps_sdk_1.enumValue)(snaps_sdk_1.NotificationType.InApp),
22
+ message: (0, superstruct_1.string)(),
23
+ content: jsx_1.NotificationComponentsStruct,
24
+ title: (0, superstruct_1.string)(),
25
+ });
26
+ const InAppNotificationWithDetailsAndFooterStruct = (0, superstruct_1.object)({
27
+ type: (0, snaps_sdk_1.enumValue)(snaps_sdk_1.NotificationType.InApp),
28
+ message: (0, superstruct_1.string)(),
29
+ content: jsx_1.NotificationComponentsStruct,
30
+ title: (0, superstruct_1.string)(),
31
+ footerLink: (0, superstruct_1.object)({
32
+ href: (0, superstruct_1.string)(),
33
+ text: (0, superstruct_1.string)(),
34
+ }),
35
+ });
36
+ const NotificationParametersStruct = (0, snaps_sdk_1.union)([
37
+ InAppNotificationStruct,
38
+ InAppNotificationWithDetailsStruct,
39
+ InAppNotificationWithDetailsAndFooterStruct,
40
+ NativeNotificationStruct,
41
+ ]);
10
42
  /**
11
43
  * The specification builder for the `snap_notify` permission.
12
44
  * `snap_notify` allows snaps to send multiple types of notifications to its users.
@@ -31,6 +63,8 @@ const methodHooks = {
31
63
  showInAppNotification: true,
32
64
  isOnPhishingList: true,
33
65
  maybeUpdatePhishingList: true,
66
+ createInterface: true,
67
+ getSnap: true,
34
68
  };
35
69
  exports.notifyBuilder = Object.freeze({
36
70
  targetName: methodName,
@@ -45,15 +79,21 @@ exports.notifyBuilder = Object.freeze({
45
79
  * @param hooks.showInAppNotification - A function that shows a notification in the MetaMask UI.
46
80
  * @param hooks.isOnPhishingList - A function that checks for links against the phishing list.
47
81
  * @param hooks.maybeUpdatePhishingList - A function that updates the phishing list if needed.
82
+ * @param hooks.createInterface - A function that creates the interface in SnapInterfaceController.
83
+ * @param hooks.getSnap - A function that checks if a snap is installed.
48
84
  * @returns The method implementation which returns `null` on success.
49
85
  * @throws If the params are invalid.
50
86
  */
51
- function getImplementation({ showNativeNotification, showInAppNotification, isOnPhishingList, maybeUpdatePhishingList, }) {
87
+ function getImplementation({ showNativeNotification, showInAppNotification, isOnPhishingList, maybeUpdatePhishingList, createInterface, getSnap, }) {
52
88
  return async function implementation(args) {
53
89
  const { params, context: { origin }, } = args;
54
- const validatedParams = getValidatedParams(params);
55
90
  await maybeUpdatePhishingList();
56
- (0, snaps_utils_1.validateTextLinks)(validatedParams.message, isOnPhishingList);
91
+ const validatedParams = getValidatedParams(params, isOnPhishingList, getSnap);
92
+ let id;
93
+ if ((0, utils_1.hasProperty)(validatedParams, 'content')) {
94
+ id = await createInterface(origin, validatedParams.content);
95
+ validatedParams.content = id;
96
+ }
57
97
  switch (validatedParams.type) {
58
98
  case snaps_sdk_1.NotificationType.Native:
59
99
  return await showNativeNotification(origin, validatedParams);
@@ -72,9 +112,12 @@ exports.getImplementation = getImplementation;
72
112
  * type. Throws if validation fails.
73
113
  *
74
114
  * @param params - The unvalidated params object from the method request.
115
+ * @param isOnPhishingList - The function that checks for links against the phishing list.
116
+ * @param getSnap - A function that checks if a snap is installed.
75
117
  * @returns The validated method parameter object.
118
+ * @throws If the params are invalid.
76
119
  */
77
- function getValidatedParams(params) {
120
+ function getValidatedParams(params, isOnPhishingList, getSnap) {
78
121
  if (!(0, utils_1.isObject)(params)) {
79
122
  throw rpc_errors_1.rpcErrors.invalidParams({
80
123
  message: 'Expected params to be a single object.',
@@ -102,7 +145,20 @@ function getValidatedParams(params) {
102
145
  message: 'Must specify a non-empty string "message" less than 500 characters long.',
103
146
  });
104
147
  }
105
- return params;
148
+ try {
149
+ const validatedParams = (0, snaps_utils_1.createUnion)(params, NotificationParametersStruct, 'type');
150
+ (0, snaps_utils_1.validateTextLinks)(validatedParams.message, isOnPhishingList, getSnap);
151
+ if ((0, utils_1.hasProperty)(validatedParams, 'footerLink')) {
152
+ (0, snaps_utils_1.validateTextLinks)(validatedParams.footerLink.text, isOnPhishingList, getSnap);
153
+ (0, snaps_utils_1.validateLink)(validatedParams.footerLink.href, isOnPhishingList, getSnap);
154
+ }
155
+ return validatedParams;
156
+ }
157
+ catch (error) {
158
+ throw rpc_errors_1.rpcErrors.invalidParams({
159
+ message: `Invalid params: ${error.message}`,
160
+ });
161
+ }
106
162
  }
107
163
  exports.getValidatedParams = getValidatedParams;
108
164
  //# sourceMappingURL=notify.cjs.map