@aptos-labs/ts-sdk 1.29.1 → 1.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (689) hide show
  1. package/README.md +2 -2
  2. package/dist/common/{accountAddress-DUCC2ffJ.d.ts → accountAddress-DnSqjhSl.d.ts} +700 -245
  3. package/dist/common/{chunk-HBPH2AD3.js → chunk-7IYTZDXV.js} +1 -1
  4. package/dist/common/chunk-7IYTZDXV.js.map +1 -0
  5. package/dist/common/cli/index.d.ts +123 -126
  6. package/dist/common/cli/index.js +1 -1
  7. package/dist/common/cli/index.js.map +1 -1
  8. package/dist/common/index.d.ts +5916 -1627
  9. package/dist/common/index.js +8 -8
  10. package/dist/common/index.js.map +1 -1
  11. package/dist/esm/Ed25519Account-DpH9qAcg.d.mts +470 -0
  12. package/dist/esm/account/AbstractKeylessAccount.d.mts +5 -5
  13. package/dist/esm/account/AbstractKeylessAccount.mjs +1 -1
  14. package/dist/esm/account/Account.d.mts +2 -2
  15. package/dist/esm/account/Account.mjs +1 -1
  16. package/dist/esm/account/Ed25519Account.d.mts +2 -2
  17. package/dist/esm/account/Ed25519Account.mjs +1 -1
  18. package/dist/esm/account/EphemeralKeyPair.d.mts +49 -14
  19. package/dist/esm/account/EphemeralKeyPair.mjs +1 -1
  20. package/dist/esm/account/FederatedKeylessAccount.d.mts +3 -3
  21. package/dist/esm/account/FederatedKeylessAccount.mjs +1 -1
  22. package/dist/esm/account/KeylessAccount.d.mts +37 -3
  23. package/dist/esm/account/KeylessAccount.mjs +1 -1
  24. package/dist/esm/account/MultiKeyAccount.d.mts +54 -34
  25. package/dist/esm/account/MultiKeyAccount.mjs +1 -1
  26. package/dist/esm/account/SingleKeyAccount.d.mts +2 -2
  27. package/dist/esm/account/SingleKeyAccount.mjs +1 -1
  28. package/dist/esm/account/index.d.mts +2 -2
  29. package/dist/esm/account/index.mjs +1 -1
  30. package/dist/esm/api/account.d.mts +445 -160
  31. package/dist/esm/api/account.mjs +1 -1
  32. package/dist/esm/api/ans.d.mts +369 -122
  33. package/dist/esm/api/ans.mjs +1 -1
  34. package/dist/esm/api/aptos.d.mts +40 -7
  35. package/dist/esm/api/aptos.mjs +1 -1
  36. package/dist/esm/api/aptosConfig.d.mts +102 -14
  37. package/dist/esm/api/aptosConfig.mjs +1 -1
  38. package/dist/esm/api/coin.d.mts +50 -13
  39. package/dist/esm/api/coin.mjs +1 -1
  40. package/dist/esm/api/digitalAsset.d.mts +708 -298
  41. package/dist/esm/api/digitalAsset.mjs +1 -1
  42. package/dist/esm/api/event.d.mts +128 -25
  43. package/dist/esm/api/event.mjs +1 -1
  44. package/dist/esm/api/faucet.d.mts +44 -7
  45. package/dist/esm/api/faucet.mjs +1 -1
  46. package/dist/esm/api/fungibleAsset.d.mts +151 -48
  47. package/dist/esm/api/fungibleAsset.mjs +1 -1
  48. package/dist/esm/api/general.d.mts +169 -53
  49. package/dist/esm/api/general.mjs +1 -1
  50. package/dist/esm/api/index.d.mts +2 -2
  51. package/dist/esm/api/index.mjs +1 -1
  52. package/dist/esm/api/keyless.d.mts +81 -10
  53. package/dist/esm/api/keyless.mjs +1 -1
  54. package/dist/esm/api/object.d.mts +49 -5
  55. package/dist/esm/api/object.mjs +1 -1
  56. package/dist/esm/api/staking.d.mts +84 -15
  57. package/dist/esm/api/staking.mjs +1 -1
  58. package/dist/esm/api/table.d.mts +117 -37
  59. package/dist/esm/api/table.mjs +1 -1
  60. package/dist/esm/api/transaction.d.mts +440 -109
  61. package/dist/esm/api/transaction.mjs +1 -1
  62. package/dist/esm/api/transactionSubmission/build.d.mts +99 -13
  63. package/dist/esm/api/transactionSubmission/build.mjs +1 -1
  64. package/dist/esm/api/transactionSubmission/helpers.d.mts +79 -0
  65. package/dist/esm/api/transactionSubmission/helpers.mjs +1 -1
  66. package/dist/esm/api/transactionSubmission/management.d.mts +111 -12
  67. package/dist/esm/api/transactionSubmission/management.mjs +1 -1
  68. package/dist/esm/api/transactionSubmission/sign.d.mts +97 -3
  69. package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
  70. package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -1
  71. package/dist/esm/api/transactionSubmission/simulate.d.mts +140 -15
  72. package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
  73. package/dist/esm/api/transactionSubmission/submit.d.mts +104 -13
  74. package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
  75. package/dist/esm/api/utils.d.mts +26 -3
  76. package/dist/esm/api/utils.mjs +1 -1
  77. package/dist/esm/bcs/consts.mjs +1 -1
  78. package/dist/esm/bcs/deserializer.d.mts +82 -32
  79. package/dist/esm/bcs/deserializer.mjs +1 -1
  80. package/dist/esm/bcs/index.mjs +1 -1
  81. package/dist/esm/bcs/serializable/entryFunctionBytes.d.mts +25 -6
  82. package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -1
  83. package/dist/esm/bcs/serializable/fixedBytes.d.mts +51 -21
  84. package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -1
  85. package/dist/esm/bcs/serializable/movePrimitives.d.mts +79 -0
  86. package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
  87. package/dist/esm/bcs/serializable/moveStructs.d.mts +119 -32
  88. package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
  89. package/dist/esm/bcs/serializer.d.mts +111 -76
  90. package/dist/esm/bcs/serializer.mjs +1 -1
  91. package/dist/esm/{chunk-U6Z4FNB7.mjs → chunk-2CJC43CV.mjs} +1 -1
  92. package/dist/esm/chunk-2CJC43CV.mjs.map +1 -0
  93. package/dist/esm/{chunk-WWZ3METZ.mjs → chunk-2I56E4T2.mjs} +2 -2
  94. package/dist/esm/chunk-2I56E4T2.mjs.map +1 -0
  95. package/dist/esm/{chunk-HSPBA2TZ.mjs → chunk-2QRWGJJA.mjs} +2 -2
  96. package/dist/esm/chunk-2QRWGJJA.mjs.map +1 -0
  97. package/dist/esm/chunk-37UZKMJI.mjs +2 -0
  98. package/dist/esm/chunk-37UZKMJI.mjs.map +1 -0
  99. package/dist/esm/chunk-4CDDWSKZ.mjs +2 -0
  100. package/dist/esm/chunk-4CDDWSKZ.mjs.map +1 -0
  101. package/dist/esm/chunk-4OV7QU2U.mjs +2 -0
  102. package/dist/esm/chunk-4OV7QU2U.mjs.map +1 -0
  103. package/dist/esm/{chunk-RNTXQYJQ.mjs → chunk-5AAFF2PV.mjs} +2 -2
  104. package/dist/esm/chunk-5AAFF2PV.mjs.map +1 -0
  105. package/dist/esm/chunk-5CCHECTE.mjs +2 -0
  106. package/dist/esm/chunk-5CCHECTE.mjs.map +1 -0
  107. package/dist/esm/{chunk-CPPBQDHB.mjs → chunk-5XXIIWG7.mjs} +2 -2
  108. package/dist/esm/chunk-5XXIIWG7.mjs.map +1 -0
  109. package/dist/esm/{chunk-K2O24YLZ.mjs → chunk-5ZBHIUWG.mjs} +2 -2
  110. package/dist/esm/chunk-5ZBHIUWG.mjs.map +1 -0
  111. package/dist/esm/chunk-6AGTDRNM.mjs +2 -0
  112. package/dist/esm/chunk-6AGTDRNM.mjs.map +1 -0
  113. package/dist/esm/chunk-6FLHGOKP.mjs +2 -0
  114. package/dist/esm/chunk-6FLHGOKP.mjs.map +1 -0
  115. package/dist/esm/{chunk-LG7RJQ57.mjs → chunk-6Q2O5G3J.mjs} +1 -1
  116. package/dist/esm/chunk-6Q2O5G3J.mjs.map +1 -0
  117. package/dist/esm/chunk-7D3RY73L.mjs +2 -0
  118. package/dist/esm/chunk-7D3RY73L.mjs.map +1 -0
  119. package/dist/esm/{chunk-5655UVIK.mjs → chunk-7PVIWKGT.mjs} +2 -2
  120. package/dist/esm/chunk-7PVIWKGT.mjs.map +1 -0
  121. package/dist/esm/chunk-7V6RL27I.mjs +2 -0
  122. package/dist/esm/chunk-7V6RL27I.mjs.map +1 -0
  123. package/dist/esm/{chunk-44GYWUSH.mjs → chunk-7XS45O6M.mjs} +1 -1
  124. package/dist/esm/chunk-7XS45O6M.mjs.map +1 -0
  125. package/dist/esm/{chunk-E37YRKWK.mjs → chunk-AGBA3Y7A.mjs} +2 -2
  126. package/dist/esm/chunk-AGBA3Y7A.mjs.map +1 -0
  127. package/dist/esm/{chunk-ECWOLU5T.mjs → chunk-BQXVHY7J.mjs} +2 -2
  128. package/dist/esm/chunk-BQXVHY7J.mjs.map +1 -0
  129. package/dist/esm/{chunk-PUZ25PTD.mjs → chunk-CRL4WGOH.mjs} +2 -2
  130. package/dist/esm/chunk-CRL4WGOH.mjs.map +1 -0
  131. package/dist/esm/{chunk-SWHLSREF.mjs → chunk-D3KBNFZR.mjs} +2 -2
  132. package/dist/esm/chunk-D3KBNFZR.mjs.map +1 -0
  133. package/dist/esm/{chunk-SCHZ67F3.mjs → chunk-D3OEQLUE.mjs} +1 -1
  134. package/dist/esm/{chunk-SCHZ67F3.mjs.map → chunk-D3OEQLUE.mjs.map} +1 -1
  135. package/dist/esm/{chunk-MO4IZXLK.mjs → chunk-DCUVV3VY.mjs} +2 -2
  136. package/dist/esm/chunk-DCUVV3VY.mjs.map +1 -0
  137. package/dist/esm/{chunk-AFOPNDOJ.mjs → chunk-DXQT55L3.mjs} +2 -2
  138. package/dist/esm/chunk-DXQT55L3.mjs.map +1 -0
  139. package/dist/esm/chunk-DZJXOL64.mjs +2 -0
  140. package/dist/esm/chunk-DZJXOL64.mjs.map +1 -0
  141. package/dist/esm/{chunk-QCUFTD7K.mjs → chunk-EF2PUPUH.mjs} +2 -2
  142. package/dist/esm/chunk-EF2PUPUH.mjs.map +1 -0
  143. package/dist/esm/{chunk-XXHW3ZT3.mjs → chunk-EKZQ3EYX.mjs} +2 -2
  144. package/dist/esm/chunk-EKZQ3EYX.mjs.map +1 -0
  145. package/dist/esm/{chunk-XH7YKEYR.mjs → chunk-EN2HDNFE.mjs} +2 -2
  146. package/dist/esm/chunk-EN2HDNFE.mjs.map +1 -0
  147. package/dist/esm/{chunk-TL7DR54X.mjs → chunk-FO4F3OJJ.mjs} +2 -2
  148. package/dist/esm/chunk-FO4F3OJJ.mjs.map +1 -0
  149. package/dist/esm/{chunk-7ZLBJUVZ.mjs → chunk-FPF4KZ5M.mjs} +2 -2
  150. package/dist/esm/chunk-FPF4KZ5M.mjs.map +1 -0
  151. package/dist/esm/{chunk-Y7F2V3R6.mjs → chunk-FY7TSOUU.mjs} +2 -2
  152. package/dist/esm/chunk-FY7TSOUU.mjs.map +1 -0
  153. package/dist/esm/{chunk-XK3JFCP3.mjs → chunk-GIQQF2PD.mjs} +2 -2
  154. package/dist/esm/chunk-GIQQF2PD.mjs.map +1 -0
  155. package/dist/esm/{chunk-SRPI2FFA.mjs → chunk-GMKKHGXK.mjs} +1 -1
  156. package/dist/esm/chunk-GMKKHGXK.mjs.map +1 -0
  157. package/dist/esm/chunk-GPZRGLU2.mjs +2 -0
  158. package/dist/esm/chunk-GPZRGLU2.mjs.map +1 -0
  159. package/dist/esm/{chunk-TDGQGILY.mjs → chunk-GQABU3RQ.mjs} +1 -1
  160. package/dist/esm/chunk-GQABU3RQ.mjs.map +1 -0
  161. package/dist/esm/{chunk-BRFHAO2Y.mjs → chunk-HAMXSLWF.mjs} +2 -2
  162. package/dist/esm/chunk-HAMXSLWF.mjs.map +1 -0
  163. package/dist/esm/{chunk-AH44UPM4.mjs → chunk-HBIDHQ2M.mjs} +1 -1
  164. package/dist/esm/chunk-HBIDHQ2M.mjs.map +1 -0
  165. package/dist/esm/{chunk-FRGXKOU5.mjs → chunk-HCV3NGLS.mjs} +2 -2
  166. package/dist/esm/chunk-HCV3NGLS.mjs.map +1 -0
  167. package/dist/esm/{chunk-GFGX3QDP.mjs → chunk-HDTKBFRX.mjs} +2 -2
  168. package/dist/esm/chunk-HDTKBFRX.mjs.map +1 -0
  169. package/dist/esm/chunk-HGVZ7ULA.mjs +2 -0
  170. package/dist/esm/chunk-HGVZ7ULA.mjs.map +1 -0
  171. package/dist/esm/{chunk-6EMN3BOV.mjs → chunk-I2NMCLNW.mjs} +1 -1
  172. package/dist/esm/chunk-I2NMCLNW.mjs.map +1 -0
  173. package/dist/esm/chunk-IBLZ6MZU.mjs +2 -0
  174. package/dist/esm/chunk-IBLZ6MZU.mjs.map +1 -0
  175. package/dist/esm/chunk-IECDO22V.mjs +2 -0
  176. package/dist/esm/chunk-IECDO22V.mjs.map +1 -0
  177. package/dist/esm/{chunk-TMW2HIXC.mjs → chunk-IFHQSZLK.mjs} +2 -2
  178. package/dist/esm/chunk-IFHQSZLK.mjs.map +1 -0
  179. package/dist/esm/{chunk-EXP5STXZ.mjs → chunk-J245N3XF.mjs} +1 -1
  180. package/dist/esm/chunk-J245N3XF.mjs.map +1 -0
  181. package/dist/esm/{chunk-2TQIU7CG.mjs → chunk-JDYASF3E.mjs} +2 -2
  182. package/dist/esm/chunk-JDYASF3E.mjs.map +1 -0
  183. package/dist/esm/{chunk-MS4MRLGA.mjs → chunk-JGNMNCQB.mjs} +2 -2
  184. package/dist/esm/chunk-JGNMNCQB.mjs.map +1 -0
  185. package/dist/esm/{chunk-TS3PYRAT.mjs → chunk-JNHFQTFC.mjs} +2 -2
  186. package/dist/esm/chunk-JNHFQTFC.mjs.map +1 -0
  187. package/dist/esm/{chunk-CVDR5SJR.mjs → chunk-JY3JJ55D.mjs} +2 -2
  188. package/dist/esm/chunk-JY3JJ55D.mjs.map +1 -0
  189. package/dist/esm/{chunk-KYSDF3CA.mjs → chunk-K6MZXKVV.mjs} +2 -2
  190. package/dist/esm/chunk-K6MZXKVV.mjs.map +1 -0
  191. package/dist/esm/{chunk-FVA2OPG4.mjs → chunk-KDMSOCZY.mjs} +1 -1
  192. package/dist/esm/{chunk-BCUSI3N6.mjs → chunk-KFNDDPOW.mjs} +2 -2
  193. package/dist/esm/chunk-KFNDDPOW.mjs.map +1 -0
  194. package/dist/esm/{chunk-DF4WKSTK.mjs → chunk-KFSVKIFO.mjs} +2 -2
  195. package/dist/esm/chunk-KFSVKIFO.mjs.map +1 -0
  196. package/dist/esm/chunk-KIW54KWR.mjs +2 -0
  197. package/dist/esm/{chunk-QPP6BX53.mjs → chunk-KM6UXNC7.mjs} +2 -2
  198. package/dist/esm/chunk-KM6UXNC7.mjs.map +1 -0
  199. package/dist/esm/{chunk-PKXEB7XP.mjs → chunk-KRVLR3L4.mjs} +2 -2
  200. package/dist/esm/chunk-KRVLR3L4.mjs.map +1 -0
  201. package/dist/esm/{chunk-B6M7QBUO.mjs → chunk-KSKQVOBA.mjs} +2 -2
  202. package/dist/esm/chunk-KSKQVOBA.mjs.map +1 -0
  203. package/dist/esm/{chunk-G7MWTE2J.mjs → chunk-KSUZS6EL.mjs} +2 -2
  204. package/dist/esm/{chunk-YHAPZP5A.mjs → chunk-L5I7F3NZ.mjs} +2 -2
  205. package/dist/esm/chunk-L5I7F3NZ.mjs.map +1 -0
  206. package/dist/esm/{chunk-XONG5JZ4.mjs → chunk-LD5MUWGW.mjs} +2 -2
  207. package/dist/esm/chunk-LD5MUWGW.mjs.map +1 -0
  208. package/dist/esm/{chunk-UAL27G6B.mjs → chunk-LEKBJ2EG.mjs} +1 -1
  209. package/dist/esm/chunk-LEKBJ2EG.mjs.map +1 -0
  210. package/dist/esm/{chunk-6RZZIOGH.mjs → chunk-LZS7BQ2B.mjs} +2 -2
  211. package/dist/esm/chunk-LZS7BQ2B.mjs.map +1 -0
  212. package/dist/esm/{chunk-3YKAGVHZ.mjs → chunk-N3OYD6VZ.mjs} +2 -2
  213. package/dist/esm/chunk-N3OYD6VZ.mjs.map +1 -0
  214. package/dist/esm/{chunk-KEYAPEAX.mjs → chunk-N47FTRYO.mjs} +1 -1
  215. package/dist/esm/chunk-N47FTRYO.mjs.map +1 -0
  216. package/dist/esm/{chunk-QIW56MUH.mjs → chunk-NODYW7DM.mjs} +2 -2
  217. package/dist/esm/chunk-NODYW7DM.mjs.map +1 -0
  218. package/dist/esm/{chunk-25TIHDS6.mjs → chunk-NV6DHDM3.mjs} +2 -2
  219. package/dist/esm/chunk-NV6DHDM3.mjs.map +1 -0
  220. package/dist/esm/{chunk-EV2USF7B.mjs → chunk-OLPI7QAH.mjs} +2 -2
  221. package/dist/esm/chunk-OLPI7QAH.mjs.map +1 -0
  222. package/dist/esm/chunk-ONBFUPEC.mjs +2 -0
  223. package/dist/esm/chunk-ONBFUPEC.mjs.map +1 -0
  224. package/dist/esm/{chunk-N5JNKD5F.mjs → chunk-OS2EG6AE.mjs} +2 -2
  225. package/dist/esm/chunk-OS2EG6AE.mjs.map +1 -0
  226. package/dist/esm/chunk-OTY3NO7Q.mjs +2 -0
  227. package/dist/esm/chunk-OTY3NO7Q.mjs.map +1 -0
  228. package/dist/esm/{chunk-25NSCK4Q.mjs → chunk-OV5UQ75K.mjs} +2 -2
  229. package/dist/esm/chunk-OV5UQ75K.mjs.map +1 -0
  230. package/dist/esm/{chunk-YJCZU6PR.mjs → chunk-OZN3OOJV.mjs} +2 -2
  231. package/dist/esm/chunk-OZN3OOJV.mjs.map +1 -0
  232. package/dist/esm/{chunk-WP7WF54Q.mjs → chunk-PCLU4KLY.mjs} +2 -2
  233. package/dist/esm/chunk-PCLU4KLY.mjs.map +1 -0
  234. package/dist/esm/{chunk-SR24OGHJ.mjs → chunk-PGZWRY7A.mjs} +2 -2
  235. package/dist/esm/chunk-PGZWRY7A.mjs.map +1 -0
  236. package/dist/esm/{chunk-SAPUZZEU.mjs → chunk-PHG2IWZW.mjs} +2 -2
  237. package/dist/esm/chunk-PHG2IWZW.mjs.map +1 -0
  238. package/dist/esm/{chunk-LR65XHSF.mjs → chunk-PHP47DI4.mjs} +2 -2
  239. package/dist/esm/chunk-PHP47DI4.mjs.map +1 -0
  240. package/dist/esm/chunk-PRZ7AIGA.mjs +2 -0
  241. package/dist/esm/chunk-PRZ7AIGA.mjs.map +1 -0
  242. package/dist/esm/{chunk-OY2IX7HW.mjs → chunk-QBP4XJT5.mjs} +2 -2
  243. package/dist/esm/chunk-QBP4XJT5.mjs.map +1 -0
  244. package/dist/esm/{chunk-ZGO2SK6F.mjs → chunk-QBWGWHJK.mjs} +2 -2
  245. package/dist/esm/chunk-QBWGWHJK.mjs.map +1 -0
  246. package/dist/esm/chunk-QQIVWB6G.mjs +2 -0
  247. package/dist/esm/chunk-QQIVWB6G.mjs.map +1 -0
  248. package/dist/esm/{chunk-IYQISVDX.mjs → chunk-QRTZYRH2.mjs} +2 -2
  249. package/dist/esm/chunk-QRTZYRH2.mjs.map +1 -0
  250. package/dist/esm/{chunk-NH2S6SB2.mjs → chunk-R3Y6WH2U.mjs} +2 -2
  251. package/dist/esm/chunk-R3Y6WH2U.mjs.map +1 -0
  252. package/dist/esm/{chunk-X4KEZTUQ.mjs → chunk-RAXP3STS.mjs} +2 -2
  253. package/dist/esm/chunk-RAXP3STS.mjs.map +1 -0
  254. package/dist/esm/{chunk-TVFIUUVY.mjs → chunk-RNAKZVRN.mjs} +2 -2
  255. package/dist/esm/chunk-RNAKZVRN.mjs.map +1 -0
  256. package/dist/esm/{chunk-NNRAQP36.mjs → chunk-RUDS7RSB.mjs} +2 -2
  257. package/dist/esm/chunk-RUDS7RSB.mjs.map +1 -0
  258. package/dist/esm/{chunk-U67PFBTL.mjs → chunk-S3FVA55H.mjs} +2 -2
  259. package/dist/esm/chunk-S3FVA55H.mjs.map +1 -0
  260. package/dist/esm/{chunk-LDFTE4MM.mjs → chunk-TIZL5YVP.mjs} +2 -2
  261. package/dist/esm/chunk-TIZL5YVP.mjs.map +1 -0
  262. package/dist/esm/{chunk-EWZ2M5BW.mjs → chunk-TRU3EK64.mjs} +2 -2
  263. package/dist/esm/chunk-TRU3EK64.mjs.map +1 -0
  264. package/dist/esm/chunk-UI3AKMZX.mjs +2 -0
  265. package/dist/esm/{chunk-555I4YHP.mjs.map → chunk-UI3AKMZX.mjs.map} +1 -1
  266. package/dist/esm/{chunk-B2CXRZL5.mjs → chunk-UKAXCARD.mjs} +2 -2
  267. package/dist/esm/chunk-UKAXCARD.mjs.map +1 -0
  268. package/dist/esm/{chunk-NMD45OTM.mjs → chunk-V5NDNR36.mjs} +2 -2
  269. package/dist/esm/chunk-V5NDNR36.mjs.map +1 -0
  270. package/dist/esm/{chunk-KXBIA4KR.mjs → chunk-VQTEGTUQ.mjs} +2 -2
  271. package/dist/esm/chunk-VQTEGTUQ.mjs.map +1 -0
  272. package/dist/esm/{chunk-BD6BJETG.mjs → chunk-WIXNX7HY.mjs} +2 -2
  273. package/dist/esm/chunk-WIXNX7HY.mjs.map +1 -0
  274. package/dist/esm/{chunk-7V6DEA7G.mjs → chunk-WOOH5MMX.mjs} +2 -2
  275. package/dist/esm/chunk-WOOH5MMX.mjs.map +1 -0
  276. package/dist/esm/{chunk-DAJOX4PL.mjs → chunk-WSVOJSAC.mjs} +2 -2
  277. package/dist/esm/chunk-WSVOJSAC.mjs.map +1 -0
  278. package/dist/esm/{chunk-L5NY7TMI.mjs → chunk-WUCPTRXU.mjs} +2 -2
  279. package/dist/esm/chunk-WUCPTRXU.mjs.map +1 -0
  280. package/dist/esm/chunk-XHCALZ7X.mjs +2 -0
  281. package/dist/esm/chunk-XHCALZ7X.mjs.map +1 -0
  282. package/dist/esm/{chunk-DAXKRXRK.mjs → chunk-XIY2VORC.mjs} +2 -2
  283. package/dist/esm/chunk-XIY2VORC.mjs.map +1 -0
  284. package/dist/esm/chunk-XOCRDV2V.mjs +2 -0
  285. package/dist/esm/chunk-XOCRDV2V.mjs.map +1 -0
  286. package/dist/esm/{chunk-STGYDB5E.mjs → chunk-Z36WHOZV.mjs} +2 -2
  287. package/dist/esm/chunk-Z36WHOZV.mjs.map +1 -0
  288. package/dist/esm/{chunk-LXLISEQ4.mjs → chunk-ZINOJTLU.mjs} +2 -2
  289. package/dist/esm/chunk-ZINOJTLU.mjs.map +1 -0
  290. package/dist/esm/{chunk-46D5QX3G.mjs → chunk-ZS3EWM5A.mjs} +2 -2
  291. package/dist/esm/chunk-ZS3EWM5A.mjs.map +1 -0
  292. package/dist/esm/{chunk-QLN2URFX.mjs → chunk-ZUTOMGB7.mjs} +2 -2
  293. package/dist/esm/chunk-ZUTOMGB7.mjs.map +1 -0
  294. package/dist/esm/cli/index.mjs +1 -1
  295. package/dist/esm/cli/localNode.d.mts +26 -10
  296. package/dist/esm/cli/localNode.mjs +1 -1
  297. package/dist/esm/cli/move.d.mts +104 -123
  298. package/dist/esm/cli/move.mjs +1 -1
  299. package/dist/esm/client/core.d.mts +21 -6
  300. package/dist/esm/client/core.mjs +1 -1
  301. package/dist/esm/client/get.d.mts +34 -6
  302. package/dist/esm/client/get.mjs +1 -1
  303. package/dist/esm/client/index.mjs +1 -1
  304. package/dist/esm/client/post.d.mts +63 -6
  305. package/dist/esm/client/post.mjs +1 -1
  306. package/dist/esm/client/types.d.mts +21 -8
  307. package/dist/esm/client/types.mjs +1 -1
  308. package/dist/esm/core/account/index.mjs +1 -1
  309. package/dist/esm/core/account/utils/address.d.mts +1 -1
  310. package/dist/esm/core/account/utils/address.mjs +1 -1
  311. package/dist/esm/core/account/utils/index.mjs +1 -1
  312. package/dist/esm/core/accountAddress.d.mts +63 -48
  313. package/dist/esm/core/accountAddress.mjs +1 -1
  314. package/dist/esm/core/authenticationKey.d.mts +1 -1
  315. package/dist/esm/core/authenticationKey.mjs +1 -1
  316. package/dist/esm/core/common.d.mts +6 -0
  317. package/dist/esm/core/common.mjs +1 -1
  318. package/dist/esm/core/crypto/ed25519.d.mts +77 -26
  319. package/dist/esm/core/crypto/ed25519.mjs +1 -1
  320. package/dist/esm/core/crypto/ephemeral.d.mts +36 -14
  321. package/dist/esm/core/crypto/ephemeral.mjs +1 -1
  322. package/dist/esm/core/crypto/federatedKeyless.d.mts +2 -14
  323. package/dist/esm/core/crypto/federatedKeyless.mjs +1 -1
  324. package/dist/esm/core/crypto/hdKey.d.mts +9 -6
  325. package/dist/esm/core/crypto/hdKey.mjs +1 -1
  326. package/dist/esm/core/crypto/index.d.mts +1 -1
  327. package/dist/esm/core/crypto/index.mjs +1 -1
  328. package/dist/esm/core/crypto/keyless.d.mts +126 -45
  329. package/dist/esm/core/crypto/keyless.mjs +1 -1
  330. package/dist/esm/core/crypto/multiEd25519.d.mts +45 -6
  331. package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
  332. package/dist/esm/core/crypto/multiKey.d.mts +58 -7
  333. package/dist/esm/core/crypto/multiKey.mjs +1 -1
  334. package/dist/esm/core/crypto/poseidon.d.mts +35 -5
  335. package/dist/esm/core/crypto/poseidon.mjs +1 -1
  336. package/dist/esm/core/crypto/privateKey.d.mts +10 -6
  337. package/dist/esm/core/crypto/proof.d.mts +2 -6
  338. package/dist/esm/core/crypto/proof.mjs +1 -1
  339. package/dist/esm/core/crypto/publicKey.d.mts +1 -1
  340. package/dist/esm/core/crypto/publicKey.mjs +1 -1
  341. package/dist/esm/core/crypto/secp256k1.d.mts +72 -27
  342. package/dist/esm/core/crypto/secp256k1.mjs +1 -1
  343. package/dist/esm/core/crypto/signature.d.mts +5 -4
  344. package/dist/esm/core/crypto/signature.mjs +1 -1
  345. package/dist/esm/core/crypto/singleKey.d.mts +63 -5
  346. package/dist/esm/core/crypto/singleKey.mjs +1 -1
  347. package/dist/esm/core/crypto/utils.mjs +1 -1
  348. package/dist/esm/core/hex.d.mts +27 -28
  349. package/dist/esm/core/hex.mjs +1 -1
  350. package/dist/esm/core/index.d.mts +1 -1
  351. package/dist/esm/core/index.mjs +1 -1
  352. package/dist/esm/index.d.mts +2 -2
  353. package/dist/esm/index.mjs +1 -1
  354. package/dist/esm/internal/account.d.mts +191 -12
  355. package/dist/esm/internal/account.mjs +1 -1
  356. package/dist/esm/internal/ans.d.mts +206 -14
  357. package/dist/esm/internal/ans.mjs +1 -1
  358. package/dist/esm/internal/coin.d.mts +13 -1
  359. package/dist/esm/internal/coin.mjs +1 -1
  360. package/dist/esm/internal/digitalAsset.d.mts +330 -2
  361. package/dist/esm/internal/digitalAsset.mjs +1 -1
  362. package/dist/esm/internal/event.d.mts +39 -0
  363. package/dist/esm/internal/event.mjs +1 -1
  364. package/dist/esm/internal/faucet.d.mts +14 -0
  365. package/dist/esm/internal/faucet.mjs +1 -1
  366. package/dist/esm/internal/fungibleAsset.d.mts +48 -2
  367. package/dist/esm/internal/fungibleAsset.mjs +1 -1
  368. package/dist/esm/internal/general.d.mts +46 -0
  369. package/dist/esm/internal/general.mjs +1 -1
  370. package/dist/esm/internal/keyless.d.mts +38 -2
  371. package/dist/esm/internal/keyless.mjs +1 -1
  372. package/dist/esm/internal/object.d.mts +21 -0
  373. package/dist/esm/internal/object.mjs +1 -1
  374. package/dist/esm/internal/staking.d.mts +26 -0
  375. package/dist/esm/internal/staking.mjs +1 -1
  376. package/dist/esm/internal/table.d.mts +33 -1
  377. package/dist/esm/internal/table.mjs +1 -1
  378. package/dist/esm/internal/transaction.d.mts +107 -5
  379. package/dist/esm/internal/transaction.mjs +1 -1
  380. package/dist/esm/internal/transactionSubmission.d.mts +72 -29
  381. package/dist/esm/internal/transactionSubmission.mjs +1 -1
  382. package/dist/esm/internal/view.d.mts +1 -1
  383. package/dist/esm/internal/view.mjs +1 -1
  384. package/dist/esm/publicKey-_tPa99ea.d.mts +151 -0
  385. package/dist/esm/transactions/authenticator/account.d.mts +66 -17
  386. package/dist/esm/transactions/authenticator/account.mjs +1 -1
  387. package/dist/esm/transactions/authenticator/index.d.mts +1 -1
  388. package/dist/esm/transactions/authenticator/index.mjs +1 -1
  389. package/dist/esm/transactions/authenticator/transaction.d.mts +53 -20
  390. package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
  391. package/dist/esm/transactions/index.d.mts +1 -1
  392. package/dist/esm/transactions/index.mjs +1 -1
  393. package/dist/esm/transactions/instances/chainId.d.mts +20 -1
  394. package/dist/esm/transactions/instances/chainId.mjs +1 -1
  395. package/dist/esm/transactions/instances/identifier.d.mts +21 -3
  396. package/dist/esm/transactions/instances/identifier.mjs +1 -1
  397. package/dist/esm/transactions/instances/index.d.mts +1 -1
  398. package/dist/esm/transactions/instances/index.mjs +1 -1
  399. package/dist/esm/transactions/instances/moduleId.d.mts +22 -8
  400. package/dist/esm/transactions/instances/moduleId.mjs +1 -1
  401. package/dist/esm/transactions/instances/multiAgentTransaction.d.mts +24 -8
  402. package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
  403. package/dist/esm/transactions/instances/rawTransaction.d.mts +31 -4
  404. package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
  405. package/dist/esm/transactions/instances/rotationProofChallenge.d.mts +25 -3
  406. package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
  407. package/dist/esm/transactions/instances/signedTransaction.d.mts +29 -7
  408. package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
  409. package/dist/esm/transactions/instances/simpleTransaction.d.mts +23 -8
  410. package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
  411. package/dist/esm/transactions/instances/transactionArgument.d.mts +23 -0
  412. package/dist/esm/transactions/instances/transactionPayload.d.mts +72 -26
  413. package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
  414. package/dist/esm/transactions/management/accountSequenceNumber.d.mts +37 -11
  415. package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
  416. package/dist/esm/transactions/management/asyncQueue.d.mts +22 -19
  417. package/dist/esm/transactions/management/asyncQueue.mjs +1 -1
  418. package/dist/esm/transactions/management/index.d.mts +2 -2
  419. package/dist/esm/transactions/management/index.mjs +1 -1
  420. package/dist/esm/transactions/management/transactionWorker.d.mts +67 -36
  421. package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
  422. package/dist/esm/transactions/transactionBuilder/helpers.d.mts +74 -4
  423. package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
  424. package/dist/esm/transactions/transactionBuilder/index.d.mts +1 -1
  425. package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
  426. package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +45 -23
  427. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
  428. package/dist/esm/transactions/transactionBuilder/signingMessage.d.mts +20 -15
  429. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
  430. package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +101 -30
  431. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
  432. package/dist/esm/transactions/typeTag/index.d.mts +244 -3
  433. package/dist/esm/transactions/typeTag/index.mjs +1 -1
  434. package/dist/esm/transactions/typeTag/parser.d.mts +31 -2
  435. package/dist/esm/transactions/typeTag/parser.mjs +1 -1
  436. package/dist/esm/transactions/types.d.mts +82 -34
  437. package/dist/esm/types/generated/queries.mjs +1 -1
  438. package/dist/esm/types/generated/types.mjs +1 -1
  439. package/dist/esm/types/index.d.mts +320 -59
  440. package/dist/esm/types/index.mjs +1 -1
  441. package/dist/esm/types/indexer.d.mts +65 -2
  442. package/dist/esm/types/keyless.d.mts +18 -0
  443. package/dist/esm/utils/apiEndpoints.d.mts +3 -0
  444. package/dist/esm/utils/apiEndpoints.mjs +1 -1
  445. package/dist/esm/utils/const.d.mts +2 -4
  446. package/dist/esm/utils/const.mjs +1 -1
  447. package/dist/esm/utils/helpers.d.mts +25 -10
  448. package/dist/esm/utils/helpers.mjs +1 -1
  449. package/dist/esm/utils/index.mjs +1 -1
  450. package/dist/esm/utils/memoize.d.mts +12 -10
  451. package/dist/esm/utils/memoize.mjs +1 -1
  452. package/dist/esm/utils/normalizeBundle.d.mts +11 -5
  453. package/dist/esm/utils/normalizeBundle.mjs +1 -1
  454. package/dist/esm/version.d.mts +1 -1
  455. package/dist/esm/version.mjs +1 -1
  456. package/package.json +3 -2
  457. package/src/account/AbstractKeylessAccount.ts +4 -3
  458. package/src/account/Account.ts +88 -54
  459. package/src/account/Ed25519Account.ts +56 -21
  460. package/src/account/EphemeralKeyPair.ts +50 -15
  461. package/src/account/FederatedKeylessAccount.ts +1 -1
  462. package/src/account/KeylessAccount.ts +37 -1
  463. package/src/account/MultiKeyAccount.ts +56 -35
  464. package/src/account/SingleKeyAccount.ts +60 -28
  465. package/src/api/account.ts +443 -159
  466. package/src/api/ans.ts +367 -120
  467. package/src/api/aptos.ts +38 -5
  468. package/src/api/aptosConfig.ts +102 -14
  469. package/src/api/coin.ts +49 -12
  470. package/src/api/digitalAsset.ts +707 -296
  471. package/src/api/event.ts +128 -25
  472. package/src/api/faucet.ts +44 -7
  473. package/src/api/fungibleAsset.ts +149 -46
  474. package/src/api/general.ts +168 -52
  475. package/src/api/keyless.ts +117 -21
  476. package/src/api/object.ts +49 -5
  477. package/src/api/staking.ts +84 -15
  478. package/src/api/table.ts +117 -37
  479. package/src/api/transaction.ts +438 -107
  480. package/src/api/transactionSubmission/build.ts +98 -12
  481. package/src/api/transactionSubmission/helpers.ts +79 -0
  482. package/src/api/transactionSubmission/management.ts +110 -10
  483. package/src/api/transactionSubmission/sign.ts +96 -2
  484. package/src/api/transactionSubmission/simulate.ts +139 -14
  485. package/src/api/transactionSubmission/submit.ts +103 -12
  486. package/src/api/utils.ts +26 -3
  487. package/src/bcs/deserializer.ts +82 -32
  488. package/src/bcs/serializable/entryFunctionBytes.ts +27 -6
  489. package/src/bcs/serializable/fixedBytes.ts +55 -25
  490. package/src/bcs/serializable/movePrimitives.ts +91 -0
  491. package/src/bcs/serializable/moveStructs.ts +123 -35
  492. package/src/bcs/serializer.ts +131 -84
  493. package/src/cli/localNode.ts +46 -17
  494. package/src/cli/move.ts +119 -136
  495. package/src/client/core.ts +22 -7
  496. package/src/client/get.ts +34 -6
  497. package/src/client/post.ts +63 -6
  498. package/src/client/types.ts +40 -13
  499. package/src/core/account/utils/address.ts +1 -1
  500. package/src/core/accountAddress.ts +63 -50
  501. package/src/core/authenticationKey.ts +47 -20
  502. package/src/core/common.ts +6 -0
  503. package/src/core/crypto/ed25519.ts +76 -25
  504. package/src/core/crypto/ephemeral.ts +37 -21
  505. package/src/core/crypto/federatedKeyless.ts +1 -20
  506. package/src/core/crypto/hdKey.ts +10 -7
  507. package/src/core/crypto/keyless.ts +140 -63
  508. package/src/core/crypto/multiEd25519.ts +44 -5
  509. package/src/core/crypto/multiKey.ts +66 -19
  510. package/src/core/crypto/poseidon.ts +72 -5
  511. package/src/core/crypto/privateKey.ts +9 -5
  512. package/src/core/crypto/proof.ts +3 -12
  513. package/src/core/crypto/publicKey.ts +15 -5
  514. package/src/core/crypto/secp256k1.ts +76 -26
  515. package/src/core/crypto/signature.ts +7 -4
  516. package/src/core/crypto/singleKey.ts +62 -5
  517. package/src/core/hex.ts +27 -28
  518. package/src/internal/account.ts +248 -12
  519. package/src/internal/ans.ts +219 -15
  520. package/src/internal/coin.ts +12 -0
  521. package/src/internal/digitalAsset.ts +344 -3
  522. package/src/internal/event.ts +51 -0
  523. package/src/internal/faucet.ts +14 -0
  524. package/src/internal/fungibleAsset.ts +46 -0
  525. package/src/internal/general.ts +46 -0
  526. package/src/internal/keyless.ts +37 -1
  527. package/src/internal/object.ts +21 -0
  528. package/src/internal/queries/getTableItemsData.graphql +1 -1
  529. package/src/internal/queries/getTableItemsMetadata.graphql +1 -1
  530. package/src/internal/staking.ts +27 -1
  531. package/src/internal/table.ts +32 -0
  532. package/src/internal/transaction.ts +120 -7
  533. package/src/internal/transactionSubmission.ts +86 -30
  534. package/src/transactions/authenticator/account.ts +65 -16
  535. package/src/transactions/authenticator/transaction.ts +52 -19
  536. package/src/transactions/instances/chainId.ts +20 -1
  537. package/src/transactions/instances/identifier.ts +21 -3
  538. package/src/transactions/instances/moduleId.ts +22 -8
  539. package/src/transactions/instances/multiAgentTransaction.ts +26 -10
  540. package/src/transactions/instances/rawTransaction.ts +31 -4
  541. package/src/transactions/instances/rotationProofChallenge.ts +24 -2
  542. package/src/transactions/instances/signedTransaction.ts +28 -6
  543. package/src/transactions/instances/simpleTransaction.ts +26 -11
  544. package/src/transactions/instances/transactionArgument.ts +26 -0
  545. package/src/transactions/instances/transactionPayload.ts +73 -26
  546. package/src/transactions/management/accountSequenceNumber.ts +38 -11
  547. package/src/transactions/management/asyncQueue.ts +22 -19
  548. package/src/transactions/management/transactionWorker.ts +66 -40
  549. package/src/transactions/transactionBuilder/helpers.ts +130 -3
  550. package/src/transactions/transactionBuilder/remoteAbi.ts +71 -30
  551. package/src/transactions/transactionBuilder/signingMessage.ts +19 -14
  552. package/src/transactions/transactionBuilder/transactionBuilder.ts +153 -40
  553. package/src/transactions/typeTag/index.ts +264 -3
  554. package/src/transactions/typeTag/parser.ts +54 -20
  555. package/src/transactions/types.ts +81 -33
  556. package/src/types/index.ts +338 -61
  557. package/src/types/indexer.ts +82 -2
  558. package/src/types/keyless.ts +21 -0
  559. package/src/utils/apiEndpoints.ts +3 -0
  560. package/src/utils/const.ts +2 -4
  561. package/src/utils/helpers.ts +25 -10
  562. package/src/utils/memoize.ts +12 -10
  563. package/src/utils/normalizeBundle.ts +11 -5
  564. package/src/version.ts +1 -1
  565. package/dist/common/chunk-HBPH2AD3.js.map +0 -1
  566. package/dist/esm/Ed25519Account-B1VMJOY2.d.mts +0 -361
  567. package/dist/esm/chunk-25NSCK4Q.mjs.map +0 -1
  568. package/dist/esm/chunk-25TIHDS6.mjs.map +0 -1
  569. package/dist/esm/chunk-2TQIU7CG.mjs.map +0 -1
  570. package/dist/esm/chunk-3MCYLML2.mjs +0 -2
  571. package/dist/esm/chunk-3MCYLML2.mjs.map +0 -1
  572. package/dist/esm/chunk-3YKAGVHZ.mjs.map +0 -1
  573. package/dist/esm/chunk-44GYWUSH.mjs.map +0 -1
  574. package/dist/esm/chunk-46D5QX3G.mjs.map +0 -1
  575. package/dist/esm/chunk-555I4YHP.mjs +0 -2
  576. package/dist/esm/chunk-5655UVIK.mjs.map +0 -1
  577. package/dist/esm/chunk-6EMN3BOV.mjs.map +0 -1
  578. package/dist/esm/chunk-6QGVRNV6.mjs +0 -2
  579. package/dist/esm/chunk-6QGVRNV6.mjs.map +0 -1
  580. package/dist/esm/chunk-6RZZIOGH.mjs.map +0 -1
  581. package/dist/esm/chunk-7V6DEA7G.mjs.map +0 -1
  582. package/dist/esm/chunk-7ZLBJUVZ.mjs.map +0 -1
  583. package/dist/esm/chunk-AFOPNDOJ.mjs.map +0 -1
  584. package/dist/esm/chunk-AH44UPM4.mjs.map +0 -1
  585. package/dist/esm/chunk-B2CXRZL5.mjs.map +0 -1
  586. package/dist/esm/chunk-B5NYEWNM.mjs +0 -2
  587. package/dist/esm/chunk-B5NYEWNM.mjs.map +0 -1
  588. package/dist/esm/chunk-B6M7QBUO.mjs.map +0 -1
  589. package/dist/esm/chunk-BCUSI3N6.mjs.map +0 -1
  590. package/dist/esm/chunk-BD6BJETG.mjs.map +0 -1
  591. package/dist/esm/chunk-BF4ZE37Q.mjs +0 -2
  592. package/dist/esm/chunk-BF4ZE37Q.mjs.map +0 -1
  593. package/dist/esm/chunk-BKEJMQQ6.mjs +0 -2
  594. package/dist/esm/chunk-BKEJMQQ6.mjs.map +0 -1
  595. package/dist/esm/chunk-BRFHAO2Y.mjs.map +0 -1
  596. package/dist/esm/chunk-BSUYPXRD.mjs +0 -2
  597. package/dist/esm/chunk-BSUYPXRD.mjs.map +0 -1
  598. package/dist/esm/chunk-CCMHWJ3Q.mjs +0 -2
  599. package/dist/esm/chunk-CCMHWJ3Q.mjs.map +0 -1
  600. package/dist/esm/chunk-CPPBQDHB.mjs.map +0 -1
  601. package/dist/esm/chunk-CVDR5SJR.mjs.map +0 -1
  602. package/dist/esm/chunk-DAJOX4PL.mjs.map +0 -1
  603. package/dist/esm/chunk-DAXKRXRK.mjs.map +0 -1
  604. package/dist/esm/chunk-DF4WKSTK.mjs.map +0 -1
  605. package/dist/esm/chunk-E37YRKWK.mjs.map +0 -1
  606. package/dist/esm/chunk-ECWOLU5T.mjs.map +0 -1
  607. package/dist/esm/chunk-EV2USF7B.mjs.map +0 -1
  608. package/dist/esm/chunk-EWZ2M5BW.mjs.map +0 -1
  609. package/dist/esm/chunk-EXP5STXZ.mjs.map +0 -1
  610. package/dist/esm/chunk-FRGXKOU5.mjs.map +0 -1
  611. package/dist/esm/chunk-GFGX3QDP.mjs.map +0 -1
  612. package/dist/esm/chunk-GGR3P2TG.mjs +0 -2
  613. package/dist/esm/chunk-GGR3P2TG.mjs.map +0 -1
  614. package/dist/esm/chunk-HAT5S2XX.mjs +0 -2
  615. package/dist/esm/chunk-HAT5S2XX.mjs.map +0 -1
  616. package/dist/esm/chunk-HPZ2S4FE.mjs +0 -2
  617. package/dist/esm/chunk-HPZ2S4FE.mjs.map +0 -1
  618. package/dist/esm/chunk-HSPBA2TZ.mjs.map +0 -1
  619. package/dist/esm/chunk-IMGLHDIA.mjs +0 -2
  620. package/dist/esm/chunk-IMGLHDIA.mjs.map +0 -1
  621. package/dist/esm/chunk-IYQISVDX.mjs.map +0 -1
  622. package/dist/esm/chunk-K2O24YLZ.mjs.map +0 -1
  623. package/dist/esm/chunk-KA6FZNWP.mjs +0 -2
  624. package/dist/esm/chunk-KA6FZNWP.mjs.map +0 -1
  625. package/dist/esm/chunk-KEYAPEAX.mjs.map +0 -1
  626. package/dist/esm/chunk-KXBIA4KR.mjs.map +0 -1
  627. package/dist/esm/chunk-KYSDF3CA.mjs.map +0 -1
  628. package/dist/esm/chunk-L5NY7TMI.mjs.map +0 -1
  629. package/dist/esm/chunk-LDFTE4MM.mjs.map +0 -1
  630. package/dist/esm/chunk-LG3DAAPD.mjs +0 -2
  631. package/dist/esm/chunk-LG3DAAPD.mjs.map +0 -1
  632. package/dist/esm/chunk-LG7RJQ57.mjs.map +0 -1
  633. package/dist/esm/chunk-LGD5KU56.mjs +0 -2
  634. package/dist/esm/chunk-LGD5KU56.mjs.map +0 -1
  635. package/dist/esm/chunk-LR65XHSF.mjs.map +0 -1
  636. package/dist/esm/chunk-LXLISEQ4.mjs.map +0 -1
  637. package/dist/esm/chunk-M2QV232A.mjs +0 -2
  638. package/dist/esm/chunk-M2QV232A.mjs.map +0 -1
  639. package/dist/esm/chunk-MEWFJJJN.mjs +0 -2
  640. package/dist/esm/chunk-MEWFJJJN.mjs.map +0 -1
  641. package/dist/esm/chunk-MO4IZXLK.mjs.map +0 -1
  642. package/dist/esm/chunk-MS4MRLGA.mjs.map +0 -1
  643. package/dist/esm/chunk-N5JNKD5F.mjs.map +0 -1
  644. package/dist/esm/chunk-NH2S6SB2.mjs.map +0 -1
  645. package/dist/esm/chunk-NMD45OTM.mjs.map +0 -1
  646. package/dist/esm/chunk-NNRAQP36.mjs.map +0 -1
  647. package/dist/esm/chunk-OY2IX7HW.mjs.map +0 -1
  648. package/dist/esm/chunk-PKXEB7XP.mjs.map +0 -1
  649. package/dist/esm/chunk-PNXUYOYI.mjs +0 -2
  650. package/dist/esm/chunk-PNXUYOYI.mjs.map +0 -1
  651. package/dist/esm/chunk-PUZ25PTD.mjs.map +0 -1
  652. package/dist/esm/chunk-Q4XR6QOZ.mjs +0 -2
  653. package/dist/esm/chunk-QCUFTD7K.mjs.map +0 -1
  654. package/dist/esm/chunk-QDIKOQRK.mjs +0 -2
  655. package/dist/esm/chunk-QDIKOQRK.mjs.map +0 -1
  656. package/dist/esm/chunk-QIW56MUH.mjs.map +0 -1
  657. package/dist/esm/chunk-QLN2URFX.mjs.map +0 -1
  658. package/dist/esm/chunk-QPP6BX53.mjs.map +0 -1
  659. package/dist/esm/chunk-RNTXQYJQ.mjs.map +0 -1
  660. package/dist/esm/chunk-SAPUZZEU.mjs.map +0 -1
  661. package/dist/esm/chunk-SR24OGHJ.mjs.map +0 -1
  662. package/dist/esm/chunk-SRPI2FFA.mjs.map +0 -1
  663. package/dist/esm/chunk-STGYDB5E.mjs.map +0 -1
  664. package/dist/esm/chunk-SWHLSREF.mjs.map +0 -1
  665. package/dist/esm/chunk-TDGQGILY.mjs.map +0 -1
  666. package/dist/esm/chunk-TL7DR54X.mjs.map +0 -1
  667. package/dist/esm/chunk-TMW2HIXC.mjs.map +0 -1
  668. package/dist/esm/chunk-TS3PYRAT.mjs.map +0 -1
  669. package/dist/esm/chunk-TVFIUUVY.mjs.map +0 -1
  670. package/dist/esm/chunk-U67PFBTL.mjs.map +0 -1
  671. package/dist/esm/chunk-U6Z4FNB7.mjs.map +0 -1
  672. package/dist/esm/chunk-UAL27G6B.mjs.map +0 -1
  673. package/dist/esm/chunk-WP7WF54Q.mjs.map +0 -1
  674. package/dist/esm/chunk-WS4RPKL6.mjs +0 -2
  675. package/dist/esm/chunk-WS4RPKL6.mjs.map +0 -1
  676. package/dist/esm/chunk-WWZ3METZ.mjs.map +0 -1
  677. package/dist/esm/chunk-X4KEZTUQ.mjs.map +0 -1
  678. package/dist/esm/chunk-XH7YKEYR.mjs.map +0 -1
  679. package/dist/esm/chunk-XK3JFCP3.mjs.map +0 -1
  680. package/dist/esm/chunk-XONG5JZ4.mjs.map +0 -1
  681. package/dist/esm/chunk-XXHW3ZT3.mjs.map +0 -1
  682. package/dist/esm/chunk-Y7F2V3R6.mjs.map +0 -1
  683. package/dist/esm/chunk-YHAPZP5A.mjs.map +0 -1
  684. package/dist/esm/chunk-YJCZU6PR.mjs.map +0 -1
  685. package/dist/esm/chunk-ZGO2SK6F.mjs.map +0 -1
  686. package/dist/esm/publicKey-B3XRNhHO.d.mts +0 -113
  687. /package/dist/esm/{chunk-FVA2OPG4.mjs.map → chunk-KDMSOCZY.mjs.map} +0 -0
  688. /package/dist/esm/{chunk-Q4XR6QOZ.mjs.map → chunk-KIW54KWR.mjs.map} +0 -0
  689. /package/dist/esm/{chunk-G7MWTE2J.mjs.map → chunk-KSUZS6EL.mjs.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/transactions/instances/moduleId.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Serializable, Serializer } from \"../../bcs/serializer\";\nimport { Deserializer } from \"../../bcs/deserializer\";\nimport { AccountAddress } from \"../../core\";\nimport { Identifier } from \"./identifier\";\nimport { MoveModuleId } from \"../../types\";\n\n/**\n * Represents a ModuleId that can be serialized and deserialized.\n * A ModuleId consists of a module address (e.g., \"0x1\") and a module name (e.g., \"coin\").\n */\nexport class ModuleId extends Serializable {\n public readonly address: AccountAddress;\n\n public readonly name: Identifier;\n\n /**\n * Initializes a new instance of the module with the specified account address and name.\n *\n * @param address - The account address, e.g., \"0x1\".\n * @param name - The module name under the specified address, e.g., \"coin\".\n */\n constructor(address: AccountAddress, name: Identifier) {\n super();\n this.address = address;\n this.name = name;\n }\n\n /**\n * Converts a string literal in the format \"account_address::module_name\" to a ModuleId.\n * @param moduleId - A string literal representing the module identifier.\n * @throws Error if the provided moduleId is not in the correct format.\n * @returns ModuleId - The corresponding ModuleId object.\n */\n static fromStr(moduleId: MoveModuleId): ModuleId {\n const parts = moduleId.split(\"::\");\n if (parts.length !== 2) {\n throw new Error(\"Invalid module id.\");\n }\n return new ModuleId(AccountAddress.fromString(parts[0]), new Identifier(parts[1]));\n }\n\n /**\n * Serializes the address and name properties using the provided serializer.\n * This function is essential for converting the object's data into a format suitable for transmission or storage.\n *\n * @param serializer - The serializer instance used to perform the serialization.\n */\n serialize(serializer: Serializer): void {\n this.address.serialize(serializer);\n this.name.serialize(serializer);\n }\n\n /**\n * Deserializes a ModuleId from the provided deserializer.\n * This function retrieves the account address and identifier to construct a ModuleId instance.\n *\n * @param deserializer - The deserializer instance used to read the data.\n */\n static deserialize(deserializer: Deserializer): ModuleId {\n const address = AccountAddress.deserialize(deserializer);\n const name = Identifier.deserialize(deserializer);\n return new ModuleId(address, name);\n }\n}\n"],"mappings":"2HAaO,IAAMA,EAAN,MAAMC,UAAiBC,CAAa,CAWzC,YAAYC,EAAyBC,EAAkB,CACrD,MAAM,EACN,KAAK,QAAUD,EACf,KAAK,KAAOC,CACd,CAQA,OAAO,QAAQC,EAAkC,CAC/C,IAAMC,EAAQD,EAAS,MAAM,IAAI,EACjC,GAAIC,EAAM,SAAW,EACnB,MAAM,IAAI,MAAM,oBAAoB,EAEtC,OAAO,IAAIL,EAASM,EAAe,WAAWD,EAAM,CAAC,CAAC,EAAG,IAAIE,EAAWF,EAAM,CAAC,CAAC,CAAC,CACnF,CAQA,UAAUG,EAA8B,CACtC,KAAK,QAAQ,UAAUA,CAAU,EACjC,KAAK,KAAK,UAAUA,CAAU,CAChC,CAQA,OAAO,YAAYC,EAAsC,CACvD,IAAMP,EAAUI,EAAe,YAAYG,CAAY,EACjDN,EAAOI,EAAW,YAAYE,CAAY,EAChD,OAAO,IAAIT,EAASE,EAASC,CAAI,CACnC,CACF","names":["ModuleId","_ModuleId","Serializable","address","name","moduleId","parts","AccountAddress","Identifier","serializer","deserializer"]}
@@ -1,2 +1,2 @@
1
- import{a as i}from"./chunk-6EMN3BOV.mjs";import{h as a}from"./chunk-WWZ3METZ.mjs";import{a as o}from"./chunk-FVA2OPG4.mjs";var n=class{constructor(t){this.config=t}async simple(t){return a({aptosConfig:this.config,...t})}async multiAgent(t){return a({aptosConfig:this.config,...t})}};o([i],n.prototype,"simple",1),o([i],n.prototype,"multiAgent",1);export{n as a};
2
- //# sourceMappingURL=chunk-25TIHDS6.mjs.map
1
+ import{a as i}from"./chunk-I2NMCLNW.mjs";import{h as a}from"./chunk-2I56E4T2.mjs";import{a as o}from"./chunk-KDMSOCZY.mjs";var n=class{constructor(t){this.config=t}async simple(t){return a({aptosConfig:this.config,...t})}async multiAgent(t){return a({aptosConfig:this.config,...t})}};o([i],n.prototype,"simple",1),o([i],n.prototype,"multiAgent",1);export{n as a};
2
+ //# sourceMappingURL=chunk-NV6DHDM3.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/api/transactionSubmission/submit.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { submitTransaction } from \"../../internal/transactionSubmission\";\nimport { AccountAuthenticator, AnyRawTransaction } from \"../../transactions\";\nimport { PendingTransactionResponse } from \"../../types\";\nimport { AptosConfig } from \"../aptosConfig\";\nimport { ValidateFeePayerDataOnSubmission } from \"./helpers\";\n\n/**\n * A class to handle all `Submit` transaction operations.\n */\nexport class Submit {\n readonly config: AptosConfig;\n\n /**\n * Initializes a new instance of the Aptos client with the specified configuration.\n * This allows you to interact with the Aptos blockchain using the provided settings.\n *\n * @param config - The configuration settings for the Aptos client.\n * @param config.network - The network to connect to (e.g., TESTNET, MAINNET).\n * @param config.nodeUrl - The URL of the Aptos node to connect to.\n * @param config.faucetUrl - The URL of the faucet for obtaining test tokens.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * async function runExample() {\n * // Create a configuration for the Aptos client\n * const config = new AptosConfig({\n * network: Network.TESTNET, // Use the TESTNET for testing\n * nodeUrl: \"https://testnet.aptos.dev\", // Specify the node URL\n * faucetUrl: \"https://faucet.testnet.aptos.dev\" // Specify the faucet URL\n * });\n *\n * // Initialize the Aptos client with the configuration\n * const aptos = new Aptos(config);\n *\n * console.log(\"Aptos client initialized:\", aptos);\n * }\n * runExample().catch(console.error);\n * ```\n */\n constructor(config: AptosConfig) {\n this.config = config;\n }\n\n /**\n * Submits a transaction to the Aptos blockchain using the provided transaction details and authenticators.\n * This function allows you to execute transactions securely by specifying the sender and optional fee payer authenticators.\n *\n * @param args - The arguments for submitting the transaction.\n * @param args.transaction - The raw transaction data to be submitted.\n * @param args.senderAuthenticator - The authenticator for the sender's account.\n * @param [args.feePayerAuthenticator] - The optional authenticator for the fee payer's account.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network, Account } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * const sender = Account.generate(); // Generate a new sender account\n * const transaction = await aptos.transaction.build.simple({\n * sender: sender.accountAddress,\n * data: {\n * function: \"0x1::aptos_account::transfer\",\n * functionArguments: [Account.generate().accountAddress, 100], // Replace with a real destination account\n * },\n * });\n *\n * // Submit the transaction\n * const response = await aptos.simple({\n * transaction,\n * senderAuthenticator: sender.getAuthenticator(), // Use the sender's authenticator\n * });\n *\n * console.log(\"Transaction submitted:\", response);\n * }\n * runExample().catch(console.error);\n * ```\n */\n @ValidateFeePayerDataOnSubmission\n async simple(args: {\n transaction: AnyRawTransaction;\n senderAuthenticator: AccountAuthenticator;\n feePayerAuthenticator?: AccountAuthenticator;\n }): Promise<PendingTransactionResponse> {\n return submitTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Submits a multi-agent transaction to the Aptos network, allowing multiple signers to authorize the transaction.\n * This function is useful for scenarios where a transaction requires approval from multiple accounts.\n *\n * @param args - The parameters for the multi-agent transaction.\n * @param args.transaction - The raw transaction to be submitted.\n * @param args.senderAuthenticator - The authenticator for the sender account.\n * @param args.additionalSignersAuthenticators - An array of authenticators for additional signers.\n * @param [args.feePayerAuthenticator] - An optional authenticator for the fee payer account.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network, Account } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * const sender = Account.generate(); // Generate a new sender account\n * const additionalSigner1 = Account.generate(); // Generate an additional signer account\n * const additionalSigner2 = Account.generate(); // Generate another additional signer account\n *\n * const transaction = await aptos.transaction.build.simple({\n * sender: sender.accountAddress,\n * data: {\n * function: \"0x1::aptos_account::transfer\",\n * functionArguments: [additionalSigner1.accountAddress, 100],\n * },\n * });\n *\n * const response = await aptos.multiAgent({\n * transaction,\n * senderAuthenticator: sender.getAuthenticator(), // Use the sender's authenticator\n * additionalSignersAuthenticators: [\n * additionalSigner1.getAuthenticator(), // Use the first additional signer's authenticator\n * additionalSigner2.getAuthenticator(), // Use the second additional signer's authenticator\n * ],\n * });\n *\n * console.log(response); // Log the response from the transaction submission\n * }\n * runExample().catch(console.error);\n * ```\n */\n @ValidateFeePayerDataOnSubmission\n async multiAgent(args: {\n transaction: AnyRawTransaction;\n senderAuthenticator: AccountAuthenticator;\n additionalSignersAuthenticators: Array<AccountAuthenticator>;\n feePayerAuthenticator?: AccountAuthenticator;\n }): Promise<PendingTransactionResponse> {\n return submitTransaction({ aptosConfig: this.config, ...args });\n }\n}\n"],"mappings":"2HAYO,IAAMA,EAAN,KAAa,CAgClB,YAAYC,EAAqB,CAC/B,KAAK,OAASA,CAChB,CAwCA,MAAM,OAAOC,EAI2B,CACtC,OAAOC,EAAkB,CAAE,YAAa,KAAK,OAAQ,GAAGD,CAAK,CAAC,CAChE,CA+CA,MAAM,WAAWA,EAKuB,CACtC,OAAOC,EAAkB,CAAE,YAAa,KAAK,OAAQ,GAAGD,CAAK,CAAC,CAChE,CACF,EA7DQE,EAAA,CADLC,GAzEUL,EA0EL,sBAqDAI,EAAA,CADLC,GA9HUL,EA+HL","names":["Submit","config","args","submitTransaction","__decorateClass","ValidateFeePayerDataOnSubmission"]}
@@ -1,2 +1,2 @@
1
- import{b as p}from"./chunk-PUZ25PTD.mjs";async function r(e){let{aptosConfig:t,overrides:s,params:n,contentType:o,acceptType:i,path:a,originMethod:R,type:d}=e,u=t.getRequestUrl(d);return p({url:u,method:"GET",originMethod:R,path:a,contentType:o,acceptType:i,params:n,overrides:{...t.clientConfig,...s}},t,e.type)}async function m(e){let{aptosConfig:t}=e;return r({...e,type:"Fullnode",overrides:{...t.clientConfig,...t.fullnodeConfig,...e.overrides,HEADERS:{...t.clientConfig?.HEADERS,...t.fullnodeConfig?.HEADERS}}})}async function y(e){return r({...e,type:"Pepper"})}async function A(e){let t=[],s,n=e.params;do{let o=await r({type:"Fullnode",aptosConfig:e.aptosConfig,originMethod:e.originMethod,path:e.path,params:n,overrides:e.overrides});s=o.headers["x-aptos-cursor"],delete o.headers,t.push(...o.data),n.start=s}while(s!=null);return t}export{r as a,m as b,y as c,A as d};
2
- //# sourceMappingURL=chunk-EV2USF7B.mjs.map
1
+ import{b as p}from"./chunk-CRL4WGOH.mjs";async function r(e){let{aptosConfig:t,overrides:s,params:n,contentType:o,acceptType:i,path:a,originMethod:R,type:d}=e,u=t.getRequestUrl(d);return p({url:u,method:"GET",originMethod:R,path:a,contentType:o,acceptType:i,params:n,overrides:{...t.clientConfig,...s}},t,e.type)}async function m(e){let{aptosConfig:t}=e;return r({...e,type:"Fullnode",overrides:{...t.clientConfig,...t.fullnodeConfig,...e.overrides,HEADERS:{...t.clientConfig?.HEADERS,...t.fullnodeConfig?.HEADERS}}})}async function y(e){return r({...e,type:"Pepper"})}async function A(e){let t=[],s,n=e.params;do{let o=await r({type:"Fullnode",aptosConfig:e.aptosConfig,originMethod:e.originMethod,path:e.path,params:n,overrides:e.overrides});s=o.headers["x-aptos-cursor"],delete o.headers,t.push(...o.data),n.start=s}while(s!=null);return t}export{r as a,m as b,y as c,A as d};
2
+ //# sourceMappingURL=chunk-OLPI7QAH.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/client/get.ts"],"sourcesContent":["import { AptosConfig } from \"../api/aptosConfig\";\nimport { aptosRequest } from \"./core\";\nimport { AptosResponse } from \"./types\";\nimport { AnyNumber, ClientConfig, MimeType } from \"../types\";\nimport { AptosApiType } from \"../utils/const\";\n\n/**\n * Options for making a GET request, including configuration for the API client.\n */\nexport type GetRequestOptions = {\n /**\n * The config for the API client\n */\n aptosConfig: AptosConfig;\n /**\n * The type of API endpoint to call e.g. fullnode, indexer, etc\n */\n type: AptosApiType;\n /**\n * The name of the API method\n */\n originMethod: string;\n /**\n * The URL path to the API method\n */\n path: string;\n /**\n * The content type of the request body\n */\n contentType?: MimeType;\n /**\n * The accepted content type of the response of the API\n */\n acceptType?: MimeType;\n /**\n * The query parameters for the request\n */\n params?: Record<string, string | AnyNumber | boolean | undefined>;\n /**\n * Specific client overrides for this request to override aptosConfig\n */\n overrides?: ClientConfig;\n};\n\n/**\n * Options for making a request to the Aptos API, excluding the \"type\" field.\n */\nexport type GetAptosRequestOptions = Omit<GetRequestOptions, \"type\">;\n\n/**\n * Executes a GET request to retrieve data based on the provided options.\n *\n * @param options - The options for the GET request.\n * @param options.aptosConfig - The configuration object for Aptos requests.\n * @param options.overrides - Optional overrides for the request configuration.\n * @param options.params - Query parameters to include in the request.\n * @param options.contentType - The content type of the request.\n * @param options.acceptType - The accepted response type.\n * @param options.path - The specific path for the request.\n * @param options.originMethod - The original method of the request.\n * @param options.type - The type of request being made.\n * @returns The response from the GET request.\n */\nexport async function get<Req extends {}, Res extends {}>(\n options: GetRequestOptions,\n): Promise<AptosResponse<Req, Res>> {\n const { aptosConfig, overrides, params, contentType, acceptType, path, originMethod, type } = options;\n const url = aptosConfig.getRequestUrl(type);\n\n return aptosRequest<Req, Res>(\n {\n url,\n method: \"GET\",\n originMethod,\n path,\n contentType,\n acceptType,\n params,\n overrides: {\n ...aptosConfig.clientConfig,\n ...overrides,\n },\n },\n aptosConfig,\n options.type,\n );\n}\n\n/**\n * Retrieves data from the Aptos full node using the provided options.\n *\n * @param options - The options for the request to the Aptos full node.\n * @param options.aptosConfig - Configuration settings specific to the Aptos client and full node.\n * @param options.aptosConfig.clientConfig - The client configuration settings.\n * @param options.aptosConfig.fullnodeConfig - The full node configuration settings.\n * @param options.overrides - Additional overrides for the request.\n * @param options.type - The type of API request being made.\n *\n * @returns A promise that resolves with the response from the Aptos full node.\n */\nexport async function getAptosFullNode<Req extends {}, Res extends {}>(\n options: GetAptosRequestOptions,\n): Promise<AptosResponse<Req, Res>> {\n const { aptosConfig } = options;\n\n return get<Req, Res>({\n ...options,\n type: AptosApiType.FULLNODE,\n overrides: {\n ...aptosConfig.clientConfig,\n ...aptosConfig.fullnodeConfig,\n ...options.overrides,\n HEADERS: { ...aptosConfig.clientConfig?.HEADERS, ...aptosConfig.fullnodeConfig?.HEADERS },\n },\n });\n}\n\n/**\n * Makes a GET request to the Aptos Pepper service to retrieve data.\n *\n * @param options - The options for the request.\n * @param options.param1 - Description of param1.\n * @param options.param2 - Description of param2.\n * @returns AptosResponse - The response from the Aptos Pepper service.\n */\nexport async function getAptosPepperService<Req extends {}, Res extends {}>(\n options: GetAptosRequestOptions,\n): Promise<AptosResponse<Req, Res>> {\n return get<Req, Res>({ ...options, type: AptosApiType.PEPPER });\n}\n\n/// This function is a helper for paginating using a function wrapping an API\nexport async function paginateWithCursor<Req extends Record<string, any>, Res extends Array<{}>>(\n options: GetAptosRequestOptions,\n): Promise<Res> {\n const out: any[] = [];\n let cursor: string | undefined;\n const requestParams = options.params as { start?: string; limit?: number };\n do {\n // eslint-disable-next-line no-await-in-loop\n const response = await get<Req, Res>({\n type: AptosApiType.FULLNODE,\n aptosConfig: options.aptosConfig,\n originMethod: options.originMethod,\n path: options.path,\n params: requestParams,\n overrides: options.overrides,\n });\n /**\n * the cursor is a \"state key\" from the API perspective. Client\n * should not need to \"care\" what it represents but just use it\n * to query the next chunk of data.\n */\n cursor = response.headers[\"x-aptos-cursor\"];\n // Now that we have the cursor (if any), we remove the headers before\n // adding these to the output of this function.\n delete response.headers;\n out.push(...response.data);\n requestParams.start = cursor;\n } while (cursor !== null && cursor !== undefined);\n return out as Res;\n}\n"],"mappings":"yCA+DA,eAAsBA,EACpBC,EACkC,CAClC,GAAM,CAAE,YAAAC,EAAa,UAAAC,EAAW,OAAAC,EAAQ,YAAAC,EAAa,WAAAC,EAAY,KAAAC,EAAM,aAAAC,EAAc,KAAAC,CAAK,EAAIR,EACxFS,EAAMR,EAAY,cAAcO,CAAI,EAE1C,OAAOE,EACL,CACE,IAAAD,EACA,OAAQ,MACR,aAAAF,EACA,KAAAD,EACA,YAAAF,EACA,WAAAC,EACA,OAAAF,EACA,UAAW,CACT,GAAGF,EAAY,aACf,GAAGC,CACL,CACF,EACAD,EACAD,EAAQ,IACV,CACF,CAcA,eAAsBW,EACpBX,EACkC,CAClC,GAAM,CAAE,YAAAC,CAAY,EAAID,EAExB,OAAOD,EAAc,CACnB,GAAGC,EACH,gBACA,UAAW,CACT,GAAGC,EAAY,aACf,GAAGA,EAAY,eACf,GAAGD,EAAQ,UACX,QAAS,CAAE,GAAGC,EAAY,cAAc,QAAS,GAAGA,EAAY,gBAAgB,OAAQ,CAC1F,CACF,CAAC,CACH,CAUA,eAAsBW,EACpBZ,EACkC,CAClC,OAAOD,EAAc,CAAE,GAAGC,EAAS,aAA0B,CAAC,CAChE,CAGA,eAAsBa,EACpBb,EACc,CACd,IAAMc,EAAa,CAAC,EAChBC,EACEC,EAAgBhB,EAAQ,OAC9B,EAAG,CAED,IAAMiB,EAAW,MAAMlB,EAAc,CACnC,gBACA,YAAaC,EAAQ,YACrB,aAAcA,EAAQ,aACtB,KAAMA,EAAQ,KACd,OAAQgB,EACR,UAAWhB,EAAQ,SACrB,CAAC,EAMDe,EAASE,EAAS,QAAQ,gBAAgB,EAG1C,OAAOA,EAAS,QAChBH,EAAI,KAAK,GAAGG,EAAS,IAAI,EACzBD,EAAc,MAAQD,CACxB,OAASA,GAAW,MACpB,OAAOD,CACT","names":["get","options","aptosConfig","overrides","params","contentType","acceptType","path","originMethod","type","url","aptosRequest","getAptosFullNode","getAptosPepperService","paginateWithCursor","out","cursor","requestParams","response"]}
@@ -0,0 +1,2 @@
1
+ import{a}from"./chunk-QQIVWB6G.mjs";var e=class extends a{};export{e as a};
2
+ //# sourceMappingURL=chunk-ONBFUPEC.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/core/crypto/proof.ts"],"sourcesContent":["import { Serializable } from \"../../bcs\";\n\n/**\n * An abstract representation of a cryptographic proof associated with specific\n * zero-knowledge proof schemes, such as Groth16 and PLONK.\n */\nexport abstract class Proof extends Serializable {}\n"],"mappings":"oCAMO,IAAeA,EAAf,cAA6BC,CAAa,CAAC","names":["Proof","Serializable"]}
@@ -1,2 +1,2 @@
1
- import{a as i}from"./chunk-TMW2HIXC.mjs";import{a as b,b as g}from"./chunk-BD6BJETG.mjs";import{b as h,d as p}from"./chunk-DAJOX4PL.mjs";import{b as a}from"./chunk-QPP6BX53.mjs";import{a as y}from"./chunk-HPZ2S4FE.mjs";var n=class extends y{static deserialize(e){let r=e.deserializeUleb128AsU32();switch(r){case 0:return o.load(e);case 1:return d.load(e);case 2:return u.load(e);case 3:return l.load(e);case 4:return A.load(e);default:throw new Error(`Unknown variant index for TransactionAuthenticator: ${r}`)}}},o=class s extends n{constructor(e,r){super(),this.public_key=e,this.signature=r}serialize(e){e.serializeU32AsUleb128(0),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let r=h.deserialize(e),t=p.deserialize(e);return new s(r,t)}},d=class s extends n{constructor(e,r){super(),this.public_key=e,this.signature=r}serialize(e){e.serializeU32AsUleb128(1),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let r=b.deserialize(e),t=g.deserialize(e);return new s(r,t)}},u=class s extends n{constructor(e,r,t){super(),this.sender=e,this.secondary_signer_addresses=r,this.secondary_signers=t}serialize(e){e.serializeU32AsUleb128(2),this.sender.serialize(e),e.serializeVector(this.secondary_signer_addresses),e.serializeVector(this.secondary_signers)}static load(e){let r=i.deserialize(e),t=e.deserializeVector(a),c=e.deserializeVector(i);return new s(r,t,c)}},l=class s extends n{constructor(e,r,t,c){super(),this.sender=e,this.secondary_signer_addresses=r,this.secondary_signers=t,this.fee_payer=c}serialize(e){e.serializeU32AsUleb128(3),this.sender.serialize(e),e.serializeVector(this.secondary_signer_addresses),e.serializeVector(this.secondary_signers),this.fee_payer.address.serialize(e),this.fee_payer.authenticator.serialize(e)}static load(e){let r=i.deserialize(e),t=e.deserializeVector(a),c=e.deserializeVector(i),_=a.deserialize(e),z=i.deserialize(e),S={address:_,authenticator:z};return new s(r,t,c,S)}},A=class s extends n{constructor(e){super(),this.sender=e}serialize(e){e.serializeU32AsUleb128(4),this.sender.serialize(e)}static load(e){let r=i.deserialize(e);return new s(r)}};export{n as a,o as b,d as c,u as d,l as e,A as f};
2
- //# sourceMappingURL=chunk-N5JNKD5F.mjs.map
1
+ import{a as i}from"./chunk-IFHQSZLK.mjs";import{a as b,b as g}from"./chunk-WIXNX7HY.mjs";import{b as h,d as p}from"./chunk-WSVOJSAC.mjs";import{b as a}from"./chunk-KM6UXNC7.mjs";import{a as y}from"./chunk-QQIVWB6G.mjs";var n=class extends y{static deserialize(e){let r=e.deserializeUleb128AsU32();switch(r){case 0:return o.load(e);case 1:return d.load(e);case 2:return u.load(e);case 3:return l.load(e);case 4:return A.load(e);default:throw new Error(`Unknown variant index for TransactionAuthenticator: ${r}`)}}},o=class s extends n{constructor(e,r){super(),this.public_key=e,this.signature=r}serialize(e){e.serializeU32AsUleb128(0),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let r=h.deserialize(e),t=p.deserialize(e);return new s(r,t)}},d=class s extends n{constructor(e,r){super(),this.public_key=e,this.signature=r}serialize(e){e.serializeU32AsUleb128(1),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let r=b.deserialize(e),t=g.deserialize(e);return new s(r,t)}},u=class s extends n{constructor(e,r,t){super(),this.sender=e,this.secondary_signer_addresses=r,this.secondary_signers=t}serialize(e){e.serializeU32AsUleb128(2),this.sender.serialize(e),e.serializeVector(this.secondary_signer_addresses),e.serializeVector(this.secondary_signers)}static load(e){let r=i.deserialize(e),t=e.deserializeVector(a),c=e.deserializeVector(i);return new s(r,t,c)}},l=class s extends n{constructor(e,r,t,c){super(),this.sender=e,this.secondary_signer_addresses=r,this.secondary_signers=t,this.fee_payer=c}serialize(e){e.serializeU32AsUleb128(3),this.sender.serialize(e),e.serializeVector(this.secondary_signer_addresses),e.serializeVector(this.secondary_signers),this.fee_payer.address.serialize(e),this.fee_payer.authenticator.serialize(e)}static load(e){let r=i.deserialize(e),t=e.deserializeVector(a),c=e.deserializeVector(i),_=a.deserialize(e),z=i.deserialize(e),S={address:_,authenticator:z};return new s(r,t,c,S)}},A=class s extends n{constructor(e){super(),this.sender=e}serialize(e){e.serializeU32AsUleb128(4),this.sender.serialize(e)}static load(e){let r=i.deserialize(e);return new s(r)}};export{n as a,o as b,d as c,u as d,l as e,A as f};
2
+ //# sourceMappingURL=chunk-OS2EG6AE.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/transactions/authenticator/transaction.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/* eslint-disable @typescript-eslint/naming-convention */\n\nimport { AccountAuthenticator } from \"./account\";\nimport { Deserializer, Serializable, Serializer } from \"../../bcs\";\nimport { AccountAddress } from \"../../core\";\nimport { Ed25519PublicKey, Ed25519Signature } from \"../../core/crypto/ed25519\";\nimport { MultiEd25519PublicKey, MultiEd25519Signature } from \"../../core/crypto/multiEd25519\";\nimport { TransactionAuthenticatorVariant } from \"../../types\";\n\n/**\n * Represents an abstract base class for transaction authenticators.\n * This class provides methods for serializing and deserializing different types of transaction authenticators.\n *\n * @extends Serializable\n */\nexport abstract class TransactionAuthenticator extends Serializable {\n abstract serialize(serializer: Serializer): void;\n\n /**\n * Deserializes a TransactionAuthenticator from the provided deserializer.\n * This function helps in reconstructing the TransactionAuthenticator based on the variant index found in the serialized data.\n *\n * @param deserializer - The deserializer instance used to read the serialized data.\n */\n static deserialize(deserializer: Deserializer): TransactionAuthenticator {\n const index = deserializer.deserializeUleb128AsU32();\n switch (index) {\n case TransactionAuthenticatorVariant.Ed25519:\n return TransactionAuthenticatorEd25519.load(deserializer);\n case TransactionAuthenticatorVariant.MultiEd25519:\n return TransactionAuthenticatorMultiEd25519.load(deserializer);\n case TransactionAuthenticatorVariant.MultiAgent:\n return TransactionAuthenticatorMultiAgent.load(deserializer);\n case TransactionAuthenticatorVariant.FeePayer:\n return TransactionAuthenticatorFeePayer.load(deserializer);\n case TransactionAuthenticatorVariant.SingleSender:\n return TransactionAuthenticatorSingleSender.load(deserializer);\n default:\n throw new Error(`Unknown variant index for TransactionAuthenticator: ${index}`);\n }\n }\n}\n\n/**\n * Represents a transaction authenticator using Ed25519 for a single signer transaction.\n * This class encapsulates the client's public key and the Ed25519 signature of a raw transaction.\n *\n * @param public_key - The client's public key.\n * @param signature - The Ed25519 signature of a raw transaction.\n * @see {@link https://aptos.dev/integration/creating-a-signed-transaction | Creating a Signed Transaction}\n * for details about generating a signature.\n */\nexport class TransactionAuthenticatorEd25519 extends TransactionAuthenticator {\n public readonly public_key: Ed25519PublicKey;\n\n public readonly signature: Ed25519Signature;\n\n /**\n * Creates an instance of the class with the specified account authenticator.\n *\n * @param public_key - The Ed25519PublicKey that will be used for authentication.\n * @param signature - The Ed25519Signature that will be used for authentication.\n */\n constructor(public_key: Ed25519PublicKey, signature: Ed25519Signature) {\n super();\n this.public_key = public_key;\n this.signature = signature;\n }\n\n /**\n * Serializes the transaction authenticator by encoding the sender information.\n *\n * @param serializer - The serializer instance used to perform the serialization.\n */\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TransactionAuthenticatorVariant.Ed25519);\n this.public_key.serialize(serializer);\n this.signature.serialize(serializer);\n }\n\n /**\n * Loads a TransactionAuthenticatorSingleSender instance from the provided deserializer.\n * This function helps in deserializing the sender information to create a transaction authenticator.\n *\n * @param deserializer - The deserializer used to extract the sender data.\n */\n static load(deserializer: Deserializer): TransactionAuthenticatorEd25519 {\n const public_key = Ed25519PublicKey.deserialize(deserializer);\n const signature = Ed25519Signature.deserialize(deserializer);\n return new TransactionAuthenticatorEd25519(public_key, signature);\n }\n}\n\n/**\n * Represents a transaction authenticator for multi-signature transactions using Ed25519.\n * This class is used to validate transactions that require multiple signatures from different signers.\n *\n * @param public_key - The public key of the client involved in the transaction.\n * @param signature - The multi-signature of the raw transaction.\n */\nexport class TransactionAuthenticatorMultiEd25519 extends TransactionAuthenticator {\n public readonly public_key: MultiEd25519PublicKey;\n\n public readonly signature: MultiEd25519Signature;\n\n constructor(public_key: MultiEd25519PublicKey, signature: MultiEd25519Signature) {\n super();\n this.public_key = public_key;\n this.signature = signature;\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TransactionAuthenticatorVariant.MultiEd25519);\n this.public_key.serialize(serializer);\n this.signature.serialize(serializer);\n }\n\n static load(deserializer: Deserializer): TransactionAuthenticatorMultiEd25519 {\n const public_key = MultiEd25519PublicKey.deserialize(deserializer);\n const signature = MultiEd25519Signature.deserialize(deserializer);\n return new TransactionAuthenticatorMultiEd25519(public_key, signature);\n }\n}\n\n/**\n * Represents a transaction authenticator for a multi-agent transaction.\n *\n * This class manages the authentication process involving a primary sender and multiple secondary signers.\n *\n * @param sender - The authenticator for the sender account.\n * @param secondary_signer_addresses - An array of addresses for the secondary signers.\n * @param secondary_signers - An array of authenticators for the secondary signer accounts.\n */\nexport class TransactionAuthenticatorMultiAgent extends TransactionAuthenticator {\n public readonly sender: AccountAuthenticator;\n\n public readonly secondary_signer_addresses: Array<AccountAddress>;\n\n public readonly secondary_signers: Array<AccountAuthenticator>;\n\n constructor(\n sender: AccountAuthenticator,\n secondary_signer_addresses: Array<AccountAddress>,\n secondary_signers: Array<AccountAuthenticator>,\n ) {\n super();\n this.sender = sender;\n this.secondary_signer_addresses = secondary_signer_addresses;\n this.secondary_signers = secondary_signers;\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TransactionAuthenticatorVariant.MultiAgent);\n this.sender.serialize(serializer);\n serializer.serializeVector<AccountAddress>(this.secondary_signer_addresses);\n serializer.serializeVector<AccountAuthenticator>(this.secondary_signers);\n }\n\n static load(deserializer: Deserializer): TransactionAuthenticatorMultiAgent {\n const sender = AccountAuthenticator.deserialize(deserializer);\n const secondary_signer_addresses = deserializer.deserializeVector(AccountAddress);\n const secondary_signers = deserializer.deserializeVector(AccountAuthenticator);\n return new TransactionAuthenticatorMultiAgent(sender, secondary_signer_addresses, secondary_signers);\n }\n}\n\n/**\n * Represents a transaction authenticator specifically for fee payer transactions.\n * It encapsulates the sender's account authenticator, addresses of secondary signers,\n * their respective authenticators, and the fee payer's account information.\n *\n * @param sender - The authenticator for the sender's account.\n * @param secondary_signer_addresses - An array of addresses for secondary signers.\n * @param secondary_signers - An array of authenticators for secondary signers' accounts.\n * @param fee_payer - An object containing the fee payer's account address and authenticator.\n */\nexport class TransactionAuthenticatorFeePayer extends TransactionAuthenticator {\n public readonly sender: AccountAuthenticator;\n\n public readonly secondary_signer_addresses: Array<AccountAddress>;\n\n public readonly secondary_signers: Array<AccountAuthenticator>;\n\n public readonly fee_payer: {\n address: AccountAddress;\n authenticator: AccountAuthenticator;\n };\n\n constructor(\n sender: AccountAuthenticator,\n secondary_signer_addresses: Array<AccountAddress>,\n secondary_signers: Array<AccountAuthenticator>,\n fee_payer: { address: AccountAddress; authenticator: AccountAuthenticator },\n ) {\n super();\n this.sender = sender;\n this.secondary_signer_addresses = secondary_signer_addresses;\n this.secondary_signers = secondary_signers;\n this.fee_payer = fee_payer;\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TransactionAuthenticatorVariant.FeePayer);\n this.sender.serialize(serializer);\n serializer.serializeVector<AccountAddress>(this.secondary_signer_addresses);\n serializer.serializeVector<AccountAuthenticator>(this.secondary_signers);\n this.fee_payer.address.serialize(serializer);\n this.fee_payer.authenticator.serialize(serializer);\n }\n\n static load(deserializer: Deserializer): TransactionAuthenticatorMultiAgent {\n const sender = AccountAuthenticator.deserialize(deserializer);\n const secondary_signer_addresses = deserializer.deserializeVector(AccountAddress);\n const secondary_signers = deserializer.deserializeVector(AccountAuthenticator);\n const address = AccountAddress.deserialize(deserializer);\n const authenticator = AccountAuthenticator.deserialize(deserializer);\n const fee_payer = { address, authenticator };\n return new TransactionAuthenticatorFeePayer(sender, secondary_signer_addresses, secondary_signers, fee_payer);\n }\n}\n\n/**\n * Represents a single sender authenticator for transactions that require a single signer.\n * This class is responsible for managing the authentication of a transaction initiated by a single sender.\n *\n * @param sender - An instance of AccountAuthenticator that represents the account of the sender.\n */\nexport class TransactionAuthenticatorSingleSender extends TransactionAuthenticator {\n public readonly sender: AccountAuthenticator;\n\n constructor(sender: AccountAuthenticator) {\n super();\n this.sender = sender;\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TransactionAuthenticatorVariant.SingleSender);\n this.sender.serialize(serializer);\n }\n\n static load(deserializer: Deserializer): TransactionAuthenticatorSingleSender {\n const sender = AccountAuthenticator.deserialize(deserializer);\n return new TransactionAuthenticatorSingleSender(sender);\n }\n}\n"],"mappings":"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","names":["TransactionAuthenticator","Serializable","deserializer","index","TransactionAuthenticatorEd25519","TransactionAuthenticatorMultiEd25519","TransactionAuthenticatorMultiAgent","TransactionAuthenticatorFeePayer","TransactionAuthenticatorSingleSender","_TransactionAuthenticatorEd25519","public_key","signature","serializer","Ed25519PublicKey","Ed25519Signature","_TransactionAuthenticatorMultiEd25519","MultiEd25519PublicKey","MultiEd25519Signature","_TransactionAuthenticatorMultiAgent","sender","secondary_signer_addresses","secondary_signers","AccountAuthenticator","AccountAddress","_TransactionAuthenticatorFeePayer","fee_payer","address","authenticator","_TransactionAuthenticatorSingleSender"]}
@@ -0,0 +1,2 @@
1
+ import{a as n}from"./chunk-AGBA3Y7A.mjs";import{b as a}from"./chunk-KM6UXNC7.mjs";import{a as v}from"./chunk-QQIVWB6G.mjs";var t=class i extends v{deserialize(e){let r=a.deserialize(e),s=n.deserialize(e),l=n.deserialize(e),b=e.deserializeVector(i);return new o(r,s,l,b)}static deserialize(e){let r=e.deserializeUleb128AsU32();switch(r){case 0:return u.load(e);case 1:return c.load(e);case 2:return p.load(e);case 3:return z.load(e);case 4:return T.load(e);case 5:return S.load(e);case 6:return f.load(e);case 7:return y.load(e);case 8:return d.load(e);case 9:return g.load(e);case 10:return h.load(e);case 255:return U.load(e);default:throw new Error(`Unknown variant index for TypeTag: ${r}`)}}isBool(){return this instanceof u}isAddress(){return this instanceof T}isGeneric(){return this instanceof U}isSigner(){return this instanceof S}isVector(){return this instanceof f}isStruct(){return this instanceof y}isU8(){return this instanceof c}isU16(){return this instanceof d}isU32(){return this instanceof g}isU64(){return this instanceof p}isU128(){return this instanceof z}isU256(){return this instanceof h}isPrimitive(){return this instanceof S||this instanceof T||this instanceof u||this instanceof c||this instanceof d||this instanceof g||this instanceof p||this instanceof z||this instanceof h}},u=class i extends t{toString(){return"bool"}serialize(e){e.serializeU32AsUleb128(0)}static load(e){return new i}},c=class i extends t{toString(){return"u8"}serialize(e){e.serializeU32AsUleb128(1)}static load(e){return new i}},d=class i extends t{toString(){return"u16"}serialize(e){e.serializeU32AsUleb128(8)}static load(e){return new i}},g=class i extends t{toString(){return"u32"}serialize(e){e.serializeU32AsUleb128(9)}static load(e){return new i}},p=class i extends t{toString(){return"u64"}serialize(e){e.serializeU32AsUleb128(2)}static load(e){return new i}},z=class i extends t{toString(){return"u128"}serialize(e){e.serializeU32AsUleb128(3)}static load(e){return new i}},h=class i extends t{toString(){return"u256"}serialize(e){e.serializeU32AsUleb128(10)}static load(e){return new i}},T=class i extends t{toString(){return"address"}serialize(e){e.serializeU32AsUleb128(4)}static load(e){return new i}},S=class i extends t{toString(){return"signer"}serialize(e){e.serializeU32AsUleb128(5)}static load(e){return new i}},x=class i extends t{constructor(r){super();this.value=r}toString(){return`&${this.value.toString()}`}serialize(r){r.serializeU32AsUleb128(254)}static load(r){let s=t.deserialize(r);return new i(s)}},U=class i extends t{constructor(r){super();this.value=r;if(r<0)throw new Error("Generic type parameter index cannot be negative")}toString(){return`T${this.value}`}serialize(r){r.serializeU32AsUleb128(255),r.serializeU32(this.value)}static load(r){let s=r.deserializeU32();return new i(s)}},f=class i extends t{constructor(r){super();this.value=r}toString(){return`vector<${this.value.toString()}>`}static u8(){return new i(new c)}serialize(r){r.serializeU32AsUleb128(6),this.value.serialize(r)}static load(r){let s=t.deserialize(r);return new i(s)}},y=class i extends t{constructor(r){super();this.value=r}toString(){let r="";return this.value.typeArgs.length>0&&(r=`<${this.value.typeArgs.map(s=>s.toString()).join(", ")}>`),`${this.value.address.toString()}::${this.value.moduleName.identifier}::${this.value.name.identifier}${r}`}serialize(r){r.serializeU32AsUleb128(7),this.value.serialize(r)}static load(r){let s=o.deserialize(r);return new i(s)}isTypeTag(r,s,l){return this.value.moduleName.identifier===s&&this.value.name.identifier===l&&this.value.address.equals(r)}isString(){return this.isTypeTag(a.ONE,"string","String")}isOption(){return this.isTypeTag(a.ONE,"option","Option")}isObject(){return this.isTypeTag(a.ONE,"object","Object")}},o=class i extends v{constructor(e,r,s,l){super(),this.address=e,this.moduleName=r,this.name=s,this.typeArgs=l}serialize(e){e.serialize(this.address),e.serialize(this.moduleName),e.serialize(this.name),e.serializeVector(this.typeArgs)}static deserialize(e){let r=a.deserialize(e),s=n.deserialize(e),l=n.deserialize(e),b=e.deserializeVector(t);return new i(r,s,l,b)}};function O(){return new o(a.ONE,new n("aptos_coin"),new n("AptosCoin"),[])}function E(){return new o(a.ONE,new n("string"),new n("String"),[])}function V(i){return new o(a.ONE,new n("option"),new n("Option"),[i])}function j(i){return new o(a.ONE,new n("object"),new n("Object"),[i])}export{t as a,u as b,c,d,g as e,p as f,z as g,h,T as i,S as j,x as k,U as l,f as m,y as n,o,O as p,E as q,V as r,j as s};
2
+ //# sourceMappingURL=chunk-OTY3NO7Q.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/transactions/typeTag/index.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable class-methods-use-this */\n/* eslint-disable max-classes-per-file */\nimport { Deserializer } from \"../../bcs/deserializer\";\nimport { Serializable, Serializer } from \"../../bcs/serializer\";\nimport { AccountAddress } from \"../../core\";\nimport { Identifier } from \"../instances/identifier\";\nimport { TypeTagVariants } from \"../../types\";\n\n/**\n * Represents a type tag in the serialization framework, serving as a base class for various specific type tags.\n * This class provides methods for serialization and deserialization of type tags, as well as type checking methods\n * to determine the specific type of the tag at runtime.\n *\n * @extends Serializable\n */\nexport abstract class TypeTag extends Serializable {\n abstract serialize(serializer: Serializer): void;\n\n /**\n * Deserializes a StructTag from the provided deserializer.\n * This function allows you to reconstruct a StructTag object from its serialized form.\n *\n * @param deserializer - The deserializer instance used to read the serialized data.\n */\n deserialize(deserializer: Deserializer): StructTag {\n const address = AccountAddress.deserialize(deserializer);\n const moduleName = Identifier.deserialize(deserializer);\n const name = Identifier.deserialize(deserializer);\n const typeArgs = deserializer.deserializeVector(TypeTag);\n return new StructTag(address, moduleName, name, typeArgs);\n }\n\n static deserialize(deserializer: Deserializer): TypeTag {\n const index = deserializer.deserializeUleb128AsU32();\n switch (index) {\n case TypeTagVariants.Bool:\n return TypeTagBool.load(deserializer);\n case TypeTagVariants.U8:\n return TypeTagU8.load(deserializer);\n case TypeTagVariants.U64:\n return TypeTagU64.load(deserializer);\n case TypeTagVariants.U128:\n return TypeTagU128.load(deserializer);\n case TypeTagVariants.Address:\n return TypeTagAddress.load(deserializer);\n case TypeTagVariants.Signer:\n return TypeTagSigner.load(deserializer);\n case TypeTagVariants.Vector:\n return TypeTagVector.load(deserializer);\n case TypeTagVariants.Struct:\n return TypeTagStruct.load(deserializer);\n case TypeTagVariants.U16:\n return TypeTagU16.load(deserializer);\n case TypeTagVariants.U32:\n return TypeTagU32.load(deserializer);\n case TypeTagVariants.U256:\n return TypeTagU256.load(deserializer);\n case TypeTagVariants.Generic:\n // This is only used for ABI representation, and cannot actually be used as a type.\n return TypeTagGeneric.load(deserializer);\n default:\n throw new Error(`Unknown variant index for TypeTag: ${index}`);\n }\n }\n\n abstract toString(): string;\n\n /**\n * Determines if the current instance is of type TypeTagBool.\n *\n * @returns {boolean} True if the instance is a TypeTagBool, otherwise false.\n */\n isBool(): this is TypeTagBool {\n return this instanceof TypeTagBool;\n }\n\n /**\n * Determines if the current instance is of type TypeTagAddress.\n *\n * @returns {boolean} True if the instance is a TypeTagAddress, otherwise false.\n */\n isAddress(): this is TypeTagAddress {\n return this instanceof TypeTagAddress;\n }\n\n /**\n * Determines if the current instance is of type TypeTagGeneric.\n *\n * @returns {boolean} Returns true if the instance is a TypeTagGeneric, otherwise false.\n */\n isGeneric(): this is TypeTagGeneric {\n return this instanceof TypeTagGeneric;\n }\n\n /**\n * Determine if the current instance is a TypeTagSigner.\n *\n * @returns {boolean} Returns true if the instance is a TypeTagSigner, otherwise false.\n */\n isSigner(): this is TypeTagSigner {\n return this instanceof TypeTagSigner;\n }\n\n /**\n * Checks if the current instance is a vector type.\n * This can help determine the specific type of data structure being used.\n *\n * @returns {boolean} True if the instance is of type TypeTagVector, otherwise false.\n */\n isVector(): this is TypeTagVector {\n return this instanceof TypeTagVector;\n }\n\n /**\n * Determines if the current instance is a structure type.\n *\n * @returns {boolean} True if the instance is of type TypeTagStruct, otherwise false.\n */\n isStruct(): this is TypeTagStruct {\n return this instanceof TypeTagStruct;\n }\n\n /**\n * Determines if the current instance is of type `TypeTagU8`.\n *\n * @returns {boolean} Returns true if the instance is of type `TypeTagU8`, otherwise false.\n */\n isU8(): this is TypeTagU8 {\n return this instanceof TypeTagU8;\n }\n\n /**\n * Checks if the current instance is of type TypeTagU16.\n *\n * @returns {boolean} True if the instance is TypeTagU16, otherwise false.\n */\n isU16(): this is TypeTagU16 {\n return this instanceof TypeTagU16;\n }\n\n /**\n * Checks if the current instance is of type TypeTagU32.\n *\n * @returns {boolean} Returns true if the instance is TypeTagU32, otherwise false.\n */\n isU32(): this is TypeTagU32 {\n return this instanceof TypeTagU32;\n }\n\n /**\n * Checks if the current instance is of type TypeTagU64.\n *\n * @returns {boolean} True if the instance is a TypeTagU64, otherwise false.\n */\n isU64(): this is TypeTagU64 {\n return this instanceof TypeTagU64;\n }\n\n /**\n * Determines if the current instance is of the TypeTagU128 type.\n *\n * @returns {boolean} True if the instance is of TypeTagU128, otherwise false.\n */\n isU128(): this is TypeTagU128 {\n return this instanceof TypeTagU128;\n }\n\n /**\n * Checks if the current instance is of type TypeTagU256.\n *\n * @returns {boolean} Returns true if the instance is of type TypeTagU256, otherwise false.\n */\n isU256(): this is TypeTagU256 {\n return this instanceof TypeTagU256;\n }\n\n isPrimitive(): boolean {\n return (\n this instanceof TypeTagSigner ||\n this instanceof TypeTagAddress ||\n this instanceof TypeTagBool ||\n this instanceof TypeTagU8 ||\n this instanceof TypeTagU16 ||\n this instanceof TypeTagU32 ||\n this instanceof TypeTagU64 ||\n this instanceof TypeTagU128 ||\n this instanceof TypeTagU256\n );\n }\n}\n\n/**\n * Represents a boolean type tag in the type system.\n * This class extends the base TypeTag class and provides\n * methods for serialization and deserialization of the boolean\n * type tag.\n *\n * @extends TypeTag\n */\nexport class TypeTagBool extends TypeTag {\n /**\n * Returns the string representation of the object.\n *\n * @returns {string} The string representation of the object.\n */\n toString(): string {\n return \"bool\";\n }\n\n /**\n * Serializes the current instance's properties into a provided serializer.\n * This function ensures that the address, module name, name, and type arguments are properly serialized.\n *\n * @param serializer - The serializer instance used to serialize the properties.\n */\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TypeTagVariants.Bool);\n }\n\n /**\n * Deserializes a StructTag and returns a new TypeTagStruct instance.\n *\n * @param _deserializer - The deserializer used to read the StructTag data.\n */\n static load(_deserializer: Deserializer): TypeTagBool {\n return new TypeTagBool();\n }\n}\n\n/**\n * Represents a type tag for an 8-bit unsigned integer (u8).\n * This class extends the base TypeTag class and provides methods\n * for serialization and deserialization specific to the u8 type.\n *\n * @extends TypeTag\n */\nexport class TypeTagU8 extends TypeTag {\n toString(): string {\n return \"u8\";\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TypeTagVariants.U8);\n }\n\n static load(_deserializer: Deserializer): TypeTagU8 {\n return new TypeTagU8();\n }\n}\n\n/**\n * Represents a type tag for unsigned 16-bit integers (u16).\n * This class extends the base TypeTag class and provides methods for serialization and deserialization.\n *\n * @extends TypeTag\n */\nexport class TypeTagU16 extends TypeTag {\n toString(): string {\n return \"u16\";\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TypeTagVariants.U16);\n }\n\n static load(_deserializer: Deserializer): TypeTagU16 {\n return new TypeTagU16();\n }\n}\n\n/**\n * Represents a type tag for a 32-bit unsigned integer (u32).\n * This class extends the base TypeTag class and provides methods for serialization\n * and deserialization specific to the u32 type.\n *\n * @extends TypeTag\n */\nexport class TypeTagU32 extends TypeTag {\n toString(): string {\n return \"u32\";\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TypeTagVariants.U32);\n }\n\n static load(_deserializer: Deserializer): TypeTagU32 {\n return new TypeTagU32();\n }\n}\n\n/**\n * Represents a type tag for 64-bit unsigned integers (u64).\n * This class extends the base TypeTag class and provides methods for serialization and deserialization.\n *\n * @extends TypeTag\n */\nexport class TypeTagU64 extends TypeTag {\n toString(): string {\n return \"u64\";\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TypeTagVariants.U64);\n }\n\n static load(_deserializer: Deserializer): TypeTagU64 {\n return new TypeTagU64();\n }\n}\n\n/**\n * Represents a type tag for the u128 data type.\n * This class extends the base TypeTag class and provides methods for serialization and deserialization.\n *\n * @extends TypeTag\n */\nexport class TypeTagU128 extends TypeTag {\n toString(): string {\n return \"u128\";\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TypeTagVariants.U128);\n }\n\n static load(_deserializer: Deserializer): TypeTagU128 {\n return new TypeTagU128();\n }\n}\n\n/**\n * Represents a type tag for the U256 data type.\n * This class extends the base TypeTag class and provides methods for serialization and deserialization.\n *\n * @extends TypeTag\n */\nexport class TypeTagU256 extends TypeTag {\n toString(): string {\n return \"u256\";\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TypeTagVariants.U256);\n }\n\n static load(_deserializer: Deserializer): TypeTagU256 {\n return new TypeTagU256();\n }\n}\n\n/**\n * Represents a type tag for an address in the system.\n * This class extends the TypeTag class and provides functionality\n * to serialize the address type and load it from a deserializer.\n *\n * @extends TypeTag\n */\nexport class TypeTagAddress extends TypeTag {\n toString(): string {\n return \"address\";\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TypeTagVariants.Address);\n }\n\n static load(_deserializer: Deserializer): TypeTagAddress {\n return new TypeTagAddress();\n }\n}\n\n/**\n * Represents a type tag for a signer in the system.\n * This class extends the base TypeTag and provides specific functionality\n * related to the signer type.\n *\n * @extends TypeTag\n */\nexport class TypeTagSigner extends TypeTag {\n toString(): string {\n return \"signer\";\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TypeTagVariants.Signer);\n }\n\n static load(_deserializer: Deserializer): TypeTagSigner {\n return new TypeTagSigner();\n }\n}\n\n/**\n * Represents a reference to a type tag in the type system.\n * This class extends the TypeTag class and provides functionality\n * to serialize and deserialize type tag references.\n *\n * @extends TypeTag\n */\nexport class TypeTagReference extends TypeTag {\n toString(): `&${string}` {\n return `&${this.value.toString()}`;\n }\n\n /**\n * Initializes a new instance of the class with the specified parameters.\n *\n * @param value - The TypeTag to reference.\n */\n constructor(public readonly value: TypeTag) {\n super();\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TypeTagVariants.Reference);\n }\n\n static load(deserializer: Deserializer): TypeTagReference {\n const value = TypeTag.deserialize(deserializer);\n return new TypeTagReference(value);\n }\n}\n\n/**\n * Represents a generic type tag used for type parameters in entry functions.\n * Generics are not serialized into a real type, so they cannot be used as a type directly.\n *\n * @extends TypeTag\n */\nexport class TypeTagGeneric extends TypeTag {\n toString(): `T${number}` {\n return `T${this.value}`;\n }\n\n constructor(public readonly value: number) {\n super();\n if (value < 0) throw new Error(\"Generic type parameter index cannot be negative\");\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TypeTagVariants.Generic);\n serializer.serializeU32(this.value);\n }\n\n static load(deserializer: Deserializer): TypeTagGeneric {\n const value = deserializer.deserializeU32();\n return new TypeTagGeneric(value);\n }\n}\n\n/**\n * Represents a vector type tag, which encapsulates a single type tag value.\n * This class extends the base TypeTag class and provides methods for serialization,\n * deserialization, and string representation of the vector type tag.\n *\n * @extends TypeTag\n */\nexport class TypeTagVector extends TypeTag {\n toString(): `vector<${string}>` {\n return `vector<${this.value.toString()}>`;\n }\n\n constructor(public readonly value: TypeTag) {\n super();\n }\n\n /**\n * Creates a new TypeTagVector instance with a TypeTagU8 type.\n *\n * @returns {TypeTagVector} A new TypeTagVector initialized with TypeTagU8.\n */\n static u8(): TypeTagVector {\n return new TypeTagVector(new TypeTagU8());\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TypeTagVariants.Vector);\n this.value.serialize(serializer);\n }\n\n static load(deserializer: Deserializer): TypeTagVector {\n const value = TypeTag.deserialize(deserializer);\n return new TypeTagVector(value);\n }\n}\n\n/**\n * Represents a structured type tag in the system, extending the base TypeTag class.\n * This class encapsulates information about a specific structure, including its address,\n * module name, and type arguments, and provides methods for serialization and type checking.\n *\n * @param value - The StructTag instance containing the details of the structured type.\n */\nexport class TypeTagStruct extends TypeTag {\n toString(): `0x${string}::${string}::${string}` {\n // Collect type args and add it if there are any\n let typePredicate = \"\";\n if (this.value.typeArgs.length > 0) {\n typePredicate = `<${this.value.typeArgs.map((typeArg) => typeArg.toString()).join(\", \")}>`;\n }\n\n return `${this.value.address.toString()}::${this.value.moduleName.identifier}::${\n this.value.name.identifier\n }${typePredicate}`;\n }\n\n constructor(public readonly value: StructTag) {\n super();\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TypeTagVariants.Struct);\n this.value.serialize(serializer);\n }\n\n static load(deserializer: Deserializer): TypeTagStruct {\n const value = StructTag.deserialize(deserializer);\n return new TypeTagStruct(value);\n }\n\n /**\n * Determines if the provided address, module name, and struct name match the current type tag.\n *\n * @param address - The account address to compare against the type tag.\n * @param moduleName - The name of the module to compare against the type tag.\n * @param structName - The name of the struct to compare against the type tag.\n * @returns True if the address, module name, and struct name match the type tag; otherwise, false.\n */\n isTypeTag(address: AccountAddress, moduleName: string, structName: string): boolean {\n return (\n this.value.moduleName.identifier === moduleName &&\n this.value.name.identifier === structName &&\n this.value.address.equals(address)\n );\n }\n\n /**\n * Checks if the provided value is of type string.\n * This function can help ensure that the data being processed is in the correct format before further operations.\n *\n * @returns {boolean} Returns true if the value is a string, otherwise false.\n */\n isString(): boolean {\n return this.isTypeTag(AccountAddress.ONE, \"string\", \"String\");\n }\n\n /**\n * Checks if the specified account address is of type \"option\".\n *\n * @returns {boolean} Returns true if the account address is an option type, otherwise false.\n */\n isOption(): boolean {\n return this.isTypeTag(AccountAddress.ONE, \"option\", \"Option\");\n }\n\n /**\n * Checks if the provided value is of type 'object'.\n * This function helps determine if a value can be treated as an object type in the context of the SDK.\n *\n * @returns {boolean} Returns true if the value is an object, otherwise false.\n */\n isObject(): boolean {\n return this.isTypeTag(AccountAddress.ONE, \"object\", \"Object\");\n }\n}\n\n/**\n * Represents a structured tag that includes an address, module name,\n * name, and type arguments. This class is used to define and manage\n * structured data types within the SDK.\n *\n * @property {AccountAddress} address - The address associated with the struct tag.\n * @property {Identifier} moduleName - The name of the module that contains the struct.\n * @property {Identifier} name - The name of the struct.\n * @property {Array<TypeTag>} typeArgs - An array of type arguments associated with the struct.\n */\nexport class StructTag extends Serializable {\n public readonly address: AccountAddress;\n\n public readonly moduleName: Identifier;\n\n public readonly name: Identifier;\n\n public readonly typeArgs: Array<TypeTag>;\n\n constructor(address: AccountAddress, module_name: Identifier, name: Identifier, type_args: Array<TypeTag>) {\n super();\n this.address = address;\n this.moduleName = module_name;\n this.name = name;\n this.typeArgs = type_args;\n }\n\n serialize(serializer: Serializer): void {\n serializer.serialize(this.address);\n serializer.serialize(this.moduleName);\n serializer.serialize(this.name);\n serializer.serializeVector(this.typeArgs);\n }\n\n static deserialize(deserializer: Deserializer): StructTag {\n const address = AccountAddress.deserialize(deserializer);\n const moduleName = Identifier.deserialize(deserializer);\n const name = Identifier.deserialize(deserializer);\n const typeArgs = deserializer.deserializeVector(TypeTag);\n return new StructTag(address, moduleName, name, typeArgs);\n }\n}\n\n/**\n * Retrieves the StructTag for the AptosCoin, which represents the Aptos Coin in the Aptos blockchain.\n *\n * @returns {StructTag} The StructTag for the AptosCoin.\n */\nexport function aptosCoinStructTag(): StructTag {\n return new StructTag(AccountAddress.ONE, new Identifier(\"aptos_coin\"), new Identifier(\"AptosCoin\"), []);\n}\n\n/**\n * Returns a new StructTag representing a string type.\n *\n * @returns {StructTag} A StructTag for the string type.\n */\nexport function stringStructTag(): StructTag {\n return new StructTag(AccountAddress.ONE, new Identifier(\"string\"), new Identifier(\"String\"), []);\n}\n\n/**\n * Creates a new StructTag for the Option type with the specified type argument.\n * This can help in defining a specific instance of an Option type in your application.\n *\n * @param typeArg - The type tag that specifies the type of the value contained in the Option.\n */\nexport function optionStructTag(typeArg: TypeTag): StructTag {\n return new StructTag(AccountAddress.ONE, new Identifier(\"option\"), new Identifier(\"Option\"), [typeArg]);\n}\n\n/**\n * Creates a new StructTag for the Object type with the specified type argument.\n * This function helps in defining a structured representation of an Object with a specific type.\n *\n * @param typeArg - The type tag that specifies the type of the Object.\n */\nexport function objectStructTag(typeArg: TypeTag): StructTag {\n return new StructTag(AccountAddress.ONE, new Identifier(\"object\"), new Identifier(\"Object\"), [typeArg]);\n}\n"],"mappings":"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","names":["TypeTag","_TypeTag","Serializable","deserializer","address","AccountAddress","moduleName","Identifier","name","typeArgs","StructTag","index","TypeTagBool","TypeTagU8","TypeTagU64","TypeTagU128","TypeTagAddress","TypeTagSigner","TypeTagVector","TypeTagStruct","TypeTagU16","TypeTagU32","TypeTagU256","TypeTagGeneric","_TypeTagBool","serializer","_deserializer","_TypeTagU8","_TypeTagU16","_TypeTagU32","_TypeTagU64","_TypeTagU128","_TypeTagU256","_TypeTagAddress","_TypeTagSigner","TypeTagReference","_TypeTagReference","value","_TypeTagGeneric","_TypeTagVector","_TypeTagStruct","typePredicate","typeArg","structName","_StructTag","module_name","type_args","aptosCoinStructTag","stringStructTag","optionStructTag","objectStructTag"]}
@@ -1,2 +1,2 @@
1
- import{a as o}from"./chunk-ZGO2SK6F.mjs";var t=class{constructor(n){this.config=n}async transferCoinTransaction(n){return o({aptosConfig:this.config,...n})}};export{t as a};
2
- //# sourceMappingURL=chunk-25NSCK4Q.mjs.map
1
+ import{a as o}from"./chunk-QBWGWHJK.mjs";var t=class{constructor(n){this.config=n}async transferCoinTransaction(n){return o({aptosConfig:this.config,...n})}};export{t as a};
2
+ //# sourceMappingURL=chunk-OV5UQ75K.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/api/coin.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { AccountAddressInput } from \"../core\";\nimport { transferCoinTransaction } from \"../internal/coin\";\nimport { SimpleTransaction } from \"../transactions/instances/simpleTransaction\";\nimport { InputGenerateTransactionOptions } from \"../transactions/types\";\nimport { AnyNumber, MoveStructId } from \"../types\";\nimport { AptosConfig } from \"./aptosConfig\";\n\n/**\n * A class to handle all `Coin` operations.\n */\nexport class Coin {\n /**\n * Initializes a new instance of the Aptos client with the specified configuration.\n * This allows you to interact with the Aptos blockchain using the provided settings.\n *\n * @param config - The configuration settings for the Aptos client.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * async function runExample() {\n * // Create a new Aptos client with testnet configuration\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * console.log(\"Aptos client initialized:\", aptos);\n * }\n * runExample().catch(console.error);\n * ```\n */\n constructor(readonly config: AptosConfig) {}\n\n /**\n * Generate a transfer coin transaction that can be simulated, signed, and submitted.\n * This function helps you create a transaction to transfer a specified amount of coins\n * from one account to another within the Aptos network.\n *\n * @param args The arguments for the transfer transaction.\n * @param args.sender The sender account address.\n * @param args.recipient The recipient account address.\n * @param args.amount The amount of coins to transfer.\n * @param args.coinType Optional. The coin struct type to transfer. Defaults to 0x1::aptos_coin::AptosCoin.\n * @param args.options Optional. Additional options for generating the transaction.\n *\n * @returns SimpleTransaction\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Generate a transfer coin transaction\n * const transaction = await aptos.transferCoinTransaction({\n * sender: \"0x1\", // replace with a real sender account address\n * recipient: \"0x2\", // replace with a real recipient account address\n * amount: 10,\n * });\n *\n * console.log(transaction);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async transferCoinTransaction(args: {\n sender: AccountAddressInput;\n recipient: AccountAddressInput;\n amount: AnyNumber;\n coinType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }): Promise<SimpleTransaction> {\n return transferCoinTransaction({ aptosConfig: this.config, ...args });\n }\n}\n"],"mappings":"yCAaO,IAAMA,EAAN,KAAW,CAqBhB,YAAqBC,EAAqB,CAArB,YAAAA,CAAsB,CAoC3C,MAAM,wBAAwBC,EAMC,CAC7B,OAAOC,EAAwB,CAAE,YAAa,KAAK,OAAQ,GAAGD,CAAK,CAAC,CACtE,CACF","names":["Coin","config","args","transferCoinTransaction"]}
@@ -1,2 +1,2 @@
1
- import{a as i}from"./chunk-MS4MRLGA.mjs";import{a as r}from"./chunk-HPZ2S4FE.mjs";var t=class l extends r{constructor(e){super(),this.value=new i(e)}serialize(e){e.serialize(this.value)}serializeForEntryFunction(e){e.serializeU32AsUleb128(this.value.value.length),e.serialize(this)}static deserialize(e,s){let a=i.deserialize(e,s);return new l(a.value)}};export{t as a};
2
- //# sourceMappingURL=chunk-YJCZU6PR.mjs.map
1
+ import{a as i}from"./chunk-JGNMNCQB.mjs";import{a as r}from"./chunk-QQIVWB6G.mjs";var t=class l extends r{constructor(e){super(),this.value=new i(e)}serialize(e){e.serialize(this.value)}serializeForEntryFunction(e){e.serializeU32AsUleb128(this.value.value.length),e.serialize(this)}static deserialize(e,s){let a=i.deserialize(e,s);return new l(a.value)}};export{t as a};
2
+ //# sourceMappingURL=chunk-OZN3OOJV.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/bcs/serializable/entryFunctionBytes.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Serializer, Serializable } from \"../serializer\";\nimport { Deserializer } from \"../deserializer\";\nimport { FixedBytes } from \"./fixedBytes\";\nimport { EntryFunctionArgument } from \"../../transactions/instances/transactionArgument\";\nimport { HexInput } from \"../../types\";\n\n/**\n * This class exists solely to represent a sequence of fixed bytes as a serialized entry function, because\n * serializing an entry function appends a prefix that's *only* used for entry function arguments.\n *\n * NOTE: Using this class for serialized script functions will lead to erroneous and unexpected behavior.\n *\n * If you wish to convert this class back to a TransactionArgument, you must know the type\n * of the argument beforehand, and use the appropriate class to deserialize the bytes within\n * an instance of this class.\n */\nexport class EntryFunctionBytes extends Serializable implements EntryFunctionArgument {\n public readonly value: FixedBytes;\n\n /**\n * Creates an instance of the class with a specified hexadecimal input value.\n *\n * @param value - The hexadecimal input to be converted into FixedBytes.\n */\n private constructor(value: HexInput) {\n super();\n this.value = new FixedBytes(value);\n }\n\n // Note that to see the Move, BCS-serialized representation of the underlying fixed byte vector,\n // we must not serialize the length prefix.\n //\n // In other words, this class is only used to represent a sequence of bytes that are already\n // BCS-serialized as a type. To represent those bytes accurately, the BCS-serialized form is the same exact\n // representation.\n\n /**\n * Serializes the value using the provided serializer.\n * This function is essential for accurately representing a sequence of bytes that are already BCS-serialized as a type.\n *\n * Note that to see the Move, BCS-serialized representation of the underlying fixed byte vector,\n * we must not serialize the length prefix.\n *\n * @param serializer - The serializer instance used to perform the serialization.\n */\n serialize(serializer: Serializer): void {\n serializer.serialize(this.value);\n }\n\n // When we serialize these bytes as an entry function argument, we need to\n // serialize the length prefix. This essentially converts the underlying fixed byte vector to a type-agnostic\n // byte vector to an `any` type.\n // NOTE: This, and the lack of a `serializeForScriptFunction`, is the only meaningful difference between this\n // class and FixedBytes.\n\n /**\n * Serializes the current instance for use as an entry function argument by converting the underlying fixed byte vector to a\n * type-agnostic byte vector.\n * This process includes serializing the length prefix of the byte vector.\n *\n * @param serializer - The serializer instance used to perform the serialization.\n */\n serializeForEntryFunction(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(this.value.value.length);\n serializer.serialize(this);\n }\n\n /**\n * The only way to create an instance of this class is to use this static method.\n * This function should only be used when deserializing a sequence of EntryFunctionPayload arguments.\n * @param deserializer - The deserializer instance with the buffered bytes.\n * @param length - The length of the bytes to deserialize.\n * @returns An instance of this class, which will now only be usable as an EntryFunctionArgument.\n */\n static deserialize(deserializer: Deserializer, length: number): EntryFunctionBytes {\n const fixedBytes = FixedBytes.deserialize(deserializer, length);\n return new EntryFunctionBytes(fixedBytes.value);\n }\n}\n"],"mappings":"kFAmBO,IAAMA,EAAN,MAAMC,UAA2BC,CAA8C,CAQ5E,YAAYC,EAAiB,CACnC,MAAM,EACN,KAAK,MAAQ,IAAIC,EAAWD,CAAK,CACnC,CAkBA,UAAUE,EAA8B,CACtCA,EAAW,UAAU,KAAK,KAAK,CACjC,CAeA,0BAA0BA,EAA8B,CACtDA,EAAW,sBAAsB,KAAK,MAAM,MAAM,MAAM,EACxDA,EAAW,UAAU,IAAI,CAC3B,CASA,OAAO,YAAYC,EAA4BC,EAAoC,CACjF,IAAMC,EAAaJ,EAAW,YAAYE,EAAcC,CAAM,EAC9D,OAAO,IAAIN,EAAmBO,EAAW,KAAK,CAChD,CACF","names":["EntryFunctionBytes","_EntryFunctionBytes","Serializable","value","FixedBytes","serializer","deserializer","length","fixedBytes"]}
@@ -1,2 +1,2 @@
1
- import{b as c}from"./chunk-QPP6BX53.mjs";import{sha3_256 as n}from"@noble/hashes/sha3";var d=(e,r)=>{let t=e.bcsToBytes(),s=typeof r=="string"?Buffer.from(r,"utf8"):r,o=new Uint8Array([...t,...s,254]);return new c(n(o))},f=(e,r)=>{let t=e.bcsToBytes(),s=typeof r=="string"?Buffer.from(r,"utf8"):r,o=new Uint8Array([...t,...s,255]);return new c(n(o))},a=(e,r,t)=>{let s=`${r}::${t}`;return d(e,s)};export{d as a,f as b,a as c};
2
- //# sourceMappingURL=chunk-WP7WF54Q.mjs.map
1
+ import{b as c}from"./chunk-KM6UXNC7.mjs";import{sha3_256 as n}from"@noble/hashes/sha3";var d=(e,r)=>{let t=e.bcsToBytes(),s=typeof r=="string"?Buffer.from(r,"utf8"):r,o=new Uint8Array([...t,...s,254]);return new c(n(o))},f=(e,r)=>{let t=e.bcsToBytes(),s=typeof r=="string"?Buffer.from(r,"utf8"):r,o=new Uint8Array([...t,...s,255]);return new c(n(o))},a=(e,r,t)=>{let s=`${r}::${t}`;return d(e,s)};export{d as a,f as b,a as c};
2
+ //# sourceMappingURL=chunk-PCLU4KLY.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/core/account/utils/address.ts"],"sourcesContent":["import { sha3_256 } from \"@noble/hashes/sha3\";\nimport { AccountAddress } from \"../../accountAddress\";\nimport { DeriveScheme } from \"../../../types\";\n\n/**\n * Creates an object address from creator address and seed\n *\n * @param creatorAddress The object creator account address\n * @param seed The seed in either Uint8Array | string type\n *\n * @returns The object account address\n */\nexport const createObjectAddress = (creatorAddress: AccountAddress, seed: Uint8Array | string): AccountAddress => {\n const creatorBytes = creatorAddress.bcsToBytes();\n\n const seedBytes = typeof seed === \"string\" ? Buffer.from(seed, \"utf8\") : seed;\n\n const bytes = new Uint8Array([...creatorBytes, ...seedBytes, DeriveScheme.DeriveObjectAddressFromSeed]);\n\n return new AccountAddress(sha3_256(bytes));\n};\n\n/**\n * Creates a resource address from creator address and seed\n *\n * @param creatorAddress The creator account address\n * @param seed The seed in either Uint8Array | string type\n *\n * @returns The resource account address\n */\nexport const createResourceAddress = (creatorAddress: AccountAddress, seed: Uint8Array | string): AccountAddress => {\n const creatorBytes = creatorAddress.bcsToBytes();\n\n const seedBytes = typeof seed === \"string\" ? Buffer.from(seed, \"utf8\") : seed;\n\n const bytes = new Uint8Array([...creatorBytes, ...seedBytes, DeriveScheme.DeriveResourceAccountAddress]);\n\n return new AccountAddress(sha3_256(bytes));\n};\n\n/**\n * Creates a token object address from creator address, collection name and token name\n *\n * @param creatorAddress The token creator account address\n * @param collectionName The collection name\n * @param tokenName The token name\n *\n * @returns The token account address\n */\nexport const createTokenAddress = (\n creatorAddress: AccountAddress,\n collectionName: string,\n tokenName: string,\n): AccountAddress => {\n const seed = `${collectionName}::${tokenName}`;\n return createObjectAddress(creatorAddress, seed);\n};\n"],"mappings":"yCAAA,OAAS,YAAAA,MAAgB,qBAYlB,IAAMC,EAAsB,CAACC,EAAgCC,IAA8C,CAChH,IAAMC,EAAeF,EAAe,WAAW,EAEzCG,EAAY,OAAOF,GAAS,SAAW,OAAO,KAAKA,EAAM,MAAM,EAAIA,EAEnEG,EAAQ,IAAI,WAAW,CAAC,GAAGF,EAAc,GAAGC,KAAmD,CAAC,EAEtG,OAAO,IAAIE,EAAeC,EAASF,CAAK,CAAC,CAC3C,EAUaG,EAAwB,CAACP,EAAgCC,IAA8C,CAClH,IAAMC,EAAeF,EAAe,WAAW,EAEzCG,EAAY,OAAOF,GAAS,SAAW,OAAO,KAAKA,EAAM,MAAM,EAAIA,EAEnEG,EAAQ,IAAI,WAAW,CAAC,GAAGF,EAAc,GAAGC,KAAoD,CAAC,EAEvG,OAAO,IAAIE,EAAeC,EAASF,CAAK,CAAC,CAC3C,EAWaI,EAAqB,CAChCR,EACAS,EACAC,IACmB,CACnB,IAAMT,EAAO,GAAGQ,CAAc,KAAKC,CAAS,GAC5C,OAAOX,EAAoBC,EAAgBC,CAAI,CACjD","names":["sha3_256","createObjectAddress","creatorAddress","seed","creatorBytes","seedBytes","bytes","AccountAddress","sha3_256","createResourceAddress","createTokenAddress","collectionName","tokenName"]}
@@ -1,2 +1,2 @@
1
- import{a as t}from"./chunk-WWZ3METZ.mjs";var o=class{constructor(n){this.config=n}async simple(n){return t({aptosConfig:this.config,...n})}async multiAgent(n){return t({aptosConfig:this.config,...n})}};export{o as a};
2
- //# sourceMappingURL=chunk-SR24OGHJ.mjs.map
1
+ import{a as t}from"./chunk-2I56E4T2.mjs";var o=class{constructor(n){this.config=n}async simple(n){return t({aptosConfig:this.config,...n})}async multiAgent(n){return t({aptosConfig:this.config,...n})}};export{o as a};
2
+ //# sourceMappingURL=chunk-PGZWRY7A.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/api/transactionSubmission/build.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { AccountAddressInput } from \"../../core\";\nimport { generateTransaction } from \"../../internal/transactionSubmission\";\nimport { InputGenerateTransactionPayloadData, InputGenerateTransactionOptions } from \"../../transactions\";\nimport { MultiAgentTransaction } from \"../../transactions/instances/multiAgentTransaction\";\nimport { SimpleTransaction } from \"../../transactions/instances/simpleTransaction\";\nimport { AptosConfig } from \"../aptosConfig\";\n\n/**\n * A class to handle all `Build` transaction operations.\n */\nexport class Build {\n readonly config: AptosConfig;\n\n /**\n * Initializes a new instance of the Aptos client with the specified configuration.\n * This allows you to interact with the Aptos blockchain using the provided settings.\n *\n * @param config - The configuration settings for the Aptos client.\n * @param config.network - The network to connect to (e.g., TESTNET, MAINNET).\n * @param config.nodeUrl - The URL of the Aptos node to connect to.\n * @param config.account - The account details for authentication.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * async function runExample() {\n * // Create a configuration for the Aptos client\n * const config = new AptosConfig({\n * network: Network.TESTNET, // specify the network\n * nodeUrl: \"https://testnet.aptos.dev\", // specify the node URL\n * });\n *\n * // Initialize the Aptos client\n * const aptos = new Aptos(config);\n *\n * console.log(\"Aptos client initialized:\", aptos);\n * }\n * runExample().catch(console.error);\n * ```\n */\n constructor(config: AptosConfig) {\n this.config = config;\n }\n\n /**\n * Build a simple transaction.\n *\n * This function allows you to create a transaction with specified sender and data.\n *\n * @param args.sender - The sender account address.\n * @param args.data - The transaction data.\n * @param args.options - Optional transaction configurations.\n * @param args.withFeePayer - Whether there is a fee payer for the transaction.\n *\n * @returns SimpleTransaction\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Build a simple transaction\n * const transaction = await aptos.transaction.simple({\n * sender: \"0x1\", // replace with a real sender account address\n * data: {\n * function: \"0x1::aptos_account::transfer\",\n * functionArguments: [\"0x2\", 100], // replace with a real destination account address\n * },\n * options: {\n * gasUnitPrice: 100, // specify your own gas unit price if needed\n * maxGasAmount: 1000, // specify your own max gas amount if needed\n * },\n * });\n *\n * console.log(transaction);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async simple(args: {\n sender: AccountAddressInput;\n data: InputGenerateTransactionPayloadData;\n options?: InputGenerateTransactionOptions;\n withFeePayer?: boolean;\n }): Promise<SimpleTransaction> {\n return generateTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Build a multi-agent transaction that allows multiple signers to authorize a transaction.\n *\n * @param args - The parameters for creating the multi-agent transaction.\n * @param args.sender - The sender account address.\n * @param args.data - The transaction data.\n * @param args.secondarySignerAddresses - An array of the secondary signers' account addresses.\n * @param args.options - Optional transaction configurations.\n * @param args.withFeePayer - Whether there is a fee payer for the transaction.\n *\n * @returns MultiAgentTransaction\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Build a multi-agent transaction\n * const transaction = await aptos.multiAgent({\n * sender: \"0x1\", // replace with a real sender account address\n * data: {\n * // Transaction data structure\n * function: \"0x1::aptos_account::transfer\",\n * functionArguments: [\"0x2\", 100], // replace with a real destination account address and amount\n * },\n * secondarySignerAddresses: [\"0x3\", \"0x4\"], // replace with real secondary signer addresses\n * options: {\n * // Optional transaction configurations\n * maxGasAmount: \"1000\",\n * gasUnitPrice: \"1\",\n * },\n * });\n *\n * console.log(transaction);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async multiAgent(args: {\n sender: AccountAddressInput;\n data: InputGenerateTransactionPayloadData;\n secondarySignerAddresses: AccountAddressInput[];\n options?: InputGenerateTransactionOptions;\n withFeePayer?: boolean;\n }): Promise<MultiAgentTransaction> {\n return generateTransaction({ aptosConfig: this.config, ...args });\n }\n}\n"],"mappings":"yCAaO,IAAMA,EAAN,KAAY,CA+BjB,YAAYC,EAAqB,CAC/B,KAAK,OAASA,CAChB,CAwCA,MAAM,OAAOC,EAKkB,CAC7B,OAAOC,EAAoB,CAAE,YAAa,KAAK,OAAQ,GAAGD,CAAK,CAAC,CAClE,CA2CA,MAAM,WAAWA,EAMkB,CACjC,OAAOC,EAAoB,CAAE,YAAa,KAAK,OAAQ,GAAGD,CAAK,CAAC,CAClE,CACF","names":["Build","config","args","generateTransaction"]}
@@ -1,2 +1,2 @@
1
- import{a as h}from"./chunk-XK3JFCP3.mjs";import{a as y}from"./chunk-DAXKRXRK.mjs";import{a as m}from"./chunk-TVFIUUVY.mjs";import{a}from"./chunk-CPPBQDHB.mjs";import{a as c}from"./chunk-HSPBA2TZ.mjs";import{a as l}from"./chunk-XXHW3ZT3.mjs";import{a as f}from"./chunk-LDFTE4MM.mjs";import{a as g}from"./chunk-TS3PYRAT.mjs";import{a as u}from"./chunk-QCUFTD7K.mjs";import{a as A}from"./chunk-QLN2URFX.mjs";import{a as s}from"./chunk-DF4WKSTK.mjs";import{a as p}from"./chunk-X4KEZTUQ.mjs";import{a as d}from"./chunk-NMD45OTM.mjs";import{a as r}from"./chunk-25NSCK4Q.mjs";var t=class{constructor(n){this.config=new d(n),this.account=new s(this.config),this.ans=new p(this.config),this.coin=new r(this.config),this.digitalAsset=new a(this.config),this.event=new c(this.config),this.faucet=new l(this.config),this.fungibleAsset=new f(this.config),this.general=new g(this.config),this.staking=new h(this.config),this.transaction=new m(this.config),this.table=new y(this.config),this.keyless=new u(this.config),this.object=new A(this.config)}};function e(b,n,w){Object.getOwnPropertyNames(n.prototype).forEach(i=>{let o=Object.getOwnPropertyDescriptor(n.prototype,i);o&&(o.value=function(...j){return this[w][i](...j)},Object.defineProperty(b.prototype,i,o))})}e(t,s,"account");e(t,p,"ans");e(t,r,"coin");e(t,a,"digitalAsset");e(t,c,"event");e(t,l,"faucet");e(t,f,"fungibleAsset");e(t,g,"general");e(t,h,"staking");e(t,m,"transaction");e(t,y,"table");e(t,u,"keyless");e(t,A,"object");export{t as a};
2
- //# sourceMappingURL=chunk-SAPUZZEU.mjs.map
1
+ import{a as y}from"./chunk-XIY2VORC.mjs";import{a as m}from"./chunk-RNAKZVRN.mjs";import{a as c}from"./chunk-2QRWGJJA.mjs";import{a as l}from"./chunk-EKZQ3EYX.mjs";import{a as f}from"./chunk-TIZL5YVP.mjs";import{a as g}from"./chunk-JNHFQTFC.mjs";import{a as u}from"./chunk-EF2PUPUH.mjs";import{a as A}from"./chunk-ZUTOMGB7.mjs";import{a as h}from"./chunk-GIQQF2PD.mjs";import{a as s}from"./chunk-KFSVKIFO.mjs";import{a as p}from"./chunk-RAXP3STS.mjs";import{a as d}from"./chunk-V5NDNR36.mjs";import{a as r}from"./chunk-OV5UQ75K.mjs";import{a}from"./chunk-5XXIIWG7.mjs";var t=class{constructor(n){this.config=new d(n),this.account=new s(this.config),this.ans=new p(this.config),this.coin=new r(this.config),this.digitalAsset=new a(this.config),this.event=new c(this.config),this.faucet=new l(this.config),this.fungibleAsset=new f(this.config),this.general=new g(this.config),this.staking=new h(this.config),this.transaction=new m(this.config),this.table=new y(this.config),this.keyless=new u(this.config),this.object=new A(this.config)}};function e(b,n,w){Object.getOwnPropertyNames(n.prototype).forEach(i=>{let o=Object.getOwnPropertyDescriptor(n.prototype,i);o&&(o.value=function(...j){return this[w][i](...j)},Object.defineProperty(b.prototype,i,o))})}e(t,s,"account");e(t,p,"ans");e(t,r,"coin");e(t,a,"digitalAsset");e(t,c,"event");e(t,l,"faucet");e(t,f,"fungibleAsset");e(t,g,"general");e(t,h,"staking");e(t,m,"transaction");e(t,y,"table");e(t,u,"keyless");e(t,A,"object");export{t as a};
2
+ //# sourceMappingURL=chunk-PHG2IWZW.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/api/aptos.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Account } from \"./account\";\nimport { AptosConfig } from \"./aptosConfig\";\nimport { Coin } from \"./coin\";\nimport { DigitalAsset } from \"./digitalAsset\";\nimport { Event } from \"./event\";\nimport { Faucet } from \"./faucet\";\nimport { FungibleAsset } from \"./fungibleAsset\";\nimport { General } from \"./general\";\nimport { ANS } from \"./ans\";\nimport { Staking } from \"./staking\";\nimport { Transaction } from \"./transaction\";\nimport { Table } from \"./table\";\nimport { Keyless } from \"./keyless\";\nimport { AptosObject } from \"./object\";\n\n/**\n * The main entry point for interacting with the Aptos APIs,\n * providing access to various functionalities organized into\n * distinct namespaces.\n *\n * To utilize the SDK, instantiate a new Aptos object to gain\n * access to the complete range of SDK features.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * async function runExample() {\n * // Create a configuration for connecting to the Aptos testnet\n * const config = new AptosConfig({ network: Network.TESTNET });\n *\n * // Initialize the Aptos client with the configuration\n * const aptos = new Aptos(config);\n *\n * console.log(\"Aptos client initialized:\", aptos);\n * }\n * runExample().catch(console.error);\n * ```\n */\nexport class Aptos {\n readonly config: AptosConfig;\n\n readonly account: Account;\n\n readonly ans: ANS;\n\n readonly coin: Coin;\n\n readonly digitalAsset: DigitalAsset;\n\n readonly event: Event;\n\n readonly faucet: Faucet;\n\n readonly fungibleAsset: FungibleAsset;\n\n readonly general: General;\n\n readonly staking: Staking;\n\n readonly transaction: Transaction;\n\n readonly table: Table;\n\n readonly keyless: Keyless;\n\n readonly object: AptosObject;\n\n /**\n * Initializes a new instance of the Aptos client with the provided configuration settings.\n * This allows you to interact with various Aptos functionalities such as accounts, transactions, and events.\n *\n * @param settings - Configuration settings for the Aptos client.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * async function runExample() {\n * // Create a new Aptos client with default settings\n * const config = new AptosConfig({ network: Network.TESTNET }); // Specify your own settings if needed\n * const aptos = new Aptos(config);\n *\n * console.log(\"Aptos client initialized:\", aptos);\n * }\n * runExample().catch(console.error);\n * ```\n */\n constructor(settings?: AptosConfig) {\n this.config = new AptosConfig(settings);\n this.account = new Account(this.config);\n this.ans = new ANS(this.config);\n this.coin = new Coin(this.config);\n this.digitalAsset = new DigitalAsset(this.config);\n this.event = new Event(this.config);\n this.faucet = new Faucet(this.config);\n this.fungibleAsset = new FungibleAsset(this.config);\n this.general = new General(this.config);\n this.staking = new Staking(this.config);\n this.transaction = new Transaction(this.config);\n this.table = new Table(this.config);\n this.keyless = new Keyless(this.config);\n this.object = new AptosObject(this.config);\n }\n}\n\n// extends Aptos interface so all the methods and properties\n// from the other classes will be recognized by typescript.\nexport interface Aptos\n extends Account,\n ANS,\n Coin,\n DigitalAsset,\n Event,\n Faucet,\n FungibleAsset,\n General,\n Keyless,\n Staking,\n Table,\n AptosObject,\n Omit<Transaction, \"build\" | \"simulate\" | \"submit\" | \"batch\"> {}\n\n/**\nIn TypeScript, we can’t inherit or extend from more than one class,\nMixins helps us to get around that by creating a partial classes\nthat we can combine to form a single class that contains all the methods and properties from the partial classes.\n{@link https://www.typescriptlang.org/docs/handbook/mixins.html#alternative-pattern}\n\nHere, we combine any subclass and the Aptos class.\n*/\nfunction applyMixin(targetClass: any, baseClass: any, baseClassProp: string) {\n // Mixin instance methods\n Object.getOwnPropertyNames(baseClass.prototype).forEach((propertyName) => {\n const propertyDescriptor = Object.getOwnPropertyDescriptor(baseClass.prototype, propertyName);\n if (!propertyDescriptor) return;\n // eslint-disable-next-line func-names\n propertyDescriptor.value = function (...args: any) {\n return (this as any)[baseClassProp][propertyName](...args);\n };\n Object.defineProperty(targetClass.prototype, propertyName, propertyDescriptor);\n });\n}\n\napplyMixin(Aptos, Account, \"account\");\napplyMixin(Aptos, ANS, \"ans\");\napplyMixin(Aptos, Coin, \"coin\");\napplyMixin(Aptos, DigitalAsset, \"digitalAsset\");\napplyMixin(Aptos, Event, \"event\");\napplyMixin(Aptos, Faucet, \"faucet\");\napplyMixin(Aptos, FungibleAsset, \"fungibleAsset\");\napplyMixin(Aptos, General, \"general\");\napplyMixin(Aptos, Staking, \"staking\");\napplyMixin(Aptos, Transaction, \"transaction\");\napplyMixin(Aptos, Table, \"table\");\napplyMixin(Aptos, Keyless, \"keyless\");\napplyMixin(Aptos, AptosObject, \"object\");\n"],"mappings":"yjBA0CO,IAAMA,EAAN,KAAY,CAiDjB,YAAYC,EAAwB,CAClC,KAAK,OAAS,IAAIC,EAAYD,CAAQ,EACtC,KAAK,QAAU,IAAIE,EAAQ,KAAK,MAAM,EACtC,KAAK,IAAM,IAAIC,EAAI,KAAK,MAAM,EAC9B,KAAK,KAAO,IAAIC,EAAK,KAAK,MAAM,EAChC,KAAK,aAAe,IAAIC,EAAa,KAAK,MAAM,EAChD,KAAK,MAAQ,IAAIC,EAAM,KAAK,MAAM,EAClC,KAAK,OAAS,IAAIC,EAAO,KAAK,MAAM,EACpC,KAAK,cAAgB,IAAIC,EAAc,KAAK,MAAM,EAClD,KAAK,QAAU,IAAIC,EAAQ,KAAK,MAAM,EACtC,KAAK,QAAU,IAAIC,EAAQ,KAAK,MAAM,EACtC,KAAK,YAAc,IAAIC,EAAY,KAAK,MAAM,EAC9C,KAAK,MAAQ,IAAIC,EAAM,KAAK,MAAM,EAClC,KAAK,QAAU,IAAIC,EAAQ,KAAK,MAAM,EACtC,KAAK,OAAS,IAAIC,EAAY,KAAK,MAAM,CAC3C,CACF,EA2BA,SAASC,EAAWC,EAAkBC,EAAgBC,EAAuB,CAE3E,OAAO,oBAAoBD,EAAU,SAAS,EAAE,QAASE,GAAiB,CACxE,IAAMC,EAAqB,OAAO,yBAAyBH,EAAU,UAAWE,CAAY,EACvFC,IAELA,EAAmB,MAAQ,YAAaC,EAAW,CACjD,OAAQ,KAAaH,CAAa,EAAEC,CAAY,EAAE,GAAGE,CAAI,CAC3D,EACA,OAAO,eAAeL,EAAY,UAAWG,EAAcC,CAAkB,EAC/E,CAAC,CACH,CAEAL,EAAWhB,EAAOG,EAAS,SAAS,EACpCa,EAAWhB,EAAOI,EAAK,KAAK,EAC5BY,EAAWhB,EAAOK,EAAM,MAAM,EAC9BW,EAAWhB,EAAOM,EAAc,cAAc,EAC9CU,EAAWhB,EAAOO,EAAO,OAAO,EAChCS,EAAWhB,EAAOQ,EAAQ,QAAQ,EAClCQ,EAAWhB,EAAOS,EAAe,eAAe,EAChDO,EAAWhB,EAAOU,EAAS,SAAS,EACpCM,EAAWhB,EAAOW,EAAS,SAAS,EACpCK,EAAWhB,EAAOY,EAAa,aAAa,EAC5CI,EAAWhB,EAAOa,EAAO,OAAO,EAChCG,EAAWhB,EAAOc,EAAS,SAAS,EACpCE,EAAWhB,EAAOe,EAAa,QAAQ","names":["Aptos","settings","AptosConfig","Account","ANS","Coin","DigitalAsset","Event","Faucet","FungibleAsset","General","Staking","Transaction","Table","Keyless","AptosObject","applyMixin","targetClass","baseClass","baseClassProp","propertyName","propertyDescriptor","args"]}
@@ -1,2 +1,2 @@
1
- import{hmac as c}from"@noble/hashes/hmac";import{sha512 as p}from"@noble/hashes/sha512";import*as i from"@scure/bip39";var d=/^m\/44'\/637'\/[0-9]+'\/[0-9]+'\/[0-9]+'?$/,m=/^m\/44'\/637'\/[0-9]+'\/[0-9]+\/[0-9]+$/,y=(t=>(t.ED25519="ed25519 seed",t))(y||{}),g=2147483648;function D(e){return m.test(e)}function E(e){return d.test(e)}var A=(e,t)=>{let r=c.create(p,e).update(t).digest();return{key:r.slice(0,32),chainCode:r.slice(32)}},f=({key:e,chainCode:t},r)=>{let n=new ArrayBuffer(4);new DataView(n).setUint32(0,r);let o=new Uint8Array(n),s=new Uint8Array([0]),a=new Uint8Array([...s,...e,...o]);return A(t,a)},x=e=>e.replace("'",""),U=e=>e.split("/").slice(1).map(x),h=e=>{let t=e.trim().split(/\s+/).map(r=>r.toLowerCase()).join(" ");return i.mnemonicToSeedSync(t)};export{d as a,m as b,y as c,g as d,D as e,E as f,A as g,f as h,U as i,h as j};
2
- //# sourceMappingURL=chunk-LR65XHSF.mjs.map
1
+ import{hmac as c}from"@noble/hashes/hmac";import{sha512 as p}from"@noble/hashes/sha512";import*as i from"@scure/bip39";var d=/^m\/44'\/637'\/[0-9]+'\/[0-9]+'\/[0-9]+'?$/,m=/^m\/44'\/637'\/[0-9]+'\/[0-9]+\/[0-9]+$/,y=(t=>(t.ED25519="ed25519 seed",t))(y||{}),u=2147483648;function D(e){return m.test(e)}function E(e){return d.test(e)}var A=(e,t)=>{let r=c.create(p,e).update(t).digest();return{key:r.slice(0,32),chainCode:r.slice(32)}},f=({key:e,chainCode:t},r)=>{let n=new ArrayBuffer(4);new DataView(n).setUint32(0,r);let o=new Uint8Array(n),s=new Uint8Array([0]),a=new Uint8Array([...s,...e,...o]);return A(t,a)},x=e=>e.replace(/'/g,""),U=e=>e.split("/").slice(1).map(x),h=e=>{let t=e.trim().split(/\s+/).map(r=>r.toLowerCase()).join(" ");return i.mnemonicToSeedSync(t)};export{d as a,m as b,y as c,u as d,D as e,E as f,A as g,f as h,U as i,h as j};
2
+ //# sourceMappingURL=chunk-PHP47DI4.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/core/crypto/hdKey.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { hmac } from \"@noble/hashes/hmac\";\nimport { sha512 } from \"@noble/hashes/sha512\";\nimport * as bip39 from \"@scure/bip39\";\n\n/**\n * Contains the derived cryptographic key as a Uint8Array.\n */\nexport type DerivedKeys = {\n key: Uint8Array;\n chainCode: Uint8Array;\n};\n\n/**\n * Aptos derive path is 637\n */\nexport const APTOS_HARDENED_REGEX = /^m\\/44'\\/637'\\/[0-9]+'\\/[0-9]+'\\/[0-9]+'?$/;\nexport const APTOS_BIP44_REGEX = /^m\\/44'\\/637'\\/[0-9]+'\\/[0-9]+\\/[0-9]+$/;\n\n/**\n * Supported key types and their associated seeds.\n */\nexport enum KeyType {\n ED25519 = \"ed25519 seed\",\n}\n\nexport const HARDENED_OFFSET = 0x80000000;\n\n/**\n * Validate a BIP-44 derivation path string to ensure it meets the required format.\n * This function checks if the provided path adheres to the BIP-44 standard for Secp256k1.\n * Parse and validate a path that is compliant to BIP-44 in form m/44'/637'/{account_index}'/{change_index}/{address_index}\n * for Secp256k1\n *\n * Note that for Secp256k1, the last two components must be non-hardened.\n *\n * @param path - The path string to validate (e.g. `m/44'/637'/0'/0/0`).\n */\nexport function isValidBIP44Path(path: string): boolean {\n return APTOS_BIP44_REGEX.test(path);\n}\n\n/**\n * Aptos derive path is 637\n *\n * Parse and validate a path that is compliant to SLIP-0010 and BIP-44\n * in form m/44'/637'/{account_index}'/{change_index}'/{address_index}'.\n * See SLIP-0010 {@link https://github.com/satoshilabs/slips/blob/master/slip-0044.md}\n * See BIP-44 {@link https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki}\n *\n * Note that for Ed25519, all components must be hardened.\n * This is because non-hardened [PK] derivation would not work due to Ed25519's lack of a key homomorphism.\n * Specifically, you cannot derive the PK associated with derivation path a/b/c given the PK of a/b.\n * This is because the PK in Ed25519 is, more or less, computed as 𝑔𝐻(𝑠𝑘),\n * with the hash function breaking the homomorphism.\n *\n * @param path - The derivation path string to validate (e.g. `m/44'/637'/0'/0'/0'`).\n */\nexport function isValidHardenedPath(path: string): boolean {\n return APTOS_HARDENED_REGEX.test(path);\n}\n\nexport const deriveKey = (hashSeed: Uint8Array | string, data: Uint8Array | string): DerivedKeys => {\n const digest = hmac.create(sha512, hashSeed).update(data).digest();\n return {\n key: digest.slice(0, 32),\n chainCode: digest.slice(32),\n };\n};\n\n/**\n * Derive a child key from the private key\n * @param key\n * @param chainCode\n * @param index\n * @constructor\n */\nexport const CKDPriv = ({ key, chainCode }: DerivedKeys, index: number): DerivedKeys => {\n const buffer = new ArrayBuffer(4);\n new DataView(buffer).setUint32(0, index);\n const indexBytes = new Uint8Array(buffer);\n const zero = new Uint8Array([0]);\n const data = new Uint8Array([...zero, ...key, ...indexBytes]);\n return deriveKey(chainCode, data);\n};\n\nconst removeApostrophes = (val: string): string => val.replace(/'/g, \"\");\n\n/**\n * Splits derive path into segments\n * @param path\n */\nexport const splitPath = (path: string): Array<string> => path.split(\"/\").slice(1).map(removeApostrophes);\n\n/**\n * Normalizes the mnemonic by removing extra whitespace and making it lowercase\n * @param mnemonic the mnemonic seed phrase\n */\nexport const mnemonicToSeed = (mnemonic: string): Uint8Array => {\n const normalizedMnemonic = mnemonic\n .trim()\n .split(/\\s+/)\n .map((part) => part.toLowerCase())\n .join(\" \");\n return bip39.mnemonicToSeedSync(normalizedMnemonic);\n};\n"],"mappings":"AAGA,OAAS,QAAAA,MAAY,qBACrB,OAAS,UAAAC,MAAc,uBACvB,UAAYC,MAAW,eAahB,IAAMC,EAAuB,6CACvBC,EAAoB,0CAKrBC,OACVA,EAAA,QAAU,eADAA,OAAA,IAICC,EAAkB,WAYxB,SAASC,EAAiBC,EAAuB,CACtD,OAAOJ,EAAkB,KAAKI,CAAI,CACpC,CAkBO,SAASC,EAAoBD,EAAuB,CACzD,OAAOL,EAAqB,KAAKK,CAAI,CACvC,CAEO,IAAME,EAAY,CAACC,EAA+BC,IAA2C,CAClG,IAAMC,EAASb,EAAK,OAAOC,EAAQU,CAAQ,EAAE,OAAOC,CAAI,EAAE,OAAO,EACjE,MAAO,CACL,IAAKC,EAAO,MAAM,EAAG,EAAE,EACvB,UAAWA,EAAO,MAAM,EAAE,CAC5B,CACF,EASaC,EAAU,CAAC,CAAE,IAAAC,EAAK,UAAAC,CAAU,EAAgBC,IAA+B,CACtF,IAAMC,EAAS,IAAI,YAAY,CAAC,EAChC,IAAI,SAASA,CAAM,EAAE,UAAU,EAAGD,CAAK,EACvC,IAAME,EAAa,IAAI,WAAWD,CAAM,EAClCE,EAAO,IAAI,WAAW,CAAC,CAAC,CAAC,EACzBR,EAAO,IAAI,WAAW,CAAC,GAAGQ,EAAM,GAAGL,EAAK,GAAGI,CAAU,CAAC,EAC5D,OAAOT,EAAUM,EAAWJ,CAAI,CAClC,EAEMS,EAAqBC,GAAwBA,EAAI,QAAQ,KAAM,EAAE,EAM1DC,EAAaf,GAAgCA,EAAK,MAAM,GAAG,EAAE,MAAM,CAAC,EAAE,IAAIa,CAAiB,EAM3FG,EAAkBC,GAAiC,CAC9D,IAAMC,EAAqBD,EACxB,KAAK,EACL,MAAM,KAAK,EACX,IAAKE,GAASA,EAAK,YAAY,CAAC,EAChC,KAAK,GAAG,EACX,OAAa,qBAAmBD,CAAkB,CACpD","names":["hmac","sha512","bip39","APTOS_HARDENED_REGEX","APTOS_BIP44_REGEX","KeyType","HARDENED_OFFSET","isValidBIP44Path","path","isValidHardenedPath","deriveKey","hashSeed","data","digest","CKDPriv","key","chainCode","index","buffer","indexBytes","zero","removeApostrophes","val","splitPath","mnemonicToSeed","mnemonic","normalizedMnemonic","part"]}
@@ -0,0 +1,2 @@
1
+ import{b as c}from"./chunk-KM6UXNC7.mjs";import{a as o}from"./chunk-QQIVWB6G.mjs";import{b as n}from"./chunk-KFNDDPOW.mjs";import{sha3_256 as d}from"@noble/hashes/sha3";var r=class r extends o{constructor(t){super();let{data:e}=t,i=n.fromHexInput(e);if(i.toUint8Array().length!==r.LENGTH)throw new Error(`Authentication Key length should be ${r.LENGTH}`);this.data=i}serialize(t){t.serializeFixedBytes(this.data.toUint8Array())}static deserialize(t){let e=t.deserializeFixedBytes(r.LENGTH);return new r({data:e})}toUint8Array(){return this.data.toUint8Array()}static fromSchemeAndBytes(t){let{scheme:e,input:i}=t,u=n.fromHexInput(i).toUint8Array(),h=new Uint8Array([...u,e]),a=d.create();a.update(h);let y=a.digest();return new r({data:y})}static fromPublicKeyAndScheme(t){let{publicKey:e}=t;return e.authKey()}static fromPublicKey(t){let{publicKey:e}=t;return e.authKey()}derivedAddress(){return new c(this.data.toUint8Array())}};r.LENGTH=32;var s=r;export{s as a};
2
+ //# sourceMappingURL=chunk-PRZ7AIGA.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/core/authenticationKey.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { sha3_256 as sha3Hash } from \"@noble/hashes/sha3\";\nimport { AccountAddress } from \"./accountAddress\";\nimport type { AccountPublicKey } from \"./crypto\";\nimport { Hex } from \"./hex\";\nimport { AuthenticationKeyScheme, HexInput } from \"../types\";\nimport { Serializable, Serializer } from \"../bcs/serializer\";\nimport { Deserializer } from \"../bcs/deserializer\";\n\n/**\n * Represents an authentication key used for account management. Each account stores an authentication key that enables account\n * owners to rotate their private key(s) without changing the address that hosts their account. The authentication key is a\n * SHA3-256 hash of data and is always 32 bytes in length.\n *\n * @see {@link https://aptos.dev/concepts/accounts | Account Basics}\n *\n * Account addresses can be derived from the AuthenticationKey.\n */\nexport class AuthenticationKey extends Serializable {\n /**\n * An authentication key is always a SHA3-256 hash of data, and is always 32 bytes.\n *\n * The data to hash depends on the underlying public key type and the derivation scheme.\n */\n static readonly LENGTH: number = 32;\n\n /**\n * The raw bytes of the authentication key.\n */\n public readonly data: Hex;\n\n /**\n * Creates an instance of the AuthenticationKey using the provided hex input.\n * This ensures that the hex input is valid and conforms to the required length for an Authentication Key.\n *\n * @param args - The arguments for constructing the AuthenticationKey.\n * @param args.data - The hex input data to be used for the Authentication Key.\n * @throws {Error} Throws an error if the length of the provided hex input is not equal to the required Authentication Key\n * length.\n */\n constructor(args: { data: HexInput }) {\n super();\n const { data } = args;\n const hex = Hex.fromHexInput(data);\n if (hex.toUint8Array().length !== AuthenticationKey.LENGTH) {\n throw new Error(`Authentication Key length should be ${AuthenticationKey.LENGTH}`);\n }\n this.data = hex;\n }\n\n /**\n * Serializes the fixed bytes data into a format suitable for transmission or storage.\n *\n * @param serializer - The serializer instance used to perform the serialization.\n */\n serialize(serializer: Serializer): void {\n serializer.serializeFixedBytes(this.data.toUint8Array());\n }\n\n /**\n * Deserialize an AuthenticationKey from the byte buffer in a Deserializer instance.\n * @param deserializer - The deserializer to deserialize the AuthenticationKey from.\n * @returns An instance of AuthenticationKey.\n */\n static deserialize(deserializer: Deserializer): AuthenticationKey {\n const bytes = deserializer.deserializeFixedBytes(AuthenticationKey.LENGTH);\n return new AuthenticationKey({ data: bytes });\n }\n\n /**\n * Convert the internal data representation to a Uint8Array.\n *\n * This function is useful for obtaining a byte representation of the data, which can be utilized for serialization or transmission.\n *\n * @returns Uint8Array representation of the internal data.\n */\n toUint8Array(): Uint8Array {\n return this.data.toUint8Array();\n }\n\n /**\n * Generates an AuthenticationKey from the specified scheme and input bytes.\n * This function is essential for creating a valid authentication key based on a given scheme.\n *\n * @param args - The arguments for generating the AuthenticationKey.\n * @param args.scheme - The authentication key scheme to use.\n * @param args.input - The input data in hexadecimal format to derive the key.\n * @returns An instance of AuthenticationKey containing the generated key data.\n */\n static fromSchemeAndBytes(args: { scheme: AuthenticationKeyScheme; input: HexInput }): AuthenticationKey {\n const { scheme, input } = args;\n const inputBytes = Hex.fromHexInput(input).toUint8Array();\n const hashInput = new Uint8Array([...inputBytes, scheme]);\n const hash = sha3Hash.create();\n hash.update(hashInput);\n const hashDigest = hash.digest();\n return new AuthenticationKey({ data: hashDigest });\n }\n\n /**\n * Derives an AuthenticationKey from the provided public key using a specified derivation scheme.\n *\n * @deprecated Use `fromPublicKey` instead.\n * @param args - The arguments for deriving the authentication key.\n * @param args.publicKey - The public key used for the derivation.\n * @param args.scheme - The scheme to use for deriving the authentication key.\n */\n public static fromPublicKeyAndScheme(args: { publicKey: AccountPublicKey; scheme: AuthenticationKeyScheme }) {\n const { publicKey } = args;\n return publicKey.authKey();\n }\n\n /**\n * Converts a PublicKey to an AuthenticationKey using the derivation scheme inferred from the provided PublicKey instance.\n *\n * @param args - The arguments for the function.\n * @param args.publicKey - The PublicKey to be converted.\n * @returns AuthenticationKey - The derived AuthenticationKey.\n */\n static fromPublicKey(args: { publicKey: AccountPublicKey }): AuthenticationKey {\n const { publicKey } = args;\n return publicKey.authKey();\n }\n\n /**\n * Derives an account address from an AuthenticationKey by translating the AuthenticationKey bytes directly to an AccountAddress.\n *\n * @returns AccountAddress - The derived account address.\n */\n derivedAddress(): AccountAddress {\n return new AccountAddress(this.data.toUint8Array());\n }\n}\n"],"mappings":"2HAGA,OAAS,YAAYA,MAAgB,qBAiB9B,IAAMC,EAAN,MAAMA,UAA0BC,CAAa,CAsBlD,YAAYC,EAA0B,CACpC,MAAM,EACN,GAAM,CAAE,KAAAC,CAAK,EAAID,EACXE,EAAMC,EAAI,aAAaF,CAAI,EACjC,GAAIC,EAAI,aAAa,EAAE,SAAWJ,EAAkB,OAClD,MAAM,IAAI,MAAM,uCAAuCA,EAAkB,MAAM,EAAE,EAEnF,KAAK,KAAOI,CACd,CAOA,UAAUE,EAA8B,CACtCA,EAAW,oBAAoB,KAAK,KAAK,aAAa,CAAC,CACzD,CAOA,OAAO,YAAYC,EAA+C,CAChE,IAAMC,EAAQD,EAAa,sBAAsBP,EAAkB,MAAM,EACzE,OAAO,IAAIA,EAAkB,CAAE,KAAMQ,CAAM,CAAC,CAC9C,CASA,cAA2B,CACzB,OAAO,KAAK,KAAK,aAAa,CAChC,CAWA,OAAO,mBAAmBN,EAA+E,CACvG,GAAM,CAAE,OAAAO,EAAQ,MAAAC,CAAM,EAAIR,EACpBS,EAAaN,EAAI,aAAaK,CAAK,EAAE,aAAa,EAClDE,EAAY,IAAI,WAAW,CAAC,GAAGD,EAAYF,CAAM,CAAC,EAClDI,EAAOC,EAAS,OAAO,EAC7BD,EAAK,OAAOD,CAAS,EACrB,IAAMG,EAAaF,EAAK,OAAO,EAC/B,OAAO,IAAIb,EAAkB,CAAE,KAAMe,CAAW,CAAC,CACnD,CAUA,OAAc,uBAAuBb,EAAwE,CAC3G,GAAM,CAAE,UAAAc,CAAU,EAAId,EACtB,OAAOc,EAAU,QAAQ,CAC3B,CASA,OAAO,cAAcd,EAA0D,CAC7E,GAAM,CAAE,UAAAc,CAAU,EAAId,EACtB,OAAOc,EAAU,QAAQ,CAC3B,CAOA,gBAAiC,CAC/B,OAAO,IAAIC,EAAe,KAAK,KAAK,aAAa,CAAC,CACpD,CACF,EAlHajB,EAMK,OAAiB,GAN5B,IAAMkB,EAANlB","names":["sha3Hash","_AuthenticationKey","Serializable","args","data","hex","Hex","serializer","deserializer","bytes","scheme","input","inputBytes","hashInput","hash","sha3Hash","hashDigest","publicKey","AccountAddress","AuthenticationKey"]}
@@ -1,2 +1,2 @@
1
- import{a as c}from"./chunk-WWZ3METZ.mjs";import{c as p}from"./chunk-PKXEB7XP.mjs";import{c as o}from"./chunk-GFGX3QDP.mjs";import{n as u,q as g,r as A}from"./chunk-VHNX2NUR.mjs";import{f as a,i as r}from"./chunk-QDIKOQRK.mjs";async function G(t){let{aptosConfig:s,options:e}=t,n={query:A,variables:{where_condition:e?.where,limit:e?.limit,offset:e?.offset}};return(await o({aptosConfig:s,query:n,originMethod:"getFungibleAssetMetadata"})).fungible_asset_metadata}async function h(t){let{aptosConfig:s,options:e}=t,n={query:g,variables:{where_condition:e?.where,limit:e?.limit,offset:e?.offset}};return(await o({aptosConfig:s,query:n,originMethod:"getFungibleAssetActivities"})).fungible_asset_activities}async function M(t){let{aptosConfig:s,options:e}=t,n={query:u,variables:{where_condition:e?.where,limit:e?.limit,offset:e?.offset}};return(await o({aptosConfig:s,query:n,originMethod:"getCurrentFungibleAssetBalances"})).current_fungible_asset_balances}var b={typeParameters:[{constraints:[]}],parameters:[p("0x1::object::Object"),new r,new a]};async function x(t){let{aptosConfig:s,sender:e,fungibleAssetMetadataAddress:n,recipient:i,amount:l,options:f}=t;return c({aptosConfig:s,sender:e.accountAddress,data:{function:"0x1::primary_fungible_store::transfer",typeArguments:["0x1::fungible_asset::Metadata"],functionArguments:[n,i,l],abi:b},options:f})}export{G as a,h as b,M as c,x as d};
2
- //# sourceMappingURL=chunk-OY2IX7HW.mjs.map
1
+ import{a as c}from"./chunk-2I56E4T2.mjs";import{c as p}from"./chunk-KRVLR3L4.mjs";import{f as a,i as r}from"./chunk-OTY3NO7Q.mjs";import{c as o}from"./chunk-HDTKBFRX.mjs";import{n as u,q as g,r as A}from"./chunk-VHNX2NUR.mjs";async function G(t){let{aptosConfig:s,options:e}=t,n={query:A,variables:{where_condition:e?.where,limit:e?.limit,offset:e?.offset}};return(await o({aptosConfig:s,query:n,originMethod:"getFungibleAssetMetadata"})).fungible_asset_metadata}async function h(t){let{aptosConfig:s,options:e}=t,n={query:g,variables:{where_condition:e?.where,limit:e?.limit,offset:e?.offset}};return(await o({aptosConfig:s,query:n,originMethod:"getFungibleAssetActivities"})).fungible_asset_activities}async function M(t){let{aptosConfig:s,options:e}=t,n={query:u,variables:{where_condition:e?.where,limit:e?.limit,offset:e?.offset}};return(await o({aptosConfig:s,query:n,originMethod:"getCurrentFungibleAssetBalances"})).current_fungible_asset_balances}var b={typeParameters:[{constraints:[]}],parameters:[p("0x1::object::Object"),new r,new a]};async function x(t){let{aptosConfig:s,sender:e,fungibleAssetMetadataAddress:n,recipient:i,amount:l,options:f}=t;return c({aptosConfig:s,sender:e.accountAddress,data:{function:"0x1::primary_fungible_store::transfer",typeArguments:["0x1::fungible_asset::Metadata"],functionArguments:[n,i,l],abi:b},options:f})}export{G as a,h as b,M as c,x as d};
2
+ //# sourceMappingURL=chunk-QBP4XJT5.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/internal/fungibleAsset.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * This file contains the underlying implementations for exposed API surface in\n * the {@link api/fungible_asset}. By moving the methods out into a separate file,\n * other namespaces and processes can access these methods without depending on the entire\n * fungible_asset namespace and without having a dependency cycle error.\n */\n\nimport { AptosConfig } from \"../api/aptosConfig\";\nimport {\n AnyNumber,\n GetCurrentFungibleAssetBalancesResponse,\n GetFungibleAssetActivitiesResponse,\n GetFungibleAssetMetadataResponse,\n PaginationArgs,\n WhereArg,\n} from \"../types\";\nimport { queryIndexer } from \"./general\";\nimport {\n GetCurrentFungibleAssetBalances,\n GetFungibleAssetActivities,\n GetFungibleAssetMetadata,\n} from \"../types/generated/queries\";\nimport {\n GetCurrentFungibleAssetBalancesQuery,\n GetFungibleAssetActivitiesQuery,\n GetFungibleAssetMetadataQuery,\n} from \"../types/generated/operations\";\nimport {\n CurrentFungibleAssetBalancesBoolExp,\n FungibleAssetActivitiesBoolExp,\n FungibleAssetMetadataBoolExp,\n} from \"../types/generated/types\";\nimport { AccountAddressInput } from \"../core\";\nimport { Account } from \"../account\";\nimport {\n EntryFunctionABI,\n InputGenerateTransactionOptions,\n parseTypeTag,\n TypeTagAddress,\n TypeTagU64,\n} from \"../transactions\";\nimport { generateTransaction } from \"./transactionSubmission\";\nimport { SimpleTransaction } from \"../transactions/instances/simpleTransaction\";\n\n/**\n * Retrieves metadata for fungible assets based on specified criteria.\n * This function allows you to filter and paginate through fungible asset metadata.\n *\n * @param args - The arguments for the function.\n * @param args.aptosConfig - The configuration for Aptos.\n * @param [args.options] - Optional parameters for pagination and filtering.\n * @param [args.options.limit] - The maximum number of results to return.\n * @param [args.options.offset] - The number of results to skip before starting to collect the result set.\n * @param [args.options.where] - Conditions to filter the results.\n */\nexport async function getFungibleAssetMetadata(args: {\n aptosConfig: AptosConfig;\n options?: PaginationArgs & WhereArg<FungibleAssetMetadataBoolExp>;\n}): Promise<GetFungibleAssetMetadataResponse> {\n const { aptosConfig, options } = args;\n\n const graphqlQuery = {\n query: GetFungibleAssetMetadata,\n variables: {\n where_condition: options?.where,\n limit: options?.limit,\n offset: options?.offset,\n },\n };\n\n const data = await queryIndexer<GetFungibleAssetMetadataQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getFungibleAssetMetadata\",\n });\n\n return data.fungible_asset_metadata;\n}\n\n/**\n * Retrieves the activities associated with fungible assets.\n * This function allows you to filter and paginate through the activities based on specified conditions.\n *\n * @param args - The arguments for retrieving fungible asset activities.\n * @param args.aptosConfig - The configuration settings for Aptos.\n * @param [args.options] - Optional parameters for pagination and filtering.\n * @param [args.options.limit] - The maximum number of activities to retrieve.\n * @param [args.options.offset] - The number of activities to skip before starting to collect the result set.\n * @param [args.options.where] - Conditions to filter the activities.\n * @returns A promise that resolves to an array of fungible asset activities.\n */\nexport async function getFungibleAssetActivities(args: {\n aptosConfig: AptosConfig;\n options?: PaginationArgs & WhereArg<FungibleAssetActivitiesBoolExp>;\n}): Promise<GetFungibleAssetActivitiesResponse> {\n const { aptosConfig, options } = args;\n\n const graphqlQuery = {\n query: GetFungibleAssetActivities,\n variables: {\n where_condition: options?.where,\n limit: options?.limit,\n offset: options?.offset,\n },\n };\n\n const data = await queryIndexer<GetFungibleAssetActivitiesQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getFungibleAssetActivities\",\n });\n\n return data.fungible_asset_activities;\n}\n\n/**\n * Retrieves the current balances of fungible assets for a specified configuration.\n *\n * @param args - The arguments for retrieving fungible asset balances.\n * @param args.aptosConfig - The configuration settings for Aptos.\n * @param args.options - Optional parameters for pagination and filtering.\n * @param args.options.limit - The maximum number of results to return.\n * @param args.options.offset - The number of results to skip before starting to collect the results.\n * @param args.options.where - Conditions to filter the results based on specific criteria.\n * @returns The current balances of fungible assets.\n */\nexport async function getCurrentFungibleAssetBalances(args: {\n aptosConfig: AptosConfig;\n options?: PaginationArgs & WhereArg<CurrentFungibleAssetBalancesBoolExp>;\n}): Promise<GetCurrentFungibleAssetBalancesResponse> {\n const { aptosConfig, options } = args;\n\n const graphqlQuery = {\n query: GetCurrentFungibleAssetBalances,\n variables: {\n where_condition: options?.where,\n limit: options?.limit,\n offset: options?.offset,\n },\n };\n\n const data = await queryIndexer<GetCurrentFungibleAssetBalancesQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getCurrentFungibleAssetBalances\",\n });\n\n return data.current_fungible_asset_balances;\n}\n\nconst faTransferAbi: EntryFunctionABI = {\n typeParameters: [{ constraints: [] }],\n parameters: [parseTypeTag(\"0x1::object::Object\"), new TypeTagAddress(), new TypeTagU64()],\n};\n\n/**\n * Transfers a specified amount of a fungible asset from the sender to the recipient.\n * This function helps facilitate the transfer of digital assets between accounts on the Aptos blockchain.\n *\n * @param args - The parameters for the transfer operation.\n * @param args.aptosConfig - The configuration settings for the Aptos network.\n * @param args.sender - The account initiating the transfer.\n * @param args.fungibleAssetMetadataAddress - The address of the fungible asset's metadata.\n * @param args.recipient - The address of the account receiving the asset.\n * @param args.amount - The amount of the fungible asset to transfer.\n * @param args.options - Optional settings for generating the transaction.\n */\nexport async function transferFungibleAsset(args: {\n aptosConfig: AptosConfig;\n sender: Account;\n fungibleAssetMetadataAddress: AccountAddressInput;\n recipient: AccountAddressInput;\n amount: AnyNumber;\n options?: InputGenerateTransactionOptions;\n}): Promise<SimpleTransaction> {\n const { aptosConfig, sender, fungibleAssetMetadataAddress, recipient, amount, options } = args;\n return generateTransaction({\n aptosConfig,\n sender: sender.accountAddress,\n data: {\n function: \"0x1::primary_fungible_store::transfer\",\n typeArguments: [\"0x1::fungible_asset::Metadata\"],\n functionArguments: [fungibleAssetMetadataAddress, recipient, amount],\n abi: faTransferAbi,\n },\n options,\n });\n}\n"],"mappings":"kOA0DA,eAAsBA,EAAyBC,EAGD,CAC5C,GAAM,CAAE,YAAAC,EAAa,QAAAC,CAAQ,EAAIF,EAE3BG,EAAe,CACnB,MAAOC,EACP,UAAW,CACT,gBAAiBF,GAAS,MAC1B,MAAOA,GAAS,MAChB,OAAQA,GAAS,MACnB,CACF,EAQA,OANa,MAAMG,EAA4C,CAC7D,YAAAJ,EACA,MAAOE,EACP,aAAc,0BAChB,CAAC,GAEW,uBACd,CAcA,eAAsBG,EAA2BN,EAGD,CAC9C,GAAM,CAAE,YAAAC,EAAa,QAAAC,CAAQ,EAAIF,EAE3BG,EAAe,CACnB,MAAOI,EACP,UAAW,CACT,gBAAiBL,GAAS,MAC1B,MAAOA,GAAS,MAChB,OAAQA,GAAS,MACnB,CACF,EAQA,OANa,MAAMG,EAA8C,CAC/D,YAAAJ,EACA,MAAOE,EACP,aAAc,4BAChB,CAAC,GAEW,yBACd,CAaA,eAAsBK,EAAgCR,EAGD,CACnD,GAAM,CAAE,YAAAC,EAAa,QAAAC,CAAQ,EAAIF,EAE3BG,EAAe,CACnB,MAAOM,EACP,UAAW,CACT,gBAAiBP,GAAS,MAC1B,MAAOA,GAAS,MAChB,OAAQA,GAAS,MACnB,CACF,EAQA,OANa,MAAMG,EAAmD,CACpE,YAAAJ,EACA,MAAOE,EACP,aAAc,iCAChB,CAAC,GAEW,+BACd,CAEA,IAAMO,EAAkC,CACtC,eAAgB,CAAC,CAAE,YAAa,CAAC,CAAE,CAAC,EACpC,WAAY,CAACC,EAAa,qBAAqB,EAAG,IAAIC,EAAkB,IAAIC,CAAY,CAC1F,EAcA,eAAsBC,EAAsBd,EAOb,CAC7B,GAAM,CAAE,YAAAC,EAAa,OAAAc,EAAQ,6BAAAC,EAA8B,UAAAC,EAAW,OAAAC,EAAQ,QAAAhB,CAAQ,EAAIF,EAC1F,OAAOmB,EAAoB,CACzB,YAAAlB,EACA,OAAQc,EAAO,eACf,KAAM,CACJ,SAAU,wCACV,cAAe,CAAC,+BAA+B,EAC/C,kBAAmB,CAACC,EAA8BC,EAAWC,CAAM,EACnE,IAAKR,CACP,EACA,QAAAR,CACF,CAAC,CACH","names":["getFungibleAssetMetadata","args","aptosConfig","options","graphqlQuery","GetFungibleAssetMetadata","queryIndexer","getFungibleAssetActivities","GetFungibleAssetActivities","getCurrentFungibleAssetBalances","GetCurrentFungibleAssetBalances","faTransferAbi","parseTypeTag","TypeTagAddress","TypeTagU64","transferFungibleAsset","sender","fungibleAssetMetadataAddress","recipient","amount","generateTransaction"]}
@@ -1,2 +1,2 @@
1
- import{a as r}from"./chunk-WWZ3METZ.mjs";import{f as t,i as o}from"./chunk-QDIKOQRK.mjs";import{e as n}from"./chunk-EXP5STXZ.mjs";var u={typeParameters:[{constraints:[]}],parameters:[new o,new t]};async function y(e){let{aptosConfig:i,sender:s,recipient:c,amount:p,coinType:a,options:m}=e;return r({aptosConfig:i,sender:s,data:{function:"0x1::aptos_account::transfer_coins",typeArguments:[a??n],functionArguments:[c,p],abi:u},options:m})}export{y as a};
2
- //# sourceMappingURL=chunk-ZGO2SK6F.mjs.map
1
+ import{a as r}from"./chunk-2I56E4T2.mjs";import{f as t,i as o}from"./chunk-OTY3NO7Q.mjs";import{e as n}from"./chunk-J245N3XF.mjs";var u={typeParameters:[{constraints:[]}],parameters:[new o,new t]};async function y(e){let{aptosConfig:i,sender:s,recipient:c,amount:p,coinType:a,options:m}=e;return r({aptosConfig:i,sender:s,data:{function:"0x1::aptos_account::transfer_coins",typeArguments:[a??n],functionArguments:[c,p],abi:u},options:m})}export{y as a};
2
+ //# sourceMappingURL=chunk-QBWGWHJK.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/internal/coin.ts"],"sourcesContent":["import { AptosConfig } from \"../api/aptosConfig\";\nimport { AccountAddressInput } from \"../core\";\nimport { EntryFunctionABI, InputGenerateTransactionOptions } from \"../transactions/types\";\nimport { AnyNumber, MoveStructId } from \"../types\";\nimport { APTOS_COIN } from \"../utils/const\";\nimport { generateTransaction } from \"./transactionSubmission\";\nimport { TypeTagAddress, TypeTagU64 } from \"../transactions\";\nimport { SimpleTransaction } from \"../transactions/instances/simpleTransaction\";\n\nconst coinTransferAbi: EntryFunctionABI = {\n typeParameters: [{ constraints: [] }],\n parameters: [new TypeTagAddress(), new TypeTagU64()],\n};\n\n/**\n * Generates a transaction to transfer coins from one account to another.\n * This function allows you to specify the sender, recipient, amount, and coin type for the transaction.\n *\n * @param args - The parameters for the transaction.\n * @param args.aptosConfig - The Aptos configuration object.\n * @param args.sender - The address of the account sending the coins.\n * @param args.recipient - The address of the account receiving the coins.\n * @param args.amount - The amount of coins to transfer.\n * @param args.coinType - (Optional) The type of coin to transfer, defaults to Aptos Coin if not specified.\n * @param args.options - (Optional) Options for generating the transaction.\n */\nexport async function transferCoinTransaction(args: {\n aptosConfig: AptosConfig;\n sender: AccountAddressInput;\n recipient: AccountAddressInput;\n amount: AnyNumber;\n coinType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n}): Promise<SimpleTransaction> {\n const { aptosConfig, sender, recipient, amount, coinType, options } = args;\n const coinStructType = coinType ?? APTOS_COIN;\n return generateTransaction({\n aptosConfig,\n sender,\n data: {\n function: \"0x1::aptos_account::transfer_coins\",\n typeArguments: [coinStructType],\n functionArguments: [recipient, amount],\n abi: coinTransferAbi,\n },\n options,\n });\n}\n"],"mappings":"kIASA,IAAMA,EAAoC,CACxC,eAAgB,CAAC,CAAE,YAAa,CAAC,CAAE,CAAC,EACpC,WAAY,CAAC,IAAIC,EAAkB,IAAIC,CAAY,CACrD,EAcA,eAAsBC,EAAwBC,EAOf,CAC7B,GAAM,CAAE,YAAAC,EAAa,OAAAC,EAAQ,UAAAC,EAAW,OAAAC,EAAQ,SAAAC,EAAU,QAAAC,CAAQ,EAAIN,EAEtE,OAAOO,EAAoB,CACzB,YAAAN,EACA,OAAAC,EACA,KAAM,CACJ,SAAU,qCACV,cAAe,CANIG,GAAYG,CAMD,EAC9B,kBAAmB,CAACL,EAAWC,CAAM,EACrC,IAAKR,CACP,EACA,QAAAU,CACF,CAAC,CACH","names":["coinTransferAbi","TypeTagAddress","TypeTagU64","transferCoinTransaction","args","aptosConfig","sender","recipient","amount","coinType","options","generateTransaction","APTOS_COIN"]}
@@ -0,0 +1,2 @@
1
+ import{b as y}from"./chunk-KFNDDPOW.mjs";import{a as U,b,c as f,d as h,e as u,f as c}from"./chunk-56CNRT2K.mjs";import{a as s}from"./chunk-KDMSOCZY.mjs";var B=class{bcsToBytes(){let e=new n;return this.serialize(e),e.toUint8Array()}bcsToHex(){let e=this.bcsToBytes();return y.fromHexInput(e)}toStringWithoutPrefix(){return this.bcsToHex().toStringWithoutPrefix()}toString(){return`0x${this.toStringWithoutPrefix()}`}},n=class{constructor(e=64){if(e<=0)throw new Error("Length needs to be greater than 0");this.buffer=new ArrayBuffer(e),this.offset=0}ensureBufferWillHandleSize(e){for(;this.buffer.byteLength<this.offset+e;){let t=new ArrayBuffer(this.buffer.byteLength*2);new Uint8Array(t).set(new Uint8Array(this.buffer)),this.buffer=t}}appendToBuffer(e){this.ensureBufferWillHandleSize(e.length),new Uint8Array(this.buffer,this.offset).set(e),this.offset+=e.length}serializeWithFunction(e,t,i){this.ensureBufferWillHandleSize(t);let a=new DataView(this.buffer,this.offset);e.apply(a,[0,i,!0]),this.offset+=t}serializeStr(e){let t=new TextEncoder;this.serializeBytes(t.encode(e))}serializeBytes(e){this.serializeU32AsUleb128(e.length),this.appendToBuffer(e)}serializeFixedBytes(e){this.appendToBuffer(e)}serializeBool(e){p(e);let t=e?1:0;this.appendToBuffer(new Uint8Array([t]))}serializeU8(e){this.appendToBuffer(new Uint8Array([e]))}serializeU16(e){this.serializeWithFunction(DataView.prototype.setUint16,2,e)}serializeU32(e){this.serializeWithFunction(DataView.prototype.setUint32,4,e)}serializeU64(e){let t=BigInt(e)&BigInt(f),i=BigInt(e)>>BigInt(32);this.serializeU32(Number(t)),this.serializeU32(Number(i))}serializeU128(e){let t=BigInt(e)&h,i=BigInt(e)>>BigInt(64);this.serializeU64(t),this.serializeU64(i)}serializeU256(e){let t=BigInt(e)&u,i=BigInt(e)>>BigInt(128);this.serializeU128(t),this.serializeU128(i)}serializeU32AsUleb128(e){let t=e,i=[];for(;t>>>7;)i.push(t&127|128),t>>>=7;i.push(t),this.appendToBuffer(new Uint8Array(i))}toUint8Array(){return new Uint8Array(this.buffer).slice(0,this.offset)}serialize(e){e.serialize(this)}serializeVector(e){this.serializeU32AsUleb128(e.length),e.forEach(t=>{t.serialize(this)})}serializeOption(e){let t=e!==void 0;this.serializeBool(t),t&&e.serialize(this)}serializeOptionStr(e){e===void 0?this.serializeU32AsUleb128(0):(this.serializeU32AsUleb128(1),this.serializeStr(e))}};s([o(0,U)],n.prototype,"serializeU8",1),s([o(0,b)],n.prototype,"serializeU16",1),s([o(0,f)],n.prototype,"serializeU32",1),s([o(BigInt(0),h)],n.prototype,"serializeU64",1),s([o(BigInt(0),u)],n.prototype,"serializeU128",1),s([o(BigInt(0),c)],n.prototype,"serializeU256",1),s([o(0,f)],n.prototype,"serializeU32AsUleb128",1);function p(r){if(typeof r!="boolean")throw new Error(`${r} is not a boolean value`)}var A=(r,e,t)=>`${r} is out of range: [${e}, ${t}]`;function z(r,e,t){let i=BigInt(r);if(i>BigInt(t)||i<BigInt(e))throw new Error(A(r,e,t))}function o(r,e){return(t,i,a)=>{let g=a.value;return a.value=function(l){return z(l,r,e),g.apply(this,[l])},a}}export{B as a,n as b,p as c,A as d,z as e};
2
+ //# sourceMappingURL=chunk-QQIVWB6G.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/bcs/serializer.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/* eslint-disable no-bitwise */\nimport {\n MAX_U128_BIG_INT,\n MAX_U16_NUMBER,\n MAX_U32_NUMBER,\n MAX_U64_BIG_INT,\n MAX_U8_NUMBER,\n MAX_U256_BIG_INT,\n} from \"./consts\";\nimport { Hex } from \"../core/hex\";\nimport { AnyNumber, Uint16, Uint32, Uint8 } from \"../types\";\n\n/**\n * This class serves as a base class for all serializable types. It facilitates\n * composable serialization of complex types and enables the serialization of\n * instances to their BCS (Binary Canonical Serialization) representation.\n */\nexport abstract class Serializable {\n abstract serialize(serializer: Serializer): void;\n\n /**\n * Serializes a `Serializable` value to its BCS representation.\n * This function is the TypeScript SDK equivalent of `bcs::to_bytes` in Move.\n * @returns the BCS representation of the Serializable instance as a byte buffer.\n */\n bcsToBytes(): Uint8Array {\n const serializer = new Serializer();\n this.serialize(serializer);\n return serializer.toUint8Array();\n }\n\n /**\n * Converts the BCS-serialized bytes of a value into a Hex instance.\n * This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.\n * @returns A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.\n */\n bcsToHex(): Hex {\n const bcsBytes = this.bcsToBytes();\n return Hex.fromHexInput(bcsBytes);\n }\n\n /**\n * Returns the hex string representation of the `Serializable` value without the 0x prefix.\n * @returns the hex format as a string without `0x` prefix.\n */\n toStringWithoutPrefix(): string {\n return this.bcsToHex().toStringWithoutPrefix();\n }\n\n /**\n * Returns the hex string representation of the `Serializable` value with the 0x prefix.\n * @returns the hex formatas a string prefixed by `0x`.\n */\n toString(): string {\n return `0x${this.toStringWithoutPrefix()}`;\n }\n}\n\n/**\n * A class for serializing various data types into a binary format.\n * It provides methods to serialize strings, bytes, numbers, and other serializable objects\n * using the Binary Coded Serialization (BCS) layout. The serialized data can be retrieved as a\n * Uint8Array.\n */\nexport class Serializer {\n private buffer: ArrayBuffer;\n\n private offset: number;\n\n /**\n * Constructs a serializer with a buffer of size `length` bytes, 64 bytes by default.\n * The `length` must be greater than 0.\n *\n * @param length - The size of the buffer in bytes.\n */\n constructor(length: number = 64) {\n if (length <= 0) {\n throw new Error(\"Length needs to be greater than 0\");\n }\n this.buffer = new ArrayBuffer(length);\n this.offset = 0;\n }\n\n /**\n * Ensures that the internal buffer can accommodate the specified number of bytes.\n * This function dynamically resizes the buffer if the current size is insufficient.\n *\n * @param bytes - The number of bytes to ensure the buffer can handle.\n */\n private ensureBufferWillHandleSize(bytes: number) {\n while (this.buffer.byteLength < this.offset + bytes) {\n const newBuffer = new ArrayBuffer(this.buffer.byteLength * 2);\n new Uint8Array(newBuffer).set(new Uint8Array(this.buffer));\n this.buffer = newBuffer;\n }\n }\n\n /**\n * Appends the specified values to the buffer, ensuring that the buffer can accommodate the new data.\n *\n * @param {Uint8Array} values - The values to be appended to the buffer.\n */\n protected appendToBuffer(values: Uint8Array) {\n this.ensureBufferWillHandleSize(values.length);\n new Uint8Array(this.buffer, this.offset).set(values);\n this.offset += values.length;\n }\n\n /**\n * Serializes a value into the buffer using the provided function, ensuring the buffer can accommodate the size.\n *\n * @param fn - The function to serialize the value, which takes a byte offset, the value to serialize, and an optional little-endian flag.\n * @param fn.byteOffset - The byte offset at which to write the value.\n * @param fn.value - The numeric value to serialize into the buffer.\n * @param fn.littleEndian - Optional flag indicating whether to use little-endian byte order (defaults to true).\n */\n // TODO: JSDoc bytesLength and value\n private serializeWithFunction(\n fn: (byteOffset: number, value: number, littleEndian?: boolean) => void,\n bytesLength: number,\n value: number,\n ) {\n this.ensureBufferWillHandleSize(bytesLength);\n const dv = new DataView(this.buffer, this.offset);\n fn.apply(dv, [0, value, true]);\n this.offset += bytesLength;\n }\n\n /**\n * Serializes a string. UTF8 string is supported.\n * The number of bytes in the string content is serialized first, as a uleb128-encoded u32 integer.\n * Then the string content is serialized as UTF8 encoded bytes.\n *\n * BCS layout for \"string\": string_length | string_content\n * where string_length is a u32 integer encoded as a uleb128 integer, equal to the number of bytes in string_content.\n *\n * @param value - The string to serialize.\n *\n * @example\n * ```typescript\n * const serializer = new Serializer();\n * serializer.serializeStr(\"1234abcd\");\n * assert(serializer.toUint8Array() === new Uint8Array([8, 49, 50, 51, 52, 97, 98, 99, 100]));\n * ```\n */\n serializeStr(value: string) {\n const textEncoder = new TextEncoder();\n this.serializeBytes(textEncoder.encode(value));\n }\n\n /**\n * Serializes an array of bytes.\n *\n * This function encodes the length of the byte array as a u32 integer in uleb128 format, followed by the byte array itself.\n * BCS layout for \"bytes\": bytes_length | bytes\n * where bytes_length is a u32 integer encoded as a uleb128 integer, equal to the length of the bytes array.\n * @param value - The byte array to serialize.\n */\n serializeBytes(value: Uint8Array) {\n this.serializeU32AsUleb128(value.length);\n this.appendToBuffer(value);\n }\n\n /**\n * Serializes an array of bytes with a known length, allowing for efficient deserialization without needing to serialize the\n * length itself.\n * When deserializing, the number of bytes to deserialize needs to be passed in.\n\n * @param value - The Uint8Array to be serialized.\n */\n serializeFixedBytes(value: Uint8Array) {\n this.appendToBuffer(value);\n }\n\n /**\n * Serializes a boolean value into a byte representation.\n *\n * The BCS layout for a boolean uses one byte, where \"0x01\" represents true and \"0x00\" represents false.\n *\n * @param value - The boolean value to serialize.\n */\n serializeBool(value: boolean) {\n /**\n * Ensures that the provided value is a boolean.\n * This function throws an error if the value is not a boolean, helping to enforce type safety in your code.\n *\n * @param value - The value to be checked for boolean type.\n * @throws {Error} Throws an error if the value is not a boolean.\n */\n ensureBoolean(value);\n const byteValue = value ? 1 : 0;\n this.appendToBuffer(new Uint8Array([byteValue]));\n }\n\n /**\n * Serializes a Uint8 value and appends it to the buffer.\n * BCS layout for \"uint8\": One byte. Binary format in little-endian representation.\n *\n * @param value - The Uint8 value to serialize.\n */\n @checkNumberRange(0, MAX_U8_NUMBER)\n serializeU8(value: Uint8) {\n this.appendToBuffer(new Uint8Array([value]));\n }\n\n /**\n * Serializes a uint16 number.\n *\n\n */\n\n /**\n * Serializes a 16-bit unsigned integer value into a binary format.\n * BCS layout for \"uint16\": Two bytes. Binary format in little-endian representation.\n *\n * @param value - The 16-bit unsigned integer value to serialize.\n * @example\n * ```typescript\n * const serializer = new Serializer();\n * serializer.serializeU16(4660);\n * assert(serializer.toUint8Array() === new Uint8Array([0x34, 0x12]));\n * ```\n */\n @checkNumberRange(0, MAX_U16_NUMBER)\n serializeU16(value: Uint16) {\n this.serializeWithFunction(DataView.prototype.setUint16, 2, value);\n }\n\n /**\n * Serializes a 32-bit unsigned integer value into a binary format.\n * This function is useful for encoding data that needs to be stored or transmitted in a compact form.\n * @example\n * ```typescript\n * const serializer = new Serializer();\n * serializer.serializeU32(305419896);\n * assert(serializer.toUint8Array() === new Uint8Array([0x78, 0x56, 0x34, 0x12]));\n * ```\n * @param value - The 32-bit unsigned integer value to serialize.\n */\n @checkNumberRange(0, MAX_U32_NUMBER)\n serializeU32(value: Uint32) {\n this.serializeWithFunction(DataView.prototype.setUint32, 4, value);\n }\n\n /**\n * Serializes a 64-bit unsigned integer into a format suitable for storage or transmission.\n * This function breaks down the value into two 32-bit components and writes them in little-endian order.\n *\n * @param value - The 64-bit unsigned integer to serialize, represented as a number.\n * @example\n * ```ts\n * const serializer = new Serializer();\n * serializer.serializeU64(1311768467750121216);\n * assert(serializer.toUint8Array() === new Uint8Array([0x00, 0xEF, 0xCD, 0xAB, 0x78, 0x56, 0x34, 0x12]));\n * ```\n */\n @checkNumberRange(BigInt(0), MAX_U64_BIG_INT)\n serializeU64(value: AnyNumber) {\n const low = BigInt(value) & BigInt(MAX_U32_NUMBER);\n const high = BigInt(value) >> BigInt(32);\n\n // write little endian number\n this.serializeU32(Number(low));\n this.serializeU32(Number(high));\n }\n\n /**\n * Serializes a U128 value into a format suitable for storage or transmission.\n *\n * @param value - The U128 value to serialize, represented as a number.\n */\n @checkNumberRange(BigInt(0), MAX_U128_BIG_INT)\n serializeU128(value: AnyNumber) {\n const low = BigInt(value) & MAX_U64_BIG_INT;\n const high = BigInt(value) >> BigInt(64);\n\n // write little endian number\n this.serializeU64(low);\n this.serializeU64(high);\n }\n\n /**\n * Serializes a U256 value into a byte representation.\n * This function is essential for encoding large numbers in a compact format suitable for transmission or storage.\n *\n * @param value - The U256 value to serialize, represented as an AnyNumber.\n */\n @checkNumberRange(BigInt(0), MAX_U256_BIG_INT)\n serializeU256(value: AnyNumber) {\n const low = BigInt(value) & MAX_U128_BIG_INT;\n const high = BigInt(value) >> BigInt(128);\n\n // write little endian number\n this.serializeU128(low);\n this.serializeU128(high);\n }\n\n /**\n * Serializes a 32-bit unsigned integer as a variable-length ULEB128 encoded byte array.\n * BCS uses uleb128 encoding in two cases: (1) lengths of variable-length sequences and (2) tags of enum values\n *\n * @param val - The 32-bit unsigned integer value to be serialized.\n */\n @checkNumberRange(0, MAX_U32_NUMBER)\n serializeU32AsUleb128(val: Uint32) {\n let value = val;\n const valueArray = [];\n while (value >>> 7 !== 0) {\n valueArray.push((value & 0x7f) | 0x80);\n value >>>= 7;\n }\n valueArray.push(value);\n this.appendToBuffer(new Uint8Array(valueArray));\n }\n\n /**\n * Returns the buffered bytes as a Uint8Array.\n *\n * This function allows you to retrieve the byte representation of the buffer up to the current offset.\n *\n * @returns Uint8Array - The byte array representation of the buffer.\n */\n toUint8Array(): Uint8Array {\n return new Uint8Array(this.buffer).slice(0, this.offset);\n }\n\n /**\n * Serializes a `Serializable` value, facilitating composable serialization.\n *\n * @param value The Serializable value to serialize.\n *\n * @returns the serializer instance\n */\n serialize<T extends Serializable>(value: T): void {\n // NOTE: The `serialize` method called by `value` is defined in `value`'s\n // Serializable interface, not the one defined in this class.\n value.serialize(this);\n }\n\n /**\n * Serializes an array of BCS Serializable values to a serializer instance.\n * The bytes are added to the serializer instance's byte buffer.\n *\n * @param values The array of BCS Serializable values\n * @example\n * const addresses = new Array<AccountAddress>(\n * AccountAddress.from(\"0x1\"),\n * AccountAddress.from(\"0x2\"),\n * AccountAddress.from(\"0xa\"),\n * AccountAddress.from(\"0xb\"),\n * );\n * const serializer = new Serializer();\n * serializer.serializeVector(addresses);\n * const serializedBytes = serializer.toUint8Array();\n * // serializedBytes is now the BCS-serialized bytes\n * // The equivalent value in Move would be:\n * // `bcs::to_bytes(&vector<address> [@0x1, @0x2, @0xa, @0xb])`;\n */\n serializeVector<T extends Serializable>(values: Array<T>): void {\n this.serializeU32AsUleb128(values.length);\n values.forEach((item) => {\n item.serialize(this);\n });\n }\n\n /**\n * Serializes a BCS Serializable value into a serializer instance or handles the case when the value is undefined.\n * This function allows you to efficiently add serialized data to the serializer's byte buffer.\n *\n * @param value The BCS Serializable value to serialize, or undefined if there is no value.\n *\n * @example\n * ```typescript\n * const serializer = new Serializer();\n * serializer.serializeOption(new AccountAddress(...));\n * const serializedBytes = serializer.toUint8Array();\n * // serializedBytes is now the BCS-serialized byte representation of AccountAddress\n *\n * const serializer = new Serializer();\n * serializer.serializeOption(undefined);\n * assert(serializer.toUint8Array() === new Uint8Array([0x00]));\n * ```\n */\n serializeOption<T extends Serializable>(value?: T): void {\n const hasValue = value !== undefined;\n this.serializeBool(hasValue);\n if (hasValue) {\n value.serialize(this);\n }\n }\n\n /**\n * Serializes an optional string, supporting UTF8 encoding.\n * The function encodes the existence of the string first, followed by the length and content if it exists.\n *\n * BCS layout for optional \"string\": 1 | string_length | string_content\n * where string_length is a u32 integer encoded as a uleb128 integer, equal to the number of bytes in string_content.\n * BCS layout for undefined: 0\n *\n * @param value - The optional string to serialize. If undefined, it will serialize as 0.\n */\n serializeOptionStr(value?: string): void {\n if (value === undefined) {\n this.serializeU32AsUleb128(0);\n } else {\n this.serializeU32AsUleb128(1);\n this.serializeStr(value);\n }\n }\n}\n\nexport function ensureBoolean(value: unknown): asserts value is boolean {\n if (typeof value !== \"boolean\") {\n throw new Error(`${value} is not a boolean value`);\n }\n}\n\nexport const outOfRangeErrorMessage = (value: AnyNumber, min: AnyNumber, max: AnyNumber) =>\n `${value} is out of range: [${min}, ${max}]`;\n\n/**\n * Validates that a given number is within a specified range.\n * This function throws an error if the value is outside the defined minimum and maximum bounds.\n *\n * @param value - The number to validate.\n * @param minValue - The minimum allowable value (inclusive).\n * @param maxValue - The maximum allowable value (inclusive).\n */\nexport function validateNumberInRange<T extends AnyNumber>(value: T, minValue: T, maxValue: T) {\n const valueBigInt = BigInt(value);\n if (valueBigInt > BigInt(maxValue) || valueBigInt < BigInt(minValue)) {\n throw new Error(outOfRangeErrorMessage(value, minValue, maxValue));\n }\n}\n\n/**\n * A decorator that validates that the input argument for a function is within a specified range.\n * This ensures that the function is only called with valid input values, preventing potential errors.\n *\n * @param minValue - The input argument must be greater than or equal to this value.\n * @param maxValue - The input argument must be less than or equal to this value.\n */\nfunction checkNumberRange<T extends AnyNumber>(minValue: T, maxValue: T) {\n return (target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => {\n const childFunction = descriptor.value;\n // eslint-disable-next-line no-param-reassign\n descriptor.value = function deco(value: AnyNumber) {\n validateNumberInRange(value, minValue, maxValue);\n return childFunction.apply(this, [value]);\n };\n\n return descriptor;\n };\n}\n"],"mappings":"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","names":["Serializable","serializer","Serializer","bcsBytes","Hex","length","bytes","newBuffer","values","fn","bytesLength","value","dv","textEncoder","ensureBoolean","byteValue","low","MAX_U32_NUMBER","high","MAX_U64_BIG_INT","MAX_U128_BIG_INT","val","valueArray","item","hasValue","__decorateClass","checkNumberRange","MAX_U8_NUMBER","MAX_U16_NUMBER","MAX_U256_BIG_INT","outOfRangeErrorMessage","min","max","validateNumberInRange","minValue","maxValue","valueBigInt","target","propertyKey","descriptor","childFunction"]}
@@ -1,2 +1,2 @@
1
- import{a as u}from"./chunk-WWZ3METZ.mjs";import{f as M}from"./chunk-NNRAQP36.mjs";import{c as R}from"./chunk-PKXEB7XP.mjs";import{c as k}from"./chunk-GFGX3QDP.mjs";import{A as V,m as O,y as q,z as G}from"./chunk-VHNX2NUR.mjs";import{b as w,f as h,i as x,l as A,m as f,n as i,q as p,s as y}from"./chunk-QDIKOQRK.mjs";import{b as c}from"./chunk-QPP6BX53.mjs";import{a as _,c as d}from"./chunk-CCMHWJ3Q.mjs";import{a as T,e as D}from"./chunk-6QGVRNV6.mjs";import{d as E}from"./chunk-56CNRT2K.mjs";var C={BOOLEAN:"bool",U8:"u8",U16:"u16",U32:"u32",U64:"u64",U128:"u128",U256:"u256",ADDRESS:"address",STRING:"0x1::string::String",ARRAY:"vector<u8>"},l="0x4::token::Token";async function It(t){let{aptosConfig:o,digitalAssetAddress:n}=t,e={token_data_id:{_eq:c.from(n).toStringLong()}};return(await k({aptosConfig:o,query:{query:V,variables:{where_condition:e}},originMethod:"getDigitalAssetData"})).current_token_datas_v2[0]}async function Pt(t){let{aptosConfig:o,digitalAssetAddress:n}=t,e={token_data_id:{_eq:c.from(n).toStringLong()},amount:{_gt:0}};return(await k({aptosConfig:o,query:{query:G,variables:{where_condition:e}},originMethod:"getCurrentDigitalAssetOwnership"})).current_token_ownerships_v2[0]}async function bt(t){let{aptosConfig:o,ownerAddress:n,options:e}=t,r={owner_address:{_eq:c.from(n).toStringLong()},amount:{_gt:0}},s={query:G,variables:{where_condition:r,offset:e?.offset,limit:e?.limit,order_by:e?.orderBy}};return(await k({aptosConfig:o,query:s,originMethod:"getOwnedDigitalAssets"})).current_token_ownerships_v2}async function St(t){let{aptosConfig:o,digitalAssetAddress:n,options:e}=t,r={token_data_id:{_eq:c.from(n).toStringLong()}},s={query:q,variables:{where_condition:r,offset:e?.offset,limit:e?.limit,order_by:e?.orderBy}};return(await k({aptosConfig:o,query:s,originMethod:"getDigitalAssetActivity"})).token_activities_v2}var F={typeParameters:[],parameters:[new i(p()),new h,new i(p()),new i(p()),new w,new w,new w,new w,new w,new w,new w,new w,new w,new h,new h]};async function Dt(t){let{aptosConfig:o,options:n,creator:e}=t;return u({aptosConfig:o,sender:e.accountAddress,data:{function:"0x4::aptos_token::create_collection",functionArguments:[new d(t.description),new D(t.maxSupply??E),new d(t.name),new d(t.uri),new T(t.mutableDescription??!0),new T(t.mutableRoyalty??!0),new T(t.mutableURI??!0),new T(t.mutableTokenDescription??!0),new T(t.mutableTokenName??!0),new T(t.mutableTokenProperties??!0),new T(t.mutableTokenURI??!0),new T(t.tokensBurnableByCreator??!0),new T(t.tokensFreezableByCreator??!0),new D(t.royaltyNumerator??0),new D(t.royaltyDenominator??1)],abi:F},options:n})}async function v(t){let{aptosConfig:o,options:n}=t,e=n?.where;n?.tokenStandard&&(e.token_standard={_eq:n?.tokenStandard??"v2"});let r={query:O,variables:{where_condition:e,offset:n?.offset,limit:n?.limit}};return(await k({aptosConfig:o,query:r,originMethod:"getCollectionData"})).current_collections_v2[0]}async function ht(t){let{aptosConfig:o,creatorAddress:n,collectionName:e,options:r}=t,s=c.from(n),a={collection_name:{_eq:e},creator_address:{_eq:s.toStringLong()}};return r?.tokenStandard&&(a.token_standard={_eq:r?.tokenStandard??"v2"}),v({aptosConfig:o,options:{...r,where:a}})}async function vt(t){let{aptosConfig:o,creatorAddress:n,options:e}=t,s={creator_address:{_eq:c.from(n).toStringLong()}};return e?.tokenStandard&&(s.token_standard={_eq:e?.tokenStandard??"v2"}),v({aptosConfig:o,options:{...e,where:s}})}async function xt(t){let{aptosConfig:o,collectionId:n,options:e}=t,s={collection_id:{_eq:c.from(n).toStringLong()}};return e?.tokenStandard&&(s.token_standard={_eq:e?.tokenStandard??"v2"}),v({aptosConfig:o,options:{...e,where:s}})}async function Gt(t){let{creatorAddress:o,collectionName:n,options:e,aptosConfig:r}=t,s=c.from(o),a={collection_name:{_eq:n},creator_address:{_eq:s.toStringLong()}};return e?.tokenStandard&&(a.token_standard={_eq:e?.tokenStandard??"v2"}),(await v({aptosConfig:r,options:{where:a}})).collection_id}var N={typeParameters:[],parameters:[new i(p()),new i(p()),new i(p()),new i(p()),new f(new i(p())),new f(new i(p())),new f(f.u8())]};async function Bt(t){let{aptosConfig:o,options:n,creator:e,collection:r,description:s,name:a,uri:m,propertyKeys:g,propertyTypes:P,propertyValues:I}=t,b=P?.map(S=>C[S]);return u({aptosConfig:o,sender:e.accountAddress,data:{function:"0x4::aptos_token::mint",functionArguments:[new d(r),new d(s),new d(a),new d(m),_.MoveString(g??[]),_.MoveString(b??[]),K(I??[],b??[])],abi:N},options:n})}var Q={typeParameters:[{constraints:["key"]}],parameters:[new i(y(new A(0))),new x]};async function Et(t){let{aptosConfig:o,sender:n,digitalAssetAddress:e,recipient:r,digitalAssetType:s,options:a}=t;return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x1::object::transfer",typeArguments:[s??l],functionArguments:[c.from(e),c.from(r)],abi:Q},options:a})}var Y={typeParameters:[],parameters:[new i(p()),new i(p()),new i(p()),new i(p()),new f(new i(p())),new f(new i(p())),new f(f.u8()),new x]};async function Ot(t){let{aptosConfig:o,account:n,collection:e,description:r,name:s,uri:a,recipient:m,propertyKeys:g,propertyTypes:P,propertyValues:I,options:b}=t;if(g?.length!==I?.length)throw new Error("Property keys and property values counts do not match");if(P?.length!==I?.length)throw new Error("Property types and property values counts do not match");let S=P?.map(U=>C[U]);return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::mint_soul_bound",functionArguments:[e,r,s,a,_.MoveString(g??[]),_.MoveString(S??[]),K(I??[],S??[]),m],abi:Y},options:b})}var L={typeParameters:[{constraints:["key"]}],parameters:[new i(y(new A(0)))]};async function qt(t){let{aptosConfig:o,creator:n,digitalAssetAddress:e,digitalAssetType:r,options:s}=t;return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::burn",typeArguments:[r??l],functionArguments:[c.from(e)],abi:L},options:s})}var z={typeParameters:[{constraints:["key"]}],parameters:[new i(y(new A(0)))]};async function Vt(t){let{aptosConfig:o,creator:n,digitalAssetAddress:e,digitalAssetType:r,options:s}=t;return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::freeze_transfer",typeArguments:[r??l],functionArguments:[e],abi:z},options:s})}var j={typeParameters:[{constraints:["key"]}],parameters:[new i(y(new A(0)))]};async function Rt(t){let{aptosConfig:o,creator:n,digitalAssetAddress:e,digitalAssetType:r,options:s}=t;return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::unfreeze_transfer",typeArguments:[r??l],functionArguments:[e],abi:j},options:s})}var W={typeParameters:[{constraints:["key"]}],parameters:[new i(y(new A(0))),new i(p())]};async function Mt(t){let{aptosConfig:o,creator:n,description:e,digitalAssetAddress:r,digitalAssetType:s,options:a}=t;return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::set_description",typeArguments:[s??l],functionArguments:[c.from(r),new d(e)],abi:W},options:a})}var X={typeParameters:[{constraints:["key"]}],parameters:[new i(y(new A(0))),new i(p())]};async function Kt(t){let{aptosConfig:o,creator:n,name:e,digitalAssetAddress:r,digitalAssetType:s,options:a}=t;return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::set_name",typeArguments:[s??l],functionArguments:[c.from(r),new d(e)],abi:X},options:a})}var H={typeParameters:[{constraints:["key"]}],parameters:[new i(y(new A(0))),new i(p())]};async function Ut(t){let{aptosConfig:o,creator:n,uri:e,digitalAssetAddress:r,digitalAssetType:s,options:a}=t;return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::set_uri",typeArguments:[s??l],functionArguments:[c.from(r),new d(e)],abi:H},options:a})}var J={typeParameters:[{constraints:["key"]}],parameters:[new i(y(new A(0))),new i(p()),new i(p()),f.u8()]};async function Ft(t){let{aptosConfig:o,creator:n,propertyKey:e,propertyType:r,propertyValue:s,digitalAssetAddress:a,digitalAssetType:m,options:g}=t;return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::add_property",typeArguments:[m??l],functionArguments:[c.from(a),new d(e),new d(C[r]),_.U8(B(s,C[r]))],abi:J},options:g})}var Z={typeParameters:[{constraints:["key"]}],parameters:[new i(y(new A(0))),new i(p())]};async function Nt(t){let{aptosConfig:o,creator:n,propertyKey:e,digitalAssetAddress:r,digitalAssetType:s,options:a}=t;return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::remove_property",typeArguments:[s??l],functionArguments:[c.from(r),new d(e)],abi:Z},options:a})}var $={typeParameters:[{constraints:["key"]}],parameters:[new i(y(new A(0))),new i(p()),new i(p()),f.u8()]};async function Qt(t){let{aptosConfig:o,creator:n,propertyKey:e,propertyType:r,propertyValue:s,digitalAssetAddress:a,digitalAssetType:m,options:g}=t;return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::update_property",typeArguments:[m??l],functionArguments:[c.from(a),new d(e),new d(C[r]),B(s,C[r])],abi:$},options:g})}var tt={typeParameters:[{constraints:["key"]},{constraints:[]}],parameters:[new i(y(new A(0))),new i(p()),new A(1)]};async function Yt(t){let{aptosConfig:o,creator:n,propertyKey:e,propertyType:r,propertyValue:s,digitalAssetAddress:a,digitalAssetType:m,options:g}=t;return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::add_typed_property",typeArguments:[m??l,C[r]],functionArguments:[c.from(a),new d(e),s],abi:tt},options:g})}var et={typeParameters:[{constraints:["key"]},{constraints:[]}],parameters:[new i(y(new A(0))),new i(p()),new A(1)]};async function Lt(t){let{aptosConfig:o,creator:n,propertyKey:e,propertyType:r,propertyValue:s,digitalAssetAddress:a,digitalAssetType:m,options:g}=t;return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::update_typed_property",typeArguments:[m??l,C[r]],functionArguments:[c.from(a),new d(e),s],abi:et},options:g})}function K(t,o){let n=new Array;return o.forEach((e,r)=>{n.push(B(t[r],e))}),n}function B(t,o){let n=R(o);return M(t,n,0,[]).bcsToBytes()}export{It as a,Pt as b,bt as c,St as d,Dt as e,v as f,ht as g,vt as h,xt as i,Gt as j,Bt as k,Et as l,Ot as m,qt as n,Vt as o,Rt as p,Mt as q,Kt as r,Ut as s,Ft as t,Nt as u,Qt as v,Yt as w,Lt as x};
2
- //# sourceMappingURL=chunk-IYQISVDX.mjs.map
1
+ import{a as u}from"./chunk-2I56E4T2.mjs";import{f as M}from"./chunk-RUDS7RSB.mjs";import{c as R}from"./chunk-KRVLR3L4.mjs";import{b as w,f as h,i as x,l as A,m as f,n as i,q as p,s as y}from"./chunk-OTY3NO7Q.mjs";import{c as k}from"./chunk-HDTKBFRX.mjs";import{A as V,m as O,y as q,z as G}from"./chunk-VHNX2NUR.mjs";import{a as _,c as d}from"./chunk-IECDO22V.mjs";import{a as T,e as D}from"./chunk-6FLHGOKP.mjs";import{b as c}from"./chunk-KM6UXNC7.mjs";import{d as E}from"./chunk-56CNRT2K.mjs";var C={BOOLEAN:"bool",U8:"u8",U16:"u16",U32:"u32",U64:"u64",U128:"u128",U256:"u256",ADDRESS:"address",STRING:"0x1::string::String",ARRAY:"vector<u8>"},l="0x4::token::Token";async function It(t){let{aptosConfig:o,digitalAssetAddress:n}=t,e={token_data_id:{_eq:c.from(n).toStringLong()}};return(await k({aptosConfig:o,query:{query:V,variables:{where_condition:e}},originMethod:"getDigitalAssetData"})).current_token_datas_v2[0]}async function Pt(t){let{aptosConfig:o,digitalAssetAddress:n}=t,e={token_data_id:{_eq:c.from(n).toStringLong()},amount:{_gt:0}};return(await k({aptosConfig:o,query:{query:G,variables:{where_condition:e}},originMethod:"getCurrentDigitalAssetOwnership"})).current_token_ownerships_v2[0]}async function bt(t){let{aptosConfig:o,ownerAddress:n,options:e}=t,r={owner_address:{_eq:c.from(n).toStringLong()},amount:{_gt:0}},s={query:G,variables:{where_condition:r,offset:e?.offset,limit:e?.limit,order_by:e?.orderBy}};return(await k({aptosConfig:o,query:s,originMethod:"getOwnedDigitalAssets"})).current_token_ownerships_v2}async function St(t){let{aptosConfig:o,digitalAssetAddress:n,options:e}=t,r={token_data_id:{_eq:c.from(n).toStringLong()}},s={query:q,variables:{where_condition:r,offset:e?.offset,limit:e?.limit,order_by:e?.orderBy}};return(await k({aptosConfig:o,query:s,originMethod:"getDigitalAssetActivity"})).token_activities_v2}var F={typeParameters:[],parameters:[new i(p()),new h,new i(p()),new i(p()),new w,new w,new w,new w,new w,new w,new w,new w,new w,new h,new h]};async function Dt(t){let{aptosConfig:o,options:n,creator:e}=t;return u({aptosConfig:o,sender:e.accountAddress,data:{function:"0x4::aptos_token::create_collection",functionArguments:[new d(t.description),new D(t.maxSupply??E),new d(t.name),new d(t.uri),new T(t.mutableDescription??!0),new T(t.mutableRoyalty??!0),new T(t.mutableURI??!0),new T(t.mutableTokenDescription??!0),new T(t.mutableTokenName??!0),new T(t.mutableTokenProperties??!0),new T(t.mutableTokenURI??!0),new T(t.tokensBurnableByCreator??!0),new T(t.tokensFreezableByCreator??!0),new D(t.royaltyNumerator??0),new D(t.royaltyDenominator??1)],abi:F},options:n})}async function v(t){let{aptosConfig:o,options:n}=t,e=n?.where;n?.tokenStandard&&(e.token_standard={_eq:n?.tokenStandard??"v2"});let r={query:O,variables:{where_condition:e,offset:n?.offset,limit:n?.limit}};return(await k({aptosConfig:o,query:r,originMethod:"getCollectionData"})).current_collections_v2[0]}async function ht(t){let{aptosConfig:o,creatorAddress:n,collectionName:e,options:r}=t,s=c.from(n),a={collection_name:{_eq:e},creator_address:{_eq:s.toStringLong()}};return r?.tokenStandard&&(a.token_standard={_eq:r?.tokenStandard??"v2"}),v({aptosConfig:o,options:{...r,where:a}})}async function vt(t){let{aptosConfig:o,creatorAddress:n,options:e}=t,s={creator_address:{_eq:c.from(n).toStringLong()}};return e?.tokenStandard&&(s.token_standard={_eq:e?.tokenStandard??"v2"}),v({aptosConfig:o,options:{...e,where:s}})}async function xt(t){let{aptosConfig:o,collectionId:n,options:e}=t,s={collection_id:{_eq:c.from(n).toStringLong()}};return e?.tokenStandard&&(s.token_standard={_eq:e?.tokenStandard??"v2"}),v({aptosConfig:o,options:{...e,where:s}})}async function Gt(t){let{creatorAddress:o,collectionName:n,options:e,aptosConfig:r}=t,s=c.from(o),a={collection_name:{_eq:n},creator_address:{_eq:s.toStringLong()}};return e?.tokenStandard&&(a.token_standard={_eq:e?.tokenStandard??"v2"}),(await v({aptosConfig:r,options:{where:a}})).collection_id}var N={typeParameters:[],parameters:[new i(p()),new i(p()),new i(p()),new i(p()),new f(new i(p())),new f(new i(p())),new f(f.u8())]};async function Bt(t){let{aptosConfig:o,options:n,creator:e,collection:r,description:s,name:a,uri:m,propertyKeys:g,propertyTypes:P,propertyValues:I}=t,b=P?.map(S=>C[S]);return u({aptosConfig:o,sender:e.accountAddress,data:{function:"0x4::aptos_token::mint",functionArguments:[new d(r),new d(s),new d(a),new d(m),_.MoveString(g??[]),_.MoveString(b??[]),K(I??[],b??[])],abi:N},options:n})}var Q={typeParameters:[{constraints:["key"]}],parameters:[new i(y(new A(0))),new x]};async function Et(t){let{aptosConfig:o,sender:n,digitalAssetAddress:e,recipient:r,digitalAssetType:s,options:a}=t;return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x1::object::transfer",typeArguments:[s??l],functionArguments:[c.from(e),c.from(r)],abi:Q},options:a})}var Y={typeParameters:[],parameters:[new i(p()),new i(p()),new i(p()),new i(p()),new f(new i(p())),new f(new i(p())),new f(f.u8()),new x]};async function Ot(t){let{aptosConfig:o,account:n,collection:e,description:r,name:s,uri:a,recipient:m,propertyKeys:g,propertyTypes:P,propertyValues:I,options:b}=t;if(g?.length!==I?.length)throw new Error("Property keys and property values counts do not match");if(P?.length!==I?.length)throw new Error("Property types and property values counts do not match");let S=P?.map(U=>C[U]);return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::mint_soul_bound",functionArguments:[e,r,s,a,_.MoveString(g??[]),_.MoveString(S??[]),K(I??[],S??[]),m],abi:Y},options:b})}var L={typeParameters:[{constraints:["key"]}],parameters:[new i(y(new A(0)))]};async function qt(t){let{aptosConfig:o,creator:n,digitalAssetAddress:e,digitalAssetType:r,options:s}=t;return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::burn",typeArguments:[r??l],functionArguments:[c.from(e)],abi:L},options:s})}var z={typeParameters:[{constraints:["key"]}],parameters:[new i(y(new A(0)))]};async function Vt(t){let{aptosConfig:o,creator:n,digitalAssetAddress:e,digitalAssetType:r,options:s}=t;return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::freeze_transfer",typeArguments:[r??l],functionArguments:[e],abi:z},options:s})}var j={typeParameters:[{constraints:["key"]}],parameters:[new i(y(new A(0)))]};async function Rt(t){let{aptosConfig:o,creator:n,digitalAssetAddress:e,digitalAssetType:r,options:s}=t;return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::unfreeze_transfer",typeArguments:[r??l],functionArguments:[e],abi:j},options:s})}var W={typeParameters:[{constraints:["key"]}],parameters:[new i(y(new A(0))),new i(p())]};async function Mt(t){let{aptosConfig:o,creator:n,description:e,digitalAssetAddress:r,digitalAssetType:s,options:a}=t;return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::set_description",typeArguments:[s??l],functionArguments:[c.from(r),new d(e)],abi:W},options:a})}var X={typeParameters:[{constraints:["key"]}],parameters:[new i(y(new A(0))),new i(p())]};async function Kt(t){let{aptosConfig:o,creator:n,name:e,digitalAssetAddress:r,digitalAssetType:s,options:a}=t;return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::set_name",typeArguments:[s??l],functionArguments:[c.from(r),new d(e)],abi:X},options:a})}var H={typeParameters:[{constraints:["key"]}],parameters:[new i(y(new A(0))),new i(p())]};async function Ut(t){let{aptosConfig:o,creator:n,uri:e,digitalAssetAddress:r,digitalAssetType:s,options:a}=t;return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::set_uri",typeArguments:[s??l],functionArguments:[c.from(r),new d(e)],abi:H},options:a})}var J={typeParameters:[{constraints:["key"]}],parameters:[new i(y(new A(0))),new i(p()),new i(p()),f.u8()]};async function Ft(t){let{aptosConfig:o,creator:n,propertyKey:e,propertyType:r,propertyValue:s,digitalAssetAddress:a,digitalAssetType:m,options:g}=t;return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::add_property",typeArguments:[m??l],functionArguments:[c.from(a),new d(e),new d(C[r]),_.U8(B(s,C[r]))],abi:J},options:g})}var Z={typeParameters:[{constraints:["key"]}],parameters:[new i(y(new A(0))),new i(p())]};async function Nt(t){let{aptosConfig:o,creator:n,propertyKey:e,digitalAssetAddress:r,digitalAssetType:s,options:a}=t;return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::remove_property",typeArguments:[s??l],functionArguments:[c.from(r),new d(e)],abi:Z},options:a})}var $={typeParameters:[{constraints:["key"]}],parameters:[new i(y(new A(0))),new i(p()),new i(p()),f.u8()]};async function Qt(t){let{aptosConfig:o,creator:n,propertyKey:e,propertyType:r,propertyValue:s,digitalAssetAddress:a,digitalAssetType:m,options:g}=t;return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::update_property",typeArguments:[m??l],functionArguments:[c.from(a),new d(e),new d(C[r]),B(s,C[r])],abi:$},options:g})}var tt={typeParameters:[{constraints:["key"]},{constraints:[]}],parameters:[new i(y(new A(0))),new i(p()),new A(1)]};async function Yt(t){let{aptosConfig:o,creator:n,propertyKey:e,propertyType:r,propertyValue:s,digitalAssetAddress:a,digitalAssetType:m,options:g}=t;return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::add_typed_property",typeArguments:[m??l,C[r]],functionArguments:[c.from(a),new d(e),s],abi:tt},options:g})}var et={typeParameters:[{constraints:["key"]},{constraints:[]}],parameters:[new i(y(new A(0))),new i(p()),new A(1)]};async function Lt(t){let{aptosConfig:o,creator:n,propertyKey:e,propertyType:r,propertyValue:s,digitalAssetAddress:a,digitalAssetType:m,options:g}=t;return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::update_typed_property",typeArguments:[m??l,C[r]],functionArguments:[c.from(a),new d(e),s],abi:et},options:g})}function K(t,o){let n=new Array;return o.forEach((e,r)=>{n.push(B(t[r],e))}),n}function B(t,o){let n=R(o);return M(t,n,0,[]).bcsToBytes()}export{It as a,Pt as b,bt as c,St as d,Dt as e,v as f,ht as g,vt as h,xt as i,Gt as j,Bt as k,Et as l,Ot as m,qt as n,Vt as o,Rt as p,Mt as q,Kt as r,Ut as s,Ft as t,Nt as u,Qt as v,Yt as w,Lt as x};
2
+ //# sourceMappingURL=chunk-QRTZYRH2.mjs.map