@aptos-labs/ts-sdk 1.33.0-sc.1 → 1.33.0-sc.3

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 (699) hide show
  1. package/README.md +4 -6
  2. package/dist/common/{accountAddress-fJZJVSBc.d.ts → accountAddress-Cf1amU98.d.ts} +293 -1
  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 +1945 -226
  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 +65 -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 +19 -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 +7 -2
  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 +56 -2
  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-UTOO6IVJ.mjs → chunk-22HNYCN4.mjs} +2 -2
  96. package/dist/esm/chunk-22HNYCN4.mjs.map +1 -0
  97. package/dist/esm/{chunk-U7UTBXJD.mjs → chunk-255RZ5AM.mjs} +2 -2
  98. package/dist/esm/chunk-255RZ5AM.mjs.map +1 -0
  99. package/dist/esm/{chunk-WJSZAGHP.mjs → chunk-2I2HOJHV.mjs} +2 -2
  100. package/dist/esm/chunk-2I2HOJHV.mjs.map +1 -0
  101. package/dist/esm/{chunk-CW6P2DDJ.mjs → chunk-2NWLRUD6.mjs} +2 -2
  102. package/dist/esm/{chunk-CW6P2DDJ.mjs.map → chunk-2NWLRUD6.mjs.map} +1 -1
  103. package/dist/esm/chunk-2YQZYHWO.mjs +2 -0
  104. package/dist/esm/chunk-2YQZYHWO.mjs.map +1 -0
  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-EVASO3UR.mjs → chunk-424ZTUPT.mjs} +2 -2
  108. package/dist/esm/chunk-424ZTUPT.mjs.map +1 -0
  109. package/dist/esm/chunk-4RXKALLC.mjs +2 -0
  110. package/dist/esm/chunk-4RXKALLC.mjs.map +1 -0
  111. package/dist/esm/chunk-4YLUM62M.mjs +2 -0
  112. package/dist/esm/chunk-4YLUM62M.mjs.map +1 -0
  113. package/dist/esm/{chunk-B2OF42B3.mjs → chunk-4ZYPDCSP.mjs} +2 -2
  114. package/dist/esm/chunk-4ZYPDCSP.mjs.map +1 -0
  115. package/dist/esm/{chunk-AOQJI6IC.mjs → chunk-5L2745QA.mjs} +2 -2
  116. package/dist/esm/chunk-5L2745QA.mjs.map +1 -0
  117. package/dist/esm/{chunk-7R44XXPU.mjs → chunk-5TZXG626.mjs} +2 -2
  118. package/dist/esm/chunk-5TZXG626.mjs.map +1 -0
  119. package/dist/esm/chunk-5VILVOYP.mjs +2 -0
  120. package/dist/esm/chunk-5VILVOYP.mjs.map +1 -0
  121. package/dist/esm/{chunk-2G7SAWM3.mjs → chunk-63JTAZEH.mjs} +2 -2
  122. package/dist/esm/chunk-63JTAZEH.mjs.map +1 -0
  123. package/dist/esm/{chunk-UQIMOQZ7.mjs → chunk-6XUFRKGR.mjs} +2 -2
  124. package/dist/esm/chunk-6XUFRKGR.mjs.map +1 -0
  125. package/dist/esm/{chunk-2WLKSKL7.mjs → chunk-75IC2LNI.mjs} +2 -2
  126. package/dist/esm/chunk-75IC2LNI.mjs.map +1 -0
  127. package/dist/esm/{chunk-SOLRIYPW.mjs → chunk-7FCSZ5LT.mjs} +2 -2
  128. package/dist/esm/{chunk-3BWKODVZ.mjs → chunk-7FJ7RHY4.mjs} +2 -2
  129. package/dist/esm/chunk-7FJ7RHY4.mjs.map +1 -0
  130. package/dist/esm/{chunk-WIDWY7A2.mjs → chunk-7IY3DTEF.mjs} +2 -2
  131. package/dist/esm/chunk-7IY3DTEF.mjs.map +1 -0
  132. package/dist/esm/{chunk-2CJC43CV.mjs → chunk-A5L76YP7.mjs} +1 -1
  133. package/dist/esm/chunk-A5L76YP7.mjs.map +1 -0
  134. package/dist/esm/{chunk-CK5NDXQT.mjs → chunk-AKLUTUMD.mjs} +2 -2
  135. package/dist/esm/chunk-AKLUTUMD.mjs.map +1 -0
  136. package/dist/esm/{chunk-IKJAX5KQ.mjs → chunk-AN75UUF7.mjs} +2 -2
  137. package/dist/esm/chunk-AN75UUF7.mjs.map +1 -0
  138. package/dist/esm/chunk-AV6G4ACP.mjs +2 -0
  139. package/dist/esm/chunk-AV6G4ACP.mjs.map +1 -0
  140. package/dist/esm/{chunk-AOROYJ74.mjs → chunk-AZWVCBK2.mjs} +2 -2
  141. package/dist/esm/chunk-AZWVCBK2.mjs.map +1 -0
  142. package/dist/esm/{chunk-6ZOVTYLJ.mjs → chunk-BI3BTSUB.mjs} +2 -2
  143. package/dist/esm/chunk-BI3BTSUB.mjs.map +1 -0
  144. package/dist/esm/chunk-BPNW35GW.mjs +2 -0
  145. package/dist/esm/chunk-BPNW35GW.mjs.map +1 -0
  146. package/dist/esm/{chunk-2CKUTG67.mjs → chunk-BWDNXTV6.mjs} +2 -2
  147. package/dist/esm/chunk-BWDNXTV6.mjs.map +1 -0
  148. package/dist/esm/{chunk-OIOGOW6I.mjs → chunk-C3Q23D22.mjs} +1 -1
  149. package/dist/esm/chunk-C3Q23D22.mjs.map +1 -0
  150. package/dist/esm/chunk-CKKCL3LM.mjs +2 -0
  151. package/dist/esm/chunk-CKKCL3LM.mjs.map +1 -0
  152. package/dist/esm/{chunk-PMA7XAFK.mjs → chunk-CMA7755V.mjs} +2 -2
  153. package/dist/esm/chunk-CMA7755V.mjs.map +1 -0
  154. package/dist/esm/{chunk-MKM5MDD5.mjs → chunk-CSEQXUJM.mjs} +2 -2
  155. package/dist/esm/{chunk-MKM5MDD5.mjs.map → chunk-CSEQXUJM.mjs.map} +1 -1
  156. package/dist/esm/{chunk-VQZMI3EZ.mjs → chunk-CWKNJZB6.mjs} +2 -2
  157. package/dist/esm/chunk-CWKNJZB6.mjs.map +1 -0
  158. package/dist/esm/{chunk-V4FKFCBL.mjs → chunk-DAFSKSZ5.mjs} +1 -1
  159. package/dist/esm/chunk-DAFSKSZ5.mjs.map +1 -0
  160. package/dist/esm/chunk-DGJHSYF5.mjs +2 -0
  161. package/dist/esm/chunk-DGJHSYF5.mjs.map +1 -0
  162. package/dist/esm/chunk-DPP3ROKC.mjs +2 -0
  163. package/dist/esm/chunk-DPP3ROKC.mjs.map +1 -0
  164. package/dist/esm/chunk-DPW6ELCQ.mjs +2 -0
  165. package/dist/esm/chunk-DPW6ELCQ.mjs.map +1 -0
  166. package/dist/esm/{chunk-BKSQPS2O.mjs → chunk-DTICBERU.mjs} +2 -2
  167. package/dist/esm/chunk-DTICBERU.mjs.map +1 -0
  168. package/dist/esm/{chunk-AJ5JHBAE.mjs → chunk-EBMEXURY.mjs} +2 -2
  169. package/dist/esm/chunk-EBMEXURY.mjs.map +1 -0
  170. package/dist/esm/chunk-EMURYYVO.mjs +2 -0
  171. package/dist/esm/chunk-EMURYYVO.mjs.map +1 -0
  172. package/dist/esm/{chunk-S22QVNK7.mjs → chunk-ESLJXR3M.mjs} +2 -2
  173. package/dist/esm/chunk-ESLJXR3M.mjs.map +1 -0
  174. package/dist/esm/{chunk-3QUZFCNW.mjs → chunk-EVG6EXWX.mjs} +2 -2
  175. package/dist/esm/chunk-EVG6EXWX.mjs.map +1 -0
  176. package/dist/esm/{chunk-P6RNNESB.mjs → chunk-EYE4UEWZ.mjs} +2 -2
  177. package/dist/esm/chunk-EYE4UEWZ.mjs.map +1 -0
  178. package/dist/esm/chunk-F2ZTBAJJ.mjs +2 -0
  179. package/dist/esm/chunk-F2ZTBAJJ.mjs.map +1 -0
  180. package/dist/esm/{chunk-AKIO3OIT.mjs → chunk-FN4C3CKC.mjs} +2 -2
  181. package/dist/esm/chunk-FN4C3CKC.mjs.map +1 -0
  182. package/dist/esm/{chunk-T6ADNZE5.mjs → chunk-G4O6FXCF.mjs} +2 -2
  183. package/dist/esm/chunk-G4O6FXCF.mjs.map +1 -0
  184. package/dist/esm/chunk-G5ZWH5T3.mjs +2 -0
  185. package/dist/esm/chunk-G5ZWH5T3.mjs.map +1 -0
  186. package/dist/esm/{chunk-TE3SBS7J.mjs → chunk-GCGMMS3E.mjs} +2 -2
  187. package/dist/esm/chunk-GCGMMS3E.mjs.map +1 -0
  188. package/dist/esm/{chunk-GMKKHGXK.mjs → chunk-GOXRBEIJ.mjs} +1 -1
  189. package/dist/esm/chunk-GOXRBEIJ.mjs.map +1 -0
  190. package/dist/esm/chunk-GP4TLDVZ.mjs +1 -0
  191. package/dist/esm/chunk-GP4TLDVZ.mjs.map +1 -0
  192. package/dist/esm/{chunk-FFBC7GFN.mjs → chunk-HBH2NQKU.mjs} +2 -2
  193. package/dist/esm/chunk-HBH2NQKU.mjs.map +1 -0
  194. package/dist/esm/{chunk-NNWPYX3K.mjs → chunk-I6XLN4DI.mjs} +2 -2
  195. package/dist/esm/chunk-I6XLN4DI.mjs.map +1 -0
  196. package/dist/esm/{chunk-2E3EAJPC.mjs → chunk-IDQUPGUG.mjs} +2 -2
  197. package/dist/esm/chunk-IDQUPGUG.mjs.map +1 -0
  198. package/dist/esm/{chunk-Q3CWUEXI.mjs → chunk-IDTLNF4M.mjs} +2 -2
  199. package/dist/esm/chunk-IDTLNF4M.mjs.map +1 -0
  200. package/dist/esm/{chunk-6Q2O5G3J.mjs → chunk-IF4UU2MT.mjs} +1 -1
  201. package/dist/esm/chunk-IF4UU2MT.mjs.map +1 -0
  202. package/dist/esm/chunk-IOZSAIGP.mjs +2 -0
  203. package/dist/esm/{chunk-YQHOQJRQ.mjs.map → chunk-IOZSAIGP.mjs.map} +1 -1
  204. package/dist/esm/{chunk-6YFM6NEC.mjs → chunk-IVH53P2F.mjs} +2 -2
  205. package/dist/esm/chunk-IVH53P2F.mjs.map +1 -0
  206. package/dist/esm/chunk-JJM6ELMS.mjs +2 -0
  207. package/dist/esm/chunk-JJM6ELMS.mjs.map +1 -0
  208. package/dist/esm/{chunk-5XLZACVT.mjs → chunk-JW5CCOAL.mjs} +2 -2
  209. package/dist/esm/chunk-JW5CCOAL.mjs.map +1 -0
  210. package/dist/esm/{chunk-DBAISV4K.mjs → chunk-JZ5DVZIM.mjs} +2 -2
  211. package/dist/esm/chunk-JZ5DVZIM.mjs.map +1 -0
  212. package/dist/esm/{chunk-BVUMR7DQ.mjs → chunk-KCFBPJUP.mjs} +2 -2
  213. package/dist/esm/chunk-KCFBPJUP.mjs.map +1 -0
  214. package/dist/esm/{chunk-XEW2YQE2.mjs → chunk-LA7EWU7P.mjs} +2 -2
  215. package/dist/esm/chunk-LA7EWU7P.mjs.map +1 -0
  216. package/dist/esm/{chunk-J2NQJ34O.mjs → chunk-LP4EJK2O.mjs} +2 -2
  217. package/dist/esm/chunk-LP4EJK2O.mjs.map +1 -0
  218. package/dist/esm/{chunk-7CDITZUS.mjs → chunk-M2G2BM4Z.mjs} +2 -2
  219. package/dist/esm/chunk-M2G2BM4Z.mjs.map +1 -0
  220. package/dist/esm/{chunk-7BKLEHKL.mjs → chunk-MCLYDS3O.mjs} +2 -2
  221. package/dist/esm/chunk-MCLYDS3O.mjs.map +1 -0
  222. package/dist/esm/{chunk-4JX6OQEE.mjs → chunk-MGAGOKNQ.mjs} +2 -2
  223. package/dist/esm/chunk-MGAGOKNQ.mjs.map +1 -0
  224. package/dist/esm/chunk-MNWN4IT6.mjs +2 -0
  225. package/dist/esm/chunk-MNWN4IT6.mjs.map +1 -0
  226. package/dist/esm/{chunk-AR6BOLET.mjs → chunk-MSE2YEDF.mjs} +2 -2
  227. package/dist/esm/chunk-MSE2YEDF.mjs.map +1 -0
  228. package/dist/esm/{chunk-BRV3RLKW.mjs → chunk-MT2RJ7H3.mjs} +2 -2
  229. package/dist/esm/chunk-MT2RJ7H3.mjs.map +1 -0
  230. package/dist/esm/{chunk-ACVIE7IE.mjs → chunk-N4DM5FYH.mjs} +2 -2
  231. package/dist/esm/chunk-N4DM5FYH.mjs.map +1 -0
  232. package/dist/esm/{chunk-LGTOOAQI.mjs → chunk-N6YTF76Q.mjs} +2 -2
  233. package/dist/esm/chunk-N6YTF76Q.mjs.map +1 -0
  234. package/dist/esm/chunk-NS5YFLZQ.mjs +2 -0
  235. package/dist/esm/chunk-NS5YFLZQ.mjs.map +1 -0
  236. package/dist/esm/{chunk-QCIRC2SG.mjs → chunk-OBEMAKRF.mjs} +2 -2
  237. package/dist/esm/chunk-OBEMAKRF.mjs.map +1 -0
  238. package/dist/esm/{chunk-2YTHKFJZ.mjs → chunk-ODEDSSQL.mjs} +2 -2
  239. package/dist/esm/chunk-ODEDSSQL.mjs.map +1 -0
  240. package/dist/esm/{chunk-2E3BT4YW.mjs → chunk-OHZURQPY.mjs} +2 -2
  241. package/dist/esm/chunk-OHZURQPY.mjs.map +1 -0
  242. package/dist/esm/{chunk-OZK26LTY.mjs → chunk-ONTWK5FU.mjs} +2 -2
  243. package/dist/esm/chunk-ONTWK5FU.mjs.map +1 -0
  244. package/dist/esm/{chunk-T7BTSSX7.mjs → chunk-OOJGI2IR.mjs} +2 -2
  245. package/dist/esm/chunk-OOJGI2IR.mjs.map +1 -0
  246. package/dist/esm/{chunk-42H7WETG.mjs → chunk-ORMOQWWH.mjs} +2 -2
  247. package/dist/esm/chunk-ORMOQWWH.mjs.map +1 -0
  248. package/dist/esm/{chunk-JNO7KPMG.mjs → chunk-Q4C4U6I4.mjs} +2 -2
  249. package/dist/esm/chunk-Q4C4U6I4.mjs.map +1 -0
  250. package/dist/esm/{chunk-YT3IP57B.mjs → chunk-QD55JBJB.mjs} +2 -2
  251. package/dist/esm/chunk-QD55JBJB.mjs.map +1 -0
  252. package/dist/esm/{chunk-F45G3GP3.mjs → chunk-QHEKBHNU.mjs} +2 -2
  253. package/dist/esm/{chunk-D6WMUQB5.mjs → chunk-R3VMJE5K.mjs} +2 -2
  254. package/dist/esm/chunk-R3VMJE5K.mjs.map +1 -0
  255. package/dist/esm/{chunk-J7PJSK3J.mjs → chunk-RJ7F4JDV.mjs} +1 -1
  256. package/dist/esm/chunk-RJ7F4JDV.mjs.map +1 -0
  257. package/dist/esm/{chunk-J45GIVXE.mjs → chunk-RKY36HTP.mjs} +2 -2
  258. package/dist/esm/chunk-RKY36HTP.mjs.map +1 -0
  259. package/dist/esm/chunk-ROT6S6BM.mjs +2 -0
  260. package/dist/esm/chunk-ROT6S6BM.mjs.map +1 -0
  261. package/dist/esm/{chunk-554TWPPO.mjs → chunk-SCXTC4PW.mjs} +2 -2
  262. package/dist/esm/chunk-SCXTC4PW.mjs.map +1 -0
  263. package/dist/esm/{chunk-SPRNSFUV.mjs → chunk-STY74NUA.mjs} +2 -2
  264. package/dist/esm/chunk-STY74NUA.mjs.map +1 -0
  265. package/dist/esm/{chunk-GX4CYRK4.mjs → chunk-T6NQDM7D.mjs} +2 -2
  266. package/dist/esm/chunk-T6NQDM7D.mjs.map +1 -0
  267. package/dist/esm/{chunk-SHAKBL2R.mjs → chunk-TMI4XNRL.mjs} +2 -2
  268. package/dist/esm/chunk-TMI4XNRL.mjs.map +1 -0
  269. package/dist/esm/{chunk-ZMBXHMVQ.mjs → chunk-TOBQ5UE6.mjs} +2 -2
  270. package/dist/esm/chunk-TOBQ5UE6.mjs.map +1 -0
  271. package/dist/esm/chunk-TWYIOTWN.mjs +2 -0
  272. package/dist/esm/chunk-TWYIOTWN.mjs.map +1 -0
  273. package/dist/esm/{chunk-362NFXZR.mjs → chunk-UC23V7PU.mjs} +2 -2
  274. package/dist/esm/chunk-UC23V7PU.mjs.map +1 -0
  275. package/dist/esm/{chunk-3TOPGQJA.mjs → chunk-UFDIPJRD.mjs} +2 -2
  276. package/dist/esm/chunk-UFDIPJRD.mjs.map +1 -0
  277. package/dist/esm/{chunk-3QIOEU3Z.mjs → chunk-V7PGIXTT.mjs} +2 -2
  278. package/dist/esm/chunk-V7PGIXTT.mjs.map +1 -0
  279. package/dist/esm/chunk-VFLH3KLJ.mjs +2 -0
  280. package/dist/esm/chunk-VFLH3KLJ.mjs.map +1 -0
  281. package/dist/esm/{chunk-IHGA5KAD.mjs → chunk-W4BSN6SK.mjs} +1 -1
  282. package/dist/esm/chunk-W4BSN6SK.mjs.map +1 -0
  283. package/dist/esm/chunk-WCMW2L3P.mjs +2 -0
  284. package/dist/esm/chunk-WCMW2L3P.mjs.map +1 -0
  285. package/dist/esm/{chunk-JJXLJY37.mjs → chunk-WG3SZFSJ.mjs} +2 -2
  286. package/dist/esm/chunk-WG3SZFSJ.mjs.map +1 -0
  287. package/dist/esm/{chunk-VGJIATTB.mjs → chunk-XGF7UNEW.mjs} +2 -2
  288. package/dist/esm/chunk-XGF7UNEW.mjs.map +1 -0
  289. package/dist/esm/chunk-XJJVJOX5.mjs +2 -0
  290. package/dist/esm/{chunk-UGTIALNW.mjs.map → chunk-XJJVJOX5.mjs.map} +1 -1
  291. package/dist/esm/{chunk-OPO5EYF7.mjs → chunk-XKUIMGKU.mjs} +2 -2
  292. package/dist/esm/chunk-XKUIMGKU.mjs.map +1 -0
  293. package/dist/esm/chunk-XTOIL6MB.mjs +2 -0
  294. package/dist/esm/chunk-XTOIL6MB.mjs.map +1 -0
  295. package/dist/esm/{chunk-4ZNSNWQL.mjs → chunk-YNU343QC.mjs} +2 -2
  296. package/dist/esm/chunk-YNU343QC.mjs.map +1 -0
  297. package/dist/esm/{chunk-HBIDHQ2M.mjs → chunk-YOZBVVKL.mjs} +1 -1
  298. package/dist/esm/chunk-YOZBVVKL.mjs.map +1 -0
  299. package/dist/esm/{chunk-B6ERS4UX.mjs → chunk-YZAUA2GG.mjs} +2 -2
  300. package/dist/esm/chunk-YZAUA2GG.mjs.map +1 -0
  301. package/dist/esm/{chunk-EPBNJZ4A.mjs → chunk-ZMSWKJDU.mjs} +2 -2
  302. package/dist/esm/chunk-ZMSWKJDU.mjs.map +1 -0
  303. package/dist/esm/{chunk-EVA2SMAU.mjs → chunk-ZTXK5FPC.mjs} +2 -2
  304. package/dist/esm/chunk-ZTXK5FPC.mjs.map +1 -0
  305. package/dist/esm/cli/index.mjs +1 -1
  306. package/dist/esm/cli/localNode.d.mts +20 -8
  307. package/dist/esm/cli/localNode.mjs +1 -1
  308. package/dist/esm/cli/move.d.mts +26 -0
  309. package/dist/esm/cli/move.mjs +1 -1
  310. package/dist/esm/client/core.d.mts +4 -0
  311. package/dist/esm/client/core.mjs +1 -1
  312. package/dist/esm/client/get.d.mts +33 -1
  313. package/dist/esm/client/get.mjs +1 -1
  314. package/dist/esm/client/index.d.mts +1 -1
  315. package/dist/esm/client/index.mjs +1 -1
  316. package/dist/esm/client/post.d.mts +37 -0
  317. package/dist/esm/client/post.mjs +1 -1
  318. package/dist/esm/core/account/index.mjs +1 -1
  319. package/dist/esm/core/account/utils/address.d.mts +6 -0
  320. package/dist/esm/core/account/utils/address.mjs +1 -1
  321. package/dist/esm/core/account/utils/index.mjs +1 -1
  322. package/dist/esm/core/accountAddress.d.mts +46 -0
  323. package/dist/esm/core/accountAddress.mjs +1 -1
  324. package/dist/esm/core/authenticationKey.d.mts +1 -1
  325. package/dist/esm/core/authenticationKey.mjs +1 -1
  326. package/dist/esm/core/common.d.mts +14 -0
  327. package/dist/esm/core/common.mjs +1 -1
  328. package/dist/esm/core/crypto/ed25519.d.mts +57 -5
  329. package/dist/esm/core/crypto/ed25519.mjs +1 -1
  330. package/dist/esm/core/crypto/ephemeral.d.mts +23 -1
  331. package/dist/esm/core/crypto/ephemeral.mjs +1 -1
  332. package/dist/esm/core/crypto/federatedKeyless.d.mts +13 -1
  333. package/dist/esm/core/crypto/federatedKeyless.mjs +1 -1
  334. package/dist/esm/core/crypto/hdKey.d.mts +28 -0
  335. package/dist/esm/core/crypto/hdKey.mjs +1 -1
  336. package/dist/esm/core/crypto/index.d.mts +2 -2
  337. package/dist/esm/core/crypto/index.mjs +1 -1
  338. package/dist/esm/core/crypto/keyless.d.mts +131 -1
  339. package/dist/esm/core/crypto/keyless.mjs +1 -1
  340. package/dist/esm/core/crypto/multiEd25519.d.mts +41 -1
  341. package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
  342. package/dist/esm/core/crypto/multiKey.d.mts +38 -1
  343. package/dist/esm/core/crypto/multiKey.mjs +1 -1
  344. package/dist/esm/core/crypto/poseidon.d.mts +10 -0
  345. package/dist/esm/core/crypto/poseidon.mjs +1 -1
  346. package/dist/esm/core/crypto/privateKey.d.mts +9 -1
  347. package/dist/esm/core/crypto/privateKey.mjs +1 -1
  348. package/dist/esm/core/crypto/proof.d.mts +2 -0
  349. package/dist/esm/core/crypto/proof.mjs +1 -1
  350. package/dist/esm/core/crypto/publicKey.d.mts +1 -1
  351. package/dist/esm/core/crypto/publicKey.mjs +1 -1
  352. package/dist/esm/core/crypto/secp256k1.d.mts +51 -3
  353. package/dist/esm/core/crypto/secp256k1.mjs +1 -1
  354. package/dist/esm/core/crypto/signature.d.mts +6 -0
  355. package/dist/esm/core/crypto/signature.mjs +1 -1
  356. package/dist/esm/core/crypto/singleKey.d.mts +36 -2
  357. package/dist/esm/core/crypto/singleKey.mjs +1 -1
  358. package/dist/esm/core/crypto/utils.d.mts +2 -0
  359. package/dist/esm/core/crypto/utils.mjs +1 -1
  360. package/dist/esm/core/hex.d.mts +20 -0
  361. package/dist/esm/core/hex.mjs +1 -1
  362. package/dist/esm/core/index.d.mts +2 -2
  363. package/dist/esm/core/index.mjs +1 -1
  364. package/dist/esm/errors/index.mjs +1 -1
  365. package/dist/esm/index.d.mts +5 -4
  366. package/dist/esm/index.mjs +1 -1
  367. package/dist/esm/internal/account.d.mts +24 -4
  368. package/dist/esm/internal/account.mjs +1 -1
  369. package/dist/esm/internal/ans.d.mts +27 -2
  370. package/dist/esm/internal/ans.mjs +1 -1
  371. package/dist/esm/internal/coin.d.mts +3 -1
  372. package/dist/esm/internal/coin.mjs +1 -1
  373. package/dist/esm/internal/digitalAsset.d.mts +31 -2
  374. package/dist/esm/internal/digitalAsset.mjs +1 -1
  375. package/dist/esm/internal/event.d.mts +5 -0
  376. package/dist/esm/internal/event.mjs +1 -1
  377. package/dist/esm/internal/faucet.d.mts +5 -0
  378. package/dist/esm/internal/faucet.mjs +1 -1
  379. package/dist/esm/internal/fungibleAsset.d.mts +8 -2
  380. package/dist/esm/internal/fungibleAsset.mjs +1 -1
  381. package/dist/esm/internal/general.d.mts +7 -0
  382. package/dist/esm/internal/general.mjs +1 -1
  383. package/dist/esm/internal/keyless.d.mts +6 -2
  384. package/dist/esm/internal/keyless.mjs +1 -1
  385. package/dist/esm/internal/object.d.mts +2 -0
  386. package/dist/esm/internal/object.mjs +1 -1
  387. package/dist/esm/internal/staking.d.mts +5 -1
  388. package/dist/esm/internal/staking.mjs +1 -1
  389. package/dist/esm/internal/table.d.mts +3 -0
  390. package/dist/esm/internal/table.mjs +1 -1
  391. package/dist/esm/internal/transaction.d.mts +14 -0
  392. package/dist/esm/internal/transaction.mjs +1 -1
  393. package/dist/esm/internal/transactionSubmission.d.mts +16 -5
  394. package/dist/esm/internal/transactionSubmission.mjs +1 -1
  395. package/dist/esm/internal/view.d.mts +2 -1
  396. package/dist/esm/internal/view.mjs +1 -1
  397. package/dist/esm/{publicKey-BVXX1nVl.d.mts → publicKey-BMtGNNLg.d.mts} +36 -0
  398. package/dist/esm/transactions/authenticator/account.d.mts +28 -1
  399. package/dist/esm/transactions/authenticator/account.mjs +1 -1
  400. package/dist/esm/transactions/authenticator/index.d.mts +2 -1
  401. package/dist/esm/transactions/authenticator/index.mjs +1 -1
  402. package/dist/esm/transactions/authenticator/transaction.d.mts +23 -2
  403. package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
  404. package/dist/esm/transactions/index.d.mts +2 -1
  405. package/dist/esm/transactions/index.mjs +1 -1
  406. package/dist/esm/transactions/instances/chainId.d.mts +8 -0
  407. package/dist/esm/transactions/instances/chainId.mjs +1 -1
  408. package/dist/esm/transactions/instances/identifier.d.mts +8 -0
  409. package/dist/esm/transactions/instances/identifier.mjs +1 -1
  410. package/dist/esm/transactions/instances/index.d.mts +2 -1
  411. package/dist/esm/transactions/instances/index.mjs +1 -1
  412. package/dist/esm/transactions/instances/moduleId.d.mts +10 -0
  413. package/dist/esm/transactions/instances/moduleId.mjs +1 -1
  414. package/dist/esm/transactions/instances/multiAgentTransaction.d.mts +8 -0
  415. package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
  416. package/dist/esm/transactions/instances/rawTransaction.d.mts +30 -0
  417. package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
  418. package/dist/esm/transactions/instances/rotationProofChallenge.d.mts +7 -1
  419. package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
  420. package/dist/esm/transactions/instances/signedTransaction.d.mts +10 -1
  421. package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
  422. package/dist/esm/transactions/instances/simpleTransaction.d.mts +8 -0
  423. package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
  424. package/dist/esm/transactions/instances/transactionArgument.d.mts +16 -0
  425. package/dist/esm/transactions/instances/transactionPayload.d.mts +48 -0
  426. package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
  427. package/dist/esm/transactions/management/accountSequenceNumber.d.mts +19 -2
  428. package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
  429. package/dist/esm/transactions/management/asyncQueue.d.mts +16 -0
  430. package/dist/esm/transactions/management/asyncQueue.mjs +1 -1
  431. package/dist/esm/transactions/management/index.d.mts +3 -2
  432. package/dist/esm/transactions/management/index.mjs +1 -1
  433. package/dist/esm/transactions/management/transactionWorker.d.mts +45 -7
  434. package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
  435. package/dist/esm/transactions/script-composer/index.d.mts +5 -2
  436. package/dist/esm/transactions/script-composer/index.mjs +1 -1
  437. package/dist/esm/transactions/transactionBuilder/helpers.d.mts +64 -1
  438. package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
  439. package/dist/esm/transactions/transactionBuilder/index.d.mts +2 -1
  440. package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
  441. package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +14 -1
  442. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
  443. package/dist/esm/transactions/transactionBuilder/signingMessage.d.mts +10 -1
  444. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
  445. package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +42 -1
  446. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
  447. package/dist/esm/transactions/typeTag/index.d.mts +82 -0
  448. package/dist/esm/transactions/typeTag/index.mjs +1 -1
  449. package/dist/esm/transactions/typeTag/parser.d.mts +8 -0
  450. package/dist/esm/transactions/typeTag/parser.mjs +1 -1
  451. package/dist/esm/transactions/types.d.mts +80 -1
  452. package/dist/esm/types/indexer.d.mts +52 -0
  453. package/dist/esm/types/keyless.d.mts +12 -0
  454. package/dist/esm/utils/apiEndpoints.d.mts +30 -0
  455. package/dist/esm/utils/apiEndpoints.mjs +1 -1
  456. package/dist/esm/utils/const.d.mts +24 -0
  457. package/dist/esm/utils/const.mjs +1 -1
  458. package/dist/esm/utils/helpers.d.mts +20 -0
  459. package/dist/esm/utils/helpers.mjs +1 -1
  460. package/dist/esm/utils/index.mjs +1 -1
  461. package/dist/esm/utils/memoize.d.mts +4 -0
  462. package/dist/esm/utils/memoize.mjs +1 -1
  463. package/dist/esm/utils/normalizeBundle.d.mts +8 -0
  464. package/dist/esm/utils/normalizeBundle.mjs +1 -1
  465. package/dist/esm/version.d.mts +1 -1
  466. package/dist/esm/version.mjs +1 -1
  467. package/package.json +20 -21
  468. package/src/account/AbstractKeylessAccount.ts +80 -9
  469. package/src/account/Account.ts +51 -6
  470. package/src/account/AccountUtils.ts +216 -0
  471. package/src/account/Ed25519Account.ts +26 -0
  472. package/src/account/EphemeralKeyPair.ts +30 -0
  473. package/src/account/FederatedKeylessAccount.ts +10 -3
  474. package/src/account/KeylessAccount.ts +13 -1
  475. package/src/account/MultiKeyAccount.ts +75 -12
  476. package/src/account/SingleKeyAccount.ts +63 -6
  477. package/src/account/index.ts +1 -0
  478. package/src/account/utils.ts +16 -0
  479. package/src/api/account.ts +22 -2
  480. package/src/api/ans.ts +15 -0
  481. package/src/api/aptos.ts +3 -0
  482. package/src/api/aptosConfig.ts +24 -0
  483. package/src/api/coin.ts +3 -0
  484. package/src/api/digitalAsset.ts +26 -0
  485. package/src/api/event.ts +6 -0
  486. package/src/api/faucet.ts +11 -2
  487. package/src/api/fungibleAsset.ts +8 -0
  488. package/src/api/general.ts +12 -0
  489. package/src/api/keyless.ts +6 -0
  490. package/src/api/object.ts +3 -0
  491. package/src/api/staking.ts +5 -0
  492. package/src/api/table.ts +5 -0
  493. package/src/api/transaction.ts +19 -3
  494. package/src/api/transactionSubmission/build.ts +10 -4
  495. package/src/api/transactionSubmission/helpers.ts +2 -0
  496. package/src/api/transactionSubmission/management.ts +5 -0
  497. package/src/api/transactionSubmission/sign.ts +4 -0
  498. package/src/api/transactionSubmission/simulate.ts +4 -0
  499. package/src/api/transactionSubmission/submit.ts +4 -0
  500. package/src/api/utils.ts +1 -0
  501. package/src/bcs/deserializer.ts +64 -2
  502. package/src/bcs/serializable/entryFunctionBytes.ts +10 -0
  503. package/src/bcs/serializable/fixedBytes.ts +12 -0
  504. package/src/bcs/serializable/movePrimitives.ts +26 -0
  505. package/src/bcs/serializable/moveStructs.ts +56 -0
  506. package/src/bcs/serializer.ts +64 -1
  507. package/src/cli/localNode.ts +22 -8
  508. package/src/cli/move.ts +26 -0
  509. package/src/client/core.ts +4 -0
  510. package/src/client/get.ts +75 -1
  511. package/src/client/post.ts +37 -0
  512. package/src/core/account/utils/address.ts +6 -0
  513. package/src/core/accountAddress.ts +46 -0
  514. package/src/core/authenticationKey.ts +22 -0
  515. package/src/core/common.ts +14 -0
  516. package/src/core/crypto/ed25519.ts +58 -4
  517. package/src/core/crypto/ephemeral.ts +22 -0
  518. package/src/core/crypto/federatedKeyless.ts +12 -0
  519. package/src/core/crypto/hdKey.ts +29 -0
  520. package/src/core/crypto/keyless.ts +134 -0
  521. package/src/core/crypto/multiEd25519.ts +40 -0
  522. package/src/core/crypto/multiKey.ts +37 -1
  523. package/src/core/crypto/poseidon.ts +20 -0
  524. package/src/core/crypto/privateKey.ts +17 -8
  525. package/src/core/crypto/proof.ts +2 -0
  526. package/src/core/crypto/publicKey.ts +14 -0
  527. package/src/core/crypto/secp256k1.ts +62 -5
  528. package/src/core/crypto/signature.ts +8 -0
  529. package/src/core/crypto/singleKey.ts +34 -2
  530. package/src/core/crypto/utils.ts +2 -0
  531. package/src/core/hex.ts +20 -0
  532. package/src/internal/account.ts +27 -7
  533. package/src/internal/ans.ts +27 -0
  534. package/src/internal/coin.ts +1 -0
  535. package/src/internal/digitalAsset.ts +30 -0
  536. package/src/internal/event.ts +6 -0
  537. package/src/internal/faucet.ts +5 -0
  538. package/src/internal/fungibleAsset.ts +5 -0
  539. package/src/internal/general.ts +7 -0
  540. package/src/internal/keyless.ts +4 -0
  541. package/src/internal/object.ts +2 -0
  542. package/src/internal/staking.ts +5 -1
  543. package/src/internal/table.ts +3 -0
  544. package/src/internal/transaction.ts +16 -0
  545. package/src/internal/transactionSubmission.ts +15 -2
  546. package/src/transactions/authenticator/account.ts +26 -0
  547. package/src/transactions/authenticator/transaction.ts +20 -0
  548. package/src/transactions/instances/chainId.ts +8 -0
  549. package/src/transactions/instances/identifier.ts +8 -0
  550. package/src/transactions/instances/moduleId.ts +10 -0
  551. package/src/transactions/instances/multiAgentTransaction.ts +8 -0
  552. package/src/transactions/instances/rawTransaction.ts +30 -0
  553. package/src/transactions/instances/rotationProofChallenge.ts +6 -0
  554. package/src/transactions/instances/signedTransaction.ts +8 -0
  555. package/src/transactions/instances/simpleTransaction.ts +8 -0
  556. package/src/transactions/instances/transactionArgument.ts +16 -0
  557. package/src/transactions/instances/transactionPayload.ts +50 -0
  558. package/src/transactions/management/accountSequenceNumber.ts +16 -0
  559. package/src/transactions/management/asyncQueue.ts +16 -0
  560. package/src/transactions/management/transactionWorker.ts +42 -5
  561. package/src/transactions/script-composer/index.ts +17 -8
  562. package/src/transactions/transactionBuilder/helpers.ts +82 -10
  563. package/src/transactions/transactionBuilder/remoteAbi.ts +20 -0
  564. package/src/transactions/transactionBuilder/signingMessage.ts +10 -0
  565. package/src/transactions/transactionBuilder/transactionBuilder.ts +58 -0
  566. package/src/transactions/typeTag/index.ts +82 -0
  567. package/src/transactions/typeTag/parser.ts +24 -0
  568. package/src/transactions/types.ts +78 -0
  569. package/src/types/indexer.ts +52 -0
  570. package/src/types/keyless.ts +12 -0
  571. package/src/utils/apiEndpoints.ts +30 -2
  572. package/src/utils/const.ts +24 -1
  573. package/src/utils/helpers.ts +22 -0
  574. package/src/utils/memoize.ts +6 -0
  575. package/src/utils/normalizeBundle.ts +8 -1
  576. package/src/version.ts +1 -1
  577. package/dist/common/chunk-F43XVDYJ.js.map +0 -1
  578. package/dist/esm/chunk-2CJC43CV.mjs.map +0 -1
  579. package/dist/esm/chunk-2CKUTG67.mjs.map +0 -1
  580. package/dist/esm/chunk-2E3BT4YW.mjs.map +0 -1
  581. package/dist/esm/chunk-2E3EAJPC.mjs.map +0 -1
  582. package/dist/esm/chunk-2G7SAWM3.mjs.map +0 -1
  583. package/dist/esm/chunk-2WLKSKL7.mjs.map +0 -1
  584. package/dist/esm/chunk-2YTHKFJZ.mjs.map +0 -1
  585. package/dist/esm/chunk-362NFXZR.mjs.map +0 -1
  586. package/dist/esm/chunk-3BWKODVZ.mjs.map +0 -1
  587. package/dist/esm/chunk-3QIOEU3Z.mjs.map +0 -1
  588. package/dist/esm/chunk-3QUZFCNW.mjs.map +0 -1
  589. package/dist/esm/chunk-3TOPGQJA.mjs.map +0 -1
  590. package/dist/esm/chunk-42H7WETG.mjs.map +0 -1
  591. package/dist/esm/chunk-4JX6OQEE.mjs.map +0 -1
  592. package/dist/esm/chunk-4O5XDQDO.mjs +0 -2
  593. package/dist/esm/chunk-4O5XDQDO.mjs.map +0 -1
  594. package/dist/esm/chunk-4ZNSNWQL.mjs.map +0 -1
  595. package/dist/esm/chunk-554TWPPO.mjs.map +0 -1
  596. package/dist/esm/chunk-5B3SMBXQ.mjs +0 -2
  597. package/dist/esm/chunk-5B3SMBXQ.mjs.map +0 -1
  598. package/dist/esm/chunk-5XLZACVT.mjs.map +0 -1
  599. package/dist/esm/chunk-6EVBSHT2.mjs +0 -2
  600. package/dist/esm/chunk-6EVBSHT2.mjs.map +0 -1
  601. package/dist/esm/chunk-6Q2O5G3J.mjs.map +0 -1
  602. package/dist/esm/chunk-6YFM6NEC.mjs.map +0 -1
  603. package/dist/esm/chunk-6ZOVTYLJ.mjs.map +0 -1
  604. package/dist/esm/chunk-77ILVREP.mjs +0 -2
  605. package/dist/esm/chunk-77ILVREP.mjs.map +0 -1
  606. package/dist/esm/chunk-7BKLEHKL.mjs.map +0 -1
  607. package/dist/esm/chunk-7CDITZUS.mjs.map +0 -1
  608. package/dist/esm/chunk-7R44XXPU.mjs.map +0 -1
  609. package/dist/esm/chunk-A7KFSQSE.mjs +0 -2
  610. package/dist/esm/chunk-A7KFSQSE.mjs.map +0 -1
  611. package/dist/esm/chunk-ACVIE7IE.mjs.map +0 -1
  612. package/dist/esm/chunk-AJ5JHBAE.mjs.map +0 -1
  613. package/dist/esm/chunk-AKIO3OIT.mjs.map +0 -1
  614. package/dist/esm/chunk-AOQJI6IC.mjs.map +0 -1
  615. package/dist/esm/chunk-AOROYJ74.mjs.map +0 -1
  616. package/dist/esm/chunk-AR6BOLET.mjs.map +0 -1
  617. package/dist/esm/chunk-AVZYJAXR.mjs +0 -2
  618. package/dist/esm/chunk-AVZYJAXR.mjs.map +0 -1
  619. package/dist/esm/chunk-B2OF42B3.mjs.map +0 -1
  620. package/dist/esm/chunk-B6ERS4UX.mjs.map +0 -1
  621. package/dist/esm/chunk-BKSQPS2O.mjs.map +0 -1
  622. package/dist/esm/chunk-BRV3RLKW.mjs.map +0 -1
  623. package/dist/esm/chunk-BVUMR7DQ.mjs.map +0 -1
  624. package/dist/esm/chunk-BZ7OCXLM.mjs +0 -2
  625. package/dist/esm/chunk-BZ7OCXLM.mjs.map +0 -1
  626. package/dist/esm/chunk-CK5NDXQT.mjs.map +0 -1
  627. package/dist/esm/chunk-D3OEQLUE.mjs +0 -2
  628. package/dist/esm/chunk-D3OEQLUE.mjs.map +0 -1
  629. package/dist/esm/chunk-D52UKPQF.mjs +0 -2
  630. package/dist/esm/chunk-D52UKPQF.mjs.map +0 -1
  631. package/dist/esm/chunk-D6WMUQB5.mjs.map +0 -1
  632. package/dist/esm/chunk-DBAISV4K.mjs.map +0 -1
  633. package/dist/esm/chunk-EPBNJZ4A.mjs.map +0 -1
  634. package/dist/esm/chunk-EVA2SMAU.mjs.map +0 -1
  635. package/dist/esm/chunk-EVASO3UR.mjs.map +0 -1
  636. package/dist/esm/chunk-FFBC7GFN.mjs.map +0 -1
  637. package/dist/esm/chunk-FZDEGDUY.mjs.map +0 -1
  638. package/dist/esm/chunk-GAEAYY44.mjs +0 -1
  639. package/dist/esm/chunk-GMKKHGXK.mjs.map +0 -1
  640. package/dist/esm/chunk-GX4CYRK4.mjs.map +0 -1
  641. package/dist/esm/chunk-H6RW3TML.mjs +0 -2
  642. package/dist/esm/chunk-H6RW3TML.mjs.map +0 -1
  643. package/dist/esm/chunk-HBIDHQ2M.mjs.map +0 -1
  644. package/dist/esm/chunk-HXCL6KBW.mjs +0 -2
  645. package/dist/esm/chunk-HXCL6KBW.mjs.map +0 -1
  646. package/dist/esm/chunk-IHGA5KAD.mjs.map +0 -1
  647. package/dist/esm/chunk-IIV42FZR.mjs +0 -2
  648. package/dist/esm/chunk-IIV42FZR.mjs.map +0 -1
  649. package/dist/esm/chunk-IKJAX5KQ.mjs.map +0 -1
  650. package/dist/esm/chunk-IZ3I5XZU.mjs +0 -2
  651. package/dist/esm/chunk-IZ3I5XZU.mjs.map +0 -1
  652. package/dist/esm/chunk-J2NQJ34O.mjs.map +0 -1
  653. package/dist/esm/chunk-J45GIVXE.mjs.map +0 -1
  654. package/dist/esm/chunk-J7PJSK3J.mjs.map +0 -1
  655. package/dist/esm/chunk-JJXLJY37.mjs.map +0 -1
  656. package/dist/esm/chunk-JNO7KPMG.mjs.map +0 -1
  657. package/dist/esm/chunk-LGTOOAQI.mjs.map +0 -1
  658. package/dist/esm/chunk-LRN4ALMT.mjs +0 -2
  659. package/dist/esm/chunk-LRN4ALMT.mjs.map +0 -1
  660. package/dist/esm/chunk-MHN6XY4Z.mjs +0 -2
  661. package/dist/esm/chunk-MHN6XY4Z.mjs.map +0 -1
  662. package/dist/esm/chunk-NNWPYX3K.mjs.map +0 -1
  663. package/dist/esm/chunk-OIOGOW6I.mjs.map +0 -1
  664. package/dist/esm/chunk-OPO5EYF7.mjs.map +0 -1
  665. package/dist/esm/chunk-OZK26LTY.mjs.map +0 -1
  666. package/dist/esm/chunk-P6RNNESB.mjs.map +0 -1
  667. package/dist/esm/chunk-PC4HNMCP.mjs +0 -2
  668. package/dist/esm/chunk-PC4HNMCP.mjs.map +0 -1
  669. package/dist/esm/chunk-PMA7XAFK.mjs.map +0 -1
  670. package/dist/esm/chunk-Q3CWUEXI.mjs.map +0 -1
  671. package/dist/esm/chunk-QCIRC2SG.mjs.map +0 -1
  672. package/dist/esm/chunk-S22QVNK7.mjs.map +0 -1
  673. package/dist/esm/chunk-SHAKBL2R.mjs.map +0 -1
  674. package/dist/esm/chunk-SPRNSFUV.mjs.map +0 -1
  675. package/dist/esm/chunk-T6ADNZE5.mjs.map +0 -1
  676. package/dist/esm/chunk-T7BTSSX7.mjs.map +0 -1
  677. package/dist/esm/chunk-TE3SBS7J.mjs.map +0 -1
  678. package/dist/esm/chunk-U7UTBXJD.mjs.map +0 -1
  679. package/dist/esm/chunk-UGTIALNW.mjs +0 -2
  680. package/dist/esm/chunk-UQIMOQZ7.mjs.map +0 -1
  681. package/dist/esm/chunk-UTOO6IVJ.mjs.map +0 -1
  682. package/dist/esm/chunk-UZTJWOLS.mjs +0 -2
  683. package/dist/esm/chunk-UZTJWOLS.mjs.map +0 -1
  684. package/dist/esm/chunk-V4FKFCBL.mjs.map +0 -1
  685. package/dist/esm/chunk-V5NDNR36.mjs +0 -2
  686. package/dist/esm/chunk-V5NDNR36.mjs.map +0 -1
  687. package/dist/esm/chunk-VGJIATTB.mjs.map +0 -1
  688. package/dist/esm/chunk-VQZMI3EZ.mjs.map +0 -1
  689. package/dist/esm/chunk-WIDWY7A2.mjs.map +0 -1
  690. package/dist/esm/chunk-WJSZAGHP.mjs.map +0 -1
  691. package/dist/esm/chunk-XEW2YQE2.mjs.map +0 -1
  692. package/dist/esm/chunk-YIQ3JFHW.mjs +0 -2
  693. package/dist/esm/chunk-YIQ3JFHW.mjs.map +0 -1
  694. package/dist/esm/chunk-YQHOQJRQ.mjs +0 -2
  695. package/dist/esm/chunk-YT3IP57B.mjs.map +0 -1
  696. package/dist/esm/chunk-ZMBXHMVQ.mjs.map +0 -1
  697. /package/dist/esm/{chunk-GAEAYY44.mjs.map → account/AccountUtils.mjs.map} +0 -0
  698. /package/dist/esm/{chunk-SOLRIYPW.mjs.map → chunk-7FCSZ5LT.mjs.map} +0 -0
  699. /package/dist/esm/{chunk-F45G3GP3.mjs.map → chunk-QHEKBHNU.mjs.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/core/crypto/ed25519.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { ed25519 } from \"@noble/curves/ed25519\";\nimport { Deserializer } from \"../../bcs/deserializer\";\nimport { Serializable, Serializer } from \"../../bcs/serializer\";\nimport { AuthenticationKey } from \"../authenticationKey\";\nimport { Hex } from \"../hex\";\nimport { HexInput, SigningScheme as AuthenticationKeyScheme, PrivateKeyVariants } from \"../../types\";\nimport { CKDPriv, deriveKey, HARDENED_OFFSET, isValidHardenedPath, mnemonicToSeed, splitPath } from \"./hdKey\";\nimport { PrivateKey } from \"./privateKey\";\nimport { AccountPublicKey, PublicKey, VerifySignatureArgs } from \"./publicKey\";\nimport { Signature } from \"./signature\";\nimport { convertSigningMessage } from \"./utils\";\n\n/**\n * L is the value that greater than or equal to will produce a non-canonical signature, and must be rejected\n * @group Implementation\n * @category Serialization\n */\nconst L: number[] = [\n 0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10,\n];\n\n/**\n * Checks if an ED25519 signature is non-canonical.\n * This function helps determine the validity of a signature by verifying its canonical form.\n *\n * @param signature - The signature to be checked for canonicality.\n * @returns A boolean indicating whether the signature is non-canonical.\n *\n * Comes from Aptos Core\n * https://github.com/aptos-labs/aptos-core/blob/main/crates/aptos-crypto/src/ed25519/ed25519_sigs.rs#L47-L85\n * @group Implementation\n * @category Serialization\n */\nexport function isCanonicalEd25519Signature(signature: Signature): boolean {\n const s = signature.toUint8Array().slice(32);\n for (let i = L.length - 1; i >= 0; i -= 1) {\n if (s[i] < L[i]) {\n return true;\n }\n if (s[i] > L[i]) {\n return false;\n }\n }\n // As this stage S == L which implies a non-canonical S.\n return false;\n}\n\n/**\n * Represents the public key of an Ed25519 key pair.\n *\n * Since [AIP-55](https://github.com/aptos-foundation/AIPs/pull/263) Aptos supports\n * `Legacy` and `Unified` authentication keys.\n *\n * Ed25519 scheme is represented in the SDK as `Legacy authentication key` and also\n * as `AnyPublicKey` that represents any `Unified authentication key`.\n * @group Implementation\n * @category Serialization\n */\nexport class Ed25519PublicKey extends AccountPublicKey {\n /**\n * Length of an Ed25519 public key\n * @group Implementation\n * @category Serialization\n */\n static readonly LENGTH: number = 32;\n\n /**\n * Bytes of the public key\n * @private\n * @group Implementation\n * @category Serialization\n */\n private readonly key: Hex;\n\n /**\n * Creates an instance of the Ed25519Signature class from a hex input.\n * This constructor validates the length of the signature to ensure it meets the required specifications.\n *\n * @param hexInput - The hex input representing the Ed25519 signature.\n * @throws Error if the signature length is not equal to Ed25519Signature.LENGTH.\n * @group Implementation\n * @category Serialization\n */\n constructor(hexInput: HexInput) {\n super();\n\n const hex = Hex.fromHexInput(hexInput);\n if (hex.toUint8Array().length !== Ed25519PublicKey.LENGTH) {\n throw new Error(`PublicKey length should be ${Ed25519PublicKey.LENGTH}`);\n }\n this.key = hex;\n }\n\n // region AccountPublicKey\n\n /**\n * Verifies a signed message using a public key.\n *\n * @param args - The arguments for verification.\n * @param args.message - A signed message as a Hex string or Uint8Array.\n * @param args.signature - The signature of the message.\n * @group Implementation\n * @category Serialization\n */\n verifySignature(args: VerifySignatureArgs): boolean {\n const { message, signature } = args;\n // Verify malleability\n if (!isCanonicalEd25519Signature(signature)) {\n return false;\n }\n\n const messageToVerify = convertSigningMessage(message);\n const messageBytes = Hex.fromHexInput(messageToVerify).toUint8Array();\n const signatureBytes = signature.toUint8Array();\n const publicKeyBytes = this.key.toUint8Array();\n return ed25519.verify(signatureBytes, messageBytes, publicKeyBytes);\n }\n\n /**\n * Generates an authentication key from the public key using the Ed25519 scheme.\n * This function is essential for creating a secure authentication key that can be used for further cryptographic operations.\n *\n * @returns {AuthenticationKey} The generated authentication key.\n * @group Implementation\n * @category Serialization\n */\n authKey(): AuthenticationKey {\n return AuthenticationKey.fromSchemeAndBytes({\n scheme: AuthenticationKeyScheme.Ed25519,\n input: this.toUint8Array(),\n });\n }\n\n /**\n * Convert the internal data representation to a Uint8Array.\n *\n * @returns Uint8Array representation of the data.\n * @group Implementation\n * @category Serialization\n */\n toUint8Array(): Uint8Array {\n return this.key.toUint8Array();\n }\n\n // endregion\n\n // region Serializable\n\n /**\n * Serializes the data into a byte array using the provided serializer.\n * This allows for the conversion of data into a format suitable for transmission or storage.\n *\n * @param serializer - The serializer instance used to perform the serialization.\n * @group Implementation\n * @category Serialization\n */\n serialize(serializer: Serializer): void {\n serializer.serializeBytes(this.key.toUint8Array());\n }\n\n /**\n * Deserialize bytes into an Ed25519Signature object.\n * This function is used to convert serialized byte data into a usable Ed25519Signature instance.\n *\n * @param deserializer - The deserializer instance used to read the byte data.\n * @group Implementation\n * @category Serialization\n */\n static deserialize(deserializer: Deserializer): Ed25519PublicKey {\n const bytes = deserializer.deserializeBytes();\n return new Ed25519PublicKey(bytes);\n }\n\n // endregion\n\n /**\n * Determine if the provided public key is an instance of Ed25519PublicKey.\n *\n * @param publicKey - The public key to check.\n * @returns True if the public key is an instance of Ed25519PublicKey, otherwise false.\n * @deprecated use `instanceof Ed25519PublicKey` instead.\n * @group Implementation\n * @category Serialization\n */\n static isPublicKey(publicKey: AccountPublicKey): publicKey is Ed25519PublicKey {\n return publicKey instanceof Ed25519PublicKey;\n }\n\n /**\n * Determines if the provided public key is a valid Ed25519 public key.\n * This function checks for the presence of the \"key\" property and verifies that its data length matches the expected length\n * for Ed25519 public keys.\n *\n * @param publicKey - The public key to validate.\n * @returns A boolean indicating whether the public key is a valid Ed25519 public key.\n * @group Implementation\n * @category Serialization\n */\n static isInstance(publicKey: PublicKey): publicKey is Ed25519PublicKey {\n return \"key\" in publicKey && (publicKey.key as any)?.data?.length === Ed25519PublicKey.LENGTH;\n }\n}\n\n/**\n * Represents the private key of an Ed25519 key pair.\n * @group Implementation\n * @category Serialization\n */\nexport class Ed25519PrivateKey extends Serializable implements PrivateKey {\n /**\n * Length of an Ed25519 private key\n * @group Implementation\n * @category Serialization\n */\n static readonly LENGTH: number = 32;\n\n /**\n * The Ed25519 key seed to use for BIP-32 compatibility\n * See more {@link https://github.com/satoshilabs/slips/blob/master/slip-0010.md}\n * @group Implementation\n * @category Serialization\n */\n static readonly SLIP_0010_SEED = \"ed25519 seed\";\n\n /**\n * The Ed25519 signing key\n * @private\n * @group Implementation\n * @category Serialization\n */\n private readonly signingKey: Hex;\n\n // region Constructors\n\n /**\n * Create a new PrivateKey instance from a Uint8Array or String.\n *\n * [Read about AIP-80](https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-80.md)\n *\n * @param hexInput HexInput (string or Uint8Array)\n * @param strict If true, private key must AIP-80 compliant.\n * @group Implementation\n * @category Serialization\n */\n constructor(hexInput: HexInput, strict?: boolean) {\n super();\n\n const privateKeyHex = PrivateKey.parseHexInput(hexInput, PrivateKeyVariants.Ed25519, strict);\n if (privateKeyHex.toUint8Array().length !== Ed25519PrivateKey.LENGTH) {\n throw new Error(`PrivateKey length should be ${Ed25519PrivateKey.LENGTH}`);\n }\n\n // Create keyPair from Private key in Uint8Array format\n this.signingKey = privateKeyHex;\n }\n\n /**\n * Generate a new random private key.\n *\n * @returns Ed25519PrivateKey A newly generated Ed25519 private key.\n * @group Implementation\n * @category Serialization\n */\n static generate(): Ed25519PrivateKey {\n const keyPair = ed25519.utils.randomPrivateKey();\n return new Ed25519PrivateKey(keyPair, false);\n }\n\n /**\n * Derives a private key from a mnemonic seed phrase using a specified BIP44 path.\n * To derive multiple keys from the same phrase, change the path\n *\n * IMPORTANT: Ed25519 supports hardened derivation only, as it lacks a key homomorphism, making non-hardened derivation impossible.\n *\n * @param path - The BIP44 path used for key derivation.\n * @param mnemonics - The mnemonic seed phrase from which the key will be derived.\n * @throws Error if the provided path is not a valid hardened path.\n * @group Implementation\n * @category Serialization\n */\n static fromDerivationPath(path: string, mnemonics: string): Ed25519PrivateKey {\n if (!isValidHardenedPath(path)) {\n throw new Error(`Invalid derivation path ${path}`);\n }\n return Ed25519PrivateKey.fromDerivationPathInner(path, mnemonicToSeed(mnemonics));\n }\n\n /**\n * Derives a child private key from a given BIP44 path and seed.\n * A private inner function so we can separate from the main fromDerivationPath() method\n * to add tests to verify we create the keys correctly.\n *\n * @param path - The BIP44 path used for key derivation.\n * @param seed - The seed phrase created by the mnemonics, represented as a Uint8Array.\n * @param offset - The offset used for key derivation, defaults to HARDENED_OFFSET.\n * @returns An instance of Ed25519PrivateKey derived from the specified path and seed.\n * @group Implementation\n * @category Serialization\n */\n private static fromDerivationPathInner(path: string, seed: Uint8Array, offset = HARDENED_OFFSET): Ed25519PrivateKey {\n const { key, chainCode } = deriveKey(Ed25519PrivateKey.SLIP_0010_SEED, seed);\n\n const segments = splitPath(path).map((el) => parseInt(el, 10));\n\n // Derive the child key based on the path\n const { key: privateKey } = segments.reduce((parentKeys, segment) => CKDPriv(parentKeys, segment + offset), {\n key,\n chainCode,\n });\n return new Ed25519PrivateKey(privateKey, false);\n }\n\n // endregion\n\n // region PrivateKey\n\n /**\n * Derive the Ed25519PublicKey for this private key.\n *\n * @returns Ed25519PublicKey - The derived public key corresponding to the private key.\n * @group Implementation\n * @category Serialization\n */\n publicKey(): Ed25519PublicKey {\n const bytes = ed25519.getPublicKey(this.signingKey.toUint8Array());\n return new Ed25519PublicKey(bytes);\n }\n\n /**\n * Sign the given message with the private key.\n * This function generates a digital signature for the specified message, ensuring its authenticity and integrity.\n *\n * @param message - A message as a string or Uint8Array in HexInput format.\n * @returns A digital signature for the provided message.\n * @group Implementation\n * @category Serialization\n */\n sign(message: HexInput): Ed25519Signature {\n const messageToSign = convertSigningMessage(message);\n const messageBytes = Hex.fromHexInput(messageToSign).toUint8Array();\n const signatureBytes = ed25519.sign(messageBytes, this.signingKey.toUint8Array());\n return new Ed25519Signature(signatureBytes);\n }\n\n /**\n * Get the private key in bytes (Uint8Array).\n *\n * @returns Uint8Array representation of the private key\n * @group Implementation\n * @category Serialization\n */\n toUint8Array(): Uint8Array {\n return this.signingKey.toUint8Array();\n }\n\n /**\n * Get the private key as a hex string with the 0x prefix.\n *\n * @returns string representation of the private key.\n * @group Implementation\n * @category Serialization\n */\n toString(): string {\n return this.toHexString();\n }\n\n /**\n * Get the private key as a hex string with the 0x prefix.\n *\n * @returns string representation of the private key.\n */\n toHexString(): string {\n return this.signingKey.toString();\n }\n\n /**\n * Get the private key as a AIP-80 compliant hex string.\n *\n * [Read about AIP-80](https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-80.md)\n *\n * @returns AIP-80 compliant string representation of the private key.\n */\n toAIP80String(): string {\n return PrivateKey.formatPrivateKey(this.signingKey.toString(), PrivateKeyVariants.Ed25519);\n }\n\n // endregion\n\n // region Serializable\n\n serialize(serializer: Serializer): void {\n serializer.serializeBytes(this.toUint8Array());\n }\n\n static deserialize(deserializer: Deserializer): Ed25519PrivateKey {\n const bytes = deserializer.deserializeBytes();\n return new Ed25519PrivateKey(bytes, false);\n }\n\n // endregion\n\n /**\n * Determines if the provided private key is an instance of Ed25519PrivateKey.\n *\n * @param privateKey - The private key to check.\n * @returns A boolean indicating whether the private key is an Ed25519PrivateKey.\n *\n * @deprecated Use `instanceof Ed25519PrivateKey` instead.\n * @group Implementation\n * @category Serialization\n */\n static isPrivateKey(privateKey: PrivateKey): privateKey is Ed25519PrivateKey {\n return privateKey instanceof Ed25519PrivateKey;\n }\n}\n\n/**\n * Represents a signature of a message signed using an Ed25519 private key.\n * @group Implementation\n * @category Serialization\n */\nexport class Ed25519Signature extends Signature {\n /**\n * Length of an Ed25519 signature, which is 64 bytes.\n * @group Implementation\n * @category Serialization\n */\n static readonly LENGTH = 64;\n\n /**\n * The signature bytes\n * @private\n * @group Implementation\n * @category Serialization\n */\n private readonly data: Hex;\n\n // region Constructors\n\n constructor(hexInput: HexInput) {\n super();\n const data = Hex.fromHexInput(hexInput);\n if (data.toUint8Array().length !== Ed25519Signature.LENGTH) {\n throw new Error(`Signature length should be ${Ed25519Signature.LENGTH}`);\n }\n this.data = data;\n }\n\n // endregion\n\n // region Signature\n\n toUint8Array(): Uint8Array {\n return this.data.toUint8Array();\n }\n\n // endregion\n\n // region Serializable\n\n serialize(serializer: Serializer): void {\n serializer.serializeBytes(this.data.toUint8Array());\n }\n\n static deserialize(deserializer: Deserializer): Ed25519Signature {\n const bytes = deserializer.deserializeBytes();\n return new Ed25519Signature(bytes);\n }\n\n // endregion\n}\n"],"mappings":"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","names":["ed25519","L","isCanonicalEd25519Signature","signature","s","i","_Ed25519PublicKey","AccountPublicKey","hexInput","hex","Hex","args","message","messageToVerify","convertSigningMessage","messageBytes","signatureBytes","publicKeyBytes","ed25519","AuthenticationKey","serializer","deserializer","bytes","publicKey","Ed25519PublicKey","_Ed25519PrivateKey","Serializable","strict","privateKeyHex","PrivateKey","keyPair","path","mnemonics","isValidHardenedPath","mnemonicToSeed","seed","offset","HARDENED_OFFSET","key","chainCode","deriveKey","segments","splitPath","el","privateKey","parentKeys","segment","CKDPriv","messageToSign","Ed25519Signature","Ed25519PrivateKey","_Ed25519Signature","Signature","data"]}
@@ -0,0 +1,2 @@
1
+ import{a}from"./chunk-EBMEXURY.mjs";var e=class extends a{};export{e as a};
2
+ //# sourceMappingURL=chunk-XJJVJOX5.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/core/crypto/proof.ts"],"sourcesContent":["import { Serializable } from \"../../bcs\";\n\n/**\n * An abstract representation of a cryptographic proof associated with specific\n * zero-knowledge proof schemes, such as Groth16 and PLONK.\n */\nexport abstract class Proof extends Serializable {}\n"],"mappings":"oCAMO,IAAeA,EAAf,cAA6BC,CAAa,CAAC","names":["Proof","Serializable"]}
1
+ {"version":3,"sources":["../../src/core/crypto/proof.ts"],"sourcesContent":["import { Serializable } from \"../../bcs\";\n\n/**\n * An abstract representation of a cryptographic proof associated with specific\n * zero-knowledge proof schemes, such as Groth16 and PLONK.\n * @group Implementation\n * @category Serialization\n */\nexport abstract class Proof extends Serializable {}\n"],"mappings":"oCAQO,IAAeA,EAAf,cAA6BC,CAAa,CAAC","names":["Proof","Serializable"]}
@@ -1,2 +1,2 @@
1
- import{a as i}from"./chunk-AJ5JHBAE.mjs";var r=class a extends i{constructor(e){super(),this.chainId=e}serialize(e){e.serializeU8(this.chainId)}static deserialize(e){let s=e.deserializeU8();return new a(s)}};export{r as a};
2
- //# sourceMappingURL=chunk-OPO5EYF7.mjs.map
1
+ import{a as i}from"./chunk-EBMEXURY.mjs";var r=class a extends i{constructor(e){super(),this.chainId=e}serialize(e){e.serializeU8(this.chainId)}static deserialize(e){let s=e.deserializeU8();return new a(s)}};export{r as a};
2
+ //# sourceMappingURL=chunk-XKUIMGKU.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/transactions/instances/chainId.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Serializer, Serializable } from \"../../bcs/serializer\";\nimport { Deserializer } from \"../../bcs/deserializer\";\n\n/**\n * Represents a ChainId that can be serialized and deserialized.\n *\n * @extends Serializable\n * @group Implementation\n * @category Transactions\n */\nexport class ChainId extends Serializable {\n public readonly chainId: number;\n\n /**\n * Initializes a new instance of the class with the specified chain ID.\n *\n * @param chainId - The ID of the blockchain network to be used.\n * @group Implementation\n * @category Transactions\n */\n constructor(chainId: number) {\n super();\n this.chainId = chainId;\n }\n\n /**\n * Serializes the current object using the provided serializer.\n * This function helps in converting the object into a format suitable for transmission or storage.\n *\n * @param serializer - The serializer instance used to perform the serialization.\n * @group Implementation\n * @category Transactions\n */\n serialize(serializer: Serializer): void {\n serializer.serializeU8(this.chainId);\n }\n\n /**\n * Deserializes a ChainId from the provided deserializer.\n * This function allows you to reconstruct a ChainId object from serialized data.\n *\n * @param deserializer - The deserializer instance used to read the serialized data.\n * @group Implementation\n * @category Transactions\n */\n static deserialize(deserializer: Deserializer): ChainId {\n const chainId = deserializer.deserializeU8();\n return new ChainId(chainId);\n }\n}\n"],"mappings":"yCAaO,IAAMA,EAAN,MAAMC,UAAgBC,CAAa,CAUxC,YAAYC,EAAiB,CAC3B,MAAM,EACN,KAAK,QAAUA,CACjB,CAUA,UAAUC,EAA8B,CACtCA,EAAW,YAAY,KAAK,OAAO,CACrC,CAUA,OAAO,YAAYC,EAAqC,CACtD,IAAMF,EAAUE,EAAa,cAAc,EAC3C,OAAO,IAAIJ,EAAQE,CAAO,CAC5B,CACF","names":["ChainId","_ChainId","Serializable","chainId","serializer","deserializer"]}
@@ -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":"kFA6CO,IAAMA,EAAN,MAAMC,CAAa,CAaxB,YAAYC,EAAkB,CAE5B,KAAK,OAAS,IAAI,YAAYA,EAAK,MAAM,EACzC,IAAI,WAAW,KAAK,MAAM,EAAE,IAAIA,EAAM,CAAC,EACvC,KAAK,OAAS,CAChB,CAEA,OAAO,QAAQC,EAA6B,CAC1C,IAAMD,EAAOE,EAAI,qBAAqBD,CAAG,EACzC,OAAO,IAAIF,EAAaC,CAAI,CAC9B,CAUQ,KAAKG,EAA6B,CACxC,GAAI,KAAK,OAASA,EAAS,KAAK,OAAO,WACrC,MAAM,IAAI,MAAM,8BAA8B,EAGhD,IAAMC,EAAQ,KAAK,OAAO,MAAM,KAAK,OAAQ,KAAK,OAASD,CAAM,EACjE,YAAK,QAAUA,EACRC,CACT,CAWA,WAAoB,CAClB,OAAO,KAAK,OAAO,WAAa,KAAK,MACvC,CAiBA,gBAAyB,CACvB,IAAMC,EAAQ,KAAK,iBAAiB,EAEpC,OADoB,IAAI,YAAY,EACjB,OAAOA,CAAK,CACjC,CAeA,sBAA2C,CACzC,OAAO,KAAK,kBAAkB,QAAQ,CACxC,CA4CA,kBACEC,EACAC,EACqC,CAErC,GADe,KAAK,gBAAgB,EAGpC,IAAID,IAAS,SACX,OAAO,KAAK,eAAe,EAE7B,GAAIA,IAAS,QACX,OAAO,KAAK,iBAAiB,EAE/B,GAAIA,IAAS,aAAc,CACzB,GAAIC,IAAQ,OACV,MAAM,IAAI,MAAM,iCAAiC,EAEnD,OAAO,KAAK,sBAAsBA,CAAG,CACvC,CAEA,OAAO,KAAK,YAAYD,CAAI,EAC9B,CAYA,kBAA+B,CAC7B,IAAMC,EAAM,KAAK,wBAAwB,EACzC,OAAO,IAAI,WAAW,KAAK,KAAKA,CAAG,CAAC,CACtC,CASA,sBAAsBA,EAAyB,CAC7C,OAAO,IAAI,WAAW,KAAK,KAAKA,CAAG,CAAC,CACtC,CAaA,iBAA2B,CACzB,IAAMC,EAAO,IAAI,WAAW,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC,EAC3C,GAAIA,IAAS,GAAKA,IAAS,EACzB,MAAM,IAAI,MAAM,uBAAuB,EAEzC,OAAOA,IAAS,CAClB,CAWA,eAAuB,CACrB,OAAO,IAAI,SAAS,KAAK,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAC9C,CAcA,gBAAyB,CACvB,OAAO,IAAI,SAAS,KAAK,KAAK,CAAC,CAAC,EAAE,UAAU,EAAG,EAAI,CACrD,CAcA,gBAAyB,CACvB,OAAO,IAAI,SAAS,KAAK,KAAK,CAAC,CAAC,EAAE,UAAU,EAAG,EAAI,CACrD,CAcA,gBAAyB,CACvB,IAAMC,EAAM,KAAK,eAAe,EAC1BC,EAAO,KAAK,eAAe,EAGjC,OAAO,OAAQ,OAAOA,CAAI,GAAK,OAAO,EAAE,EAAK,OAAOD,CAAG,CAAC,CAC1D,CAUA,iBAA2B,CACzB,IAAMA,EAAM,KAAK,eAAe,EAC1BC,EAAO,KAAK,eAAe,EAGjC,OAAO,OAAQA,GAAQ,OAAO,EAAE,EAAKD,CAAG,CAC1C,CAWA,iBAA2B,CACzB,IAAMA,EAAM,KAAK,gBAAgB,EAC3BC,EAAO,KAAK,gBAAgB,EAGlC,OAAO,OAAQA,GAAQ,OAAO,GAAG,EAAKD,CAAG,CAC3C,CAYA,yBAAkC,CAChC,IAAIJ,EAAgB,OAAO,CAAC,EACxBM,EAAQ,EAEZ,KAAON,EAAQO,GAAgB,CAC7B,IAAMC,EAAO,KAAK,cAAc,EAGhC,GAFAR,GAAS,OAAOQ,EAAO,GAAI,GAAK,OAAOF,CAAK,EAEvC,EAAAE,EAAO,KACV,MAEFF,GAAS,CACX,CAEA,GAAIN,EAAQO,EACV,MAAM,IAAI,MAAM,qDAAqD,EAGvE,OAAO,OAAOP,CAAK,CACrB,CAiBA,YAAeS,EAA2B,CAGxC,OAAOA,EAAI,YAAY,IAAI,CAC7B,CA0BA,kBAAqBA,EAAkC,CACrD,IAAMX,EAAS,KAAK,wBAAwB,EACtCY,EAAS,IAAI,MACnB,QAASC,EAAI,EAAGA,EAAIb,EAAQa,GAAK,EAC/BD,EAAO,KAAK,KAAK,YAAYD,CAAG,CAAC,EAEnC,OAAOC,CACT,CACF","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{c as a}from"./chunk-CK5NDXQT.mjs";import{u as n}from"./chunk-VHNX2NUR.mjs";import{b as s}from"./chunk-JNO7KPMG.mjs";async function d(e){let{aptosConfig:o,options:t}=e,r={query:n,variables:{where_condition:t?.where,offset:t?.offset,limit:t?.limit,order_by:t?.orderBy}};return(await a({aptosConfig:o,query:r,originMethod:"getObjectData"})).current_objects}async function f(e){let{aptosConfig:o,objectAddress:t,options:r}=e,c={object_address:{_eq:s.from(t).toStringLong()}};return(await d({aptosConfig:o,options:{...r,where:c}}))[0]}export{d as a,f as b};
2
- //# sourceMappingURL=chunk-4ZNSNWQL.mjs.map
1
+ import{c as a}from"./chunk-AKLUTUMD.mjs";import{u as n}from"./chunk-VHNX2NUR.mjs";import{b as s}from"./chunk-Q4C4U6I4.mjs";async function d(e){let{aptosConfig:o,options:t}=e,r={query:n,variables:{where_condition:t?.where,offset:t?.offset,limit:t?.limit,order_by:t?.orderBy}};return(await a({aptosConfig:o,query:r,originMethod:"getObjectData"})).current_objects}async function f(e){let{aptosConfig:o,objectAddress:t,options:r}=e,c={object_address:{_eq:s.from(t).toStringLong()}};return(await d({aptosConfig:o,options:{...r,where:c}}))[0]}export{d as a,f as b};
2
+ //# sourceMappingURL=chunk-YNU343QC.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/internal/object.ts"],"sourcesContent":["import { AptosConfig } from \"../api/aptosConfig\";\nimport { AccountAddressInput, AccountAddress } from \"../core\";\nimport { PaginationArgs, OrderByArg, GetObjectDataQueryResponse, WhereArg } from \"../types\";\nimport { GetObjectDataQuery } from \"../types/generated/operations\";\nimport { GetObjectData } from \"../types/generated/queries\";\nimport { CurrentObjectsBoolExp } from \"../types/generated/types\";\nimport { queryIndexer } from \"./general\";\n\n/**\n * Retrieves the current objects based on specified filtering and pagination options.\n *\n * @param args - The arguments for retrieving object data.\n * @param args.aptosConfig - The configuration settings for Aptos.\n * @param [args.options] - Optional parameters for pagination and filtering.\n * @param [args.options.offset] - The number of items to skip before starting to collect the result set.\n * @param [args.options.limit] - The maximum number of items to return.\n * @param [args.options.orderBy] - The criteria for ordering the results.\n * @param [args.options.where] - The conditions to filter the results.\n * @returns The current objects that match the specified criteria.\n * @group Implementation\n */\nexport async function getObjectData(args: {\n aptosConfig: AptosConfig;\n options?: PaginationArgs & OrderByArg<GetObjectDataQueryResponse[0]> & WhereArg<CurrentObjectsBoolExp>;\n}): Promise<GetObjectDataQueryResponse> {\n const { aptosConfig, options } = args;\n\n const graphqlQuery = {\n query: GetObjectData,\n variables: {\n where_condition: options?.where,\n offset: options?.offset,\n limit: options?.limit,\n order_by: options?.orderBy,\n },\n };\n const data = await queryIndexer<GetObjectDataQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getObjectData\",\n });\n\n return data.current_objects;\n}\n\n/**\n * Retrieves the object data associated with a specific object address.\n * This function allows you to access detailed information about an object in the Aptos blockchain.\n *\n * @param args - The arguments for retrieving object data.\n * @param args.aptosConfig - The configuration for connecting to the Aptos blockchain.\n * @param args.objectAddress - The address of the object whose data is being retrieved.\n * @param args.options - Optional parameters for pagination and ordering of the results.\n * @group Implementation\n */\nexport async function getObjectDataByObjectAddress(args: {\n aptosConfig: AptosConfig;\n objectAddress: AccountAddressInput;\n options?: PaginationArgs & OrderByArg<GetObjectDataQueryResponse[0]>;\n}): Promise<GetObjectDataQueryResponse[0]> {\n const { aptosConfig, objectAddress, options } = args;\n const address = AccountAddress.from(objectAddress).toStringLong();\n\n const whereCondition: { object_address: { _eq: string } } = {\n object_address: { _eq: address },\n };\n return (await getObjectData({ aptosConfig, options: { ...options, where: whereCondition } }))[0];\n}\n"],"mappings":"2HAqBA,eAAsBA,EAAcC,EAGI,CACtC,GAAM,CAAE,YAAAC,EAAa,QAAAC,CAAQ,EAAIF,EAE3BG,EAAe,CACnB,MAAOC,EACP,UAAW,CACT,gBAAiBF,GAAS,MAC1B,OAAQA,GAAS,OACjB,MAAOA,GAAS,MAChB,SAAUA,GAAS,OACrB,CACF,EAOA,OANa,MAAMG,EAAiC,CAClD,YAAAJ,EACA,MAAOE,EACP,aAAc,eAChB,CAAC,GAEW,eACd,CAYA,eAAsBG,EAA6BN,EAIR,CACzC,GAAM,CAAE,YAAAC,EAAa,cAAAM,EAAe,QAAAL,CAAQ,EAAIF,EAG1CQ,EAAsD,CAC1D,eAAgB,CAAE,IAHJC,EAAe,KAAKF,CAAa,EAAE,aAAa,CAG/B,CACjC,EACA,OAAQ,MAAMR,EAAc,CAAE,YAAAE,EAAa,QAAS,CAAE,GAAGC,EAAS,MAAOM,CAAe,CAAE,CAAC,GAAG,CAAC,CACjG","names":["getObjectData","args","aptosConfig","options","graphqlQuery","GetObjectData","queryIndexer","getObjectDataByObjectAddress","objectAddress","whereCondition","AccountAddress"]}
@@ -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"]}
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-HXCL6KBW.mjs";import{a as e,c as n}from"./chunk-V4FKFCBL.mjs";var r=class{constructor(t,i,o,a,c){this.lastUncommintedNumber=null;this.currentNumber=null;this.lock=!1;this.aptosConfig=t,this.account=i,this.maxWaitTime=o,this.maximumInFlight=a,this.sleepTime=c}async nextSequenceNumber(){for(;this.lock;)await e(this.sleepTime);this.lock=!0;let t=BigInt(0);try{if((this.lastUncommintedNumber===null||this.currentNumber===null)&&await this.initialize(),this.currentNumber-this.lastUncommintedNumber>=this.maximumInFlight){await this.update();let i=n();for(;this.currentNumber-this.lastUncommintedNumber>=this.maximumInFlight;)await e(this.sleepTime),n()-i>this.maxWaitTime?(console.warn(`Waited over 30 seconds for a transaction to commit, re-syncing ${this.account.accountAddress.toString()}`),await this.initialize()):await this.update()}t=this.currentNumber,this.currentNumber+=BigInt(1)}catch(i){console.error("error in getting next sequence number for this account",i)}finally{this.lock=!1}return t}async initialize(){let{sequence_number:t}=await s({aptosConfig:this.aptosConfig,accountAddress:this.account.accountAddress});this.currentNumber=BigInt(t),this.lastUncommintedNumber=BigInt(t)}async update(){let{sequence_number:t}=await s({aptosConfig:this.aptosConfig,accountAddress:this.account.accountAddress});return this.lastUncommintedNumber=BigInt(t),this.lastUncommintedNumber}async synchronize(){if(this.lastUncommintedNumber!==this.currentNumber){for(;this.lock;)await e(this.sleepTime);this.lock=!0;try{await this.update();let t=n();for(;this.lastUncommintedNumber!==this.currentNumber;)n()-t>this.maxWaitTime?(console.warn(`Waited over 30 seconds for a transaction to commit, re-syncing ${this.account.accountAddress.toString()}`),await this.initialize()):(await e(this.sleepTime),await this.update())}catch(t){console.error("error in synchronizing this account sequence number with the one on chain",t)}finally{this.lock=!1}}}};export{r as a};
2
- //# sourceMappingURL=chunk-B6ERS4UX.mjs.map
1
+ import{a as s}from"./chunk-CKKCL3LM.mjs";import{a as e,c as n}from"./chunk-DAFSKSZ5.mjs";var r=class{constructor(t,i,o,a,c){this.lastUncommintedNumber=null;this.currentNumber=null;this.lock=!1;this.aptosConfig=t,this.account=i,this.maxWaitTime=o,this.maximumInFlight=a,this.sleepTime=c}async nextSequenceNumber(){for(;this.lock;)await e(this.sleepTime);this.lock=!0;let t=BigInt(0);try{if((this.lastUncommintedNumber===null||this.currentNumber===null)&&await this.initialize(),this.currentNumber-this.lastUncommintedNumber>=this.maximumInFlight){await this.update();let i=n();for(;this.currentNumber-this.lastUncommintedNumber>=this.maximumInFlight;)await e(this.sleepTime),n()-i>this.maxWaitTime?(console.warn(`Waited over 30 seconds for a transaction to commit, re-syncing ${this.account.accountAddress.toString()}`),await this.initialize()):await this.update()}t=this.currentNumber,this.currentNumber+=BigInt(1)}catch(i){console.error("error in getting next sequence number for this account",i)}finally{this.lock=!1}return t}async initialize(){let{sequence_number:t}=await s({aptosConfig:this.aptosConfig,accountAddress:this.account.accountAddress});this.currentNumber=BigInt(t),this.lastUncommintedNumber=BigInt(t)}async update(){let{sequence_number:t}=await s({aptosConfig:this.aptosConfig,accountAddress:this.account.accountAddress});return this.lastUncommintedNumber=BigInt(t),this.lastUncommintedNumber}async synchronize(){if(this.lastUncommintedNumber!==this.currentNumber){for(;this.lock;)await e(this.sleepTime);this.lock=!0;try{await this.update();let t=n();for(;this.lastUncommintedNumber!==this.currentNumber;)n()-t>this.maxWaitTime?(console.warn(`Waited over 30 seconds for a transaction to commit, re-syncing ${this.account.accountAddress.toString()}`),await this.initialize()):(await e(this.sleepTime),await this.update())}catch(t){console.error("error in synchronizing this account sequence number with the one on chain",t)}finally{this.lock=!1}}}};export{r as a};
2
+ //# sourceMappingURL=chunk-YZAUA2GG.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/transactions/management/accountSequenceNumber.ts"],"sourcesContent":["/**\n * A wrapper that handles and manages an account sequence number.\n *\n * Submit up to `maximumInFlight` transactions per account in parallel with a timeout of `sleepTime`\n * If local assumes `maximumInFlight` are in flight, determine the actual committed state from the network\n * If there are less than `maximumInFlight` due to some being committed, adjust the window\n * If `maximumInFlight` are in flight, wait `sleepTime` seconds before re-evaluating\n * If ever waiting more than `maxWaitTime` restart the sequence number to the current on-chain state\n *\n * Assumptions:\n * Accounts are expected to be managed by a single AccountSequenceNumber and not used otherwise.\n * They are initialized to the current on-chain state, so if there are already transactions in\n * flight, they may take some time to reset.\n * Accounts are automatically initialized if not explicitly\n *\n * Notes:\n * This is co-routine safe, that is many async tasks can be reading from this concurrently.\n * The state of an account cannot be used across multiple AccountSequenceNumber services.\n * The synchronize method will create a barrier that prevents additional nextSequenceNumber\n * calls until it is complete.\n * This only manages the distribution of sequence numbers it does not help handle transaction\n * failures.\n * If a transaction fails, you should call synchronize and wait for timeouts.\n * @group Implementation\n * @category Transactions\n */\n\nimport { AptosConfig } from \"../../api/aptosConfig\";\nimport { Account } from \"../../account\";\nimport { getInfo } from \"../../internal/account\";\nimport { nowInSeconds, sleep } from \"../../utils/helpers\";\n\n/**\n * Represents an account's sequence number management for transaction handling on the Aptos blockchain.\n * This class provides methods to retrieve the next available sequence number, synchronize with the on-chain sequence number,\n * and manage local sequence numbers while ensuring thread safety.\n *\n * @param aptosConfig - The configuration settings for Aptos.\n * @param account - The account associated with the sequence number.\n * @param maxWaitTime - The maximum time to wait for a transaction to commit.\n * @param maximumInFlight - The maximum number of transactions that can be in flight at once.\n * @param sleepTime - The time to wait before retrying to get the sequence number.\n * @group Implementation\n * @category Transactions\n */\nexport class AccountSequenceNumber {\n readonly aptosConfig: AptosConfig;\n\n readonly account: Account;\n\n // sequence number on chain\n // TODO: Change to Uncommitted\n lastUncommintedNumber: bigint | null = null;\n\n // local sequence number\n currentNumber: bigint | null = null;\n\n /**\n * We want to guarantee that we preserve ordering of workers to requests.\n *\n * `lock` is used to try to prevent multiple coroutines from accessing a shared resource at the same time,\n * which can result in race conditions and data inconsistency.\n * This code actually doesn't do it though, since we aren't giving out a slot, it is still somewhat a race condition.\n *\n * The ideal solution is likely that each thread grabs the next number from an incremental integer.\n * When they complete, they increment that number and that entity is able to enter the `lock`.\n * That would guarantee ordering.\n * @group Implementation\n * @category Transactions\n */\n lock = false;\n\n maxWaitTime: number;\n\n maximumInFlight: number;\n\n sleepTime: number;\n\n /**\n * Creates an instance of the class with the specified configuration and account details.\n * This constructor initializes the necessary parameters for managing Aptos transactions.\n *\n * @param aptosConfig - The configuration settings for Aptos.\n * @param account - The account associated with the Aptos transactions.\n * @param maxWaitTime - The maximum time to wait for a transaction to be processed, in milliseconds.\n * @param maximumInFlight - The maximum number of transactions that can be in flight at the same time.\n * @param sleepTime - The time to sleep between transaction checks, in milliseconds.\n * @group Implementation\n * @category Transactions\n */\n constructor(\n aptosConfig: AptosConfig,\n account: Account,\n maxWaitTime: number,\n maximumInFlight: number,\n sleepTime: number,\n ) {\n this.aptosConfig = aptosConfig;\n this.account = account;\n this.maxWaitTime = maxWaitTime;\n this.maximumInFlight = maximumInFlight;\n this.sleepTime = sleepTime;\n }\n\n /**\n * Returns the next available sequence number for this account.\n * This function ensures that the sequence number is updated and synchronized, handling potential delays in transaction commits.\n *\n * @returns {BigInt} The next available sequence number.\n * @group Implementation\n * @category Transactions\n */\n async nextSequenceNumber(): Promise<bigint | null> {\n /* eslint-disable no-await-in-loop */\n while (this.lock) {\n await sleep(this.sleepTime);\n }\n\n this.lock = true;\n let nextNumber = BigInt(0);\n try {\n if (this.lastUncommintedNumber === null || this.currentNumber === null) {\n await this.initialize();\n }\n\n if (this.currentNumber! - this.lastUncommintedNumber! >= this.maximumInFlight) {\n await this.update();\n\n const startTime = nowInSeconds();\n while (this.currentNumber! - this.lastUncommintedNumber! >= this.maximumInFlight) {\n await sleep(this.sleepTime);\n if (nowInSeconds() - startTime > this.maxWaitTime) {\n /* eslint-disable no-console */\n console.warn(\n `Waited over 30 seconds for a transaction to commit, re-syncing ${this.account.accountAddress.toString()}`,\n );\n await this.initialize();\n } else {\n await this.update();\n }\n }\n }\n nextNumber = this.currentNumber!;\n this.currentNumber! += BigInt(1);\n } catch (e) {\n console.error(\"error in getting next sequence number for this account\", e);\n } finally {\n this.lock = false;\n }\n return nextNumber;\n }\n\n /**\n * Initializes this account with the sequence number on chain.\n *\n * @returns {Promise<void>} A promise that resolves when the account has been initialized.\n *\n * @throws {Error} Throws an error if the account information cannot be retrieved.\n * @group Implementation\n * @category Transactions\n */\n async initialize(): Promise<void> {\n const { sequence_number: sequenceNumber } = await getInfo({\n aptosConfig: this.aptosConfig,\n accountAddress: this.account.accountAddress,\n });\n this.currentNumber = BigInt(sequenceNumber);\n this.lastUncommintedNumber = BigInt(sequenceNumber);\n }\n\n /**\n * Updates this account's sequence number with the one on-chain.\n *\n * @returns The on-chain sequence number for this account.\n * @group Implementation\n * @category Transactions\n */\n async update(): Promise<bigint> {\n const { sequence_number: sequenceNumber } = await getInfo({\n aptosConfig: this.aptosConfig,\n accountAddress: this.account.accountAddress,\n });\n this.lastUncommintedNumber = BigInt(sequenceNumber);\n return this.lastUncommintedNumber;\n }\n\n /**\n * Synchronizes the local sequence number with the sequence number on-chain for the specified account.\n * This function polls the network until all submitted transactions have either been committed or until the maximum wait time has elapsed.\n *\n * @throws {Error} Throws an error if there is an issue synchronizing the account sequence number with the one on-chain.\n * @group Implementation\n * @category Transactions\n */\n async synchronize(): Promise<void> {\n if (this.lastUncommintedNumber === this.currentNumber) return;\n\n /* eslint-disable no-await-in-loop */\n while (this.lock) {\n await sleep(this.sleepTime);\n }\n\n this.lock = true;\n\n try {\n await this.update();\n const startTime = nowInSeconds();\n while (this.lastUncommintedNumber !== this.currentNumber) {\n if (nowInSeconds() - startTime > this.maxWaitTime) {\n /* eslint-disable no-console */\n console.warn(\n `Waited over 30 seconds for a transaction to commit, re-syncing ${this.account.accountAddress.toString()}`,\n );\n await this.initialize();\n } else {\n await sleep(this.sleepTime);\n await this.update();\n }\n }\n } catch (e) {\n console.error(\"error in synchronizing this account sequence number with the one on chain\", e);\n } finally {\n this.lock = false;\n }\n }\n}\n"],"mappings":"yFA6CO,IAAMA,EAAN,KAA4B,CA6CjC,YACEC,EACAC,EACAC,EACAC,EACAC,EACA,CA5CF,2BAAuC,KAGvC,mBAA+B,KAe/B,UAAO,GA2BL,KAAK,YAAcJ,EACnB,KAAK,QAAUC,EACf,KAAK,YAAcC,EACnB,KAAK,gBAAkBC,EACvB,KAAK,UAAYC,CACnB,CAUA,MAAM,oBAA6C,CAEjD,KAAO,KAAK,MACV,MAAMC,EAAM,KAAK,SAAS,EAG5B,KAAK,KAAO,GACZ,IAAIC,EAAa,OAAO,CAAC,EACzB,GAAI,CAKF,IAJI,KAAK,wBAA0B,MAAQ,KAAK,gBAAkB,OAChE,MAAM,KAAK,WAAW,EAGpB,KAAK,cAAiB,KAAK,uBAA0B,KAAK,gBAAiB,CAC7E,MAAM,KAAK,OAAO,EAElB,IAAMC,EAAYC,EAAa,EAC/B,KAAO,KAAK,cAAiB,KAAK,uBAA0B,KAAK,iBAC/D,MAAMH,EAAM,KAAK,SAAS,EACtBG,EAAa,EAAID,EAAY,KAAK,aAEpC,QAAQ,KACN,kEAAkE,KAAK,QAAQ,eAAe,SAAS,CAAC,EAC1G,EACA,MAAM,KAAK,WAAW,GAEtB,MAAM,KAAK,OAAO,CAGxB,CACAD,EAAa,KAAK,cAClB,KAAK,eAAkB,OAAO,CAAC,CACjC,OAASG,EAAG,CACV,QAAQ,MAAM,yDAA0DA,CAAC,CAC3E,QAAE,CACA,KAAK,KAAO,EACd,CACA,OAAOH,CACT,CAWA,MAAM,YAA4B,CAChC,GAAM,CAAE,gBAAiBI,CAAe,EAAI,MAAMC,EAAQ,CACxD,YAAa,KAAK,YAClB,eAAgB,KAAK,QAAQ,cAC/B,CAAC,EACD,KAAK,cAAgB,OAAOD,CAAc,EAC1C,KAAK,sBAAwB,OAAOA,CAAc,CACpD,CASA,MAAM,QAA0B,CAC9B,GAAM,CAAE,gBAAiBA,CAAe,EAAI,MAAMC,EAAQ,CACxD,YAAa,KAAK,YAClB,eAAgB,KAAK,QAAQ,cAC/B,CAAC,EACD,YAAK,sBAAwB,OAAOD,CAAc,EAC3C,KAAK,qBACd,CAUA,MAAM,aAA6B,CACjC,GAAI,KAAK,wBAA0B,KAAK,cAGxC,MAAO,KAAK,MACV,MAAML,EAAM,KAAK,SAAS,EAG5B,KAAK,KAAO,GAEZ,GAAI,CACF,MAAM,KAAK,OAAO,EAClB,IAAME,EAAYC,EAAa,EAC/B,KAAO,KAAK,wBAA0B,KAAK,eACrCA,EAAa,EAAID,EAAY,KAAK,aAEpC,QAAQ,KACN,kEAAkE,KAAK,QAAQ,eAAe,SAAS,CAAC,EAC1G,EACA,MAAM,KAAK,WAAW,IAEtB,MAAMF,EAAM,KAAK,SAAS,EAC1B,MAAM,KAAK,OAAO,EAGxB,OAASI,EAAG,CACV,QAAQ,MAAM,4EAA6EA,CAAC,CAC9F,QAAE,CACA,KAAK,KAAO,EACd,EACF,CACF","names":["AccountSequenceNumber","aptosConfig","account","maxWaitTime","maximumInFlight","sleepTime","sleep","nextNumber","startTime","nowInSeconds","e","sequenceNumber","getInfo"]}
@@ -1,2 +1,2 @@
1
- import{c as l}from"./chunk-AOROYJ74.mjs";import{a as k,b as y,d as g,e as w,f as z,g as D,h as L,i as d,j as R,l as X,m as q,n as H,o as J,p as K,q as Q,s as i,t as W}from"./chunk-FFBC7GFN.mjs";import{c as j}from"./chunk-HXCL6KBW.mjs";import{b as C,c as x,d as a,e as M,f as _,g as O,h as V,i as G,n as P}from"./chunk-T6ADNZE5.mjs";import{b as m}from"./chunk-JNO7KPMG.mjs";import{a as T,c as I,d as f}from"./chunk-Q3CWUEXI.mjs";import{a as A,b as E,c as v,d as b,e as F,f as $,g as S}from"./chunk-42H7WETG.mjs";import{a as p}from"./chunk-3OLFJ65O.mjs";var Y=new TextEncoder;function yn(n){return n?.map(e=>y(e)?l(e):e)??[]}async function B(n,e,t,u){let r=await j({aptosConfig:u,accountAddress:n,moduleName:e});if(r.abi)return r.abi.exposed_functions.find(s=>s.name===t)}async function Tn(n,e,t,u){let r=await B(n,e,t,u);if(!r)throw new Error(`Could not find function ABI for '${n}::${e}::${t}'`);let s=[];for(let c=0;c<r.params.length;c+=1)s.push(l(r.params[c],{allowGenerics:!0}));return{typeParameters:r.generic_type_params,parameters:s}}async function ln(n,e,t,u){let r=await B(n,e,t,u);if(!r)throw new Error(`Could not find entry function ABI for '${n}::${e}::${t}'`);if(!r.is_entry)throw new Error(`'${n}::${e}::${t}' is not an entry function`);let s=W(r),c=[];for(let o=s;o<r.params.length;o+=1)c.push(l(r.params[o],{allowGenerics:!0}));return{signers:s,typeParameters:r.generic_type_params,parameters:c}}async function An(n,e,t,u){let r=await B(n,e,t,u);if(!r)throw new Error(`Could not find view function ABI for '${n}::${e}::${t}'`);if(!r.is_view)throw new Error(`'${n}::${e}::${t}' is not an view function`);let s=[];for(let o=0;o<r.params.length;o+=1)s.push(l(r.params[o],{allowGenerics:!0}));let c=[];for(let o=0;o<r.return.length;o+=1)c.push(l(r.return[o],{allowGenerics:!0}));return{typeParameters:r.generic_type_params,parameters:s,returnTypes:c}}function gn(n,e,t,u,r){return n instanceof p?n:p.new_bytes(Z(e,t,n,u,r).bcsToBytes())}function Z(n,e,t,u,r){if(u>=e.parameters.length)throw new Error(`Too many arguments for '${n}', expected ${e.parameters.length}`);let s=e.parameters[u];return U(t,s,u,r)}function U(n,e,t,u){return D(n)?(h(e,n,t),n):N(n,e,t,u)}function N(n,e,t,u){if(e.isBool()){if(k(n))return new A(n);if(y(n)){if(n==="true")return new A(!0);if(n==="false")return new A(!1)}i("boolean",t)}if(e.isAddress()){if(y(n))return m.fromString(n);i("string | AccountAddress",t)}if(e.isU8()){let r=g(n);if(r!==void 0)return new E(r);i("number | string",t)}if(e.isU16()){let r=g(n);if(r!==void 0)return new v(r);i("number | string",t)}if(e.isU32()){let r=g(n);if(r!==void 0)return new b(r);i("number | string",t)}if(e.isU64()){if(w(n))return new F(BigInt(n));i("bigint | number | string",t)}if(e.isU128()){if(w(n))return new $(BigInt(n));i("bigint | number | string",t)}if(e.isU256()){if(w(n))return new S(BigInt(n));i("bigint | number | string",t)}if(e.isGeneric()){let r=e.value;if(r<0||r>=u.length)throw new Error(`Generic argument ${e.toString()} is invalid for argument ${t}`);return U(n,u[r],t,u)}if(e.isVector()){if(e.value.isU8()){if(y(n))return T.U8(Y.encode(n));if(n instanceof Uint8Array)return T.U8(n);if(n instanceof ArrayBuffer)return T.U8(new Uint8Array(n))}if(Array.isArray(n))return new T(n.map(r=>U(r,e.value,t,u)));throw new Error(`Type mismatch for argument ${t}, type '${e.toString()}'`)}if(e.isStruct()){if(e.isString()){if(y(n))return new I(n);i("string",t)}if(e.isObject()){if(y(n))return m.fromString(n);i("string | AccountAddress",t)}if(e.isOption()){if(z(n)){let r=e.value.typeArgs[0];return r instanceof C?new f(null):r instanceof G?new f(null):r instanceof x?new f(null):r instanceof a?new f(null):r instanceof M?new f(null):r instanceof _?new f(null):r instanceof O?new f(null):r instanceof V?new f(null):new f(null)}return new f(U(n,e.value.typeArgs[0],t,u))}throw new Error(`Unsupported struct input type for argument ${t}, type '${e.toString()}'`)}throw new Error(`Type mismatch for argument ${t}, type '${e.toString()}'`)}function h(n,e,t){if(n.isBool()){if(L(e))return;i("Bool",t)}if(n.isAddress()){if(d(e))return;i("AccountAddress",t)}if(n.isU8()){if(X(e))return;i("U8",t)}if(n.isU16()){if(q(e))return;i("U16",t)}if(n.isU32()){if(H(e))return;i("U32",t)}if(n.isU64()){if(J(e))return;i("U64",t)}if(n.isU128()){if(K(e))return;i("U128",t)}if(n.isU256()){if(Q(e))return;i("U256",t)}if(n.isVector()){if(e instanceof T){e.values.length>0&&h(n.value,e.values[0],t);return}i("MoveVector",t)}if(n instanceof P){if(n.isString()){if(R(e))return;i("MoveString",t)}if(n.isObject()){if(d(e))return;i("AccountAddress",t)}if(n.isOption()){if(e instanceof f){e.value!==void 0&&h(n.value.typeArgs[0],e.value,t);return}i("MoveOption",t)}}throw new Error(`Type mismatch for argument ${t}, expected '${n.toString()}'`)}export{yn as a,B as b,Tn as c,ln as d,An as e,gn as f,Z as g,U as h};
2
- //# sourceMappingURL=chunk-EPBNJZ4A.mjs.map
1
+ import{c as l}from"./chunk-AZWVCBK2.mjs";import{a as k,b as y,d as g,e as w,f as z,g as D,h as L,i as d,j as R,l as X,m as q,n as H,o as J,p as K,q as Q,s as i,t as W}from"./chunk-HBH2NQKU.mjs";import{c as j}from"./chunk-CKKCL3LM.mjs";import{b as C,c as x,d as a,e as M,f as _,g as O,h as V,i as G,n as P}from"./chunk-G4O6FXCF.mjs";import{b as m}from"./chunk-Q4C4U6I4.mjs";import{a as T,c as I,d as f}from"./chunk-IDTLNF4M.mjs";import{a as A,b as E,c as v,d as b,e as F,f as $,g as S}from"./chunk-ORMOQWWH.mjs";import{a as p}from"./chunk-3OLFJ65O.mjs";var Y=new TextEncoder;function yn(n){return n?.map(e=>y(e)?l(e):e)??[]}async function B(n,e,t,u){let r=await j({aptosConfig:u,accountAddress:n,moduleName:e});if(r.abi)return r.abi.exposed_functions.find(s=>s.name===t)}async function Tn(n,e,t,u){let r=await B(n,e,t,u);if(!r)throw new Error(`Could not find function ABI for '${n}::${e}::${t}'`);let s=[];for(let c=0;c<r.params.length;c+=1)s.push(l(r.params[c],{allowGenerics:!0}));return{typeParameters:r.generic_type_params,parameters:s}}async function ln(n,e,t,u){let r=await B(n,e,t,u);if(!r)throw new Error(`Could not find entry function ABI for '${n}::${e}::${t}'`);if(!r.is_entry)throw new Error(`'${n}::${e}::${t}' is not an entry function`);let s=W(r),c=[];for(let o=s;o<r.params.length;o+=1)c.push(l(r.params[o],{allowGenerics:!0}));return{signers:s,typeParameters:r.generic_type_params,parameters:c}}async function An(n,e,t,u){let r=await B(n,e,t,u);if(!r)throw new Error(`Could not find view function ABI for '${n}::${e}::${t}'`);if(!r.is_view)throw new Error(`'${n}::${e}::${t}' is not an view function`);let s=[];for(let o=0;o<r.params.length;o+=1)s.push(l(r.params[o],{allowGenerics:!0}));let c=[];for(let o=0;o<r.return.length;o+=1)c.push(l(r.return[o],{allowGenerics:!0}));return{typeParameters:r.generic_type_params,parameters:s,returnTypes:c}}function gn(n,e,t,u,r){return n instanceof p?n:p.new_bytes(Z(e,t,n,u,r).bcsToBytes())}function Z(n,e,t,u,r){if(u>=e.parameters.length)throw new Error(`Too many arguments for '${n}', expected ${e.parameters.length}`);let s=e.parameters[u];return U(t,s,u,r)}function U(n,e,t,u){return D(n)?(h(e,n,t),n):N(n,e,t,u)}function N(n,e,t,u){if(e.isBool()){if(k(n))return new A(n);if(y(n)){if(n==="true")return new A(!0);if(n==="false")return new A(!1)}i("boolean",t)}if(e.isAddress()){if(y(n))return m.fromString(n);i("string | AccountAddress",t)}if(e.isU8()){let r=g(n);if(r!==void 0)return new E(r);i("number | string",t)}if(e.isU16()){let r=g(n);if(r!==void 0)return new v(r);i("number | string",t)}if(e.isU32()){let r=g(n);if(r!==void 0)return new b(r);i("number | string",t)}if(e.isU64()){if(w(n))return new F(BigInt(n));i("bigint | number | string",t)}if(e.isU128()){if(w(n))return new $(BigInt(n));i("bigint | number | string",t)}if(e.isU256()){if(w(n))return new S(BigInt(n));i("bigint | number | string",t)}if(e.isGeneric()){let r=e.value;if(r<0||r>=u.length)throw new Error(`Generic argument ${e.toString()} is invalid for argument ${t}`);return U(n,u[r],t,u)}if(e.isVector()){if(e.value.isU8()){if(y(n))return T.U8(Y.encode(n));if(n instanceof Uint8Array)return T.U8(n);if(n instanceof ArrayBuffer)return T.U8(new Uint8Array(n))}if(Array.isArray(n))return new T(n.map(r=>U(r,e.value,t,u)));throw new Error(`Type mismatch for argument ${t}, type '${e.toString()}'`)}if(e.isStruct()){if(e.isString()){if(y(n))return new I(n);i("string",t)}if(e.isObject()){if(y(n))return m.fromString(n);i("string | AccountAddress",t)}if(e.isOption()){if(z(n)){let r=e.value.typeArgs[0];return r instanceof C?new f(null):r instanceof G?new f(null):r instanceof x?new f(null):r instanceof a?new f(null):r instanceof M?new f(null):r instanceof _?new f(null):r instanceof O?new f(null):r instanceof V?new f(null):new f(null)}return new f(U(n,e.value.typeArgs[0],t,u))}throw new Error(`Unsupported struct input type for argument ${t}, type '${e.toString()}'`)}throw new Error(`Type mismatch for argument ${t}, type '${e.toString()}'`)}function h(n,e,t){if(n.isBool()){if(L(e))return;i("Bool",t)}if(n.isAddress()){if(d(e))return;i("AccountAddress",t)}if(n.isU8()){if(X(e))return;i("U8",t)}if(n.isU16()){if(q(e))return;i("U16",t)}if(n.isU32()){if(H(e))return;i("U32",t)}if(n.isU64()){if(J(e))return;i("U64",t)}if(n.isU128()){if(K(e))return;i("U128",t)}if(n.isU256()){if(Q(e))return;i("U256",t)}if(n.isVector()){if(e instanceof T){e.values.length>0&&h(n.value,e.values[0],t);return}i("MoveVector",t)}if(n instanceof P){if(n.isString()){if(R(e))return;i("MoveString",t)}if(n.isObject()){if(d(e))return;i("AccountAddress",t)}if(n.isOption()){if(e instanceof f){e.value!==void 0&&h(n.value.typeArgs[0],e.value,t);return}i("MoveOption",t)}}throw new Error(`Type mismatch for argument ${t}, expected '${n.toString()}'`)}export{yn as a,B as b,Tn as c,ln as d,An as e,gn as f,Z as g,U as h};
2
+ //# sourceMappingURL=chunk-ZMSWKJDU.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/transactions/transactionBuilder/remoteAbi.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { parseTypeTag } from \"../typeTag/parser\";\nimport {\n TypeTag,\n TypeTagAddress,\n TypeTagBool,\n TypeTagStruct,\n TypeTagU128,\n TypeTagU16,\n TypeTagU256,\n TypeTagU32,\n TypeTagU64,\n TypeTagU8,\n} from \"../typeTag\";\nimport { AptosConfig } from \"../../api/aptosConfig\";\nimport {\n EntryFunctionArgumentTypes,\n SimpleEntryFunctionArgumentTypes,\n EntryFunctionABI,\n ViewFunctionABI,\n FunctionABI,\n TypeArgument,\n} from \"../types\";\nimport { Bool, MoveOption, MoveString, MoveVector, U128, U16, U256, U32, U64, U8 } from \"../../bcs\";\nimport { AccountAddress } from \"../../core\";\nimport { getModule } from \"../../internal/account\";\nimport {\n findFirstNonSignerArg,\n isBcsAddress,\n isBcsBool,\n isBcsString,\n isBcsU128,\n isBcsU16,\n isBcsU256,\n isBcsU32,\n isBcsU64,\n isBcsU8,\n isBool,\n isEncodedEntryFunctionArgument,\n isLargeNumber,\n isEmptyOption,\n isString,\n throwTypeMismatch,\n convertNumber,\n} from \"./helpers\";\nimport { CallArgument, MoveFunction } from \"../../types\";\n\nconst TEXT_ENCODER = new TextEncoder();\n\n/**\n * Convert type arguments to only type tags, allowing for string representations of type tags.\n *\n * @param typeArguments - An optional array of type arguments that may include string representations.\n * @returns An array of TypeTag objects derived from the provided type arguments.\n * @group Implementation\n * @category Transactions\n */\nexport function standardizeTypeTags(typeArguments?: Array<TypeArgument>): Array<TypeTag> {\n return (\n typeArguments?.map((typeArg: TypeArgument): TypeTag => {\n // Convert to TypeTag if it's a string representation\n if (isString(typeArg)) {\n return parseTypeTag(typeArg);\n }\n return typeArg;\n }) ?? []\n );\n}\n\n/**\n * Fetches the ABI of a specified function from the on-chain module ABI. This function allows you to access the details of a\n * specific function within a module.\n *\n * @param moduleAddress - The address of the module from which to fetch the function ABI.\n * @param moduleName - The name of the module containing the function.\n * @param functionName - The name of the function whose ABI is to be fetched.\n * @param aptosConfig - The configuration settings for Aptos.\n * @group Implementation\n * @category Transactions\n */\nexport async function fetchFunctionAbi(\n moduleAddress: string,\n moduleName: string,\n functionName: string,\n aptosConfig: AptosConfig,\n): Promise<MoveFunction | undefined> {\n // This fetch from the API is currently cached\n const module = await getModule({ aptosConfig, accountAddress: moduleAddress, moduleName });\n\n if (module.abi) {\n return module.abi.exposed_functions.find((func) => func.name === functionName);\n }\n\n return undefined;\n}\n\n/**\n * Fetches a function ABI from the on-chain module ABI. It doesn't validate whether it's a view or entry function.\n * @param moduleAddress\n * @param moduleName\n * @param functionName\n * @param aptosConfig\n */\nexport async function fetchMoveFunctionAbi(\n moduleAddress: string,\n moduleName: string,\n functionName: string,\n aptosConfig: AptosConfig,\n): Promise<FunctionABI> {\n const functionAbi = await fetchFunctionAbi(moduleAddress, moduleName, functionName, aptosConfig);\n if (!functionAbi) {\n throw new Error(`Could not find function ABI for '${moduleAddress}::${moduleName}::${functionName}'`);\n }\n const params: TypeTag[] = [];\n for (let i = 0; i < functionAbi.params.length; i += 1) {\n params.push(parseTypeTag(functionAbi.params[i], { allowGenerics: true }));\n }\n\n return {\n typeParameters: functionAbi.generic_type_params,\n parameters: params,\n };\n}\n\n/**\n * Fetches the ABI for an entry function from the specified module address.\n * This function validates if the ABI corresponds to an entry function and retrieves its parameters.\n *\n * @param moduleAddress - The address of the module containing the entry function.\n * @param moduleName - The name of the module containing the entry function.\n * @param functionName - The name of the entry function to fetch the ABI for.\n * @param aptosConfig - The configuration settings for Aptos.\n * @returns An object containing the number of signers, type parameters, and function parameters.\n * @throws Error if the ABI cannot be found or if the function is not an entry function.\n * @group Implementation\n * @category Transactions\n */\nexport async function fetchEntryFunctionAbi(\n moduleAddress: string,\n moduleName: string,\n functionName: string,\n aptosConfig: AptosConfig,\n): Promise<EntryFunctionABI> {\n const functionAbi = await fetchFunctionAbi(moduleAddress, moduleName, functionName, aptosConfig);\n\n // If there's no ABI, then the function is invalid\n if (!functionAbi) {\n throw new Error(`Could not find entry function ABI for '${moduleAddress}::${moduleName}::${functionName}'`);\n }\n\n // Non-entry functions also can't be used\n if (!functionAbi.is_entry) {\n throw new Error(`'${moduleAddress}::${moduleName}::${functionName}' is not an entry function`);\n }\n\n // Remove the signer arguments\n const numSigners = findFirstNonSignerArg(functionAbi);\n const params: TypeTag[] = [];\n for (let i = numSigners; i < functionAbi.params.length; i += 1) {\n params.push(parseTypeTag(functionAbi.params[i], { allowGenerics: true }));\n }\n\n return {\n signers: numSigners,\n typeParameters: functionAbi.generic_type_params,\n parameters: params,\n };\n}\n\n/**\n * Fetches the ABI for a view function from the specified module address.\n * This function ensures that the ABI is valid and retrieves the type parameters, parameters, and return types for the view function.\n *\n * @param moduleAddress - The address of the module containing the view function.\n * @param moduleName - The name of the module containing the view function.\n * @param functionName - The name of the view function for which to fetch the ABI.\n * @param aptosConfig - The configuration settings for Aptos.\n * @returns An object containing the type parameters, parameters, and return types of the view function.\n * @throws Error if the ABI cannot be found or if the function is not a view function.\n * @group Implementation\n * @category Transactions\n */\nexport async function fetchViewFunctionAbi(\n moduleAddress: string,\n moduleName: string,\n functionName: string,\n aptosConfig: AptosConfig,\n): Promise<ViewFunctionABI> {\n const functionAbi = await fetchFunctionAbi(moduleAddress, moduleName, functionName, aptosConfig);\n\n // If there's no ABI, then the function is invalid\n if (!functionAbi) {\n throw new Error(`Could not find view function ABI for '${moduleAddress}::${moduleName}::${functionName}'`);\n }\n\n // Non-view functions can't be used\n if (!functionAbi.is_view) {\n throw new Error(`'${moduleAddress}::${moduleName}::${functionName}' is not an view function`);\n }\n\n // Type tag parameters for the function\n const params: TypeTag[] = [];\n for (let i = 0; i < functionAbi.params.length; i += 1) {\n params.push(parseTypeTag(functionAbi.params[i], { allowGenerics: true }));\n }\n\n // The return types of the view function\n const returnTypes: TypeTag[] = [];\n for (let i = 0; i < functionAbi.return.length; i += 1) {\n returnTypes.push(parseTypeTag(functionAbi.return[i], { allowGenerics: true }));\n }\n\n return {\n typeParameters: functionAbi.generic_type_params,\n parameters: params,\n returnTypes,\n };\n}\n\n/**\n * Converts a entry function argument into CallArgument, if necessary.\n * This function checks the provided argument against the expected parameter type and converts it accordingly.\n *\n * @param functionName - The name of the function for which the argument is being converted.\n * @param functionAbi - The ABI (Application Binary Interface) of the function, which defines its parameters.\n * @param argument - The argument to be converted, which can be of various types. If the argument is already\n * CallArgument returned from TransactionComposer it would be returned immediately.\n * @param position - The index of the argument in the function's parameter list.\n * @param genericTypeParams - An array of type tags for any generic type parameters.\n */\nexport function convertCallArgument(\n argument: CallArgument | EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes,\n functionName: string,\n functionAbi: FunctionABI,\n position: number,\n genericTypeParams: Array<TypeTag>,\n): CallArgument {\n if (argument instanceof CallArgument) {\n return argument;\n }\n return CallArgument.new_bytes(\n convertArgument(functionName, functionAbi, argument, position, genericTypeParams).bcsToBytes(),\n );\n}\n\n/**\n * Converts a non-BCS encoded argument into BCS encoded, if necessary.\n * This function checks the provided argument against the expected parameter type and converts it accordingly.\n *\n * @param functionName - The name of the function for which the argument is being converted.\n * @param functionAbi - The ABI (Application Binary Interface) of the function, which defines its parameters.\n * @param arg - The argument to be converted, which can be of various types.\n * @param position - The index of the argument in the function's parameter list.\n * @param genericTypeParams - An array of type tags for any generic type parameters.\n * @group Implementation\n * @category Transactions\n */\nexport function convertArgument(\n functionName: string,\n functionAbi: FunctionABI,\n arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes,\n position: number,\n genericTypeParams: Array<TypeTag>,\n) {\n // Ensure not too many arguments\n if (position >= functionAbi.parameters.length) {\n throw new Error(`Too many arguments for '${functionName}', expected ${functionAbi.parameters.length}`);\n }\n\n const param = functionAbi.parameters[position];\n return checkOrConvertArgument(arg, param, position, genericTypeParams);\n}\n\n/**\n * Checks if the provided argument is BCS encoded and converts it if necessary, ensuring type compatibility with the ABI.\n * This function helps in validating and converting arguments for entry functions based on their expected types.\n *\n * @param arg - The argument to check or convert, which can be either a simple or entry function argument type.\n * @param param - The expected type tag for the argument.\n * @param position - The position of the argument in the function call.\n * @param genericTypeParams - An array of generic type parameters that may be used for conversion.\n * @group Implementation\n * @category Transactions\n */\nexport function checkOrConvertArgument(\n arg: SimpleEntryFunctionArgumentTypes | EntryFunctionArgumentTypes,\n param: TypeTag,\n position: number,\n genericTypeParams: Array<TypeTag>,\n) {\n // If the argument is bcs encoded, we can just use it directly\n if (isEncodedEntryFunctionArgument(arg)) {\n // Ensure the type matches the ABI\n\n /**\n * Checks the type of the provided argument against the expected type.\n * This function helps validate that the argument conforms to the specified type requirements.\n *\n * @param typeArgs - The expected type arguments.\n * @param arg - The argument to be checked.\n * @param position - The position of the argument in the context of the check.\n * @group Implementation\n * @category Transactions\n */\n checkType(param, arg, position);\n return arg;\n }\n\n // If it is not BCS encoded, we will need to convert it with the ABI\n return parseArg(arg, param, position, genericTypeParams);\n}\n\n/**\n * Parses a non-BCS encoded argument into a BCS encoded argument recursively.\n * This function helps convert various types of input arguments into their corresponding BCS encoded formats based on the\n * specified parameter type.\n *\n * @param arg - The argument to be parsed, which can be of various types.\n * @param param - The type tag that defines the expected type of the argument.\n * @param position - The position of the argument in the function call, used for error reporting.\n * @param genericTypeParams - An array of type tags for generic type parameters, used when the parameter type is generic.\n * @group Implementation\n * @category Transactions\n */\nfunction parseArg(\n arg: SimpleEntryFunctionArgumentTypes,\n param: TypeTag,\n position: number,\n genericTypeParams: Array<TypeTag>,\n): EntryFunctionArgumentTypes {\n if (param.isBool()) {\n if (isBool(arg)) {\n return new Bool(arg);\n }\n if (isString(arg)) {\n if (arg === \"true\") return new Bool(true);\n if (arg === \"false\") return new Bool(false);\n }\n\n /**\n * Throws a type mismatch error for the specified move option.\n *\n * @param moveOption - The name of the move option that caused the type mismatch.\n * @param position - The position where the error occurred.\n * @group Implementation\n * @category Transactions\n */\n throwTypeMismatch(\"boolean\", position);\n }\n // TODO: support uint8array?\n if (param.isAddress()) {\n if (isString(arg)) {\n return AccountAddress.fromString(arg);\n }\n throwTypeMismatch(\"string | AccountAddress\", position);\n }\n if (param.isU8()) {\n const num = convertNumber(arg);\n if (num !== undefined) {\n return new U8(num);\n }\n throwTypeMismatch(\"number | string\", position);\n }\n if (param.isU16()) {\n const num = convertNumber(arg);\n if (num !== undefined) {\n return new U16(num);\n }\n throwTypeMismatch(\"number | string\", position);\n }\n if (param.isU32()) {\n const num = convertNumber(arg);\n if (num !== undefined) {\n return new U32(num);\n }\n throwTypeMismatch(\"number | string\", position);\n }\n if (param.isU64()) {\n if (isLargeNumber(arg)) {\n return new U64(BigInt(arg));\n }\n throwTypeMismatch(\"bigint | number | string\", position);\n }\n if (param.isU128()) {\n if (isLargeNumber(arg)) {\n return new U128(BigInt(arg));\n }\n throwTypeMismatch(\"bigint | number | string\", position);\n }\n if (param.isU256()) {\n if (isLargeNumber(arg)) {\n return new U256(BigInt(arg));\n }\n throwTypeMismatch(\"bigint | number | string\", position);\n }\n\n // Generic needs to use the subtype\n if (param.isGeneric()) {\n const genericIndex = param.value;\n if (genericIndex < 0 || genericIndex >= genericTypeParams.length) {\n throw new Error(`Generic argument ${param.toString()} is invalid for argument ${position}`);\n }\n\n return checkOrConvertArgument(arg, genericTypeParams[genericIndex], position, genericTypeParams);\n }\n\n // We have to special case some vectors for Vector<u8>\n if (param.isVector()) {\n // Check special case for Vector<u8>\n if (param.value.isU8()) {\n // We don't allow vector<u8>, but we convert strings to UTF8 Uint8Array\n // This is legacy behavior from the original SDK\n if (isString(arg)) {\n return MoveVector.U8(TEXT_ENCODER.encode(arg));\n }\n if (arg instanceof Uint8Array) {\n return MoveVector.U8(arg);\n }\n if (arg instanceof ArrayBuffer) {\n return MoveVector.U8(new Uint8Array(arg));\n }\n }\n\n // TODO: Support Uint16Array, Uint32Array, BigUint64Array?\n\n if (Array.isArray(arg)) {\n return new MoveVector(arg.map((item) => checkOrConvertArgument(item, param.value, position, genericTypeParams)));\n }\n\n throw new Error(`Type mismatch for argument ${position}, type '${param.toString()}'`);\n }\n\n // Handle structs as they're more complex\n if (param.isStruct()) {\n if (param.isString()) {\n if (isString(arg)) {\n return new MoveString(arg);\n }\n throwTypeMismatch(\"string\", position);\n }\n if (param.isObject()) {\n // The inner type of Object doesn't matter, since it's just syntactic sugar\n if (isString(arg)) {\n return AccountAddress.fromString(arg);\n }\n throwTypeMismatch(\"string | AccountAddress\", position);\n }\n\n if (param.isOption()) {\n if (isEmptyOption(arg)) {\n // Here we attempt to reconstruct the underlying type\n // Note, for some reason the `isBool` etc. does not work with the compiler\n const innerParam = param.value.typeArgs[0];\n if (innerParam instanceof TypeTagBool) {\n return new MoveOption<Bool>(null);\n }\n if (innerParam instanceof TypeTagAddress) {\n return new MoveOption<AccountAddress>(null);\n }\n if (innerParam instanceof TypeTagU8) {\n return new MoveOption<U8>(null);\n }\n if (innerParam instanceof TypeTagU16) {\n return new MoveOption<U16>(null);\n }\n if (innerParam instanceof TypeTagU32) {\n return new MoveOption<U32>(null);\n }\n if (innerParam instanceof TypeTagU64) {\n return new MoveOption<U64>(null);\n }\n if (innerParam instanceof TypeTagU128) {\n return new MoveOption<U128>(null);\n }\n if (innerParam instanceof TypeTagU256) {\n return new MoveOption<U256>(null);\n }\n\n // In all other cases, we will use a placeholder, it doesn't actually matter what the type is, but it will be obvious\n // Note: This is a placeholder U8 type, and does not match the actual type, as that can't be dynamically grabbed\n return new MoveOption<MoveString>(null);\n }\n\n return new MoveOption(checkOrConvertArgument(arg, param.value.typeArgs[0], position, genericTypeParams));\n }\n\n throw new Error(`Unsupported struct input type for argument ${position}, type '${param.toString()}'`);\n }\n\n throw new Error(`Type mismatch for argument ${position}, type '${param.toString()}'`);\n}\n\n/**\n * Checks that the type of the BCS encoded argument matches the ABI\n * @param param\n * @param arg\n * @param position\n * @group Implementation\n * @category Transactions\n */\nfunction checkType(param: TypeTag, arg: EntryFunctionArgumentTypes, position: number) {\n if (param.isBool()) {\n if (isBcsBool(arg)) {\n return;\n }\n throwTypeMismatch(\"Bool\", position);\n }\n if (param.isAddress()) {\n if (isBcsAddress(arg)) {\n return;\n }\n throwTypeMismatch(\"AccountAddress\", position);\n }\n if (param.isU8()) {\n if (isBcsU8(arg)) {\n return;\n }\n throwTypeMismatch(\"U8\", position);\n }\n if (param.isU16()) {\n if (isBcsU16(arg)) {\n return;\n }\n throwTypeMismatch(\"U16\", position);\n }\n if (param.isU32()) {\n if (isBcsU32(arg)) {\n return;\n }\n throwTypeMismatch(\"U32\", position);\n }\n if (param.isU64()) {\n if (isBcsU64(arg)) {\n return;\n }\n throwTypeMismatch(\"U64\", position);\n }\n if (param.isU128()) {\n if (isBcsU128(arg)) {\n return;\n }\n throwTypeMismatch(\"U128\", position);\n }\n if (param.isU256()) {\n if (isBcsU256(arg)) {\n return;\n }\n throwTypeMismatch(\"U256\", position);\n }\n if (param.isVector()) {\n if (arg instanceof MoveVector) {\n // If there's anything in it, check that the inner types match\n // Note that since it's typed, the first item should be the same as the rest\n if (arg.values.length > 0) {\n checkType(param.value, arg.values[0], position);\n }\n\n return;\n }\n throwTypeMismatch(\"MoveVector\", position);\n }\n\n // Handle structs as they're more complex\n if (param instanceof TypeTagStruct) {\n if (param.isString()) {\n if (isBcsString(arg)) {\n return;\n }\n throwTypeMismatch(\"MoveString\", position);\n }\n if (param.isObject()) {\n if (isBcsAddress(arg)) {\n return;\n }\n throwTypeMismatch(\"AccountAddress\", position);\n }\n if (param.isOption()) {\n if (arg instanceof MoveOption) {\n // If there's a value, we can check the inner type (otherwise it doesn't really matter)\n if (arg.value !== undefined) {\n checkType(param.value.typeArgs[0], arg.value, position);\n }\n return;\n }\n throwTypeMismatch(\"MoveOption\", position);\n }\n }\n\n throw new Error(`Type mismatch for argument ${position}, expected '${param.toString()}'`);\n}\n"],"mappings":"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","names":["TEXT_ENCODER","standardizeTypeTags","typeArguments","typeArg","isString","parseTypeTag","fetchFunctionAbi","moduleAddress","moduleName","functionName","aptosConfig","module","getModule","func","fetchMoveFunctionAbi","functionAbi","params","i","fetchEntryFunctionAbi","numSigners","findFirstNonSignerArg","fetchViewFunctionAbi","returnTypes","convertCallArgument","argument","position","genericTypeParams","CallArgument","convertArgument","arg","param","checkOrConvertArgument","isEncodedEntryFunctionArgument","checkType","parseArg","isBool","Bool","throwTypeMismatch","AccountAddress","num","convertNumber","U8","U16","U32","isLargeNumber","U64","U128","U256","genericIndex","MoveVector","item","MoveString","isEmptyOption","innerParam","TypeTagBool","MoveOption","TypeTagAddress","TypeTagU8","TypeTagU16","TypeTagU32","TypeTagU64","TypeTagU128","TypeTagU256","isBcsBool","isBcsAddress","isBcsU8","isBcsU16","isBcsU32","isBcsU64","isBcsU128","isBcsU256","TypeTagStruct","isBcsString"]}
@@ -1,2 +1,2 @@
1
- import{a as c,b as g}from"./chunk-SOLRIYPW.mjs";import{k as i,l as a}from"./chunk-UTOO6IVJ.mjs";import{a as e,b as n,c as s,e as r,f as t}from"./chunk-CK5NDXQT.mjs";var p=class{constructor(o){this.config=o}async getLedgerInfo(){return e({aptosConfig:this.config})}async getChainId(){return(await this.getLedgerInfo()).chain_id}async getBlockByVersion(o){return i({aptosConfig:this.config,...o})}async getBlockByHeight(o){return a({aptosConfig:this.config,...o})}async view(o){return c({aptosConfig:this.config,...o})}async viewJson(o){return g({aptosConfig:this.config,...o})}async getChainTopUserTransactions(o){return n({aptosConfig:this.config,...o})}async queryIndexer(o){return s({aptosConfig:this.config,...o})}async getIndexerLastSuccessVersion(){return r({aptosConfig:this.config})}async getProcessorStatus(o){return t({aptosConfig:this.config,processorType:o})}};export{p as a};
2
- //# sourceMappingURL=chunk-EVA2SMAU.mjs.map
1
+ import{a as c,b as g}from"./chunk-7FCSZ5LT.mjs";import{k as i,l as a}from"./chunk-22HNYCN4.mjs";import{a as e,b as n,c as s,e as r,f as t}from"./chunk-AKLUTUMD.mjs";var p=class{constructor(o){this.config=o}async getLedgerInfo(){return e({aptosConfig:this.config})}async getChainId(){return(await this.getLedgerInfo()).chain_id}async getBlockByVersion(o){return i({aptosConfig:this.config,...o})}async getBlockByHeight(o){return a({aptosConfig:this.config,...o})}async view(o){return c({aptosConfig:this.config,...o})}async viewJson(o){return g({aptosConfig:this.config,...o})}async getChainTopUserTransactions(o){return n({aptosConfig:this.config,...o})}async queryIndexer(o){return s({aptosConfig:this.config,...o})}async getIndexerLastSuccessVersion(){return r({aptosConfig:this.config})}async getProcessorStatus(o){return t({aptosConfig:this.config,processorType:o})}};export{p as a};
2
+ //# sourceMappingURL=chunk-ZTXK5FPC.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/api/general.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { AptosConfig } from \"./aptosConfig\";\nimport {\n getChainTopUserTransactions,\n getIndexerLastSuccessVersion,\n getLedgerInfo,\n getProcessorStatus,\n queryIndexer,\n} from \"../internal/general\";\nimport { getBlockByHeight, getBlockByVersion } from \"../internal/transaction\";\nimport { view, viewJson } from \"../internal/view\";\nimport {\n AnyNumber,\n Block,\n GetChainTopUserTransactionsResponse,\n GetProcessorStatusResponse,\n GraphqlQuery,\n LedgerInfo,\n LedgerVersionArg,\n MoveValue,\n} from \"../types\";\nimport { ProcessorType } from \"../utils/const\";\nimport { InputViewFunctionData, InputViewFunctionJsonData } from \"../transactions\";\n\n/**\n * A class to query various Aptos-related information and perform operations on the Aptos blockchain.\n * @group General\n */\nexport class General {\n readonly config: AptosConfig;\n\n /**\n * Initializes a new instance of the Aptos client with the specified configuration.\n * This allows users to interact with the Aptos blockchain using the provided settings.\n *\n * @param config - The configuration settings for the Aptos client.\n * @param config.network - The network to connect to (e.g., TESTNET, MAINNET).\n * @param config.nodeUrl - The URL of the Aptos node to connect to.\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 the Aptos client\n * const config = new AptosConfig({\n * network: Network.TESTNET, // specify the network\n * nodeUrl: \"https://testnet.aptos.dev\" // specify the node URL\n * });\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 General\n */\n constructor(config: AptosConfig) {\n this.config = config;\n }\n\n /**\n * Queries for the Aptos ledger information.\n *\n * @returns The Aptos Ledger Info, which includes details such as chain ID, epoch, and ledger version.\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 the ledger information\n * const ledgerInfo = await aptos.getLedgerInfo();\n *\n * console.log(ledgerInfo);\n * }\n * runExample().catch(console.error);\n * ```\n * @group General\n */\n async getLedgerInfo(): Promise<LedgerInfo> {\n return getLedgerInfo({ aptosConfig: this.config });\n }\n\n /**\n * Retrieves the chain ID of the Aptos blockchain.\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 the chain ID\n * const chainId = await aptos.getChainId();\n * console.log(\"Chain ID:\", chainId);\n * }\n * runExample().catch(console.error);\n *\n * @returns The chain ID of the Aptos blockchain.\n * ```\n * @group General\n */\n async getChainId(): Promise<number> {\n const result = await this.getLedgerInfo();\n return result.chain_id;\n }\n\n /**\n * Retrieves block information by the specified ledger version.\n *\n * @param args - The arguments for retrieving the block.\n * @param args.ledgerVersion - The ledger version to lookup block information for.\n * @param args.options - Optional parameters for the request.\n * @param args.options.withTransactions - If set to true, include all transactions in the block.\n *\n * @returns Block information with optional transactions.\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 block information for a specific ledger version\n * const block = await aptos.getBlockByVersion({ ledgerVersion: 5 });\n * console.log(block);\n * }\n * runExample().catch(console.error);\n * ```\n * @group General\n */\n async getBlockByVersion(args: {\n ledgerVersion: AnyNumber;\n options?: { withTransactions?: boolean };\n }): Promise<Block> {\n return getBlockByVersion({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Retrieve a block by its height, allowing for the inclusion of transactions if specified.\n *\n * @param args - The parameters for the block retrieval.\n * @param args.blockHeight - The block height to look up, starting at 0.\n * @param args.options - Optional settings for the retrieval.\n * @param args.options.withTransactions - If set to true, includes all transactions in the block.\n *\n * @returns The block with optional transactions included.\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 block at height 5, including transactions\n * const block = await aptos.getBlockByHeight({ blockHeight: 5, options: { withTransactions: true } });\n * console.log(block);\n * }\n * runExample().catch(console.error);\n * ```\n * @group General\n */\n async getBlockByHeight(args: { blockHeight: AnyNumber; options?: { withTransactions?: boolean } }): Promise<Block> {\n return getBlockByHeight({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries for a Move view function\n * @param args.payload Payload for the view function\n * @param args.options.ledgerVersion The ledger version to query, if not provided it will get the latest version\n *\n * @example\n * const data = await aptos.view({\n * payload: {\n * function: \"0x1::coin::balance\",\n * typeArguments: [\"0x1::aptos_coin::AptosCoin\"],\n * functionArguments: [accountAddress],\n * }\n * })\n *\n * @returns an array of Move values\n * @group General\n */\n async view<T extends Array<MoveValue>>(args: {\n payload: InputViewFunctionData;\n options?: LedgerVersionArg;\n }): Promise<T> {\n return view<T>({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries for a Move view function with JSON, this provides compatability with the old `aptos` package\n * @param args.payload Payload for the view function\n * @param args.options.ledgerVersion The ledger version to query, if not provided it will get the latest version\n *\n * @example\n * const data = await aptos.view({\n * payload: {\n * function: \"0x1::coin::balance\",\n * typeArguments: [\"0x1::aptos_coin::AptosCoin\"],\n * functionArguments: [accountAddress.toString()],\n * }\n * })\n *\n * @returns an array of Move values\n * @group General\n */\n async viewJson<T extends Array<MoveValue>>(args: {\n payload: InputViewFunctionJsonData;\n options?: LedgerVersionArg;\n }): Promise<T> {\n return viewJson<T>({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries the top user transactions based on the specified limit.\n *\n * @param args - The arguments for querying top user transactions.\n * @param args.limit - The number of transactions to return.\n * @returns GetChainTopUserTransactionsResponse\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 the top user transactions with a limit of 5\n * const topUserTransactions = await aptos.getChainTopUserTransactions({ limit: 5 });\n *\n * console.log(topUserTransactions);\n * }\n * runExample().catch(console.error);\n * ```\n * @group General\n */\n async getChainTopUserTransactions(args: { limit: number }): Promise<GetChainTopUserTransactionsResponse> {\n return getChainTopUserTransactions({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Retrieves data from the Aptos Indexer using a GraphQL query.\n * This function allows you to execute complex queries to fetch specific data from the Aptos blockchain.\n *\n * @param args.query.query - A GraphQL query string.\n * @param args.query.variables - The variables for the query (optional).\n *\n * @return The provided T type.\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 * // Querying the Aptos Indexer for ledger information\n * const topUserTransactions = await aptos.queryIndexer({\n * query: `query MyQuery {\n * ledger_infos {\n * chain_id\n * }\n * }`\n * });\n *\n * console.log(topUserTransactions);\n * }\n * runExample().catch(console.error);\n * ```\n * @group General\n */\n async queryIndexer<T extends {}>(args: { query: GraphqlQuery }): Promise<T> {\n return queryIndexer<T>({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Queries for the last successful indexer version, providing insight into the ledger version the indexer is updated to, which\n * may lag behind the full nodes.\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 last successful indexer version\n * const version = await aptos.getIndexerLastSuccessVersion();\n * console.log(`Last successful indexer version: ${version}`);\n * }\n * runExample().catch(console.error);\n * ```\n * @group General\n */\n async getIndexerLastSuccessVersion(): Promise<bigint> {\n return getIndexerLastSuccessVersion({ aptosConfig: this.config });\n }\n\n /**\n * Query the processor status for a specific processor type.\n *\n * @param processorType The processor type to query.\n * @returns The status of the specified processor type.\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 processor status for the account transactions processor\n * const status = await aptos.getProcessorStatus(\"account_transactions_processor\");\n * console.log(status);\n * }\n * runExample().catch(console.error);\n * ```\n * @group General\n */\n async getProcessorStatus(processorType: ProcessorType): Promise<GetProcessorStatusResponse[0]> {\n return getProcessorStatus({ aptosConfig: this.config, processorType });\n }\n}\n"],"mappings":"qKA8BO,IAAMA,EAAN,KAAc,CA+BnB,YAAYC,EAAqB,CAC/B,KAAK,OAASA,CAChB,CAwBA,MAAM,eAAqC,CACzC,OAAOC,EAAc,CAAE,YAAa,KAAK,MAAO,CAAC,CACnD,CAuBA,MAAM,YAA8B,CAElC,OADe,MAAM,KAAK,cAAc,GAC1B,QAChB,CA4BA,MAAM,kBAAkBC,EAGL,CACjB,OAAOC,EAAkB,CACvB,YAAa,KAAK,OAClB,GAAGD,CACL,CAAC,CACH,CA4BA,MAAM,iBAAiBA,EAA4F,CACjH,OAAOE,EAAiB,CAAE,YAAa,KAAK,OAAQ,GAAGF,CAAK,CAAC,CAC/D,CAmBA,MAAM,KAAiCA,EAGxB,CACb,OAAOG,EAAQ,CAAE,YAAa,KAAK,OAAQ,GAAGH,CAAK,CAAC,CACtD,CAmBA,MAAM,SAAqCA,EAG5B,CACb,OAAOI,EAAY,CAAE,YAAa,KAAK,OAAQ,GAAGJ,CAAK,CAAC,CAC1D,CA0BA,MAAM,4BAA4BA,EAAuE,CACvG,OAAOK,EAA4B,CACjC,YAAa,KAAK,OAClB,GAAGL,CACL,CAAC,CACH,CAkCA,MAAM,aAA2BA,EAA2C,CAC1E,OAAOM,EAAgB,CACrB,YAAa,KAAK,OAClB,GAAGN,CACL,CAAC,CACH,CAsBA,MAAM,8BAAgD,CACpD,OAAOO,EAA6B,CAAE,YAAa,KAAK,MAAO,CAAC,CAClE,CAwBA,MAAM,mBAAmBC,EAAsE,CAC7F,OAAOC,EAAmB,CAAE,YAAa,KAAK,OAAQ,cAAAD,CAAc,CAAC,CACvE,CACF","names":["General","config","getLedgerInfo","args","getBlockByVersion","getBlockByHeight","view","viewJson","getChainTopUserTransactions","queryIndexer","getIndexerLastSuccessVersion","processorType","getProcessorStatus"]}
@@ -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
@@ -15,6 +15,8 @@ import '../transactions/instances/transactionArgument.mjs';
15
15
  * Class representing a Move package management utility for the Aptos blockchain.
16
16
  * This class provides methods to initialize directories, compile packages, run tests, publish modules, create objects, upgrade
17
17
  * packages, build transaction payloads, and run scripts.
18
+ * @group Implementation
19
+ * @category CLI
18
20
  */
19
21
  declare class Move {
20
22
  /**
@@ -28,6 +30,8 @@ declare class Move {
28
30
  * @param args.extraArguments - Optional extra arguments to include in the form of an array of strings.
29
31
  * Ex. ["--assume-yes","--gas-unit-price=10"]
30
32
  * @returns stdout
33
+ * @group Implementation
34
+ * @category CLI
31
35
  */
32
36
  init(args: {
33
37
  network?: Network;
@@ -47,6 +51,8 @@ declare class Move {
47
51
  * @param args.extraArguments - Optional extra arguments to include in the form of an array of strings.
48
52
  * Ex. ["--assume-yes","--gas-unit-price=10"]
49
53
  * @returns stdout
54
+ * @group Implementation
55
+ * @category CLI
50
56
  */
51
57
  compile(args: {
52
58
  packageDirectoryPath: string;
@@ -65,6 +71,8 @@ declare class Move {
65
71
  * @param args.extraArguments - Optional extra arguments to include in the form of an array of strings.
66
72
  * Ex. ["--assume-yes","--gas-unit-price=10"]
67
73
  * @returns The stdout output from running the tests.
74
+ * @group Implementation
75
+ * @category CLI
68
76
  */
69
77
  test(args: {
70
78
  packageDirectoryPath: string;
@@ -84,6 +92,8 @@ declare class Move {
84
92
  * @param args.extraArguments - Optional extra arguments to include in the form of an array of strings.
85
93
  * Ex. ["--assume-yes","--gas-unit-price=10"]
86
94
  * @returns stdout
95
+ * @group Implementation
96
+ * @category CLI
87
97
  */
88
98
  publish(args: {
89
99
  packageDirectoryPath: string;
@@ -113,6 +123,8 @@ declare class Move {
113
123
  * --named-addresses "launchpad_addr=0x123,initial_creator_addr=0x456" \
114
124
  * --profile my_profile \
115
125
  * --assume-yes
126
+ * @group Implementation
127
+ * @category CLI
116
128
  */
117
129
  createObjectAndPublishPackage(args: {
118
130
  packageDirectoryPath: string;
@@ -136,6 +148,8 @@ declare class Move {
136
148
  * @param args.extraArguments - Optional extra arguments to include in the form of an array of strings.
137
149
  * Ex. ["--assume-yes","--gas-unit-price=10"]
138
150
  * @returns stdout
151
+ * @group Implementation
152
+ * @category CLI
139
153
  */
140
154
  upgradeObjectPackage(args: {
141
155
  packageDirectoryPath: string;
@@ -157,6 +171,8 @@ declare class Move {
157
171
  * @param args.extraArguments - Optional extra arguments to include in the form of an array of strings.
158
172
  * Ex. ["--assume-yes","--gas-unit-price=10"] *
159
173
  * @returns stdout
174
+ * @group Implementation
175
+ * @category CLI
160
176
  */
161
177
  buildPublishPayload(args: {
162
178
  packageDirectoryPath: string;
@@ -179,6 +195,8 @@ declare class Move {
179
195
  * Ex. ["--assume-yes","--gas-unit-price=10"]
180
196
  *
181
197
  * @returns The standard output from running the script.
198
+ * @group Implementation
199
+ * @category CLI
182
200
  */
183
201
  runScript(args: {
184
202
  compiledScriptPath: string;
@@ -203,6 +221,8 @@ declare class Move {
203
221
  * @param args - An array of strings representing the command-line arguments to be passed to the command.
204
222
  * @param showStdout - Show the standard output generated by the command.
205
223
  * @returns The standard output generated by the command.
224
+ * @group Implementation
225
+ * @category CLI
206
226
  */
207
227
  private runCommand;
208
228
  /**
@@ -211,6 +231,8 @@ declare class Move {
211
231
  * @param namedAddresses - A Map where the key is a string representing the name and the value is an AccountAddress.
212
232
  * Ex. {'alice' => '0x123', 'bob' => '0x456'}
213
233
  * @returns An array of named addresses formatted as strings separated by a comma. Ex. "alice=0x123,bob=0x456"
234
+ * @group Implementation
235
+ * @category CLI
214
236
  */
215
237
  private prepareNamedAddresses;
216
238
  /**
@@ -221,6 +243,8 @@ declare class Move {
221
243
  *
222
244
  * @param namedAddresses - A record containing named addresses where the key is the name and the value is the AccountAddress.
223
245
  * @returns A Map where each key is a name and each value is the corresponding address.
246
+ * @group Implementation
247
+ * @category CLI
224
248
  */
225
249
  private parseNamedAddresses;
226
250
  /**
@@ -229,6 +253,8 @@ declare class Move {
229
253
  * @param output - The output string containing the object address.
230
254
  * @returns The extracted object address.
231
255
  * @throws Error if the object address cannot be extracted from the output.
256
+ * @group Implementation
257
+ * @category CLI
232
258
  */
233
259
  private extractAddressFromOutput;
234
260
  }
@@ -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
@@ -24,6 +24,8 @@ import '@aptos-labs/script-composer-pack';
24
24
  * @param client - The client used to make the request.
25
25
  *
26
26
  * @returns The response from the request.
27
+ * @group Implementation
28
+ * @category Client
27
29
  */
28
30
  declare function request<Req, Res>(options: ClientRequest<Req>, client: Client): Promise<ClientResponse<Res>>;
29
31
  /**
@@ -33,6 +35,8 @@ declare function request<Req, Res>(options: ClientRequest<Req>, client: Client):
33
35
  * @param aptosConfig - The configuration information for the SDK client instance.
34
36
  * @param apiType - The type of API being accessed, which determines how the response is handled.
35
37
  * @returns The response from the API request or throws an AptosApiError if the request fails.
38
+ * @group Implementation
39
+ * @category Client
36
40
  */
37
41
  declare function aptosRequest<Req extends {}, Res extends {}>(aptosRequestOpts: AptosRequest, aptosConfig: AptosConfig, apiType: AptosApiType): Promise<AptosResponse<Req, Res>>;
38
42
 
@@ -1,2 +1,2 @@
1
- import{a,b}from"../chunk-P6RNNESB.mjs";import"../chunk-HGLO5LDS.mjs";import"../chunk-UZTJWOLS.mjs";import"../chunk-F45G3GP3.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-Q3CWUEXI.mjs";import"../chunk-42H7WETG.mjs";import"../chunk-ZMBXHMVQ.mjs";import"../chunk-BRV3RLKW.mjs";import"../chunk-D52UKPQF.mjs";import"../chunk-3OLFJ65O.mjs";import"../chunk-U2PRGW4O.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-AJ5JHBAE.mjs";import"../chunk-SPRNSFUV.mjs";import"../chunk-6Q2O5G3J.mjs";import"../chunk-V4FKFCBL.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-D3OEQLUE.mjs";import"../chunk-J7PJSK3J.mjs";import"../chunk-YQHOQJRQ.mjs";import"../chunk-KDMSOCZY.mjs";export{b as aptosRequest,a as request};
1
+ import{a,b}from"../chunk-EYE4UEWZ.mjs";import"../chunk-HGLO5LDS.mjs";import"../chunk-4YLUM62M.mjs";import"../chunk-QHEKBHNU.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-TOBQ5UE6.mjs";import"../chunk-MT2RJ7H3.mjs";import"../chunk-IDTLNF4M.mjs";import"../chunk-ORMOQWWH.mjs";import"../chunk-3OLFJ65O.mjs";import"../chunk-U2PRGW4O.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-EBMEXURY.mjs";import"../chunk-DAFSKSZ5.mjs";import"../chunk-XTOIL6MB.mjs";import"../chunk-STY74NUA.mjs";import"../chunk-IF4UU2MT.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-4RXKALLC.mjs";import"../chunk-RJ7F4JDV.mjs";import"../chunk-IOZSAIGP.mjs";import"../chunk-KDMSOCZY.mjs";export{b as aptosRequest,a as request};
2
2
  //# sourceMappingURL=core.mjs.map