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

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 (399) hide show
  1. package/dist/common/{accountAddress-6RqI8Aam.d.ts → accountAddress-fJZJVSBc.d.ts} +2 -1
  2. package/dist/common/chunk-F43XVDYJ.js.map +1 -1
  3. package/dist/common/cli/index.d.ts +10 -1
  4. package/dist/common/cli/index.js +1 -1
  5. package/dist/common/cli/index.js.map +1 -1
  6. package/dist/common/index.d.ts +127 -14
  7. package/dist/common/index.js +31 -31
  8. package/dist/common/index.js.map +1 -1
  9. package/dist/esm/account/AbstractKeylessAccount.d.mts +1 -0
  10. package/dist/esm/account/AbstractKeylessAccount.mjs +1 -1
  11. package/dist/esm/account/Account.d.mts +1 -0
  12. package/dist/esm/account/Account.mjs +1 -1
  13. package/dist/esm/account/Ed25519Account.d.mts +1 -0
  14. package/dist/esm/account/Ed25519Account.mjs +1 -1
  15. package/dist/esm/account/EphemeralKeyPair.d.mts +1 -0
  16. package/dist/esm/account/EphemeralKeyPair.mjs +1 -1
  17. package/dist/esm/account/FederatedKeylessAccount.d.mts +1 -0
  18. package/dist/esm/account/FederatedKeylessAccount.mjs +1 -1
  19. package/dist/esm/account/KeylessAccount.d.mts +1 -0
  20. package/dist/esm/account/KeylessAccount.mjs +1 -1
  21. package/dist/esm/account/MultiKeyAccount.d.mts +1 -0
  22. package/dist/esm/account/MultiKeyAccount.mjs +1 -1
  23. package/dist/esm/account/SingleKeyAccount.d.mts +1 -0
  24. package/dist/esm/account/SingleKeyAccount.mjs +1 -1
  25. package/dist/esm/account/index.d.mts +1 -0
  26. package/dist/esm/account/index.mjs +1 -1
  27. package/dist/esm/api/account.d.mts +1 -0
  28. package/dist/esm/api/account.mjs +1 -1
  29. package/dist/esm/api/ans.d.mts +1 -0
  30. package/dist/esm/api/ans.mjs +1 -1
  31. package/dist/esm/api/aptos.d.mts +2 -0
  32. package/dist/esm/api/aptos.mjs +1 -1
  33. package/dist/esm/api/aptosConfig.d.mts +1 -0
  34. package/dist/esm/api/coin.d.mts +1 -0
  35. package/dist/esm/api/coin.mjs +1 -1
  36. package/dist/esm/api/digitalAsset.d.mts +1 -0
  37. package/dist/esm/api/digitalAsset.mjs +1 -1
  38. package/dist/esm/api/event.d.mts +1 -0
  39. package/dist/esm/api/event.mjs +1 -1
  40. package/dist/esm/api/faucet.d.mts +1 -0
  41. package/dist/esm/api/faucet.mjs +1 -1
  42. package/dist/esm/api/fungibleAsset.d.mts +1 -0
  43. package/dist/esm/api/fungibleAsset.mjs +1 -1
  44. package/dist/esm/api/general.d.mts +1 -0
  45. package/dist/esm/api/general.mjs +1 -1
  46. package/dist/esm/api/index.d.mts +2 -0
  47. package/dist/esm/api/index.mjs +1 -1
  48. package/dist/esm/api/keyless.d.mts +1 -0
  49. package/dist/esm/api/keyless.mjs +1 -1
  50. package/dist/esm/api/object.d.mts +1 -0
  51. package/dist/esm/api/object.mjs +1 -1
  52. package/dist/esm/api/staking.d.mts +1 -0
  53. package/dist/esm/api/staking.mjs +1 -1
  54. package/dist/esm/api/table.d.mts +1 -0
  55. package/dist/esm/api/table.mjs +1 -1
  56. package/dist/esm/api/transaction.d.mts +2 -0
  57. package/dist/esm/api/transaction.mjs +1 -1
  58. package/dist/esm/api/transactionSubmission/build.d.mts +66 -0
  59. package/dist/esm/api/transactionSubmission/build.mjs +1 -1
  60. package/dist/esm/api/transactionSubmission/helpers.mjs +1 -1
  61. package/dist/esm/api/transactionSubmission/management.d.mts +1 -0
  62. package/dist/esm/api/transactionSubmission/management.mjs +1 -1
  63. package/dist/esm/api/transactionSubmission/sign.d.mts +1 -0
  64. package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
  65. package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -1
  66. package/dist/esm/api/transactionSubmission/simulate.d.mts +10 -8
  67. package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
  68. package/dist/esm/api/transactionSubmission/submit.d.mts +1 -0
  69. package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
  70. package/dist/esm/api/utils.d.mts +1 -0
  71. package/dist/esm/api/utils.mjs +1 -1
  72. package/dist/esm/bcs/consts.d.mts +1 -0
  73. package/dist/esm/bcs/deserializer.d.mts +1 -0
  74. package/dist/esm/bcs/index.d.mts +1 -0
  75. package/dist/esm/bcs/index.mjs +1 -1
  76. package/dist/esm/bcs/serializable/entryFunctionBytes.d.mts +1 -0
  77. package/dist/esm/bcs/serializable/fixedBytes.d.mts +1 -0
  78. package/dist/esm/bcs/serializable/movePrimitives.d.mts +1 -0
  79. package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
  80. package/dist/esm/bcs/serializable/moveStructs.d.mts +1 -0
  81. package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
  82. package/dist/esm/bcs/serializer.d.mts +1 -0
  83. package/dist/esm/{chunk-RC43EXC4.mjs → chunk-2CKUTG67.mjs} +2 -2
  84. package/dist/esm/{chunk-UKVH4UGL.mjs → chunk-2E3EAJPC.mjs} +2 -2
  85. package/dist/esm/{chunk-KCEI5JYS.mjs → chunk-2G7SAWM3.mjs} +2 -2
  86. package/dist/esm/chunk-2WLKSKL7.mjs +2 -0
  87. package/dist/esm/chunk-2WLKSKL7.mjs.map +1 -0
  88. package/dist/esm/{chunk-O4MRRWRI.mjs → chunk-362NFXZR.mjs} +2 -2
  89. package/dist/esm/{chunk-ML7D2CVG.mjs → chunk-3BWKODVZ.mjs} +2 -2
  90. package/dist/esm/chunk-3OLFJ65O.mjs +2 -0
  91. package/dist/esm/chunk-3OLFJ65O.mjs.map +1 -0
  92. package/dist/esm/{chunk-ETF76XA3.mjs → chunk-3QIOEU3Z.mjs} +2 -2
  93. package/dist/esm/{chunk-SY4HK6CC.mjs → chunk-3QUZFCNW.mjs} +2 -2
  94. package/dist/esm/chunk-3QUZFCNW.mjs.map +1 -0
  95. package/dist/esm/{chunk-H7AALSJ7.mjs → chunk-3TOPGQJA.mjs} +2 -2
  96. package/dist/esm/{chunk-AGEJNSEX.mjs → chunk-4JX6OQEE.mjs} +2 -2
  97. package/dist/esm/{chunk-MBEWPBGN.mjs → chunk-4ZNSNWQL.mjs} +2 -2
  98. package/dist/esm/{chunk-EJKX6MGV.mjs → chunk-554TWPPO.mjs} +2 -2
  99. package/dist/esm/{chunk-KM6IOJ6Y.mjs → chunk-5XLZACVT.mjs} +2 -2
  100. package/dist/esm/{chunk-NF7ZQQE3.mjs → chunk-6EVBSHT2.mjs} +2 -2
  101. package/dist/esm/{chunk-JONEH52T.mjs → chunk-6YFM6NEC.mjs} +2 -2
  102. package/dist/esm/{chunk-TGW36YOD.mjs → chunk-77ILVREP.mjs} +2 -2
  103. package/dist/esm/{chunk-4IQZOAN7.mjs → chunk-7BKLEHKL.mjs} +2 -2
  104. package/dist/esm/{chunk-FFCCBAEZ.mjs → chunk-7CDITZUS.mjs} +2 -2
  105. package/dist/esm/{chunk-JIT2FYGE.mjs → chunk-7R44XXPU.mjs} +2 -2
  106. package/dist/esm/chunk-A7KFSQSE.mjs +2 -0
  107. package/dist/esm/chunk-A7KFSQSE.mjs.map +1 -0
  108. package/dist/esm/{chunk-HBWIDPNN.mjs → chunk-AOQJI6IC.mjs} +2 -2
  109. package/dist/esm/{chunk-U3GE6IPF.mjs → chunk-AR6BOLET.mjs} +2 -2
  110. package/dist/esm/{chunk-TQA6HY6A.mjs → chunk-B2OF42B3.mjs} +2 -2
  111. package/dist/esm/{chunk-4J2JYRV3.mjs → chunk-B6ERS4UX.mjs} +2 -2
  112. package/dist/esm/{chunk-YP3VO6GM.mjs → chunk-BKSQPS2O.mjs} +2 -2
  113. package/dist/esm/{chunk-JGLEKXFP.mjs → chunk-BVUMR7DQ.mjs} +2 -2
  114. package/dist/esm/{chunk-LHBMBCFC.mjs → chunk-BZ7OCXLM.mjs} +2 -2
  115. package/dist/esm/{chunk-HPZQGMSH.mjs → chunk-CK5NDXQT.mjs} +2 -2
  116. package/dist/esm/{chunk-BP45UJII.mjs → chunk-CW6P2DDJ.mjs} +2 -2
  117. package/dist/esm/{chunk-KX43GEAB.mjs → chunk-D6WMUQB5.mjs} +2 -2
  118. package/dist/esm/{chunk-2REHS35S.mjs → chunk-DBAISV4K.mjs} +2 -2
  119. package/dist/esm/chunk-EPBNJZ4A.mjs +2 -0
  120. package/dist/esm/chunk-EPBNJZ4A.mjs.map +1 -0
  121. package/dist/esm/{chunk-7OHMMGS6.mjs → chunk-EVA2SMAU.mjs} +2 -2
  122. package/dist/esm/{chunk-P2FTRAK3.mjs → chunk-EVASO3UR.mjs} +2 -2
  123. package/dist/esm/{chunk-5O3RHPER.mjs → chunk-FFBC7GFN.mjs} +2 -2
  124. package/dist/esm/chunk-FZDEGDUY.mjs +2 -0
  125. package/dist/esm/{chunk-AITN3DO4.mjs.map → chunk-FZDEGDUY.mjs.map} +1 -1
  126. package/dist/esm/{chunk-OVI7L7OG.mjs → chunk-H6RW3TML.mjs} +2 -2
  127. package/dist/esm/{chunk-FYYTCJS4.mjs → chunk-HXCL6KBW.mjs} +2 -2
  128. package/dist/esm/chunk-IHGA5KAD.mjs +2 -0
  129. package/dist/esm/{chunk-I2NMCLNW.mjs.map → chunk-IHGA5KAD.mjs.map} +1 -1
  130. package/dist/esm/{chunk-RLH25IDA.mjs → chunk-IIV42FZR.mjs} +2 -2
  131. package/dist/esm/{chunk-RSO5YIDW.mjs → chunk-IKJAX5KQ.mjs} +2 -2
  132. package/dist/esm/{chunk-UWLW2VLZ.mjs → chunk-IZ3I5XZU.mjs} +2 -2
  133. package/dist/esm/{chunk-5KCKWL2C.mjs → chunk-J2NQJ34O.mjs} +2 -2
  134. package/dist/esm/chunk-J45GIVXE.mjs +2 -0
  135. package/dist/esm/chunk-J45GIVXE.mjs.map +1 -0
  136. package/dist/esm/{chunk-LYO22HMF.mjs → chunk-JJXLJY37.mjs} +2 -2
  137. package/dist/esm/{chunk-CPKG25HX.mjs → chunk-LRN4ALMT.mjs} +2 -2
  138. package/dist/esm/{chunk-ERDYU5YQ.mjs → chunk-MKM5MDD5.mjs} +2 -2
  139. package/dist/esm/{chunk-GZBVXXUL.mjs → chunk-NNWPYX3K.mjs} +2 -2
  140. package/dist/esm/{chunk-A3USS2NC.mjs → chunk-OZK26LTY.mjs} +2 -2
  141. package/dist/esm/{chunk-SPX2YFZN.mjs → chunk-P6RNNESB.mjs} +2 -2
  142. package/dist/esm/chunk-PC4HNMCP.mjs +2 -0
  143. package/dist/esm/chunk-PC4HNMCP.mjs.map +1 -0
  144. package/dist/esm/{chunk-VGITSRT6.mjs → chunk-PMA7XAFK.mjs} +2 -2
  145. package/dist/esm/{chunk-WYOFF5DJ.mjs → chunk-QCIRC2SG.mjs} +2 -2
  146. package/dist/esm/{chunk-CEW2NI3K.mjs → chunk-S22QVNK7.mjs} +2 -2
  147. package/dist/esm/{chunk-K62JTXWQ.mjs → chunk-SHAKBL2R.mjs} +2 -2
  148. package/dist/esm/{chunk-X7JNNNMC.mjs → chunk-SOLRIYPW.mjs} +2 -2
  149. package/dist/esm/{chunk-IQ4SCMB6.mjs → chunk-T7BTSSX7.mjs} +2 -2
  150. package/dist/esm/{chunk-IUSAYAEI.mjs → chunk-TE3SBS7J.mjs} +2 -2
  151. package/dist/esm/chunk-U2PRGW4O.mjs +2 -0
  152. package/dist/esm/chunk-U2PRGW4O.mjs.map +1 -0
  153. package/dist/esm/{chunk-L25CRR2W.mjs → chunk-U7UTBXJD.mjs} +2 -2
  154. package/dist/esm/chunk-UIRAXHDH.mjs +1 -0
  155. package/dist/esm/{chunk-2LQ4FTSR.mjs → chunk-UQIMOQZ7.mjs} +2 -2
  156. package/dist/esm/{chunk-I5GENJBA.mjs → chunk-UTOO6IVJ.mjs} +2 -2
  157. package/dist/esm/{chunk-D54FD6XE.mjs → chunk-WIDWY7A2.mjs} +2 -2
  158. package/dist/esm/{chunk-E2GPZCQI.mjs → chunk-WJSZAGHP.mjs} +2 -2
  159. package/dist/esm/{chunk-II26BNYA.mjs → chunk-XEW2YQE2.mjs} +2 -2
  160. package/dist/esm/chunk-XEW2YQE2.mjs.map +1 -0
  161. package/dist/esm/chunk-YQHOQJRQ.mjs +2 -0
  162. package/dist/esm/{chunk-RZGTHCJY.mjs.map → chunk-YQHOQJRQ.mjs.map} +1 -1
  163. package/dist/esm/{chunk-LGHPJTF3.mjs → chunk-YT3IP57B.mjs} +2 -2
  164. package/dist/esm/cli/index.d.mts +1 -0
  165. package/dist/esm/cli/index.mjs +1 -1
  166. package/dist/esm/cli/move.d.mts +10 -0
  167. package/dist/esm/cli/move.mjs +1 -1
  168. package/dist/esm/client/core.d.mts +1 -0
  169. package/dist/esm/client/core.mjs +1 -1
  170. package/dist/esm/client/get.d.mts +1 -0
  171. package/dist/esm/client/get.mjs +1 -1
  172. package/dist/esm/client/index.d.mts +1 -0
  173. package/dist/esm/client/index.mjs +1 -1
  174. package/dist/esm/client/post.d.mts +1 -0
  175. package/dist/esm/client/post.mjs +1 -1
  176. package/dist/esm/core/account/index.d.mts +1 -0
  177. package/dist/esm/core/account/index.mjs +1 -1
  178. package/dist/esm/core/account/utils/address.d.mts +1 -0
  179. package/dist/esm/core/account/utils/address.mjs +1 -1
  180. package/dist/esm/core/account/utils/index.d.mts +1 -0
  181. package/dist/esm/core/account/utils/index.mjs +1 -1
  182. package/dist/esm/core/accountAddress.d.mts +1 -0
  183. package/dist/esm/core/accountAddress.mjs +1 -1
  184. package/dist/esm/core/authenticationKey.d.mts +1 -0
  185. package/dist/esm/core/authenticationKey.mjs +1 -1
  186. package/dist/esm/core/crypto/ed25519.d.mts +1 -0
  187. package/dist/esm/core/crypto/ed25519.mjs +1 -1
  188. package/dist/esm/core/crypto/ephemeral.d.mts +1 -0
  189. package/dist/esm/core/crypto/ephemeral.mjs +1 -1
  190. package/dist/esm/core/crypto/federatedKeyless.d.mts +1 -0
  191. package/dist/esm/core/crypto/federatedKeyless.mjs +1 -1
  192. package/dist/esm/core/crypto/index.d.mts +1 -0
  193. package/dist/esm/core/crypto/index.mjs +1 -1
  194. package/dist/esm/core/crypto/keyless.d.mts +1 -0
  195. package/dist/esm/core/crypto/keyless.mjs +1 -1
  196. package/dist/esm/core/crypto/multiEd25519.d.mts +1 -0
  197. package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
  198. package/dist/esm/core/crypto/multiKey.d.mts +1 -0
  199. package/dist/esm/core/crypto/multiKey.mjs +1 -1
  200. package/dist/esm/core/crypto/privateKey.d.mts +1 -0
  201. package/dist/esm/core/crypto/privateKey.mjs +1 -1
  202. package/dist/esm/core/crypto/proof.d.mts +1 -0
  203. package/dist/esm/core/crypto/proof.mjs +1 -1
  204. package/dist/esm/core/crypto/publicKey.d.mts +1 -0
  205. package/dist/esm/core/crypto/publicKey.mjs +1 -1
  206. package/dist/esm/core/crypto/secp256k1.d.mts +1 -0
  207. package/dist/esm/core/crypto/secp256k1.mjs +1 -1
  208. package/dist/esm/core/crypto/signature.d.mts +1 -0
  209. package/dist/esm/core/crypto/signature.mjs +1 -1
  210. package/dist/esm/core/crypto/singleKey.d.mts +1 -0
  211. package/dist/esm/core/crypto/singleKey.mjs +1 -1
  212. package/dist/esm/core/crypto/utils.d.mts +1 -0
  213. package/dist/esm/core/hex.d.mts +1 -0
  214. package/dist/esm/core/index.d.mts +1 -0
  215. package/dist/esm/core/index.mjs +1 -1
  216. package/dist/esm/errors/index.d.mts +1 -0
  217. package/dist/esm/index.d.mts +5 -3
  218. package/dist/esm/index.mjs +1 -1
  219. package/dist/esm/internal/account.d.mts +1 -0
  220. package/dist/esm/internal/account.mjs +1 -1
  221. package/dist/esm/internal/ans.d.mts +1 -0
  222. package/dist/esm/internal/ans.mjs +1 -1
  223. package/dist/esm/internal/coin.d.mts +1 -0
  224. package/dist/esm/internal/coin.mjs +1 -1
  225. package/dist/esm/internal/digitalAsset.d.mts +1 -0
  226. package/dist/esm/internal/digitalAsset.mjs +1 -1
  227. package/dist/esm/internal/event.d.mts +1 -0
  228. package/dist/esm/internal/event.mjs +1 -1
  229. package/dist/esm/internal/faucet.d.mts +1 -0
  230. package/dist/esm/internal/faucet.mjs +1 -1
  231. package/dist/esm/internal/fungibleAsset.d.mts +1 -0
  232. package/dist/esm/internal/fungibleAsset.mjs +1 -1
  233. package/dist/esm/internal/general.d.mts +1 -0
  234. package/dist/esm/internal/general.mjs +1 -1
  235. package/dist/esm/internal/keyless.d.mts +1 -0
  236. package/dist/esm/internal/keyless.mjs +1 -1
  237. package/dist/esm/internal/object.d.mts +1 -0
  238. package/dist/esm/internal/object.mjs +1 -1
  239. package/dist/esm/internal/staking.d.mts +1 -0
  240. package/dist/esm/internal/staking.mjs +1 -1
  241. package/dist/esm/internal/table.d.mts +1 -0
  242. package/dist/esm/internal/table.mjs +1 -1
  243. package/dist/esm/internal/transaction.d.mts +1 -0
  244. package/dist/esm/internal/transaction.mjs +1 -1
  245. package/dist/esm/internal/transactionSubmission.d.mts +2 -1
  246. package/dist/esm/internal/transactionSubmission.mjs +1 -1
  247. package/dist/esm/internal/view.d.mts +1 -0
  248. package/dist/esm/internal/view.mjs +1 -1
  249. package/dist/esm/transactions/authenticator/account.d.mts +11 -1
  250. package/dist/esm/transactions/authenticator/account.mjs +1 -1
  251. package/dist/esm/transactions/authenticator/index.d.mts +2 -1
  252. package/dist/esm/transactions/authenticator/index.mjs +1 -1
  253. package/dist/esm/transactions/authenticator/transaction.d.mts +1 -0
  254. package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
  255. package/dist/esm/transactions/index.d.mts +5 -3
  256. package/dist/esm/transactions/index.mjs +1 -1
  257. package/dist/esm/transactions/instances/chainId.d.mts +1 -0
  258. package/dist/esm/transactions/instances/identifier.d.mts +1 -0
  259. package/dist/esm/transactions/instances/index.d.mts +1 -0
  260. package/dist/esm/transactions/instances/index.mjs +1 -1
  261. package/dist/esm/transactions/instances/moduleId.d.mts +1 -0
  262. package/dist/esm/transactions/instances/moduleId.mjs +1 -1
  263. package/dist/esm/transactions/instances/multiAgentTransaction.d.mts +1 -0
  264. package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
  265. package/dist/esm/transactions/instances/rawTransaction.d.mts +1 -0
  266. package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
  267. package/dist/esm/transactions/instances/rotationProofChallenge.d.mts +1 -0
  268. package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
  269. package/dist/esm/transactions/instances/signedTransaction.d.mts +1 -0
  270. package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
  271. package/dist/esm/transactions/instances/simpleTransaction.d.mts +1 -0
  272. package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
  273. package/dist/esm/transactions/instances/transactionArgument.d.mts +1 -0
  274. package/dist/esm/transactions/instances/transactionPayload.d.mts +1 -0
  275. package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
  276. package/dist/esm/transactions/management/accountSequenceNumber.d.mts +1 -0
  277. package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
  278. package/dist/esm/transactions/management/index.d.mts +1 -0
  279. package/dist/esm/transactions/management/index.mjs +1 -1
  280. package/dist/esm/transactions/management/transactionWorker.d.mts +1 -0
  281. package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
  282. package/dist/esm/transactions/script-composer/index.d.mts +44 -0
  283. package/dist/esm/transactions/script-composer/index.mjs +2 -0
  284. package/dist/esm/transactions/transactionBuilder/helpers.d.mts +1 -0
  285. package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
  286. package/dist/esm/transactions/transactionBuilder/index.d.mts +2 -1
  287. package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
  288. package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +23 -2
  289. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
  290. package/dist/esm/transactions/transactionBuilder/signingMessage.d.mts +1 -0
  291. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
  292. package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +3 -2
  293. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
  294. package/dist/esm/transactions/typeTag/index.d.mts +1 -0
  295. package/dist/esm/transactions/typeTag/index.mjs +1 -1
  296. package/dist/esm/transactions/typeTag/parser.d.mts +1 -0
  297. package/dist/esm/transactions/typeTag/parser.mjs +1 -1
  298. package/dist/esm/transactions/types.d.mts +13 -3
  299. package/dist/esm/types/index.d.mts +1 -0
  300. package/dist/esm/types/index.mjs +1 -1
  301. package/dist/esm/types/types.d.mts +3 -1
  302. package/dist/esm/types/types.mjs +1 -1
  303. package/dist/esm/utils/helpers.d.mts +1 -0
  304. package/dist/esm/utils/index.d.mts +1 -0
  305. package/dist/esm/utils/index.mjs +1 -1
  306. package/dist/esm/utils/normalizeBundle.d.mts +1 -0
  307. package/dist/esm/utils/normalizeBundle.mjs +1 -1
  308. package/dist/esm/version.d.mts +1 -1
  309. package/dist/esm/version.mjs +1 -1
  310. package/package.json +2 -1
  311. package/src/api/transactionSubmission/build.ts +82 -1
  312. package/src/api/transactionSubmission/helpers.ts +0 -6
  313. package/src/api/transactionSubmission/simulate.ts +9 -8
  314. package/src/cli/move.ts +16 -0
  315. package/src/internal/transactionSubmission.ts +1 -1
  316. package/src/transactions/authenticator/account.ts +19 -0
  317. package/src/transactions/index.ts +1 -0
  318. package/src/transactions/script-composer/index.ts +76 -0
  319. package/src/transactions/transactionBuilder/remoteAbi.ts +55 -1
  320. package/src/transactions/transactionBuilder/transactionBuilder.ts +25 -17
  321. package/src/transactions/types.ts +14 -2
  322. package/src/types/index.ts +1 -0
  323. package/src/types/types.ts +1 -0
  324. package/src/version.ts +1 -1
  325. package/dist/esm/chunk-26WX3UFP.mjs +0 -2
  326. package/dist/esm/chunk-26WX3UFP.mjs.map +0 -1
  327. package/dist/esm/chunk-AITN3DO4.mjs +0 -2
  328. package/dist/esm/chunk-DYELAVMR.mjs +0 -2
  329. package/dist/esm/chunk-DYELAVMR.mjs.map +0 -1
  330. package/dist/esm/chunk-FD6FGKYY.mjs +0 -1
  331. package/dist/esm/chunk-I2NMCLNW.mjs +0 -2
  332. package/dist/esm/chunk-I5OYNCZS.mjs +0 -1
  333. package/dist/esm/chunk-II26BNYA.mjs.map +0 -1
  334. package/dist/esm/chunk-KTM6KVUJ.mjs +0 -2
  335. package/dist/esm/chunk-KTM6KVUJ.mjs.map +0 -1
  336. package/dist/esm/chunk-RZGTHCJY.mjs +0 -2
  337. package/dist/esm/chunk-SY4HK6CC.mjs.map +0 -1
  338. package/dist/esm/chunk-WQF3IOXC.mjs +0 -2
  339. package/dist/esm/chunk-WQF3IOXC.mjs.map +0 -1
  340. package/dist/esm/chunk-XIB6LX22.mjs +0 -2
  341. package/dist/esm/chunk-XIB6LX22.mjs.map +0 -1
  342. /package/dist/esm/{chunk-RC43EXC4.mjs.map → chunk-2CKUTG67.mjs.map} +0 -0
  343. /package/dist/esm/{chunk-UKVH4UGL.mjs.map → chunk-2E3EAJPC.mjs.map} +0 -0
  344. /package/dist/esm/{chunk-KCEI5JYS.mjs.map → chunk-2G7SAWM3.mjs.map} +0 -0
  345. /package/dist/esm/{chunk-O4MRRWRI.mjs.map → chunk-362NFXZR.mjs.map} +0 -0
  346. /package/dist/esm/{chunk-ML7D2CVG.mjs.map → chunk-3BWKODVZ.mjs.map} +0 -0
  347. /package/dist/esm/{chunk-ETF76XA3.mjs.map → chunk-3QIOEU3Z.mjs.map} +0 -0
  348. /package/dist/esm/{chunk-H7AALSJ7.mjs.map → chunk-3TOPGQJA.mjs.map} +0 -0
  349. /package/dist/esm/{chunk-AGEJNSEX.mjs.map → chunk-4JX6OQEE.mjs.map} +0 -0
  350. /package/dist/esm/{chunk-MBEWPBGN.mjs.map → chunk-4ZNSNWQL.mjs.map} +0 -0
  351. /package/dist/esm/{chunk-EJKX6MGV.mjs.map → chunk-554TWPPO.mjs.map} +0 -0
  352. /package/dist/esm/{chunk-KM6IOJ6Y.mjs.map → chunk-5XLZACVT.mjs.map} +0 -0
  353. /package/dist/esm/{chunk-NF7ZQQE3.mjs.map → chunk-6EVBSHT2.mjs.map} +0 -0
  354. /package/dist/esm/{chunk-JONEH52T.mjs.map → chunk-6YFM6NEC.mjs.map} +0 -0
  355. /package/dist/esm/{chunk-TGW36YOD.mjs.map → chunk-77ILVREP.mjs.map} +0 -0
  356. /package/dist/esm/{chunk-4IQZOAN7.mjs.map → chunk-7BKLEHKL.mjs.map} +0 -0
  357. /package/dist/esm/{chunk-FFCCBAEZ.mjs.map → chunk-7CDITZUS.mjs.map} +0 -0
  358. /package/dist/esm/{chunk-JIT2FYGE.mjs.map → chunk-7R44XXPU.mjs.map} +0 -0
  359. /package/dist/esm/{chunk-HBWIDPNN.mjs.map → chunk-AOQJI6IC.mjs.map} +0 -0
  360. /package/dist/esm/{chunk-U3GE6IPF.mjs.map → chunk-AR6BOLET.mjs.map} +0 -0
  361. /package/dist/esm/{chunk-TQA6HY6A.mjs.map → chunk-B2OF42B3.mjs.map} +0 -0
  362. /package/dist/esm/{chunk-4J2JYRV3.mjs.map → chunk-B6ERS4UX.mjs.map} +0 -0
  363. /package/dist/esm/{chunk-YP3VO6GM.mjs.map → chunk-BKSQPS2O.mjs.map} +0 -0
  364. /package/dist/esm/{chunk-JGLEKXFP.mjs.map → chunk-BVUMR7DQ.mjs.map} +0 -0
  365. /package/dist/esm/{chunk-LHBMBCFC.mjs.map → chunk-BZ7OCXLM.mjs.map} +0 -0
  366. /package/dist/esm/{chunk-HPZQGMSH.mjs.map → chunk-CK5NDXQT.mjs.map} +0 -0
  367. /package/dist/esm/{chunk-BP45UJII.mjs.map → chunk-CW6P2DDJ.mjs.map} +0 -0
  368. /package/dist/esm/{chunk-KX43GEAB.mjs.map → chunk-D6WMUQB5.mjs.map} +0 -0
  369. /package/dist/esm/{chunk-2REHS35S.mjs.map → chunk-DBAISV4K.mjs.map} +0 -0
  370. /package/dist/esm/{chunk-7OHMMGS6.mjs.map → chunk-EVA2SMAU.mjs.map} +0 -0
  371. /package/dist/esm/{chunk-P2FTRAK3.mjs.map → chunk-EVASO3UR.mjs.map} +0 -0
  372. /package/dist/esm/{chunk-5O3RHPER.mjs.map → chunk-FFBC7GFN.mjs.map} +0 -0
  373. /package/dist/esm/{chunk-OVI7L7OG.mjs.map → chunk-H6RW3TML.mjs.map} +0 -0
  374. /package/dist/esm/{chunk-FYYTCJS4.mjs.map → chunk-HXCL6KBW.mjs.map} +0 -0
  375. /package/dist/esm/{chunk-RLH25IDA.mjs.map → chunk-IIV42FZR.mjs.map} +0 -0
  376. /package/dist/esm/{chunk-RSO5YIDW.mjs.map → chunk-IKJAX5KQ.mjs.map} +0 -0
  377. /package/dist/esm/{chunk-UWLW2VLZ.mjs.map → chunk-IZ3I5XZU.mjs.map} +0 -0
  378. /package/dist/esm/{chunk-5KCKWL2C.mjs.map → chunk-J2NQJ34O.mjs.map} +0 -0
  379. /package/dist/esm/{chunk-LYO22HMF.mjs.map → chunk-JJXLJY37.mjs.map} +0 -0
  380. /package/dist/esm/{chunk-CPKG25HX.mjs.map → chunk-LRN4ALMT.mjs.map} +0 -0
  381. /package/dist/esm/{chunk-ERDYU5YQ.mjs.map → chunk-MKM5MDD5.mjs.map} +0 -0
  382. /package/dist/esm/{chunk-GZBVXXUL.mjs.map → chunk-NNWPYX3K.mjs.map} +0 -0
  383. /package/dist/esm/{chunk-A3USS2NC.mjs.map → chunk-OZK26LTY.mjs.map} +0 -0
  384. /package/dist/esm/{chunk-SPX2YFZN.mjs.map → chunk-P6RNNESB.mjs.map} +0 -0
  385. /package/dist/esm/{chunk-VGITSRT6.mjs.map → chunk-PMA7XAFK.mjs.map} +0 -0
  386. /package/dist/esm/{chunk-WYOFF5DJ.mjs.map → chunk-QCIRC2SG.mjs.map} +0 -0
  387. /package/dist/esm/{chunk-CEW2NI3K.mjs.map → chunk-S22QVNK7.mjs.map} +0 -0
  388. /package/dist/esm/{chunk-K62JTXWQ.mjs.map → chunk-SHAKBL2R.mjs.map} +0 -0
  389. /package/dist/esm/{chunk-X7JNNNMC.mjs.map → chunk-SOLRIYPW.mjs.map} +0 -0
  390. /package/dist/esm/{chunk-IQ4SCMB6.mjs.map → chunk-T7BTSSX7.mjs.map} +0 -0
  391. /package/dist/esm/{chunk-IUSAYAEI.mjs.map → chunk-TE3SBS7J.mjs.map} +0 -0
  392. /package/dist/esm/{chunk-L25CRR2W.mjs.map → chunk-U7UTBXJD.mjs.map} +0 -0
  393. /package/dist/esm/{chunk-FD6FGKYY.mjs.map → chunk-UIRAXHDH.mjs.map} +0 -0
  394. /package/dist/esm/{chunk-2LQ4FTSR.mjs.map → chunk-UQIMOQZ7.mjs.map} +0 -0
  395. /package/dist/esm/{chunk-I5GENJBA.mjs.map → chunk-UTOO6IVJ.mjs.map} +0 -0
  396. /package/dist/esm/{chunk-D54FD6XE.mjs.map → chunk-WIDWY7A2.mjs.map} +0 -0
  397. /package/dist/esm/{chunk-E2GPZCQI.mjs.map → chunk-WJSZAGHP.mjs.map} +0 -0
  398. /package/dist/esm/{chunk-LGHPJTF3.mjs.map → chunk-YT3IP57B.mjs.map} +0 -0
  399. /package/dist/esm/{chunk-I5OYNCZS.mjs.map → transactions/script-composer/index.mjs.map} +0 -0
@@ -648,7 +648,8 @@ declare enum AccountAuthenticatorVariant {
648
648
  Ed25519 = 0,
649
649
  MultiEd25519 = 1,
650
650
  SingleKey = 2,
651
- MultiKey = 3
651
+ MultiKey = 3,
652
+ NoAccountAuthenticator = 4
652
653
  }
653
654
  /**
654
655
  * Variants of private keys that can comply with the AIP-80 standard.
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/philip/Documents/General/aptos-ts-sdk/dist/common/chunk-F43XVDYJ.js","../../src/utils/helpers.ts"],"names":["sleep","timeMs","resolve","getErrorMessage","error","nowInSeconds","floorToWholeHour","timestampInSeconds","date","base64UrlDecode","base64Url","base64","paddedBase64","decode","convertAmountFromHumanReadableToOnChain","value","decimal","convertAmountFromOnChainToHumanReadable","hexToAscii","hex","str","n","parseEncodedStruct","structObj","account_address","module_name","struct_name","moduleName","structName"],"mappings":"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","file":"/Users/philip/Documents/General/aptos-ts-sdk/dist/common/chunk-F43XVDYJ.js","sourcesContent":[null,"// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { decode } from \"js-base64\";\nimport { MoveStructId } from \"../types\";\n\n/**\n * Sleep for the specified amount of time in milliseconds.\n * This function can be used to introduce delays in asynchronous operations.\n *\n * @param timeMs - The time in milliseconds to sleep.\n */\nexport async function sleep(timeMs: number): Promise<null> {\n return new Promise((resolve) => {\n setTimeout(resolve, timeMs);\n });\n}\n\n/**\n * Get the error message from an unknown error.\n *\n * @param error The error to get the message from\n * @returns The error message\n */\nexport function getErrorMessage(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n\nexport const nowInSeconds = () => Math.floor(Date.now() / 1000);\n\n/**\n * Floors the given timestamp to the nearest whole hour.\n * This function is useful for normalizing timestamps to hourly intervals.\n *\n * @param timestampInSeconds - The timestamp in seconds to be floored.\n */\nexport function floorToWholeHour(timestampInSeconds: number): number {\n const date = new Date(timestampInSeconds * 1000);\n // Reset minutes and seconds to zero\n date.setMinutes(0);\n date.setSeconds(0);\n date.setMilliseconds(0);\n return Math.floor(date.getTime() / 1000);\n}\n\n/**\n * Decodes a base64 URL-encoded string into its original form.\n * This function is useful for converting base64 URL-encoded data back to a readable format.\n *\n * @param base64Url - The base64 URL-encoded string to decode.\n * @returns The decoded string.\n */\nexport function base64UrlDecode(base64Url: string): string {\n // Replace base64url-specific characters\n const base64 = base64Url.replace(/-/g, \"+\").replace(/_/g, \"/\");\n // Pad the string with '=' characters if needed\n const paddedBase64 = base64 + \"==\".substring(0, (3 - (base64.length % 3)) % 3);\n const decodedString = decode(paddedBase64);\n return decodedString;\n}\n\n/**\n * Amount is represented in the smallest unit format on chain, this function converts\n * a human-readable amount format to the smallest unit format\n * @example\n * human-readable amount format: 500\n * on chain amount format when decimal is 8: 50000000000\n *\n * @param value The value in human-readable format\n * @param decimal The token decimal\n * @returns The value in the smallest units\n */\nexport const convertAmountFromHumanReadableToOnChain = (value: number, decimal: number) => value * 10 ** decimal;\n\n/**\n * Amount is represented in the smallest unit format on chain, this function converts\n * the smallest unit format to a human-readable amount format\n * @example\n * human-readable amount format: 500\n * on chain amount format when decimal is 8: 50000000000\n *\n * @param value The value in human-readable format\n * @param decimal The token decimal\n * @returns The value in the smallest units\n */\nexport const convertAmountFromOnChainToHumanReadable = (value: number, decimal: number) => value / 10 ** decimal;\n\n/**\n * Convert a hex string to an ascii string with the `0x` prefix.\n *\n * `0x6170746f735f636f696e` --> `aptos_coin`\n *\n * @param hex The hex string to convert (e.g. `0x6170746f735f636f696e`)\n * @returns The ascii string\n */\nconst hexToAscii = (hex: string) => {\n let str = \"\";\n for (let n = 2; n < hex.length; n += 2) {\n str += String.fromCharCode(parseInt(hex.substring(n, n + 2), 16));\n }\n return str;\n};\n\n/**\n * Convert an encoded struct to a MoveStructId.\n *\n * @example\n * const structObj = {\n * account_address: \"0x1\",\n * module_name: \"0x6170746f735f636f696e\",\n * struct_name: \"0x4170746f73436f696e\",\n * };\n * // structId is \"0x1::aptos_coin::AptosCoin\"\n * const structId = parseEncodedStruct(structObj);\n *\n * @param structObj The struct with account_address, module_name, and struct_name properties\n * @returns The MoveStructId\n */\nexport const parseEncodedStruct = (structObj: {\n account_address: string;\n module_name: string;\n struct_name: string;\n}): MoveStructId => {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n const { account_address, module_name, struct_name } = structObj;\n const moduleName = hexToAscii(module_name);\n const structName = hexToAscii(struct_name);\n return `${account_address}::${moduleName}::${structName}`;\n};\n\n/**\n * Determines whether the given object is an encoded struct type with the following properties:\n * - account_address: string\n * - module_name: string\n * - struct_name: string\n *\n * @param structObj The object to check\n * @returns Whether the object is an encoded struct type\n */\nexport const isEncodedStruct = (\n structObj: any,\n): structObj is {\n account_address: string;\n module_name: string;\n struct_name: string;\n} =>\n typeof structObj === \"object\" &&\n !Array.isArray(structObj) &&\n structObj !== null &&\n \"account_address\" in structObj &&\n \"module_name\" in structObj &&\n \"struct_name\" in structObj &&\n typeof structObj.account_address === \"string\" &&\n typeof structObj.module_name === \"string\" &&\n typeof structObj.struct_name === \"string\";\n"]}
1
+ {"version":3,"sources":["/Users/maayansavir/work/aptos_repos/aptos-ts-sdk/dist/common/chunk-F43XVDYJ.js","../../src/utils/helpers.ts"],"names":["sleep","timeMs","resolve","getErrorMessage","error","nowInSeconds","floorToWholeHour","timestampInSeconds","date","base64UrlDecode","base64Url","base64","paddedBase64","decode","convertAmountFromHumanReadableToOnChain","value","decimal","convertAmountFromOnChainToHumanReadable","hexToAscii","hex","str","n","parseEncodedStruct","structObj","account_address","module_name","struct_name","moduleName","structName"],"mappings":"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","file":"/Users/maayansavir/work/aptos_repos/aptos-ts-sdk/dist/common/chunk-F43XVDYJ.js","sourcesContent":[null,"// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { decode } from \"js-base64\";\nimport { MoveStructId } from \"../types\";\n\n/**\n * Sleep for the specified amount of time in milliseconds.\n * This function can be used to introduce delays in asynchronous operations.\n *\n * @param timeMs - The time in milliseconds to sleep.\n */\nexport async function sleep(timeMs: number): Promise<null> {\n return new Promise((resolve) => {\n setTimeout(resolve, timeMs);\n });\n}\n\n/**\n * Get the error message from an unknown error.\n *\n * @param error The error to get the message from\n * @returns The error message\n */\nexport function getErrorMessage(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n\nexport const nowInSeconds = () => Math.floor(Date.now() / 1000);\n\n/**\n * Floors the given timestamp to the nearest whole hour.\n * This function is useful for normalizing timestamps to hourly intervals.\n *\n * @param timestampInSeconds - The timestamp in seconds to be floored.\n */\nexport function floorToWholeHour(timestampInSeconds: number): number {\n const date = new Date(timestampInSeconds * 1000);\n // Reset minutes and seconds to zero\n date.setMinutes(0);\n date.setSeconds(0);\n date.setMilliseconds(0);\n return Math.floor(date.getTime() / 1000);\n}\n\n/**\n * Decodes a base64 URL-encoded string into its original form.\n * This function is useful for converting base64 URL-encoded data back to a readable format.\n *\n * @param base64Url - The base64 URL-encoded string to decode.\n * @returns The decoded string.\n */\nexport function base64UrlDecode(base64Url: string): string {\n // Replace base64url-specific characters\n const base64 = base64Url.replace(/-/g, \"+\").replace(/_/g, \"/\");\n // Pad the string with '=' characters if needed\n const paddedBase64 = base64 + \"==\".substring(0, (3 - (base64.length % 3)) % 3);\n const decodedString = decode(paddedBase64);\n return decodedString;\n}\n\n/**\n * Amount is represented in the smallest unit format on chain, this function converts\n * a human-readable amount format to the smallest unit format\n * @example\n * human-readable amount format: 500\n * on chain amount format when decimal is 8: 50000000000\n *\n * @param value The value in human-readable format\n * @param decimal The token decimal\n * @returns The value in the smallest units\n */\nexport const convertAmountFromHumanReadableToOnChain = (value: number, decimal: number) => value * 10 ** decimal;\n\n/**\n * Amount is represented in the smallest unit format on chain, this function converts\n * the smallest unit format to a human-readable amount format\n * @example\n * human-readable amount format: 500\n * on chain amount format when decimal is 8: 50000000000\n *\n * @param value The value in human-readable format\n * @param decimal The token decimal\n * @returns The value in the smallest units\n */\nexport const convertAmountFromOnChainToHumanReadable = (value: number, decimal: number) => value / 10 ** decimal;\n\n/**\n * Convert a hex string to an ascii string with the `0x` prefix.\n *\n * `0x6170746f735f636f696e` --> `aptos_coin`\n *\n * @param hex The hex string to convert (e.g. `0x6170746f735f636f696e`)\n * @returns The ascii string\n */\nconst hexToAscii = (hex: string) => {\n let str = \"\";\n for (let n = 2; n < hex.length; n += 2) {\n str += String.fromCharCode(parseInt(hex.substring(n, n + 2), 16));\n }\n return str;\n};\n\n/**\n * Convert an encoded struct to a MoveStructId.\n *\n * @example\n * const structObj = {\n * account_address: \"0x1\",\n * module_name: \"0x6170746f735f636f696e\",\n * struct_name: \"0x4170746f73436f696e\",\n * };\n * // structId is \"0x1::aptos_coin::AptosCoin\"\n * const structId = parseEncodedStruct(structObj);\n *\n * @param structObj The struct with account_address, module_name, and struct_name properties\n * @returns The MoveStructId\n */\nexport const parseEncodedStruct = (structObj: {\n account_address: string;\n module_name: string;\n struct_name: string;\n}): MoveStructId => {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n const { account_address, module_name, struct_name } = structObj;\n const moduleName = hexToAscii(module_name);\n const structName = hexToAscii(struct_name);\n return `${account_address}::${moduleName}::${structName}`;\n};\n\n/**\n * Determines whether the given object is an encoded struct type with the following properties:\n * - account_address: string\n * - module_name: string\n * - struct_name: string\n *\n * @param structObj The object to check\n * @returns Whether the object is an encoded struct type\n */\nexport const isEncodedStruct = (\n structObj: any,\n): structObj is {\n account_address: string;\n module_name: string;\n struct_name: string;\n} =>\n typeof structObj === \"object\" &&\n !Array.isArray(structObj) &&\n structObj !== null &&\n \"account_address\" in structObj &&\n \"module_name\" in structObj &&\n \"struct_name\" in structObj &&\n typeof structObj.account_address === \"string\" &&\n typeof structObj.module_name === \"string\" &&\n typeof structObj.struct_name === \"string\";\n"]}
@@ -1,5 +1,5 @@
1
1
  import { ChildProcessWithoutNullStreams } from 'child_process';
2
- import { N as Network, g as AccountAddress } from '../accountAddress-6RqI8Aam.js';
2
+ import { N as Network, g as AccountAddress } from '../accountAddress-fJZJVSBc.js';
3
3
 
4
4
  /**
5
5
  * Represents a local node for running a testnet environment.
@@ -228,6 +228,15 @@ declare class Move {
228
228
  }): Promise<{
229
229
  output: string;
230
230
  }>;
231
+ gasProfile(args: {
232
+ network: string;
233
+ transactionId: string;
234
+ extraArguments?: Array<string>;
235
+ showStdout?: boolean;
236
+ }): Promise<{
237
+ output: string;
238
+ result?: any;
239
+ }>;
231
240
  /**
232
241
  * Run a command with the specified arguments and return the output.
233
242
  *
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkF43XVDYJjs = require('../chunk-F43XVDYJ.js');var _child_process = require('child_process');var _treekill = require('tree-kill'); var _treekill2 = _interopRequireDefault(_treekill);var _os = require('os');var l=class{constructor(s){this.MAXIMUM_WAIT_TIME_SEC=75;this.READINESS_ENDPOINT="http://127.0.0.1:8070/";this.showStdout=!0;this.process=null;this.showStdout=_nullishCoalesce(_optionalChain([s, 'optionalAccess', _ => _.showStdout]), () => (!0))}async stop(){await new Promise((s,e)=>{_optionalChain([this, 'access', _2 => _2.process, 'optionalAccess', _3 => _3.pid])&&_treekill2.default.call(void 0, this.process.pid,r=>{r?e(r):s(!0)})})}async run(){await this.checkIfProcessIsUp()||(this.start(),await this.waitUntilProcessIsUp())}start(){let s="npx",e=["aptos","node","run-localnet","--force-restart","--assume-yes","--with-indexer-api"],r=_os.platform.call(void 0, ),o;r==="win32"?o=_child_process.spawn.call(void 0, s,e,{shell:!0}):o=_child_process.spawn.call(void 0, s,e),this.process=o,_optionalChain([o, 'access', _4 => _4.stderr, 'optionalAccess', _5 => _5.on, 'call', _6 => _6("data",a=>{let t=a.toString();console.log(t)})]),_optionalChain([o, 'access', _7 => _7.stdout, 'optionalAccess', _8 => _8.on, 'call', _9 => _9("data",a=>{let t=a.toString();this.showStdout&&console.log(t)})])}async waitUntilProcessIsUp(){let s=await this.checkIfProcessIsUp(),e=Date.now()/1e3,r=e;for(;!s&&e+this.MAXIMUM_WAIT_TIME_SEC>r;)await _chunkF43XVDYJjs.b.call(void 0, 1e3),s=await this.checkIfProcessIsUp(),r=Date.now()/1e3;if(!s)throw new Error("Process failed to start");return!0}async checkIfProcessIsUp(){try{return(await fetch(this.READINESS_ENDPOINT)).status===200}catch (e2){return!1}}};var h=class{async init(s){let{network:e,profile:r,extraArguments:o,showStdout:a}=s,t=["aptos","init",`--network=${_nullishCoalesce(e, () => ("local"))}`,`--profile=${_nullishCoalesce(r, () => ("default"))}`];return o&&t.push(...o),this.runCommand(t,a)}async compile(s){let{packageDirectoryPath:e,namedAddresses:r,extraArguments:o,showStdout:a}=s,t=["aptos","move","compile","--package-dir",e],n=this.parseNamedAddresses(r);return t.push(...this.prepareNamedAddresses(n)),o&&t.push(...o),this.runCommand(t,a)}async test(s){let{packageDirectoryPath:e,namedAddresses:r,extraArguments:o,showStdout:a}=s,t=["aptos","move","test","--package-dir",e],n=this.parseNamedAddresses(r);return t.push(...this.prepareNamedAddresses(n)),o&&t.push(...o),this.runCommand(t,a)}async publish(s){let{packageDirectoryPath:e,namedAddresses:r,profile:o,extraArguments:a,showStdout:t}=s,n=["aptos","move","publish","--package-dir",e,`--profile=${_nullishCoalesce(o, () => ("default"))}`],i=this.parseNamedAddresses(r);return n.push(...this.prepareNamedAddresses(i)),a&&n.push(...a),this.runCommand(n,t)}async createObjectAndPublishPackage(s){let{packageDirectoryPath:e,addressName:r,namedAddresses:o,profile:a,extraArguments:t,showStdout:n}=s,i=["aptos","move","create-object-and-publish-package","--package-dir",e,"--address-name",r,`--profile=${_nullishCoalesce(a, () => ("default"))}`],d=this.parseNamedAddresses(o);i.push(...this.prepareNamedAddresses(d)),t&&i.push(...t);let{output:c}=await this.runCommand(i,n);return{objectAddress:this.extractAddressFromOutput(c)}}async upgradeObjectPackage(s){let{packageDirectoryPath:e,objectAddress:r,namedAddresses:o,profile:a,extraArguments:t,showStdout:n}=s,i=["aptos","move","upgrade-object-package","--package-dir",e,"--object-address",r,`--profile=${_nullishCoalesce(a, () => ("default"))}`],d=this.parseNamedAddresses(o);return i.push(...this.prepareNamedAddresses(d)),t&&i.push(...t),this.runCommand(i,n)}async buildPublishPayload(s){let{outputFile:e,packageDirectoryPath:r,namedAddresses:o,extraArguments:a,showStdout:t}=s,n=["aptos","move","build-publish-payload","--json-output-file",e,"--package-dir",r],i=this.parseNamedAddresses(o);return n.push(...this.prepareNamedAddresses(i)),a&&n.push(...a),this.runCommand(n,t)}async runScript(s){let{compiledScriptPath:e,profile:r,extraArguments:o,showStdout:a}=s,t=["aptos","move","run-script","--compiled-script-path",e,`--profile=${_nullishCoalesce(r, () => ("default"))}`];return o&&t.push(...o),this.runCommand(t,a)}async runCommand(s,e=!0){return new Promise((r,o)=>{let a=_os.platform.call(void 0, ),t,n="",i="";a==="win32"?t=_child_process.spawn.call(void 0, "npx",s,{shell:!0}):t=_child_process.spawn.call(void 0, "npx",s),t.stdout.on("data",d=>{i=d.toString(),n+=d.toString()}),e&&(t.stdout.pipe(process.stdout),t.stderr.pipe(process.stderr)),process.stdin.pipe(t.stdin),t.on("close",d=>{if(d===0)try{let c=JSON.parse(i);c.Error?o(new Error(`Error: ${c.Error}`)):c.Result&&r({result:c.Result,output:n})}catch (e3){r({output:n})}else o(new Error(`Child process exited with code ${d}`))})})}prepareNamedAddresses(s){let e=s.size,r=[];if(e===0)return r;r.push("--named-addresses");let o=[];return s.forEach((a,t)=>{let n=`${t}=${a.toString()}`;o.push(n)}),r.push(o.join(",")),r}parseNamedAddresses(s){let e=new Map;return Object.keys(s).forEach(r=>{let o=s[r];e.set(r,o)}),e}extractAddressFromOutput(s){let e=s.match("Code was successfully deployed to object address (0x[0-9a-fA-F]+)");if(e)return e[1];throw new Error("Failed to extract object address from output")}};exports.LocalNode = l; exports.Move = h;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkF43XVDYJjs = require('../chunk-F43XVDYJ.js');var _child_process = require('child_process');var _treekill = require('tree-kill'); var _treekill2 = _interopRequireDefault(_treekill);var _os = require('os');var l=class{constructor(s){this.MAXIMUM_WAIT_TIME_SEC=75;this.READINESS_ENDPOINT="http://127.0.0.1:8070/";this.showStdout=!0;this.process=null;this.showStdout=_nullishCoalesce(_optionalChain([s, 'optionalAccess', _ => _.showStdout]), () => (!0))}async stop(){await new Promise((s,o)=>{_optionalChain([this, 'access', _2 => _2.process, 'optionalAccess', _3 => _3.pid])&&_treekill2.default.call(void 0, this.process.pid,r=>{r?o(r):s(!0)})})}async run(){await this.checkIfProcessIsUp()||(this.start(),await this.waitUntilProcessIsUp())}start(){let s="npx",o=["aptos","node","run-localnet","--force-restart","--assume-yes","--with-indexer-api"],r=_os.platform.call(void 0, ),e;r==="win32"?e=_child_process.spawn.call(void 0, s,o,{shell:!0}):e=_child_process.spawn.call(void 0, s,o),this.process=e,_optionalChain([e, 'access', _4 => _4.stderr, 'optionalAccess', _5 => _5.on, 'call', _6 => _6("data",a=>{let t=a.toString();console.log(t)})]),_optionalChain([e, 'access', _7 => _7.stdout, 'optionalAccess', _8 => _8.on, 'call', _9 => _9("data",a=>{let t=a.toString();this.showStdout&&console.log(t)})])}async waitUntilProcessIsUp(){let s=await this.checkIfProcessIsUp(),o=Date.now()/1e3,r=o;for(;!s&&o+this.MAXIMUM_WAIT_TIME_SEC>r;)await _chunkF43XVDYJjs.b.call(void 0, 1e3),s=await this.checkIfProcessIsUp(),r=Date.now()/1e3;if(!s)throw new Error("Process failed to start");return!0}async checkIfProcessIsUp(){try{return(await fetch(this.READINESS_ENDPOINT)).status===200}catch (e2){return!1}}};var h=class{async init(s){let{network:o,profile:r,extraArguments:e,showStdout:a}=s,t=["aptos","init",`--network=${_nullishCoalesce(o, () => ("local"))}`,`--profile=${_nullishCoalesce(r, () => ("default"))}`];return e&&t.push(...e),this.runCommand(t,a)}async compile(s){let{packageDirectoryPath:o,namedAddresses:r,extraArguments:e,showStdout:a}=s,t=["aptos","move","compile","--package-dir",o],n=this.parseNamedAddresses(r);return t.push(...this.prepareNamedAddresses(n)),e&&t.push(...e),this.runCommand(t,a)}async test(s){let{packageDirectoryPath:o,namedAddresses:r,extraArguments:e,showStdout:a}=s,t=["aptos","move","test","--package-dir",o],n=this.parseNamedAddresses(r);return t.push(...this.prepareNamedAddresses(n)),e&&t.push(...e),this.runCommand(t,a)}async publish(s){let{packageDirectoryPath:o,namedAddresses:r,profile:e,extraArguments:a,showStdout:t}=s,n=["aptos","move","publish","--package-dir",o,`--profile=${_nullishCoalesce(e, () => ("default"))}`],i=this.parseNamedAddresses(r);return n.push(...this.prepareNamedAddresses(i)),a&&n.push(...a),this.runCommand(n,t)}async createObjectAndPublishPackage(s){let{packageDirectoryPath:o,addressName:r,namedAddresses:e,profile:a,extraArguments:t,showStdout:n}=s,i=["aptos","move","create-object-and-publish-package","--package-dir",o,"--address-name",r,`--profile=${_nullishCoalesce(a, () => ("default"))}`],d=this.parseNamedAddresses(e);i.push(...this.prepareNamedAddresses(d)),t&&i.push(...t);let{output:c}=await this.runCommand(i,n);return{objectAddress:this.extractAddressFromOutput(c)}}async upgradeObjectPackage(s){let{packageDirectoryPath:o,objectAddress:r,namedAddresses:e,profile:a,extraArguments:t,showStdout:n}=s,i=["aptos","move","upgrade-object-package","--package-dir",o,"--object-address",r,`--profile=${_nullishCoalesce(a, () => ("default"))}`],d=this.parseNamedAddresses(e);return i.push(...this.prepareNamedAddresses(d)),t&&i.push(...t),this.runCommand(i,n)}async buildPublishPayload(s){let{outputFile:o,packageDirectoryPath:r,namedAddresses:e,extraArguments:a,showStdout:t}=s,n=["aptos","move","build-publish-payload","--json-output-file",o,"--package-dir",r],i=this.parseNamedAddresses(e);return n.push(...this.prepareNamedAddresses(i)),a&&n.push(...a),this.runCommand(n,t)}async runScript(s){let{compiledScriptPath:o,profile:r,extraArguments:e,showStdout:a}=s,t=["aptos","move","run-script","--compiled-script-path",o,`--profile=${_nullishCoalesce(r, () => ("default"))}`];return e&&t.push(...e),this.runCommand(t,a)}async gasProfile(s){let{network:o,transactionId:r,extraArguments:e,showStdout:a}=s,t=["aptos","move","replay","--profile-gas","--network",o,"--txn-id",r];return e&&t.push(...e),this.runCommand(t,a)}async runCommand(s,o=!0){return new Promise((r,e)=>{let a=_os.platform.call(void 0, ),t,n="",i="";a==="win32"?t=_child_process.spawn.call(void 0, "npx",s,{shell:!0}):t=_child_process.spawn.call(void 0, "npx",s),t.stdout.on("data",d=>{i=d.toString(),n+=d.toString()}),o&&(t.stdout.pipe(process.stdout),t.stderr.pipe(process.stderr)),process.stdin.pipe(t.stdin),t.on("close",d=>{if(d===0)try{let c=JSON.parse(i);c.Error?e(new Error(`Error: ${c.Error}`)):c.Result&&r({result:c.Result,output:n})}catch (e3){r({output:n})}else e(new Error(`Child process exited with code ${d}`))})})}prepareNamedAddresses(s){let o=s.size,r=[];if(o===0)return r;r.push("--named-addresses");let e=[];return s.forEach((a,t)=>{let n=`${t}=${a.toString()}`;e.push(n)}),r.push(e.join(",")),r}parseNamedAddresses(s){let o=new Map;return Object.keys(s).forEach(r=>{let e=s[r];o.set(r,e)}),o}extractAddressFromOutput(s){let o=s.match("Code was successfully deployed to object address (0x[0-9a-fA-F]+)");if(o)return o[1];throw new Error("Failed to extract object address from output")}};exports.LocalNode = l; exports.Move = h;
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/philip/Documents/General/aptos-ts-sdk/dist/common/cli/index.js","../../../src/cli/localNode.ts","../../../src/cli/move.ts"],"names":["LocalNode","args","resolve","reject","kill","err","cliCommand","cliArgs","currentPlatform","platform","childProcess","spawn","data","str","operational","start","last","sleep","Move","network","profile","extraArguments","showStdout"],"mappings":"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","file":"/Users/philip/Documents/General/aptos-ts-sdk/dist/common/cli/index.js","sourcesContent":[null,"/* eslint-disable no-console */\n\nimport { ChildProcessWithoutNullStreams, spawn } from \"child_process\";\nimport kill from \"tree-kill\";\nimport { platform } from \"os\";\n\nimport { sleep } from \"../utils/helpers\";\n\n/**\n * Represents a local node for running a testnet environment.\n * This class provides methods to start, stop, and check the status of the local testnet process.\n * It manages the lifecycle of the node process and ensures that it is operational before executing tests.\n */\nexport class LocalNode {\n readonly MAXIMUM_WAIT_TIME_SEC = 75;\n\n readonly READINESS_ENDPOINT = \"http://127.0.0.1:8070/\";\n\n showStdout: boolean = true;\n\n process: ChildProcessWithoutNullStreams | null = null;\n\n constructor(args?: { showStdout?: boolean }) {\n this.showStdout = args?.showStdout ?? true;\n }\n\n /**\n * Kills the current process and all its descendant processes.\n *\n * @returns {Promise<void>} A promise that resolves to true if the process was successfully killed.\n * @throws {Error} If there is an error while attempting to kill the process.\n */\n async stop(): Promise<void> {\n await new Promise((resolve, reject) => {\n if (!this.process?.pid) return;\n\n /**\n * Terminates the process associated with the given process ID.\n *\n * @param pid - The process ID of the process to be terminated.\n * @param callback - A function that is called after the termination attempt is complete.\n * @param callback.err - An error object if the termination failed; otherwise, null.\n * @param callback.resolve - A boolean indicating whether the termination was successful.\n */\n kill(this.process.pid, (err) => {\n if (err) {\n reject(err);\n } else {\n resolve(true);\n }\n });\n });\n }\n\n /**\n * Runs a local testnet and waits for the process to be up.\n * If the local node process is already running, it returns without starting the process.\n *\n * @returns {Promise<void>} A promise that resolves when the process is up.\n */\n async run(): Promise<void> {\n const nodeIsUp = await this.checkIfProcessIsUp();\n if (nodeIsUp) {\n return;\n }\n this.start();\n await this.waitUntilProcessIsUp();\n }\n\n /**\n * Starts the local testnet by running the Aptos node with the specified command-line arguments.\n *\n * @returns {void}\n *\n * @throws {Error} If there is an issue starting the local testnet.\n */\n start(): void {\n const cliCommand = \"npx\";\n const cliArgs = [\"aptos\", \"node\", \"run-localnet\", \"--force-restart\", \"--assume-yes\", \"--with-indexer-api\"];\n\n const currentPlatform = platform();\n let childProcess;\n // Check if current OS is windows\n if (currentPlatform === \"win32\") {\n childProcess = spawn(cliCommand, cliArgs, { shell: true });\n } else {\n childProcess = spawn(cliCommand, cliArgs);\n }\n\n this.process = childProcess;\n\n childProcess.stderr?.on(\"data\", (data: any) => {\n const str = data.toString();\n // Print local node output error log\n console.log(str);\n });\n\n childProcess.stdout?.on(\"data\", (data: any) => {\n const str = data.toString();\n // Print local node output log\n if (this.showStdout) {\n console.log(str);\n }\n });\n }\n\n /**\n * Waits for the local testnet process to be operational within a specified maximum wait time.\n * This function continuously checks if the process is up and will throw an error if it fails to start.\n *\n * @returns Promise<boolean> - Resolves to true if the process is up, otherwise throws an error.\n */\n async waitUntilProcessIsUp(): Promise<boolean> {\n let operational = await this.checkIfProcessIsUp();\n const start = Date.now() / 1000;\n let last = start;\n\n while (!operational && start + this.MAXIMUM_WAIT_TIME_SEC > last) {\n // eslint-disable-next-line no-await-in-loop\n await sleep(1000);\n // eslint-disable-next-line no-await-in-loop\n operational = await this.checkIfProcessIsUp();\n last = Date.now() / 1000;\n }\n\n // If we are here it means something blocks the process to start.\n // Might worth checking if another process is running on port 8080\n if (!operational) {\n throw new Error(\"Process failed to start\");\n }\n\n return true;\n }\n\n /**\n * Checks if the local testnet is up by querying the readiness endpoint.\n *\n * @returns Promise<boolean> - A promise that resolves to true if the testnet is up, otherwise false.\n */\n async checkIfProcessIsUp(): Promise<boolean> {\n try {\n // Query readiness endpoint\n const data = await fetch(this.READINESS_ENDPOINT);\n if (data.status === 200) {\n return true;\n }\n return false;\n } catch (err: any) {\n return false;\n }\n }\n}\n","import { spawn } from \"child_process\";\nimport { platform } from \"os\";\n\nimport { AccountAddress } from \"../core\";\nimport { Network } from \"../utils\";\n\n/**\n * Class representing a Move package management utility for the Aptos blockchain.\n * This class provides methods to initialize directories, compile packages, run tests, publish modules, create objects, upgrade\n * packages, build transaction payloads, and run scripts.\n */\nexport class Move {\n /**\n * Initialize the current directory for Aptos by configuring the necessary settings.\n * Configuration will be pushed into .aptos/config.yaml.\n *\n * @param args - The arguments for initialization.\n * @param args.network - Optional Network type argument to use for default settings; defaults to local.\n * @param args.profile - Optional Profile to use from the config file; defaults to 'default'. This will override associated\n * settings such as the REST URL, the Faucet URL, and the private key arguments.\n * @param args.extraArguments - Optional extra arguments to include in the form of an array of strings.\n * Ex. [\"--assume-yes\",\"--gas-unit-price=10\"]\n * @returns stdout\n */\n async init(args: {\n network?: Network;\n profile?: string;\n extraArguments?: Array<string>;\n showStdout?: boolean;\n }): Promise<{ output: string }> {\n const { network, profile, extraArguments, showStdout } = args;\n const cliArgs = [\"aptos\", \"init\", `--network=${network ?? \"local\"}`, `--profile=${profile ?? \"default\"}`];\n\n if (extraArguments) {\n cliArgs.push(...extraArguments);\n }\n\n return this.runCommand(cliArgs, showStdout);\n }\n\n /**\n * Compile a Move package located at the specified directory path.\n * This function helps in preparing the Move package for deployment or further processing.\n *\n * @param args - The arguments for compiling the package.\n * @param args.packageDirectoryPath - Path to a Move package (the folder with a Move.toml file).\n * @param args.namedAddresses - Named addresses for the move binary. Ex. { alice: 0x1234, bob: 0x5678 }\n * @param args.extraArguments - Optional extra arguments to include in the form of an array of strings.\n * Ex. [\"--assume-yes\",\"--gas-unit-price=10\"]\n * @returns stdout\n */\n async compile(args: {\n packageDirectoryPath: string;\n namedAddresses: Record<string, AccountAddress>;\n extraArguments?: Array<string>;\n showStdout?: boolean;\n }): Promise<{ output: string }> {\n const { packageDirectoryPath, namedAddresses, extraArguments, showStdout } = args;\n const cliArgs = [\"aptos\", \"move\", \"compile\", \"--package-dir\", packageDirectoryPath];\n\n const addressesMap = this.parseNamedAddresses(namedAddresses);\n\n cliArgs.push(...this.prepareNamedAddresses(addressesMap));\n\n if (extraArguments) {\n cliArgs.push(...extraArguments);\n }\n\n return this.runCommand(cliArgs, showStdout);\n }\n\n /**\n * Run Move unit tests for a specified package.\n *\n * @param args - The arguments for running the tests.\n * @param args.packageDirectoryPath - The path to a Move package (the folder containing a Move.toml file).\n * @param args.namedAddresses - Named addresses for the move binary. Ex. { alice: 0x1234, bob: 0x5678 }\n * @param args.extraArguments - Optional extra arguments to include in the form of an array of strings.\n * Ex. [\"--assume-yes\",\"--gas-unit-price=10\"]\n * @returns The stdout output from running the tests.\n */\n async test(args: {\n packageDirectoryPath: string;\n namedAddresses: Record<string, AccountAddress>;\n extraArguments?: Array<string>;\n showStdout?: boolean;\n }): Promise<{ output: string }> {\n const { packageDirectoryPath, namedAddresses, extraArguments, showStdout } = args;\n const cliArgs = [\"aptos\", \"move\", \"test\", \"--package-dir\", packageDirectoryPath];\n\n const addressesMap = this.parseNamedAddresses(namedAddresses);\n\n cliArgs.push(...this.prepareNamedAddresses(addressesMap));\n\n if (extraArguments) {\n cliArgs.push(...extraArguments);\n }\n\n return this.runCommand(cliArgs, showStdout);\n }\n\n /**\n * Publishes the modules to the publisher account on the Aptos blockchain.\n *\n * @param args - The arguments for publishing the modules.\n * @param args.packageDirectoryPath - The path to a move package (the folder with a Move.toml file).\n * @param args.namedAddresses - Named addresses for the move binary. Ex. { alice: 0x1234, bob: 0x5678 }\n * @param args.profile - Optional profile to use from the config file.\n * @param args.extraArguments - Optional extra arguments to include in the form of an array of strings.\n * Ex. [\"--assume-yes\",\"--gas-unit-price=10\"]\n * @returns stdout\n */\n async publish(args: {\n packageDirectoryPath: string;\n namedAddresses: Record<string, AccountAddress>;\n profile?: string;\n extraArguments?: Array<string>;\n showStdout?: boolean;\n }): Promise<{ output: string }> {\n const { packageDirectoryPath, namedAddresses, profile, extraArguments, showStdout } = args;\n const cliArgs = [\n \"aptos\",\n \"move\",\n \"publish\",\n \"--package-dir\",\n packageDirectoryPath,\n `--profile=${profile ?? \"default\"}`,\n ];\n\n const addressesMap = this.parseNamedAddresses(namedAddresses);\n\n cliArgs.push(...this.prepareNamedAddresses(addressesMap));\n\n if (extraArguments) {\n cliArgs.push(...extraArguments);\n }\n\n return this.runCommand(cliArgs, showStdout);\n }\n\n /**\n * Create a new object and publish the Move package to it on the Aptos blockchain.\n *\n * @param args - The arguments for creating the object and publishing the package.\n * @param args.packageDirectoryPath - Path to a Move package (the folder with a Move.toml file).\n * @param args.addressName - Address name for the Move package.\n * @param args.namedAddresses - Named addresses for the Move binary.\n * @param args.profile - Optional profile to use from the config file.\n * @param args.extraArguments - Optional extra arguments to include in the form of an array of strings.\n * Ex. [\"--assume-yes\",\"--gas-unit-price=10\"]\n * @returns The object address.\n *\n * A complete example in CLI:\n * aptos move create-object-and-publish-package \\\n * --package-dir path_to_directory_that_has_move.toml \\\n * --address-name launchpad_addr \\\n * --named-addresses \"launchpad_addr=0x123,initial_creator_addr=0x456\" \\\n * --profile my_profile \\\n * --assume-yes\n */\n async createObjectAndPublishPackage(args: {\n packageDirectoryPath: string;\n addressName: string;\n namedAddresses: Record<string, AccountAddress>;\n profile?: string;\n extraArguments?: Array<string>;\n showStdout?: boolean;\n }): Promise<{ objectAddress: string }> {\n const { packageDirectoryPath, addressName, namedAddresses, profile, extraArguments, showStdout } = args;\n const cliArgs = [\n \"aptos\",\n \"move\",\n \"create-object-and-publish-package\",\n \"--package-dir\",\n packageDirectoryPath,\n \"--address-name\",\n addressName,\n `--profile=${profile ?? \"default\"}`,\n ];\n\n const addressesMap = this.parseNamedAddresses(namedAddresses);\n\n cliArgs.push(...this.prepareNamedAddresses(addressesMap));\n\n if (extraArguments) {\n cliArgs.push(...extraArguments);\n }\n\n const { output } = await this.runCommand(cliArgs, showStdout);\n return { objectAddress: this.extractAddressFromOutput(output) };\n }\n\n /**\n * Upgrade a Move package previously published to an object on the Aptos blockchain.\n * The caller must be the object owner to execute this function.\n *\n * @param args - The arguments for upgrading the object package.\n * @param args.packageDirectoryPath - Path to a Move package (the folder with a Move.toml file).\n * @param args.objectAddress - Address of the object that the Move package published to. Ex. 0x1000\n * @param args.namedAddresses - Named addresses for the move binary. Ex. { alice: 0x1234, bob: 0x5678 }\n * @param args.profile - Optional profile to use from the config file.\n * @param args.extraArguments - Optional extra arguments to include in the form of an array of strings.\n * Ex. [\"--assume-yes\",\"--gas-unit-price=10\"]\n * @returns stdout\n */\n async upgradeObjectPackage(args: {\n packageDirectoryPath: string;\n objectAddress: string;\n namedAddresses: Record<string, AccountAddress>;\n profile?: string;\n extraArguments?: Array<string>;\n showStdout?: boolean;\n }): Promise<{ output: string }> {\n const { packageDirectoryPath, objectAddress, namedAddresses, profile, extraArguments, showStdout } = args;\n const cliArgs = [\n \"aptos\",\n \"move\",\n \"upgrade-object-package\",\n \"--package-dir\",\n packageDirectoryPath,\n \"--object-address\",\n objectAddress,\n `--profile=${profile ?? \"default\"}`,\n ];\n\n const addressesMap = this.parseNamedAddresses(namedAddresses);\n\n cliArgs.push(...this.prepareNamedAddresses(addressesMap));\n\n if (extraArguments) {\n cliArgs.push(...extraArguments);\n }\n\n return this.runCommand(cliArgs, showStdout);\n }\n\n /**\n * Build a publication transaction payload and store it in a JSON output file.\n *\n * @param args - The arguments for building the publishing payload.\n * @param args.packageDirectoryPath - Path to a move package (the folder with a Move.toml file).\n * @param args.outputFile - Output file to write the publication transaction to.\n * @param args.namedAddresses - Named addresses for the move binary. Ex. { alice: 0x1234, bob: 0x5678 }\n * @param args.extraArguments - Optional extra arguments to include in the form of an array of strings.\n * Ex. [\"--assume-yes\",\"--gas-unit-price=10\"] *\n * @returns stdout\n */\n async buildPublishPayload(args: {\n packageDirectoryPath: string;\n outputFile: string;\n namedAddresses: Record<string, AccountAddress>;\n extraArguments?: Array<string>;\n showStdout?: boolean;\n }): Promise<{ output: string }> {\n const { outputFile, packageDirectoryPath, namedAddresses, extraArguments, showStdout } = args;\n const cliArgs = [\n \"aptos\",\n \"move\",\n \"build-publish-payload\",\n \"--json-output-file\",\n outputFile,\n \"--package-dir\",\n packageDirectoryPath,\n ];\n\n const addressesMap = this.parseNamedAddresses(namedAddresses);\n\n cliArgs.push(...this.prepareNamedAddresses(addressesMap));\n\n if (extraArguments) {\n cliArgs.push(...extraArguments);\n }\n\n return this.runCommand(cliArgs, showStdout);\n }\n\n /**\n * Runs a Move script using the provided compiled script path and optional parameters. Ensure that the script is compiled\n * before executing this function.\n *\n * @param args - The arguments for running the script.\n * @param args.compiledScriptPath - Path to a compiled Move script bytecode file.\n * Ex. \"build/my_package/bytecode_scripts/my_move_script.mv\"\n * @param args.profile - Optional profile to use from the config file.\n * @param args.extraArguments - Optional extra arguments to include in the form of an array of strings.\n * Ex. [\"--assume-yes\",\"--gas-unit-price=10\"]\n *\n * @returns The standard output from running the script.\n */\n async runScript(args: {\n compiledScriptPath: string;\n profile?: string;\n extraArguments?: Array<string>;\n showStdout?: boolean;\n }): Promise<{ output: string }> {\n const { compiledScriptPath, profile, extraArguments, showStdout } = args;\n const cliArgs = [\n \"aptos\",\n \"move\",\n \"run-script\",\n \"--compiled-script-path\",\n compiledScriptPath,\n `--profile=${profile ?? \"default\"}`,\n ];\n\n if (extraArguments) {\n cliArgs.push(...extraArguments);\n }\n\n return this.runCommand(cliArgs, showStdout);\n }\n\n /**\n * Run a command with the specified arguments and return the output.\n *\n * @param args - An array of strings representing the command-line arguments to be passed to the command.\n * @param showStdout - Show the standard output generated by the command.\n * @returns The standard output generated by the command.\n */\n // eslint-disable-next-line class-methods-use-this\n private async runCommand(args: Array<string>, showStdout: boolean = true): Promise<{ result?: any; output: string }> {\n return new Promise((resolve, reject) => {\n const currentPlatform = platform();\n let childProcess;\n let stdout = \"\";\n // CLI final stdout is the Result/Error JSON string output\n // so we need to keep track of the last stdout\n let lastStdout = \"\";\n\n // Check if current OS is windows\n if (currentPlatform === \"win32\") {\n childProcess = spawn(\"npx\", args, { shell: true });\n } else {\n childProcess = spawn(\"npx\", args);\n }\n\n childProcess.stdout.on(\"data\", (data) => {\n lastStdout = data.toString();\n stdout += data.toString();\n });\n\n if (showStdout) {\n childProcess.stdout.pipe(process.stdout);\n childProcess.stderr.pipe(process.stderr);\n }\n process.stdin.pipe(childProcess.stdin);\n\n childProcess.on(\"close\", (code) => {\n if (code === 0) {\n try {\n // parse the last stdout as it might be the result\n const parsed = JSON.parse(lastStdout);\n if (parsed.Error) {\n reject(new Error(`Error: ${parsed.Error}`)); // Reject if the \"Error\" key exists\n } else if (parsed.Result) {\n resolve({ result: parsed.Result, output: stdout }); // Resolve if the \"Result\" key exists\n }\n } catch (error: any) {\n // resolve the stdout as it might be just a stdout\n resolve({ output: stdout });\n }\n } else {\n reject(new Error(`Child process exited with code ${code}`)); // Reject with an error if the child process exits with an error code\n }\n });\n });\n }\n\n /**\n * Convert named addresses from a Map into an array separated by a comma.\n *\n * @param namedAddresses - A Map where the key is a string representing the name and the value is an AccountAddress.\n * Ex. {'alice' => '0x123', 'bob' => '0x456'}\n * @returns An array of named addresses formatted as strings separated by a comma. Ex. \"alice=0x123,bob=0x456\"\n */\n // eslint-disable-next-line class-methods-use-this\n private prepareNamedAddresses(namedAddresses: Map<string, AccountAddress>): Array<string> {\n const totalNames = namedAddresses.size;\n const newArgs: Array<string> = [];\n\n if (totalNames === 0) {\n return newArgs;\n }\n\n newArgs.push(\"--named-addresses\");\n\n const names: Array<string> = [];\n namedAddresses.forEach((value, key) => {\n const toAppend = `${key}=${value.toString()}`;\n names.push(toAppend);\n });\n newArgs.push(names.join(\",\"));\n return newArgs;\n }\n\n /**\n * Parse named addresses from a Record type into a Map.\n *\n * This function transforms a collection of named addresses into a more accessible format by mapping each name to its\n * corresponding address.\n *\n * @param namedAddresses - A record containing named addresses where the key is the name and the value is the AccountAddress.\n * @returns A Map where each key is a name and each value is the corresponding address.\n */\n // eslint-disable-next-line class-methods-use-this\n private parseNamedAddresses(namedAddresses: Record<string, AccountAddress>): Map<string, AccountAddress> {\n const addressesMap = new Map();\n\n Object.keys(namedAddresses).forEach((key) => {\n const address = namedAddresses[key];\n addressesMap.set(key, address);\n });\n\n return addressesMap;\n }\n\n /**\n * Extracts the object address from the provided output string.\n *\n * @param output - The output string containing the object address.\n * @returns The extracted object address.\n * @throws Error if the object address cannot be extracted from the output.\n */\n // eslint-disable-next-line class-methods-use-this\n private extractAddressFromOutput(output: string): string {\n const match = output.match(\"Code was successfully deployed to object address (0x[0-9a-fA-F]+)\");\n if (match) {\n return match[1];\n }\n throw new Error(\"Failed to extract object address from output\");\n }\n}\n"]}
1
+ {"version":3,"sources":["/Users/maayansavir/work/aptos_repos/aptos-ts-sdk/dist/common/cli/index.js","../../../src/cli/localNode.ts","../../../src/cli/move.ts"],"names":["LocalNode","args","resolve","reject","kill","err","cliCommand","cliArgs","currentPlatform","platform","childProcess","spawn","data","str","operational","start","last","sleep","Move","network","profile","extraArguments","showStdout"],"mappings":"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","file":"/Users/maayansavir/work/aptos_repos/aptos-ts-sdk/dist/common/cli/index.js","sourcesContent":[null,"/* eslint-disable no-console */\n\nimport { ChildProcessWithoutNullStreams, spawn } from \"child_process\";\nimport kill from \"tree-kill\";\nimport { platform } from \"os\";\n\nimport { sleep } from \"../utils/helpers\";\n\n/**\n * Represents a local node for running a testnet environment.\n * This class provides methods to start, stop, and check the status of the local testnet process.\n * It manages the lifecycle of the node process and ensures that it is operational before executing tests.\n */\nexport class LocalNode {\n readonly MAXIMUM_WAIT_TIME_SEC = 75;\n\n readonly READINESS_ENDPOINT = \"http://127.0.0.1:8070/\";\n\n showStdout: boolean = true;\n\n process: ChildProcessWithoutNullStreams | null = null;\n\n constructor(args?: { showStdout?: boolean }) {\n this.showStdout = args?.showStdout ?? true;\n }\n\n /**\n * Kills the current process and all its descendant processes.\n *\n * @returns {Promise<void>} A promise that resolves to true if the process was successfully killed.\n * @throws {Error} If there is an error while attempting to kill the process.\n */\n async stop(): Promise<void> {\n await new Promise((resolve, reject) => {\n if (!this.process?.pid) return;\n\n /**\n * Terminates the process associated with the given process ID.\n *\n * @param pid - The process ID of the process to be terminated.\n * @param callback - A function that is called after the termination attempt is complete.\n * @param callback.err - An error object if the termination failed; otherwise, null.\n * @param callback.resolve - A boolean indicating whether the termination was successful.\n */\n kill(this.process.pid, (err) => {\n if (err) {\n reject(err);\n } else {\n resolve(true);\n }\n });\n });\n }\n\n /**\n * Runs a local testnet and waits for the process to be up.\n * If the local node process is already running, it returns without starting the process.\n *\n * @returns {Promise<void>} A promise that resolves when the process is up.\n */\n async run(): Promise<void> {\n const nodeIsUp = await this.checkIfProcessIsUp();\n if (nodeIsUp) {\n return;\n }\n this.start();\n await this.waitUntilProcessIsUp();\n }\n\n /**\n * Starts the local testnet by running the Aptos node with the specified command-line arguments.\n *\n * @returns {void}\n *\n * @throws {Error} If there is an issue starting the local testnet.\n */\n start(): void {\n const cliCommand = \"npx\";\n const cliArgs = [\"aptos\", \"node\", \"run-localnet\", \"--force-restart\", \"--assume-yes\", \"--with-indexer-api\"];\n\n const currentPlatform = platform();\n let childProcess;\n // Check if current OS is windows\n if (currentPlatform === \"win32\") {\n childProcess = spawn(cliCommand, cliArgs, { shell: true });\n } else {\n childProcess = spawn(cliCommand, cliArgs);\n }\n\n this.process = childProcess;\n\n childProcess.stderr?.on(\"data\", (data: any) => {\n const str = data.toString();\n // Print local node output error log\n console.log(str);\n });\n\n childProcess.stdout?.on(\"data\", (data: any) => {\n const str = data.toString();\n // Print local node output log\n if (this.showStdout) {\n console.log(str);\n }\n });\n }\n\n /**\n * Waits for the local testnet process to be operational within a specified maximum wait time.\n * This function continuously checks if the process is up and will throw an error if it fails to start.\n *\n * @returns Promise<boolean> - Resolves to true if the process is up, otherwise throws an error.\n */\n async waitUntilProcessIsUp(): Promise<boolean> {\n let operational = await this.checkIfProcessIsUp();\n const start = Date.now() / 1000;\n let last = start;\n\n while (!operational && start + this.MAXIMUM_WAIT_TIME_SEC > last) {\n // eslint-disable-next-line no-await-in-loop\n await sleep(1000);\n // eslint-disable-next-line no-await-in-loop\n operational = await this.checkIfProcessIsUp();\n last = Date.now() / 1000;\n }\n\n // If we are here it means something blocks the process to start.\n // Might worth checking if another process is running on port 8080\n if (!operational) {\n throw new Error(\"Process failed to start\");\n }\n\n return true;\n }\n\n /**\n * Checks if the local testnet is up by querying the readiness endpoint.\n *\n * @returns Promise<boolean> - A promise that resolves to true if the testnet is up, otherwise false.\n */\n async checkIfProcessIsUp(): Promise<boolean> {\n try {\n // Query readiness endpoint\n const data = await fetch(this.READINESS_ENDPOINT);\n if (data.status === 200) {\n return true;\n }\n return false;\n } catch (err: any) {\n return false;\n }\n }\n}\n","import { spawn } from \"child_process\";\nimport { platform } from \"os\";\n\nimport { AccountAddress } from \"../core\";\nimport { Network } from \"../utils\";\n\n/**\n * Class representing a Move package management utility for the Aptos blockchain.\n * This class provides methods to initialize directories, compile packages, run tests, publish modules, create objects, upgrade\n * packages, build transaction payloads, and run scripts.\n */\nexport class Move {\n /**\n * Initialize the current directory for Aptos by configuring the necessary settings.\n * Configuration will be pushed into .aptos/config.yaml.\n *\n * @param args - The arguments for initialization.\n * @param args.network - Optional Network type argument to use for default settings; defaults to local.\n * @param args.profile - Optional Profile to use from the config file; defaults to 'default'. This will override associated\n * settings such as the REST URL, the Faucet URL, and the private key arguments.\n * @param args.extraArguments - Optional extra arguments to include in the form of an array of strings.\n * Ex. [\"--assume-yes\",\"--gas-unit-price=10\"]\n * @returns stdout\n */\n async init(args: {\n network?: Network;\n profile?: string;\n extraArguments?: Array<string>;\n showStdout?: boolean;\n }): Promise<{ output: string }> {\n const { network, profile, extraArguments, showStdout } = args;\n const cliArgs = [\"aptos\", \"init\", `--network=${network ?? \"local\"}`, `--profile=${profile ?? \"default\"}`];\n\n if (extraArguments) {\n cliArgs.push(...extraArguments);\n }\n\n return this.runCommand(cliArgs, showStdout);\n }\n\n /**\n * Compile a Move package located at the specified directory path.\n * This function helps in preparing the Move package for deployment or further processing.\n *\n * @param args - The arguments for compiling the package.\n * @param args.packageDirectoryPath - Path to a Move package (the folder with a Move.toml file).\n * @param args.namedAddresses - Named addresses for the move binary. Ex. { alice: 0x1234, bob: 0x5678 }\n * @param args.extraArguments - Optional extra arguments to include in the form of an array of strings.\n * Ex. [\"--assume-yes\",\"--gas-unit-price=10\"]\n * @returns stdout\n */\n async compile(args: {\n packageDirectoryPath: string;\n namedAddresses: Record<string, AccountAddress>;\n extraArguments?: Array<string>;\n showStdout?: boolean;\n }): Promise<{ output: string }> {\n const { packageDirectoryPath, namedAddresses, extraArguments, showStdout } = args;\n const cliArgs = [\"aptos\", \"move\", \"compile\", \"--package-dir\", packageDirectoryPath];\n\n const addressesMap = this.parseNamedAddresses(namedAddresses);\n\n cliArgs.push(...this.prepareNamedAddresses(addressesMap));\n\n if (extraArguments) {\n cliArgs.push(...extraArguments);\n }\n\n return this.runCommand(cliArgs, showStdout);\n }\n\n /**\n * Run Move unit tests for a specified package.\n *\n * @param args - The arguments for running the tests.\n * @param args.packageDirectoryPath - The path to a Move package (the folder containing a Move.toml file).\n * @param args.namedAddresses - Named addresses for the move binary. Ex. { alice: 0x1234, bob: 0x5678 }\n * @param args.extraArguments - Optional extra arguments to include in the form of an array of strings.\n * Ex. [\"--assume-yes\",\"--gas-unit-price=10\"]\n * @returns The stdout output from running the tests.\n */\n async test(args: {\n packageDirectoryPath: string;\n namedAddresses: Record<string, AccountAddress>;\n extraArguments?: Array<string>;\n showStdout?: boolean;\n }): Promise<{ output: string }> {\n const { packageDirectoryPath, namedAddresses, extraArguments, showStdout } = args;\n const cliArgs = [\"aptos\", \"move\", \"test\", \"--package-dir\", packageDirectoryPath];\n\n const addressesMap = this.parseNamedAddresses(namedAddresses);\n\n cliArgs.push(...this.prepareNamedAddresses(addressesMap));\n\n if (extraArguments) {\n cliArgs.push(...extraArguments);\n }\n\n return this.runCommand(cliArgs, showStdout);\n }\n\n /**\n * Publishes the modules to the publisher account on the Aptos blockchain.\n *\n * @param args - The arguments for publishing the modules.\n * @param args.packageDirectoryPath - The path to a move package (the folder with a Move.toml file).\n * @param args.namedAddresses - Named addresses for the move binary. Ex. { alice: 0x1234, bob: 0x5678 }\n * @param args.profile - Optional profile to use from the config file.\n * @param args.extraArguments - Optional extra arguments to include in the form of an array of strings.\n * Ex. [\"--assume-yes\",\"--gas-unit-price=10\"]\n * @returns stdout\n */\n async publish(args: {\n packageDirectoryPath: string;\n namedAddresses: Record<string, AccountAddress>;\n profile?: string;\n extraArguments?: Array<string>;\n showStdout?: boolean;\n }): Promise<{ output: string }> {\n const { packageDirectoryPath, namedAddresses, profile, extraArguments, showStdout } = args;\n const cliArgs = [\n \"aptos\",\n \"move\",\n \"publish\",\n \"--package-dir\",\n packageDirectoryPath,\n `--profile=${profile ?? \"default\"}`,\n ];\n\n const addressesMap = this.parseNamedAddresses(namedAddresses);\n\n cliArgs.push(...this.prepareNamedAddresses(addressesMap));\n\n if (extraArguments) {\n cliArgs.push(...extraArguments);\n }\n\n return this.runCommand(cliArgs, showStdout);\n }\n\n /**\n * Create a new object and publish the Move package to it on the Aptos blockchain.\n *\n * @param args - The arguments for creating the object and publishing the package.\n * @param args.packageDirectoryPath - Path to a Move package (the folder with a Move.toml file).\n * @param args.addressName - Address name for the Move package.\n * @param args.namedAddresses - Named addresses for the Move binary.\n * @param args.profile - Optional profile to use from the config file.\n * @param args.extraArguments - Optional extra arguments to include in the form of an array of strings.\n * Ex. [\"--assume-yes\",\"--gas-unit-price=10\"]\n * @returns The object address.\n *\n * A complete example in CLI:\n * aptos move create-object-and-publish-package \\\n * --package-dir path_to_directory_that_has_move.toml \\\n * --address-name launchpad_addr \\\n * --named-addresses \"launchpad_addr=0x123,initial_creator_addr=0x456\" \\\n * --profile my_profile \\\n * --assume-yes\n */\n async createObjectAndPublishPackage(args: {\n packageDirectoryPath: string;\n addressName: string;\n namedAddresses: Record<string, AccountAddress>;\n profile?: string;\n extraArguments?: Array<string>;\n showStdout?: boolean;\n }): Promise<{ objectAddress: string }> {\n const { packageDirectoryPath, addressName, namedAddresses, profile, extraArguments, showStdout } = args;\n const cliArgs = [\n \"aptos\",\n \"move\",\n \"create-object-and-publish-package\",\n \"--package-dir\",\n packageDirectoryPath,\n \"--address-name\",\n addressName,\n `--profile=${profile ?? \"default\"}`,\n ];\n\n const addressesMap = this.parseNamedAddresses(namedAddresses);\n\n cliArgs.push(...this.prepareNamedAddresses(addressesMap));\n\n if (extraArguments) {\n cliArgs.push(...extraArguments);\n }\n\n const { output } = await this.runCommand(cliArgs, showStdout);\n return { objectAddress: this.extractAddressFromOutput(output) };\n }\n\n /**\n * Upgrade a Move package previously published to an object on the Aptos blockchain.\n * The caller must be the object owner to execute this function.\n *\n * @param args - The arguments for upgrading the object package.\n * @param args.packageDirectoryPath - Path to a Move package (the folder with a Move.toml file).\n * @param args.objectAddress - Address of the object that the Move package published to. Ex. 0x1000\n * @param args.namedAddresses - Named addresses for the move binary. Ex. { alice: 0x1234, bob: 0x5678 }\n * @param args.profile - Optional profile to use from the config file.\n * @param args.extraArguments - Optional extra arguments to include in the form of an array of strings.\n * Ex. [\"--assume-yes\",\"--gas-unit-price=10\"]\n * @returns stdout\n */\n async upgradeObjectPackage(args: {\n packageDirectoryPath: string;\n objectAddress: string;\n namedAddresses: Record<string, AccountAddress>;\n profile?: string;\n extraArguments?: Array<string>;\n showStdout?: boolean;\n }): Promise<{ output: string }> {\n const { packageDirectoryPath, objectAddress, namedAddresses, profile, extraArguments, showStdout } = args;\n const cliArgs = [\n \"aptos\",\n \"move\",\n \"upgrade-object-package\",\n \"--package-dir\",\n packageDirectoryPath,\n \"--object-address\",\n objectAddress,\n `--profile=${profile ?? \"default\"}`,\n ];\n\n const addressesMap = this.parseNamedAddresses(namedAddresses);\n\n cliArgs.push(...this.prepareNamedAddresses(addressesMap));\n\n if (extraArguments) {\n cliArgs.push(...extraArguments);\n }\n\n return this.runCommand(cliArgs, showStdout);\n }\n\n /**\n * Build a publication transaction payload and store it in a JSON output file.\n *\n * @param args - The arguments for building the publishing payload.\n * @param args.packageDirectoryPath - Path to a move package (the folder with a Move.toml file).\n * @param args.outputFile - Output file to write the publication transaction to.\n * @param args.namedAddresses - Named addresses for the move binary. Ex. { alice: 0x1234, bob: 0x5678 }\n * @param args.extraArguments - Optional extra arguments to include in the form of an array of strings.\n * Ex. [\"--assume-yes\",\"--gas-unit-price=10\"] *\n * @returns stdout\n */\n async buildPublishPayload(args: {\n packageDirectoryPath: string;\n outputFile: string;\n namedAddresses: Record<string, AccountAddress>;\n extraArguments?: Array<string>;\n showStdout?: boolean;\n }): Promise<{ output: string }> {\n const { outputFile, packageDirectoryPath, namedAddresses, extraArguments, showStdout } = args;\n const cliArgs = [\n \"aptos\",\n \"move\",\n \"build-publish-payload\",\n \"--json-output-file\",\n outputFile,\n \"--package-dir\",\n packageDirectoryPath,\n ];\n\n const addressesMap = this.parseNamedAddresses(namedAddresses);\n\n cliArgs.push(...this.prepareNamedAddresses(addressesMap));\n\n if (extraArguments) {\n cliArgs.push(...extraArguments);\n }\n\n return this.runCommand(cliArgs, showStdout);\n }\n\n /**\n * Runs a Move script using the provided compiled script path and optional parameters. Ensure that the script is compiled\n * before executing this function.\n *\n * @param args - The arguments for running the script.\n * @param args.compiledScriptPath - Path to a compiled Move script bytecode file.\n * Ex. \"build/my_package/bytecode_scripts/my_move_script.mv\"\n * @param args.profile - Optional profile to use from the config file.\n * @param args.extraArguments - Optional extra arguments to include in the form of an array of strings.\n * Ex. [\"--assume-yes\",\"--gas-unit-price=10\"]\n *\n * @returns The standard output from running the script.\n */\n async runScript(args: {\n compiledScriptPath: string;\n profile?: string;\n extraArguments?: Array<string>;\n showStdout?: boolean;\n }): Promise<{ output: string }> {\n const { compiledScriptPath, profile, extraArguments, showStdout } = args;\n const cliArgs = [\n \"aptos\",\n \"move\",\n \"run-script\",\n \"--compiled-script-path\",\n compiledScriptPath,\n `--profile=${profile ?? \"default\"}`,\n ];\n\n if (extraArguments) {\n cliArgs.push(...extraArguments);\n }\n\n return this.runCommand(cliArgs, showStdout);\n }\n\n async gasProfile(args: {\n network: string;\n transactionId: string;\n extraArguments?: Array<string>;\n showStdout?: boolean;\n }): Promise<{ output: string; result?: any }> {\n const { network, transactionId, extraArguments, showStdout } = args;\n const cliArgs = [\"aptos\", \"move\", \"replay\", \"--profile-gas\", \"--network\", network, \"--txn-id\", transactionId];\n\n if (extraArguments) {\n cliArgs.push(...extraArguments);\n }\n\n return this.runCommand(cliArgs, showStdout);\n }\n\n /**\n * Run a command with the specified arguments and return the output.\n *\n * @param args - An array of strings representing the command-line arguments to be passed to the command.\n * @param showStdout - Show the standard output generated by the command.\n * @returns The standard output generated by the command.\n */\n // eslint-disable-next-line class-methods-use-this\n private async runCommand(args: Array<string>, showStdout: boolean = true): Promise<{ result?: any; output: string }> {\n return new Promise((resolve, reject) => {\n const currentPlatform = platform();\n let childProcess;\n let stdout = \"\";\n // CLI final stdout is the Result/Error JSON string output\n // so we need to keep track of the last stdout\n let lastStdout = \"\";\n\n // Check if current OS is windows\n if (currentPlatform === \"win32\") {\n childProcess = spawn(\"npx\", args, { shell: true });\n } else {\n childProcess = spawn(\"npx\", args);\n }\n\n childProcess.stdout.on(\"data\", (data) => {\n lastStdout = data.toString();\n stdout += data.toString();\n });\n\n if (showStdout) {\n childProcess.stdout.pipe(process.stdout);\n childProcess.stderr.pipe(process.stderr);\n }\n process.stdin.pipe(childProcess.stdin);\n\n childProcess.on(\"close\", (code) => {\n if (code === 0) {\n try {\n // parse the last stdout as it might be the result\n const parsed = JSON.parse(lastStdout);\n if (parsed.Error) {\n reject(new Error(`Error: ${parsed.Error}`)); // Reject if the \"Error\" key exists\n } else if (parsed.Result) {\n resolve({ result: parsed.Result, output: stdout }); // Resolve if the \"Result\" key exists\n }\n } catch (error: any) {\n // resolve the stdout as it might be just a stdout\n resolve({ output: stdout });\n }\n } else {\n reject(new Error(`Child process exited with code ${code}`)); // Reject with an error if the child process exits with an error code\n }\n });\n });\n }\n\n /**\n * Convert named addresses from a Map into an array separated by a comma.\n *\n * @param namedAddresses - A Map where the key is a string representing the name and the value is an AccountAddress.\n * Ex. {'alice' => '0x123', 'bob' => '0x456'}\n * @returns An array of named addresses formatted as strings separated by a comma. Ex. \"alice=0x123,bob=0x456\"\n */\n // eslint-disable-next-line class-methods-use-this\n private prepareNamedAddresses(namedAddresses: Map<string, AccountAddress>): Array<string> {\n const totalNames = namedAddresses.size;\n const newArgs: Array<string> = [];\n\n if (totalNames === 0) {\n return newArgs;\n }\n\n newArgs.push(\"--named-addresses\");\n\n const names: Array<string> = [];\n namedAddresses.forEach((value, key) => {\n const toAppend = `${key}=${value.toString()}`;\n names.push(toAppend);\n });\n newArgs.push(names.join(\",\"));\n return newArgs;\n }\n\n /**\n * Parse named addresses from a Record type into a Map.\n *\n * This function transforms a collection of named addresses into a more accessible format by mapping each name to its\n * corresponding address.\n *\n * @param namedAddresses - A record containing named addresses where the key is the name and the value is the AccountAddress.\n * @returns A Map where each key is a name and each value is the corresponding address.\n */\n // eslint-disable-next-line class-methods-use-this\n private parseNamedAddresses(namedAddresses: Record<string, AccountAddress>): Map<string, AccountAddress> {\n const addressesMap = new Map();\n\n Object.keys(namedAddresses).forEach((key) => {\n const address = namedAddresses[key];\n addressesMap.set(key, address);\n });\n\n return addressesMap;\n }\n\n /**\n * Extracts the object address from the provided output string.\n *\n * @param output - The output string containing the object address.\n * @returns The extracted object address.\n * @throws Error if the object address cannot be extracted from the output.\n */\n // eslint-disable-next-line class-methods-use-this\n private extractAddressFromOutput(output: string): string {\n const match = output.match(\"Code was successfully deployed to object address (0x[0-9a-fA-F]+)\");\n if (match) {\n return match[1];\n }\n throw new Error(\"Failed to extract object address from output\");\n }\n}\n"]}
@@ -1,5 +1,7 @@
1
- import { S as Serializable, T as TransactionArgument, H as HexInput, a as Serializer, D as Deserializer, E as EntryFunctionArgument, U as Uint8, b as Uint16, c as Uint32, A as AnyNumber, d as Deserializable, e as Hex, f as AuthenticationKeyScheme, g as AccountAddress, P as PrivateKeyVariants, h as AnyPublicKeyVariant, i as EphemeralPublicKeyVariant, N as Network, C as Client, j as ClientConfig, F as FullNodeConfig, I as IndexerConfig, k as FaucetConfig, l as AptosSettings, m as EphemeralCertificateVariant, Z as ZkpVariant, L as LedgerVersionArg, n as AccountAddressInput, M as MoveModuleId, o as ScriptFunctionArgument, p as MoveFunctionId, q as MoveStructId, r as MoveValue, s as MoveFunctionGenericTypeParam, t as SigningSchemeInput, u as SigningScheme, v as AccountData, w as PaginationArgs, x as MoveModuleBytecode, y as TransactionResponse, z as MoveResource, B as TokenStandardArg, O as OrderByArg, G as GetAccountOwnedTokensQueryResponse, J as GetAccountOwnedTokensFromCollectionResponse, K as GetAccountCollectionsWithOwnedTokenResponse, Q as GetAccountCoinsDataResponse, W as WhereArg, R as GetObjectDataQueryResponse, V as GetCollectionDataResponse, X as GetTokenDataResponse, Y as GetCurrentTokenOwnershipResponse, _ as GetOwnedTokensResponse, $ as GetTokenActivityResponse, a0 as GetEventsResponse, a1 as WaitForTransactionOptions, a2 as UserTransactionResponse, a3 as MoveFunction, a4 as GetFungibleAssetMetadataResponse, a5 as GetFungibleAssetActivitiesResponse, a6 as GetCurrentFungibleAssetBalancesResponse, a7 as LedgerInfo, a8 as Block, a9 as GetChainTopUserTransactionsResponse, aa as GraphqlQuery, ab as GetProcessorStatusResponse, ac as GetANSNameResponse, ad as GetNumberOfDelegatorsResponse, ae as GetDelegatedStakingActivitiesResponse, af as PendingTransactionResponse, ag as CommittedTransactionResponse, ah as GasEstimation, ai as TableItemRequest, aj as GetTableItemsDataResponse, ak as GetTableItemsMetadataResponse, al as ClientRequest, am as ClientResponse, an as AptosRequest, ao as AptosResponse, ap as MimeType } from './accountAddress-6RqI8Aam.js';
2
- export { aG as AccountAuthenticatorVariant, bp as AccountSignature, at as AddressInvalidReason, aH as AnySignatureVariant, aZ as BlockEndInfo, a_ as BlockEpilogueTransactionResponse, aW as BlockMetadataTransactionResponse, aM as ClientHeadersType, b6 as DecodedTableData, b7 as DeletedTableData, bM as DeriveScheme, bs as DirectWriteSet, b9 as EntryFunctionPayloadResponse, aI as EphemeralSignatureVariant, bu as Event, bt as EventGuid, bP as GenerateAccount, bN as GenerateAccountWithEd25519, bO as GenerateAccountWithSingleSignerSecp256k1Key, bc as GenesisPayload, aV as GenesisTransactionResponse, aw as HexInvalidReason, bH as MoveAbility, bB as MoveAddressType, bG as MoveFunctionVisibility, bJ as MoveModule, bC as MoveObjectType, bD as MoveOptionType, bd as MoveScriptBytecode, bK as MoveStruct, bI as MoveStructField, bE as MoveStructType, bF as MoveType, bz as MoveUint128Type, bw as MoveUint16Type, bA as MoveUint256Type, bx as MoveUint32Type, by as MoveUint64Type, bv as MoveUint8Type, bb as MultisigPayloadResponse, bV as NetworkToChainId, bS as NetworkToFaucetAPI, bQ as NetworkToIndexerAPI, bW as NetworkToNetworkName, bR as NetworkToNodeAPI, bT as NetworkToPepperAPI, bU as NetworkToProverAPI, ay as OrderBy, az as OrderByValue, au as ParsingError, av as ParsingResult, bL as RoleType, ba as ScriptPayloadResponse, aC as ScriptTransactionArgumentVariants, br as ScriptWriteSet, aX as StateCheckpointTransactionResponse, aA as TokenStandard, aF as TransactionAuthenticatorVariant, bk as TransactionEd25519Signature, bo as TransactionFeePayerSignature, bn as TransactionMultiAgentSignature, bm as TransactionMultiEd25519Signature, b8 as TransactionPayloadResponse, aD as TransactionPayloadVariants, aN as TransactionResponseType, bl as TransactionSecp256k1Signature, be as TransactionSignature, aE as TransactionVariants, aB as TypeTagVariants, aK as Uint128, aL as Uint256, aJ as Uint64, aY as ValidatorTransactionResponse, bq as WriteSet, a$ as WriteSetChange, b0 as WriteSetChangeDeleteModule, b1 as WriteSetChangeDeleteResource, b2 as WriteSetChangeDeleteTableItem, b3 as WriteSetChangeWriteModule, b4 as WriteSetChangeWriteResource, b5 as WriteSetChangeWriteTableItem, aq as ensureBoolean, ax as hexToAsciiString, aU as isBlockEpilogueTransactionResponse, aR as isBlockMetadataTransactionResponse, bf as isEd25519Signature, bi as isFeePayerSignature, aQ as isGenesisTransactionResponse, bh as isMultiAgentSignature, bj as isMultiEd25519Signature, aO as isPendingTransactionResponse, bg as isSecp256k1Signature, aS as isStateCheckpointTransactionResponse, aP as isUserTransactionResponse, aT as isValidatorTransactionResponse, ar as outOfRangeErrorMessage, as as validateNumberInRange } from './accountAddress-6RqI8Aam.js';
1
+ import { S as Serializable, T as TransactionArgument, H as HexInput, a as Serializer, D as Deserializer, E as EntryFunctionArgument, U as Uint8, b as Uint16, c as Uint32, A as AnyNumber, d as Deserializable, e as Hex, f as AuthenticationKeyScheme, g as AccountAddress, P as PrivateKeyVariants, h as AnyPublicKeyVariant, i as EphemeralPublicKeyVariant, N as Network, C as Client, j as ClientConfig, F as FullNodeConfig, I as IndexerConfig, k as FaucetConfig, l as AptosSettings, m as EphemeralCertificateVariant, Z as ZkpVariant, L as LedgerVersionArg, n as AccountAddressInput, M as MoveModuleId, o as ScriptFunctionArgument, p as MoveFunctionId, q as MoveStructId, r as MoveValue, s as MoveFunctionGenericTypeParam, t as SigningSchemeInput, u as SigningScheme, v as AccountData, w as PaginationArgs, x as MoveModuleBytecode, y as TransactionResponse, z as MoveResource, B as TokenStandardArg, O as OrderByArg, G as GetAccountOwnedTokensQueryResponse, J as GetAccountOwnedTokensFromCollectionResponse, K as GetAccountCollectionsWithOwnedTokenResponse, Q as GetAccountCoinsDataResponse, W as WhereArg, R as GetObjectDataQueryResponse, V as GetCollectionDataResponse, X as GetTokenDataResponse, Y as GetCurrentTokenOwnershipResponse, _ as GetOwnedTokensResponse, $ as GetTokenActivityResponse, a0 as GetEventsResponse, a1 as WaitForTransactionOptions, a2 as UserTransactionResponse, a3 as MoveFunction, a4 as GetFungibleAssetMetadataResponse, a5 as GetFungibleAssetActivitiesResponse, a6 as GetCurrentFungibleAssetBalancesResponse, a7 as LedgerInfo, a8 as Block, a9 as GetChainTopUserTransactionsResponse, aa as GraphqlQuery, ab as GetProcessorStatusResponse, ac as GetANSNameResponse, ad as GetNumberOfDelegatorsResponse, ae as GetDelegatedStakingActivitiesResponse, af as PendingTransactionResponse, ag as CommittedTransactionResponse, ah as GasEstimation, ai as TableItemRequest, aj as GetTableItemsDataResponse, ak as GetTableItemsMetadataResponse, al as ClientRequest, am as ClientResponse, an as AptosRequest, ao as AptosResponse, ap as MimeType } from './accountAddress-fJZJVSBc.js';
2
+ export { aG as AccountAuthenticatorVariant, bp as AccountSignature, at as AddressInvalidReason, aH as AnySignatureVariant, aZ as BlockEndInfo, a_ as BlockEpilogueTransactionResponse, aW as BlockMetadataTransactionResponse, aM as ClientHeadersType, b6 as DecodedTableData, b7 as DeletedTableData, bM as DeriveScheme, bs as DirectWriteSet, b9 as EntryFunctionPayloadResponse, aI as EphemeralSignatureVariant, bu as Event, bt as EventGuid, bP as GenerateAccount, bN as GenerateAccountWithEd25519, bO as GenerateAccountWithSingleSignerSecp256k1Key, bc as GenesisPayload, aV as GenesisTransactionResponse, aw as HexInvalidReason, bH as MoveAbility, bB as MoveAddressType, bG as MoveFunctionVisibility, bJ as MoveModule, bC as MoveObjectType, bD as MoveOptionType, bd as MoveScriptBytecode, bK as MoveStruct, bI as MoveStructField, bE as MoveStructType, bF as MoveType, bz as MoveUint128Type, bw as MoveUint16Type, bA as MoveUint256Type, bx as MoveUint32Type, by as MoveUint64Type, bv as MoveUint8Type, bb as MultisigPayloadResponse, bV as NetworkToChainId, bS as NetworkToFaucetAPI, bQ as NetworkToIndexerAPI, bW as NetworkToNetworkName, bR as NetworkToNodeAPI, bT as NetworkToPepperAPI, bU as NetworkToProverAPI, ay as OrderBy, az as OrderByValue, au as ParsingError, av as ParsingResult, bL as RoleType, ba as ScriptPayloadResponse, aC as ScriptTransactionArgumentVariants, br as ScriptWriteSet, aX as StateCheckpointTransactionResponse, aA as TokenStandard, aF as TransactionAuthenticatorVariant, bk as TransactionEd25519Signature, bo as TransactionFeePayerSignature, bn as TransactionMultiAgentSignature, bm as TransactionMultiEd25519Signature, b8 as TransactionPayloadResponse, aD as TransactionPayloadVariants, aN as TransactionResponseType, bl as TransactionSecp256k1Signature, be as TransactionSignature, aE as TransactionVariants, aB as TypeTagVariants, aK as Uint128, aL as Uint256, aJ as Uint64, aY as ValidatorTransactionResponse, bq as WriteSet, a$ as WriteSetChange, b0 as WriteSetChangeDeleteModule, b1 as WriteSetChangeDeleteResource, b2 as WriteSetChangeDeleteTableItem, b3 as WriteSetChangeWriteModule, b4 as WriteSetChangeWriteResource, b5 as WriteSetChangeWriteTableItem, aq as ensureBoolean, ax as hexToAsciiString, aU as isBlockEpilogueTransactionResponse, aR as isBlockMetadataTransactionResponse, bf as isEd25519Signature, bi as isFeePayerSignature, aQ as isGenesisTransactionResponse, bh as isMultiAgentSignature, bj as isMultiEd25519Signature, aO as isPendingTransactionResponse, bg as isSecp256k1Signature, aS as isStateCheckpointTransactionResponse, aP as isUserTransactionResponse, aT as isValidatorTransactionResponse, ar as outOfRangeErrorMessage, as as validateNumberInRange } from './accountAddress-fJZJVSBc.js';
3
+ import { CallArgument } from '@aptos-labs/script-composer-pack';
4
+ export { CallArgument } from '@aptos-labs/script-composer-pack';
3
5
  import EventEmitter from 'eventemitter3';
4
6
 
5
7
  type Maybe<T> = T | null;
@@ -3073,6 +3075,15 @@ declare class AccountAuthenticatorMultiKey extends AccountAuthenticator {
3073
3075
  serialize(serializer: Serializer): void;
3074
3076
  static load(deserializer: Deserializer): AccountAuthenticatorMultiKey;
3075
3077
  }
3078
+ /**
3079
+ * AccountAuthenticatorNoAccountAuthenticator for no account authenticator
3080
+ * It represents the absence of a public key for transaction simulation.
3081
+ * It allows skipping the public/auth key check during the simulation.
3082
+ */
3083
+ declare class AccountAuthenticatorNoAccountAuthenticator extends AccountAuthenticator {
3084
+ serialize(serializer: Serializer): void;
3085
+ static load(deserializer: Deserializer): AccountAuthenticatorNoAccountAuthenticator;
3086
+ }
3076
3087
 
3077
3088
  /**
3078
3089
  * Creates an object address from creator address and seed
@@ -4274,6 +4285,14 @@ type InputMultiSigDataWithABI = {
4274
4285
  type InputEntryFunctionDataWithRemoteABI = InputEntryFunctionData & {
4275
4286
  aptosConfig: AptosConfig;
4276
4287
  };
4288
+ /**
4289
+ * The data needed to generate a batched function payload
4290
+ */
4291
+ type InputBatchedFunctionData = {
4292
+ function: MoveFunctionId;
4293
+ typeArguments?: Array<TypeArgument>;
4294
+ functionArguments: Array<EntryFunctionArgumentTypes | CallArgument | SimpleEntryFunctionArgumentTypes>;
4295
+ };
4277
4296
  /**
4278
4297
  * The data needed to generate a Multi Sig payload
4279
4298
  */
@@ -4402,12 +4421,13 @@ type InputSimulateTransactionData = {
4402
4421
  transaction: AnyRawTransaction;
4403
4422
  /**
4404
4423
  * For a single signer transaction
4424
+ * This is optional and can be undefined to skip the public/auth key check during the transaction simulation.
4405
4425
  */
4406
- signerPublicKey: PublicKey;
4426
+ signerPublicKey?: PublicKey;
4407
4427
  /**
4408
4428
  * For a fee payer or multi-agent transaction that requires additional signers in
4409
4429
  */
4410
- secondarySignersPublicKeys?: Array<PublicKey>;
4430
+ secondarySignersPublicKeys?: Array<PublicKey | undefined>;
4411
4431
  /**
4412
4432
  * For a fee payer transaction (aka Sponsored Transaction)
4413
4433
  */
@@ -7767,7 +7787,7 @@ declare function buildTransaction(args: InputGenerateMultiAgentRawTransactionArg
7767
7787
  * @returns A signed serialized transaction that can be simulated.
7768
7788
  */
7769
7789
  declare function generateSignedTransactionForSimulation(args: InputSimulateTransactionData): Uint8Array;
7770
- declare function getAuthenticatorForSimulation(publicKey: PublicKey): AccountAuthenticatorEd25519 | AccountAuthenticatorSingleKey | AccountAuthenticatorMultiKey;
7790
+ declare function getAuthenticatorForSimulation(publicKey?: PublicKey): AccountAuthenticatorEd25519 | AccountAuthenticatorSingleKey | AccountAuthenticatorMultiKey | AccountAuthenticatorNoAccountAuthenticator;
7771
7791
  /**
7772
7792
  * Generate a signed transaction ready for submission to the blockchain.
7773
7793
  * This function prepares the transaction by authenticating the sender and any additional signers based on the provided arguments.
@@ -7818,6 +7838,14 @@ declare function standardizeTypeTags(typeArguments?: Array<TypeArgument>): Array
7818
7838
  * @param aptosConfig - The configuration settings for Aptos.
7819
7839
  */
7820
7840
  declare function fetchFunctionAbi(moduleAddress: string, moduleName: string, functionName: string, aptosConfig: AptosConfig): Promise<MoveFunction | undefined>;
7841
+ /**
7842
+ * Fetches a function ABI from the on-chain module ABI. It doesn't validate whether it's a view or entry function.
7843
+ * @param moduleAddress
7844
+ * @param moduleName
7845
+ * @param functionName
7846
+ * @param aptosConfig
7847
+ */
7848
+ declare function fetchMoveFunctionAbi(moduleAddress: string, moduleName: string, functionName: string, aptosConfig: AptosConfig): Promise<FunctionABI>;
7821
7849
  /**
7822
7850
  * Fetches the ABI for an entry function from the specified module address.
7823
7851
  * This function validates if the ABI corresponds to an entry function and retrieves its parameters.
@@ -7842,6 +7870,18 @@ declare function fetchEntryFunctionAbi(moduleAddress: string, moduleName: string
7842
7870
  * @throws Error if the ABI cannot be found or if the function is not a view function.
7843
7871
  */
7844
7872
  declare function fetchViewFunctionAbi(moduleAddress: string, moduleName: string, functionName: string, aptosConfig: AptosConfig): Promise<ViewFunctionABI>;
7873
+ /**
7874
+ * Converts a entry function argument into CallArgument, if necessary.
7875
+ * This function checks the provided argument against the expected parameter type and converts it accordingly.
7876
+ *
7877
+ * @param functionName - The name of the function for which the argument is being converted.
7878
+ * @param functionAbi - The ABI (Application Binary Interface) of the function, which defines its parameters.
7879
+ * @param argument - The argument to be converted, which can be of various types. If the argument is already
7880
+ * CallArgument returned from TransactionComposer it would be returned immediately.
7881
+ * @param position - The index of the argument in the function's parameter list.
7882
+ * @param genericTypeParams - An array of type tags for any generic type parameters.
7883
+ */
7884
+ declare function convertCallArgument(argument: CallArgument | EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes, functionName: string, functionAbi: FunctionABI, position: number, genericTypeParams: Array<TypeTag>): CallArgument;
7845
7885
  /**
7846
7886
  * Converts a non-BCS encoded argument into BCS encoded, if necessary.
7847
7887
  * This function checks the provided argument against the expected parameter type and converts it accordingly.
@@ -7973,6 +8013,14 @@ declare function parseTypeTag(typeStr: string, options?: {
7973
8013
  allowGenerics?: boolean;
7974
8014
  }): TypeTag;
7975
8015
 
8016
+ declare class AptosScriptComposer {
8017
+ private builder;
8018
+ private config;
8019
+ constructor(aptosConfig: AptosConfig);
8020
+ addBatchedCalls(input: InputBatchedFunctionData): Promise<CallArgument[]>;
8021
+ build(): Uint8Array;
8022
+ }
8023
+
7976
8024
  /**
7977
8025
  * A class for querying and managing fungible asset-related operations on the Aptos blockchain.
7978
8026
  */
@@ -9244,6 +9292,70 @@ declare class Build {
9244
9292
  options?: InputGenerateTransactionOptions;
9245
9293
  withFeePayer?: boolean;
9246
9294
  }): Promise<SimpleTransaction>;
9295
+ /**
9296
+ * Build a transaction from a series of Move calls.
9297
+ *
9298
+ * This function allows you to create a transaction with a list of Move calls.
9299
+ *
9300
+ * Right now we only tested this logic with single signer and we will add support
9301
+ * for mutli agent transactions if needed.
9302
+ *
9303
+ * @param args.sender - The sender account address.
9304
+ * @param args.builder - The closure to construct the list of calls.
9305
+ * @param args.options - Optional transaction configurations.
9306
+ * @param args.withFeePayer - Whether there is a fee payer for the transaction.
9307
+ *
9308
+ * @returns SimpleTransaction
9309
+ *
9310
+ * @example
9311
+ * ```typescript
9312
+ * import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
9313
+ *
9314
+ * const config = new AptosConfig({ network: Network.TESTNET });
9315
+ * const aptos = new Aptos(config);
9316
+ *
9317
+ * async function runExample() {
9318
+ * // Build a transaction from a chained series of Move calls.
9319
+ * const transaction = await aptos.transaction.script_composer({
9320
+ * sender: "0x1", // replace with a real sender account address
9321
+ * builder: builder: async (builder) => {
9322
+ * const coin = await builder.addBatchedCalls({
9323
+ * function: "0x1::coin::withdraw",
9324
+ * functionArguments: [CallArgument.new_signer(0), 1],
9325
+ * typeArguments: ["0x1::aptos_coin::AptosCoin"],
9326
+ * });
9327
+ *
9328
+ * // Pass the returned value from the first function call to the second call
9329
+ * const fungibleAsset = await builder.addBatchedCalls({
9330
+ * function: "0x1::coin::coin_to_fungible_asset",
9331
+ * functionArguments: [coin[0]],
9332
+ * typeArguments: ["0x1::aptos_coin::AptosCoin"],
9333
+ * });
9334
+ *
9335
+ * await builder.addBatchedCalls({
9336
+ * function: "0x1::primary_fungible_store::deposit",
9337
+ * functionArguments: [singleSignerED25519SenderAccount.accountAddress, fungibleAsset[0]],
9338
+ * typeArguments: [],
9339
+ * });
9340
+ * return builder;
9341
+ * },
9342
+ * options: {
9343
+ * gasUnitPrice: 100, // specify your own gas unit price if needed
9344
+ * maxGasAmount: 1000, // specify your own max gas amount if needed
9345
+ * },
9346
+ * });
9347
+ *
9348
+ * console.log(transaction);
9349
+ * }
9350
+ * runExample().catch(console.error);
9351
+ * ```
9352
+ */
9353
+ scriptComposer(args: {
9354
+ sender: AccountAddressInput;
9355
+ builder: (builder: AptosScriptComposer) => Promise<AptosScriptComposer>;
9356
+ options?: InputGenerateTransactionOptions;
9357
+ withFeePayer?: boolean;
9358
+ }): Promise<SimpleTransaction>;
9247
9359
  /**
9248
9360
  * Build a multi-agent transaction that allows multiple signers to authorize a transaction.
9249
9361
  *
@@ -9329,7 +9441,7 @@ declare class Simulate {
9329
9441
  * This function helps you understand the outcome of a transaction before executing it on the blockchain.
9330
9442
  *
9331
9443
  * @param args - The parameters for simulating the transaction.
9332
- * @param args.signerPublicKey - The public key of the signer for the transaction.
9444
+ * @param args.signerPublicKey - The public key of the signer for the transaction (optional).
9333
9445
  * @param args.transaction - The raw transaction data to simulate.
9334
9446
  * @param args.feePayerPublicKey - The public key of the fee payer (optional).
9335
9447
  * @param args.options - Additional options for simulating the transaction (optional).
@@ -9381,7 +9493,7 @@ declare class Simulate {
9381
9493
  * ```
9382
9494
  */
9383
9495
  simple(args: {
9384
- signerPublicKey: PublicKey;
9496
+ signerPublicKey?: PublicKey;
9385
9497
  transaction: AnyRawTransaction;
9386
9498
  feePayerPublicKey?: PublicKey;
9387
9499
  options?: InputSimulateTransactionOptions;
@@ -9391,11 +9503,12 @@ declare class Simulate {
9391
9503
  * This function helps in understanding the outcome of a transaction involving multiple signers before it is executed.
9392
9504
  *
9393
9505
  * @param args - The parameters for simulating the transaction.
9394
- * @param args.signerPublicKey - The public key of the primary signer.
9506
+ * @param args.signerPublicKey - The public key of the primary signer (optional).
9395
9507
  * @param args.transaction - The raw transaction to be simulated.
9396
- * @param args.secondarySignersPublicKeys - An array of public keys for secondary signers.
9397
- * @param args.feePayerPublicKey - (Optional) The public key of the fee payer.
9398
- * @param args.options - (Optional) Options for simulating the transaction.
9508
+ * @param args.secondarySignersPublicKeys - An array of public keys for secondary signers (optional).
9509
+ * Each element of the array can be optional, allowing the corresponding key check to be skipped.
9510
+ * @param args.feePayerPublicKey - The public key of the fee payer (optional).
9511
+ * @param args.options - Options for simulating the transaction (optional).
9399
9512
  *
9400
9513
  * @example
9401
9514
  * ```typescript
@@ -9453,9 +9566,9 @@ declare class Simulate {
9453
9566
  * ```
9454
9567
  */
9455
9568
  multiAgent(args: {
9456
- signerPublicKey: PublicKey;
9569
+ signerPublicKey?: PublicKey;
9457
9570
  transaction: AnyRawTransaction;
9458
- secondarySignersPublicKeys: Array<PublicKey>;
9571
+ secondarySignersPublicKeys?: Array<PublicKey | undefined>;
9459
9572
  feePayerPublicKey?: PublicKey;
9460
9573
  options?: InputSimulateTransactionOptions;
9461
9574
  }): Promise<Array<UserTransactionResponse>>;
@@ -11527,4 +11640,4 @@ declare class AptosApiError extends Error {
11527
11640
  constructor({ apiType, aptosRequest, aptosResponse }: AptosApiErrorOpts);
11528
11641
  }
11529
11642
 
11530
- export { APTOS_BIP44_REGEX, APTOS_COIN, APTOS_FA, APTOS_HARDENED_REGEX, AbstractKeylessAccount, Account$1 as Account, AccountAddress, AccountAddressInput, AccountAuthenticator, AccountAuthenticatorEd25519, AccountAuthenticatorMultiEd25519, AccountAuthenticatorMultiKey, AccountAuthenticatorSingleKey, AccountData, AccountPublicKey, AccountSequenceNumber, AnyNumber, AnyPublicKey, AnyPublicKeyVariant, type AnyRawTransaction, type AnyRawTransactionInstance, AnySignature, type AnyTransactionPayloadInstance, Aptos, AptosApiError, AptosApiType, AptosConfig, AptosRequest, AptosResponse, AptosSettings, AuthenticationKey, AuthenticationKeyScheme, Block, Bool, CKDPriv, ChainId, Client, ClientConfig, ClientRequest, ClientResponse, CommittedTransactionResponse, type CreateAccountFromPrivateKeyArgs, type CreateEd25519AccountFromPrivateKeyArgs, type CreateEd25519SingleKeyAccountFromPrivateKeyArgs, type CreateSingleKeyAccountFromPrivateKeyArgs, DEFAULT_MAX_GAS_AMOUNT, DEFAULT_TXN_EXP_SEC_FROM_NOW, DEFAULT_TXN_TIMEOUT_SEC, type DerivedKeys, Deserializable, type DeserializableClass, Deserializer, EPK_HORIZON_SECS, Ed25519Account, Ed25519PrivateKey, Ed25519PublicKey, Ed25519Signature, type Ed25519SignerConstructorArgs, type Ed25519SignerFromDerivationPathArgs, EntryFunction, type EntryFunctionABI, EntryFunctionArgument, type EntryFunctionArgumentTypes, EntryFunctionBytes, EphemeralCertificate, EphemeralCertificateVariant, EphemeralKeyPair, EphemeralPublicKey, EphemeralPublicKeyVariant, EphemeralSignature, type ExecutionFinishEventData, FIREBASE_AUTH_ISS_PATTERN, type FailureEventData, FaucetConfig, FederatedKeylessAccount, FederatedKeylessPublicKey, FeePayerRawTransaction, FixedBytes, FullNodeConfig, type FunctionABI, GasEstimation, type GenerateAccountArgs, type GenerateEd25519AccountArgs, type GenerateEd25519SingleKeyAccountArgs, type GenerateSingleKeyAccountArgs, GetANSNameResponse, GetAccountCoinsDataResponse, GetAccountCollectionsWithOwnedTokenResponse, GetAccountOwnedTokensFromCollectionResponse, GetAccountOwnedTokensQueryResponse, type GetAptosRequestOptions, GetChainTopUserTransactionsResponse, GetCollectionDataResponse, GetCurrentFungibleAssetBalancesResponse, GetCurrentTokenOwnershipResponse, GetDelegatedStakingActivitiesResponse, GetEventsResponse, GetFungibleAssetActivitiesResponse, GetFungibleAssetMetadataResponse, GetNumberOfDelegatorsResponse, GetObjectDataQueryResponse, GetOwnedTokensResponse, GetProcessorStatusResponse, type GetRequestOptions, GetTableItemsDataResponse, GetTableItemsMetadataResponse, GetTokenActivityResponse, GetTokenDataResponse, GraphqlQuery, Groth16VerificationKey, Groth16Zkp, HARDENED_OFFSET, Hex, HexInput, Identifier, IndexerConfig, type InputEntryFunctionData, type InputEntryFunctionDataWithABI, type InputEntryFunctionDataWithRemoteABI, type InputGenerateMultiAgentRawTransactionArgs, type InputGenerateMultiAgentRawTransactionData, type InputGenerateRawTransactionArgs, type InputGenerateSingleSignerRawTransactionArgs, type InputGenerateSingleSignerRawTransactionData, type InputGenerateTransactionData, type InputGenerateTransactionOptions, type InputGenerateTransactionPayloadData, type InputGenerateTransactionPayloadDataWithABI, type InputGenerateTransactionPayloadDataWithRemoteABI, type InputMultiSigData, type InputMultiSigDataWithABI, type InputMultiSigDataWithRemoteABI, type InputScriptData, type InputSimulateTransactionData, type InputSimulateTransactionOptions, type InputSubmitTransactionData, type InputViewFunctionData, type InputViewFunctionDataWithABI, type InputViewFunctionDataWithRemoteABI, type InputViewFunctionJsonData, KeyType, KeylessAccount, KeylessConfiguration, KeylessError, KeylessErrorCategory, KeylessErrorResolutionTip, KeylessErrorType, KeylessPublicKey, KeylessSignature, type KeylessSigner, LedgerInfo, LedgerVersionArg, MAX_AUD_VAL_BYTES, MAX_COMMITED_EPK_BYTES, MAX_EXTRA_FIELD_BYTES, MAX_ISS_VAL_BYTES, MAX_JWT_HEADER_B64_BYTES, MAX_UID_KEY_BYTES, MAX_UID_VAL_BYTES, MimeType, ModuleId, MoveFunction, MoveFunctionGenericTypeParam, MoveFunctionId, MoveJWK, MoveModuleBytecode, MoveModuleId, MoveOption, MoveResource, MoveString, MoveStructId, MoveValue, MoveVector, MultiAgentRawTransaction, MultiAgentTransaction, MultiEd25519PublicKey, MultiEd25519Signature, MultiKey, MultiKeyAccount, MultiKeySignature, MultiSig, MultiSigTransactionPayload, Network, OrderByArg, PaginationArgs, PendingTransactionResponse, type PostAptosRequestOptions, type PostRequestOptions, PrivateKey, type PrivateKeyFromDerivationPathArgs, PrivateKeyVariants, ProcessorType, type ProofFetchCallback, type ProofFetchEvents, type ProofFetchFailure, type ProofFetchStatus, type ProofFetchSuccess, PublicKey, RAW_TRANSACTION_SALT, RAW_TRANSACTION_WITH_DATA_SALT, RawTransaction, RawTransactionWithData, RotationProofChallenge, Script, ScriptFunctionArgument, type ScriptFunctionArgumentTypes, Secp256k1PrivateKey, Secp256k1PublicKey, Secp256k1Signature, Serializable, Serialized, Serializer, Signature, SignedTransaction, SigningScheme, SigningSchemeInput, type SimpleEntryFunctionArgumentTypes, SimpleTransaction, SingleKeyAccount, type SingleKeySignerConstructorArgs, type SingleKeySignerFromDerivationPathArgs, type SingleKeySignerGenerateArgs, StructTag, type SuccessEventData, TableItemRequest, TokenStandardArg, TransactionAndProof, TransactionArgument, TransactionAuthenticator, TransactionAuthenticatorEd25519, TransactionAuthenticatorFeePayer, TransactionAuthenticatorMultiAgent, TransactionAuthenticatorMultiEd25519, TransactionAuthenticatorSingleSender, TransactionPayload, TransactionPayloadEntryFunction, TransactionPayloadMultiSig, TransactionPayloadScript, TransactionResponse, TransactionWorker, type TransactionWorkerEvents, TransactionWorkerEventsEnum, type TypeArgument, TypeTag, TypeTagAddress, TypeTagBool, TypeTagGeneric, TypeTagParserError, TypeTagParserErrorType, TypeTagReference, TypeTagSigner, TypeTagStruct, TypeTagU128, TypeTagU16, TypeTagU256, TypeTagU32, TypeTagU64, TypeTagU8, TypeTagVector, U128, U16, U256, U32, U64, U8, Uint16, Uint32, Uint8, UserTransactionResponse, type VerifyEd25519SignatureArgs, type VerifyMultiKeySignatureArgs, type VerifySignatureArgs, type VerifySingleKeySignatureArgs, type ViewFunctionABI, type ViewFunctionJsonPayload, WaitForTransactionOptions, WhereArg, ZeroKnowledgeSig, ZkProof, ZkpVariant, aptosCoinStructTag, aptosRequest, base64UrlDecode, bigIntToBytesLE, buildTransaction, bytesToBigIntLE, checkOrConvertArgument, convertAmountFromHumanReadableToOnChain, convertAmountFromOnChainToHumanReadable, convertArgument, convertNumber, createObjectAddress, createResourceAddress, createTokenAddress, deriveKey, deriveTransactionType, deserializeFromScriptArgument, fetchEntryFunctionAbi, fetchFunctionAbi, fetchViewFunctionAbi, findFirstNonSignerArg, floorToWholeHour, generateRawTransaction, generateSignedTransaction, generateSignedTransactionForSimulation, generateSigningMessage, generateSigningMessageForSerializable, generateSigningMessageForTransaction, generateTransactionPayload, generateTransactionPayloadWithABI, generateUserTransactionHash, generateViewFunctionPayload, generateViewFunctionPayloadWithABI, get, getAptosFullNode, getAptosPepperService, getAuthenticatorForSimulation, getErrorMessage, getFunctionParts, getIssAudAndUidVal, getKeylessConfig, getKeylessJWKs, hashStrToField, hashValues, isBcsAddress, isBcsBool, isBcsFixedBytes, isBcsString, isBcsU128, isBcsU16, isBcsU256, isBcsU32, isBcsU64, isBcsU8, isBool, isCanonicalEd25519Signature, isEmptyOption, isEncodedEntryFunctionArgument, isEncodedStruct, isKeylessSigner, isLargeNumber, isNumber, isScriptDataInput, isString, isValidBIP44Path, isValidHardenedPath, mnemonicToSeed, normalizeBundle, nowInSeconds, objectStructTag, optionStructTag, padAndPackBytesWithLen, paginateWithCursor, parseEncodedStruct, parseJwtHeader, parseTypeTag, poseidonHash, post, postAptosFaucet, postAptosFullNode, postAptosIndexer, postAptosPepperService, postAptosProvingService, promiseFulfilledStatus, request, sleep, splitPath, standardizeTypeTags, stringStructTag, throwTypeMismatch };
11643
+ export { APTOS_BIP44_REGEX, APTOS_COIN, APTOS_FA, APTOS_HARDENED_REGEX, AbstractKeylessAccount, Account$1 as Account, AccountAddress, AccountAddressInput, AccountAuthenticator, AccountAuthenticatorEd25519, AccountAuthenticatorMultiEd25519, AccountAuthenticatorMultiKey, AccountAuthenticatorNoAccountAuthenticator, AccountAuthenticatorSingleKey, AccountData, AccountPublicKey, AccountSequenceNumber, AnyNumber, AnyPublicKey, AnyPublicKeyVariant, type AnyRawTransaction, type AnyRawTransactionInstance, AnySignature, type AnyTransactionPayloadInstance, Aptos, AptosApiError, AptosApiType, AptosConfig, AptosRequest, AptosResponse, AptosScriptComposer, AptosSettings, AuthenticationKey, AuthenticationKeyScheme, Block, Bool, CKDPriv, ChainId, Client, ClientConfig, ClientRequest, ClientResponse, CommittedTransactionResponse, type CreateAccountFromPrivateKeyArgs, type CreateEd25519AccountFromPrivateKeyArgs, type CreateEd25519SingleKeyAccountFromPrivateKeyArgs, type CreateSingleKeyAccountFromPrivateKeyArgs, DEFAULT_MAX_GAS_AMOUNT, DEFAULT_TXN_EXP_SEC_FROM_NOW, DEFAULT_TXN_TIMEOUT_SEC, type DerivedKeys, Deserializable, type DeserializableClass, Deserializer, EPK_HORIZON_SECS, Ed25519Account, Ed25519PrivateKey, Ed25519PublicKey, Ed25519Signature, type Ed25519SignerConstructorArgs, type Ed25519SignerFromDerivationPathArgs, EntryFunction, type EntryFunctionABI, EntryFunctionArgument, type EntryFunctionArgumentTypes, EntryFunctionBytes, EphemeralCertificate, EphemeralCertificateVariant, EphemeralKeyPair, EphemeralPublicKey, EphemeralPublicKeyVariant, EphemeralSignature, type ExecutionFinishEventData, FIREBASE_AUTH_ISS_PATTERN, type FailureEventData, FaucetConfig, FederatedKeylessAccount, FederatedKeylessPublicKey, FeePayerRawTransaction, FixedBytes, FullNodeConfig, type FunctionABI, GasEstimation, type GenerateAccountArgs, type GenerateEd25519AccountArgs, type GenerateEd25519SingleKeyAccountArgs, type GenerateSingleKeyAccountArgs, GetANSNameResponse, GetAccountCoinsDataResponse, GetAccountCollectionsWithOwnedTokenResponse, GetAccountOwnedTokensFromCollectionResponse, GetAccountOwnedTokensQueryResponse, type GetAptosRequestOptions, GetChainTopUserTransactionsResponse, GetCollectionDataResponse, GetCurrentFungibleAssetBalancesResponse, GetCurrentTokenOwnershipResponse, GetDelegatedStakingActivitiesResponse, GetEventsResponse, GetFungibleAssetActivitiesResponse, GetFungibleAssetMetadataResponse, GetNumberOfDelegatorsResponse, GetObjectDataQueryResponse, GetOwnedTokensResponse, GetProcessorStatusResponse, type GetRequestOptions, GetTableItemsDataResponse, GetTableItemsMetadataResponse, GetTokenActivityResponse, GetTokenDataResponse, GraphqlQuery, Groth16VerificationKey, Groth16Zkp, HARDENED_OFFSET, Hex, HexInput, Identifier, IndexerConfig, type InputBatchedFunctionData, type InputEntryFunctionData, type InputEntryFunctionDataWithABI, type InputEntryFunctionDataWithRemoteABI, type InputGenerateMultiAgentRawTransactionArgs, type InputGenerateMultiAgentRawTransactionData, type InputGenerateRawTransactionArgs, type InputGenerateSingleSignerRawTransactionArgs, type InputGenerateSingleSignerRawTransactionData, type InputGenerateTransactionData, type InputGenerateTransactionOptions, type InputGenerateTransactionPayloadData, type InputGenerateTransactionPayloadDataWithABI, type InputGenerateTransactionPayloadDataWithRemoteABI, type InputMultiSigData, type InputMultiSigDataWithABI, type InputMultiSigDataWithRemoteABI, type InputScriptData, type InputSimulateTransactionData, type InputSimulateTransactionOptions, type InputSubmitTransactionData, type InputViewFunctionData, type InputViewFunctionDataWithABI, type InputViewFunctionDataWithRemoteABI, type InputViewFunctionJsonData, KeyType, KeylessAccount, KeylessConfiguration, KeylessError, KeylessErrorCategory, KeylessErrorResolutionTip, KeylessErrorType, KeylessPublicKey, KeylessSignature, type KeylessSigner, LedgerInfo, LedgerVersionArg, MAX_AUD_VAL_BYTES, MAX_COMMITED_EPK_BYTES, MAX_EXTRA_FIELD_BYTES, MAX_ISS_VAL_BYTES, MAX_JWT_HEADER_B64_BYTES, MAX_UID_KEY_BYTES, MAX_UID_VAL_BYTES, MimeType, ModuleId, MoveFunction, MoveFunctionGenericTypeParam, MoveFunctionId, MoveJWK, MoveModuleBytecode, MoveModuleId, MoveOption, MoveResource, MoveString, MoveStructId, MoveValue, MoveVector, MultiAgentRawTransaction, MultiAgentTransaction, MultiEd25519PublicKey, MultiEd25519Signature, MultiKey, MultiKeyAccount, MultiKeySignature, MultiSig, MultiSigTransactionPayload, Network, OrderByArg, PaginationArgs, PendingTransactionResponse, type PostAptosRequestOptions, type PostRequestOptions, PrivateKey, type PrivateKeyFromDerivationPathArgs, PrivateKeyVariants, ProcessorType, type ProofFetchCallback, type ProofFetchEvents, type ProofFetchFailure, type ProofFetchStatus, type ProofFetchSuccess, PublicKey, RAW_TRANSACTION_SALT, RAW_TRANSACTION_WITH_DATA_SALT, RawTransaction, RawTransactionWithData, RotationProofChallenge, Script, ScriptFunctionArgument, type ScriptFunctionArgumentTypes, Secp256k1PrivateKey, Secp256k1PublicKey, Secp256k1Signature, Serializable, Serialized, Serializer, Signature, SignedTransaction, SigningScheme, SigningSchemeInput, type SimpleEntryFunctionArgumentTypes, SimpleTransaction, SingleKeyAccount, type SingleKeySignerConstructorArgs, type SingleKeySignerFromDerivationPathArgs, type SingleKeySignerGenerateArgs, StructTag, type SuccessEventData, TableItemRequest, TokenStandardArg, TransactionAndProof, TransactionArgument, TransactionAuthenticator, TransactionAuthenticatorEd25519, TransactionAuthenticatorFeePayer, TransactionAuthenticatorMultiAgent, TransactionAuthenticatorMultiEd25519, TransactionAuthenticatorSingleSender, TransactionPayload, TransactionPayloadEntryFunction, TransactionPayloadMultiSig, TransactionPayloadScript, TransactionResponse, TransactionWorker, type TransactionWorkerEvents, TransactionWorkerEventsEnum, type TypeArgument, TypeTag, TypeTagAddress, TypeTagBool, TypeTagGeneric, TypeTagParserError, TypeTagParserErrorType, TypeTagReference, TypeTagSigner, TypeTagStruct, TypeTagU128, TypeTagU16, TypeTagU256, TypeTagU32, TypeTagU64, TypeTagU8, TypeTagVector, U128, U16, U256, U32, U64, U8, Uint16, Uint32, Uint8, UserTransactionResponse, type VerifyEd25519SignatureArgs, type VerifyMultiKeySignatureArgs, type VerifySignatureArgs, type VerifySingleKeySignatureArgs, type ViewFunctionABI, type ViewFunctionJsonPayload, WaitForTransactionOptions, WhereArg, ZeroKnowledgeSig, ZkProof, ZkpVariant, aptosCoinStructTag, aptosRequest, base64UrlDecode, bigIntToBytesLE, buildTransaction, bytesToBigIntLE, checkOrConvertArgument, convertAmountFromHumanReadableToOnChain, convertAmountFromOnChainToHumanReadable, convertArgument, convertCallArgument, convertNumber, createObjectAddress, createResourceAddress, createTokenAddress, deriveKey, deriveTransactionType, deserializeFromScriptArgument, fetchEntryFunctionAbi, fetchFunctionAbi, fetchMoveFunctionAbi, fetchViewFunctionAbi, findFirstNonSignerArg, floorToWholeHour, generateRawTransaction, generateSignedTransaction, generateSignedTransactionForSimulation, generateSigningMessage, generateSigningMessageForSerializable, generateSigningMessageForTransaction, generateTransactionPayload, generateTransactionPayloadWithABI, generateUserTransactionHash, generateViewFunctionPayload, generateViewFunctionPayloadWithABI, get, getAptosFullNode, getAptosPepperService, getAuthenticatorForSimulation, getErrorMessage, getFunctionParts, getIssAudAndUidVal, getKeylessConfig, getKeylessJWKs, hashStrToField, hashValues, isBcsAddress, isBcsBool, isBcsFixedBytes, isBcsString, isBcsU128, isBcsU16, isBcsU256, isBcsU32, isBcsU64, isBcsU8, isBool, isCanonicalEd25519Signature, isEmptyOption, isEncodedEntryFunctionArgument, isEncodedStruct, isKeylessSigner, isLargeNumber, isNumber, isScriptDataInput, isString, isValidBIP44Path, isValidHardenedPath, mnemonicToSeed, normalizeBundle, nowInSeconds, objectStructTag, optionStructTag, padAndPackBytesWithLen, paginateWithCursor, parseEncodedStruct, parseJwtHeader, parseTypeTag, poseidonHash, post, postAptosFaucet, postAptosFullNode, postAptosIndexer, postAptosPepperService, postAptosProvingService, promiseFulfilledStatus, request, sleep, splitPath, standardizeTypeTags, stringStructTag, throwTypeMismatch };