@aptos-labs/ts-sdk 1.17.0 → 1.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (425) hide show
  1. package/dist/common/{accountAddress-ccLvlUQe.d.ts → accountAddress-Lv-GSihU.d.ts} +107 -13
  2. package/dist/common/chunk-BHKSQXUZ.js +2 -0
  3. package/dist/common/chunk-BHKSQXUZ.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 +808 -117
  8. package/dist/common/index.js +30 -28
  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.d.mts +85 -0
  13. package/dist/esm/account/EphemeralKeyPair.mjs +2 -0
  14. package/dist/esm/account/KeylessAccount.d.mts +175 -0
  15. package/dist/esm/account/KeylessAccount.mjs +2 -0
  16. package/dist/esm/account/MultiKeyAccount.d.mts +11 -5
  17. package/dist/esm/account/MultiKeyAccount.mjs +1 -1
  18. package/dist/esm/account/SingleKeyAccount.mjs +1 -1
  19. package/dist/esm/account/index.d.mts +6 -0
  20. package/dist/esm/account/index.mjs +1 -1
  21. package/dist/esm/api/account.d.mts +2 -2
  22. package/dist/esm/api/account.mjs +1 -1
  23. package/dist/esm/api/ans.d.mts +2 -2
  24. package/dist/esm/api/ans.mjs +1 -1
  25. package/dist/esm/api/aptos.d.mts +9 -1
  26. package/dist/esm/api/aptos.mjs +1 -1
  27. package/dist/esm/api/aptosConfig.d.mts +20 -0
  28. package/dist/esm/api/aptosConfig.mjs +1 -1
  29. package/dist/esm/api/coin.d.mts +2 -2
  30. package/dist/esm/api/coin.mjs +1 -1
  31. package/dist/esm/api/digitalAsset.d.mts +2 -2
  32. package/dist/esm/api/digitalAsset.mjs +1 -1
  33. package/dist/esm/api/event.mjs +1 -1
  34. package/dist/esm/api/faucet.mjs +1 -1
  35. package/dist/esm/api/fungibleAsset.mjs +1 -1
  36. package/dist/esm/api/general.mjs +1 -1
  37. package/dist/esm/api/index.d.mts +7 -0
  38. package/dist/esm/api/index.mjs +1 -1
  39. package/dist/esm/api/keyless.d.mts +104 -0
  40. package/dist/esm/api/keyless.mjs +2 -0
  41. package/dist/esm/api/keyless.mjs.map +1 -0
  42. package/dist/esm/api/staking.mjs +1 -1
  43. package/dist/esm/api/table.mjs +1 -1
  44. package/dist/esm/api/transaction.mjs +1 -1
  45. package/dist/esm/api/transactionSubmission/build.d.mts +2 -2
  46. package/dist/esm/api/transactionSubmission/build.mjs +1 -1
  47. package/dist/esm/api/transactionSubmission/management.mjs +1 -1
  48. package/dist/esm/api/transactionSubmission/sign.d.mts +2 -2
  49. package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
  50. package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -1
  51. package/dist/esm/api/transactionSubmission/simulate.d.mts +2 -2
  52. package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
  53. package/dist/esm/api/transactionSubmission/submit.d.mts +2 -2
  54. package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
  55. package/dist/esm/api/utils.mjs +1 -1
  56. package/dist/esm/bcs/deserializer.d.mts +32 -0
  57. package/dist/esm/bcs/deserializer.mjs +1 -1
  58. package/dist/esm/bcs/index.mjs +1 -1
  59. package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -1
  60. package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -1
  61. package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
  62. package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
  63. package/dist/esm/bcs/serializer.d.mts +42 -0
  64. package/dist/esm/bcs/serializer.mjs +1 -1
  65. package/dist/esm/{chunk-TQLED4KC.mjs → chunk-2DSPX6BX.mjs} +2 -2
  66. package/dist/esm/chunk-2QWQ6RX5.mjs +2 -0
  67. package/dist/esm/chunk-2QWQ6RX5.mjs.map +1 -0
  68. package/dist/esm/chunk-362JBD4O.mjs +2 -0
  69. package/dist/esm/{chunk-SUAMDMAA.mjs.map → chunk-362JBD4O.mjs.map} +1 -1
  70. package/dist/esm/{chunk-RWXHA4QZ.mjs → chunk-3VUSIKCF.mjs} +2 -2
  71. package/dist/esm/chunk-3ZCQQ3L2.mjs +2 -0
  72. package/dist/esm/chunk-3ZCQQ3L2.mjs.map +1 -0
  73. package/dist/esm/chunk-42SZQH5Z.mjs +2 -0
  74. package/dist/esm/chunk-42SZQH5Z.mjs.map +1 -0
  75. package/dist/esm/{chunk-MCRRHBFQ.mjs → chunk-4EPLOSKY.mjs} +2 -2
  76. package/dist/esm/{chunk-BSVNV6SJ.mjs → chunk-4IBJW3PB.mjs} +2 -2
  77. package/dist/esm/{chunk-J6HKAEKY.mjs → chunk-5X2BJDOB.mjs} +2 -2
  78. package/dist/esm/{chunk-5UKBTF7N.mjs → chunk-5YHI7WOB.mjs} +2 -2
  79. package/dist/esm/{chunk-J5I4OZAS.mjs → chunk-6DYDZSEW.mjs} +2 -2
  80. package/dist/esm/{chunk-J4Z6XR5D.mjs → chunk-6JL2U7JB.mjs} +2 -2
  81. package/dist/esm/{chunk-RNL5TAQT.mjs → chunk-6UDHM6YZ.mjs} +2 -2
  82. package/dist/esm/{chunk-2X7A4HUS.mjs → chunk-6ZQWPHLV.mjs} +2 -2
  83. package/dist/esm/{chunk-4NHWV5AI.mjs → chunk-76OH2Z4Q.mjs} +2 -2
  84. package/dist/esm/{chunk-5EN52MUT.mjs → chunk-77NXCSLY.mjs} +2 -2
  85. package/dist/esm/{chunk-ND6OMSQU.mjs → chunk-7Y45UTRL.mjs} +2 -2
  86. package/dist/esm/chunk-7Z6DYLCA.mjs +1 -0
  87. package/dist/esm/chunk-7Z6DYLCA.mjs.map +1 -0
  88. package/dist/esm/{chunk-T2AGN5YT.mjs → chunk-A2Z7I2EY.mjs} +2 -2
  89. package/dist/esm/{chunk-36QXVFR5.mjs → chunk-A63SMUOU.mjs} +2 -2
  90. package/dist/esm/{chunk-36QXVFR5.mjs.map → chunk-A63SMUOU.mjs.map} +1 -1
  91. package/dist/esm/chunk-AQ4I7VVB.mjs +1 -0
  92. package/dist/esm/chunk-AQ4I7VVB.mjs.map +1 -0
  93. package/dist/esm/{chunk-3XFID2N4.mjs → chunk-AVH5SYTL.mjs} +2 -2
  94. package/dist/esm/{chunk-3N6N3KOS.mjs → chunk-AYKZA676.mjs} +2 -2
  95. package/dist/esm/{chunk-QRS4DGP3.mjs → chunk-BF46IXHH.mjs} +2 -2
  96. package/dist/esm/chunk-BLVYB7Y3.mjs +2 -0
  97. package/dist/esm/chunk-BLVYB7Y3.mjs.map +1 -0
  98. package/dist/esm/{chunk-PF57EOJY.mjs → chunk-BOYYQAB4.mjs} +2 -2
  99. package/dist/esm/{chunk-RPND23OR.mjs → chunk-BS7EVBWX.mjs} +2 -2
  100. package/dist/esm/{chunk-JX75UKJX.mjs → chunk-BVB3QII3.mjs} +2 -2
  101. package/dist/esm/{chunk-KZZWY4YI.mjs → chunk-C5V4EBVP.mjs} +2 -2
  102. package/dist/esm/{chunk-3BNA74V5.mjs → chunk-CZ6TC4GO.mjs} +2 -2
  103. package/dist/esm/{chunk-2HF2XEHO.mjs → chunk-DLDGUTFV.mjs} +2 -2
  104. package/dist/esm/{chunk-YR7JRJ25.mjs → chunk-DPO352QL.mjs} +2 -2
  105. package/dist/esm/{chunk-GM56MMNJ.mjs → chunk-DW2KZREM.mjs} +2 -2
  106. package/dist/esm/chunk-DZXM2MQY.mjs +2 -0
  107. package/dist/esm/chunk-DZXM2MQY.mjs.map +1 -0
  108. package/dist/esm/{chunk-6YV3366Z.mjs → chunk-EAW6AWYD.mjs} +2 -2
  109. package/dist/esm/{chunk-NUK6JT5I.mjs → chunk-EYIJYUN7.mjs} +2 -2
  110. package/dist/esm/{chunk-AF5WNJOP.mjs → chunk-F74FF323.mjs} +2 -2
  111. package/dist/esm/chunk-FM6ALU5B.mjs +2 -0
  112. package/dist/esm/chunk-FM6ALU5B.mjs.map +1 -0
  113. package/dist/esm/{chunk-ISIUQQMV.mjs → chunk-FNFQA7NS.mjs} +2 -2
  114. package/dist/esm/chunk-FTIW5GGG.mjs +2 -0
  115. package/dist/esm/{chunk-BRVWHCP3.mjs.map → chunk-FTIW5GGG.mjs.map} +1 -1
  116. package/dist/esm/{chunk-G2XVNF2T.mjs → chunk-FYB7C42X.mjs} +2 -2
  117. package/dist/esm/chunk-GFRNBBTY.mjs +2 -0
  118. package/dist/esm/chunk-GFRNBBTY.mjs.map +1 -0
  119. package/dist/esm/{chunk-CEHCDA3G.mjs → chunk-H6YNXJNF.mjs} +2 -2
  120. package/dist/esm/{chunk-47IIBESV.mjs → chunk-HCN7YJGB.mjs} +2 -2
  121. package/dist/esm/chunk-HHE63GFW.mjs +2 -0
  122. package/dist/esm/chunk-HHE63GFW.mjs.map +1 -0
  123. package/dist/esm/{chunk-S3EDNXZE.mjs → chunk-HIHKTLLM.mjs} +20 -18
  124. package/dist/esm/chunk-HIHKTLLM.mjs.map +1 -0
  125. package/dist/esm/chunk-IVVWQKCF.mjs +2 -0
  126. package/dist/esm/chunk-IVVWQKCF.mjs.map +1 -0
  127. package/dist/esm/{chunk-53INTTOI.mjs → chunk-JPDT6E3B.mjs} +2 -2
  128. package/dist/esm/{chunk-J4VNDDKJ.mjs → chunk-JSWBLHMX.mjs} +2 -2
  129. package/dist/esm/{chunk-73QJNN7O.mjs → chunk-K4CTCBLY.mjs} +2 -2
  130. package/dist/esm/{chunk-AQAH67IV.mjs → chunk-K7DBDI2I.mjs} +2 -2
  131. package/dist/esm/{chunk-PIVZMT5D.mjs → chunk-L22R3OIW.mjs} +2 -2
  132. package/dist/esm/{chunk-4GWNWSZP.mjs → chunk-LVSOUCFD.mjs} +2 -2
  133. package/dist/esm/{chunk-AHW3SKT7.mjs → chunk-M3JHXCGV.mjs} +2 -2
  134. package/dist/esm/{chunk-ZRKXS7XG.mjs → chunk-MHZ64FIW.mjs} +2 -2
  135. package/dist/esm/{chunk-UGPALAPN.mjs → chunk-MLDQ2TY2.mjs} +2 -2
  136. package/dist/esm/chunk-MQGW234H.mjs +2 -0
  137. package/dist/esm/chunk-MQGW234H.mjs.map +1 -0
  138. package/dist/esm/chunk-NCUBVHUW.mjs +2 -0
  139. package/dist/esm/chunk-NCUBVHUW.mjs.map +1 -0
  140. package/dist/esm/chunk-NMD45OTM.mjs +2 -0
  141. package/dist/esm/chunk-NMD45OTM.mjs.map +1 -0
  142. package/dist/esm/{chunk-R5VVKRJ2.mjs → chunk-NNQYSSLH.mjs} +2 -2
  143. package/dist/esm/{chunk-CZOD4SCZ.mjs → chunk-NSQLZBCA.mjs} +2 -2
  144. package/dist/esm/{chunk-KAGLWBIJ.mjs → chunk-OPGMT27G.mjs} +2 -2
  145. package/dist/esm/{chunk-N3U47Y6Y.mjs → chunk-P5V7OZNN.mjs} +2 -2
  146. package/dist/esm/{chunk-337U6Q6K.mjs → chunk-PTA3VHTQ.mjs} +2 -2
  147. package/dist/esm/chunk-Q6LFIZ3L.mjs +2 -0
  148. package/dist/esm/chunk-Q6LFIZ3L.mjs.map +1 -0
  149. package/dist/esm/chunk-QAMV4L3K.mjs +2 -0
  150. package/dist/esm/chunk-QAMV4L3K.mjs.map +1 -0
  151. package/dist/esm/{chunk-BEVXJJJF.mjs → chunk-QL2QFRKV.mjs} +2 -2
  152. package/dist/esm/chunk-QVWBJJRF.mjs +2 -0
  153. package/dist/esm/chunk-QVWBJJRF.mjs.map +1 -0
  154. package/dist/esm/{chunk-U3YYSIIT.mjs → chunk-RFA7BIDN.mjs} +2 -2
  155. package/dist/esm/{chunk-G56GPLTB.mjs → chunk-RJ4RKVVQ.mjs} +2 -2
  156. package/dist/esm/{chunk-BBVIJO6X.mjs → chunk-S32JHML7.mjs} +2 -2
  157. package/dist/esm/chunk-SCHZ67F3.mjs +2 -0
  158. package/dist/esm/chunk-SCHZ67F3.mjs.map +1 -0
  159. package/dist/esm/chunk-SFUTXSDK.mjs +2 -0
  160. package/dist/esm/chunk-SFUTXSDK.mjs.map +1 -0
  161. package/dist/esm/{chunk-3SPIFLBZ.mjs → chunk-SLFAROVZ.mjs} +2 -2
  162. package/dist/esm/{chunk-CT2BQQTZ.mjs → chunk-TG2LLWVU.mjs} +2 -2
  163. package/dist/esm/{chunk-35EWRSDK.mjs → chunk-TY4IEDJD.mjs} +2 -2
  164. package/dist/esm/chunk-U4A56FN2.mjs +2 -0
  165. package/dist/esm/{chunk-7UBKXR37.mjs.map → chunk-U4A56FN2.mjs.map} +1 -1
  166. package/dist/esm/chunk-U6X2FYNI.mjs +2 -0
  167. package/dist/esm/chunk-U6X2FYNI.mjs.map +1 -0
  168. package/dist/esm/{chunk-G2UPF44Z.mjs → chunk-UAZUO75M.mjs} +2 -2
  169. package/dist/esm/{chunk-HLC4HAYY.mjs → chunk-UGVNOSD3.mjs} +2 -2
  170. package/dist/esm/{chunk-LGNSPATO.mjs → chunk-VCMP3MXN.mjs} +2 -2
  171. package/dist/esm/{chunk-PZ4SAXY7.mjs → chunk-VTKPSYKA.mjs} +2 -2
  172. package/dist/esm/chunk-VTKPSYKA.mjs.map +1 -0
  173. package/dist/esm/chunk-WQHW4WQN.mjs +2 -0
  174. package/dist/esm/chunk-WQHW4WQN.mjs.map +1 -0
  175. package/dist/esm/chunk-WV5AD4IE.mjs +2 -0
  176. package/dist/esm/{chunk-CE65OKFI.mjs → chunk-XWVU4G57.mjs} +2 -2
  177. package/dist/esm/{chunk-ZHCSSCC5.mjs → chunk-XYLM277Z.mjs} +2 -2
  178. package/dist/esm/chunk-YE5B2S5L.mjs +2 -0
  179. package/dist/esm/chunk-YE5B2S5L.mjs.map +1 -0
  180. package/dist/esm/{chunk-FAFJKSVZ.mjs → chunk-YMUCYX3B.mjs} +2 -2
  181. package/dist/esm/{chunk-SRDIYE3M.mjs → chunk-YPHH6CAO.mjs} +2 -2
  182. package/dist/esm/chunk-YTQVMLFD.mjs +2 -0
  183. package/dist/esm/chunk-YTQVMLFD.mjs.map +1 -0
  184. package/dist/esm/{chunk-B7X6PSE7.mjs → chunk-YUNDX5I7.mjs} +2 -2
  185. package/dist/esm/chunk-Z4YHE4A5.mjs +2 -0
  186. package/dist/esm/{chunk-4BJA3QUQ.mjs.map → chunk-Z4YHE4A5.mjs.map} +1 -1
  187. package/dist/esm/cli/index.mjs +1 -1
  188. package/dist/esm/cli/localNode.mjs +1 -1
  189. package/dist/esm/cli/move.mjs +1 -1
  190. package/dist/esm/client/core.mjs +1 -1
  191. package/dist/esm/client/get.d.mts +8 -1
  192. package/dist/esm/client/get.mjs +1 -1
  193. package/dist/esm/client/index.d.mts +2 -2
  194. package/dist/esm/client/index.mjs +1 -1
  195. package/dist/esm/client/post.d.mts +9 -1
  196. package/dist/esm/client/post.mjs +1 -1
  197. package/dist/esm/core/account/index.mjs +1 -1
  198. package/dist/esm/core/account/utils/address.mjs +1 -1
  199. package/dist/esm/core/account/utils/index.mjs +1 -1
  200. package/dist/esm/core/accountAddress.mjs +1 -1
  201. package/dist/esm/core/authenticationKey.mjs +1 -1
  202. package/dist/esm/core/crypto/ed25519.mjs +1 -1
  203. package/dist/esm/core/crypto/ephemeral.d.mts +73 -0
  204. package/dist/esm/core/crypto/ephemeral.mjs +2 -0
  205. package/dist/esm/core/crypto/ephemeral.mjs.map +1 -0
  206. package/dist/esm/core/crypto/index.d.mts +6 -0
  207. package/dist/esm/core/crypto/index.mjs +1 -1
  208. package/dist/esm/core/crypto/keyless.d.mts +321 -0
  209. package/dist/esm/core/crypto/keyless.mjs +2 -0
  210. package/dist/esm/core/crypto/keyless.mjs.map +1 -0
  211. package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
  212. package/dist/esm/core/crypto/multiKey.mjs +1 -1
  213. package/dist/esm/core/crypto/poseidon.d.mts +19 -0
  214. package/dist/esm/core/crypto/poseidon.mjs +2 -0
  215. package/dist/esm/core/crypto/poseidon.mjs.map +1 -0
  216. package/dist/esm/core/crypto/proof.d.mts +21 -0
  217. package/dist/esm/core/crypto/proof.mjs +2 -0
  218. package/dist/esm/core/crypto/proof.mjs.map +1 -0
  219. package/dist/esm/core/crypto/publicKey.mjs +1 -1
  220. package/dist/esm/core/crypto/secp256k1.mjs +1 -1
  221. package/dist/esm/core/crypto/signature.mjs +1 -1
  222. package/dist/esm/core/crypto/singleKey.mjs +1 -1
  223. package/dist/esm/core/index.d.mts +6 -0
  224. package/dist/esm/core/index.mjs +1 -1
  225. package/dist/esm/index.d.mts +11 -4
  226. package/dist/esm/index.mjs +1 -1
  227. package/dist/esm/internal/account.mjs +1 -1
  228. package/dist/esm/internal/ans.mjs +1 -1
  229. package/dist/esm/internal/coin.mjs +1 -1
  230. package/dist/esm/internal/digitalAsset.mjs +1 -1
  231. package/dist/esm/internal/event.mjs +1 -1
  232. package/dist/esm/internal/faucet.mjs +1 -1
  233. package/dist/esm/internal/fungibleAsset.mjs +1 -1
  234. package/dist/esm/internal/general.mjs +1 -1
  235. package/dist/esm/internal/keyless.d.mts +72 -0
  236. package/dist/esm/internal/keyless.mjs +2 -0
  237. package/dist/esm/internal/keyless.mjs.map +1 -0
  238. package/dist/esm/internal/staking.mjs +1 -1
  239. package/dist/esm/internal/table.mjs +1 -1
  240. package/dist/esm/internal/transaction.mjs +1 -1
  241. package/dist/esm/internal/transactionSubmission.mjs +1 -1
  242. package/dist/esm/internal/view.mjs +1 -1
  243. package/dist/esm/transactions/authenticator/account.mjs +1 -1
  244. package/dist/esm/transactions/authenticator/index.mjs +1 -1
  245. package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
  246. package/dist/esm/transactions/index.mjs +1 -1
  247. package/dist/esm/transactions/instances/chainId.mjs +1 -1
  248. package/dist/esm/transactions/instances/identifier.mjs +1 -1
  249. package/dist/esm/transactions/instances/index.mjs +1 -1
  250. package/dist/esm/transactions/instances/moduleId.mjs +1 -1
  251. package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
  252. package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
  253. package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
  254. package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
  255. package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
  256. package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
  257. package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
  258. package/dist/esm/transactions/management/index.mjs +1 -1
  259. package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
  260. package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
  261. package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
  262. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
  263. package/dist/esm/transactions/transactionBuilder/signingMessage.d.mts +3 -0
  264. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
  265. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
  266. package/dist/esm/transactions/typeTag/index.mjs +1 -1
  267. package/dist/esm/transactions/typeTag/parser.mjs +1 -1
  268. package/dist/esm/types/generated/operations.d.mts +14 -12
  269. package/dist/esm/types/generated/queries.d.mts +4 -4
  270. package/dist/esm/types/generated/queries.mjs +1 -1
  271. package/dist/esm/types/generated/types.d.mts +20 -2
  272. package/dist/esm/types/generated/types.mjs +1 -1
  273. package/dist/esm/types/generated/types.mjs.map +1 -1
  274. package/dist/esm/types/index.d.mts +21 -5
  275. package/dist/esm/types/index.mjs +1 -1
  276. package/dist/esm/types/keyless.d.mts +51 -0
  277. package/dist/esm/types/keyless.mjs +1 -0
  278. package/dist/esm/types/keyless.mjs.map +1 -0
  279. package/dist/esm/utils/apiEndpoints.d.mts +3 -1
  280. package/dist/esm/utils/apiEndpoints.mjs +1 -1
  281. package/dist/esm/utils/const.d.mts +3 -1
  282. package/dist/esm/utils/const.mjs +1 -1
  283. package/dist/esm/utils/helpers.d.mts +4 -1
  284. package/dist/esm/utils/helpers.mjs +1 -1
  285. package/dist/esm/utils/index.d.mts +1 -1
  286. package/dist/esm/utils/index.mjs +1 -1
  287. package/dist/esm/utils/normalizeBundle.mjs +1 -1
  288. package/dist/esm/version.d.mts +1 -1
  289. package/dist/esm/version.mjs +1 -1
  290. package/package.json +9 -3
  291. package/src/account/EphemeralKeyPair.ts +150 -0
  292. package/src/account/KeylessAccount.ts +370 -0
  293. package/src/account/MultiKeyAccount.ts +12 -0
  294. package/src/account/index.ts +2 -0
  295. package/src/api/aptos.ts +6 -0
  296. package/src/api/aptosConfig.ts +46 -1
  297. package/src/api/keyless.ts +78 -0
  298. package/src/bcs/deserializer.ts +40 -0
  299. package/src/bcs/serializer.ts +57 -0
  300. package/src/cli/move.ts +4 -7
  301. package/src/client/core.ts +4 -0
  302. package/src/client/get.ts +12 -0
  303. package/src/client/post.ts +18 -0
  304. package/src/core/crypto/ephemeral.ts +138 -0
  305. package/src/core/crypto/index.ts +2 -0
  306. package/src/core/crypto/keyless.ts +679 -0
  307. package/src/core/crypto/poseidon.ts +144 -0
  308. package/src/core/crypto/proof.ts +16 -0
  309. package/src/core/crypto/singleKey.ts +11 -0
  310. package/src/internal/keyless.ts +129 -0
  311. package/src/internal/queries/getFungibleAssetMetadata.graphql +2 -0
  312. package/src/internal/transactionSubmission.ts +6 -1
  313. package/src/transactions/management/accountSequenceNumber.ts +5 -8
  314. package/src/transactions/transactionBuilder/signingMessage.ts +3 -0
  315. package/src/transactions/transactionBuilder/transactionBuilder.ts +16 -1
  316. package/src/types/generated/operations.ts +14 -12
  317. package/src/types/generated/queries.ts +30 -3
  318. package/src/types/generated/types.ts +20 -2
  319. package/src/types/index.ts +24 -2
  320. package/src/types/keyless.ts +42 -0
  321. package/src/utils/apiEndpoints.ts +16 -0
  322. package/src/utils/const.ts +2 -0
  323. package/src/utils/helpers.ts +22 -0
  324. package/src/version.ts +1 -1
  325. package/dist/common/chunk-KSEUZTKY.js +0 -2
  326. package/dist/common/chunk-KSEUZTKY.js.map +0 -1
  327. package/dist/esm/chunk-3JPVQHOR.mjs +0 -2
  328. package/dist/esm/chunk-3JPVQHOR.mjs.map +0 -1
  329. package/dist/esm/chunk-4BJA3QUQ.mjs +0 -2
  330. package/dist/esm/chunk-6IFMQ5AS.mjs +0 -2
  331. package/dist/esm/chunk-6IFMQ5AS.mjs.map +0 -1
  332. package/dist/esm/chunk-746MU2AB.mjs +0 -2
  333. package/dist/esm/chunk-746MU2AB.mjs.map +0 -1
  334. package/dist/esm/chunk-7UBKXR37.mjs +0 -2
  335. package/dist/esm/chunk-BRVWHCP3.mjs +0 -2
  336. package/dist/esm/chunk-CYNQRMO5.mjs +0 -2
  337. package/dist/esm/chunk-CYNQRMO5.mjs.map +0 -1
  338. package/dist/esm/chunk-D2LNQMKD.mjs +0 -2
  339. package/dist/esm/chunk-D2LNQMKD.mjs.map +0 -1
  340. package/dist/esm/chunk-DLAIJ2UM.mjs +0 -2
  341. package/dist/esm/chunk-DLAIJ2UM.mjs.map +0 -1
  342. package/dist/esm/chunk-HYCGMFC2.mjs +0 -2
  343. package/dist/esm/chunk-HYCGMFC2.mjs.map +0 -1
  344. package/dist/esm/chunk-IENCDVPF.mjs +0 -2
  345. package/dist/esm/chunk-IENCDVPF.mjs.map +0 -1
  346. package/dist/esm/chunk-MM5VMKFE.mjs +0 -2
  347. package/dist/esm/chunk-MM5VMKFE.mjs.map +0 -1
  348. package/dist/esm/chunk-OWW6SIDP.mjs +0 -2
  349. package/dist/esm/chunk-OWW6SIDP.mjs.map +0 -1
  350. package/dist/esm/chunk-PZ4SAXY7.mjs.map +0 -1
  351. package/dist/esm/chunk-ROXFCLDT.mjs +0 -2
  352. package/dist/esm/chunk-RTSWVT2Q.mjs +0 -2
  353. package/dist/esm/chunk-RTSWVT2Q.mjs.map +0 -1
  354. package/dist/esm/chunk-S3EDNXZE.mjs.map +0 -1
  355. package/dist/esm/chunk-SUAMDMAA.mjs +0 -2
  356. package/dist/esm/chunk-UO3NZ5AH.mjs +0 -1
  357. package/dist/esm/chunk-UTKM2WYS.mjs +0 -2
  358. package/dist/esm/chunk-UTKM2WYS.mjs.map +0 -1
  359. package/dist/esm/chunk-UVSRX4SV.mjs +0 -1
  360. package/dist/esm/chunk-W33BZ6IQ.mjs +0 -2
  361. package/dist/esm/chunk-W33BZ6IQ.mjs.map +0 -1
  362. /package/dist/esm/{chunk-UO3NZ5AH.mjs.map → account/EphemeralKeyPair.mjs.map} +0 -0
  363. /package/dist/esm/{chunk-UVSRX4SV.mjs.map → account/KeylessAccount.mjs.map} +0 -0
  364. /package/dist/esm/{chunk-TQLED4KC.mjs.map → chunk-2DSPX6BX.mjs.map} +0 -0
  365. /package/dist/esm/{chunk-RWXHA4QZ.mjs.map → chunk-3VUSIKCF.mjs.map} +0 -0
  366. /package/dist/esm/{chunk-MCRRHBFQ.mjs.map → chunk-4EPLOSKY.mjs.map} +0 -0
  367. /package/dist/esm/{chunk-BSVNV6SJ.mjs.map → chunk-4IBJW3PB.mjs.map} +0 -0
  368. /package/dist/esm/{chunk-J6HKAEKY.mjs.map → chunk-5X2BJDOB.mjs.map} +0 -0
  369. /package/dist/esm/{chunk-5UKBTF7N.mjs.map → chunk-5YHI7WOB.mjs.map} +0 -0
  370. /package/dist/esm/{chunk-J5I4OZAS.mjs.map → chunk-6DYDZSEW.mjs.map} +0 -0
  371. /package/dist/esm/{chunk-J4Z6XR5D.mjs.map → chunk-6JL2U7JB.mjs.map} +0 -0
  372. /package/dist/esm/{chunk-RNL5TAQT.mjs.map → chunk-6UDHM6YZ.mjs.map} +0 -0
  373. /package/dist/esm/{chunk-2X7A4HUS.mjs.map → chunk-6ZQWPHLV.mjs.map} +0 -0
  374. /package/dist/esm/{chunk-4NHWV5AI.mjs.map → chunk-76OH2Z4Q.mjs.map} +0 -0
  375. /package/dist/esm/{chunk-5EN52MUT.mjs.map → chunk-77NXCSLY.mjs.map} +0 -0
  376. /package/dist/esm/{chunk-ND6OMSQU.mjs.map → chunk-7Y45UTRL.mjs.map} +0 -0
  377. /package/dist/esm/{chunk-T2AGN5YT.mjs.map → chunk-A2Z7I2EY.mjs.map} +0 -0
  378. /package/dist/esm/{chunk-3XFID2N4.mjs.map → chunk-AVH5SYTL.mjs.map} +0 -0
  379. /package/dist/esm/{chunk-3N6N3KOS.mjs.map → chunk-AYKZA676.mjs.map} +0 -0
  380. /package/dist/esm/{chunk-QRS4DGP3.mjs.map → chunk-BF46IXHH.mjs.map} +0 -0
  381. /package/dist/esm/{chunk-PF57EOJY.mjs.map → chunk-BOYYQAB4.mjs.map} +0 -0
  382. /package/dist/esm/{chunk-RPND23OR.mjs.map → chunk-BS7EVBWX.mjs.map} +0 -0
  383. /package/dist/esm/{chunk-JX75UKJX.mjs.map → chunk-BVB3QII3.mjs.map} +0 -0
  384. /package/dist/esm/{chunk-KZZWY4YI.mjs.map → chunk-C5V4EBVP.mjs.map} +0 -0
  385. /package/dist/esm/{chunk-3BNA74V5.mjs.map → chunk-CZ6TC4GO.mjs.map} +0 -0
  386. /package/dist/esm/{chunk-2HF2XEHO.mjs.map → chunk-DLDGUTFV.mjs.map} +0 -0
  387. /package/dist/esm/{chunk-YR7JRJ25.mjs.map → chunk-DPO352QL.mjs.map} +0 -0
  388. /package/dist/esm/{chunk-GM56MMNJ.mjs.map → chunk-DW2KZREM.mjs.map} +0 -0
  389. /package/dist/esm/{chunk-6YV3366Z.mjs.map → chunk-EAW6AWYD.mjs.map} +0 -0
  390. /package/dist/esm/{chunk-NUK6JT5I.mjs.map → chunk-EYIJYUN7.mjs.map} +0 -0
  391. /package/dist/esm/{chunk-AF5WNJOP.mjs.map → chunk-F74FF323.mjs.map} +0 -0
  392. /package/dist/esm/{chunk-ISIUQQMV.mjs.map → chunk-FNFQA7NS.mjs.map} +0 -0
  393. /package/dist/esm/{chunk-G2XVNF2T.mjs.map → chunk-FYB7C42X.mjs.map} +0 -0
  394. /package/dist/esm/{chunk-CEHCDA3G.mjs.map → chunk-H6YNXJNF.mjs.map} +0 -0
  395. /package/dist/esm/{chunk-47IIBESV.mjs.map → chunk-HCN7YJGB.mjs.map} +0 -0
  396. /package/dist/esm/{chunk-53INTTOI.mjs.map → chunk-JPDT6E3B.mjs.map} +0 -0
  397. /package/dist/esm/{chunk-J4VNDDKJ.mjs.map → chunk-JSWBLHMX.mjs.map} +0 -0
  398. /package/dist/esm/{chunk-73QJNN7O.mjs.map → chunk-K4CTCBLY.mjs.map} +0 -0
  399. /package/dist/esm/{chunk-AQAH67IV.mjs.map → chunk-K7DBDI2I.mjs.map} +0 -0
  400. /package/dist/esm/{chunk-PIVZMT5D.mjs.map → chunk-L22R3OIW.mjs.map} +0 -0
  401. /package/dist/esm/{chunk-4GWNWSZP.mjs.map → chunk-LVSOUCFD.mjs.map} +0 -0
  402. /package/dist/esm/{chunk-AHW3SKT7.mjs.map → chunk-M3JHXCGV.mjs.map} +0 -0
  403. /package/dist/esm/{chunk-ZRKXS7XG.mjs.map → chunk-MHZ64FIW.mjs.map} +0 -0
  404. /package/dist/esm/{chunk-UGPALAPN.mjs.map → chunk-MLDQ2TY2.mjs.map} +0 -0
  405. /package/dist/esm/{chunk-R5VVKRJ2.mjs.map → chunk-NNQYSSLH.mjs.map} +0 -0
  406. /package/dist/esm/{chunk-CZOD4SCZ.mjs.map → chunk-NSQLZBCA.mjs.map} +0 -0
  407. /package/dist/esm/{chunk-KAGLWBIJ.mjs.map → chunk-OPGMT27G.mjs.map} +0 -0
  408. /package/dist/esm/{chunk-N3U47Y6Y.mjs.map → chunk-P5V7OZNN.mjs.map} +0 -0
  409. /package/dist/esm/{chunk-337U6Q6K.mjs.map → chunk-PTA3VHTQ.mjs.map} +0 -0
  410. /package/dist/esm/{chunk-BEVXJJJF.mjs.map → chunk-QL2QFRKV.mjs.map} +0 -0
  411. /package/dist/esm/{chunk-U3YYSIIT.mjs.map → chunk-RFA7BIDN.mjs.map} +0 -0
  412. /package/dist/esm/{chunk-G56GPLTB.mjs.map → chunk-RJ4RKVVQ.mjs.map} +0 -0
  413. /package/dist/esm/{chunk-BBVIJO6X.mjs.map → chunk-S32JHML7.mjs.map} +0 -0
  414. /package/dist/esm/{chunk-3SPIFLBZ.mjs.map → chunk-SLFAROVZ.mjs.map} +0 -0
  415. /package/dist/esm/{chunk-CT2BQQTZ.mjs.map → chunk-TG2LLWVU.mjs.map} +0 -0
  416. /package/dist/esm/{chunk-35EWRSDK.mjs.map → chunk-TY4IEDJD.mjs.map} +0 -0
  417. /package/dist/esm/{chunk-G2UPF44Z.mjs.map → chunk-UAZUO75M.mjs.map} +0 -0
  418. /package/dist/esm/{chunk-HLC4HAYY.mjs.map → chunk-UGVNOSD3.mjs.map} +0 -0
  419. /package/dist/esm/{chunk-LGNSPATO.mjs.map → chunk-VCMP3MXN.mjs.map} +0 -0
  420. /package/dist/esm/{chunk-ROXFCLDT.mjs.map → chunk-WV5AD4IE.mjs.map} +0 -0
  421. /package/dist/esm/{chunk-CE65OKFI.mjs.map → chunk-XWVU4G57.mjs.map} +0 -0
  422. /package/dist/esm/{chunk-ZHCSSCC5.mjs.map → chunk-XYLM277Z.mjs.map} +0 -0
  423. /package/dist/esm/{chunk-FAFJKSVZ.mjs.map → chunk-YMUCYX3B.mjs.map} +0 -0
  424. /package/dist/esm/{chunk-SRDIYE3M.mjs.map → chunk-YPHH6CAO.mjs.map} +0 -0
  425. /package/dist/esm/{chunk-B7X6PSE7.mjs.map → chunk-YUNDX5I7.mjs.map} +0 -0
@@ -1,6 +1,8 @@
1
1
  declare const NetworkToIndexerAPI: Record<string, string>;
2
2
  declare const NetworkToNodeAPI: Record<string, string>;
3
3
  declare const NetworkToFaucetAPI: Record<string, string>;
4
+ declare const NetworkToPepperAPI: Record<string, string>;
5
+ declare const NetworkToProverAPI: Record<string, string>;
4
6
  declare enum Network {
5
7
  MAINNET = "mainnet",
6
8
  TESTNET = "testnet",
@@ -99,13 +101,13 @@ type GetAccountOwnedTokensQuery = {
99
101
  last_transaction_timestamp: any;
100
102
  last_transaction_version: any;
101
103
  maximum?: any | null;
102
- supply: any;
104
+ supply?: any | null;
103
105
  token_data_id: string;
104
106
  token_name: string;
105
107
  token_properties: any;
106
108
  token_standard: string;
107
109
  token_uri: string;
108
- decimals: any;
110
+ decimals?: any | null;
109
111
  current_collection?: {
110
112
  collection_id: string;
111
113
  collection_name: string;
@@ -147,13 +149,13 @@ type GetAccountOwnedTokensFromCollectionQuery = {
147
149
  last_transaction_timestamp: any;
148
150
  last_transaction_version: any;
149
151
  maximum?: any | null;
150
- supply: any;
152
+ supply?: any | null;
151
153
  token_data_id: string;
152
154
  token_name: string;
153
155
  token_properties: any;
154
156
  token_standard: string;
155
157
  token_uri: string;
156
- decimals: any;
158
+ decimals?: any | null;
157
159
  current_collection?: {
158
160
  collection_id: string;
159
161
  collection_name: string;
@@ -266,6 +268,8 @@ type GetFungibleAssetMetadataQuery = {
266
268
  name: string;
267
269
  symbol: string;
268
270
  token_standard: string;
271
+ supply_v2?: any | null;
272
+ maximum_v2?: any | null;
269
273
  }>;
270
274
  };
271
275
  type GetNamesQuery = {
@@ -350,13 +354,13 @@ type GetCurrentTokenOwnershipQuery = {
350
354
  last_transaction_timestamp: any;
351
355
  last_transaction_version: any;
352
356
  maximum?: any | null;
353
- supply: any;
357
+ supply?: any | null;
354
358
  token_data_id: string;
355
359
  token_name: string;
356
360
  token_properties: any;
357
361
  token_standard: string;
358
362
  token_uri: string;
359
- decimals: any;
363
+ decimals?: any | null;
360
364
  current_collection?: {
361
365
  collection_id: string;
362
366
  collection_name: string;
@@ -385,13 +389,13 @@ type GetTokenDataQuery = {
385
389
  last_transaction_timestamp: any;
386
390
  last_transaction_version: any;
387
391
  maximum?: any | null;
388
- supply: any;
392
+ supply?: any | null;
389
393
  token_data_id: string;
390
394
  token_name: string;
391
395
  token_properties: any;
392
396
  token_standard: string;
393
397
  token_uri: string;
394
- decimals: any;
398
+ decimals?: any | null;
395
399
  current_collection?: {
396
400
  collection_id: string;
397
401
  collection_name: string;
@@ -565,11 +569,25 @@ declare enum AccountAuthenticatorVariant {
565
569
  }
566
570
  declare enum AnyPublicKeyVariant {
567
571
  Ed25519 = 0,
568
- Secp256k1 = 1
572
+ Secp256k1 = 1,
573
+ Keyless = 3
569
574
  }
570
575
  declare enum AnySignatureVariant {
571
576
  Ed25519 = 0,
572
- Secp256k1 = 1
577
+ Secp256k1 = 1,
578
+ Keyless = 3
579
+ }
580
+ declare enum EphemeralPublicKeyVariant {
581
+ Ed25519 = 0
582
+ }
583
+ declare enum EphemeralSignatureVariant {
584
+ Ed25519 = 0
585
+ }
586
+ declare enum EphemeralCertificateVariant {
587
+ ZkProof = 0
588
+ }
589
+ declare enum ZkpVariant {
590
+ Groth16 = 0
573
591
  }
574
592
  /**
575
593
  * BCS types
@@ -591,6 +609,8 @@ type AptosSettings = {
591
609
  readonly fullnode?: string;
592
610
  readonly faucet?: string;
593
611
  readonly indexer?: string;
612
+ readonly pepper?: string;
613
+ readonly prover?: string;
594
614
  readonly clientConfig?: ClientConfig;
595
615
  readonly client?: Client;
596
616
  readonly fullnodeConfig?: FullNodeConfig;
@@ -729,9 +749,9 @@ type GasEstimation = {
729
749
  */
730
750
  prioritized_gas_estimate?: number;
731
751
  };
732
- type MoveResource = {
752
+ type MoveResource<T = {}> = {
733
753
  type: MoveStructId;
734
- data: {};
754
+ data: T;
735
755
  };
736
756
  type AccountData = {
737
757
  sequence_number: string;
@@ -1431,6 +1451,38 @@ declare class Deserializer {
1431
1451
  * ```
1432
1452
  */
1433
1453
  deserializeStr(): string;
1454
+ /**
1455
+ * Deserializes a an optional string.
1456
+ *
1457
+ * BCS layout for Optional<String>: 0 if none, else 1 | string_length | string_content
1458
+ * @example
1459
+ * ```ts
1460
+ * const deserializer = new Deserializer(new Uint8Array([0x00]));
1461
+ * assert(deserializer.deserializeOptionStr() === undefined);
1462
+ * const deserializer = new Deserializer(new Uint8Array([1, 8, 49, 50, 51, 52, 97, 98, 99, 100]));
1463
+ * assert(deserializer.deserializeOptionStr() === "1234abcd");
1464
+ * ```
1465
+ */
1466
+ deserializeOptionStr(): string | undefined;
1467
+ /**
1468
+ * Deserializes a an optional deserializable class.
1469
+ *
1470
+ * BCS layout for Optional<T>: 0 if none, else 1 | bcs representation of class
1471
+ *
1472
+ * @example
1473
+ * const deserializer = new Deserializer(new Uint8Array([1, 2, 3]));
1474
+ * const value = deserializer.deserializeOption(MyClass); // where MyClass has a `deserialize` function
1475
+ * // value is now an instance of MyClass
1476
+ *
1477
+ * const deserializer = new Deserializer(new Uint8Array([0]));
1478
+ * const value = deserializer.deserializeOption(MyClass); // where MyClass has a `deserialize` function
1479
+ * // value is undefined
1480
+ *
1481
+ * @param cls The BCS-deserializable class to deserialize the buffered bytes into.
1482
+ *
1483
+ * @returns the deserialized value of class type T
1484
+ */
1485
+ deserializeOption<T>(cls: Deserializable<T>): T | undefined;
1434
1486
  /**
1435
1487
  * Deserializes an array of bytes.
1436
1488
  *
@@ -1852,6 +1904,48 @@ declare class Serializer {
1852
1904
  * // `bcs::to_bytes(&vector<address> [@0x1, @0x2, @0xa, @0xb])`;
1853
1905
  */
1854
1906
  serializeVector<T extends Serializable>(values: Array<T>): void;
1907
+ /**
1908
+ * Serializes a BCS Serializable values into a serializer instance or undefined.
1909
+ * Note that this does not return anything. The bytes are added to the serializer instance's byte buffer.
1910
+ *
1911
+ * @param values The array of BCS Serializable values
1912
+ *
1913
+ * @example
1914
+ * ```ts
1915
+ * const serializer = new Serializer();
1916
+ * serializer.serializeOption(new AccountAddress(...));
1917
+ * const serializedBytes = serializer.toUint8Array();
1918
+ * // serializedBytes is now the BCS-serialized byte representation of AccountAddress
1919
+ *
1920
+ * const serializer = new Serializer();
1921
+ * serializer.serializeOption(undefined);
1922
+ * assert(serializer.toUint8Array() === new Uint8Array([0x00]));
1923
+ * ```
1924
+ */
1925
+ serializeOption<T extends Serializable>(value?: T): void;
1926
+ /**
1927
+ * Serializes an optional string. UTF8 string is supported.
1928
+ *
1929
+ * The existence of the string is encoded first, 0 if undefined and 1 if it exists.
1930
+ * Them the number of bytes in the string content is serialized, as a uleb128-encoded u32 integer.
1931
+ * Then the string content is serialized as UTF8 encoded bytes.
1932
+ *
1933
+ * BCS layout for optional "string": 1 | string_length | string_content
1934
+ * where string_length is a u32 integer encoded as a uleb128 integer, equal to the number of bytes in string_content.
1935
+ *
1936
+ * BCS layout for undefined: 0
1937
+ * @example
1938
+ * ```ts
1939
+ * const serializer = new Serializer();
1940
+ * serializer.serializeOptionStr("1234abcd");
1941
+ * assert(serializer.toUint8Array() === new Uint8Array([1, 8, 49, 50, 51, 52, 97, 98, 99, 100]));
1942
+ *
1943
+ * const serializer = new Serializer();
1944
+ * serializer.serializeOptionStr(undefined);
1945
+ * assert(serializer.toUint8Array() === new Uint8Array([0]));
1946
+ * ```
1947
+ */
1948
+ serializeOptionStr(value?: string): void;
1855
1949
  }
1856
1950
  declare function ensureBoolean(value: unknown): asserts value is boolean;
1857
1951
  declare const outOfRangeErrorMessage: (value: AnyNumber, min: AnyNumber, max: AnyNumber) => string;
@@ -2119,4 +2213,4 @@ declare class AccountAddress extends Serializable implements TransactionArgument
2119
2213
  equals(other: AccountAddress): boolean;
2120
2214
  }
2121
2215
 
2122
- export { type GetFungibleAssetMetadataResponse as $, type AnyNumber as A, type GetAccountOwnedObjectsResponse as B, type Client as C, Deserializer as D, type EntryFunctionArgument as E, type FullNodeConfig as F, type GetAccountOwnedTokensQueryResponse as G, type HexInput as H, type IndexerConfig as I, type GetCollectionDataResponse as J, type GetTokenDataResponse as K, type LedgerVersionArg as L, type MoveModuleId as M, Network as N, type OrderByArg as O, type PaginationArgs as P, type GetCurrentTokenOwnershipResponse as Q, type GetOwnedTokensResponse as R, Serializable as S, type TransactionArgument as T, type Uint8 as U, type GetTokenActivityResponse as V, type WhereArg as W, type GetEventsResponse as X, type WaitForTransactionOptions as Y, type UserTransactionResponse as Z, type MoveFunction as _, Serializer as a, type GenesisPayload as a$, type GetFungibleAssetActivitiesResponse as a0, type GetCurrentFungibleAssetBalancesResponse as a1, type LedgerInfo as a2, type Block as a3, type MoveValue as a4, type GetChainTopUserTransactionsResponse as a5, type GraphqlQuery as a6, type GetProcessorStatusResponse as a7, type GetANSNameResponse as a8, type GetNumberOfDelegatorsResponse as a9, type Uint128 as aA, type Uint256 as aB, type ClientHeadersType as aC, TransactionResponseType as aD, isPendingTransactionResponse as aE, isUserTransactionResponse as aF, isGenesisTransactionResponse as aG, isBlockMetadataTransactionResponse as aH, isStateCheckpointTransactionResponse as aI, isValidatorTransactionResponse as aJ, type GenesisTransactionResponse as aK, type BlockMetadataTransactionResponse as aL, type StateCheckpointTransactionResponse as aM, type ValidatorTransactionResponse as aN, type WriteSetChange as aO, type WriteSetChangeDeleteModule as aP, type WriteSetChangeDeleteResource as aQ, type WriteSetChangeDeleteTableItem as aR, type WriteSetChangeWriteModule as aS, type WriteSetChangeWriteResource as aT, type WriteSetChangeWriteTableItem as aU, type DecodedTableData as aV, type DeletedTableData as aW, type TransactionPayloadResponse as aX, type EntryFunctionPayloadResponse as aY, type ScriptPayloadResponse as aZ, type MultisigPayloadResponse as a_, type GetDelegatedStakingActivitiesResponse as aa, type PendingTransactionResponse as ab, type CommittedTransactionResponse as ac, type GasEstimation as ad, type TableItemRequest as ae, type GetTableItemsDataResponse as af, type GetTableItemsMetadataResponse as ag, type AptosRequest as ah, type ClientRequest as ai, type ClientResponse as aj, MimeType as ak, ensureBoolean as al, outOfRangeErrorMessage as am, validateNumberInRange as an, AddressInvalidReason as ao, ParsingError as ap, type ParsingResult as aq, HexInvalidReason as ar, TypeTagVariants as as, ScriptTransactionArgumentVariants as at, TransactionPayloadVariants as au, TransactionVariants as av, TransactionAuthenticatorVariant as aw, AccountAuthenticatorVariant as ax, AnySignatureVariant as ay, type Uint64 as az, type Uint16 as b, type MoveScriptBytecode as b0, type TransactionSignature as b1, isEd25519Signature as b2, isSecp256k1Signature as b3, isMultiAgentSignature as b4, isFeePayerSignature as b5, isMultiEd25519Signature as b6, type TransactionEd25519Signature as b7, type TransactionSecp256k1Signature as b8, type TransactionMultiEd25519Signature as b9, type GenerateAccountWithEd25519 as bA, type GenerateAccountWithSingleSignerSecp256k1Key as bB, type GenerateAccount as bC, type OrderBy as bD, type OrderByValue as bE, type TokenStandard as bF, NetworkToIndexerAPI as bG, NetworkToNodeAPI as bH, NetworkToFaucetAPI as bI, NetworkToChainId as bJ, NetworkToNetworkName as bK, type TransactionMultiAgentSignature as ba, type TransactionFeePayerSignature as bb, type AccountSignature as bc, type WriteSet as bd, type ScriptWriteSet as be, type DirectWriteSet as bf, type EventGuid as bg, type Event as bh, type MoveUint8Type as bi, type MoveUint16Type as bj, type MoveUint32Type as bk, type MoveUint64Type as bl, type MoveUint128Type as bm, type MoveUint256Type as bn, type MoveAddressType as bo, type MoveObjectType as bp, type MoveOptionType as bq, type MoveStructType as br, type MoveType as bs, MoveFunctionVisibility as bt, MoveAbility as bu, type MoveStructField as bv, type MoveModule as bw, type MoveStruct as bx, RoleType as by, DeriveScheme as bz, type Uint32 as c, type Deserializable as d, Hex as e, type AuthenticationKeyScheme as f, AccountAddress as g, AnyPublicKeyVariant as h, type ClientConfig as i, type FaucetConfig as j, type AptosSettings as k, type ScriptFunctionArgument as l, type MoveFunctionId as m, type AccountAddressInput as n, type MoveFunctionGenericTypeParam as o, SigningSchemeInput as p, SigningScheme as q, type AccountData as r, type MoveModuleBytecode as s, type TransactionResponse as t, type MoveResource as u, type MoveStructId as v, type TokenStandardArg as w, type GetAccountOwnedTokensFromCollectionResponse as x, type GetAccountCollectionsWithOwnedTokenResponse as y, type GetAccountCoinsDataResponse as z };
2216
+ export { type WaitForTransactionOptions as $, type AnyNumber as A, type GetAccountCollectionsWithOwnedTokenResponse as B, type Client as C, Deserializer as D, type EntryFunctionArgument as E, type FullNodeConfig as F, type GetAccountOwnedTokensQueryResponse as G, type HexInput as H, type IndexerConfig as I, type GetAccountCoinsDataResponse as J, type GetAccountOwnedObjectsResponse as K, type LedgerVersionArg as L, type MoveModuleId as M, Network as N, type OrderByArg as O, type PaginationArgs as P, type GetCollectionDataResponse as Q, type GetTokenDataResponse as R, Serializable as S, type TransactionArgument as T, type Uint8 as U, type GetCurrentTokenOwnershipResponse as V, type WhereArg as W, type GetOwnedTokensResponse as X, type GetTokenActivityResponse as Y, ZkpVariant as Z, type GetEventsResponse as _, Serializer as a, type TransactionPayloadResponse as a$, type UserTransactionResponse as a0, type MoveFunction as a1, type GetFungibleAssetMetadataResponse as a2, type GetFungibleAssetActivitiesResponse as a3, type GetCurrentFungibleAssetBalancesResponse as a4, type LedgerInfo as a5, type Block as a6, type MoveValue as a7, type GetChainTopUserTransactionsResponse as a8, type GraphqlQuery as a9, AccountAuthenticatorVariant as aA, AnySignatureVariant as aB, EphemeralSignatureVariant as aC, type Uint64 as aD, type Uint128 as aE, type Uint256 as aF, type ClientHeadersType as aG, TransactionResponseType as aH, isPendingTransactionResponse as aI, isUserTransactionResponse as aJ, isGenesisTransactionResponse as aK, isBlockMetadataTransactionResponse as aL, isStateCheckpointTransactionResponse as aM, isValidatorTransactionResponse as aN, type GenesisTransactionResponse as aO, type BlockMetadataTransactionResponse as aP, type StateCheckpointTransactionResponse as aQ, type ValidatorTransactionResponse as aR, type WriteSetChange as aS, type WriteSetChangeDeleteModule as aT, type WriteSetChangeDeleteResource as aU, type WriteSetChangeDeleteTableItem as aV, type WriteSetChangeWriteModule as aW, type WriteSetChangeWriteResource as aX, type WriteSetChangeWriteTableItem as aY, type DecodedTableData as aZ, type DeletedTableData as a_, type GetProcessorStatusResponse as aa, type GetANSNameResponse as ab, type GetNumberOfDelegatorsResponse as ac, type GetDelegatedStakingActivitiesResponse as ad, type PendingTransactionResponse as ae, type CommittedTransactionResponse as af, type GasEstimation as ag, type TableItemRequest as ah, type GetTableItemsDataResponse as ai, type GetTableItemsMetadataResponse as aj, type AptosRequest as ak, type ClientRequest as al, type ClientResponse as am, MimeType as an, ensureBoolean as ao, outOfRangeErrorMessage as ap, validateNumberInRange as aq, AddressInvalidReason as ar, ParsingError as as, type ParsingResult as at, HexInvalidReason as au, TypeTagVariants as av, ScriptTransactionArgumentVariants as aw, TransactionPayloadVariants as ax, TransactionVariants as ay, TransactionAuthenticatorVariant as az, type Uint16 as b, type EntryFunctionPayloadResponse as b0, type ScriptPayloadResponse as b1, type MultisigPayloadResponse as b2, type GenesisPayload as b3, type MoveScriptBytecode as b4, type TransactionSignature as b5, isEd25519Signature as b6, isSecp256k1Signature as b7, isMultiAgentSignature as b8, isFeePayerSignature as b9, type MoveModule as bA, type MoveStruct as bB, RoleType as bC, DeriveScheme as bD, type GenerateAccountWithEd25519 as bE, type GenerateAccountWithSingleSignerSecp256k1Key as bF, type GenerateAccount as bG, type OrderBy as bH, type OrderByValue as bI, type TokenStandard as bJ, NetworkToIndexerAPI as bK, NetworkToNodeAPI as bL, NetworkToFaucetAPI as bM, NetworkToPepperAPI as bN, NetworkToProverAPI as bO, NetworkToChainId as bP, NetworkToNetworkName as bQ, isMultiEd25519Signature as ba, type TransactionEd25519Signature as bb, type TransactionSecp256k1Signature as bc, type TransactionMultiEd25519Signature as bd, type TransactionMultiAgentSignature as be, type TransactionFeePayerSignature as bf, type AccountSignature as bg, type WriteSet as bh, type ScriptWriteSet as bi, type DirectWriteSet as bj, type EventGuid as bk, type Event as bl, type MoveUint8Type as bm, type MoveUint16Type as bn, type MoveUint32Type as bo, type MoveUint64Type as bp, type MoveUint128Type as bq, type MoveUint256Type as br, type MoveAddressType as bs, type MoveObjectType as bt, type MoveOptionType as bu, type MoveStructType as bv, type MoveType as bw, MoveFunctionVisibility as bx, MoveAbility as by, type MoveStructField as bz, type Uint32 as c, type Deserializable as d, Hex as e, type AuthenticationKeyScheme as f, AccountAddress as g, AnyPublicKeyVariant as h, EphemeralPublicKeyVariant as i, type ClientConfig as j, type FaucetConfig as k, type AptosSettings as l, EphemeralCertificateVariant as m, type ScriptFunctionArgument as n, type MoveFunctionId as o, type AccountAddressInput as p, type MoveFunctionGenericTypeParam as q, SigningSchemeInput as r, SigningScheme as s, type AccountData as t, type MoveModuleBytecode as u, type TransactionResponse as v, type MoveResource as w, type MoveStructId as x, type TokenStandardArg as y, type GetAccountOwnedTokensFromCollectionResponse as z };
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var d=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var l=(o,e,t,r)=>{for(var n=r>1?void 0:r?i(e,t):e,s=o.length-1,c;s>=0;s--)(c=o[s])&&(n=(r?c(e,t,n):c(n))||n);return r&&n&&d(e,t,n),n};var _jsbase64 = require('js-base64');async function m(o){return new Promise(e=>{setTimeout(e,o)})}var p=()=>Math.floor(Date.now()/1e3);function f(o){let e=new Date(o*1e3);return e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0),Math.floor(e.getTime()/1e3)}function b(o){let e=o.replace(/-/g,"+").replace(/_/g,"/"),t=e+"==".substring(0,(3-e.length%3)%3);return _jsbase64.decode.call(void 0, t)}exports.a = l; exports.b = m; exports.c = p; exports.d = f; exports.e = b;
2
+ //# sourceMappingURL=chunk-BHKSQXUZ.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"],"mappings":"wMAGA,OAAS,UAAAA,MAAc,YAMvB,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","sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { decode } from \"js-base64\";\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"]}
@@ -1,5 +1,5 @@
1
1
  import { ChildProcessWithoutNullStreams } from 'child_process';
2
- import { N as Network, g as AccountAddress } from '../accountAddress-ccLvlUQe.js';
2
+ import { N as Network, g as AccountAddress } from '../accountAddress-Lv-GSihU.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 _chunkKSEUZTKYjs = require('../chunk-KSEUZTKY.js');var _child_process = require('child_process');var _treekill = require('tree-kill'); var _treekill2 = _interopRequireDefault(_treekill);var _os = require('os');var d=class{constructor(){this.MAXIMUM_WAIT_TIME_SEC=75;this.READINESS_ENDPOINT="http://127.0.0.1:8070/";this.process=null}stop(){_optionalChain([this, 'access', _ => _.process, 'optionalAccess', _2 => _2.pid])&&_treekill2.default.call(void 0, this.process.pid)}async run(){await this.checkIfProcessIsUp()||(this.start(),await this.waitUntilProcessIsUp())}start(){let s="npx",t=["aptos","node","run-local-testnet","--force-restart","--assume-yes","--with-indexer-api"],e=_os.platform.call(void 0, ),r;e==="win32"?r=_child_process.spawn.call(void 0, s,t,{shell:!0}):r=_child_process.spawn.call(void 0, s,t),this.process=r,_optionalChain([r, 'access', _3 => _3.stderr, 'optionalAccess', _4 => _4.on, 'call', _5 => _5("data",o=>{let a=o.toString();console.log(a)})]),_optionalChain([r, 'access', _6 => _6.stdout, 'optionalAccess', _7 => _7.on, 'call', _8 => _8("data",o=>{let a=o.toString();console.log(a)})])}async waitUntilProcessIsUp(){let s=await this.checkIfProcessIsUp(),t=Date.now()/1e3,e=t;for(;!s&&t+this.MAXIMUM_WAIT_TIME_SEC>e;)await _chunkKSEUZTKYjs.b.call(void 0, 1e3),s=await this.checkIfProcessIsUp(),e=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 l=class{async init(s){let{network:t,profile:e}=s,r=["aptos","init",`--network=${_nullishCoalesce(t, () => ("local"))}`,`--profile=${_nullishCoalesce(e, () => ("default"))}`];return this.runCommand(r)}async compile(s){let{packageDirectoryPath:t,namedAddresses:e}=s,r=["aptos","move","compile","--package-dir",t,"--skip-fetch-latest-git-deps"],o=this.parseNamedAddresses(e);return r.push(...this.prepareNamedAddresses(o)),this.runCommand(r)}async test(s){let{packageDirectoryPath:t,namedAddresses:e}=s,r=["aptos","move","test","--package-dir",t,"--skip-fetch-latest-git-deps"],o=this.parseNamedAddresses(e);return r.push(...this.prepareNamedAddresses(o)),this.runCommand(r)}async publish(s){let{packageDirectoryPath:t,namedAddresses:e,profile:r}=s,o=["aptos","move","publish","--package-dir",t,"--skip-fetch-latest-git-deps",`--profile=${_nullishCoalesce(r, () => ("default"))}`],a=this.parseNamedAddresses(e);return o.push(...this.prepareNamedAddresses(a)),this.runCommand(o)}async runCommand(s){return new Promise((t,e)=>{let r=_os.platform.call(void 0, ),o;r==="win32"?o=_child_process.spawn.call(void 0, "npx",s,{shell:!0}):o=_child_process.spawn.call(void 0, "npx",s),o.stdout.pipe(process.stdout),o.stderr.pipe(process.stderr),process.stdin.pipe(o.stdin),o.on("close",a=>{a===0?t(!0):e(new Error(`Child process exited with code ${a}`))})})}prepareNamedAddresses(s){let t=s.size,e=[];if(t===0)return e;e.push("--named-addresses");let r=0;return s.forEach((o,a)=>{r+=1;let n=`${a}=${o.toString()}`;r<t-1&&(n+=","),e.push(n)}),e}parseNamedAddresses(s){let t=new Map;return Object.keys(s).forEach(e=>{let r=s[e];t.set(e,r)}),t}};exports.LocalNode = d; exports.Move = l;
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 _chunkBHKSQXUZjs = require('../chunk-BHKSQXUZ.js');var _child_process = require('child_process');var _treekill = require('tree-kill'); var _treekill2 = _interopRequireDefault(_treekill);var _os = require('os');var c=class{constructor(){this.MAXIMUM_WAIT_TIME_SEC=75;this.READINESS_ENDPOINT="http://127.0.0.1:8070/";this.process=null}stop(){_optionalChain([this, 'access', _ => _.process, 'optionalAccess', _2 => _2.pid])&&_treekill2.default.call(void 0, this.process.pid)}async run(){await this.checkIfProcessIsUp()||(this.start(),await this.waitUntilProcessIsUp())}start(){let s="npx",t=["aptos","node","run-local-testnet","--force-restart","--assume-yes","--with-indexer-api"],e=_os.platform.call(void 0, ),r;e==="win32"?r=_child_process.spawn.call(void 0, s,t,{shell:!0}):r=_child_process.spawn.call(void 0, s,t),this.process=r,_optionalChain([r, 'access', _3 => _3.stderr, 'optionalAccess', _4 => _4.on, 'call', _5 => _5("data",o=>{let a=o.toString();console.log(a)})]),_optionalChain([r, 'access', _6 => _6.stdout, 'optionalAccess', _7 => _7.on, 'call', _8 => _8("data",o=>{let a=o.toString();console.log(a)})])}async waitUntilProcessIsUp(){let s=await this.checkIfProcessIsUp(),t=Date.now()/1e3,e=t;for(;!s&&t+this.MAXIMUM_WAIT_TIME_SEC>e;)await _chunkBHKSQXUZjs.b.call(void 0, 1e3),s=await this.checkIfProcessIsUp(),e=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 p=class{async init(s){let{network:t,profile:e}=s,r=["aptos","init",`--network=${_nullishCoalesce(t, () => ("local"))}`,`--profile=${_nullishCoalesce(e, () => ("default"))}`];return this.runCommand(r)}async compile(s){let{packageDirectoryPath:t,namedAddresses:e}=s,r=["aptos","move","compile","--package-dir",t,"--skip-fetch-latest-git-deps"],o=this.parseNamedAddresses(e);return r.push(...this.prepareNamedAddresses(o)),this.runCommand(r)}async test(s){let{packageDirectoryPath:t,namedAddresses:e}=s,r=["aptos","move","test","--package-dir",t,"--skip-fetch-latest-git-deps"],o=this.parseNamedAddresses(e);return r.push(...this.prepareNamedAddresses(o)),this.runCommand(r)}async publish(s){let{packageDirectoryPath:t,namedAddresses:e,profile:r}=s,o=["aptos","move","publish","--package-dir",t,"--skip-fetch-latest-git-deps",`--profile=${_nullishCoalesce(r, () => ("default"))}`],a=this.parseNamedAddresses(e);return o.push(...this.prepareNamedAddresses(a)),this.runCommand(o)}async runCommand(s){return new Promise((t,e)=>{let r=_os.platform.call(void 0, ),o;r==="win32"?o=_child_process.spawn.call(void 0, "npx",s,{shell:!0}):o=_child_process.spawn.call(void 0, "npx",s),o.stdout.pipe(process.stdout),o.stderr.pipe(process.stderr),process.stdin.pipe(o.stdin),o.on("close",a=>{a===0?t(!0):e(new Error(`Child process exited with code ${a}`))})})}prepareNamedAddresses(s){let t=s.size,e=[];if(t===0)return e;e.push("--named-addresses");let r=[];return s.forEach((o,a)=>{let m=`${a}=${o.toString()}`;r.push(m)}),e.push(r.join(",")),e}parseNamedAddresses(s){let t=new Map;return Object.keys(s).forEach(e=>{let r=s[e];t.set(e,r)}),t}};exports.LocalNode = c; exports.Move = p;
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","cliCommand","cliArgs","currentPlatform","childProcess","data","str","operational","start","last","sleep","Move","args","network","profile","packageDirectoryPath","namedAddresses","addressesMap","resolve","reject","code","totalNames","newArgs","idx","value","key","toAppend","address"],"mappings":"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","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 stop() {\n if (!this.process?.pid) return;\n kill(this.process.pid);\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-local-testnet\", \"--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 Netowrk 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 *\n * @returns\n */\n async init(args: { network?: Network; profile?: string }): Promise<boolean> {\n const { network, profile } = args;\n const cliArgs = [\"aptos\", \"init\", `--network=${network ?? \"local\"}`, `--profile=${profile ?? \"default\"}`];\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 * @example\n * {\n * alice:0x1234, bob:0x5678\n * }\n *\n * @returns\n */\n async compile(args: {\n packageDirectoryPath: string;\n namedAddresses: Record<string, AccountAddress>;\n }): Promise<boolean> {\n const { packageDirectoryPath, namedAddresses } = args;\n const cliArgs = [\"aptos\", \"move\", \"compile\", \"--package-dir\", packageDirectoryPath, \"--skip-fetch-latest-git-deps\"];\n\n const addressesMap = this.parseNamedAddresses(namedAddresses);\n\n cliArgs.push(...this.prepareNamedAddresses(addressesMap));\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 *\n * @returns\n */\n async test(args: { packageDirectoryPath: string; namedAddresses: Record<string, AccountAddress> }): Promise<boolean> {\n const { packageDirectoryPath, namedAddresses } = args;\n const cliArgs = [\"aptos\", \"move\", \"test\", \"--package-dir\", packageDirectoryPath, \"--skip-fetch-latest-git-deps\"];\n\n const addressesMap = this.parseNamedAddresses(namedAddresses);\n\n cliArgs.push(...this.prepareNamedAddresses(addressesMap));\n\n return this.runCommand(cliArgs);\n }\n\n /**\n * Function to publishe the modules in a Move package to 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 *\n * @returns\n */\n async publish(args: {\n packageDirectoryPath: string;\n namedAddresses: Record<string, AccountAddress>;\n profile?: string;\n }): Promise<boolean> {\n const { packageDirectoryPath, namedAddresses, profile } = args;\n const cliArgs = [\n \"aptos\",\n \"move\",\n \"publish\",\n \"--package-dir\",\n packageDirectoryPath,\n \"--skip-fetch-latest-git-deps\",\n `--profile=${profile ?? \"default\"}`,\n ];\n\n const addressesMap = this.parseNamedAddresses(namedAddresses);\n\n cliArgs.push(...this.prepareNamedAddresses(addressesMap));\n\n return this.runCommand(cliArgs);\n }\n\n /**\n * Run a move command\n *\n * @param args\n * @returns\n */\n // eslint-disable-next-line class-methods-use-this\n private async runCommand(args: Array<string>): Promise<boolean> {\n return new Promise((resolve, reject) => {\n const currentPlatform = platform();\n let childProcess;\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.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(true); // Resolve with true 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 let idx = 0;\n namedAddresses.forEach((value, key) => {\n idx += 1;\n let toAppend = `${key}=${value.toString()}`;\n if (idx < totalNames - 1) {\n toAppend += \",\";\n }\n newArgs.push(toAppend);\n });\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"]}
1
+ {"version":3,"sources":["../../../src/cli/localNode.ts","../../../src/cli/move.ts"],"names":["spawn","kill","platform","LocalNode","cliCommand","cliArgs","currentPlatform","childProcess","data","str","operational","start","last","sleep","Move","args","network","profile","packageDirectoryPath","namedAddresses","addressesMap","resolve","reject","code","totalNames","newArgs","names","value","key","toAppend","address"],"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,MAAO,CACA,KAAK,SAAS,KACnBF,EAAK,KAAK,QAAQ,GAAG,CACvB,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,oBAAqB,kBAAmB,eAAgB,oBAAoB,EAExGC,EAAkBJ,EAAS,EAC7BK,EAEAD,IAAoB,QACtBC,EAAeP,EAAMI,EAAYC,EAAS,CAAE,MAAO,EAAK,CAAC,EAEzDE,EAAeP,EAAMI,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,CAC7C,IAAMC,EAAMD,EAAK,SAAS,EAG1B,QAAQ,IAAIC,CAAG,CACjB,CAAC,CACH,CAOA,MAAM,sBAAyC,CAC7C,IAAIC,EAAc,MAAM,KAAK,mBAAmB,EAC1CC,EAAQ,KAAK,IAAI,EAAI,IACvBC,EAAOD,EAEX,KAAO,CAACD,GAAeC,EAAQ,KAAK,sBAAwBC,GAE1D,MAAMC,EAAM,GAAI,EAEhBH,EAAc,MAAM,KAAK,mBAAmB,EAC5CE,EAAO,KAAK,IAAI,EAAI,IAKtB,GAAI,CAACF,EACH,MAAM,IAAI,MAAM,yBAAyB,EAG3C,MAAO,EACT,CAOA,MAAM,oBAAuC,CAC3C,GAAI,CAGF,OADa,MAAM,MAAM,KAAK,kBAAkB,GACvC,SAAW,GAItB,MAAmB,CACjB,MAAO,EACT,CACF,CACF,EClHA,OAAS,SAAAV,MAAa,gBACtB,OAAS,YAAAE,MAAgB,KAKlB,IAAMY,EAAN,KAAW,CAWhB,MAAM,KAAKC,EAAiE,CAC1E,GAAM,CAAE,QAAAC,EAAS,QAAAC,CAAQ,EAAIF,EACvBV,EAAU,CAAC,QAAS,OAAQ,aAAaW,GAAW,OAAO,GAAI,aAAaC,GAAW,SAAS,EAAE,EAExG,OAAO,KAAK,WAAWZ,CAAO,CAChC,CAcA,MAAM,QAAQU,EAGO,CACnB,GAAM,CAAE,qBAAAG,EAAsB,eAAAC,CAAe,EAAIJ,EAC3CV,EAAU,CAAC,QAAS,OAAQ,UAAW,gBAAiBa,EAAsB,8BAA8B,EAE5GE,EAAe,KAAK,oBAAoBD,CAAc,EAE5D,OAAAd,EAAQ,KAAK,GAAG,KAAK,sBAAsBe,CAAY,CAAC,EAEjD,KAAK,WAAWf,CAAO,CAChC,CAcA,MAAM,KAAKU,EAA0G,CACnH,GAAM,CAAE,qBAAAG,EAAsB,eAAAC,CAAe,EAAIJ,EAC3CV,EAAU,CAAC,QAAS,OAAQ,OAAQ,gBAAiBa,EAAsB,8BAA8B,EAEzGE,EAAe,KAAK,oBAAoBD,CAAc,EAE5D,OAAAd,EAAQ,KAAK,GAAG,KAAK,sBAAsBe,CAAY,CAAC,EAEjD,KAAK,WAAWf,CAAO,CAChC,CAeA,MAAM,QAAQU,EAIO,CACnB,GAAM,CAAE,qBAAAG,EAAsB,eAAAC,EAAgB,QAAAF,CAAQ,EAAIF,EACpDV,EAAU,CACd,QACA,OACA,UACA,gBACAa,EACA,+BACA,aAAaD,GAAW,SAAS,EACnC,EAEMG,EAAe,KAAK,oBAAoBD,CAAc,EAE5D,OAAAd,EAAQ,KAAK,GAAG,KAAK,sBAAsBe,CAAY,CAAC,EAEjD,KAAK,WAAWf,CAAO,CAChC,CASA,MAAc,WAAWU,EAAuC,CAC9D,OAAO,IAAI,QAAQ,CAACM,EAASC,IAAW,CACtC,IAAMhB,EAAkBJ,EAAS,EAC7BK,EAGAD,IAAoB,QACtBC,EAAeP,EAAM,MAAOe,EAAM,CAAE,MAAO,EAAK,CAAC,EAEjDR,EAAeP,EAAM,MAAOe,CAAI,EAGlCR,EAAa,OAAO,KAAK,QAAQ,MAAM,EACvCA,EAAa,OAAO,KAAK,QAAQ,MAAM,EACvC,QAAQ,MAAM,KAAKA,EAAa,KAAK,EAErCA,EAAa,GAAG,QAAUgB,GAAS,CAC7BA,IAAS,EACXF,EAAQ,EAAI,EAEZC,EAAO,IAAI,MAAM,kCAAkCC,CAAI,EAAE,CAAC,CAE9D,CAAC,CACH,CAAC,CACH,CAaQ,sBAAsBJ,EAA4D,CACxF,IAAMK,EAAaL,EAAe,KAC5BM,EAAyB,CAAC,EAEhC,GAAID,IAAe,EACjB,OAAOC,EAGTA,EAAQ,KAAK,mBAAmB,EAEhC,IAAMC,EAAuB,CAAC,EAC9B,OAAAP,EAAe,QAAQ,CAACQ,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,oBAAoBN,EAA6E,CACvG,IAAMC,EAAe,IAAI,IAEzB,cAAO,KAAKD,CAAc,EAAE,QAASS,GAAQ,CAC3C,IAAME,EAAUX,EAAeS,CAAG,EAClCR,EAAa,IAAIQ,EAAKE,CAAO,CAC/B,CAAC,EAEMV,CACT,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 stop() {\n if (!this.process?.pid) return;\n kill(this.process.pid);\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-local-testnet\", \"--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 Netowrk 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 *\n * @returns\n */\n async init(args: { network?: Network; profile?: string }): Promise<boolean> {\n const { network, profile } = args;\n const cliArgs = [\"aptos\", \"init\", `--network=${network ?? \"local\"}`, `--profile=${profile ?? \"default\"}`];\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 * @example\n * {\n * alice:0x1234, bob:0x5678\n * }\n *\n * @returns\n */\n async compile(args: {\n packageDirectoryPath: string;\n namedAddresses: Record<string, AccountAddress>;\n }): Promise<boolean> {\n const { packageDirectoryPath, namedAddresses } = args;\n const cliArgs = [\"aptos\", \"move\", \"compile\", \"--package-dir\", packageDirectoryPath, \"--skip-fetch-latest-git-deps\"];\n\n const addressesMap = this.parseNamedAddresses(namedAddresses);\n\n cliArgs.push(...this.prepareNamedAddresses(addressesMap));\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 *\n * @returns\n */\n async test(args: { packageDirectoryPath: string; namedAddresses: Record<string, AccountAddress> }): Promise<boolean> {\n const { packageDirectoryPath, namedAddresses } = args;\n const cliArgs = [\"aptos\", \"move\", \"test\", \"--package-dir\", packageDirectoryPath, \"--skip-fetch-latest-git-deps\"];\n\n const addressesMap = this.parseNamedAddresses(namedAddresses);\n\n cliArgs.push(...this.prepareNamedAddresses(addressesMap));\n\n return this.runCommand(cliArgs);\n }\n\n /**\n * Function to publishe the modules in a Move package to 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 *\n * @returns\n */\n async publish(args: {\n packageDirectoryPath: string;\n namedAddresses: Record<string, AccountAddress>;\n profile?: string;\n }): Promise<boolean> {\n const { packageDirectoryPath, namedAddresses, profile } = args;\n const cliArgs = [\n \"aptos\",\n \"move\",\n \"publish\",\n \"--package-dir\",\n packageDirectoryPath,\n \"--skip-fetch-latest-git-deps\",\n `--profile=${profile ?? \"default\"}`,\n ];\n\n const addressesMap = this.parseNamedAddresses(namedAddresses);\n\n cliArgs.push(...this.prepareNamedAddresses(addressesMap));\n\n return this.runCommand(cliArgs);\n }\n\n /**\n * Run a move command\n *\n * @param args\n * @returns\n */\n // eslint-disable-next-line class-methods-use-this\n private async runCommand(args: Array<string>): Promise<boolean> {\n return new Promise((resolve, reject) => {\n const currentPlatform = platform();\n let childProcess;\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.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(true); // Resolve with true 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"]}