@metamask/snaps-controllers 18.0.3 → 19.0.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 (288) hide show
  1. package/CHANGELOG.md +103 -1
  2. package/dist/cronjob/CronjobController-method-action-types.cjs +7 -0
  3. package/dist/cronjob/CronjobController-method-action-types.cjs.map +1 -0
  4. package/dist/cronjob/CronjobController-method-action-types.d.cts +51 -0
  5. package/dist/cronjob/CronjobController-method-action-types.d.cts.map +1 -0
  6. package/dist/cronjob/CronjobController-method-action-types.d.mts +51 -0
  7. package/dist/cronjob/CronjobController-method-action-types.d.mts.map +1 -0
  8. package/dist/cronjob/CronjobController-method-action-types.mjs +6 -0
  9. package/dist/cronjob/CronjobController-method-action-types.mjs.map +1 -0
  10. package/dist/cronjob/CronjobController.cjs +7 -4
  11. package/dist/cronjob/CronjobController.cjs.map +1 -1
  12. package/dist/cronjob/CronjobController.d.cts +7 -24
  13. package/dist/cronjob/CronjobController.d.cts.map +1 -1
  14. package/dist/cronjob/CronjobController.d.mts +7 -24
  15. package/dist/cronjob/CronjobController.d.mts.map +1 -1
  16. package/dist/cronjob/CronjobController.mjs +7 -4
  17. package/dist/cronjob/CronjobController.mjs.map +1 -1
  18. package/dist/cronjob/index.cjs +3 -15
  19. package/dist/cronjob/index.cjs.map +1 -1
  20. package/dist/cronjob/index.d.cts +3 -1
  21. package/dist/cronjob/index.d.cts.map +1 -1
  22. package/dist/cronjob/index.d.mts +3 -1
  23. package/dist/cronjob/index.d.mts.map +1 -1
  24. package/dist/cronjob/index.mjs +1 -1
  25. package/dist/cronjob/index.mjs.map +1 -1
  26. package/dist/insights/SnapInsightsController.cjs +1 -3
  27. package/dist/insights/SnapInsightsController.cjs.map +1 -1
  28. package/dist/insights/SnapInsightsController.d.cts +8 -8
  29. package/dist/insights/SnapInsightsController.d.cts.map +1 -1
  30. package/dist/insights/SnapInsightsController.d.mts +8 -8
  31. package/dist/insights/SnapInsightsController.d.mts.map +1 -1
  32. package/dist/insights/SnapInsightsController.mjs +1 -3
  33. package/dist/insights/SnapInsightsController.mjs.map +1 -1
  34. package/dist/insights/index.cjs +3 -15
  35. package/dist/insights/index.cjs.map +1 -1
  36. package/dist/insights/index.d.cts +2 -1
  37. package/dist/insights/index.d.cts.map +1 -1
  38. package/dist/insights/index.d.mts +2 -1
  39. package/dist/insights/index.d.mts.map +1 -1
  40. package/dist/insights/index.mjs +1 -1
  41. package/dist/insights/index.mjs.map +1 -1
  42. package/dist/interface/SnapInterfaceController-method-action-types.cjs +7 -0
  43. package/dist/interface/SnapInterfaceController-method-action-types.cjs.map +1 -0
  44. package/dist/interface/SnapInterfaceController-method-action-types.d.cts +99 -0
  45. package/dist/interface/SnapInterfaceController-method-action-types.d.cts.map +1 -0
  46. package/dist/interface/SnapInterfaceController-method-action-types.d.mts +99 -0
  47. package/dist/interface/SnapInterfaceController-method-action-types.d.mts.map +1 -0
  48. package/dist/interface/SnapInterfaceController-method-action-types.mjs +6 -0
  49. package/dist/interface/SnapInterfaceController-method-action-types.mjs.map +1 -0
  50. package/dist/interface/SnapInterfaceController.cjs +12 -16
  51. package/dist/interface/SnapInterfaceController.cjs.map +1 -1
  52. package/dist/interface/SnapInterfaceController.d.cts +9 -39
  53. package/dist/interface/SnapInterfaceController.d.cts.map +1 -1
  54. package/dist/interface/SnapInterfaceController.d.mts +9 -39
  55. package/dist/interface/SnapInterfaceController.d.mts.map +1 -1
  56. package/dist/interface/SnapInterfaceController.mjs +12 -16
  57. package/dist/interface/SnapInterfaceController.mjs.map +1 -1
  58. package/dist/interface/index.cjs +3 -15
  59. package/dist/interface/index.cjs.map +1 -1
  60. package/dist/interface/index.d.cts +3 -1
  61. package/dist/interface/index.d.cts.map +1 -1
  62. package/dist/interface/index.d.mts +3 -1
  63. package/dist/interface/index.d.mts.map +1 -1
  64. package/dist/interface/index.mjs +1 -1
  65. package/dist/interface/index.mjs.map +1 -1
  66. package/dist/multichain/MultichainRoutingService-method-action-types.cjs +7 -0
  67. package/dist/multichain/MultichainRoutingService-method-action-types.cjs.map +1 -0
  68. package/dist/multichain/MultichainRoutingService-method-action-types.d.cts +61 -0
  69. package/dist/multichain/MultichainRoutingService-method-action-types.d.cts.map +1 -0
  70. package/dist/multichain/MultichainRoutingService-method-action-types.d.mts +61 -0
  71. package/dist/multichain/MultichainRoutingService-method-action-types.d.mts.map +1 -0
  72. package/dist/multichain/MultichainRoutingService-method-action-types.mjs +6 -0
  73. package/dist/multichain/MultichainRoutingService-method-action-types.mjs.map +1 -0
  74. package/dist/multichain/{MultichainRouter.cjs → MultichainRoutingService.cjs} +14 -13
  75. package/dist/multichain/MultichainRoutingService.cjs.map +1 -0
  76. package/dist/multichain/{MultichainRouter.d.mts → MultichainRoutingService.d.cts} +13 -28
  77. package/dist/multichain/MultichainRoutingService.d.cts.map +1 -0
  78. package/dist/multichain/{MultichainRouter.d.cts → MultichainRoutingService.d.mts} +13 -28
  79. package/dist/multichain/MultichainRoutingService.d.mts.map +1 -0
  80. package/dist/multichain/{MultichainRouter.mjs → MultichainRoutingService.mjs} +12 -11
  81. package/dist/multichain/MultichainRoutingService.mjs.map +1 -0
  82. package/dist/multichain/index.cjs +3 -15
  83. package/dist/multichain/index.cjs.map +1 -1
  84. package/dist/multichain/index.d.cts +3 -1
  85. package/dist/multichain/index.d.cts.map +1 -1
  86. package/dist/multichain/index.d.mts +3 -1
  87. package/dist/multichain/index.d.mts.map +1 -1
  88. package/dist/multichain/index.mjs +1 -1
  89. package/dist/multichain/index.mjs.map +1 -1
  90. package/dist/services/ExecutionService-method-action-types.cjs +7 -0
  91. package/dist/services/ExecutionService-method-action-types.cjs.map +1 -0
  92. package/dist/services/ExecutionService-method-action-types.d.cts +50 -0
  93. package/dist/services/ExecutionService-method-action-types.d.cts.map +1 -0
  94. package/dist/services/ExecutionService-method-action-types.d.mts +50 -0
  95. package/dist/services/ExecutionService-method-action-types.d.mts.map +1 -0
  96. package/dist/services/ExecutionService-method-action-types.mjs +6 -0
  97. package/dist/services/ExecutionService-method-action-types.mjs.map +1 -0
  98. package/dist/services/ExecutionService.cjs +287 -0
  99. package/dist/services/ExecutionService.cjs.map +1 -1
  100. package/dist/services/ExecutionService.d.cts +100 -46
  101. package/dist/services/ExecutionService.d.cts.map +1 -1
  102. package/dist/services/ExecutionService.d.mts +100 -46
  103. package/dist/services/ExecutionService.d.mts.map +1 -1
  104. package/dist/services/ExecutionService.mjs +285 -1
  105. package/dist/services/ExecutionService.mjs.map +1 -1
  106. package/dist/services/browser.cjs +5 -2
  107. package/dist/services/browser.cjs.map +1 -1
  108. package/dist/services/browser.d.cts +4 -2
  109. package/dist/services/browser.d.cts.map +1 -1
  110. package/dist/services/browser.d.mts +4 -2
  111. package/dist/services/browser.d.mts.map +1 -1
  112. package/dist/services/browser.mjs +2 -2
  113. package/dist/services/browser.mjs.map +1 -1
  114. package/dist/services/iframe/IframeExecutionService.cjs +2 -2
  115. package/dist/services/iframe/IframeExecutionService.cjs.map +1 -1
  116. package/dist/services/iframe/IframeExecutionService.d.cts +3 -3
  117. package/dist/services/iframe/IframeExecutionService.d.cts.map +1 -1
  118. package/dist/services/iframe/IframeExecutionService.d.mts +3 -3
  119. package/dist/services/iframe/IframeExecutionService.d.mts.map +1 -1
  120. package/dist/services/iframe/IframeExecutionService.mjs +2 -2
  121. package/dist/services/iframe/IframeExecutionService.mjs.map +1 -1
  122. package/dist/services/index.cjs +5 -1
  123. package/dist/services/index.cjs.map +1 -1
  124. package/dist/services/index.d.cts +4 -2
  125. package/dist/services/index.d.cts.map +1 -1
  126. package/dist/services/index.d.mts +4 -2
  127. package/dist/services/index.d.mts.map +1 -1
  128. package/dist/services/index.mjs +2 -1
  129. package/dist/services/index.mjs.map +1 -1
  130. package/dist/services/multiplex.cjs +27 -0
  131. package/dist/services/multiplex.cjs.map +1 -0
  132. package/dist/services/multiplex.d.cts +11 -0
  133. package/dist/services/multiplex.d.cts.map +1 -0
  134. package/dist/services/multiplex.d.mts +11 -0
  135. package/dist/services/multiplex.d.mts.map +1 -0
  136. package/dist/services/multiplex.mjs +27 -0
  137. package/dist/services/multiplex.mjs.map +1 -0
  138. package/dist/services/node-js/NodeProcessExecutionService.cjs +2 -2
  139. package/dist/services/node-js/NodeProcessExecutionService.cjs.map +1 -1
  140. package/dist/services/node-js/NodeProcessExecutionService.d.cts +3 -3
  141. package/dist/services/node-js/NodeProcessExecutionService.d.cts.map +1 -1
  142. package/dist/services/node-js/NodeProcessExecutionService.d.mts +3 -3
  143. package/dist/services/node-js/NodeProcessExecutionService.d.mts.map +1 -1
  144. package/dist/services/node-js/NodeProcessExecutionService.mjs +2 -2
  145. package/dist/services/node-js/NodeProcessExecutionService.mjs.map +1 -1
  146. package/dist/services/node-js/NodeThreadExecutionService.cjs +2 -5
  147. package/dist/services/node-js/NodeThreadExecutionService.cjs.map +1 -1
  148. package/dist/services/node-js/NodeThreadExecutionService.d.cts +3 -3
  149. package/dist/services/node-js/NodeThreadExecutionService.d.cts.map +1 -1
  150. package/dist/services/node-js/NodeThreadExecutionService.d.mts +3 -3
  151. package/dist/services/node-js/NodeThreadExecutionService.d.mts.map +1 -1
  152. package/dist/services/node-js/NodeThreadExecutionService.mjs +2 -5
  153. package/dist/services/node-js/NodeThreadExecutionService.mjs.map +1 -1
  154. package/dist/services/offscreen/OffscreenExecutionService.cjs.map +1 -1
  155. package/dist/services/offscreen/OffscreenExecutionService.d.cts +1 -1
  156. package/dist/services/offscreen/OffscreenExecutionService.d.cts.map +1 -1
  157. package/dist/services/offscreen/OffscreenExecutionService.d.mts +1 -1
  158. package/dist/services/offscreen/OffscreenExecutionService.d.mts.map +1 -1
  159. package/dist/services/offscreen/OffscreenExecutionService.mjs.map +1 -1
  160. package/dist/services/proxy/ProxyExecutionService.cjs +2 -5
  161. package/dist/services/proxy/ProxyExecutionService.cjs.map +1 -1
  162. package/dist/services/proxy/ProxyExecutionService.d.cts +3 -3
  163. package/dist/services/proxy/ProxyExecutionService.d.cts.map +1 -1
  164. package/dist/services/proxy/ProxyExecutionService.d.mts +3 -3
  165. package/dist/services/proxy/ProxyExecutionService.d.mts.map +1 -1
  166. package/dist/services/proxy/ProxyExecutionService.mjs +2 -5
  167. package/dist/services/proxy/ProxyExecutionService.mjs.map +1 -1
  168. package/dist/services/webview/WebViewExecutionService.cjs +2 -2
  169. package/dist/services/webview/WebViewExecutionService.cjs.map +1 -1
  170. package/dist/services/webview/WebViewExecutionService.d.cts +3 -3
  171. package/dist/services/webview/WebViewExecutionService.d.cts.map +1 -1
  172. package/dist/services/webview/WebViewExecutionService.d.mts +3 -3
  173. package/dist/services/webview/WebViewExecutionService.d.mts.map +1 -1
  174. package/dist/services/webview/WebViewExecutionService.mjs +2 -2
  175. package/dist/services/webview/WebViewExecutionService.mjs.map +1 -1
  176. package/dist/snaps/SnapController-method-action-types.cjs +7 -0
  177. package/dist/snaps/SnapController-method-action-types.cjs.map +1 -0
  178. package/dist/snaps/SnapController-method-action-types.d.cts +284 -0
  179. package/dist/snaps/SnapController-method-action-types.d.cts.map +1 -0
  180. package/dist/snaps/SnapController-method-action-types.d.mts +284 -0
  181. package/dist/snaps/SnapController-method-action-types.d.mts.map +1 -0
  182. package/dist/snaps/SnapController-method-action-types.mjs +6 -0
  183. package/dist/snaps/SnapController-method-action-types.mjs.map +1 -0
  184. package/dist/snaps/SnapController.cjs +118 -113
  185. package/dist/snaps/SnapController.cjs.map +1 -1
  186. package/dist/snaps/SnapController.d.cts +32 -189
  187. package/dist/snaps/SnapController.d.cts.map +1 -1
  188. package/dist/snaps/SnapController.d.mts +32 -189
  189. package/dist/snaps/SnapController.d.mts.map +1 -1
  190. package/dist/snaps/SnapController.mjs +119 -114
  191. package/dist/snaps/SnapController.mjs.map +1 -1
  192. package/dist/snaps/index.cjs +3 -1
  193. package/dist/snaps/index.cjs.map +1 -1
  194. package/dist/snaps/index.d.cts +3 -1
  195. package/dist/snaps/index.d.cts.map +1 -1
  196. package/dist/snaps/index.d.mts +3 -1
  197. package/dist/snaps/index.d.mts.map +1 -1
  198. package/dist/snaps/index.mjs +1 -1
  199. package/dist/snaps/index.mjs.map +1 -1
  200. package/dist/snaps/registry/SnapRegistryController-method-action-types.cjs +7 -0
  201. package/dist/snaps/registry/SnapRegistryController-method-action-types.cjs.map +1 -0
  202. package/dist/snaps/registry/SnapRegistryController-method-action-types.d.cts +46 -0
  203. package/dist/snaps/registry/SnapRegistryController-method-action-types.d.cts.map +1 -0
  204. package/dist/snaps/registry/SnapRegistryController-method-action-types.d.mts +46 -0
  205. package/dist/snaps/registry/SnapRegistryController-method-action-types.d.mts.map +1 -0
  206. package/dist/snaps/registry/SnapRegistryController-method-action-types.mjs +6 -0
  207. package/dist/snaps/registry/SnapRegistryController-method-action-types.mjs.map +1 -0
  208. package/dist/snaps/registry/{json.cjs → SnapRegistryController.cjs} +27 -24
  209. package/dist/snaps/registry/SnapRegistryController.cjs.map +1 -0
  210. package/dist/snaps/registry/SnapRegistryController.d.cts +67 -0
  211. package/dist/snaps/registry/SnapRegistryController.d.cts.map +1 -0
  212. package/dist/snaps/registry/SnapRegistryController.d.mts +67 -0
  213. package/dist/snaps/registry/SnapRegistryController.d.mts.map +1 -0
  214. package/dist/snaps/registry/{json.mjs → SnapRegistryController.mjs} +25 -22
  215. package/dist/snaps/registry/SnapRegistryController.mjs.map +1 -0
  216. package/dist/snaps/registry/index.cjs +5 -16
  217. package/dist/snaps/registry/index.cjs.map +1 -1
  218. package/dist/snaps/registry/index.d.cts +5 -2
  219. package/dist/snaps/registry/index.d.cts.map +1 -1
  220. package/dist/snaps/registry/index.d.mts +5 -2
  221. package/dist/snaps/registry/index.d.mts.map +1 -1
  222. package/dist/snaps/registry/index.mjs +2 -2
  223. package/dist/snaps/registry/index.mjs.map +1 -1
  224. package/dist/snaps/registry/types.cjs +11 -0
  225. package/dist/snaps/registry/types.cjs.map +1 -0
  226. package/dist/snaps/registry/types.d.cts +20 -0
  227. package/dist/snaps/registry/types.d.cts.map +1 -0
  228. package/dist/snaps/registry/types.d.mts +20 -0
  229. package/dist/snaps/registry/types.d.mts.map +1 -0
  230. package/dist/snaps/registry/types.mjs +8 -0
  231. package/dist/snaps/registry/types.mjs.map +1 -0
  232. package/dist/types/controllers.cjs.map +1 -1
  233. package/dist/types/controllers.d.cts +1 -1
  234. package/dist/types/controllers.d.cts.map +1 -1
  235. package/dist/types/controllers.d.mts +1 -1
  236. package/dist/types/controllers.d.mts.map +1 -1
  237. package/dist/types/controllers.mjs.map +1 -1
  238. package/dist/websocket/WebSocketService-method-action-types.cjs +7 -0
  239. package/dist/websocket/WebSocketService-method-action-types.cjs.map +1 -0
  240. package/dist/websocket/WebSocketService-method-action-types.d.cts +54 -0
  241. package/dist/websocket/WebSocketService-method-action-types.d.cts.map +1 -0
  242. package/dist/websocket/WebSocketService-method-action-types.d.mts +54 -0
  243. package/dist/websocket/WebSocketService-method-action-types.d.mts.map +1 -0
  244. package/dist/websocket/WebSocketService-method-action-types.mjs +6 -0
  245. package/dist/websocket/WebSocketService-method-action-types.mjs.map +1 -0
  246. package/dist/websocket/WebSocketService.cjs +14 -11
  247. package/dist/websocket/WebSocketService.cjs.map +1 -1
  248. package/dist/websocket/WebSocketService.d.cts +43 -22
  249. package/dist/websocket/WebSocketService.d.cts.map +1 -1
  250. package/dist/websocket/WebSocketService.d.mts +43 -22
  251. package/dist/websocket/WebSocketService.d.mts.map +1 -1
  252. package/dist/websocket/WebSocketService.mjs +14 -11
  253. package/dist/websocket/WebSocketService.mjs.map +1 -1
  254. package/dist/websocket/index.cjs +3 -15
  255. package/dist/websocket/index.cjs.map +1 -1
  256. package/dist/websocket/index.d.cts +3 -1
  257. package/dist/websocket/index.d.cts.map +1 -1
  258. package/dist/websocket/index.d.mts +3 -1
  259. package/dist/websocket/index.d.mts.map +1 -1
  260. package/dist/websocket/index.mjs +1 -1
  261. package/dist/websocket/index.mjs.map +1 -1
  262. package/package.json +8 -7
  263. package/dist/multichain/MultichainRouter.cjs.map +0 -1
  264. package/dist/multichain/MultichainRouter.d.cts.map +0 -1
  265. package/dist/multichain/MultichainRouter.d.mts.map +0 -1
  266. package/dist/multichain/MultichainRouter.mjs.map +0 -1
  267. package/dist/services/AbstractExecutionService.cjs +0 -307
  268. package/dist/services/AbstractExecutionService.cjs.map +0 -1
  269. package/dist/services/AbstractExecutionService.d.cts +0 -107
  270. package/dist/services/AbstractExecutionService.d.cts.map +0 -1
  271. package/dist/services/AbstractExecutionService.d.mts +0 -107
  272. package/dist/services/AbstractExecutionService.d.mts.map +0 -1
  273. package/dist/services/AbstractExecutionService.mjs +0 -306
  274. package/dist/services/AbstractExecutionService.mjs.map +0 -1
  275. package/dist/snaps/registry/json.cjs.map +0 -1
  276. package/dist/snaps/registry/json.d.cts +0 -58
  277. package/dist/snaps/registry/json.d.cts.map +0 -1
  278. package/dist/snaps/registry/json.d.mts +0 -58
  279. package/dist/snaps/registry/json.d.mts.map +0 -1
  280. package/dist/snaps/registry/json.mjs.map +0 -1
  281. package/dist/snaps/registry/registry.cjs +0 -11
  282. package/dist/snaps/registry/registry.cjs.map +0 -1
  283. package/dist/snaps/registry/registry.d.cts +0 -41
  284. package/dist/snaps/registry/registry.d.cts.map +0 -1
  285. package/dist/snaps/registry/registry.d.mts +0 -41
  286. package/dist/snaps/registry/registry.d.mts.map +0 -1
  287. package/dist/snaps/registry/registry.mjs +0 -8
  288. package/dist/snaps/registry/registry.mjs.map +0 -1
@@ -0,0 +1,284 @@
1
+ /**
2
+ * This file is auto generated by `scripts/generate-method-action-types.ts`.
3
+ * Do not edit manually.
4
+ */
5
+ import type { SnapController } from "./SnapController.mjs";
6
+ /**
7
+ * Initialise the SnapController.
8
+ *
9
+ * Currently this method sets up the controller and calls the `onStart` lifecycle hook for all
10
+ * runnable Snaps.
11
+ *
12
+ * @param waitForPlatform - Whether to wait for the platform to be ready before returning.
13
+ */
14
+ export type SnapControllerInitAction = {
15
+ type: `SnapController:init`;
16
+ handler: SnapController['init'];
17
+ };
18
+ /**
19
+ * Trigger an update of the registry.
20
+ *
21
+ * As a side-effect of this, preinstalled Snaps may be updated and Snaps may be blocked/unblocked.
22
+ */
23
+ export type SnapControllerUpdateRegistryAction = {
24
+ type: `SnapController:updateRegistry`;
25
+ handler: SnapController['updateRegistry'];
26
+ };
27
+ /**
28
+ * Enables the given snap. A snap can only be started if it is enabled. A snap
29
+ * can only be enabled if it isn't blocked.
30
+ *
31
+ * @param snapId - The id of the Snap to enable.
32
+ */
33
+ export type SnapControllerEnableSnapAction = {
34
+ type: `SnapController:enableSnap`;
35
+ handler: SnapController['enableSnap'];
36
+ };
37
+ /**
38
+ * Disables the given snap. A snap can only be started if it is enabled.
39
+ *
40
+ * @param snapId - The id of the Snap to disable.
41
+ * @returns A promise that resolves once the snap has been disabled.
42
+ */
43
+ export type SnapControllerDisableSnapAction = {
44
+ type: `SnapController:disableSnap`;
45
+ handler: SnapController['disableSnap'];
46
+ };
47
+ /**
48
+ * Stops the given snap, removes all hooks, closes all connections, and
49
+ * terminates its worker.
50
+ *
51
+ * @param snapId - The id of the Snap to stop.
52
+ * @param statusEvent - The Snap status event that caused the snap to be
53
+ * stopped.
54
+ */
55
+ export type SnapControllerStopSnapAction = {
56
+ type: `SnapController:stopSnap`;
57
+ handler: SnapController['stopSnap'];
58
+ };
59
+ /**
60
+ * Stops all running snaps, removes all hooks, closes all connections, and
61
+ * terminates their workers.
62
+ *
63
+ * @param statusEvent - The Snap status event that caused the snap to be
64
+ * stopped.
65
+ */
66
+ export type SnapControllerStopAllSnapsAction = {
67
+ type: `SnapController:stopAllSnaps`;
68
+ handler: SnapController['stopAllSnaps'];
69
+ };
70
+ /**
71
+ * Returns whether the given snap is running.
72
+ * Throws an error if the snap doesn't exist.
73
+ *
74
+ * @param snapId - The id of the Snap to check.
75
+ * @returns `true` if the snap is running, otherwise `false`.
76
+ */
77
+ export type SnapControllerIsSnapRunningAction = {
78
+ type: `SnapController:isSnapRunning`;
79
+ handler: SnapController['isSnapRunning'];
80
+ };
81
+ /**
82
+ * Returns whether the given snap has been added to state.
83
+ *
84
+ * @param snapId - The id of the Snap to check for.
85
+ * @returns `true` if the snap exists in the controller state, otherwise `false`.
86
+ */
87
+ export type SnapControllerHasSnapAction = {
88
+ type: `SnapController:hasSnap`;
89
+ handler: SnapController['hasSnap'];
90
+ };
91
+ /**
92
+ * Gets the snap with the given id if it exists, including all data.
93
+ * This should not be used if the snap is to be serializable, as e.g.
94
+ * the snap sourceCode may be quite large.
95
+ *
96
+ * @param snapId - The id of the Snap to get.
97
+ * @returns The entire snap object from the controller state.
98
+ */
99
+ export type SnapControllerGetSnapAction = {
100
+ type: `SnapController:getSnap`;
101
+ handler: SnapController['getSnap'];
102
+ };
103
+ /**
104
+ * Updates the own state of the snap with the given id.
105
+ * This is distinct from the state MetaMask uses to manage snaps.
106
+ *
107
+ * @param snapId - The id of the Snap whose state should be updated.
108
+ * @param newSnapState - The new state of the snap.
109
+ * @param encrypted - A flag to indicate whether to use encrypted storage or not.
110
+ */
111
+ export type SnapControllerUpdateSnapStateAction = {
112
+ type: `SnapController:updateSnapState`;
113
+ handler: SnapController['updateSnapState'];
114
+ };
115
+ /**
116
+ * Clears the state of the snap with the given id.
117
+ * This is distinct from the state MetaMask uses to manage snaps.
118
+ *
119
+ * @param snapId - The id of the Snap whose state should be cleared.
120
+ * @param encrypted - A flag to indicate whether to use encrypted storage or not.
121
+ */
122
+ export type SnapControllerClearSnapStateAction = {
123
+ type: `SnapController:clearSnapState`;
124
+ handler: SnapController['clearSnapState'];
125
+ };
126
+ /**
127
+ * Gets the own state of the snap with the given id.
128
+ * This is distinct from the state MetaMask uses to manage snaps.
129
+ *
130
+ * @param snapId - The id of the Snap whose state to get.
131
+ * @param encrypted - A flag to indicate whether to use encrypted storage or not.
132
+ * @returns The requested snap state or null if no state exists.
133
+ */
134
+ export type SnapControllerGetSnapStateAction = {
135
+ type: `SnapController:getSnapState`;
136
+ handler: SnapController['getSnapState'];
137
+ };
138
+ /**
139
+ * Gets a static auxiliary snap file in a chosen file encoding.
140
+ *
141
+ * @param snapId - The id of the Snap whose state to get.
142
+ * @param path - The path to the requested file.
143
+ * @param encoding - An optional requested file encoding.
144
+ * @returns The file requested in the chosen file encoding or null if the file is not found.
145
+ */
146
+ export type SnapControllerGetSnapFileAction = {
147
+ type: `SnapController:getSnapFile`;
148
+ handler: SnapController['getSnapFile'];
149
+ };
150
+ /**
151
+ * Determine if a given Snap ID supports a given minimum version of the Snaps platform
152
+ * by inspecting the platformVersion in the Snap manifest.
153
+ *
154
+ * @param snapId - The Snap ID.
155
+ * @param version - The version.
156
+ * @returns True if the platform version is equal or greater to the passed version, false otherwise.
157
+ */
158
+ export type SnapControllerIsMinimumPlatformVersionAction = {
159
+ type: `SnapController:isMinimumPlatformVersion`;
160
+ handler: SnapController['isMinimumPlatformVersion'];
161
+ };
162
+ /**
163
+ * Completely clear the controller's state: delete all associated data,
164
+ * handlers, event listeners, and permissions; tear down all snap providers.
165
+ * Also re-initializes the controller after clearing the state.
166
+ */
167
+ export type SnapControllerClearStateAction = {
168
+ type: `SnapController:clearState`;
169
+ handler: SnapController['clearState'];
170
+ };
171
+ /**
172
+ * Removes the given snap from state, and clears all associated handlers
173
+ * and listeners.
174
+ *
175
+ * @param snapId - The id of the Snap.
176
+ * @returns A promise that resolves once the snap has been removed.
177
+ */
178
+ export type SnapControllerRemoveSnapAction = {
179
+ type: `SnapController:removeSnap`;
180
+ handler: SnapController['removeSnap'];
181
+ };
182
+ /**
183
+ * Stops the given snaps, removes them from state, and clears all associated
184
+ * permissions, handlers, and listeners.
185
+ *
186
+ * @param snapIds - The ids of the Snaps.
187
+ */
188
+ export type SnapControllerRemoveSnapsAction = {
189
+ type: `SnapController:removeSnaps`;
190
+ handler: SnapController['removeSnaps'];
191
+ };
192
+ /**
193
+ * Disconnect the Snap from the given origin, meaning the origin can no longer
194
+ * interact with the Snap until it is reconnected.
195
+ *
196
+ * @param origin - The origin from which to remove the Snap.
197
+ * @param snapId - The id of the snap to remove.
198
+ */
199
+ export type SnapControllerDisconnectOriginAction = {
200
+ type: `SnapController:disconnectOrigin`;
201
+ handler: SnapController['disconnectOrigin'];
202
+ };
203
+ /**
204
+ * Checks if a list of permissions are dynamic and allowed to be revoked, if they are they will all be revoked.
205
+ *
206
+ * @param snapId - The snap ID.
207
+ * @param permissionNames - The names of the permissions.
208
+ * @throws If non-dynamic permissions are passed.
209
+ */
210
+ export type SnapControllerRevokeDynamicSnapPermissionsAction = {
211
+ type: `SnapController:revokeDynamicSnapPermissions`;
212
+ handler: SnapController['revokeDynamicSnapPermissions'];
213
+ };
214
+ /**
215
+ * Gets all snaps in their truncated format.
216
+ *
217
+ * @returns All installed snaps in their truncated format.
218
+ */
219
+ export type SnapControllerGetAllSnapsAction = {
220
+ type: `SnapController:getAllSnaps`;
221
+ handler: SnapController['getAllSnaps'];
222
+ };
223
+ /**
224
+ * Gets all runnable snaps.
225
+ *
226
+ * @returns All runnable snaps.
227
+ */
228
+ export type SnapControllerGetRunnableSnapsAction = {
229
+ type: `SnapController:getRunnableSnaps`;
230
+ handler: SnapController['getRunnableSnaps'];
231
+ };
232
+ /**
233
+ * Gets the serialized permitted snaps of the given origin, if any.
234
+ *
235
+ * @param origin - The origin whose permitted snaps to retrieve.
236
+ * @returns The serialized permitted snaps for the origin.
237
+ */
238
+ export type SnapControllerGetPermittedSnapsAction = {
239
+ type: `SnapController:getPermittedSnaps`;
240
+ handler: SnapController['getPermittedSnaps'];
241
+ };
242
+ /**
243
+ * Installs the snaps requested by the given origin, returning the snap
244
+ * object if the origin is permitted to install it, and an authorization error
245
+ * otherwise.
246
+ *
247
+ * @param origin - The origin that requested to install the snaps.
248
+ * @param requestedSnaps - The snaps to install.
249
+ * @returns An object of snap ids and snap objects, or errors if a
250
+ * snap couldn't be installed.
251
+ */
252
+ export type SnapControllerInstallSnapsAction = {
253
+ type: `SnapController:installSnaps`;
254
+ handler: SnapController['installSnaps'];
255
+ };
256
+ /**
257
+ * Passes a JSON-RPC request object to the RPC handler function of a snap.
258
+ *
259
+ * @param options - A bag of options.
260
+ * @param options.snapId - The ID of the recipient snap.
261
+ * @param options.origin - The origin of the RPC request.
262
+ * @param options.handler - The handler to trigger on the snap for the request.
263
+ * @param options.request - The JSON-RPC request object.
264
+ * @returns The result of the JSON-RPC request.
265
+ */
266
+ export type SnapControllerHandleRequestAction = {
267
+ type: `SnapController:handleRequest`;
268
+ handler: SnapController['handleRequest'];
269
+ };
270
+ /**
271
+ * Set the active state of the client. This will trigger the `onActive` or
272
+ * `onInactive` lifecycle hooks for all Snaps.
273
+ *
274
+ * @param active - A boolean indicating whether the client is active or not.
275
+ */
276
+ export type SnapControllerSetClientActiveAction = {
277
+ type: `SnapController:setClientActive`;
278
+ handler: SnapController['setClientActive'];
279
+ };
280
+ /**
281
+ * Union of all SnapController action types.
282
+ */
283
+ export type SnapControllerMethodActions = SnapControllerInitAction | SnapControllerUpdateRegistryAction | SnapControllerEnableSnapAction | SnapControllerDisableSnapAction | SnapControllerStopSnapAction | SnapControllerStopAllSnapsAction | SnapControllerIsSnapRunningAction | SnapControllerHasSnapAction | SnapControllerGetSnapAction | SnapControllerUpdateSnapStateAction | SnapControllerClearSnapStateAction | SnapControllerGetSnapStateAction | SnapControllerGetSnapFileAction | SnapControllerIsMinimumPlatformVersionAction | SnapControllerClearStateAction | SnapControllerRemoveSnapAction | SnapControllerRemoveSnapsAction | SnapControllerDisconnectOriginAction | SnapControllerRevokeDynamicSnapPermissionsAction | SnapControllerGetAllSnapsAction | SnapControllerGetRunnableSnapsAction | SnapControllerGetPermittedSnapsAction | SnapControllerInstallSnapsAction | SnapControllerHandleRequestAction | SnapControllerSetClientActiveAction;
284
+ //# sourceMappingURL=SnapController-method-action-types.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SnapController-method-action-types.d.mts","sourceRoot":"","sources":["../../src/snaps/SnapController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,6BAAyB;AAEvD;;;;;;;G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B,GAC5B,gCAAgC,GAChC,iCAAiC,GACjC,2BAA2B,GAC3B,2BAA2B,GAC3B,mCAAmC,GACnC,kCAAkC,GAClC,gCAAgC,GAChC,+BAA+B,GAC/B,4CAA4C,GAC5C,8BAA8B,GAC9B,8BAA8B,GAC9B,+BAA+B,GAC/B,oCAAoC,GACpC,gDAAgD,GAChD,+BAA+B,GAC/B,oCAAoC,GACpC,qCAAqC,GACrC,gCAAgC,GAChC,iCAAiC,GACjC,mCAAmC,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * This file is auto generated by `scripts/generate-method-action-types.ts`.
3
+ * Do not edit manually.
4
+ */
5
+ export {};
6
+ //# sourceMappingURL=SnapController-method-action-types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SnapController-method-action-types.mjs","sourceRoot":"","sources":["../../src/snaps/SnapController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated by `scripts/generate-method-action-types.ts`.\n * Do not edit manually.\n */\n\nimport type { SnapController } from './SnapController';\n\n/**\n * Initialise the SnapController.\n *\n * Currently this method sets up the controller and calls the `onStart` lifecycle hook for all\n * runnable Snaps.\n *\n * @param waitForPlatform - Whether to wait for the platform to be ready before returning.\n */\nexport type SnapControllerInitAction = {\n type: `SnapController:init`;\n handler: SnapController['init'];\n};\n\n/**\n * Trigger an update of the registry.\n *\n * As a side-effect of this, preinstalled Snaps may be updated and Snaps may be blocked/unblocked.\n */\nexport type SnapControllerUpdateRegistryAction = {\n type: `SnapController:updateRegistry`;\n handler: SnapController['updateRegistry'];\n};\n\n/**\n * Enables the given snap. A snap can only be started if it is enabled. A snap\n * can only be enabled if it isn't blocked.\n *\n * @param snapId - The id of the Snap to enable.\n */\nexport type SnapControllerEnableSnapAction = {\n type: `SnapController:enableSnap`;\n handler: SnapController['enableSnap'];\n};\n\n/**\n * Disables the given snap. A snap can only be started if it is enabled.\n *\n * @param snapId - The id of the Snap to disable.\n * @returns A promise that resolves once the snap has been disabled.\n */\nexport type SnapControllerDisableSnapAction = {\n type: `SnapController:disableSnap`;\n handler: SnapController['disableSnap'];\n};\n\n/**\n * Stops the given snap, removes all hooks, closes all connections, and\n * terminates its worker.\n *\n * @param snapId - The id of the Snap to stop.\n * @param statusEvent - The Snap status event that caused the snap to be\n * stopped.\n */\nexport type SnapControllerStopSnapAction = {\n type: `SnapController:stopSnap`;\n handler: SnapController['stopSnap'];\n};\n\n/**\n * Stops all running snaps, removes all hooks, closes all connections, and\n * terminates their workers.\n *\n * @param statusEvent - The Snap status event that caused the snap to be\n * stopped.\n */\nexport type SnapControllerStopAllSnapsAction = {\n type: `SnapController:stopAllSnaps`;\n handler: SnapController['stopAllSnaps'];\n};\n\n/**\n * Returns whether the given snap is running.\n * Throws an error if the snap doesn't exist.\n *\n * @param snapId - The id of the Snap to check.\n * @returns `true` if the snap is running, otherwise `false`.\n */\nexport type SnapControllerIsSnapRunningAction = {\n type: `SnapController:isSnapRunning`;\n handler: SnapController['isSnapRunning'];\n};\n\n/**\n * Returns whether the given snap has been added to state.\n *\n * @param snapId - The id of the Snap to check for.\n * @returns `true` if the snap exists in the controller state, otherwise `false`.\n */\nexport type SnapControllerHasSnapAction = {\n type: `SnapController:hasSnap`;\n handler: SnapController['hasSnap'];\n};\n\n/**\n * Gets the snap with the given id if it exists, including all data.\n * This should not be used if the snap is to be serializable, as e.g.\n * the snap sourceCode may be quite large.\n *\n * @param snapId - The id of the Snap to get.\n * @returns The entire snap object from the controller state.\n */\nexport type SnapControllerGetSnapAction = {\n type: `SnapController:getSnap`;\n handler: SnapController['getSnap'];\n};\n\n/**\n * Updates the own state of the snap with the given id.\n * This is distinct from the state MetaMask uses to manage snaps.\n *\n * @param snapId - The id of the Snap whose state should be updated.\n * @param newSnapState - The new state of the snap.\n * @param encrypted - A flag to indicate whether to use encrypted storage or not.\n */\nexport type SnapControllerUpdateSnapStateAction = {\n type: `SnapController:updateSnapState`;\n handler: SnapController['updateSnapState'];\n};\n\n/**\n * Clears the state of the snap with the given id.\n * This is distinct from the state MetaMask uses to manage snaps.\n *\n * @param snapId - The id of the Snap whose state should be cleared.\n * @param encrypted - A flag to indicate whether to use encrypted storage or not.\n */\nexport type SnapControllerClearSnapStateAction = {\n type: `SnapController:clearSnapState`;\n handler: SnapController['clearSnapState'];\n};\n\n/**\n * Gets the own state of the snap with the given id.\n * This is distinct from the state MetaMask uses to manage snaps.\n *\n * @param snapId - The id of the Snap whose state to get.\n * @param encrypted - A flag to indicate whether to use encrypted storage or not.\n * @returns The requested snap state or null if no state exists.\n */\nexport type SnapControllerGetSnapStateAction = {\n type: `SnapController:getSnapState`;\n handler: SnapController['getSnapState'];\n};\n\n/**\n * Gets a static auxiliary snap file in a chosen file encoding.\n *\n * @param snapId - The id of the Snap whose state to get.\n * @param path - The path to the requested file.\n * @param encoding - An optional requested file encoding.\n * @returns The file requested in the chosen file encoding or null if the file is not found.\n */\nexport type SnapControllerGetSnapFileAction = {\n type: `SnapController:getSnapFile`;\n handler: SnapController['getSnapFile'];\n};\n\n/**\n * Determine if a given Snap ID supports a given minimum version of the Snaps platform\n * by inspecting the platformVersion in the Snap manifest.\n *\n * @param snapId - The Snap ID.\n * @param version - The version.\n * @returns True if the platform version is equal or greater to the passed version, false otherwise.\n */\nexport type SnapControllerIsMinimumPlatformVersionAction = {\n type: `SnapController:isMinimumPlatformVersion`;\n handler: SnapController['isMinimumPlatformVersion'];\n};\n\n/**\n * Completely clear the controller's state: delete all associated data,\n * handlers, event listeners, and permissions; tear down all snap providers.\n * Also re-initializes the controller after clearing the state.\n */\nexport type SnapControllerClearStateAction = {\n type: `SnapController:clearState`;\n handler: SnapController['clearState'];\n};\n\n/**\n * Removes the given snap from state, and clears all associated handlers\n * and listeners.\n *\n * @param snapId - The id of the Snap.\n * @returns A promise that resolves once the snap has been removed.\n */\nexport type SnapControllerRemoveSnapAction = {\n type: `SnapController:removeSnap`;\n handler: SnapController['removeSnap'];\n};\n\n/**\n * Stops the given snaps, removes them from state, and clears all associated\n * permissions, handlers, and listeners.\n *\n * @param snapIds - The ids of the Snaps.\n */\nexport type SnapControllerRemoveSnapsAction = {\n type: `SnapController:removeSnaps`;\n handler: SnapController['removeSnaps'];\n};\n\n/**\n * Disconnect the Snap from the given origin, meaning the origin can no longer\n * interact with the Snap until it is reconnected.\n *\n * @param origin - The origin from which to remove the Snap.\n * @param snapId - The id of the snap to remove.\n */\nexport type SnapControllerDisconnectOriginAction = {\n type: `SnapController:disconnectOrigin`;\n handler: SnapController['disconnectOrigin'];\n};\n\n/**\n * Checks if a list of permissions are dynamic and allowed to be revoked, if they are they will all be revoked.\n *\n * @param snapId - The snap ID.\n * @param permissionNames - The names of the permissions.\n * @throws If non-dynamic permissions are passed.\n */\nexport type SnapControllerRevokeDynamicSnapPermissionsAction = {\n type: `SnapController:revokeDynamicSnapPermissions`;\n handler: SnapController['revokeDynamicSnapPermissions'];\n};\n\n/**\n * Gets all snaps in their truncated format.\n *\n * @returns All installed snaps in their truncated format.\n */\nexport type SnapControllerGetAllSnapsAction = {\n type: `SnapController:getAllSnaps`;\n handler: SnapController['getAllSnaps'];\n};\n\n/**\n * Gets all runnable snaps.\n *\n * @returns All runnable snaps.\n */\nexport type SnapControllerGetRunnableSnapsAction = {\n type: `SnapController:getRunnableSnaps`;\n handler: SnapController['getRunnableSnaps'];\n};\n\n/**\n * Gets the serialized permitted snaps of the given origin, if any.\n *\n * @param origin - The origin whose permitted snaps to retrieve.\n * @returns The serialized permitted snaps for the origin.\n */\nexport type SnapControllerGetPermittedSnapsAction = {\n type: `SnapController:getPermittedSnaps`;\n handler: SnapController['getPermittedSnaps'];\n};\n\n/**\n * Installs the snaps requested by the given origin, returning the snap\n * object if the origin is permitted to install it, and an authorization error\n * otherwise.\n *\n * @param origin - The origin that requested to install the snaps.\n * @param requestedSnaps - The snaps to install.\n * @returns An object of snap ids and snap objects, or errors if a\n * snap couldn't be installed.\n */\nexport type SnapControllerInstallSnapsAction = {\n type: `SnapController:installSnaps`;\n handler: SnapController['installSnaps'];\n};\n\n/**\n * Passes a JSON-RPC request object to the RPC handler function of a snap.\n *\n * @param options - A bag of options.\n * @param options.snapId - The ID of the recipient snap.\n * @param options.origin - The origin of the RPC request.\n * @param options.handler - The handler to trigger on the snap for the request.\n * @param options.request - The JSON-RPC request object.\n * @returns The result of the JSON-RPC request.\n */\nexport type SnapControllerHandleRequestAction = {\n type: `SnapController:handleRequest`;\n handler: SnapController['handleRequest'];\n};\n\n/**\n * Set the active state of the client. This will trigger the `onActive` or\n * `onInactive` lifecycle hooks for all Snaps.\n *\n * @param active - A boolean indicating whether the client is active or not.\n */\nexport type SnapControllerSetClientActiveAction = {\n type: `SnapController:setClientActive`;\n handler: SnapController['setClientActive'];\n};\n\n/**\n * Union of all SnapController action types.\n */\nexport type SnapControllerMethodActions =\n | SnapControllerInitAction\n | SnapControllerUpdateRegistryAction\n | SnapControllerEnableSnapAction\n | SnapControllerDisableSnapAction\n | SnapControllerStopSnapAction\n | SnapControllerStopAllSnapsAction\n | SnapControllerIsSnapRunningAction\n | SnapControllerHasSnapAction\n | SnapControllerGetSnapAction\n | SnapControllerUpdateSnapStateAction\n | SnapControllerClearSnapStateAction\n | SnapControllerGetSnapStateAction\n | SnapControllerGetSnapFileAction\n | SnapControllerIsMinimumPlatformVersionAction\n | SnapControllerClearStateAction\n | SnapControllerRemoveSnapAction\n | SnapControllerRemoveSnapsAction\n | SnapControllerDisconnectOriginAction\n | SnapControllerRevokeDynamicSnapPermissionsAction\n | SnapControllerGetAllSnapsAction\n | SnapControllerGetRunnableSnapsAction\n | SnapControllerGetPermittedSnapsAction\n | SnapControllerInstallSnapsAction\n | SnapControllerHandleRequestAction\n | SnapControllerSetClientActiveAction;\n"]}