@metamask/snaps-rpc-methods 11.0.0 → 11.1.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 (704) hide show
  1. package/CHANGELOG.md +14 -1
  2. package/dist/__fixtures__/entropy.cjs +31 -0
  3. package/dist/__fixtures__/entropy.cjs.map +1 -0
  4. package/dist/{types/__fixtures__/entropy.d.ts → __fixtures__/entropy.d.cts} +1 -0
  5. package/dist/__fixtures__/entropy.d.cts.map +1 -0
  6. package/dist/__fixtures__/entropy.d.mts +15 -0
  7. package/dist/__fixtures__/entropy.d.mts.map +1 -0
  8. package/dist/__fixtures__/entropy.mjs +28 -0
  9. package/dist/__fixtures__/entropy.mjs.map +1 -0
  10. package/dist/__fixtures__/index.cjs +18 -0
  11. package/dist/__fixtures__/index.cjs.map +1 -0
  12. package/dist/__fixtures__/index.d.cts +2 -0
  13. package/dist/__fixtures__/index.d.cts.map +1 -0
  14. package/dist/__fixtures__/index.d.mts +2 -0
  15. package/dist/__fixtures__/index.d.mts.map +1 -0
  16. package/dist/__fixtures__/index.mjs +2 -0
  17. package/dist/__fixtures__/index.mjs.map +1 -0
  18. package/dist/endowments/caveats/generic.cjs +50 -0
  19. package/dist/endowments/caveats/generic.cjs.map +1 -0
  20. package/dist/{types/endowments/caveats/generic.d.ts → endowments/caveats/generic.d.cts} +3 -2
  21. package/dist/endowments/caveats/generic.d.cts.map +1 -0
  22. package/dist/endowments/caveats/generic.d.mts +20 -0
  23. package/dist/endowments/caveats/generic.d.mts.map +1 -0
  24. package/dist/endowments/caveats/generic.mjs +45 -6
  25. package/dist/endowments/caveats/generic.mjs.map +1 -1
  26. package/dist/endowments/caveats/index.cjs +19 -0
  27. package/dist/endowments/caveats/index.cjs.map +1 -0
  28. package/dist/endowments/caveats/index.d.cts +3 -0
  29. package/dist/endowments/caveats/index.d.cts.map +1 -0
  30. package/dist/endowments/caveats/index.d.mts +3 -0
  31. package/dist/endowments/caveats/index.d.mts.map +1 -0
  32. package/dist/endowments/caveats/index.mjs +2 -17
  33. package/dist/endowments/caveats/index.mjs.map +1 -1
  34. package/dist/endowments/caveats/requestTime.cjs +104 -0
  35. package/dist/{chunk-FCVWU5XH.js.map → endowments/caveats/requestTime.cjs.map} +1 -1
  36. package/dist/{types/endowments/caveats/requestTime.d.ts → endowments/caveats/requestTime.d.cts} +5 -4
  37. package/dist/endowments/caveats/requestTime.d.cts.map +1 -0
  38. package/dist/endowments/caveats/requestTime.d.mts +30 -0
  39. package/dist/endowments/caveats/requestTime.d.mts.map +1 -0
  40. package/dist/endowments/caveats/requestTime.mjs +96 -11
  41. package/dist/endowments/caveats/requestTime.mjs.map +1 -1
  42. package/dist/endowments/cronjob.cjs +105 -0
  43. package/dist/endowments/cronjob.cjs.map +1 -0
  44. package/dist/{types/endowments/cronjob.d.ts → endowments/cronjob.d.cts} +7 -6
  45. package/dist/endowments/cronjob.d.cts.map +1 -0
  46. package/dist/endowments/cronjob.d.mts +52 -0
  47. package/dist/endowments/cronjob.d.mts.map +1 -0
  48. package/dist/endowments/cronjob.mjs +97 -14
  49. package/dist/endowments/cronjob.mjs.map +1 -1
  50. package/dist/endowments/enum.cjs +18 -0
  51. package/dist/endowments/enum.cjs.map +1 -0
  52. package/dist/{types/endowments/enum.d.ts → endowments/enum.d.cts} +1 -0
  53. package/dist/endowments/enum.d.cts.map +1 -0
  54. package/dist/endowments/enum.d.mts +14 -0
  55. package/dist/endowments/enum.d.mts.map +1 -0
  56. package/dist/endowments/enum.mjs +14 -6
  57. package/dist/endowments/enum.mjs.map +1 -1
  58. package/dist/endowments/ethereum-provider.cjs +32 -0
  59. package/dist/endowments/ethereum-provider.cjs.map +1 -0
  60. package/dist/{types/endowments/ethereum-provider.d.ts → endowments/ethereum-provider.d.cts} +4 -3
  61. package/dist/endowments/ethereum-provider.d.cts.map +1 -0
  62. package/dist/endowments/ethereum-provider.d.mts +15 -0
  63. package/dist/endowments/ethereum-provider.d.mts.map +1 -0
  64. package/dist/endowments/ethereum-provider.mjs +27 -6
  65. package/dist/endowments/ethereum-provider.mjs.map +1 -1
  66. package/dist/endowments/home-page.cjs +28 -0
  67. package/dist/{chunk-2SFH57UV.js.map → endowments/home-page.cjs.map} +1 -1
  68. package/dist/{types/endowments/home-page.d.ts → endowments/home-page.d.cts} +5 -4
  69. package/dist/endowments/home-page.d.cts.map +1 -0
  70. package/dist/endowments/home-page.d.mts +16 -0
  71. package/dist/endowments/home-page.d.mts.map +1 -0
  72. package/dist/endowments/home-page.mjs +23 -6
  73. package/dist/endowments/home-page.mjs.map +1 -1
  74. package/dist/endowments/index.cjs +92 -0
  75. package/dist/endowments/index.cjs.map +1 -0
  76. package/dist/{types/endowments/index.d.ts → endowments/index.d.cts} +12 -11
  77. package/dist/endowments/index.d.cts.map +1 -0
  78. package/dist/endowments/index.d.mts +132 -0
  79. package/dist/endowments/index.d.mts.map +1 -0
  80. package/dist/endowments/index.mjs +65 -52
  81. package/dist/endowments/index.mjs.map +1 -1
  82. package/dist/endowments/keyring.cjs +96 -0
  83. package/dist/endowments/keyring.cjs.map +1 -0
  84. package/dist/{types/endowments/keyring.d.ts → endowments/keyring.d.cts} +7 -6
  85. package/dist/endowments/keyring.d.cts.map +1 -0
  86. package/dist/endowments/keyring.d.mts +40 -0
  87. package/dist/endowments/keyring.d.mts.map +1 -0
  88. package/dist/endowments/keyring.mjs +89 -15
  89. package/dist/endowments/keyring.mjs.map +1 -1
  90. package/dist/endowments/lifecycle-hooks.cjs +28 -0
  91. package/dist/endowments/lifecycle-hooks.cjs.map +1 -0
  92. package/dist/{types/endowments/lifecycle-hooks.d.ts → endowments/lifecycle-hooks.d.cts} +5 -4
  93. package/dist/endowments/lifecycle-hooks.d.cts.map +1 -0
  94. package/dist/endowments/lifecycle-hooks.d.mts +16 -0
  95. package/dist/endowments/lifecycle-hooks.d.mts.map +1 -0
  96. package/dist/endowments/lifecycle-hooks.mjs +23 -6
  97. package/dist/endowments/lifecycle-hooks.mjs.map +1 -1
  98. package/dist/endowments/name-lookup.cjs +141 -0
  99. package/dist/endowments/name-lookup.cjs.map +1 -0
  100. package/dist/{types/endowments/name-lookup.d.ts → endowments/name-lookup.d.cts} +6 -5
  101. package/dist/endowments/name-lookup.d.cts.map +1 -0
  102. package/dist/endowments/name-lookup.d.mts +50 -0
  103. package/dist/endowments/name-lookup.d.mts.map +1 -0
  104. package/dist/endowments/name-lookup.mjs +133 -17
  105. package/dist/endowments/name-lookup.mjs.map +1 -1
  106. package/dist/endowments/network-access.cjs +30 -0
  107. package/dist/endowments/network-access.cjs.map +1 -0
  108. package/dist/{types/endowments/network-access.d.ts → endowments/network-access.d.cts} +4 -3
  109. package/dist/endowments/network-access.d.cts.map +1 -0
  110. package/dist/endowments/network-access.d.mts +15 -0
  111. package/dist/endowments/network-access.d.mts.map +1 -0
  112. package/dist/endowments/network-access.mjs +25 -6
  113. package/dist/endowments/network-access.mjs.map +1 -1
  114. package/dist/endowments/rpc.cjs +90 -0
  115. package/dist/endowments/rpc.cjs.map +1 -0
  116. package/dist/{types/endowments/rpc.d.ts → endowments/rpc.d.cts} +7 -6
  117. package/dist/endowments/rpc.d.cts.map +1 -0
  118. package/dist/endowments/rpc.d.mts +39 -0
  119. package/dist/endowments/rpc.d.mts.map +1 -0
  120. package/dist/endowments/rpc.mjs +83 -15
  121. package/dist/endowments/rpc.mjs.map +1 -1
  122. package/dist/endowments/signature-insight.cjs +102 -0
  123. package/dist/endowments/signature-insight.cjs.map +1 -0
  124. package/dist/{types/endowments/signature-insight.d.ts → endowments/signature-insight.d.cts} +6 -5
  125. package/dist/endowments/signature-insight.d.cts.map +1 -0
  126. package/dist/endowments/signature-insight.d.mts +40 -0
  127. package/dist/endowments/signature-insight.d.mts.map +1 -0
  128. package/dist/endowments/signature-insight.mjs +95 -15
  129. package/dist/endowments/signature-insight.mjs.map +1 -1
  130. package/dist/endowments/transaction-insight.cjs +105 -0
  131. package/dist/endowments/transaction-insight.cjs.map +1 -0
  132. package/dist/{types/endowments/transaction-insight.d.ts → endowments/transaction-insight.d.cts} +6 -5
  133. package/dist/endowments/transaction-insight.d.cts.map +1 -0
  134. package/dist/endowments/transaction-insight.d.mts +40 -0
  135. package/dist/endowments/transaction-insight.d.mts.map +1 -0
  136. package/dist/endowments/transaction-insight.mjs +98 -15
  137. package/dist/endowments/transaction-insight.mjs.map +1 -1
  138. package/dist/endowments/web-assembly.cjs +31 -0
  139. package/dist/endowments/web-assembly.cjs.map +1 -0
  140. package/dist/{types/endowments/web-assembly.d.ts → endowments/web-assembly.d.cts} +4 -3
  141. package/dist/endowments/web-assembly.d.cts.map +1 -0
  142. package/dist/endowments/web-assembly.d.mts +15 -0
  143. package/dist/endowments/web-assembly.d.mts.map +1 -0
  144. package/dist/endowments/web-assembly.mjs +26 -6
  145. package/dist/endowments/web-assembly.mjs.map +1 -1
  146. package/dist/index.cjs +28 -0
  147. package/dist/index.cjs.map +1 -0
  148. package/dist/index.d.cts +8 -0
  149. package/dist/index.d.cts.map +1 -0
  150. package/dist/index.d.mts +8 -0
  151. package/dist/index.d.mts.map +1 -0
  152. package/dist/index.mjs +6 -122
  153. package/dist/index.mjs.map +1 -1
  154. package/dist/permissions.cjs +55 -0
  155. package/dist/permissions.cjs.map +1 -0
  156. package/dist/{types/permissions.d.ts → permissions.d.cts} +3 -2
  157. package/dist/permissions.d.cts.map +1 -0
  158. package/dist/permissions.d.mts +17 -0
  159. package/dist/permissions.d.mts.map +1 -0
  160. package/dist/permissions.mjs +48 -43
  161. package/dist/permissions.mjs.map +1 -1
  162. package/dist/permitted/createInterface.cjs +64 -0
  163. package/dist/permitted/createInterface.cjs.map +1 -0
  164. package/dist/{types/permitted/createInterface.d.ts → permitted/createInterface.d.cts} +48 -47
  165. package/dist/permitted/createInterface.d.cts.map +1 -0
  166. package/dist/permitted/createInterface.d.mts +181 -0
  167. package/dist/permitted/createInterface.d.mts.map +1 -0
  168. package/dist/permitted/createInterface.mjs +59 -5
  169. package/dist/permitted/createInterface.mjs.map +1 -1
  170. package/dist/permitted/getAllSnaps.cjs +39 -0
  171. package/dist/permitted/getAllSnaps.cjs.map +1 -0
  172. package/dist/{types/permitted/getAllSnaps.d.ts → permitted/getAllSnaps.d.cts} +4 -3
  173. package/dist/permitted/getAllSnaps.d.cts.map +1 -0
  174. package/dist/permitted/getAllSnaps.d.mts +15 -0
  175. package/dist/permitted/getAllSnaps.d.mts.map +1 -0
  176. package/dist/permitted/getAllSnaps.mjs +34 -5
  177. package/dist/permitted/getAllSnaps.mjs.map +1 -1
  178. package/dist/permitted/getClientStatus.cjs +32 -0
  179. package/dist/permitted/getClientStatus.cjs.map +1 -0
  180. package/dist/{types/permitted/getClientStatus.d.ts → permitted/getClientStatus.d.cts} +4 -3
  181. package/dist/permitted/getClientStatus.d.cts.map +1 -0
  182. package/dist/permitted/getClientStatus.d.mts +14 -0
  183. package/dist/permitted/getClientStatus.d.mts.map +1 -0
  184. package/dist/permitted/getClientStatus.mjs +27 -5
  185. package/dist/permitted/getClientStatus.mjs.map +1 -1
  186. package/dist/permitted/getFile.cjs +47 -0
  187. package/dist/permitted/getFile.cjs.map +1 -0
  188. package/dist/{types/permitted/getFile.d.ts → permitted/getFile.d.cts} +4 -3
  189. package/dist/permitted/getFile.d.cts.map +1 -0
  190. package/dist/permitted/getFile.d.mts +16 -0
  191. package/dist/permitted/getFile.d.mts.map +1 -0
  192. package/dist/permitted/getFile.mjs +42 -7
  193. package/dist/permitted/getFile.mjs.map +1 -1
  194. package/dist/permitted/getInterfaceState.cjs +62 -0
  195. package/dist/permitted/getInterfaceState.cjs.map +1 -0
  196. package/dist/{types/permitted/getInterfaceState.d.ts → permitted/getInterfaceState.d.cts} +4 -3
  197. package/dist/permitted/getInterfaceState.d.cts.map +1 -0
  198. package/dist/permitted/getInterfaceState.d.mts +19 -0
  199. package/dist/permitted/getInterfaceState.d.mts.map +1 -0
  200. package/dist/permitted/getInterfaceState.mjs +57 -5
  201. package/dist/permitted/getInterfaceState.mjs.map +1 -1
  202. package/dist/permitted/getSnaps.cjs +33 -0
  203. package/dist/permitted/getSnaps.cjs.map +1 -0
  204. package/dist/{types/permitted/getSnaps.d.ts → permitted/getSnaps.d.cts} +4 -3
  205. package/dist/permitted/getSnaps.d.cts.map +1 -0
  206. package/dist/permitted/getSnaps.d.mts +14 -0
  207. package/dist/permitted/getSnaps.d.mts.map +1 -0
  208. package/dist/permitted/getSnaps.mjs +28 -5
  209. package/dist/permitted/getSnaps.mjs.map +1 -1
  210. package/dist/permitted/handlers.cjs +31 -0
  211. package/dist/permitted/handlers.cjs.map +1 -0
  212. package/dist/{types/permitted/handlers.d.ts → permitted/handlers.d.cts} +1 -0
  213. package/dist/permitted/handlers.d.cts.map +1 -0
  214. package/dist/permitted/handlers.d.mts +35 -0
  215. package/dist/permitted/handlers.d.mts.map +1 -0
  216. package/dist/permitted/handlers.mjs +26 -19
  217. package/dist/permitted/handlers.mjs.map +1 -1
  218. package/dist/permitted/index.cjs +19 -0
  219. package/dist/permitted/index.cjs.map +1 -0
  220. package/dist/permitted/index.d.cts +12 -0
  221. package/dist/permitted/index.d.cts.map +1 -0
  222. package/dist/permitted/index.d.mts +12 -0
  223. package/dist/permitted/index.d.mts.map +1 -0
  224. package/dist/permitted/index.mjs +2 -26
  225. package/dist/permitted/index.mjs.map +1 -1
  226. package/dist/permitted/invokeKeyring.cjs +83 -0
  227. package/dist/permitted/invokeKeyring.cjs.map +1 -0
  228. package/dist/{types/permitted/invokeKeyring.d.ts → permitted/invokeKeyring.d.cts} +4 -3
  229. package/dist/permitted/invokeKeyring.d.cts.map +1 -0
  230. package/dist/permitted/invokeKeyring.d.mts +16 -0
  231. package/dist/permitted/invokeKeyring.d.mts.map +1 -0
  232. package/dist/permitted/invokeKeyring.mjs +78 -6
  233. package/dist/permitted/invokeKeyring.mjs.map +1 -1
  234. package/dist/permitted/invokeSnapSugar.cjs +68 -0
  235. package/dist/permitted/invokeSnapSugar.cjs.map +1 -0
  236. package/dist/{types/permitted/invokeSnapSugar.d.ts → permitted/invokeSnapSugar.d.cts} +5 -4
  237. package/dist/permitted/invokeSnapSugar.d.cts.map +1 -0
  238. package/dist/permitted/invokeSnapSugar.d.mts +35 -0
  239. package/dist/permitted/invokeSnapSugar.d.mts.map +1 -0
  240. package/dist/permitted/invokeSnapSugar.mjs +61 -9
  241. package/dist/permitted/invokeSnapSugar.mjs.map +1 -1
  242. package/dist/permitted/middleware.cjs +40 -0
  243. package/dist/permitted/middleware.cjs.map +1 -0
  244. package/dist/{types/permitted/middleware.d.ts → permitted/middleware.d.cts} +3 -2
  245. package/dist/permitted/middleware.d.cts.map +1 -0
  246. package/dist/permitted/middleware.d.mts +11 -0
  247. package/dist/permitted/middleware.d.mts.map +1 -0
  248. package/dist/permitted/middleware.mjs +35 -20
  249. package/dist/permitted/middleware.mjs.map +1 -1
  250. package/dist/permitted/requestSnaps.cjs +121 -0
  251. package/dist/permitted/requestSnaps.cjs.map +1 -0
  252. package/dist/{types/permitted/requestSnaps.d.ts → permitted/requestSnaps.d.cts} +4 -3
  253. package/dist/permitted/requestSnaps.d.cts.map +1 -0
  254. package/dist/permitted/requestSnaps.d.mts +51 -0
  255. package/dist/permitted/requestSnaps.d.mts.map +1 -0
  256. package/dist/permitted/requestSnaps.mjs +114 -10
  257. package/dist/permitted/requestSnaps.mjs.map +1 -1
  258. package/dist/permitted/resolveInterface.cjs +65 -0
  259. package/dist/permitted/resolveInterface.cjs.map +1 -0
  260. package/dist/{types/permitted/resolveInterface.d.ts → permitted/resolveInterface.d.cts} +6 -5
  261. package/dist/permitted/resolveInterface.d.cts.map +1 -0
  262. package/dist/permitted/resolveInterface.d.mts +22 -0
  263. package/dist/permitted/resolveInterface.d.mts.map +1 -0
  264. package/dist/permitted/resolveInterface.mjs +60 -5
  265. package/dist/permitted/resolveInterface.mjs.map +1 -1
  266. package/dist/permitted/updateInterface.cjs +65 -0
  267. package/dist/permitted/updateInterface.cjs.map +1 -0
  268. package/dist/{types/permitted/updateInterface.d.ts → permitted/updateInterface.d.cts} +48 -47
  269. package/dist/permitted/updateInterface.d.cts.map +1 -0
  270. package/dist/permitted/updateInterface.d.mts +181 -0
  271. package/dist/permitted/updateInterface.d.mts.map +1 -0
  272. package/dist/permitted/updateInterface.mjs +60 -5
  273. package/dist/permitted/updateInterface.mjs.map +1 -1
  274. package/dist/restricted/caveats/index.cjs +22 -0
  275. package/dist/restricted/caveats/index.cjs.map +1 -0
  276. package/dist/{types/restricted/caveats/index.d.ts → restricted/caveats/index.d.cts} +3 -2
  277. package/dist/restricted/caveats/index.d.cts.map +1 -0
  278. package/dist/restricted/caveats/index.d.mts +9 -0
  279. package/dist/restricted/caveats/index.d.mts.map +1 -0
  280. package/dist/restricted/caveats/index.mjs +17 -15
  281. package/dist/restricted/caveats/index.mjs.map +1 -1
  282. package/dist/restricted/caveats/permittedCoinTypes.cjs +90 -0
  283. package/dist/restricted/caveats/permittedCoinTypes.cjs.map +1 -0
  284. package/dist/{types/restricted/caveats/permittedCoinTypes.d.ts → restricted/caveats/permittedCoinTypes.d.cts} +5 -4
  285. package/dist/restricted/caveats/permittedCoinTypes.d.cts.map +1 -0
  286. package/dist/restricted/caveats/permittedCoinTypes.d.mts +30 -0
  287. package/dist/restricted/caveats/permittedCoinTypes.d.mts.map +1 -0
  288. package/dist/restricted/caveats/permittedCoinTypes.mjs +82 -11
  289. package/dist/restricted/caveats/permittedCoinTypes.mjs.map +1 -1
  290. package/dist/restricted/caveats/permittedDerivationPaths.cjs +70 -0
  291. package/dist/restricted/caveats/permittedDerivationPaths.cjs.map +1 -0
  292. package/dist/{types/restricted/caveats/permittedDerivationPaths.d.ts → restricted/caveats/permittedDerivationPaths.d.cts} +5 -4
  293. package/dist/restricted/caveats/permittedDerivationPaths.d.cts.map +1 -0
  294. package/dist/restricted/caveats/permittedDerivationPaths.d.mts +33 -0
  295. package/dist/restricted/caveats/permittedDerivationPaths.d.mts.map +1 -0
  296. package/dist/restricted/caveats/permittedDerivationPaths.mjs +62 -11
  297. package/dist/restricted/caveats/permittedDerivationPaths.mjs.map +1 -1
  298. package/dist/restricted/caveats/snapIds.cjs +56 -0
  299. package/dist/restricted/caveats/snapIds.cjs.map +1 -0
  300. package/dist/{types/restricted/caveats/snapIds.d.ts → restricted/caveats/snapIds.d.cts} +5 -4
  301. package/dist/restricted/caveats/snapIds.d.cts.map +1 -0
  302. package/dist/restricted/caveats/snapIds.d.mts +22 -0
  303. package/dist/restricted/caveats/snapIds.d.mts.map +1 -0
  304. package/dist/restricted/caveats/snapIds.mjs +49 -9
  305. package/dist/restricted/caveats/snapIds.mjs.map +1 -1
  306. package/dist/restricted/dialog.cjs +222 -0
  307. package/dist/restricted/dialog.cjs.map +1 -0
  308. package/dist/restricted/dialog.d.cts +432 -0
  309. package/dist/restricted/dialog.d.cts.map +1 -0
  310. package/dist/restricted/dialog.d.mts +432 -0
  311. package/dist/restricted/dialog.d.mts.map +1 -0
  312. package/dist/restricted/dialog.mjs +216 -9
  313. package/dist/restricted/dialog.mjs.map +1 -1
  314. package/dist/restricted/getBip32Entropy.cjs +69 -0
  315. package/dist/restricted/getBip32Entropy.cjs.map +1 -0
  316. package/dist/{types/restricted/getBip32Entropy.d.ts → restricted/getBip32Entropy.d.cts} +6 -5
  317. package/dist/restricted/getBip32Entropy.d.cts.map +1 -0
  318. package/dist/restricted/getBip32Entropy.d.mts +45 -0
  319. package/dist/restricted/getBip32Entropy.d.mts.map +1 -0
  320. package/dist/restricted/getBip32Entropy.mjs +63 -8
  321. package/dist/restricted/getBip32Entropy.mjs.map +1 -1
  322. package/dist/restricted/getBip32PublicKey.cjs +78 -0
  323. package/dist/restricted/getBip32PublicKey.cjs.map +1 -0
  324. package/dist/{types/restricted/getBip32PublicKey.d.ts → restricted/getBip32PublicKey.d.cts} +7 -6
  325. package/dist/restricted/getBip32PublicKey.d.cts.map +1 -0
  326. package/dist/restricted/getBip32PublicKey.d.mts +54 -0
  327. package/dist/restricted/getBip32PublicKey.d.mts.map +1 -0
  328. package/dist/restricted/getBip32PublicKey.mjs +72 -10
  329. package/dist/restricted/getBip32PublicKey.mjs.map +1 -1
  330. package/dist/restricted/getBip44Entropy.cjs +71 -0
  331. package/dist/restricted/getBip44Entropy.cjs.map +1 -0
  332. package/dist/{types/restricted/getBip44Entropy.d.ts → restricted/getBip44Entropy.d.cts} +6 -5
  333. package/dist/restricted/getBip44Entropy.d.cts.map +1 -0
  334. package/dist/restricted/getBip44Entropy.d.mts +47 -0
  335. package/dist/restricted/getBip44Entropy.d.mts.map +1 -0
  336. package/dist/restricted/getBip44Entropy.mjs +65 -7
  337. package/dist/restricted/getBip44Entropy.mjs.map +1 -1
  338. package/dist/restricted/getEntropy.cjs +59 -0
  339. package/dist/restricted/getEntropy.cjs.map +1 -0
  340. package/dist/{types/restricted/getEntropy.d.ts → restricted/getEntropy.d.cts} +7 -6
  341. package/dist/restricted/getEntropy.d.cts.map +1 -0
  342. package/dist/restricted/getEntropy.d.mts +62 -0
  343. package/dist/restricted/getEntropy.d.mts.map +1 -0
  344. package/dist/restricted/getEntropy.mjs +54 -8
  345. package/dist/restricted/getEntropy.mjs.map +1 -1
  346. package/dist/restricted/getLocale.cjs +47 -0
  347. package/dist/restricted/getLocale.cjs.map +1 -0
  348. package/dist/{types/restricted/getLocale.d.ts → restricted/getLocale.d.cts} +6 -5
  349. package/dist/restricted/getLocale.d.cts.map +1 -0
  350. package/dist/restricted/getLocale.d.mts +50 -0
  351. package/dist/restricted/getLocale.d.mts.map +1 -0
  352. package/dist/restricted/getLocale.mjs +40 -9
  353. package/dist/restricted/getLocale.mjs.map +1 -1
  354. package/dist/restricted/getPreferences.cjs +46 -0
  355. package/dist/restricted/getPreferences.cjs.map +1 -0
  356. package/dist/{types/restricted/getPreferences.d.ts → restricted/getPreferences.d.cts} +6 -5
  357. package/dist/restricted/getPreferences.d.cts.map +1 -0
  358. package/dist/restricted/getPreferences.d.mts +49 -0
  359. package/dist/restricted/getPreferences.d.mts.map +1 -0
  360. package/dist/restricted/getPreferences.mjs +39 -9
  361. package/dist/restricted/getPreferences.mjs.map +1 -1
  362. package/dist/restricted/index.cjs +49 -0
  363. package/dist/restricted/index.cjs.map +1 -0
  364. package/dist/{types/restricted/index.d.ts → restricted/index.d.cts} +17 -16
  365. package/dist/restricted/index.d.cts.map +1 -0
  366. package/dist/restricted/index.d.mts +169 -0
  367. package/dist/restricted/index.d.mts.map +1 -0
  368. package/dist/restricted/index.mjs +27 -35
  369. package/dist/restricted/index.mjs.map +1 -1
  370. package/dist/restricted/invokeSnap.cjs +96 -0
  371. package/dist/restricted/invokeSnap.cjs.map +1 -0
  372. package/dist/{types/restricted/invokeSnap.d.ts → restricted/invokeSnap.d.cts} +8 -6
  373. package/dist/restricted/invokeSnap.d.cts.map +1 -0
  374. package/dist/restricted/invokeSnap.d.mts +65 -0
  375. package/dist/restricted/invokeSnap.d.mts.map +1 -0
  376. package/dist/restricted/invokeSnap.mjs +89 -11
  377. package/dist/restricted/invokeSnap.mjs.map +1 -1
  378. package/dist/restricted/manageAccounts.cjs +61 -0
  379. package/dist/restricted/manageAccounts.cjs.map +1 -0
  380. package/dist/{types/restricted/manageAccounts.d.ts → restricted/manageAccounts.d.cts} +6 -5
  381. package/dist/restricted/manageAccounts.d.cts.map +1 -0
  382. package/dist/restricted/manageAccounts.d.mts +65 -0
  383. package/dist/restricted/manageAccounts.d.mts.map +1 -0
  384. package/dist/restricted/manageAccounts.mjs +54 -11
  385. package/dist/restricted/manageAccounts.mjs.map +1 -1
  386. package/dist/restricted/manageState.cjs +175 -0
  387. package/dist/restricted/manageState.cjs.map +1 -0
  388. package/dist/{types/restricted/manageState.d.ts → restricted/manageState.d.cts} +6 -5
  389. package/dist/restricted/manageState.d.cts.map +1 -0
  390. package/dist/restricted/manageState.d.mts +111 -0
  391. package/dist/restricted/manageState.d.mts.map +1 -0
  392. package/dist/restricted/manageState.mjs +166 -18
  393. package/dist/restricted/manageState.mjs.map +1 -1
  394. package/dist/restricted/notify.cjs +108 -0
  395. package/dist/restricted/notify.cjs.map +1 -0
  396. package/dist/{types/restricted/notify.d.ts → restricted/notify.d.cts} +7 -6
  397. package/dist/restricted/notify.d.cts.map +1 -0
  398. package/dist/restricted/notify.d.mts +83 -0
  399. package/dist/restricted/notify.d.mts.map +1 -0
  400. package/dist/restricted/notify.mjs +100 -11
  401. package/dist/restricted/notify.mjs.map +1 -1
  402. package/dist/utils.cjs +140 -0
  403. package/dist/utils.cjs.map +1 -0
  404. package/dist/{types/utils.d.ts → utils.d.cts} +6 -4
  405. package/dist/utils.d.cts.map +1 -0
  406. package/dist/utils.d.mts +98 -0
  407. package/dist/utils.d.mts.map +1 -0
  408. package/dist/utils.mjs +132 -12
  409. package/dist/utils.mjs.map +1 -1
  410. package/package.json +20 -19
  411. package/dist/chunk-23XDKQW2.mjs +0 -73
  412. package/dist/chunk-23XDKQW2.mjs.map +0 -1
  413. package/dist/chunk-2CTOCP34.mjs +0 -45
  414. package/dist/chunk-2CTOCP34.mjs.map +0 -1
  415. package/dist/chunk-2L2ATCIK.mjs +0 -78
  416. package/dist/chunk-2L2ATCIK.mjs.map +0 -1
  417. package/dist/chunk-2RDYC42U.mjs +0 -67
  418. package/dist/chunk-2RDYC42U.mjs.map +0 -1
  419. package/dist/chunk-2SFH57UV.js +0 -21
  420. package/dist/chunk-33LLA2MH.mjs +0 -75
  421. package/dist/chunk-33LLA2MH.mjs.map +0 -1
  422. package/dist/chunk-33MTKZ4H.js +0 -90
  423. package/dist/chunk-33MTKZ4H.js.map +0 -1
  424. package/dist/chunk-3UAWEHMF.js +0 -18
  425. package/dist/chunk-3UAWEHMF.js.map +0 -1
  426. package/dist/chunk-3WCLDJAS.mjs +0 -74
  427. package/dist/chunk-3WCLDJAS.mjs.map +0 -1
  428. package/dist/chunk-3WKIKYUH.js +0 -78
  429. package/dist/chunk-3WKIKYUH.js.map +0 -1
  430. package/dist/chunk-4D2B2UQ6.mjs +0 -23
  431. package/dist/chunk-4D2B2UQ6.mjs.map +0 -1
  432. package/dist/chunk-4LSOS7SM.js +0 -23
  433. package/dist/chunk-4LSOS7SM.js.map +0 -1
  434. package/dist/chunk-4PWFZPJC.js +0 -79
  435. package/dist/chunk-4PWFZPJC.js.map +0 -1
  436. package/dist/chunk-57BL7O2P.mjs +0 -69
  437. package/dist/chunk-57BL7O2P.mjs.map +0 -1
  438. package/dist/chunk-62URQ5VS.mjs +0 -18
  439. package/dist/chunk-62URQ5VS.mjs.map +0 -1
  440. package/dist/chunk-6XKVFSC2.js +0 -32
  441. package/dist/chunk-6XKVFSC2.js.map +0 -1
  442. package/dist/chunk-756OQVOC.js +0 -67
  443. package/dist/chunk-756OQVOC.js.map +0 -1
  444. package/dist/chunk-7CV677MM.js +0 -42
  445. package/dist/chunk-7CV677MM.js.map +0 -1
  446. package/dist/chunk-7HVABE5R.js +0 -74
  447. package/dist/chunk-7HVABE5R.js.map +0 -1
  448. package/dist/chunk-7P6TF6CE.mjs +0 -55
  449. package/dist/chunk-7P6TF6CE.mjs.map +0 -1
  450. package/dist/chunk-7TVJV425.js +0 -1
  451. package/dist/chunk-7TVJV425.js.map +0 -1
  452. package/dist/chunk-A6H6I4VH.js +0 -61
  453. package/dist/chunk-A6H6I4VH.js.map +0 -1
  454. package/dist/chunk-AMMJ744B.mjs +0 -32
  455. package/dist/chunk-AMMJ744B.mjs.map +0 -1
  456. package/dist/chunk-ATBKAX2S.js +0 -39
  457. package/dist/chunk-ATBKAX2S.js.map +0 -1
  458. package/dist/chunk-B3NIHNXW.js +0 -23
  459. package/dist/chunk-B3NIHNXW.js.map +0 -1
  460. package/dist/chunk-CD4OUHO5.mjs +0 -20
  461. package/dist/chunk-CD4OUHO5.mjs.map +0 -1
  462. package/dist/chunk-CDAVFOUS.js +0 -53
  463. package/dist/chunk-CDAVFOUS.js.map +0 -1
  464. package/dist/chunk-CH5O2YCX.mjs +0 -18
  465. package/dist/chunk-CH5O2YCX.mjs.map +0 -1
  466. package/dist/chunk-DLVPMPRZ.js +0 -45
  467. package/dist/chunk-DLVPMPRZ.js.map +0 -1
  468. package/dist/chunk-DTZF746A.mjs +0 -21
  469. package/dist/chunk-DTZF746A.mjs.map +0 -1
  470. package/dist/chunk-E27BGHCR.js +0 -78
  471. package/dist/chunk-E27BGHCR.js.map +0 -1
  472. package/dist/chunk-ELCOEVKA.js +0 -196
  473. package/dist/chunk-ELCOEVKA.js.map +0 -1
  474. package/dist/chunk-EOXTZF5U.js +0 -47
  475. package/dist/chunk-EOXTZF5U.js.map +0 -1
  476. package/dist/chunk-FCVWU5XH.js +0 -73
  477. package/dist/chunk-FFHVA6PP.js +0 -82
  478. package/dist/chunk-FFHVA6PP.js.map +0 -1
  479. package/dist/chunk-FJ7COFRJ.mjs +0 -54
  480. package/dist/chunk-FJ7COFRJ.mjs.map +0 -1
  481. package/dist/chunk-FM4LNQR7.mjs +0 -34
  482. package/dist/chunk-FM4LNQR7.mjs.map +0 -1
  483. package/dist/chunk-GE5XFDUE.js +0 -21
  484. package/dist/chunk-GE5XFDUE.js.map +0 -1
  485. package/dist/chunk-GEJDXRTL.mjs +0 -59
  486. package/dist/chunk-GEJDXRTL.mjs.map +0 -1
  487. package/dist/chunk-GPV4ETUH.mjs +0 -47
  488. package/dist/chunk-GPV4ETUH.mjs.map +0 -1
  489. package/dist/chunk-H6X3CWWQ.js +0 -54
  490. package/dist/chunk-H6X3CWWQ.js.map +0 -1
  491. package/dist/chunk-HOECEYMT.mjs +0 -70
  492. package/dist/chunk-HOECEYMT.mjs.map +0 -1
  493. package/dist/chunk-I2P65KBQ.mjs +0 -67
  494. package/dist/chunk-I2P65KBQ.mjs.map +0 -1
  495. package/dist/chunk-I3G6S6MJ.js +0 -68
  496. package/dist/chunk-I3G6S6MJ.js.map +0 -1
  497. package/dist/chunk-IE6EHYEG.js +0 -57
  498. package/dist/chunk-IE6EHYEG.js.map +0 -1
  499. package/dist/chunk-JWDQUKKU.mjs +0 -80
  500. package/dist/chunk-JWDQUKKU.mjs.map +0 -1
  501. package/dist/chunk-K3UL5RVN.mjs +0 -43
  502. package/dist/chunk-K3UL5RVN.mjs.map +0 -1
  503. package/dist/chunk-KRSIAVUJ.js +0 -115
  504. package/dist/chunk-KRSIAVUJ.js.map +0 -1
  505. package/dist/chunk-KSTF5JYB.mjs +0 -23
  506. package/dist/chunk-KSTF5JYB.mjs.map +0 -1
  507. package/dist/chunk-LP3RWEDJ.js +0 -43
  508. package/dist/chunk-LP3RWEDJ.js.map +0 -1
  509. package/dist/chunk-LR7UR4YU.mjs +0 -52
  510. package/dist/chunk-LR7UR4YU.mjs.map +0 -1
  511. package/dist/chunk-LXJBBRQ4.mjs +0 -57
  512. package/dist/chunk-LXJBBRQ4.mjs.map +0 -1
  513. package/dist/chunk-M2JQCKR7.js +0 -143
  514. package/dist/chunk-M2JQCKR7.js.map +0 -1
  515. package/dist/chunk-MC2Z4NF6.mjs +0 -45
  516. package/dist/chunk-MC2Z4NF6.mjs.map +0 -1
  517. package/dist/chunk-MXPVC2XP.mjs +0 -105
  518. package/dist/chunk-MXPVC2XP.mjs.map +0 -1
  519. package/dist/chunk-NU4NAAFG.js +0 -1
  520. package/dist/chunk-NU4NAAFG.js.map +0 -1
  521. package/dist/chunk-NWT2EXFD.js +0 -18
  522. package/dist/chunk-NWT2EXFD.js.map +0 -1
  523. package/dist/chunk-O66NZFSD.mjs +0 -23
  524. package/dist/chunk-O66NZFSD.mjs.map +0 -1
  525. package/dist/chunk-ODN35VOK.mjs +0 -119
  526. package/dist/chunk-ODN35VOK.mjs.map +0 -1
  527. package/dist/chunk-OI33OL7K.js +0 -47
  528. package/dist/chunk-OI33OL7K.js.map +0 -1
  529. package/dist/chunk-PIAWDTWO.mjs +0 -68
  530. package/dist/chunk-PIAWDTWO.mjs.map +0 -1
  531. package/dist/chunk-PIRQCNBJ.mjs +0 -78
  532. package/dist/chunk-PIRQCNBJ.mjs.map +0 -1
  533. package/dist/chunk-PK2RPAXI.js +0 -59
  534. package/dist/chunk-PK2RPAXI.js.map +0 -1
  535. package/dist/chunk-PS6OEQXL.js +0 -105
  536. package/dist/chunk-PS6OEQXL.js.map +0 -1
  537. package/dist/chunk-PXU6PORA.js +0 -119
  538. package/dist/chunk-PXU6PORA.js.map +0 -1
  539. package/dist/chunk-Q27K2I6Z.js +0 -23
  540. package/dist/chunk-Q27K2I6Z.js.map +0 -1
  541. package/dist/chunk-QDZAWH6F.js +0 -80
  542. package/dist/chunk-QDZAWH6F.js.map +0 -1
  543. package/dist/chunk-QMULJEYN.js +0 -35
  544. package/dist/chunk-QMULJEYN.js.map +0 -1
  545. package/dist/chunk-RHPSYX7X.js +0 -34
  546. package/dist/chunk-RHPSYX7X.js.map +0 -1
  547. package/dist/chunk-T56DKVFS.js +0 -70
  548. package/dist/chunk-T56DKVFS.js.map +0 -1
  549. package/dist/chunk-TAXLFFV4.mjs +0 -115
  550. package/dist/chunk-TAXLFFV4.mjs.map +0 -1
  551. package/dist/chunk-TE4W25CA.mjs +0 -143
  552. package/dist/chunk-TE4W25CA.mjs.map +0 -1
  553. package/dist/chunk-TG63GBK3.mjs +0 -1
  554. package/dist/chunk-TG63GBK3.mjs.map +0 -1
  555. package/dist/chunk-TNENASGX.mjs +0 -1
  556. package/dist/chunk-TNENASGX.mjs.map +0 -1
  557. package/dist/chunk-TQCUJQHY.mjs +0 -196
  558. package/dist/chunk-TQCUJQHY.mjs.map +0 -1
  559. package/dist/chunk-TT4DP2YW.mjs +0 -35
  560. package/dist/chunk-TT4DP2YW.mjs.map +0 -1
  561. package/dist/chunk-TVC3E5LI.mjs +0 -42
  562. package/dist/chunk-TVC3E5LI.mjs.map +0 -1
  563. package/dist/chunk-U6TJQLNV.js +0 -45
  564. package/dist/chunk-U6TJQLNV.js.map +0 -1
  565. package/dist/chunk-UB3733UY.mjs +0 -23
  566. package/dist/chunk-UB3733UY.mjs.map +0 -1
  567. package/dist/chunk-UCWANXBZ.js +0 -45
  568. package/dist/chunk-UCWANXBZ.js.map +0 -1
  569. package/dist/chunk-UF3UJTY3.js +0 -55
  570. package/dist/chunk-UF3UJTY3.js.map +0 -1
  571. package/dist/chunk-UY4DUF53.mjs +0 -45
  572. package/dist/chunk-UY4DUF53.mjs.map +0 -1
  573. package/dist/chunk-V3KRSCUK.mjs +0 -53
  574. package/dist/chunk-V3KRSCUK.mjs.map +0 -1
  575. package/dist/chunk-VUA6ICJO.js +0 -52
  576. package/dist/chunk-VUA6ICJO.js.map +0 -1
  577. package/dist/chunk-VVBTXSID.mjs +0 -82
  578. package/dist/chunk-VVBTXSID.mjs.map +0 -1
  579. package/dist/chunk-VYII7C3J.mjs +0 -79
  580. package/dist/chunk-VYII7C3J.mjs.map +0 -1
  581. package/dist/chunk-W33UWNA2.mjs +0 -90
  582. package/dist/chunk-W33UWNA2.mjs.map +0 -1
  583. package/dist/chunk-XGMYBPQR.mjs +0 -47
  584. package/dist/chunk-XGMYBPQR.mjs.map +0 -1
  585. package/dist/chunk-YGKFOOWI.js +0 -20
  586. package/dist/chunk-YGKFOOWI.js.map +0 -1
  587. package/dist/chunk-YOHE52XB.js +0 -23
  588. package/dist/chunk-YOHE52XB.js.map +0 -1
  589. package/dist/chunk-YT2Q3W5C.js +0 -69
  590. package/dist/chunk-YT2Q3W5C.js.map +0 -1
  591. package/dist/chunk-YZMFLB67.js +0 -75
  592. package/dist/chunk-YZMFLB67.js.map +0 -1
  593. package/dist/chunk-Z6YFGWHN.mjs +0 -61
  594. package/dist/chunk-Z6YFGWHN.mjs.map +0 -1
  595. package/dist/chunk-ZH3FC55E.mjs +0 -21
  596. package/dist/chunk-ZH3FC55E.mjs.map +0 -1
  597. package/dist/chunk-ZKISN6YP.js +0 -67
  598. package/dist/chunk-ZKISN6YP.js.map +0 -1
  599. package/dist/chunk-ZXDCQWMJ.mjs +0 -39
  600. package/dist/chunk-ZXDCQWMJ.mjs.map +0 -1
  601. package/dist/endowments/caveats/generic.js +0 -7
  602. package/dist/endowments/caveats/generic.js.map +0 -1
  603. package/dist/endowments/caveats/index.js +0 -18
  604. package/dist/endowments/caveats/index.js.map +0 -1
  605. package/dist/endowments/caveats/requestTime.js +0 -13
  606. package/dist/endowments/caveats/requestTime.js.map +0 -1
  607. package/dist/endowments/cronjob.js +0 -16
  608. package/dist/endowments/cronjob.js.map +0 -1
  609. package/dist/endowments/enum.js +0 -7
  610. package/dist/endowments/enum.js.map +0 -1
  611. package/dist/endowments/ethereum-provider.js +0 -8
  612. package/dist/endowments/ethereum-provider.js.map +0 -1
  613. package/dist/endowments/home-page.js +0 -8
  614. package/dist/endowments/home-page.js.map +0 -1
  615. package/dist/endowments/index.js +0 -54
  616. package/dist/endowments/index.js.map +0 -1
  617. package/dist/endowments/keyring.js +0 -17
  618. package/dist/endowments/keyring.js.map +0 -1
  619. package/dist/endowments/lifecycle-hooks.js +0 -8
  620. package/dist/endowments/lifecycle-hooks.js.map +0 -1
  621. package/dist/endowments/name-lookup.js +0 -19
  622. package/dist/endowments/name-lookup.js.map +0 -1
  623. package/dist/endowments/network-access.js +0 -8
  624. package/dist/endowments/network-access.js.map +0 -1
  625. package/dist/endowments/rpc.js +0 -17
  626. package/dist/endowments/rpc.js.map +0 -1
  627. package/dist/endowments/signature-insight.js +0 -17
  628. package/dist/endowments/signature-insight.js.map +0 -1
  629. package/dist/endowments/transaction-insight.js +0 -17
  630. package/dist/endowments/transaction-insight.js.map +0 -1
  631. package/dist/endowments/web-assembly.js +0 -8
  632. package/dist/endowments/web-assembly.js.map +0 -1
  633. package/dist/index.js +0 -123
  634. package/dist/index.js.map +0 -1
  635. package/dist/permissions.js +0 -44
  636. package/dist/permissions.js.map +0 -1
  637. package/dist/permitted/createInterface.js +0 -7
  638. package/dist/permitted/createInterface.js.map +0 -1
  639. package/dist/permitted/getAllSnaps.js +0 -7
  640. package/dist/permitted/getAllSnaps.js.map +0 -1
  641. package/dist/permitted/getClientStatus.js +0 -7
  642. package/dist/permitted/getClientStatus.js.map +0 -1
  643. package/dist/permitted/getFile.js +0 -9
  644. package/dist/permitted/getFile.js.map +0 -1
  645. package/dist/permitted/getInterfaceState.js +0 -7
  646. package/dist/permitted/getInterfaceState.js.map +0 -1
  647. package/dist/permitted/getSnaps.js +0 -7
  648. package/dist/permitted/getSnaps.js.map +0 -1
  649. package/dist/permitted/handlers.js +0 -21
  650. package/dist/permitted/handlers.js.map +0 -1
  651. package/dist/permitted/index.js +0 -27
  652. package/dist/permitted/index.js.map +0 -1
  653. package/dist/permitted/invokeKeyring.js +0 -8
  654. package/dist/permitted/invokeKeyring.js.map +0 -1
  655. package/dist/permitted/invokeSnapSugar.js +0 -11
  656. package/dist/permitted/invokeSnapSugar.js.map +0 -1
  657. package/dist/permitted/middleware.js +0 -21
  658. package/dist/permitted/middleware.js.map +0 -1
  659. package/dist/permitted/requestSnaps.js +0 -12
  660. package/dist/permitted/requestSnaps.js.map +0 -1
  661. package/dist/permitted/resolveInterface.js +0 -7
  662. package/dist/permitted/resolveInterface.js.map +0 -1
  663. package/dist/permitted/updateInterface.js +0 -7
  664. package/dist/permitted/updateInterface.js.map +0 -1
  665. package/dist/restricted/caveats/index.js +0 -17
  666. package/dist/restricted/caveats/index.js.map +0 -1
  667. package/dist/restricted/caveats/permittedCoinTypes.js +0 -13
  668. package/dist/restricted/caveats/permittedCoinTypes.js.map +0 -1
  669. package/dist/restricted/caveats/permittedDerivationPaths.js +0 -13
  670. package/dist/restricted/caveats/permittedDerivationPaths.js.map +0 -1
  671. package/dist/restricted/caveats/snapIds.js +0 -11
  672. package/dist/restricted/caveats/snapIds.js.map +0 -1
  673. package/dist/restricted/dialog.js +0 -11
  674. package/dist/restricted/dialog.js.map +0 -1
  675. package/dist/restricted/getBip32Entropy.js +0 -10
  676. package/dist/restricted/getBip32Entropy.js.map +0 -1
  677. package/dist/restricted/getBip32PublicKey.js +0 -12
  678. package/dist/restricted/getBip32PublicKey.js.map +0 -1
  679. package/dist/restricted/getBip44Entropy.js +0 -9
  680. package/dist/restricted/getBip44Entropy.js.map +0 -1
  681. package/dist/restricted/getEntropy.js +0 -10
  682. package/dist/restricted/getEntropy.js.map +0 -1
  683. package/dist/restricted/getLocale.js +0 -11
  684. package/dist/restricted/getLocale.js.map +0 -1
  685. package/dist/restricted/getPreferences.js +0 -11
  686. package/dist/restricted/getPreferences.js.map +0 -1
  687. package/dist/restricted/index.js +0 -37
  688. package/dist/restricted/index.js.map +0 -1
  689. package/dist/restricted/invokeSnap.js +0 -13
  690. package/dist/restricted/invokeSnap.js.map +0 -1
  691. package/dist/restricted/manageAccounts.js +0 -13
  692. package/dist/restricted/manageAccounts.js.map +0 -1
  693. package/dist/restricted/manageState.js +0 -20
  694. package/dist/restricted/manageState.js.map +0 -1
  695. package/dist/restricted/notify.js +0 -13
  696. package/dist/restricted/notify.js.map +0 -1
  697. package/dist/tsconfig.build.tsbuildinfo +0 -1
  698. package/dist/types/__fixtures__/index.d.ts +0 -1
  699. package/dist/types/endowments/caveats/index.d.ts +0 -2
  700. package/dist/types/index.d.ts +0 -7
  701. package/dist/types/permitted/index.d.ts +0 -11
  702. package/dist/types/restricted/dialog.d.ts +0 -1463
  703. package/dist/utils.js +0 -13
  704. package/dist/utils.js.map +0 -1
@@ -1,10 +1,56 @@
1
- import {
2
- GetEntropyArgsStruct,
3
- getEntropyBuilder
4
- } from "../chunk-2RDYC42U.mjs";
5
- import "../chunk-W33UWNA2.mjs";
6
- export {
7
- GetEntropyArgsStruct,
8
- getEntropyBuilder
1
+ import { PermissionType, SubjectType } from "@metamask/permission-controller";
2
+ import { rpcErrors } from "@metamask/rpc-errors";
3
+ import { SIP_6_MAGIC_VALUE } from "@metamask/snaps-utils";
4
+ import { literal, object, optional, string } from "@metamask/superstruct";
5
+ import { assertStruct } from "@metamask/utils";
6
+ import { deriveEntropy } from "../utils.mjs";
7
+ const targetName = 'snap_getEntropy';
8
+ export const GetEntropyArgsStruct = object({
9
+ version: literal(1),
10
+ salt: optional(string()),
11
+ });
12
+ const specificationBuilder = ({ allowedCaveats = null, methodHooks, }) => {
13
+ return {
14
+ permissionType: PermissionType.RestrictedMethod,
15
+ targetName,
16
+ allowedCaveats,
17
+ methodImplementation: getEntropyImplementation(methodHooks),
18
+ subjectTypes: [SubjectType.Snap],
19
+ };
9
20
  };
21
+ const methodHooks = {
22
+ getMnemonic: true,
23
+ getUnlockPromise: true,
24
+ };
25
+ export const getEntropyBuilder = Object.freeze({
26
+ targetName,
27
+ specificationBuilder,
28
+ methodHooks,
29
+ });
30
+ /**
31
+ * Builds the method implementation for `snap_getEntropy`. The implementation
32
+ * is based on the reference implementation of
33
+ * [SIP-6](https://metamask.github.io/SIPs/SIPS/sip-6).
34
+ *
35
+ * @param hooks - The RPC method hooks.
36
+ * @param hooks.getMnemonic - The method to get the mnemonic of the user's
37
+ * primary keyring.
38
+ * @param hooks.getUnlockPromise - The method to get a promise that resolves
39
+ * once the extension is unlocked.
40
+ * @returns The method implementation.
41
+ */
42
+ function getEntropyImplementation({ getMnemonic, getUnlockPromise, }) {
43
+ return async function getEntropy(options) {
44
+ const { params, context: { origin }, } = options;
45
+ assertStruct(params, GetEntropyArgsStruct, 'Invalid "snap_getEntropy" parameters', rpcErrors.invalidParams);
46
+ await getUnlockPromise(true);
47
+ const mnemonicPhrase = await getMnemonic();
48
+ return deriveEntropy({
49
+ input: origin,
50
+ salt: params.salt,
51
+ mnemonicPhrase,
52
+ magic: SIP_6_MAGIC_VALUE,
53
+ });
54
+ };
55
+ }
10
56
  //# sourceMappingURL=getEntropy.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"file":"getEntropy.mjs","sourceRoot":"","sources":["../../src/restricted/getEntropy.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,wCAAwC;AAC9E,OAAO,EAAE,SAAS,EAAE,6BAA6B;AAEjD,OAAO,EAAE,iBAAiB,EAAE,8BAA8B;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,8BAA8B;AAE1E,OAAO,EAAE,YAAY,EAAE,wBAAwB;AAG/C,OAAO,EAAE,aAAa,EAAE,qBAAiB;AAEzC,MAAM,UAAU,GAAG,iBAAiB,CAAC;AAcrC,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC;IACzC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IACnB,IAAI,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;CACzB,CAAC,CAAC;AAUH,MAAM,oBAAoB,GAItB,CAAC,EACH,cAAc,GAAG,IAAI,EACrB,WAAW,GAC2B,EAAE,EAAE;IAC1C,OAAO;QACL,cAAc,EAAE,cAAc,CAAC,gBAAgB;QAC/C,UAAU;QACV,cAAc;QACd,oBAAoB,EAAE,wBAAwB,CAAC,WAAW,CAAC;QAC3D,YAAY,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC;KACjC,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,WAAW,GAAuC;IACtD,WAAW,EAAE,IAAI;IACjB,gBAAgB,EAAE,IAAI;CACvB,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAAC;IAC7C,UAAU;IACV,oBAAoB;IACpB,WAAW;CACH,CAAC,CAAC;AAgBZ;;;;;;;;;;;GAWG;AACH,SAAS,wBAAwB,CAAC,EAChC,WAAW,EACX,gBAAgB,GACA;IAChB,OAAO,KAAK,UAAU,UAAU,CAC9B,OAAkD;QAElD,MAAM,EACJ,MAAM,EACN,OAAO,EAAE,EAAE,MAAM,EAAE,GACpB,GAAG,OAAO,CAAC;QAEZ,YAAY,CACV,MAAM,EACN,oBAAoB,EACpB,sCAAsC,EACtC,SAAS,CAAC,aAAa,CACxB,CAAC;QAEF,MAAM,gBAAgB,CAAC,IAAI,CAAC,CAAC;QAC7B,MAAM,cAAc,GAAG,MAAM,WAAW,EAAE,CAAC;QAE3C,OAAO,aAAa,CAAC;YACnB,KAAK,EAAE,MAAM;YACb,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,cAAc;YACd,KAAK,EAAE,iBAAiB;SACzB,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import type {\n PermissionSpecificationBuilder,\n RestrictedMethodOptions,\n ValidPermissionSpecification,\n} from '@metamask/permission-controller';\nimport { PermissionType, SubjectType } from '@metamask/permission-controller';\nimport { rpcErrors } from '@metamask/rpc-errors';\nimport type { GetEntropyParams, GetEntropyResult } from '@metamask/snaps-sdk';\nimport { SIP_6_MAGIC_VALUE } from '@metamask/snaps-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { literal, object, optional, string } from '@metamask/superstruct';\nimport type { NonEmptyArray } from '@metamask/utils';\nimport { assertStruct } from '@metamask/utils';\n\nimport type { MethodHooksObject } from '../utils';\nimport { deriveEntropy } from '../utils';\n\nconst targetName = 'snap_getEntropy';\n\ntype GetEntropySpecificationBuilderOptions = {\n allowedCaveats?: Readonly<NonEmptyArray<string>> | null;\n methodHooks: GetEntropyHooks;\n};\n\ntype GetEntropySpecification = ValidPermissionSpecification<{\n permissionType: PermissionType.RestrictedMethod;\n targetName: typeof targetName;\n methodImplementation: ReturnType<typeof getEntropyImplementation>;\n allowedCaveats: Readonly<NonEmptyArray<string>> | null;\n}>;\n\nexport const GetEntropyArgsStruct = object({\n version: literal(1),\n salt: optional(string()),\n});\n\n/**\n * @property version - The version of the `snap_getEntropy` method. This must be\n * the numeric literal `1`.\n * @property salt - A string to use as the salt when deriving the entropy. If\n * omitted, the salt will be an empty string.\n */\nexport type GetEntropyArgs = Infer<typeof GetEntropyArgsStruct>;\n\nconst specificationBuilder: PermissionSpecificationBuilder<\n PermissionType.RestrictedMethod,\n GetEntropySpecificationBuilderOptions,\n GetEntropySpecification\n> = ({\n allowedCaveats = null,\n methodHooks,\n}: GetEntropySpecificationBuilderOptions) => {\n return {\n permissionType: PermissionType.RestrictedMethod,\n targetName,\n allowedCaveats,\n methodImplementation: getEntropyImplementation(methodHooks),\n subjectTypes: [SubjectType.Snap],\n };\n};\n\nconst methodHooks: MethodHooksObject<GetEntropyHooks> = {\n getMnemonic: true,\n getUnlockPromise: true,\n};\n\nexport const getEntropyBuilder = Object.freeze({\n targetName,\n specificationBuilder,\n methodHooks,\n} as const);\n\nexport type GetEntropyHooks = {\n /**\n * @returns The mnemonic of the user's primary keyring.\n */\n getMnemonic: () => Promise<Uint8Array>;\n\n /**\n * Waits for the extension to be unlocked.\n *\n * @returns A promise that resolves once the extension is unlocked.\n */\n getUnlockPromise: (shouldShowUnlockRequest: boolean) => Promise<void>;\n};\n\n/**\n * Builds the method implementation for `snap_getEntropy`. The implementation\n * is based on the reference implementation of\n * [SIP-6](https://metamask.github.io/SIPs/SIPS/sip-6).\n *\n * @param hooks - The RPC method hooks.\n * @param hooks.getMnemonic - The method to get the mnemonic of the user's\n * primary keyring.\n * @param hooks.getUnlockPromise - The method to get a promise that resolves\n * once the extension is unlocked.\n * @returns The method implementation.\n */\nfunction getEntropyImplementation({\n getMnemonic,\n getUnlockPromise,\n}: GetEntropyHooks) {\n return async function getEntropy(\n options: RestrictedMethodOptions<GetEntropyParams>,\n ): Promise<GetEntropyResult> {\n const {\n params,\n context: { origin },\n } = options;\n\n assertStruct(\n params,\n GetEntropyArgsStruct,\n 'Invalid \"snap_getEntropy\" parameters',\n rpcErrors.invalidParams,\n );\n\n await getUnlockPromise(true);\n const mnemonicPhrase = await getMnemonic();\n\n return deriveEntropy({\n input: origin,\n salt: params.salt,\n mnemonicPhrase,\n magic: SIP_6_MAGIC_VALUE,\n });\n };\n}\n"]}
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getImplementation = exports.getLocaleBuilder = exports.specificationBuilder = void 0;
4
+ const permission_controller_1 = require("@metamask/permission-controller");
5
+ const methodName = 'snap_getLocale';
6
+ /**
7
+ * The specification builder for the `snap_getLocale` permission.
8
+ * `snap_getLocale` allows snaps to get the user selected locale.
9
+ *
10
+ * @param options - The specification builder options.
11
+ * @param options.allowedCaveats - The optional allowed caveats for the permission.
12
+ * @param options.methodHooks - The RPC method hooks needed by the method implementation.
13
+ * @returns The specification for the `snap_getLocale` permission.
14
+ * @deprecated - To be removed in favor of `snap_getPreferences`.
15
+ */
16
+ const specificationBuilder = ({ allowedCaveats = null, methodHooks }) => {
17
+ return {
18
+ permissionType: permission_controller_1.PermissionType.RestrictedMethod,
19
+ targetName: methodName,
20
+ allowedCaveats,
21
+ methodImplementation: getImplementation(methodHooks),
22
+ subjectTypes: [permission_controller_1.SubjectType.Snap],
23
+ };
24
+ };
25
+ exports.specificationBuilder = specificationBuilder;
26
+ const methodHooks = {
27
+ getPreferences: true,
28
+ };
29
+ exports.getLocaleBuilder = Object.freeze({
30
+ targetName: methodName,
31
+ specificationBuilder: exports.specificationBuilder,
32
+ methodHooks,
33
+ });
34
+ /**
35
+ * Builds the method implementation for `snap_getLocale`.
36
+ *
37
+ * @param hooks - The RPC method hooks.
38
+ * @param hooks.getPreferences - A function that returns the user selected preferences.
39
+ * @returns The user selected locale.
40
+ */
41
+ function getImplementation({ getPreferences }) {
42
+ return async function implementation(_args) {
43
+ return getPreferences().locale;
44
+ };
45
+ }
46
+ exports.getImplementation = getImplementation;
47
+ //# sourceMappingURL=getLocale.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getLocale.cjs","sourceRoot":"","sources":["../../src/restricted/getLocale.ts"],"names":[],"mappings":";;;AAMA,2EAA8E;AAS9E,MAAM,UAAU,GAAG,gBAAgB,CAAC;AAkBpC;;;;;;;;;GASG;AACI,MAAM,oBAAoB,GAI7B,CAAC,EAAE,cAAc,GAAG,IAAI,EAAE,WAAW,EAA+B,EAAE,EAAE;IAC1E,OAAO;QACL,cAAc,EAAE,sCAAc,CAAC,gBAAgB;QAC/C,UAAU,EAAE,UAAU;QACtB,cAAc;QACd,oBAAoB,EAAE,iBAAiB,CAAC,WAAW,CAAC;QACpD,YAAY,EAAE,CAAC,mCAAW,CAAC,IAAI,CAAC;KACjC,CAAC;AACJ,CAAC,CAAC;AAZW,QAAA,oBAAoB,wBAY/B;AAEF,MAAM,WAAW,GAA4C;IAC3D,cAAc,EAAE,IAAI;CACrB,CAAC;AAEW,QAAA,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC;IAC5C,UAAU,EAAE,UAAU;IACtB,oBAAoB,EAApB,4BAAoB;IACpB,WAAW;CACH,CAAC,CAAC;AAEZ;;;;;;GAMG;AACH,SAAgB,iBAAiB,CAAC,EAAE,cAAc,EAAwB;IACxE,OAAO,KAAK,UAAU,cAAc,CAClC,KAA0D;QAE1D,OAAO,cAAc,EAAE,CAAC,MAAM,CAAC;IACjC,CAAC,CAAC;AACJ,CAAC;AAND,8CAMC","sourcesContent":["import type {\n PermissionSpecificationBuilder,\n ValidPermissionSpecification,\n RestrictedMethodOptions,\n RestrictedMethodParameters,\n} from '@metamask/permission-controller';\nimport { PermissionType, SubjectType } from '@metamask/permission-controller';\nimport type {\n GetLocaleResult,\n GetPreferencesResult,\n} from '@metamask/snaps-sdk';\nimport type { NonEmptyArray } from '@metamask/utils';\n\nimport type { MethodHooksObject } from '../utils';\n\nconst methodName = 'snap_getLocale';\n\nexport type GetLocaleMethodHooks = {\n getPreferences: () => GetPreferencesResult;\n};\n\ntype SpecificationBuilderOptions = {\n allowedCaveats?: Readonly<NonEmptyArray<string>> | null;\n methodHooks: GetLocaleMethodHooks;\n};\n\ntype Specification = ValidPermissionSpecification<{\n permissionType: PermissionType.RestrictedMethod;\n targetName: typeof methodName;\n methodImplementation: ReturnType<typeof getImplementation>;\n allowedCaveats: Readonly<NonEmptyArray<string>> | null;\n}>;\n\n/**\n * The specification builder for the `snap_getLocale` permission.\n * `snap_getLocale` allows snaps to get the user selected locale.\n *\n * @param options - The specification builder options.\n * @param options.allowedCaveats - The optional allowed caveats for the permission.\n * @param options.methodHooks - The RPC method hooks needed by the method implementation.\n * @returns The specification for the `snap_getLocale` permission.\n * @deprecated - To be removed in favor of `snap_getPreferences`.\n */\nexport const specificationBuilder: PermissionSpecificationBuilder<\n PermissionType.RestrictedMethod,\n SpecificationBuilderOptions,\n Specification\n> = ({ allowedCaveats = null, methodHooks }: SpecificationBuilderOptions) => {\n return {\n permissionType: PermissionType.RestrictedMethod,\n targetName: methodName,\n allowedCaveats,\n methodImplementation: getImplementation(methodHooks),\n subjectTypes: [SubjectType.Snap],\n };\n};\n\nconst methodHooks: MethodHooksObject<GetLocaleMethodHooks> = {\n getPreferences: true,\n};\n\nexport const getLocaleBuilder = Object.freeze({\n targetName: methodName,\n specificationBuilder,\n methodHooks,\n} as const);\n\n/**\n * Builds the method implementation for `snap_getLocale`.\n *\n * @param hooks - The RPC method hooks.\n * @param hooks.getPreferences - A function that returns the user selected preferences.\n * @returns The user selected locale.\n */\nexport function getImplementation({ getPreferences }: GetLocaleMethodHooks) {\n return async function implementation(\n _args: RestrictedMethodOptions<RestrictedMethodParameters>,\n ): Promise<GetLocaleResult> {\n return getPreferences().locale;\n };\n}\n"]}
@@ -1,8 +1,8 @@
1
- import type { PermissionSpecificationBuilder, ValidPermissionSpecification, RestrictedMethodOptions, RestrictedMethodParameters } from '@metamask/permission-controller';
2
- import { PermissionType } from '@metamask/permission-controller';
3
- import type { GetLocaleResult, GetPreferencesResult } from '@metamask/snaps-sdk';
4
- import type { NonEmptyArray } from '@metamask/utils';
5
- import type { MethodHooksObject } from '../utils';
1
+ import type { PermissionSpecificationBuilder, ValidPermissionSpecification, RestrictedMethodOptions, RestrictedMethodParameters } from "@metamask/permission-controller";
2
+ import { PermissionType } from "@metamask/permission-controller";
3
+ import type { GetLocaleResult, GetPreferencesResult } from "@metamask/snaps-sdk";
4
+ import type { NonEmptyArray } from "@metamask/utils";
5
+ import type { MethodHooksObject } from "../utils.cjs";
6
6
  declare const methodName = "snap_getLocale";
7
7
  export type GetLocaleMethodHooks = {
8
8
  getPreferences: () => GetPreferencesResult;
@@ -47,3 +47,4 @@ export declare const getLocaleBuilder: Readonly<{
47
47
  */
48
48
  export declare function getImplementation({ getPreferences }: GetLocaleMethodHooks): (_args: RestrictedMethodOptions<RestrictedMethodParameters>) => Promise<GetLocaleResult>;
49
49
  export {};
50
+ //# sourceMappingURL=getLocale.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getLocale.d.cts","sourceRoot":"","sources":["../../src/restricted/getLocale.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,8BAA8B,EAC9B,4BAA4B,EAC5B,uBAAuB,EACvB,0BAA0B,EAC3B,wCAAwC;AACzC,OAAO,EAAE,cAAc,EAAe,wCAAwC;AAC9E,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACrB,4BAA4B;AAC7B,OAAO,KAAK,EAAE,aAAa,EAAE,wBAAwB;AAErD,OAAO,KAAK,EAAE,iBAAiB,EAAE,qBAAiB;AAElD,QAAA,MAAM,UAAU,mBAAmB,CAAC;AAEpC,MAAM,MAAM,oBAAoB,GAAG;IACjC,cAAc,EAAE,MAAM,oBAAoB,CAAC;CAC5C,CAAC;AAEF,KAAK,2BAA2B,GAAG;IACjC,cAAc,CAAC,EAAE,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC;IACxD,WAAW,EAAE,oBAAoB,CAAC;CACnC,CAAC;AAEF,KAAK,aAAa,GAAG,4BAA4B,CAAC;IAChD,cAAc,EAAE,cAAc,CAAC,gBAAgB,CAAC;IAChD,UAAU,EAAE,OAAO,UAAU,CAAC;IAC9B,oBAAoB,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;IAC3D,cAAc,EAAE,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC;CACxD,CAAC,CAAC;AAEH;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB,EAAE,8BAA8B,CAC/D,cAAc,CAAC,gBAAgB,EAC/B,2BAA2B,EAC3B,aAAa,CASd,CAAC;AAMF,eAAO,MAAM,gBAAgB;;;wBAlCX,eAAe,gBAAgB;oBACnC,iBAAiB;8BACP,WAAW,wBAAwB,CAAC;wBAC1C,SAAS,cAAc,MAAM,CAAC,CAAC,GAAG,IAAI;;;EAmC7C,CAAC;AAEZ;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,cAAc,EAAE,EAAE,oBAAoB,WAE/D,wBAAwB,0BAA0B,CAAC,KACzD,QAAQ,eAAe,CAAC,CAG5B"}
@@ -0,0 +1,50 @@
1
+ import type { PermissionSpecificationBuilder, ValidPermissionSpecification, RestrictedMethodOptions, RestrictedMethodParameters } from "@metamask/permission-controller";
2
+ import { PermissionType } from "@metamask/permission-controller";
3
+ import type { GetLocaleResult, GetPreferencesResult } from "@metamask/snaps-sdk";
4
+ import type { NonEmptyArray } from "@metamask/utils";
5
+ import type { MethodHooksObject } from "../utils.mjs";
6
+ declare const methodName = "snap_getLocale";
7
+ export type GetLocaleMethodHooks = {
8
+ getPreferences: () => GetPreferencesResult;
9
+ };
10
+ type SpecificationBuilderOptions = {
11
+ allowedCaveats?: Readonly<NonEmptyArray<string>> | null;
12
+ methodHooks: GetLocaleMethodHooks;
13
+ };
14
+ type Specification = ValidPermissionSpecification<{
15
+ permissionType: PermissionType.RestrictedMethod;
16
+ targetName: typeof methodName;
17
+ methodImplementation: ReturnType<typeof getImplementation>;
18
+ allowedCaveats: Readonly<NonEmptyArray<string>> | null;
19
+ }>;
20
+ /**
21
+ * The specification builder for the `snap_getLocale` permission.
22
+ * `snap_getLocale` allows snaps to get the user selected locale.
23
+ *
24
+ * @param options - The specification builder options.
25
+ * @param options.allowedCaveats - The optional allowed caveats for the permission.
26
+ * @param options.methodHooks - The RPC method hooks needed by the method implementation.
27
+ * @returns The specification for the `snap_getLocale` permission.
28
+ * @deprecated - To be removed in favor of `snap_getPreferences`.
29
+ */
30
+ export declare const specificationBuilder: PermissionSpecificationBuilder<PermissionType.RestrictedMethod, SpecificationBuilderOptions, Specification>;
31
+ export declare const getLocaleBuilder: Readonly<{
32
+ readonly targetName: "snap_getLocale";
33
+ readonly specificationBuilder: PermissionSpecificationBuilder<PermissionType.RestrictedMethod, SpecificationBuilderOptions, {
34
+ permissionType: PermissionType.RestrictedMethod;
35
+ targetName: typeof methodName;
36
+ methodImplementation: ReturnType<typeof getImplementation>;
37
+ allowedCaveats: Readonly<NonEmptyArray<string>> | null;
38
+ }>;
39
+ readonly methodHooks: MethodHooksObject<GetLocaleMethodHooks>;
40
+ }>;
41
+ /**
42
+ * Builds the method implementation for `snap_getLocale`.
43
+ *
44
+ * @param hooks - The RPC method hooks.
45
+ * @param hooks.getPreferences - A function that returns the user selected preferences.
46
+ * @returns The user selected locale.
47
+ */
48
+ export declare function getImplementation({ getPreferences }: GetLocaleMethodHooks): (_args: RestrictedMethodOptions<RestrictedMethodParameters>) => Promise<GetLocaleResult>;
49
+ export {};
50
+ //# sourceMappingURL=getLocale.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getLocale.d.mts","sourceRoot":"","sources":["../../src/restricted/getLocale.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,8BAA8B,EAC9B,4BAA4B,EAC5B,uBAAuB,EACvB,0BAA0B,EAC3B,wCAAwC;AACzC,OAAO,EAAE,cAAc,EAAe,wCAAwC;AAC9E,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACrB,4BAA4B;AAC7B,OAAO,KAAK,EAAE,aAAa,EAAE,wBAAwB;AAErD,OAAO,KAAK,EAAE,iBAAiB,EAAE,qBAAiB;AAElD,QAAA,MAAM,UAAU,mBAAmB,CAAC;AAEpC,MAAM,MAAM,oBAAoB,GAAG;IACjC,cAAc,EAAE,MAAM,oBAAoB,CAAC;CAC5C,CAAC;AAEF,KAAK,2BAA2B,GAAG;IACjC,cAAc,CAAC,EAAE,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC;IACxD,WAAW,EAAE,oBAAoB,CAAC;CACnC,CAAC;AAEF,KAAK,aAAa,GAAG,4BAA4B,CAAC;IAChD,cAAc,EAAE,cAAc,CAAC,gBAAgB,CAAC;IAChD,UAAU,EAAE,OAAO,UAAU,CAAC;IAC9B,oBAAoB,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;IAC3D,cAAc,EAAE,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC;CACxD,CAAC,CAAC;AAEH;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB,EAAE,8BAA8B,CAC/D,cAAc,CAAC,gBAAgB,EAC/B,2BAA2B,EAC3B,aAAa,CASd,CAAC;AAMF,eAAO,MAAM,gBAAgB;;;wBAlCX,eAAe,gBAAgB;oBACnC,iBAAiB;8BACP,WAAW,wBAAwB,CAAC;wBAC1C,SAAS,cAAc,MAAM,CAAC,CAAC,GAAG,IAAI;;;EAmC7C,CAAC;AAEZ;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,cAAc,EAAE,EAAE,oBAAoB,WAE/D,wBAAwB,0BAA0B,CAAC,KACzD,QAAQ,eAAe,CAAC,CAG5B"}
@@ -1,11 +1,42 @@
1
- import {
2
- getImplementation,
3
- getLocaleBuilder,
4
- specificationBuilder
5
- } from "../chunk-AMMJ744B.mjs";
6
- export {
7
- getImplementation,
8
- getLocaleBuilder,
9
- specificationBuilder
1
+ import { PermissionType, SubjectType } from "@metamask/permission-controller";
2
+ const methodName = 'snap_getLocale';
3
+ /**
4
+ * The specification builder for the `snap_getLocale` permission.
5
+ * `snap_getLocale` allows snaps to get the user selected locale.
6
+ *
7
+ * @param options - The specification builder options.
8
+ * @param options.allowedCaveats - The optional allowed caveats for the permission.
9
+ * @param options.methodHooks - The RPC method hooks needed by the method implementation.
10
+ * @returns The specification for the `snap_getLocale` permission.
11
+ * @deprecated - To be removed in favor of `snap_getPreferences`.
12
+ */
13
+ export const specificationBuilder = ({ allowedCaveats = null, methodHooks }) => {
14
+ return {
15
+ permissionType: PermissionType.RestrictedMethod,
16
+ targetName: methodName,
17
+ allowedCaveats,
18
+ methodImplementation: getImplementation(methodHooks),
19
+ subjectTypes: [SubjectType.Snap],
20
+ };
10
21
  };
22
+ const methodHooks = {
23
+ getPreferences: true,
24
+ };
25
+ export const getLocaleBuilder = Object.freeze({
26
+ targetName: methodName,
27
+ specificationBuilder,
28
+ methodHooks,
29
+ });
30
+ /**
31
+ * Builds the method implementation for `snap_getLocale`.
32
+ *
33
+ * @param hooks - The RPC method hooks.
34
+ * @param hooks.getPreferences - A function that returns the user selected preferences.
35
+ * @returns The user selected locale.
36
+ */
37
+ export function getImplementation({ getPreferences }) {
38
+ return async function implementation(_args) {
39
+ return getPreferences().locale;
40
+ };
41
+ }
11
42
  //# sourceMappingURL=getLocale.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"file":"getLocale.mjs","sourceRoot":"","sources":["../../src/restricted/getLocale.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,wCAAwC;AAS9E,MAAM,UAAU,GAAG,gBAAgB,CAAC;AAkBpC;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAI7B,CAAC,EAAE,cAAc,GAAG,IAAI,EAAE,WAAW,EAA+B,EAAE,EAAE;IAC1E,OAAO;QACL,cAAc,EAAE,cAAc,CAAC,gBAAgB;QAC/C,UAAU,EAAE,UAAU;QACtB,cAAc;QACd,oBAAoB,EAAE,iBAAiB,CAAC,WAAW,CAAC;QACpD,YAAY,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC;KACjC,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,WAAW,GAA4C;IAC3D,cAAc,EAAE,IAAI;CACrB,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC;IAC5C,UAAU,EAAE,UAAU;IACtB,oBAAoB;IACpB,WAAW;CACH,CAAC,CAAC;AAEZ;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,EAAE,cAAc,EAAwB;IACxE,OAAO,KAAK,UAAU,cAAc,CAClC,KAA0D;QAE1D,OAAO,cAAc,EAAE,CAAC,MAAM,CAAC;IACjC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import type {\n PermissionSpecificationBuilder,\n ValidPermissionSpecification,\n RestrictedMethodOptions,\n RestrictedMethodParameters,\n} from '@metamask/permission-controller';\nimport { PermissionType, SubjectType } from '@metamask/permission-controller';\nimport type {\n GetLocaleResult,\n GetPreferencesResult,\n} from '@metamask/snaps-sdk';\nimport type { NonEmptyArray } from '@metamask/utils';\n\nimport type { MethodHooksObject } from '../utils';\n\nconst methodName = 'snap_getLocale';\n\nexport type GetLocaleMethodHooks = {\n getPreferences: () => GetPreferencesResult;\n};\n\ntype SpecificationBuilderOptions = {\n allowedCaveats?: Readonly<NonEmptyArray<string>> | null;\n methodHooks: GetLocaleMethodHooks;\n};\n\ntype Specification = ValidPermissionSpecification<{\n permissionType: PermissionType.RestrictedMethod;\n targetName: typeof methodName;\n methodImplementation: ReturnType<typeof getImplementation>;\n allowedCaveats: Readonly<NonEmptyArray<string>> | null;\n}>;\n\n/**\n * The specification builder for the `snap_getLocale` permission.\n * `snap_getLocale` allows snaps to get the user selected locale.\n *\n * @param options - The specification builder options.\n * @param options.allowedCaveats - The optional allowed caveats for the permission.\n * @param options.methodHooks - The RPC method hooks needed by the method implementation.\n * @returns The specification for the `snap_getLocale` permission.\n * @deprecated - To be removed in favor of `snap_getPreferences`.\n */\nexport const specificationBuilder: PermissionSpecificationBuilder<\n PermissionType.RestrictedMethod,\n SpecificationBuilderOptions,\n Specification\n> = ({ allowedCaveats = null, methodHooks }: SpecificationBuilderOptions) => {\n return {\n permissionType: PermissionType.RestrictedMethod,\n targetName: methodName,\n allowedCaveats,\n methodImplementation: getImplementation(methodHooks),\n subjectTypes: [SubjectType.Snap],\n };\n};\n\nconst methodHooks: MethodHooksObject<GetLocaleMethodHooks> = {\n getPreferences: true,\n};\n\nexport const getLocaleBuilder = Object.freeze({\n targetName: methodName,\n specificationBuilder,\n methodHooks,\n} as const);\n\n/**\n * Builds the method implementation for `snap_getLocale`.\n *\n * @param hooks - The RPC method hooks.\n * @param hooks.getPreferences - A function that returns the user selected preferences.\n * @returns The user selected locale.\n */\nexport function getImplementation({ getPreferences }: GetLocaleMethodHooks) {\n return async function implementation(\n _args: RestrictedMethodOptions<RestrictedMethodParameters>,\n ): Promise<GetLocaleResult> {\n return getPreferences().locale;\n };\n}\n"]}
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getImplementation = exports.getPreferencesBuilder = exports.specificationBuilder = void 0;
4
+ const permission_controller_1 = require("@metamask/permission-controller");
5
+ const methodName = 'snap_getPreferences';
6
+ /**
7
+ * The specification builder for the `snap_getPreferences` permission.
8
+ * `snap_getPreferences` allows snaps to access user preferences.
9
+ *
10
+ * @param options - The specification builder options.
11
+ * @param options.allowedCaveats - The optional allowed caveats for the permission.
12
+ * @param options.methodHooks - The RPC method hooks needed by the method implementation.
13
+ * @returns The specification for the `snap_getPreferences` permission.
14
+ */
15
+ const specificationBuilder = ({ allowedCaveats = null, methodHooks }) => {
16
+ return {
17
+ permissionType: permission_controller_1.PermissionType.RestrictedMethod,
18
+ targetName: methodName,
19
+ allowedCaveats,
20
+ methodImplementation: getImplementation(methodHooks),
21
+ subjectTypes: [permission_controller_1.SubjectType.Snap],
22
+ };
23
+ };
24
+ exports.specificationBuilder = specificationBuilder;
25
+ const methodHooks = {
26
+ getPreferences: true,
27
+ };
28
+ exports.getPreferencesBuilder = Object.freeze({
29
+ targetName: methodName,
30
+ specificationBuilder: exports.specificationBuilder,
31
+ methodHooks,
32
+ });
33
+ /**
34
+ * Builds the method implementation for `snap_getPreferences`.
35
+ *
36
+ * @param hooks - The RPC method hooks.
37
+ * @param hooks.getPreferences - A function that returns the user selected preferences.
38
+ * @returns The user preferences.
39
+ */
40
+ function getImplementation({ getPreferences, }) {
41
+ return async function implementation(_args) {
42
+ return getPreferences();
43
+ };
44
+ }
45
+ exports.getImplementation = getImplementation;
46
+ //# sourceMappingURL=getPreferences.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getPreferences.cjs","sourceRoot":"","sources":["../../src/restricted/getPreferences.ts"],"names":[],"mappings":";;;AAMA,2EAA8E;AAM9E,MAAM,UAAU,GAAG,qBAAqB,CAAC;AAkBzC;;;;;;;;GAQG;AACI,MAAM,oBAAoB,GAI7B,CAAC,EAAE,cAAc,GAAG,IAAI,EAAE,WAAW,EAA+B,EAAE,EAAE;IAC1E,OAAO;QACL,cAAc,EAAE,sCAAc,CAAC,gBAAgB;QAC/C,UAAU,EAAE,UAAU;QACtB,cAAc;QACd,oBAAoB,EAAE,iBAAiB,CAAC,WAAW,CAAC;QACpD,YAAY,EAAE,CAAC,mCAAW,CAAC,IAAI,CAAC;KACjC,CAAC;AACJ,CAAC,CAAC;AAZW,QAAA,oBAAoB,wBAY/B;AAEF,MAAM,WAAW,GAAiD;IAChE,cAAc,EAAE,IAAI;CACrB,CAAC;AAEW,QAAA,qBAAqB,GAAG,MAAM,CAAC,MAAM,CAAC;IACjD,UAAU,EAAE,UAAU;IACtB,oBAAoB,EAApB,4BAAoB;IACpB,WAAW;CACH,CAAC,CAAC;AAEZ;;;;;;GAMG;AACH,SAAgB,iBAAiB,CAAC,EAChC,cAAc,GACY;IAC1B,OAAO,KAAK,UAAU,cAAc,CAClC,KAA0D;QAE1D,OAAO,cAAc,EAAE,CAAC;IAC1B,CAAC,CAAC;AACJ,CAAC;AARD,8CAQC","sourcesContent":["import type {\n PermissionSpecificationBuilder,\n ValidPermissionSpecification,\n RestrictedMethodOptions,\n RestrictedMethodParameters,\n} from '@metamask/permission-controller';\nimport { PermissionType, SubjectType } from '@metamask/permission-controller';\nimport type { GetPreferencesResult } from '@metamask/snaps-sdk';\nimport type { NonEmptyArray } from '@metamask/utils';\n\nimport type { MethodHooksObject } from '../utils';\n\nconst methodName = 'snap_getPreferences';\n\nexport type GetPreferencesMethodHooks = {\n getPreferences: () => GetPreferencesResult;\n};\n\ntype SpecificationBuilderOptions = {\n allowedCaveats?: Readonly<NonEmptyArray<string>> | null;\n methodHooks: GetPreferencesMethodHooks;\n};\n\ntype Specification = ValidPermissionSpecification<{\n permissionType: PermissionType.RestrictedMethod;\n targetName: typeof methodName;\n methodImplementation: ReturnType<typeof getImplementation>;\n allowedCaveats: Readonly<NonEmptyArray<string>> | null;\n}>;\n\n/**\n * The specification builder for the `snap_getPreferences` permission.\n * `snap_getPreferences` allows snaps to access user preferences.\n *\n * @param options - The specification builder options.\n * @param options.allowedCaveats - The optional allowed caveats for the permission.\n * @param options.methodHooks - The RPC method hooks needed by the method implementation.\n * @returns The specification for the `snap_getPreferences` permission.\n */\nexport const specificationBuilder: PermissionSpecificationBuilder<\n PermissionType.RestrictedMethod,\n SpecificationBuilderOptions,\n Specification\n> = ({ allowedCaveats = null, methodHooks }: SpecificationBuilderOptions) => {\n return {\n permissionType: PermissionType.RestrictedMethod,\n targetName: methodName,\n allowedCaveats,\n methodImplementation: getImplementation(methodHooks),\n subjectTypes: [SubjectType.Snap],\n };\n};\n\nconst methodHooks: MethodHooksObject<GetPreferencesMethodHooks> = {\n getPreferences: true,\n};\n\nexport const getPreferencesBuilder = Object.freeze({\n targetName: methodName,\n specificationBuilder,\n methodHooks,\n} as const);\n\n/**\n * Builds the method implementation for `snap_getPreferences`.\n *\n * @param hooks - The RPC method hooks.\n * @param hooks.getPreferences - A function that returns the user selected preferences.\n * @returns The user preferences.\n */\nexport function getImplementation({\n getPreferences,\n}: GetPreferencesMethodHooks) {\n return async function implementation(\n _args: RestrictedMethodOptions<RestrictedMethodParameters>,\n ): Promise<GetPreferencesResult> {\n return getPreferences();\n };\n}\n"]}
@@ -1,8 +1,8 @@
1
- import type { PermissionSpecificationBuilder, ValidPermissionSpecification, RestrictedMethodOptions, RestrictedMethodParameters } from '@metamask/permission-controller';
2
- import { PermissionType } from '@metamask/permission-controller';
3
- import type { GetPreferencesResult } from '@metamask/snaps-sdk';
4
- import type { NonEmptyArray } from '@metamask/utils';
5
- import type { MethodHooksObject } from '../utils';
1
+ import type { PermissionSpecificationBuilder, ValidPermissionSpecification, RestrictedMethodOptions, RestrictedMethodParameters } from "@metamask/permission-controller";
2
+ import { PermissionType } from "@metamask/permission-controller";
3
+ import type { GetPreferencesResult } from "@metamask/snaps-sdk";
4
+ import type { NonEmptyArray } from "@metamask/utils";
5
+ import type { MethodHooksObject } from "../utils.cjs";
6
6
  declare const methodName = "snap_getPreferences";
7
7
  export type GetPreferencesMethodHooks = {
8
8
  getPreferences: () => GetPreferencesResult;
@@ -46,3 +46,4 @@ export declare const getPreferencesBuilder: Readonly<{
46
46
  */
47
47
  export declare function getImplementation({ getPreferences, }: GetPreferencesMethodHooks): (_args: RestrictedMethodOptions<RestrictedMethodParameters>) => Promise<GetPreferencesResult>;
48
48
  export {};
49
+ //# sourceMappingURL=getPreferences.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getPreferences.d.cts","sourceRoot":"","sources":["../../src/restricted/getPreferences.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,8BAA8B,EAC9B,4BAA4B,EAC5B,uBAAuB,EACvB,0BAA0B,EAC3B,wCAAwC;AACzC,OAAO,EAAE,cAAc,EAAe,wCAAwC;AAC9E,OAAO,KAAK,EAAE,oBAAoB,EAAE,4BAA4B;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,wBAAwB;AAErD,OAAO,KAAK,EAAE,iBAAiB,EAAE,qBAAiB;AAElD,QAAA,MAAM,UAAU,wBAAwB,CAAC;AAEzC,MAAM,MAAM,yBAAyB,GAAG;IACtC,cAAc,EAAE,MAAM,oBAAoB,CAAC;CAC5C,CAAC;AAEF,KAAK,2BAA2B,GAAG;IACjC,cAAc,CAAC,EAAE,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC;IACxD,WAAW,EAAE,yBAAyB,CAAC;CACxC,CAAC;AAEF,KAAK,aAAa,GAAG,4BAA4B,CAAC;IAChD,cAAc,EAAE,cAAc,CAAC,gBAAgB,CAAC;IAChD,UAAU,EAAE,OAAO,UAAU,CAAC;IAC9B,oBAAoB,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;IAC3D,cAAc,EAAE,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC;CACxD,CAAC,CAAC;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,EAAE,8BAA8B,CAC/D,cAAc,CAAC,gBAAgB,EAC/B,2BAA2B,EAC3B,aAAa,CASd,CAAC;AAMF,eAAO,MAAM,qBAAqB;;;wBAjChB,eAAe,gBAAgB;oBACnC,iBAAiB;8BACP,WAAW,wBAAwB,CAAC;wBAC1C,SAAS,cAAc,MAAM,CAAC,CAAC,GAAG,IAAI;;;EAkC7C,CAAC;AAEZ;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,cAAc,GACf,EAAE,yBAAyB,WAEjB,wBAAwB,0BAA0B,CAAC,KACzD,QAAQ,oBAAoB,CAAC,CAGjC"}
@@ -0,0 +1,49 @@
1
+ import type { PermissionSpecificationBuilder, ValidPermissionSpecification, RestrictedMethodOptions, RestrictedMethodParameters } from "@metamask/permission-controller";
2
+ import { PermissionType } from "@metamask/permission-controller";
3
+ import type { GetPreferencesResult } from "@metamask/snaps-sdk";
4
+ import type { NonEmptyArray } from "@metamask/utils";
5
+ import type { MethodHooksObject } from "../utils.mjs";
6
+ declare const methodName = "snap_getPreferences";
7
+ export type GetPreferencesMethodHooks = {
8
+ getPreferences: () => GetPreferencesResult;
9
+ };
10
+ type SpecificationBuilderOptions = {
11
+ allowedCaveats?: Readonly<NonEmptyArray<string>> | null;
12
+ methodHooks: GetPreferencesMethodHooks;
13
+ };
14
+ type Specification = ValidPermissionSpecification<{
15
+ permissionType: PermissionType.RestrictedMethod;
16
+ targetName: typeof methodName;
17
+ methodImplementation: ReturnType<typeof getImplementation>;
18
+ allowedCaveats: Readonly<NonEmptyArray<string>> | null;
19
+ }>;
20
+ /**
21
+ * The specification builder for the `snap_getPreferences` permission.
22
+ * `snap_getPreferences` allows snaps to access user preferences.
23
+ *
24
+ * @param options - The specification builder options.
25
+ * @param options.allowedCaveats - The optional allowed caveats for the permission.
26
+ * @param options.methodHooks - The RPC method hooks needed by the method implementation.
27
+ * @returns The specification for the `snap_getPreferences` permission.
28
+ */
29
+ export declare const specificationBuilder: PermissionSpecificationBuilder<PermissionType.RestrictedMethod, SpecificationBuilderOptions, Specification>;
30
+ export declare const getPreferencesBuilder: Readonly<{
31
+ readonly targetName: "snap_getPreferences";
32
+ readonly specificationBuilder: PermissionSpecificationBuilder<PermissionType.RestrictedMethod, SpecificationBuilderOptions, {
33
+ permissionType: PermissionType.RestrictedMethod;
34
+ targetName: typeof methodName;
35
+ methodImplementation: ReturnType<typeof getImplementation>;
36
+ allowedCaveats: Readonly<NonEmptyArray<string>> | null;
37
+ }>;
38
+ readonly methodHooks: MethodHooksObject<GetPreferencesMethodHooks>;
39
+ }>;
40
+ /**
41
+ * Builds the method implementation for `snap_getPreferences`.
42
+ *
43
+ * @param hooks - The RPC method hooks.
44
+ * @param hooks.getPreferences - A function that returns the user selected preferences.
45
+ * @returns The user preferences.
46
+ */
47
+ export declare function getImplementation({ getPreferences, }: GetPreferencesMethodHooks): (_args: RestrictedMethodOptions<RestrictedMethodParameters>) => Promise<GetPreferencesResult>;
48
+ export {};
49
+ //# sourceMappingURL=getPreferences.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getPreferences.d.mts","sourceRoot":"","sources":["../../src/restricted/getPreferences.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,8BAA8B,EAC9B,4BAA4B,EAC5B,uBAAuB,EACvB,0BAA0B,EAC3B,wCAAwC;AACzC,OAAO,EAAE,cAAc,EAAe,wCAAwC;AAC9E,OAAO,KAAK,EAAE,oBAAoB,EAAE,4BAA4B;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,wBAAwB;AAErD,OAAO,KAAK,EAAE,iBAAiB,EAAE,qBAAiB;AAElD,QAAA,MAAM,UAAU,wBAAwB,CAAC;AAEzC,MAAM,MAAM,yBAAyB,GAAG;IACtC,cAAc,EAAE,MAAM,oBAAoB,CAAC;CAC5C,CAAC;AAEF,KAAK,2BAA2B,GAAG;IACjC,cAAc,CAAC,EAAE,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC;IACxD,WAAW,EAAE,yBAAyB,CAAC;CACxC,CAAC;AAEF,KAAK,aAAa,GAAG,4BAA4B,CAAC;IAChD,cAAc,EAAE,cAAc,CAAC,gBAAgB,CAAC;IAChD,UAAU,EAAE,OAAO,UAAU,CAAC;IAC9B,oBAAoB,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;IAC3D,cAAc,EAAE,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC;CACxD,CAAC,CAAC;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,EAAE,8BAA8B,CAC/D,cAAc,CAAC,gBAAgB,EAC/B,2BAA2B,EAC3B,aAAa,CASd,CAAC;AAMF,eAAO,MAAM,qBAAqB;;;wBAjChB,eAAe,gBAAgB;oBACnC,iBAAiB;8BACP,WAAW,wBAAwB,CAAC;wBAC1C,SAAS,cAAc,MAAM,CAAC,CAAC,GAAG,IAAI;;;EAkC7C,CAAC;AAEZ;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,cAAc,GACf,EAAE,yBAAyB,WAEjB,wBAAwB,0BAA0B,CAAC,KACzD,QAAQ,oBAAoB,CAAC,CAGjC"}
@@ -1,11 +1,41 @@
1
- import {
2
- getImplementation,
3
- getPreferencesBuilder,
4
- specificationBuilder
5
- } from "../chunk-FM4LNQR7.mjs";
6
- export {
7
- getImplementation,
8
- getPreferencesBuilder,
9
- specificationBuilder
1
+ import { PermissionType, SubjectType } from "@metamask/permission-controller";
2
+ const methodName = 'snap_getPreferences';
3
+ /**
4
+ * The specification builder for the `snap_getPreferences` permission.
5
+ * `snap_getPreferences` allows snaps to access user preferences.
6
+ *
7
+ * @param options - The specification builder options.
8
+ * @param options.allowedCaveats - The optional allowed caveats for the permission.
9
+ * @param options.methodHooks - The RPC method hooks needed by the method implementation.
10
+ * @returns The specification for the `snap_getPreferences` permission.
11
+ */
12
+ export const specificationBuilder = ({ allowedCaveats = null, methodHooks }) => {
13
+ return {
14
+ permissionType: PermissionType.RestrictedMethod,
15
+ targetName: methodName,
16
+ allowedCaveats,
17
+ methodImplementation: getImplementation(methodHooks),
18
+ subjectTypes: [SubjectType.Snap],
19
+ };
10
20
  };
21
+ const methodHooks = {
22
+ getPreferences: true,
23
+ };
24
+ export const getPreferencesBuilder = Object.freeze({
25
+ targetName: methodName,
26
+ specificationBuilder,
27
+ methodHooks,
28
+ });
29
+ /**
30
+ * Builds the method implementation for `snap_getPreferences`.
31
+ *
32
+ * @param hooks - The RPC method hooks.
33
+ * @param hooks.getPreferences - A function that returns the user selected preferences.
34
+ * @returns The user preferences.
35
+ */
36
+ export function getImplementation({ getPreferences, }) {
37
+ return async function implementation(_args) {
38
+ return getPreferences();
39
+ };
40
+ }
11
41
  //# sourceMappingURL=getPreferences.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"file":"getPreferences.mjs","sourceRoot":"","sources":["../../src/restricted/getPreferences.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,wCAAwC;AAM9E,MAAM,UAAU,GAAG,qBAAqB,CAAC;AAkBzC;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAI7B,CAAC,EAAE,cAAc,GAAG,IAAI,EAAE,WAAW,EAA+B,EAAE,EAAE;IAC1E,OAAO;QACL,cAAc,EAAE,cAAc,CAAC,gBAAgB;QAC/C,UAAU,EAAE,UAAU;QACtB,cAAc;QACd,oBAAoB,EAAE,iBAAiB,CAAC,WAAW,CAAC;QACpD,YAAY,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC;KACjC,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,WAAW,GAAiD;IAChE,cAAc,EAAE,IAAI;CACrB,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,CAAC;IACjD,UAAU,EAAE,UAAU;IACtB,oBAAoB;IACpB,WAAW;CACH,CAAC,CAAC;AAEZ;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,EAChC,cAAc,GACY;IAC1B,OAAO,KAAK,UAAU,cAAc,CAClC,KAA0D;QAE1D,OAAO,cAAc,EAAE,CAAC;IAC1B,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import type {\n PermissionSpecificationBuilder,\n ValidPermissionSpecification,\n RestrictedMethodOptions,\n RestrictedMethodParameters,\n} from '@metamask/permission-controller';\nimport { PermissionType, SubjectType } from '@metamask/permission-controller';\nimport type { GetPreferencesResult } from '@metamask/snaps-sdk';\nimport type { NonEmptyArray } from '@metamask/utils';\n\nimport type { MethodHooksObject } from '../utils';\n\nconst methodName = 'snap_getPreferences';\n\nexport type GetPreferencesMethodHooks = {\n getPreferences: () => GetPreferencesResult;\n};\n\ntype SpecificationBuilderOptions = {\n allowedCaveats?: Readonly<NonEmptyArray<string>> | null;\n methodHooks: GetPreferencesMethodHooks;\n};\n\ntype Specification = ValidPermissionSpecification<{\n permissionType: PermissionType.RestrictedMethod;\n targetName: typeof methodName;\n methodImplementation: ReturnType<typeof getImplementation>;\n allowedCaveats: Readonly<NonEmptyArray<string>> | null;\n}>;\n\n/**\n * The specification builder for the `snap_getPreferences` permission.\n * `snap_getPreferences` allows snaps to access user preferences.\n *\n * @param options - The specification builder options.\n * @param options.allowedCaveats - The optional allowed caveats for the permission.\n * @param options.methodHooks - The RPC method hooks needed by the method implementation.\n * @returns The specification for the `snap_getPreferences` permission.\n */\nexport const specificationBuilder: PermissionSpecificationBuilder<\n PermissionType.RestrictedMethod,\n SpecificationBuilderOptions,\n Specification\n> = ({ allowedCaveats = null, methodHooks }: SpecificationBuilderOptions) => {\n return {\n permissionType: PermissionType.RestrictedMethod,\n targetName: methodName,\n allowedCaveats,\n methodImplementation: getImplementation(methodHooks),\n subjectTypes: [SubjectType.Snap],\n };\n};\n\nconst methodHooks: MethodHooksObject<GetPreferencesMethodHooks> = {\n getPreferences: true,\n};\n\nexport const getPreferencesBuilder = Object.freeze({\n targetName: methodName,\n specificationBuilder,\n methodHooks,\n} as const);\n\n/**\n * Builds the method implementation for `snap_getPreferences`.\n *\n * @param hooks - The RPC method hooks.\n * @param hooks.getPreferences - A function that returns the user selected preferences.\n * @returns The user preferences.\n */\nexport function getImplementation({\n getPreferences,\n}: GetPreferencesMethodHooks) {\n return async function implementation(\n _args: RestrictedMethodOptions<RestrictedMethodParameters>,\n ): Promise<GetPreferencesResult> {\n return getPreferences();\n };\n}\n"]}
@@ -0,0 +1,49 @@
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
+ exports.DIALOG_APPROVAL_TYPES = exports.restrictedMethodPermissionBuilders = exports.getEncryptionEntropy = exports.WALLET_SNAP_PERMISSION_KEY = void 0;
18
+ const dialog_1 = require("./dialog.cjs");
19
+ const getBip32Entropy_1 = require("./getBip32Entropy.cjs");
20
+ const getBip32PublicKey_1 = require("./getBip32PublicKey.cjs");
21
+ const getBip44Entropy_1 = require("./getBip44Entropy.cjs");
22
+ const getEntropy_1 = require("./getEntropy.cjs");
23
+ const getLocale_1 = require("./getLocale.cjs");
24
+ const getPreferences_1 = require("./getPreferences.cjs");
25
+ const invokeSnap_1 = require("./invokeSnap.cjs");
26
+ const manageAccounts_1 = require("./manageAccounts.cjs");
27
+ const manageState_1 = require("./manageState.cjs");
28
+ const notify_1 = require("./notify.cjs");
29
+ var invokeSnap_2 = require("./invokeSnap.cjs");
30
+ Object.defineProperty(exports, "WALLET_SNAP_PERMISSION_KEY", { enumerable: true, get: function () { return invokeSnap_2.WALLET_SNAP_PERMISSION_KEY; } });
31
+ var manageState_2 = require("./manageState.cjs");
32
+ Object.defineProperty(exports, "getEncryptionEntropy", { enumerable: true, get: function () { return manageState_2.getEncryptionEntropy; } });
33
+ exports.restrictedMethodPermissionBuilders = {
34
+ [dialog_1.dialogBuilder.targetName]: dialog_1.dialogBuilder,
35
+ [getBip32Entropy_1.getBip32EntropyBuilder.targetName]: getBip32Entropy_1.getBip32EntropyBuilder,
36
+ [getBip32PublicKey_1.getBip32PublicKeyBuilder.targetName]: getBip32PublicKey_1.getBip32PublicKeyBuilder,
37
+ [getBip44Entropy_1.getBip44EntropyBuilder.targetName]: getBip44Entropy_1.getBip44EntropyBuilder,
38
+ [getEntropy_1.getEntropyBuilder.targetName]: getEntropy_1.getEntropyBuilder,
39
+ [invokeSnap_1.invokeSnapBuilder.targetName]: invokeSnap_1.invokeSnapBuilder,
40
+ [manageState_1.manageStateBuilder.targetName]: manageState_1.manageStateBuilder,
41
+ [notify_1.notifyBuilder.targetName]: notify_1.notifyBuilder,
42
+ [manageAccounts_1.manageAccountsBuilder.targetName]: manageAccounts_1.manageAccountsBuilder,
43
+ [getLocale_1.getLocaleBuilder.targetName]: getLocale_1.getLocaleBuilder,
44
+ [getPreferences_1.getPreferencesBuilder.targetName]: getPreferences_1.getPreferencesBuilder,
45
+ };
46
+ __exportStar(require("./caveats/index.cjs"), exports);
47
+ var dialog_2 = require("./dialog.cjs");
48
+ Object.defineProperty(exports, "DIALOG_APPROVAL_TYPES", { enumerable: true, get: function () { return dialog_2.DIALOG_APPROVAL_TYPES; } });
49
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/restricted/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,yCAAyC;AAEzC,2DAA2D;AAE3D,+DAA+D;AAE/D,2DAA2D;AAE3D,iDAAiD;AAEjD,+CAA+C;AAE/C,yDAAyD;AAEzD,iDAAiD;AAEjD,yDAAyD;AAEzD,mDAAmD;AAEnD,yCAAyC;AAEzC,+CAA0D;AAAjD,wHAAA,0BAA0B,OAAA;AACnC,iDAAqD;AAA5C,mHAAA,oBAAoB,OAAA;AAchB,QAAA,kCAAkC,GAAG;IAChD,CAAC,sBAAa,CAAC,UAAU,CAAC,EAAE,sBAAa;IACzC,CAAC,wCAAsB,CAAC,UAAU,CAAC,EAAE,wCAAsB;IAC3D,CAAC,4CAAwB,CAAC,UAAU,CAAC,EAAE,4CAAwB;IAC/D,CAAC,wCAAsB,CAAC,UAAU,CAAC,EAAE,wCAAsB;IAC3D,CAAC,8BAAiB,CAAC,UAAU,CAAC,EAAE,8BAAiB;IACjD,CAAC,8BAAiB,CAAC,UAAU,CAAC,EAAE,8BAAiB;IACjD,CAAC,gCAAkB,CAAC,UAAU,CAAC,EAAE,gCAAkB;IACnD,CAAC,sBAAa,CAAC,UAAU,CAAC,EAAE,sBAAa;IACzC,CAAC,sCAAqB,CAAC,UAAU,CAAC,EAAE,sCAAqB;IACzD,CAAC,4BAAgB,CAAC,UAAU,CAAC,EAAE,4BAAgB;IAC/C,CAAC,sCAAqB,CAAC,UAAU,CAAC,EAAE,sCAAqB;CACjD,CAAC;AAEX,sDAA0B;AAE1B,uCAAiD;AAAxC,+GAAA,qBAAqB,OAAA","sourcesContent":["import type { DialogMethodHooks } from './dialog';\nimport { dialogBuilder } from './dialog';\nimport type { GetBip32EntropyMethodHooks } from './getBip32Entropy';\nimport { getBip32EntropyBuilder } from './getBip32Entropy';\nimport type { GetBip32PublicKeyMethodHooks } from './getBip32PublicKey';\nimport { getBip32PublicKeyBuilder } from './getBip32PublicKey';\nimport type { GetBip44EntropyMethodHooks } from './getBip44Entropy';\nimport { getBip44EntropyBuilder } from './getBip44Entropy';\nimport type { GetEntropyHooks } from './getEntropy';\nimport { getEntropyBuilder } from './getEntropy';\nimport type { GetLocaleMethodHooks } from './getLocale';\nimport { getLocaleBuilder } from './getLocale';\nimport type { GetPreferencesMethodHooks } from './getPreferences';\nimport { getPreferencesBuilder } from './getPreferences';\nimport type { InvokeSnapMethodHooks } from './invokeSnap';\nimport { invokeSnapBuilder } from './invokeSnap';\nimport type { ManageAccountsMethodHooks } from './manageAccounts';\nimport { manageAccountsBuilder } from './manageAccounts';\nimport type { ManageStateMethodHooks } from './manageState';\nimport { manageStateBuilder } from './manageState';\nimport type { NotifyMethodHooks } from './notify';\nimport { notifyBuilder } from './notify';\n\nexport { WALLET_SNAP_PERMISSION_KEY } from './invokeSnap';\nexport { getEncryptionEntropy } from './manageState';\n\nexport type RestrictedMethodHooks = DialogMethodHooks &\n GetBip32EntropyMethodHooks &\n GetBip32PublicKeyMethodHooks &\n GetBip44EntropyMethodHooks &\n GetEntropyHooks &\n InvokeSnapMethodHooks &\n ManageStateMethodHooks &\n NotifyMethodHooks &\n ManageAccountsMethodHooks &\n GetLocaleMethodHooks &\n GetPreferencesMethodHooks;\n\nexport const restrictedMethodPermissionBuilders = {\n [dialogBuilder.targetName]: dialogBuilder,\n [getBip32EntropyBuilder.targetName]: getBip32EntropyBuilder,\n [getBip32PublicKeyBuilder.targetName]: getBip32PublicKeyBuilder,\n [getBip44EntropyBuilder.targetName]: getBip44EntropyBuilder,\n [getEntropyBuilder.targetName]: getEntropyBuilder,\n [invokeSnapBuilder.targetName]: invokeSnapBuilder,\n [manageStateBuilder.targetName]: manageStateBuilder,\n [notifyBuilder.targetName]: notifyBuilder,\n [manageAccountsBuilder.targetName]: manageAccountsBuilder,\n [getLocaleBuilder.targetName]: getLocaleBuilder,\n [getPreferencesBuilder.targetName]: getPreferencesBuilder,\n} as const;\n\nexport * from './caveats';\nexport type { DialogApprovalTypes } from './dialog';\nexport { DIALOG_APPROVAL_TYPES } from './dialog';\n"]}
@@ -1,16 +1,16 @@
1
- import type { DialogMethodHooks } from './dialog';
2
- import type { GetBip32EntropyMethodHooks } from './getBip32Entropy';
3
- import type { GetBip32PublicKeyMethodHooks } from './getBip32PublicKey';
4
- import type { GetBip44EntropyMethodHooks } from './getBip44Entropy';
5
- import type { GetEntropyHooks } from './getEntropy';
6
- import type { GetLocaleMethodHooks } from './getLocale';
7
- import type { GetPreferencesMethodHooks } from './getPreferences';
8
- import type { InvokeSnapMethodHooks } from './invokeSnap';
9
- import type { ManageAccountsMethodHooks } from './manageAccounts';
10
- import type { ManageStateMethodHooks } from './manageState';
11
- import type { NotifyMethodHooks } from './notify';
12
- export { WALLET_SNAP_PERMISSION_KEY } from './invokeSnap';
13
- export { getEncryptionEntropy } from './manageState';
1
+ import type { DialogMethodHooks } from "./dialog.cjs";
2
+ import type { GetBip32EntropyMethodHooks } from "./getBip32Entropy.cjs";
3
+ import type { GetBip32PublicKeyMethodHooks } from "./getBip32PublicKey.cjs";
4
+ import type { GetBip44EntropyMethodHooks } from "./getBip44Entropy.cjs";
5
+ import type { GetEntropyHooks } from "./getEntropy.cjs";
6
+ import type { GetLocaleMethodHooks } from "./getLocale.cjs";
7
+ import type { GetPreferencesMethodHooks } from "./getPreferences.cjs";
8
+ import type { InvokeSnapMethodHooks } from "./invokeSnap.cjs";
9
+ import type { ManageAccountsMethodHooks } from "./manageAccounts.cjs";
10
+ import type { ManageStateMethodHooks } from "./manageState.cjs";
11
+ import type { NotifyMethodHooks } from "./notify.cjs";
12
+ export { WALLET_SNAP_PERMISSION_KEY } from "./invokeSnap.cjs";
13
+ export { getEncryptionEntropy } from "./manageState.cjs";
14
14
  export type RestrictedMethodHooks = DialogMethodHooks & GetBip32EntropyMethodHooks & GetBip32PublicKeyMethodHooks & GetBip44EntropyMethodHooks & GetEntropyHooks & InvokeSnapMethodHooks & ManageStateMethodHooks & NotifyMethodHooks & ManageAccountsMethodHooks & GetLocaleMethodHooks & GetPreferencesMethodHooks;
15
15
  export declare const restrictedMethodPermissionBuilders: {
16
16
  readonly snap_dialog: Readonly<{
@@ -163,6 +163,7 @@ export declare const restrictedMethodPermissionBuilders: {
163
163
  readonly methodHooks: import("../utils").MethodHooksObject<GetPreferencesMethodHooks>;
164
164
  }>;
165
165
  };
166
- export * from './caveats';
167
- export type { DialogApprovalTypes } from './dialog';
168
- export { DIALOG_APPROVAL_TYPES } from './dialog';
166
+ export * from "./caveats/index.cjs";
167
+ export type { DialogApprovalTypes } from "./dialog.cjs";
168
+ export { DIALOG_APPROVAL_TYPES } from "./dialog.cjs";
169
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/restricted/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,qBAAiB;AAElD,OAAO,KAAK,EAAE,0BAA0B,EAAE,8BAA0B;AAEpE,OAAO,KAAK,EAAE,4BAA4B,EAAE,gCAA4B;AAExE,OAAO,KAAK,EAAE,0BAA0B,EAAE,8BAA0B;AAEpE,OAAO,KAAK,EAAE,eAAe,EAAE,yBAAqB;AAEpD,OAAO,KAAK,EAAE,oBAAoB,EAAE,wBAAoB;AAExD,OAAO,KAAK,EAAE,yBAAyB,EAAE,6BAAyB;AAElE,OAAO,KAAK,EAAE,qBAAqB,EAAE,yBAAqB;AAE1D,OAAO,KAAK,EAAE,yBAAyB,EAAE,6BAAyB;AAElE,OAAO,KAAK,EAAE,sBAAsB,EAAE,0BAAsB;AAE5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,qBAAiB;AAGlD,OAAO,EAAE,0BAA0B,EAAE,yBAAqB;AAC1D,OAAO,EAAE,oBAAoB,EAAE,0BAAsB;AAErD,MAAM,MAAM,qBAAqB,GAAG,iBAAiB,GACnD,0BAA0B,GAC1B,4BAA4B,GAC5B,0BAA0B,GAC1B,eAAe,GACf,qBAAqB,GACrB,sBAAsB,GACtB,iBAAiB,GACjB,yBAAyB,GACzB,oBAAoB,GACpB,yBAAyB,CAAC;AAE5B,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAYrC,CAAC;AAEX,oCAA0B;AAC1B,YAAY,EAAE,mBAAmB,EAAE,qBAAiB;AACpD,OAAO,EAAE,qBAAqB,EAAE,qBAAiB"}