@metamask/snaps-jest 8.3.1 → 8.4.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 (296) hide show
  1. package/CHANGELOG.md +16 -1
  2. package/dist/environment.cjs +2 -1
  3. package/dist/environment.cjs.map +1 -1
  4. package/dist/environment.d.cts +1 -1
  5. package/dist/environment.d.cts.map +1 -1
  6. package/dist/environment.d.mts +1 -1
  7. package/dist/environment.d.mts.map +1 -1
  8. package/dist/environment.mjs +3 -2
  9. package/dist/environment.mjs.map +1 -1
  10. package/dist/helpers.cjs +13 -80
  11. package/dist/helpers.cjs.map +1 -1
  12. package/dist/helpers.d.cts +2 -44
  13. package/dist/helpers.d.cts.map +1 -1
  14. package/dist/helpers.d.mts +2 -44
  15. package/dist/helpers.d.mts.map +1 -1
  16. package/dist/helpers.mjs +4 -64
  17. package/dist/helpers.mjs.map +1 -1
  18. package/dist/index.cjs +8 -1
  19. package/dist/index.cjs.map +1 -1
  20. package/dist/index.d.cts +1 -0
  21. package/dist/index.d.cts.map +1 -1
  22. package/dist/index.d.mts +1 -0
  23. package/dist/index.d.mts.map +1 -1
  24. package/dist/index.mjs +1 -0
  25. package/dist/index.mjs.map +1 -1
  26. package/dist/internals/environment.d.cts +1 -1
  27. package/dist/internals/environment.d.mts +1 -1
  28. package/dist/internals/index.cjs +0 -3
  29. package/dist/internals/index.cjs.map +1 -1
  30. package/dist/internals/index.d.cts +0 -3
  31. package/dist/internals/index.d.cts.map +1 -1
  32. package/dist/internals/index.d.mts +0 -3
  33. package/dist/internals/index.d.mts.map +1 -1
  34. package/dist/internals/index.mjs +0 -3
  35. package/dist/internals/index.mjs.map +1 -1
  36. package/dist/matchers.cjs +3 -3
  37. package/dist/matchers.cjs.map +1 -1
  38. package/dist/matchers.d.cts.map +1 -1
  39. package/dist/matchers.d.mts.map +1 -1
  40. package/dist/matchers.mjs +1 -1
  41. package/dist/matchers.mjs.map +1 -1
  42. package/dist/types/types.cjs.map +1 -1
  43. package/dist/types/types.d.cts +8 -1
  44. package/dist/types/types.d.cts.map +1 -1
  45. package/dist/types/types.d.mts +8 -1
  46. package/dist/types/types.d.mts.map +1 -1
  47. package/dist/types/types.mjs.map +1 -1
  48. package/package.json +7 -20
  49. package/dist/internals/request.cjs +0 -143
  50. package/dist/internals/request.cjs.map +0 -1
  51. package/dist/internals/request.d.cts +0 -56
  52. package/dist/internals/request.d.cts.map +0 -1
  53. package/dist/internals/request.d.mts +0 -56
  54. package/dist/internals/request.d.mts.map +0 -1
  55. package/dist/internals/request.mjs +0 -138
  56. package/dist/internals/request.mjs.map +0 -1
  57. package/dist/internals/simulation/constants.cjs +0 -21
  58. package/dist/internals/simulation/constants.cjs.map +0 -1
  59. package/dist/internals/simulation/constants.d.cts +0 -18
  60. package/dist/internals/simulation/constants.d.cts.map +0 -1
  61. package/dist/internals/simulation/constants.d.mts +0 -18
  62. package/dist/internals/simulation/constants.d.mts.map +0 -1
  63. package/dist/internals/simulation/constants.mjs +0 -18
  64. package/dist/internals/simulation/constants.mjs.map +0 -1
  65. package/dist/internals/simulation/controllers.cjs +0 -101
  66. package/dist/internals/simulation/controllers.cjs.map +0 -1
  67. package/dist/internals/simulation/controllers.d.cts +0 -41
  68. package/dist/internals/simulation/controllers.d.cts.map +0 -1
  69. package/dist/internals/simulation/controllers.d.mts +0 -41
  70. package/dist/internals/simulation/controllers.d.mts.map +0 -1
  71. package/dist/internals/simulation/controllers.mjs +0 -96
  72. package/dist/internals/simulation/controllers.mjs.map +0 -1
  73. package/dist/internals/simulation/files.cjs +0 -94
  74. package/dist/internals/simulation/files.cjs.map +0 -1
  75. package/dist/internals/simulation/files.d.cts +0 -49
  76. package/dist/internals/simulation/files.d.cts.map +0 -1
  77. package/dist/internals/simulation/files.d.mts +0 -49
  78. package/dist/internals/simulation/files.d.mts.map +0 -1
  79. package/dist/internals/simulation/files.mjs +0 -91
  80. package/dist/internals/simulation/files.mjs.map +0 -1
  81. package/dist/internals/simulation/index.cjs +0 -22
  82. package/dist/internals/simulation/index.cjs.map +0 -1
  83. package/dist/internals/simulation/index.d.cts +0 -6
  84. package/dist/internals/simulation/index.d.cts.map +0 -1
  85. package/dist/internals/simulation/index.d.mts +0 -6
  86. package/dist/internals/simulation/index.d.mts.map +0 -1
  87. package/dist/internals/simulation/index.mjs +0 -6
  88. package/dist/internals/simulation/index.mjs.map +0 -1
  89. package/dist/internals/simulation/interface.cjs +0 -527
  90. package/dist/internals/simulation/interface.cjs.map +0 -1
  91. package/dist/internals/simulation/interface.d.cts +0 -152
  92. package/dist/internals/simulation/interface.d.cts.map +0 -1
  93. package/dist/internals/simulation/interface.d.mts +0 -152
  94. package/dist/internals/simulation/interface.d.mts.map +0 -1
  95. package/dist/internals/simulation/interface.mjs +0 -513
  96. package/dist/internals/simulation/interface.mjs.map +0 -1
  97. package/dist/internals/simulation/methods/constants.cjs +0 -72
  98. package/dist/internals/simulation/methods/constants.cjs.map +0 -1
  99. package/dist/internals/simulation/methods/constants.d.cts +0 -11
  100. package/dist/internals/simulation/methods/constants.d.cts.map +0 -1
  101. package/dist/internals/simulation/methods/constants.d.mts +0 -11
  102. package/dist/internals/simulation/methods/constants.d.mts.map +0 -1
  103. package/dist/internals/simulation/methods/constants.mjs +0 -69
  104. package/dist/internals/simulation/methods/constants.mjs.map +0 -1
  105. package/dist/internals/simulation/methods/hooks/get-preferences.cjs +0 -18
  106. package/dist/internals/simulation/methods/hooks/get-preferences.cjs.map +0 -1
  107. package/dist/internals/simulation/methods/hooks/get-preferences.d.cts +0 -14
  108. package/dist/internals/simulation/methods/hooks/get-preferences.d.cts.map +0 -1
  109. package/dist/internals/simulation/methods/hooks/get-preferences.d.mts +0 -14
  110. package/dist/internals/simulation/methods/hooks/get-preferences.d.mts.map +0 -1
  111. package/dist/internals/simulation/methods/hooks/get-preferences.mjs +0 -14
  112. package/dist/internals/simulation/methods/hooks/get-preferences.mjs.map +0 -1
  113. package/dist/internals/simulation/methods/hooks/index.cjs +0 -22
  114. package/dist/internals/simulation/methods/hooks/index.cjs.map +0 -1
  115. package/dist/internals/simulation/methods/hooks/index.d.cts +0 -6
  116. package/dist/internals/simulation/methods/hooks/index.d.cts.map +0 -1
  117. package/dist/internals/simulation/methods/hooks/index.d.mts +0 -6
  118. package/dist/internals/simulation/methods/hooks/index.d.mts.map +0 -1
  119. package/dist/internals/simulation/methods/hooks/index.mjs +0 -6
  120. package/dist/internals/simulation/methods/hooks/index.mjs.map +0 -1
  121. package/dist/internals/simulation/methods/hooks/interface.cjs +0 -24
  122. package/dist/internals/simulation/methods/hooks/interface.cjs.map +0 -1
  123. package/dist/internals/simulation/methods/hooks/interface.d.cts +0 -17
  124. package/dist/internals/simulation/methods/hooks/interface.d.cts.map +0 -1
  125. package/dist/internals/simulation/methods/hooks/interface.d.mts +0 -17
  126. package/dist/internals/simulation/methods/hooks/interface.d.mts.map +0 -1
  127. package/dist/internals/simulation/methods/hooks/interface.mjs +0 -19
  128. package/dist/internals/simulation/methods/hooks/interface.mjs.map +0 -1
  129. package/dist/internals/simulation/methods/hooks/notifications.cjs +0 -58
  130. package/dist/internals/simulation/methods/hooks/notifications.cjs.map +0 -1
  131. package/dist/internals/simulation/methods/hooks/notifications.d.cts +0 -17
  132. package/dist/internals/simulation/methods/hooks/notifications.d.cts.map +0 -1
  133. package/dist/internals/simulation/methods/hooks/notifications.d.mts +0 -17
  134. package/dist/internals/simulation/methods/hooks/notifications.d.mts.map +0 -1
  135. package/dist/internals/simulation/methods/hooks/notifications.mjs +0 -55
  136. package/dist/internals/simulation/methods/hooks/notifications.mjs.map +0 -1
  137. package/dist/internals/simulation/methods/hooks/request-user-approval.cjs +0 -38
  138. package/dist/internals/simulation/methods/hooks/request-user-approval.cjs.map +0 -1
  139. package/dist/internals/simulation/methods/hooks/request-user-approval.d.cts +0 -16
  140. package/dist/internals/simulation/methods/hooks/request-user-approval.d.cts.map +0 -1
  141. package/dist/internals/simulation/methods/hooks/request-user-approval.d.mts +0 -16
  142. package/dist/internals/simulation/methods/hooks/request-user-approval.d.mts.map +0 -1
  143. package/dist/internals/simulation/methods/hooks/request-user-approval.mjs +0 -35
  144. package/dist/internals/simulation/methods/hooks/request-user-approval.mjs.map +0 -1
  145. package/dist/internals/simulation/methods/hooks/state.cjs +0 -84
  146. package/dist/internals/simulation/methods/hooks/state.cjs.map +0 -1
  147. package/dist/internals/simulation/methods/hooks/state.d.cts +0 -24
  148. package/dist/internals/simulation/methods/hooks/state.d.cts.map +0 -1
  149. package/dist/internals/simulation/methods/hooks/state.d.mts +0 -24
  150. package/dist/internals/simulation/methods/hooks/state.d.mts.map +0 -1
  151. package/dist/internals/simulation/methods/hooks/state.mjs +0 -79
  152. package/dist/internals/simulation/methods/hooks/state.mjs.map +0 -1
  153. package/dist/internals/simulation/methods/index.cjs +0 -18
  154. package/dist/internals/simulation/methods/index.cjs.map +0 -1
  155. package/dist/internals/simulation/methods/index.d.cts +0 -2
  156. package/dist/internals/simulation/methods/index.d.cts.map +0 -1
  157. package/dist/internals/simulation/methods/index.d.mts +0 -2
  158. package/dist/internals/simulation/methods/index.d.mts.map +0 -1
  159. package/dist/internals/simulation/methods/index.mjs +0 -2
  160. package/dist/internals/simulation/methods/index.mjs.map +0 -1
  161. package/dist/internals/simulation/methods/specifications.cjs +0 -85
  162. package/dist/internals/simulation/methods/specifications.cjs.map +0 -1
  163. package/dist/internals/simulation/methods/specifications.d.cts +0 -57
  164. package/dist/internals/simulation/methods/specifications.d.cts.map +0 -1
  165. package/dist/internals/simulation/methods/specifications.d.mts +0 -57
  166. package/dist/internals/simulation/methods/specifications.d.mts.map +0 -1
  167. package/dist/internals/simulation/methods/specifications.mjs +0 -78
  168. package/dist/internals/simulation/methods/specifications.mjs.map +0 -1
  169. package/dist/internals/simulation/middleware/engine.cjs +0 -37
  170. package/dist/internals/simulation/middleware/engine.cjs.map +0 -1
  171. package/dist/internals/simulation/middleware/engine.d.cts +0 -27
  172. package/dist/internals/simulation/middleware/engine.d.cts.map +0 -1
  173. package/dist/internals/simulation/middleware/engine.d.mts +0 -27
  174. package/dist/internals/simulation/middleware/engine.d.mts.map +0 -1
  175. package/dist/internals/simulation/middleware/engine.mjs +0 -34
  176. package/dist/internals/simulation/middleware/engine.mjs.map +0 -1
  177. package/dist/internals/simulation/middleware/index.cjs +0 -18
  178. package/dist/internals/simulation/middleware/index.cjs.map +0 -1
  179. package/dist/internals/simulation/middleware/index.d.cts +0 -2
  180. package/dist/internals/simulation/middleware/index.d.cts.map +0 -1
  181. package/dist/internals/simulation/middleware/index.d.mts +0 -2
  182. package/dist/internals/simulation/middleware/index.d.mts.map +0 -1
  183. package/dist/internals/simulation/middleware/index.mjs +0 -2
  184. package/dist/internals/simulation/middleware/index.mjs.map +0 -1
  185. package/dist/internals/simulation/middleware/internal-methods/accounts.cjs +0 -34
  186. package/dist/internals/simulation/middleware/internal-methods/accounts.cjs.map +0 -1
  187. package/dist/internals/simulation/middleware/internal-methods/accounts.d.cts +0 -20
  188. package/dist/internals/simulation/middleware/internal-methods/accounts.d.cts.map +0 -1
  189. package/dist/internals/simulation/middleware/internal-methods/accounts.d.mts +0 -20
  190. package/dist/internals/simulation/middleware/internal-methods/accounts.d.mts.map +0 -1
  191. package/dist/internals/simulation/middleware/internal-methods/accounts.mjs +0 -30
  192. package/dist/internals/simulation/middleware/internal-methods/accounts.mjs.map +0 -1
  193. package/dist/internals/simulation/middleware/internal-methods/index.cjs +0 -18
  194. package/dist/internals/simulation/middleware/internal-methods/index.cjs.map +0 -1
  195. package/dist/internals/simulation/middleware/internal-methods/index.d.cts +0 -2
  196. package/dist/internals/simulation/middleware/internal-methods/index.d.cts.map +0 -1
  197. package/dist/internals/simulation/middleware/internal-methods/index.d.mts +0 -2
  198. package/dist/internals/simulation/middleware/internal-methods/index.d.mts.map +0 -1
  199. package/dist/internals/simulation/middleware/internal-methods/index.mjs +0 -2
  200. package/dist/internals/simulation/middleware/internal-methods/index.mjs.map +0 -1
  201. package/dist/internals/simulation/middleware/internal-methods/middleware.cjs +0 -44
  202. package/dist/internals/simulation/middleware/internal-methods/middleware.cjs.map +0 -1
  203. package/dist/internals/simulation/middleware/internal-methods/middleware.d.cts +0 -23
  204. package/dist/internals/simulation/middleware/internal-methods/middleware.d.cts.map +0 -1
  205. package/dist/internals/simulation/middleware/internal-methods/middleware.d.mts +0 -23
  206. package/dist/internals/simulation/middleware/internal-methods/middleware.d.mts.map +0 -1
  207. package/dist/internals/simulation/middleware/internal-methods/middleware.mjs +0 -40
  208. package/dist/internals/simulation/middleware/internal-methods/middleware.mjs.map +0 -1
  209. package/dist/internals/simulation/middleware/internal-methods/provider-state.cjs +0 -28
  210. package/dist/internals/simulation/middleware/internal-methods/provider-state.cjs.map +0 -1
  211. package/dist/internals/simulation/middleware/internal-methods/provider-state.d.cts +0 -16
  212. package/dist/internals/simulation/middleware/internal-methods/provider-state.d.cts.map +0 -1
  213. package/dist/internals/simulation/middleware/internal-methods/provider-state.d.mts +0 -16
  214. package/dist/internals/simulation/middleware/internal-methods/provider-state.d.mts.map +0 -1
  215. package/dist/internals/simulation/middleware/internal-methods/provider-state.mjs +0 -24
  216. package/dist/internals/simulation/middleware/internal-methods/provider-state.mjs.map +0 -1
  217. package/dist/internals/simulation/middleware/mock.cjs +0 -22
  218. package/dist/internals/simulation/middleware/mock.cjs.map +0 -1
  219. package/dist/internals/simulation/middleware/mock.d.cts +0 -11
  220. package/dist/internals/simulation/middleware/mock.d.cts.map +0 -1
  221. package/dist/internals/simulation/middleware/mock.d.mts +0 -11
  222. package/dist/internals/simulation/middleware/mock.d.mts.map +0 -1
  223. package/dist/internals/simulation/middleware/mock.mjs +0 -18
  224. package/dist/internals/simulation/middleware/mock.mjs.map +0 -1
  225. package/dist/internals/simulation/options.cjs +0 -25
  226. package/dist/internals/simulation/options.cjs.map +0 -1
  227. package/dist/internals/simulation/options.d.cts +0 -40
  228. package/dist/internals/simulation/options.d.cts.map +0 -1
  229. package/dist/internals/simulation/options.d.mts +0 -40
  230. package/dist/internals/simulation/options.d.mts.map +0 -1
  231. package/dist/internals/simulation/options.mjs +0 -21
  232. package/dist/internals/simulation/options.mjs.map +0 -1
  233. package/dist/internals/simulation/simulation.cjs +0 -155
  234. package/dist/internals/simulation/simulation.cjs.map +0 -1
  235. package/dist/internals/simulation/simulation.d.cts +0 -103
  236. package/dist/internals/simulation/simulation.d.cts.map +0 -1
  237. package/dist/internals/simulation/simulation.d.mts +0 -103
  238. package/dist/internals/simulation/simulation.d.mts.map +0 -1
  239. package/dist/internals/simulation/simulation.mjs +0 -150
  240. package/dist/internals/simulation/simulation.mjs.map +0 -1
  241. package/dist/internals/simulation/store/index.cjs +0 -21
  242. package/dist/internals/simulation/store/index.cjs.map +0 -1
  243. package/dist/internals/simulation/store/index.d.cts +0 -5
  244. package/dist/internals/simulation/store/index.d.cts.map +0 -1
  245. package/dist/internals/simulation/store/index.d.mts +0 -5
  246. package/dist/internals/simulation/store/index.d.mts.map +0 -1
  247. package/dist/internals/simulation/store/index.mjs +0 -5
  248. package/dist/internals/simulation/store/index.mjs.map +0 -1
  249. package/dist/internals/simulation/store/mocks.cjs +0 -39
  250. package/dist/internals/simulation/store/mocks.cjs.map +0 -1
  251. package/dist/internals/simulation/store/mocks.d.cts +0 -36
  252. package/dist/internals/simulation/store/mocks.d.cts.map +0 -1
  253. package/dist/internals/simulation/store/mocks.d.mts +0 -36
  254. package/dist/internals/simulation/store/mocks.d.mts.map +0 -1
  255. package/dist/internals/simulation/store/mocks.mjs +0 -35
  256. package/dist/internals/simulation/store/mocks.mjs.map +0 -1
  257. package/dist/internals/simulation/store/notifications.cjs +0 -35
  258. package/dist/internals/simulation/store/notifications.cjs.map +0 -1
  259. package/dist/internals/simulation/store/notifications.d.cts +0 -45
  260. package/dist/internals/simulation/store/notifications.d.cts.map +0 -1
  261. package/dist/internals/simulation/store/notifications.d.mts +0 -45
  262. package/dist/internals/simulation/store/notifications.d.mts.map +0 -1
  263. package/dist/internals/simulation/store/notifications.mjs +0 -32
  264. package/dist/internals/simulation/store/notifications.mjs.map +0 -1
  265. package/dist/internals/simulation/store/state.cjs +0 -54
  266. package/dist/internals/simulation/store/state.cjs.map +0 -1
  267. package/dist/internals/simulation/store/state.d.cts +0 -56
  268. package/dist/internals/simulation/store/state.d.cts.map +0 -1
  269. package/dist/internals/simulation/store/state.d.mts +0 -56
  270. package/dist/internals/simulation/store/state.d.mts.map +0 -1
  271. package/dist/internals/simulation/store/state.mjs +0 -50
  272. package/dist/internals/simulation/store/state.mjs.map +0 -1
  273. package/dist/internals/simulation/store/store.cjs +0 -51
  274. package/dist/internals/simulation/store/store.cjs.map +0 -1
  275. package/dist/internals/simulation/store/store.d.cts +0 -22
  276. package/dist/internals/simulation/store/store.d.cts.map +0 -1
  277. package/dist/internals/simulation/store/store.d.mts +0 -22
  278. package/dist/internals/simulation/store/store.d.mts.map +0 -1
  279. package/dist/internals/simulation/store/store.mjs +0 -45
  280. package/dist/internals/simulation/store/store.mjs.map +0 -1
  281. package/dist/internals/simulation/store/ui.cjs +0 -24
  282. package/dist/internals/simulation/store/ui.cjs.map +0 -1
  283. package/dist/internals/simulation/store/ui.d.cts +0 -27
  284. package/dist/internals/simulation/store/ui.d.cts.map +0 -1
  285. package/dist/internals/simulation/store/ui.d.mts +0 -27
  286. package/dist/internals/simulation/store/ui.d.mts.map +0 -1
  287. package/dist/internals/simulation/store/ui.mjs +0 -21
  288. package/dist/internals/simulation/store/ui.mjs.map +0 -1
  289. package/dist/internals/structs.cjs +0 -157
  290. package/dist/internals/structs.cjs.map +0 -1
  291. package/dist/internals/structs.d.cts +0 -205
  292. package/dist/internals/structs.d.cts.map +0 -1
  293. package/dist/internals/structs.d.mts +0 -205
  294. package/dist/internals/structs.d.mts.map +0 -1
  295. package/dist/internals/structs.mjs +0 -154
  296. package/dist/internals/structs.mjs.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.cjs","sourceRoot":"","sources":["../../../../src/internals/simulation/methods/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,wBAAwB,GAAG,EAAE,CAAC;AAE9B,QAAA,yBAAyB,GAAG,EAAE,CAAC;AAE5C;;;;;;GAMG;AACU,QAAA,oBAAoB,GAAG,MAAM,CAAC,MAAM,CAAC;IAChD,iBAAiB;IACjB,UAAU;IACV,aAAa;IACb,cAAc;IACd,aAAa;IACb,iBAAiB;IACjB,gBAAgB;IAChB,cAAc;IACd,gBAAgB;IAChB,oBAAoB;IACpB,sBAAsB;IACtB,oCAAoC;IACpC,sCAAsC;IACtC,aAAa;IACb,4BAA4B;IAC5B,sBAAsB;IACtB,mBAAmB;IACnB,aAAa;IACb,cAAc;IACd,kBAAkB;IAClB,uCAAuC;IACvC,yCAAyC;IACzC,0BAA0B;IAC1B,yBAAyB;IACzB,2BAA2B;IAC3B,iCAAiC;IACjC,mCAAmC;IACnC,8BAA8B;IAC9B,gCAAgC;IAChC,aAAa;IACb,cAAc;IACd,YAAY;IACZ,oBAAoB;IACpB,eAAe;IACf,iCAAiC;IACjC,qBAAqB;IACrB,wBAAwB;IACxB,qBAAqB;IACrB,UAAU;IACV,mBAAmB;IACnB,sBAAsB;IACtB,sBAAsB;IACtB,sBAAsB;IACtB,oBAAoB;IACpB,gBAAgB;IAChB,aAAa;IACb,qBAAqB;IACrB,2BAA2B;IAC3B,qBAAqB;IACrB,eAAe;IACf,eAAe;IACf,aAAa;IACb,oBAAoB;IACpB,eAAe;IACf,mBAAmB;IACnB,oBAAoB;IACpB,WAAW;CACZ,CAAC,CAAC","sourcesContent":["export const EXCLUDED_SNAP_ENDOWMENTS = [];\n\nexport const EXCLUDED_SNAP_PERMISSIONS = [];\n\n/**\n * All unrestricted methods recognized by the `PermissionController`.\n * Unrestricted methods are ignored by the permission system, but every\n * JSON-RPC request seen by the permission system must correspond to a\n * restricted or unrestricted method, or the request will be rejected with a\n * \"method not found\" error.\n */\nexport const UNRESTRICTED_METHODS = Object.freeze([\n 'eth_blockNumber',\n 'eth_call',\n 'eth_chainId',\n 'eth_coinbase',\n 'eth_decrypt',\n 'eth_estimateGas',\n 'eth_feeHistory',\n 'eth_gasPrice',\n 'eth_getBalance',\n 'eth_getBlockByHash',\n 'eth_getBlockByNumber',\n 'eth_getBlockTransactionCountByHash',\n 'eth_getBlockTransactionCountByNumber',\n 'eth_getCode',\n 'eth_getEncryptionPublicKey',\n 'eth_getFilterChanges',\n 'eth_getFilterLogs',\n 'eth_getLogs',\n 'eth_getProof',\n 'eth_getStorageAt',\n 'eth_getTransactionByBlockHashAndIndex',\n 'eth_getTransactionByBlockNumberAndIndex',\n 'eth_getTransactionByHash',\n 'eth_getTransactionCount',\n 'eth_getTransactionReceipt',\n 'eth_getUncleByBlockHashAndIndex',\n 'eth_getUncleByBlockNumberAndIndex',\n 'eth_getUncleCountByBlockHash',\n 'eth_getUncleCountByBlockNumber',\n 'eth_getWork',\n 'eth_hashrate',\n 'eth_mining',\n 'eth_newBlockFilter',\n 'eth_newFilter',\n 'eth_newPendingTransactionFilter',\n 'eth_protocolVersion',\n 'eth_sendRawTransaction',\n 'eth_sendTransaction',\n 'eth_sign',\n 'eth_signTypedData',\n 'eth_signTypedData_v1',\n 'eth_signTypedData_v3',\n 'eth_signTypedData_v4',\n 'eth_submitHashrate',\n 'eth_submitWork',\n 'eth_syncing',\n 'eth_uninstallFilter',\n 'metamask_getProviderState',\n 'metamask_watchAsset',\n 'net_listening',\n 'net_peerCount',\n 'net_version',\n 'personal_ecRecover',\n 'personal_sign',\n 'wallet_watchAsset',\n 'web3_clientVersion',\n 'web3_sha3',\n]);\n"]}
@@ -1,11 +0,0 @@
1
- export declare const EXCLUDED_SNAP_ENDOWMENTS: never[];
2
- export declare const EXCLUDED_SNAP_PERMISSIONS: never[];
3
- /**
4
- * All unrestricted methods recognized by the `PermissionController`.
5
- * Unrestricted methods are ignored by the permission system, but every
6
- * JSON-RPC request seen by the permission system must correspond to a
7
- * restricted or unrestricted method, or the request will be rejected with a
8
- * "method not found" error.
9
- */
10
- export declare const UNRESTRICTED_METHODS: readonly string[];
11
- //# sourceMappingURL=constants.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.cts","sourceRoot":"","sources":["../../../../src/internals/simulation/methods/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB,SAAK,CAAC;AAE3C,eAAO,MAAM,yBAAyB,SAAK,CAAC;AAE5C;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,mBA0D/B,CAAC"}
@@ -1,11 +0,0 @@
1
- export declare const EXCLUDED_SNAP_ENDOWMENTS: never[];
2
- export declare const EXCLUDED_SNAP_PERMISSIONS: never[];
3
- /**
4
- * All unrestricted methods recognized by the `PermissionController`.
5
- * Unrestricted methods are ignored by the permission system, but every
6
- * JSON-RPC request seen by the permission system must correspond to a
7
- * restricted or unrestricted method, or the request will be rejected with a
8
- * "method not found" error.
9
- */
10
- export declare const UNRESTRICTED_METHODS: readonly string[];
11
- //# sourceMappingURL=constants.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.mts","sourceRoot":"","sources":["../../../../src/internals/simulation/methods/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB,SAAK,CAAC;AAE3C,eAAO,MAAM,yBAAyB,SAAK,CAAC;AAE5C;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,mBA0D/B,CAAC"}
@@ -1,69 +0,0 @@
1
- export const EXCLUDED_SNAP_ENDOWMENTS = [];
2
- export const EXCLUDED_SNAP_PERMISSIONS = [];
3
- /**
4
- * All unrestricted methods recognized by the `PermissionController`.
5
- * Unrestricted methods are ignored by the permission system, but every
6
- * JSON-RPC request seen by the permission system must correspond to a
7
- * restricted or unrestricted method, or the request will be rejected with a
8
- * "method not found" error.
9
- */
10
- export const UNRESTRICTED_METHODS = Object.freeze([
11
- 'eth_blockNumber',
12
- 'eth_call',
13
- 'eth_chainId',
14
- 'eth_coinbase',
15
- 'eth_decrypt',
16
- 'eth_estimateGas',
17
- 'eth_feeHistory',
18
- 'eth_gasPrice',
19
- 'eth_getBalance',
20
- 'eth_getBlockByHash',
21
- 'eth_getBlockByNumber',
22
- 'eth_getBlockTransactionCountByHash',
23
- 'eth_getBlockTransactionCountByNumber',
24
- 'eth_getCode',
25
- 'eth_getEncryptionPublicKey',
26
- 'eth_getFilterChanges',
27
- 'eth_getFilterLogs',
28
- 'eth_getLogs',
29
- 'eth_getProof',
30
- 'eth_getStorageAt',
31
- 'eth_getTransactionByBlockHashAndIndex',
32
- 'eth_getTransactionByBlockNumberAndIndex',
33
- 'eth_getTransactionByHash',
34
- 'eth_getTransactionCount',
35
- 'eth_getTransactionReceipt',
36
- 'eth_getUncleByBlockHashAndIndex',
37
- 'eth_getUncleByBlockNumberAndIndex',
38
- 'eth_getUncleCountByBlockHash',
39
- 'eth_getUncleCountByBlockNumber',
40
- 'eth_getWork',
41
- 'eth_hashrate',
42
- 'eth_mining',
43
- 'eth_newBlockFilter',
44
- 'eth_newFilter',
45
- 'eth_newPendingTransactionFilter',
46
- 'eth_protocolVersion',
47
- 'eth_sendRawTransaction',
48
- 'eth_sendTransaction',
49
- 'eth_sign',
50
- 'eth_signTypedData',
51
- 'eth_signTypedData_v1',
52
- 'eth_signTypedData_v3',
53
- 'eth_signTypedData_v4',
54
- 'eth_submitHashrate',
55
- 'eth_submitWork',
56
- 'eth_syncing',
57
- 'eth_uninstallFilter',
58
- 'metamask_getProviderState',
59
- 'metamask_watchAsset',
60
- 'net_listening',
61
- 'net_peerCount',
62
- 'net_version',
63
- 'personal_ecRecover',
64
- 'personal_sign',
65
- 'wallet_watchAsset',
66
- 'web3_clientVersion',
67
- 'web3_sha3',
68
- ]);
69
- //# sourceMappingURL=constants.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.mjs","sourceRoot":"","sources":["../../../../src/internals/simulation/methods/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,wBAAwB,GAAG,EAAE,CAAC;AAE3C,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,CAAC;AAE5C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,CAAC;IAChD,iBAAiB;IACjB,UAAU;IACV,aAAa;IACb,cAAc;IACd,aAAa;IACb,iBAAiB;IACjB,gBAAgB;IAChB,cAAc;IACd,gBAAgB;IAChB,oBAAoB;IACpB,sBAAsB;IACtB,oCAAoC;IACpC,sCAAsC;IACtC,aAAa;IACb,4BAA4B;IAC5B,sBAAsB;IACtB,mBAAmB;IACnB,aAAa;IACb,cAAc;IACd,kBAAkB;IAClB,uCAAuC;IACvC,yCAAyC;IACzC,0BAA0B;IAC1B,yBAAyB;IACzB,2BAA2B;IAC3B,iCAAiC;IACjC,mCAAmC;IACnC,8BAA8B;IAC9B,gCAAgC;IAChC,aAAa;IACb,cAAc;IACd,YAAY;IACZ,oBAAoB;IACpB,eAAe;IACf,iCAAiC;IACjC,qBAAqB;IACrB,wBAAwB;IACxB,qBAAqB;IACrB,UAAU;IACV,mBAAmB;IACnB,sBAAsB;IACtB,sBAAsB;IACtB,sBAAsB;IACtB,oBAAoB;IACpB,gBAAgB;IAChB,aAAa;IACb,qBAAqB;IACrB,2BAA2B;IAC3B,qBAAqB;IACrB,eAAe;IACf,eAAe;IACf,aAAa;IACb,oBAAoB;IACpB,eAAe;IACf,mBAAmB;IACnB,oBAAoB;IACpB,WAAW;CACZ,CAAC,CAAC","sourcesContent":["export const EXCLUDED_SNAP_ENDOWMENTS = [];\n\nexport const EXCLUDED_SNAP_PERMISSIONS = [];\n\n/**\n * All unrestricted methods recognized by the `PermissionController`.\n * Unrestricted methods are ignored by the permission system, but every\n * JSON-RPC request seen by the permission system must correspond to a\n * restricted or unrestricted method, or the request will be rejected with a\n * \"method not found\" error.\n */\nexport const UNRESTRICTED_METHODS = Object.freeze([\n 'eth_blockNumber',\n 'eth_call',\n 'eth_chainId',\n 'eth_coinbase',\n 'eth_decrypt',\n 'eth_estimateGas',\n 'eth_feeHistory',\n 'eth_gasPrice',\n 'eth_getBalance',\n 'eth_getBlockByHash',\n 'eth_getBlockByNumber',\n 'eth_getBlockTransactionCountByHash',\n 'eth_getBlockTransactionCountByNumber',\n 'eth_getCode',\n 'eth_getEncryptionPublicKey',\n 'eth_getFilterChanges',\n 'eth_getFilterLogs',\n 'eth_getLogs',\n 'eth_getProof',\n 'eth_getStorageAt',\n 'eth_getTransactionByBlockHashAndIndex',\n 'eth_getTransactionByBlockNumberAndIndex',\n 'eth_getTransactionByHash',\n 'eth_getTransactionCount',\n 'eth_getTransactionReceipt',\n 'eth_getUncleByBlockHashAndIndex',\n 'eth_getUncleByBlockNumberAndIndex',\n 'eth_getUncleCountByBlockHash',\n 'eth_getUncleCountByBlockNumber',\n 'eth_getWork',\n 'eth_hashrate',\n 'eth_mining',\n 'eth_newBlockFilter',\n 'eth_newFilter',\n 'eth_newPendingTransactionFilter',\n 'eth_protocolVersion',\n 'eth_sendRawTransaction',\n 'eth_sendTransaction',\n 'eth_sign',\n 'eth_signTypedData',\n 'eth_signTypedData_v1',\n 'eth_signTypedData_v3',\n 'eth_signTypedData_v4',\n 'eth_submitHashrate',\n 'eth_submitWork',\n 'eth_syncing',\n 'eth_uninstallFilter',\n 'metamask_getProviderState',\n 'metamask_watchAsset',\n 'net_listening',\n 'net_peerCount',\n 'net_version',\n 'personal_ecRecover',\n 'personal_sign',\n 'wallet_watchAsset',\n 'web3_clientVersion',\n 'web3_sha3',\n]);\n"]}
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getGetPreferencesMethodImplementation = void 0;
4
- /**
5
- * Get the implementation of the `getPreferences` hook.
6
- *
7
- * @param options - The simulation options.
8
- * @param options.currency - The currency to use.
9
- * @param options.locale - The locale to use.
10
- * @returns The implementation of the `getPreferences` hook.
11
- */
12
- function getGetPreferencesMethodImplementation({ currency, locale, }) {
13
- return () => {
14
- return { currency, locale };
15
- };
16
- }
17
- exports.getGetPreferencesMethodImplementation = getGetPreferencesMethodImplementation;
18
- //# sourceMappingURL=get-preferences.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-preferences.cjs","sourceRoot":"","sources":["../../../../../src/internals/simulation/methods/hooks/get-preferences.ts"],"names":[],"mappings":";;;AAEA;;;;;;;GAOG;AACH,SAAgB,qCAAqC,CAAC,EACpD,QAAQ,EACR,MAAM,GACY;IAClB,OAAO,GAAG,EAAE;QACV,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;IAC9B,CAAC,CAAC;AACJ,CAAC;AAPD,sFAOC","sourcesContent":["import type { SimulationOptions } from '../../options';\n\n/**\n * Get the implementation of the `getPreferences` hook.\n *\n * @param options - The simulation options.\n * @param options.currency - The currency to use.\n * @param options.locale - The locale to use.\n * @returns The implementation of the `getPreferences` hook.\n */\nexport function getGetPreferencesMethodImplementation({\n currency,\n locale,\n}: SimulationOptions) {\n return () => {\n return { currency, locale };\n };\n}\n"]}
@@ -1,14 +0,0 @@
1
- import type { SimulationOptions } from "../../options.cjs";
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
- };
14
- //# sourceMappingURL=get-preferences.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-preferences.d.cts","sourceRoot":"","sources":["../../../../../src/internals/simulation/methods/hooks/get-preferences.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,0BAAsB;AAEvD;;;;;;;GAOG;AACH,wBAAgB,qCAAqC,CAAC,EACpD,QAAQ,EACR,MAAM,GACP,EAAE,iBAAiB;;;EAInB"}
@@ -1,14 +0,0 @@
1
- import type { SimulationOptions } from "../../options.mjs";
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
- };
14
- //# sourceMappingURL=get-preferences.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-preferences.d.mts","sourceRoot":"","sources":["../../../../../src/internals/simulation/methods/hooks/get-preferences.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,0BAAsB;AAEvD;;;;;;;GAOG;AACH,wBAAgB,qCAAqC,CAAC,EACpD,QAAQ,EACR,MAAM,GACP,EAAE,iBAAiB;;;EAInB"}
@@ -1,14 +0,0 @@
1
- /**
2
- * Get the implementation of the `getPreferences` hook.
3
- *
4
- * @param options - The simulation options.
5
- * @param options.currency - The currency to use.
6
- * @param options.locale - The locale to use.
7
- * @returns The implementation of the `getPreferences` hook.
8
- */
9
- export function getGetPreferencesMethodImplementation({ currency, locale, }) {
10
- return () => {
11
- return { currency, locale };
12
- };
13
- }
14
- //# sourceMappingURL=get-preferences.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-preferences.mjs","sourceRoot":"","sources":["../../../../../src/internals/simulation/methods/hooks/get-preferences.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,UAAU,qCAAqC,CAAC,EACpD,QAAQ,EACR,MAAM,GACY;IAClB,OAAO,GAAG,EAAE;QACV,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;IAC9B,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import type { SimulationOptions } from '../../options';\n\n/**\n * Get the implementation of the `getPreferences` hook.\n *\n * @param options - The simulation options.\n * @param options.currency - The currency to use.\n * @param options.locale - The locale to use.\n * @returns The implementation of the `getPreferences` hook.\n */\nexport function getGetPreferencesMethodImplementation({\n currency,\n locale,\n}: SimulationOptions) {\n return () => {\n return { currency, locale };\n };\n}\n"]}
@@ -1,22 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./get-preferences.cjs"), exports);
18
- __exportStar(require("./notifications.cjs"), exports);
19
- __exportStar(require("./request-user-approval.cjs"), exports);
20
- __exportStar(require("./state.cjs"), exports);
21
- __exportStar(require("./interface.cjs"), exports);
22
- //# sourceMappingURL=index.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../../../src/internals/simulation/methods/hooks/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAkC;AAClC,sDAAgC;AAChC,8DAAwC;AACxC,8CAAwB;AACxB,kDAA4B","sourcesContent":["export * from './get-preferences';\nexport * from './notifications';\nexport * from './request-user-approval';\nexport * from './state';\nexport * from './interface';\n"]}
@@ -1,6 +0,0 @@
1
- export * from "./get-preferences.cjs";
2
- export * from "./notifications.cjs";
3
- export * from "./request-user-approval.cjs";
4
- export * from "./state.cjs";
5
- export * from "./interface.cjs";
6
- //# sourceMappingURL=index.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../../../src/internals/simulation/methods/hooks/index.ts"],"names":[],"mappings":"AAAA,sCAAkC;AAClC,oCAAgC;AAChC,4CAAwC;AACxC,4BAAwB;AACxB,gCAA4B"}
@@ -1,6 +0,0 @@
1
- export * from "./get-preferences.mjs";
2
- export * from "./notifications.mjs";
3
- export * from "./request-user-approval.mjs";
4
- export * from "./state.mjs";
5
- export * from "./interface.mjs";
6
- //# sourceMappingURL=index.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../../../src/internals/simulation/methods/hooks/index.ts"],"names":[],"mappings":"AAAA,sCAAkC;AAClC,oCAAgC;AAChC,4CAAwC;AACxC,4BAAwB;AACxB,gCAA4B"}
@@ -1,6 +0,0 @@
1
- export * from "./get-preferences.mjs";
2
- export * from "./notifications.mjs";
3
- export * from "./request-user-approval.mjs";
4
- export * from "./state.mjs";
5
- export * from "./interface.mjs";
6
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../../../src/internals/simulation/methods/hooks/index.ts"],"names":[],"mappings":"AAAA,sCAAkC;AAClC,oCAAgC;AAChC,4CAAwC;AACxC,4BAAwB;AACxB,gCAA4B","sourcesContent":["export * from './get-preferences';\nexport * from './notifications';\nexport * from './request-user-approval';\nexport * from './state';\nexport * from './interface';\n"]}
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getGetInterfaceImplementation = exports.getCreateInterfaceImplementation = void 0;
4
- /**
5
- * Get the implementation of the `createInterface` hook.
6
- *
7
- * @param controllerMessenger - The controller messenger used to call actions.
8
- * @returns The implementation of the `createInterface` hook.
9
- */
10
- function getCreateInterfaceImplementation(controllerMessenger) {
11
- return async (snapId, content, context) => controllerMessenger.call('SnapInterfaceController:createInterface', snapId, content, context);
12
- }
13
- exports.getCreateInterfaceImplementation = getCreateInterfaceImplementation;
14
- /**
15
- * Get the implementation of the `getInterface` hook.
16
- *
17
- * @param controllerMessenger - The controller messenger used to call actions.
18
- * @returns The implementation of the `getInterface` hook.
19
- */
20
- function getGetInterfaceImplementation(controllerMessenger) {
21
- return (snapId, id) => controllerMessenger.call('SnapInterfaceController:getInterface', snapId, id);
22
- }
23
- exports.getGetInterfaceImplementation = getGetInterfaceImplementation;
24
- //# sourceMappingURL=interface.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"interface.cjs","sourceRoot":"","sources":["../../../../../src/internals/simulation/methods/hooks/interface.ts"],"names":[],"mappings":";;;AAIA;;;;;GAKG;AACH,SAAgB,gCAAgC,CAC9C,mBAA4C;IAE5C,OAAO,KAAK,EACV,MAAc,EACd,OAAkB,EAClB,OAA0B,EAC1B,EAAE,CACF,mBAAmB,CAAC,IAAI,CACtB,yCAAyC,EACzC,MAAM,EACN,OAAO,EACP,OAAO,CACR,CAAC;AACN,CAAC;AAdD,4EAcC;AAED;;;;;GAKG;AACH,SAAgB,6BAA6B,CAC3C,mBAA4C;IAE5C,OAAO,CAAC,MAAc,EAAE,EAAU,EAAE,EAAE,CACpC,mBAAmB,CAAC,IAAI,CACtB,sCAAsC,EACtC,MAAM,EACN,EAAE,CACH,CAAC;AACN,CAAC;AATD,sEASC","sourcesContent":["import type { Component, InterfaceContext, SnapId } from '@metamask/snaps-sdk';\n\nimport type { RootControllerMessenger } from '../../controllers';\n\n/**\n * Get the implementation of the `createInterface` hook.\n *\n * @param controllerMessenger - The controller messenger used to call actions.\n * @returns The implementation of the `createInterface` hook.\n */\nexport function getCreateInterfaceImplementation(\n controllerMessenger: RootControllerMessenger,\n) {\n return async (\n snapId: SnapId,\n content: Component,\n context?: InterfaceContext,\n ) =>\n controllerMessenger.call(\n 'SnapInterfaceController:createInterface',\n snapId,\n content,\n context,\n );\n}\n\n/**\n * Get the implementation of the `getInterface` hook.\n *\n * @param controllerMessenger - The controller messenger used to call actions.\n * @returns The implementation of the `getInterface` hook.\n */\nexport function getGetInterfaceImplementation(\n controllerMessenger: RootControllerMessenger,\n) {\n return (snapId: SnapId, id: string) =>\n controllerMessenger.call(\n 'SnapInterfaceController:getInterface',\n snapId,\n id,\n );\n}\n"]}
@@ -1,17 +0,0 @@
1
- import type { Component, InterfaceContext, SnapId } from "@metamask/snaps-sdk";
2
- import type { RootControllerMessenger } from "../../controllers.cjs";
3
- /**
4
- * Get the implementation of the `createInterface` hook.
5
- *
6
- * @param controllerMessenger - The controller messenger used to call actions.
7
- * @returns The implementation of the `createInterface` hook.
8
- */
9
- export declare function getCreateInterfaceImplementation(controllerMessenger: RootControllerMessenger): (snapId: SnapId, content: Component, context?: InterfaceContext) => Promise<string>;
10
- /**
11
- * Get the implementation of the `getInterface` hook.
12
- *
13
- * @param controllerMessenger - The controller messenger used to call actions.
14
- * @returns The implementation of the `getInterface` hook.
15
- */
16
- export declare function getGetInterfaceImplementation(controllerMessenger: RootControllerMessenger): (snapId: SnapId, id: string) => import("@metamask/snaps-controllers").StoredInterface;
17
- //# sourceMappingURL=interface.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"interface.d.cts","sourceRoot":"","sources":["../../../../../src/internals/simulation/methods/hooks/interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,EAAE,4BAA4B;AAE/E,OAAO,KAAK,EAAE,uBAAuB,EAAE,8BAA0B;AAEjE;;;;;GAKG;AACH,wBAAgB,gCAAgC,CAC9C,mBAAmB,EAAE,uBAAuB,YAGlC,MAAM,WACL,SAAS,YACR,gBAAgB,qBAQ7B;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAC3C,mBAAmB,EAAE,uBAAuB,YAE5B,MAAM,MAAM,MAAM,2DAMnC"}
@@ -1,17 +0,0 @@
1
- import type { Component, InterfaceContext, SnapId } from "@metamask/snaps-sdk";
2
- import type { RootControllerMessenger } from "../../controllers.mjs";
3
- /**
4
- * Get the implementation of the `createInterface` hook.
5
- *
6
- * @param controllerMessenger - The controller messenger used to call actions.
7
- * @returns The implementation of the `createInterface` hook.
8
- */
9
- export declare function getCreateInterfaceImplementation(controllerMessenger: RootControllerMessenger): (snapId: SnapId, content: Component, context?: InterfaceContext) => Promise<string>;
10
- /**
11
- * Get the implementation of the `getInterface` hook.
12
- *
13
- * @param controllerMessenger - The controller messenger used to call actions.
14
- * @returns The implementation of the `getInterface` hook.
15
- */
16
- export declare function getGetInterfaceImplementation(controllerMessenger: RootControllerMessenger): (snapId: SnapId, id: string) => import("@metamask/snaps-controllers").StoredInterface;
17
- //# sourceMappingURL=interface.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"interface.d.mts","sourceRoot":"","sources":["../../../../../src/internals/simulation/methods/hooks/interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,EAAE,4BAA4B;AAE/E,OAAO,KAAK,EAAE,uBAAuB,EAAE,8BAA0B;AAEjE;;;;;GAKG;AACH,wBAAgB,gCAAgC,CAC9C,mBAAmB,EAAE,uBAAuB,YAGlC,MAAM,WACL,SAAS,YACR,gBAAgB,qBAQ7B;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAC3C,mBAAmB,EAAE,uBAAuB,YAE5B,MAAM,MAAM,MAAM,2DAMnC"}
@@ -1,19 +0,0 @@
1
- /**
2
- * Get the implementation of the `createInterface` hook.
3
- *
4
- * @param controllerMessenger - The controller messenger used to call actions.
5
- * @returns The implementation of the `createInterface` hook.
6
- */
7
- export function getCreateInterfaceImplementation(controllerMessenger) {
8
- return async (snapId, content, context) => controllerMessenger.call('SnapInterfaceController:createInterface', snapId, content, context);
9
- }
10
- /**
11
- * Get the implementation of the `getInterface` hook.
12
- *
13
- * @param controllerMessenger - The controller messenger used to call actions.
14
- * @returns The implementation of the `getInterface` hook.
15
- */
16
- export function getGetInterfaceImplementation(controllerMessenger) {
17
- return (snapId, id) => controllerMessenger.call('SnapInterfaceController:getInterface', snapId, id);
18
- }
19
- //# sourceMappingURL=interface.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"interface.mjs","sourceRoot":"","sources":["../../../../../src/internals/simulation/methods/hooks/interface.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,MAAM,UAAU,gCAAgC,CAC9C,mBAA4C;IAE5C,OAAO,KAAK,EACV,MAAc,EACd,OAAkB,EAClB,OAA0B,EAC1B,EAAE,CACF,mBAAmB,CAAC,IAAI,CACtB,yCAAyC,EACzC,MAAM,EACN,OAAO,EACP,OAAO,CACR,CAAC;AACN,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,6BAA6B,CAC3C,mBAA4C;IAE5C,OAAO,CAAC,MAAc,EAAE,EAAU,EAAE,EAAE,CACpC,mBAAmB,CAAC,IAAI,CACtB,sCAAsC,EACtC,MAAM,EACN,EAAE,CACH,CAAC;AACN,CAAC","sourcesContent":["import type { Component, InterfaceContext, SnapId } from '@metamask/snaps-sdk';\n\nimport type { RootControllerMessenger } from '../../controllers';\n\n/**\n * Get the implementation of the `createInterface` hook.\n *\n * @param controllerMessenger - The controller messenger used to call actions.\n * @returns The implementation of the `createInterface` hook.\n */\nexport function getCreateInterfaceImplementation(\n controllerMessenger: RootControllerMessenger,\n) {\n return async (\n snapId: SnapId,\n content: Component,\n context?: InterfaceContext,\n ) =>\n controllerMessenger.call(\n 'SnapInterfaceController:createInterface',\n snapId,\n content,\n context,\n );\n}\n\n/**\n * Get the implementation of the `getInterface` hook.\n *\n * @param controllerMessenger - The controller messenger used to call actions.\n * @returns The implementation of the `getInterface` hook.\n */\nexport function getGetInterfaceImplementation(\n controllerMessenger: RootControllerMessenger,\n) {\n return (snapId: SnapId, id: string) =>\n controllerMessenger.call(\n 'SnapInterfaceController:getInterface',\n snapId,\n id,\n );\n}\n"]}
@@ -1,58 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getShowInAppNotificationImplementation = exports.getShowNativeNotificationImplementation = void 0;
4
- const snaps_sdk_1 = require("@metamask/snaps-sdk");
5
- const toolkit_1 = require("@reduxjs/toolkit");
6
- const effects_1 = require("redux-saga/effects");
7
- const store_1 = require("../../store/index.cjs");
8
- /**
9
- * Show a native notification to the user.
10
- *
11
- * @param _snapId - The ID of the Snap that created the notification.
12
- * @param options - The notification options.
13
- * @param options.message - The message to show in the notification.
14
- * @yields Adds the notification to the store.
15
- * @returns `null`.
16
- */
17
- function* showNativeNotificationImplementation(_snapId, { message }) {
18
- yield (0, effects_1.put)((0, store_1.addNotification)({ id: (0, toolkit_1.nanoid)(), type: snaps_sdk_1.NotificationType.Native, message }));
19
- return null;
20
- }
21
- /**
22
- * Get a method that can be used to show a native notification.
23
- *
24
- * @param runSaga - A function to run a saga outside the usual Redux flow.
25
- * @returns A method that can be used to show a native notification.
26
- */
27
- function getShowNativeNotificationImplementation(runSaga) {
28
- return async (...args) => {
29
- return await runSaga(showNativeNotificationImplementation, ...args).toPromise();
30
- };
31
- }
32
- exports.getShowNativeNotificationImplementation = getShowNativeNotificationImplementation;
33
- /**
34
- * Show an in-app notification to the user.
35
- *
36
- * @param _snapId - The ID of the Snap that created the notification.
37
- * @param options - The notification options.
38
- * @param options.message - The message to show in the notification.
39
- * @yields Adds the notification to the store.
40
- * @returns `null`.
41
- */
42
- function* showInAppNotificationImplementation(_snapId, { message }) {
43
- yield (0, effects_1.put)((0, store_1.addNotification)({ id: (0, toolkit_1.nanoid)(), type: snaps_sdk_1.NotificationType.InApp, message }));
44
- return null;
45
- }
46
- /**
47
- * Get a method that can be used to show an in-app notification.
48
- *
49
- * @param runSaga - A function to run a saga outside the usual Redux flow.
50
- * @returns A method that can be used to show an in-app notification.
51
- */
52
- function getShowInAppNotificationImplementation(runSaga) {
53
- return async (...args) => {
54
- return await runSaga(showInAppNotificationImplementation, ...args).toPromise();
55
- };
56
- }
57
- exports.getShowInAppNotificationImplementation = getShowInAppNotificationImplementation;
58
- //# sourceMappingURL=notifications.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"notifications.cjs","sourceRoot":"","sources":["../../../../../src/internals/simulation/methods/hooks/notifications.ts"],"names":[],"mappings":";;;AACA,mDAAuD;AACvD,8CAA0C;AAE1C,gDAAyC;AAGzC,iDAA8C;AAE9C;;;;;;;;GAQG;AACH,QAAQ,CAAC,CAAC,oCAAoC,CAC5C,OAAe,EACf,EAAE,OAAO,EAAgB;IAEzB,MAAM,IAAA,aAAG,EACP,IAAA,uBAAe,EAAC,EAAE,EAAE,EAAE,IAAA,gBAAM,GAAE,EAAE,IAAI,EAAE,4BAAgB,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,CAC1E,CAAC;IAEF,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;GAKG;AACH,SAAgB,uCAAuC,CACrD,OAAwB;IAExB,OAAO,KAAK,EACV,GAAG,IAA6D,EAChE,EAAE;QACF,OAAO,MAAM,OAAO,CAClB,oCAAoC,EACpC,GAAG,IAAI,CACR,CAAC,SAAS,EAAE,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC;AAXD,0FAWC;AAED;;;;;;;;GAQG;AACH,QAAQ,CAAC,CAAC,mCAAmC,CAC3C,OAAe,EACf,EAAE,OAAO,EAAgB;IAEzB,MAAM,IAAA,aAAG,EACP,IAAA,uBAAe,EAAC,EAAE,EAAE,EAAE,IAAA,gBAAM,GAAE,EAAE,IAAI,EAAE,4BAAgB,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC,CACzE,CAAC;IAEF,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;GAKG;AACH,SAAgB,sCAAsC,CACpD,OAAwB;IAExB,OAAO,KAAK,EACV,GAAG,IAA4D,EAC/D,EAAE;QACF,OAAO,MAAM,OAAO,CAClB,mCAAmC,EACnC,GAAG,IAAI,CACR,CAAC,SAAS,EAAE,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC;AAXD,wFAWC","sourcesContent":["import type { NotifyParams } from '@metamask/snaps-sdk';\nimport { NotificationType } from '@metamask/snaps-sdk';\nimport { nanoid } from '@reduxjs/toolkit';\nimport type { SagaIterator } from 'redux-saga';\nimport { put } from 'redux-saga/effects';\n\nimport type { RunSagaFunction } from '../../store';\nimport { addNotification } from '../../store';\n\n/**\n * Show a native notification to the user.\n *\n * @param _snapId - The ID of the Snap that created the notification.\n * @param options - The notification options.\n * @param options.message - The message to show in the notification.\n * @yields Adds the notification to the store.\n * @returns `null`.\n */\nfunction* showNativeNotificationImplementation(\n _snapId: string,\n { message }: NotifyParams,\n): SagaIterator {\n yield put(\n addNotification({ id: nanoid(), type: NotificationType.Native, message }),\n );\n\n return null;\n}\n\n/**\n * Get a method that can be used to show a native notification.\n *\n * @param runSaga - A function to run a saga outside the usual Redux flow.\n * @returns A method that can be used to show a native notification.\n */\nexport function getShowNativeNotificationImplementation(\n runSaga: RunSagaFunction,\n) {\n return async (\n ...args: Parameters<typeof showNativeNotificationImplementation>\n ) => {\n return await runSaga(\n showNativeNotificationImplementation,\n ...args,\n ).toPromise();\n };\n}\n\n/**\n * Show an in-app notification to the user.\n *\n * @param _snapId - The ID of the Snap that created the notification.\n * @param options - The notification options.\n * @param options.message - The message to show in the notification.\n * @yields Adds the notification to the store.\n * @returns `null`.\n */\nfunction* showInAppNotificationImplementation(\n _snapId: string,\n { message }: NotifyParams,\n): SagaIterator<null> {\n yield put(\n addNotification({ id: nanoid(), type: NotificationType.InApp, message }),\n );\n\n return null;\n}\n\n/**\n * Get a method that can be used to show an in-app notification.\n *\n * @param runSaga - A function to run a saga outside the usual Redux flow.\n * @returns A method that can be used to show an in-app notification.\n */\nexport function getShowInAppNotificationImplementation(\n runSaga: RunSagaFunction,\n) {\n return async (\n ...args: Parameters<typeof showInAppNotificationImplementation>\n ) => {\n return await runSaga(\n showInAppNotificationImplementation,\n ...args,\n ).toPromise();\n };\n}\n"]}
@@ -1,17 +0,0 @@
1
- import type { NotifyParams } from "@metamask/snaps-sdk";
2
- import type { RunSagaFunction } from "../../store/index.cjs";
3
- /**
4
- * Get a method that can be used to show a native notification.
5
- *
6
- * @param runSaga - A function to run a saga outside the usual Redux flow.
7
- * @returns A method that can be used to show a native notification.
8
- */
9
- export declare function getShowNativeNotificationImplementation(runSaga: RunSagaFunction): (_snapId: string, args_1: NotifyParams) => Promise<any>;
10
- /**
11
- * Get a method that can be used to show an in-app notification.
12
- *
13
- * @param runSaga - A function to run a saga outside the usual Redux flow.
14
- * @returns A method that can be used to show an in-app notification.
15
- */
16
- export declare function getShowInAppNotificationImplementation(runSaga: RunSagaFunction): (_snapId: string, args_1: NotifyParams) => Promise<any>;
17
- //# sourceMappingURL=notifications.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"notifications.d.cts","sourceRoot":"","sources":["../../../../../src/internals/simulation/methods/hooks/notifications.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,4BAA4B;AAMxD,OAAO,KAAK,EAAE,eAAe,EAAE,8BAAoB;AAuBnD;;;;;GAKG;AACH,wBAAgB,uCAAuC,CACrD,OAAO,EAAE,eAAe,2DAUzB;AAsBD;;;;;GAKG;AACH,wBAAgB,sCAAsC,CACpD,OAAO,EAAE,eAAe,2DAUzB"}
@@ -1,17 +0,0 @@
1
- import type { NotifyParams } from "@metamask/snaps-sdk";
2
- import type { RunSagaFunction } from "../../store/index.mjs";
3
- /**
4
- * Get a method that can be used to show a native notification.
5
- *
6
- * @param runSaga - A function to run a saga outside the usual Redux flow.
7
- * @returns A method that can be used to show a native notification.
8
- */
9
- export declare function getShowNativeNotificationImplementation(runSaga: RunSagaFunction): (_snapId: string, args_1: NotifyParams) => Promise<any>;
10
- /**
11
- * Get a method that can be used to show an in-app notification.
12
- *
13
- * @param runSaga - A function to run a saga outside the usual Redux flow.
14
- * @returns A method that can be used to show an in-app notification.
15
- */
16
- export declare function getShowInAppNotificationImplementation(runSaga: RunSagaFunction): (_snapId: string, args_1: NotifyParams) => Promise<any>;
17
- //# sourceMappingURL=notifications.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"notifications.d.mts","sourceRoot":"","sources":["../../../../../src/internals/simulation/methods/hooks/notifications.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,4BAA4B;AAMxD,OAAO,KAAK,EAAE,eAAe,EAAE,8BAAoB;AAuBnD;;;;;GAKG;AACH,wBAAgB,uCAAuC,CACrD,OAAO,EAAE,eAAe,2DAUzB;AAsBD;;;;;GAKG;AACH,wBAAgB,sCAAsC,CACpD,OAAO,EAAE,eAAe,2DAUzB"}
@@ -1,55 +0,0 @@
1
- import { NotificationType } from "@metamask/snaps-sdk";
2
- import $reduxjstoolkit from "@reduxjs/toolkit";
3
- const { nanoid } = $reduxjstoolkit;
4
- import $reduxsagaeffects from "redux-saga/effects";
5
- const { put } = $reduxsagaeffects;
6
- import { addNotification } from "../../store/index.mjs";
7
- /**
8
- * Show a native notification to the user.
9
- *
10
- * @param _snapId - The ID of the Snap that created the notification.
11
- * @param options - The notification options.
12
- * @param options.message - The message to show in the notification.
13
- * @yields Adds the notification to the store.
14
- * @returns `null`.
15
- */
16
- function* showNativeNotificationImplementation(_snapId, { message }) {
17
- yield put(addNotification({ id: nanoid(), type: NotificationType.Native, message }));
18
- return null;
19
- }
20
- /**
21
- * Get a method that can be used to show a native notification.
22
- *
23
- * @param runSaga - A function to run a saga outside the usual Redux flow.
24
- * @returns A method that can be used to show a native notification.
25
- */
26
- export function getShowNativeNotificationImplementation(runSaga) {
27
- return async (...args) => {
28
- return await runSaga(showNativeNotificationImplementation, ...args).toPromise();
29
- };
30
- }
31
- /**
32
- * Show an in-app notification to the user.
33
- *
34
- * @param _snapId - The ID of the Snap that created the notification.
35
- * @param options - The notification options.
36
- * @param options.message - The message to show in the notification.
37
- * @yields Adds the notification to the store.
38
- * @returns `null`.
39
- */
40
- function* showInAppNotificationImplementation(_snapId, { message }) {
41
- yield put(addNotification({ id: nanoid(), type: NotificationType.InApp, message }));
42
- return null;
43
- }
44
- /**
45
- * Get a method that can be used to show an in-app notification.
46
- *
47
- * @param runSaga - A function to run a saga outside the usual Redux flow.
48
- * @returns A method that can be used to show an in-app notification.
49
- */
50
- export function getShowInAppNotificationImplementation(runSaga) {
51
- return async (...args) => {
52
- return await runSaga(showInAppNotificationImplementation, ...args).toPromise();
53
- };
54
- }
55
- //# sourceMappingURL=notifications.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"notifications.mjs","sourceRoot":"","sources":["../../../../../src/internals/simulation/methods/hooks/notifications.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,4BAA4B;;;;;AAMvD,OAAO,EAAE,eAAe,EAAE,8BAAoB;AAE9C;;;;;;;;GAQG;AACH,QAAQ,CAAC,CAAC,oCAAoC,CAC5C,OAAe,EACf,EAAE,OAAO,EAAgB;IAEzB,MAAM,GAAG,CACP,eAAe,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,gBAAgB,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,CAC1E,CAAC;IAEF,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,uCAAuC,CACrD,OAAwB;IAExB,OAAO,KAAK,EACV,GAAG,IAA6D,EAChE,EAAE;QACF,OAAO,MAAM,OAAO,CAClB,oCAAoC,EACpC,GAAG,IAAI,CACR,CAAC,SAAS,EAAE,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC;AAED;;;;;;;;GAQG;AACH,QAAQ,CAAC,CAAC,mCAAmC,CAC3C,OAAe,EACf,EAAE,OAAO,EAAgB;IAEzB,MAAM,GAAG,CACP,eAAe,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,gBAAgB,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC,CACzE,CAAC;IAEF,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,sCAAsC,CACpD,OAAwB;IAExB,OAAO,KAAK,EACV,GAAG,IAA4D,EAC/D,EAAE;QACF,OAAO,MAAM,OAAO,CAClB,mCAAmC,EACnC,GAAG,IAAI,CACR,CAAC,SAAS,EAAE,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import type { NotifyParams } from '@metamask/snaps-sdk';\nimport { NotificationType } from '@metamask/snaps-sdk';\nimport { nanoid } from '@reduxjs/toolkit';\nimport type { SagaIterator } from 'redux-saga';\nimport { put } from 'redux-saga/effects';\n\nimport type { RunSagaFunction } from '../../store';\nimport { addNotification } from '../../store';\n\n/**\n * Show a native notification to the user.\n *\n * @param _snapId - The ID of the Snap that created the notification.\n * @param options - The notification options.\n * @param options.message - The message to show in the notification.\n * @yields Adds the notification to the store.\n * @returns `null`.\n */\nfunction* showNativeNotificationImplementation(\n _snapId: string,\n { message }: NotifyParams,\n): SagaIterator {\n yield put(\n addNotification({ id: nanoid(), type: NotificationType.Native, message }),\n );\n\n return null;\n}\n\n/**\n * Get a method that can be used to show a native notification.\n *\n * @param runSaga - A function to run a saga outside the usual Redux flow.\n * @returns A method that can be used to show a native notification.\n */\nexport function getShowNativeNotificationImplementation(\n runSaga: RunSagaFunction,\n) {\n return async (\n ...args: Parameters<typeof showNativeNotificationImplementation>\n ) => {\n return await runSaga(\n showNativeNotificationImplementation,\n ...args,\n ).toPromise();\n };\n}\n\n/**\n * Show an in-app notification to the user.\n *\n * @param _snapId - The ID of the Snap that created the notification.\n * @param options - The notification options.\n * @param options.message - The message to show in the notification.\n * @yields Adds the notification to the store.\n * @returns `null`.\n */\nfunction* showInAppNotificationImplementation(\n _snapId: string,\n { message }: NotifyParams,\n): SagaIterator<null> {\n yield put(\n addNotification({ id: nanoid(), type: NotificationType.InApp, message }),\n );\n\n return null;\n}\n\n/**\n * Get a method that can be used to show an in-app notification.\n *\n * @param runSaga - A function to run a saga outside the usual Redux flow.\n * @returns A method that can be used to show an in-app notification.\n */\nexport function getShowInAppNotificationImplementation(\n runSaga: RunSagaFunction,\n) {\n return async (\n ...args: Parameters<typeof showInAppNotificationImplementation>\n ) => {\n return await runSaga(\n showInAppNotificationImplementation,\n ...args,\n ).toPromise();\n };\n}\n"]}
@@ -1,38 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getRequestUserApprovalImplementation = void 0;
4
- const effects_1 = require("redux-saga/effects");
5
- const store_1 = require("../../store/index.cjs");
6
- /**
7
- * Show a dialog to the user. This will wait for `resolveUserInterface` to be
8
- * dispatched before returning.
9
- *
10
- * @param opts - The options for the request.
11
- * @param opts.type - The type of dialog to show.
12
- * @param opts.requestData - The data to display in the dialog.
13
- * @param opts.requestData.id - The ID of the interface.
14
- * @yields Sets the dialog in the store, waits for the user to resolve the
15
- * dialog, and closes the dialog.
16
- * @returns The result of the dialog.
17
- */
18
- function* requestUserApprovalImplementation({ type, requestData: { id }, }) {
19
- yield (0, effects_1.put)((0, store_1.setInterface)({ type, id }));
20
- // We use `take` to wait for `resolveUserInterface` to be dispatched, which
21
- // indicates that the user has resolved the dialog.
22
- const { payload } = yield (0, effects_1.take)(store_1.resolveInterface.type);
23
- yield (0, effects_1.put)((0, store_1.closeInterface)());
24
- return payload;
25
- }
26
- /**
27
- * Get the implementation of the `requestUserApproval` hook.
28
- *
29
- * @param runSaga - The function to run a saga outside the usual Redux flow.
30
- * @returns The implementation of the `requestUserApproval` hook.
31
- */
32
- function getRequestUserApprovalImplementation(runSaga) {
33
- return async (...args) => {
34
- return await runSaga(requestUserApprovalImplementation, ...args).toPromise();
35
- };
36
- }
37
- exports.getRequestUserApprovalImplementation = getRequestUserApprovalImplementation;
38
- //# sourceMappingURL=request-user-approval.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"request-user-approval.cjs","sourceRoot":"","sources":["../../../../../src/internals/simulation/methods/hooks/request-user-approval.ts"],"names":[],"mappings":";;;AACA,gDAA+C;AAG/C,iDAA6E;AAS7E;;;;;;;;;;;GAWG;AACH,QAAQ,CAAC,CAAC,iCAAiC,CAAC,EAC1C,IAAI,EACJ,WAAW,EAAE,EAAE,EAAE,EAAE,GACO;IAC1B,MAAM,IAAA,aAAG,EAAC,IAAA,oBAAY,EAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IAEtC,2EAA2E;IAC3E,mDAAmD;IACnD,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,IAAA,cAAI,EAAC,wBAAgB,CAAC,IAAI,CAAC,CAAC;IACtD,MAAM,IAAA,aAAG,EAAC,IAAA,sBAAc,GAAE,CAAC,CAAC;IAE5B,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;GAKG;AACH,SAAgB,oCAAoC,CAAC,OAAwB;IAC3E,OAAO,KAAK,EACV,GAAG,IAA0D,EAC7D,EAAE;QACF,OAAO,MAAM,OAAO,CAClB,iCAAiC,EACjC,GAAG,IAAI,CACR,CAAC,SAAS,EAAE,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC;AATD,oFASC","sourcesContent":["import type { SagaIterator } from 'redux-saga';\nimport { put, take } from 'redux-saga/effects';\n\nimport type { RunSagaFunction } from '../../store';\nimport { resolveInterface, setInterface, closeInterface } from '../../store';\n\ntype RequestUserApprovalParams = {\n type: string;\n requestData: {\n id: string;\n };\n};\n\n/**\n * Show a dialog to the user. This will wait for `resolveUserInterface` to be\n * dispatched before returning.\n *\n * @param opts - The options for the request.\n * @param opts.type - The type of dialog to show.\n * @param opts.requestData - The data to display in the dialog.\n * @param opts.requestData.id - The ID of the interface.\n * @yields Sets the dialog in the store, waits for the user to resolve the\n * dialog, and closes the dialog.\n * @returns The result of the dialog.\n */\nfunction* requestUserApprovalImplementation({\n type,\n requestData: { id },\n}: RequestUserApprovalParams): SagaIterator<unknown> {\n yield put(setInterface({ type, id }));\n\n // We use `take` to wait for `resolveUserInterface` to be dispatched, which\n // indicates that the user has resolved the dialog.\n const { payload } = yield take(resolveInterface.type);\n yield put(closeInterface());\n\n return payload;\n}\n\n/**\n * Get the implementation of the `requestUserApproval` hook.\n *\n * @param runSaga - The function to run a saga outside the usual Redux flow.\n * @returns The implementation of the `requestUserApproval` hook.\n */\nexport function getRequestUserApprovalImplementation(runSaga: RunSagaFunction) {\n return async (\n ...args: Parameters<typeof requestUserApprovalImplementation>\n ) => {\n return await runSaga(\n requestUserApprovalImplementation,\n ...args,\n ).toPromise();\n };\n}\n"]}
@@ -1,16 +0,0 @@
1
- import type { RunSagaFunction } from "../../store/index.cjs";
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 {};
16
- //# sourceMappingURL=request-user-approval.d.cts.map