@aptos-labs/ts-sdk 1.27.1 → 1.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (288) hide show
  1. package/dist/common/{accountAddress-LOYE4_sG.d.ts → accountAddress-OVl7-qVN.d.ts} +2 -1
  2. package/dist/common/chunk-HBPH2AD3.js +2 -0
  3. package/dist/common/chunk-HBPH2AD3.js.map +1 -0
  4. package/dist/common/cli/index.d.ts +1 -1
  5. package/dist/common/cli/index.js +1 -1
  6. package/dist/common/cli/index.js.map +1 -1
  7. package/dist/common/index.d.ts +51 -5
  8. package/dist/common/index.js +27 -27
  9. package/dist/common/index.js.map +1 -1
  10. package/dist/esm/account/Account.mjs +1 -1
  11. package/dist/esm/account/Ed25519Account.mjs +1 -1
  12. package/dist/esm/account/EphemeralKeyPair.mjs +1 -1
  13. package/dist/esm/account/KeylessAccount.mjs +1 -1
  14. package/dist/esm/account/MultiKeyAccount.d.mts +2 -1
  15. package/dist/esm/account/MultiKeyAccount.mjs +1 -1
  16. package/dist/esm/account/SingleKeyAccount.mjs +1 -1
  17. package/dist/esm/account/index.mjs +1 -1
  18. package/dist/esm/api/account.d.mts +2 -1
  19. package/dist/esm/api/account.mjs +1 -1
  20. package/dist/esm/api/ans.mjs +1 -1
  21. package/dist/esm/api/aptos.mjs +1 -1
  22. package/dist/esm/api/aptosConfig.mjs +1 -1
  23. package/dist/esm/api/coin.mjs +1 -1
  24. package/dist/esm/api/digitalAsset.mjs +1 -1
  25. package/dist/esm/api/event.mjs +1 -1
  26. package/dist/esm/api/faucet.mjs +1 -1
  27. package/dist/esm/api/fungibleAsset.mjs +1 -1
  28. package/dist/esm/api/general.mjs +1 -1
  29. package/dist/esm/api/index.mjs +1 -1
  30. package/dist/esm/api/keyless.mjs +1 -1
  31. package/dist/esm/api/object.mjs +1 -1
  32. package/dist/esm/api/staking.mjs +1 -1
  33. package/dist/esm/api/table.mjs +1 -1
  34. package/dist/esm/api/transaction.mjs +1 -1
  35. package/dist/esm/api/transactionSubmission/build.mjs +1 -1
  36. package/dist/esm/api/transactionSubmission/management.mjs +1 -1
  37. package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
  38. package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
  39. package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
  40. package/dist/esm/api/utils.mjs +1 -1
  41. package/dist/esm/bcs/index.d.mts +1 -1
  42. package/dist/esm/bcs/index.mjs +1 -1
  43. package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
  44. package/dist/esm/bcs/serializable/moveStructs.d.mts +10 -1
  45. package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
  46. package/dist/esm/{chunk-NCWD4NA3.mjs → chunk-2CAGPXCX.mjs} +2 -2
  47. package/dist/esm/{chunk-Q67DUNMI.mjs → chunk-2XYA7NOU.mjs} +2 -2
  48. package/dist/esm/{chunk-2N2VEGT6.mjs → chunk-3F3FCWT5.mjs} +2 -2
  49. package/dist/esm/{chunk-3SPU4V2B.mjs → chunk-3GOJQ5JD.mjs} +2 -2
  50. package/dist/esm/{chunk-G7UNU5GI.mjs → chunk-3HTSCV3R.mjs} +2 -2
  51. package/dist/esm/{chunk-H33YIMTU.mjs → chunk-4ENUSVZB.mjs} +2 -2
  52. package/dist/esm/chunk-52HZTDBB.mjs +2 -0
  53. package/dist/esm/chunk-52HZTDBB.mjs.map +1 -0
  54. package/dist/esm/{chunk-76HTG7Z7.mjs → chunk-53DBMWMU.mjs} +2 -2
  55. package/dist/esm/{chunk-I5XQKNOK.mjs → chunk-54QUDAAC.mjs} +2 -2
  56. package/dist/esm/{chunk-7AIKM3UF.mjs → chunk-56F7EYFE.mjs} +2 -2
  57. package/dist/esm/{chunk-JKNTGRSQ.mjs → chunk-5L3UXSQI.mjs} +2 -2
  58. package/dist/esm/{chunk-PY4TS34X.mjs → chunk-5P7MXLZA.mjs} +2 -2
  59. package/dist/esm/{chunk-6BYVG7H4.mjs → chunk-5TBIWC7N.mjs} +2 -2
  60. package/dist/esm/{chunk-ZQFFRZJ4.mjs → chunk-6CHBLB3V.mjs} +2 -2
  61. package/dist/esm/{chunk-NRRADUK4.mjs → chunk-AVSM2BJR.mjs} +2 -2
  62. package/dist/esm/{chunk-52KPINA4.mjs → chunk-B5NYEWNM.mjs} +2 -2
  63. package/dist/esm/{chunk-74YFNJ7A.mjs → chunk-BIGX2RJL.mjs} +2 -2
  64. package/dist/esm/chunk-DCNBMUKN.mjs +2 -0
  65. package/dist/esm/chunk-DCNBMUKN.mjs.map +1 -0
  66. package/dist/esm/{chunk-AYX5JMB4.mjs → chunk-DVIRUFCY.mjs} +2 -2
  67. package/dist/esm/{chunk-UV7M72QD.mjs → chunk-EJMPY5MF.mjs} +2 -2
  68. package/dist/esm/{chunk-F7NVDHR2.mjs → chunk-EQSON7Y5.mjs} +2 -2
  69. package/dist/esm/{chunk-GNFEBKFV.mjs → chunk-EXMQBH3I.mjs} +2 -2
  70. package/dist/esm/chunk-EXP5STXZ.mjs +2 -0
  71. package/dist/esm/chunk-EXP5STXZ.mjs.map +1 -0
  72. package/dist/esm/{chunk-UO52TECC.mjs → chunk-F5PNGH44.mjs} +2 -2
  73. package/dist/esm/chunk-G773HST5.mjs +2 -0
  74. package/dist/esm/chunk-G773HST5.mjs.map +1 -0
  75. package/dist/esm/{chunk-FOHGSNYZ.mjs → chunk-GGPA6QTN.mjs} +2 -2
  76. package/dist/esm/{chunk-QV6EZL2G.mjs → chunk-GKERWKMB.mjs} +2 -2
  77. package/dist/esm/{chunk-Y3HLYCF3.mjs → chunk-GR4PHW7K.mjs} +2 -2
  78. package/dist/esm/{chunk-MLL54PYO.mjs → chunk-HAT5S2XX.mjs} +2 -2
  79. package/dist/esm/{chunk-MLL54PYO.mjs.map → chunk-HAT5S2XX.mjs.map} +1 -1
  80. package/dist/esm/{chunk-ZXPBRVOA.mjs → chunk-HBQLX5QF.mjs} +2 -2
  81. package/dist/esm/{chunk-RA3YPQG2.mjs → chunk-IVOEXGOG.mjs} +2 -2
  82. package/dist/esm/{chunk-5L3PLK3W.mjs → chunk-JOROI7FE.mjs} +2 -2
  83. package/dist/esm/chunk-JUNVPIW4.mjs +2 -0
  84. package/dist/esm/chunk-JUNVPIW4.mjs.map +1 -0
  85. package/dist/esm/{chunk-T2NJUIOQ.mjs → chunk-KRIIRH5L.mjs} +2 -2
  86. package/dist/esm/{chunk-7Y3MRBG6.mjs → chunk-LFUBUXHD.mjs} +2 -2
  87. package/dist/esm/{chunk-YXITAP46.mjs → chunk-LJZPPBTH.mjs} +2 -2
  88. package/dist/esm/{chunk-5IUXBOS5.mjs → chunk-LS6G4DZV.mjs} +2 -2
  89. package/dist/esm/{chunk-GXTEJ7NO.mjs → chunk-MNVDBUF3.mjs} +2 -2
  90. package/dist/esm/{chunk-ORXEFE6X.mjs → chunk-NBO2BDDZ.mjs} +2 -2
  91. package/dist/esm/{chunk-2CC67KW5.mjs → chunk-NDJKEFNU.mjs} +2 -2
  92. package/dist/esm/{chunk-A4T373F3.mjs → chunk-NKDHR2DA.mjs} +2 -2
  93. package/dist/esm/{chunk-FNT3VLRD.mjs → chunk-NPFW6ZFY.mjs} +2 -2
  94. package/dist/esm/{chunk-KEN2VRIM.mjs → chunk-OPTI3MH2.mjs} +2 -2
  95. package/dist/esm/{chunk-QE5OL6KN.mjs → chunk-ORGMRM5K.mjs} +2 -2
  96. package/dist/esm/{chunk-SONTIUAM.mjs → chunk-OTNGLTKS.mjs} +2 -2
  97. package/dist/esm/{chunk-CTJX4CUF.mjs → chunk-P2EKDA7R.mjs} +2 -2
  98. package/dist/esm/{chunk-GHKMF253.mjs → chunk-PDNA4H34.mjs} +2 -2
  99. package/dist/esm/{chunk-ECKJI2TV.mjs → chunk-QQHA2Y46.mjs} +2 -2
  100. package/dist/esm/chunk-QQU4IQ27.mjs +2 -0
  101. package/dist/esm/chunk-QQU4IQ27.mjs.map +1 -0
  102. package/dist/esm/{chunk-WHW4Z7TK.mjs → chunk-SCYGW3VV.mjs} +2 -2
  103. package/dist/esm/{chunk-3NRBTP3S.mjs → chunk-SUAA25UP.mjs} +2 -2
  104. package/dist/esm/{chunk-YY2XW5R4.mjs → chunk-T53MZO2U.mjs} +2 -2
  105. package/dist/esm/chunk-UAL27G6B.mjs +2 -0
  106. package/dist/esm/chunk-UAL27G6B.mjs.map +1 -0
  107. package/dist/esm/{chunk-MEKXPGK7.mjs → chunk-VQVNUN5Y.mjs} +2 -2
  108. package/dist/esm/{chunk-WFOYGJS5.mjs → chunk-VTEZ6TBO.mjs} +2 -2
  109. package/dist/esm/{chunk-OEOUZFHD.mjs → chunk-VYXJ7FUF.mjs} +2 -2
  110. package/dist/esm/{chunk-4ZMI5G5L.mjs → chunk-VYXS7TLB.mjs} +2 -2
  111. package/dist/esm/{chunk-HKMG3LZX.mjs → chunk-WLZYSLHP.mjs} +2 -2
  112. package/dist/esm/{chunk-6ERHGCK2.mjs → chunk-WX6P3Q4I.mjs} +2 -2
  113. package/dist/esm/{chunk-USOIC4HO.mjs → chunk-WYQLUB4H.mjs} +2 -2
  114. package/dist/esm/{chunk-HHU7UCFI.mjs → chunk-XSTCHOUI.mjs} +2 -2
  115. package/dist/esm/chunk-XSTCHOUI.mjs.map +1 -0
  116. package/dist/esm/{chunk-ZZRSKHWS.mjs → chunk-YFMFXRJX.mjs} +2 -2
  117. package/dist/esm/{chunk-PO33LVUF.mjs → chunk-YPQZJ72F.mjs} +2 -2
  118. package/dist/esm/chunk-Z2AJWV6D.mjs +2 -0
  119. package/dist/esm/chunk-Z2AJWV6D.mjs.map +1 -0
  120. package/dist/esm/{chunk-HRIYZBXY.mjs → chunk-ZNC3FRSK.mjs} +2 -2
  121. package/dist/esm/{chunk-NU55IEL4.mjs → chunk-ZWX3NHGU.mjs} +2 -2
  122. package/dist/esm/chunk-ZXVQ2OBJ.mjs +2 -0
  123. package/dist/esm/{chunk-ZEYOFDIO.mjs.map → chunk-ZXVQ2OBJ.mjs.map} +1 -1
  124. package/dist/esm/cli/index.mjs +1 -1
  125. package/dist/esm/cli/localNode.mjs +1 -1
  126. package/dist/esm/cli/move.mjs +1 -1
  127. package/dist/esm/client/core.mjs +1 -1
  128. package/dist/esm/client/get.mjs +1 -1
  129. package/dist/esm/client/index.mjs +1 -1
  130. package/dist/esm/client/post.mjs +1 -1
  131. package/dist/esm/client/types.mjs +1 -1
  132. package/dist/esm/core/account/index.mjs +1 -1
  133. package/dist/esm/core/account/utils/address.mjs +1 -1
  134. package/dist/esm/core/account/utils/index.mjs +1 -1
  135. package/dist/esm/core/accountAddress.mjs +1 -1
  136. package/dist/esm/core/authenticationKey.mjs +1 -1
  137. package/dist/esm/core/crypto/ed25519.mjs +1 -1
  138. package/dist/esm/core/crypto/ephemeral.mjs +1 -1
  139. package/dist/esm/core/crypto/index.mjs +1 -1
  140. package/dist/esm/core/crypto/keyless.mjs +1 -1
  141. package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
  142. package/dist/esm/core/crypto/multiKey.mjs +1 -1
  143. package/dist/esm/core/crypto/proof.mjs +1 -1
  144. package/dist/esm/core/crypto/publicKey.mjs +1 -1
  145. package/dist/esm/core/crypto/secp256k1.mjs +1 -1
  146. package/dist/esm/core/crypto/signature.mjs +1 -1
  147. package/dist/esm/core/crypto/singleKey.mjs +1 -1
  148. package/dist/esm/core/index.mjs +1 -1
  149. package/dist/esm/index.d.mts +3 -3
  150. package/dist/esm/index.mjs +1 -1
  151. package/dist/esm/internal/account.mjs +1 -1
  152. package/dist/esm/internal/ans.mjs +1 -1
  153. package/dist/esm/internal/coin.mjs +1 -1
  154. package/dist/esm/internal/digitalAsset.mjs +1 -1
  155. package/dist/esm/internal/event.mjs +1 -1
  156. package/dist/esm/internal/faucet.mjs +1 -1
  157. package/dist/esm/internal/fungibleAsset.mjs +1 -1
  158. package/dist/esm/internal/general.mjs +1 -1
  159. package/dist/esm/internal/keyless.mjs +1 -1
  160. package/dist/esm/internal/object.mjs +1 -1
  161. package/dist/esm/internal/staking.mjs +1 -1
  162. package/dist/esm/internal/table.mjs +1 -1
  163. package/dist/esm/internal/transaction.mjs +1 -1
  164. package/dist/esm/internal/transactionSubmission.mjs +1 -1
  165. package/dist/esm/internal/view.mjs +1 -1
  166. package/dist/esm/transactions/authenticator/account.mjs +1 -1
  167. package/dist/esm/transactions/authenticator/index.mjs +1 -1
  168. package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
  169. package/dist/esm/transactions/index.mjs +1 -1
  170. package/dist/esm/transactions/instances/index.mjs +1 -1
  171. package/dist/esm/transactions/instances/moduleId.mjs +1 -1
  172. package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
  173. package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
  174. package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
  175. package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
  176. package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
  177. package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
  178. package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
  179. package/dist/esm/transactions/management/index.mjs +1 -1
  180. package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
  181. package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
  182. package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
  183. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
  184. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
  185. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
  186. package/dist/esm/transactions/typeTag/index.mjs +1 -1
  187. package/dist/esm/transactions/typeTag/parser.mjs +1 -1
  188. package/dist/esm/transactions/types.d.mts +2 -2
  189. package/dist/esm/types/index.d.mts +2 -1
  190. package/dist/esm/types/index.mjs +1 -1
  191. package/dist/esm/utils/const.d.mts +2 -1
  192. package/dist/esm/utils/const.mjs +1 -1
  193. package/dist/esm/utils/helpers.d.mts +41 -1
  194. package/dist/esm/utils/helpers.mjs +1 -1
  195. package/dist/esm/utils/index.d.mts +2 -2
  196. package/dist/esm/utils/index.mjs +1 -1
  197. package/dist/esm/utils/normalizeBundle.mjs +1 -1
  198. package/dist/esm/version.d.mts +1 -1
  199. package/dist/esm/version.mjs +1 -1
  200. package/package.json +1 -1
  201. package/src/account/MultiKeyAccount.ts +4 -4
  202. package/src/api/account.ts +31 -4
  203. package/src/bcs/serializable/moveStructs.ts +41 -8
  204. package/src/cli/move.ts +1 -1
  205. package/src/internal/account.ts +6 -5
  206. package/src/internal/event.ts +10 -3
  207. package/src/transactions/instances/transactionPayload.ts +3 -1
  208. package/src/transactions/types.ts +4 -2
  209. package/src/types/index.ts +1 -0
  210. package/src/utils/const.ts +1 -0
  211. package/src/utils/helpers.ts +70 -0
  212. package/src/version.ts +1 -1
  213. package/dist/common/chunk-J4IUXT5W.js +0 -2
  214. package/dist/common/chunk-J4IUXT5W.js.map +0 -1
  215. package/dist/esm/chunk-4SDUQ7AS.mjs +0 -2
  216. package/dist/esm/chunk-4SDUQ7AS.mjs.map +0 -1
  217. package/dist/esm/chunk-EZIF26UH.mjs +0 -2
  218. package/dist/esm/chunk-EZIF26UH.mjs.map +0 -1
  219. package/dist/esm/chunk-HHU7UCFI.mjs.map +0 -1
  220. package/dist/esm/chunk-KMJ6TF6Y.mjs +0 -2
  221. package/dist/esm/chunk-KMJ6TF6Y.mjs.map +0 -1
  222. package/dist/esm/chunk-L36ZHC7J.mjs +0 -2
  223. package/dist/esm/chunk-L36ZHC7J.mjs.map +0 -1
  224. package/dist/esm/chunk-LDTF3ABK.mjs +0 -2
  225. package/dist/esm/chunk-LDTF3ABK.mjs.map +0 -1
  226. package/dist/esm/chunk-THRXIXIO.mjs +0 -2
  227. package/dist/esm/chunk-THRXIXIO.mjs.map +0 -1
  228. package/dist/esm/chunk-WABFFJGI.mjs +0 -2
  229. package/dist/esm/chunk-WABFFJGI.mjs.map +0 -1
  230. package/dist/esm/chunk-ZEYOFDIO.mjs +0 -2
  231. package/dist/esm/chunk-ZOMXBB6Z.mjs +0 -2
  232. package/dist/esm/chunk-ZOMXBB6Z.mjs.map +0 -1
  233. /package/dist/esm/{chunk-NCWD4NA3.mjs.map → chunk-2CAGPXCX.mjs.map} +0 -0
  234. /package/dist/esm/{chunk-Q67DUNMI.mjs.map → chunk-2XYA7NOU.mjs.map} +0 -0
  235. /package/dist/esm/{chunk-2N2VEGT6.mjs.map → chunk-3F3FCWT5.mjs.map} +0 -0
  236. /package/dist/esm/{chunk-3SPU4V2B.mjs.map → chunk-3GOJQ5JD.mjs.map} +0 -0
  237. /package/dist/esm/{chunk-G7UNU5GI.mjs.map → chunk-3HTSCV3R.mjs.map} +0 -0
  238. /package/dist/esm/{chunk-H33YIMTU.mjs.map → chunk-4ENUSVZB.mjs.map} +0 -0
  239. /package/dist/esm/{chunk-76HTG7Z7.mjs.map → chunk-53DBMWMU.mjs.map} +0 -0
  240. /package/dist/esm/{chunk-I5XQKNOK.mjs.map → chunk-54QUDAAC.mjs.map} +0 -0
  241. /package/dist/esm/{chunk-7AIKM3UF.mjs.map → chunk-56F7EYFE.mjs.map} +0 -0
  242. /package/dist/esm/{chunk-JKNTGRSQ.mjs.map → chunk-5L3UXSQI.mjs.map} +0 -0
  243. /package/dist/esm/{chunk-PY4TS34X.mjs.map → chunk-5P7MXLZA.mjs.map} +0 -0
  244. /package/dist/esm/{chunk-6BYVG7H4.mjs.map → chunk-5TBIWC7N.mjs.map} +0 -0
  245. /package/dist/esm/{chunk-ZQFFRZJ4.mjs.map → chunk-6CHBLB3V.mjs.map} +0 -0
  246. /package/dist/esm/{chunk-NRRADUK4.mjs.map → chunk-AVSM2BJR.mjs.map} +0 -0
  247. /package/dist/esm/{chunk-52KPINA4.mjs.map → chunk-B5NYEWNM.mjs.map} +0 -0
  248. /package/dist/esm/{chunk-74YFNJ7A.mjs.map → chunk-BIGX2RJL.mjs.map} +0 -0
  249. /package/dist/esm/{chunk-AYX5JMB4.mjs.map → chunk-DVIRUFCY.mjs.map} +0 -0
  250. /package/dist/esm/{chunk-UV7M72QD.mjs.map → chunk-EJMPY5MF.mjs.map} +0 -0
  251. /package/dist/esm/{chunk-F7NVDHR2.mjs.map → chunk-EQSON7Y5.mjs.map} +0 -0
  252. /package/dist/esm/{chunk-GNFEBKFV.mjs.map → chunk-EXMQBH3I.mjs.map} +0 -0
  253. /package/dist/esm/{chunk-UO52TECC.mjs.map → chunk-F5PNGH44.mjs.map} +0 -0
  254. /package/dist/esm/{chunk-FOHGSNYZ.mjs.map → chunk-GGPA6QTN.mjs.map} +0 -0
  255. /package/dist/esm/{chunk-QV6EZL2G.mjs.map → chunk-GKERWKMB.mjs.map} +0 -0
  256. /package/dist/esm/{chunk-Y3HLYCF3.mjs.map → chunk-GR4PHW7K.mjs.map} +0 -0
  257. /package/dist/esm/{chunk-ZXPBRVOA.mjs.map → chunk-HBQLX5QF.mjs.map} +0 -0
  258. /package/dist/esm/{chunk-RA3YPQG2.mjs.map → chunk-IVOEXGOG.mjs.map} +0 -0
  259. /package/dist/esm/{chunk-5L3PLK3W.mjs.map → chunk-JOROI7FE.mjs.map} +0 -0
  260. /package/dist/esm/{chunk-T2NJUIOQ.mjs.map → chunk-KRIIRH5L.mjs.map} +0 -0
  261. /package/dist/esm/{chunk-7Y3MRBG6.mjs.map → chunk-LFUBUXHD.mjs.map} +0 -0
  262. /package/dist/esm/{chunk-YXITAP46.mjs.map → chunk-LJZPPBTH.mjs.map} +0 -0
  263. /package/dist/esm/{chunk-5IUXBOS5.mjs.map → chunk-LS6G4DZV.mjs.map} +0 -0
  264. /package/dist/esm/{chunk-GXTEJ7NO.mjs.map → chunk-MNVDBUF3.mjs.map} +0 -0
  265. /package/dist/esm/{chunk-ORXEFE6X.mjs.map → chunk-NBO2BDDZ.mjs.map} +0 -0
  266. /package/dist/esm/{chunk-2CC67KW5.mjs.map → chunk-NDJKEFNU.mjs.map} +0 -0
  267. /package/dist/esm/{chunk-A4T373F3.mjs.map → chunk-NKDHR2DA.mjs.map} +0 -0
  268. /package/dist/esm/{chunk-FNT3VLRD.mjs.map → chunk-NPFW6ZFY.mjs.map} +0 -0
  269. /package/dist/esm/{chunk-KEN2VRIM.mjs.map → chunk-OPTI3MH2.mjs.map} +0 -0
  270. /package/dist/esm/{chunk-QE5OL6KN.mjs.map → chunk-ORGMRM5K.mjs.map} +0 -0
  271. /package/dist/esm/{chunk-SONTIUAM.mjs.map → chunk-OTNGLTKS.mjs.map} +0 -0
  272. /package/dist/esm/{chunk-CTJX4CUF.mjs.map → chunk-P2EKDA7R.mjs.map} +0 -0
  273. /package/dist/esm/{chunk-GHKMF253.mjs.map → chunk-PDNA4H34.mjs.map} +0 -0
  274. /package/dist/esm/{chunk-ECKJI2TV.mjs.map → chunk-QQHA2Y46.mjs.map} +0 -0
  275. /package/dist/esm/{chunk-WHW4Z7TK.mjs.map → chunk-SCYGW3VV.mjs.map} +0 -0
  276. /package/dist/esm/{chunk-3NRBTP3S.mjs.map → chunk-SUAA25UP.mjs.map} +0 -0
  277. /package/dist/esm/{chunk-YY2XW5R4.mjs.map → chunk-T53MZO2U.mjs.map} +0 -0
  278. /package/dist/esm/{chunk-MEKXPGK7.mjs.map → chunk-VQVNUN5Y.mjs.map} +0 -0
  279. /package/dist/esm/{chunk-WFOYGJS5.mjs.map → chunk-VTEZ6TBO.mjs.map} +0 -0
  280. /package/dist/esm/{chunk-OEOUZFHD.mjs.map → chunk-VYXJ7FUF.mjs.map} +0 -0
  281. /package/dist/esm/{chunk-4ZMI5G5L.mjs.map → chunk-VYXS7TLB.mjs.map} +0 -0
  282. /package/dist/esm/{chunk-HKMG3LZX.mjs.map → chunk-WLZYSLHP.mjs.map} +0 -0
  283. /package/dist/esm/{chunk-6ERHGCK2.mjs.map → chunk-WX6P3Q4I.mjs.map} +0 -0
  284. /package/dist/esm/{chunk-USOIC4HO.mjs.map → chunk-WYQLUB4H.mjs.map} +0 -0
  285. /package/dist/esm/{chunk-ZZRSKHWS.mjs.map → chunk-YFMFXRJX.mjs.map} +0 -0
  286. /package/dist/esm/{chunk-PO33LVUF.mjs.map → chunk-YPQZJ72F.mjs.map} +0 -0
  287. /package/dist/esm/{chunk-HRIYZBXY.mjs.map → chunk-ZNC3FRSK.mjs.map} +0 -0
  288. /package/dist/esm/{chunk-NU55IEL4.mjs.map → chunk-ZWX3NHGU.mjs.map} +0 -0
@@ -540,7 +540,8 @@ declare enum ScriptTransactionArgumentVariants {
540
540
  Bool = 5,
541
541
  U16 = 6,
542
542
  U32 = 7,
543
- U256 = 8
543
+ U256 = 8,
544
+ Serialized = 9
544
545
  }
545
546
  /**
546
547
  * Transaction payload enum as they are represented in Rust
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var d=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var i=(e,n,t,r)=>{for(var o=r>1?void 0:r?m(n,t):n,s=e.length-1,a;s>=0;s--)(a=e[s])&&(o=(r?a(n,t,o):a(o))||o);return r&&o&&d(n,t,o),o};var _jsbase64 = require('js-base64');async function p(e){return new Promise(n=>{setTimeout(n,e)})}var _=()=>Math.floor(Date.now()/1e3);function f(e){let n=new Date(e*1e3);return n.setMinutes(0),n.setSeconds(0),n.setMilliseconds(0),Math.floor(n.getTime()/1e3)}function S(e){let n=e.replace(/-/g,"+").replace(/_/g,"/"),t=n+"==".substring(0,(3-n.length%3)%3);return _jsbase64.decode.call(void 0, t)}var h=(e,n)=>e*10**n,x= exports.g =(e,n)=>e/10**n,c=e=>{let n="";for(let t=2;t<e.length;t+=2)n+=String.fromCharCode(parseInt(e.substring(t,t+2),16));return n},y= exports.h =e=>{let{account_address:n,module_name:t,struct_name:r}=e,o=c(t),s=c(r);return`${n}::${o}::${s}`},b= exports.i =e=>typeof e=="object"&&!Array.isArray(e)&&e!==null&&"account_address"in e&&"module_name"in e&&"struct_name"in e&&typeof e.account_address=="string"&&typeof e.module_name=="string"&&typeof e.struct_name=="string";exports.a = i; exports.b = p; exports.c = _; exports.d = f; exports.e = S; exports.f = h; exports.g = x; exports.h = y; exports.i = b;
2
+ //# sourceMappingURL=chunk-HBPH2AD3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/helpers.ts"],"names":["decode","sleep","timeMs","resolve","nowInSeconds","floorToWholeHour","timestampInSeconds","date","base64UrlDecode","base64Url","base64","paddedBase64","convertAmountFromHumanReadableToOnChain","value","decimal","convertAmountFromOnChainToHumanReadable","hexToAscii","hex","str","n","parseEncodedStruct","structObj","account_address","module_name","struct_name","moduleName","structName","isEncodedStruct"],"mappings":"wMAGA,OAAS,UAAAA,MAAc,YAOvB,eAAsBC,EAAMC,EAA+B,CACzD,OAAO,IAAI,QAASC,GAAY,CAC9B,WAAWA,EAASD,CAAM,CAC5B,CAAC,CACH,CAEO,IAAME,EAAe,IAAM,KAAK,MAAM,KAAK,IAAI,EAAI,GAAI,EAEvD,SAASC,EAAiBC,EAAoC,CACnE,IAAMC,EAAO,IAAI,KAAKD,EAAqB,GAAI,EAE/C,OAAAC,EAAK,WAAW,CAAC,EACjBA,EAAK,WAAW,CAAC,EACjBA,EAAK,gBAAgB,CAAC,EACf,KAAK,MAAMA,EAAK,QAAQ,EAAI,GAAI,CACzC,CAEO,SAASC,EAAgBC,EAA2B,CAEzD,IAAMC,EAASD,EAAU,QAAQ,KAAM,GAAG,EAAE,QAAQ,KAAM,GAAG,EAEvDE,EAAeD,EAAS,KAAK,UAAU,GAAI,EAAKA,EAAO,OAAS,GAAM,CAAC,EAE7E,OADsBV,EAAOW,CAAY,CAE3C,CAaO,IAAMC,EAA0C,CAACC,EAAeC,IAAoBD,EAAQ,IAAMC,EAa5FC,EAA0C,CAACF,EAAeC,IAAoBD,EAAQ,IAAMC,EAUnGE,EAAcC,GAAgB,CAClC,IAAIC,EAAM,GACV,QAASC,EAAI,EAAGA,EAAIF,EAAI,OAAQE,GAAK,EACnCD,GAAO,OAAO,aAAa,SAASD,EAAI,UAAUE,EAAGA,EAAI,CAAC,EAAG,EAAE,CAAC,EAElE,OAAOD,CACT,EAiBaE,EAAsBC,GAIf,CAElB,GAAM,CAAE,gBAAAC,EAAiB,YAAAC,EAAa,YAAAC,CAAY,EAAIH,EAChDI,EAAaT,EAAWO,CAAW,EACnCG,EAAaV,EAAWQ,CAAW,EACzC,MAAO,GAAGF,CAAe,KAAKG,CAAU,KAAKC,CAAU,EACzD,EAWaC,EACXN,GAMA,OAAOA,GAAc,UACrB,CAAC,MAAM,QAAQA,CAAS,GACxBA,IAAc,MACd,oBAAqBA,GACrB,gBAAiBA,GACjB,gBAAiBA,GACjB,OAAOA,EAAU,iBAAoB,UACrC,OAAOA,EAAU,aAAgB,UACjC,OAAOA,EAAU,aAAgB","sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { decode } from \"js-base64\";\nimport { MoveStructId } from \"../types\";\n\n/**\n * Sleep the current thread for the given amount of time\n * @param timeMs 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\nexport const nowInSeconds = () => Math.floor(Date.now() / 1000);\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\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 is 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 is 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-LOYE4_sG.js';
2
+ import { N as Network, g as AccountAddress } from '../accountAddress-OVl7-qVN.js';
3
3
 
4
4
  declare class LocalNode {
5
5
  readonly MAXIMUM_WAIT_TIME_SEC = 75;
@@ -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 _chunkJ4IUXT5Wjs = require('../chunk-J4IUXT5W.js');var _child_process = require('child_process');var _treekill = require('tree-kill'); var _treekill2 = _interopRequireDefault(_treekill);var _os = require('os');var p=class{constructor(){this.MAXIMUM_WAIT_TIME_SEC=75;this.READINESS_ENDPOINT="http://127.0.0.1:8070/";this.process=null}async stop(){await new Promise((s,e)=>{_optionalChain([this, 'access', _ => _.process, 'optionalAccess', _2 => _2.pid])&&_treekill2.default.call(void 0, this.process.pid,t=>{t?e(t):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"],t=_os.platform.call(void 0, ),a;t==="win32"?a=_child_process.spawn.call(void 0, s,e,{shell:!0}):a=_child_process.spawn.call(void 0, s,e),this.process=a,_optionalChain([a, 'access', _3 => _3.stderr, 'optionalAccess', _4 => _4.on, 'call', _5 => _5("data",r=>{let o=r.toString();console.log(o)})]),_optionalChain([a, 'access', _6 => _6.stdout, 'optionalAccess', _7 => _7.on, 'call', _8 => _8("data",r=>{let o=r.toString();console.log(o)})])}async waitUntilProcessIsUp(){let s=await this.checkIfProcessIsUp(),e=Date.now()/1e3,t=e;for(;!s&&e+this.MAXIMUM_WAIT_TIME_SEC>t;)await _chunkJ4IUXT5Wjs.b.call(void 0, 1e3),s=await this.checkIfProcessIsUp(),t=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 m=class{async init(s){let{network:e,profile:t,extraArguments:a}=s,r=["aptos","init",`--network=${_nullishCoalesce(e, () => ("local"))}`,`--profile=${_nullishCoalesce(t, () => ("default"))}`];return a&&r.push(...a),this.runCommand(r)}async compile(s){let{packageDirectoryPath:e,namedAddresses:t,extraArguments:a}=s,r=["aptos","move","compile","--package-dir",e],o=this.parseNamedAddresses(t);return r.push(...this.prepareNamedAddresses(o)),a&&r.push(...a),this.runCommand(r)}async test(s){let{packageDirectoryPath:e,namedAddresses:t,extraArguments:a}=s,r=["aptos","move","test","--package-dir",e],o=this.parseNamedAddresses(t);return r.push(...this.prepareNamedAddresses(o)),a&&r.push(...a),this.runCommand(r)}async publish(s){let{packageDirectoryPath:e,namedAddresses:t,profile:a,extraArguments:r}=s,o=["aptos","move","publish","--package-dir",e,`--profile=${_nullishCoalesce(a, () => ("default"))}`],n=this.parseNamedAddresses(t);return o.push(...this.prepareNamedAddresses(n)),r&&o.push(...r),this.runCommand(o)}async createObjectAndPublishPackage(s){let{packageDirectoryPath:e,addressName:t,namedAddresses:a,profile:r,extraArguments:o}=s,n=["aptos","move","create-object-and-publish-package","--package-dir",e,"--address-name",t,`--profile=${_nullishCoalesce(r, () => ("default"))}`],i=this.parseNamedAddresses(a);n.push(...this.prepareNamedAddresses(i)),o&&n.push(...o);let g=await this.runCommand(n);return{objectAddress:this.extractAddressFromOutput(g.output)}}async upgradeObjectPackage(s){let{packageDirectoryPath:e,objectAddress:t,namedAddresses:a,profile:r,extraArguments:o}=s,n=["aptos","move","upgrade-object-package","--package-dir",e,"--object-address",t,`--profile=${_nullishCoalesce(r, () => ("default"))}`],i=this.parseNamedAddresses(a);return n.push(...this.prepareNamedAddresses(i)),o&&n.push(...o),this.runCommand(n)}async buildPublishPayload(s){let{outputFile:e,packageDirectoryPath:t,namedAddresses:a,extraArguments:r}=s,o=["aptos","move","build-publish-payload","--json-output-file",e,"--package-dir",t],n=this.parseNamedAddresses(a);return o.push(...this.prepareNamedAddresses(n)),r&&o.push(...r),this.runCommand(o)}async runScript(s){let{compiledScriptPath:e,profile:t,extraArguments:a}=s,r=["aptos","move","run-script","--compiled-script-path",e,`--profile=${_nullishCoalesce(t, () => ("default"))}`];return a&&r.push(...a),this.runCommand(r)}async runCommand(s){return new Promise((e,t)=>{let a=_os.platform.call(void 0, ),r,o="";a==="win32"?r=_child_process.spawn.call(void 0, "npx",s,{shell:!0}):r=_child_process.spawn.call(void 0, "npx",s),r.stdout.on("data",n=>{o+=n.toString()}),r.stdout.pipe(process.stdout),r.stderr.pipe(process.stderr),process.stdin.pipe(r.stdin),r.on("close",n=>{n===0?e({output:o}):t(new Error(`Child process exited with code ${n}`))})})}prepareNamedAddresses(s){let e=s.size,t=[];if(e===0)return t;t.push("--named-addresses");let a=[];return s.forEach((r,o)=>{let n=`${o}=${r.toString()}`;a.push(n)}),t.push(a.join(",")),t}parseNamedAddresses(s){let e=new Map;return Object.keys(s).forEach(t=>{let a=s[t];e.set(t,a)}),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 = p; exports.Move = m;
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 _chunkHBPH2AD3js = require('../chunk-HBPH2AD3.js');var _child_process = require('child_process');var _treekill = require('tree-kill'); var _treekill2 = _interopRequireDefault(_treekill);var _os = require('os');var p=class{constructor(){this.MAXIMUM_WAIT_TIME_SEC=75;this.READINESS_ENDPOINT="http://127.0.0.1:8070/";this.process=null}async stop(){await new Promise((s,e)=>{_optionalChain([this, 'access', _ => _.process, 'optionalAccess', _2 => _2.pid])&&_treekill2.default.call(void 0, this.process.pid,t=>{t?e(t):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"],t=_os.platform.call(void 0, ),a;t==="win32"?a=_child_process.spawn.call(void 0, s,e,{shell:!0}):a=_child_process.spawn.call(void 0, s,e),this.process=a,_optionalChain([a, 'access', _3 => _3.stderr, 'optionalAccess', _4 => _4.on, 'call', _5 => _5("data",r=>{let o=r.toString();console.log(o)})]),_optionalChain([a, 'access', _6 => _6.stdout, 'optionalAccess', _7 => _7.on, 'call', _8 => _8("data",r=>{let o=r.toString();console.log(o)})])}async waitUntilProcessIsUp(){let s=await this.checkIfProcessIsUp(),e=Date.now()/1e3,t=e;for(;!s&&e+this.MAXIMUM_WAIT_TIME_SEC>t;)await _chunkHBPH2AD3js.b.call(void 0, 1e3),s=await this.checkIfProcessIsUp(),t=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 m=class{async init(s){let{network:e,profile:t,extraArguments:a}=s,r=["aptos","init",`--network=${_nullishCoalesce(e, () => ("local"))}`,`--profile=${_nullishCoalesce(t, () => ("default"))}`];return a&&r.push(...a),this.runCommand(r)}async compile(s){let{packageDirectoryPath:e,namedAddresses:t,extraArguments:a}=s,r=["aptos","move","compile","--package-dir",e],o=this.parseNamedAddresses(t);return r.push(...this.prepareNamedAddresses(o)),a&&r.push(...a),this.runCommand(r)}async test(s){let{packageDirectoryPath:e,namedAddresses:t,extraArguments:a}=s,r=["aptos","move","test","--package-dir",e],o=this.parseNamedAddresses(t);return r.push(...this.prepareNamedAddresses(o)),a&&r.push(...a),this.runCommand(r)}async publish(s){let{packageDirectoryPath:e,namedAddresses:t,profile:a,extraArguments:r}=s,o=["aptos","move","publish","--package-dir",e,`--profile=${_nullishCoalesce(a, () => ("default"))}`],n=this.parseNamedAddresses(t);return o.push(...this.prepareNamedAddresses(n)),r&&o.push(...r),this.runCommand(o)}async createObjectAndPublishPackage(s){let{packageDirectoryPath:e,addressName:t,namedAddresses:a,profile:r,extraArguments:o}=s,n=["aptos","move","create-object-and-publish-package","--package-dir",e,"--address-name",t,`--profile=${_nullishCoalesce(r, () => ("default"))}`],i=this.parseNamedAddresses(a);n.push(...this.prepareNamedAddresses(i)),o&&n.push(...o);let g=await this.runCommand(n);return{objectAddress:this.extractAddressFromOutput(g.output)}}async upgradeObjectPackage(s){let{packageDirectoryPath:e,objectAddress:t,namedAddresses:a,profile:r,extraArguments:o}=s,n=["aptos","move","upgrade-object-package","--package-dir",e,"--object-address",t,`--profile=${_nullishCoalesce(r, () => ("default"))}`],i=this.parseNamedAddresses(a);return n.push(...this.prepareNamedAddresses(i)),o&&n.push(...o),this.runCommand(n)}async buildPublishPayload(s){let{outputFile:e,packageDirectoryPath:t,namedAddresses:a,extraArguments:r}=s,o=["aptos","move","build-publish-payload","--json-output-file",e,"--package-dir",t],n=this.parseNamedAddresses(a);return o.push(...this.prepareNamedAddresses(n)),r&&o.push(...r),this.runCommand(o)}async runScript(s){let{compiledScriptPath:e,profile:t,extraArguments:a}=s,r=["aptos","move","run-script","--compiled-script-path",e,`--profile=${_nullishCoalesce(t, () => ("default"))}`];return a&&r.push(...a),this.runCommand(r)}async runCommand(s){return new Promise((e,t)=>{let a=_os.platform.call(void 0, ),r,o="";a==="win32"?r=_child_process.spawn.call(void 0, "npx",s,{shell:!0}):r=_child_process.spawn.call(void 0, "npx",s),r.stdout.on("data",n=>{o+=n.toString()}),r.stdout.pipe(process.stdout),r.stderr.pipe(process.stderr),process.stdin.pipe(r.stdin),r.on("close",n=>{n===0?e({output:o}):t(new Error(`Child process exited with code ${n}`))})})}prepareNamedAddresses(s){let e=s.size,t=[];if(e===0)return t;t.push("--named-addresses");let a=[];return s.forEach((r,o)=>{let n=`${o}=${r.toString()}`;a.push(n)}),t.push(a.join(",")),t}parseNamedAddresses(s){let e=new Map;return Object.keys(s).forEach(t=>{let a=s[t];e.set(t,a)}),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 = p; exports.Move = m;
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/cli/localNode.ts","../../../src/cli/move.ts"],"names":["spawn","kill","platform","LocalNode","resolve","reject","err","cliCommand","cliArgs","currentPlatform","childProcess","data","str","operational","start","last","sleep","Move","args","network","profile","extraArguments","packageDirectoryPath","namedAddresses","addressesMap","addressName","result","objectAddress","outputFile","compiledScriptPath","stdout","code","totalNames","newArgs","names","value","key","toAppend","address","output","match"],"mappings":"yCAAA,OAAyC,SAAAA,MAAa,gBACtD,OAAOC,MAAU,YACjB,OAAS,YAAAC,MAAgB,KAIlB,IAAMC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D,EAAM,KAAKG,CAAQ,CACrB,CAAC,EACDJ,EAAQ,KAAKC,EAAM,KAAK,GAAG,CAAC,EACrBD,CACT,CASQ,oBAAoBV,EAA6E,CACvG,IAAMC,EAAe,IAAI,IAEzB,cAAO,KAAKD,CAAc,EAAE,QAASa,GAAQ,CAC3C,IAAME,EAAUf,EAAea,CAAG,EAClCZ,EAAa,IAAIY,EAAKE,CAAO,CAC/B,CAAC,EAEMd,CACT,CASQ,yBAAyBe,EAAwB,CACvD,IAAMC,EAAQD,EAAO,MAAM,sEAAsE,EACjG,GAAIC,EACF,OAAOA,EAAM,CAAC,EAEhB,MAAM,IAAI,MAAM,8CAA8C,CAChE,CACF","sourcesContent":["import { ChildProcessWithoutNullStreams, spawn } from \"child_process\";\nimport kill from \"tree-kill\";\nimport { platform } from \"os\";\n\nimport { sleep } from \"../utils/helpers\";\n\nexport class LocalNode {\n readonly MAXIMUM_WAIT_TIME_SEC = 75;\n\n readonly READINESS_ENDPOINT = \"http://127.0.0.1:8070/\";\n\n process: ChildProcessWithoutNullStreams | null = null;\n\n /**\n * kills all the descendent processes\n * of the node process, including the node process itself\n */\n async stop() {\n await new Promise((resolve, reject) => {\n if (!this.process?.pid) return;\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 process to be up.\n *\n * If local node process is already up it returns and does\n * not start the process\n */\n async run() {\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 run-local-testnet command\n */\n start() {\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 log\n // eslint-disable-next-line no-console\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 // eslint-disable-next-line no-console\n console.log(str);\n });\n }\n\n /**\n * Waits for the local testnet process to be up\n *\n * @returns Promise<boolean>\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\n *\n * @returns Promise<boolean>\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\nexport class Move {\n /**\n * Function to initialize current directory for Aptos\n *\n * Configuration will be pushed into .aptos/config.yaml\n * @param args.network optional Network type argument to use for default settings, default is local\n * @param args.profile optional Profile to use from the config file, default is 'default'\n * This will be used to override associated settings such as the REST URL, the Faucet URL, and the private key arguments.\n * @param args.extraArguments (optional) Any extra arguments to include in the form of an array of strings\n * @example\n * [\"--assume-yes\",\"--gas-unit-price=10\"]\n *\n * @returns stdout\n */\n async init(args: {\n network?: Network;\n profile?: string;\n extraArguments?: Array<string>;\n }): Promise<{ output: string }> {\n const { network, profile, extraArguments } = 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);\n }\n\n /**\n * Function to compile a package\n *\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\n * @param args.extraArguments (optional) Any extra arguments to include in the form of an array of strings\n * @example\n * [\"--assume-yes\",\"--gas-unit-price=10\"]\n * @example\n * {\n * alice:0x1234, bob:0x5678\n * }\n *\n * @returns stdout\n */\n async compile(args: {\n packageDirectoryPath: string;\n namedAddresses: Record<string, AccountAddress>;\n extraArguments?: Array<string>;\n }): Promise<{ output: string }> {\n const { packageDirectoryPath, namedAddresses, extraArguments } = 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);\n }\n\n /**\n * Function to run Move unit tests for a package\n *\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\n * @example\n * {\n * alice:0x1234, bob:0x5678\n * }\n * @param args.extraArguments (optional) Any extra arguments to include in the form of an array of strings\n * @example\n * [\"--assume-yes\",\"--gas-unit-price=10\"]\n *\n * @returns stdout\n */\n async test(args: {\n packageDirectoryPath: string;\n namedAddresses: Record<string, AccountAddress>;\n extraArguments?: Array<string>;\n }): Promise<{ output: string }> {\n const { packageDirectoryPath, namedAddresses, extraArguments } = 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);\n }\n\n /**\n * Function to publish the modules to the publisher account on the Aptos blockchain\n *\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\n * @example\n * {\n * alice:0x1234, bob:0x5678\n * }\n * @param args.profile optional Profile to use from the config file.\n * @param args.extraArguments (optional) Any extra arguments to include in the form of an array of strings\n * @example\n * [\"--assume-yes\",\"--gas-unit-price=10\"]\n *\n * @returns stdout\n */\n async publish(args: {\n packageDirectoryPath: string;\n namedAddresses: Record<string, AccountAddress>;\n profile?: string;\n extraArguments?: Array<string>;\n }): Promise<{ output: string }> {\n const { packageDirectoryPath, namedAddresses, profile, extraArguments } = 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);\n }\n\n /**\n * Function to create a new object and publish the Move package to it on the Aptos blockchain\n *\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 * @example\n * MoonCoin, please find the actual address name in Move.toml\n * @param args.namedAddresses Named addresses for the move binary\n * @example\n * {\n * alice:0x1234, bob:0x5678\n * }\n * @param args.profile optional Profile to use from the config file.\n * @param args.extraArguments (optional) Any extra arguments to include in the form of an array of strings\n * @example\n * [\"--assume-yes\",\"--gas-unit-price=10\"]\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 * @returns object address\n */\n async createObjectAndPublishPackage(args: {\n packageDirectoryPath: string;\n addressName: string;\n namedAddresses: Record<string, AccountAddress>;\n profile?: string;\n extraArguments?: Array<string>;\n }): Promise<{ objectAddress: string }> {\n const { packageDirectoryPath, addressName, namedAddresses, profile, extraArguments } = 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 result = await this.runCommand(cliArgs);\n return { objectAddress: this.extractAddressFromOutput(result.output) };\n }\n\n /**\n * Function to upgrade a Move package previously published to an object on the Aptos blockchain\n * Caller must be the object owner to call this function\n *\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\n * @example\n * 0x1000\n * @param args.namedAddresses Named addresses for the move binary\n * @example\n * {\n * alice:0x1234, bob:0x5678\n * }\n * @param args.profile optional Profile to use from the config file.\n * @param args.extraArguments (optional) Any extra arguments to include in the form of an array of strings\n * @example\n * [\"--assume-yes\",\"--gas-unit-price=10\"]\n *\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 }): Promise<{ output: string }> {\n const { packageDirectoryPath, objectAddress, namedAddresses, profile, extraArguments } = 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);\n }\n\n /**\n * Build a publication transaction payload and store it in a JSON output file\n *\n * @param args.packageDirectoryPath Path to a move package (the folder with a Move.toml file)\n * @param args.outputFile Output file to write publication transaction to\n * @param args.namedAddresses Named addresses for the move binary\n * @example\n * {\n * alice:0x1234, bob:0x5678\n * }\n * @param args.extraArguments (optional) Any extra arguments to include in the form of an array of strings\n * @example\n * [\"--assume-yes\",\"--gas-unit-price=10\"]\n *\n * @returns stdout\n */\n async buildPublishPayload(args: {\n packageDirectoryPath: string;\n outputFile: string;\n namedAddresses: Record<string, AccountAddress>;\n extraArguments?: Array<string>;\n }) {\n const { outputFile, packageDirectoryPath, namedAddresses, extraArguments } = 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);\n }\n\n /**\n * Function to run a Move script, please run compile before running this\n *\n * @param args.compiledScriptPath Path to a compiled Move script bytecode file\n * @param args.namedAddresses Named addresses for the move binary\n * @example\n * 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) Any extra arguments to include in the form of an array of strings\n * @example\n * [\"--assume-yes\",\"--gas-unit-price=10\"]\n *\n * @returns stdout\n */\n async runScript(args: {\n compiledScriptPath: string;\n profile?: string;\n extraArguments?: Array<string>;\n }): Promise<{ output: string }> {\n const { compiledScriptPath, profile, extraArguments } = 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);\n }\n\n /**\n * Run a move command\n *\n * @param args\n * @returns stdout\n */\n // eslint-disable-next-line class-methods-use-this\n private async runCommand(args: Array<string>): Promise<{ output: string }> {\n return new Promise((resolve, reject) => {\n const currentPlatform = platform();\n let childProcess;\n let stdout = \"\";\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 stdout += data.toString();\n });\n\n childProcess.stdout.pipe(process.stdout);\n childProcess.stderr.pipe(process.stderr);\n process.stdin.pipe(childProcess.stdin);\n\n childProcess.on(\"close\", (code) => {\n if (code === 0) {\n resolve({ output: stdout }); // Resolve with stdout if the child process exits successfully\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 seperated by a comma\n *\n * @example\n * input: {'alice' => '0x123', 'bob' => '0x456'}\n * output: \"alice=0x123,bob=0x456\"\n *\n * @param namedAddresses\n * @returns An array of names addresses seperated by a comma\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 * @param namedAddresses\n * @returns Map<name,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 * Extract object address from the output\n *\n * @param output\n * @returns object address\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":["../../../src/cli/localNode.ts","../../../src/cli/move.ts"],"names":["spawn","kill","platform","LocalNode","resolve","reject","err","cliCommand","cliArgs","currentPlatform","childProcess","data","str","operational","start","last","sleep","Move","args","network","profile","extraArguments","packageDirectoryPath","namedAddresses","addressesMap","addressName","result","objectAddress","outputFile","compiledScriptPath","stdout","code","totalNames","newArgs","names","value","key","toAppend","address","output","match"],"mappings":"yCAAA,OAAyC,SAAAA,MAAa,gBACtD,OAAOC,MAAU,YACjB,OAAS,YAAAC,MAAgB,KAIlB,IAAMC,EAAN,KAAgB,CAAhB,cACL,KAAS,sBAAwB,GAEjC,KAAS,mBAAqB,yBAE9B,aAAiD,KAMjD,MAAM,MAAO,CACX,MAAM,IAAI,QAAQ,CAACC,EAASC,IAAW,CAChC,KAAK,SAAS,KACnBJ,EAAK,KAAK,QAAQ,IAAMK,GAAQ,CAC1BA,EACFD,EAAOC,CAAG,EAEVF,EAAQ,EAAI,CAEhB,CAAC,CACH,CAAC,CACH,CAQA,MAAM,KAAM,CACO,MAAM,KAAK,mBAAmB,IAI/C,KAAK,MAAM,EACX,MAAM,KAAK,qBAAqB,EAClC,CAKA,OAAQ,CACN,IAAMG,EAAa,MACbC,EAAU,CAAC,QAAS,OAAQ,eAAgB,kBAAmB,eAAgB,oBAAoB,EAEnGC,EAAkBP,EAAS,EAC7BQ,EAEAD,IAAoB,QACtBC,EAAeV,EAAMO,EAAYC,EAAS,CAAE,MAAO,EAAK,CAAC,EAEzDE,EAAeV,EAAMO,EAAYC,CAAO,EAG1C,KAAK,QAAUE,EAEfA,EAAa,QAAQ,GAAG,OAASC,GAAc,CAC7C,IAAMC,EAAMD,EAAK,SAAS,EAG1B,QAAQ,IAAIC,CAAG,CACjB,CAAC,EAEDF,EAAa,QAAQ,GAAG,OAASC,GAAc,CAC7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K,EAErCA,EAAa,GAAG,QAAUqB,GAAS,CAC7BA,IAAS,EACX3B,EAAQ,CAAE,OAAQ0B,CAAO,CAAC,EAE1BzB,EAAO,IAAI,MAAM,kCAAkC0B,CAAI,EAAE,CAAC,CAE9D,CAAC,CACH,CAAC,CACH,CAaQ,sBAAsBR,EAA4D,CACxF,IAAMS,EAAaT,EAAe,KAC5BU,EAAyB,CAAC,EAEhC,GAAID,IAAe,EACjB,OAAOC,EAGTA,EAAQ,KAAK,mBAAmB,EAEhC,IAAMC,EAAuB,CAAC,EAC9B,OAAAX,EAAe,QAAQ,CAACY,EAAOC,IAAQ,CACrC,IAAMC,EAAW,GAAGD,CAAG,IAAID,EAAM,SAAS,CAAC,GAC3CD,EAAM,KAAKG,CAAQ,CACrB,CAAC,EACDJ,EAAQ,KAAKC,EAAM,KAAK,GAAG,CAAC,EACrBD,CACT,CASQ,oBAAoBV,EAA6E,CACvG,IAAMC,EAAe,IAAI,IAEzB,cAAO,KAAKD,CAAc,EAAE,QAASa,GAAQ,CAC3C,IAAME,EAAUf,EAAea,CAAG,EAClCZ,EAAa,IAAIY,EAAKE,CAAO,CAC/B,CAAC,EAEMd,CACT,CASQ,yBAAyBe,EAAwB,CACvD,IAAMC,EAAQD,EAAO,MAAM,mEAAmE,EAC9F,GAAIC,EACF,OAAOA,EAAM,CAAC,EAEhB,MAAM,IAAI,MAAM,8CAA8C,CAChE,CACF","sourcesContent":["import { ChildProcessWithoutNullStreams, spawn } from \"child_process\";\nimport kill from \"tree-kill\";\nimport { platform } from \"os\";\n\nimport { sleep } from \"../utils/helpers\";\n\nexport class LocalNode {\n readonly MAXIMUM_WAIT_TIME_SEC = 75;\n\n readonly READINESS_ENDPOINT = \"http://127.0.0.1:8070/\";\n\n process: ChildProcessWithoutNullStreams | null = null;\n\n /**\n * kills all the descendent processes\n * of the node process, including the node process itself\n */\n async stop() {\n await new Promise((resolve, reject) => {\n if (!this.process?.pid) return;\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 process to be up.\n *\n * If local node process is already up it returns and does\n * not start the process\n */\n async run() {\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 run-local-testnet command\n */\n start() {\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 log\n // eslint-disable-next-line no-console\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 // eslint-disable-next-line no-console\n console.log(str);\n });\n }\n\n /**\n * Waits for the local testnet process to be up\n *\n * @returns Promise<boolean>\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\n *\n * @returns Promise<boolean>\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\nexport class Move {\n /**\n * Function to initialize current directory for Aptos\n *\n * Configuration will be pushed into .aptos/config.yaml\n * @param args.network optional Network type argument to use for default settings, default is local\n * @param args.profile optional Profile to use from the config file, default is 'default'\n * This will be used to override associated settings such as the REST URL, the Faucet URL, and the private key arguments.\n * @param args.extraArguments (optional) Any extra arguments to include in the form of an array of strings\n * @example\n * [\"--assume-yes\",\"--gas-unit-price=10\"]\n *\n * @returns stdout\n */\n async init(args: {\n network?: Network;\n profile?: string;\n extraArguments?: Array<string>;\n }): Promise<{ output: string }> {\n const { network, profile, extraArguments } = 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);\n }\n\n /**\n * Function to compile a package\n *\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\n * @param args.extraArguments (optional) Any extra arguments to include in the form of an array of strings\n * @example\n * [\"--assume-yes\",\"--gas-unit-price=10\"]\n * @example\n * {\n * alice:0x1234, bob:0x5678\n * }\n *\n * @returns stdout\n */\n async compile(args: {\n packageDirectoryPath: string;\n namedAddresses: Record<string, AccountAddress>;\n extraArguments?: Array<string>;\n }): Promise<{ output: string }> {\n const { packageDirectoryPath, namedAddresses, extraArguments } = 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);\n }\n\n /**\n * Function to run Move unit tests for a package\n *\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\n * @example\n * {\n * alice:0x1234, bob:0x5678\n * }\n * @param args.extraArguments (optional) Any extra arguments to include in the form of an array of strings\n * @example\n * [\"--assume-yes\",\"--gas-unit-price=10\"]\n *\n * @returns stdout\n */\n async test(args: {\n packageDirectoryPath: string;\n namedAddresses: Record<string, AccountAddress>;\n extraArguments?: Array<string>;\n }): Promise<{ output: string }> {\n const { packageDirectoryPath, namedAddresses, extraArguments } = 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);\n }\n\n /**\n * Function to publish the modules to the publisher account on the Aptos blockchain\n *\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\n * @example\n * {\n * alice:0x1234, bob:0x5678\n * }\n * @param args.profile optional Profile to use from the config file.\n * @param args.extraArguments (optional) Any extra arguments to include in the form of an array of strings\n * @example\n * [\"--assume-yes\",\"--gas-unit-price=10\"]\n *\n * @returns stdout\n */\n async publish(args: {\n packageDirectoryPath: string;\n namedAddresses: Record<string, AccountAddress>;\n profile?: string;\n extraArguments?: Array<string>;\n }): Promise<{ output: string }> {\n const { packageDirectoryPath, namedAddresses, profile, extraArguments } = 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);\n }\n\n /**\n * Function to create a new object and publish the Move package to it on the Aptos blockchain\n *\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 * @example\n * MoonCoin, please find the actual address name in Move.toml\n * @param args.namedAddresses Named addresses for the move binary\n * @example\n * {\n * alice:0x1234, bob:0x5678\n * }\n * @param args.profile optional Profile to use from the config file.\n * @param args.extraArguments (optional) Any extra arguments to include in the form of an array of strings\n * @example\n * [\"--assume-yes\",\"--gas-unit-price=10\"]\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 * @returns object address\n */\n async createObjectAndPublishPackage(args: {\n packageDirectoryPath: string;\n addressName: string;\n namedAddresses: Record<string, AccountAddress>;\n profile?: string;\n extraArguments?: Array<string>;\n }): Promise<{ objectAddress: string }> {\n const { packageDirectoryPath, addressName, namedAddresses, profile, extraArguments } = 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 result = await this.runCommand(cliArgs);\n return { objectAddress: this.extractAddressFromOutput(result.output) };\n }\n\n /**\n * Function to upgrade a Move package previously published to an object on the Aptos blockchain\n * Caller must be the object owner to call this function\n *\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\n * @example\n * 0x1000\n * @param args.namedAddresses Named addresses for the move binary\n * @example\n * {\n * alice:0x1234, bob:0x5678\n * }\n * @param args.profile optional Profile to use from the config file.\n * @param args.extraArguments (optional) Any extra arguments to include in the form of an array of strings\n * @example\n * [\"--assume-yes\",\"--gas-unit-price=10\"]\n *\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 }): Promise<{ output: string }> {\n const { packageDirectoryPath, objectAddress, namedAddresses, profile, extraArguments } = 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);\n }\n\n /**\n * Build a publication transaction payload and store it in a JSON output file\n *\n * @param args.packageDirectoryPath Path to a move package (the folder with a Move.toml file)\n * @param args.outputFile Output file to write publication transaction to\n * @param args.namedAddresses Named addresses for the move binary\n * @example\n * {\n * alice:0x1234, bob:0x5678\n * }\n * @param args.extraArguments (optional) Any extra arguments to include in the form of an array of strings\n * @example\n * [\"--assume-yes\",\"--gas-unit-price=10\"]\n *\n * @returns stdout\n */\n async buildPublishPayload(args: {\n packageDirectoryPath: string;\n outputFile: string;\n namedAddresses: Record<string, AccountAddress>;\n extraArguments?: Array<string>;\n }) {\n const { outputFile, packageDirectoryPath, namedAddresses, extraArguments } = 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);\n }\n\n /**\n * Function to run a Move script, please run compile before running this\n *\n * @param args.compiledScriptPath Path to a compiled Move script bytecode file\n * @param args.namedAddresses Named addresses for the move binary\n * @example\n * 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) Any extra arguments to include in the form of an array of strings\n * @example\n * [\"--assume-yes\",\"--gas-unit-price=10\"]\n *\n * @returns stdout\n */\n async runScript(args: {\n compiledScriptPath: string;\n profile?: string;\n extraArguments?: Array<string>;\n }): Promise<{ output: string }> {\n const { compiledScriptPath, profile, extraArguments } = 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);\n }\n\n /**\n * Run a move command\n *\n * @param args\n * @returns stdout\n */\n // eslint-disable-next-line class-methods-use-this\n private async runCommand(args: Array<string>): Promise<{ output: string }> {\n return new Promise((resolve, reject) => {\n const currentPlatform = platform();\n let childProcess;\n let stdout = \"\";\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 stdout += data.toString();\n });\n\n childProcess.stdout.pipe(process.stdout);\n childProcess.stderr.pipe(process.stderr);\n process.stdin.pipe(childProcess.stdin);\n\n childProcess.on(\"close\", (code) => {\n if (code === 0) {\n resolve({ output: stdout }); // Resolve with stdout if the child process exits successfully\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 seperated by a comma\n *\n * @example\n * input: {'alice' => '0x123', 'bob' => '0x456'}\n * output: \"alice=0x123,bob=0x456\"\n *\n * @param namedAddresses\n * @returns An array of names addresses seperated by a comma\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 * @param namedAddresses\n * @returns Map<name,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 * Extract object address from the output\n *\n * @param output\n * @returns object address\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,5 @@
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, 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, M as MoveModuleId, n as ScriptFunctionArgument, o as MoveFunctionId, p as AccountAddressInput, q as MoveStructId, r as MoveValue, s as MoveFunctionGenericTypeParam, t as SigningSchemeInput, u as SigningScheme, v as AccountData, P as PaginationArgs, w as MoveModuleBytecode, x as TransactionResponse, y as MoveResource, z as TokenStandardArg, O as OrderByArg, G as GetAccountOwnedTokensQueryResponse, B as GetAccountOwnedTokensFromCollectionResponse, J as GetAccountCollectionsWithOwnedTokenResponse, K as GetAccountCoinsDataResponse, W as WhereArg, Q as GetObjectDataQueryResponse, R as GetCollectionDataResponse, V as GetTokenDataResponse, X as GetCurrentTokenOwnershipResponse, Y as GetOwnedTokensResponse, _ as GetTokenActivityResponse, $ as GetEventsResponse, a0 as WaitForTransactionOptions, a1 as UserTransactionResponse, a2 as MoveFunction, a3 as GetFungibleAssetMetadataResponse, a4 as GetFungibleAssetActivitiesResponse, a5 as GetCurrentFungibleAssetBalancesResponse, a6 as LedgerInfo, a7 as Block, a8 as GetChainTopUserTransactionsResponse, a9 as GraphqlQuery, aa as GetProcessorStatusResponse, ab as GetANSNameResponse, ac as GetNumberOfDelegatorsResponse, ad as GetDelegatedStakingActivitiesResponse, ae as PendingTransactionResponse, af as CommittedTransactionResponse, ag as GasEstimation, ah as TableItemRequest, ai as GetTableItemsDataResponse, aj as GetTableItemsMetadataResponse, ak as AptosRequest, al as ClientRequest, am as ClientResponse, an as MimeType } from './accountAddress-LOYE4_sG.js';
2
- export { aA as AccountAuthenticatorVariant, bj as AccountSignature, ar as AddressInvalidReason, aB as AnySignatureVariant, aT as BlockEndInfo, aU as BlockEpilogueTransactionResponse, aQ as BlockMetadataTransactionResponse, aG as ClientHeadersType, b0 as DecodedTableData, b1 as DeletedTableData, bG as DeriveScheme, bm as DirectWriteSet, b3 as EntryFunctionPayloadResponse, aC as EphemeralSignatureVariant, bo as Event, bn as EventGuid, bJ as GenerateAccount, bH as GenerateAccountWithEd25519, bI as GenerateAccountWithSingleSignerSecp256k1Key, b6 as GenesisPayload, aP as GenesisTransactionResponse, au as HexInvalidReason, bB as MoveAbility, bv as MoveAddressType, bA as MoveFunctionVisibility, bD as MoveModule, bw as MoveObjectType, bx as MoveOptionType, b7 as MoveScriptBytecode, bE as MoveStruct, bC as MoveStructField, by as MoveStructType, bz as MoveType, bt as MoveUint128Type, bq as MoveUint16Type, bu as MoveUint256Type, br as MoveUint32Type, bs as MoveUint64Type, bp as MoveUint8Type, b5 as MultisigPayloadResponse, bS as NetworkToChainId, bP as NetworkToFaucetAPI, bN as NetworkToIndexerAPI, bT as NetworkToNetworkName, bO as NetworkToNodeAPI, bQ as NetworkToPepperAPI, bR as NetworkToProverAPI, bK as OrderBy, bL as OrderByValue, as as ParsingError, at as ParsingResult, bF as RoleType, b4 as ScriptPayloadResponse, aw as ScriptTransactionArgumentVariants, bl as ScriptWriteSet, aR as StateCheckpointTransactionResponse, bM as TokenStandard, az as TransactionAuthenticatorVariant, be as TransactionEd25519Signature, bi as TransactionFeePayerSignature, bh as TransactionMultiAgentSignature, bg as TransactionMultiEd25519Signature, b2 as TransactionPayloadResponse, ax as TransactionPayloadVariants, aH as TransactionResponseType, bf as TransactionSecp256k1Signature, b8 as TransactionSignature, ay as TransactionVariants, av as TypeTagVariants, aE as Uint128, aF as Uint256, aD as Uint64, aS as ValidatorTransactionResponse, bk as WriteSet, aV as WriteSetChange, aW as WriteSetChangeDeleteModule, aX as WriteSetChangeDeleteResource, aY as WriteSetChangeDeleteTableItem, aZ as WriteSetChangeWriteModule, a_ as WriteSetChangeWriteResource, a$ as WriteSetChangeWriteTableItem, ao as ensureBoolean, aO as isBlockEpilogueTransactionResponse, aL as isBlockMetadataTransactionResponse, b9 as isEd25519Signature, bc as isFeePayerSignature, aK as isGenesisTransactionResponse, bb as isMultiAgentSignature, bd as isMultiEd25519Signature, aI as isPendingTransactionResponse, ba as isSecp256k1Signature, aM as isStateCheckpointTransactionResponse, aJ as isUserTransactionResponse, aN as isValidatorTransactionResponse, ap as outOfRangeErrorMessage, aq as validateNumberInRange } from './accountAddress-LOYE4_sG.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, 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, M as MoveModuleId, n as ScriptFunctionArgument, o as MoveFunctionId, p as AccountAddressInput, q as MoveStructId, r as MoveValue, s as MoveFunctionGenericTypeParam, t as SigningSchemeInput, u as SigningScheme, v as AccountData, P as PaginationArgs, w as MoveModuleBytecode, x as TransactionResponse, y as MoveResource, z as TokenStandardArg, O as OrderByArg, G as GetAccountOwnedTokensQueryResponse, B as GetAccountOwnedTokensFromCollectionResponse, J as GetAccountCollectionsWithOwnedTokenResponse, K as GetAccountCoinsDataResponse, W as WhereArg, Q as GetObjectDataQueryResponse, R as GetCollectionDataResponse, V as GetTokenDataResponse, X as GetCurrentTokenOwnershipResponse, Y as GetOwnedTokensResponse, _ as GetTokenActivityResponse, $ as GetEventsResponse, a0 as WaitForTransactionOptions, a1 as UserTransactionResponse, a2 as MoveFunction, a3 as GetFungibleAssetMetadataResponse, a4 as GetFungibleAssetActivitiesResponse, a5 as GetCurrentFungibleAssetBalancesResponse, a6 as LedgerInfo, a7 as Block, a8 as GetChainTopUserTransactionsResponse, a9 as GraphqlQuery, aa as GetProcessorStatusResponse, ab as GetANSNameResponse, ac as GetNumberOfDelegatorsResponse, ad as GetDelegatedStakingActivitiesResponse, ae as PendingTransactionResponse, af as CommittedTransactionResponse, ag as GasEstimation, ah as TableItemRequest, ai as GetTableItemsDataResponse, aj as GetTableItemsMetadataResponse, ak as AptosRequest, al as ClientRequest, am as ClientResponse, an as MimeType } from './accountAddress-OVl7-qVN.js';
2
+ export { aA as AccountAuthenticatorVariant, bj as AccountSignature, ar as AddressInvalidReason, aB as AnySignatureVariant, aT as BlockEndInfo, aU as BlockEpilogueTransactionResponse, aQ as BlockMetadataTransactionResponse, aG as ClientHeadersType, b0 as DecodedTableData, b1 as DeletedTableData, bG as DeriveScheme, bm as DirectWriteSet, b3 as EntryFunctionPayloadResponse, aC as EphemeralSignatureVariant, bo as Event, bn as EventGuid, bJ as GenerateAccount, bH as GenerateAccountWithEd25519, bI as GenerateAccountWithSingleSignerSecp256k1Key, b6 as GenesisPayload, aP as GenesisTransactionResponse, au as HexInvalidReason, bB as MoveAbility, bv as MoveAddressType, bA as MoveFunctionVisibility, bD as MoveModule, bw as MoveObjectType, bx as MoveOptionType, b7 as MoveScriptBytecode, bE as MoveStruct, bC as MoveStructField, by as MoveStructType, bz as MoveType, bt as MoveUint128Type, bq as MoveUint16Type, bu as MoveUint256Type, br as MoveUint32Type, bs as MoveUint64Type, bp as MoveUint8Type, b5 as MultisigPayloadResponse, bS as NetworkToChainId, bP as NetworkToFaucetAPI, bN as NetworkToIndexerAPI, bT as NetworkToNetworkName, bO as NetworkToNodeAPI, bQ as NetworkToPepperAPI, bR as NetworkToProverAPI, bK as OrderBy, bL as OrderByValue, as as ParsingError, at as ParsingResult, bF as RoleType, b4 as ScriptPayloadResponse, aw as ScriptTransactionArgumentVariants, bl as ScriptWriteSet, aR as StateCheckpointTransactionResponse, bM as TokenStandard, az as TransactionAuthenticatorVariant, be as TransactionEd25519Signature, bi as TransactionFeePayerSignature, bh as TransactionMultiAgentSignature, bg as TransactionMultiEd25519Signature, b2 as TransactionPayloadResponse, ax as TransactionPayloadVariants, aH as TransactionResponseType, bf as TransactionSecp256k1Signature, b8 as TransactionSignature, ay as TransactionVariants, av as TypeTagVariants, aE as Uint128, aF as Uint256, aD as Uint64, aS as ValidatorTransactionResponse, bk as WriteSet, aV as WriteSetChange, aW as WriteSetChangeDeleteModule, aX as WriteSetChangeDeleteResource, aY as WriteSetChangeDeleteTableItem, aZ as WriteSetChangeWriteModule, a_ as WriteSetChangeWriteResource, a$ as WriteSetChangeWriteTableItem, ao as ensureBoolean, aO as isBlockEpilogueTransactionResponse, aL as isBlockMetadataTransactionResponse, b9 as isEd25519Signature, bc as isFeePayerSignature, aK as isGenesisTransactionResponse, bb as isMultiAgentSignature, bd as isMultiEd25519Signature, aI as isPendingTransactionResponse, ba as isSecp256k1Signature, aM as isStateCheckpointTransactionResponse, aJ as isUserTransactionResponse, aN as isValidatorTransactionResponse, ap as outOfRangeErrorMessage, aq as validateNumberInRange } from './accountAddress-OVl7-qVN.js';
3
3
  import EventEmitter from 'eventemitter3';
4
4
 
5
5
  type Maybe<T> = T | null;
@@ -612,6 +612,15 @@ declare class MoveVector<T extends Serializable & EntryFunctionArgument> extends
612
612
  */
613
613
  static deserialize<T extends Serializable & EntryFunctionArgument>(deserializer: Deserializer, cls: Deserializable<T>): MoveVector<T>;
614
614
  }
615
+ declare class Serialized extends Serializable implements TransactionArgument {
616
+ readonly value: Uint8Array;
617
+ constructor(value: HexInput);
618
+ serialize(serializer: Serializer): void;
619
+ serializeForEntryFunction(serializer: Serializer): void;
620
+ serializeForScriptFunction(serializer: Serializer): void;
621
+ static deserialize(deserializer: Deserializer): Serialized;
622
+ toMoveVector<T extends Serializable & EntryFunctionArgument>(cls: Deserializable<T>): MoveVector<T>;
623
+ }
615
624
  declare class MoveString extends Serializable implements TransactionArgument {
616
625
  value: string;
617
626
  constructor(value: string);
@@ -1488,6 +1497,7 @@ declare const DEFAULT_TXN_TIMEOUT_SEC = 20;
1488
1497
  * The default gas currency for the network.
1489
1498
  */
1490
1499
  declare const APTOS_COIN = "0x1::aptos_coin::AptosCoin";
1500
+ declare const APTOS_FA = "0x000000000000000000000000000000000000000000000000000000000000000a";
1491
1501
  declare const RAW_TRANSACTION_SALT = "APTOS::RawTransaction";
1492
1502
  declare const RAW_TRANSACTION_WITH_DATA_SALT = "APTOS::RawTransactionWithData";
1493
1503
  /**
@@ -2727,7 +2737,7 @@ type EntryFunctionArgumentTypes = Bool | U8 | U16 | U32 | U64 | U128 | U256 | Ac
2727
2737
  /**
2728
2738
  * Script function arguments to be used when building a raw transaction using BCS serialized arguments
2729
2739
  */
2730
- type ScriptFunctionArgumentTypes = Bool | U8 | U16 | U32 | U64 | U128 | U256 | AccountAddress | MoveVector<U8> | MoveString | FixedBytes;
2740
+ type ScriptFunctionArgumentTypes = Bool | U8 | U16 | U32 | U64 | U128 | U256 | AccountAddress | MoveVector<ScriptFunctionArgumentTypes> | MoveString | FixedBytes | Serialized;
2731
2741
  /**
2732
2742
  * TypeArgument inputs for Entry functions, view functions, and scripts
2733
2743
  *
@@ -3568,6 +3578,7 @@ declare class MultiKeyAccount implements Account$1 {
3568
3578
  constructor(args: {
3569
3579
  multiKey: MultiKey;
3570
3580
  signers: Account$1[];
3581
+ address?: AccountAddressInput;
3571
3582
  });
3572
3583
  /**
3573
3584
  * Static constructor for MultiKeyAccount
@@ -3914,7 +3925,8 @@ declare class Account {
3914
3925
  * const accountCoinAmount = await aptos.getAccountCoinAmount({accountAddress:"0x123", coinType:"0x1::aptos_coin::AptosCoin"})
3915
3926
  *
3916
3927
  * @param args.accountAddress The account address we want to get the total count for
3917
- * @param args.coinType The coin type to query
3928
+ * @param args.coinType The coin type to query.
3929
+ * Note: faMetadataAddress will automatically fill this in if not provided when migrated to fungible assets
3918
3930
  * @param args.faMetadataAddress The fungible asset metadata address to query.
3919
3931
  * Note: coinType will automatically fill this in if not provided when migrated to fungible assets
3920
3932
  * @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying
@@ -6500,6 +6512,40 @@ declare const convertAmountFromHumanReadableToOnChain: (value: number, decimal:
6500
6512
  * @returns The value is smallest units
6501
6513
  */
6502
6514
  declare const convertAmountFromOnChainToHumanReadable: (value: number, decimal: number) => number;
6515
+ /**
6516
+ * Convert an encoded struct to a MoveStructId.
6517
+ *
6518
+ * @example
6519
+ * const structObj = {
6520
+ * account_address: "0x1",
6521
+ * module_name: "0x6170746f735f636f696e",
6522
+ * struct_name: "0x4170746f73436f696e",
6523
+ * };
6524
+ * // structId is "0x1::aptos_coin::AptosCoin"
6525
+ * const structId = parseEncodedStruct(structObj);
6526
+ *
6527
+ * @param structObj The struct with account_address, module_name, and struct_name properties
6528
+ * @returns The MoveStructId
6529
+ */
6530
+ declare const parseEncodedStruct: (structObj: {
6531
+ account_address: string;
6532
+ module_name: string;
6533
+ struct_name: string;
6534
+ }) => MoveStructId;
6535
+ /**
6536
+ * Determines whether the given object is an encoded struct type with the following properties:
6537
+ * - account_address: string
6538
+ * - module_name: string
6539
+ * - struct_name: string
6540
+ *
6541
+ * @param structObj The object to check
6542
+ * @returns Whether the object is an encoded struct type
6543
+ */
6544
+ declare const isEncodedStruct: (structObj: any) => structObj is {
6545
+ account_address: string;
6546
+ module_name: string;
6547
+ struct_name: string;
6548
+ };
6503
6549
 
6504
6550
  /**
6505
6551
  * Given a url and method, sends the request with axios and
@@ -6625,4 +6671,4 @@ declare function postAptosFaucet<Req extends {}, Res extends {}>(options: PostAp
6625
6671
  declare function postAptosPepperService<Req extends {}, Res extends {}>(options: PostAptosRequestOptions): Promise<AptosResponse<Req, Res>>;
6626
6672
  declare function postAptosProvingService<Req extends {}, Res extends {}>(options: PostAptosRequestOptions): Promise<AptosResponse<Req, Res>>;
6627
6673
 
6628
- export { APTOS_BIP44_REGEX, APTOS_COIN, APTOS_HARDENED_REGEX, 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, type 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, type FailureEventData, FaucetConfig, 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, 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, KeylessPublicKey, KeylessSignature, 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, 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, type PrivateKey, type PrivateKeyFromDerivationPathArgs, 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, Serializer, Signature, SignedTransaction, SigningScheme, SigningSchemeInput, type SimpleEntryFunctionArgumentTypes, SimpleTransaction, SingleKeyAccount, type SingleKeySignerConstructorArgs, type SingleKeySignerFromDerivationPathArgs, type SingleKeySignerGenerateArgs, StructTag, type SuccessEventData, TableItemRequest, TokenStandardArg, 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, buildTransaction, 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, getFunctionParts, getKeylessConfig, hashValues, isBcsAddress, isBcsBool, isBcsFixedBytes, isBcsString, isBcsU128, isBcsU16, isBcsU256, isBcsU32, isBcsU64, isBcsU8, isBool, isCanonicalEd25519Signature, isEmptyOption, isEncodedEntryFunctionArgument, isLargeNumber, isNumber, isScriptDataInput, isString, isValidBIP44Path, isValidHardenedPath, mnemonicToSeed, normalizeBundle, nowInSeconds, objectStructTag, optionStructTag, paginateWithCursor, parseTypeTag, post, postAptosFaucet, postAptosFullNode, postAptosIndexer, postAptosPepperService, postAptosProvingService, promiseFulfilledStatus, request, sleep, splitPath, standardizeTypeTags, stringStructTag, throwTypeMismatch };
6674
+ export { APTOS_BIP44_REGEX, APTOS_COIN, APTOS_FA, APTOS_HARDENED_REGEX, 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, type 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, type FailureEventData, FaucetConfig, 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, 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, KeylessPublicKey, KeylessSignature, 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, 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, type PrivateKey, type PrivateKeyFromDerivationPathArgs, 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, 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, buildTransaction, 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, getFunctionParts, getKeylessConfig, hashValues, isBcsAddress, isBcsBool, isBcsFixedBytes, isBcsString, isBcsU128, isBcsU16, isBcsU256, isBcsU32, isBcsU64, isBcsU8, isBool, isCanonicalEd25519Signature, isEmptyOption, isEncodedEntryFunctionArgument, isEncodedStruct, isLargeNumber, isNumber, isScriptDataInput, isString, isValidBIP44Path, isValidHardenedPath, mnemonicToSeed, normalizeBundle, nowInSeconds, objectStructTag, optionStructTag, paginateWithCursor, parseEncodedStruct, parseTypeTag, post, postAptosFaucet, postAptosFullNode, postAptosIndexer, postAptosPepperService, postAptosProvingService, promiseFulfilledStatus, request, sleep, splitPath, standardizeTypeTags, stringStructTag, throwTypeMismatch };