@metamask/keyring-api 10.1.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 (360) hide show
  1. package/CHANGELOG.md +16 -1
  2. package/dist/{JsonRpcRequest.js → JsonRpcRequest.cjs} +2 -2
  3. package/dist/JsonRpcRequest.cjs.map +1 -0
  4. package/dist/{JsonRpcRequest.d.ts → JsonRpcRequest.d.cts} +3 -2
  5. package/dist/JsonRpcRequest.d.cts.map +1 -0
  6. package/dist/JsonRpcRequest.d.mts +17 -0
  7. package/dist/JsonRpcRequest.d.mts.map +1 -0
  8. package/dist/JsonRpcRequest.mjs +10 -0
  9. package/dist/JsonRpcRequest.mjs.map +1 -0
  10. package/dist/{KeyringClient.js → KeyringClient.cjs} +10 -4
  11. package/dist/KeyringClient.cjs.map +1 -0
  12. package/dist/{KeyringClient.d.ts → KeyringClient.d.cts} +6 -3
  13. package/dist/KeyringClient.d.cts.map +1 -0
  14. package/dist/KeyringClient.d.mts +31 -0
  15. package/dist/KeyringClient.d.mts.map +1 -0
  16. package/dist/KeyringClient.mjs +126 -0
  17. package/dist/KeyringClient.mjs.map +1 -0
  18. package/dist/{KeyringSnapRpcClient.js → KeyringSnapRpcClient.cjs} +2 -2
  19. package/dist/KeyringSnapRpcClient.cjs.map +1 -0
  20. package/dist/{KeyringSnapRpcClient.d.ts → KeyringSnapRpcClient.d.cts} +6 -5
  21. package/dist/KeyringSnapRpcClient.d.cts.map +1 -0
  22. package/dist/KeyringSnapRpcClient.d.mts +40 -0
  23. package/dist/KeyringSnapRpcClient.d.mts.map +1 -0
  24. package/dist/KeyringSnapRpcClient.mjs +63 -0
  25. package/dist/KeyringSnapRpcClient.mjs.map +1 -0
  26. package/dist/api/{account.js → account.cjs} +3 -3
  27. package/dist/api/account.cjs.map +1 -0
  28. package/dist/api/{account.d.ts → account.d.cts} +2 -1
  29. package/dist/api/account.d.cts.map +1 -0
  30. package/dist/api/account.d.mts +70 -0
  31. package/dist/api/account.d.mts.map +1 -0
  32. package/dist/api/account.mjs +61 -0
  33. package/dist/api/account.mjs.map +1 -0
  34. package/dist/api/asset.cjs +83 -0
  35. package/dist/api/asset.cjs.map +1 -0
  36. package/dist/api/asset.d.cts +93 -0
  37. package/dist/api/asset.d.cts.map +1 -0
  38. package/dist/api/asset.d.mts +93 -0
  39. package/dist/api/asset.d.mts.map +1 -0
  40. package/dist/api/asset.mjs +80 -0
  41. package/dist/api/asset.mjs.map +1 -0
  42. package/dist/api/{balance.js → balance.cjs} +3 -3
  43. package/dist/api/balance.cjs.map +1 -0
  44. package/dist/api/{balance.d.ts → balance.d.cts} +3 -2
  45. package/dist/api/balance.d.cts.map +1 -0
  46. package/dist/api/balance.d.mts +10 -0
  47. package/dist/api/balance.d.mts.map +1 -0
  48. package/dist/api/balance.mjs +8 -0
  49. package/dist/api/balance.mjs.map +1 -0
  50. package/dist/api/{caip.js → caip.cjs} +5 -5
  51. package/dist/api/caip.cjs.map +1 -0
  52. package/dist/api/{caip.d.ts → caip.d.cts} +2 -1
  53. package/dist/api/caip.d.cts.map +1 -0
  54. package/dist/api/caip.d.mts +38 -0
  55. package/dist/api/caip.d.mts.map +1 -0
  56. package/dist/api/caip.mjs +43 -0
  57. package/dist/api/caip.mjs.map +1 -0
  58. package/dist/api/{export.js → export.cjs} +1 -1
  59. package/dist/api/export.cjs.map +1 -0
  60. package/dist/api/{export.d.ts → export.d.cts} +2 -1
  61. package/dist/api/export.d.cts.map +1 -0
  62. package/dist/api/export.d.mts +9 -0
  63. package/dist/api/export.d.mts.map +1 -0
  64. package/dist/api/export.mjs +4 -0
  65. package/dist/api/export.mjs.map +1 -0
  66. package/dist/api/{index.js → index.cjs} +9 -7
  67. package/dist/api/index.cjs.map +1 -0
  68. package/dist/api/index.d.cts +10 -0
  69. package/dist/api/index.d.cts.map +1 -0
  70. package/dist/api/index.d.mts +10 -0
  71. package/dist/api/index.d.mts.map +1 -0
  72. package/dist/api/index.mjs +9 -0
  73. package/dist/api/index.mjs.map +1 -0
  74. package/dist/api/{keyring.js → keyring.cjs} +1 -1
  75. package/dist/api/keyring.cjs.map +1 -0
  76. package/dist/api/{keyring.d.ts → keyring.d.cts} +22 -7
  77. package/dist/api/keyring.d.cts.map +1 -0
  78. package/dist/api/keyring.d.mts +174 -0
  79. package/dist/api/keyring.d.mts.map +1 -0
  80. package/dist/api/keyring.mjs +2 -0
  81. package/dist/api/keyring.mjs.map +1 -0
  82. package/dist/api/{request.js → request.cjs} +3 -3
  83. package/dist/api/request.cjs.map +1 -0
  84. package/dist/api/{request.d.ts → request.d.cts} +3 -2
  85. package/dist/api/request.d.cts.map +1 -0
  86. package/dist/api/request.d.mts +40 -0
  87. package/dist/api/request.d.mts.map +1 -0
  88. package/dist/api/request.mjs +26 -0
  89. package/dist/api/request.mjs.map +1 -0
  90. package/dist/api/{response.js → response.cjs} +2 -2
  91. package/dist/api/response.cjs.map +1 -0
  92. package/dist/api/{response.d.ts → response.d.cts} +2 -1
  93. package/dist/api/response.d.cts.map +1 -0
  94. package/dist/api/response.d.mts +25 -0
  95. package/dist/api/response.d.mts.map +1 -0
  96. package/dist/api/response.mjs +41 -0
  97. package/dist/api/response.mjs.map +1 -0
  98. package/dist/api/transaction.cjs +295 -0
  99. package/dist/api/transaction.cjs.map +1 -0
  100. package/dist/api/transaction.d.cts +773 -0
  101. package/dist/api/transaction.d.cts.map +1 -0
  102. package/dist/api/transaction.d.mts +773 -0
  103. package/dist/api/transaction.d.mts.map +1 -0
  104. package/dist/api/transaction.mjs +292 -0
  105. package/dist/api/transaction.mjs.map +1 -0
  106. package/dist/{eth/erc4337/index.js → btc/index.cjs} +2 -2
  107. package/dist/btc/index.cjs.map +1 -0
  108. package/dist/btc/index.d.cts +2 -0
  109. package/dist/btc/index.d.cts.map +1 -0
  110. package/dist/btc/index.d.mts +2 -0
  111. package/dist/btc/index.d.mts.map +1 -0
  112. package/dist/btc/index.mjs +2 -0
  113. package/dist/btc/index.mjs.map +1 -0
  114. package/dist/btc/{types.js → types.cjs} +3 -3
  115. package/dist/btc/types.cjs.map +1 -0
  116. package/dist/btc/{types.d.ts → types.d.cts} +2 -1
  117. package/dist/btc/types.d.cts.map +1 -0
  118. package/dist/btc/types.d.mts +34 -0
  119. package/dist/btc/types.d.mts.map +1 -0
  120. package/dist/btc/types.mjs +37 -0
  121. package/dist/btc/types.mjs.map +1 -0
  122. package/dist/{contexts.js → contexts.cjs} +1 -1
  123. package/dist/contexts.cjs.map +1 -0
  124. package/dist/{contexts.d.ts → contexts.d.cts} +1 -0
  125. package/dist/contexts.d.cts.map +1 -0
  126. package/dist/contexts.d.mts +8 -0
  127. package/dist/contexts.d.mts.map +1 -0
  128. package/dist/contexts.mjs +2 -0
  129. package/dist/contexts.mjs.map +1 -0
  130. package/dist/{sol/index.js → eth/erc4337/index.cjs} +2 -2
  131. package/dist/eth/erc4337/index.cjs.map +1 -0
  132. package/dist/eth/erc4337/index.d.cts +2 -0
  133. package/dist/eth/erc4337/index.d.cts.map +1 -0
  134. package/dist/eth/erc4337/index.d.mts +2 -0
  135. package/dist/eth/erc4337/index.d.mts.map +1 -0
  136. package/dist/eth/erc4337/index.mjs +2 -0
  137. package/dist/eth/erc4337/index.mjs.map +1 -0
  138. package/dist/eth/erc4337/{types.js → types.cjs} +4 -4
  139. package/dist/eth/erc4337/types.cjs.map +1 -0
  140. package/dist/eth/erc4337/{types.d.ts → types.d.cts} +7 -6
  141. package/dist/eth/erc4337/types.d.cts.map +1 -0
  142. package/dist/eth/erc4337/types.d.mts +98 -0
  143. package/dist/eth/erc4337/types.d.mts.map +1 -0
  144. package/dist/eth/erc4337/types.mjs +59 -0
  145. package/dist/eth/erc4337/types.mjs.map +1 -0
  146. package/dist/eth/index.cjs +20 -0
  147. package/dist/eth/index.cjs.map +1 -0
  148. package/dist/eth/index.d.cts +4 -0
  149. package/dist/eth/index.d.cts.map +1 -0
  150. package/dist/eth/index.d.mts +4 -0
  151. package/dist/eth/index.d.mts.map +1 -0
  152. package/dist/eth/index.mjs +4 -0
  153. package/dist/eth/index.mjs.map +1 -0
  154. package/dist/eth/{types.js → types.cjs} +3 -3
  155. package/dist/eth/types.cjs.map +1 -0
  156. package/dist/eth/{types.d.ts → types.d.cts} +2 -1
  157. package/dist/eth/types.d.cts.map +1 -0
  158. package/dist/eth/types.d.mts +81 -0
  159. package/dist/eth/types.d.mts.map +1 -0
  160. package/dist/eth/types.mjs +70 -0
  161. package/dist/eth/types.mjs.map +1 -0
  162. package/dist/eth/{utils.js → utils.cjs} +3 -4
  163. package/dist/eth/{utils.js.map → utils.cjs.map} +1 -1
  164. package/dist/eth/{utils.d.ts → utils.d.cts} +2 -1
  165. package/dist/eth/utils.d.cts.map +1 -0
  166. package/dist/eth/utils.d.mts +9 -0
  167. package/dist/eth/utils.d.mts.map +1 -0
  168. package/dist/eth/utils.mjs +11 -0
  169. package/dist/eth/utils.mjs.map +1 -0
  170. package/dist/{events.js → events.cjs} +1 -1
  171. package/dist/events.cjs.map +1 -0
  172. package/dist/{events.d.ts → events.d.cts} +1 -0
  173. package/dist/events.d.cts.map +1 -0
  174. package/dist/events.d.mts +11 -0
  175. package/dist/events.d.mts.map +1 -0
  176. package/dist/events.mjs +14 -0
  177. package/dist/events.mjs.map +1 -0
  178. package/dist/index.cjs +29 -0
  179. package/dist/index.cjs.map +1 -0
  180. package/dist/index.d.cts +14 -0
  181. package/dist/index.d.cts.map +1 -0
  182. package/dist/index.d.mts +14 -0
  183. package/dist/index.d.mts.map +1 -0
  184. package/dist/index.mjs +13 -0
  185. package/dist/index.mjs.map +1 -0
  186. package/dist/internal/{api.js → api.cjs} +17 -6
  187. package/dist/internal/api.cjs.map +1 -0
  188. package/dist/internal/{api.d.ts → api.d.cts} +323 -5
  189. package/dist/internal/api.d.cts.map +1 -0
  190. package/dist/internal/api.d.mts +737 -0
  191. package/dist/internal/api.d.mts.map +1 -0
  192. package/dist/internal/api.mjs +147 -0
  193. package/dist/internal/api.mjs.map +1 -0
  194. package/dist/internal/eth/{EthKeyring.js → EthKeyring.cjs} +1 -1
  195. package/dist/internal/eth/EthKeyring.cjs.map +1 -0
  196. package/dist/internal/eth/{EthKeyring.d.ts → EthKeyring.d.cts} +4 -3
  197. package/dist/internal/eth/EthKeyring.d.cts.map +1 -0
  198. package/dist/internal/eth/EthKeyring.d.mts +34 -0
  199. package/dist/internal/eth/EthKeyring.d.mts.map +1 -0
  200. package/dist/internal/eth/EthKeyring.mjs +2 -0
  201. package/dist/internal/eth/EthKeyring.mjs.map +1 -0
  202. package/dist/internal/eth/{index.js → index.cjs} +1 -1
  203. package/dist/internal/eth/index.cjs.map +1 -0
  204. package/dist/internal/eth/index.d.cts +2 -0
  205. package/dist/internal/eth/index.d.cts.map +1 -0
  206. package/dist/internal/eth/index.d.mts +2 -0
  207. package/dist/internal/eth/index.d.mts.map +1 -0
  208. package/dist/internal/eth/index.mjs +2 -0
  209. package/dist/internal/eth/index.mjs.map +1 -0
  210. package/dist/internal/{events.js → events.cjs} +5 -5
  211. package/dist/internal/events.cjs.map +1 -0
  212. package/dist/internal/{events.d.ts → events.d.cts} +3 -2
  213. package/dist/internal/events.d.cts.map +1 -0
  214. package/dist/internal/events.d.mts +162 -0
  215. package/dist/internal/events.d.mts.map +1 -0
  216. package/dist/internal/events.mjs +69 -0
  217. package/dist/internal/events.mjs.map +1 -0
  218. package/dist/internal/{index.js → index.cjs} +5 -5
  219. package/dist/internal/index.cjs.map +1 -0
  220. package/dist/internal/index.d.cts +6 -0
  221. package/dist/internal/index.d.cts.map +1 -0
  222. package/dist/internal/index.d.mts +6 -0
  223. package/dist/internal/index.d.mts.map +1 -0
  224. package/dist/internal/index.mjs +5 -0
  225. package/dist/internal/index.mjs.map +1 -0
  226. package/dist/internal/{rpc.js → rpc.cjs} +4 -3
  227. package/dist/internal/rpc.cjs.map +1 -0
  228. package/dist/internal/{rpc.d.ts → rpc.d.cts} +2 -0
  229. package/dist/internal/rpc.d.cts.map +1 -0
  230. package/dist/internal/rpc.d.mts +27 -0
  231. package/dist/internal/rpc.d.mts.map +1 -0
  232. package/dist/internal/rpc.mjs +30 -0
  233. package/dist/internal/rpc.mjs.map +1 -0
  234. package/dist/internal/{types.js → types.cjs} +6 -6
  235. package/dist/internal/types.cjs.map +1 -0
  236. package/dist/internal/{types.d.ts → types.d.cts} +21 -20
  237. package/dist/internal/types.d.cts.map +1 -0
  238. package/dist/internal/types.d.mts +392 -0
  239. package/dist/internal/types.d.mts.map +1 -0
  240. package/dist/internal/types.mjs +49 -0
  241. package/dist/internal/types.mjs.map +1 -0
  242. package/dist/{rpc-handler.js → rpc-handler.cjs} +13 -6
  243. package/dist/rpc-handler.cjs.map +1 -0
  244. package/dist/{rpc-handler.d.ts → rpc-handler.d.cts} +4 -3
  245. package/dist/rpc-handler.d.cts.map +1 -0
  246. package/dist/rpc-handler.d.mts +30 -0
  247. package/dist/rpc-handler.d.mts.map +1 -0
  248. package/dist/rpc-handler.mjs +138 -0
  249. package/dist/rpc-handler.mjs.map +1 -0
  250. package/dist/{snap-utils.js → snap-utils.cjs} +2 -3
  251. package/dist/snap-utils.cjs.map +1 -0
  252. package/dist/{snap-utils.d.ts → snap-utils.d.cts} +4 -3
  253. package/dist/snap-utils.d.cts.map +1 -0
  254. package/dist/snap-utils.d.mts +12 -0
  255. package/dist/snap-utils.d.mts.map +1 -0
  256. package/dist/snap-utils.mjs +17 -0
  257. package/dist/snap-utils.mjs.map +1 -0
  258. package/dist/{btc/index.js → sol/index.cjs} +2 -2
  259. package/dist/sol/index.cjs.map +1 -0
  260. package/dist/sol/index.d.cts +2 -0
  261. package/dist/sol/index.d.cts.map +1 -0
  262. package/dist/sol/index.d.mts +2 -0
  263. package/dist/sol/index.d.mts.map +1 -0
  264. package/dist/sol/index.mjs +2 -0
  265. package/dist/sol/index.mjs.map +1 -0
  266. package/dist/sol/{types.js → types.cjs} +3 -3
  267. package/dist/sol/types.cjs.map +1 -0
  268. package/dist/sol/{types.d.ts → types.d.cts} +2 -1
  269. package/dist/sol/types.d.cts.map +1 -0
  270. package/dist/sol/types.d.mts +39 -0
  271. package/dist/sol/types.d.mts.map +1 -0
  272. package/dist/sol/types.mjs +33 -0
  273. package/dist/sol/types.mjs.map +1 -0
  274. package/dist/{superstruct.js → superstruct.cjs} +34 -6
  275. package/dist/superstruct.cjs.map +1 -0
  276. package/dist/{superstruct.d.ts → superstruct.d.cts} +21 -2
  277. package/dist/superstruct.d.cts.map +1 -0
  278. package/dist/superstruct.d.mts +102 -0
  279. package/dist/superstruct.d.mts.map +1 -0
  280. package/dist/superstruct.mjs +102 -0
  281. package/dist/superstruct.mjs.map +1 -0
  282. package/dist/{eth/index.js → utils/index.cjs} +4 -4
  283. package/dist/utils/index.cjs.map +1 -0
  284. package/dist/utils/index.d.cts +4 -0
  285. package/dist/utils/index.d.cts.map +1 -0
  286. package/dist/utils/index.d.mts +4 -0
  287. package/dist/utils/index.d.mts.map +1 -0
  288. package/dist/utils/index.mjs +4 -0
  289. package/dist/utils/index.mjs.map +1 -0
  290. package/dist/utils/pagination.cjs +28 -0
  291. package/dist/utils/pagination.cjs.map +1 -0
  292. package/dist/utils/pagination.d.cts +59 -0
  293. package/dist/utils/pagination.d.cts.map +1 -0
  294. package/dist/utils/pagination.d.mts +59 -0
  295. package/dist/utils/pagination.d.mts.map +1 -0
  296. package/dist/utils/pagination.mjs +25 -0
  297. package/dist/utils/pagination.mjs.map +1 -0
  298. package/dist/utils/{types.js → types.cjs} +2 -2
  299. package/dist/utils/types.cjs.map +1 -0
  300. package/dist/utils/types.d.cts +42 -0
  301. package/dist/utils/types.d.cts.map +1 -0
  302. package/dist/utils/types.d.mts +42 -0
  303. package/dist/utils/types.d.mts.map +1 -0
  304. package/dist/utils/types.mjs +26 -0
  305. package/dist/utils/types.mjs.map +1 -0
  306. package/dist/utils/{typing.js → typing.cjs} +2 -3
  307. package/dist/utils/{typing.js.map → typing.cjs.map} +1 -1
  308. package/dist/utils/{typing.d.ts → typing.d.cts} +1 -0
  309. package/dist/utils/typing.d.cts.map +1 -0
  310. package/dist/utils/typing.d.mts +33 -0
  311. package/dist/utils/typing.d.mts.map +1 -0
  312. package/dist/utils/typing.mjs +17 -0
  313. package/dist/utils/typing.mjs.map +1 -0
  314. package/package.json +20 -9
  315. package/dist/JsonRpcRequest.js.map +0 -1
  316. package/dist/KeyringClient.js.map +0 -1
  317. package/dist/KeyringSnapRpcClient.js.map +0 -1
  318. package/dist/api/account.js.map +0 -1
  319. package/dist/api/balance.js.map +0 -1
  320. package/dist/api/caip.js.map +0 -1
  321. package/dist/api/export.js.map +0 -1
  322. package/dist/api/index.d.ts +0 -7
  323. package/dist/api/index.js.map +0 -1
  324. package/dist/api/keyring.js.map +0 -1
  325. package/dist/api/request.js.map +0 -1
  326. package/dist/api/response.js.map +0 -1
  327. package/dist/btc/index.d.ts +0 -1
  328. package/dist/btc/index.js.map +0 -1
  329. package/dist/btc/types.js.map +0 -1
  330. package/dist/contexts.js.map +0 -1
  331. package/dist/eth/erc4337/index.d.ts +0 -1
  332. package/dist/eth/erc4337/index.js.map +0 -1
  333. package/dist/eth/erc4337/types.js.map +0 -1
  334. package/dist/eth/index.d.ts +0 -3
  335. package/dist/eth/index.js.map +0 -1
  336. package/dist/eth/types.js.map +0 -1
  337. package/dist/events.js.map +0 -1
  338. package/dist/index.d.ts +0 -12
  339. package/dist/index.js +0 -28
  340. package/dist/index.js.map +0 -1
  341. package/dist/internal/api.js.map +0 -1
  342. package/dist/internal/eth/EthKeyring.js.map +0 -1
  343. package/dist/internal/eth/index.d.ts +0 -1
  344. package/dist/internal/eth/index.js.map +0 -1
  345. package/dist/internal/events.js.map +0 -1
  346. package/dist/internal/index.d.ts +0 -5
  347. package/dist/internal/index.js.map +0 -1
  348. package/dist/internal/rpc.js.map +0 -1
  349. package/dist/internal/types.js.map +0 -1
  350. package/dist/rpc-handler.js.map +0 -1
  351. package/dist/snap-utils.js.map +0 -1
  352. package/dist/sol/index.d.ts +0 -1
  353. package/dist/sol/index.js.map +0 -1
  354. package/dist/sol/types.js.map +0 -1
  355. package/dist/superstruct.js.map +0 -1
  356. package/dist/utils/index.d.ts +0 -2
  357. package/dist/utils/index.js +0 -19
  358. package/dist/utils/index.js.map +0 -1
  359. package/dist/utils/types.d.ts +0 -17
  360. package/dist/utils/types.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transaction.d.mts","sourceRoot":"","sources":["../../src/api/transaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAKnD,OAAO,KAAK,EAAE,WAAW,EAAE,2BAAuB;AAElD,OAAO,KAAK,EAAE,SAAS,EAAE,2BAAiB;AAkD1C;;GAEG;AACH,oBAAY,OAAO;IACjB;;;;;;OAMG;IACH,IAAI,SAAS;IAEb;;;;;OAKG;IACH,QAAQ,aAAa;CACtB;AAiBD;;GAEG;AACH,oBAAY,iBAAiB;IAC3B;;;OAGG;IACH,SAAS,cAAc;IAEvB;;;OAGG;IACH,WAAW,gBAAgB;IAE3B;;OAEG;IACH,SAAS,cAAc;IAEvB;;OAEG;IACH,MAAM,WAAW;CAClB;AAED;;GAEG;AACH,oBAAY,eAAe;IACzB;;;;OAIG;IACH,IAAI,SAAS;IAEb;;;OAGG;IACH,OAAO,YAAY;CACpB;AAED;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;IACjC;;OAEG;;;;;;;IAQH;;OAEG;;EAEH,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAC5B;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;IAQH;;;;OAIG;;IAGH;;;OAGG;;;;;IAGH;;OAEG;;;;;;;;;;;;;;;;;;;;;;;;QAnNH;;WAEG;;QAGH;;WAEG;;;;;;;;;;;IA+MH;;OAEG;;;;;;;;;;;;;;;;;;;;;;;;QAxNH;;WAEG;;QAGH;;WAEG;;;;;;;;;;;IAoNH;;OAEG;;;;;;;;;;;;;;;;;;;;;;;;QAxLH;;WAEG;;;;;QAGH;;WAEG;;;;;;;;;;;IAoLH;;;;;OAKG;;;;;;;;QApIH;;WAEG;;;;;;;QAQH;;WAEG;;;EA0HH,CAAC;AAEH;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IACjC;;OAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAnGH;;WAEG;;QAGH;;WAEG;;QAGH;;WAEG;;QAGH;;WAEG;;;;;;;QAQH;;;;WAIG;;QAGH;;;WAGG;;;;;QAGH;;WAEG;;;;;;;;;;;;;;;;;;;;;;;;YAnNH;;eAEG;;YAGH;;eAEG;;;;;;;;;;;QA+MH;;WAEG;;;;;;;;;;;;;;;;;;;;;;;;YAxNH;;eAEG;;YAGH;;eAEG;;;;;;;;;;;QAoNH;;WAEG;;;;;;;;;;;;;;;;;;;;;;;;YAxLH;;eAEG;;;;;YAGH;;eAEG;;;;;;;;;;;QAoLH;;;;;WAKG;;;;;;;;YApIH;;eAEG;;;;;;;YAQH;;eAEG;;;;IAoKH;;;OAGG;;EAEH,CAAC;AAEH;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,WAAW,CACxC,OAAO,sBAAsB,EAC7B,SAAS,CAAC,WAAW,CAAC,CACvB,CAAC"}
@@ -0,0 +1,292 @@
1
+ import { array, enums, nullable, number, string } from "@metamask/superstruct";
2
+ import { CaipChainIdStruct } from "@metamask/utils";
3
+ import { AssetStruct } from "./asset.mjs";
4
+ import { object } from "../superstruct.mjs";
5
+ import { UuidStruct } from "../utils/index.mjs";
6
+ /**
7
+ * This struct represents a participant in a transaction.
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * {
12
+ * address: '0x1234...',
13
+ * asset: {
14
+ * fungible: true,
15
+ * type: 'eip155:1/slip44:60',
16
+ * unit: 'ETH',
17
+ * amount: '0.01',
18
+ * },
19
+ * },
20
+ * ```
21
+ *
22
+ * @example
23
+ * ```ts
24
+ * {
25
+ * address: '0x1234...',
26
+ * asset: {
27
+ * fungible: false,
28
+ * id: 'eip155:1/erc721:0x06012c8cf97BEaD5deAe237070F9587f8E7A266d/771769',
29
+ * },
30
+ * },
31
+ * ```
32
+ *
33
+ * @example
34
+ * ```ts
35
+ * {
36
+ * address: '0x1234...',
37
+ * asset: null,
38
+ * },
39
+ * ```
40
+ */
41
+ const ParticipantStruct = object({
42
+ /**
43
+ * Participant address.
44
+ */
45
+ address: string(),
46
+ /**
47
+ * Asset being transferred.
48
+ */
49
+ asset: nullable(AssetStruct),
50
+ });
51
+ /**
52
+ * Fee types.
53
+ */
54
+ export var FeeType;
55
+ (function (FeeType) {
56
+ /**
57
+ * Base fee. It is the minimum fee required to include a transaction in the
58
+ * blockchain.
59
+ *
60
+ * For non-confirmed transactions, it must be the maximum base fee. For
61
+ * confirmed transactions, it must be the actual base fee paid.
62
+ */
63
+ FeeType["Base"] = "base";
64
+ /**
65
+ * Priority fee. It is an optional fee used to prioritize the transaction.
66
+ *
67
+ * For non-confirmed transactions, it must be the maximum priority fee. For
68
+ * confirmed transactions, it must be the actual priority fee paid.
69
+ */
70
+ FeeType["Priority"] = "priority";
71
+ })(FeeType || (FeeType = {}));
72
+ /**
73
+ * This struct represents a transaction fee.
74
+ */
75
+ const FeeStruct = object({
76
+ /**
77
+ * Fee type {@see FeeType}.
78
+ */
79
+ type: enums([`${FeeType.Base}`, `${FeeType.Priority}`]),
80
+ /**
81
+ * Asset used to pay for the fee.
82
+ */
83
+ asset: AssetStruct,
84
+ });
85
+ /**
86
+ * Transaction statuses.
87
+ */
88
+ export var TransactionStatus;
89
+ (function (TransactionStatus) {
90
+ /**
91
+ * The transaction has been submitted but is not yet in the
92
+ * blockchain. For example, it can be in the mempool.
93
+ */
94
+ TransactionStatus["Submitted"] = "submitted";
95
+ /**
96
+ * The transaction is in the blockchain but has not been
97
+ * confirmed yet.
98
+ */
99
+ TransactionStatus["Unconfirmed"] = "unconfirmed";
100
+ /**
101
+ * The transaction has been confirmed.
102
+ */
103
+ TransactionStatus["Confirmed"] = "confirmed";
104
+ /**
105
+ * The transaction has failed. For example, it has been reverted.
106
+ */
107
+ TransactionStatus["Failed"] = "failed";
108
+ })(TransactionStatus || (TransactionStatus = {}));
109
+ /**
110
+ * Transaction types.
111
+ */
112
+ export var TransactionType;
113
+ (function (TransactionType) {
114
+ /**
115
+ * The transaction was originated by the account. If the transaction
116
+ * has a change output that goes back to the same account, it must be tagged
117
+ * as a send transaction.
118
+ */
119
+ TransactionType["Send"] = "send";
120
+ /**
121
+ * The transaction was received by the account, but originated by
122
+ * another account.
123
+ */
124
+ TransactionType["Receive"] = "receive";
125
+ })(TransactionType || (TransactionType = {}));
126
+ /**
127
+ * This struct represents a transaction event.
128
+ */
129
+ export const TransactionEventStruct = object({
130
+ /**
131
+ * New status of the transaction.
132
+ */
133
+ status: enums([
134
+ `${TransactionStatus.Submitted}`,
135
+ `${TransactionStatus.Unconfirmed}`,
136
+ `${TransactionStatus.Confirmed}`,
137
+ `${TransactionStatus.Failed}`,
138
+ ]),
139
+ /**
140
+ * UNIX timestamp of when the event occurred.
141
+ */
142
+ timestamp: nullable(number()),
143
+ });
144
+ /**
145
+ * This struct represents a blockchain transaction.
146
+ *
147
+ * @example
148
+ * ```ts
149
+ * const tx = {
150
+ * id: 'f5d8ee39a430901c91a5917b9f2dc19d6d1a0e9cea205b009ca73dd04470b9a6',
151
+ * chain: 'bip122:000000000019d6689c085ae165831e93',
152
+ * account: 'b9beb861-9761-4b97-89ce-d992be5f34da',
153
+ * status: 'confirmed',
154
+ * timestamp: 1716367781,
155
+ * type: 'send',
156
+ * from: [
157
+ * {
158
+ * address: 'bc1qrp0yzgkf8rawkuvdlhnjfj2fnjwm0m8727kgah',
159
+ * asset: {
160
+ * fungible: true,
161
+ * type: 'bip122:000000000019d6689c085ae165831e93/slip44:0',
162
+ * unit: 'BTC',
163
+ * amount: '0.1',
164
+ * },
165
+ * },
166
+ * ],
167
+ * to: [
168
+ * {
169
+ * address: 'bc1qrp0yzgkf8rawkuvdlhnjfj2fnjwm0m8727kgah',
170
+ * asset: {
171
+ * fungible: true,
172
+ * type: 'bip122:000000000019d6689c085ae165831e93/slip44:0',
173
+ * unit: 'BTC',
174
+ * amount: '0.1',
175
+ * },
176
+ * },
177
+ * {
178
+ * address: 'bc1qwl8399fz829uqvqly9tcatgrgtwp3udnhxfq4k',
179
+ * asset: {
180
+ * fungible: true,
181
+ * type: 'bip122:000000000019d6689c085ae165831e93/slip44:0',
182
+ * unit: 'BTC',
183
+ * amount: '0.1',
184
+ * },
185
+ * },
186
+ * ],
187
+ * fees: [
188
+ * {
189
+ * type: 'priority',
190
+ * asset: {
191
+ * fungible: true,
192
+ * type: 'bip122:000000000019d6689c085ae165831e93/slip44:0',
193
+ * unit: 'BTC',
194
+ * amount: '0.1',
195
+ * },
196
+ * },
197
+ * ],
198
+ * };
199
+ * ```
200
+ */
201
+ export const TransactionStruct = object({
202
+ /**
203
+ * Chain-specific transaction ID.
204
+ */
205
+ id: string(),
206
+ /**
207
+ * Chain ID (CAIP-2).
208
+ */
209
+ chain: CaipChainIdStruct,
210
+ /**
211
+ * Account ID (UUIDv4).
212
+ */
213
+ account: UuidStruct,
214
+ /**
215
+ * Transaction status {@see TransactionStatus}.
216
+ */
217
+ status: enums([
218
+ `${TransactionStatus.Submitted}`,
219
+ `${TransactionStatus.Unconfirmed}`,
220
+ `${TransactionStatus.Confirmed}`,
221
+ `${TransactionStatus.Failed}`,
222
+ ]),
223
+ /**
224
+ * UNIX timestamp of when the transaction was added to the blockchain. The
225
+ * timestamp can be null if the transaction has not been included in the
226
+ * blockchain yet.
227
+ */
228
+ timestamp: nullable(number()),
229
+ /**
230
+ * Transaction type {@see TransactionType}. This will be used by MetaMask to enrich the transaction
231
+ * details on the UI.
232
+ */
233
+ type: enums([`${TransactionType.Send}`, `${TransactionType.Receive}`]),
234
+ /**
235
+ * Transaction sender addresses and amounts.
236
+ */
237
+ from: array(ParticipantStruct),
238
+ /**
239
+ * Transaction receiver addresses and amounts.
240
+ */
241
+ to: array(ParticipantStruct),
242
+ /**
243
+ * Total transaction fee.
244
+ */
245
+ fees: array(FeeStruct),
246
+ /**
247
+ * List of events related to the transaction {@see TransactionEventStruct}.
248
+ *
249
+ * The events are tracked in a best-effort basis and may not be available for
250
+ * all transactions.
251
+ */
252
+ events: array(TransactionEventStruct),
253
+ });
254
+ /**
255
+ * This struct represents a page of transactions.
256
+ *
257
+ * @example
258
+ * ```ts
259
+ * {
260
+ * data: [
261
+ * {
262
+ * // Transaction object
263
+ * }
264
+ * ],
265
+ * next: 'c3y1Q6QtqtstbxKX+oqVdEW6',
266
+ * }
267
+ * ```
268
+ *
269
+ * @example
270
+ * ```ts
271
+ * {
272
+ * data: [
273
+ * {
274
+ * // Transaction object
275
+ * }
276
+ * ],
277
+ * next: null, // No more results
278
+ * }**
279
+ * ```
280
+ */
281
+ export const TransactionsPageStruct = object({
282
+ /**
283
+ * List of transactions.
284
+ */
285
+ data: array(TransactionStruct),
286
+ /**
287
+ * Next cursor to iterate over the results. If null, there are no more
288
+ * results.
289
+ */
290
+ next: nullable(string()),
291
+ });
292
+ //# sourceMappingURL=transaction.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transaction.mjs","sourceRoot":"","sources":["../../src/api/transaction.ts"],"names":[],"mappings":"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","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport { array, enums, nullable, number, string } from '@metamask/superstruct';\nimport { CaipChainIdStruct } from '@metamask/utils';\n\nimport { AssetStruct } from './asset';\nimport type { InferEquals } from '../superstruct';\nimport { object } from '../superstruct';\nimport type { Paginated } from '../utils';\nimport { UuidStruct } from '../utils';\n\n/**\n * This struct represents a participant in a transaction.\n *\n * @example\n * ```ts\n * {\n * address: '0x1234...',\n * asset: {\n * fungible: true,\n * type: 'eip155:1/slip44:60',\n * unit: 'ETH',\n * amount: '0.01',\n * },\n * },\n * ```\n *\n * @example\n * ```ts\n * {\n * address: '0x1234...',\n * asset: {\n * fungible: false,\n * id: 'eip155:1/erc721:0x06012c8cf97BEaD5deAe237070F9587f8E7A266d/771769',\n * },\n * },\n * ```\n *\n * @example\n * ```ts\n * {\n * address: '0x1234...',\n * asset: null,\n * },\n * ```\n */\nconst ParticipantStruct = object({\n /**\n * Participant address.\n */\n address: string(),\n\n /**\n * Asset being transferred.\n */\n asset: nullable(AssetStruct),\n});\n\n/**\n * Fee types.\n */\nexport enum FeeType {\n /**\n * Base fee. It is the minimum fee required to include a transaction in the\n * blockchain.\n *\n * For non-confirmed transactions, it must be the maximum base fee. For\n * confirmed transactions, it must be the actual base fee paid.\n */\n Base = 'base',\n\n /**\n * Priority fee. It is an optional fee used to prioritize the transaction.\n *\n * For non-confirmed transactions, it must be the maximum priority fee. For\n * confirmed transactions, it must be the actual priority fee paid.\n */\n Priority = 'priority',\n}\n\n/**\n * This struct represents a transaction fee.\n */\nconst FeeStruct = object({\n /**\n * Fee type {@see FeeType}.\n */\n type: enums([`${FeeType.Base}`, `${FeeType.Priority}`]),\n\n /**\n * Asset used to pay for the fee.\n */\n asset: AssetStruct,\n});\n\n/**\n * Transaction statuses.\n */\nexport enum TransactionStatus {\n /**\n * The transaction has been submitted but is not yet in the\n * blockchain. For example, it can be in the mempool.\n */\n Submitted = 'submitted',\n\n /**\n * The transaction is in the blockchain but has not been\n * confirmed yet.\n */\n Unconfirmed = 'unconfirmed',\n\n /**\n * The transaction has been confirmed.\n */\n Confirmed = 'confirmed',\n\n /**\n * The transaction has failed. For example, it has been reverted.\n */\n Failed = 'failed',\n}\n\n/**\n * Transaction types.\n */\nexport enum TransactionType {\n /**\n * The transaction was originated by the account. If the transaction\n * has a change output that goes back to the same account, it must be tagged\n * as a send transaction.\n */\n Send = 'send',\n\n /**\n * The transaction was received by the account, but originated by\n * another account.\n */\n Receive = 'receive',\n}\n\n/**\n * This struct represents a transaction event.\n */\nexport const TransactionEventStruct = object({\n /**\n * New status of the transaction.\n */\n status: enums([\n `${TransactionStatus.Submitted}`,\n `${TransactionStatus.Unconfirmed}`,\n `${TransactionStatus.Confirmed}`,\n `${TransactionStatus.Failed}`,\n ]),\n\n /**\n * UNIX timestamp of when the event occurred.\n */\n timestamp: nullable(number()),\n});\n\n/**\n * This struct represents a blockchain transaction.\n *\n * @example\n * ```ts\n * const tx = {\n * id: 'f5d8ee39a430901c91a5917b9f2dc19d6d1a0e9cea205b009ca73dd04470b9a6',\n * chain: 'bip122:000000000019d6689c085ae165831e93',\n * account: 'b9beb861-9761-4b97-89ce-d992be5f34da',\n * status: 'confirmed',\n * timestamp: 1716367781,\n * type: 'send',\n * from: [\n * {\n * address: 'bc1qrp0yzgkf8rawkuvdlhnjfj2fnjwm0m8727kgah',\n * asset: {\n * fungible: true,\n * type: 'bip122:000000000019d6689c085ae165831e93/slip44:0',\n * unit: 'BTC',\n * amount: '0.1',\n * },\n * },\n * ],\n * to: [\n * {\n * address: 'bc1qrp0yzgkf8rawkuvdlhnjfj2fnjwm0m8727kgah',\n * asset: {\n * fungible: true,\n * type: 'bip122:000000000019d6689c085ae165831e93/slip44:0',\n * unit: 'BTC',\n * amount: '0.1',\n * },\n * },\n * {\n * address: 'bc1qwl8399fz829uqvqly9tcatgrgtwp3udnhxfq4k',\n * asset: {\n * fungible: true,\n * type: 'bip122:000000000019d6689c085ae165831e93/slip44:0',\n * unit: 'BTC',\n * amount: '0.1',\n * },\n * },\n * ],\n * fees: [\n * {\n * type: 'priority',\n * asset: {\n * fungible: true,\n * type: 'bip122:000000000019d6689c085ae165831e93/slip44:0',\n * unit: 'BTC',\n * amount: '0.1',\n * },\n * },\n * ],\n * };\n * ```\n */\nexport const TransactionStruct = object({\n /**\n * Chain-specific transaction ID.\n */\n id: string(),\n\n /**\n * Chain ID (CAIP-2).\n */\n chain: CaipChainIdStruct,\n\n /**\n * Account ID (UUIDv4).\n */\n account: UuidStruct,\n\n /**\n * Transaction status {@see TransactionStatus}.\n */\n status: enums([\n `${TransactionStatus.Submitted}`,\n `${TransactionStatus.Unconfirmed}`,\n `${TransactionStatus.Confirmed}`,\n `${TransactionStatus.Failed}`,\n ]),\n\n /**\n * UNIX timestamp of when the transaction was added to the blockchain. The\n * timestamp can be null if the transaction has not been included in the\n * blockchain yet.\n */\n timestamp: nullable(number()),\n\n /**\n * Transaction type {@see TransactionType}. This will be used by MetaMask to enrich the transaction\n * details on the UI.\n */\n type: enums([`${TransactionType.Send}`, `${TransactionType.Receive}`]),\n\n /**\n * Transaction sender addresses and amounts.\n */\n from: array(ParticipantStruct),\n\n /**\n * Transaction receiver addresses and amounts.\n */\n to: array(ParticipantStruct),\n\n /**\n * Total transaction fee.\n */\n fees: array(FeeStruct),\n\n /**\n * List of events related to the transaction {@see TransactionEventStruct}.\n *\n * The events are tracked in a best-effort basis and may not be available for\n * all transactions.\n */\n events: array(TransactionEventStruct),\n});\n\n/**\n * Transaction object.\n *\n * See {@link TransactionStruct}.\n */\nexport type Transaction = Infer<typeof TransactionStruct>;\n\n/**\n * This struct represents a page of transactions.\n *\n * @example\n * ```ts\n * {\n * data: [\n * {\n * // Transaction object\n * }\n * ],\n * next: 'c3y1Q6QtqtstbxKX+oqVdEW6',\n * }\n * ```\n *\n * @example\n * ```ts\n * {\n * data: [\n * {\n * // Transaction object\n * }\n * ],\n * next: null, // No more results\n * }**\n * ```\n */\nexport const TransactionsPageStruct = object({\n /**\n * List of transactions.\n */\n data: array(TransactionStruct),\n\n /**\n * Next cursor to iterate over the results. If null, there are no more\n * results.\n */\n next: nullable(string()),\n});\n\n/**\n * Transactions page object.\n *\n * See {@link TransactionsPageStruct}.\n */\nexport type TransactionsPage = InferEquals<\n typeof TransactionsPageStruct,\n Paginated<Transaction>\n>;\n"]}
@@ -14,5 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./types"), exports);
18
- //# sourceMappingURL=index.js.map
17
+ __exportStar(require("./types.cjs"), exports);
18
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/btc/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAAwB","sourcesContent":["export * from './types';\n"]}
@@ -0,0 +1,2 @@
1
+ export * from "./types.cjs";
2
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/btc/index.ts"],"names":[],"mappings":"AAAA,4BAAwB"}
@@ -0,0 +1,2 @@
1
+ export * from "./types.mjs";
2
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/btc/index.ts"],"names":[],"mappings":"AAAA,4BAAwB"}
@@ -0,0 +1,2 @@
1
+ export * from "./types.mjs";
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/btc/index.ts"],"names":[],"mappings":"AAAA,4BAAwB","sourcesContent":["export * from './types';\n"]}
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BtcP2wpkhAccountStruct = exports.BtcMethod = exports.BtcP2wpkhAddressStruct = void 0;
4
4
  const superstruct_1 = require("@metamask/superstruct");
5
5
  const bech32_1 = require("bech32");
6
- const api_1 = require("../api");
7
- const superstruct_2 = require("../superstruct");
6
+ const api_1 = require("../api/index.cjs");
7
+ const superstruct_2 = require("../superstruct.cjs");
8
8
  exports.BtcP2wpkhAddressStruct = (0, superstruct_1.refine)((0, superstruct_1.string)(), 'BtcP2wpkhAddressStruct', (address) => {
9
9
  try {
10
10
  bech32_1.bech32.decode(address);
@@ -37,4 +37,4 @@ exports.BtcP2wpkhAccountStruct = (0, superstruct_2.object)({
37
37
  */
38
38
  methods: (0, superstruct_1.array)((0, superstruct_1.enums)([`${BtcMethod.SendBitcoin}`])),
39
39
  });
40
- //# sourceMappingURL=types.js.map
40
+ //# sourceMappingURL=types.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.cjs","sourceRoot":"","sources":["../../src/btc/types.ts"],"names":[],"mappings":";;;AACA,uDAA8E;AAC9E,mCAAgC;AAEhC,0CAA8D;AAC9D,oDAAwC;AAE3B,QAAA,sBAAsB,GAAG,IAAA,oBAAM,EAC1C,IAAA,oBAAM,GAAE,EACR,wBAAwB,EACxB,CAAC,OAAe,EAAE,EAAE;IAClB,IAAI,CAAC;QACH,eAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACzB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,IAAI,KAAK,CACd,oCAAqC,KAAe,CAAC,OAAO,EAAE,CAC/D,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CACF,CAAC;AAEF;;GAEG;AACH,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,8BAA8B;IAC9B,wCAA2B,CAAA;AAC7B,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB;AAEY,QAAA,sBAAsB,GAAG,IAAA,oBAAM,EAAC;IAC3C,GAAG,0BAAoB,CAAC,MAAM;IAE9B;;OAEG;IACH,OAAO,EAAE,8BAAsB;IAE/B;;OAEG;IACH,IAAI,EAAE,IAAA,qBAAO,EAAC,GAAG,oBAAc,CAAC,MAAM,EAAE,CAAC;IAEzC;;OAEG;IACH,OAAO,EAAE,IAAA,mBAAK,EAAC,IAAA,mBAAK,EAAC,CAAC,GAAG,SAAS,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;CACpD,CAAC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport { string, array, enums, refine, literal } from '@metamask/superstruct';\nimport { bech32 } from 'bech32';\n\nimport { KeyringAccountStruct, BtcAccountType } from '../api';\nimport { object } from '../superstruct';\n\nexport const BtcP2wpkhAddressStruct = refine(\n string(),\n 'BtcP2wpkhAddressStruct',\n (address: string) => {\n try {\n bech32.decode(address);\n } catch (error) {\n return new Error(\n `Could not decode P2WPKH address: ${(error as Error).message}`,\n );\n }\n return true;\n },\n);\n\n/**\n * Supported Bitcoin methods.\n */\nexport enum BtcMethod {\n // General transaction methods\n SendBitcoin = 'sendBitcoin',\n}\n\nexport const BtcP2wpkhAccountStruct = object({\n ...KeyringAccountStruct.schema,\n\n /**\n * Account address.\n */\n address: BtcP2wpkhAddressStruct,\n\n /**\n * Account type.\n */\n type: literal(`${BtcAccountType.P2wpkh}`),\n\n /**\n * Account supported methods.\n */\n methods: array(enums([`${BtcMethod.SendBitcoin}`])),\n});\n\nexport type BtcP2wpkhAccount = Infer<typeof BtcP2wpkhAccountStruct>;\n"]}
@@ -1,4 +1,4 @@
1
- import type { Infer } from '@metamask/superstruct';
1
+ import type { Infer } from "@metamask/superstruct";
2
2
  export declare const BtcP2wpkhAddressStruct: import("@metamask/superstruct").Struct<string, null>;
3
3
  /**
4
4
  * Supported Bitcoin methods.
@@ -31,3 +31,4 @@ export declare const BtcP2wpkhAccountStruct: import("@metamask/superstruct").Str
31
31
  options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
32
32
  }>;
33
33
  export type BtcP2wpkhAccount = Infer<typeof BtcP2wpkhAccountStruct>;
34
+ //# sourceMappingURL=types.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../../src/btc/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAOnD,eAAO,MAAM,sBAAsB,sDAalC,CAAC;AAEF;;GAEG;AACH,oBAAY,SAAS;IAEnB,WAAW,gBAAgB;CAC5B;AAED,eAAO,MAAM,sBAAsB;;;;;;;IAGjC;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;EAEH,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
@@ -0,0 +1,34 @@
1
+ import type { Infer } from "@metamask/superstruct";
2
+ export declare const BtcP2wpkhAddressStruct: import("@metamask/superstruct").Struct<string, null>;
3
+ /**
4
+ * Supported Bitcoin methods.
5
+ */
6
+ export declare enum BtcMethod {
7
+ SendBitcoin = "sendBitcoin"
8
+ }
9
+ export declare const BtcP2wpkhAccountStruct: import("@metamask/superstruct").Struct<{
10
+ type: "bip122:p2wpkh";
11
+ id: string;
12
+ address: string;
13
+ options: Record<string, import("@metamask/utils").Json>;
14
+ methods: "sendBitcoin"[];
15
+ }, {
16
+ /**
17
+ * Account address.
18
+ */
19
+ address: import("@metamask/superstruct").Struct<string, null>;
20
+ /**
21
+ * Account type.
22
+ */
23
+ type: import("@metamask/superstruct").Struct<"bip122:p2wpkh", "bip122:p2wpkh">;
24
+ /**
25
+ * Account supported methods.
26
+ */
27
+ methods: import("@metamask/superstruct").Struct<"sendBitcoin"[], import("@metamask/superstruct").Struct<"sendBitcoin", {
28
+ sendBitcoin: "sendBitcoin";
29
+ }>>;
30
+ id: import("@metamask/superstruct").Struct<string, null>;
31
+ options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
32
+ }>;
33
+ export type BtcP2wpkhAccount = Infer<typeof BtcP2wpkhAccountStruct>;
34
+ //# sourceMappingURL=types.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../../src/btc/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAOnD,eAAO,MAAM,sBAAsB,sDAalC,CAAC;AAEF;;GAEG;AACH,oBAAY,SAAS;IAEnB,WAAW,gBAAgB;CAC5B;AAED,eAAO,MAAM,sBAAsB;;;;;;;IAGjC;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;EAEH,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
@@ -0,0 +1,37 @@
1
+ import { string, array, enums, refine, literal } from "@metamask/superstruct";
2
+ import { bech32 } from "bech32";
3
+ import { KeyringAccountStruct, BtcAccountType } from "../api/index.mjs";
4
+ import { object } from "../superstruct.mjs";
5
+ export const BtcP2wpkhAddressStruct = refine(string(), 'BtcP2wpkhAddressStruct', (address) => {
6
+ try {
7
+ bech32.decode(address);
8
+ }
9
+ catch (error) {
10
+ return new Error(`Could not decode P2WPKH address: ${error.message}`);
11
+ }
12
+ return true;
13
+ });
14
+ /**
15
+ * Supported Bitcoin methods.
16
+ */
17
+ export var BtcMethod;
18
+ (function (BtcMethod) {
19
+ // General transaction methods
20
+ BtcMethod["SendBitcoin"] = "sendBitcoin";
21
+ })(BtcMethod || (BtcMethod = {}));
22
+ export const BtcP2wpkhAccountStruct = object({
23
+ ...KeyringAccountStruct.schema,
24
+ /**
25
+ * Account address.
26
+ */
27
+ address: BtcP2wpkhAddressStruct,
28
+ /**
29
+ * Account type.
30
+ */
31
+ type: literal(`${BtcAccountType.P2wpkh}`),
32
+ /**
33
+ * Account supported methods.
34
+ */
35
+ methods: array(enums([`${BtcMethod.SendBitcoin}`])),
36
+ });
37
+ //# sourceMappingURL=types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.mjs","sourceRoot":"","sources":["../../src/btc/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,8BAA8B;AAC9E,OAAO,EAAE,MAAM,EAAE,eAAe;AAEhC,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,yBAAe;AAC9D,OAAO,EAAE,MAAM,EAAE,2BAAuB;AAExC,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAC1C,MAAM,EAAE,EACR,wBAAwB,EACxB,CAAC,OAAe,EAAE,EAAE;IAClB,IAAI,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACzB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,IAAI,KAAK,CACd,oCAAqC,KAAe,CAAC,OAAO,EAAE,CAC/D,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CACF,CAAC;AAEF;;GAEG;AACH,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,8BAA8B;IAC9B,wCAA2B,CAAA;AAC7B,CAAC,EAHW,SAAS,KAAT,SAAS,QAGpB;AAED,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC;IAC3C,GAAG,oBAAoB,CAAC,MAAM;IAE9B;;OAEG;IACH,OAAO,EAAE,sBAAsB;IAE/B;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC;IAEzC;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,SAAS,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;CACpD,CAAC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport { string, array, enums, refine, literal } from '@metamask/superstruct';\nimport { bech32 } from 'bech32';\n\nimport { KeyringAccountStruct, BtcAccountType } from '../api';\nimport { object } from '../superstruct';\n\nexport const BtcP2wpkhAddressStruct = refine(\n string(),\n 'BtcP2wpkhAddressStruct',\n (address: string) => {\n try {\n bech32.decode(address);\n } catch (error) {\n return new Error(\n `Could not decode P2WPKH address: ${(error as Error).message}`,\n );\n }\n return true;\n },\n);\n\n/**\n * Supported Bitcoin methods.\n */\nexport enum BtcMethod {\n // General transaction methods\n SendBitcoin = 'sendBitcoin',\n}\n\nexport const BtcP2wpkhAccountStruct = object({\n ...KeyringAccountStruct.schema,\n\n /**\n * Account address.\n */\n address: BtcP2wpkhAddressStruct,\n\n /**\n * Account type.\n */\n type: literal(`${BtcAccountType.P2wpkh}`),\n\n /**\n * Account supported methods.\n */\n methods: array(enums([`${BtcMethod.SendBitcoin}`])),\n});\n\nexport type BtcP2wpkhAccount = Infer<typeof BtcP2wpkhAccountStruct>;\n"]}
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=contexts.js.map
3
+ //# sourceMappingURL=contexts.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contexts.cjs","sourceRoot":"","sources":["../src/contexts.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Context used by a Keyring implementation.\n */\nexport type KeyringExecutionContext = {\n /** The chain ID. */\n chainId: string;\n};\n"]}
@@ -5,3 +5,4 @@ export type KeyringExecutionContext = {
5
5
  /** The chain ID. */
6
6
  chainId: string;
7
7
  };
8
+ //# sourceMappingURL=contexts.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contexts.d.cts","sourceRoot":"","sources":["../src/contexts.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACpC,oBAAoB;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Context used by a Keyring implementation.
3
+ */
4
+ export type KeyringExecutionContext = {
5
+ /** The chain ID. */
6
+ chainId: string;
7
+ };
8
+ //# sourceMappingURL=contexts.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contexts.d.mts","sourceRoot":"","sources":["../src/contexts.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACpC,oBAAoB;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=contexts.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contexts.mjs","sourceRoot":"","sources":["../src/contexts.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Context used by a Keyring implementation.\n */\nexport type KeyringExecutionContext = {\n /** The chain ID. */\n chainId: string;\n};\n"]}
@@ -14,5 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./types"), exports);
18
- //# sourceMappingURL=index.js.map
17
+ __exportStar(require("./types.cjs"), exports);
18
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/eth/erc4337/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAAwB","sourcesContent":["export * from './types';\n"]}
@@ -0,0 +1,2 @@
1
+ export * from "./types.cjs";
2
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/eth/erc4337/index.ts"],"names":[],"mappings":"AAAA,4BAAwB"}
@@ -0,0 +1,2 @@
1
+ export * from "./types.mjs";
2
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/eth/erc4337/index.ts"],"names":[],"mappings":"AAAA,4BAAwB"}
@@ -0,0 +1,2 @@
1
+ export * from "./types.mjs";
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/eth/erc4337/index.ts"],"names":[],"mappings":"AAAA,4BAAwB","sourcesContent":["export * from './types';\n"]}
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EthUserOperationPatchStruct = exports.EthBaseUserOperationStruct = exports.EthBaseTransactionStruct = exports.EthUserOperationStruct = void 0;
4
- const superstruct_1 = require("../../superstruct");
5
- const utils_1 = require("../../utils");
6
- const types_1 = require("../types");
4
+ const superstruct_1 = require("../../superstruct.cjs");
5
+ const utils_1 = require("../../utils/index.cjs");
6
+ const types_1 = require("../types.cjs");
7
7
  /**
8
8
  * Struct of a UserOperation as defined by ERC-4337.
9
9
  *
@@ -59,4 +59,4 @@ exports.EthUserOperationPatchStruct = (0, superstruct_1.object)({
59
59
  verificationGasLimit: (0, superstruct_1.exactOptional)(types_1.EthUint256Struct),
60
60
  preVerificationGas: (0, superstruct_1.exactOptional)(types_1.EthUint256Struct),
61
61
  });
62
- //# sourceMappingURL=types.js.map
62
+ //# sourceMappingURL=types.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.cjs","sourceRoot":"","sources":["../../../src/eth/erc4337/types.ts"],"names":[],"mappings":";;;AAEA,uDAA0D;AAC1D,iDAAwC;AACxC,wCAA8E;AAE9E;;;;GAIG;AACU,QAAA,sBAAsB,GAAG,IAAA,oBAAM,EAAC;IAC3C,MAAM,EAAE,wBAAgB;IACxB,KAAK,EAAE,wBAAgB;IACvB,QAAQ,EAAE,sBAAc;IACxB,QAAQ,EAAE,sBAAc;IACxB,YAAY,EAAE,wBAAgB;IAC9B,oBAAoB,EAAE,wBAAgB;IACtC,kBAAkB,EAAE,wBAAgB;IACpC,YAAY,EAAE,wBAAgB;IAC9B,oBAAoB,EAAE,wBAAgB;IACtC,gBAAgB,EAAE,sBAAc;IAChC,SAAS,EAAE,sBAAc;CAC1B,CAAC,CAAC;AAIH;;;GAGG;AACU,QAAA,wBAAwB,GAAG,IAAA,oBAAM,EAAC;IAC7C;;OAEG;IACH,EAAE,EAAE,wBAAgB;IAEpB;;OAEG;IACH,KAAK,EAAE,wBAAgB;IAEvB;;OAEG;IACH,IAAI,EAAE,sBAAc;CACrB,CAAC,CAAC;AAIU,QAAA,0BAA0B,GAAG,IAAA,oBAAM,EAAC;IAC/C,KAAK,EAAE,wBAAgB;IACvB,QAAQ,EAAE,sBAAc;IACxB,QAAQ,EAAE,sBAAc;IACxB,SAAS,EAAE,IAAA,2BAAa,EACtB,IAAA,oBAAM,EAAC;QACL,YAAY,EAAE,wBAAgB;QAC9B,oBAAoB,EAAE,wBAAgB;QACtC,kBAAkB,EAAE,wBAAgB;KACrC,CAAC,CACH;IACD,qBAAqB,EAAE,sBAAc;IACrC,cAAc,EAAE,sBAAc;IAC9B,UAAU,EAAE,iBAAS;CACtB,CAAC,CAAC;AAIU,QAAA,2BAA2B,GAAG,IAAA,oBAAM,EAAC;IAChD,gBAAgB,EAAE,sBAAc;IAChC,YAAY,EAAE,IAAA,2BAAa,EAAC,wBAAgB,CAAC;IAC7C,oBAAoB,EAAE,IAAA,2BAAa,EAAC,wBAAgB,CAAC;IACrD,kBAAkB,EAAE,IAAA,2BAAa,EAAC,wBAAgB,CAAC;CACpD,CAAC,CAAC","sourcesContent":["import { type Infer } from '@metamask/superstruct';\n\nimport { exactOptional, object } from '../../superstruct';\nimport { UrlStruct } from '../../utils';\nimport { EthAddressStruct, EthBytesStruct, EthUint256Struct } from '../types';\n\n/**\n * Struct of a UserOperation as defined by ERC-4337.\n *\n * @see https://eips.ethereum.org/EIPS/eip-4337#definitions\n */\nexport const EthUserOperationStruct = object({\n sender: EthAddressStruct,\n nonce: EthUint256Struct,\n initCode: EthBytesStruct,\n callData: EthBytesStruct,\n callGasLimit: EthUint256Struct,\n verificationGasLimit: EthUint256Struct,\n preVerificationGas: EthUint256Struct,\n maxFeePerGas: EthUint256Struct,\n maxPriorityFeePerGas: EthUint256Struct,\n paymasterAndData: EthBytesStruct,\n signature: EthBytesStruct,\n});\n\nexport type EthUserOperation = Infer<typeof EthUserOperationStruct>;\n\n/**\n * Struct containing the most basic transaction information required to\n * construct a UserOperation.\n */\nexport const EthBaseTransactionStruct = object({\n /**\n * Address of the transaction recipient.\n */\n to: EthAddressStruct,\n\n /**\n * Amount of wei to transfer to the recipient.\n */\n value: EthUint256Struct,\n\n /**\n * Data to pass to the recipient.\n */\n data: EthBytesStruct,\n});\n\nexport type EthBaseTransaction = Infer<typeof EthBaseTransactionStruct>;\n\nexport const EthBaseUserOperationStruct = object({\n nonce: EthUint256Struct,\n initCode: EthBytesStruct,\n callData: EthBytesStruct,\n gasLimits: exactOptional(\n object({\n callGasLimit: EthUint256Struct,\n verificationGasLimit: EthUint256Struct,\n preVerificationGas: EthUint256Struct,\n }),\n ),\n dummyPaymasterAndData: EthBytesStruct,\n dummySignature: EthBytesStruct,\n bundlerUrl: UrlStruct,\n});\n\nexport type EthBaseUserOperation = Infer<typeof EthBaseUserOperationStruct>;\n\nexport const EthUserOperationPatchStruct = object({\n paymasterAndData: EthBytesStruct,\n callGasLimit: exactOptional(EthUint256Struct),\n verificationGasLimit: exactOptional(EthUint256Struct),\n preVerificationGas: exactOptional(EthUint256Struct),\n});\n\nexport type EthUserOperationPatch = Infer<typeof EthUserOperationPatchStruct>;\n"]}
@@ -1,4 +1,4 @@
1
- import { type Infer } from '@metamask/superstruct';
1
+ import { type Infer } from "@metamask/superstruct";
2
2
  /**
3
3
  * Struct of a UserOperation as defined by ERC-4337.
4
4
  *
@@ -36,8 +36,8 @@ export type EthUserOperation = Infer<typeof EthUserOperationStruct>;
36
36
  */
37
37
  export declare const EthBaseTransactionStruct: import("@metamask/superstruct").Struct<{
38
38
  value: string;
39
- data: string;
40
39
  to: string;
40
+ data: string;
41
41
  }, {
42
42
  /**
43
43
  * Address of the transaction recipient.
@@ -69,7 +69,7 @@ export declare const EthBaseUserOperationStruct: import("@metamask/superstruct")
69
69
  nonce: import("@metamask/superstruct").Struct<string, null>;
70
70
  initCode: import("@metamask/superstruct").Struct<string, null>;
71
71
  callData: import("@metamask/superstruct").Struct<string, null>;
72
- gasLimits: import("@metamask/superstruct").Struct<import("../../superstruct").ExactOptionalTag | {
72
+ gasLimits: import("@metamask/superstruct").Struct<import("../../superstruct.cjs").ExactOptionalTag | {
73
73
  callGasLimit: string;
74
74
  verificationGasLimit: string;
75
75
  preVerificationGas: string;
@@ -90,8 +90,9 @@ export declare const EthUserOperationPatchStruct: import("@metamask/superstruct"
90
90
  preVerificationGas?: string;
91
91
  }, {
92
92
  paymasterAndData: import("@metamask/superstruct").Struct<string, null>;
93
- callGasLimit: import("@metamask/superstruct").Struct<string | import("../../superstruct").ExactOptionalTag, null>;
94
- verificationGasLimit: import("@metamask/superstruct").Struct<string | import("../../superstruct").ExactOptionalTag, null>;
95
- preVerificationGas: import("@metamask/superstruct").Struct<string | import("../../superstruct").ExactOptionalTag, null>;
93
+ callGasLimit: import("@metamask/superstruct").Struct<string | import("../../superstruct.cjs").ExactOptionalTag, null>;
94
+ verificationGasLimit: import("@metamask/superstruct").Struct<string | import("../../superstruct.cjs").ExactOptionalTag, null>;
95
+ preVerificationGas: import("@metamask/superstruct").Struct<string | import("../../superstruct.cjs").ExactOptionalTag, null>;
96
96
  }>;
97
97
  export type EthUserOperationPatch = Infer<typeof EthUserOperationPatchStruct>;
98
+ //# sourceMappingURL=types.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../../../src/eth/erc4337/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,KAAK,EAAE,8BAA8B;AAMnD;;;;GAIG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;EAYjC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEpE;;;GAGG;AACH,eAAO,MAAM,wBAAwB;;;;;IACnC;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;EAEH,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAExE,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAcrC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE5E,eAAO,MAAM,2BAA2B;;;;;;;;;;EAKtC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC"}