@metamask/snaps-jest 8.2.0 → 8.3.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 (191) hide show
  1. package/CHANGELOG.md +11 -1
  2. package/README.md +2 -2
  3. package/dist/chunk-24CGIQLL.mjs +30 -0
  4. package/dist/chunk-24CGIQLL.mjs.map +1 -0
  5. package/dist/{chunk-T2PHS5FY.js → chunk-2RJYSYUB.js} +2 -2
  6. package/dist/chunk-2RJYSYUB.js.map +1 -0
  7. package/dist/{chunk-KNJNL723.mjs → chunk-3J2IBWXV.mjs} +2 -2
  8. package/dist/{chunk-DVDAOXO7.js → chunk-3NP6BDGK.js} +48 -15
  9. package/dist/chunk-3NP6BDGK.js.map +1 -0
  10. package/dist/{chunk-43HRTFLS.mjs → chunk-6JPBXAHM.mjs} +103 -15
  11. package/dist/chunk-6JPBXAHM.mjs.map +1 -0
  12. package/dist/{chunk-VXPCUDBI.js → chunk-6V6MFT67.js} +8 -6
  13. package/dist/chunk-6V6MFT67.js.map +1 -0
  14. package/dist/{chunk-MAT5SBM7.mjs → chunk-7PCHIR6O.mjs} +7 -37
  15. package/dist/chunk-7PCHIR6O.mjs.map +1 -0
  16. package/dist/{chunk-4MAA7WGJ.js → chunk-AMAL4SJH.js} +7 -7
  17. package/dist/chunk-AMAL4SJH.js.map +1 -0
  18. package/dist/{chunk-HOI6FPLR.mjs → chunk-C26TYXXD.mjs} +9 -9
  19. package/dist/chunk-C26TYXXD.mjs.map +1 -0
  20. package/dist/{chunk-NSMTFK33.mjs → chunk-CACRY3TX.mjs} +3 -3
  21. package/dist/{chunk-PZDTZGSI.js → chunk-D653LBAY.js} +1 -1
  22. package/dist/chunk-D653LBAY.js.map +1 -0
  23. package/dist/{chunk-GVTDUKXK.js → chunk-DUVKGPX5.js} +106 -18
  24. package/dist/chunk-DUVKGPX5.js.map +1 -0
  25. package/dist/{chunk-IH7UNS5A.mjs → chunk-G333FBBL.mjs} +6 -4
  26. package/dist/chunk-G333FBBL.mjs.map +1 -0
  27. package/dist/{chunk-YNUVT3HC.js → chunk-GLPGOEVE.js} +4 -4
  28. package/dist/chunk-GLPGOEVE.js.map +1 -0
  29. package/dist/{chunk-WMLSD6B5.js → chunk-K7MK6LQU.js} +3 -3
  30. package/dist/{chunk-B73P64TE.mjs → chunk-KOPPL55J.mjs} +2 -2
  31. package/dist/chunk-KOPPL55J.mjs.map +1 -0
  32. package/dist/{chunk-XKJHFUHE.js → chunk-KPRLFCKD.js} +4 -2
  33. package/dist/chunk-KPRLFCKD.js.map +1 -0
  34. package/dist/{chunk-IVFVB4VR.js → chunk-LPMHPAZK.js} +54 -14
  35. package/dist/chunk-LPMHPAZK.js.map +1 -0
  36. package/dist/{chunk-GG2BCPQH.mjs → chunk-LSKT2AUS.mjs} +5 -3
  37. package/dist/chunk-LSKT2AUS.mjs.map +1 -0
  38. package/dist/{chunk-6KXCBUNZ.mjs → chunk-LVNNGMJ2.mjs} +3 -1
  39. package/dist/{chunk-6KXCBUNZ.mjs.map → chunk-LVNNGMJ2.mjs.map} +1 -1
  40. package/dist/{chunk-TMAWGVZP.mjs → chunk-OHRFO2BL.mjs} +7 -7
  41. package/dist/chunk-OHRFO2BL.mjs.map +1 -0
  42. package/dist/{chunk-WRKY2DLV.js → chunk-OO6IVUCV.js} +5 -5
  43. package/dist/{chunk-3M4GRUMH.mjs → chunk-ORR7AE5X.mjs} +2 -2
  44. package/dist/{chunk-5SGLRSWR.mjs → chunk-PDOVVC74.mjs} +4 -4
  45. package/dist/chunk-PDOVVC74.mjs.map +1 -0
  46. package/dist/{chunk-O24GTINW.mjs → chunk-Q3I6P2ZF.mjs} +42 -9
  47. package/dist/chunk-Q3I6P2ZF.mjs.map +1 -0
  48. package/dist/chunk-QRVFWATH.mjs +14 -0
  49. package/dist/chunk-QRVFWATH.mjs.map +1 -0
  50. package/dist/{chunk-MBQHVBLA.js → chunk-QYHQ2WWX.js} +5 -5
  51. package/dist/chunk-QYHQ2WWX.js.map +1 -0
  52. package/dist/{chunk-XWGECIXI.js → chunk-RJNNNCZJ.js} +3 -3
  53. package/dist/{chunk-CYPP66I7.mjs → chunk-ROCGQYSK.mjs} +46 -6
  54. package/dist/chunk-ROCGQYSK.mjs.map +1 -0
  55. package/dist/chunk-SNXRXX2O.js +30 -0
  56. package/dist/chunk-SNXRXX2O.js.map +1 -0
  57. package/dist/{chunk-44ARQBXS.js → chunk-WZ57PU2K.js} +6 -4
  58. package/dist/chunk-WZ57PU2K.js.map +1 -0
  59. package/dist/chunk-XP4YGQJA.js +14 -0
  60. package/dist/chunk-XP4YGQJA.js.map +1 -0
  61. package/dist/{chunk-7Y27L2EV.js → chunk-Y2U3ZPCK.js} +15 -45
  62. package/dist/chunk-Y2U3ZPCK.js.map +1 -0
  63. package/dist/{chunk-74TIKA2T.mjs → chunk-ZJQSGRNK.mjs} +1 -1
  64. package/dist/chunk-ZJQSGRNK.mjs.map +1 -0
  65. package/dist/environment.js +16 -16
  66. package/dist/environment.mjs +15 -15
  67. package/dist/helpers.js +29 -15
  68. package/dist/helpers.mjs +28 -14
  69. package/dist/index.js +31 -17
  70. package/dist/index.mjs +30 -16
  71. package/dist/internals/index.js +28 -20
  72. package/dist/internals/index.mjs +31 -23
  73. package/dist/internals/request.js +14 -14
  74. package/dist/internals/request.mjs +13 -13
  75. package/dist/internals/simulation/constants.js +4 -2
  76. package/dist/internals/simulation/constants.mjs +3 -1
  77. package/dist/internals/simulation/controllers.js +7 -7
  78. package/dist/internals/simulation/controllers.mjs +6 -6
  79. package/dist/internals/simulation/index.js +26 -18
  80. package/dist/internals/simulation/index.mjs +29 -21
  81. package/dist/internals/simulation/interface.js +10 -4
  82. package/dist/internals/simulation/interface.mjs +9 -3
  83. package/dist/internals/simulation/methods/hooks/get-preferences.js +8 -0
  84. package/dist/internals/simulation/methods/hooks/get-preferences.mjs +8 -0
  85. package/dist/internals/simulation/methods/hooks/index.js +5 -5
  86. package/dist/internals/simulation/methods/hooks/index.mjs +8 -8
  87. package/dist/internals/simulation/methods/hooks/notifications.js +2 -2
  88. package/dist/internals/simulation/methods/hooks/notifications.mjs +2 -2
  89. package/dist/internals/simulation/methods/hooks/request-user-approval.js +14 -0
  90. package/dist/internals/simulation/methods/hooks/request-user-approval.mjs +14 -0
  91. package/dist/internals/simulation/methods/hooks/state.js +2 -2
  92. package/dist/internals/simulation/methods/hooks/state.mjs +2 -2
  93. package/dist/internals/simulation/methods/index.js +6 -6
  94. package/dist/internals/simulation/methods/index.mjs +5 -5
  95. package/dist/internals/simulation/methods/specifications.js +6 -6
  96. package/dist/internals/simulation/methods/specifications.mjs +5 -5
  97. package/dist/internals/simulation/middleware/engine.js +3 -3
  98. package/dist/internals/simulation/middleware/engine.mjs +2 -2
  99. package/dist/internals/simulation/middleware/index.js +3 -3
  100. package/dist/internals/simulation/middleware/index.mjs +2 -2
  101. package/dist/internals/simulation/options.js +3 -3
  102. package/dist/internals/simulation/options.mjs +2 -2
  103. package/dist/internals/simulation/simulation.js +12 -11
  104. package/dist/internals/simulation/simulation.mjs +11 -10
  105. package/dist/internals/simulation/store/index.js +3 -3
  106. package/dist/internals/simulation/store/index.mjs +2 -2
  107. package/dist/internals/simulation/store/store.js +3 -3
  108. package/dist/internals/simulation/store/store.mjs +2 -2
  109. package/dist/internals/simulation/store/ui.js +2 -2
  110. package/dist/internals/simulation/store/ui.mjs +1 -1
  111. package/dist/internals/structs.js +2 -2
  112. package/dist/internals/structs.mjs +1 -1
  113. package/dist/matchers.js +15 -17
  114. package/dist/matchers.mjs +14 -16
  115. package/dist/options.js +2 -2
  116. package/dist/options.mjs +1 -1
  117. package/dist/setup.js +14 -14
  118. package/dist/setup.mjs +14 -14
  119. package/dist/tsconfig.build.tsbuildinfo +1 -1
  120. package/dist/types/helpers.d.ts +43 -1
  121. package/dist/types/internals/request.d.ts +1 -1
  122. package/dist/types/internals/server.d.ts +1 -1
  123. package/dist/types/internals/simulation/constants.d.ts +4 -0
  124. package/dist/types/internals/simulation/controllers.d.ts +4 -4
  125. package/dist/types/internals/simulation/interface.d.ts +31 -4
  126. package/dist/types/internals/simulation/methods/hooks/get-preferences.d.ts +13 -0
  127. package/dist/types/internals/simulation/methods/hooks/index.d.ts +2 -2
  128. package/dist/types/internals/simulation/methods/hooks/request-user-approval.d.ts +15 -0
  129. package/dist/types/internals/simulation/methods/specifications.d.ts +2 -2
  130. package/dist/types/internals/simulation/middleware/engine.d.ts +1 -1
  131. package/dist/types/internals/simulation/middleware/internal-methods/accounts.d.ts +1 -1
  132. package/dist/types/internals/simulation/middleware/internal-methods/middleware.d.ts +1 -1
  133. package/dist/types/internals/simulation/options.d.ts +10 -8
  134. package/dist/types/internals/simulation/simulation.d.ts +8 -5
  135. package/dist/types/internals/simulation/store/mocks.d.ts +2 -2
  136. package/dist/types/internals/simulation/store/notifications.d.ts +2 -2
  137. package/dist/types/internals/simulation/store/state.d.ts +1 -1
  138. package/dist/types/internals/simulation/store/store.d.ts +4 -4
  139. package/dist/types/internals/simulation/store/ui.d.ts +4 -3
  140. package/dist/types/internals/structs.d.ts +41 -41
  141. package/dist/types/matchers.d.ts +0 -10
  142. package/dist/types/options.d.ts +7 -7
  143. package/dist/types/types.d.ts +60 -21
  144. package/package.json +16 -16
  145. package/dist/chunk-265BMFM5.js +0 -13
  146. package/dist/chunk-265BMFM5.js.map +0 -1
  147. package/dist/chunk-43HRTFLS.mjs.map +0 -1
  148. package/dist/chunk-44ARQBXS.js.map +0 -1
  149. package/dist/chunk-4MAA7WGJ.js.map +0 -1
  150. package/dist/chunk-5SGLRSWR.mjs.map +0 -1
  151. package/dist/chunk-74TIKA2T.mjs.map +0 -1
  152. package/dist/chunk-7Y27L2EV.js.map +0 -1
  153. package/dist/chunk-B73P64TE.mjs.map +0 -1
  154. package/dist/chunk-CYPP66I7.mjs.map +0 -1
  155. package/dist/chunk-DVDAOXO7.js.map +0 -1
  156. package/dist/chunk-GG2BCPQH.mjs.map +0 -1
  157. package/dist/chunk-GVTDUKXK.js.map +0 -1
  158. package/dist/chunk-HOI6FPLR.mjs.map +0 -1
  159. package/dist/chunk-IH7UNS5A.mjs.map +0 -1
  160. package/dist/chunk-IVFVB4VR.js.map +0 -1
  161. package/dist/chunk-KSIBNOB2.mjs +0 -13
  162. package/dist/chunk-KSIBNOB2.mjs.map +0 -1
  163. package/dist/chunk-MAT5SBM7.mjs.map +0 -1
  164. package/dist/chunk-MBQHVBLA.js.map +0 -1
  165. package/dist/chunk-O24GTINW.mjs.map +0 -1
  166. package/dist/chunk-ORO3T6BU.mjs +0 -24
  167. package/dist/chunk-ORO3T6BU.mjs.map +0 -1
  168. package/dist/chunk-PZDTZGSI.js.map +0 -1
  169. package/dist/chunk-RAMAN5RM.js +0 -24
  170. package/dist/chunk-RAMAN5RM.js.map +0 -1
  171. package/dist/chunk-T2PHS5FY.js.map +0 -1
  172. package/dist/chunk-TMAWGVZP.mjs.map +0 -1
  173. package/dist/chunk-VXPCUDBI.js.map +0 -1
  174. package/dist/chunk-XKJHFUHE.js.map +0 -1
  175. package/dist/chunk-YNUVT3HC.js.map +0 -1
  176. package/dist/internals/simulation/methods/hooks/get-locale.js +0 -8
  177. package/dist/internals/simulation/methods/hooks/get-locale.mjs +0 -8
  178. package/dist/internals/simulation/methods/hooks/show-dialog.js +0 -14
  179. package/dist/internals/simulation/methods/hooks/show-dialog.mjs +0 -14
  180. package/dist/types/internals/simulation/methods/hooks/get-locale.d.ts +0 -9
  181. package/dist/types/internals/simulation/methods/hooks/show-dialog.d.ts +0 -9
  182. /package/dist/{chunk-KNJNL723.mjs.map → chunk-3J2IBWXV.mjs.map} +0 -0
  183. /package/dist/{chunk-NSMTFK33.mjs.map → chunk-CACRY3TX.mjs.map} +0 -0
  184. /package/dist/{chunk-WMLSD6B5.js.map → chunk-K7MK6LQU.js.map} +0 -0
  185. /package/dist/{chunk-WRKY2DLV.js.map → chunk-OO6IVUCV.js.map} +0 -0
  186. /package/dist/{chunk-3M4GRUMH.mjs.map → chunk-ORR7AE5X.mjs.map} +0 -0
  187. /package/dist/{chunk-XWGECIXI.js.map → chunk-RJNNNCZJ.js.map} +0 -0
  188. /package/dist/internals/simulation/methods/hooks/{get-locale.js.map → get-preferences.js.map} +0 -0
  189. /package/dist/internals/simulation/methods/hooks/{get-locale.mjs.map → get-preferences.mjs.map} +0 -0
  190. /package/dist/internals/simulation/methods/hooks/{show-dialog.js.map → request-user-approval.js.map} +0 -0
  191. /package/dist/internals/simulation/methods/hooks/{show-dialog.mjs.map → request-user-approval.mjs.map} +0 -0
@@ -1,7 +1,49 @@
1
1
  import type { AbstractExecutionService } from '@metamask/snaps-controllers';
2
2
  import type { SnapId } from '@metamask/snaps-sdk';
3
3
  import type { InstallSnapOptions } from './internals';
4
- import type { Snap } from './types';
4
+ import type { Snap, SnapInterface, SnapAlertInterface, SnapInterfaceActions, SnapConfirmationInterface, SnapPromptInterface, DefaultSnapInterface, DefaultSnapInterfaceWithFooter, DefaultSnapInterfaceWithPartialFooter, DefaultSnapInterfaceWithoutFooter } from './types';
5
+ /**
6
+ * Ensure that the actual interface is an alert dialog.
7
+ *
8
+ * @param ui - The interface to verify.
9
+ */
10
+ export declare function assertIsAlertDialog(ui: SnapInterface): asserts ui is SnapAlertInterface & SnapInterfaceActions;
11
+ /**
12
+ * Ensure that the actual interface is a confirmation dialog.
13
+ *
14
+ * @param ui - The interface to verify.
15
+ */
16
+ export declare function assertIsConfirmationDialog(ui: SnapInterface): asserts ui is SnapConfirmationInterface & SnapInterfaceActions;
17
+ /**
18
+ * Ensure that the actual interface is a Prompt dialog.
19
+ *
20
+ * @param ui - The interface to verify.
21
+ */
22
+ export declare function assertIsPromptDialog(ui: SnapInterface): asserts ui is SnapPromptInterface & SnapInterfaceActions;
23
+ /**
24
+ * Ensure that the actual interface is a custom dialog.
25
+ *
26
+ * @param ui - The interface to verify.
27
+ */
28
+ export declare function assertIsCustomDialog(ui: SnapInterface): asserts ui is DefaultSnapInterface & SnapInterfaceActions;
29
+ /**
30
+ * Ensure that the actual interface is a custom dialog with a complete footer.
31
+ *
32
+ * @param ui - The interface to verify.
33
+ */
34
+ export declare function assertCustomDialogHasFooter(ui: DefaultSnapInterface & SnapInterfaceActions): asserts ui is DefaultSnapInterfaceWithFooter & SnapInterfaceActions;
35
+ /**
36
+ * Ensure that the actual interface is a custom dialog with a partial footer.
37
+ *
38
+ * @param ui - The interface to verify.
39
+ */
40
+ export declare function assertCustomDialogHasPartialFooter(ui: DefaultSnapInterface & SnapInterfaceActions): asserts ui is DefaultSnapInterfaceWithPartialFooter & SnapInterfaceActions;
41
+ /**
42
+ * Ensure that the actual interface is a custom dialog without a footer.
43
+ *
44
+ * @param ui - The interface to verify.
45
+ */
46
+ export declare function assertCustomDialogHasNoFooter(ui: DefaultSnapInterface & SnapInterfaceActions): asserts ui is DefaultSnapInterfaceWithoutFooter & SnapInterfaceActions;
5
47
  /**
6
48
  * Load a snap into the environment. This is the main entry point for testing
7
49
  * snaps: It returns a {@link Snap} object that can be used to interact with the
@@ -4,7 +4,7 @@ import type { HandlerType } from '@metamask/snaps-utils';
4
4
  import type { RequestOptions, SnapHandlerInterface, SnapRequest } from '../types';
5
5
  import type { RunSagaFunction, Store } from './simulation';
6
6
  import type { RootControllerMessenger } from './simulation/controllers';
7
- export declare type HandleRequestOptions = {
7
+ export type HandleRequestOptions = {
8
8
  snapId: SnapId;
9
9
  store: Store;
10
10
  executionService: AbstractExecutionService<unknown>;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  import type { Server } from 'http';
3
3
  import type { SnapsEnvironmentOptions } from '../options';
4
- export declare type ServerOptions = Required<Required<SnapsEnvironmentOptions>['server']>;
4
+ export type ServerOptions = Required<Required<SnapsEnvironmentOptions>['server']>;
5
5
  /**
6
6
  * Start an HTTP server on `localhost` with a random port. This is used to serve
7
7
  * the static files for the environment.
@@ -7,6 +7,10 @@ export declare const DEFAULT_SRP = "test test test test test test test test test
7
7
  * The default locale.
8
8
  */
9
9
  export declare const DEFAULT_LOCALE = "en";
10
+ /**
11
+ * The default currency.
12
+ */
13
+ export declare const DEFAULT_CURRENCY = "usd";
10
14
  /**
11
15
  * The default JSON-RPC endpoint for Ethereum requests.
12
16
  */
@@ -8,15 +8,15 @@ import type { SnapManifest } from '@metamask/snaps-utils';
8
8
  import type { SimulationOptions } from './options';
9
9
  import type { MiddlewareHooks } from './simulation';
10
10
  import type { RunSagaFunction } from './store';
11
- export declare type RootControllerAllowedActions = SnapInterfaceControllerActions | SnapInterfaceControllerAllowedActions | PermissionControllerActions | ExecutionServiceActions | SubjectMetadataControllerActions;
12
- export declare type RootControllerMessenger = ControllerMessenger<RootControllerAllowedActions, any>;
13
- export declare type GetControllersOptions = {
11
+ export type RootControllerAllowedActions = SnapInterfaceControllerActions | SnapInterfaceControllerAllowedActions | PermissionControllerActions | ExecutionServiceActions | SubjectMetadataControllerActions;
12
+ export type RootControllerMessenger = ControllerMessenger<RootControllerAllowedActions, any>;
13
+ export type GetControllersOptions = {
14
14
  controllerMessenger: ControllerMessenger<any, any>;
15
15
  hooks: MiddlewareHooks;
16
16
  runSaga: RunSagaFunction;
17
17
  options: SimulationOptions;
18
18
  };
19
- export declare type Controllers = {
19
+ export type Controllers = {
20
20
  permissionController: PermissionController<PermissionSpecificationConstraint, CaveatSpecificationConstraint>;
21
21
  subjectMetadataController: SubjectMetadataController;
22
22
  interfaceController: SnapInterfaceController;
@@ -1,6 +1,7 @@
1
+ import type { DialogApprovalTypes } from '@metamask/snaps-rpc-methods';
1
2
  import type { InterfaceState, SnapId, File } from '@metamask/snaps-sdk';
2
3
  import { DialogType } from '@metamask/snaps-sdk';
3
- import type { JSXElement } from '@metamask/snaps-sdk/jsx';
4
+ import { type JSXElement } from '@metamask/snaps-sdk/jsx';
4
5
  import { type SagaIterator } from 'redux-saga';
5
6
  import type { FileOptions, SnapInterface, SnapInterfaceActions } from '../../types';
6
7
  import type { RootControllerMessenger } from './controllers';
@@ -14,11 +15,18 @@ import type { Interface, RunSagaFunction } from './store';
14
15
  * @param interfaceActions - The actions to interact with the interface.
15
16
  * @returns The user interface object.
16
17
  */
17
- export declare function getInterfaceResponse(runSaga: RunSagaFunction, type: DialogType, content: JSXElement, interfaceActions: SnapInterfaceActions): SnapInterface;
18
+ export declare function getInterfaceResponse(runSaga: RunSagaFunction, type: DialogApprovalTypes[DialogType | 'default'], content: JSXElement, interfaceActions: SnapInterfaceActions): SnapInterface;
19
+ /**
20
+ * Resolve the current user interface with the given value.
21
+ *
22
+ * @param value - The value to resolve the user interface with.
23
+ * @yields Puts the resolve user interface action.
24
+ */
25
+ export declare function resolveWithSaga(value: unknown): SagaIterator;
18
26
  /**
19
27
  * A JSX element with a name.
20
28
  */
21
- export declare type NamedJSXElement = JSXElement & {
29
+ export type NamedJSXElement = JSXElement & {
22
30
  props: {
23
31
  name: string;
24
32
  };
@@ -35,6 +43,14 @@ export declare function getElement(content: JSXElement, name: string): {
35
43
  element: NamedJSXElement;
36
44
  form?: string;
37
45
  } | undefined;
46
+ /**
47
+ * Get an element from a JSX tree with the given type.
48
+ *
49
+ * @param content - The interface content.
50
+ * @param type - The element type.
51
+ * @returns The element with the given type.
52
+ */
53
+ export declare function getElementByType<Element extends JSXElement>(content: JSXElement, type: string): Element | undefined;
38
54
  /**
39
55
  * Click on an element of the Snap interface.
40
56
  *
@@ -77,6 +93,17 @@ export declare function typeInField(controllerMessenger: RootControllerMessenger
77
93
  * @param value - The value to type in the element.
78
94
  */
79
95
  export declare function selectInDropdown(controllerMessenger: RootControllerMessenger, id: string, content: JSXElement, snapId: SnapId, name: string, value: string): Promise<void>;
96
+ /**
97
+ * Choose an option with value from radio group interface element.
98
+ *
99
+ * @param controllerMessenger - The controller messenger used to call actions.
100
+ * @param id - The interface ID.
101
+ * @param content - The interface Components.
102
+ * @param snapId - The Snap ID.
103
+ * @param name - The element name.
104
+ * @param value - The value to type in the element.
105
+ */
106
+ export declare function selectFromRadioGroup(controllerMessenger: RootControllerMessenger, id: string, content: JSXElement, snapId: SnapId, name: string, value: string): Promise<void>;
80
107
  /**
81
108
  * Upload a file to an interface element.
82
109
  *
@@ -121,4 +148,4 @@ export declare function getInterfaceActions(snapId: SnapId, controllerMessenger:
121
148
  * @yields Takes the set interface action.
122
149
  * @returns The user interface object.
123
150
  */
124
- export declare function getInterface(runSaga: RunSagaFunction, snapId: SnapId, controllerMessenger: RootControllerMessenger): SagaIterator<SnapInterface>;
151
+ export declare function getInterface(runSaga: RunSagaFunction, snapId: SnapId, controllerMessenger: RootControllerMessenger): SagaIterator;
@@ -0,0 +1,13 @@
1
+ import type { SimulationOptions } from '../../options';
2
+ /**
3
+ * Get the implementation of the `getPreferences` hook.
4
+ *
5
+ * @param options - The simulation options.
6
+ * @param options.currency - The currency to use.
7
+ * @param options.locale - The locale to use.
8
+ * @returns The implementation of the `getPreferences` hook.
9
+ */
10
+ export declare function getGetPreferencesMethodImplementation({ currency, locale, }: SimulationOptions): () => {
11
+ currency: string;
12
+ locale: string;
13
+ };
@@ -1,5 +1,5 @@
1
- export * from './get-locale';
1
+ export * from './get-preferences';
2
2
  export * from './notifications';
3
- export * from './show-dialog';
3
+ export * from './request-user-approval';
4
4
  export * from './state';
5
5
  export * from './interface';
@@ -0,0 +1,15 @@
1
+ import type { RunSagaFunction } from '../../store';
2
+ type RequestUserApprovalParams = {
3
+ type: string;
4
+ requestData: {
5
+ id: string;
6
+ };
7
+ };
8
+ /**
9
+ * Get the implementation of the `requestUserApproval` hook.
10
+ *
11
+ * @param runSaga - The function to run a saga outside the usual Redux flow.
12
+ * @returns The implementation of the `requestUserApproval` hook.
13
+ */
14
+ export declare function getRequestUserApprovalImplementation(runSaga: RunSagaFunction): (args_0: RequestUserApprovalParams) => Promise<any>;
15
+ export {};
@@ -3,7 +3,7 @@ import type { SnapId } from '@metamask/snaps-sdk';
3
3
  import type { RootControllerMessenger } from '../controllers';
4
4
  import type { SimulationOptions } from '../options';
5
5
  import type { RunSagaFunction } from '../store';
6
- export declare type PermissionSpecificationsHooks = {
6
+ export type PermissionSpecificationsHooks = {
7
7
  /**
8
8
  * A hook that returns the user's secret recovery phrase.
9
9
  *
@@ -11,7 +11,7 @@ export declare type PermissionSpecificationsHooks = {
11
11
  */
12
12
  getMnemonic: () => Promise<Uint8Array>;
13
13
  };
14
- export declare type GetPermissionSpecificationsOptions = {
14
+ export type GetPermissionSpecificationsOptions = {
15
15
  controllerMessenger: RootControllerMessenger;
16
16
  hooks: PermissionSpecificationsHooks;
17
17
  runSaga: RunSagaFunction;
@@ -4,7 +4,7 @@ import type { RestrictedMethodParameters } from '@metamask/permission-controller
4
4
  import type { Json } from '@metamask/utils';
5
5
  import type { MiddlewareHooks } from '../simulation';
6
6
  import type { Store } from '../store';
7
- export declare type CreateJsonRpcEngineOptions = {
7
+ export type CreateJsonRpcEngineOptions = {
8
8
  store: Store;
9
9
  hooks: MiddlewareHooks;
10
10
  permissionMiddleware: JsonRpcMiddleware<RestrictedMethodParameters, Json>;
@@ -1,6 +1,6 @@
1
1
  import type { JsonRpcEngineEndCallback, JsonRpcEngineNextCallback } from '@metamask/json-rpc-engine';
2
2
  import type { Json, JsonRpcRequest, PendingJsonRpcResponse } from '@metamask/utils';
3
- export declare type GetAccountsHandlerHooks = {
3
+ export type GetAccountsHandlerHooks = {
4
4
  getMnemonic: () => Promise<Uint8Array>;
5
5
  };
6
6
  /**
@@ -1,6 +1,6 @@
1
1
  import type { JsonRpcMiddleware } from '@metamask/json-rpc-engine';
2
2
  import type { Json, JsonRpcParams } from '@metamask/utils';
3
- export declare type InternalMethodsMiddlewareHooks = {
3
+ export type InternalMethodsMiddlewareHooks = {
4
4
  /**
5
5
  * A hook that returns the user's secret recovery phrase.
6
6
  *
@@ -1,14 +1,16 @@
1
- import type { Infer } from 'superstruct';
2
- declare const SimulationOptionsStruct: import("superstruct").Struct<{
1
+ import type { Infer } from '@metamask/superstruct';
2
+ declare const SimulationOptionsStruct: import("@metamask/superstruct").Struct<{
3
3
  state?: Record<string, import("@metamask/utils").Json> | null | undefined;
4
4
  locale?: string | undefined;
5
5
  secretRecoveryPhrase?: string | undefined;
6
+ currency?: string | undefined;
6
7
  unencryptedState?: Record<string, import("@metamask/utils").Json> | null | undefined;
7
8
  }, {
8
- secretRecoveryPhrase: import("superstruct").Struct<string | undefined, null>;
9
- locale: import("superstruct").Struct<string | undefined, null>;
10
- state: import("superstruct").Struct<Record<string, import("@metamask/utils").Json> | null | undefined, null>;
11
- unencryptedState: import("superstruct").Struct<Record<string, import("@metamask/utils").Json> | null | undefined, null>;
9
+ currency: import("@metamask/superstruct").Struct<string | undefined, null>;
10
+ secretRecoveryPhrase: import("@metamask/superstruct").Struct<string | undefined, null>;
11
+ locale: import("@metamask/superstruct").Struct<string | undefined, null>;
12
+ state: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json> | null | undefined, null>;
13
+ unencryptedState: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json> | null | undefined, null>;
12
14
  }>;
13
15
  /**
14
16
  * Options for the simulation.
@@ -19,13 +21,13 @@ declare const SimulationOptionsStruct: import("superstruct").Struct<{
19
21
  * @property locale - The locale to use. Defaults to `en`.
20
22
  * @property state - The initial state of the Snap, if any. Defaults to `null`.
21
23
  */
22
- export declare type SimulationUserOptions = Infer<typeof SimulationOptionsStruct>;
24
+ export type SimulationUserOptions = Infer<typeof SimulationOptionsStruct>;
23
25
  /**
24
26
  * Options for the simulation, with defaults filled in.
25
27
  *
26
28
  * See {@link SimulationUserOptions} for documentation.
27
29
  */
28
- export declare type SimulationOptions = Required<SimulationUserOptions>;
30
+ export type SimulationOptions = Required<SimulationUserOptions>;
29
31
  /**
30
32
  * Get the options for the simulation.
31
33
  *
@@ -3,6 +3,7 @@ import { ControllerMessenger } from '@metamask/base-controller';
3
3
  import type { AbstractExecutionService } from '@metamask/snaps-controllers';
4
4
  import type { SnapId, AuxiliaryFileEncoding, Component, InterfaceState } from '@metamask/snaps-sdk';
5
5
  import type { FetchedSnapFiles } from '@metamask/snaps-utils';
6
+ import type { Json } from '@metamask/utils';
6
7
  import type { RootControllerMessenger } from './controllers';
7
8
  import type { SimulationOptions, SimulationUserOptions } from './options';
8
9
  import type { RunSagaFunction, Store } from './store';
@@ -13,7 +14,7 @@ import type { RunSagaFunction, Store } from './store';
13
14
  * @template Service - The type of the execution service, i.e., the class that
14
15
  * creates the execution service.
15
16
  */
16
- export declare type ExecutionServiceOptions<Service extends new (...args: any[]) => any> = Omit<ConstructorParameters<Service>[0], keyof ConstructorParameters<typeof AbstractExecutionService<unknown>>[0]>;
17
+ export type ExecutionServiceOptions<Service extends new (...args: any[]) => any> = Omit<ConstructorParameters<Service>[0], keyof ConstructorParameters<typeof AbstractExecutionService<unknown>>[0]>;
17
18
  /**
18
19
  * The options for running a Snap in a simulated environment.
19
20
  *
@@ -24,7 +25,7 @@ export declare type ExecutionServiceOptions<Service extends new (...args: any[])
24
25
  * @property options - The simulation options.
25
26
  * @template Service - The type of the execution service.
26
27
  */
27
- export declare type InstallSnapOptions<Service extends new (...args: any[]) => InstanceType<typeof AbstractExecutionService<unknown>>> = ExecutionServiceOptions<Service> extends Record<string, never> ? {
28
+ export type InstallSnapOptions<Service extends new (...args: any[]) => InstanceType<typeof AbstractExecutionService<unknown>>> = ExecutionServiceOptions<Service> extends Record<string, never> ? {
28
29
  executionService: Service;
29
30
  executionServiceOptions?: ExecutionServiceOptions<Service>;
30
31
  options?: SimulationUserOptions;
@@ -33,14 +34,14 @@ export declare type InstallSnapOptions<Service extends new (...args: any[]) => I
33
34
  executionServiceOptions: ExecutionServiceOptions<Service>;
34
35
  options?: SimulationUserOptions;
35
36
  };
36
- export declare type InstalledSnap = {
37
+ export type InstalledSnap = {
37
38
  snapId: SnapId;
38
39
  store: Store;
39
40
  executionService: InstanceType<typeof AbstractExecutionService>;
40
41
  controllerMessenger: ControllerMessenger<ActionConstraint, EventConstraint>;
41
42
  runSaga: RunSagaFunction;
42
43
  };
43
- export declare type MiddlewareHooks = {
44
+ export type MiddlewareHooks = {
44
45
  /**
45
46
  * A hook that returns the user's secret recovery phrase.
46
47
  *
@@ -64,6 +65,7 @@ export declare type MiddlewareHooks = {
64
65
  createInterface: (content: Component) => Promise<string>;
65
66
  updateInterface: (id: string, content: Component) => Promise<void>;
66
67
  getInterfaceState: (id: string) => InterfaceState;
68
+ resolveInterface: (id: string, value: Json) => Promise<void>;
67
69
  };
68
70
  /**
69
71
  * Install a Snap in a simulated environment. This will fetch the Snap files,
@@ -94,5 +96,6 @@ export declare function getHooks(options: SimulationOptions, snapFiles: FetchedS
94
96
  * Register mocked action handlers.
95
97
  *
96
98
  * @param controllerMessenger - The controller messenger.
99
+ * @param runSaga - The run saga function.
97
100
  */
98
- export declare function registerActions(controllerMessenger: RootControllerMessenger): void;
101
+ export declare function registerActions(controllerMessenger: RootControllerMessenger, runSaga: RunSagaFunction): void;
@@ -1,11 +1,11 @@
1
1
  import type { Json } from '@metamask/utils';
2
2
  import type { PayloadAction } from '@reduxjs/toolkit';
3
3
  import type { ApplicationState } from './store';
4
- export declare type JsonRpcMock = {
4
+ export type JsonRpcMock = {
5
5
  method: string;
6
6
  result: Json;
7
7
  };
8
- export declare type MocksState = {
8
+ export type MocksState = {
9
9
  jsonRpc: Record<string, Json>;
10
10
  };
11
11
  export declare const mocksSlice: import("@reduxjs/toolkit").Slice<MocksState, {
@@ -7,7 +7,7 @@ import type { PayloadAction } from '@reduxjs/toolkit';
7
7
  * @property message - The notification message.
8
8
  * @property type - The notification type.
9
9
  */
10
- export declare type Notification = {
10
+ export type Notification = {
11
11
  id: string;
12
12
  message: string;
13
13
  type: NotificationType;
@@ -17,7 +17,7 @@ export declare type Notification = {
17
17
  *
18
18
  * @property notifications - An array of notifications.
19
19
  */
20
- export declare type NotificationsState = {
20
+ export type NotificationsState = {
21
21
  notifications: Notification[];
22
22
  };
23
23
  export declare const notificationsSlice: import("@reduxjs/toolkit").Slice<NotificationsState, {
@@ -7,7 +7,7 @@ import type { PayloadAction } from '@reduxjs/toolkit';
7
7
  * @property unencrypted - The unencrypted state. Can be null if the Snap does
8
8
  * not have an unencrypted state.
9
9
  */
10
- export declare type State = {
10
+ export type State = {
11
11
  encrypted: string | null;
12
12
  unencrypted: string | null;
13
13
  };
@@ -14,8 +14,8 @@ export declare function createStore({ state, unencryptedState }: SimulationOptio
14
14
  state: import("./state").State;
15
15
  ui: import("./ui").UiState;
16
16
  }, import("redux").AnyAction, import("@reduxjs/toolkit").MiddlewareArray<[import("redux-saga").SagaMiddleware<object>]>>;
17
- runSaga: <S extends import("redux-saga").Saga<any[]>>(saga: S, ...args: Parameters<S>) => import("redux-saga").Task<any>;
17
+ runSaga: <S extends import("redux-saga").Saga>(saga: S, ...args: Parameters<S>) => import("redux-saga").Task<any>;
18
18
  };
19
- export declare type Store = ReturnType<typeof createStore>['store'];
20
- export declare type ApplicationState = ReturnType<Store['getState']>;
21
- export declare type RunSagaFunction = ReturnType<typeof createStore>['runSaga'];
19
+ export type Store = ReturnType<typeof createStore>['store'];
20
+ export type ApplicationState = ReturnType<Store['getState']>;
21
+ export type RunSagaFunction = ReturnType<typeof createStore>['runSaga'];
@@ -1,10 +1,11 @@
1
+ import type { DialogApprovalTypes } from '@metamask/snaps-rpc-methods';
1
2
  import type { DialogType } from '@metamask/snaps-sdk';
2
3
  import type { PayloadAction } from '@reduxjs/toolkit';
3
- export declare type Interface = {
4
- type: DialogType;
4
+ export type Interface = {
5
+ type: DialogApprovalTypes[DialogType | 'default'];
5
6
  id: string;
6
7
  };
7
- export declare type UiState = {
8
+ export type UiState = {
8
9
  current?: Interface | null;
9
10
  };
10
11
  export declare const uiSlice: import("@reduxjs/toolkit").Slice<UiState, {
@@ -1,4 +1,4 @@
1
- export declare const TransactionOptionsStruct: import("superstruct").Struct<{
1
+ export declare const TransactionOptionsStruct: import("@metamask/superstruct").Struct<{
2
2
  value: `0x${string}`;
3
3
  data: `0x${string}`;
4
4
  from: `0x${string}`;
@@ -13,55 +13,55 @@ export declare const TransactionOptionsStruct: import("superstruct").Struct<{
13
13
  /**
14
14
  * The CAIP-2 chain ID to send the transaction on. Defaults to `eip155:1`.
15
15
  */
16
- chainId: import("superstruct").Struct<string, null>;
16
+ chainId: import("@metamask/superstruct").Struct<string, null>;
17
17
  /**
18
18
  * The origin to send the transaction from. Defaults to `metamask.io`.
19
19
  */
20
- origin: import("superstruct").Struct<string, null>;
20
+ origin: import("@metamask/superstruct").Struct<string, null>;
21
21
  /**
22
22
  * The address to send the transaction from. Defaults to a randomly generated
23
23
  * address.
24
24
  */
25
- from: import("superstruct").Struct<`0x${string}`, null>;
25
+ from: import("@metamask/superstruct").Struct<`0x${string}`, null>;
26
26
  /**
27
27
  * The address to send the transaction to. Defaults to a randomly generated
28
28
  * address.
29
29
  */
30
- to: import("superstruct").Struct<`0x${string}`, null>;
30
+ to: import("@metamask/superstruct").Struct<`0x${string}`, null>;
31
31
  /**
32
32
  * The value to send with the transaction. The value may be specified as a
33
33
  * `number`, `bigint`, `string`, or `Uint8Array`. Defaults to `0`.
34
34
  */
35
- value: import("superstruct").Struct<`0x${string}`, null>;
35
+ value: import("@metamask/superstruct").Struct<`0x${string}`, null>;
36
36
  /**
37
37
  * The gas limit to use for the transaction. The gas limit may be specified
38
38
  * as a `number`, `bigint`, `string`, or `Uint8Array`. Defaults to `21_000`.
39
39
  */
40
- gasLimit: import("superstruct").Struct<`0x${string}`, null>;
40
+ gasLimit: import("@metamask/superstruct").Struct<`0x${string}`, null>;
41
41
  /**
42
42
  * The max fee per gas (in Wei) to use for the transaction. The max fee per
43
43
  * gas may be specified as a `number`, `bigint`, `string`, or `Uint8Array`.
44
44
  * Defaults to `1`.
45
45
  */
46
- maxFeePerGas: import("superstruct").Struct<`0x${string}`, null>;
46
+ maxFeePerGas: import("@metamask/superstruct").Struct<`0x${string}`, null>;
47
47
  /**
48
48
  * The max priority fee per gas (in Wei) to use for the transaction. The max
49
49
  * priority fee per gas may be specified as a `number`, `bigint`, `string`,
50
50
  * or `Uint8Array`. Defaults to `1`.
51
51
  */
52
- maxPriorityFeePerGas: import("superstruct").Struct<`0x${string}`, null>;
52
+ maxPriorityFeePerGas: import("@metamask/superstruct").Struct<`0x${string}`, null>;
53
53
  /**
54
54
  * The nonce to use for the transaction. The nonce may be specified as a
55
55
  * `number`, `bigint`, `string`, or `Uint8Array`. Defaults to `0`.
56
56
  */
57
- nonce: import("superstruct").Struct<`0x${string}`, null>;
57
+ nonce: import("@metamask/superstruct").Struct<`0x${string}`, null>;
58
58
  /**
59
59
  * The data to send with the transaction. The data may be specified as a
60
60
  * `number`, `bigint`, `string`, or `Uint8Array`. Defaults to `0x`.
61
61
  */
62
- data: import("superstruct").Struct<`0x${string}`, null>;
62
+ data: import("@metamask/superstruct").Struct<`0x${string}`, null>;
63
63
  }>;
64
- export declare const SignatureOptionsStruct: import("superstruct").Struct<{
64
+ export declare const SignatureOptionsStruct: import("@metamask/superstruct").Struct<{
65
65
  data: `0x${string}` | Record<string, any> | Record<string, any>[];
66
66
  from: `0x${string}`;
67
67
  origin: string;
@@ -70,45 +70,45 @@ export declare const SignatureOptionsStruct: import("superstruct").Struct<{
70
70
  /**
71
71
  * The origin making the signature request.
72
72
  */
73
- origin: import("superstruct").Struct<string, null>;
73
+ origin: import("@metamask/superstruct").Struct<string, null>;
74
74
  /**
75
75
  * The address signing the signature request. Defaults to a randomly generated
76
76
  * address.
77
77
  */
78
- from: import("superstruct").Struct<`0x${string}`, null>;
78
+ from: import("@metamask/superstruct").Struct<`0x${string}`, null>;
79
79
  /**
80
80
  * The data to send with the transaction. The data may be specified as a
81
81
  * `string`, an object, or an array of objects. This covers the data types
82
82
  * for the supported signature methods. Defaults to `0x`.
83
83
  */
84
- data: import("superstruct").Struct<`0x${string}` | Record<string, any> | Record<string, any>[], null>;
84
+ data: import("@metamask/superstruct").Struct<`0x${string}` | Record<string, any> | Record<string, any>[], null>;
85
85
  /**
86
86
  * The signature method being used.
87
87
  */
88
- signatureMethod: import("superstruct").Struct<"eth_sign" | "personal_sign" | "eth_signTypedData" | "eth_signTypedData_v3" | "eth_signTypedData_v4", null>;
88
+ signatureMethod: import("@metamask/superstruct").Struct<"eth_sign" | "personal_sign" | "eth_signTypedData" | "eth_signTypedData_v3" | "eth_signTypedData_v4", null>;
89
89
  }>;
90
- export declare const SnapOptionsStruct: import("superstruct").Struct<{
90
+ export declare const SnapOptionsStruct: import("@metamask/superstruct").Struct<{
91
91
  timeout?: number | undefined;
92
92
  }, {
93
93
  /**
94
94
  * The timeout in milliseconds to use for requests to the snap. Defaults to
95
95
  * `1000`.
96
96
  */
97
- timeout: import("superstruct").Struct<number | undefined, null>;
97
+ timeout: import("@metamask/superstruct").Struct<number | undefined, null>;
98
98
  }>;
99
- export declare const JsonRpcMockOptionsStruct: import("superstruct").Struct<{
99
+ export declare const JsonRpcMockOptionsStruct: import("@metamask/superstruct").Struct<{
100
100
  result: import("@metamask/snaps-sdk").Json;
101
101
  method: string;
102
102
  }, {
103
- method: import("superstruct").Struct<string, null>;
104
- result: import("superstruct").Struct<import("@metamask/snaps-sdk").Json, unknown>;
103
+ method: import("@metamask/superstruct").Struct<string, null>;
104
+ result: import("@metamask/superstruct").Struct<import("@metamask/snaps-sdk").Json, unknown>;
105
105
  }>;
106
- export declare const InterfaceStruct: import("superstruct").Struct<{
106
+ export declare const InterfaceStruct: import("@metamask/superstruct").Struct<{
107
107
  content?: import("@metamask/snaps-sdk/jsx").JSXElement | undefined;
108
108
  }, {
109
- content: import("superstruct").Struct<import("@metamask/snaps-sdk/jsx").JSXElement | undefined, null>;
109
+ content: import("@metamask/superstruct").Struct<import("@metamask/snaps-sdk/jsx").JSXElement | undefined, null>;
110
110
  }>;
111
- export declare const SnapResponseWithoutInterfaceStruct: import("superstruct").Struct<{
111
+ export declare const SnapResponseWithoutInterfaceStruct: import("@metamask/superstruct").Struct<{
112
112
  id: string;
113
113
  response: {
114
114
  result: import("@metamask/snaps-sdk").Json;
@@ -121,27 +121,27 @@ export declare const SnapResponseWithoutInterfaceStruct: import("superstruct").S
121
121
  id: string;
122
122
  }[];
123
123
  }, {
124
- id: import("superstruct").Struct<string, null>;
125
- response: import("superstruct").Struct<{
124
+ id: import("@metamask/superstruct").Struct<string, null>;
125
+ response: import("@metamask/superstruct").Struct<{
126
126
  result: import("@metamask/snaps-sdk").Json;
127
127
  } | {
128
128
  error: import("@metamask/snaps-sdk").Json;
129
129
  }, null>;
130
- notifications: import("superstruct").Struct<{
130
+ notifications: import("@metamask/superstruct").Struct<{
131
131
  type: "native" | "inApp";
132
132
  message: string;
133
133
  id: string;
134
- }[], import("superstruct").Struct<{
134
+ }[], import("@metamask/superstruct").Struct<{
135
135
  type: "native" | "inApp";
136
136
  message: string;
137
137
  id: string;
138
138
  }, {
139
- id: import("superstruct").Struct<string, null>;
140
- message: import("superstruct").Struct<string, null>;
141
- type: import("superstruct").Struct<"native" | "inApp", null>;
139
+ id: import("@metamask/superstruct").Struct<string, null>;
140
+ message: import("@metamask/superstruct").Struct<string, null>;
141
+ type: import("@metamask/superstruct").Struct<"native" | "inApp", null>;
142
142
  }>>;
143
143
  }>;
144
- export declare const SnapResponseWithInterfaceStruct: import("superstruct").Struct<{
144
+ export declare const SnapResponseWithInterfaceStruct: import("@metamask/superstruct").Struct<{
145
145
  id: string;
146
146
  response: {
147
147
  result: import("@metamask/snaps-sdk").Json;
@@ -155,28 +155,28 @@ export declare const SnapResponseWithInterfaceStruct: import("superstruct").Stru
155
155
  id: string;
156
156
  }[];
157
157
  }, {
158
- getInterface: import("superstruct").Struct<Function, null>;
159
- id: import("superstruct").Struct<string, null>;
160
- response: import("superstruct").Struct<{
158
+ getInterface: import("@metamask/superstruct").Struct<Function, null>;
159
+ id: import("@metamask/superstruct").Struct<string, null>;
160
+ response: import("@metamask/superstruct").Struct<{
161
161
  result: import("@metamask/snaps-sdk").Json;
162
162
  } | {
163
163
  error: import("@metamask/snaps-sdk").Json;
164
164
  }, null>;
165
- notifications: import("superstruct").Struct<{
165
+ notifications: import("@metamask/superstruct").Struct<{
166
166
  type: "native" | "inApp";
167
167
  message: string;
168
168
  id: string;
169
- }[], import("superstruct").Struct<{
169
+ }[], import("@metamask/superstruct").Struct<{
170
170
  type: "native" | "inApp";
171
171
  message: string;
172
172
  id: string;
173
173
  }, {
174
- id: import("superstruct").Struct<string, null>;
175
- message: import("superstruct").Struct<string, null>;
176
- type: import("superstruct").Struct<"native" | "inApp", null>;
174
+ id: import("@metamask/superstruct").Struct<string, null>;
175
+ message: import("@metamask/superstruct").Struct<string, null>;
176
+ type: import("@metamask/superstruct").Struct<"native" | "inApp", null>;
177
177
  }>>;
178
178
  }>;
179
- export declare const SnapResponseStruct: import("superstruct").Struct<{
179
+ export declare const SnapResponseStruct: import("@metamask/superstruct").Struct<{
180
180
  id: string;
181
181
  response: {
182
182
  result: import("@metamask/snaps-sdk").Json;