@metamask/snaps-jest 8.3.0 → 8.3.2

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 (625) hide show
  1. package/CHANGELOG.md +16 -2
  2. package/dist/environment.cjs +96 -0
  3. package/dist/environment.cjs.map +1 -0
  4. package/dist/{types/environment.d.ts → environment.d.cts} +5 -4
  5. package/dist/environment.d.cts.map +1 -0
  6. package/dist/environment.d.mts +53 -0
  7. package/dist/environment.d.mts.map +1 -0
  8. package/dist/environment.mjs +94 -44
  9. package/dist/environment.mjs.map +1 -1
  10. package/dist/global.cjs +4 -0
  11. package/dist/global.cjs.map +1 -0
  12. package/dist/{types/global.d.ts → global.d.cts} +2 -1
  13. package/dist/global.d.cts.map +1 -0
  14. package/dist/global.d.mts +70 -0
  15. package/dist/global.d.mts.map +1 -0
  16. package/dist/global.mjs +2 -1
  17. package/dist/global.mjs.map +1 -1
  18. package/dist/helpers.cjs +240 -0
  19. package/dist/helpers.cjs.map +1 -0
  20. package/dist/{types/helpers.d.ts → helpers.d.cts} +5 -4
  21. package/dist/helpers.d.cts.map +1 -0
  22. package/dist/helpers.d.mts +132 -0
  23. package/dist/helpers.d.mts.map +1 -0
  24. package/dist/helpers.mjs +228 -56
  25. package/dist/helpers.mjs.map +1 -1
  26. package/dist/index.cjs +29 -0
  27. package/dist/index.cjs.map +1 -0
  28. package/dist/index.d.cts +6 -0
  29. package/dist/index.d.cts.map +1 -0
  30. package/dist/index.d.mts +6 -0
  31. package/dist/index.d.mts.map +1 -0
  32. package/dist/index.mjs +6 -67
  33. package/dist/index.mjs.map +1 -1
  34. package/dist/internals/environment.cjs +18 -0
  35. package/dist/internals/environment.cjs.map +1 -0
  36. package/dist/{types/internals/environment.d.ts → internals/environment.d.cts} +2 -1
  37. package/dist/internals/environment.d.cts.map +1 -0
  38. package/dist/internals/environment.d.mts +8 -0
  39. package/dist/internals/environment.d.mts.map +1 -0
  40. package/dist/internals/environment.mjs +13 -7
  41. package/dist/internals/environment.mjs.map +1 -1
  42. package/dist/internals/index.cjs +23 -0
  43. package/dist/internals/index.cjs.map +1 -0
  44. package/dist/internals/index.d.cts +7 -0
  45. package/dist/internals/index.d.cts.map +1 -0
  46. package/dist/internals/index.d.mts +7 -0
  47. package/dist/internals/index.d.mts.map +1 -0
  48. package/dist/internals/index.mjs +6 -149
  49. package/dist/internals/index.mjs.map +1 -1
  50. package/dist/internals/logger.cjs +6 -0
  51. package/dist/internals/logger.cjs.map +1 -0
  52. package/dist/{types/internals/logger.d.ts → internals/logger.d.cts} +1 -0
  53. package/dist/internals/logger.d.cts.map +1 -0
  54. package/dist/internals/logger.d.mts +3 -0
  55. package/dist/internals/logger.d.mts.map +1 -0
  56. package/dist/internals/logger.mjs +2 -7
  57. package/dist/internals/logger.mjs.map +1 -1
  58. package/dist/internals/request.cjs +143 -0
  59. package/dist/internals/request.cjs.map +1 -0
  60. package/dist/{types/internals/request.d.ts → internals/request.d.cts} +7 -6
  61. package/dist/internals/request.d.cts.map +1 -0
  62. package/dist/internals/request.d.mts +56 -0
  63. package/dist/internals/request.d.mts.map +1 -0
  64. package/dist/internals/request.mjs +137 -41
  65. package/dist/internals/request.mjs.map +1 -1
  66. package/dist/internals/server.cjs +74 -0
  67. package/dist/internals/server.cjs.map +1 -0
  68. package/dist/{types/internals/server.d.ts → internals/server.d.cts} +3 -2
  69. package/dist/internals/server.d.cts.map +1 -0
  70. package/dist/internals/server.d.mts +15 -0
  71. package/dist/internals/server.d.mts.map +1 -0
  72. package/dist/internals/server.mjs +73 -8
  73. package/dist/internals/server.mjs.map +1 -1
  74. package/dist/internals/simulation/constants.cjs +21 -0
  75. package/dist/internals/simulation/constants.cjs.map +1 -0
  76. package/dist/{types/internals/simulation/constants.d.ts → internals/simulation/constants.d.cts} +1 -0
  77. package/dist/internals/simulation/constants.d.cts.map +1 -0
  78. package/dist/internals/simulation/constants.d.mts +18 -0
  79. package/dist/internals/simulation/constants.d.mts.map +1 -0
  80. package/dist/internals/simulation/constants.mjs +17 -13
  81. package/dist/internals/simulation/constants.mjs.map +1 -1
  82. package/dist/internals/simulation/controllers.cjs +101 -0
  83. package/dist/internals/simulation/controllers.cjs.map +1 -0
  84. package/dist/{types/internals/simulation/controllers.d.ts → internals/simulation/controllers.d.cts} +11 -10
  85. package/dist/internals/simulation/controllers.d.cts.map +1 -0
  86. package/dist/internals/simulation/controllers.d.mts +41 -0
  87. package/dist/internals/simulation/controllers.d.mts.map +1 -0
  88. package/dist/internals/simulation/controllers.mjs +95 -24
  89. package/dist/internals/simulation/controllers.mjs.map +1 -1
  90. package/dist/internals/simulation/files.cjs +94 -0
  91. package/dist/internals/simulation/files.cjs.map +1 -0
  92. package/dist/{types/internals/simulation/files.d.ts → internals/simulation/files.d.cts} +6 -4
  93. package/dist/internals/simulation/files.d.cts.map +1 -0
  94. package/dist/internals/simulation/files.d.mts +49 -0
  95. package/dist/internals/simulation/files.d.mts.map +1 -0
  96. package/dist/internals/simulation/files.mjs +90 -13
  97. package/dist/internals/simulation/files.mjs.map +1 -1
  98. package/dist/internals/simulation/index.cjs +22 -0
  99. package/dist/internals/simulation/index.cjs.map +1 -0
  100. package/dist/internals/simulation/index.d.cts +6 -0
  101. package/dist/internals/simulation/index.d.cts.map +1 -0
  102. package/dist/internals/simulation/index.d.mts +6 -0
  103. package/dist/internals/simulation/index.d.mts.map +1 -0
  104. package/dist/internals/simulation/index.mjs +5 -110
  105. package/dist/internals/simulation/index.mjs.map +1 -1
  106. package/dist/internals/simulation/interface.cjs +527 -0
  107. package/dist/internals/simulation/interface.cjs.map +1 -0
  108. package/dist/{types/internals/simulation/interface.d.ts → internals/simulation/interface.d.cts} +9 -8
  109. package/dist/internals/simulation/interface.d.cts.map +1 -0
  110. package/dist/internals/simulation/interface.d.mts +152 -0
  111. package/dist/internals/simulation/interface.d.mts.map +1 -0
  112. package/dist/internals/simulation/interface.mjs +512 -36
  113. package/dist/internals/simulation/interface.mjs.map +1 -1
  114. package/dist/internals/simulation/methods/constants.cjs +72 -0
  115. package/dist/internals/simulation/methods/constants.cjs.map +1 -0
  116. package/dist/{types/internals/simulation/methods/constants.d.ts → internals/simulation/methods/constants.d.cts} +1 -0
  117. package/dist/internals/simulation/methods/constants.d.cts.map +1 -0
  118. package/dist/internals/simulation/methods/constants.d.mts +11 -0
  119. package/dist/internals/simulation/methods/constants.d.mts.map +1 -0
  120. package/dist/internals/simulation/methods/constants.mjs +68 -11
  121. package/dist/internals/simulation/methods/constants.mjs.map +1 -1
  122. package/dist/internals/simulation/methods/hooks/get-preferences.cjs +18 -0
  123. package/dist/internals/simulation/methods/hooks/get-preferences.cjs.map +1 -0
  124. package/dist/{types/internals/simulation/methods/hooks/get-preferences.d.ts → internals/simulation/methods/hooks/get-preferences.d.cts} +2 -1
  125. package/dist/internals/simulation/methods/hooks/get-preferences.d.cts.map +1 -0
  126. package/dist/internals/simulation/methods/hooks/get-preferences.d.mts +14 -0
  127. package/dist/internals/simulation/methods/hooks/get-preferences.d.mts.map +1 -0
  128. package/dist/internals/simulation/methods/hooks/get-preferences.mjs +13 -7
  129. package/dist/internals/simulation/methods/hooks/get-preferences.mjs.map +1 -1
  130. package/dist/internals/simulation/methods/hooks/index.cjs +22 -0
  131. package/dist/internals/simulation/methods/hooks/index.cjs.map +1 -0
  132. package/dist/internals/simulation/methods/hooks/index.d.cts +6 -0
  133. package/dist/internals/simulation/methods/hooks/index.d.cts.map +1 -0
  134. package/dist/internals/simulation/methods/hooks/index.d.mts +6 -0
  135. package/dist/internals/simulation/methods/hooks/index.d.mts.map +1 -0
  136. package/dist/internals/simulation/methods/hooks/index.mjs +5 -38
  137. package/dist/internals/simulation/methods/hooks/index.mjs.map +1 -1
  138. package/dist/internals/simulation/methods/hooks/interface.cjs +24 -0
  139. package/dist/internals/simulation/methods/hooks/interface.cjs.map +1 -0
  140. package/dist/{types/internals/simulation/methods/hooks/interface.d.ts → internals/simulation/methods/hooks/interface.d.cts} +3 -2
  141. package/dist/internals/simulation/methods/hooks/interface.d.cts.map +1 -0
  142. package/dist/internals/simulation/methods/hooks/interface.d.mts +17 -0
  143. package/dist/internals/simulation/methods/hooks/interface.d.mts.map +1 -0
  144. package/dist/internals/simulation/methods/hooks/interface.mjs +18 -9
  145. package/dist/internals/simulation/methods/hooks/interface.mjs.map +1 -1
  146. package/dist/internals/simulation/methods/hooks/notifications.cjs +58 -0
  147. package/dist/internals/simulation/methods/hooks/notifications.cjs.map +1 -0
  148. package/dist/{types/internals/simulation/methods/hooks/notifications.d.ts → internals/simulation/methods/hooks/notifications.d.cts} +5 -4
  149. package/dist/internals/simulation/methods/hooks/notifications.d.cts.map +1 -0
  150. package/dist/internals/simulation/methods/hooks/notifications.d.mts +17 -0
  151. package/dist/internals/simulation/methods/hooks/notifications.d.mts.map +1 -0
  152. package/dist/internals/simulation/methods/hooks/notifications.mjs +54 -15
  153. package/dist/internals/simulation/methods/hooks/notifications.mjs.map +1 -1
  154. package/dist/internals/simulation/methods/hooks/request-user-approval.cjs +38 -0
  155. package/dist/internals/simulation/methods/hooks/request-user-approval.cjs.map +1 -0
  156. package/dist/{types/internals/simulation/methods/hooks/request-user-approval.d.ts → internals/simulation/methods/hooks/request-user-approval.d.cts} +2 -1
  157. package/dist/internals/simulation/methods/hooks/request-user-approval.d.cts.map +1 -0
  158. package/dist/internals/simulation/methods/hooks/request-user-approval.d.mts +16 -0
  159. package/dist/internals/simulation/methods/hooks/request-user-approval.d.mts.map +1 -0
  160. package/dist/internals/simulation/methods/hooks/request-user-approval.mjs +34 -13
  161. package/dist/internals/simulation/methods/hooks/request-user-approval.mjs.map +1 -1
  162. package/dist/internals/simulation/methods/hooks/state.cjs +84 -0
  163. package/dist/internals/simulation/methods/hooks/state.cjs.map +1 -0
  164. package/dist/{types/internals/simulation/methods/hooks/state.d.ts → internals/simulation/methods/hooks/state.d.cts} +3 -2
  165. package/dist/internals/simulation/methods/hooks/state.d.cts.map +1 -0
  166. package/dist/internals/simulation/methods/hooks/state.d.mts +24 -0
  167. package/dist/internals/simulation/methods/hooks/state.d.mts.map +1 -0
  168. package/dist/internals/simulation/methods/hooks/state.mjs +78 -17
  169. package/dist/internals/simulation/methods/hooks/state.mjs.map +1 -1
  170. package/dist/internals/simulation/methods/index.cjs +18 -0
  171. package/dist/internals/simulation/methods/index.cjs.map +1 -0
  172. package/dist/internals/simulation/methods/index.d.cts +2 -0
  173. package/dist/internals/simulation/methods/index.d.cts.map +1 -0
  174. package/dist/internals/simulation/methods/index.d.mts +2 -0
  175. package/dist/internals/simulation/methods/index.d.mts.map +1 -0
  176. package/dist/internals/simulation/methods/index.mjs +1 -27
  177. package/dist/internals/simulation/methods/index.mjs.map +1 -1
  178. package/dist/internals/simulation/methods/specifications.cjs +85 -0
  179. package/dist/internals/simulation/methods/specifications.cjs.map +1 -0
  180. package/dist/{types/internals/simulation/methods/specifications.d.ts → internals/simulation/methods/specifications.d.cts} +6 -5
  181. package/dist/internals/simulation/methods/specifications.d.cts.map +1 -0
  182. package/dist/internals/simulation/methods/specifications.d.mts +57 -0
  183. package/dist/internals/simulation/methods/specifications.d.mts.map +1 -0
  184. package/dist/internals/simulation/methods/specifications.mjs +77 -26
  185. package/dist/internals/simulation/methods/specifications.mjs.map +1 -1
  186. package/dist/internals/simulation/middleware/engine.cjs +37 -0
  187. package/dist/internals/simulation/middleware/engine.cjs.map +1 -0
  188. package/dist/{types/internals/simulation/middleware/engine.d.ts → internals/simulation/middleware/engine.d.cts} +7 -6
  189. package/dist/internals/simulation/middleware/engine.d.cts.map +1 -0
  190. package/dist/internals/simulation/middleware/engine.d.mts +27 -0
  191. package/dist/internals/simulation/middleware/engine.d.mts.map +1 -0
  192. package/dist/internals/simulation/middleware/engine.mjs +33 -14
  193. package/dist/internals/simulation/middleware/engine.mjs.map +1 -1
  194. package/dist/internals/simulation/middleware/index.cjs +18 -0
  195. package/dist/internals/simulation/middleware/index.cjs.map +1 -0
  196. package/dist/internals/simulation/middleware/index.d.cts +2 -0
  197. package/dist/internals/simulation/middleware/index.d.cts.map +1 -0
  198. package/dist/internals/simulation/middleware/index.d.mts +2 -0
  199. package/dist/internals/simulation/middleware/index.d.mts.map +1 -0
  200. package/dist/internals/simulation/middleware/index.mjs +1 -15
  201. package/dist/internals/simulation/middleware/index.mjs.map +1 -1
  202. package/dist/internals/simulation/middleware/internal-methods/accounts.cjs +34 -0
  203. package/dist/internals/simulation/middleware/internal-methods/accounts.cjs.map +1 -0
  204. package/dist/{types/internals/simulation/middleware/internal-methods/accounts.d.ts → internals/simulation/middleware/internal-methods/accounts.d.cts} +4 -2
  205. package/dist/internals/simulation/middleware/internal-methods/accounts.d.cts.map +1 -0
  206. package/dist/internals/simulation/middleware/internal-methods/accounts.d.mts +20 -0
  207. package/dist/internals/simulation/middleware/internal-methods/accounts.d.mts.map +1 -0
  208. package/dist/internals/simulation/middleware/internal-methods/accounts.mjs +29 -7
  209. package/dist/internals/simulation/middleware/internal-methods/accounts.mjs.map +1 -1
  210. package/dist/internals/simulation/middleware/internal-methods/index.cjs +18 -0
  211. package/dist/internals/simulation/middleware/internal-methods/index.cjs.map +1 -0
  212. package/dist/internals/simulation/middleware/internal-methods/index.d.cts +2 -0
  213. package/dist/internals/simulation/middleware/internal-methods/index.d.cts.map +1 -0
  214. package/dist/internals/simulation/middleware/internal-methods/index.d.mts +2 -0
  215. package/dist/internals/simulation/middleware/internal-methods/index.d.mts.map +1 -0
  216. package/dist/internals/simulation/middleware/internal-methods/index.mjs +1 -10
  217. package/dist/internals/simulation/middleware/internal-methods/index.mjs.map +1 -1
  218. package/dist/internals/simulation/middleware/internal-methods/middleware.cjs +44 -0
  219. package/dist/internals/simulation/middleware/internal-methods/middleware.cjs.map +1 -0
  220. package/dist/{types/internals/simulation/middleware/internal-methods/middleware.d.ts → internals/simulation/middleware/internal-methods/middleware.d.cts} +3 -2
  221. package/dist/internals/simulation/middleware/internal-methods/middleware.d.cts.map +1 -0
  222. package/dist/internals/simulation/middleware/internal-methods/middleware.d.mts +23 -0
  223. package/dist/internals/simulation/middleware/internal-methods/middleware.d.mts.map +1 -0
  224. package/dist/internals/simulation/middleware/internal-methods/middleware.mjs +38 -8
  225. package/dist/internals/simulation/middleware/internal-methods/middleware.mjs.map +1 -1
  226. package/dist/internals/simulation/middleware/internal-methods/provider-state.cjs +28 -0
  227. package/dist/internals/simulation/middleware/internal-methods/provider-state.cjs.map +1 -0
  228. package/dist/{types/internals/simulation/middleware/internal-methods/provider-state.d.ts → internals/simulation/middleware/internal-methods/provider-state.d.cts} +4 -2
  229. package/dist/internals/simulation/middleware/internal-methods/provider-state.d.cts.map +1 -0
  230. package/dist/internals/simulation/middleware/internal-methods/provider-state.d.mts +16 -0
  231. package/dist/internals/simulation/middleware/internal-methods/provider-state.d.mts.map +1 -0
  232. package/dist/internals/simulation/middleware/internal-methods/provider-state.mjs +23 -7
  233. package/dist/internals/simulation/middleware/internal-methods/provider-state.mjs.map +1 -1
  234. package/dist/internals/simulation/middleware/mock.cjs +22 -0
  235. package/dist/internals/simulation/middleware/mock.cjs.map +1 -0
  236. package/dist/{types/internals/simulation/middleware/mock.d.ts → internals/simulation/middleware/mock.d.cts} +4 -3
  237. package/dist/internals/simulation/middleware/mock.d.cts.map +1 -0
  238. package/dist/internals/simulation/middleware/mock.d.mts +11 -0
  239. package/dist/internals/simulation/middleware/mock.d.mts.map +1 -0
  240. package/dist/internals/simulation/middleware/mock.mjs +17 -8
  241. package/dist/internals/simulation/middleware/mock.mjs.map +1 -1
  242. package/dist/internals/simulation/options.cjs +25 -0
  243. package/dist/internals/simulation/options.cjs.map +1 -0
  244. package/dist/{types/internals/simulation/options.d.ts → internals/simulation/options.d.cts} +3 -2
  245. package/dist/internals/simulation/options.d.cts.map +1 -0
  246. package/dist/internals/simulation/options.d.mts +40 -0
  247. package/dist/internals/simulation/options.d.mts.map +1 -0
  248. package/dist/internals/simulation/options.mjs +20 -8
  249. package/dist/internals/simulation/options.mjs.map +1 -1
  250. package/dist/internals/simulation/simulation.cjs +155 -0
  251. package/dist/internals/simulation/simulation.cjs.map +1 -0
  252. package/dist/{types/internals/simulation/simulation.d.ts → internals/simulation/simulation.d.cts} +11 -9
  253. package/dist/internals/simulation/simulation.d.cts.map +1 -0
  254. package/dist/internals/simulation/simulation.d.mts +103 -0
  255. package/dist/internals/simulation/simulation.d.mts.map +1 -0
  256. package/dist/internals/simulation/simulation.mjs +149 -38
  257. package/dist/internals/simulation/simulation.mjs.map +1 -1
  258. package/dist/internals/simulation/store/index.cjs +21 -0
  259. package/dist/internals/simulation/store/index.cjs.map +1 -0
  260. package/dist/internals/simulation/store/index.d.cts +5 -0
  261. package/dist/internals/simulation/store/index.d.cts.map +1 -0
  262. package/dist/internals/simulation/store/index.d.mts +5 -0
  263. package/dist/internals/simulation/store/index.d.mts.map +1 -0
  264. package/dist/internals/simulation/store/index.mjs +4 -43
  265. package/dist/internals/simulation/store/index.mjs.map +1 -1
  266. package/dist/internals/simulation/store/mocks.cjs +39 -0
  267. package/dist/internals/simulation/store/mocks.cjs.map +1 -0
  268. package/dist/{types/internals/simulation/store/mocks.d.ts → internals/simulation/store/mocks.d.cts} +9 -8
  269. package/dist/internals/simulation/store/mocks.d.cts.map +1 -0
  270. package/dist/internals/simulation/store/mocks.d.mts +36 -0
  271. package/dist/internals/simulation/store/mocks.d.mts.map +1 -0
  272. package/dist/internals/simulation/store/mocks.mjs +33 -14
  273. package/dist/internals/simulation/store/mocks.mjs.map +1 -1
  274. package/dist/internals/simulation/store/notifications.cjs +35 -0
  275. package/dist/internals/simulation/store/notifications.cjs.map +1 -0
  276. package/dist/{types/internals/simulation/store/notifications.d.ts → internals/simulation/store/notifications.d.cts} +9 -8
  277. package/dist/internals/simulation/store/notifications.d.cts.map +1 -0
  278. package/dist/internals/simulation/store/notifications.d.mts +45 -0
  279. package/dist/internals/simulation/store/notifications.d.mts.map +1 -0
  280. package/dist/internals/simulation/store/notifications.mjs +30 -14
  281. package/dist/internals/simulation/store/notifications.mjs.map +1 -1
  282. package/dist/internals/simulation/store/state.cjs +54 -0
  283. package/dist/internals/simulation/store/state.cjs.map +1 -0
  284. package/dist/{types/internals/simulation/store/state.d.ts → internals/simulation/store/state.d.cts} +12 -11
  285. package/dist/internals/simulation/store/state.d.cts.map +1 -0
  286. package/dist/internals/simulation/store/state.d.mts +56 -0
  287. package/dist/internals/simulation/store/state.d.mts.map +1 -0
  288. package/dist/internals/simulation/store/state.mjs +48 -12
  289. package/dist/internals/simulation/store/state.mjs.map +1 -1
  290. package/dist/internals/simulation/store/store.cjs +51 -0
  291. package/dist/internals/simulation/store/store.cjs.map +1 -0
  292. package/dist/{types/internals/simulation/store/store.d.ts → internals/simulation/store/store.d.cts} +6 -5
  293. package/dist/internals/simulation/store/store.d.cts.map +1 -0
  294. package/dist/internals/simulation/store/store.d.mts +22 -0
  295. package/dist/internals/simulation/store/store.d.mts.map +1 -0
  296. package/dist/internals/simulation/store/store.mjs +44 -11
  297. package/dist/internals/simulation/store/store.mjs.map +1 -1
  298. package/dist/internals/simulation/store/ui.cjs +24 -0
  299. package/dist/internals/simulation/store/ui.cjs.map +1 -0
  300. package/dist/{types/internals/simulation/store/ui.d.ts → internals/simulation/store/ui.d.cts} +9 -8
  301. package/dist/internals/simulation/store/ui.d.cts.map +1 -0
  302. package/dist/internals/simulation/store/ui.d.mts +27 -0
  303. package/dist/internals/simulation/store/ui.d.mts.map +1 -0
  304. package/dist/internals/simulation/store/ui.mjs +19 -14
  305. package/dist/internals/simulation/store/ui.mjs.map +1 -1
  306. package/dist/internals/structs.cjs +157 -0
  307. package/dist/internals/structs.cjs.map +1 -0
  308. package/dist/{types/internals/structs.d.ts → internals/structs.d.cts} +28 -27
  309. package/dist/internals/structs.d.cts.map +1 -0
  310. package/dist/internals/structs.d.mts +205 -0
  311. package/dist/internals/structs.d.mts.map +1 -0
  312. package/dist/internals/structs.mjs +153 -21
  313. package/dist/internals/structs.mjs.map +1 -1
  314. package/dist/matchers.cjs +160 -0
  315. package/dist/matchers.cjs.map +1 -0
  316. package/dist/{types/matchers.d.ts → matchers.d.cts} +4 -3
  317. package/dist/matchers.d.cts.map +1 -0
  318. package/dist/matchers.d.mts +28 -0
  319. package/dist/matchers.d.mts.map +1 -0
  320. package/dist/matchers.mjs +152 -47
  321. package/dist/matchers.mjs.map +1 -1
  322. package/dist/options.cjs +24 -0
  323. package/dist/options.cjs.map +1 -0
  324. package/dist/{types/options.d.ts → options.d.cts} +2 -1
  325. package/dist/options.d.cts.map +1 -0
  326. package/dist/options.d.mts +61 -0
  327. package/dist/options.d.mts.map +1 -0
  328. package/dist/options.mjs +19 -7
  329. package/dist/options.mjs.map +1 -1
  330. package/dist/setup.cjs +7 -0
  331. package/dist/setup.cjs.map +1 -0
  332. package/dist/setup.d.cts +2 -0
  333. package/dist/setup.d.cts.map +1 -0
  334. package/dist/setup.d.mts +2 -0
  335. package/dist/setup.d.mts.map +1 -0
  336. package/dist/setup.mjs +4 -37
  337. package/dist/setup.mjs.map +1 -1
  338. package/dist/types/index.cjs +18 -0
  339. package/dist/types/index.cjs.map +1 -0
  340. package/dist/types/index.d.cts +2 -0
  341. package/dist/types/index.d.cts.map +1 -0
  342. package/dist/types/index.d.mts +2 -0
  343. package/dist/types/index.d.mts.map +1 -0
  344. package/dist/types/index.mjs +2 -0
  345. package/dist/types/index.mjs.map +1 -0
  346. package/dist/types/types.cjs +3 -0
  347. package/dist/types/types.cjs.map +1 -0
  348. package/dist/types/{types.d.ts → types.d.cts} +7 -6
  349. package/dist/types/types.d.cts.map +1 -0
  350. package/dist/types/types.d.mts +386 -0
  351. package/dist/types/types.d.mts.map +1 -0
  352. package/dist/types/types.mjs +2 -0
  353. package/dist/types/types.mjs.map +1 -0
  354. package/jest-preset.js +1 -1
  355. package/package.json +25 -23
  356. package/dist/chunk-24CGIQLL.mjs +0 -30
  357. package/dist/chunk-24CGIQLL.mjs.map +0 -1
  358. package/dist/chunk-2JTGBHPR.js +0 -14
  359. package/dist/chunk-2JTGBHPR.js.map +0 -1
  360. package/dist/chunk-2RJYSYUB.js +0 -28
  361. package/dist/chunk-2RJYSYUB.js.map +0 -1
  362. package/dist/chunk-2YE2P5BZ.js +0 -36
  363. package/dist/chunk-2YE2P5BZ.js.map +0 -1
  364. package/dist/chunk-3FNLFVV2.js +0 -15
  365. package/dist/chunk-3FNLFVV2.js.map +0 -1
  366. package/dist/chunk-3J2IBWXV.mjs +0 -39
  367. package/dist/chunk-3J2IBWXV.mjs.map +0 -1
  368. package/dist/chunk-3NP6BDGK.js +0 -167
  369. package/dist/chunk-3NP6BDGK.js.map +0 -1
  370. package/dist/chunk-55J6XMHW.js +0 -1
  371. package/dist/chunk-55J6XMHW.js.map +0 -1
  372. package/dist/chunk-57SGDM5B.mjs +0 -69
  373. package/dist/chunk-57SGDM5B.mjs.map +0 -1
  374. package/dist/chunk-5U5WB3SM.mjs +0 -41
  375. package/dist/chunk-5U5WB3SM.mjs.map +0 -1
  376. package/dist/chunk-5ZFHFICZ.mjs +0 -1
  377. package/dist/chunk-5ZFHFICZ.mjs.map +0 -1
  378. package/dist/chunk-6HHV6YFQ.mjs +0 -1
  379. package/dist/chunk-6HHV6YFQ.mjs.map +0 -1
  380. package/dist/chunk-6JPBXAHM.mjs +0 -509
  381. package/dist/chunk-6JPBXAHM.mjs.map +0 -1
  382. package/dist/chunk-6V6MFT67.js +0 -38
  383. package/dist/chunk-6V6MFT67.js.map +0 -1
  384. package/dist/chunk-7PCHIR6O.mjs +0 -181
  385. package/dist/chunk-7PCHIR6O.mjs.map +0 -1
  386. package/dist/chunk-ALRZENWP.mjs +0 -42
  387. package/dist/chunk-ALRZENWP.mjs.map +0 -1
  388. package/dist/chunk-AMAL4SJH.js +0 -153
  389. package/dist/chunk-AMAL4SJH.js.map +0 -1
  390. package/dist/chunk-C26TYXXD.mjs +0 -240
  391. package/dist/chunk-C26TYXXD.mjs.map +0 -1
  392. package/dist/chunk-CACRY3TX.mjs +0 -104
  393. package/dist/chunk-CACRY3TX.mjs.map +0 -1
  394. package/dist/chunk-CKRORVDW.js +0 -1
  395. package/dist/chunk-CKRORVDW.js.map +0 -1
  396. package/dist/chunk-D653LBAY.js +0 -34
  397. package/dist/chunk-D653LBAY.js.map +0 -1
  398. package/dist/chunk-DR6Y7IVX.js +0 -1
  399. package/dist/chunk-DR6Y7IVX.js.map +0 -1
  400. package/dist/chunk-DUVKGPX5.js +0 -509
  401. package/dist/chunk-DUVKGPX5.js.map +0 -1
  402. package/dist/chunk-EMTW3H54.js +0 -20
  403. package/dist/chunk-EMTW3H54.js.map +0 -1
  404. package/dist/chunk-FP4H3ADT.mjs +0 -20
  405. package/dist/chunk-FP4H3ADT.mjs.map +0 -1
  406. package/dist/chunk-FQWOVTBB.mjs +0 -22
  407. package/dist/chunk-FQWOVTBB.mjs.map +0 -1
  408. package/dist/chunk-G333FBBL.mjs +0 -38
  409. package/dist/chunk-G333FBBL.mjs.map +0 -1
  410. package/dist/chunk-GECE47HW.js +0 -1
  411. package/dist/chunk-GECE47HW.js.map +0 -1
  412. package/dist/chunk-GLPGOEVE.js +0 -240
  413. package/dist/chunk-GLPGOEVE.js.map +0 -1
  414. package/dist/chunk-GMTKFAWO.js +0 -42
  415. package/dist/chunk-GMTKFAWO.js.map +0 -1
  416. package/dist/chunk-H2464AXT.mjs +0 -33
  417. package/dist/chunk-H2464AXT.mjs.map +0 -1
  418. package/dist/chunk-HROOL3VI.js +0 -1
  419. package/dist/chunk-HROOL3VI.js.map +0 -1
  420. package/dist/chunk-IWJ4HKDR.mjs +0 -50
  421. package/dist/chunk-IWJ4HKDR.mjs.map +0 -1
  422. package/dist/chunk-IXKO6X55.mjs +0 -15
  423. package/dist/chunk-IXKO6X55.mjs.map +0 -1
  424. package/dist/chunk-J3I5KZIF.js +0 -22
  425. package/dist/chunk-J3I5KZIF.js.map +0 -1
  426. package/dist/chunk-J4ZPUCLX.mjs +0 -8
  427. package/dist/chunk-J4ZPUCLX.mjs.map +0 -1
  428. package/dist/chunk-JMDSN227.mjs +0 -25
  429. package/dist/chunk-JMDSN227.mjs.map +0 -1
  430. package/dist/chunk-K7MK6LQU.js +0 -54
  431. package/dist/chunk-K7MK6LQU.js.map +0 -1
  432. package/dist/chunk-KIQOUUEZ.mjs +0 -1
  433. package/dist/chunk-KIQOUUEZ.mjs.map +0 -1
  434. package/dist/chunk-KOPPL55J.mjs +0 -28
  435. package/dist/chunk-KOPPL55J.mjs.map +0 -1
  436. package/dist/chunk-KPRLFCKD.js +0 -13
  437. package/dist/chunk-KPRLFCKD.js.map +0 -1
  438. package/dist/chunk-LACTK6EO.js +0 -33
  439. package/dist/chunk-LACTK6EO.js.map +0 -1
  440. package/dist/chunk-LB4R3BUA.mjs +0 -36
  441. package/dist/chunk-LB4R3BUA.mjs.map +0 -1
  442. package/dist/chunk-LBC2OGSN.js +0 -48
  443. package/dist/chunk-LBC2OGSN.js.map +0 -1
  444. package/dist/chunk-LPMHPAZK.js +0 -203
  445. package/dist/chunk-LPMHPAZK.js.map +0 -1
  446. package/dist/chunk-LSKT2AUS.mjs +0 -97
  447. package/dist/chunk-LSKT2AUS.mjs.map +0 -1
  448. package/dist/chunk-LVNNGMJ2.mjs +0 -13
  449. package/dist/chunk-LVNNGMJ2.mjs.map +0 -1
  450. package/dist/chunk-MF43OG3Z.mjs +0 -1
  451. package/dist/chunk-MF43OG3Z.mjs.map +0 -1
  452. package/dist/chunk-MPZOXW6I.mjs +0 -48
  453. package/dist/chunk-MPZOXW6I.mjs.map +0 -1
  454. package/dist/chunk-N6MAO223.js +0 -60
  455. package/dist/chunk-N6MAO223.js.map +0 -1
  456. package/dist/chunk-NTOY6Y4Q.mjs +0 -1
  457. package/dist/chunk-NTOY6Y4Q.mjs.map +0 -1
  458. package/dist/chunk-OHRFO2BL.mjs +0 -89
  459. package/dist/chunk-OHRFO2BL.mjs.map +0 -1
  460. package/dist/chunk-OO6IVUCV.js +0 -104
  461. package/dist/chunk-OO6IVUCV.js.map +0 -1
  462. package/dist/chunk-ORR7AE5X.mjs +0 -54
  463. package/dist/chunk-ORR7AE5X.mjs.map +0 -1
  464. package/dist/chunk-PDOVVC74.mjs +0 -153
  465. package/dist/chunk-PDOVVC74.mjs.map +0 -1
  466. package/dist/chunk-PHUTP7NB.js +0 -25
  467. package/dist/chunk-PHUTP7NB.js.map +0 -1
  468. package/dist/chunk-Q2OQXAUM.mjs +0 -35
  469. package/dist/chunk-Q2OQXAUM.mjs.map +0 -1
  470. package/dist/chunk-Q3I6P2ZF.mjs +0 -167
  471. package/dist/chunk-Q3I6P2ZF.mjs.map +0 -1
  472. package/dist/chunk-QRVFWATH.mjs +0 -14
  473. package/dist/chunk-QRVFWATH.mjs.map +0 -1
  474. package/dist/chunk-QYHQ2WWX.js +0 -89
  475. package/dist/chunk-QYHQ2WWX.js.map +0 -1
  476. package/dist/chunk-RJNNNCZJ.js +0 -39
  477. package/dist/chunk-RJNNNCZJ.js.map +0 -1
  478. package/dist/chunk-ROCGQYSK.mjs +0 -203
  479. package/dist/chunk-ROCGQYSK.mjs.map +0 -1
  480. package/dist/chunk-RQKT6BQ2.mjs +0 -1
  481. package/dist/chunk-RQKT6BQ2.mjs.map +0 -1
  482. package/dist/chunk-S2HLITUN.js +0 -1
  483. package/dist/chunk-S2HLITUN.js.map +0 -1
  484. package/dist/chunk-SB5EPHE3.js +0 -41
  485. package/dist/chunk-SB5EPHE3.js.map +0 -1
  486. package/dist/chunk-SLU4FNKX.mjs +0 -60
  487. package/dist/chunk-SLU4FNKX.mjs.map +0 -1
  488. package/dist/chunk-SNXRXX2O.js +0 -30
  489. package/dist/chunk-SNXRXX2O.js.map +0 -1
  490. package/dist/chunk-SW65QYFV.js +0 -50
  491. package/dist/chunk-SW65QYFV.js.map +0 -1
  492. package/dist/chunk-TGZ7WOTJ.mjs +0 -1
  493. package/dist/chunk-TGZ7WOTJ.mjs.map +0 -1
  494. package/dist/chunk-TZB4LBT7.js +0 -8
  495. package/dist/chunk-TZB4LBT7.js.map +0 -1
  496. package/dist/chunk-UDOXICJK.mjs +0 -1
  497. package/dist/chunk-UDOXICJK.mjs.map +0 -1
  498. package/dist/chunk-VHJZERIC.js +0 -1
  499. package/dist/chunk-VHJZERIC.js.map +0 -1
  500. package/dist/chunk-VOYBI6T4.mjs +0 -22
  501. package/dist/chunk-VOYBI6T4.mjs.map +0 -1
  502. package/dist/chunk-WDYPMEZB.js +0 -22
  503. package/dist/chunk-WDYPMEZB.js.map +0 -1
  504. package/dist/chunk-WHGYMK5B.js +0 -1
  505. package/dist/chunk-WHGYMK5B.js.map +0 -1
  506. package/dist/chunk-WZ57PU2K.js +0 -97
  507. package/dist/chunk-WZ57PU2K.js.map +0 -1
  508. package/dist/chunk-XAOCS6ZD.js +0 -69
  509. package/dist/chunk-XAOCS6ZD.js.map +0 -1
  510. package/dist/chunk-XK5HPZZC.mjs +0 -14
  511. package/dist/chunk-XK5HPZZC.mjs.map +0 -1
  512. package/dist/chunk-XP4YGQJA.js +0 -14
  513. package/dist/chunk-XP4YGQJA.js.map +0 -1
  514. package/dist/chunk-Y2U3ZPCK.js +0 -181
  515. package/dist/chunk-Y2U3ZPCK.js.map +0 -1
  516. package/dist/chunk-Y3JC4WGW.js +0 -35
  517. package/dist/chunk-Y3JC4WGW.js.map +0 -1
  518. package/dist/chunk-ZG33OGC3.mjs +0 -1
  519. package/dist/chunk-ZG33OGC3.mjs.map +0 -1
  520. package/dist/chunk-ZJQSGRNK.mjs +0 -34
  521. package/dist/chunk-ZJQSGRNK.mjs.map +0 -1
  522. package/dist/chunk-ZTX624YO.js +0 -1
  523. package/dist/chunk-ZTX624YO.js.map +0 -1
  524. package/dist/environment.js +0 -46
  525. package/dist/environment.js.map +0 -1
  526. package/dist/global.js +0 -2
  527. package/dist/global.js.map +0 -1
  528. package/dist/helpers.js +0 -57
  529. package/dist/helpers.js.map +0 -1
  530. package/dist/index.js +0 -68
  531. package/dist/index.js.map +0 -1
  532. package/dist/internals/environment.js +0 -8
  533. package/dist/internals/environment.js.map +0 -1
  534. package/dist/internals/index.js +0 -150
  535. package/dist/internals/index.js.map +0 -1
  536. package/dist/internals/logger.js +0 -8
  537. package/dist/internals/logger.js.map +0 -1
  538. package/dist/internals/request.js +0 -42
  539. package/dist/internals/request.js.map +0 -1
  540. package/dist/internals/server.js +0 -9
  541. package/dist/internals/server.js.map +0 -1
  542. package/dist/internals/simulation/constants.js +0 -14
  543. package/dist/internals/simulation/constants.js.map +0 -1
  544. package/dist/internals/simulation/controllers.js +0 -25
  545. package/dist/internals/simulation/controllers.js.map +0 -1
  546. package/dist/internals/simulation/files.js +0 -14
  547. package/dist/internals/simulation/files.js.map +0 -1
  548. package/dist/internals/simulation/index.js +0 -111
  549. package/dist/internals/simulation/index.js.map +0 -1
  550. package/dist/internals/simulation/interface.js +0 -37
  551. package/dist/internals/simulation/interface.js.map +0 -1
  552. package/dist/internals/simulation/methods/constants.js +0 -12
  553. package/dist/internals/simulation/methods/constants.js.map +0 -1
  554. package/dist/internals/simulation/methods/hooks/get-preferences.js +0 -8
  555. package/dist/internals/simulation/methods/hooks/get-preferences.js.map +0 -1
  556. package/dist/internals/simulation/methods/hooks/index.js +0 -39
  557. package/dist/internals/simulation/methods/hooks/index.js.map +0 -1
  558. package/dist/internals/simulation/methods/hooks/interface.js +0 -10
  559. package/dist/internals/simulation/methods/hooks/interface.js.map +0 -1
  560. package/dist/internals/simulation/methods/hooks/notifications.js +0 -16
  561. package/dist/internals/simulation/methods/hooks/notifications.js.map +0 -1
  562. package/dist/internals/simulation/methods/hooks/request-user-approval.js +0 -14
  563. package/dist/internals/simulation/methods/hooks/request-user-approval.js.map +0 -1
  564. package/dist/internals/simulation/methods/hooks/state.js +0 -18
  565. package/dist/internals/simulation/methods/hooks/state.js.map +0 -1
  566. package/dist/internals/simulation/methods/index.js +0 -28
  567. package/dist/internals/simulation/methods/index.js.map +0 -1
  568. package/dist/internals/simulation/methods/specifications.js +0 -27
  569. package/dist/internals/simulation/methods/specifications.js.map +0 -1
  570. package/dist/internals/simulation/middleware/engine.js +0 -15
  571. package/dist/internals/simulation/middleware/engine.js.map +0 -1
  572. package/dist/internals/simulation/middleware/index.js +0 -16
  573. package/dist/internals/simulation/middleware/index.js.map +0 -1
  574. package/dist/internals/simulation/middleware/internal-methods/accounts.js +0 -8
  575. package/dist/internals/simulation/middleware/internal-methods/accounts.js.map +0 -1
  576. package/dist/internals/simulation/middleware/internal-methods/index.js +0 -11
  577. package/dist/internals/simulation/middleware/internal-methods/index.js.map +0 -1
  578. package/dist/internals/simulation/middleware/internal-methods/middleware.js +0 -10
  579. package/dist/internals/simulation/middleware/internal-methods/middleware.js.map +0 -1
  580. package/dist/internals/simulation/middleware/internal-methods/provider-state.js +0 -8
  581. package/dist/internals/simulation/middleware/internal-methods/provider-state.js.map +0 -1
  582. package/dist/internals/simulation/middleware/mock.js +0 -9
  583. package/dist/internals/simulation/middleware/mock.js.map +0 -1
  584. package/dist/internals/simulation/options.js +0 -9
  585. package/dist/internals/simulation/options.js.map +0 -1
  586. package/dist/internals/simulation/simulation.js +0 -39
  587. package/dist/internals/simulation/simulation.js.map +0 -1
  588. package/dist/internals/simulation/store/index.js +0 -44
  589. package/dist/internals/simulation/store/index.js.map +0 -1
  590. package/dist/internals/simulation/store/mocks.js +0 -16
  591. package/dist/internals/simulation/store/mocks.js.map +0 -1
  592. package/dist/internals/simulation/store/notifications.js +0 -16
  593. package/dist/internals/simulation/store/notifications.js.map +0 -1
  594. package/dist/internals/simulation/store/state.js +0 -14
  595. package/dist/internals/simulation/store/state.js.map +0 -1
  596. package/dist/internals/simulation/store/store.js +0 -12
  597. package/dist/internals/simulation/store/store.js.map +0 -1
  598. package/dist/internals/simulation/store/ui.js +0 -16
  599. package/dist/internals/simulation/store/ui.js.map +0 -1
  600. package/dist/internals/structs.js +0 -22
  601. package/dist/internals/structs.js.map +0 -1
  602. package/dist/matchers.js +0 -49
  603. package/dist/matchers.js.map +0 -1
  604. package/dist/options.js +0 -8
  605. package/dist/options.js.map +0 -1
  606. package/dist/setup.js +0 -38
  607. package/dist/setup.js.map +0 -1
  608. package/dist/tsconfig.build.tsbuildinfo +0 -1
  609. package/dist/types/index.d.ts +0 -5
  610. package/dist/types/internals/index.d.ts +0 -6
  611. package/dist/types/internals/simulation/index.d.ts +0 -5
  612. package/dist/types/internals/simulation/methods/hooks/index.d.ts +0 -5
  613. package/dist/types/internals/simulation/methods/index.d.ts +0 -1
  614. package/dist/types/internals/simulation/middleware/index.d.ts +0 -1
  615. package/dist/types/internals/simulation/middleware/internal-methods/index.d.ts +0 -1
  616. package/dist/types/internals/simulation/store/index.d.ts +0 -4
  617. package/dist/types/setup.d.ts +0 -1
  618. package/dist/types/vendor/readable-stream.d.js +0 -1
  619. package/dist/types/vendor/readable-stream.d.js.map +0 -1
  620. package/dist/types/vendor/readable-stream.d.mjs +0 -1
  621. package/dist/types/vendor/readable-stream.d.mjs.map +0 -1
  622. package/dist/types.js +0 -2
  623. package/dist/types.js.map +0 -1
  624. package/dist/types.mjs +0 -2
  625. package/dist/types.mjs.map +0 -1
@@ -0,0 +1,20 @@
1
+ import type { JsonRpcEngineEndCallback, JsonRpcEngineNextCallback } from "@metamask/json-rpc-engine";
2
+ import type { Json, JsonRpcRequest, PendingJsonRpcResponse } from "@metamask/utils";
3
+ export type GetAccountsHandlerHooks = {
4
+ getMnemonic: () => Promise<Uint8Array>;
5
+ };
6
+ /**
7
+ * A mock handler for account related methods that always returns the first
8
+ * address for the selected secret recovery phrase.
9
+ *
10
+ * @param _request - Incoming JSON-RPC request. This is ignored for this
11
+ * specific handler.
12
+ * @param response - The outgoing JSON-RPC response, modified to return the
13
+ * result.
14
+ * @param _next - The `json-rpc-engine` middleware next handler.
15
+ * @param end - The `json-rpc-engine` middleware end handler.
16
+ * @param hooks - Any hooks required by this handler.
17
+ * @returns The JSON-RPC response.
18
+ */
19
+ export declare function getAccountsHandler(_request: JsonRpcRequest, response: PendingJsonRpcResponse<Json>, _next: JsonRpcEngineNextCallback, end: JsonRpcEngineEndCallback, hooks: GetAccountsHandlerHooks): Promise<void>;
20
+ //# sourceMappingURL=accounts.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accounts.d.mts","sourceRoot":"","sources":["../../../../../src/internals/simulation/middleware/internal-methods/accounts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,yBAAyB,EAC1B,kCAAkC;AAEnC,OAAO,KAAK,EACV,IAAI,EACJ,cAAc,EACd,sBAAsB,EACvB,wBAAwB;AAEzB,MAAM,MAAM,uBAAuB,GAAG;IACpC,WAAW,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC;CACxC,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,wBAAsB,kBAAkB,CACtC,QAAQ,EAAE,cAAc,EACxB,QAAQ,EAAE,sBAAsB,CAAC,IAAI,CAAC,EACtC,KAAK,EAAE,yBAAyB,EAChC,GAAG,EAAE,wBAAwB,EAC7B,KAAK,EAAE,uBAAuB,iBAiB/B"}
@@ -1,8 +1,30 @@
1
- import {
2
- getAccountsHandler
3
- } from "../../../../chunk-VOYBI6T4.mjs";
4
- import "../../../../chunk-JMDSN227.mjs";
5
- export {
6
- getAccountsHandler
7
- };
1
+ import { BIP44Node } from "@metamask/key-tree";
2
+ /**
3
+ * A mock handler for account related methods that always returns the first
4
+ * address for the selected secret recovery phrase.
5
+ *
6
+ * @param _request - Incoming JSON-RPC request. This is ignored for this
7
+ * specific handler.
8
+ * @param response - The outgoing JSON-RPC response, modified to return the
9
+ * result.
10
+ * @param _next - The `json-rpc-engine` middleware next handler.
11
+ * @param end - The `json-rpc-engine` middleware end handler.
12
+ * @param hooks - Any hooks required by this handler.
13
+ * @returns The JSON-RPC response.
14
+ */
15
+ export async function getAccountsHandler(_request, response, _next, end, hooks) {
16
+ const { getMnemonic } = hooks;
17
+ const node = await BIP44Node.fromDerivationPath({
18
+ derivationPath: [
19
+ await getMnemonic(),
20
+ `bip32:44'`,
21
+ `bip32:60'`,
22
+ `bip32:0'`,
23
+ `bip32:0`,
24
+ `bip32:0`,
25
+ ],
26
+ });
27
+ response.result = [node.address];
28
+ return end();
29
+ }
8
30
  //# sourceMappingURL=accounts.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"file":"accounts.mjs","sourceRoot":"","sources":["../../../../../src/internals/simulation/middleware/internal-methods/accounts.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,2BAA2B;AAW/C;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,QAAwB,EACxB,QAAsC,EACtC,KAAgC,EAChC,GAA6B,EAC7B,KAA8B;IAE9B,MAAM,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;IAE9B,MAAM,IAAI,GAAG,MAAM,SAAS,CAAC,kBAAkB,CAAC;QAC9C,cAAc,EAAE;YACd,MAAM,WAAW,EAAE;YACnB,WAAW;YACX,WAAW;YACX,UAAU;YACV,SAAS;YACT,SAAS;SACV;KACF,CAAC,CAAC;IAEH,QAAQ,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACjC,OAAO,GAAG,EAAE,CAAC;AACf,CAAC","sourcesContent":["import type {\n JsonRpcEngineEndCallback,\n JsonRpcEngineNextCallback,\n} from '@metamask/json-rpc-engine';\nimport { BIP44Node } from '@metamask/key-tree';\nimport type {\n Json,\n JsonRpcRequest,\n PendingJsonRpcResponse,\n} from '@metamask/utils';\n\nexport type GetAccountsHandlerHooks = {\n getMnemonic: () => Promise<Uint8Array>;\n};\n\n/**\n * A mock handler for account related methods that always returns the first\n * address for the selected secret recovery phrase.\n *\n * @param _request - Incoming JSON-RPC request. This is ignored for this\n * specific handler.\n * @param response - The outgoing JSON-RPC response, modified to return the\n * result.\n * @param _next - The `json-rpc-engine` middleware next handler.\n * @param end - The `json-rpc-engine` middleware end handler.\n * @param hooks - Any hooks required by this handler.\n * @returns The JSON-RPC response.\n */\nexport async function getAccountsHandler(\n _request: JsonRpcRequest,\n response: PendingJsonRpcResponse<Json>,\n _next: JsonRpcEngineNextCallback,\n end: JsonRpcEngineEndCallback,\n hooks: GetAccountsHandlerHooks,\n) {\n const { getMnemonic } = hooks;\n\n const node = await BIP44Node.fromDerivationPath({\n derivationPath: [\n await getMnemonic(),\n `bip32:44'`,\n `bip32:60'`,\n `bip32:0'`,\n `bip32:0`,\n `bip32:0`,\n ],\n });\n\n response.result = [node.address];\n return end();\n}\n"]}
@@ -0,0 +1,18 @@
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("./middleware.cjs"), exports);
18
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../../../src/internals/simulation/middleware/internal-methods/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAA6B","sourcesContent":["export * from './middleware';\n"]}
@@ -0,0 +1,2 @@
1
+ export * from "./middleware.cjs";
2
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../../../src/internals/simulation/middleware/internal-methods/index.ts"],"names":[],"mappings":"AAAA,iCAA6B"}
@@ -0,0 +1,2 @@
1
+ export * from "./middleware.mjs";
2
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../../../src/internals/simulation/middleware/internal-methods/index.ts"],"names":[],"mappings":"AAAA,iCAA6B"}
@@ -1,11 +1,2 @@
1
- import "../../../../chunk-6HHV6YFQ.mjs";
2
- import {
3
- createInternalMethodsMiddleware
4
- } from "../../../../chunk-Q2OQXAUM.mjs";
5
- import "../../../../chunk-VOYBI6T4.mjs";
6
- import "../../../../chunk-IXKO6X55.mjs";
7
- import "../../../../chunk-JMDSN227.mjs";
8
- export {
9
- createInternalMethodsMiddleware
10
- };
1
+ export * from "./middleware.mjs";
11
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../../../src/internals/simulation/middleware/internal-methods/index.ts"],"names":[],"mappings":"AAAA,iCAA6B","sourcesContent":["export * from './middleware';\n"]}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createInternalMethodsMiddleware = void 0;
4
+ const snaps_utils_1 = require("@metamask/snaps-utils");
5
+ const accounts_1 = require("./accounts.cjs");
6
+ const provider_state_1 = require("./provider-state.cjs");
7
+ const methodHandlers = {
8
+ /* eslint-disable @typescript-eslint/naming-convention */
9
+ metamask_getProviderState: provider_state_1.getProviderStateHandler,
10
+ eth_requestAccounts: accounts_1.getAccountsHandler,
11
+ eth_accounts: accounts_1.getAccountsHandler,
12
+ /* eslint-enable @typescript-eslint/naming-convention */
13
+ };
14
+ /**
15
+ * Create a middleware for handling JSON-RPC methods normally handled internally
16
+ * by the MetaMask client.
17
+ *
18
+ * NOTE: This middleware provides all `hooks` to all handlers and should
19
+ * therefore NOT be used outside of the simulation environment. It is intended
20
+ * for testing purposes only.
21
+ *
22
+ * @param hooks - Any hooks used by the middleware handlers.
23
+ * @returns A middleware function.
24
+ */
25
+ function createInternalMethodsMiddleware(hooks) {
26
+ // This should probably use createAsyncMiddleware.
27
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
28
+ return async function methodMiddleware(request, response, next, end) {
29
+ const handler = methodHandlers[request.method];
30
+ if (handler) {
31
+ try {
32
+ // Implementations may or may not be async, so we must await them.
33
+ return await handler(request, response, next, end, hooks);
34
+ }
35
+ catch (error) {
36
+ (0, snaps_utils_1.logError)(error);
37
+ return end(error);
38
+ }
39
+ }
40
+ return next();
41
+ };
42
+ }
43
+ exports.createInternalMethodsMiddleware = createInternalMethodsMiddleware;
44
+ //# sourceMappingURL=middleware.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"middleware.cjs","sourceRoot":"","sources":["../../../../../src/internals/simulation/middleware/internal-methods/middleware.ts"],"names":[],"mappings":";;;AACA,uDAAiD;AAGjD,6CAAgD;AAChD,yDAA2D;AAW3D,MAAM,cAAc,GAAG;IACrB,yDAAyD;IACzD,yBAAyB,EAAE,wCAAuB;IAClD,mBAAmB,EAAE,6BAAkB;IACvC,YAAY,EAAE,6BAAkB;IAChC,wDAAwD;CACzD,CAAC;AAEF;;;;;;;;;;GAUG;AACH,SAAgB,+BAA+B,CAC7C,KAAqC;IAErC,kDAAkD;IAClD,kEAAkE;IAClE,OAAO,KAAK,UAAU,gBAAgB,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG;QACjE,MAAM,OAAO,GACX,cAAc,CAAC,OAAO,CAAC,MAAqC,CAAC,CAAC;QAChE,IAAI,OAAO,EAAE,CAAC;YACZ,IAAI,CAAC;gBACH,kEAAkE;gBAClE,OAAO,MAAM,OAAO,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;YAC5D,CAAC;YAAC,OAAO,KAAU,EAAE,CAAC;gBACpB,IAAA,sBAAQ,EAAC,KAAK,CAAC,CAAC;gBAChB,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC;YACpB,CAAC;QACH,CAAC;QAED,OAAO,IAAI,EAAE,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC;AApBD,0EAoBC","sourcesContent":["import type { JsonRpcMiddleware } from '@metamask/json-rpc-engine';\nimport { logError } from '@metamask/snaps-utils';\nimport type { Json, JsonRpcParams } from '@metamask/utils';\n\nimport { getAccountsHandler } from './accounts';\nimport { getProviderStateHandler } from './provider-state';\n\nexport type InternalMethodsMiddlewareHooks = {\n /**\n * A hook that returns the user's secret recovery phrase.\n *\n * @returns The user's secret recovery phrase.\n */\n getMnemonic: () => Promise<Uint8Array>;\n};\n\nconst methodHandlers = {\n /* eslint-disable @typescript-eslint/naming-convention */\n metamask_getProviderState: getProviderStateHandler,\n eth_requestAccounts: getAccountsHandler,\n eth_accounts: getAccountsHandler,\n /* eslint-enable @typescript-eslint/naming-convention */\n};\n\n/**\n * Create a middleware for handling JSON-RPC methods normally handled internally\n * by the MetaMask client.\n *\n * NOTE: This middleware provides all `hooks` to all handlers and should\n * therefore NOT be used outside of the simulation environment. It is intended\n * for testing purposes only.\n *\n * @param hooks - Any hooks used by the middleware handlers.\n * @returns A middleware function.\n */\nexport function createInternalMethodsMiddleware(\n hooks: InternalMethodsMiddlewareHooks,\n): JsonRpcMiddleware<JsonRpcParams, Json> {\n // This should probably use createAsyncMiddleware.\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n return async function methodMiddleware(request, response, next, end) {\n const handler =\n methodHandlers[request.method as keyof typeof methodHandlers];\n if (handler) {\n try {\n // Implementations may or may not be async, so we must await them.\n return await handler(request, response, next, end, hooks);\n } catch (error: any) {\n logError(error);\n return end(error);\n }\n }\n\n return next();\n };\n}\n"]}
@@ -1,5 +1,5 @@
1
- import type { JsonRpcMiddleware } from '@metamask/json-rpc-engine';
2
- import type { Json, JsonRpcParams } from '@metamask/utils';
1
+ import type { JsonRpcMiddleware } from "@metamask/json-rpc-engine";
2
+ import type { Json, JsonRpcParams } from "@metamask/utils";
3
3
  export type InternalMethodsMiddlewareHooks = {
4
4
  /**
5
5
  * A hook that returns the user's secret recovery phrase.
@@ -20,3 +20,4 @@ export type InternalMethodsMiddlewareHooks = {
20
20
  * @returns A middleware function.
21
21
  */
22
22
  export declare function createInternalMethodsMiddleware(hooks: InternalMethodsMiddlewareHooks): JsonRpcMiddleware<JsonRpcParams, Json>;
23
+ //# sourceMappingURL=middleware.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"middleware.d.cts","sourceRoot":"","sources":["../../../../../src/internals/simulation/middleware/internal-methods/middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,kCAAkC;AAEnE,OAAO,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,wBAAwB;AAK3D,MAAM,MAAM,8BAA8B,GAAG;IAC3C;;;;OAIG;IACH,WAAW,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC;CACxC,CAAC;AAUF;;;;;;;;;;GAUG;AACH,wBAAgB,+BAA+B,CAC7C,KAAK,EAAE,8BAA8B,GACpC,iBAAiB,CAAC,aAAa,EAAE,IAAI,CAAC,CAkBxC"}
@@ -0,0 +1,23 @@
1
+ import type { JsonRpcMiddleware } from "@metamask/json-rpc-engine";
2
+ import type { Json, JsonRpcParams } from "@metamask/utils";
3
+ export type InternalMethodsMiddlewareHooks = {
4
+ /**
5
+ * A hook that returns the user's secret recovery phrase.
6
+ *
7
+ * @returns The user's secret recovery phrase.
8
+ */
9
+ getMnemonic: () => Promise<Uint8Array>;
10
+ };
11
+ /**
12
+ * Create a middleware for handling JSON-RPC methods normally handled internally
13
+ * by the MetaMask client.
14
+ *
15
+ * NOTE: This middleware provides all `hooks` to all handlers and should
16
+ * therefore NOT be used outside of the simulation environment. It is intended
17
+ * for testing purposes only.
18
+ *
19
+ * @param hooks - Any hooks used by the middleware handlers.
20
+ * @returns A middleware function.
21
+ */
22
+ export declare function createInternalMethodsMiddleware(hooks: InternalMethodsMiddlewareHooks): JsonRpcMiddleware<JsonRpcParams, Json>;
23
+ //# sourceMappingURL=middleware.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"middleware.d.mts","sourceRoot":"","sources":["../../../../../src/internals/simulation/middleware/internal-methods/middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,kCAAkC;AAEnE,OAAO,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,wBAAwB;AAK3D,MAAM,MAAM,8BAA8B,GAAG;IAC3C;;;;OAIG;IACH,WAAW,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC;CACxC,CAAC;AAUF;;;;;;;;;;GAUG;AACH,wBAAgB,+BAA+B,CAC7C,KAAK,EAAE,8BAA8B,GACpC,iBAAiB,CAAC,aAAa,EAAE,IAAI,CAAC,CAkBxC"}
@@ -1,10 +1,40 @@
1
- import {
2
- createInternalMethodsMiddleware
3
- } from "../../../../chunk-Q2OQXAUM.mjs";
4
- import "../../../../chunk-VOYBI6T4.mjs";
5
- import "../../../../chunk-IXKO6X55.mjs";
6
- import "../../../../chunk-JMDSN227.mjs";
7
- export {
8
- createInternalMethodsMiddleware
1
+ import { logError } from "@metamask/snaps-utils";
2
+ import { getAccountsHandler } from "./accounts.mjs";
3
+ import { getProviderStateHandler } from "./provider-state.mjs";
4
+ const methodHandlers = {
5
+ /* eslint-disable @typescript-eslint/naming-convention */
6
+ metamask_getProviderState: getProviderStateHandler,
7
+ eth_requestAccounts: getAccountsHandler,
8
+ eth_accounts: getAccountsHandler,
9
+ /* eslint-enable @typescript-eslint/naming-convention */
9
10
  };
11
+ /**
12
+ * Create a middleware for handling JSON-RPC methods normally handled internally
13
+ * by the MetaMask client.
14
+ *
15
+ * NOTE: This middleware provides all `hooks` to all handlers and should
16
+ * therefore NOT be used outside of the simulation environment. It is intended
17
+ * for testing purposes only.
18
+ *
19
+ * @param hooks - Any hooks used by the middleware handlers.
20
+ * @returns A middleware function.
21
+ */
22
+ export function createInternalMethodsMiddleware(hooks) {
23
+ // This should probably use createAsyncMiddleware.
24
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
25
+ return async function methodMiddleware(request, response, next, end) {
26
+ const handler = methodHandlers[request.method];
27
+ if (handler) {
28
+ try {
29
+ // Implementations may or may not be async, so we must await them.
30
+ return await handler(request, response, next, end, hooks);
31
+ }
32
+ catch (error) {
33
+ logError(error);
34
+ return end(error);
35
+ }
36
+ }
37
+ return next();
38
+ };
39
+ }
10
40
  //# sourceMappingURL=middleware.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"file":"middleware.mjs","sourceRoot":"","sources":["../../../../../src/internals/simulation/middleware/internal-methods/middleware.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,8BAA8B;AAGjD,OAAO,EAAE,kBAAkB,EAAE,uBAAmB;AAChD,OAAO,EAAE,uBAAuB,EAAE,6BAAyB;AAW3D,MAAM,cAAc,GAAG;IACrB,yDAAyD;IACzD,yBAAyB,EAAE,uBAAuB;IAClD,mBAAmB,EAAE,kBAAkB;IACvC,YAAY,EAAE,kBAAkB;IAChC,wDAAwD;CACzD,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,UAAU,+BAA+B,CAC7C,KAAqC;IAErC,kDAAkD;IAClD,kEAAkE;IAClE,OAAO,KAAK,UAAU,gBAAgB,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG;QACjE,MAAM,OAAO,GACX,cAAc,CAAC,OAAO,CAAC,MAAqC,CAAC,CAAC;QAChE,IAAI,OAAO,EAAE,CAAC;YACZ,IAAI,CAAC;gBACH,kEAAkE;gBAClE,OAAO,MAAM,OAAO,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;YAC5D,CAAC;YAAC,OAAO,KAAU,EAAE,CAAC;gBACpB,QAAQ,CAAC,KAAK,CAAC,CAAC;gBAChB,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC;YACpB,CAAC;QACH,CAAC;QAED,OAAO,IAAI,EAAE,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import type { JsonRpcMiddleware } from '@metamask/json-rpc-engine';\nimport { logError } from '@metamask/snaps-utils';\nimport type { Json, JsonRpcParams } from '@metamask/utils';\n\nimport { getAccountsHandler } from './accounts';\nimport { getProviderStateHandler } from './provider-state';\n\nexport type InternalMethodsMiddlewareHooks = {\n /**\n * A hook that returns the user's secret recovery phrase.\n *\n * @returns The user's secret recovery phrase.\n */\n getMnemonic: () => Promise<Uint8Array>;\n};\n\nconst methodHandlers = {\n /* eslint-disable @typescript-eslint/naming-convention */\n metamask_getProviderState: getProviderStateHandler,\n eth_requestAccounts: getAccountsHandler,\n eth_accounts: getAccountsHandler,\n /* eslint-enable @typescript-eslint/naming-convention */\n};\n\n/**\n * Create a middleware for handling JSON-RPC methods normally handled internally\n * by the MetaMask client.\n *\n * NOTE: This middleware provides all `hooks` to all handlers and should\n * therefore NOT be used outside of the simulation environment. It is intended\n * for testing purposes only.\n *\n * @param hooks - Any hooks used by the middleware handlers.\n * @returns A middleware function.\n */\nexport function createInternalMethodsMiddleware(\n hooks: InternalMethodsMiddlewareHooks,\n): JsonRpcMiddleware<JsonRpcParams, Json> {\n // This should probably use createAsyncMiddleware.\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n return async function methodMiddleware(request, response, next, end) {\n const handler =\n methodHandlers[request.method as keyof typeof methodHandlers];\n if (handler) {\n try {\n // Implementations may or may not be async, so we must await them.\n return await handler(request, response, next, end, hooks);\n } catch (error: any) {\n logError(error);\n return end(error);\n }\n }\n\n return next();\n };\n}\n"]}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getProviderStateHandler = void 0;
4
+ /**
5
+ * A mock handler for metamask_getProviderState that always returns a specific
6
+ * hardcoded result.
7
+ *
8
+ * @param _request - Incoming JSON-RPC request. Ignored for this specific
9
+ * handler.
10
+ * @param response - The outgoing JSON-RPC response, modified to return the
11
+ * result.
12
+ * @param _next - The `json-rpc-engine` middleware next handler.
13
+ * @param end - The `json-rpc-engine` middleware end handler.
14
+ * @returns The JSON-RPC response.
15
+ */
16
+ async function getProviderStateHandler(_request, response, _next, end) {
17
+ // For now this will return a mocked result, this should probably match
18
+ // whatever network the simulation is using.
19
+ response.result = {
20
+ isUnlocked: true,
21
+ chainId: '0x01',
22
+ networkVersion: '0x01',
23
+ accounts: [],
24
+ };
25
+ return end();
26
+ }
27
+ exports.getProviderStateHandler = getProviderStateHandler;
28
+ //# sourceMappingURL=provider-state.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider-state.cjs","sourceRoot":"","sources":["../../../../../src/internals/simulation/middleware/internal-methods/provider-state.ts"],"names":[],"mappings":";;;AAUA;;;;;;;;;;;GAWG;AACI,KAAK,UAAU,uBAAuB,CAC3C,QAAwB,EACxB,QAAsC,EACtC,KAAgC,EAChC,GAA6B;IAE7B,uEAAuE;IACvE,4CAA4C;IAC5C,QAAQ,CAAC,MAAM,GAAG;QAChB,UAAU,EAAE,IAAI;QAChB,OAAO,EAAE,MAAM;QACf,cAAc,EAAE,MAAM;QACtB,QAAQ,EAAE,EAAE;KACb,CAAC;IAEF,OAAO,GAAG,EAAE,CAAC;AACf,CAAC;AAhBD,0DAgBC","sourcesContent":["import type {\n JsonRpcEngineEndCallback,\n JsonRpcEngineNextCallback,\n} from '@metamask/json-rpc-engine';\nimport type {\n Json,\n JsonRpcRequest,\n PendingJsonRpcResponse,\n} from '@metamask/utils';\n\n/**\n * A mock handler for metamask_getProviderState that always returns a specific\n * hardcoded result.\n *\n * @param _request - Incoming JSON-RPC request. Ignored for this specific\n * handler.\n * @param response - The outgoing JSON-RPC response, modified to return the\n * result.\n * @param _next - The `json-rpc-engine` middleware next handler.\n * @param end - The `json-rpc-engine` middleware end handler.\n * @returns The JSON-RPC response.\n */\nexport async function getProviderStateHandler(\n _request: JsonRpcRequest,\n response: PendingJsonRpcResponse<Json>,\n _next: JsonRpcEngineNextCallback,\n end: JsonRpcEngineEndCallback,\n) {\n // For now this will return a mocked result, this should probably match\n // whatever network the simulation is using.\n response.result = {\n isUnlocked: true,\n chainId: '0x01',\n networkVersion: '0x01',\n accounts: [],\n };\n\n return end();\n}\n"]}
@@ -1,5 +1,5 @@
1
- import type { JsonRpcEngineEndCallback, JsonRpcEngineNextCallback } from '@metamask/json-rpc-engine';
2
- import type { Json, JsonRpcRequest, PendingJsonRpcResponse } from '@metamask/utils';
1
+ import type { JsonRpcEngineEndCallback, JsonRpcEngineNextCallback } from "@metamask/json-rpc-engine";
2
+ import type { Json, JsonRpcRequest, PendingJsonRpcResponse } from "@metamask/utils";
3
3
  /**
4
4
  * A mock handler for metamask_getProviderState that always returns a specific
5
5
  * hardcoded result.
@@ -10,5 +10,7 @@ import type { Json, JsonRpcRequest, PendingJsonRpcResponse } from '@metamask/uti
10
10
  * result.
11
11
  * @param _next - The `json-rpc-engine` middleware next handler.
12
12
  * @param end - The `json-rpc-engine` middleware end handler.
13
+ * @returns The JSON-RPC response.
13
14
  */
14
15
  export declare function getProviderStateHandler(_request: JsonRpcRequest, response: PendingJsonRpcResponse<Json>, _next: JsonRpcEngineNextCallback, end: JsonRpcEngineEndCallback): Promise<void>;
16
+ //# sourceMappingURL=provider-state.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider-state.d.cts","sourceRoot":"","sources":["../../../../../src/internals/simulation/middleware/internal-methods/provider-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,yBAAyB,EAC1B,kCAAkC;AACnC,OAAO,KAAK,EACV,IAAI,EACJ,cAAc,EACd,sBAAsB,EACvB,wBAAwB;AAEzB;;;;;;;;;;;GAWG;AACH,wBAAsB,uBAAuB,CAC3C,QAAQ,EAAE,cAAc,EACxB,QAAQ,EAAE,sBAAsB,CAAC,IAAI,CAAC,EACtC,KAAK,EAAE,yBAAyB,EAChC,GAAG,EAAE,wBAAwB,iBAY9B"}
@@ -0,0 +1,16 @@
1
+ import type { JsonRpcEngineEndCallback, JsonRpcEngineNextCallback } from "@metamask/json-rpc-engine";
2
+ import type { Json, JsonRpcRequest, PendingJsonRpcResponse } from "@metamask/utils";
3
+ /**
4
+ * A mock handler for metamask_getProviderState that always returns a specific
5
+ * hardcoded result.
6
+ *
7
+ * @param _request - Incoming JSON-RPC request. Ignored for this specific
8
+ * handler.
9
+ * @param response - The outgoing JSON-RPC response, modified to return the
10
+ * result.
11
+ * @param _next - The `json-rpc-engine` middleware next handler.
12
+ * @param end - The `json-rpc-engine` middleware end handler.
13
+ * @returns The JSON-RPC response.
14
+ */
15
+ export declare function getProviderStateHandler(_request: JsonRpcRequest, response: PendingJsonRpcResponse<Json>, _next: JsonRpcEngineNextCallback, end: JsonRpcEngineEndCallback): Promise<void>;
16
+ //# sourceMappingURL=provider-state.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider-state.d.mts","sourceRoot":"","sources":["../../../../../src/internals/simulation/middleware/internal-methods/provider-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,yBAAyB,EAC1B,kCAAkC;AACnC,OAAO,KAAK,EACV,IAAI,EACJ,cAAc,EACd,sBAAsB,EACvB,wBAAwB;AAEzB;;;;;;;;;;;GAWG;AACH,wBAAsB,uBAAuB,CAC3C,QAAQ,EAAE,cAAc,EACxB,QAAQ,EAAE,sBAAsB,CAAC,IAAI,CAAC,EACtC,KAAK,EAAE,yBAAyB,EAChC,GAAG,EAAE,wBAAwB,iBAY9B"}
@@ -1,8 +1,24 @@
1
- import {
2
- getProviderStateHandler
3
- } from "../../../../chunk-IXKO6X55.mjs";
4
- import "../../../../chunk-JMDSN227.mjs";
5
- export {
6
- getProviderStateHandler
7
- };
1
+ /**
2
+ * A mock handler for metamask_getProviderState that always returns a specific
3
+ * hardcoded result.
4
+ *
5
+ * @param _request - Incoming JSON-RPC request. Ignored for this specific
6
+ * handler.
7
+ * @param response - The outgoing JSON-RPC response, modified to return the
8
+ * result.
9
+ * @param _next - The `json-rpc-engine` middleware next handler.
10
+ * @param end - The `json-rpc-engine` middleware end handler.
11
+ * @returns The JSON-RPC response.
12
+ */
13
+ export async function getProviderStateHandler(_request, response, _next, end) {
14
+ // For now this will return a mocked result, this should probably match
15
+ // whatever network the simulation is using.
16
+ response.result = {
17
+ isUnlocked: true,
18
+ chainId: '0x01',
19
+ networkVersion: '0x01',
20
+ accounts: [],
21
+ };
22
+ return end();
23
+ }
8
24
  //# sourceMappingURL=provider-state.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"file":"provider-state.mjs","sourceRoot":"","sources":["../../../../../src/internals/simulation/middleware/internal-methods/provider-state.ts"],"names":[],"mappings":"AAUA;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,QAAwB,EACxB,QAAsC,EACtC,KAAgC,EAChC,GAA6B;IAE7B,uEAAuE;IACvE,4CAA4C;IAC5C,QAAQ,CAAC,MAAM,GAAG;QAChB,UAAU,EAAE,IAAI;QAChB,OAAO,EAAE,MAAM;QACf,cAAc,EAAE,MAAM;QACtB,QAAQ,EAAE,EAAE;KACb,CAAC;IAEF,OAAO,GAAG,EAAE,CAAC;AACf,CAAC","sourcesContent":["import type {\n JsonRpcEngineEndCallback,\n JsonRpcEngineNextCallback,\n} from '@metamask/json-rpc-engine';\nimport type {\n Json,\n JsonRpcRequest,\n PendingJsonRpcResponse,\n} from '@metamask/utils';\n\n/**\n * A mock handler for metamask_getProviderState that always returns a specific\n * hardcoded result.\n *\n * @param _request - Incoming JSON-RPC request. Ignored for this specific\n * handler.\n * @param response - The outgoing JSON-RPC response, modified to return the\n * result.\n * @param _next - The `json-rpc-engine` middleware next handler.\n * @param end - The `json-rpc-engine` middleware end handler.\n * @returns The JSON-RPC response.\n */\nexport async function getProviderStateHandler(\n _request: JsonRpcRequest,\n response: PendingJsonRpcResponse<Json>,\n _next: JsonRpcEngineNextCallback,\n end: JsonRpcEngineEndCallback,\n) {\n // For now this will return a mocked result, this should probably match\n // whatever network the simulation is using.\n response.result = {\n isUnlocked: true,\n chainId: '0x01',\n networkVersion: '0x01',\n accounts: [],\n };\n\n return end();\n}\n"]}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createMockMiddleware = void 0;
4
+ const mocks_1 = require("../store/mocks.cjs");
5
+ /**
6
+ * Create a middleware for handling JSON-RPC methods that have been mocked.
7
+ *
8
+ * @param store - The Redux store to use.
9
+ * @returns A middleware function.
10
+ */
11
+ function createMockMiddleware(store) {
12
+ return function mockMiddleware(request, response, next, end) {
13
+ const result = (0, mocks_1.getJsonRpcMock)(store.getState(), request.method);
14
+ if (result) {
15
+ response.result = result;
16
+ return end();
17
+ }
18
+ return next();
19
+ };
20
+ }
21
+ exports.createMockMiddleware = createMockMiddleware;
22
+ //# sourceMappingURL=mock.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mock.cjs","sourceRoot":"","sources":["../../../../src/internals/simulation/middleware/mock.ts"],"names":[],"mappings":";;;AAIA,8CAAgD;AAEhD;;;;;GAKG;AACH,SAAgB,oBAAoB,CAClC,KAAY;IAEZ,OAAO,SAAS,cAAc,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG;QACzD,MAAM,MAAM,GAAG,IAAA,sBAAc,EAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QAChE,IAAI,MAAM,EAAE,CAAC;YACX,QAAQ,CAAC,MAAM,GAAG,MAAM,CAAC;YACzB,OAAO,GAAG,EAAE,CAAC;QACf,CAAC;QAED,OAAO,IAAI,EAAE,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC;AAZD,oDAYC","sourcesContent":["import type { JsonRpcMiddleware } from '@metamask/json-rpc-engine';\nimport type { Json, JsonRpcParams } from '@metamask/utils';\n\nimport type { Store } from '../store';\nimport { getJsonRpcMock } from '../store/mocks';\n\n/**\n * Create a middleware for handling JSON-RPC methods that have been mocked.\n *\n * @param store - The Redux store to use.\n * @returns A middleware function.\n */\nexport function createMockMiddleware(\n store: Store,\n): JsonRpcMiddleware<JsonRpcParams, Json> {\n return function mockMiddleware(request, response, next, end) {\n const result = getJsonRpcMock(store.getState(), request.method);\n if (result) {\n response.result = result;\n return end();\n }\n\n return next();\n };\n}\n"]}
@@ -1,6 +1,6 @@
1
- import type { JsonRpcMiddleware } from '@metamask/json-rpc-engine';
2
- import type { Json, JsonRpcParams } from '@metamask/utils';
3
- import type { Store } from '../store';
1
+ import type { JsonRpcMiddleware } from "@metamask/json-rpc-engine";
2
+ import type { Json, JsonRpcParams } from "@metamask/utils";
3
+ import type { Store } from "../store/index.cjs";
4
4
  /**
5
5
  * Create a middleware for handling JSON-RPC methods that have been mocked.
6
6
  *
@@ -8,3 +8,4 @@ import type { Store } from '../store';
8
8
  * @returns A middleware function.
9
9
  */
10
10
  export declare function createMockMiddleware(store: Store): JsonRpcMiddleware<JsonRpcParams, Json>;
11
+ //# sourceMappingURL=mock.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mock.d.cts","sourceRoot":"","sources":["../../../../src/internals/simulation/middleware/mock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,kCAAkC;AACnE,OAAO,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,wBAAwB;AAE3D,OAAO,KAAK,EAAE,KAAK,EAAE,2BAAiB;AAGtC;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,KAAK,GACX,iBAAiB,CAAC,aAAa,EAAE,IAAI,CAAC,CAUxC"}
@@ -0,0 +1,11 @@
1
+ import type { JsonRpcMiddleware } from "@metamask/json-rpc-engine";
2
+ import type { Json, JsonRpcParams } from "@metamask/utils";
3
+ import type { Store } from "../store/index.mjs";
4
+ /**
5
+ * Create a middleware for handling JSON-RPC methods that have been mocked.
6
+ *
7
+ * @param store - The Redux store to use.
8
+ * @returns A middleware function.
9
+ */
10
+ export declare function createMockMiddleware(store: Store): JsonRpcMiddleware<JsonRpcParams, Json>;
11
+ //# sourceMappingURL=mock.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mock.d.mts","sourceRoot":"","sources":["../../../../src/internals/simulation/middleware/mock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,kCAAkC;AACnE,OAAO,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,wBAAwB;AAE3D,OAAO,KAAK,EAAE,KAAK,EAAE,2BAAiB;AAGtC;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,KAAK,GACX,iBAAiB,CAAC,aAAa,EAAE,IAAI,CAAC,CAUxC"}
@@ -1,9 +1,18 @@
1
- import {
2
- createMockMiddleware
3
- } from "../../../chunk-FP4H3ADT.mjs";
4
- import "../../../chunk-H2464AXT.mjs";
5
- import "../../../chunk-JMDSN227.mjs";
6
- export {
7
- createMockMiddleware
8
- };
1
+ import { getJsonRpcMock } from "../store/mocks.mjs";
2
+ /**
3
+ * Create a middleware for handling JSON-RPC methods that have been mocked.
4
+ *
5
+ * @param store - The Redux store to use.
6
+ * @returns A middleware function.
7
+ */
8
+ export function createMockMiddleware(store) {
9
+ return function mockMiddleware(request, response, next, end) {
10
+ const result = getJsonRpcMock(store.getState(), request.method);
11
+ if (result) {
12
+ response.result = result;
13
+ return end();
14
+ }
15
+ return next();
16
+ };
17
+ }
9
18
  //# sourceMappingURL=mock.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"file":"mock.mjs","sourceRoot":"","sources":["../../../../src/internals/simulation/middleware/mock.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,2BAAuB;AAEhD;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAClC,KAAY;IAEZ,OAAO,SAAS,cAAc,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG;QACzD,MAAM,MAAM,GAAG,cAAc,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QAChE,IAAI,MAAM,EAAE,CAAC;YACX,QAAQ,CAAC,MAAM,GAAG,MAAM,CAAC;YACzB,OAAO,GAAG,EAAE,CAAC;QACf,CAAC;QAED,OAAO,IAAI,EAAE,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import type { JsonRpcMiddleware } from '@metamask/json-rpc-engine';\nimport type { Json, JsonRpcParams } from '@metamask/utils';\n\nimport type { Store } from '../store';\nimport { getJsonRpcMock } from '../store/mocks';\n\n/**\n * Create a middleware for handling JSON-RPC methods that have been mocked.\n *\n * @param store - The Redux store to use.\n * @returns A middleware function.\n */\nexport function createMockMiddleware(\n store: Store,\n): JsonRpcMiddleware<JsonRpcParams, Json> {\n return function mockMiddleware(request, response, next, end) {\n const result = getJsonRpcMock(store.getState(), request.method);\n if (result) {\n response.result = result;\n return end();\n }\n\n return next();\n };\n}\n"]}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getOptions = void 0;
4
+ const superstruct_1 = require("@metamask/superstruct");
5
+ const utils_1 = require("@metamask/utils");
6
+ const constants_1 = require("./constants.cjs");
7
+ const SimulationOptionsStruct = (0, superstruct_1.object)({
8
+ currency: (0, superstruct_1.defaulted)((0, superstruct_1.optional)((0, superstruct_1.string)()), constants_1.DEFAULT_CURRENCY),
9
+ secretRecoveryPhrase: (0, superstruct_1.defaulted)((0, superstruct_1.optional)((0, superstruct_1.string)()), constants_1.DEFAULT_SRP),
10
+ locale: (0, superstruct_1.defaulted)((0, superstruct_1.optional)((0, superstruct_1.string)()), constants_1.DEFAULT_LOCALE),
11
+ state: (0, superstruct_1.defaulted)((0, superstruct_1.optional)((0, superstruct_1.nullable)((0, superstruct_1.record)((0, superstruct_1.string)(), utils_1.JsonStruct))), null),
12
+ unencryptedState: (0, superstruct_1.defaulted)((0, superstruct_1.optional)((0, superstruct_1.nullable)((0, superstruct_1.record)((0, superstruct_1.string)(), utils_1.JsonStruct))), null),
13
+ });
14
+ /**
15
+ * Get the options for the simulation.
16
+ *
17
+ * @param options - The user options. Any options not specified will be filled
18
+ * in with default values.
19
+ * @returns The simulation options.
20
+ */
21
+ function getOptions(options) {
22
+ return (0, superstruct_1.create)(options, SimulationOptionsStruct);
23
+ }
24
+ exports.getOptions = getOptions;
25
+ //# sourceMappingURL=options.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.cjs","sourceRoot":"","sources":["../../../src/internals/simulation/options.ts"],"names":[],"mappings":";;;AACA,uDAQ+B;AAC/B,2CAA6C;AAE7C,+CAA4E;AAE5E,MAAM,uBAAuB,GAAG,IAAA,oBAAM,EAAC;IACrC,QAAQ,EAAE,IAAA,uBAAS,EAAC,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC,EAAE,4BAAgB,CAAC;IACzD,oBAAoB,EAAE,IAAA,uBAAS,EAAC,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC,EAAE,uBAAW,CAAC;IAChE,MAAM,EAAE,IAAA,uBAAS,EAAC,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC,EAAE,0BAAc,CAAC;IACrD,KAAK,EAAE,IAAA,uBAAS,EAAC,IAAA,sBAAQ,EAAC,IAAA,sBAAQ,EAAC,IAAA,oBAAM,EAAC,IAAA,oBAAM,GAAE,EAAE,kBAAU,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC;IACxE,gBAAgB,EAAE,IAAA,uBAAS,EACzB,IAAA,sBAAQ,EAAC,IAAA,sBAAQ,EAAC,IAAA,oBAAM,EAAC,IAAA,oBAAM,GAAE,EAAE,kBAAU,CAAC,CAAC,CAAC,EAChD,IAAI,CACL;CACF,CAAC,CAAC;AAoBH;;;;;;GAMG;AACH,SAAgB,UAAU,CAAC,OAA8B;IACvD,OAAO,IAAA,oBAAM,EACX,OAAO,EACP,uBAAuB,CACW,CAAC;AACvC,CAAC;AALD,gCAKC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport {\n create,\n defaulted,\n nullable,\n object,\n optional,\n record,\n string,\n} from '@metamask/superstruct';\nimport { JsonStruct } from '@metamask/utils';\n\nimport { DEFAULT_CURRENCY, DEFAULT_LOCALE, DEFAULT_SRP } from './constants';\n\nconst SimulationOptionsStruct = object({\n currency: defaulted(optional(string()), DEFAULT_CURRENCY),\n secretRecoveryPhrase: defaulted(optional(string()), DEFAULT_SRP),\n locale: defaulted(optional(string()), DEFAULT_LOCALE),\n state: defaulted(optional(nullable(record(string(), JsonStruct))), null),\n unencryptedState: defaulted(\n optional(nullable(record(string(), JsonStruct))),\n null,\n ),\n});\n\n/**\n * Options for the simulation.\n *\n * @property secretRecoveryPhrase - The secret recovery phrase to use. This is\n * used to derive addresses and private keys. Defaults to a test recovery\n * phrase.\n * @property locale - The locale to use. Defaults to `en`.\n * @property state - The initial state of the Snap, if any. Defaults to `null`.\n */\nexport type SimulationUserOptions = Infer<typeof SimulationOptionsStruct>;\n\n/**\n * Options for the simulation, with defaults filled in.\n *\n * See {@link SimulationUserOptions} for documentation.\n */\nexport type SimulationOptions = Required<SimulationUserOptions>;\n\n/**\n * Get the options for the simulation.\n *\n * @param options - The user options. Any options not specified will be filled\n * in with default values.\n * @returns The simulation options.\n */\nexport function getOptions(options: SimulationUserOptions): SimulationOptions {\n return create(\n options,\n SimulationOptionsStruct,\n ) as Required<SimulationUserOptions>;\n}\n"]}
@@ -1,9 +1,9 @@
1
- import type { Infer } from '@metamask/superstruct';
1
+ import type { Infer } from "@metamask/superstruct";
2
2
  declare const SimulationOptionsStruct: import("@metamask/superstruct").Struct<{
3
3
  state?: Record<string, import("@metamask/utils").Json> | null | undefined;
4
+ currency?: string | undefined;
4
5
  locale?: string | undefined;
5
6
  secretRecoveryPhrase?: string | undefined;
6
- currency?: string | undefined;
7
7
  unencryptedState?: Record<string, import("@metamask/utils").Json> | null | undefined;
8
8
  }, {
9
9
  currency: import("@metamask/superstruct").Struct<string | undefined, null>;
@@ -37,3 +37,4 @@ export type SimulationOptions = Required<SimulationUserOptions>;
37
37
  */
38
38
  export declare function getOptions(options: SimulationUserOptions): SimulationOptions;
39
39
  export {};
40
+ //# sourceMappingURL=options.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.d.cts","sourceRoot":"","sources":["../../../src/internals/simulation/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAcnD,QAAA,MAAM,uBAAuB;;;;;;;;;;;;EAS3B,CAAC;AAEH;;;;;;;;GAQG;AACH,MAAM,MAAM,qBAAqB,GAAG,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE1E;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC,qBAAqB,CAAC,CAAC;AAEhE;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,qBAAqB,GAAG,iBAAiB,CAK5E"}
@@ -0,0 +1,40 @@
1
+ import type { Infer } from "@metamask/superstruct";
2
+ declare const SimulationOptionsStruct: import("@metamask/superstruct").Struct<{
3
+ state?: Record<string, import("@metamask/utils").Json> | null | undefined;
4
+ currency?: string | undefined;
5
+ locale?: string | undefined;
6
+ secretRecoveryPhrase?: string | undefined;
7
+ unencryptedState?: Record<string, import("@metamask/utils").Json> | null | undefined;
8
+ }, {
9
+ currency: import("@metamask/superstruct").Struct<string | undefined, null>;
10
+ secretRecoveryPhrase: import("@metamask/superstruct").Struct<string | undefined, null>;
11
+ locale: import("@metamask/superstruct").Struct<string | undefined, null>;
12
+ state: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json> | null | undefined, null>;
13
+ unencryptedState: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json> | null | undefined, null>;
14
+ }>;
15
+ /**
16
+ * Options for the simulation.
17
+ *
18
+ * @property secretRecoveryPhrase - The secret recovery phrase to use. This is
19
+ * used to derive addresses and private keys. Defaults to a test recovery
20
+ * phrase.
21
+ * @property locale - The locale to use. Defaults to `en`.
22
+ * @property state - The initial state of the Snap, if any. Defaults to `null`.
23
+ */
24
+ export type SimulationUserOptions = Infer<typeof SimulationOptionsStruct>;
25
+ /**
26
+ * Options for the simulation, with defaults filled in.
27
+ *
28
+ * See {@link SimulationUserOptions} for documentation.
29
+ */
30
+ export type SimulationOptions = Required<SimulationUserOptions>;
31
+ /**
32
+ * Get the options for the simulation.
33
+ *
34
+ * @param options - The user options. Any options not specified will be filled
35
+ * in with default values.
36
+ * @returns The simulation options.
37
+ */
38
+ export declare function getOptions(options: SimulationUserOptions): SimulationOptions;
39
+ export {};
40
+ //# sourceMappingURL=options.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.d.mts","sourceRoot":"","sources":["../../../src/internals/simulation/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAcnD,QAAA,MAAM,uBAAuB;;;;;;;;;;;;EAS3B,CAAC;AAEH;;;;;;;;GAQG;AACH,MAAM,MAAM,qBAAqB,GAAG,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE1E;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC,qBAAqB,CAAC,CAAC;AAEhE;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,qBAAqB,GAAG,iBAAiB,CAK5E"}