@aptos-labs/ts-sdk 1.29.0 → 1.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (693) hide show
  1. package/README.md +2 -2
  2. package/dist/common/{accountAddress-DUCC2ffJ.d.ts → accountAddress-DnSqjhSl.d.ts} +700 -245
  3. package/dist/common/{chunk-HBPH2AD3.js → chunk-7IYTZDXV.js} +1 -1
  4. package/dist/common/chunk-7IYTZDXV.js.map +1 -0
  5. package/dist/common/cli/index.d.ts +123 -126
  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 +5921 -1627
  9. package/dist/common/index.js +8 -8
  10. package/dist/common/index.js.map +1 -1
  11. package/dist/esm/Ed25519Account-DpH9qAcg.d.mts +470 -0
  12. package/dist/esm/account/AbstractKeylessAccount.d.mts +6 -5
  13. package/dist/esm/account/AbstractKeylessAccount.mjs +1 -1
  14. package/dist/esm/account/Account.d.mts +2 -2
  15. package/dist/esm/account/Account.mjs +1 -1
  16. package/dist/esm/account/Ed25519Account.d.mts +2 -2
  17. package/dist/esm/account/Ed25519Account.mjs +1 -1
  18. package/dist/esm/account/EphemeralKeyPair.d.mts +49 -14
  19. package/dist/esm/account/EphemeralKeyPair.mjs +1 -1
  20. package/dist/esm/account/FederatedKeylessAccount.d.mts +3 -3
  21. package/dist/esm/account/FederatedKeylessAccount.mjs +1 -1
  22. package/dist/esm/account/KeylessAccount.d.mts +42 -4
  23. package/dist/esm/account/KeylessAccount.mjs +1 -1
  24. package/dist/esm/account/MultiKeyAccount.d.mts +54 -34
  25. package/dist/esm/account/MultiKeyAccount.mjs +1 -1
  26. package/dist/esm/account/SingleKeyAccount.d.mts +2 -2
  27. package/dist/esm/account/SingleKeyAccount.mjs +1 -1
  28. package/dist/esm/account/index.d.mts +2 -2
  29. package/dist/esm/account/index.mjs +1 -1
  30. package/dist/esm/api/account.d.mts +446 -161
  31. package/dist/esm/api/account.mjs +1 -1
  32. package/dist/esm/api/ans.d.mts +369 -122
  33. package/dist/esm/api/ans.mjs +1 -1
  34. package/dist/esm/api/aptos.d.mts +40 -7
  35. package/dist/esm/api/aptos.mjs +1 -1
  36. package/dist/esm/api/aptosConfig.d.mts +102 -14
  37. package/dist/esm/api/aptosConfig.mjs +1 -1
  38. package/dist/esm/api/coin.d.mts +52 -15
  39. package/dist/esm/api/coin.mjs +1 -1
  40. package/dist/esm/api/digitalAsset.d.mts +710 -300
  41. package/dist/esm/api/digitalAsset.mjs +1 -1
  42. package/dist/esm/api/event.d.mts +129 -26
  43. package/dist/esm/api/event.mjs +1 -1
  44. package/dist/esm/api/faucet.d.mts +44 -7
  45. package/dist/esm/api/faucet.mjs +1 -1
  46. package/dist/esm/api/fungibleAsset.d.mts +152 -49
  47. package/dist/esm/api/fungibleAsset.mjs +1 -1
  48. package/dist/esm/api/general.d.mts +171 -55
  49. package/dist/esm/api/general.mjs +1 -1
  50. package/dist/esm/api/index.d.mts +2 -2
  51. package/dist/esm/api/index.mjs +1 -1
  52. package/dist/esm/api/keyless.d.mts +82 -11
  53. package/dist/esm/api/keyless.mjs +1 -1
  54. package/dist/esm/api/object.d.mts +51 -7
  55. package/dist/esm/api/object.mjs +1 -1
  56. package/dist/esm/api/staking.d.mts +86 -17
  57. package/dist/esm/api/staking.mjs +1 -1
  58. package/dist/esm/api/table.d.mts +118 -38
  59. package/dist/esm/api/table.mjs +1 -1
  60. package/dist/esm/api/transaction.d.mts +440 -109
  61. package/dist/esm/api/transaction.mjs +1 -1
  62. package/dist/esm/api/transactionSubmission/build.d.mts +99 -13
  63. package/dist/esm/api/transactionSubmission/build.mjs +1 -1
  64. package/dist/esm/api/transactionSubmission/helpers.d.mts +79 -0
  65. package/dist/esm/api/transactionSubmission/helpers.mjs +1 -1
  66. package/dist/esm/api/transactionSubmission/management.d.mts +111 -12
  67. package/dist/esm/api/transactionSubmission/management.mjs +1 -1
  68. package/dist/esm/api/transactionSubmission/sign.d.mts +97 -3
  69. package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
  70. package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -1
  71. package/dist/esm/api/transactionSubmission/simulate.d.mts +140 -15
  72. package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
  73. package/dist/esm/api/transactionSubmission/submit.d.mts +104 -13
  74. package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
  75. package/dist/esm/api/utils.d.mts +26 -3
  76. package/dist/esm/api/utils.mjs +1 -1
  77. package/dist/esm/bcs/consts.mjs +1 -1
  78. package/dist/esm/bcs/deserializer.d.mts +82 -32
  79. package/dist/esm/bcs/deserializer.mjs +1 -1
  80. package/dist/esm/bcs/index.mjs +1 -1
  81. package/dist/esm/bcs/serializable/entryFunctionBytes.d.mts +25 -6
  82. package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -1
  83. package/dist/esm/bcs/serializable/fixedBytes.d.mts +51 -21
  84. package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -1
  85. package/dist/esm/bcs/serializable/movePrimitives.d.mts +79 -0
  86. package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
  87. package/dist/esm/bcs/serializable/moveStructs.d.mts +119 -32
  88. package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
  89. package/dist/esm/bcs/serializer.d.mts +111 -76
  90. package/dist/esm/bcs/serializer.mjs +1 -1
  91. package/dist/esm/{chunk-U6Z4FNB7.mjs → chunk-2CJC43CV.mjs} +1 -1
  92. package/dist/esm/chunk-2CJC43CV.mjs.map +1 -0
  93. package/dist/esm/{chunk-P2EIZ7WL.mjs → chunk-2I56E4T2.mjs} +2 -2
  94. package/dist/esm/chunk-2I56E4T2.mjs.map +1 -0
  95. package/dist/esm/{chunk-P3TAY5PP.mjs → chunk-2QRWGJJA.mjs} +2 -2
  96. package/dist/esm/chunk-2QRWGJJA.mjs.map +1 -0
  97. package/dist/esm/chunk-37UZKMJI.mjs +2 -0
  98. package/dist/esm/chunk-37UZKMJI.mjs.map +1 -0
  99. package/dist/esm/chunk-4CDDWSKZ.mjs +2 -0
  100. package/dist/esm/chunk-4CDDWSKZ.mjs.map +1 -0
  101. package/dist/esm/chunk-4OV7QU2U.mjs +2 -0
  102. package/dist/esm/chunk-4OV7QU2U.mjs.map +1 -0
  103. package/dist/esm/{chunk-SWNFKKRE.mjs → chunk-5AAFF2PV.mjs} +2 -2
  104. package/dist/esm/chunk-5AAFF2PV.mjs.map +1 -0
  105. package/dist/esm/chunk-5CCHECTE.mjs +2 -0
  106. package/dist/esm/chunk-5CCHECTE.mjs.map +1 -0
  107. package/dist/esm/{chunk-KUOB4DDE.mjs → chunk-5XXIIWG7.mjs} +2 -2
  108. package/dist/esm/chunk-5XXIIWG7.mjs.map +1 -0
  109. package/dist/esm/chunk-5ZBHIUWG.mjs +2 -0
  110. package/dist/esm/chunk-5ZBHIUWG.mjs.map +1 -0
  111. package/dist/esm/chunk-6AGTDRNM.mjs +2 -0
  112. package/dist/esm/chunk-6AGTDRNM.mjs.map +1 -0
  113. package/dist/esm/chunk-6FLHGOKP.mjs +2 -0
  114. package/dist/esm/chunk-6FLHGOKP.mjs.map +1 -0
  115. package/dist/esm/{chunk-LG7RJQ57.mjs → chunk-6Q2O5G3J.mjs} +1 -1
  116. package/dist/esm/chunk-6Q2O5G3J.mjs.map +1 -0
  117. package/dist/esm/chunk-7D3RY73L.mjs +2 -0
  118. package/dist/esm/chunk-7D3RY73L.mjs.map +1 -0
  119. package/dist/esm/{chunk-QBSU3L5Q.mjs → chunk-7PVIWKGT.mjs} +2 -2
  120. package/dist/esm/chunk-7PVIWKGT.mjs.map +1 -0
  121. package/dist/esm/chunk-7V6RL27I.mjs +2 -0
  122. package/dist/esm/chunk-7V6RL27I.mjs.map +1 -0
  123. package/dist/esm/{chunk-44GYWUSH.mjs → chunk-7XS45O6M.mjs} +1 -1
  124. package/dist/esm/chunk-7XS45O6M.mjs.map +1 -0
  125. package/dist/esm/{chunk-YUNDX5I7.mjs → chunk-AGBA3Y7A.mjs} +2 -2
  126. package/dist/esm/chunk-AGBA3Y7A.mjs.map +1 -0
  127. package/dist/esm/{chunk-OKAQO57B.mjs → chunk-BQXVHY7J.mjs} +2 -2
  128. package/dist/esm/chunk-BQXVHY7J.mjs.map +1 -0
  129. package/dist/esm/chunk-CRL4WGOH.mjs +2 -0
  130. package/dist/esm/chunk-CRL4WGOH.mjs.map +1 -0
  131. package/dist/esm/{chunk-APN6AV5Q.mjs → chunk-D3KBNFZR.mjs} +2 -2
  132. package/dist/esm/chunk-D3KBNFZR.mjs.map +1 -0
  133. package/dist/esm/{chunk-SCHZ67F3.mjs → chunk-D3OEQLUE.mjs} +1 -1
  134. package/dist/esm/{chunk-SCHZ67F3.mjs.map → chunk-D3OEQLUE.mjs.map} +1 -1
  135. package/dist/esm/{chunk-FZ5EYP3D.mjs → chunk-DCUVV3VY.mjs} +2 -2
  136. package/dist/esm/chunk-DCUVV3VY.mjs.map +1 -0
  137. package/dist/esm/{chunk-S2KDCIZN.mjs → chunk-DXQT55L3.mjs} +2 -2
  138. package/dist/esm/chunk-DXQT55L3.mjs.map +1 -0
  139. package/dist/esm/chunk-DZJXOL64.mjs +2 -0
  140. package/dist/esm/chunk-DZJXOL64.mjs.map +1 -0
  141. package/dist/esm/{chunk-Y2GWUE7C.mjs → chunk-EF2PUPUH.mjs} +2 -2
  142. package/dist/esm/chunk-EF2PUPUH.mjs.map +1 -0
  143. package/dist/esm/{chunk-J64ARI4E.mjs → chunk-EKZQ3EYX.mjs} +2 -2
  144. package/dist/esm/chunk-EKZQ3EYX.mjs.map +1 -0
  145. package/dist/esm/{chunk-F76N4MQO.mjs → chunk-EN2HDNFE.mjs} +2 -2
  146. package/dist/esm/chunk-EN2HDNFE.mjs.map +1 -0
  147. package/dist/esm/{chunk-L2QXU6F4.mjs → chunk-FO4F3OJJ.mjs} +2 -2
  148. package/dist/esm/chunk-FO4F3OJJ.mjs.map +1 -0
  149. package/dist/esm/{chunk-HKBBA653.mjs → chunk-FPF4KZ5M.mjs} +2 -2
  150. package/dist/esm/chunk-FPF4KZ5M.mjs.map +1 -0
  151. package/dist/esm/{chunk-OMV7445F.mjs → chunk-FY7TSOUU.mjs} +2 -2
  152. package/dist/esm/chunk-FY7TSOUU.mjs.map +1 -0
  153. package/dist/esm/{chunk-ELYS7CWV.mjs → chunk-GIQQF2PD.mjs} +2 -2
  154. package/dist/esm/chunk-GIQQF2PD.mjs.map +1 -0
  155. package/dist/esm/{chunk-SRPI2FFA.mjs → chunk-GMKKHGXK.mjs} +1 -1
  156. package/dist/esm/chunk-GMKKHGXK.mjs.map +1 -0
  157. package/dist/esm/chunk-GPZRGLU2.mjs +2 -0
  158. package/dist/esm/chunk-GPZRGLU2.mjs.map +1 -0
  159. package/dist/esm/{chunk-TDGQGILY.mjs → chunk-GQABU3RQ.mjs} +1 -1
  160. package/dist/esm/chunk-GQABU3RQ.mjs.map +1 -0
  161. package/dist/esm/{chunk-JH6VLTMS.mjs → chunk-HAMXSLWF.mjs} +2 -2
  162. package/dist/esm/chunk-HAMXSLWF.mjs.map +1 -0
  163. package/dist/esm/{chunk-AH44UPM4.mjs → chunk-HBIDHQ2M.mjs} +1 -1
  164. package/dist/esm/chunk-HBIDHQ2M.mjs.map +1 -0
  165. package/dist/esm/{chunk-QPB6EJVM.mjs → chunk-HCV3NGLS.mjs} +2 -2
  166. package/dist/esm/chunk-HCV3NGLS.mjs.map +1 -0
  167. package/dist/esm/{chunk-2BTTX2KO.mjs → chunk-HDTKBFRX.mjs} +2 -2
  168. package/dist/esm/chunk-HDTKBFRX.mjs.map +1 -0
  169. package/dist/esm/chunk-HGVZ7ULA.mjs +2 -0
  170. package/dist/esm/chunk-HGVZ7ULA.mjs.map +1 -0
  171. package/dist/esm/{chunk-6EMN3BOV.mjs → chunk-I2NMCLNW.mjs} +1 -1
  172. package/dist/esm/chunk-I2NMCLNW.mjs.map +1 -0
  173. package/dist/esm/chunk-IBLZ6MZU.mjs +2 -0
  174. package/dist/esm/chunk-IBLZ6MZU.mjs.map +1 -0
  175. package/dist/esm/chunk-IECDO22V.mjs +2 -0
  176. package/dist/esm/chunk-IECDO22V.mjs.map +1 -0
  177. package/dist/esm/{chunk-KUZ2YTJH.mjs → chunk-IFHQSZLK.mjs} +2 -2
  178. package/dist/esm/chunk-IFHQSZLK.mjs.map +1 -0
  179. package/dist/esm/{chunk-EXP5STXZ.mjs → chunk-J245N3XF.mjs} +1 -1
  180. package/dist/esm/chunk-J245N3XF.mjs.map +1 -0
  181. package/dist/esm/{chunk-7VKFXX5Q.mjs → chunk-JDYASF3E.mjs} +2 -2
  182. package/dist/esm/chunk-JDYASF3E.mjs.map +1 -0
  183. package/dist/esm/{chunk-H6YNXJNF.mjs → chunk-JGNMNCQB.mjs} +2 -2
  184. package/dist/esm/chunk-JGNMNCQB.mjs.map +1 -0
  185. package/dist/esm/{chunk-R76DHMGR.mjs → chunk-JNHFQTFC.mjs} +2 -2
  186. package/dist/esm/chunk-JNHFQTFC.mjs.map +1 -0
  187. package/dist/esm/{chunk-5PCNWXRN.mjs → chunk-JY3JJ55D.mjs} +2 -2
  188. package/dist/esm/chunk-JY3JJ55D.mjs.map +1 -0
  189. package/dist/esm/{chunk-3W2DHZXK.mjs → chunk-K6MZXKVV.mjs} +2 -2
  190. package/dist/esm/chunk-K6MZXKVV.mjs.map +1 -0
  191. package/dist/esm/{chunk-FVA2OPG4.mjs → chunk-KDMSOCZY.mjs} +1 -1
  192. package/dist/esm/{chunk-BCUSI3N6.mjs → chunk-KFNDDPOW.mjs} +2 -2
  193. package/dist/esm/chunk-KFNDDPOW.mjs.map +1 -0
  194. package/dist/esm/{chunk-4TB3AWQE.mjs → chunk-KFSVKIFO.mjs} +2 -2
  195. package/dist/esm/chunk-KFSVKIFO.mjs.map +1 -0
  196. package/dist/esm/chunk-KIW54KWR.mjs +2 -0
  197. package/dist/esm/{chunk-OHRL766V.mjs → chunk-KM6UXNC7.mjs} +2 -2
  198. package/dist/esm/chunk-KM6UXNC7.mjs.map +1 -0
  199. package/dist/esm/{chunk-NWOMSL6K.mjs → chunk-KRVLR3L4.mjs} +2 -2
  200. package/dist/esm/chunk-KRVLR3L4.mjs.map +1 -0
  201. package/dist/esm/{chunk-4HR32TSY.mjs → chunk-KSKQVOBA.mjs} +2 -2
  202. package/dist/esm/chunk-KSKQVOBA.mjs.map +1 -0
  203. package/dist/esm/{chunk-ZROQH5YL.mjs → chunk-KSUZS6EL.mjs} +2 -2
  204. package/dist/esm/chunk-L5I7F3NZ.mjs +2 -0
  205. package/dist/esm/chunk-L5I7F3NZ.mjs.map +1 -0
  206. package/dist/esm/{chunk-MAMPMCO7.mjs → chunk-LD5MUWGW.mjs} +2 -2
  207. package/dist/esm/chunk-LD5MUWGW.mjs.map +1 -0
  208. package/dist/esm/{chunk-UAL27G6B.mjs → chunk-LEKBJ2EG.mjs} +1 -1
  209. package/dist/esm/chunk-LEKBJ2EG.mjs.map +1 -0
  210. package/dist/esm/chunk-LZS7BQ2B.mjs +2 -0
  211. package/dist/esm/chunk-LZS7BQ2B.mjs.map +1 -0
  212. package/dist/esm/{chunk-53RB2PRH.mjs → chunk-N3OYD6VZ.mjs} +2 -2
  213. package/dist/esm/chunk-N3OYD6VZ.mjs.map +1 -0
  214. package/dist/esm/{chunk-KEYAPEAX.mjs → chunk-N47FTRYO.mjs} +1 -1
  215. package/dist/esm/chunk-N47FTRYO.mjs.map +1 -0
  216. package/dist/esm/{chunk-YDZBU2DJ.mjs → chunk-NODYW7DM.mjs} +2 -2
  217. package/dist/esm/chunk-NODYW7DM.mjs.map +1 -0
  218. package/dist/esm/{chunk-HVMFZF6P.mjs → chunk-NV6DHDM3.mjs} +2 -2
  219. package/dist/esm/chunk-NV6DHDM3.mjs.map +1 -0
  220. package/dist/esm/{chunk-YU3IYJRL.mjs → chunk-OLPI7QAH.mjs} +2 -2
  221. package/dist/esm/chunk-OLPI7QAH.mjs.map +1 -0
  222. package/dist/esm/chunk-ONBFUPEC.mjs +2 -0
  223. package/dist/esm/chunk-ONBFUPEC.mjs.map +1 -0
  224. package/dist/esm/{chunk-A42BPAD4.mjs → chunk-OS2EG6AE.mjs} +2 -2
  225. package/dist/esm/chunk-OS2EG6AE.mjs.map +1 -0
  226. package/dist/esm/chunk-OTY3NO7Q.mjs +2 -0
  227. package/dist/esm/chunk-OTY3NO7Q.mjs.map +1 -0
  228. package/dist/esm/{chunk-MNVUSJEK.mjs → chunk-OV5UQ75K.mjs} +2 -2
  229. package/dist/esm/chunk-OV5UQ75K.mjs.map +1 -0
  230. package/dist/esm/{chunk-P5V7OZNN.mjs → chunk-OZN3OOJV.mjs} +2 -2
  231. package/dist/esm/chunk-OZN3OOJV.mjs.map +1 -0
  232. package/dist/esm/{chunk-WRRQ7L5K.mjs → chunk-PCLU4KLY.mjs} +2 -2
  233. package/dist/esm/chunk-PCLU4KLY.mjs.map +1 -0
  234. package/dist/esm/{chunk-Q3TAEOH5.mjs → chunk-PGZWRY7A.mjs} +2 -2
  235. package/dist/esm/chunk-PGZWRY7A.mjs.map +1 -0
  236. package/dist/esm/{chunk-X34JJPW5.mjs → chunk-PHG2IWZW.mjs} +2 -2
  237. package/dist/esm/chunk-PHG2IWZW.mjs.map +1 -0
  238. package/dist/esm/{chunk-LR65XHSF.mjs → chunk-PHP47DI4.mjs} +2 -2
  239. package/dist/esm/chunk-PHP47DI4.mjs.map +1 -0
  240. package/dist/esm/chunk-PRZ7AIGA.mjs +2 -0
  241. package/dist/esm/chunk-PRZ7AIGA.mjs.map +1 -0
  242. package/dist/esm/{chunk-6UZ3VI5Y.mjs → chunk-QBP4XJT5.mjs} +2 -2
  243. package/dist/esm/chunk-QBP4XJT5.mjs.map +1 -0
  244. package/dist/esm/{chunk-5VD4MHB3.mjs → chunk-QBWGWHJK.mjs} +2 -2
  245. package/dist/esm/chunk-QBWGWHJK.mjs.map +1 -0
  246. package/dist/esm/chunk-QQIVWB6G.mjs +2 -0
  247. package/dist/esm/chunk-QQIVWB6G.mjs.map +1 -0
  248. package/dist/esm/{chunk-367OG3DB.mjs → chunk-QRTZYRH2.mjs} +2 -2
  249. package/dist/esm/chunk-QRTZYRH2.mjs.map +1 -0
  250. package/dist/esm/{chunk-2F7Z7RMW.mjs → chunk-R3Y6WH2U.mjs} +2 -2
  251. package/dist/esm/chunk-R3Y6WH2U.mjs.map +1 -0
  252. package/dist/esm/{chunk-S2W4D6NZ.mjs → chunk-RAXP3STS.mjs} +2 -2
  253. package/dist/esm/chunk-RAXP3STS.mjs.map +1 -0
  254. package/dist/esm/{chunk-F3M2UQA4.mjs → chunk-RNAKZVRN.mjs} +2 -2
  255. package/dist/esm/chunk-RNAKZVRN.mjs.map +1 -0
  256. package/dist/esm/{chunk-TQWGQLM6.mjs → chunk-RUDS7RSB.mjs} +2 -2
  257. package/dist/esm/chunk-RUDS7RSB.mjs.map +1 -0
  258. package/dist/esm/{chunk-GMBSQDPO.mjs → chunk-S3FVA55H.mjs} +2 -2
  259. package/dist/esm/chunk-S3FVA55H.mjs.map +1 -0
  260. package/dist/esm/{chunk-BSAHPS6E.mjs → chunk-TIZL5YVP.mjs} +2 -2
  261. package/dist/esm/chunk-TIZL5YVP.mjs.map +1 -0
  262. package/dist/esm/{chunk-SDWE6WMM.mjs → chunk-TRU3EK64.mjs} +2 -2
  263. package/dist/esm/chunk-TRU3EK64.mjs.map +1 -0
  264. package/dist/esm/chunk-UI3AKMZX.mjs +2 -0
  265. package/dist/esm/{chunk-UAEODDZS.mjs.map → chunk-UI3AKMZX.mjs.map} +1 -1
  266. package/dist/esm/{chunk-ADE6MVXC.mjs → chunk-UKAXCARD.mjs} +2 -2
  267. package/dist/esm/chunk-UKAXCARD.mjs.map +1 -0
  268. package/dist/esm/{chunk-NMD45OTM.mjs → chunk-V5NDNR36.mjs} +2 -2
  269. package/dist/esm/chunk-V5NDNR36.mjs.map +1 -0
  270. package/dist/esm/{chunk-O2BPA6TS.mjs → chunk-VQTEGTUQ.mjs} +2 -2
  271. package/dist/esm/chunk-VQTEGTUQ.mjs.map +1 -0
  272. package/dist/esm/{chunk-45IUUCAV.mjs → chunk-WIXNX7HY.mjs} +2 -2
  273. package/dist/esm/chunk-WIXNX7HY.mjs.map +1 -0
  274. package/dist/esm/{chunk-CRA2MFJC.mjs → chunk-WOOH5MMX.mjs} +2 -2
  275. package/dist/esm/chunk-WOOH5MMX.mjs.map +1 -0
  276. package/dist/esm/{chunk-GWSDIX6C.mjs → chunk-WSVOJSAC.mjs} +2 -2
  277. package/dist/esm/chunk-WSVOJSAC.mjs.map +1 -0
  278. package/dist/esm/{chunk-IR4SLC2M.mjs → chunk-WUCPTRXU.mjs} +2 -2
  279. package/dist/esm/chunk-WUCPTRXU.mjs.map +1 -0
  280. package/dist/esm/chunk-XHCALZ7X.mjs +2 -0
  281. package/dist/esm/chunk-XHCALZ7X.mjs.map +1 -0
  282. package/dist/esm/{chunk-WJRZWAIS.mjs → chunk-XIY2VORC.mjs} +2 -2
  283. package/dist/esm/chunk-XIY2VORC.mjs.map +1 -0
  284. package/dist/esm/chunk-XOCRDV2V.mjs +2 -0
  285. package/dist/esm/chunk-XOCRDV2V.mjs.map +1 -0
  286. package/dist/esm/{chunk-D3Q4BC3I.mjs → chunk-Z36WHOZV.mjs} +2 -2
  287. package/dist/esm/chunk-Z36WHOZV.mjs.map +1 -0
  288. package/dist/esm/{chunk-BOYYQAB4.mjs → chunk-ZINOJTLU.mjs} +2 -2
  289. package/dist/esm/chunk-ZINOJTLU.mjs.map +1 -0
  290. package/dist/esm/{chunk-RXE6NNOL.mjs → chunk-ZS3EWM5A.mjs} +2 -2
  291. package/dist/esm/chunk-ZS3EWM5A.mjs.map +1 -0
  292. package/dist/esm/{chunk-GDUAFXIQ.mjs → chunk-ZUTOMGB7.mjs} +2 -2
  293. package/dist/esm/chunk-ZUTOMGB7.mjs.map +1 -0
  294. package/dist/esm/cli/index.mjs +1 -1
  295. package/dist/esm/cli/localNode.d.mts +26 -10
  296. package/dist/esm/cli/localNode.mjs +1 -1
  297. package/dist/esm/cli/move.d.mts +104 -123
  298. package/dist/esm/cli/move.mjs +1 -1
  299. package/dist/esm/client/core.d.mts +21 -6
  300. package/dist/esm/client/core.mjs +1 -1
  301. package/dist/esm/client/get.d.mts +34 -6
  302. package/dist/esm/client/get.mjs +1 -1
  303. package/dist/esm/client/index.mjs +1 -1
  304. package/dist/esm/client/post.d.mts +63 -6
  305. package/dist/esm/client/post.mjs +1 -1
  306. package/dist/esm/client/types.d.mts +21 -8
  307. package/dist/esm/client/types.mjs +1 -1
  308. package/dist/esm/core/account/index.mjs +1 -1
  309. package/dist/esm/core/account/utils/address.d.mts +1 -1
  310. package/dist/esm/core/account/utils/address.mjs +1 -1
  311. package/dist/esm/core/account/utils/index.mjs +1 -1
  312. package/dist/esm/core/accountAddress.d.mts +63 -48
  313. package/dist/esm/core/accountAddress.mjs +1 -1
  314. package/dist/esm/core/authenticationKey.d.mts +1 -1
  315. package/dist/esm/core/authenticationKey.mjs +1 -1
  316. package/dist/esm/core/common.d.mts +6 -0
  317. package/dist/esm/core/common.mjs +1 -1
  318. package/dist/esm/core/crypto/ed25519.d.mts +77 -26
  319. package/dist/esm/core/crypto/ed25519.mjs +1 -1
  320. package/dist/esm/core/crypto/ephemeral.d.mts +36 -14
  321. package/dist/esm/core/crypto/ephemeral.mjs +1 -1
  322. package/dist/esm/core/crypto/federatedKeyless.d.mts +2 -14
  323. package/dist/esm/core/crypto/federatedKeyless.mjs +1 -1
  324. package/dist/esm/core/crypto/hdKey.d.mts +9 -6
  325. package/dist/esm/core/crypto/hdKey.mjs +1 -1
  326. package/dist/esm/core/crypto/index.d.mts +1 -1
  327. package/dist/esm/core/crypto/index.mjs +1 -1
  328. package/dist/esm/core/crypto/keyless.d.mts +126 -45
  329. package/dist/esm/core/crypto/keyless.mjs +1 -1
  330. package/dist/esm/core/crypto/multiEd25519.d.mts +45 -6
  331. package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
  332. package/dist/esm/core/crypto/multiKey.d.mts +58 -7
  333. package/dist/esm/core/crypto/multiKey.mjs +1 -1
  334. package/dist/esm/core/crypto/poseidon.d.mts +35 -5
  335. package/dist/esm/core/crypto/poseidon.mjs +1 -1
  336. package/dist/esm/core/crypto/privateKey.d.mts +10 -6
  337. package/dist/esm/core/crypto/proof.d.mts +2 -6
  338. package/dist/esm/core/crypto/proof.mjs +1 -1
  339. package/dist/esm/core/crypto/publicKey.d.mts +1 -1
  340. package/dist/esm/core/crypto/publicKey.mjs +1 -1
  341. package/dist/esm/core/crypto/secp256k1.d.mts +72 -27
  342. package/dist/esm/core/crypto/secp256k1.mjs +1 -1
  343. package/dist/esm/core/crypto/signature.d.mts +5 -4
  344. package/dist/esm/core/crypto/signature.mjs +1 -1
  345. package/dist/esm/core/crypto/singleKey.d.mts +63 -5
  346. package/dist/esm/core/crypto/singleKey.mjs +1 -1
  347. package/dist/esm/core/crypto/utils.mjs +1 -1
  348. package/dist/esm/core/hex.d.mts +27 -28
  349. package/dist/esm/core/hex.mjs +1 -1
  350. package/dist/esm/core/index.d.mts +1 -1
  351. package/dist/esm/core/index.mjs +1 -1
  352. package/dist/esm/index.d.mts +2 -2
  353. package/dist/esm/index.mjs +1 -1
  354. package/dist/esm/internal/account.d.mts +191 -12
  355. package/dist/esm/internal/account.mjs +1 -1
  356. package/dist/esm/internal/ans.d.mts +206 -14
  357. package/dist/esm/internal/ans.mjs +1 -1
  358. package/dist/esm/internal/coin.d.mts +13 -1
  359. package/dist/esm/internal/coin.mjs +1 -1
  360. package/dist/esm/internal/digitalAsset.d.mts +330 -2
  361. package/dist/esm/internal/digitalAsset.mjs +1 -1
  362. package/dist/esm/internal/event.d.mts +39 -0
  363. package/dist/esm/internal/event.mjs +1 -1
  364. package/dist/esm/internal/faucet.d.mts +14 -0
  365. package/dist/esm/internal/faucet.mjs +1 -1
  366. package/dist/esm/internal/fungibleAsset.d.mts +48 -2
  367. package/dist/esm/internal/fungibleAsset.mjs +1 -1
  368. package/dist/esm/internal/general.d.mts +46 -0
  369. package/dist/esm/internal/general.mjs +1 -1
  370. package/dist/esm/internal/keyless.d.mts +38 -2
  371. package/dist/esm/internal/keyless.mjs +1 -1
  372. package/dist/esm/internal/object.d.mts +21 -0
  373. package/dist/esm/internal/object.mjs +1 -1
  374. package/dist/esm/internal/staking.d.mts +26 -0
  375. package/dist/esm/internal/staking.mjs +1 -1
  376. package/dist/esm/internal/table.d.mts +33 -1
  377. package/dist/esm/internal/table.mjs +1 -1
  378. package/dist/esm/internal/transaction.d.mts +107 -5
  379. package/dist/esm/internal/transaction.mjs +1 -1
  380. package/dist/esm/internal/transactionSubmission.d.mts +72 -29
  381. package/dist/esm/internal/transactionSubmission.mjs +1 -1
  382. package/dist/esm/internal/view.d.mts +1 -1
  383. package/dist/esm/internal/view.mjs +1 -1
  384. package/dist/esm/publicKey-_tPa99ea.d.mts +151 -0
  385. package/dist/esm/transactions/authenticator/account.d.mts +66 -17
  386. package/dist/esm/transactions/authenticator/account.mjs +1 -1
  387. package/dist/esm/transactions/authenticator/index.d.mts +1 -1
  388. package/dist/esm/transactions/authenticator/index.mjs +1 -1
  389. package/dist/esm/transactions/authenticator/transaction.d.mts +53 -20
  390. package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
  391. package/dist/esm/transactions/index.d.mts +1 -1
  392. package/dist/esm/transactions/index.mjs +1 -1
  393. package/dist/esm/transactions/instances/chainId.d.mts +20 -1
  394. package/dist/esm/transactions/instances/chainId.mjs +1 -1
  395. package/dist/esm/transactions/instances/identifier.d.mts +21 -3
  396. package/dist/esm/transactions/instances/identifier.mjs +1 -1
  397. package/dist/esm/transactions/instances/index.d.mts +1 -1
  398. package/dist/esm/transactions/instances/index.mjs +1 -1
  399. package/dist/esm/transactions/instances/moduleId.d.mts +22 -8
  400. package/dist/esm/transactions/instances/moduleId.mjs +1 -1
  401. package/dist/esm/transactions/instances/multiAgentTransaction.d.mts +24 -8
  402. package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
  403. package/dist/esm/transactions/instances/rawTransaction.d.mts +31 -4
  404. package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
  405. package/dist/esm/transactions/instances/rotationProofChallenge.d.mts +25 -3
  406. package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
  407. package/dist/esm/transactions/instances/signedTransaction.d.mts +29 -7
  408. package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
  409. package/dist/esm/transactions/instances/simpleTransaction.d.mts +23 -8
  410. package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
  411. package/dist/esm/transactions/instances/transactionArgument.d.mts +23 -0
  412. package/dist/esm/transactions/instances/transactionPayload.d.mts +72 -26
  413. package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
  414. package/dist/esm/transactions/management/accountSequenceNumber.d.mts +37 -11
  415. package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
  416. package/dist/esm/transactions/management/asyncQueue.d.mts +22 -19
  417. package/dist/esm/transactions/management/asyncQueue.mjs +1 -1
  418. package/dist/esm/transactions/management/index.d.mts +2 -2
  419. package/dist/esm/transactions/management/index.mjs +1 -1
  420. package/dist/esm/transactions/management/transactionWorker.d.mts +67 -36
  421. package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
  422. package/dist/esm/transactions/transactionBuilder/helpers.d.mts +74 -4
  423. package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
  424. package/dist/esm/transactions/transactionBuilder/index.d.mts +1 -1
  425. package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
  426. package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +45 -23
  427. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
  428. package/dist/esm/transactions/transactionBuilder/signingMessage.d.mts +20 -15
  429. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
  430. package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +101 -30
  431. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
  432. package/dist/esm/transactions/typeTag/index.d.mts +244 -3
  433. package/dist/esm/transactions/typeTag/index.mjs +1 -1
  434. package/dist/esm/transactions/typeTag/parser.d.mts +31 -2
  435. package/dist/esm/transactions/typeTag/parser.mjs +1 -1
  436. package/dist/esm/transactions/types.d.mts +82 -34
  437. package/dist/esm/types/generated/queries.mjs +1 -1
  438. package/dist/esm/types/generated/types.mjs +1 -1
  439. package/dist/esm/types/index.d.mts +320 -59
  440. package/dist/esm/types/index.mjs +1 -1
  441. package/dist/esm/types/indexer.d.mts +65 -2
  442. package/dist/esm/types/keyless.d.mts +18 -0
  443. package/dist/esm/utils/apiEndpoints.d.mts +3 -0
  444. package/dist/esm/utils/apiEndpoints.mjs +1 -1
  445. package/dist/esm/utils/const.d.mts +2 -4
  446. package/dist/esm/utils/const.mjs +1 -1
  447. package/dist/esm/utils/helpers.d.mts +25 -10
  448. package/dist/esm/utils/helpers.mjs +1 -1
  449. package/dist/esm/utils/index.mjs +1 -1
  450. package/dist/esm/utils/memoize.d.mts +12 -10
  451. package/dist/esm/utils/memoize.mjs +1 -1
  452. package/dist/esm/utils/normalizeBundle.d.mts +11 -5
  453. package/dist/esm/utils/normalizeBundle.mjs +1 -1
  454. package/dist/esm/version.d.mts +1 -1
  455. package/dist/esm/version.mjs +1 -1
  456. package/package.json +23 -22
  457. package/src/account/AbstractKeylessAccount.ts +7 -5
  458. package/src/account/Account.ts +88 -54
  459. package/src/account/Ed25519Account.ts +56 -21
  460. package/src/account/EphemeralKeyPair.ts +50 -15
  461. package/src/account/FederatedKeylessAccount.ts +4 -3
  462. package/src/account/KeylessAccount.ts +46 -3
  463. package/src/account/MultiKeyAccount.ts +56 -35
  464. package/src/account/SingleKeyAccount.ts +60 -28
  465. package/src/api/account.ts +443 -159
  466. package/src/api/ans.ts +367 -120
  467. package/src/api/aptos.ts +38 -5
  468. package/src/api/aptosConfig.ts +102 -14
  469. package/src/api/coin.ts +49 -12
  470. package/src/api/digitalAsset.ts +707 -296
  471. package/src/api/event.ts +128 -25
  472. package/src/api/faucet.ts +44 -7
  473. package/src/api/fungibleAsset.ts +149 -46
  474. package/src/api/general.ts +168 -52
  475. package/src/api/keyless.ts +117 -21
  476. package/src/api/object.ts +49 -5
  477. package/src/api/staking.ts +84 -15
  478. package/src/api/table.ts +117 -37
  479. package/src/api/transaction.ts +438 -107
  480. package/src/api/transactionSubmission/build.ts +98 -12
  481. package/src/api/transactionSubmission/helpers.ts +79 -0
  482. package/src/api/transactionSubmission/management.ts +110 -10
  483. package/src/api/transactionSubmission/sign.ts +96 -2
  484. package/src/api/transactionSubmission/simulate.ts +139 -14
  485. package/src/api/transactionSubmission/submit.ts +103 -12
  486. package/src/api/utils.ts +26 -3
  487. package/src/bcs/deserializer.ts +82 -32
  488. package/src/bcs/serializable/entryFunctionBytes.ts +27 -6
  489. package/src/bcs/serializable/fixedBytes.ts +55 -25
  490. package/src/bcs/serializable/movePrimitives.ts +91 -0
  491. package/src/bcs/serializable/moveStructs.ts +123 -35
  492. package/src/bcs/serializer.ts +131 -84
  493. package/src/cli/localNode.ts +46 -17
  494. package/src/cli/move.ts +119 -136
  495. package/src/client/core.ts +23 -8
  496. package/src/client/get.ts +34 -6
  497. package/src/client/post.ts +63 -6
  498. package/src/client/types.ts +40 -13
  499. package/src/core/account/utils/address.ts +1 -1
  500. package/src/core/accountAddress.ts +63 -50
  501. package/src/core/authenticationKey.ts +47 -20
  502. package/src/core/common.ts +6 -0
  503. package/src/core/crypto/ed25519.ts +76 -25
  504. package/src/core/crypto/ephemeral.ts +37 -21
  505. package/src/core/crypto/federatedKeyless.ts +1 -20
  506. package/src/core/crypto/hdKey.ts +10 -7
  507. package/src/core/crypto/keyless.ts +140 -63
  508. package/src/core/crypto/multiEd25519.ts +44 -5
  509. package/src/core/crypto/multiKey.ts +66 -19
  510. package/src/core/crypto/poseidon.ts +72 -5
  511. package/src/core/crypto/privateKey.ts +9 -5
  512. package/src/core/crypto/proof.ts +3 -12
  513. package/src/core/crypto/publicKey.ts +15 -5
  514. package/src/core/crypto/secp256k1.ts +76 -26
  515. package/src/core/crypto/signature.ts +7 -4
  516. package/src/core/crypto/singleKey.ts +62 -5
  517. package/src/core/hex.ts +27 -28
  518. package/src/internal/account.ts +248 -12
  519. package/src/internal/ans.ts +219 -15
  520. package/src/internal/coin.ts +12 -0
  521. package/src/internal/digitalAsset.ts +344 -3
  522. package/src/internal/event.ts +51 -0
  523. package/src/internal/faucet.ts +14 -0
  524. package/src/internal/fungibleAsset.ts +46 -0
  525. package/src/internal/general.ts +46 -0
  526. package/src/internal/keyless.ts +37 -1
  527. package/src/internal/object.ts +21 -0
  528. package/src/internal/queries/getTableItemsData.graphql +1 -1
  529. package/src/internal/queries/getTableItemsMetadata.graphql +1 -1
  530. package/src/internal/staking.ts +27 -1
  531. package/src/internal/table.ts +32 -0
  532. package/src/internal/transaction.ts +120 -7
  533. package/src/internal/transactionSubmission.ts +86 -30
  534. package/src/transactions/authenticator/account.ts +65 -16
  535. package/src/transactions/authenticator/transaction.ts +52 -19
  536. package/src/transactions/instances/chainId.ts +20 -1
  537. package/src/transactions/instances/identifier.ts +21 -3
  538. package/src/transactions/instances/moduleId.ts +22 -8
  539. package/src/transactions/instances/multiAgentTransaction.ts +26 -10
  540. package/src/transactions/instances/rawTransaction.ts +31 -4
  541. package/src/transactions/instances/rotationProofChallenge.ts +24 -2
  542. package/src/transactions/instances/signedTransaction.ts +28 -6
  543. package/src/transactions/instances/simpleTransaction.ts +26 -11
  544. package/src/transactions/instances/transactionArgument.ts +26 -0
  545. package/src/transactions/instances/transactionPayload.ts +73 -26
  546. package/src/transactions/management/accountSequenceNumber.ts +38 -11
  547. package/src/transactions/management/asyncQueue.ts +22 -19
  548. package/src/transactions/management/transactionWorker.ts +66 -40
  549. package/src/transactions/transactionBuilder/helpers.ts +130 -3
  550. package/src/transactions/transactionBuilder/remoteAbi.ts +71 -30
  551. package/src/transactions/transactionBuilder/signingMessage.ts +19 -14
  552. package/src/transactions/transactionBuilder/transactionBuilder.ts +166 -42
  553. package/src/transactions/typeTag/index.ts +264 -3
  554. package/src/transactions/typeTag/parser.ts +54 -20
  555. package/src/transactions/types.ts +81 -33
  556. package/src/types/index.ts +338 -61
  557. package/src/types/indexer.ts +82 -2
  558. package/src/types/keyless.ts +21 -0
  559. package/src/utils/apiEndpoints.ts +3 -0
  560. package/src/utils/const.ts +2 -4
  561. package/src/utils/helpers.ts +25 -10
  562. package/src/utils/memoize.ts +12 -10
  563. package/src/utils/normalizeBundle.ts +11 -5
  564. package/src/version.ts +1 -1
  565. package/dist/common/chunk-HBPH2AD3.js.map +0 -1
  566. package/dist/esm/Ed25519Account-B1VMJOY2.d.mts +0 -361
  567. package/dist/esm/chunk-2BTTX2KO.mjs.map +0 -1
  568. package/dist/esm/chunk-2F7Z7RMW.mjs.map +0 -1
  569. package/dist/esm/chunk-367OG3DB.mjs.map +0 -1
  570. package/dist/esm/chunk-3W2DHZXK.mjs.map +0 -1
  571. package/dist/esm/chunk-44GYWUSH.mjs.map +0 -1
  572. package/dist/esm/chunk-45IUUCAV.mjs.map +0 -1
  573. package/dist/esm/chunk-4HR32TSY.mjs.map +0 -1
  574. package/dist/esm/chunk-4TB3AWQE.mjs.map +0 -1
  575. package/dist/esm/chunk-53RB2PRH.mjs.map +0 -1
  576. package/dist/esm/chunk-5PCNWXRN.mjs.map +0 -1
  577. package/dist/esm/chunk-5VD4MHB3.mjs.map +0 -1
  578. package/dist/esm/chunk-6EMN3BOV.mjs.map +0 -1
  579. package/dist/esm/chunk-6UZ3VI5Y.mjs.map +0 -1
  580. package/dist/esm/chunk-76OH2Z4Q.mjs +0 -2
  581. package/dist/esm/chunk-76OH2Z4Q.mjs.map +0 -1
  582. package/dist/esm/chunk-7VKFXX5Q.mjs.map +0 -1
  583. package/dist/esm/chunk-A42BPAD4.mjs.map +0 -1
  584. package/dist/esm/chunk-A63SMUOU.mjs +0 -2
  585. package/dist/esm/chunk-A63SMUOU.mjs.map +0 -1
  586. package/dist/esm/chunk-ADE6MVXC.mjs.map +0 -1
  587. package/dist/esm/chunk-AH44UPM4.mjs.map +0 -1
  588. package/dist/esm/chunk-APN6AV5Q.mjs.map +0 -1
  589. package/dist/esm/chunk-B5NYEWNM.mjs +0 -2
  590. package/dist/esm/chunk-B5NYEWNM.mjs.map +0 -1
  591. package/dist/esm/chunk-BA4RBST6.mjs +0 -2
  592. package/dist/esm/chunk-BA4RBST6.mjs.map +0 -1
  593. package/dist/esm/chunk-BCUSI3N6.mjs.map +0 -1
  594. package/dist/esm/chunk-BOYYQAB4.mjs.map +0 -1
  595. package/dist/esm/chunk-BSAHPS6E.mjs.map +0 -1
  596. package/dist/esm/chunk-BSUYPXRD.mjs +0 -2
  597. package/dist/esm/chunk-BSUYPXRD.mjs.map +0 -1
  598. package/dist/esm/chunk-BWNTSJOC.mjs +0 -2
  599. package/dist/esm/chunk-BWNTSJOC.mjs.map +0 -1
  600. package/dist/esm/chunk-CB6H4VMZ.mjs +0 -2
  601. package/dist/esm/chunk-CB6H4VMZ.mjs.map +0 -1
  602. package/dist/esm/chunk-CRA2MFJC.mjs.map +0 -1
  603. package/dist/esm/chunk-D3Q4BC3I.mjs.map +0 -1
  604. package/dist/esm/chunk-E4O26ZJB.mjs +0 -2
  605. package/dist/esm/chunk-E4O26ZJB.mjs.map +0 -1
  606. package/dist/esm/chunk-ELYS7CWV.mjs.map +0 -1
  607. package/dist/esm/chunk-EXP5STXZ.mjs.map +0 -1
  608. package/dist/esm/chunk-F3M2UQA4.mjs.map +0 -1
  609. package/dist/esm/chunk-F63E4CR7.mjs +0 -2
  610. package/dist/esm/chunk-F63E4CR7.mjs.map +0 -1
  611. package/dist/esm/chunk-F76N4MQO.mjs.map +0 -1
  612. package/dist/esm/chunk-FZ5EYP3D.mjs.map +0 -1
  613. package/dist/esm/chunk-G5MGSV7Y.mjs +0 -2
  614. package/dist/esm/chunk-G5MGSV7Y.mjs.map +0 -1
  615. package/dist/esm/chunk-G5XLMQ5E.mjs +0 -2
  616. package/dist/esm/chunk-G5XLMQ5E.mjs.map +0 -1
  617. package/dist/esm/chunk-GDO6Q2FI.mjs +0 -2
  618. package/dist/esm/chunk-GDO6Q2FI.mjs.map +0 -1
  619. package/dist/esm/chunk-GDUAFXIQ.mjs.map +0 -1
  620. package/dist/esm/chunk-GMBSQDPO.mjs.map +0 -1
  621. package/dist/esm/chunk-GWSDIX6C.mjs.map +0 -1
  622. package/dist/esm/chunk-H6YNXJNF.mjs.map +0 -1
  623. package/dist/esm/chunk-HAT5S2XX.mjs +0 -2
  624. package/dist/esm/chunk-HAT5S2XX.mjs.map +0 -1
  625. package/dist/esm/chunk-HHGJXVAE.mjs +0 -2
  626. package/dist/esm/chunk-HHGJXVAE.mjs.map +0 -1
  627. package/dist/esm/chunk-HKBBA653.mjs.map +0 -1
  628. package/dist/esm/chunk-HVMFZF6P.mjs.map +0 -1
  629. package/dist/esm/chunk-IR4SLC2M.mjs.map +0 -1
  630. package/dist/esm/chunk-J64ARI4E.mjs.map +0 -1
  631. package/dist/esm/chunk-JH6VLTMS.mjs.map +0 -1
  632. package/dist/esm/chunk-KEYAPEAX.mjs.map +0 -1
  633. package/dist/esm/chunk-KUOB4DDE.mjs.map +0 -1
  634. package/dist/esm/chunk-KUZ2YTJH.mjs.map +0 -1
  635. package/dist/esm/chunk-L2QXU6F4.mjs.map +0 -1
  636. package/dist/esm/chunk-LG7RJQ57.mjs.map +0 -1
  637. package/dist/esm/chunk-LNEZEYYE.mjs +0 -2
  638. package/dist/esm/chunk-LNEZEYYE.mjs.map +0 -1
  639. package/dist/esm/chunk-LR65XHSF.mjs.map +0 -1
  640. package/dist/esm/chunk-MAMPMCO7.mjs.map +0 -1
  641. package/dist/esm/chunk-MDJ66AA3.mjs +0 -2
  642. package/dist/esm/chunk-MDJ66AA3.mjs.map +0 -1
  643. package/dist/esm/chunk-MLDQ2TY2.mjs +0 -2
  644. package/dist/esm/chunk-MLDQ2TY2.mjs.map +0 -1
  645. package/dist/esm/chunk-MNVUSJEK.mjs.map +0 -1
  646. package/dist/esm/chunk-MQGW234H.mjs +0 -2
  647. package/dist/esm/chunk-MQGW234H.mjs.map +0 -1
  648. package/dist/esm/chunk-NMD45OTM.mjs.map +0 -1
  649. package/dist/esm/chunk-NWOMSL6K.mjs.map +0 -1
  650. package/dist/esm/chunk-O2BPA6TS.mjs.map +0 -1
  651. package/dist/esm/chunk-OHRL766V.mjs.map +0 -1
  652. package/dist/esm/chunk-OKAQO57B.mjs.map +0 -1
  653. package/dist/esm/chunk-OMV7445F.mjs.map +0 -1
  654. package/dist/esm/chunk-P2EIZ7WL.mjs.map +0 -1
  655. package/dist/esm/chunk-P3TAY5PP.mjs.map +0 -1
  656. package/dist/esm/chunk-P5V7OZNN.mjs.map +0 -1
  657. package/dist/esm/chunk-Q3TAEOH5.mjs.map +0 -1
  658. package/dist/esm/chunk-Q4XR6QOZ.mjs +0 -2
  659. package/dist/esm/chunk-QBSU3L5Q.mjs.map +0 -1
  660. package/dist/esm/chunk-QPB6EJVM.mjs.map +0 -1
  661. package/dist/esm/chunk-R76DHMGR.mjs.map +0 -1
  662. package/dist/esm/chunk-RXE6NNOL.mjs.map +0 -1
  663. package/dist/esm/chunk-S2KDCIZN.mjs.map +0 -1
  664. package/dist/esm/chunk-S2W4D6NZ.mjs.map +0 -1
  665. package/dist/esm/chunk-SDWE6WMM.mjs.map +0 -1
  666. package/dist/esm/chunk-SRPI2FFA.mjs.map +0 -1
  667. package/dist/esm/chunk-STUXKQVZ.mjs +0 -2
  668. package/dist/esm/chunk-STUXKQVZ.mjs.map +0 -1
  669. package/dist/esm/chunk-SUJLWCRN.mjs +0 -2
  670. package/dist/esm/chunk-SUJLWCRN.mjs.map +0 -1
  671. package/dist/esm/chunk-SWNFKKRE.mjs.map +0 -1
  672. package/dist/esm/chunk-TDGQGILY.mjs.map +0 -1
  673. package/dist/esm/chunk-TQWGQLM6.mjs.map +0 -1
  674. package/dist/esm/chunk-U6Z4FNB7.mjs.map +0 -1
  675. package/dist/esm/chunk-UAEODDZS.mjs +0 -2
  676. package/dist/esm/chunk-UAL27G6B.mjs.map +0 -1
  677. package/dist/esm/chunk-WJRZWAIS.mjs.map +0 -1
  678. package/dist/esm/chunk-WRRQ7L5K.mjs.map +0 -1
  679. package/dist/esm/chunk-X34JJPW5.mjs.map +0 -1
  680. package/dist/esm/chunk-XMW65WCQ.mjs +0 -2
  681. package/dist/esm/chunk-XMW65WCQ.mjs.map +0 -1
  682. package/dist/esm/chunk-Y2GWUE7C.mjs.map +0 -1
  683. package/dist/esm/chunk-Y3BATGHX.mjs +0 -2
  684. package/dist/esm/chunk-Y3BATGHX.mjs.map +0 -1
  685. package/dist/esm/chunk-YDZBU2DJ.mjs.map +0 -1
  686. package/dist/esm/chunk-YPHH6CAO.mjs +0 -2
  687. package/dist/esm/chunk-YPHH6CAO.mjs.map +0 -1
  688. package/dist/esm/chunk-YU3IYJRL.mjs.map +0 -1
  689. package/dist/esm/chunk-YUNDX5I7.mjs.map +0 -1
  690. package/dist/esm/publicKey-B3XRNhHO.d.mts +0 -113
  691. /package/dist/esm/{chunk-FVA2OPG4.mjs.map → chunk-KDMSOCZY.mjs.map} +0 -0
  692. /package/dist/esm/{chunk-Q4XR6QOZ.mjs.map → chunk-KIW54KWR.mjs.map} +0 -0
  693. /package/dist/esm/{chunk-ZROQH5YL.mjs.map → chunk-KSUZS6EL.mjs.map} +0 -0
@@ -13,16 +13,18 @@ import {
13
13
  import { Hex } from "../core/hex";
14
14
  import { AnyNumber, Uint16, Uint32, Uint8 } from "../types";
15
15
 
16
- // This class is intended to be used as a base class for all serializable types.
17
- // It can be used to facilitate composable serialization of a complex type and
18
- // in general to serialize a type to its BCS representation.
16
+ /**
17
+ * This class serves as a base class for all serializable types. It facilitates
18
+ * composable serialization of complex types and enables the serialization of
19
+ * instances to their BCS (Binary Canonical Serialization) representation.
20
+ */
19
21
  export abstract class Serializable {
20
22
  abstract serialize(serializer: Serializer): void;
21
23
 
22
24
  /**
23
25
  * Serializes a `Serializable` value to its BCS representation.
24
- * This function is the Typescript SDK equivalent of `bcs::to_bytes` in Move.
25
- * @returns the BCS representation of the Serializable instance as a byte buffer
26
+ * This function is the TypeScript SDK equivalent of `bcs::to_bytes` in Move.
27
+ * @returns the BCS representation of the Serializable instance as a byte buffer.
26
28
  */
27
29
  bcsToBytes(): Uint8Array {
28
30
  const serializer = new Serializer();
@@ -31,22 +33,49 @@ export abstract class Serializable {
31
33
  }
32
34
 
33
35
  /**
34
- * Helper function to get a value's BCS-serialized bytes as a Hex instance.
35
- * @returns a Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array
36
+ * Converts the BCS-serialized bytes of a value into a Hex instance.
37
+ * This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
38
+ * @returns A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
36
39
  */
37
40
  bcsToHex(): Hex {
38
41
  const bcsBytes = this.bcsToBytes();
39
42
  return Hex.fromHexInput(bcsBytes);
40
43
  }
44
+
45
+ /**
46
+ * Returns the hex string representation of the `Serializable` value without the 0x prefix.
47
+ * @returns the hex format as a string without `0x` prefix.
48
+ */
49
+ toStringWithoutPrefix(): string {
50
+ return this.bcsToHex().toStringWithoutPrefix();
51
+ }
52
+
53
+ /**
54
+ * Returns the hex string representation of the `Serializable` value with the 0x prefix.
55
+ * @returns the hex formatas a string prefixed by `0x`.
56
+ */
57
+ toString(): string {
58
+ return `0x${this.toStringWithoutPrefix()}`;
59
+ }
41
60
  }
42
61
 
62
+ /**
63
+ * A class for serializing various data types into a binary format.
64
+ * It provides methods to serialize strings, bytes, numbers, and other serializable objects
65
+ * using the Binary Coded Serialization (BCS) layout. The serialized data can be retrieved as a
66
+ * Uint8Array.
67
+ */
43
68
  export class Serializer {
44
69
  private buffer: ArrayBuffer;
45
70
 
46
71
  private offset: number;
47
72
 
48
- // Constructs a serializer with a buffer of size `length` bytes, 64 bytes by default.
49
- // `length` must be greater than 0.
73
+ /**
74
+ * Constructs a serializer with a buffer of size `length` bytes, 64 bytes by default.
75
+ * The `length` must be greater than 0.
76
+ *
77
+ * @param length - The size of the buffer in bytes.
78
+ */
50
79
  constructor(length: number = 64) {
51
80
  if (length <= 0) {
52
81
  throw new Error("Length needs to be greater than 0");
@@ -55,6 +84,12 @@ export class Serializer {
55
84
  this.offset = 0;
56
85
  }
57
86
 
87
+ /**
88
+ * Ensures that the internal buffer can accommodate the specified number of bytes.
89
+ * This function dynamically resizes the buffer if the current size is insufficient.
90
+ *
91
+ * @param bytes - The number of bytes to ensure the buffer can handle.
92
+ */
58
93
  private ensureBufferWillHandleSize(bytes: number) {
59
94
  while (this.buffer.byteLength < this.offset + bytes) {
60
95
  const newBuffer = new ArrayBuffer(this.buffer.byteLength * 2);
@@ -63,12 +98,26 @@ export class Serializer {
63
98
  }
64
99
  }
65
100
 
101
+ /**
102
+ * Appends the specified values to the buffer, ensuring that the buffer can accommodate the new data.
103
+ *
104
+ * @param {Uint8Array} values - The values to be appended to the buffer.
105
+ */
66
106
  protected appendToBuffer(values: Uint8Array) {
67
107
  this.ensureBufferWillHandleSize(values.length);
68
108
  new Uint8Array(this.buffer, this.offset).set(values);
69
109
  this.offset += values.length;
70
110
  }
71
111
 
112
+ /**
113
+ * Serializes a value into the buffer using the provided function, ensuring the buffer can accommodate the size.
114
+ *
115
+ * @param fn - The function to serialize the value, which takes a byte offset, the value to serialize, and an optional little-endian flag.
116
+ * @param fn.byteOffset - The byte offset at which to write the value.
117
+ * @param fn.value - The numeric value to serialize into the buffer.
118
+ * @param fn.littleEndian - Optional flag indicating whether to use little-endian byte order (defaults to true).
119
+ */
120
+ // TODO: JSDoc bytesLength and value
72
121
  private serializeWithFunction(
73
122
  fn: (byteOffset: number, value: number, littleEndian?: boolean) => void,
74
123
  bytesLength: number,
@@ -82,15 +131,16 @@ export class Serializer {
82
131
 
83
132
  /**
84
133
  * Serializes a string. UTF8 string is supported.
85
- *
86
134
  * The number of bytes in the string content is serialized first, as a uleb128-encoded u32 integer.
87
135
  * Then the string content is serialized as UTF8 encoded bytes.
88
136
  *
89
137
  * BCS layout for "string": string_length | string_content
90
138
  * where string_length is a u32 integer encoded as a uleb128 integer, equal to the number of bytes in string_content.
91
139
  *
140
+ * @param value - The string to serialize.
141
+ *
92
142
  * @example
93
- * ```ts
143
+ * ```typescript
94
144
  * const serializer = new Serializer();
95
145
  * serializer.serializeStr("1234abcd");
96
146
  * assert(serializer.toUint8Array() === new Uint8Array([8, 49, 50, 51, 52, 97, 98, 99, 100]));
@@ -104,8 +154,10 @@ export class Serializer {
104
154
  /**
105
155
  * Serializes an array of bytes.
106
156
  *
157
+ * This function encodes the length of the byte array as a u32 integer in uleb128 format, followed by the byte array itself.
107
158
  * BCS layout for "bytes": bytes_length | bytes
108
159
  * where bytes_length is a u32 integer encoded as a uleb128 integer, equal to the length of the bytes array.
160
+ * @param value - The byte array to serialize.
109
161
  */
110
162
  serializeBytes(value: Uint8Array) {
111
163
  this.serializeU32AsUleb128(value.length);
@@ -113,30 +165,41 @@ export class Serializer {
113
165
  }
114
166
 
115
167
  /**
116
- * Serializes an array of bytes with known length. Therefore, length doesn't need to be
117
- * serialized to help deserialization.
118
- *
168
+ * Serializes an array of bytes with a known length, allowing for efficient deserialization without needing to serialize the
169
+ * length itself.
119
170
  * When deserializing, the number of bytes to deserialize needs to be passed in.
171
+
172
+ * @param value - The Uint8Array to be serialized.
120
173
  */
121
174
  serializeFixedBytes(value: Uint8Array) {
122
175
  this.appendToBuffer(value);
123
176
  }
124
177
 
125
178
  /**
126
- * Serializes a boolean value.
179
+ * Serializes a boolean value into a byte representation.
180
+ *
181
+ * The BCS layout for a boolean uses one byte, where "0x01" represents true and "0x00" represents false.
127
182
  *
128
- * BCS layout for "boolean": One byte. "0x01" for true and "0x00" for false.
183
+ * @param value - The boolean value to serialize.
129
184
  */
130
185
  serializeBool(value: boolean) {
186
+ /**
187
+ * Ensures that the provided value is a boolean.
188
+ * This function throws an error if the value is not a boolean, helping to enforce type safety in your code.
189
+ *
190
+ * @param value - The value to be checked for boolean type.
191
+ * @throws {Error} Throws an error if the value is not a boolean.
192
+ */
131
193
  ensureBoolean(value);
132
194
  const byteValue = value ? 1 : 0;
133
195
  this.appendToBuffer(new Uint8Array([byteValue]));
134
196
  }
135
197
 
136
198
  /**
137
- * Serializes a uint8 number.
138
- *
199
+ * Serializes a Uint8 value and appends it to the buffer.
139
200
  * BCS layout for "uint8": One byte. Binary format in little-endian representation.
201
+ *
202
+ * @param value - The Uint8 value to serialize.
140
203
  */
141
204
  @checkNumberRange(0, MAX_U8_NUMBER)
142
205
  serializeU8(value: Uint8) {
@@ -146,9 +209,16 @@ export class Serializer {
146
209
  /**
147
210
  * Serializes a uint16 number.
148
211
  *
212
+
213
+ */
214
+
215
+ /**
216
+ * Serializes a 16-bit unsigned integer value into a binary format.
149
217
  * BCS layout for "uint16": Two bytes. Binary format in little-endian representation.
218
+ *
219
+ * @param value - The 16-bit unsigned integer value to serialize.
150
220
  * @example
151
- * ```ts
221
+ * ```typescript
152
222
  * const serializer = new Serializer();
153
223
  * serializer.serializeU16(4660);
154
224
  * assert(serializer.toUint8Array() === new Uint8Array([0x34, 0x12]));
@@ -160,15 +230,15 @@ export class Serializer {
160
230
  }
161
231
 
162
232
  /**
163
- * Serializes a uint32 number.
164
- *
165
- * BCS layout for "uint32": Four bytes. Binary format in little-endian representation.
233
+ * Serializes a 32-bit unsigned integer value into a binary format.
234
+ * This function is useful for encoding data that needs to be stored or transmitted in a compact form.
166
235
  * @example
167
- * ```ts
236
+ * ```typescript
168
237
  * const serializer = new Serializer();
169
238
  * serializer.serializeU32(305419896);
170
239
  * assert(serializer.toUint8Array() === new Uint8Array([0x78, 0x56, 0x34, 0x12]));
171
240
  * ```
241
+ * @param value - The 32-bit unsigned integer value to serialize.
172
242
  */
173
243
  @checkNumberRange(0, MAX_U32_NUMBER)
174
244
  serializeU32(value: Uint32) {
@@ -176,9 +246,10 @@ export class Serializer {
176
246
  }
177
247
 
178
248
  /**
179
- * Serializes a uint64 number.
249
+ * Serializes a 64-bit unsigned integer into a format suitable for storage or transmission.
250
+ * This function breaks down the value into two 32-bit components and writes them in little-endian order.
180
251
  *
181
- * BCS layout for "uint64": Eight bytes. Binary format in little-endian representation.
252
+ * @param value - The 64-bit unsigned integer to serialize, represented as a number.
182
253
  * @example
183
254
  * ```ts
184
255
  * const serializer = new Serializer();
@@ -197,9 +268,9 @@ export class Serializer {
197
268
  }
198
269
 
199
270
  /**
200
- * Serializes a uint128 number.
271
+ * Serializes a U128 value into a format suitable for storage or transmission.
201
272
  *
202
- * BCS layout for "uint128": Sixteen bytes. Binary format in little-endian representation.
273
+ * @param value - The U128 value to serialize, represented as a number.
203
274
  */
204
275
  @checkNumberRange(BigInt(0), MAX_U128_BIG_INT)
205
276
  serializeU128(value: AnyNumber) {
@@ -212,9 +283,10 @@ export class Serializer {
212
283
  }
213
284
 
214
285
  /**
215
- * Serializes a uint256 number.
286
+ * Serializes a U256 value into a byte representation.
287
+ * This function is essential for encoding large numbers in a compact format suitable for transmission or storage.
216
288
  *
217
- * BCS layout for "uint256": Sixteen bytes. Binary format in little-endian representation.
289
+ * @param value - The U256 value to serialize, represented as an AnyNumber.
218
290
  */
219
291
  @checkNumberRange(BigInt(0), MAX_U256_BIG_INT)
220
292
  serializeU256(value: AnyNumber) {
@@ -227,9 +299,10 @@ export class Serializer {
227
299
  }
228
300
 
229
301
  /**
230
- * Serializes a uint32 number with uleb128.
231
- *
302
+ * Serializes a 32-bit unsigned integer as a variable-length ULEB128 encoded byte array.
232
303
  * BCS uses uleb128 encoding in two cases: (1) lengths of variable-length sequences and (2) tags of enum values
304
+ *
305
+ * @param val - The 32-bit unsigned integer value to be serialized.
233
306
  */
234
307
  @checkNumberRange(0, MAX_U32_NUMBER)
235
308
  serializeU32AsUleb128(val: Uint32) {
@@ -244,7 +317,11 @@ export class Serializer {
244
317
  }
245
318
 
246
319
  /**
247
- * Returns the buffered bytes
320
+ * Returns the buffered bytes as a Uint8Array.
321
+ *
322
+ * This function allows you to retrieve the byte representation of the buffer up to the current offset.
323
+ *
324
+ * @returns Uint8Array - The byte array representation of the buffer.
248
325
  */
249
326
  toUint8Array(): Uint8Array {
250
327
  return new Uint8Array(this.buffer).slice(0, this.offset);
@@ -253,35 +330,7 @@ export class Serializer {
253
330
  /**
254
331
  * Serializes a `Serializable` value, facilitating composable serialization.
255
332
  *
256
- * @param value The Serializable value to serialize
257
- *
258
- * @example
259
- * // Define the MoveStruct class that implements the Serializable interface
260
- * class MoveStruct extends Serializable {
261
- * constructor(
262
- * public creatorAddress: AccountAddress, // where AccountAddress extends Serializable
263
- * public collectionName: string,
264
- * public tokenName: string
265
- * ) {}
266
- *
267
- * serialize(serializer: Serializer): void {
268
- * serializer.serialize(this.creatorAddress); // Composable serialization of another Serializable object
269
- * serializer.serializeStr(this.collectionName);
270
- * serializer.serializeStr(this.tokenName);
271
- * }
272
- * }
273
- *
274
- * // Construct a MoveStruct
275
- * const moveStruct = new MoveStruct(new AccountAddress(...), "MyCollection", "TokenA");
276
- *
277
- * // Serialize a string, a u64 number, and a MoveStruct instance.
278
- * const serializer = new Serializer();
279
- * serializer.serializeStr("ExampleString");
280
- * serializer.serializeU64(12345678);
281
- * serializer.serialize(moveStruct);
282
- *
283
- * // Get the bytes from the Serializer instance
284
- * const serializedBytes = serializer.toUint8Array();
333
+ * @param value The Serializable value to serialize.
285
334
  *
286
335
  * @returns the serializer instance
287
336
  */
@@ -293,7 +342,7 @@ export class Serializer {
293
342
 
294
343
  /**
295
344
  * Serializes an array of BCS Serializable values to a serializer instance.
296
- * Note that this does not return anything. The bytes are added to the serializer instance's byte buffer.
345
+ * The bytes are added to the serializer instance's byte buffer.
297
346
  *
298
347
  * @param values The array of BCS Serializable values
299
348
  * @example
@@ -318,13 +367,13 @@ export class Serializer {
318
367
  }
319
368
 
320
369
  /**
321
- * Serializes a BCS Serializable values into a serializer instance or undefined.
322
- * Note that this does not return anything. The bytes are added to the serializer instance's byte buffer.
370
+ * Serializes a BCS Serializable value into a serializer instance or handles the case when the value is undefined.
371
+ * This function allows you to efficiently add serialized data to the serializer's byte buffer.
323
372
  *
324
- * @param values The array of BCS Serializable values
373
+ * @param value The BCS Serializable value to serialize, or undefined if there is no value.
325
374
  *
326
375
  * @example
327
- * ```ts
376
+ * ```typescript
328
377
  * const serializer = new Serializer();
329
378
  * serializer.serializeOption(new AccountAddress(...));
330
379
  * const serializedBytes = serializer.toUint8Array();
@@ -344,26 +393,14 @@ export class Serializer {
344
393
  }
345
394
 
346
395
  /**
347
- * Serializes an optional string. UTF8 string is supported.
348
- *
349
- * The existence of the string is encoded first, 0 if undefined and 1 if it exists.
350
- * Them the number of bytes in the string content is serialized, as a uleb128-encoded u32 integer.
351
- * Then the string content is serialized as UTF8 encoded bytes.
396
+ * Serializes an optional string, supporting UTF8 encoding.
397
+ * The function encodes the existence of the string first, followed by the length and content if it exists.
352
398
  *
353
399
  * BCS layout for optional "string": 1 | string_length | string_content
354
400
  * where string_length is a u32 integer encoded as a uleb128 integer, equal to the number of bytes in string_content.
355
- *
356
401
  * BCS layout for undefined: 0
357
- * @example
358
- * ```ts
359
- * const serializer = new Serializer();
360
- * serializer.serializeOptionStr("1234abcd");
361
- * assert(serializer.toUint8Array() === new Uint8Array([1, 8, 49, 50, 51, 52, 97, 98, 99, 100]));
362
402
  *
363
- * const serializer = new Serializer();
364
- * serializer.serializeOptionStr(undefined);
365
- * assert(serializer.toUint8Array() === new Uint8Array([0]));
366
- * ```
403
+ * @param value - The optional string to serialize. If undefined, it will serialize as 0.
367
404
  */
368
405
  serializeOptionStr(value?: string): void {
369
406
  if (value === undefined) {
@@ -384,6 +421,14 @@ export function ensureBoolean(value: unknown): asserts value is boolean {
384
421
  export const outOfRangeErrorMessage = (value: AnyNumber, min: AnyNumber, max: AnyNumber) =>
385
422
  `${value} is out of range: [${min}, ${max}]`;
386
423
 
424
+ /**
425
+ * Validates that a given number is within a specified range.
426
+ * This function throws an error if the value is outside the defined minimum and maximum bounds.
427
+ *
428
+ * @param value - The number to validate.
429
+ * @param minValue - The minimum allowable value (inclusive).
430
+ * @param maxValue - The maximum allowable value (inclusive).
431
+ */
387
432
  export function validateNumberInRange<T extends AnyNumber>(value: T, minValue: T, maxValue: T) {
388
433
  const valueBigInt = BigInt(value);
389
434
  if (valueBigInt > BigInt(maxValue) || valueBigInt < BigInt(minValue)) {
@@ -392,9 +437,11 @@ export function validateNumberInRange<T extends AnyNumber>(value: T, minValue: T
392
437
  }
393
438
 
394
439
  /**
395
- * A decorator to ensure the input argument for a function is within a range.
396
- * @param minValue The input argument must be >= minValue
397
- * @param maxValue The input argument must be <= maxValue
440
+ * A decorator that validates that the input argument for a function is within a specified range.
441
+ * This ensures that the function is only called with valid input values, preventing potential errors.
442
+ *
443
+ * @param minValue - The input argument must be greater than or equal to this value.
444
+ * @param maxValue - The input argument must be less than or equal to this value.
398
445
  */
399
446
  function checkNumberRange<T extends AnyNumber>(minValue: T, maxValue: T) {
400
447
  return (target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => {
@@ -1,23 +1,47 @@
1
+ /* eslint-disable no-console */
2
+
1
3
  import { ChildProcessWithoutNullStreams, spawn } from "child_process";
2
4
  import kill from "tree-kill";
3
5
  import { platform } from "os";
4
6
 
5
7
  import { sleep } from "../utils/helpers";
6
8
 
9
+ /**
10
+ * Represents a local node for running a testnet environment.
11
+ * This class provides methods to start, stop, and check the status of the local testnet process.
12
+ * It manages the lifecycle of the node process and ensures that it is operational before executing tests.
13
+ */
7
14
  export class LocalNode {
8
15
  readonly MAXIMUM_WAIT_TIME_SEC = 75;
9
16
 
10
17
  readonly READINESS_ENDPOINT = "http://127.0.0.1:8070/";
11
18
 
19
+ showStdout: boolean = true;
20
+
12
21
  process: ChildProcessWithoutNullStreams | null = null;
13
22
 
23
+ constructor(args?: { showStdout?: boolean }) {
24
+ this.showStdout = args?.showStdout ?? true;
25
+ }
26
+
14
27
  /**
15
- * kills all the descendent processes
16
- * of the node process, including the node process itself
28
+ * Kills the current process and all its descendant processes.
29
+ *
30
+ * @returns {Promise<void>} A promise that resolves to true if the process was successfully killed.
31
+ * @throws {Error} If there is an error while attempting to kill the process.
17
32
  */
18
- async stop() {
33
+ async stop(): Promise<void> {
19
34
  await new Promise((resolve, reject) => {
20
35
  if (!this.process?.pid) return;
36
+
37
+ /**
38
+ * Terminates the process associated with the given process ID.
39
+ *
40
+ * @param pid - The process ID of the process to be terminated.
41
+ * @param callback - A function that is called after the termination attempt is complete.
42
+ * @param callback.err - An error object if the termination failed; otherwise, null.
43
+ * @param callback.resolve - A boolean indicating whether the termination was successful.
44
+ */
21
45
  kill(this.process.pid, (err) => {
22
46
  if (err) {
23
47
  reject(err);
@@ -29,12 +53,12 @@ export class LocalNode {
29
53
  }
30
54
 
31
55
  /**
32
- * Runs a local testnet and waits for process to be up.
56
+ * Runs a local testnet and waits for the process to be up.
57
+ * If the local node process is already running, it returns without starting the process.
33
58
  *
34
- * If local node process is already up it returns and does
35
- * not start the process
59
+ * @returns {Promise<void>} A promise that resolves when the process is up.
36
60
  */
37
- async run() {
61
+ async run(): Promise<void> {
38
62
  const nodeIsUp = await this.checkIfProcessIsUp();
39
63
  if (nodeIsUp) {
40
64
  return;
@@ -44,9 +68,13 @@ export class LocalNode {
44
68
  }
45
69
 
46
70
  /**
47
- * Starts the local testnet by running the aptos node run-local-testnet command
71
+ * Starts the local testnet by running the Aptos node with the specified command-line arguments.
72
+ *
73
+ * @returns {void}
74
+ *
75
+ * @throws {Error} If there is an issue starting the local testnet.
48
76
  */
49
- start() {
77
+ start(): void {
50
78
  const cliCommand = "npx";
51
79
  const cliArgs = ["aptos", "node", "run-localnet", "--force-restart", "--assume-yes", "--with-indexer-api"];
52
80
 
@@ -63,23 +91,24 @@ export class LocalNode {
63
91
 
64
92
  childProcess.stderr?.on("data", (data: any) => {
65
93
  const str = data.toString();
66
- // Print local node output log
67
- // eslint-disable-next-line no-console
94
+ // Print local node output error log
68
95
  console.log(str);
69
96
  });
70
97
 
71
98
  childProcess.stdout?.on("data", (data: any) => {
72
99
  const str = data.toString();
73
100
  // Print local node output log
74
- // eslint-disable-next-line no-console
75
- console.log(str);
101
+ if (this.showStdout) {
102
+ console.log(str);
103
+ }
76
104
  });
77
105
  }
78
106
 
79
107
  /**
80
- * Waits for the local testnet process to be up
108
+ * Waits for the local testnet process to be operational within a specified maximum wait time.
109
+ * This function continuously checks if the process is up and will throw an error if it fails to start.
81
110
  *
82
- * @returns Promise<boolean>
111
+ * @returns Promise<boolean> - Resolves to true if the process is up, otherwise throws an error.
83
112
  */
84
113
  async waitUntilProcessIsUp(): Promise<boolean> {
85
114
  let operational = await this.checkIfProcessIsUp();
@@ -104,9 +133,9 @@ export class LocalNode {
104
133
  }
105
134
 
106
135
  /**
107
- * Checks if the local testnet is up
136
+ * Checks if the local testnet is up by querying the readiness endpoint.
108
137
  *
109
- * @returns Promise<boolean>
138
+ * @returns Promise<boolean> - A promise that resolves to true if the testnet is up, otherwise false.
110
139
  */
111
140
  async checkIfProcessIsUp(): Promise<boolean> {
112
141
  try {