@aptos-labs/ts-sdk 1.33.1 → 1.33.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (690) hide show
  1. package/README.md +4 -6
  2. package/dist/common/{accountAddress-BHsGaOsa.d.ts → accountAddress-Cf1amU98.d.ts} +279 -0
  3. package/dist/common/{chunk-F43XVDYJ.js → chunk-IHUCZKG2.js} +1 -1
  4. package/dist/common/chunk-IHUCZKG2.js.map +1 -0
  5. package/dist/common/cli/index.d.ts +47 -9
  6. package/dist/common/cli/index.js +1 -1
  7. package/dist/common/cli/index.js.map +1 -1
  8. package/dist/common/index.d.ts +1941 -225
  9. package/dist/common/index.js +33 -33
  10. package/dist/common/index.js.map +1 -1
  11. package/dist/esm/{Ed25519Account-B3xHXAQe.d.mts → Ed25519Account-D4j3_WIS.d.mts} +122 -12
  12. package/dist/esm/account/AbstractKeylessAccount.d.mts +81 -7
  13. package/dist/esm/account/AbstractKeylessAccount.mjs +1 -1
  14. package/dist/esm/account/Account.d.mts +5 -4
  15. package/dist/esm/account/Account.mjs +1 -1
  16. package/dist/esm/account/AccountUtils.d.mts +64 -0
  17. package/dist/esm/account/AccountUtils.mjs +2 -0
  18. package/dist/esm/account/Ed25519Account.d.mts +3 -2
  19. package/dist/esm/account/Ed25519Account.mjs +1 -1
  20. package/dist/esm/account/EphemeralKeyPair.d.mts +29 -1
  21. package/dist/esm/account/EphemeralKeyPair.mjs +1 -1
  22. package/dist/esm/account/FederatedKeylessAccount.d.mts +25 -5
  23. package/dist/esm/account/FederatedKeylessAccount.mjs +1 -1
  24. package/dist/esm/account/KeylessAccount.d.mts +30 -5
  25. package/dist/esm/account/KeylessAccount.mjs +1 -1
  26. package/dist/esm/account/MultiKeyAccount.d.mts +40 -5
  27. package/dist/esm/account/MultiKeyAccount.mjs +1 -1
  28. package/dist/esm/account/SingleKeyAccount.d.mts +4 -3
  29. package/dist/esm/account/SingleKeyAccount.mjs +1 -1
  30. package/dist/esm/account/index.d.mts +4 -2
  31. package/dist/esm/account/index.mjs +1 -1
  32. package/dist/esm/account/utils.d.mts +18 -0
  33. package/dist/esm/account/utils.mjs +2 -0
  34. package/dist/esm/account/utils.mjs.map +1 -0
  35. package/dist/esm/api/account.d.mts +25 -4
  36. package/dist/esm/api/account.mjs +1 -1
  37. package/dist/esm/api/ans.d.mts +18 -2
  38. package/dist/esm/api/ans.mjs +1 -1
  39. package/dist/esm/api/aptos.d.mts +5 -2
  40. package/dist/esm/api/aptos.mjs +1 -1
  41. package/dist/esm/api/aptosConfig.d.mts +16 -0
  42. package/dist/esm/api/aptosConfig.mjs +1 -1
  43. package/dist/esm/api/coin.d.mts +5 -1
  44. package/dist/esm/api/coin.mjs +1 -1
  45. package/dist/esm/api/digitalAsset.d.mts +29 -2
  46. package/dist/esm/api/digitalAsset.mjs +1 -1
  47. package/dist/esm/api/event.d.mts +6 -0
  48. package/dist/esm/api/event.mjs +1 -1
  49. package/dist/esm/api/faucet.d.mts +11 -2
  50. package/dist/esm/api/faucet.mjs +1 -1
  51. package/dist/esm/api/fungibleAsset.d.mts +11 -2
  52. package/dist/esm/api/fungibleAsset.mjs +1 -1
  53. package/dist/esm/api/general.d.mts +14 -1
  54. package/dist/esm/api/general.mjs +1 -1
  55. package/dist/esm/api/index.d.mts +3 -2
  56. package/dist/esm/api/index.mjs +1 -1
  57. package/dist/esm/api/keyless.d.mts +8 -2
  58. package/dist/esm/api/keyless.mjs +1 -1
  59. package/dist/esm/api/object.d.mts +3 -0
  60. package/dist/esm/api/object.mjs +1 -1
  61. package/dist/esm/api/staking.d.mts +5 -0
  62. package/dist/esm/api/staking.mjs +1 -1
  63. package/dist/esm/api/table.d.mts +5 -0
  64. package/dist/esm/api/table.mjs +1 -1
  65. package/dist/esm/api/transaction.d.mts +23 -6
  66. package/dist/esm/api/transaction.mjs +1 -1
  67. package/dist/esm/api/transactionSubmission/build.d.mts +6 -1
  68. package/dist/esm/api/transactionSubmission/build.mjs +1 -1
  69. package/dist/esm/api/transactionSubmission/helpers.d.mts +2 -0
  70. package/dist/esm/api/transactionSubmission/helpers.mjs +1 -1
  71. package/dist/esm/api/transactionSubmission/management.d.mts +8 -2
  72. package/dist/esm/api/transactionSubmission/management.mjs +1 -1
  73. package/dist/esm/api/transactionSubmission/sign.d.mts +7 -2
  74. package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
  75. package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -1
  76. package/dist/esm/api/transactionSubmission/simulate.d.mts +6 -1
  77. package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
  78. package/dist/esm/api/transactionSubmission/submit.d.mts +6 -1
  79. package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
  80. package/dist/esm/api/utils.d.mts +1 -0
  81. package/dist/esm/api/utils.mjs +1 -1
  82. package/dist/esm/bcs/deserializer.d.mts +42 -1
  83. package/dist/esm/bcs/deserializer.mjs +1 -1
  84. package/dist/esm/bcs/index.mjs +1 -1
  85. package/dist/esm/bcs/serializable/entryFunctionBytes.d.mts +10 -0
  86. package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -1
  87. package/dist/esm/bcs/serializable/fixedBytes.d.mts +12 -0
  88. package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -1
  89. package/dist/esm/bcs/serializable/movePrimitives.d.mts +24 -0
  90. package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
  91. package/dist/esm/bcs/serializable/moveStructs.d.mts +56 -0
  92. package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
  93. package/dist/esm/bcs/serializer.d.mts +60 -0
  94. package/dist/esm/bcs/serializer.mjs +1 -1
  95. package/dist/esm/{chunk-PMGK5IHB.mjs → chunk-2FBJWTJD.mjs} +2 -2
  96. package/dist/esm/chunk-2FBJWTJD.mjs.map +1 -0
  97. package/dist/esm/{chunk-L4SWQLAJ.mjs → chunk-2N5KYALM.mjs} +2 -2
  98. package/dist/esm/chunk-2N5KYALM.mjs.map +1 -0
  99. package/dist/esm/{chunk-7V35JAAF.mjs → chunk-2TJ6OTVD.mjs} +2 -2
  100. package/dist/esm/chunk-2TJ6OTVD.mjs.map +1 -0
  101. package/dist/esm/{chunk-GVNK3UMT.mjs → chunk-2UXW3EB7.mjs} +2 -2
  102. package/dist/esm/chunk-2UXW3EB7.mjs.map +1 -0
  103. package/dist/esm/{chunk-UJSTWN32.mjs → chunk-2WCATZVL.mjs} +2 -2
  104. package/dist/esm/{chunk-UJSTWN32.mjs.map → chunk-2WCATZVL.mjs.map} +1 -1
  105. package/dist/esm/{chunk-FZDEGDUY.mjs → chunk-35DKMW7Q.mjs} +1 -1
  106. package/dist/esm/chunk-35DKMW7Q.mjs.map +1 -0
  107. package/dist/esm/{chunk-WFK3XRQX.mjs → chunk-3RCAJICY.mjs} +2 -2
  108. package/dist/esm/chunk-3RCAJICY.mjs.map +1 -0
  109. package/dist/esm/{chunk-KCWRCWNT.mjs → chunk-43GCGE6C.mjs} +2 -2
  110. package/dist/esm/chunk-43GCGE6C.mjs.map +1 -0
  111. package/dist/esm/{chunk-4DP3PEYK.mjs → chunk-4EUS4E6S.mjs} +2 -2
  112. package/dist/esm/chunk-4EUS4E6S.mjs.map +1 -0
  113. package/dist/esm/chunk-4RXKALLC.mjs +2 -0
  114. package/dist/esm/chunk-4RXKALLC.mjs.map +1 -0
  115. package/dist/esm/chunk-4YLUM62M.mjs +2 -0
  116. package/dist/esm/chunk-4YLUM62M.mjs.map +1 -0
  117. package/dist/esm/{chunk-SNYYEVJA.mjs → chunk-4ZYPDCSP.mjs} +2 -2
  118. package/dist/esm/chunk-4ZYPDCSP.mjs.map +1 -0
  119. package/dist/esm/{chunk-F2WY2DEY.mjs → chunk-5EBUWO2M.mjs} +2 -2
  120. package/dist/esm/chunk-5EBUWO2M.mjs.map +1 -0
  121. package/dist/esm/{chunk-5LGKGWLX.mjs → chunk-5EYTHMRZ.mjs} +2 -2
  122. package/dist/esm/chunk-5EYTHMRZ.mjs.map +1 -0
  123. package/dist/esm/{chunk-DBTKJMLV.mjs → chunk-5PXDPMF2.mjs} +2 -2
  124. package/dist/esm/chunk-5PXDPMF2.mjs.map +1 -0
  125. package/dist/esm/chunk-5VMAJTTV.mjs +2 -0
  126. package/dist/esm/chunk-5VMAJTTV.mjs.map +1 -0
  127. package/dist/esm/{chunk-YEWZAR76.mjs → chunk-5YWH3XPN.mjs} +2 -2
  128. package/dist/esm/chunk-5YWH3XPN.mjs.map +1 -0
  129. package/dist/esm/{chunk-QI7OREBM.mjs → chunk-67ZVDKJF.mjs} +2 -2
  130. package/dist/esm/chunk-67ZVDKJF.mjs.map +1 -0
  131. package/dist/esm/{chunk-U6OCK6T4.mjs → chunk-6CXMDJQR.mjs} +2 -2
  132. package/dist/esm/chunk-6CXMDJQR.mjs.map +1 -0
  133. package/dist/esm/chunk-6IEZPA4H.mjs +2 -0
  134. package/dist/esm/chunk-6IEZPA4H.mjs.map +1 -0
  135. package/dist/esm/{chunk-N62NUAHT.mjs → chunk-6YHDZLRN.mjs} +2 -2
  136. package/dist/esm/chunk-6YHDZLRN.mjs.map +1 -0
  137. package/dist/esm/chunk-6YWYAVFS.mjs +2 -0
  138. package/dist/esm/chunk-6YWYAVFS.mjs.map +1 -0
  139. package/dist/esm/chunk-77AEKF7K.mjs +2 -0
  140. package/dist/esm/{chunk-YD2BMHH7.mjs.map → chunk-77AEKF7K.mjs.map} +1 -1
  141. package/dist/esm/{chunk-XOLU6UP3.mjs → chunk-7IY3DTEF.mjs} +2 -2
  142. package/dist/esm/chunk-7IY3DTEF.mjs.map +1 -0
  143. package/dist/esm/{chunk-2CJC43CV.mjs → chunk-A5L76YP7.mjs} +1 -1
  144. package/dist/esm/chunk-A5L76YP7.mjs.map +1 -0
  145. package/dist/esm/{chunk-ICMELYCL.mjs → chunk-AFEHO5PP.mjs} +2 -2
  146. package/dist/esm/chunk-AFEHO5PP.mjs.map +1 -0
  147. package/dist/esm/{chunk-NK67FECB.mjs → chunk-AXYARCYT.mjs} +2 -2
  148. package/dist/esm/chunk-AXYARCYT.mjs.map +1 -0
  149. package/dist/esm/{chunk-AOROYJ74.mjs → chunk-AZWVCBK2.mjs} +2 -2
  150. package/dist/esm/chunk-AZWVCBK2.mjs.map +1 -0
  151. package/dist/esm/{chunk-U3T4ZT7B.mjs → chunk-BGSEBFFC.mjs} +2 -2
  152. package/dist/esm/chunk-BGSEBFFC.mjs.map +1 -0
  153. package/dist/esm/{chunk-6ZOVTYLJ.mjs → chunk-BI3BTSUB.mjs} +2 -2
  154. package/dist/esm/chunk-BI3BTSUB.mjs.map +1 -0
  155. package/dist/esm/{chunk-OIOGOW6I.mjs → chunk-C3Q23D22.mjs} +1 -1
  156. package/dist/esm/chunk-C3Q23D22.mjs.map +1 -0
  157. package/dist/esm/{chunk-VQZMI3EZ.mjs → chunk-CWKNJZB6.mjs} +2 -2
  158. package/dist/esm/chunk-CWKNJZB6.mjs.map +1 -0
  159. package/dist/esm/{chunk-V4FKFCBL.mjs → chunk-DAFSKSZ5.mjs} +1 -1
  160. package/dist/esm/chunk-DAFSKSZ5.mjs.map +1 -0
  161. package/dist/esm/{chunk-IBZKCBN5.mjs → chunk-DOQV5BSA.mjs} +2 -2
  162. package/dist/esm/chunk-DOQV5BSA.mjs.map +1 -0
  163. package/dist/esm/chunk-DPW6ELCQ.mjs +2 -0
  164. package/dist/esm/chunk-DPW6ELCQ.mjs.map +1 -0
  165. package/dist/esm/{chunk-IK2NYNKG.mjs → chunk-DYATTONT.mjs} +2 -2
  166. package/dist/esm/chunk-DYATTONT.mjs.map +1 -0
  167. package/dist/esm/{chunk-ALNQK276.mjs → chunk-E5HGSOG2.mjs} +2 -2
  168. package/dist/esm/chunk-E5HGSOG2.mjs.map +1 -0
  169. package/dist/esm/{chunk-2MN7DW2J.mjs → chunk-E7JDVKFY.mjs} +2 -2
  170. package/dist/esm/chunk-E7JDVKFY.mjs.map +1 -0
  171. package/dist/esm/{chunk-AJ5JHBAE.mjs → chunk-EBMEXURY.mjs} +2 -2
  172. package/dist/esm/chunk-EBMEXURY.mjs.map +1 -0
  173. package/dist/esm/chunk-EMURYYVO.mjs +2 -0
  174. package/dist/esm/chunk-EMURYYVO.mjs.map +1 -0
  175. package/dist/esm/chunk-F2ZTBAJJ.mjs +2 -0
  176. package/dist/esm/chunk-F2ZTBAJJ.mjs.map +1 -0
  177. package/dist/esm/{chunk-UGIHQFID.mjs → chunk-FIEMUPXF.mjs} +2 -2
  178. package/dist/esm/chunk-FIEMUPXF.mjs.map +1 -0
  179. package/dist/esm/{chunk-AKIO3OIT.mjs → chunk-FN4C3CKC.mjs} +2 -2
  180. package/dist/esm/chunk-FN4C3CKC.mjs.map +1 -0
  181. package/dist/esm/{chunk-H3C3VTHS.mjs → chunk-FZD5RWSZ.mjs} +2 -2
  182. package/dist/esm/chunk-FZD5RWSZ.mjs.map +1 -0
  183. package/dist/esm/{chunk-T6ADNZE5.mjs → chunk-G4O6FXCF.mjs} +2 -2
  184. package/dist/esm/chunk-G4O6FXCF.mjs.map +1 -0
  185. package/dist/esm/{chunk-GMKKHGXK.mjs → chunk-GOXRBEIJ.mjs} +1 -1
  186. package/dist/esm/chunk-GOXRBEIJ.mjs.map +1 -0
  187. package/dist/esm/chunk-GP4TLDVZ.mjs +1 -0
  188. package/dist/esm/chunk-GP4TLDVZ.mjs.map +1 -0
  189. package/dist/esm/{chunk-BAEIZAP7.mjs → chunk-HBH2NQKU.mjs} +2 -2
  190. package/dist/esm/chunk-HBH2NQKU.mjs.map +1 -0
  191. package/dist/esm/{chunk-ZMMLM6ZJ.mjs → chunk-IDTLNF4M.mjs} +2 -2
  192. package/dist/esm/chunk-IDTLNF4M.mjs.map +1 -0
  193. package/dist/esm/{chunk-PXMNAP2Q.mjs → chunk-IEUEMBFD.mjs} +2 -2
  194. package/dist/esm/chunk-IEUEMBFD.mjs.map +1 -0
  195. package/dist/esm/{chunk-6Q2O5G3J.mjs → chunk-IF4UU2MT.mjs} +1 -1
  196. package/dist/esm/chunk-IF4UU2MT.mjs.map +1 -0
  197. package/dist/esm/{chunk-LPVGVTWT.mjs → chunk-JBEUUULP.mjs} +2 -2
  198. package/dist/esm/chunk-JBEUUULP.mjs.map +1 -0
  199. package/dist/esm/chunk-JJM6ELMS.mjs +2 -0
  200. package/dist/esm/chunk-JJM6ELMS.mjs.map +1 -0
  201. package/dist/esm/{chunk-2ESU5N3V.mjs → chunk-KOORZTHC.mjs} +2 -2
  202. package/dist/esm/chunk-KOORZTHC.mjs.map +1 -0
  203. package/dist/esm/{chunk-2QGJDHME.mjs → chunk-KVM2SGSF.mjs} +2 -2
  204. package/dist/esm/chunk-KVM2SGSF.mjs.map +1 -0
  205. package/dist/esm/{chunk-5PVZ4N42.mjs → chunk-M77M6NSB.mjs} +2 -2
  206. package/dist/esm/chunk-M77M6NSB.mjs.map +1 -0
  207. package/dist/esm/{chunk-G4KAHJXB.mjs → chunk-MCLYDS3O.mjs} +2 -2
  208. package/dist/esm/chunk-MCLYDS3O.mjs.map +1 -0
  209. package/dist/esm/{chunk-46O23AOD.mjs → chunk-MLSAZJZK.mjs} +2 -2
  210. package/dist/esm/chunk-MLSAZJZK.mjs.map +1 -0
  211. package/dist/esm/{chunk-BRV3RLKW.mjs → chunk-MT2RJ7H3.mjs} +2 -2
  212. package/dist/esm/chunk-MT2RJ7H3.mjs.map +1 -0
  213. package/dist/esm/chunk-MWBRD43V.mjs +2 -0
  214. package/dist/esm/chunk-MWBRD43V.mjs.map +1 -0
  215. package/dist/esm/{chunk-ACVIE7IE.mjs → chunk-N4DM5FYH.mjs} +2 -2
  216. package/dist/esm/chunk-N4DM5FYH.mjs.map +1 -0
  217. package/dist/esm/{chunk-LGTOOAQI.mjs → chunk-N6YTF76Q.mjs} +2 -2
  218. package/dist/esm/chunk-N6YTF76Q.mjs.map +1 -0
  219. package/dist/esm/{chunk-7N7FEBZA.mjs → chunk-NBNZ53ZV.mjs} +2 -2
  220. package/dist/esm/chunk-NBNZ53ZV.mjs.map +1 -0
  221. package/dist/esm/{chunk-CX6KECGV.mjs → chunk-NWLJ6RW7.mjs} +2 -2
  222. package/dist/esm/chunk-NWLJ6RW7.mjs.map +1 -0
  223. package/dist/esm/{chunk-VIZHWYI5.mjs → chunk-NYETBDSR.mjs} +2 -2
  224. package/dist/esm/chunk-NYETBDSR.mjs.map +1 -0
  225. package/dist/esm/{chunk-SK3LIS4Z.mjs → chunk-OEQ2U7GK.mjs} +2 -2
  226. package/dist/esm/chunk-OEQ2U7GK.mjs.map +1 -0
  227. package/dist/esm/{chunk-2C27NY4D.mjs → chunk-OHZURQPY.mjs} +2 -2
  228. package/dist/esm/chunk-OHZURQPY.mjs.map +1 -0
  229. package/dist/esm/{chunk-333QBK32.mjs → chunk-ONTWK5FU.mjs} +2 -2
  230. package/dist/esm/chunk-ONTWK5FU.mjs.map +1 -0
  231. package/dist/esm/chunk-OR6GFWLG.mjs +2 -0
  232. package/dist/esm/chunk-OR6GFWLG.mjs.map +1 -0
  233. package/dist/esm/{chunk-42H7WETG.mjs → chunk-ORMOQWWH.mjs} +2 -2
  234. package/dist/esm/chunk-ORMOQWWH.mjs.map +1 -0
  235. package/dist/esm/{chunk-S5SQJRAV.mjs → chunk-OROPNHRY.mjs} +2 -2
  236. package/dist/esm/chunk-OROPNHRY.mjs.map +1 -0
  237. package/dist/esm/{chunk-VWGB5BHW.mjs → chunk-OSBRPVVI.mjs} +2 -2
  238. package/dist/esm/chunk-OSBRPVVI.mjs.map +1 -0
  239. package/dist/esm/{chunk-NZ7M6NG2.mjs → chunk-P7A5RILV.mjs} +2 -2
  240. package/dist/esm/{chunk-JNO7KPMG.mjs → chunk-Q4C4U6I4.mjs} +2 -2
  241. package/dist/esm/chunk-Q4C4U6I4.mjs.map +1 -0
  242. package/dist/esm/{chunk-HMMNQFVM.mjs → chunk-QHC5DKVZ.mjs} +2 -2
  243. package/dist/esm/chunk-QHC5DKVZ.mjs.map +1 -0
  244. package/dist/esm/{chunk-F45G3GP3.mjs → chunk-QHEKBHNU.mjs} +2 -2
  245. package/dist/esm/chunk-QQEK7WVP.mjs +2 -0
  246. package/dist/esm/chunk-QQEK7WVP.mjs.map +1 -0
  247. package/dist/esm/{chunk-J7PJSK3J.mjs → chunk-RJ7F4JDV.mjs} +1 -1
  248. package/dist/esm/chunk-RJ7F4JDV.mjs.map +1 -0
  249. package/dist/esm/{chunk-BUAHUVAD.mjs → chunk-ROT6S6BM.mjs} +2 -2
  250. package/dist/esm/chunk-ROT6S6BM.mjs.map +1 -0
  251. package/dist/esm/{chunk-LKKI2KAP.mjs → chunk-S4LZMY2L.mjs} +2 -2
  252. package/dist/esm/chunk-S4LZMY2L.mjs.map +1 -0
  253. package/dist/esm/{chunk-33CVOPIN.mjs → chunk-S7RZGC56.mjs} +2 -2
  254. package/dist/esm/{chunk-33CVOPIN.mjs.map → chunk-S7RZGC56.mjs.map} +1 -1
  255. package/dist/esm/{chunk-SPRNSFUV.mjs → chunk-STY74NUA.mjs} +2 -2
  256. package/dist/esm/chunk-STY74NUA.mjs.map +1 -0
  257. package/dist/esm/{chunk-ZMBXHMVQ.mjs → chunk-TOBQ5UE6.mjs} +2 -2
  258. package/dist/esm/chunk-TOBQ5UE6.mjs.map +1 -0
  259. package/dist/esm/{chunk-7T26VA2W.mjs → chunk-UC23V7PU.mjs} +2 -2
  260. package/dist/esm/chunk-UC23V7PU.mjs.map +1 -0
  261. package/dist/esm/{chunk-4MTSP4S2.mjs → chunk-V6VPMNWJ.mjs} +2 -2
  262. package/dist/esm/chunk-V6VPMNWJ.mjs.map +1 -0
  263. package/dist/esm/{chunk-JMPHD4BP.mjs → chunk-VUIHJIMX.mjs} +2 -2
  264. package/dist/esm/chunk-VUIHJIMX.mjs.map +1 -0
  265. package/dist/esm/{chunk-2KSMV5KD.mjs → chunk-VV4HCOJQ.mjs} +2 -2
  266. package/dist/esm/chunk-VV4HCOJQ.mjs.map +1 -0
  267. package/dist/esm/{chunk-XZN344G4.mjs → chunk-VVXBVJXD.mjs} +2 -2
  268. package/dist/esm/chunk-VVXBVJXD.mjs.map +1 -0
  269. package/dist/esm/{chunk-IHGA5KAD.mjs → chunk-W4BSN6SK.mjs} +1 -1
  270. package/dist/esm/chunk-W4BSN6SK.mjs.map +1 -0
  271. package/dist/esm/chunk-WCMW2L3P.mjs +2 -0
  272. package/dist/esm/chunk-WCMW2L3P.mjs.map +1 -0
  273. package/dist/esm/{chunk-UFPYCROT.mjs → chunk-WQRGDSPD.mjs} +2 -2
  274. package/dist/esm/chunk-WQRGDSPD.mjs.map +1 -0
  275. package/dist/esm/chunk-WUWPN7XV.mjs +2 -0
  276. package/dist/esm/chunk-WUWPN7XV.mjs.map +1 -0
  277. package/dist/esm/{chunk-LA5HJILW.mjs → chunk-X6UNY6YM.mjs} +2 -2
  278. package/dist/esm/chunk-X6UNY6YM.mjs.map +1 -0
  279. package/dist/esm/chunk-XJJVJOX5.mjs +2 -0
  280. package/dist/esm/{chunk-UGTIALNW.mjs.map → chunk-XJJVJOX5.mjs.map} +1 -1
  281. package/dist/esm/{chunk-OPO5EYF7.mjs → chunk-XKUIMGKU.mjs} +2 -2
  282. package/dist/esm/chunk-XKUIMGKU.mjs.map +1 -0
  283. package/dist/esm/chunk-XTJOA5QN.mjs +2 -0
  284. package/dist/esm/chunk-XTJOA5QN.mjs.map +1 -0
  285. package/dist/esm/chunk-XTOIL6MB.mjs +2 -0
  286. package/dist/esm/chunk-XTOIL6MB.mjs.map +1 -0
  287. package/dist/esm/{chunk-ZMS3AOEZ.mjs → chunk-XY43TPRH.mjs} +2 -2
  288. package/dist/esm/chunk-XY43TPRH.mjs.map +1 -0
  289. package/dist/esm/{chunk-EGV3HFE3.mjs → chunk-XYB6KYKW.mjs} +2 -2
  290. package/dist/esm/chunk-XYB6KYKW.mjs.map +1 -0
  291. package/dist/esm/{chunk-RCA73RVB.mjs → chunk-XZ4JRYCE.mjs} +2 -2
  292. package/dist/esm/chunk-XZ4JRYCE.mjs.map +1 -0
  293. package/dist/esm/{chunk-4XB3BB5Z.mjs → chunk-YCQUYDZI.mjs} +2 -2
  294. package/dist/esm/chunk-YCQUYDZI.mjs.map +1 -0
  295. package/dist/esm/{chunk-HBIDHQ2M.mjs → chunk-YOZBVVKL.mjs} +1 -1
  296. package/dist/esm/chunk-YOZBVVKL.mjs.map +1 -0
  297. package/dist/esm/chunk-ZAIVZDOL.mjs +2 -0
  298. package/dist/esm/chunk-ZAIVZDOL.mjs.map +1 -0
  299. package/dist/esm/{chunk-ZXVN3HXB.mjs → chunk-ZGVNZE7J.mjs} +2 -2
  300. package/dist/esm/chunk-ZGVNZE7J.mjs.map +1 -0
  301. package/dist/esm/{chunk-YJVZFYBX.mjs → chunk-ZPV7HPA4.mjs} +2 -2
  302. package/dist/esm/chunk-ZPV7HPA4.mjs.map +1 -0
  303. package/dist/esm/cli/index.mjs +1 -1
  304. package/dist/esm/cli/localNode.d.mts +20 -8
  305. package/dist/esm/cli/localNode.mjs +1 -1
  306. package/dist/esm/cli/move.d.mts +26 -0
  307. package/dist/esm/cli/move.mjs +1 -1
  308. package/dist/esm/client/core.d.mts +4 -0
  309. package/dist/esm/client/core.mjs +1 -1
  310. package/dist/esm/client/get.d.mts +33 -1
  311. package/dist/esm/client/get.mjs +1 -1
  312. package/dist/esm/client/index.d.mts +1 -1
  313. package/dist/esm/client/index.mjs +1 -1
  314. package/dist/esm/client/post.d.mts +37 -0
  315. package/dist/esm/client/post.mjs +1 -1
  316. package/dist/esm/core/account/index.mjs +1 -1
  317. package/dist/esm/core/account/utils/address.d.mts +6 -0
  318. package/dist/esm/core/account/utils/address.mjs +1 -1
  319. package/dist/esm/core/account/utils/index.mjs +1 -1
  320. package/dist/esm/core/accountAddress.d.mts +46 -0
  321. package/dist/esm/core/accountAddress.mjs +1 -1
  322. package/dist/esm/core/authenticationKey.d.mts +1 -1
  323. package/dist/esm/core/authenticationKey.mjs +1 -1
  324. package/dist/esm/core/common.d.mts +14 -0
  325. package/dist/esm/core/common.mjs +1 -1
  326. package/dist/esm/core/crypto/ed25519.d.mts +57 -5
  327. package/dist/esm/core/crypto/ed25519.mjs +1 -1
  328. package/dist/esm/core/crypto/ephemeral.d.mts +23 -1
  329. package/dist/esm/core/crypto/ephemeral.mjs +1 -1
  330. package/dist/esm/core/crypto/federatedKeyless.d.mts +13 -1
  331. package/dist/esm/core/crypto/federatedKeyless.mjs +1 -1
  332. package/dist/esm/core/crypto/hdKey.d.mts +28 -0
  333. package/dist/esm/core/crypto/hdKey.mjs +1 -1
  334. package/dist/esm/core/crypto/index.d.mts +2 -2
  335. package/dist/esm/core/crypto/index.mjs +1 -1
  336. package/dist/esm/core/crypto/keyless.d.mts +131 -1
  337. package/dist/esm/core/crypto/keyless.mjs +1 -1
  338. package/dist/esm/core/crypto/multiEd25519.d.mts +41 -1
  339. package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
  340. package/dist/esm/core/crypto/multiKey.d.mts +38 -1
  341. package/dist/esm/core/crypto/multiKey.mjs +1 -1
  342. package/dist/esm/core/crypto/poseidon.d.mts +10 -0
  343. package/dist/esm/core/crypto/poseidon.mjs +1 -1
  344. package/dist/esm/core/crypto/privateKey.d.mts +9 -1
  345. package/dist/esm/core/crypto/privateKey.mjs +1 -1
  346. package/dist/esm/core/crypto/proof.d.mts +2 -0
  347. package/dist/esm/core/crypto/proof.mjs +1 -1
  348. package/dist/esm/core/crypto/publicKey.d.mts +1 -1
  349. package/dist/esm/core/crypto/publicKey.mjs +1 -1
  350. package/dist/esm/core/crypto/secp256k1.d.mts +50 -3
  351. package/dist/esm/core/crypto/secp256k1.mjs +1 -1
  352. package/dist/esm/core/crypto/signature.d.mts +6 -0
  353. package/dist/esm/core/crypto/signature.mjs +1 -1
  354. package/dist/esm/core/crypto/singleKey.d.mts +36 -2
  355. package/dist/esm/core/crypto/singleKey.mjs +1 -1
  356. package/dist/esm/core/crypto/utils.d.mts +2 -0
  357. package/dist/esm/core/crypto/utils.mjs +1 -1
  358. package/dist/esm/core/hex.d.mts +20 -0
  359. package/dist/esm/core/hex.mjs +1 -1
  360. package/dist/esm/core/index.d.mts +2 -2
  361. package/dist/esm/core/index.mjs +1 -1
  362. package/dist/esm/errors/index.mjs +1 -1
  363. package/dist/esm/index.d.mts +5 -4
  364. package/dist/esm/index.mjs +1 -1
  365. package/dist/esm/internal/account.d.mts +24 -4
  366. package/dist/esm/internal/account.mjs +1 -1
  367. package/dist/esm/internal/ans.d.mts +27 -2
  368. package/dist/esm/internal/ans.mjs +1 -1
  369. package/dist/esm/internal/coin.d.mts +3 -1
  370. package/dist/esm/internal/coin.mjs +1 -1
  371. package/dist/esm/internal/digitalAsset.d.mts +31 -2
  372. package/dist/esm/internal/digitalAsset.mjs +1 -1
  373. package/dist/esm/internal/event.d.mts +5 -0
  374. package/dist/esm/internal/event.mjs +1 -1
  375. package/dist/esm/internal/faucet.d.mts +5 -0
  376. package/dist/esm/internal/faucet.mjs +1 -1
  377. package/dist/esm/internal/fungibleAsset.d.mts +8 -2
  378. package/dist/esm/internal/fungibleAsset.mjs +1 -1
  379. package/dist/esm/internal/general.d.mts +7 -0
  380. package/dist/esm/internal/general.mjs +1 -1
  381. package/dist/esm/internal/keyless.d.mts +6 -2
  382. package/dist/esm/internal/keyless.mjs +1 -1
  383. package/dist/esm/internal/object.d.mts +2 -0
  384. package/dist/esm/internal/object.mjs +1 -1
  385. package/dist/esm/internal/staking.d.mts +5 -1
  386. package/dist/esm/internal/staking.mjs +1 -1
  387. package/dist/esm/internal/table.d.mts +3 -0
  388. package/dist/esm/internal/table.mjs +1 -1
  389. package/dist/esm/internal/transaction.d.mts +14 -0
  390. package/dist/esm/internal/transaction.mjs +1 -1
  391. package/dist/esm/internal/transactionSubmission.d.mts +16 -5
  392. package/dist/esm/internal/transactionSubmission.mjs +1 -1
  393. package/dist/esm/internal/view.d.mts +2 -1
  394. package/dist/esm/internal/view.mjs +1 -1
  395. package/dist/esm/{publicKey-BVXX1nVl.d.mts → publicKey-BMtGNNLg.d.mts} +36 -0
  396. package/dist/esm/transactions/authenticator/account.d.mts +28 -1
  397. package/dist/esm/transactions/authenticator/account.mjs +1 -1
  398. package/dist/esm/transactions/authenticator/index.d.mts +2 -1
  399. package/dist/esm/transactions/authenticator/index.mjs +1 -1
  400. package/dist/esm/transactions/authenticator/transaction.d.mts +23 -2
  401. package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
  402. package/dist/esm/transactions/index.d.mts +2 -1
  403. package/dist/esm/transactions/index.mjs +1 -1
  404. package/dist/esm/transactions/instances/chainId.d.mts +8 -0
  405. package/dist/esm/transactions/instances/chainId.mjs +1 -1
  406. package/dist/esm/transactions/instances/identifier.d.mts +8 -0
  407. package/dist/esm/transactions/instances/identifier.mjs +1 -1
  408. package/dist/esm/transactions/instances/index.d.mts +2 -1
  409. package/dist/esm/transactions/instances/index.mjs +1 -1
  410. package/dist/esm/transactions/instances/moduleId.d.mts +10 -0
  411. package/dist/esm/transactions/instances/moduleId.mjs +1 -1
  412. package/dist/esm/transactions/instances/multiAgentTransaction.d.mts +8 -0
  413. package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
  414. package/dist/esm/transactions/instances/rawTransaction.d.mts +30 -0
  415. package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
  416. package/dist/esm/transactions/instances/rotationProofChallenge.d.mts +7 -1
  417. package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
  418. package/dist/esm/transactions/instances/signedTransaction.d.mts +10 -1
  419. package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
  420. package/dist/esm/transactions/instances/simpleTransaction.d.mts +8 -0
  421. package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
  422. package/dist/esm/transactions/instances/transactionArgument.d.mts +16 -0
  423. package/dist/esm/transactions/instances/transactionPayload.d.mts +48 -0
  424. package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
  425. package/dist/esm/transactions/management/accountSequenceNumber.d.mts +19 -2
  426. package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
  427. package/dist/esm/transactions/management/asyncQueue.d.mts +16 -0
  428. package/dist/esm/transactions/management/asyncQueue.mjs +1 -1
  429. package/dist/esm/transactions/management/index.d.mts +3 -2
  430. package/dist/esm/transactions/management/index.mjs +1 -1
  431. package/dist/esm/transactions/management/transactionWorker.d.mts +45 -7
  432. package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
  433. package/dist/esm/transactions/transactionBuilder/helpers.d.mts +64 -1
  434. package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
  435. package/dist/esm/transactions/transactionBuilder/index.d.mts +2 -1
  436. package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
  437. package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +14 -1
  438. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
  439. package/dist/esm/transactions/transactionBuilder/signingMessage.d.mts +10 -1
  440. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
  441. package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +42 -1
  442. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
  443. package/dist/esm/transactions/typeTag/index.d.mts +82 -0
  444. package/dist/esm/transactions/typeTag/index.mjs +1 -1
  445. package/dist/esm/transactions/typeTag/parser.d.mts +8 -0
  446. package/dist/esm/transactions/typeTag/parser.mjs +1 -1
  447. package/dist/esm/transactions/types.d.mts +80 -1
  448. package/dist/esm/types/index.mjs +1 -1
  449. package/dist/esm/types/indexer.d.mts +52 -0
  450. package/dist/esm/types/keyless.d.mts +12 -0
  451. package/dist/esm/utils/apiEndpoints.d.mts +30 -0
  452. package/dist/esm/utils/apiEndpoints.mjs +1 -1
  453. package/dist/esm/utils/const.d.mts +24 -0
  454. package/dist/esm/utils/const.mjs +1 -1
  455. package/dist/esm/utils/helpers.d.mts +20 -0
  456. package/dist/esm/utils/helpers.mjs +1 -1
  457. package/dist/esm/utils/index.mjs +1 -1
  458. package/dist/esm/utils/memoize.d.mts +4 -0
  459. package/dist/esm/utils/memoize.mjs +1 -1
  460. package/dist/esm/utils/normalizeBundle.d.mts +8 -0
  461. package/dist/esm/utils/normalizeBundle.mjs +1 -1
  462. package/dist/esm/version.d.mts +1 -1
  463. package/dist/esm/version.mjs +1 -1
  464. package/package.json +19 -20
  465. package/src/account/AbstractKeylessAccount.ts +80 -9
  466. package/src/account/Account.ts +51 -6
  467. package/src/account/AccountUtils.ts +216 -0
  468. package/src/account/Ed25519Account.ts +26 -0
  469. package/src/account/EphemeralKeyPair.ts +30 -0
  470. package/src/account/FederatedKeylessAccount.ts +10 -3
  471. package/src/account/KeylessAccount.ts +13 -1
  472. package/src/account/MultiKeyAccount.ts +75 -12
  473. package/src/account/SingleKeyAccount.ts +63 -6
  474. package/src/account/index.ts +1 -0
  475. package/src/account/utils.ts +16 -0
  476. package/src/api/account.ts +22 -2
  477. package/src/api/ans.ts +15 -0
  478. package/src/api/aptos.ts +3 -0
  479. package/src/api/aptosConfig.ts +24 -0
  480. package/src/api/coin.ts +3 -0
  481. package/src/api/digitalAsset.ts +26 -0
  482. package/src/api/event.ts +6 -0
  483. package/src/api/faucet.ts +11 -2
  484. package/src/api/fungibleAsset.ts +8 -0
  485. package/src/api/general.ts +12 -0
  486. package/src/api/keyless.ts +6 -0
  487. package/src/api/object.ts +3 -0
  488. package/src/api/staking.ts +5 -0
  489. package/src/api/table.ts +5 -0
  490. package/src/api/transaction.ts +19 -3
  491. package/src/api/transactionSubmission/build.ts +4 -0
  492. package/src/api/transactionSubmission/helpers.ts +2 -0
  493. package/src/api/transactionSubmission/management.ts +5 -0
  494. package/src/api/transactionSubmission/sign.ts +4 -0
  495. package/src/api/transactionSubmission/simulate.ts +4 -0
  496. package/src/api/transactionSubmission/submit.ts +4 -0
  497. package/src/api/utils.ts +1 -0
  498. package/src/bcs/deserializer.ts +47 -1
  499. package/src/bcs/serializable/entryFunctionBytes.ts +10 -0
  500. package/src/bcs/serializable/fixedBytes.ts +12 -0
  501. package/src/bcs/serializable/movePrimitives.ts +26 -0
  502. package/src/bcs/serializable/moveStructs.ts +56 -0
  503. package/src/bcs/serializer.ts +64 -1
  504. package/src/cli/localNode.ts +22 -8
  505. package/src/cli/move.ts +26 -0
  506. package/src/client/core.ts +4 -0
  507. package/src/client/get.ts +75 -1
  508. package/src/client/post.ts +37 -0
  509. package/src/core/account/utils/address.ts +6 -0
  510. package/src/core/accountAddress.ts +46 -0
  511. package/src/core/authenticationKey.ts +22 -0
  512. package/src/core/common.ts +14 -0
  513. package/src/core/crypto/ed25519.ts +58 -4
  514. package/src/core/crypto/ephemeral.ts +22 -0
  515. package/src/core/crypto/federatedKeyless.ts +12 -0
  516. package/src/core/crypto/hdKey.ts +29 -0
  517. package/src/core/crypto/keyless.ts +134 -0
  518. package/src/core/crypto/multiEd25519.ts +40 -0
  519. package/src/core/crypto/multiKey.ts +37 -1
  520. package/src/core/crypto/poseidon.ts +20 -0
  521. package/src/core/crypto/privateKey.ts +8 -0
  522. package/src/core/crypto/proof.ts +2 -0
  523. package/src/core/crypto/publicKey.ts +14 -0
  524. package/src/core/crypto/secp256k1.ts +49 -2
  525. package/src/core/crypto/signature.ts +8 -0
  526. package/src/core/crypto/singleKey.ts +34 -2
  527. package/src/core/crypto/utils.ts +2 -0
  528. package/src/core/hex.ts +20 -0
  529. package/src/internal/account.ts +27 -7
  530. package/src/internal/ans.ts +27 -0
  531. package/src/internal/coin.ts +1 -0
  532. package/src/internal/digitalAsset.ts +30 -0
  533. package/src/internal/event.ts +6 -0
  534. package/src/internal/faucet.ts +5 -0
  535. package/src/internal/fungibleAsset.ts +5 -0
  536. package/src/internal/general.ts +7 -0
  537. package/src/internal/keyless.ts +4 -0
  538. package/src/internal/object.ts +2 -0
  539. package/src/internal/staking.ts +5 -1
  540. package/src/internal/table.ts +3 -0
  541. package/src/internal/transaction.ts +16 -0
  542. package/src/internal/transactionSubmission.ts +15 -2
  543. package/src/transactions/authenticator/account.ts +26 -0
  544. package/src/transactions/authenticator/transaction.ts +20 -0
  545. package/src/transactions/instances/chainId.ts +8 -0
  546. package/src/transactions/instances/identifier.ts +8 -0
  547. package/src/transactions/instances/moduleId.ts +10 -0
  548. package/src/transactions/instances/multiAgentTransaction.ts +8 -0
  549. package/src/transactions/instances/rawTransaction.ts +30 -0
  550. package/src/transactions/instances/rotationProofChallenge.ts +6 -0
  551. package/src/transactions/instances/signedTransaction.ts +8 -0
  552. package/src/transactions/instances/simpleTransaction.ts +8 -0
  553. package/src/transactions/instances/transactionArgument.ts +16 -0
  554. package/src/transactions/instances/transactionPayload.ts +50 -0
  555. package/src/transactions/management/accountSequenceNumber.ts +16 -0
  556. package/src/transactions/management/asyncQueue.ts +16 -0
  557. package/src/transactions/management/transactionWorker.ts +42 -5
  558. package/src/transactions/transactionBuilder/helpers.ts +82 -10
  559. package/src/transactions/transactionBuilder/remoteAbi.ts +20 -0
  560. package/src/transactions/transactionBuilder/signingMessage.ts +10 -0
  561. package/src/transactions/transactionBuilder/transactionBuilder.ts +58 -0
  562. package/src/transactions/typeTag/index.ts +82 -0
  563. package/src/transactions/typeTag/parser.ts +24 -0
  564. package/src/transactions/types.ts +78 -0
  565. package/src/types/indexer.ts +52 -0
  566. package/src/types/keyless.ts +12 -0
  567. package/src/utils/apiEndpoints.ts +30 -2
  568. package/src/utils/const.ts +24 -1
  569. package/src/utils/helpers.ts +22 -0
  570. package/src/utils/memoize.ts +6 -0
  571. package/src/utils/normalizeBundle.ts +8 -1
  572. package/src/version.ts +1 -1
  573. package/dist/common/chunk-F43XVDYJ.js.map +0 -1
  574. package/dist/esm/chunk-2C27NY4D.mjs.map +0 -1
  575. package/dist/esm/chunk-2CJC43CV.mjs.map +0 -1
  576. package/dist/esm/chunk-2ESU5N3V.mjs.map +0 -1
  577. package/dist/esm/chunk-2KSMV5KD.mjs.map +0 -1
  578. package/dist/esm/chunk-2MN7DW2J.mjs.map +0 -1
  579. package/dist/esm/chunk-2QGJDHME.mjs.map +0 -1
  580. package/dist/esm/chunk-333QBK32.mjs.map +0 -1
  581. package/dist/esm/chunk-372SLYVR.mjs +0 -2
  582. package/dist/esm/chunk-372SLYVR.mjs.map +0 -1
  583. package/dist/esm/chunk-42H7WETG.mjs.map +0 -1
  584. package/dist/esm/chunk-46O23AOD.mjs.map +0 -1
  585. package/dist/esm/chunk-4DI5SPSK.mjs +0 -2
  586. package/dist/esm/chunk-4DI5SPSK.mjs.map +0 -1
  587. package/dist/esm/chunk-4DP3PEYK.mjs.map +0 -1
  588. package/dist/esm/chunk-4MTSP4S2.mjs.map +0 -1
  589. package/dist/esm/chunk-4O5XDQDO.mjs +0 -2
  590. package/dist/esm/chunk-4O5XDQDO.mjs.map +0 -1
  591. package/dist/esm/chunk-4OV2A6PJ.mjs +0 -2
  592. package/dist/esm/chunk-4OV2A6PJ.mjs.map +0 -1
  593. package/dist/esm/chunk-4XB3BB5Z.mjs.map +0 -1
  594. package/dist/esm/chunk-5B3SMBXQ.mjs +0 -2
  595. package/dist/esm/chunk-5B3SMBXQ.mjs.map +0 -1
  596. package/dist/esm/chunk-5LGKGWLX.mjs.map +0 -1
  597. package/dist/esm/chunk-5PVZ4N42.mjs.map +0 -1
  598. package/dist/esm/chunk-6Q2O5G3J.mjs.map +0 -1
  599. package/dist/esm/chunk-6ZOVTYLJ.mjs.map +0 -1
  600. package/dist/esm/chunk-7N7FEBZA.mjs.map +0 -1
  601. package/dist/esm/chunk-7T26VA2W.mjs.map +0 -1
  602. package/dist/esm/chunk-7V35JAAF.mjs.map +0 -1
  603. package/dist/esm/chunk-ACVIE7IE.mjs.map +0 -1
  604. package/dist/esm/chunk-AJ5JHBAE.mjs.map +0 -1
  605. package/dist/esm/chunk-AKIO3OIT.mjs.map +0 -1
  606. package/dist/esm/chunk-ALNQK276.mjs.map +0 -1
  607. package/dist/esm/chunk-AOROYJ74.mjs.map +0 -1
  608. package/dist/esm/chunk-BAEIZAP7.mjs.map +0 -1
  609. package/dist/esm/chunk-BRV3RLKW.mjs.map +0 -1
  610. package/dist/esm/chunk-BUAHUVAD.mjs.map +0 -1
  611. package/dist/esm/chunk-C2HCRGQU.mjs +0 -2
  612. package/dist/esm/chunk-C2HCRGQU.mjs.map +0 -1
  613. package/dist/esm/chunk-CDEYH77E.mjs +0 -2
  614. package/dist/esm/chunk-CDEYH77E.mjs.map +0 -1
  615. package/dist/esm/chunk-CX6KECGV.mjs.map +0 -1
  616. package/dist/esm/chunk-D3OEQLUE.mjs +0 -2
  617. package/dist/esm/chunk-D3OEQLUE.mjs.map +0 -1
  618. package/dist/esm/chunk-DBTKJMLV.mjs.map +0 -1
  619. package/dist/esm/chunk-DC2IESER.mjs +0 -2
  620. package/dist/esm/chunk-DC2IESER.mjs.map +0 -1
  621. package/dist/esm/chunk-EGV3HFE3.mjs.map +0 -1
  622. package/dist/esm/chunk-ELXJ5A4B.mjs +0 -2
  623. package/dist/esm/chunk-ELXJ5A4B.mjs.map +0 -1
  624. package/dist/esm/chunk-F2WY2DEY.mjs.map +0 -1
  625. package/dist/esm/chunk-FZDEGDUY.mjs.map +0 -1
  626. package/dist/esm/chunk-G4KAHJXB.mjs.map +0 -1
  627. package/dist/esm/chunk-GAEAYY44.mjs +0 -1
  628. package/dist/esm/chunk-GMKKHGXK.mjs.map +0 -1
  629. package/dist/esm/chunk-GVNK3UMT.mjs.map +0 -1
  630. package/dist/esm/chunk-H3C3VTHS.mjs.map +0 -1
  631. package/dist/esm/chunk-HBIDHQ2M.mjs.map +0 -1
  632. package/dist/esm/chunk-HMMNQFVM.mjs.map +0 -1
  633. package/dist/esm/chunk-IBZKCBN5.mjs.map +0 -1
  634. package/dist/esm/chunk-ICMELYCL.mjs.map +0 -1
  635. package/dist/esm/chunk-IHGA5KAD.mjs.map +0 -1
  636. package/dist/esm/chunk-IK2NYNKG.mjs.map +0 -1
  637. package/dist/esm/chunk-J3E4UMBB.mjs +0 -2
  638. package/dist/esm/chunk-J3E4UMBB.mjs.map +0 -1
  639. package/dist/esm/chunk-J7PJSK3J.mjs.map +0 -1
  640. package/dist/esm/chunk-JMPHD4BP.mjs.map +0 -1
  641. package/dist/esm/chunk-JNO7KPMG.mjs.map +0 -1
  642. package/dist/esm/chunk-KCWRCWNT.mjs.map +0 -1
  643. package/dist/esm/chunk-L4SWQLAJ.mjs.map +0 -1
  644. package/dist/esm/chunk-LA5HJILW.mjs.map +0 -1
  645. package/dist/esm/chunk-LGTOOAQI.mjs.map +0 -1
  646. package/dist/esm/chunk-LKKI2KAP.mjs.map +0 -1
  647. package/dist/esm/chunk-LPVGVTWT.mjs.map +0 -1
  648. package/dist/esm/chunk-MHN6XY4Z.mjs +0 -2
  649. package/dist/esm/chunk-MHN6XY4Z.mjs.map +0 -1
  650. package/dist/esm/chunk-N62NUAHT.mjs.map +0 -1
  651. package/dist/esm/chunk-NK67FECB.mjs.map +0 -1
  652. package/dist/esm/chunk-OIOGOW6I.mjs.map +0 -1
  653. package/dist/esm/chunk-OPO5EYF7.mjs.map +0 -1
  654. package/dist/esm/chunk-P6KX7AS2.mjs +0 -2
  655. package/dist/esm/chunk-P6KX7AS2.mjs.map +0 -1
  656. package/dist/esm/chunk-PMGK5IHB.mjs.map +0 -1
  657. package/dist/esm/chunk-PXMNAP2Q.mjs.map +0 -1
  658. package/dist/esm/chunk-QI7OREBM.mjs.map +0 -1
  659. package/dist/esm/chunk-RCA73RVB.mjs.map +0 -1
  660. package/dist/esm/chunk-S5SQJRAV.mjs.map +0 -1
  661. package/dist/esm/chunk-SK3LIS4Z.mjs.map +0 -1
  662. package/dist/esm/chunk-SNYYEVJA.mjs.map +0 -1
  663. package/dist/esm/chunk-SPRNSFUV.mjs.map +0 -1
  664. package/dist/esm/chunk-T6ADNZE5.mjs.map +0 -1
  665. package/dist/esm/chunk-TCXYTPUR.mjs +0 -2
  666. package/dist/esm/chunk-TCXYTPUR.mjs.map +0 -1
  667. package/dist/esm/chunk-U3T4ZT7B.mjs.map +0 -1
  668. package/dist/esm/chunk-U6OCK6T4.mjs.map +0 -1
  669. package/dist/esm/chunk-UFPYCROT.mjs.map +0 -1
  670. package/dist/esm/chunk-UGIHQFID.mjs.map +0 -1
  671. package/dist/esm/chunk-UGTIALNW.mjs +0 -2
  672. package/dist/esm/chunk-V4FKFCBL.mjs.map +0 -1
  673. package/dist/esm/chunk-V5NDNR36.mjs +0 -2
  674. package/dist/esm/chunk-V5NDNR36.mjs.map +0 -1
  675. package/dist/esm/chunk-VIZHWYI5.mjs.map +0 -1
  676. package/dist/esm/chunk-VQZMI3EZ.mjs.map +0 -1
  677. package/dist/esm/chunk-VWGB5BHW.mjs.map +0 -1
  678. package/dist/esm/chunk-WFK3XRQX.mjs.map +0 -1
  679. package/dist/esm/chunk-XOLU6UP3.mjs.map +0 -1
  680. package/dist/esm/chunk-XZN344G4.mjs.map +0 -1
  681. package/dist/esm/chunk-YD2BMHH7.mjs +0 -2
  682. package/dist/esm/chunk-YEWZAR76.mjs.map +0 -1
  683. package/dist/esm/chunk-YJVZFYBX.mjs.map +0 -1
  684. package/dist/esm/chunk-ZMBXHMVQ.mjs.map +0 -1
  685. package/dist/esm/chunk-ZMMLM6ZJ.mjs.map +0 -1
  686. package/dist/esm/chunk-ZMS3AOEZ.mjs.map +0 -1
  687. package/dist/esm/chunk-ZXVN3HXB.mjs.map +0 -1
  688. /package/dist/esm/{chunk-GAEAYY44.mjs.map → account/AccountUtils.mjs.map} +0 -0
  689. /package/dist/esm/{chunk-NZ7M6NG2.mjs.map → chunk-P7A5RILV.mjs.map} +0 -0
  690. /package/dist/esm/{chunk-F45G3GP3.mjs.map → chunk-QHEKBHNU.mjs.map} +0 -0
@@ -0,0 +1,2 @@
1
+ import{b as s}from"./chunk-STY74NUA.mjs";import{c as r}from"./chunk-56CNRT2K.mjs";var a=class d{constructor(e){this.buffer=new ArrayBuffer(e.length),new Uint8Array(this.buffer).set(e,0),this.offset=0}static fromHex(e){let i=s.hexInputToUint8Array(e);return new d(i)}read(e){if(this.offset+e>this.buffer.byteLength)throw new Error("Reached to the end of buffer");let i=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,i}remaining(){return this.buffer.byteLength-this.offset}deserializeStr(){let e=this.deserializeBytes();return new TextDecoder().decode(e)}deserializeOptionStr(){return this.deserializeOption("string")}deserializeOption(e,i){if(this.deserializeBool()){if(e==="string")return this.deserializeStr();if(e==="bytes")return this.deserializeBytes();if(e==="fixedBytes"){if(i===void 0)throw new Error("Fixed bytes length not provided");return this.deserializeFixedBytes(i)}return this.deserialize(e)}}deserializeBytes(){let e=this.deserializeUleb128AsU32();return new Uint8Array(this.read(e))}deserializeFixedBytes(e){return new Uint8Array(this.read(e))}deserializeBool(){let e=new Uint8Array(this.read(1))[0];if(e!==1&&e!==0)throw new Error("Invalid boolean value");return e===1}deserializeU8(){return new DataView(this.read(1)).getUint8(0)}deserializeU16(){return new DataView(this.read(2)).getUint16(0,!0)}deserializeU32(){return new DataView(this.read(4)).getUint32(0,!0)}deserializeU64(){let e=this.deserializeU32(),i=this.deserializeU32();return BigInt(BigInt(i)<<BigInt(32)|BigInt(e))}deserializeU128(){let e=this.deserializeU64(),i=this.deserializeU64();return BigInt(i<<BigInt(64)|e)}deserializeU256(){let e=this.deserializeU128(),i=this.deserializeU128();return BigInt(i<<BigInt(128)|e)}deserializeUleb128AsU32(){let e=BigInt(0),i=0;for(;e<r;){let t=this.deserializeU8();if(e|=BigInt(t&127)<<BigInt(i),!(t&128))break;i+=7}if(e>r)throw new Error("Overflow while parsing uleb128-encoded uint32 value");return Number(e)}deserialize(e){return e.deserialize(this)}deserializeVector(e){let i=this.deserializeUleb128AsU32(),t=new Array;for(let n=0;n<i;n+=1)t.push(this.deserialize(e));return t}};export{a};
2
+ //# sourceMappingURL=chunk-XTOIL6MB.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/bcs/deserializer.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/* eslint-disable no-bitwise */\nimport { MAX_U32_NUMBER } from \"./consts\";\nimport { Uint8, Uint16, Uint32, Uint64, Uint128, Uint256, HexInput } from \"../types\";\nimport { Hex } from \"../core/hex\";\n\n/**\n * This interface exists to define Deserializable<T> inputs for functions that\n * deserialize a byte buffer into a type T.\n * It is not intended to be implemented or extended, because Typescript has no support\n * for static methods in interfaces.\n *\n * @template T - The type that this will deserialize into.\n * @group Implementation\n * @category BCS\n */\nexport interface Deserializable<T> {\n /**\n * Deserializes the buffered bytes into an instance of the specified class type.\n * This function provides an alternative syntax for deserialization, allowing users to call\n * `deserializer.deserialize(MyClass)` instead of `MyClass.deserialize(deserializer)`.\n *\n * @param deserializer - The deserializer instance with the buffered bytes.\n * @returns The deserialized value of class type T.\n * @example\n * ```typescript\n * const deserializer = new Deserializer(new Uint8Array([1, 2, 3]));\n * const value = deserializer.deserialize(MyClass); // where MyClass has a `deserialize` function\n * // value is now an instance of MyClass\n * // equivalent to `const value = MyClass.deserialize(deserializer)`\n * ```\n * @group Implementation\n * @category BCS\n */\n deserialize(deserializer: Deserializer): T;\n}\n\n/**\n * A class that provides methods for deserializing various data types from a byte buffer.\n * It supports deserialization of primitive types, strings, and complex objects using a BCS (Binary Common Serialization) layout.\n * @group Implementation\n * @category BCS\n */\nexport class Deserializer {\n private buffer: ArrayBuffer;\n\n private offset: number;\n\n /**\n * Creates a new instance of the class with a copy of the provided data buffer.\n * This prevents outside mutation of the buffer.\n *\n * @param data - The data to be copied into the internal buffer as a Uint8Array.\n * @group Implementation\n * @category BCS\n */\n constructor(data: Uint8Array) {\n // copies data to prevent outside mutation of buffer.\n this.buffer = new ArrayBuffer(data.length);\n new Uint8Array(this.buffer).set(data, 0);\n this.offset = 0;\n }\n\n static fromHex(hex: HexInput): Deserializer {\n const data = Hex.hexInputToUint8Array(hex);\n return new Deserializer(data);\n }\n\n /**\n * Reads a specified number of bytes from the buffer and advances the offset.\n *\n * @param length - The number of bytes to read from the buffer.\n * @throws Throws an error if the read operation exceeds the buffer's length.\n * @group Implementation\n * @category BCS\n */\n private read(length: number): ArrayBuffer {\n if (this.offset + length > this.buffer.byteLength) {\n throw new Error(\"Reached to the end of buffer\");\n }\n\n const bytes = this.buffer.slice(this.offset, this.offset + length);\n this.offset += length;\n return bytes;\n }\n\n /**\n * Returns the number of bytes remaining in the buffer.\n *\n * This information is useful to determine if there's more data to be read.\n *\n * @returns The number of bytes remaining in the buffer.\n * @group Implementation\n * @category BCS\n */\n remaining(): number {\n return this.buffer.byteLength - this.offset;\n }\n\n /**\n * Deserializes a UTF-8 encoded string from a byte array. It first reads the length of the string in bytes,\n * followed by the actual byte content, and decodes it into a string.\n *\n * BCS layout for \"string\": string_length | string_content\n * where string_length is a u32 integer encoded as a uleb128 integer, equal to the number of bytes in string_content.\n *\n * @example\n * ```typescript\n * const deserializer = new Deserializer(new Uint8Array([8, 49, 50, 51, 52, 97, 98, 99, 100]));\n * assert(deserializer.deserializeStr() === \"1234abcd\");\n * ```\n * @group Implementation\n * @category BCS\n */\n deserializeStr(): string {\n const value = this.deserializeBytes();\n const textDecoder = new TextDecoder();\n return textDecoder.decode(value);\n }\n\n /**\n * @deprecated use `deserializeOption(\"string\")` instead.\n *\n * The BCS layout for Optional<String> is 0 if none, else 1 followed by the string length and string content.\n * @returns The deserialized string if it exists, otherwise undefined.\n * @example\n * ```typescript\n * const deserializer = new Deserializer(new Uint8Array([0x00]));\n * assert(deserializer.deserializeOptionStr() === undefined);\n * const deserializer = new Deserializer(new Uint8Array([1, 8, 49, 50, 51, 52, 97, 98, 99, 100]));\n * assert(deserializer.deserializeOptionStr() === \"1234abcd\");\n * ```\n */\n deserializeOptionStr(): string | undefined {\n return this.deserializeOption(\"string\");\n }\n\n /**\n * Deserializes an optional value from the buffer.\n *\n * The BCS layout for Optional<T> starts with a boolean byte (0 if none, 1 if some),\n * followed by the value if present.\n *\n * @template T - The type of the value to deserialize\n * @param type - Either a Deserializable class or one of the string literals: \"string\", \"bytes\", or \"fixedBytes\"\n * @param len - Required length when type is \"fixedBytes\", ignored otherwise\n * @returns The deserialized value if present, undefined otherwise\n *\n * @throws {Error} When \"fixedBytes\" is specified without a length\n *\n * @example\n * ```typescript\n * // Deserialize an optional string\n * const deserializer = new Deserializer(new Uint8Array([1, 3, 97, 98, 99]));\n * const optStr = deserializer.deserializeOption(\"string\");\n * // optStr === \"abc\"\n *\n * // Deserialize an optional custom type\n * const deserializer = new Deserializer(new Uint8Array([0]));\n * const optValue = deserializer.deserializeOption(MyClass);\n * // optValue === undefined\n *\n * // Deserialize optional bytes\n * const deserializer = new Deserializer(new Uint8Array([1, 3, 1, 2, 3]));\n * const optBytes = deserializer.deserializeOption(\"bytes\");\n * // optBytes === Uint8Array[1, 2, 3]\n *\n * // Deserialize optional fixed bytes\n * const deserializer = new Deserializer(new Uint8Array([1, 1, 2, 3, 4]));\n * const optBytes = deserializer.deserializeOption(\"fixedBytes\", 4);\n * // optBytes === Uint8Array[1, 2, 3, 4]\n * ```\n * @group Implementation\n * @category BCS\n */\n deserializeOption(type: \"string\"): string | undefined;\n deserializeOption(type: \"bytes\"): Uint8Array | undefined;\n deserializeOption(type: \"fixedBytes\", len: number): Uint8Array | undefined;\n deserializeOption<T>(type: Deserializable<T>): T | undefined;\n deserializeOption<T>(\n type: Deserializable<T> | \"string\" | \"bytes\" | \"fixedBytes\",\n len?: number,\n ): T | string | Uint8Array | undefined {\n const exists = this.deserializeBool();\n if (!exists) return undefined;\n\n if (type === \"string\") {\n return this.deserializeStr();\n }\n if (type === \"bytes\") {\n return this.deserializeBytes();\n }\n if (type === \"fixedBytes\") {\n if (len === undefined) {\n throw new Error(\"Fixed bytes length not provided\");\n }\n return this.deserializeFixedBytes(len);\n }\n\n return this.deserialize(type);\n }\n\n /**\n * Deserializes an array of bytes.\n *\n * The BCS layout for \"bytes\" consists of a bytes_length followed by the bytes themselves, where bytes_length is a u32 integer\n * encoded as a uleb128 integer, indicating the length of the bytes array.\n *\n * @returns {Uint8Array} The deserialized array of bytes.\n * @group Implementation\n * @category BCS\n */\n deserializeBytes(): Uint8Array {\n const len = this.deserializeUleb128AsU32();\n return new Uint8Array(this.read(len));\n }\n\n /**\n * Deserializes an array of bytes of a specified length.\n *\n * @param len - The number of bytes to read from the source.\n * @group Implementation\n * @category BCS\n */\n deserializeFixedBytes(len: number): Uint8Array {\n return new Uint8Array(this.read(len));\n }\n\n /**\n * Deserializes a boolean value from a byte stream.\n *\n * The BCS layout for a boolean uses one byte, where \"0x01\" represents true and \"0x00\" represents false.\n * An error is thrown if the byte value is not valid.\n *\n * @returns The deserialized boolean value.\n * @throws Throws an error if the boolean value is invalid.\n * @group Implementation\n * @category BCS\n */\n deserializeBool(): boolean {\n const bool = new Uint8Array(this.read(1))[0];\n if (bool !== 1 && bool !== 0) {\n throw new Error(\"Invalid boolean value\");\n }\n return bool === 1;\n }\n\n /**\n * Deserializes a uint8 number from the binary data.\n *\n * BCS layout for \"uint8\": One byte. Binary format in little-endian representation.\n *\n * @returns {number} The deserialized uint8 number.\n * @group Implementation\n * @category BCS\n */\n deserializeU8(): Uint8 {\n return new DataView(this.read(1)).getUint8(0);\n }\n\n /**\n * Deserializes a uint16 number from a binary format in little-endian representation.\n *\n * BCS layout for \"uint16\": Two bytes.\n * @example\n * ```typescript\n * const deserializer = new Deserializer(new Uint8Array([0x34, 0x12]));\n * assert(deserializer.deserializeU16() === 4660);\n * ```\n * @group Implementation\n * @category BCS\n */\n deserializeU16(): Uint16 {\n return new DataView(this.read(2)).getUint16(0, true);\n }\n\n /**\n * Deserializes a uint32 number from a binary format in little-endian representation.\n *\n * BCS layout for \"uint32\": Four bytes.\n * @example\n * ```typescript\n * const deserializer = new Deserializer(new Uint8Array([0x78, 0x56, 0x34, 0x12]));\n * assert(deserializer.deserializeU32() === 305419896);\n * ```\n * @group Implementation\n * @category BCS\n */\n deserializeU32(): Uint32 {\n return new DataView(this.read(4)).getUint32(0, true);\n }\n\n /**\n * Deserializes a uint64 number.\n *\n * This function combines two 32-bit values to return a 64-bit unsigned integer in little-endian representation.\n * @example\n * ```typescript\n * const deserializer = new Deserializer(new Uint8Array([0x00, 0xEF, 0xCD, 0xAB, 0x78, 0x56, 0x34, 0x12]));\n * assert(deserializer.deserializeU64() === 1311768467750121216);\n * ```\n * @group Implementation\n * @category BCS\n */\n deserializeU64(): Uint64 {\n const low = this.deserializeU32();\n const high = this.deserializeU32();\n\n // combine the two 32-bit values and return (little endian)\n return BigInt((BigInt(high) << BigInt(32)) | BigInt(low));\n }\n\n /**\n * Deserializes a uint128 number from its binary representation.\n * This function combines two 64-bit values to return a single uint128 value in little-endian format.\n *\n * @returns {BigInt} The deserialized uint128 number.\n * @group Implementation\n * @category BCS\n */\n deserializeU128(): Uint128 {\n const low = this.deserializeU64();\n const high = this.deserializeU64();\n\n // combine the two 64-bit values and return (little endian)\n return BigInt((high << BigInt(64)) | low);\n }\n\n /**\n * Deserializes a uint256 number from its binary representation.\n *\n * The BCS layout for \"uint256\" consists of thirty-two bytes in little-endian format.\n *\n * @returns {BigInt} The deserialized uint256 number.\n * @group Implementation\n * @category BCS\n */\n deserializeU256(): Uint256 {\n const low = this.deserializeU128();\n const high = this.deserializeU128();\n\n // combine the two 128-bit values and return (little endian)\n return BigInt((high << BigInt(128)) | low);\n }\n\n /**\n * Deserializes a uleb128 encoded uint32 number.\n *\n * This function is used for interpreting lengths of variable-length sequences and tags of enum values in BCS encoding.\n *\n * @throws {Error} Throws an error if the parsed value exceeds the maximum uint32 number.\n * @returns {number} The deserialized uint32 value.\n * @group Implementation\n * @category BCS\n */\n deserializeUleb128AsU32(): Uint32 {\n let value: bigint = BigInt(0);\n let shift = 0;\n\n while (value < MAX_U32_NUMBER) {\n const byte = this.deserializeU8();\n value |= BigInt(byte & 0x7f) << BigInt(shift);\n\n if ((byte & 0x80) === 0) {\n break;\n }\n shift += 7;\n }\n\n if (value > MAX_U32_NUMBER) {\n throw new Error(\"Overflow while parsing uleb128-encoded uint32 value\");\n }\n\n return Number(value);\n }\n\n /**\n * Helper function that primarily exists to support alternative syntax for deserialization.\n * That is, if we have a `const deserializer: new Deserializer(...)`, instead of having to use\n * `MyClass.deserialize(deserializer)`, we can call `deserializer.deserialize(MyClass)`.\n *\n * @example const deserializer = new Deserializer(new Uint8Array([1, 2, 3]));\n * const value = deserializer.deserialize(MyClass); // where MyClass has a `deserialize` function\n * // value is now an instance of MyClass\n * // equivalent to `const value = MyClass.deserialize(deserializer)`\n * @param cls The BCS-deserializable class to deserialize the buffered bytes into.\n *\n * @returns the deserialized value of class type T\n * @group Implementation\n * @category BCS\n */\n deserialize<T>(cls: Deserializable<T>): T {\n // NOTE: `deserialize` in `cls.deserialize(this)` here is a static method defined in `cls`,\n // It is separate from the `deserialize` instance method defined here in Deserializer.\n return cls.deserialize(this);\n }\n\n /**\n * Deserializes an array of BCS Deserializable values given an existing Deserializer instance with a loaded byte buffer.\n *\n * @param cls The BCS-deserializable class to deserialize the buffered bytes into.\n * @returns An array of deserialized values of type T.\n * @example\n * // serialize a vector of addresses\n * const addresses = new Array<AccountAddress>(\n * AccountAddress.from(\"0x1\"),\n * AccountAddress.from(\"0x2\"),\n * AccountAddress.from(\"0xa\"),\n * AccountAddress.from(\"0xb\"),\n * );\n * const serializer = new Serializer();\n * serializer.serializeVector(addresses);\n * const serializedBytes = serializer.toUint8Array();\n *\n * // deserialize the bytes into an array of addresses\n * const deserializer = new Deserializer(serializedBytes);\n * const deserializedAddresses = deserializer.deserializeVector(AccountAddress);\n * // deserializedAddresses is now an array of AccountAddress instances\n * @group Implementation\n * @category BCS\n */\n deserializeVector<T>(cls: Deserializable<T>): Array<T> {\n const length = this.deserializeUleb128AsU32();\n const vector = new Array<T>();\n for (let i = 0; i < length; i += 1) {\n vector.push(this.deserialize(cls));\n }\n return vector;\n }\n}\n"],"mappings":"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","names":["Deserializer","_Deserializer","data","hex","Hex","length","bytes","value","type","len","bool","low","high","shift","MAX_U32_NUMBER","byte","cls","vector","i"]}
@@ -1,2 +1,2 @@
1
- import{h as e,i as s,j as t,k as o,l as r,m as i,n as a,o as m,p as c,q as g,r as u,s as p,t as d}from"./chunk-CX6KECGV.mjs";var A=class{constructor(n){this.config=n}async getOwnerAddress(n){return e({aptosConfig:this.config,...n})}async getExpiration(n){return t({aptosConfig:this.config,...n})}async getTargetAddress(n){return i({aptosConfig:this.config,...n})}async setTargetAddress(n){return a({aptosConfig:this.config,...n})}async getPrimaryName(n){return o({aptosConfig:this.config,...n})}async setPrimaryName(n){return r({aptosConfig:this.config,...n})}async registerName(n){return s({aptosConfig:this.config,...n})}async renewDomain(n){return d({aptosConfig:this.config,...n})}async getName(n){return m({aptosConfig:this.config,...n})}async getAccountNames(n){return c({aptosConfig:this.config,...n})}async getAccountDomains(n){return g({aptosConfig:this.config,...n})}async getAccountSubdomains(n){return u({aptosConfig:this.config,...n})}async getDomainSubdomains(n){return p({aptosConfig:this.config,...n})}};export{A as a};
2
- //# sourceMappingURL=chunk-ZMS3AOEZ.mjs.map
1
+ import{h as e,i as s,j as t,k as o,l as r,m as i,n as a,o as m,p as c,q as g,r as u,s as p,t as d}from"./chunk-NWLJ6RW7.mjs";var A=class{constructor(n){this.config=n}async getOwnerAddress(n){return e({aptosConfig:this.config,...n})}async getExpiration(n){return t({aptosConfig:this.config,...n})}async getTargetAddress(n){return i({aptosConfig:this.config,...n})}async setTargetAddress(n){return a({aptosConfig:this.config,...n})}async getPrimaryName(n){return o({aptosConfig:this.config,...n})}async setPrimaryName(n){return r({aptosConfig:this.config,...n})}async registerName(n){return s({aptosConfig:this.config,...n})}async renewDomain(n){return d({aptosConfig:this.config,...n})}async getName(n){return m({aptosConfig:this.config,...n})}async getAccountNames(n){return c({aptosConfig:this.config,...n})}async getAccountDomains(n){return g({aptosConfig:this.config,...n})}async getAccountSubdomains(n){return u({aptosConfig:this.config,...n})}async getDomainSubdomains(n){return p({aptosConfig:this.config,...n})}};export{A as a};
2
+ //# sourceMappingURL=chunk-XY43TPRH.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/api/ans.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Account } from \"../account\";\nimport { AccountAddress, AccountAddressInput } from \"../core\";\nimport {\n RegisterNameParameters,\n getExpiration,\n getOwnerAddress,\n registerName,\n getPrimaryName,\n setPrimaryName,\n getTargetAddress,\n setTargetAddress,\n renewDomain,\n getName,\n getAccountDomains,\n GetAccountDomainsArgs,\n GetAccountSubdomainsArgs,\n getAccountSubdomains,\n getAccountNames,\n GetAccountNamesArgs,\n getDomainSubdomains,\n GetDomainSubdomainsArgs,\n} from \"../internal/ans\";\nimport { GetANSNameResponse } from \"../types\";\nimport { InputGenerateTransactionOptions } from \"../transactions/types\";\nimport { AptosConfig } from \"./aptosConfig\";\nimport { SimpleTransaction } from \"../transactions/instances/simpleTransaction\";\n\n/**\n * A class to handle all `ANS` operations.\n * @group ANS\n */\nexport class ANS {\n /**\n * Initializes a new instance of the Aptos class with the provided configuration.\n * This allows you to interact with the Aptos blockchain using the specified network settings.\n *\n * @param config - The configuration settings for the Aptos client.\n * @param config.network - The network to connect to (e.g., mainnet, testnet).\n * @param config.nodeUrl - The URL of the Aptos node to connect to.\n * @param config.faucetUrl - The URL of the faucet to use for funding accounts.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * async function runExample() {\n * // Create a configuration for connecting to the Aptos testnet\n * const config = new AptosConfig({ network: Network.TESTNET });\n *\n * // Initialize the Aptos client with the configuration\n * const aptos = new Aptos(config);\n *\n * console.log(\"Aptos client initialized:\", aptos);\n * }\n * runExample().catch(console.error);\n * ```\n * @group ANS\n */\n constructor(readonly config: AptosConfig) {}\n\n /**\n * Retrieve the owner address of a specified domain name or subdomain name from the contract.\n *\n * @param args - The arguments for retrieving the owner address.\n * @param args.name - A string representing the name of the domain or subdomain to retrieve the owner address for.\n *\n * @returns AccountAddress if the name is owned, undefined otherwise.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Retrieve the owner address of \"test.aptos\"\n * const owner = await aptos.getOwnerAddress({ name: \"test.aptos\" });\n * console.log(owner); // Logs the owner address or undefined if not owned\n * }\n * runExample().catch(console.error);\n * ```\n * @group ANS\n */\n async getOwnerAddress(args: { name: string }): Promise<AccountAddress | undefined> {\n return getOwnerAddress({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Retrieve the expiration time of a domain name or subdomain name from the contract.\n *\n * @param args - The arguments for retrieving the expiration.\n * @param args.name - A string of the name to retrieve.\n *\n * @returns number as a unix timestamp in milliseconds.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Get the expiration time for the domain \"test.aptos\"\n * const exp = await aptos.getExpiration({ name: \"test.aptos\" });\n *\n * // Log the expiration date\n * console.log(new Date(exp)); // Outputs the expiration date\n * }\n * runExample().catch(console.error);\n * ```\n * @group ANS\n */\n async getExpiration(args: { name: string }): Promise<number | undefined> {\n return getExpiration({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Retrieve the target address of a domain or subdomain name, which indicates the address the name points to for use on-chain.\n * Note that the target address can point to addresses that do not own the name.\n *\n * @param args - The arguments for retrieving the target address.\n * @param args.name - A string representing the name, which can be a primary name, a subdomain, or a combination (e.g.,\n * \"primary\", \"primary.apt\", \"secondary.primary\", \"secondary.primary.apt\").\n *\n * @returns AccountAddress if the name has a target, undefined otherwise.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Retrieve the target address for the specified domain name\n * const targetAddr = await aptos.getTargetAddress({ name: \"test.aptos\" });\n *\n * console.log(targetAddr); // Logs the target address, e.g., 0x123...\n * }\n * runExample().catch(console.error);\n * ```\n * @group ANS\n */\n async getTargetAddress(args: { name: string }): Promise<AccountAddress | undefined> {\n return getTargetAddress({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Sets the target address of a domain or subdomain name, pointing it to a specified address for use on-chain.\n * The target address can be different from the owner of the name.\n *\n * @param args - The arguments for setting the target address.\n * @param args.sender - The account initiating the transaction.\n * @param args.name - A string representing the domain or subdomain name (e.g., \"test.aptos\").\n * @param args.address - The AccountAddressInput of the address to set the domain or subdomain to.\n * @param args.options - Optional settings for generating the transaction.\n *\n * @returns SimpleTransaction\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Setting the target address for a domain name\n * const sender = Account.generate(); // replace with a real account\n * const address = \"0x1\"; // replace with a real account address\n *\n * await aptos.setTargetAddress({\n * sender: sender,\n * name: \"test.aptos\",\n * address: address,\n * });\n *\n * const targetAddress = await aptos.getTargetAddress({ name: \"test.aptos\" });\n * console.log(targetAddress); // Should log the address set for \"test.aptos\"\n * }\n * runExample().catch(console.error);\n * ```\n * @group ANS\n */\n async setTargetAddress(args: {\n sender: Account;\n name: string;\n address: AccountAddressInput;\n options?: InputGenerateTransactionOptions;\n }): Promise<SimpleTransaction> {\n return setTargetAddress({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Retrieve the primary name for an account. An account can have multiple names, but only one primary name, which may not exist.\n *\n * @param args - The arguments for retrieving the primary name.\n * @param args.address - An AccountAddressInput (address) of the account.\n *\n * @returns A string if the account has a primary name, undefined otherwise.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Retrieve the primary name for the specified account address\n * const name = await aptos.getPrimaryName({ address: \"0x1\" }); // replace with a real account address\n * console.log(name);\n * }\n * runExample().catch(console.error);\n * ```\n * @group ANS\n */\n async getPrimaryName(args: { address: AccountAddressInput }): Promise<string | undefined> {\n return getPrimaryName({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Sets the primary name for the sender account, allowing them to designate a single primary name among potentially multiple\n * names. An account may not have a primary name.\n *\n * @param args - The arguments for setting the primary name.\n * @param args.sender - The sender account.\n * @param args.name - A string representing the name to set as primary (e.g., \"test.aptos\").\n * @param args.options - Optional transaction options.\n *\n * @returns SimpleTransaction\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Set the primary name for the sender account\n * const sender = Account.generate(); // replace with a real account\n * await aptos.setPrimaryName({ sender, name: \"test.aptos\" });\n *\n * const primaryName = await aptos.getPrimaryName({ address: sender.accountAddress });\n * console.log(\"Primary Name:\", primaryName); // Should log: \"Primary Name: test.aptos\"\n * }\n * runExample().catch(console.error);\n * ```\n * @group ANS\n */\n async setPrimaryName(args: {\n sender: Account;\n name?: string;\n options?: InputGenerateTransactionOptions;\n }): Promise<SimpleTransaction> {\n return setPrimaryName({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Registers a new name.\n *\n * This function allows you to register a domain or subdomain name with specific expiration policies and options.\n *\n * @param args.sender - The sender account.\n * @param args.name - A string of the name to register. This can be inclusive or exclusive of the .apt suffix. Examples include:\n * \"test\", \"test.apt\", \"test.aptos.apt\", etc.\n * @param args.expiration - An object with the expiration policy of the name.\n * @param args.expiration.policy - 'domain' | 'subdomain:follow-domain' | 'subdomain:independent'.\n * - domain: Years is required and the name will expire after the given number of years.\n * - subdomain:follow-domain: The name will expire at the same time as the domain name.\n * - subdomain:independent: The name will expire at the given date.\n * @param args.expiration.expirationDate - An epoch number in milliseconds of the date when the subdomain will expire. Only\n * applicable when the policy is set to 'subdomain:independent'.\n * @param args.transferable - Determines if the subdomain being minted is soul-bound. Applicable only to subdomains.\n * @param args.targetAddress optional - The address the domain name will resolve to. If not provided, the sender's address will\n * be used.\n * @param args.toAddress optional - The address to send the domain name to. If not provided, the transaction will be sent to the\n * router.\n *\n * @returns SimpleTransaction\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Registering a subdomain name assuming def.apt is already registered and belongs to the sender alice.\n * const txn = await aptos.registerName({\n * sender: \"0x1\", // replace with a real sender account\n * name: \"test.aptos.apt\",\n * expiration: {\n * policy: \"subdomain:independent\",\n * expirationDate: Date.now() + 30 * 24 * 60 * 60 * 1000, // expires in 30 days\n * },\n * });\n *\n * console.log(\"Transaction:\", txn);\n * }\n * runExample().catch(console.error);\n * ```\n * @group ANS\n */\n async registerName(args: Omit<RegisterNameParameters, \"aptosConfig\">): Promise<SimpleTransaction> {\n return registerName({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Renews a domain name for one year.\n * If a domain name was minted with V1 of the contract, it will automatically be upgraded to V2 via this transaction.\n *\n * @param args - The arguments for renewing the domain.\n * @param args.sender - The sender account, which must be the domain owner.\n * @param args.name - A string representing the domain to renew. Subdomains cannot be renewed.\n * @param args.years - The number of years to renew the name. Currently, only one year is permitted.\n * @param args.options - Optional transaction options.\n *\n * @returns SimpleTransaction\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Renew the domain \"test\" for one year\n * const transaction = await aptos.renewDomain({\n * sender: Account.generate(), // replace with a real account\n * name: \"test\"\n * });\n *\n * console.log(transaction);\n * }\n * runExample().catch(console.error);\n * ```\n * @group ANS\n */\n async renewDomain(args: {\n sender: Account;\n name: string;\n years?: 1;\n options?: InputGenerateTransactionOptions;\n }): Promise<SimpleTransaction> {\n return renewDomain({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Fetches a single name from the indexer based on the provided name argument.\n *\n * @param args - The arguments for retrieving the name.\n * @param args.name - A string of the name to retrieve, e.g. \"test.aptos.apt\" or \"test.apt\" or \"test\".\n * Can be inclusive or exclusive of the .apt suffix and can be a subdomain.\n *\n * @returns A promise of an ANSName or undefined if the name is not active.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Fetching a name from the indexer\n * const name = await aptos.getName({ name: \"test.aptos\" }); // replace with a real name\n * console.log(name);\n * }\n * runExample().catch(console.error);\n * ```\n * @group ANS\n */\n async getName(args: { name: string }): Promise<GetANSNameResponse[0] | undefined> {\n return getName({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Fetches all names for an account, including both top-level domains and subdomains.\n *\n * @param args - The arguments for fetching account names.\n * @param args.accountAddress - An AccountAddressInput of the address to retrieve names for.\n * @param args.options - Optional parameters for fetching names.\n * @param args.options.offset - Optional, the offset to start from when fetching names.\n * @param args.options.limit - Optional, a number of the names to fetch per request.\n * @param args.options.orderBy - The order to sort the names by.\n * @param args.options.where - Additional filters to apply to the query.\n *\n * @returns A promise of an array of ANSName.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Fetch account names for a specific address\n * const accountNames = await aptos.getAccountNames({\n * accountAddress: \"0x1\", // replace with a real account address\n * options: {\n * limit: 10, // specify how many names to fetch\n * orderBy: \"name\", // specify the order by which to sort the names\n * },\n * });\n *\n * console.log(accountNames);\n * }\n * runExample().catch(console.error);\n * ```\n * @group ANS\n */\n async getAccountNames(args: GetAccountNamesArgs): Promise<GetANSNameResponse> {\n return getAccountNames({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Fetches all top-level domain names for a specified account.\n *\n * @param args - The arguments for retrieving account domains.\n * @param args.accountAddress - An AccountAddressInput of the address to retrieve domain names for.\n * @param args.options.offset - Optional, the offset to start from when fetching names.\n * @param args.options.limit - Optional, a number of the names to fetch per request.\n * @param args.options.orderBy - The order to sort the names by.\n * @param args.options.where - Additional filters to apply to the query.\n *\n * @returns A promise of an array of ANSName.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Fetching all top-level domain names for a specific account\n * const domains = await aptos.getAccountDomains({\n * accountAddress: \"0x1\", // replace with a real account address\n * options: {\n * limit: 10, // specify the number of names to fetch\n * offset: 0, // specify the offset for pagination\n * orderBy: \"created_at\", // specify the order by which to sort the names\n * where: {\n * // additional filters can be specified here\n * },\n * },\n * });\n *\n * console.log(domains);\n * }\n * runExample().catch(console.error);\n * ```\n * @group ANS\n */\n async getAccountDomains(args: GetAccountDomainsArgs): Promise<GetANSNameResponse> {\n return getAccountDomains({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Fetches all subdomain names for a specified account.\n *\n * @param args - The arguments for retrieving subdomains.\n * @param args.accountAddress - The address to retrieve subdomain names for.\n * @param args.options - Optional parameters for fetching subdomains.\n * @param args.options.offset - The offset to start from when fetching names.\n * @param args.options.limit - The number of names to fetch per request.\n * @param args.options.orderBy - The order to sort the names by.\n * @param args.options.where - Additional filters to apply to the query.\n *\n * @returns A promise of an array of ANSName.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Fetching subdomain names for a specific account\n * const subdomains = await aptos.getAccountSubdomains({\n * accountAddress: \"0x1\", // replace with a real account address\n * options: {\n * limit: 10, // specify the number of subdomains to fetch\n * offset: 0, // specify the offset for pagination\n * orderBy: \"name\", // specify the order by which to sort the names\n * },\n * });\n *\n * console.log(subdomains);\n * }\n * runExample().catch(console.error);\n * ```\n * @group ANS\n */\n async getAccountSubdomains(args: GetAccountSubdomainsArgs): Promise<GetANSNameResponse> {\n return getAccountSubdomains({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Fetches all subdomain names for a given domain, excluding the domain itself.\n *\n * @param args - The arguments for fetching subdomains.\n * @param args.domain - A string of the domain name, e.g., \"test.apt\" or \"test\" (without the suffix of .apt).\n * @param args.options - Optional parameters for fetching subdomains.\n * @param args.options.offset - Optional, the offset to start from when fetching names.\n * @param args.options.limit - Optional, the number of names to fetch per request.\n * @param args.options.orderBy - The order to sort the names by.\n * @param args.options.where - Additional filters to apply to the query.\n *\n * @returns A promise that resolves to an array of ANSName.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Fetching subdomains for a specific domain\n * const subdomains = await aptos.getDomainSubdomains({\n * domain: \"test\", // replace with your domain\n * options: {\n * limit: 10, // specify the number of subdomains to fetch\n * offset: 0, // specify the starting point for fetching\n * orderBy: \"name\", // specify the order by which to sort the results\n * },\n * });\n *\n * console.log(subdomains);\n * }\n * runExample().catch(console.error);\n * ```\n * @group ANS\n */\n async getDomainSubdomains(args: GetDomainSubdomainsArgs): Promise<GetANSNameResponse> {\n return getDomainSubdomains({ aptosConfig: this.config, ...args });\n }\n}\n"],"mappings":"6HAkCO,IAAMA,EAAN,KAAU,CA2Bf,YAAqBC,EAAqB,CAArB,YAAAA,CAAsB,CA0B3C,MAAM,gBAAgBC,EAA6D,CACjF,OAAOC,EAAgB,CAAE,YAAa,KAAK,OAAQ,GAAGD,CAAK,CAAC,CAC9D,CA4BA,MAAM,cAAcA,EAAqD,CACvE,OAAOE,EAAc,CAAE,YAAa,KAAK,OAAQ,GAAGF,CAAK,CAAC,CAC5D,CA6BA,MAAM,iBAAiBA,EAA6D,CAClF,OAAOG,EAAiB,CAAE,YAAa,KAAK,OAAQ,GAAGH,CAAK,CAAC,CAC/D,CAuCA,MAAM,iBAAiBA,EAKQ,CAC7B,OAAOI,EAAiB,CAAE,YAAa,KAAK,OAAQ,GAAGJ,CAAK,CAAC,CAC/D,CA0BA,MAAM,eAAeA,EAAqE,CACxF,OAAOK,EAAe,CAAE,YAAa,KAAK,OAAQ,GAAGL,CAAK,CAAC,CAC7D,CAgCA,MAAM,eAAeA,EAIU,CAC7B,OAAOM,EAAe,CAAE,YAAa,KAAK,OAAQ,GAAGN,CAAK,CAAC,CAC7D,CAiDA,MAAM,aAAaA,EAA+E,CAChG,OAAOO,EAAa,CAAE,YAAa,KAAK,OAAQ,GAAGP,CAAK,CAAC,CAC3D,CAkCA,MAAM,YAAYA,EAKa,CAC7B,OAAOQ,EAAY,CAAE,YAAa,KAAK,OAAQ,GAAGR,CAAK,CAAC,CAC1D,CA2BA,MAAM,QAAQA,EAAoE,CAChF,OAAOS,EAAQ,CAAE,YAAa,KAAK,OAAQ,GAAGT,CAAK,CAAC,CACtD,CAsCA,MAAM,gBAAgBA,EAAwD,CAC5E,OAAOU,EAAgB,CAAE,YAAa,KAAK,OAAQ,GAAGV,CAAK,CAAC,CAC9D,CAyCA,MAAM,kBAAkBA,EAA0D,CAChF,OAAOW,EAAkB,CAAE,YAAa,KAAK,OAAQ,GAAGX,CAAK,CAAC,CAChE,CAuCA,MAAM,qBAAqBA,EAA6D,CACtF,OAAOY,EAAqB,CAAE,YAAa,KAAK,OAAQ,GAAGZ,CAAK,CAAC,CACnE,CAuCA,MAAM,oBAAoBA,EAA4D,CACpF,OAAOa,EAAoB,CAAE,YAAa,KAAK,OAAQ,GAAGb,CAAK,CAAC,CAClE,CACF","names":["ANS","config","args","getOwnerAddress","getExpiration","getTargetAddress","setTargetAddress","getPrimaryName","setPrimaryName","registerName","renewDomain","getName","getAccountNames","getAccountDomains","getAccountSubdomains","getDomainSubdomains"]}
@@ -1,2 +1,2 @@
1
- import{a as _}from"./chunk-SK3LIS4Z.mjs";import{g}from"./chunk-4OV2A6PJ.mjs";import{a as C}from"./chunk-P6KX7AS2.mjs";import{a as l}from"./chunk-5PVZ4N42.mjs";import{a as v}from"./chunk-U3T4ZT7B.mjs";import{i as k,l as E,m as S,n as b,q as y}from"./chunk-PXMNAP2Q.mjs";import{b as h}from"./chunk-KCWRCWNT.mjs";import{e as A,f as x}from"./chunk-LKKI2KAP.mjs";import{d as K}from"./chunk-F45G3GP3.mjs";import{j as w}from"./chunk-J7PJSK3J.mjs";import{a as u}from"./chunk-ZMMLM6ZJ.mjs";import{b as f}from"./chunk-SPRNSFUV.mjs";import{jwtDecode as T}from"jwt-decode";async function j(r){let{aptosConfig:i,jwt:a,ephemeralKeyPair:e,uidKey:p="sub",derivationPath:s}=r,t={jwt_b64:a,epk:e.getPublicKey().bcsToHex().toStringWithoutPrefix(),exp_date_secs:e.expiryDateSecs,epk_blinder:f.fromHexInput(e.blinder).toStringWithoutPrefix(),uid_key:p,derivation_path:s},{data:n}=await A({aptosConfig:i,path:"fetch",body:t,originMethod:"getPepper",overrides:{WITH_CREDENTIALS:!1}});return f.fromHexInput(n.pepper).toUint8Array()}async function F(r){let{aptosConfig:i,jwt:a,ephemeralKeyPair:e,pepper:p=await j(r),uidKey:s="sub",maxExpHorizonSecs:t=(await y({aptosConfig:i})).maxExpHorizonSecs}=r;if(f.fromHexInput(p).toUint8Array().length!==l.PEPPER_LENGTH)throw new Error(`Pepper needs to be ${l.PEPPER_LENGTH} bytes`);let n=T(a);if(typeof n.iat!="number")throw new Error("iat was not found");if(t<e.expiryDateSecs-n.iat)throw Error(`The EphemeralKeyPair is too long lived. It's lifespan must be less than ${t}`);let o={jwt_b64:a,epk:e.getPublicKey().bcsToHex().toStringWithoutPrefix(),epk_blinder:f.fromHexInput(e.blinder).toStringWithoutPrefix(),exp_date_secs:e.expiryDateSecs,exp_horizon_secs:t,pepper:f.fromHexInput(p).toStringWithoutPrefix(),uid_key:s},{data:c}=await x({aptosConfig:i,path:"prove",body:o,originMethod:"getProof",overrides:{WITH_CREDENTIALS:!1}}),d=c.proof,m=new E({a:d.a,b:d.b,c:d.c});return new b({proof:new S(m,0),trainingWheelsSignature:h.fromHex(c.training_wheels_signature),expHorizonSecs:t})}async function oe(r){let{aptosConfig:i,jwt:a,jwkAddress:e,uidKey:p,proofFetchCallback:s,pepper:t=await j(r)}=r,{verificationKey:n,maxExpHorizonSecs:o}=await y({aptosConfig:i}),c=F({...r,pepper:t,maxExpHorizonSecs:o}),d=s?c:await c;if(e!==void 0){let H=v.fromJwtAndPepper({jwt:a,pepper:t,jwkAddress:e,uidKey:p}),I=await g({aptosConfig:i,authenticationKey:H.authKey().derivedAddress()});return C.create({...r,address:I,proof:d,pepper:t,proofFetchCallback:s,jwkAddress:e,verificationKey:n})}let m=k.fromJwtAndPepper({jwt:a,pepper:t,uidKey:p}),P=await g({aptosConfig:i,authenticationKey:m.authKey().derivedAddress()});return l.create({...r,address:P,proof:d,pepper:t,proofFetchCallback:s,verificationKey:n})}async function re(r){let{aptosConfig:i,sender:a,iss:e,options:p}=r,{jwksUrl:s}=r;s===void 0&&(w.test(e)?s="https://www.googleapis.com/service_accounts/v1/jwk/securetoken@system.gserviceaccount.com":s=e.endsWith("/")?`${e}.well-known/jwks.json`:`${e}/.well-known/jwks.json`);let t;try{if(t=await fetch(s),!t.ok)throw new Error(`${t.status} ${t.statusText}`)}catch(o){let c;throw o instanceof Error?c=`${o.message}`:c=`error unknown - ${o}`,K.fromErrorType({type:14,details:`Failed to fetch JWKS at ${s}: ${c}`})}let n=await t.json();return _({aptosConfig:i,sender:a.accountAddress,data:{function:"0x1::jwks::update_federated_jwk_set",functionArguments:[e,u.MoveString(n.keys.map(o=>o.kid)),u.MoveString(n.keys.map(o=>o.alg)),u.MoveString(n.keys.map(o=>o.e)),u.MoveString(n.keys.map(o=>o.n))]},options:p})}export{j as a,F as b,oe as c,re as d};
2
- //# sourceMappingURL=chunk-EGV3HFE3.mjs.map
1
+ import{a as _}from"./chunk-OEQ2U7GK.mjs";import{g}from"./chunk-WUWPN7XV.mjs";import{a as l}from"./chunk-M77M6NSB.mjs";import{a as C}from"./chunk-ZAIVZDOL.mjs";import{a as v}from"./chunk-BGSEBFFC.mjs";import{i as k,l as E,m as S,n as b,q as y}from"./chunk-IEUEMBFD.mjs";import{b as h}from"./chunk-43GCGE6C.mjs";import{e as A,f as x}from"./chunk-S4LZMY2L.mjs";import{d as K}from"./chunk-QHEKBHNU.mjs";import{a as u}from"./chunk-IDTLNF4M.mjs";import{b as f}from"./chunk-STY74NUA.mjs";import{j as w}from"./chunk-RJ7F4JDV.mjs";import{jwtDecode as T}from"jwt-decode";async function j(r){let{aptosConfig:i,jwt:a,ephemeralKeyPair:e,uidKey:p="sub",derivationPath:s}=r,t={jwt_b64:a,epk:e.getPublicKey().bcsToHex().toStringWithoutPrefix(),exp_date_secs:e.expiryDateSecs,epk_blinder:f.fromHexInput(e.blinder).toStringWithoutPrefix(),uid_key:p,derivation_path:s},{data:n}=await A({aptosConfig:i,path:"fetch",body:t,originMethod:"getPepper",overrides:{WITH_CREDENTIALS:!1}});return f.fromHexInput(n.pepper).toUint8Array()}async function F(r){let{aptosConfig:i,jwt:a,ephemeralKeyPair:e,pepper:p=await j(r),uidKey:s="sub",maxExpHorizonSecs:t=(await y({aptosConfig:i})).maxExpHorizonSecs}=r;if(f.fromHexInput(p).toUint8Array().length!==l.PEPPER_LENGTH)throw new Error(`Pepper needs to be ${l.PEPPER_LENGTH} bytes`);let n=T(a);if(typeof n.iat!="number")throw new Error("iat was not found");if(t<e.expiryDateSecs-n.iat)throw Error(`The EphemeralKeyPair is too long lived. It's lifespan must be less than ${t}`);let o={jwt_b64:a,epk:e.getPublicKey().bcsToHex().toStringWithoutPrefix(),epk_blinder:f.fromHexInput(e.blinder).toStringWithoutPrefix(),exp_date_secs:e.expiryDateSecs,exp_horizon_secs:t,pepper:f.fromHexInput(p).toStringWithoutPrefix(),uid_key:s},{data:c}=await x({aptosConfig:i,path:"prove",body:o,originMethod:"getProof",overrides:{WITH_CREDENTIALS:!1}}),d=c.proof,m=new E({a:d.a,b:d.b,c:d.c});return new b({proof:new S(m,0),trainingWheelsSignature:h.fromHex(c.training_wheels_signature),expHorizonSecs:t})}async function oe(r){let{aptosConfig:i,jwt:a,jwkAddress:e,uidKey:p,proofFetchCallback:s,pepper:t=await j(r)}=r,{verificationKey:n,maxExpHorizonSecs:o}=await y({aptosConfig:i}),c=F({...r,pepper:t,maxExpHorizonSecs:o}),d=s?c:await c;if(e!==void 0){let H=v.fromJwtAndPepper({jwt:a,pepper:t,jwkAddress:e,uidKey:p}),I=await g({aptosConfig:i,authenticationKey:H.authKey().derivedAddress()});return C.create({...r,address:I,proof:d,pepper:t,proofFetchCallback:s,jwkAddress:e,verificationKey:n})}let m=k.fromJwtAndPepper({jwt:a,pepper:t,uidKey:p}),P=await g({aptosConfig:i,authenticationKey:m.authKey().derivedAddress()});return l.create({...r,address:P,proof:d,pepper:t,proofFetchCallback:s,verificationKey:n})}async function re(r){let{aptosConfig:i,sender:a,iss:e,options:p}=r,{jwksUrl:s}=r;s===void 0&&(w.test(e)?s="https://www.googleapis.com/service_accounts/v1/jwk/securetoken@system.gserviceaccount.com":s=e.endsWith("/")?`${e}.well-known/jwks.json`:`${e}/.well-known/jwks.json`);let t;try{if(t=await fetch(s),!t.ok)throw new Error(`${t.status} ${t.statusText}`)}catch(o){let c;throw o instanceof Error?c=`${o.message}`:c=`error unknown - ${o}`,K.fromErrorType({type:14,details:`Failed to fetch JWKS at ${s}: ${c}`})}let n=await t.json();return _({aptosConfig:i,sender:a.accountAddress,data:{function:"0x1::jwks::update_federated_jwk_set",functionArguments:[e,u.MoveString(n.keys.map(o=>o.kid)),u.MoveString(n.keys.map(o=>o.alg)),u.MoveString(n.keys.map(o=>o.e)),u.MoveString(n.keys.map(o=>o.n))]},options:p})}export{j as a,F as b,oe as c,re as d};
2
+ //# sourceMappingURL=chunk-XYB6KYKW.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/internal/keyless.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * This file contains the underlying implementations for exposed API surface in\n * the {@link api/keyless}. By moving the methods out into a separate file,\n * other namespaces and processes can access these methods without depending on the entire\n * keyless namespace and without having a dependency cycle error.\n * @group Implementation\n */\nimport { jwtDecode, JwtPayload } from \"jwt-decode\";\nimport { AptosConfig } from \"../api/aptosConfig\";\nimport { postAptosPepperService, postAptosProvingService } from \"../client\";\nimport {\n AccountAddressInput,\n EphemeralSignature,\n Groth16Zkp,\n Hex,\n KeylessPublicKey,\n MoveJWK,\n ZeroKnowledgeSig,\n ZkProof,\n getKeylessConfig,\n} from \"../core\";\nimport { HexInput, ZkpVariant } from \"../types\";\nimport { Account, EphemeralKeyPair, KeylessAccount, ProofFetchCallback } from \"../account\";\nimport { PepperFetchRequest, PepperFetchResponse, ProverRequest, ProverResponse } from \"../types/keyless\";\nimport { lookupOriginalAccountAddress } from \"./account\";\nimport { FederatedKeylessPublicKey } from \"../core/crypto/federatedKeyless\";\nimport { FederatedKeylessAccount } from \"../account/FederatedKeylessAccount\";\nimport { MoveVector } from \"../bcs\";\nimport { generateTransaction } from \"./transactionSubmission\";\nimport { InputGenerateTransactionOptions, SimpleTransaction } from \"../transactions\";\nimport { KeylessError, KeylessErrorType } from \"../errors\";\nimport { FIREBASE_AUTH_ISS_PATTERN } from \"../utils/const\";\n\n/**\n * Retrieves a pepper value based on the provided configuration and authentication details.\n *\n * @param args - The arguments required to fetch the pepper.\n * @param args.aptosConfig - The configuration object for Aptos.\n * @param args.jwt - The JSON Web Token used for authentication.\n * @param args.ephemeralKeyPair - The ephemeral key pair used for the operation.\n * @param args.uidKey - An optional unique identifier key (defaults to \"sub\").\n * @param args.derivationPath - An optional derivation path for the key.\n * @returns A Uint8Array containing the fetched pepper value.\n * @group Implementation\n */\nexport async function getPepper(args: {\n aptosConfig: AptosConfig;\n jwt: string;\n ephemeralKeyPair: EphemeralKeyPair;\n uidKey?: string;\n derivationPath?: string;\n}): Promise<Uint8Array> {\n const { aptosConfig, jwt, ephemeralKeyPair, uidKey = \"sub\", derivationPath } = args;\n\n const body = {\n jwt_b64: jwt,\n epk: ephemeralKeyPair.getPublicKey().bcsToHex().toStringWithoutPrefix(),\n exp_date_secs: ephemeralKeyPair.expiryDateSecs,\n epk_blinder: Hex.fromHexInput(ephemeralKeyPair.blinder).toStringWithoutPrefix(),\n uid_key: uidKey,\n derivation_path: derivationPath,\n };\n const { data } = await postAptosPepperService<PepperFetchRequest, PepperFetchResponse>({\n aptosConfig,\n path: \"fetch\",\n body,\n originMethod: \"getPepper\",\n overrides: { WITH_CREDENTIALS: false },\n });\n return Hex.fromHexInput(data.pepper).toUint8Array();\n}\n\n/**\n * Generates a zero-knowledge proof based on the provided parameters.\n * This function is essential for creating a signed proof that can be used in various cryptographic operations.\n *\n * @param args - The parameters required to generate the proof.\n * @param args.aptosConfig - The configuration settings for Aptos.\n * @param args.jwt - The JSON Web Token used for authentication.\n * @param args.ephemeralKeyPair - The ephemeral key pair used for generating the proof.\n * @param args.pepper - An optional hex input used to enhance security (default is generated if not provided).\n * @param args.uidKey - An optional string that specifies the unique identifier key (defaults to \"sub\").\n * @throws Error if the pepper length is not valid or if the ephemeral key pair's lifespan exceeds the maximum allowed.\n * @group Implementation\n */\nexport async function getProof(args: {\n aptosConfig: AptosConfig;\n jwt: string;\n ephemeralKeyPair: EphemeralKeyPair;\n pepper?: HexInput;\n uidKey?: string;\n maxExpHorizonSecs?: number;\n}): Promise<ZeroKnowledgeSig> {\n const {\n aptosConfig,\n jwt,\n ephemeralKeyPair,\n pepper = await getPepper(args),\n uidKey = \"sub\",\n maxExpHorizonSecs = (await getKeylessConfig({ aptosConfig })).maxExpHorizonSecs,\n } = args;\n if (Hex.fromHexInput(pepper).toUint8Array().length !== KeylessAccount.PEPPER_LENGTH) {\n throw new Error(`Pepper needs to be ${KeylessAccount.PEPPER_LENGTH} bytes`);\n }\n const decodedJwt = jwtDecode<JwtPayload>(jwt);\n if (typeof decodedJwt.iat !== \"number\") {\n throw new Error(\"iat was not found\");\n }\n if (maxExpHorizonSecs < ephemeralKeyPair.expiryDateSecs - decodedJwt.iat) {\n throw Error(`The EphemeralKeyPair is too long lived. It's lifespan must be less than ${maxExpHorizonSecs}`);\n }\n const json = {\n jwt_b64: jwt,\n epk: ephemeralKeyPair.getPublicKey().bcsToHex().toStringWithoutPrefix(),\n epk_blinder: Hex.fromHexInput(ephemeralKeyPair.blinder).toStringWithoutPrefix(),\n exp_date_secs: ephemeralKeyPair.expiryDateSecs,\n exp_horizon_secs: maxExpHorizonSecs,\n pepper: Hex.fromHexInput(pepper).toStringWithoutPrefix(),\n uid_key: uidKey,\n };\n\n const { data } = await postAptosProvingService<ProverRequest, ProverResponse>({\n aptosConfig,\n path: \"prove\",\n body: json,\n originMethod: \"getProof\",\n overrides: { WITH_CREDENTIALS: false },\n });\n\n const proofPoints = data.proof;\n const groth16Zkp = new Groth16Zkp({\n a: proofPoints.a,\n b: proofPoints.b,\n c: proofPoints.c,\n });\n\n const signedProof = new ZeroKnowledgeSig({\n proof: new ZkProof(groth16Zkp, ZkpVariant.Groth16),\n trainingWheelsSignature: EphemeralSignature.fromHex(data.training_wheels_signature),\n expHorizonSecs: maxExpHorizonSecs,\n });\n return signedProof;\n}\n\n/**\n * Derives a keyless account by fetching the necessary proof and looking up the original account address.\n * This function helps in creating a keyless account that can be used without managing private keys directly.\n *\n * @param args - The arguments required to derive the keyless account.\n * @param args.aptosConfig - The configuration settings for Aptos.\n * @param args.jwt - The JSON Web Token used for authentication.\n * @param args.ephemeralKeyPair - The ephemeral key pair used for cryptographic operations.\n * @param args.uidKey - An optional unique identifier key for the user.\n * @param args.pepper - An optional hexadecimal input used for additional security.\n * @param args.proofFetchCallback - An optional callback function to handle the proof fetch outcome.\n * @returns A keyless account object.\n * @group Implementation\n */\nexport async function deriveKeylessAccount(args: {\n aptosConfig: AptosConfig;\n jwt: string;\n ephemeralKeyPair: EphemeralKeyPair;\n uidKey?: string;\n pepper?: HexInput;\n proofFetchCallback?: ProofFetchCallback;\n}): Promise<KeylessAccount>;\n\nexport async function deriveKeylessAccount(args: {\n aptosConfig: AptosConfig;\n jwt: string;\n ephemeralKeyPair: EphemeralKeyPair;\n jwkAddress: AccountAddressInput;\n uidKey?: string;\n pepper?: HexInput;\n proofFetchCallback?: ProofFetchCallback;\n}): Promise<FederatedKeylessAccount>;\n\nexport async function deriveKeylessAccount(args: {\n aptosConfig: AptosConfig;\n jwt: string;\n ephemeralKeyPair: EphemeralKeyPair;\n jwkAddress?: AccountAddressInput;\n uidKey?: string;\n pepper?: HexInput;\n proofFetchCallback?: ProofFetchCallback;\n}): Promise<KeylessAccount | FederatedKeylessAccount> {\n const { aptosConfig, jwt, jwkAddress, uidKey, proofFetchCallback, pepper = await getPepper(args) } = args;\n const { verificationKey, maxExpHorizonSecs } = await getKeylessConfig({ aptosConfig });\n\n const proofPromise = getProof({ ...args, pepper, maxExpHorizonSecs });\n // If a callback is provided, pass in the proof as a promise to KeylessAccount.create. This will make the proof be fetched in the\n // background and the callback will handle the outcome of the fetch. This allows the developer to not have to block on the proof fetch\n // allowing for faster rendering of UX.\n //\n // If no callback is provided, the just await the proof fetch and continue synchronously.\n const proof = proofFetchCallback ? proofPromise : await proofPromise;\n\n // Look up the original address to handle key rotations and then instantiate the account.\n if (jwkAddress !== undefined) {\n const publicKey = FederatedKeylessPublicKey.fromJwtAndPepper({ jwt, pepper, jwkAddress, uidKey });\n const address = await lookupOriginalAccountAddress({\n aptosConfig,\n authenticationKey: publicKey.authKey().derivedAddress(),\n });\n\n return FederatedKeylessAccount.create({\n ...args,\n address,\n proof,\n pepper,\n proofFetchCallback,\n jwkAddress,\n verificationKey,\n });\n }\n\n const publicKey = KeylessPublicKey.fromJwtAndPepper({ jwt, pepper, uidKey });\n const address = await lookupOriginalAccountAddress({\n aptosConfig,\n authenticationKey: publicKey.authKey().derivedAddress(),\n });\n return KeylessAccount.create({ ...args, address, proof, pepper, proofFetchCallback, verificationKey });\n}\n\nexport interface JWKS {\n keys: MoveJWK[];\n}\n\nexport async function updateFederatedKeylessJwkSetTransaction(args: {\n aptosConfig: AptosConfig;\n sender: Account;\n iss: string;\n jwksUrl?: string;\n options?: InputGenerateTransactionOptions;\n}): Promise<SimpleTransaction> {\n const { aptosConfig, sender, iss, options } = args;\n\n let { jwksUrl } = args;\n\n if (jwksUrl === undefined) {\n if (FIREBASE_AUTH_ISS_PATTERN.test(iss)) {\n jwksUrl = \"https://www.googleapis.com/service_accounts/v1/jwk/securetoken@system.gserviceaccount.com\";\n } else {\n jwksUrl = iss.endsWith(\"/\") ? `${iss}.well-known/jwks.json` : `${iss}/.well-known/jwks.json`;\n }\n }\n\n let response: Response;\n\n try {\n response = await fetch(jwksUrl);\n if (!response.ok) {\n throw new Error(`${response.status} ${response.statusText}`);\n }\n } catch (error) {\n let errorMessage: string;\n if (error instanceof Error) {\n errorMessage = `${error.message}`;\n } else {\n errorMessage = `error unknown - ${error}`;\n }\n throw KeylessError.fromErrorType({\n type: KeylessErrorType.JWK_FETCH_FAILED_FEDERATED,\n details: `Failed to fetch JWKS at ${jwksUrl}: ${errorMessage}`,\n });\n }\n\n const jwks: JWKS = await response.json();\n return generateTransaction({\n aptosConfig,\n sender: sender.accountAddress,\n data: {\n function: \"0x1::jwks::update_federated_jwk_set\",\n functionArguments: [\n iss,\n MoveVector.MoveString(jwks.keys.map((key) => key.kid)),\n MoveVector.MoveString(jwks.keys.map((key) => key.alg)),\n MoveVector.MoveString(jwks.keys.map((key) => key.e)),\n MoveVector.MoveString(jwks.keys.map((key) => key.n)),\n ],\n },\n options,\n });\n}\n"],"mappings":"0gBAUA,OAAS,aAAAA,MAA6B,aAsCtC,eAAsBC,EAAUC,EAMR,CACtB,GAAM,CAAE,YAAAC,EAAa,IAAAC,EAAK,iBAAAC,EAAkB,OAAAC,EAAS,MAAO,eAAAC,CAAe,EAAIL,EAEzEM,EAAO,CACX,QAASJ,EACT,IAAKC,EAAiB,aAAa,EAAE,SAAS,EAAE,sBAAsB,EACtE,cAAeA,EAAiB,eAChC,YAAaI,EAAI,aAAaJ,EAAiB,OAAO,EAAE,sBAAsB,EAC9E,QAASC,EACT,gBAAiBC,CACnB,EACM,CAAE,KAAAG,CAAK,EAAI,MAAMC,EAAgE,CACrF,YAAAR,EACA,KAAM,QACN,KAAAK,EACA,aAAc,YACd,UAAW,CAAE,iBAAkB,EAAM,CACvC,CAAC,EACD,OAAOC,EAAI,aAAaC,EAAK,MAAM,EAAE,aAAa,CACpD,CAeA,eAAsBE,EAASV,EAOD,CAC5B,GAAM,CACJ,YAAAC,EACA,IAAAC,EACA,iBAAAC,EACA,OAAAQ,EAAS,MAAMZ,EAAUC,CAAI,EAC7B,OAAAI,EAAS,MACT,kBAAAQ,GAAqB,MAAMC,EAAiB,CAAE,YAAAZ,CAAY,CAAC,GAAG,iBAChE,EAAID,EACJ,GAAIO,EAAI,aAAaI,CAAM,EAAE,aAAa,EAAE,SAAWG,EAAe,cACpE,MAAM,IAAI,MAAM,sBAAsBA,EAAe,aAAa,QAAQ,EAE5E,IAAMC,EAAaC,EAAsBd,CAAG,EAC5C,GAAI,OAAOa,EAAW,KAAQ,SAC5B,MAAM,IAAI,MAAM,mBAAmB,EAErC,GAAIH,EAAoBT,EAAiB,eAAiBY,EAAW,IACnE,MAAM,MAAM,4EAA4EH,CAAiB,EAAE,EAE7G,IAAMK,EAAO,CACX,QAASf,EACT,IAAKC,EAAiB,aAAa,EAAE,SAAS,EAAE,sBAAsB,EACtE,YAAaI,EAAI,aAAaJ,EAAiB,OAAO,EAAE,sBAAsB,EAC9E,cAAeA,EAAiB,eAChC,iBAAkBS,EAClB,OAAQL,EAAI,aAAaI,CAAM,EAAE,sBAAsB,EACvD,QAASP,CACX,EAEM,CAAE,KAAAI,CAAK,EAAI,MAAMU,EAAuD,CAC5E,YAAAjB,EACA,KAAM,QACN,KAAMgB,EACN,aAAc,WACd,UAAW,CAAE,iBAAkB,EAAM,CACvC,CAAC,EAEKE,EAAcX,EAAK,MACnBY,EAAa,IAAIC,EAAW,CAChC,EAAGF,EAAY,EACf,EAAGA,EAAY,EACf,EAAGA,EAAY,CACjB,CAAC,EAOD,OALoB,IAAIG,EAAiB,CACvC,MAAO,IAAIC,EAAQH,GAA8B,EACjD,wBAAyBI,EAAmB,QAAQhB,EAAK,yBAAyB,EAClF,eAAgBI,CAClB,CAAC,CAEH,CAmCA,eAAsBa,GAAqBzB,EAQW,CACpD,GAAM,CAAE,YAAAC,EAAa,IAAAC,EAAK,WAAAwB,EAAY,OAAAtB,EAAQ,mBAAAuB,EAAoB,OAAAhB,EAAS,MAAMZ,EAAUC,CAAI,CAAE,EAAIA,EAC/F,CAAE,gBAAA4B,EAAiB,kBAAAhB,CAAkB,EAAI,MAAMC,EAAiB,CAAE,YAAAZ,CAAY,CAAC,EAE/E4B,EAAenB,EAAS,CAAE,GAAGV,EAAM,OAAAW,EAAQ,kBAAAC,CAAkB,CAAC,EAM9DkB,EAAQH,EAAqBE,EAAe,MAAMA,EAGxD,GAAIH,IAAe,OAAW,CAC5B,IAAMK,EAAYC,EAA0B,iBAAiB,CAAE,IAAA9B,EAAK,OAAAS,EAAQ,WAAAe,EAAY,OAAAtB,CAAO,CAAC,EAC1F6B,EAAU,MAAMC,EAA6B,CACjD,YAAAjC,EACA,kBAAmB8B,EAAU,QAAQ,EAAE,eAAe,CACxD,CAAC,EAED,OAAOI,EAAwB,OAAO,CACpC,GAAGnC,EACH,QAAAiC,EACA,MAAAH,EACA,OAAAnB,EACA,mBAAAgB,EACA,WAAAD,EACA,gBAAAE,CACF,CAAC,CACH,CAEA,IAAMG,EAAYK,EAAiB,iBAAiB,CAAE,IAAAlC,EAAK,OAAAS,EAAQ,OAAAP,CAAO,CAAC,EACrE6B,EAAU,MAAMC,EAA6B,CACjD,YAAAjC,EACA,kBAAmB8B,EAAU,QAAQ,EAAE,eAAe,CACxD,CAAC,EACD,OAAOjB,EAAe,OAAO,CAAE,GAAGd,EAAM,QAAAiC,EAAS,MAAAH,EAAO,OAAAnB,EAAQ,mBAAAgB,EAAoB,gBAAAC,CAAgB,CAAC,CACvG,CAMA,eAAsBS,GAAwCrC,EAM/B,CAC7B,GAAM,CAAE,YAAAC,EAAa,OAAAqC,EAAQ,IAAAC,EAAK,QAAAC,CAAQ,EAAIxC,EAE1C,CAAE,QAAAyC,CAAQ,EAAIzC,EAEdyC,IAAY,SACVC,EAA0B,KAAKH,CAAG,EACpCE,EAAU,4FAEVA,EAAUF,EAAI,SAAS,GAAG,EAAI,GAAGA,CAAG,wBAA0B,GAAGA,CAAG,0BAIxE,IAAII,EAEJ,GAAI,CAEF,GADAA,EAAW,MAAM,MAAMF,CAAO,EAC1B,CAACE,EAAS,GACZ,MAAM,IAAI,MAAM,GAAGA,EAAS,MAAM,IAAIA,EAAS,UAAU,EAAE,CAE/D,OAASC,EAAO,CACd,IAAIC,EACJ,MAAID,aAAiB,MACnBC,EAAe,GAAGD,EAAM,OAAO,GAE/BC,EAAe,mBAAmBD,CAAK,GAEnCE,EAAa,cAAc,CAC/B,QACA,QAAS,2BAA2BL,CAAO,KAAKI,CAAY,EAC9D,CAAC,CACH,CAEA,IAAME,EAAa,MAAMJ,EAAS,KAAK,EACvC,OAAOK,EAAoB,CACzB,YAAA/C,EACA,OAAQqC,EAAO,eACf,KAAM,CACJ,SAAU,sCACV,kBAAmB,CACjBC,EACAU,EAAW,WAAWF,EAAK,KAAK,IAAKG,GAAQA,EAAI,GAAG,CAAC,EACrDD,EAAW,WAAWF,EAAK,KAAK,IAAKG,GAAQA,EAAI,GAAG,CAAC,EACrDD,EAAW,WAAWF,EAAK,KAAK,IAAKG,GAAQA,EAAI,CAAC,CAAC,EACnDD,EAAW,WAAWF,EAAK,KAAK,IAAKG,GAAQA,EAAI,CAAC,CAAC,CACrD,CACF,EACA,QAAAV,CACF,CAAC,CACH","names":["jwtDecode","getPepper","args","aptosConfig","jwt","ephemeralKeyPair","uidKey","derivationPath","body","Hex","data","postAptosPepperService","getProof","pepper","maxExpHorizonSecs","getKeylessConfig","KeylessAccount","decodedJwt","jwtDecode","json","postAptosProvingService","proofPoints","groth16Zkp","Groth16Zkp","ZeroKnowledgeSig","ZkProof","EphemeralSignature","deriveKeylessAccount","jwkAddress","proofFetchCallback","verificationKey","proofPromise","proof","publicKey","FederatedKeylessPublicKey","address","lookupOriginalAccountAddress","FederatedKeylessAccount","KeylessPublicKey","updateFederatedKeylessJwkSetTransaction","sender","iss","options","jwksUrl","FIREBASE_AUTH_ISS_PATTERN","response","error","errorMessage","KeylessError","jwks","generateTransaction","MoveVector","key"]}
@@ -1,2 +1,2 @@
1
- import{a as l}from"./chunk-4MTSP4S2.mjs";import{a as o,b as c}from"./chunk-2CJC43CV.mjs";import{a as h,i as d}from"./chunk-SK3LIS4Z.mjs";import{g as u}from"./chunk-WFK3XRQX.mjs";import g from"eventemitter3";var m="fulfilled",f=(n=>(n.TransactionSent="transactionSent",n.TransactionSendFailed="transactionSendFailed",n.TransactionExecuted="transactionExecuted",n.TransactionExecutionFailed="transactionExecutionFailed",n.ExecutionFinish="executionFinish",n))(f||{}),p=class extends g{constructor(t,e,a=30,n=100,i=10){super();this.taskQueue=new o;this.transactionsQueue=new o;this.outstandingTransactions=new o;this.sentTransactions=[];this.executedTransactions=[];this.aptosConfig=t,this.account=e,this.started=!1,this.accountSequnceNumber=new l(t,e,a,n,i)}async submitNextTransaction(){try{for(;;){let t=await this.accountSequnceNumber.nextSequenceNumber();if(t===null)return;let e=await this.generateNextTransaction(this.account,t);if(!e)return;let a=d({aptosConfig:this.aptosConfig,transaction:e,signer:this.account});await this.outstandingTransactions.enqueue([a,t])}}catch(t){if(t instanceof c)return;throw new Error(`Submit transaction failed for ${this.account.accountAddress.toString()} with error ${t}`)}}async processTransactions(){try{for(;;){let t=[],e=[],[a,n]=await this.outstandingTransactions.dequeue();for(t.push(a),e.push(n);!this.outstandingTransactions.isEmpty();)[a,n]=await this.outstandingTransactions.dequeue(),t.push(a),e.push(n);let i=await Promise.allSettled(t);for(let s=0;s<i.length&&s<e.length;s+=1){let r=i[s];n=e[s],r.status===m?(this.sentTransactions.push([r.value.hash,n,null]),this.emit("transactionSent",{message:`transaction hash ${r.value.hash} has been committed to chain`,transactionHash:r.value.hash}),await this.checkTransaction(r,n)):(this.sentTransactions.push([r.status,n,r.reason]),this.emit("transactionSendFailed",{message:`failed to commit transaction ${this.sentTransactions.length} with error ${r.reason}`,error:r.reason}))}this.emit("executionFinish",{message:`execute ${i.length} transactions finished`})}}catch(t){if(t instanceof c)return;throw new Error(`Process execution failed for ${this.account.accountAddress.toString()} with error ${t}`)}}async checkTransaction(t,e){try{let a=[];a.push(u({aptosConfig:this.aptosConfig,transactionHash:t.value.hash}));let n=await Promise.allSettled(a);for(let i=0;i<n.length;i+=1){let s=n[i];s.status===m?(this.executedTransactions.push([s.value.hash,e,null]),this.emit("transactionExecuted",{message:`transaction hash ${s.value.hash} has been executed on chain`,transactionHash:t.value.hash})):(this.executedTransactions.push([s.status,e,s.reason]),this.emit("transactionExecutionFailed",{message:`failed to execute transaction ${this.executedTransactions.length} with error ${s.reason}`,error:s.reason}))}}catch(a){throw new Error(`Check transaction failed for ${this.account.accountAddress.toString()} with error ${a}`)}}async push(t,e){this.transactionsQueue.enqueue([t,e])}async generateNextTransaction(t,e){if(this.transactionsQueue.isEmpty())return;let[a,n]=await this.transactionsQueue.dequeue();return h({aptosConfig:this.aptosConfig,sender:t.accountAddress,data:a,options:{...n,accountSequenceNumber:e}})}async run(){try{for(;!this.taskQueue.isCancelled();)await(await this.taskQueue.dequeue())()}catch(t){throw new Error(`Unable to start transaction batching: ${t}`)}}start(){if(this.started)throw new Error("worker has already started");this.started=!0,this.taskQueue.enqueue(()=>this.submitNextTransaction()),this.taskQueue.enqueue(()=>this.processTransactions()),this.run()}stop(){if(this.taskQueue.isCancelled())throw new Error("worker has already stopped");this.started=!1,this.taskQueue.cancel()}};export{m as a,f as b,p as c};
2
- //# sourceMappingURL=chunk-RCA73RVB.mjs.map
1
+ import{a as l}from"./chunk-V6VPMNWJ.mjs";import{a as o,b as c}from"./chunk-A5L76YP7.mjs";import{a as h,i as d}from"./chunk-OEQ2U7GK.mjs";import{g as u}from"./chunk-3RCAJICY.mjs";import g from"eventemitter3";var m="fulfilled",f=(n=>(n.TransactionSent="transactionSent",n.TransactionSendFailed="transactionSendFailed",n.TransactionExecuted="transactionExecuted",n.TransactionExecutionFailed="transactionExecutionFailed",n.ExecutionFinish="executionFinish",n))(f||{}),p=class extends g{constructor(t,e,a=30,n=100,i=10){super();this.taskQueue=new o;this.transactionsQueue=new o;this.outstandingTransactions=new o;this.sentTransactions=[];this.executedTransactions=[];this.aptosConfig=t,this.account=e,this.started=!1,this.accountSequnceNumber=new l(t,e,a,n,i)}async submitNextTransaction(){try{for(;;){let t=await this.accountSequnceNumber.nextSequenceNumber();if(t===null)return;let e=await this.generateNextTransaction(this.account,t);if(!e)return;let a=d({aptosConfig:this.aptosConfig,transaction:e,signer:this.account});await this.outstandingTransactions.enqueue([a,t])}}catch(t){if(t instanceof c)return;throw new Error(`Submit transaction failed for ${this.account.accountAddress.toString()} with error ${t}`)}}async processTransactions(){try{for(;;){let t=[],e=[],[a,n]=await this.outstandingTransactions.dequeue();for(t.push(a),e.push(n);!this.outstandingTransactions.isEmpty();)[a,n]=await this.outstandingTransactions.dequeue(),t.push(a),e.push(n);let i=await Promise.allSettled(t);for(let s=0;s<i.length&&s<e.length;s+=1){let r=i[s];n=e[s],r.status===m?(this.sentTransactions.push([r.value.hash,n,null]),this.emit("transactionSent",{message:`transaction hash ${r.value.hash} has been committed to chain`,transactionHash:r.value.hash}),await this.checkTransaction(r,n)):(this.sentTransactions.push([r.status,n,r.reason]),this.emit("transactionSendFailed",{message:`failed to commit transaction ${this.sentTransactions.length} with error ${r.reason}`,error:r.reason}))}this.emit("executionFinish",{message:`execute ${i.length} transactions finished`})}}catch(t){if(t instanceof c)return;throw new Error(`Process execution failed for ${this.account.accountAddress.toString()} with error ${t}`)}}async checkTransaction(t,e){try{let a=[];a.push(u({aptosConfig:this.aptosConfig,transactionHash:t.value.hash}));let n=await Promise.allSettled(a);for(let i=0;i<n.length;i+=1){let s=n[i];s.status===m?(this.executedTransactions.push([s.value.hash,e,null]),this.emit("transactionExecuted",{message:`transaction hash ${s.value.hash} has been executed on chain`,transactionHash:t.value.hash})):(this.executedTransactions.push([s.status,e,s.reason]),this.emit("transactionExecutionFailed",{message:`failed to execute transaction ${this.executedTransactions.length} with error ${s.reason}`,error:s.reason}))}}catch(a){throw new Error(`Check transaction failed for ${this.account.accountAddress.toString()} with error ${a}`)}}async push(t,e){this.transactionsQueue.enqueue([t,e])}async generateNextTransaction(t,e){if(this.transactionsQueue.isEmpty())return;let[a,n]=await this.transactionsQueue.dequeue();return h({aptosConfig:this.aptosConfig,sender:t.accountAddress,data:a,options:{...n,accountSequenceNumber:e}})}async run(){try{for(;!this.taskQueue.isCancelled();)await(await this.taskQueue.dequeue())()}catch(t){throw new Error(`Unable to start transaction batching: ${t}`)}}start(){if(this.started)throw new Error("worker has already started");this.started=!0,this.taskQueue.enqueue(()=>this.submitNextTransaction()),this.taskQueue.enqueue(()=>this.processTransactions()),this.run()}stop(){if(this.taskQueue.isCancelled())throw new Error("worker has already stopped");this.started=!1,this.taskQueue.cancel()}};export{m as a,f as b,p as c};
2
+ //# sourceMappingURL=chunk-XZ4JRYCE.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/transactions/management/transactionWorker.ts"],"sourcesContent":["/* eslint-disable no-await-in-loop */\n\nimport EventEmitter from \"eventemitter3\";\nimport { AptosConfig } from \"../../api/aptosConfig\";\nimport { Account } from \"../../account\";\nimport { waitForTransaction } from \"../../internal/transaction\";\nimport { generateTransaction, signAndSubmitTransaction } from \"../../internal/transactionSubmission\";\nimport { PendingTransactionResponse, TransactionResponse } from \"../../types\";\nimport { InputGenerateTransactionOptions, InputGenerateTransactionPayloadData } from \"../types\";\nimport { AccountSequenceNumber } from \"./accountSequenceNumber\";\nimport { AsyncQueue, AsyncQueueCancelledError } from \"./asyncQueue\";\nimport { SimpleTransaction } from \"../instances/simpleTransaction\";\n\n/**\n * @group Implementation\n * @category Transactions\n */\nexport const promiseFulfilledStatus = \"fulfilled\";\n\n/**\n * Events emitted by the transaction worker during its operation, allowing the dapp to respond to various transaction states.\n * @group Implementation\n * @category Transactions\n */\nexport enum TransactionWorkerEventsEnum {\n // fired after a transaction gets sent to the chain\n TransactionSent = \"transactionSent\",\n // fired if there is an error sending the transaction to the chain\n TransactionSendFailed = \"transactionSendFailed\",\n // fired when a single transaction has executed successfully\n TransactionExecuted = \"transactionExecuted\",\n // fired if a single transaction fails in execution\n TransactionExecutionFailed = \"transactionExecutionFailed\",\n // fired when the worker has finished its job / when the queue has been emptied\n ExecutionFinish = \"executionFinish\",\n}\n\n/**\n * Defines the events emitted by the transaction worker during various stages of transaction processing. *\n * @group Implementation\n * @category Transactions\n */\nexport interface TransactionWorkerEvents {\n transactionSent: (data: SuccessEventData) => void;\n transactionSendFailed: (data: FailureEventData) => void;\n transactionExecuted: (data: SuccessEventData) => void;\n transactionExecutionFailed: (data: FailureEventData) => void;\n executionFinish: (data: ExecutionFinishEventData) => void;\n}\n\n/**\n * The payload for when the worker has finished its job.\n * @group Implementation\n * @category Transactions\n */\nexport type ExecutionFinishEventData = {\n message: string;\n};\n\n/**\n * The payload for a success event.\n * @group Implementation\n * @category Transactions\n */\nexport type SuccessEventData = {\n message: string;\n transactionHash: string;\n};\n\n/**\n * The payload for a failure event.\n * @group Implementation\n * @category Transactions\n */\nexport type FailureEventData = {\n message: string;\n error: string;\n};\n\n/**\n * TransactionWorker provides a simple framework for receiving payloads to be processed.\n *\n * Once one `start()` the process and pushes a new transaction, the worker acquires\n * the current account's next sequence number (by using the AccountSequenceNumber class),\n * generates a signed transaction and pushes an async submission process into the `outstandingTransactions` queue.\n * At the same time, the worker processes transactions by reading the `outstandingTransactions` queue\n * and submits the next transaction to chain, it\n * 1) waits for resolution of the submission process or get pre-execution validation error\n * and 2) waits for the resolution of the execution process or get an execution error.\n * The worker fires events for any submission and/or execution success and/or failure.\n * @group Implementation\n * @category Transactions\n */\nexport class TransactionWorker extends EventEmitter<TransactionWorkerEvents> {\n readonly aptosConfig: AptosConfig;\n\n readonly account: Account;\n\n // current account sequence number\n // TODO: Rename Sequnce -> Sequence\n readonly accountSequnceNumber: AccountSequenceNumber;\n\n readonly taskQueue: AsyncQueue<() => Promise<void>> = new AsyncQueue<() => Promise<void>>();\n\n // process has started\n started: boolean;\n\n /**\n * transactions payloads waiting to be generated and signed\n *\n * TODO support entry function payload from ABI builder\n * @group Implementation\n * @category Transactions\n */\n transactionsQueue = new AsyncQueue<\n [InputGenerateTransactionPayloadData, InputGenerateTransactionOptions | undefined]\n >();\n\n /**\n * signed transactions waiting to be submitted\n * @group Implementation\n * @category Transactions\n */\n outstandingTransactions = new AsyncQueue<[Promise<PendingTransactionResponse>, bigint]>();\n\n /**\n * transactions that have been submitted to chain\n * @group Implementation\n * @category Transactions\n */\n sentTransactions: Array<[string, bigint, any]> = [];\n\n /**\n * transactions that have been committed to chain\n * @group Implementation\n * @category Transactions\n */\n executedTransactions: Array<[string, bigint, any]> = [];\n\n /**\n * Initializes a new instance of the class, providing a framework for receiving payloads to be processed.\n *\n * @param aptosConfig - A configuration object for Aptos.\n * @param account - The account that will be used for sending transactions.\n * @param maxWaitTime - The maximum wait time to wait before re-syncing the sequence number to the current on-chain state,\n * default is 30 seconds.\n * @param maximumInFlight - The maximum number of transactions that can be submitted per account, default is 100.\n * @param sleepTime - The time to wait in seconds before re-evaluating if the maximum number of transactions are in flight,\n * default is 10 seconds.\n * @group Implementation\n * @category Transactions\n */\n constructor(\n aptosConfig: AptosConfig,\n account: Account,\n maxWaitTime: number = 30,\n maximumInFlight: number = 100,\n sleepTime: number = 10,\n ) {\n super();\n this.aptosConfig = aptosConfig;\n this.account = account;\n this.started = false;\n this.accountSequnceNumber = new AccountSequenceNumber(\n aptosConfig,\n account,\n maxWaitTime,\n maximumInFlight,\n sleepTime,\n );\n }\n\n /**\n * Submits the next transaction for the account by generating it with the current sequence number\n * and adding it to the outstanding transaction queue for processing.\n * This function continues to submit transactions until there are no more to process.\n *\n * @throws {Error} Throws an error if the transaction submission fails.\n * @group Implementation\n * @category Transactions\n */\n async submitNextTransaction() {\n try {\n /* eslint-disable no-constant-condition */\n while (true) {\n const sequenceNumber = await this.accountSequnceNumber.nextSequenceNumber();\n if (sequenceNumber === null) return;\n const transaction = await this.generateNextTransaction(this.account, sequenceNumber);\n if (!transaction) return;\n const pendingTransaction = signAndSubmitTransaction({\n aptosConfig: this.aptosConfig,\n transaction,\n signer: this.account,\n });\n await this.outstandingTransactions.enqueue([pendingTransaction, sequenceNumber]);\n }\n } catch (error: any) {\n if (error instanceof AsyncQueueCancelledError) {\n return;\n }\n throw new Error(`Submit transaction failed for ${this.account.accountAddress.toString()} with error ${error}`);\n }\n }\n\n /**\n * Reads the outstanding transaction queue and submits the transactions to the chain.\n * This function processes each transaction, checking their status and emitting events based on whether they were successfully\n * sent or failed.\n *\n * @throws {Error} Throws an error if the process execution fails.\n * @event TransactionWorkerEventsEnum.TransactionSent - Emitted when a transaction has been successfully committed to the chain.\n * @event TransactionWorkerEventsEnum.TransactionSendFailed - Emitted when a transaction fails to commit, along with the error\n * reason.\n * @event TransactionWorkerEventsEnum.ExecutionFinish - Emitted when the execution of transactions is complete.\n * @group Implementation\n * @category Transactions\n */\n async processTransactions() {\n try {\n /* eslint-disable no-constant-condition */\n while (true) {\n const awaitingTransactions = [];\n const sequenceNumbers = [];\n let [pendingTransaction, sequenceNumber] = await this.outstandingTransactions.dequeue();\n\n awaitingTransactions.push(pendingTransaction);\n sequenceNumbers.push(sequenceNumber);\n\n while (!this.outstandingTransactions.isEmpty()) {\n [pendingTransaction, sequenceNumber] = await this.outstandingTransactions.dequeue();\n\n awaitingTransactions.push(pendingTransaction);\n sequenceNumbers.push(sequenceNumber);\n }\n // send awaiting transactions to chain\n const sentTransactions = await Promise.allSettled(awaitingTransactions);\n for (let i = 0; i < sentTransactions.length && i < sequenceNumbers.length; i += 1) {\n // check sent transaction status\n const sentTransaction = sentTransactions[i];\n sequenceNumber = sequenceNumbers[i];\n if (sentTransaction.status === promiseFulfilledStatus) {\n // transaction sent to chain\n this.sentTransactions.push([sentTransaction.value.hash, sequenceNumber, null]);\n // check sent transaction execution\n this.emit(TransactionWorkerEventsEnum.TransactionSent, {\n message: `transaction hash ${sentTransaction.value.hash} has been committed to chain`,\n transactionHash: sentTransaction.value.hash,\n });\n await this.checkTransaction(sentTransaction, sequenceNumber);\n } else {\n // send transaction failed\n this.sentTransactions.push([sentTransaction.status, sequenceNumber, sentTransaction.reason]);\n this.emit(TransactionWorkerEventsEnum.TransactionSendFailed, {\n message: `failed to commit transaction ${this.sentTransactions.length} with error ${sentTransaction.reason}`,\n error: sentTransaction.reason,\n });\n }\n }\n this.emit(TransactionWorkerEventsEnum.ExecutionFinish, {\n message: `execute ${sentTransactions.length} transactions finished`,\n });\n }\n } catch (error: any) {\n if (error instanceof AsyncQueueCancelledError) {\n return;\n }\n throw new Error(`Process execution failed for ${this.account.accountAddress.toString()} with error ${error}`);\n }\n }\n\n /**\n * Once a transaction has been sent to the chain, this function checks for its execution status.\n * @param sentTransaction - The transaction that was sent to the chain and is now waiting to be executed.\n * @param sequenceNumber - The account's sequence number that was sent with the transaction.\n * @group Implementation\n * @category Transactions\n */\n async checkTransaction(sentTransaction: PromiseFulfilledResult<PendingTransactionResponse>, sequenceNumber: bigint) {\n try {\n const waitFor: Array<Promise<TransactionResponse>> = [];\n waitFor.push(waitForTransaction({ aptosConfig: this.aptosConfig, transactionHash: sentTransaction.value.hash }));\n const sentTransactions = await Promise.allSettled(waitFor);\n\n for (let i = 0; i < sentTransactions.length; i += 1) {\n const executedTransaction = sentTransactions[i];\n if (executedTransaction.status === promiseFulfilledStatus) {\n // transaction executed to chain\n this.executedTransactions.push([executedTransaction.value.hash, sequenceNumber, null]);\n this.emit(TransactionWorkerEventsEnum.TransactionExecuted, {\n message: `transaction hash ${executedTransaction.value.hash} has been executed on chain`,\n transactionHash: sentTransaction.value.hash,\n });\n } else {\n // transaction execution failed\n this.executedTransactions.push([executedTransaction.status, sequenceNumber, executedTransaction.reason]);\n this.emit(TransactionWorkerEventsEnum.TransactionExecutionFailed, {\n message: `failed to execute transaction ${this.executedTransactions.length} with error ${executedTransaction.reason}`,\n error: executedTransaction.reason,\n });\n }\n }\n } catch (error: any) {\n throw new Error(`Check transaction failed for ${this.account.accountAddress.toString()} with error ${error}`);\n }\n }\n\n /**\n * Pushes a transaction to the transactions queue for processing.\n *\n * @param transactionData - The transaction payload containing necessary details.\n * @param transactionData.abi - For all entry function payloads, the ABI to skip remote ABI lookups.\n * @param options - Optional parameters for transaction configuration.\n * @param options.maxGasAmount - Maximum gas amount for the transaction.\n * @param options.gasUnitPrice - Gas unit price for the transaction.\n * @param options.expireTimestamp - Expiration timestamp on the transaction.\n * @param options.accountSequenceNumber - The sequence number for the transaction.\n * @group Implementation\n * @category Transactions\n */\n async push(\n transactionData: InputGenerateTransactionPayloadData,\n options?: InputGenerateTransactionOptions,\n ): Promise<void> {\n this.transactionsQueue.enqueue([transactionData, options]);\n }\n\n /**\n * Generates a signed transaction that can be submitted to the chain.\n *\n * @param account - An Aptos account used as the sender of the transaction.\n * @param sequenceNumber - A sequence number the transaction will be generated with.\n * @returns A signed transaction object or undefined if the transaction queue is empty.\n * @group Implementation\n * @category Transactions\n */\n async generateNextTransaction(account: Account, sequenceNumber: bigint): Promise<SimpleTransaction | undefined> {\n if (this.transactionsQueue.isEmpty()) return undefined;\n const [transactionData, options] = await this.transactionsQueue.dequeue();\n return generateTransaction({\n aptosConfig: this.aptosConfig,\n sender: account.accountAddress,\n data: transactionData,\n options: { ...options, accountSequenceNumber: sequenceNumber },\n });\n }\n\n /**\n * Starts transaction submission and processing by executing tasks from the queue until it is cancelled.\n *\n * @throws {Error} Throws an error if unable to start transaction batching.\n * @group Implementation\n * @category Transactions\n */\n async run() {\n try {\n while (!this.taskQueue.isCancelled()) {\n const task = await this.taskQueue.dequeue();\n await task();\n }\n } catch (error: any) {\n throw new Error(`Unable to start transaction batching: ${error}`);\n }\n }\n\n /**\n * Starts the transaction management process.\n *\n * @throws {Error} Throws an error if the worker has already started.\n * @group Implementation\n * @category Transactions\n */\n start() {\n if (this.started) {\n throw new Error(\"worker has already started\");\n }\n this.started = true;\n this.taskQueue.enqueue(() => this.submitNextTransaction());\n this.taskQueue.enqueue(() => this.processTransactions());\n this.run();\n }\n\n /**\n * Stops the transaction management process.\n *\n * @throws {Error} Throws an error if the worker has already stopped.\n * @group Implementation\n * @category Transactions\n */\n stop() {\n if (this.taskQueue.isCancelled()) {\n throw new Error(\"worker has already stopped\");\n }\n this.started = false;\n this.taskQueue.cancel();\n }\n}\n"],"mappings":"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","names":["EventEmitter","promiseFulfilledStatus","TransactionWorkerEventsEnum","TransactionWorker","EventEmitter","aptosConfig","account","maxWaitTime","maximumInFlight","sleepTime","AsyncQueue","AccountSequenceNumber","sequenceNumber","transaction","pendingTransaction","signAndSubmitTransaction","error","AsyncQueueCancelledError","awaitingTransactions","sequenceNumbers","sentTransactions","i","sentTransaction","waitFor","waitForTransaction","executedTransaction","transactionData","options","generateTransaction"]}
@@ -1,2 +1,2 @@
1
- import{a as p,b as u}from"./chunk-KCWRCWNT.mjs";import{b as h,c as d,e as m}from"./chunk-GMKKHGXK.mjs";import{c as s}from"./chunk-H3C3VTHS.mjs";import{c as b,d as K}from"./chunk-V4FKFCBL.mjs";import{a as l}from"./chunk-J3E4UMBB.mjs";import{a as c}from"./chunk-AJ5JHBAE.mjs";import{b as y}from"./chunk-SPRNSFUV.mjs";import{randomBytes as E}from"@noble/hashes/utils";var S=1209600,i=class i extends c{constructor(e){super();let{privateKey:r,expiryDateSecs:a,blinder:n}=e;this.privateKey=r,this.publicKey=new p(r.publicKey()),this.expiryDateSecs=a||K(b()+S),this.blinder=n!==void 0?y.fromHexInput(n).toUint8Array():v();let t=h(this.publicKey.bcsToBytes(),93);t.push(BigInt(this.expiryDateSecs)),t.push(d(this.blinder));let x=m(t);this.nonce=x.toString()}getPublicKey(){return this.publicKey}isExpired(){return Math.floor(Date.now()/1e3)>this.expiryDateSecs}serialize(e){e.serializeU32AsUleb128(this.publicKey.variant),e.serializeBytes(this.privateKey.toUint8Array()),e.serializeU64(this.expiryDateSecs),e.serializeFixedBytes(this.blinder)}static deserialize(e){let r=e.deserializeUleb128AsU32(),a;switch(r){case 0:a=s.deserialize(e);break;default:throw new Error(`Unknown variant index for EphemeralPublicKey: ${r}`)}let n=e.deserializeU64(),t=e.deserializeFixedBytes(31);return new i({privateKey:a,expiryDateSecs:Number(n),blinder:t})}static fromBytes(e){return i.deserialize(new l(e))}static generate(e){let r;switch(e?.scheme){case 0:default:r=s.generate()}return new i({privateKey:r,expiryDateSecs:e?.expiryDateSecs})}sign(e){if(this.isExpired())throw new Error("EphemeralKeyPair has expired");return new u(this.privateKey.sign(e))}};i.BLINDER_LENGTH=31;var o=i;function v(){return E(o.BLINDER_LENGTH)}export{o as a};
2
- //# sourceMappingURL=chunk-4XB3BB5Z.mjs.map
1
+ import{a as p,b as u}from"./chunk-43GCGE6C.mjs";import{b as h,c as d,e as m}from"./chunk-GOXRBEIJ.mjs";import{c as s}from"./chunk-FZD5RWSZ.mjs";import{a as c}from"./chunk-EBMEXURY.mjs";import{c as b,d as K}from"./chunk-DAFSKSZ5.mjs";import{a as y}from"./chunk-XTOIL6MB.mjs";import{b as l}from"./chunk-STY74NUA.mjs";import{randomBytes as E}from"@noble/hashes/utils";var S=1209600,i=class i extends c{constructor(e){super();let{privateKey:r,expiryDateSecs:a,blinder:n}=e;this.privateKey=r,this.publicKey=new p(r.publicKey()),this.expiryDateSecs=a||K(b()+S),this.blinder=n!==void 0?l.fromHexInput(n).toUint8Array():v();let t=h(this.publicKey.bcsToBytes(),93);t.push(BigInt(this.expiryDateSecs)),t.push(d(this.blinder));let x=m(t);this.nonce=x.toString()}getPublicKey(){return this.publicKey}isExpired(){return Math.floor(Date.now()/1e3)>this.expiryDateSecs}serialize(e){e.serializeU32AsUleb128(this.publicKey.variant),e.serializeBytes(this.privateKey.toUint8Array()),e.serializeU64(this.expiryDateSecs),e.serializeFixedBytes(this.blinder)}static deserialize(e){let r=e.deserializeUleb128AsU32(),a;switch(r){case 0:a=s.deserialize(e);break;default:throw new Error(`Unknown variant index for EphemeralPublicKey: ${r}`)}let n=e.deserializeU64(),t=e.deserializeFixedBytes(31);return new i({privateKey:a,expiryDateSecs:Number(n),blinder:t})}static fromBytes(e){return i.deserialize(new y(e))}static generate(e){let r;switch(e?.scheme){case 0:default:r=s.generate()}return new i({privateKey:r,expiryDateSecs:e?.expiryDateSecs})}sign(e){if(this.isExpired())throw new Error("EphemeralKeyPair has expired");return new u(this.privateKey.sign(e))}};i.BLINDER_LENGTH=31;var o=i;function v(){return E(o.BLINDER_LENGTH)}export{o as a};
2
+ //# sourceMappingURL=chunk-YCQUYDZI.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/account/EphemeralKeyPair.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { randomBytes } from \"@noble/hashes/utils\";\n\nimport {\n bytesToBigIntLE,\n padAndPackBytesWithLen,\n poseidonHash,\n Ed25519PrivateKey,\n EphemeralPublicKey,\n EphemeralSignature,\n PrivateKey,\n} from \"../core/crypto\";\nimport { Hex } from \"../core/hex\";\nimport { EphemeralPublicKeyVariant, HexInput } from \"../types\";\nimport { Deserializer, Serializable, Serializer } from \"../bcs\";\nimport { floorToWholeHour, nowInSeconds } from \"../utils/helpers\";\n\nconst TWO_WEEKS_IN_SECONDS = 1_209_600;\n\n/**\n * Represents an ephemeral key pair used for signing transactions via the Keyless authentication scheme.\n * This key pair is temporary and includes an expiration time.\n * For more details on how this class is used, refer to the documentation:\n * https://aptos.dev/guides/keyless-accounts/#1-present-the-user-with-a-sign-in-with-idp-button-on-the-ui\n * @group Implementation\n * @category Account (On-Chain Model)\n */\nexport class EphemeralKeyPair extends Serializable {\n static readonly BLINDER_LENGTH: number = 31;\n\n /**\n * A byte array of length BLINDER_LENGTH used to obfuscate the public key from the IdP.\n * Used in calculating the nonce passed to the IdP and as a secret witness in proof generation.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n readonly blinder: Uint8Array;\n\n /**\n * A timestamp in seconds indicating when the ephemeral key pair is expired. After expiry, a new\n * EphemeralKeyPair must be generated and a new JWT needs to be created.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n readonly expiryDateSecs: number;\n\n /**\n * The value passed to the IdP when the user authenticates. It consists of a hash of the\n * ephemeral public key, expiry date, and blinder.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n readonly nonce: string;\n\n /**\n * A private key used to sign transactions. This private key is not tied to any account on the chain as it\n * is ephemeral (not permanent) in nature.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n private privateKey: PrivateKey;\n\n /**\n * A public key used to verify transactions. This public key is not tied to any account on the chain as it\n * is ephemeral (not permanent) in nature.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n private publicKey: EphemeralPublicKey;\n\n /**\n * Creates an instance of the class with a specified private key, optional expiry date, and optional blinder.\n * This constructor initializes the public key, sets the expiry date to a default value if not provided,\n * generates a blinder if not supplied, and calculates the nonce based on the public key, expiry date, and blinder.\n *\n * @param args - The parameters for constructing the instance.\n * @param args.privateKey - The private key used for creating the instance.\n * @param args.expiryDateSecs - Optional expiry date in seconds from the current time. Defaults to two weeks from now.\n * @param args.blinder - Optional blinder value. If not provided, a new blinder will be generated.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n constructor(args: { privateKey: PrivateKey; expiryDateSecs?: number; blinder?: HexInput }) {\n super();\n const { privateKey, expiryDateSecs, blinder } = args;\n this.privateKey = privateKey;\n this.publicKey = new EphemeralPublicKey(privateKey.publicKey());\n // By default, we set the expiry date to be two weeks in the future floored to the nearest hour\n this.expiryDateSecs = expiryDateSecs || floorToWholeHour(nowInSeconds() + TWO_WEEKS_IN_SECONDS);\n // Generate the blinder if not provided\n this.blinder = blinder !== undefined ? Hex.fromHexInput(blinder).toUint8Array() : generateBlinder();\n // Calculate the nonce\n const fields = padAndPackBytesWithLen(this.publicKey.bcsToBytes(), 93);\n fields.push(BigInt(this.expiryDateSecs));\n fields.push(bytesToBigIntLE(this.blinder));\n const nonceHash = poseidonHash(fields);\n this.nonce = nonceHash.toString();\n }\n\n /**\n * Returns the public key of the key pair.\n * @return EphemeralPublicKey\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n getPublicKey(): EphemeralPublicKey {\n return this.publicKey;\n }\n\n /**\n * Checks if the current time has surpassed the expiry date of the key pair.\n * @return boolean - Returns true if the key pair is expired, otherwise false.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n isExpired(): boolean {\n const currentTimeSecs: number = Math.floor(Date.now() / 1000);\n return currentTimeSecs > this.expiryDateSecs;\n }\n\n /**\n * Serializes the object's properties into a format suitable for transmission or storage.\n * This function is essential for preparing the object data for serialization processes.\n *\n * @param serializer - The serializer instance used to serialize the object's properties.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(this.publicKey.variant);\n serializer.serializeBytes(this.privateKey.toUint8Array());\n serializer.serializeU64(this.expiryDateSecs);\n serializer.serializeFixedBytes(this.blinder);\n }\n\n /**\n * Deserializes an ephemeral key pair from the provided deserializer.\n * This function helps in reconstructing an ephemeral key pair, which is essential for cryptographic operations.\n *\n * @param deserializer - The deserializer instance used to read the serialized data.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n static deserialize(deserializer: Deserializer): EphemeralKeyPair {\n const variantIndex = deserializer.deserializeUleb128AsU32();\n let privateKey: PrivateKey;\n switch (variantIndex) {\n case EphemeralPublicKeyVariant.Ed25519:\n privateKey = Ed25519PrivateKey.deserialize(deserializer);\n break;\n default:\n throw new Error(`Unknown variant index for EphemeralPublicKey: ${variantIndex}`);\n }\n const expiryDateSecs = deserializer.deserializeU64();\n const blinder = deserializer.deserializeFixedBytes(31);\n return new EphemeralKeyPair({ privateKey, expiryDateSecs: Number(expiryDateSecs), blinder });\n }\n\n /**\n * Deserialize a byte array into an EphemeralKeyPair object.\n * This function allows you to reconstruct an EphemeralKeyPair from its serialized byte representation.\n *\n * @param bytes - The byte array representing the serialized EphemeralKeyPair.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n static fromBytes(bytes: Uint8Array): EphemeralKeyPair {\n return EphemeralKeyPair.deserialize(new Deserializer(bytes));\n }\n\n /**\n * Generates a new ephemeral key pair with an optional expiry date.\n * This function allows you to create a temporary key pair for secure operations.\n *\n * @param args - Optional parameters for key pair generation.\n * @param args.scheme - The type of key pair to use for the EphemeralKeyPair. Only Ed25519 is supported for now.\n * @param args.expiryDateSecs - The date of expiry for the key pair in seconds.\n * @returns An instance of EphemeralKeyPair containing the generated private key and expiry date.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n static generate(args?: { scheme?: EphemeralPublicKeyVariant; expiryDateSecs?: number }): EphemeralKeyPair {\n let privateKey: PrivateKey;\n\n switch (args?.scheme) {\n case EphemeralPublicKeyVariant.Ed25519:\n default:\n privateKey = Ed25519PrivateKey.generate();\n }\n\n return new EphemeralKeyPair({ privateKey, expiryDateSecs: args?.expiryDateSecs });\n }\n\n /**\n * Sign the given data using the private key, returning an ephemeral signature.\n * This function is essential for creating a secure signature that can be used for authentication or verification purposes.\n *\n * @param data - The data to be signed, provided in HexInput format.\n * @returns EphemeralSignature - The resulting ephemeral signature.\n * @throws Error - Throws an error if the EphemeralKeyPair has expired.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n sign(data: HexInput): EphemeralSignature {\n if (this.isExpired()) {\n throw new Error(\"EphemeralKeyPair has expired\");\n }\n return new EphemeralSignature(this.privateKey.sign(data));\n }\n}\n\n/**\n * Generates a random byte array of length EphemeralKeyPair.BLINDER_LENGTH.\n * @returns Uint8Array A random byte array used for blinding.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\nfunction generateBlinder(): Uint8Array {\n return randomBytes(EphemeralKeyPair.BLINDER_LENGTH);\n}\n"],"mappings":"2TAGA,OAAS,eAAAA,MAAmB,sBAgB5B,IAAMC,EAAuB,QAUhBC,EAAN,MAAMA,UAAyBC,CAAa,CAuDjD,YAAYC,EAA+E,CACzF,MAAM,EACN,GAAM,CAAE,WAAAC,EAAY,eAAAC,EAAgB,QAAAC,CAAQ,EAAIH,EAChD,KAAK,WAAaC,EAClB,KAAK,UAAY,IAAIG,EAAmBH,EAAW,UAAU,CAAC,EAE9D,KAAK,eAAiBC,GAAkBG,EAAiBC,EAAa,EAAIT,CAAoB,EAE9F,KAAK,QAAUM,IAAY,OAAYI,EAAI,aAAaJ,CAAO,EAAE,aAAa,EAAIK,EAAgB,EAElG,IAAMC,EAASC,EAAuB,KAAK,UAAU,WAAW,EAAG,EAAE,EACrED,EAAO,KAAK,OAAO,KAAK,cAAc,CAAC,EACvCA,EAAO,KAAKE,EAAgB,KAAK,OAAO,CAAC,EACzC,IAAMC,EAAYC,EAAaJ,CAAM,EACrC,KAAK,MAAQG,EAAU,SAAS,CAClC,CAQA,cAAmC,CACjC,OAAO,KAAK,SACd,CAQA,WAAqB,CAEnB,OADgC,KAAK,MAAM,KAAK,IAAI,EAAI,GAAI,EACnC,KAAK,cAChC,CAUA,UAAUE,EAA8B,CACtCA,EAAW,sBAAsB,KAAK,UAAU,OAAO,EACvDA,EAAW,eAAe,KAAK,WAAW,aAAa,CAAC,EACxDA,EAAW,aAAa,KAAK,cAAc,EAC3CA,EAAW,oBAAoB,KAAK,OAAO,CAC7C,CAUA,OAAO,YAAYC,EAA8C,CAC/D,IAAMC,EAAeD,EAAa,wBAAwB,EACtDd,EACJ,OAAQe,EAAc,CACpB,OACEf,EAAagB,EAAkB,YAAYF,CAAY,EACvD,MACF,QACE,MAAM,IAAI,MAAM,iDAAiDC,CAAY,EAAE,CACnF,CACA,IAAMd,EAAiBa,EAAa,eAAe,EAC7CZ,EAAUY,EAAa,sBAAsB,EAAE,EACrD,OAAO,IAAIjB,EAAiB,CAAE,WAAAG,EAAY,eAAgB,OAAOC,CAAc,EAAG,QAAAC,CAAQ,CAAC,CAC7F,CAUA,OAAO,UAAUe,EAAqC,CACpD,OAAOpB,EAAiB,YAAY,IAAIqB,EAAaD,CAAK,CAAC,CAC7D,CAaA,OAAO,SAASlB,EAA0F,CACxG,IAAIC,EAEJ,OAAQD,GAAM,OAAQ,CACpB,OACA,QACEC,EAAagB,EAAkB,SAAS,CAC5C,CAEA,OAAO,IAAInB,EAAiB,CAAE,WAAAG,EAAY,eAAgBD,GAAM,cAAe,CAAC,CAClF,CAYA,KAAKoB,EAAoC,CACvC,GAAI,KAAK,UAAU,EACjB,MAAM,IAAI,MAAM,8BAA8B,EAEhD,OAAO,IAAIC,EAAmB,KAAK,WAAW,KAAKD,CAAI,CAAC,CAC1D,CACF,EAtLatB,EACK,eAAyB,GADpC,IAAMwB,EAANxB,EA8LP,SAASU,GAA8B,CACrC,OAAOe,EAAYD,EAAiB,cAAc,CACpD","names":["randomBytes","TWO_WEEKS_IN_SECONDS","_EphemeralKeyPair","Serializable","args","privateKey","expiryDateSecs","blinder","EphemeralPublicKey","floorToWholeHour","nowInSeconds","Hex","generateBlinder","fields","padAndPackBytesWithLen","bytesToBigIntLE","nonceHash","poseidonHash","serializer","deserializer","variantIndex","Ed25519PrivateKey","bytes","Deserializer","data","EphemeralSignature","EphemeralKeyPair","randomBytes"]}
@@ -1,2 +1,2 @@
1
1
  var n=new Map;function m(r,e,t){return async(...s)=>{if(n.has(e)){let{value:i,timestamp:u}=n.get(e);if(t===void 0||Date.now()-u<=t)return i}let a=await r(...s);return n.set(e,{value:a,timestamp:Date.now()}),a}}function o(r,e,t){return(...s)=>{if(n.has(e)){let{value:i,timestamp:u}=n.get(e);if(t===void 0||Date.now()-u<=t)return i}let a=r(...s);return n.set(e,{value:a,timestamp:Date.now()}),a}}export{m as a,o as b};
2
- //# sourceMappingURL=chunk-HBIDHQ2M.mjs.map
2
+ //# sourceMappingURL=chunk-YOZBVVKL.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/memoize.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * The global cache Map shared across all functions. Must keep care to ensure that the\n * cache keys are unique across all functions.\n * @group Implementation\n * @category Utils\n */\nconst cache = new Map<string, { value: any; timestamp: number }>();\n\n/**\n * A memoize higher-order function to cache the response of an async function.\n * This function helps to improve performance by avoiding repeated calls to the same async function with the same arguments\n * within a specified time-to-live (TTL).\n *\n * @param func The async function to cache the result of.\n * @param key The cache key used to store the result.\n * @param ttlMs The time-to-live in milliseconds for cached data.\n * @returns The cached or latest result.\n * @group Implementation\n * @category Utils\n */\nexport function memoizeAsync<T>(\n func: (...args: any[]) => Promise<T>,\n key: string,\n ttlMs?: number,\n): (...args: any[]) => Promise<T> {\n return async (...args: any[]) => {\n // Check if the cached result exists and is within TTL\n if (cache.has(key)) {\n const { value, timestamp } = cache.get(key)!;\n if (ttlMs === undefined || Date.now() - timestamp <= ttlMs) {\n return value;\n }\n }\n\n // If not cached or TTL expired, compute the result\n const result = await func(...args);\n\n // Cache the result with a timestamp\n cache.set(key, { value: result, timestamp: Date.now() });\n\n return result;\n };\n}\n\n/**\n * Caches the result of a function call to improve performance on subsequent calls with the same arguments.\n *\n * @param key - The key to cache on, all accesses by this key will return the cached value.\n * @param func - The function whose result will be cached.\n * @param ttlMs - The time-to-live in milliseconds for cached data.\n * @returns A memoized version of the provided function that returns the cached result if available and within TTL.\n * @group Implementation\n * @category Utils\n */\nexport function memoize<T>(func: (...args: any[]) => T, key: string, ttlMs?: number): (...args: any[]) => T {\n return (...args: any[]) => {\n // Check if the cached result exists and is within TTL\n if (cache.has(key)) {\n const { value, timestamp } = cache.get(key)!;\n if (ttlMs === undefined || Date.now() - timestamp <= ttlMs) {\n return value;\n }\n }\n\n // If not cached or TTL expired, compute the result\n const result = func(...args);\n\n // Cache the result with a timestamp\n cache.set(key, { value: result, timestamp: Date.now() });\n\n return result;\n };\n}\n"],"mappings":"AASA,IAAMA,EAAQ,IAAI,IAcX,SAASC,EACdC,EACAC,EACAC,EACgC,CAChC,MAAO,UAAUC,IAAgB,CAE/B,GAAIL,EAAM,IAAIG,CAAG,EAAG,CAClB,GAAM,CAAE,MAAAG,EAAO,UAAAC,CAAU,EAAIP,EAAM,IAAIG,CAAG,EAC1C,GAAIC,IAAU,QAAa,KAAK,IAAI,EAAIG,GAAaH,EACnD,OAAOE,CAEX,CAGA,IAAME,EAAS,MAAMN,EAAK,GAAGG,CAAI,EAGjC,OAAAL,EAAM,IAAIG,EAAK,CAAE,MAAOK,EAAQ,UAAW,KAAK,IAAI,CAAE,CAAC,EAEhDA,CACT,CACF,CAYO,SAASC,EAAWP,EAA6BC,EAAaC,EAAuC,CAC1G,MAAO,IAAIC,IAAgB,CAEzB,GAAIL,EAAM,IAAIG,CAAG,EAAG,CAClB,GAAM,CAAE,MAAAG,EAAO,UAAAC,CAAU,EAAIP,EAAM,IAAIG,CAAG,EAC1C,GAAIC,IAAU,QAAa,KAAK,IAAI,EAAIG,GAAaH,EACnD,OAAOE,CAEX,CAGA,IAAME,EAASN,EAAK,GAAGG,CAAI,EAG3B,OAAAL,EAAM,IAAIG,EAAK,CAAE,MAAOK,EAAQ,UAAW,KAAK,IAAI,CAAE,CAAC,EAEhDA,CACT,CACF","names":["cache","memoizeAsync","func","key","ttlMs","args","value","timestamp","result","memoize"]}
@@ -0,0 +1,2 @@
1
+ import{b as f}from"./chunk-QQEK7WVP.mjs";import{a as A}from"./chunk-BGSEBFFC.mjs";import{r as y}from"./chunk-IEUEMBFD.mjs";import{b as K}from"./chunk-Q4C4U6I4.mjs";import{a as m}from"./chunk-XTOIL6MB.mjs";var h=class d extends f{constructor(e){let r=A.create(e);super({publicKey:r,...e}),this.publicKey=r,this.audless=e.audless??!1}serialize(e){super.serialize(e),this.publicKey.jwkAddress.serialize(e)}static deserialize(e){let{address:r,proof:l,ephemeralKeyPair:s,jwt:i,uidKey:o,pepper:c,verificationKeyHash:t}=f.partialDeserialize(e),n=K.deserialize(e),{iss:a,aud:p,uidVal:u}=y({jwt:i,uidKey:o});return new d({address:r,proof:l,ephemeralKeyPair:s,iss:a,uidKey:o,uidVal:u,aud:p,pepper:c,jwt:i,verificationKeyHash:t,jwkAddress:n})}static fromBytes(e){return d.deserialize(m.fromHex(e))}static create(e){let{address:r,proof:l,jwt:s,ephemeralKeyPair:i,pepper:o,jwkAddress:c,uidKey:t="sub",proofFetchCallback:n,verificationKey:a}=e,{iss:p,aud:u,uidVal:w}=y({jwt:s,uidKey:t});return new d({address:r,proof:l,ephemeralKeyPair:i,iss:p,uidKey:t,uidVal:w,aud:u,pepper:o,jwkAddress:K.from(c),jwt:s,proofFetchCallback:n,verificationKeyHash:a?a.hash():void 0})}};export{h as a};
2
+ //# sourceMappingURL=chunk-ZAIVZDOL.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/account/FederatedKeylessAccount.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { HexInput } from \"../types\";\nimport { AccountAddress, AccountAddressInput } from \"../core/accountAddress\";\nimport { getIssAudAndUidVal, Groth16VerificationKey, ZeroKnowledgeSig } from \"../core/crypto\";\n\nimport { EphemeralKeyPair } from \"./EphemeralKeyPair\";\nimport { Deserializer, Serializer } from \"../bcs\";\nimport { FederatedKeylessPublicKey } from \"../core/crypto/federatedKeyless\";\nimport { AbstractKeylessAccount, ProofFetchCallback } from \"./AbstractKeylessAccount\";\n\n/**\n * Account implementation for the FederatedKeyless authentication scheme.\n *\n * Used to represent a FederatedKeyless based account and sign transactions with it.\n *\n * Use `FederatedKeylessAccount.create()` to instantiate a KeylessAccount with a JSON Web Token (JWT), proof, EphemeralKeyPair and the\n * address the JSON Web Key Set (JWKS) are installed that will be used to verify the JWT.\n *\n * When the proof expires or the JWT becomes invalid, the KeylessAccount must be instantiated again with a new JWT,\n * EphemeralKeyPair, and corresponding proof.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\nexport class FederatedKeylessAccount extends AbstractKeylessAccount {\n /**\n * The FederatedKeylessPublicKey associated with the account\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n readonly publicKey: FederatedKeylessPublicKey;\n\n readonly audless: boolean;\n\n /**\n * Use the static generator `FederatedKeylessAccount.create(...)` instead.\n * Creates a KeylessAccount instance using the provided parameters.\n * This function allows you to set up a KeylessAccount with specific attributes such as address, proof, and JWT.\n *\n * @param args - The parameters for creating a KeylessAccount.\n * @param args.address - Optional account address associated with the KeylessAccount.\n * @param args.proof - A Zero Knowledge Signature or a promise that resolves to one.\n * @param args.jwt - A JSON Web Token used for authentication.\n * @param args.ephemeralKeyPair - The ephemeral key pair used in the account creation.\n * @param args.jwkAddress - The address which stores the JSON Web Key Set (JWKS) used to verify the JWT.\n * @param args.uidKey - Optional key for user identification, defaults to \"sub\".\n * @param args.proofFetchCallback - Optional callback function for fetching proof.\n */\n constructor(args: {\n address?: AccountAddress;\n ephemeralKeyPair: EphemeralKeyPair;\n iss: string;\n uidKey: string;\n uidVal: string;\n aud: string;\n pepper: HexInput;\n jwkAddress: AccountAddress;\n proof: ZeroKnowledgeSig | Promise<ZeroKnowledgeSig>;\n proofFetchCallback?: ProofFetchCallback;\n jwt: string;\n verificationKeyHash?: HexInput;\n audless?: boolean;\n }) {\n const publicKey = FederatedKeylessPublicKey.create(args);\n super({ publicKey, ...args });\n this.publicKey = publicKey;\n this.audless = args.audless ?? false;\n }\n\n /**\n * Serializes the transaction data into a format suitable for transmission or storage.\n * This function ensures that both the transaction bytes and the proof are properly serialized.\n *\n * @param serializer - The serializer instance used to convert the transaction data into bytes.\n */\n serialize(serializer: Serializer): void {\n super.serialize(serializer);\n this.publicKey.jwkAddress.serialize(serializer);\n }\n\n /**\n * Deserializes the provided deserializer to create a KeylessAccount instance.\n * This function extracts necessary components such as the JWT, UID key, pepper, ephemeral key pair, and proof from the deserializer.\n *\n * @param deserializer - The deserializer instance used to retrieve the serialized data.\n * @returns A KeylessAccount instance created from the deserialized data.\n */\n static deserialize(deserializer: Deserializer): FederatedKeylessAccount {\n const { address, proof, ephemeralKeyPair, jwt, uidKey, pepper, verificationKeyHash } =\n AbstractKeylessAccount.partialDeserialize(deserializer);\n const jwkAddress = AccountAddress.deserialize(deserializer);\n const { iss, aud, uidVal } = getIssAudAndUidVal({ jwt, uidKey });\n return new FederatedKeylessAccount({\n address,\n proof,\n ephemeralKeyPair,\n iss,\n uidKey,\n uidVal,\n aud,\n pepper,\n jwt,\n verificationKeyHash,\n jwkAddress,\n });\n }\n\n /**\n * Deserialize bytes using this account's information.\n *\n * @param bytes The bytes being interpreted.\n * @returns\n */\n static fromBytes(bytes: HexInput): FederatedKeylessAccount {\n return FederatedKeylessAccount.deserialize(Deserializer.fromHex(bytes));\n }\n\n /**\n * Creates a KeylessAccount instance using the provided parameters.\n * This function allows you to set up a KeylessAccount with specific attributes such as address, proof, and JWT.\n * This is used instead of the KeylessAccount constructor.\n *\n * @param args - The parameters for creating a KeylessAccount.\n * @param args.address - Optional account address associated with the KeylessAccount.\n * @param args.proof - A Zero Knowledge Signature or a promise that resolves to one.\n * @param args.jwt - A JSON Web Token used for authentication.\n * @param args.ephemeralKeyPair - The ephemeral key pair used in the account creation.\n * @param args.jwkAddress - The address which stores the JSON Web Key Set (JWKS) used to verify the JWT.\n * @param args.uidKey - Optional key for user identification, defaults to \"sub\".\n * @param args.proofFetchCallback - Optional callback function for fetching proof.\n */\n static create(args: {\n address?: AccountAddress;\n proof: ZeroKnowledgeSig | Promise<ZeroKnowledgeSig>;\n jwt: string;\n ephemeralKeyPair: EphemeralKeyPair;\n pepper: HexInput;\n jwkAddress: AccountAddressInput;\n uidKey?: string;\n proofFetchCallback?: ProofFetchCallback;\n verificationKey?: Groth16VerificationKey;\n }): FederatedKeylessAccount {\n const {\n address,\n proof,\n jwt,\n ephemeralKeyPair,\n pepper,\n jwkAddress,\n uidKey = \"sub\",\n proofFetchCallback,\n verificationKey,\n } = args;\n\n const { iss, aud, uidVal } = getIssAudAndUidVal({ jwt, uidKey });\n return new FederatedKeylessAccount({\n address,\n proof,\n ephemeralKeyPair,\n iss,\n uidKey,\n uidVal,\n aud,\n pepper,\n jwkAddress: AccountAddress.from(jwkAddress),\n jwt,\n proofFetchCallback,\n verificationKeyHash: verificationKey ? verificationKey.hash() : undefined,\n });\n }\n}\n"],"mappings":"6MAyBO,IAAMA,EAAN,MAAMC,UAAgCC,CAAuB,CAwBlE,YAAYC,EAcT,CACD,IAAMC,EAAYC,EAA0B,OAAOF,CAAI,EACvD,MAAM,CAAE,UAAAC,EAAW,GAAGD,CAAK,CAAC,EAC5B,KAAK,UAAYC,EACjB,KAAK,QAAUD,EAAK,SAAW,EACjC,CAQA,UAAUG,EAA8B,CACtC,MAAM,UAAUA,CAAU,EAC1B,KAAK,UAAU,WAAW,UAAUA,CAAU,CAChD,CASA,OAAO,YAAYC,EAAqD,CACtE,GAAM,CAAE,QAAAC,EAAS,MAAAC,EAAO,iBAAAC,EAAkB,IAAAC,EAAK,OAAAC,EAAQ,OAAAC,EAAQ,oBAAAC,CAAoB,EACjFZ,EAAuB,mBAAmBK,CAAY,EAClDQ,EAAaC,EAAe,YAAYT,CAAY,EACpD,CAAE,IAAAU,EAAK,IAAAC,EAAK,OAAAC,CAAO,EAAIC,EAAmB,CAAE,IAAAT,EAAK,OAAAC,CAAO,CAAC,EAC/D,OAAO,IAAIX,EAAwB,CACjC,QAAAO,EACA,MAAAC,EACA,iBAAAC,EACA,IAAAO,EACA,OAAAL,EACA,OAAAO,EACA,IAAAD,EACA,OAAAL,EACA,IAAAF,EACA,oBAAAG,EACA,WAAAC,CACF,CAAC,CACH,CAQA,OAAO,UAAUM,EAA0C,CACzD,OAAOpB,EAAwB,YAAYqB,EAAa,QAAQD,CAAK,CAAC,CACxE,CAgBA,OAAO,OAAOlB,EAUc,CAC1B,GAAM,CACJ,QAAAK,EACA,MAAAC,EACA,IAAAE,EACA,iBAAAD,EACA,OAAAG,EACA,WAAAE,EACA,OAAAH,EAAS,MACT,mBAAAW,EACA,gBAAAC,CACF,EAAIrB,EAEE,CAAE,IAAAc,EAAK,IAAAC,EAAK,OAAAC,CAAO,EAAIC,EAAmB,CAAE,IAAAT,EAAK,OAAAC,CAAO,CAAC,EAC/D,OAAO,IAAIX,EAAwB,CACjC,QAAAO,EACA,MAAAC,EACA,iBAAAC,EACA,IAAAO,EACA,OAAAL,EACA,OAAAO,EACA,IAAAD,EACA,OAAAL,EACA,WAAYG,EAAe,KAAKD,CAAU,EAC1C,IAAAJ,EACA,mBAAAY,EACA,oBAAqBC,EAAkBA,EAAgB,KAAK,EAAI,MAClE,CAAC,CACH,CACF","names":["FederatedKeylessAccount","_FederatedKeylessAccount","AbstractKeylessAccount","args","publicKey","FederatedKeylessPublicKey","serializer","deserializer","address","proof","ephemeralKeyPair","jwt","uidKey","pepper","verificationKeyHash","jwkAddress","AccountAddress","iss","aud","uidVal","getIssAudAndUidVal","bytes","Deserializer","proofFetchCallback","verificationKey"]}
@@ -1,2 +1,2 @@
1
- import{c as d}from"./chunk-2KSMV5KD.mjs";import{p as c}from"./chunk-VHNX2NUR.mjs";import{b as i}from"./chunk-JNO7KPMG.mjs";var a=300,g=t=>{if(t&&t.length>a)throw new Error(`Event type length exceeds the maximum length of ${a}`)};async function m(t){let{aptosConfig:o,eventType:e,options:n}=t,s={_or:[{account_address:{_eq:e.split("::")[0]}},{account_address:{_eq:"0x0000000000000000000000000000000000000000000000000000000000000000"},sequence_number:{_eq:0},creation_number:{_eq:0}}],indexed_type:{_eq:e}};return p({aptosConfig:o,options:{...n,where:s}})}async function f(t){let{accountAddress:o,aptosConfig:e,creationNumber:n,options:s}=t,r={account_address:{_eq:i.from(o).toStringLong()},creation_number:{_eq:n}};return p({aptosConfig:e,options:{...s,where:r}})}async function _(t){let{accountAddress:o,aptosConfig:e,eventType:n,options:s}=t,r={account_address:{_eq:i.from(o).toStringLong()},indexed_type:{_eq:n}};return p({aptosConfig:e,options:{...s,where:r}})}async function p(t){let{aptosConfig:o,options:e}=t;g(e?.where?.indexed_type?._eq);let n={query:c,variables:{where_condition:e?.where,offset:e?.offset,limit:e?.limit,order_by:e?.orderBy}};return(await d({aptosConfig:o,query:n,originMethod:"getEvents"})).events}export{m as a,f as b,_ as c,p as d};
2
- //# sourceMappingURL=chunk-ZXVN3HXB.mjs.map
1
+ import{c as d}from"./chunk-VV4HCOJQ.mjs";import{p as c}from"./chunk-VHNX2NUR.mjs";import{b as i}from"./chunk-Q4C4U6I4.mjs";var a=300,g=t=>{if(t&&t.length>a)throw new Error(`Event type length exceeds the maximum length of ${a}`)};async function m(t){let{aptosConfig:o,eventType:e,options:n}=t,s={_or:[{account_address:{_eq:e.split("::")[0]}},{account_address:{_eq:"0x0000000000000000000000000000000000000000000000000000000000000000"},sequence_number:{_eq:0},creation_number:{_eq:0}}],indexed_type:{_eq:e}};return p({aptosConfig:o,options:{...n,where:s}})}async function f(t){let{accountAddress:o,aptosConfig:e,creationNumber:n,options:s}=t,r={account_address:{_eq:i.from(o).toStringLong()},creation_number:{_eq:n}};return p({aptosConfig:e,options:{...s,where:r}})}async function _(t){let{accountAddress:o,aptosConfig:e,eventType:n,options:s}=t,r={account_address:{_eq:i.from(o).toStringLong()},indexed_type:{_eq:n}};return p({aptosConfig:e,options:{...s,where:r}})}async function p(t){let{aptosConfig:o,options:e}=t;g(e?.where?.indexed_type?._eq);let n={query:c,variables:{where_condition:e?.where,offset:e?.offset,limit:e?.limit,order_by:e?.orderBy}};return(await d({aptosConfig:o,query:n,originMethod:"getEvents"})).events}export{m as a,f as b,_ as c,p as d};
2
+ //# sourceMappingURL=chunk-ZGVNZE7J.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/internal/event.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * This file contains the underlying implementations for exposed API surface in\n * the {@link api/event}. By moving the methods out into a separate file,\n * other namespaces and processes can access these methods without depending on the entire\n * event namespace and without having a dependency cycle error.\n * @group Implementation\n */\n\nimport { AptosConfig } from \"../api/aptosConfig\";\nimport { AccountAddress, AccountAddressInput } from \"../core\";\nimport { AnyNumber, GetEventsResponse, PaginationArgs, MoveStructId, OrderByArg, WhereArg } from \"../types\";\nimport { GetEventsQuery } from \"../types/generated/operations\";\nimport { GetEvents } from \"../types/generated/queries\";\nimport { EventsBoolExp, InputMaybe } from \"../types/generated/types\";\nimport { queryIndexer } from \"./general\";\n\nconst MAX_EVENT_TYPE_LENGTH = 300;\nconst checkEventTypeLength = (eventType?: InputMaybe<string>) => {\n if (eventType && eventType.length > MAX_EVENT_TYPE_LENGTH) {\n throw new Error(`Event type length exceeds the maximum length of ${MAX_EVENT_TYPE_LENGTH}`);\n }\n};\n\n/**\n * Retrieves events associated with a specific module event type.\n * This function allows you to filter events based on the event type and pagination options.\n *\n * @param args - The arguments for retrieving module events.\n * @param args.aptosConfig - The configuration object for Aptos.\n * @param args.eventType - The MoveStructId representing the type of event to retrieve.\n * @param [args.options] - Optional pagination and ordering parameters for the event retrieval.\n * @group Implementation\n */\nexport async function getModuleEventsByEventType(args: {\n aptosConfig: AptosConfig;\n eventType: MoveStructId;\n options?: PaginationArgs & OrderByArg<GetEventsResponse[0]>;\n}): Promise<GetEventsResponse> {\n const { aptosConfig, eventType, options } = args;\n\n const whereCondition: EventsBoolExp = {\n _or: [\n // EventHandle events\n { account_address: { _eq: eventType.split(\"::\")[0] } },\n // Module events\n {\n account_address: { _eq: \"0x0000000000000000000000000000000000000000000000000000000000000000\" },\n sequence_number: { _eq: 0 },\n creation_number: { _eq: 0 },\n },\n ],\n indexed_type: { _eq: eventType },\n };\n\n return getEvents({ aptosConfig, options: { ...options, where: whereCondition } });\n}\n\n/**\n * Retrieve events associated with a specific account and creation number.\n *\n * @param args - The parameters for retrieving account events.\n * @param args.aptosConfig - The configuration settings for the Aptos client.\n * @param args.accountAddress - The address of the account for which events are being retrieved.\n * @param args.creationNumber - The creation number to filter events.\n * @param args.options - Optional pagination and ordering parameters for the event retrieval.\n * @group Implementation\n */\nexport async function getAccountEventsByCreationNumber(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n creationNumber: AnyNumber;\n options?: PaginationArgs & OrderByArg<GetEventsResponse[0]>;\n}): Promise<GetEventsResponse> {\n const { accountAddress, aptosConfig, creationNumber, options } = args;\n const address = AccountAddress.from(accountAddress);\n\n const whereCondition: EventsBoolExp = {\n account_address: { _eq: address.toStringLong() },\n creation_number: { _eq: creationNumber },\n };\n\n return getEvents({ aptosConfig, options: { ...options, where: whereCondition } });\n}\n\n/**\n * Retrieves events associated with a specific account and event type.\n *\n * @param args - The parameters for retrieving account events.\n * @param args.aptosConfig - The configuration for connecting to the Aptos blockchain.\n * @param args.accountAddress - The address of the account for which to retrieve events.\n * @param args.eventType - The type of event to filter by.\n * @param args.options - Optional pagination and ordering parameters for the event retrieval.\n * @group Implementation\n */\nexport async function getAccountEventsByEventType(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n eventType: MoveStructId;\n options?: PaginationArgs & OrderByArg<GetEventsResponse[0]>;\n}): Promise<GetEventsResponse> {\n const { accountAddress, aptosConfig, eventType, options } = args;\n const address = AccountAddress.from(accountAddress).toStringLong();\n\n const whereCondition: EventsBoolExp = {\n account_address: { _eq: address },\n indexed_type: { _eq: eventType },\n };\n\n return getEvents({ aptosConfig, options: { ...options, where: whereCondition } });\n}\n\n/**\n * Retrieves a list of events based on specified filtering and pagination options.\n *\n * @param args - The arguments for retrieving events.\n * @param args.aptosConfig - The configuration for connecting to the Aptos network.\n * @param [args.options] - Optional parameters for pagination and filtering.\n * @param [args.options.offset] - The number of records to skip before starting to collect the result set.\n * @param [args.options.limit] - The maximum number of records to return.\n * @param [args.options.orderBy] - Defines the order in which to return the events.\n * @param [args.options.where] - Conditions to filter the events.\n * @param [args.options.where.indexed_type] - Filters events by the indexed type.\n * @group Implementation\n */\nexport async function getEvents(args: {\n aptosConfig: AptosConfig;\n options?: PaginationArgs & OrderByArg<GetEventsResponse[0]> & WhereArg<EventsBoolExp>;\n}): Promise<GetEventsResponse> {\n const { aptosConfig, options } = args;\n\n /**\n * Checks the length of event types based on the provided filtering options.\n *\n * @param options - The options for querying event types.\n * @param options.where - The conditions to filter the event types.\n * @param options.where.indexed_type - The indexed type to filter by.\n * @param options.where.indexed_type._eq - The specific value to match for the indexed type.\n * @param options.offset - The number of items to skip before starting to collect the result set.\n * @param options.limit - The maximum number of items to return.\n * @param options.orderBy - The criteria to sort the results.\n * @group Implementation\n */\n // eslint-disable-next-line no-underscore-dangle\n checkEventTypeLength(options?.where?.indexed_type?._eq);\n\n const graphqlQuery = {\n query: GetEvents,\n variables: {\n where_condition: options?.where,\n offset: options?.offset,\n limit: options?.limit,\n order_by: options?.orderBy,\n },\n };\n\n const data = await queryIndexer<GetEventsQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getEvents\",\n });\n\n return data.events;\n}\n"],"mappings":"2HAmBA,IAAMA,EAAwB,IACxBC,EAAwBC,GAAmC,CAC/D,GAAIA,GAAaA,EAAU,OAASF,EAClC,MAAM,IAAI,MAAM,mDAAmDA,CAAqB,EAAE,CAE9F,EAYA,eAAsBG,EAA2BC,EAIlB,CAC7B,GAAM,CAAE,YAAAC,EAAa,UAAAH,EAAW,QAAAI,CAAQ,EAAIF,EAEtCG,EAAgC,CACpC,IAAK,CAEH,CAAE,gBAAiB,CAAE,IAAKL,EAAU,MAAM,IAAI,EAAE,CAAC,CAAE,CAAE,EAErD,CACE,gBAAiB,CAAE,IAAK,oEAAqE,EAC7F,gBAAiB,CAAE,IAAK,CAAE,EAC1B,gBAAiB,CAAE,IAAK,CAAE,CAC5B,CACF,EACA,aAAc,CAAE,IAAKA,CAAU,CACjC,EAEA,OAAOM,EAAU,CAAE,YAAAH,EAAa,QAAS,CAAE,GAAGC,EAAS,MAAOC,CAAe,CAAE,CAAC,CAClF,CAYA,eAAsBE,EAAiCL,EAKxB,CAC7B,GAAM,CAAE,eAAAM,EAAgB,YAAAL,EAAa,eAAAM,EAAgB,QAAAL,CAAQ,EAAIF,EAG3DG,EAAgC,CACpC,gBAAiB,CAAE,IAHLK,EAAe,KAAKF,CAAc,EAGhB,aAAa,CAAE,EAC/C,gBAAiB,CAAE,IAAKC,CAAe,CACzC,EAEA,OAAOH,EAAU,CAAE,YAAAH,EAAa,QAAS,CAAE,GAAGC,EAAS,MAAOC,CAAe,CAAE,CAAC,CAClF,CAYA,eAAsBM,EAA4BT,EAKnB,CAC7B,GAAM,CAAE,eAAAM,EAAgB,YAAAL,EAAa,UAAAH,EAAW,QAAAI,CAAQ,EAAIF,EAGtDG,EAAgC,CACpC,gBAAiB,CAAE,IAHLK,EAAe,KAAKF,CAAc,EAAE,aAAa,CAG/B,EAChC,aAAc,CAAE,IAAKR,CAAU,CACjC,EAEA,OAAOM,EAAU,CAAE,YAAAH,EAAa,QAAS,CAAE,GAAGC,EAAS,MAAOC,CAAe,CAAE,CAAC,CAClF,CAeA,eAAsBC,EAAUJ,EAGD,CAC7B,GAAM,CAAE,YAAAC,EAAa,QAAAC,CAAQ,EAAIF,EAejCH,EAAqBK,GAAS,OAAO,cAAc,GAAG,EAEtD,IAAMQ,EAAe,CACnB,MAAOC,EACP,UAAW,CACT,gBAAiBT,GAAS,MAC1B,OAAQA,GAAS,OACjB,MAAOA,GAAS,MAChB,SAAUA,GAAS,OACrB,CACF,EAQA,OANa,MAAMU,EAA6B,CAC9C,YAAAX,EACA,MAAOS,EACP,aAAc,WAChB,CAAC,GAEW,MACd","names":["MAX_EVENT_TYPE_LENGTH","checkEventTypeLength","eventType","getModuleEventsByEventType","args","aptosConfig","options","whereCondition","getEvents","getAccountEventsByCreationNumber","accountAddress","creationNumber","AccountAddress","getAccountEventsByEventType","graphqlQuery","GetEvents","queryIndexer"]}
@@ -1,2 +1,2 @@
1
- import{a as o}from"./chunk-UJSTWN32.mjs";var t=class{constructor(n){this.config=n}async transferCoinTransaction(n){return o({aptosConfig:this.config,...n})}};export{t as a};
2
- //# sourceMappingURL=chunk-YJVZFYBX.mjs.map
1
+ import{a as o}from"./chunk-2WCATZVL.mjs";var t=class{constructor(n){this.config=n}async transferCoinTransaction(n){return o({aptosConfig:this.config,...n})}};export{t as a};
2
+ //# sourceMappingURL=chunk-ZPV7HPA4.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/api/coin.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { AccountAddressInput } from \"../core\";\nimport { transferCoinTransaction } from \"../internal/coin\";\nimport { SimpleTransaction } from \"../transactions/instances/simpleTransaction\";\nimport { InputGenerateTransactionOptions } from \"../transactions/types\";\nimport { AnyNumber, MoveStructId } from \"../types\";\nimport { AptosConfig } from \"./aptosConfig\";\n\n/**\n * A class to handle all `Coin` operations.\n * @group Coin\n */\nexport class Coin {\n /**\n * Initializes a new instance of the Aptos client with the specified configuration.\n * This allows you to interact with the Aptos blockchain using the provided settings.\n *\n * @param config - The configuration settings for the Aptos client.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * async function runExample() {\n * // Create a new Aptos client with testnet configuration\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * console.log(\"Aptos client initialized:\", aptos);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Coin\n */\n constructor(readonly config: AptosConfig) {}\n\n /**\n * Generate a transfer coin transaction that can be simulated, signed, and submitted.\n * This function helps you create a transaction to transfer a specified amount of coins\n * from one account to another within the Aptos network.\n *\n * @param args The arguments for the transfer transaction.\n * @param args.sender The sender account address.\n * @param args.recipient The recipient account address.\n * @param args.amount The amount of coins to transfer.\n * @param args.coinType Optional. The coin struct type to transfer. Defaults to 0x1::aptos_coin::AptosCoin.\n * @param args.options Optional. Additional options for generating the transaction.\n *\n * @returns SimpleTransaction\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Generate a transfer coin transaction\n * const transaction = await aptos.transferCoinTransaction({\n * sender: \"0x1\", // replace with a real sender account address\n * recipient: \"0x2\", // replace with a real recipient account address\n * amount: 10,\n * });\n *\n * console.log(transaction);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Coin\n */\n async transferCoinTransaction(args: {\n sender: AccountAddressInput;\n recipient: AccountAddressInput;\n amount: AnyNumber;\n coinType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }): Promise<SimpleTransaction> {\n return transferCoinTransaction({ aptosConfig: this.config, ...args });\n }\n}\n"],"mappings":"yCAcO,IAAMA,EAAN,KAAW,CAsBhB,YAAqBC,EAAqB,CAArB,YAAAA,CAAsB,CAqC3C,MAAM,wBAAwBC,EAMC,CAC7B,OAAOC,EAAwB,CAAE,YAAa,KAAK,OAAQ,GAAGD,CAAK,CAAC,CACtE,CACF","names":["Coin","config","args","transferCoinTransaction"]}
@@ -1,2 +1,2 @@
1
- import{a as o}from"../chunk-VQZMI3EZ.mjs";import{a as r}from"../chunk-FZDEGDUY.mjs";import"../chunk-V4FKFCBL.mjs";import"../chunk-KDMSOCZY.mjs";export{o as LocalNode,r as Move};
1
+ import{a as o}from"../chunk-CWKNJZB6.mjs";import{a as r}from"../chunk-35DKMW7Q.mjs";import"../chunk-DAFSKSZ5.mjs";import"../chunk-KDMSOCZY.mjs";export{o as LocalNode,r as Move};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1,9 +1,11 @@
1
1
  import { ChildProcessWithoutNullStreams } from 'child_process';
2
2
 
3
3
  /**
4
- * Represents a local node for running a testnet environment.
5
- * This class provides methods to start, stop, and check the status of the local testnet process.
4
+ * Represents a local node for running a localnet environment.
5
+ * This class provides methods to start, stop, and check the status of the localnet process.
6
6
  * It manages the lifecycle of the node process and ensures that it is operational before executing tests.
7
+ * @group Implementation
8
+ * @category CLI
7
9
  */
8
10
  declare class LocalNode {
9
11
  readonly MAXIMUM_WAIT_TIME_SEC = 75;
@@ -18,34 +20,44 @@ declare class LocalNode {
18
20
  *
19
21
  * @returns {Promise<void>} A promise that resolves to true if the process was successfully killed.
20
22
  * @throws {Error} If there is an error while attempting to kill the process.
23
+ * @group Implementation
24
+ * @category CLI
21
25
  */
22
26
  stop(): Promise<void>;
23
27
  /**
24
- * Runs a local testnet and waits for the process to be up.
28
+ * Runs a localnet and waits for the process to be up.
25
29
  * If the local node process is already running, it returns without starting the process.
26
30
  *
27
31
  * @returns {Promise<void>} A promise that resolves when the process is up.
32
+ * @group Implementation
33
+ * @category CLI
28
34
  */
29
35
  run(): Promise<void>;
30
36
  /**
31
- * Starts the local testnet by running the Aptos node with the specified command-line arguments.
37
+ * Starts the localnet by running the Aptos node with the specified command-line arguments.
32
38
  *
33
39
  * @returns {void}
34
40
  *
35
- * @throws {Error} If there is an issue starting the local testnet.
41
+ * @throws {Error} If there is an issue starting the localnet.
42
+ * @group Implementation
43
+ * @category CLI
36
44
  */
37
45
  start(): void;
38
46
  /**
39
- * Waits for the local testnet process to be operational within a specified maximum wait time.
47
+ * Waits for the localnet process to be operational within a specified maximum wait time.
40
48
  * This function continuously checks if the process is up and will throw an error if it fails to start.
41
49
  *
42
50
  * @returns Promise<boolean> - Resolves to true if the process is up, otherwise throws an error.
51
+ * @group Implementation
52
+ * @category CLI
43
53
  */
44
54
  waitUntilProcessIsUp(): Promise<boolean>;
45
55
  /**
46
- * Checks if the local testnet is up by querying the readiness endpoint.
56
+ * Checks if the localnet is up by querying the readiness endpoint.
47
57
  *
48
- * @returns Promise<boolean> - A promise that resolves to true if the testnet is up, otherwise false.
58
+ * @returns Promise<boolean> - A promise that resolves to true if the localnet is up, otherwise false.
59
+ * @group Implementation
60
+ * @category CLI
49
61
  */
50
62
  checkIfProcessIsUp(): Promise<boolean>;
51
63
  }
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-VQZMI3EZ.mjs";import"../chunk-V4FKFCBL.mjs";import"../chunk-KDMSOCZY.mjs";export{a as LocalNode};
1
+ import{a}from"../chunk-CWKNJZB6.mjs";import"../chunk-DAFSKSZ5.mjs";import"../chunk-KDMSOCZY.mjs";export{a as LocalNode};
2
2
  //# sourceMappingURL=localNode.mjs.map
@@ -14,6 +14,8 @@ import '../transactions/instances/transactionArgument.mjs';
14
14
  * Class representing a Move package management utility for the Aptos blockchain.
15
15
  * This class provides methods to initialize directories, compile packages, run tests, publish modules, create objects, upgrade
16
16
  * packages, build transaction payloads, and run scripts.
17
+ * @group Implementation
18
+ * @category CLI
17
19
  */
18
20
  declare class Move {
19
21
  /**
@@ -27,6 +29,8 @@ declare class Move {
27
29
  * @param args.extraArguments - Optional extra arguments to include in the form of an array of strings.
28
30
  * Ex. ["--assume-yes","--gas-unit-price=10"]
29
31
  * @returns stdout
32
+ * @group Implementation
33
+ * @category CLI
30
34
  */
31
35
  init(args: {
32
36
  network?: Network;
@@ -46,6 +50,8 @@ declare class Move {
46
50
  * @param args.extraArguments - Optional extra arguments to include in the form of an array of strings.
47
51
  * Ex. ["--assume-yes","--gas-unit-price=10"]
48
52
  * @returns stdout
53
+ * @group Implementation
54
+ * @category CLI
49
55
  */
50
56
  compile(args: {
51
57
  packageDirectoryPath: string;
@@ -64,6 +70,8 @@ declare class Move {
64
70
  * @param args.extraArguments - Optional extra arguments to include in the form of an array of strings.
65
71
  * Ex. ["--assume-yes","--gas-unit-price=10"]
66
72
  * @returns The stdout output from running the tests.
73
+ * @group Implementation
74
+ * @category CLI
67
75
  */
68
76
  test(args: {
69
77
  packageDirectoryPath: string;
@@ -83,6 +91,8 @@ declare class Move {
83
91
  * @param args.extraArguments - Optional extra arguments to include in the form of an array of strings.
84
92
  * Ex. ["--assume-yes","--gas-unit-price=10"]
85
93
  * @returns stdout
94
+ * @group Implementation
95
+ * @category CLI
86
96
  */
87
97
  publish(args: {
88
98
  packageDirectoryPath: string;
@@ -112,6 +122,8 @@ declare class Move {
112
122
  * --named-addresses "launchpad_addr=0x123,initial_creator_addr=0x456" \
113
123
  * --profile my_profile \
114
124
  * --assume-yes
125
+ * @group Implementation
126
+ * @category CLI
115
127
  */
116
128
  createObjectAndPublishPackage(args: {
117
129
  packageDirectoryPath: string;
@@ -135,6 +147,8 @@ declare class Move {
135
147
  * @param args.extraArguments - Optional extra arguments to include in the form of an array of strings.
136
148
  * Ex. ["--assume-yes","--gas-unit-price=10"]
137
149
  * @returns stdout
150
+ * @group Implementation
151
+ * @category CLI
138
152
  */
139
153
  upgradeObjectPackage(args: {
140
154
  packageDirectoryPath: string;
@@ -156,6 +170,8 @@ declare class Move {
156
170
  * @param args.extraArguments - Optional extra arguments to include in the form of an array of strings.
157
171
  * Ex. ["--assume-yes","--gas-unit-price=10"] *
158
172
  * @returns stdout
173
+ * @group Implementation
174
+ * @category CLI
159
175
  */
160
176
  buildPublishPayload(args: {
161
177
  packageDirectoryPath: string;
@@ -178,6 +194,8 @@ declare class Move {
178
194
  * Ex. ["--assume-yes","--gas-unit-price=10"]
179
195
  *
180
196
  * @returns The standard output from running the script.
197
+ * @group Implementation
198
+ * @category CLI
181
199
  */
182
200
  runScript(args: {
183
201
  compiledScriptPath: string;
@@ -202,6 +220,8 @@ declare class Move {
202
220
  * @param args - An array of strings representing the command-line arguments to be passed to the command.
203
221
  * @param showStdout - Show the standard output generated by the command.
204
222
  * @returns The standard output generated by the command.
223
+ * @group Implementation
224
+ * @category CLI
205
225
  */
206
226
  private runCommand;
207
227
  /**
@@ -210,6 +230,8 @@ declare class Move {
210
230
  * @param namedAddresses - A Map where the key is a string representing the name and the value is an AccountAddress.
211
231
  * Ex. {'alice' => '0x123', 'bob' => '0x456'}
212
232
  * @returns An array of named addresses formatted as strings separated by a comma. Ex. "alice=0x123,bob=0x456"
233
+ * @group Implementation
234
+ * @category CLI
213
235
  */
214
236
  private prepareNamedAddresses;
215
237
  /**
@@ -220,6 +242,8 @@ declare class Move {
220
242
  *
221
243
  * @param namedAddresses - A record containing named addresses where the key is the name and the value is the AccountAddress.
222
244
  * @returns A Map where each key is a name and each value is the corresponding address.
245
+ * @group Implementation
246
+ * @category CLI
223
247
  */
224
248
  private parseNamedAddresses;
225
249
  /**
@@ -228,6 +252,8 @@ declare class Move {
228
252
  * @param output - The output string containing the object address.
229
253
  * @returns The extracted object address.
230
254
  * @throws Error if the object address cannot be extracted from the output.
255
+ * @group Implementation
256
+ * @category CLI
231
257
  */
232
258
  private extractAddressFromOutput;
233
259
  }
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-FZDEGDUY.mjs";import"../chunk-KDMSOCZY.mjs";export{a as Move};
1
+ import{a}from"../chunk-35DKMW7Q.mjs";import"../chunk-KDMSOCZY.mjs";export{a as Move};
2
2
  //# sourceMappingURL=move.mjs.map