@aptos-labs/ts-sdk 1.14.0 → 1.15.0-win.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 (451) hide show
  1. package/dist/common/{accountAddress-csDQ8Gnp.d.ts → accountAddress-ccLvlUQe.d.ts} +20 -1
  2. package/dist/common/cli/index.d.ts +1 -1
  3. package/dist/common/cli/index.js +1 -1
  4. package/dist/common/cli/index.js.map +1 -1
  5. package/dist/common/index.d.ts +1624 -1390
  6. package/dist/common/index.js +42 -13
  7. package/dist/common/index.js.map +1 -1
  8. package/dist/esm/{Ed25519Account--qjfup2u.d.mts → Ed25519Account-B1VMJOY2.d.mts} +77 -10
  9. package/dist/esm/account/Account.d.mts +34 -0
  10. package/dist/esm/account/Account.mjs +2 -0
  11. package/dist/esm/account/Ed25519Account.d.mts +34 -0
  12. package/dist/esm/account/Ed25519Account.mjs +2 -0
  13. package/dist/esm/account/MultiKeyAccount.d.mts +133 -0
  14. package/dist/esm/account/MultiKeyAccount.mjs +2 -0
  15. package/dist/esm/account/SingleKeyAccount.d.mts +34 -0
  16. package/dist/esm/account/SingleKeyAccount.mjs +2 -0
  17. package/dist/esm/account/index.d.mts +35 -0
  18. package/dist/esm/account/index.mjs +2 -0
  19. package/dist/esm/api/account.d.mts +14 -2
  20. package/dist/esm/api/account.mjs +1 -1
  21. package/dist/esm/api/ans.d.mts +3 -3
  22. package/dist/esm/api/ans.mjs +1 -1
  23. package/dist/esm/api/aptos.d.mts +11 -9
  24. package/dist/esm/api/aptos.mjs +1 -1
  25. package/dist/esm/api/coin.d.mts +7 -7
  26. package/dist/esm/api/coin.mjs +1 -1
  27. package/dist/esm/api/digitalAsset.d.mts +2 -2
  28. package/dist/esm/api/digitalAsset.mjs +1 -1
  29. package/dist/esm/api/event.mjs +1 -1
  30. package/dist/esm/api/faucet.mjs +1 -1
  31. package/dist/esm/api/fungibleAsset.d.mts +6 -6
  32. package/dist/esm/api/fungibleAsset.mjs +1 -1
  33. package/dist/esm/api/general.d.mts +8 -33
  34. package/dist/esm/api/general.mjs +1 -1
  35. package/dist/esm/api/index.d.mts +10 -9
  36. package/dist/esm/api/index.mjs +1 -1
  37. package/dist/esm/api/staking.mjs +1 -1
  38. package/dist/esm/api/table.d.mts +84 -0
  39. package/dist/esm/api/table.mjs +2 -0
  40. package/dist/esm/api/transaction.d.mts +2 -2
  41. package/dist/esm/api/transaction.mjs +1 -1
  42. package/dist/esm/api/transactionSubmission/build.d.mts +2 -2
  43. package/dist/esm/api/transactionSubmission/build.mjs +1 -1
  44. package/dist/esm/api/transactionSubmission/management.d.mts +9 -9
  45. package/dist/esm/api/transactionSubmission/management.mjs +1 -1
  46. package/dist/esm/api/transactionSubmission/sign.d.mts +2 -2
  47. package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
  48. package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -1
  49. package/dist/esm/api/transactionSubmission/simulate.d.mts +7 -7
  50. package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
  51. package/dist/esm/api/transactionSubmission/submit.d.mts +1 -1
  52. package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
  53. package/dist/esm/api/utils.mjs +1 -1
  54. package/dist/esm/bcs/index.mjs +1 -1
  55. package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -1
  56. package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -1
  57. package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
  58. package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
  59. package/dist/esm/bcs/serializer.mjs +1 -1
  60. package/dist/esm/{chunk-O4JRPZZM.mjs → chunk-2X7A4HUS.mjs} +2 -2
  61. package/dist/esm/{chunk-PXFIA4BL.mjs → chunk-2XK53QFA.mjs} +2 -2
  62. package/dist/esm/{chunk-CDB34C4N.mjs → chunk-2YZSEM2G.mjs} +2 -2
  63. package/dist/esm/chunk-2YZSEM2G.mjs.map +1 -0
  64. package/dist/esm/{chunk-RHBCVCOS.mjs → chunk-35EWRSDK.mjs} +2 -2
  65. package/dist/esm/{chunk-52C73T26.mjs → chunk-36QXVFR5.mjs} +2 -2
  66. package/dist/esm/chunk-3HSXKDOC.mjs +2 -0
  67. package/dist/esm/chunk-3HSXKDOC.mjs.map +1 -0
  68. package/dist/esm/chunk-3N6N3KOS.mjs +2 -0
  69. package/dist/esm/chunk-3N6N3KOS.mjs.map +1 -0
  70. package/dist/esm/{chunk-NWYIE7ZX.mjs → chunk-477G7LHJ.mjs} +2 -2
  71. package/dist/esm/chunk-4NHWV5AI.mjs +2 -0
  72. package/dist/esm/{chunk-NPFNYP75.mjs → chunk-5EN52MUT.mjs} +2 -2
  73. package/dist/esm/{chunk-L5IL2IAB.mjs → chunk-5VIESFOC.mjs} +2 -2
  74. package/dist/esm/{chunk-BIAEC6FO.mjs → chunk-5YLAWRI2.mjs} +2 -2
  75. package/dist/esm/{chunk-N77VJHW5.mjs → chunk-6JLYD5Q2.mjs} +2 -2
  76. package/dist/esm/chunk-6XWDDCQD.mjs +2 -0
  77. package/dist/esm/chunk-6XWDDCQD.mjs.map +1 -0
  78. package/dist/esm/{chunk-BE4FOV6X.mjs → chunk-7NEETXEA.mjs} +2 -2
  79. package/dist/esm/chunk-7VRZLDIJ.mjs +2 -0
  80. package/dist/esm/{chunk-PMUT3HZE.mjs → chunk-ACG4ZGRQ.mjs} +2 -2
  81. package/dist/esm/chunk-ACG4ZGRQ.mjs.map +1 -0
  82. package/dist/esm/chunk-AQAH67IV.mjs +2 -0
  83. package/dist/esm/chunk-B7X6PSE7.mjs +2 -0
  84. package/dist/esm/{chunk-AOCNYMMX.mjs → chunk-BCUSI3N6.mjs} +2 -2
  85. package/dist/esm/{chunk-BAV4XY7C.mjs → chunk-BHLICYAI.mjs} +2 -2
  86. package/dist/esm/chunk-BO2TLWNT.mjs +2 -0
  87. package/dist/esm/chunk-CEHCDA3G.mjs +2 -0
  88. package/dist/esm/chunk-CJDEPZ4J.mjs +2 -0
  89. package/dist/esm/{chunk-CPBGL37X.mjs.map → chunk-CJDEPZ4J.mjs.map} +1 -1
  90. package/dist/esm/{chunk-4P5EKAJB.mjs → chunk-CWUH4PNH.mjs} +2 -2
  91. package/dist/esm/chunk-DLAIJ2UM.mjs +2 -0
  92. package/dist/esm/chunk-DLAIJ2UM.mjs.map +1 -0
  93. package/dist/esm/{chunk-HG4Q4EFG.mjs → chunk-E2NVC2VR.mjs} +2 -2
  94. package/dist/esm/chunk-E2NVC2VR.mjs.map +1 -0
  95. package/dist/esm/chunk-F7EMGK4M.mjs +2 -0
  96. package/dist/esm/{chunk-FS3NSGBF.mjs → chunk-G56GPLTB.mjs} +2 -2
  97. package/dist/esm/{chunk-6FBKUTGF.mjs → chunk-GHYE26Q5.mjs} +2 -2
  98. package/dist/esm/{chunk-P3UFJZY5.mjs → chunk-GIAABV7R.mjs} +2 -2
  99. package/dist/esm/chunk-GIAABV7R.mjs.map +1 -0
  100. package/dist/esm/chunk-GKJ2NJG5.mjs +2 -0
  101. package/dist/esm/chunk-GKJ2NJG5.mjs.map +1 -0
  102. package/dist/esm/{chunk-QTRYMRYK.mjs → chunk-GM56MMNJ.mjs} +2 -2
  103. package/dist/esm/chunk-HMARHACL.mjs +2 -0
  104. package/dist/esm/chunk-HMARHACL.mjs.map +1 -0
  105. package/dist/esm/chunk-HNEAPYNI.mjs +2 -0
  106. package/dist/esm/{chunk-S2LTZKM4.mjs → chunk-HSJTQLI2.mjs} +2 -2
  107. package/dist/esm/{chunk-AT2A6UGB.mjs → chunk-IENCDVPF.mjs} +2 -2
  108. package/dist/esm/{chunk-AT2A6UGB.mjs.map → chunk-IENCDVPF.mjs.map} +1 -1
  109. package/dist/esm/{chunk-2G4ZSGL4.mjs → chunk-IZQV2SU6.mjs} +2 -2
  110. package/dist/esm/chunk-J6OFSYUA.mjs +2 -0
  111. package/dist/esm/chunk-J6OFSYUA.mjs.map +1 -0
  112. package/dist/esm/chunk-JB5H65CE.mjs +2 -0
  113. package/dist/esm/chunk-JB5H65CE.mjs.map +1 -0
  114. package/dist/esm/chunk-JFIAWBCK.mjs +2 -0
  115. package/dist/esm/chunk-JFIAWBCK.mjs.map +1 -0
  116. package/dist/esm/chunk-JQIGQMNZ.mjs +2 -0
  117. package/dist/esm/chunk-JQIGQMNZ.mjs.map +1 -0
  118. package/dist/esm/chunk-JXCZTOYC.mjs +1 -0
  119. package/dist/esm/chunk-JXCZTOYC.mjs.map +1 -0
  120. package/dist/esm/chunk-K7HX7JQH.mjs +2 -0
  121. package/dist/esm/chunk-K7HX7JQH.mjs.map +1 -0
  122. package/dist/esm/{chunk-UML2VQZT.mjs → chunk-KAGLWBIJ.mjs} +2 -2
  123. package/dist/esm/chunk-LG7RJQ57.mjs +2 -0
  124. package/dist/esm/{chunk-XO3HHRJV.mjs → chunk-MCRRHBFQ.mjs} +2 -2
  125. package/dist/esm/{chunk-U43IJHQN.mjs → chunk-MJPUASSD.mjs} +2 -2
  126. package/dist/esm/chunk-MQI2IE6Y.mjs +2 -0
  127. package/dist/esm/chunk-MQI2IE6Y.mjs.map +1 -0
  128. package/dist/esm/chunk-N3U47Y6Y.mjs +2 -0
  129. package/dist/esm/{chunk-JCD72AW7.mjs → chunk-NZETF6Z4.mjs} +2 -2
  130. package/dist/esm/{chunk-UPIN5AIO.mjs → chunk-P6GWG2CY.mjs} +2 -2
  131. package/dist/esm/chunk-PF57EOJY.mjs +2 -0
  132. package/dist/esm/chunk-PIVZMT5D.mjs +2 -0
  133. package/dist/esm/chunk-PIVZMT5D.mjs.map +1 -0
  134. package/dist/esm/{chunk-HWECUBBA.mjs → chunk-PLXGSUZA.mjs} +2 -2
  135. package/dist/esm/chunk-PLXGSUZA.mjs.map +1 -0
  136. package/dist/esm/{chunk-PYXJYEAC.mjs → chunk-PPO4IXE4.mjs} +2 -2
  137. package/dist/esm/chunk-PPO4IXE4.mjs.map +1 -0
  138. package/dist/esm/{chunk-SPU745XV.mjs → chunk-QIHR7HD6.mjs} +2 -2
  139. package/dist/esm/chunk-QQ5PHEJF.mjs +2 -0
  140. package/dist/esm/chunk-QQ5PHEJF.mjs.map +1 -0
  141. package/dist/esm/{chunk-IOSQVDZI.mjs → chunk-QRS4DGP3.mjs} +2 -2
  142. package/dist/esm/{chunk-IOSQVDZI.mjs.map → chunk-QRS4DGP3.mjs.map} +1 -1
  143. package/dist/esm/{chunk-LDQ6JFEF.mjs → chunk-QSHLNSUP.mjs} +2 -2
  144. package/dist/esm/{chunk-LDQ6JFEF.mjs.map → chunk-QSHLNSUP.mjs.map} +1 -1
  145. package/dist/esm/chunk-RFSO3JRG.mjs +1 -0
  146. package/dist/esm/chunk-RFSO3JRG.mjs.map +1 -0
  147. package/dist/esm/chunk-RVWYURXG.mjs +2 -0
  148. package/dist/esm/chunk-RVWYURXG.mjs.map +1 -0
  149. package/dist/esm/{chunk-QD2Y3VK4.mjs → chunk-RYD6HRW7.mjs} +2 -2
  150. package/dist/esm/chunk-RYD6HRW7.mjs.map +1 -0
  151. package/dist/esm/{chunk-APDALGDD.mjs → chunk-S2VSJJRJ.mjs} +2 -2
  152. package/dist/esm/{chunk-S4SEFF4K.mjs → chunk-S3EDNXZE.mjs} +46 -17
  153. package/dist/esm/chunk-S3EDNXZE.mjs.map +1 -0
  154. package/dist/esm/chunk-SRDIYE3M.mjs +2 -0
  155. package/dist/esm/{chunk-QIAHBEEW.mjs.map → chunk-SRDIYE3M.mjs.map} +1 -1
  156. package/dist/esm/{chunk-CNMQNPNV.mjs → chunk-T2AGN5YT.mjs} +2 -2
  157. package/dist/esm/chunk-TGQARO3F.mjs +2 -0
  158. package/dist/esm/chunk-TGQARO3F.mjs.map +1 -0
  159. package/dist/esm/chunk-TM7NDDT3.mjs +2 -0
  160. package/dist/esm/chunk-TM7NDDT3.mjs.map +1 -0
  161. package/dist/esm/{chunk-3YZGJLW7.mjs → chunk-TT2XR5ZI.mjs} +2 -2
  162. package/dist/esm/{chunk-DMKUAQB7.mjs → chunk-U3YYSIIT.mjs} +2 -2
  163. package/dist/esm/chunk-UGPALAPN.mjs +2 -0
  164. package/dist/esm/{chunk-5HY3DEPF.mjs → chunk-UKSRF2Q3.mjs} +2 -2
  165. package/dist/esm/chunk-UO3NZ5AH.mjs +1 -0
  166. package/dist/esm/chunk-UO3NZ5AH.mjs.map +1 -0
  167. package/dist/esm/{chunk-FXNFWLQC.mjs → chunk-UPSCPEEE.mjs} +2 -2
  168. package/dist/esm/chunk-WXWWYH73.mjs +2 -0
  169. package/dist/esm/chunk-WXWWYH73.mjs.map +1 -0
  170. package/dist/esm/{chunk-6OV2PQS5.mjs → chunk-XBHFMNYB.mjs} +2 -2
  171. package/dist/esm/{chunk-RW2A63WK.mjs → chunk-XD46HTI2.mjs} +2 -2
  172. package/dist/esm/chunk-XD46HTI2.mjs.map +1 -0
  173. package/dist/esm/{chunk-WCVUDO5S.mjs → chunk-XFSDV3ND.mjs} +2 -2
  174. package/dist/esm/{chunk-UDRSFVAK.mjs → chunk-YMB2XW2O.mjs} +2 -2
  175. package/dist/esm/chunk-ZBXOX3S7.mjs +2 -0
  176. package/dist/esm/cli/index.d.mts +1 -1
  177. package/dist/esm/cli/index.mjs +1 -1
  178. package/dist/esm/cli/move.d.mts +1 -1
  179. package/dist/esm/cli/move.mjs +1 -1
  180. package/dist/esm/client/core.mjs +1 -1
  181. package/dist/esm/client/get.mjs +1 -1
  182. package/dist/esm/client/index.mjs +1 -1
  183. package/dist/esm/client/post.mjs +1 -1
  184. package/dist/esm/client/types.mjs +1 -1
  185. package/dist/esm/core/account/index.d.mts +5 -14
  186. package/dist/esm/core/account/index.mjs +1 -1
  187. package/dist/esm/core/account/utils/address.mjs +1 -1
  188. package/dist/esm/core/account/utils/index.mjs +1 -1
  189. package/dist/esm/core/accountAddress.mjs +1 -1
  190. package/dist/esm/core/authenticationKey.d.mts +1 -1
  191. package/dist/esm/core/authenticationKey.mjs +1 -1
  192. package/dist/esm/core/common.mjs +1 -1
  193. package/dist/esm/core/crypto/ed25519.d.mts +1 -1
  194. package/dist/esm/core/crypto/ed25519.mjs +1 -1
  195. package/dist/esm/core/crypto/index.d.mts +4 -4
  196. package/dist/esm/core/crypto/index.mjs +1 -1
  197. package/dist/esm/core/crypto/multiEd25519.d.mts +1 -1
  198. package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
  199. package/dist/esm/core/crypto/multiKey.d.mts +8 -1
  200. package/dist/esm/core/crypto/multiKey.mjs +1 -1
  201. package/dist/esm/core/crypto/privateKey.d.mts +1 -1
  202. package/dist/esm/core/crypto/publicKey.d.mts +1 -1
  203. package/dist/esm/core/crypto/publicKey.mjs +1 -1
  204. package/dist/esm/core/crypto/secp256k1.d.mts +1 -1
  205. package/dist/esm/core/crypto/secp256k1.mjs +1 -1
  206. package/dist/esm/core/crypto/signature.mjs +1 -1
  207. package/dist/esm/core/crypto/singleKey.d.mts +1 -1
  208. package/dist/esm/core/crypto/singleKey.mjs +1 -1
  209. package/dist/esm/core/crypto/utils.mjs +1 -1
  210. package/dist/esm/core/hex.mjs +1 -1
  211. package/dist/esm/core/index.d.mts +3 -6
  212. package/dist/esm/core/index.mjs +1 -1
  213. package/dist/esm/index.d.mts +7 -5
  214. package/dist/esm/index.mjs +1 -1
  215. package/dist/esm/internal/account.d.mts +15 -3
  216. package/dist/esm/internal/account.mjs +1 -1
  217. package/dist/esm/internal/ans.d.mts +3 -3
  218. package/dist/esm/internal/ans.mjs +1 -1
  219. package/dist/esm/internal/coin.d.mts +8 -8
  220. package/dist/esm/internal/coin.mjs +1 -1
  221. package/dist/esm/internal/digitalAsset.d.mts +3 -3
  222. package/dist/esm/internal/digitalAsset.mjs +1 -1
  223. package/dist/esm/internal/event.d.mts +1 -1
  224. package/dist/esm/internal/event.mjs +1 -1
  225. package/dist/esm/internal/faucet.d.mts +1 -1
  226. package/dist/esm/internal/faucet.mjs +1 -1
  227. package/dist/esm/internal/fungibleAsset.d.mts +6 -6
  228. package/dist/esm/internal/fungibleAsset.mjs +1 -1
  229. package/dist/esm/internal/general.d.mts +2 -8
  230. package/dist/esm/internal/general.mjs +1 -1
  231. package/dist/esm/internal/staking.d.mts +1 -1
  232. package/dist/esm/internal/staking.mjs +1 -1
  233. package/dist/esm/internal/table.d.mts +31 -0
  234. package/dist/esm/internal/table.mjs +2 -0
  235. package/dist/esm/internal/table.mjs.map +1 -0
  236. package/dist/esm/internal/transaction.mjs +1 -1
  237. package/dist/esm/internal/transactionSubmission.d.mts +2 -2
  238. package/dist/esm/internal/transactionSubmission.mjs +1 -1
  239. package/dist/esm/internal/view.d.mts +7 -7
  240. package/dist/esm/internal/view.mjs +1 -1
  241. package/dist/esm/transactions/authenticator/account.d.mts +4 -5
  242. package/dist/esm/transactions/authenticator/account.mjs +1 -1
  243. package/dist/esm/transactions/authenticator/index.d.mts +1 -1
  244. package/dist/esm/transactions/authenticator/index.mjs +1 -1
  245. package/dist/esm/transactions/authenticator/transaction.d.mts +1 -1
  246. package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
  247. package/dist/esm/transactions/index.d.mts +3 -3
  248. package/dist/esm/transactions/index.mjs +1 -1
  249. package/dist/esm/transactions/instances/chainId.mjs +1 -1
  250. package/dist/esm/transactions/instances/identifier.mjs +1 -1
  251. package/dist/esm/transactions/instances/index.d.mts +1 -1
  252. package/dist/esm/transactions/instances/index.mjs +1 -1
  253. package/dist/esm/transactions/instances/moduleId.d.mts +1 -1
  254. package/dist/esm/transactions/instances/moduleId.mjs +1 -1
  255. package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
  256. package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
  257. package/dist/esm/transactions/instances/rotationProofChallenge.d.mts +1 -1
  258. package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
  259. package/dist/esm/transactions/instances/signedTransaction.d.mts +1 -1
  260. package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
  261. package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
  262. package/dist/esm/transactions/instances/transactionPayload.d.mts +1 -1
  263. package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
  264. package/dist/esm/transactions/management/accountSequenceNumber.d.mts +14 -2
  265. package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
  266. package/dist/esm/transactions/management/index.d.mts +3 -3
  267. package/dist/esm/transactions/management/index.mjs +1 -1
  268. package/dist/esm/transactions/management/transactionWorker.d.mts +2 -2
  269. package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
  270. package/dist/esm/transactions/transactionBuilder/helpers.d.mts +9 -9
  271. package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
  272. package/dist/esm/transactions/transactionBuilder/index.d.mts +9 -9
  273. package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
  274. package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +6 -6
  275. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
  276. package/dist/esm/transactions/transactionBuilder/signingMessage.d.mts +72 -0
  277. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +2 -0
  278. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs.map +1 -0
  279. package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +7 -29
  280. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
  281. package/dist/esm/transactions/typeTag/index.mjs +1 -1
  282. package/dist/esm/transactions/typeTag/parser.mjs +1 -1
  283. package/dist/esm/transactions/types.d.mts +7 -7
  284. package/dist/esm/types/generated/operations.d.mts +31 -2
  285. package/dist/esm/types/generated/queries.d.mts +6 -2
  286. package/dist/esm/types/generated/queries.mjs +1 -1
  287. package/dist/esm/types/generated/types.d.mts +212 -7
  288. package/dist/esm/types/generated/types.mjs +1 -1
  289. package/dist/esm/types/generated/types.mjs.map +1 -1
  290. package/dist/esm/types/index.d.mts +1 -1
  291. package/dist/esm/types/indexer.d.mts +4 -2
  292. package/dist/esm/utils/index.mjs +1 -1
  293. package/dist/esm/utils/normalizeBundle.mjs +1 -1
  294. package/dist/esm/version.d.mts +1 -1
  295. package/dist/esm/version.mjs +1 -1
  296. package/package.json +2 -2
  297. package/src/{core/account → account}/Account.ts +25 -15
  298. package/src/{core/account → account}/Ed25519Account.ts +45 -9
  299. package/src/account/MultiKeyAccount.ts +176 -0
  300. package/src/{core/account → account}/SingleKeyAccount.ts +45 -10
  301. package/src/account/index.ts +4 -0
  302. package/src/api/account.ts +2 -1
  303. package/src/api/ans.ts +2 -1
  304. package/src/api/aptos.ts +6 -0
  305. package/src/api/digitalAsset.ts +2 -1
  306. package/src/api/fungibleAsset.ts +2 -1
  307. package/src/api/general.ts +0 -26
  308. package/src/api/table.ts +108 -0
  309. package/src/api/transaction.ts +2 -1
  310. package/src/api/transactionSubmission/management.ts +1 -1
  311. package/src/api/transactionSubmission/sign.ts +1 -1
  312. package/src/cli/move.ts +1 -1
  313. package/src/core/account/index.ts +0 -3
  314. package/src/core/crypto/multiKey.ts +17 -6
  315. package/src/core/index.ts +0 -1
  316. package/src/index.ts +1 -0
  317. package/src/internal/account.ts +3 -2
  318. package/src/internal/ans.ts +2 -1
  319. package/src/internal/digitalAsset.ts +2 -1
  320. package/src/internal/fungibleAsset.ts +2 -1
  321. package/src/internal/general.ts +1 -20
  322. package/src/internal/queries/currentTokenOwnershipFieldsFragment.graphql +1 -0
  323. package/src/internal/queries/getTableItemsData.graphql +15 -0
  324. package/src/internal/queries/getTableItemsMetadata.graphql +12 -0
  325. package/src/internal/table.ts +82 -0
  326. package/src/internal/transactionSubmission.ts +5 -7
  327. package/src/transactions/authenticator/account.ts +6 -11
  328. package/src/transactions/management/accountSequenceNumber.ts +1 -1
  329. package/src/transactions/management/transactionWorker.ts +1 -1
  330. package/src/transactions/transactionBuilder/index.ts +1 -0
  331. package/src/transactions/transactionBuilder/signingMessage.ts +93 -0
  332. package/src/transactions/transactionBuilder/transactionBuilder.ts +2 -73
  333. package/src/types/generated/operations.ts +29 -0
  334. package/src/types/generated/queries.ts +59 -0
  335. package/src/types/generated/types.ts +223 -4
  336. package/src/types/indexer.ts +4 -0
  337. package/src/version.ts +1 -1
  338. package/dist/esm/chunk-4374JPA6.mjs +0 -2
  339. package/dist/esm/chunk-4374JPA6.mjs.map +0 -1
  340. package/dist/esm/chunk-62P5CJAJ.mjs +0 -2
  341. package/dist/esm/chunk-62P5CJAJ.mjs.map +0 -1
  342. package/dist/esm/chunk-B3BRR4WP.mjs +0 -2
  343. package/dist/esm/chunk-B3BRR4WP.mjs.map +0 -1
  344. package/dist/esm/chunk-BWFJHFBQ.mjs +0 -2
  345. package/dist/esm/chunk-CDB34C4N.mjs.map +0 -1
  346. package/dist/esm/chunk-CF5R4HVB.mjs +0 -2
  347. package/dist/esm/chunk-CPBGL37X.mjs +0 -2
  348. package/dist/esm/chunk-DSTKXJMA.mjs +0 -2
  349. package/dist/esm/chunk-E7FWVXGX.mjs +0 -1
  350. package/dist/esm/chunk-FBPNHF54.mjs +0 -2
  351. package/dist/esm/chunk-HG4Q4EFG.mjs.map +0 -1
  352. package/dist/esm/chunk-HWECUBBA.mjs.map +0 -1
  353. package/dist/esm/chunk-IR46T46A.mjs +0 -2
  354. package/dist/esm/chunk-IR46T46A.mjs.map +0 -1
  355. package/dist/esm/chunk-LBGYH45K.mjs +0 -2
  356. package/dist/esm/chunk-LBGYH45K.mjs.map +0 -1
  357. package/dist/esm/chunk-MFL3UCKA.mjs +0 -2
  358. package/dist/esm/chunk-MFL3UCKA.mjs.map +0 -1
  359. package/dist/esm/chunk-MLWIHWNH.mjs +0 -1
  360. package/dist/esm/chunk-NBCHJ75L.mjs +0 -2
  361. package/dist/esm/chunk-NBCHJ75L.mjs.map +0 -1
  362. package/dist/esm/chunk-NZGRLKRG.mjs +0 -2
  363. package/dist/esm/chunk-OGHE4AQA.mjs +0 -2
  364. package/dist/esm/chunk-P3UFJZY5.mjs.map +0 -1
  365. package/dist/esm/chunk-PJPXC22D.mjs +0 -2
  366. package/dist/esm/chunk-PJPXC22D.mjs.map +0 -1
  367. package/dist/esm/chunk-PMUT3HZE.mjs.map +0 -1
  368. package/dist/esm/chunk-PYXJYEAC.mjs.map +0 -1
  369. package/dist/esm/chunk-QD2Y3VK4.mjs.map +0 -1
  370. package/dist/esm/chunk-QIAHBEEW.mjs +0 -2
  371. package/dist/esm/chunk-QIAU5K5Y.mjs +0 -2
  372. package/dist/esm/chunk-QIAU5K5Y.mjs.map +0 -1
  373. package/dist/esm/chunk-R5QUBEH6.mjs +0 -2
  374. package/dist/esm/chunk-R7G3CLRI.mjs +0 -1
  375. package/dist/esm/chunk-RR7I2HLA.mjs +0 -2
  376. package/dist/esm/chunk-RR7I2HLA.mjs.map +0 -1
  377. package/dist/esm/chunk-RW2A63WK.mjs.map +0 -1
  378. package/dist/esm/chunk-S4SEFF4K.mjs.map +0 -1
  379. package/dist/esm/chunk-TBMAJ6AW.mjs +0 -2
  380. package/dist/esm/chunk-TGXZVNR5.mjs +0 -2
  381. package/dist/esm/chunk-TJDC5PWD.mjs +0 -2
  382. package/dist/esm/chunk-UF534PKA.mjs +0 -2
  383. package/dist/esm/chunk-UF534PKA.mjs.map +0 -1
  384. package/dist/esm/chunk-UMDTVVQC.mjs +0 -2
  385. package/dist/esm/chunk-UMDTVVQC.mjs.map +0 -1
  386. package/dist/esm/chunk-UNU3RVRJ.mjs +0 -2
  387. package/dist/esm/chunk-WFZDFFBM.mjs +0 -2
  388. package/dist/esm/chunk-XIJHRBDL.mjs +0 -2
  389. package/dist/esm/chunk-XIJHRBDL.mjs.map +0 -1
  390. package/dist/esm/chunk-ZEHKHKBP.mjs +0 -2
  391. package/dist/esm/chunk-ZEHKHKBP.mjs.map +0 -1
  392. package/dist/esm/chunk-ZYYK3UXP.mjs +0 -2
  393. package/dist/esm/core/account/Account.d.mts +0 -20
  394. package/dist/esm/core/account/Account.mjs +0 -2
  395. package/dist/esm/core/account/Ed25519Account.d.mts +0 -20
  396. package/dist/esm/core/account/Ed25519Account.mjs +0 -2
  397. package/dist/esm/core/account/SingleKeyAccount.d.mts +0 -20
  398. package/dist/esm/core/account/SingleKeyAccount.mjs +0 -2
  399. /package/dist/esm/{core/account → account}/Account.mjs.map +0 -0
  400. /package/dist/esm/{core/account → account}/Ed25519Account.mjs.map +0 -0
  401. /package/dist/esm/{chunk-E7FWVXGX.mjs.map → account/MultiKeyAccount.mjs.map} +0 -0
  402. /package/dist/esm/{core/account → account}/SingleKeyAccount.mjs.map +0 -0
  403. /package/dist/esm/{chunk-MLWIHWNH.mjs.map → account/index.mjs.map} +0 -0
  404. /package/dist/esm/{chunk-R7G3CLRI.mjs.map → api/table.mjs.map} +0 -0
  405. /package/dist/esm/{chunk-O4JRPZZM.mjs.map → chunk-2X7A4HUS.mjs.map} +0 -0
  406. /package/dist/esm/{chunk-PXFIA4BL.mjs.map → chunk-2XK53QFA.mjs.map} +0 -0
  407. /package/dist/esm/{chunk-RHBCVCOS.mjs.map → chunk-35EWRSDK.mjs.map} +0 -0
  408. /package/dist/esm/{chunk-52C73T26.mjs.map → chunk-36QXVFR5.mjs.map} +0 -0
  409. /package/dist/esm/{chunk-NWYIE7ZX.mjs.map → chunk-477G7LHJ.mjs.map} +0 -0
  410. /package/dist/esm/{chunk-WFZDFFBM.mjs.map → chunk-4NHWV5AI.mjs.map} +0 -0
  411. /package/dist/esm/{chunk-NPFNYP75.mjs.map → chunk-5EN52MUT.mjs.map} +0 -0
  412. /package/dist/esm/{chunk-L5IL2IAB.mjs.map → chunk-5VIESFOC.mjs.map} +0 -0
  413. /package/dist/esm/{chunk-BIAEC6FO.mjs.map → chunk-5YLAWRI2.mjs.map} +0 -0
  414. /package/dist/esm/{chunk-N77VJHW5.mjs.map → chunk-6JLYD5Q2.mjs.map} +0 -0
  415. /package/dist/esm/{chunk-BE4FOV6X.mjs.map → chunk-7NEETXEA.mjs.map} +0 -0
  416. /package/dist/esm/{chunk-TGXZVNR5.mjs.map → chunk-7VRZLDIJ.mjs.map} +0 -0
  417. /package/dist/esm/{chunk-CF5R4HVB.mjs.map → chunk-AQAH67IV.mjs.map} +0 -0
  418. /package/dist/esm/{chunk-DSTKXJMA.mjs.map → chunk-B7X6PSE7.mjs.map} +0 -0
  419. /package/dist/esm/{chunk-AOCNYMMX.mjs.map → chunk-BCUSI3N6.mjs.map} +0 -0
  420. /package/dist/esm/{chunk-BAV4XY7C.mjs.map → chunk-BHLICYAI.mjs.map} +0 -0
  421. /package/dist/esm/{chunk-OGHE4AQA.mjs.map → chunk-BO2TLWNT.mjs.map} +0 -0
  422. /package/dist/esm/{chunk-TBMAJ6AW.mjs.map → chunk-CEHCDA3G.mjs.map} +0 -0
  423. /package/dist/esm/{chunk-4P5EKAJB.mjs.map → chunk-CWUH4PNH.mjs.map} +0 -0
  424. /package/dist/esm/{chunk-TJDC5PWD.mjs.map → chunk-F7EMGK4M.mjs.map} +0 -0
  425. /package/dist/esm/{chunk-FS3NSGBF.mjs.map → chunk-G56GPLTB.mjs.map} +0 -0
  426. /package/dist/esm/{chunk-6FBKUTGF.mjs.map → chunk-GHYE26Q5.mjs.map} +0 -0
  427. /package/dist/esm/{chunk-QTRYMRYK.mjs.map → chunk-GM56MMNJ.mjs.map} +0 -0
  428. /package/dist/esm/{chunk-NZGRLKRG.mjs.map → chunk-HNEAPYNI.mjs.map} +0 -0
  429. /package/dist/esm/{chunk-S2LTZKM4.mjs.map → chunk-HSJTQLI2.mjs.map} +0 -0
  430. /package/dist/esm/{chunk-2G4ZSGL4.mjs.map → chunk-IZQV2SU6.mjs.map} +0 -0
  431. /package/dist/esm/{chunk-UML2VQZT.mjs.map → chunk-KAGLWBIJ.mjs.map} +0 -0
  432. /package/dist/esm/{chunk-FBPNHF54.mjs.map → chunk-LG7RJQ57.mjs.map} +0 -0
  433. /package/dist/esm/{chunk-XO3HHRJV.mjs.map → chunk-MCRRHBFQ.mjs.map} +0 -0
  434. /package/dist/esm/{chunk-U43IJHQN.mjs.map → chunk-MJPUASSD.mjs.map} +0 -0
  435. /package/dist/esm/{chunk-ZYYK3UXP.mjs.map → chunk-N3U47Y6Y.mjs.map} +0 -0
  436. /package/dist/esm/{chunk-JCD72AW7.mjs.map → chunk-NZETF6Z4.mjs.map} +0 -0
  437. /package/dist/esm/{chunk-UPIN5AIO.mjs.map → chunk-P6GWG2CY.mjs.map} +0 -0
  438. /package/dist/esm/{chunk-BWFJHFBQ.mjs.map → chunk-PF57EOJY.mjs.map} +0 -0
  439. /package/dist/esm/{chunk-SPU745XV.mjs.map → chunk-QIHR7HD6.mjs.map} +0 -0
  440. /package/dist/esm/{chunk-APDALGDD.mjs.map → chunk-S2VSJJRJ.mjs.map} +0 -0
  441. /package/dist/esm/{chunk-CNMQNPNV.mjs.map → chunk-T2AGN5YT.mjs.map} +0 -0
  442. /package/dist/esm/{chunk-3YZGJLW7.mjs.map → chunk-TT2XR5ZI.mjs.map} +0 -0
  443. /package/dist/esm/{chunk-DMKUAQB7.mjs.map → chunk-U3YYSIIT.mjs.map} +0 -0
  444. /package/dist/esm/{chunk-R5QUBEH6.mjs.map → chunk-UGPALAPN.mjs.map} +0 -0
  445. /package/dist/esm/{chunk-5HY3DEPF.mjs.map → chunk-UKSRF2Q3.mjs.map} +0 -0
  446. /package/dist/esm/{chunk-FXNFWLQC.mjs.map → chunk-UPSCPEEE.mjs.map} +0 -0
  447. /package/dist/esm/{chunk-6OV2PQS5.mjs.map → chunk-XBHFMNYB.mjs.map} +0 -0
  448. /package/dist/esm/{chunk-WCVUDO5S.mjs.map → chunk-XFSDV3ND.mjs.map} +0 -0
  449. /package/dist/esm/{chunk-UDRSFVAK.mjs.map → chunk-YMB2XW2O.mjs.map} +0 -0
  450. /package/dist/esm/{chunk-UNU3RVRJ.mjs.map → chunk-ZBXOX3S7.mjs.map} +0 -0
  451. /package/dist/esm/{publicKey-lq5djCIY.d.mts → publicKey-B3XRNhHO.d.mts} +0 -0
@@ -1,2 +1,2 @@
1
- import{a as n}from"./chunk-BIAEC6FO.mjs";import{a as s,b as t,c as r,d as i,e as c,f as u,g as d,h as A,i as g,j as m,k as a,l as p,m as f,n as y,o as C,p as O,q as T}from"./chunk-4374JPA6.mjs";import{e as o}from"./chunk-CYNQRMO5.mjs";var l=class{constructor(e){this.config=e}async getAccountInfo(e){return s({aptosConfig:this.config,...e})}async getAccountModules(e){return t({aptosConfig:this.config,...e})}async getAccountModule(e){return r({aptosConfig:this.config,...e})}async getAccountTransactions(e){return i({aptosConfig:this.config,...e})}async getAccountResources(e){return c({aptosConfig:this.config,...e})}async getAccountResource(e){return u({aptosConfig:this.config,...e})}async lookupOriginalAccountAddress(e){return d({aptosConfig:this.config,...e})}async getAccountTokensCount(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"account_transactions_processor"}),A({aptosConfig:this.config,...e})}async getAccountOwnedTokens(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),g({aptosConfig:this.config,...e})}async getAccountOwnedTokensFromCollectionAddress(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),m({aptosConfig:this.config,...e})}async getAccountCollectionsWithOwnedTokens(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),a({aptosConfig:this.config,...e})}async getAccountTransactionsCount(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"account_transactions_processor"}),p({aptosConfig:this.config,...e})}async getAccountCoinsData(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"fungible_asset_processor"}),y({aptosConfig:this.config,...e})}async getAccountCoinsCount(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"fungible_asset_processor"}),C({aptosConfig:this.config,...e})}async getAccountAPTAmount(e){return this.getAccountCoinAmount({coinType:o,...e})}async getAccountCoinAmount(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"fungible_asset_processor"}),f({aptosConfig:this.config,...e})}async getAccountOwnedObjects(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"default_processor"}),O({aptosConfig:this.config,...e})}async deriveAccountFromPrivateKey(e){return T({aptosConfig:this.config,...e})}};export{l as a};
2
- //# sourceMappingURL=chunk-PMUT3HZE.mjs.map
1
+ import{a as n}from"./chunk-5YLAWRI2.mjs";import{a as s,b as t,c as r,d as i,e as c,f as u,g as d,h as A,i as g,j as m,k as a,l as p,m as f,n as y,o as C,p as O,q as T}from"./chunk-3HSXKDOC.mjs";import{e as o}from"./chunk-CYNQRMO5.mjs";var l=class{constructor(e){this.config=e}async getAccountInfo(e){return s({aptosConfig:this.config,...e})}async getAccountModules(e){return t({aptosConfig:this.config,...e})}async getAccountModule(e){return r({aptosConfig:this.config,...e})}async getAccountTransactions(e){return i({aptosConfig:this.config,...e})}async getAccountResources(e){return c({aptosConfig:this.config,...e})}async getAccountResource(e){return u({aptosConfig:this.config,...e})}async lookupOriginalAccountAddress(e){return d({aptosConfig:this.config,...e})}async getAccountTokensCount(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"account_transactions_processor"}),A({aptosConfig:this.config,...e})}async getAccountOwnedTokens(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),g({aptosConfig:this.config,...e})}async getAccountOwnedTokensFromCollectionAddress(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),m({aptosConfig:this.config,...e})}async getAccountCollectionsWithOwnedTokens(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),a({aptosConfig:this.config,...e})}async getAccountTransactionsCount(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"account_transactions_processor"}),p({aptosConfig:this.config,...e})}async getAccountCoinsData(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"fungible_asset_processor"}),y({aptosConfig:this.config,...e})}async getAccountCoinsCount(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"fungible_asset_processor"}),C({aptosConfig:this.config,...e})}async getAccountAPTAmount(e){return this.getAccountCoinAmount({coinType:o,...e})}async getAccountCoinAmount(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"fungible_asset_processor"}),f({aptosConfig:this.config,...e})}async getAccountOwnedObjects(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"default_processor"}),O({aptosConfig:this.config,...e})}async deriveAccountFromPrivateKey(e){return T({aptosConfig:this.config,...e})}};export{l as a};
2
+ //# sourceMappingURL=chunk-ACG4ZGRQ.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/api/account.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Account as AccountModule } from \"../account\";\nimport { AccountAddress, PrivateKey, AccountAddressInput } from \"../core\";\nimport {\n AccountData,\n AnyNumber,\n GetAccountCoinsDataResponse,\n GetAccountCollectionsWithOwnedTokenResponse,\n GetAccountOwnedObjectsResponse,\n GetAccountOwnedTokensFromCollectionResponse,\n GetAccountOwnedTokensQueryResponse,\n LedgerVersionArg,\n MoveModuleBytecode,\n MoveResource,\n MoveStructId,\n OrderByArg,\n PaginationArgs,\n TokenStandardArg,\n TransactionResponse,\n WhereArg,\n} from \"../types\";\nimport {\n deriveAccountFromPrivateKey,\n getAccountCoinAmount,\n getAccountCoinsCount,\n getAccountCoinsData,\n getAccountCollectionsWithOwnedTokens,\n getAccountOwnedObjects,\n getAccountOwnedTokens,\n getAccountOwnedTokensFromCollectionAddress,\n getAccountTokensCount,\n getAccountTransactionsCount,\n getInfo,\n getModule,\n getModules,\n getResource,\n getResources,\n getTransactions,\n lookupOriginalAccountAddress,\n} from \"../internal/account\";\nimport { APTOS_COIN, ProcessorType } from \"../utils/const\";\nimport { AptosConfig } from \"./aptosConfig\";\nimport { waitForIndexerOnVersion } from \"./utils\";\nimport { CurrentFungibleAssetBalancesBoolExp } from \"../types/generated/types\";\n\n/**\n * A class to query all `Account` related queries on Aptos.\n */\nexport class Account {\n constructor(readonly config: AptosConfig) {}\n\n /**\n * Queries the current state for an Aptos account given its account address\n *\n * @param args.accountAddress Aptos account address\n *\n * @returns The account data\n *\n * @example An example of the returned account\n * ```\n * {\n * sequence_number: \"1\",\n * authentication_key: \"0x5307b5f4bc67829097a8ba9b43dba3b88261eeccd1f709d9bde240fc100fbb69\"\n * }\n * ```\n */\n async getAccountInfo(args: { accountAddress: AccountAddressInput }): Promise<AccountData> {\n return getInfo({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries for all modules in an account given an account address\n *\n * Note: In order to get all account modules, this function may call the API\n * multiple times as it auto paginates.\n *\n * @param args.accountAddress Aptos account address\n * @param args.options.offset The number module to start returning results from\n * @param args.options.limit The number of results to return\n * @param args.options.ledgerVersion The ledger version to query, if not provided it will get the latest version\n *\n * @returns Account modules\n */\n\n async getAccountModules(args: {\n accountAddress: AccountAddressInput;\n options?: PaginationArgs & LedgerVersionArg;\n }): Promise<MoveModuleBytecode[]> {\n return getModules({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries for a specific account module given account address and module name\n *\n * @param args.accountAddress Aptos account address\n * @param args.moduleName The name of the module\n * @param args.options.ledgerVersion The ledger version to query, if not provided it will get the latest version\n *\n * @returns Account module\n *\n * @example\n * const module = await aptos.getAccountModule({accountAddress:\"0x456\"})\n * // An example of an account module response\n * ```\n * {\n * bytecode: \"0xa11ceb0b0600000006010002030206050807070f0d081c200\",\n * abi: { address: \"0x1\" }\n * }\n * ```\n */\n async getAccountModule(args: {\n accountAddress: AccountAddressInput;\n moduleName: string;\n options?: LedgerVersionArg;\n }): Promise<MoveModuleBytecode> {\n return getModule({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries account transactions given an account address\n *\n * Note: In order to get all account transactions, this function may call the API\n * multiple times as it auto paginates.\n *\n * @example\n * const transactions = await aptos.getAccountTransactions({accountAddress:\"0x456\"})\n *\n * @param args.accountAddress Aptos account address\n * @param args.options.offset The number transaction to start returning results from\n * @param args.options.limit The number of results to return\n *\n * @returns The account transactions\n */\n async getAccountTransactions(args: {\n accountAddress: AccountAddressInput;\n options?: PaginationArgs;\n }): Promise<TransactionResponse[]> {\n return getTransactions({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Queries all account resources given an account address\n *\n * Note: In order to get all account resources, this function may call the API\n * multiple times as it auto paginates.\n *\n * @example\n * const resources = await aptos.getAccountResources({accountAddress:\"0x456\"})\n *\n * @param args.accountAddress Aptos account address\n * @param args.options.offset The number resource to start returning results from\n * @param args.options.limit The number of results to return\n * @param args.options.ledgerVersion The ledger version to query, if not provided it will get the latest version\n * @returns Account resources\n */\n async getAccountResources(args: {\n accountAddress: AccountAddressInput;\n options?: PaginationArgs & LedgerVersionArg;\n }): Promise<MoveResource[]> {\n return getResources({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries a specific account resource given account address and resource type. Note that the default is `any` in order\n * to allow for ease of accessing properties of the object.\n *\n * @type The typed output of the resource\n * @param args.accountAddress Aptos account address\n * @param args.resourceType String representation of an on-chain Move struct type, i.e \"0x1::aptos_coin::AptosCoin\"\n * @param args.options.ledgerVersion The ledger version to query, if not provided it will get the latest version\n *\n * @returns Account resource\n *\n * @example\n * const resource = await aptos.getAccountResource({accountAddress:\"0x456\"})\n *\n */\n async getAccountResource<T extends {} = any>(args: {\n accountAddress: AccountAddressInput;\n resourceType: MoveStructId;\n options?: LedgerVersionArg;\n }): Promise<T> {\n return getResource<T>({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Looks up the account address for a given authentication key\n *\n * This handles both if the account's authentication key has been rotated or not.\n *\n * @example\n * const accountAddress = await aptos.lookupOriginalAccountAddress({authenticationKey:account.accountAddress})\n *\n * @param args.authenticationKey The authentication key\n * @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying\n * @param args.options.ledgerVersion The ledger version to query, if not provided it will get the latest version\n * @returns Promise<AccountAddress> The accountAddress associated with the authentication key\n */\n async lookupOriginalAccountAddress(args: {\n authenticationKey: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n options?: LedgerVersionArg;\n }): Promise<AccountAddress> {\n return lookupOriginalAccountAddress({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries the current count of tokens owned by an account\n *\n * @example\n * const tokensCount = await aptos.getAccountTokensCount({accountAddress:\"0x456\"})\n *\n * @param args.accountAddress The account address\n * @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying\n * @returns Current count of tokens owned by the account\n */\n async getAccountTokensCount(args: {\n accountAddress: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n }): Promise<number> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.ACCOUNT_TRANSACTION_PROCESSOR,\n });\n return getAccountTokensCount({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Queries the account's current owned tokens.\n *\n * This query returns all tokens (v1 and v2 standards) an account owns, including NFTs, fungible, soulbound, etc.\n * If you want to get only the token from a specific standard, you can pass an optional tokenStandard param\n *\n * @example\n * const accountOwnedTokens = await aptos.getAccountOwnedTokens({accountAddress:\"0x456\"})\n *\n * @param args.accountAddress The account address we want to get the tokens for\n * @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying\n * @param args.options.tokenStandard The NFT standard to query for\n * @param args.options.offset The number token to start returning results from\n * @param args.options.limit The number of results to return\n * @param args.options.orderBy The order to sort the tokens by\n * @returns Tokens array with the token data\n */\n async getAccountOwnedTokens(args: {\n accountAddress: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n options?: TokenStandardArg & PaginationArgs & OrderByArg<GetAccountOwnedTokensQueryResponse[0]>;\n }): Promise<GetAccountOwnedTokensQueryResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.TOKEN_V2_PROCESSOR,\n });\n return getAccountOwnedTokens({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Queries all current tokens of a specific collection that an account owns by the collection address\n *\n * This query returns all tokens (v1 and v2 standards) an account owns, including NFTs, fungible, soulbound, etc.\n * If you want to get only the token from a specific standard, you can pass an optional tokenStandard param\n *\n * @example\n * const accountOwnedTokens = await aptos.getAccountOwnedTokensFromCollectionAddress({accountAddress:\"0x123\", collectionAddress:\"0x456\"})\n *\n * @param args.accountAddress The account address we want to get the tokens for\n * @param args.collectionAddress The address of the collection being queried\n * @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying\n * @param args.options.tokenStandard The NFT standard to query for\n * @param args.options.offset The number token to start returning results from\n * @param args.options.limit The number of results to return\n * @param args.options.orderBy The order to sort the tokens by\n * @returns Tokens array with the token data\n */\n async getAccountOwnedTokensFromCollectionAddress(args: {\n accountAddress: AccountAddressInput;\n collectionAddress: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n options?: TokenStandardArg & PaginationArgs & OrderByArg<GetAccountOwnedTokensFromCollectionResponse[0]>;\n }): Promise<GetAccountOwnedTokensFromCollectionResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.TOKEN_V2_PROCESSOR,\n });\n return getAccountOwnedTokensFromCollectionAddress({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Queries for all collections that an account currently has tokens for.\n *\n * This query returns all tokens (v1 and v2 standards) an account owns, including NFTs, fungible, soulbound, etc.\n * If you want to get only the token from a specific standard, you can pass an optional tokenStandard param\n *\n * @example\n * const accountCollectionsWithOwnedTokens = await aptos.getAccountCollectionsWithOwnedTokens({accountAddress:\"0x123\"})\n *\n * @param args.accountAddress The account address we want to get the collections for\n * @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying\n * @param args.options.tokenStandard The NFT standard to query for\n * @param args.options.offset The number collection to start returning results from\n * @param args.options.limit The number of results to return\n * @param args.options.orderBy The order to sort the tokens by\n * @returns Collections array with the collections data\n */\n async getAccountCollectionsWithOwnedTokens(args: {\n accountAddress: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n options?: TokenStandardArg & PaginationArgs & OrderByArg<GetAccountCollectionsWithOwnedTokenResponse[0]>;\n }): Promise<GetAccountCollectionsWithOwnedTokenResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.TOKEN_V2_PROCESSOR,\n });\n return getAccountCollectionsWithOwnedTokens({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Queries the current count of transactions submitted by an account\n *\n * @example\n * const accountTransactionsCount = await aptos.getAccountTransactionsCount({accountAddress:\"0x123\"})\n *\n * @param args.accountAddress The account address we want to get the total count for\n * @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying\n * @returns Current count of transactions made by an account\n */\n async getAccountTransactionsCount(args: {\n accountAddress: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n }): Promise<number> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.ACCOUNT_TRANSACTION_PROCESSOR,\n });\n return getAccountTransactionsCount({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Queries an account's coins data\n *\n * @example\n * const accountCoinsData = await aptos.getAccountCoinsData({accountAddress:\"0x123\"})\n *\n * @param args.accountAddress The account address we want to get the coins data for\n * @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying\n * @param args.options.offset optional. The number coin to start returning results from\n * @param args.options.limit optional. The number of results to return\n * @param args.options.orderBy optional. The order to sort the coins by\n * @param args.options.where optional. Filter the results by\n * @returns Array with the coins data\n */\n async getAccountCoinsData(args: {\n accountAddress: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n options?: PaginationArgs &\n OrderByArg<GetAccountCoinsDataResponse[0]> &\n WhereArg<CurrentFungibleAssetBalancesBoolExp>;\n }): Promise<GetAccountCoinsDataResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.FUNGIBLE_ASSET_PROCESSOR,\n });\n return getAccountCoinsData({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Queries the current count of an account's coins aggregated\n *\n * @example\n * const accountCoinsCount = await aptos.getAccountCoinsCount({accountAddress:\"0x123\"})\n *\n * @param args.accountAddress The account address we want to get the total count for\n * @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying\n * @returns Current count of the aggregated count of all account's coins\n */\n async getAccountCoinsCount(args: {\n accountAddress: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n }): Promise<number> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.FUNGIBLE_ASSET_PROCESSOR,\n });\n return getAccountCoinsCount({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries the account's APT amount\n *\n * @example\n * const accountAPTAmount = await aptos.getAccountAPTAmount({accountAddress:\"0x123\"})\n *\n * @param args.accountAddress The account address we want to get the total count for\n * @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying\n * @returns Current amount of account's APT\n */\n async getAccountAPTAmount(args: {\n accountAddress: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n }): Promise<number> {\n return this.getAccountCoinAmount({ coinType: APTOS_COIN, ...args });\n }\n\n /**\n * Queries the account's coin amount by the coin type\n *\n * @example\n * const accountCoinAmount = await aptos.getAccountCoinAmount({accountAddress:\"0x123\", coinType:\"0x1::aptos_coin::AptosCoin\"})\n *\n * @param args.accountAddress The account address we want to get the total count for\n * @param args.coinType The coin type to query\n * @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying\n * @returns Current amount of account's coin\n */\n async getAccountCoinAmount(args: {\n accountAddress: AccountAddressInput;\n coinType: MoveStructId;\n minimumLedgerVersion?: AnyNumber;\n }): Promise<number> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.FUNGIBLE_ASSET_PROCESSOR,\n });\n return getAccountCoinAmount({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries an account's owned objects\n *\n * @example\n * const accountOwnedObjects = await aptos.getAccountOwnedObjects({accountAddress:\"0x123\"})\n *\n * @param args.accountAddress The account address we want to get the objects for\n * @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying\n * @param args.options.offset The starting position to start returning results from\n * @param args.options.limit The number of results to return\n * @param args.options.orderBy The order to sort the objects by\n * @returns Objects array with the object data\n */\n async getAccountOwnedObjects(args: {\n accountAddress: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n options?: PaginationArgs & OrderByArg<GetAccountOwnedObjectsResponse[0]>;\n }): Promise<GetAccountOwnedObjectsResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.DEFAULT,\n });\n return getAccountOwnedObjects({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Derives an account by providing a private key.\n * This functions resolves the provided private key type and derives the public key from it.\n *\n * If the privateKey is a Secp256k1 type, it derives the account using the derived public key and\n * auth key using the SingleKey scheme locally.\n *\n * If the privateKey is a ED25519 type, it looks up the authentication key on chain, and uses it to resolve\n * whether it is a Legacy ED25519 key or a Unified ED25519 key. It then derives the account based\n * on that.\n *\n * @example\n * const account = await aptos.deriveAccountFromPrivateKey({privateKey:new Ed25519PrivateKey(\"0x123\")})\n *\n * @param args.privateKey An account private key\n * @returns Account type\n */\n async deriveAccountFromPrivateKey(args: { privateKey: PrivateKey }): Promise<AccountModule> {\n return deriveAccountFromPrivateKey({ aptosConfig: this.config, ...args });\n }\n}\n"],"mappings":"2OAkDO,IAAMA,EAAN,KAAc,CACnB,YAAqBC,EAAqB,CAArB,YAAAA,CAAsB,CAiB3C,MAAM,eAAeC,EAAqE,CACxF,OAAOC,EAAQ,CAAE,YAAa,KAAK,OAAQ,GAAGD,CAAK,CAAC,CACtD,CAgBA,MAAM,kBAAkBA,EAGU,CAChC,OAAOE,EAAW,CAAE,YAAa,KAAK,OAAQ,GAAGF,CAAK,CAAC,CACzD,CAqBA,MAAM,iBAAiBA,EAIS,CAC9B,OAAOG,EAAU,CAAE,YAAa,KAAK,OAAQ,GAAGH,CAAK,CAAC,CACxD,CAiBA,MAAM,uBAAuBA,EAGM,CACjC,OAAOI,EAAgB,CACrB,YAAa,KAAK,OAClB,GAAGJ,CACL,CAAC,CACH,CAiBA,MAAM,oBAAoBA,EAGE,CAC1B,OAAOK,EAAa,CAAE,YAAa,KAAK,OAAQ,GAAGL,CAAK,CAAC,CAC3D,CAiBA,MAAM,mBAAuCA,EAI9B,CACb,OAAOM,EAAe,CAAE,YAAa,KAAK,OAAQ,GAAGN,CAAK,CAAC,CAC7D,CAeA,MAAM,6BAA6BA,EAIP,CAC1B,OAAOO,EAA6B,CAAE,YAAa,KAAK,OAAQ,GAAGP,CAAK,CAAC,CAC3E,CAYA,MAAM,sBAAsBA,EAGR,CAClB,aAAMQ,EAAwB,CAC5B,OAAQ,KAAK,OACb,qBAAsBR,EAAK,qBAC3B,8CACF,CAAC,EACMS,EAAsB,CAC3B,YAAa,KAAK,OAClB,GAAGT,CACL,CAAC,CACH,CAmBA,MAAM,sBAAsBA,EAIoB,CAC9C,aAAMQ,EAAwB,CAC5B,OAAQ,KAAK,OACb,qBAAsBR,EAAK,qBAC3B,kCACF,CAAC,EACMU,EAAsB,CAC3B,YAAa,KAAK,OAClB,GAAGV,CACL,CAAC,CACH,CAoBA,MAAM,2CAA2CA,EAKQ,CACvD,aAAMQ,EAAwB,CAC5B,OAAQ,KAAK,OACb,qBAAsBR,EAAK,qBAC3B,kCACF,CAAC,EACMW,EAA2C,CAChD,YAAa,KAAK,OAClB,GAAGX,CACL,CAAC,CACH,CAmBA,MAAM,qCAAqCA,EAIc,CACvD,aAAMQ,EAAwB,CAC5B,OAAQ,KAAK,OACb,qBAAsBR,EAAK,qBAC3B,kCACF,CAAC,EACMY,EAAqC,CAC1C,YAAa,KAAK,OAClB,GAAGZ,CACL,CAAC,CACH,CAYA,MAAM,4BAA4BA,EAGd,CAClB,aAAMQ,EAAwB,CAC5B,OAAQ,KAAK,OACb,qBAAsBR,EAAK,qBAC3B,8CACF,CAAC,EACMa,EAA4B,CACjC,YAAa,KAAK,OAClB,GAAGb,CACL,CAAC,CACH,CAgBA,MAAM,oBAAoBA,EAMe,CACvC,aAAMQ,EAAwB,CAC5B,OAAQ,KAAK,OACb,qBAAsBR,EAAK,qBAC3B,wCACF,CAAC,EACMc,EAAoB,CACzB,YAAa,KAAK,OAClB,GAAGd,CACL,CAAC,CACH,CAYA,MAAM,qBAAqBA,EAGP,CAClB,aAAMQ,EAAwB,CAC5B,OAAQ,KAAK,OACb,qBAAsBR,EAAK,qBAC3B,wCACF,CAAC,EACMe,EAAqB,CAAE,YAAa,KAAK,OAAQ,GAAGf,CAAK,CAAC,CACnE,CAYA,MAAM,oBAAoBA,EAGN,CAClB,OAAO,KAAK,qBAAqB,CAAE,SAAUgB,EAAY,GAAGhB,CAAK,CAAC,CACpE,CAaA,MAAM,qBAAqBA,EAIP,CAClB,aAAMQ,EAAwB,CAC5B,OAAQ,KAAK,OACb,qBAAsBR,EAAK,qBAC3B,wCACF,CAAC,EACMiB,EAAqB,CAAE,YAAa,KAAK,OAAQ,GAAGjB,CAAK,CAAC,CACnE,CAeA,MAAM,uBAAuBA,EAIe,CAC1C,aAAMQ,EAAwB,CAC5B,OAAQ,KAAK,OACb,qBAAsBR,EAAK,qBAC3B,iCACF,CAAC,EACMkB,EAAuB,CAC5B,YAAa,KAAK,OAClB,GAAGlB,CACL,CAAC,CACH,CAmBA,MAAM,4BAA4BA,EAA0D,CAC1F,OAAOmB,EAA4B,CAAE,YAAa,KAAK,OAAQ,GAAGnB,CAAK,CAAC,CAC1E,CACF","names":["Account","config","args","getInfo","getModules","getModule","getTransactions","getResources","getResource","lookupOriginalAccountAddress","waitForIndexerOnVersion","getAccountTokensCount","getAccountOwnedTokens","getAccountOwnedTokensFromCollectionAddress","getAccountCollectionsWithOwnedTokens","getAccountTransactionsCount","getAccountCoinsData","getAccountCoinsCount","APTOS_COIN","getAccountCoinAmount","getAccountOwnedObjects","deriveAccountFromPrivateKey"]}
@@ -0,0 +1,2 @@
1
+ import{a as i}from"./chunk-3N6N3KOS.mjs";import{a as b,b as g}from"./chunk-MCRRHBFQ.mjs";import{a as h,c as p}from"./chunk-T2AGN5YT.mjs";import{b as a}from"./chunk-QRS4DGP3.mjs";import{a as y}from"./chunk-36QXVFR5.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-AQAH67IV.mjs.map
@@ -0,0 +1,2 @@
1
+ import{a as e}from"./chunk-36QXVFR5.mjs";var r=class t extends e{constructor(i){super(),this.identifier=i}serialize(i){i.serializeStr(this.identifier)}static deserialize(i){let s=i.deserializeStr();return new t(s)}};export{r as a};
2
+ //# sourceMappingURL=chunk-B7X6PSE7.mjs.map
@@ -1,2 +1,2 @@
1
- import{a}from"./chunk-FBPNHF54.mjs";import{bytesToHex as s,hexToBytes as o}from"@noble/hashes/utils";var l=(e=>(e.TOO_SHORT="too_short",e.INVALID_LENGTH="invalid_length",e.INVALID_HEX_CHARS="invalid_hex_chars",e))(l||{}),i=class n{constructor(t){this.data=t}toUint8Array(){return this.data}toStringWithoutPrefix(){return s(this.data)}toString(){return`0x${this.toStringWithoutPrefix()}`}static fromHexString(t){let r=t;if(r.startsWith("0x")&&(r=r.slice(2)),r.length===0)throw new a("Hex string is too short, must be at least 1 char long, excluding the optional leading 0x.","too_short");if(r.length%2!==0)throw new a("Hex string must be an even number of hex characters.","invalid_length");try{return new n(o(r))}catch(e){throw new a(`Hex string contains invalid hex characters: ${e?.message}`,"invalid_hex_chars")}}static fromHexInput(t){return t instanceof Uint8Array?new n(t):n.fromHexString(t)}static isValid(t){try{return n.fromHexString(t),{valid:!0}}catch(r){return{valid:!1,invalidReason:r?.invalidReason,invalidReasonMessage:r?.message}}}equals(t){return this.data.length!==t.data.length?!1:this.data.every((r,e)=>r===t.data[e])}};export{l as a,i as b};
2
- //# sourceMappingURL=chunk-AOCNYMMX.mjs.map
1
+ import{a}from"./chunk-LG7RJQ57.mjs";import{bytesToHex as s,hexToBytes as o}from"@noble/hashes/utils";var l=(e=>(e.TOO_SHORT="too_short",e.INVALID_LENGTH="invalid_length",e.INVALID_HEX_CHARS="invalid_hex_chars",e))(l||{}),i=class n{constructor(t){this.data=t}toUint8Array(){return this.data}toStringWithoutPrefix(){return s(this.data)}toString(){return`0x${this.toStringWithoutPrefix()}`}static fromHexString(t){let r=t;if(r.startsWith("0x")&&(r=r.slice(2)),r.length===0)throw new a("Hex string is too short, must be at least 1 char long, excluding the optional leading 0x.","too_short");if(r.length%2!==0)throw new a("Hex string must be an even number of hex characters.","invalid_length");try{return new n(o(r))}catch(e){throw new a(`Hex string contains invalid hex characters: ${e?.message}`,"invalid_hex_chars")}}static fromHexInput(t){return t instanceof Uint8Array?new n(t):n.fromHexString(t)}static isValid(t){try{return n.fromHexString(t),{valid:!0}}catch(r){return{valid:!1,invalidReason:r?.invalidReason,invalidReasonMessage:r?.message}}}equals(t){return this.data.length!==t.data.length?!1:this.data.every((r,e)=>r===t.data[e])}};export{l as a,i as b};
2
+ //# sourceMappingURL=chunk-BCUSI3N6.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as n}from"./chunk-OGHE4AQA.mjs";import{b as i}from"./chunk-IOSQVDZI.mjs";import{a as d}from"./chunk-52C73T26.mjs";var o=class t extends d{constructor(e,s,r){super();this.rawTransaction=e,this.feePayerAddress=r,this.secondarySignerAddresses=s}serialize(e){this.rawTransaction.serialize(e),e.serializeVector(this.secondarySignerAddresses),this.feePayerAddress===void 0?e.serializeBool(!1):(e.serializeBool(!0),this.feePayerAddress.serialize(e))}static deserialize(e){let s=n.deserialize(e),r=e.deserializeVector(i),c=e.deserializeBool(),a;return c&&(a=i.deserialize(e)),new t(s,r,a)}};export{o as a};
2
- //# sourceMappingURL=chunk-BAV4XY7C.mjs.map
1
+ import{a as n}from"./chunk-BO2TLWNT.mjs";import{b as i}from"./chunk-QRS4DGP3.mjs";import{a as d}from"./chunk-36QXVFR5.mjs";var o=class t extends d{constructor(e,s,r){super(),this.rawTransaction=e,this.feePayerAddress=r,this.secondarySignerAddresses=s}serialize(e){this.rawTransaction.serialize(e),e.serializeVector(this.secondarySignerAddresses),this.feePayerAddress===void 0?e.serializeBool(!1):(e.serializeBool(!0),this.feePayerAddress.serialize(e))}static deserialize(e){let s=n.deserialize(e),r=e.deserializeVector(i),c=e.deserializeBool(),a;return c&&(a=i.deserialize(e)),new t(s,r,a)}};export{o as a};
2
+ //# sourceMappingURL=chunk-BHLICYAI.mjs.map
@@ -0,0 +1,2 @@
1
+ import{b as h}from"./chunk-7VRZLDIJ.mjs";import{a as y}from"./chunk-PF57EOJY.mjs";import{b as n}from"./chunk-QRS4DGP3.mjs";import{a as _}from"./chunk-36QXVFR5.mjs";var t=class i extends _{constructor(e,s,a,r,c,d,l){super(),this.sender=e,this.sequence_number=s,this.payload=a,this.max_gas_amount=r,this.gas_unit_price=c,this.expiration_timestamp_secs=d,this.chain_id=l}serialize(e){this.sender.serialize(e),e.serializeU64(this.sequence_number),this.payload.serialize(e),e.serializeU64(this.max_gas_amount),e.serializeU64(this.gas_unit_price),e.serializeU64(this.expiration_timestamp_secs),this.chain_id.serialize(e)}static deserialize(e){let s=n.deserialize(e),a=e.deserializeU64(),r=h.deserialize(e),c=e.deserializeU64(),d=e.deserializeU64(),l=e.deserializeU64(),m=y.deserialize(e);return new i(s,a,r,c,d,l,m)}},o=class extends _{static deserialize(e){let s=e.deserializeUleb128AsU32();switch(s){case 0:return u.load(e);case 1:return p.load(e);default:throw new Error(`Unknown variant index for RawTransactionWithData: ${s}`)}}},u=class i extends o{constructor(e,s){super(),this.raw_txn=e,this.secondary_signer_addresses=s}serialize(e){e.serializeU32AsUleb128(0),this.raw_txn.serialize(e),e.serializeVector(this.secondary_signer_addresses)}static load(e){let s=t.deserialize(e),a=e.deserializeVector(n);return new i(s,a)}},p=class i extends o{constructor(e,s,a){super(),this.raw_txn=e,this.secondary_signer_addresses=s,this.fee_payer_address=a}serialize(e){e.serializeU32AsUleb128(1),this.raw_txn.serialize(e),e.serializeVector(this.secondary_signer_addresses),this.fee_payer_address.serialize(e)}static load(e){let s=t.deserialize(e),a=e.deserializeVector(n),r=n.deserialize(e);return new i(s,a,r)}};export{t as a,o as b,u as c,p as d};
2
+ //# sourceMappingURL=chunk-BO2TLWNT.mjs.map
@@ -0,0 +1,2 @@
1
+ import{a as r}from"./chunk-36QXVFR5.mjs";import{b as i}from"./chunk-BCUSI3N6.mjs";var t=class a extends r{constructor(e){super(),this.value=i.fromHexInput(e).toUint8Array()}serialize(e){e.serializeFixedBytes(this.value)}serializeForEntryFunction(e){e.serialize(this)}serializeForScriptFunction(e){e.serialize(this)}static deserialize(e,s){let o=e.deserializeFixedBytes(s);return new a(o)}};export{t as a};
2
+ //# sourceMappingURL=chunk-CEHCDA3G.mjs.map
@@ -0,0 +1,2 @@
1
+ var o="1.15.0";export{o as a};
2
+ //# sourceMappingURL=chunk-CJDEPZ4J.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/version.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * The current version of the SDK\n *\n * hardcoded for now, we would want to have it injected dynamically\n */\nexport const VERSION = \"1.14.0\";\n"],"mappings":"AAQO,IAAMA,EAAU","names":["VERSION"]}
1
+ {"version":3,"sources":["../../src/version.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * The current version of the SDK\n *\n * hardcoded for now, we would want to have it injected dynamically\n */\nexport const VERSION = \"1.15.0\";\n"],"mappings":"AAQO,IAAMA,EAAU","names":["VERSION"]}
@@ -1,2 +1,2 @@
1
- import{b as s}from"./chunk-6EMN3BOV.mjs";import{f as r}from"./chunk-UF534PKA.mjs";import{a as o}from"./chunk-FVA2OPG4.mjs";var i=class{constructor(n){this.config=n}async simple(n){return r({aptosConfig:this.config,...n})}async multiAgent(n){return r({aptosConfig:this.config,...n})}};o([s],i.prototype,"simple",1),o([s],i.prototype,"multiAgent",1);export{i as a};
2
- //# sourceMappingURL=chunk-4P5EKAJB.mjs.map
1
+ import{b as s}from"./chunk-6EMN3BOV.mjs";import{f as r}from"./chunk-K7HX7JQH.mjs";import{a as o}from"./chunk-FVA2OPG4.mjs";var i=class{constructor(n){this.config=n}async simple(n){return r({aptosConfig:this.config,...n})}async multiAgent(n){return r({aptosConfig:this.config,...n})}};o([s],i.prototype,"simple",1),o([s],i.prototype,"multiAgent",1);export{i as a};
2
+ //# sourceMappingURL=chunk-CWUH4PNH.mjs.map
@@ -0,0 +1,2 @@
1
+ import{e as o}from"./chunk-3N6N3KOS.mjs";import{a as g,b as c}from"./chunk-PIVZMT5D.mjs";var y=class a{constructor(i){let{multiKey:n,signers:s}=i;this.publicKey=n,this.signingScheme=3,this.accountAddress=this.publicKey.authKey().derivedAddress();let r=[];for(let e of s)r.push(this.publicKey.getIndex(e.publicKey));let t=s.map((e,u)=>[e,r[u]]);t.sort((e,u)=>e[1]-u[1]),this.signers=t.map(e=>e[0]),this.signerIndicies=t.map(e=>e[1]),this.signaturesBitmap=this.publicKey.createBitmap({bits:r})}static fromPublicKeysAndSigners(i){let{publicKeys:n,signaturesRequired:s,signers:r}=i,t=new g({publicKeys:n,signaturesRequired:s});return new a({multiKey:t,signers:r})}static isMultiKeySigner(i){return i instanceof a}signWithAuthenticator(i){return new o(this.publicKey,this.sign(i))}signTransactionWithAuthenticator(i){return new o(this.publicKey,this.signTransaction(i))}sign(i){let n=[];for(let s of this.signers)n.push(s.sign(i));return new c({signatures:n,bitmap:this.signaturesBitmap})}signTransaction(i){let n=[];for(let s of this.signers)n.push(s.signTransaction(i));return new c({signatures:n,bitmap:this.signaturesBitmap})}verifySignature(i){let{message:n,signature:s}=i;if(!this.signerIndicies.every((t,e)=>e===0||t>=this.signerIndicies[e-1]))return!1;for(let t=0;t<s.signatures.length;t+=1){let e=s.signatures[t];if(!this.publicKey.publicKeys[this.signerIndicies[t]].verifySignature({message:n,signature:e}))return!1}return!0}};export{y as a};
2
+ //# sourceMappingURL=chunk-DLAIJ2UM.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/account/MultiKeyAccount.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Account } from \"./Account\";\nimport { MultiKey, MultiKeySignature, PublicKey } from \"../core/crypto\";\nimport { AccountAddress } from \"../core/accountAddress\";\nimport { HexInput, SigningScheme } from \"../types\";\nimport { AccountAuthenticatorMultiKey } from \"../transactions/authenticator/account\";\nimport { AnyRawTransaction } from \"../transactions/types\";\n\nexport interface VerifyMultiKeySignatureArgs {\n message: HexInput;\n signature: MultiKeySignature;\n}\n\n/**\n * Signer implementation for the MultiKey authentication scheme.\n *\n * This accounts to use a M of N signing scheme. M and N are specified in the {@link MultiKey}\n * It signs messages via the array of M number of Accounts that individually correspond to a public key in the {@link MultiKey}.\n *\n * Note: Generating a signer instance does not create the account on-chain.\n */\nexport class MultiKeyAccount implements Account {\n /**\n * Public key associated with the account\n */\n readonly publicKey: MultiKey;\n\n /**\n * Account address associated with the account\n */\n readonly accountAddress: AccountAddress;\n\n /**\n * Signing scheme used to sign transactions\n */\n readonly signingScheme: SigningScheme;\n\n /**\n * The signers used to sign messages. These signers should correspond to public keys in the\n * MultiKeyAccount's public key. The number of signers should be equal or greater\n * than this.publicKey.signaturesRequired\n */\n readonly signers: Account[];\n\n /**\n * An array of indicies where for signer[i], signerIndicies[i] is the index of the corresponding public key in\n * publicKey.publicKeys. Used to derive the right public key to use for verification.\n */\n readonly signerIndicies: number[];\n\n readonly signaturesBitmap: Uint8Array;\n\n /**\n * constructor for MultiKeyAccount\n *\n * @param args.multiKey the multikey of the account which consists of N public keys and a number M which is\n * the number of required signatures.\n * @param args.signers an array of M signers that will be used to sign the transaction\n * @returns MultiKeyAccount\n */\n constructor(args: { multiKey: MultiKey; signers: Account[] }) {\n const { multiKey, signers } = args;\n\n this.publicKey = multiKey;\n this.signingScheme = SigningScheme.MultiKey;\n\n this.accountAddress = this.publicKey.authKey().derivedAddress();\n\n // Get the index of each respective signer in the bitmap\n const bitPositions: number[] = [];\n for (const signer of signers) {\n bitPositions.push(this.publicKey.getIndex(signer.publicKey));\n }\n // Zip signers and bit positions and sort signers by bit positions in order\n // to ensure the signature is signed in ascending order according to the bitmap.\n // Authentication on chain will fail otherwise.\n const signersAndBitPosition: [Account, number][] = signers.map((signer, index) => [signer, bitPositions[index]]);\n signersAndBitPosition.sort((a, b) => a[1] - b[1]);\n this.signers = signersAndBitPosition.map((value) => value[0]);\n this.signerIndicies = signersAndBitPosition.map((value) => value[1]);\n this.signaturesBitmap = this.publicKey.createBitmap({ bits: bitPositions });\n }\n\n /**\n * Static constructor for MultiKeyAccount\n *\n * @param args.publicKeys the N public keys of the MultiKeyAccount\n * @param args.signaturesRequired the number of signatures required\n * @param args.signers an array of M signers that will be used to sign the transaction\n * @returns MultiKeyAccount\n */\n static fromPublicKeysAndSigners(args: {\n publicKeys: PublicKey[];\n signaturesRequired: number;\n signers: Account[];\n }): MultiKeyAccount {\n const { publicKeys, signaturesRequired, signers } = args;\n const multiKey = new MultiKey({ publicKeys, signaturesRequired });\n return new MultiKeyAccount({ multiKey, signers });\n }\n\n static isMultiKeySigner(account: Account): account is MultiKeyAccount {\n return account instanceof MultiKeyAccount;\n }\n\n /**\n * Sign a message using the account's signers.\n * @param message the signing message, as binary input\n * @return the AccountAuthenticator containing the signature, together with the account's public key\n */\n signWithAuthenticator(message: HexInput): AccountAuthenticatorMultiKey {\n return new AccountAuthenticatorMultiKey(this.publicKey, this.sign(message));\n }\n\n /**\n * Sign a transaction using the account's signers.\n * @param transaction the raw transaction\n * @return the AccountAuthenticator containing the signature of the transaction, together with the account's public key\n */\n signTransactionWithAuthenticator(transaction: AnyRawTransaction): AccountAuthenticatorMultiKey {\n return new AccountAuthenticatorMultiKey(this.publicKey, this.signTransaction(transaction));\n }\n\n /**\n * Sign the given message using the MultiKeyAccount's signers\n * @param message in HexInput format\n * @returns MultiKeySignature\n */\n sign(data: HexInput): MultiKeySignature {\n const signatures = [];\n for (const signer of this.signers) {\n signatures.push(signer.sign(data));\n }\n return new MultiKeySignature({ signatures, bitmap: this.signaturesBitmap });\n }\n\n /**\n * Sign the given transaction using the MultiKeyAccount's signers\n * @param transaction the transaction to be signed\n * @returns MultiKeySignature\n */\n signTransaction(transaction: AnyRawTransaction): MultiKeySignature {\n const signatures = [];\n for (const signer of this.signers) {\n signatures.push(signer.signTransaction(transaction));\n }\n return new MultiKeySignature({ signatures, bitmap: this.signaturesBitmap });\n }\n\n /**\n * Verify the given message and signature with the public key.\n *\n * @param args.message raw message data in HexInput format\n * @param args.signatures signed message MultiKeySignature\n * @returns boolean\n */\n verifySignature(args: VerifyMultiKeySignatureArgs): boolean {\n const { message, signature } = args;\n const isSignerIndiciesSorted = this.signerIndicies.every(\n (value, i) => i === 0 || value >= this.signerIndicies[i - 1],\n );\n if (!isSignerIndiciesSorted) {\n return false;\n }\n for (let i = 0; i < signature.signatures.length; i += 1) {\n const singleSignature = signature.signatures[i];\n const publicKey = this.publicKey.publicKeys[this.signerIndicies[i]];\n if (!publicKey.verifySignature({ message, signature: singleSignature })) {\n return false;\n }\n }\n return true;\n }\n}\n"],"mappings":"yFAuBO,IAAMA,EAAN,MAAMC,CAAmC,CAuC9C,YAAYC,EAAkD,CAC5D,GAAM,CAAE,SAAAC,EAAU,QAAAC,CAAQ,EAAIF,EAE9B,KAAK,UAAYC,EACjB,KAAK,cAAgB,EAErB,KAAK,eAAiB,KAAK,UAAU,QAAQ,EAAE,eAAe,EAG9D,IAAME,EAAyB,CAAC,EAChC,QAAWC,KAAUF,EACnBC,EAAa,KAAK,KAAK,UAAU,SAASC,EAAO,SAAS,CAAC,EAK7D,IAAMC,EAA6CH,EAAQ,IAAI,CAACE,EAAQE,IAAU,CAACF,EAAQD,EAAaG,CAAK,CAAC,CAAC,EAC/GD,EAAsB,KAAK,CAACE,EAAGC,IAAMD,EAAE,CAAC,EAAIC,EAAE,CAAC,CAAC,EAChD,KAAK,QAAUH,EAAsB,IAAKI,GAAUA,EAAM,CAAC,CAAC,EAC5D,KAAK,eAAiBJ,EAAsB,IAAKI,GAAUA,EAAM,CAAC,CAAC,EACnE,KAAK,iBAAmB,KAAK,UAAU,aAAa,CAAE,KAAMN,CAAa,CAAC,CAC5E,CAUA,OAAO,yBAAyBH,EAIZ,CAClB,GAAM,CAAE,WAAAU,EAAY,mBAAAC,EAAoB,QAAAT,CAAQ,EAAIF,EAC9CC,EAAW,IAAIW,EAAS,CAAE,WAAAF,EAAY,mBAAAC,CAAmB,CAAC,EAChE,OAAO,IAAIZ,EAAgB,CAAE,SAAAE,EAAU,QAAAC,CAAQ,CAAC,CAClD,CAEA,OAAO,iBAAiBW,EAA8C,CACpE,OAAOA,aAAmBd,CAC5B,CAOA,sBAAsBe,EAAiD,CACrE,OAAO,IAAIC,EAA6B,KAAK,UAAW,KAAK,KAAKD,CAAO,CAAC,CAC5E,CAOA,iCAAiCE,EAA8D,CAC7F,OAAO,IAAID,EAA6B,KAAK,UAAW,KAAK,gBAAgBC,CAAW,CAAC,CAC3F,CAOA,KAAKC,EAAmC,CACtC,IAAMC,EAAa,CAAC,EACpB,QAAWd,KAAU,KAAK,QACxBc,EAAW,KAAKd,EAAO,KAAKa,CAAI,CAAC,EAEnC,OAAO,IAAIE,EAAkB,CAAE,WAAAD,EAAY,OAAQ,KAAK,gBAAiB,CAAC,CAC5E,CAOA,gBAAgBF,EAAmD,CACjE,IAAME,EAAa,CAAC,EACpB,QAAWd,KAAU,KAAK,QACxBc,EAAW,KAAKd,EAAO,gBAAgBY,CAAW,CAAC,EAErD,OAAO,IAAIG,EAAkB,CAAE,WAAAD,EAAY,OAAQ,KAAK,gBAAiB,CAAC,CAC5E,CASA,gBAAgBlB,EAA4C,CAC1D,GAAM,CAAE,QAAAc,EAAS,UAAAM,CAAU,EAAIpB,EAI/B,GAAI,CAH2B,KAAK,eAAe,MACjD,CAACS,EAAOY,IAAMA,IAAM,GAAKZ,GAAS,KAAK,eAAeY,EAAI,CAAC,CAC7D,EAEE,MAAO,GAET,QAASA,EAAI,EAAGA,EAAID,EAAU,WAAW,OAAQC,GAAK,EAAG,CACvD,IAAMC,EAAkBF,EAAU,WAAWC,CAAC,EAE9C,GAAI,CADc,KAAK,UAAU,WAAW,KAAK,eAAeA,CAAC,CAAC,EACnD,gBAAgB,CAAE,QAAAP,EAAS,UAAWQ,CAAgB,CAAC,EACpE,MAAO,EAEX,CACA,MAAO,EACT,CACF","names":["MultiKeyAccount","_MultiKeyAccount","args","multiKey","signers","bitPositions","signer","signersAndBitPosition","index","a","b","value","publicKeys","signaturesRequired","MultiKey","account","message","AccountAuthenticatorMultiKey","transaction","data","signatures","MultiKeySignature","signature","i","singleSignature"]}
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-4374JPA6.mjs";import{a as e}from"./chunk-3JPVQHOR.mjs";var n=()=>Math.floor(Date.now()/1e3),r=class{constructor(t,i,o,a,c){this.lastUncommintedNumber=null;this.currentNumber=null;this.lock=!1;this.aptosConfig=t,this.account=i,this.maxWaitTime=o,this.maximumInFlight=a,this.sleepTime=c}async nextSequenceNumber(){for(;this.lock;)await e(this.sleepTime);this.lock=!0;let t=BigInt(0);try{if((this.lastUncommintedNumber===null||this.currentNumber===null)&&await this.initialize(),this.currentNumber-this.lastUncommintedNumber>=this.maximumInFlight){await this.update();let i=n();for(;this.currentNumber-this.lastUncommintedNumber>=this.maximumInFlight;)await e(this.sleepTime),n()-i>this.maxWaitTime?(console.warn(`Waited over 30 seconds for a transaction to commit, resyncing ${this.account.accountAddress.toString()}`),await this.initialize()):await this.update()}t=this.currentNumber,this.currentNumber+=BigInt(1)}catch(i){console.error("error in getting next sequence number for this account",i)}finally{this.lock=!1}return t}async initialize(){let{sequence_number:t}=await s({aptosConfig:this.aptosConfig,accountAddress:this.account.accountAddress});this.currentNumber=BigInt(t),this.lastUncommintedNumber=BigInt(t)}async update(){let{sequence_number:t}=await s({aptosConfig:this.aptosConfig,accountAddress:this.account.accountAddress});return this.lastUncommintedNumber=BigInt(t),this.lastUncommintedNumber}async synchronize(){if(this.lastUncommintedNumber!==this.currentNumber){for(;this.lock;)await e(this.sleepTime);this.lock=!0;try{await this.update();let t=n();for(;this.lastUncommintedNumber!==this.currentNumber;)n()-t>this.maxWaitTime?(console.warn(`Waited over 30 seconds for a transaction to commit, resyncing ${this.account.accountAddress.toString()}`),await this.initialize()):(await e(this.sleepTime),await this.update())}catch(t){console.error("error in synchronizing this account sequence number with the one on chain",t)}finally{this.lock=!1}}}};export{r as a};
2
- //# sourceMappingURL=chunk-HG4Q4EFG.mjs.map
1
+ import{a as s}from"./chunk-3HSXKDOC.mjs";import{a as e}from"./chunk-3JPVQHOR.mjs";var n=()=>Math.floor(Date.now()/1e3),r=class{constructor(t,i,o,a,c){this.lastUncommintedNumber=null;this.currentNumber=null;this.lock=!1;this.aptosConfig=t,this.account=i,this.maxWaitTime=o,this.maximumInFlight=a,this.sleepTime=c}async nextSequenceNumber(){for(;this.lock;)await e(this.sleepTime);this.lock=!0;let t=BigInt(0);try{if((this.lastUncommintedNumber===null||this.currentNumber===null)&&await this.initialize(),this.currentNumber-this.lastUncommintedNumber>=this.maximumInFlight){await this.update();let i=n();for(;this.currentNumber-this.lastUncommintedNumber>=this.maximumInFlight;)await e(this.sleepTime),n()-i>this.maxWaitTime?(console.warn(`Waited over 30 seconds for a transaction to commit, resyncing ${this.account.accountAddress.toString()}`),await this.initialize()):await this.update()}t=this.currentNumber,this.currentNumber+=BigInt(1)}catch(i){console.error("error in getting next sequence number for this account",i)}finally{this.lock=!1}return t}async initialize(){let{sequence_number:t}=await s({aptosConfig:this.aptosConfig,accountAddress:this.account.accountAddress});this.currentNumber=BigInt(t),this.lastUncommintedNumber=BigInt(t)}async update(){let{sequence_number:t}=await s({aptosConfig:this.aptosConfig,accountAddress:this.account.accountAddress});return this.lastUncommintedNumber=BigInt(t),this.lastUncommintedNumber}async synchronize(){if(this.lastUncommintedNumber!==this.currentNumber){for(;this.lock;)await e(this.sleepTime);this.lock=!0;try{await this.update();let t=n();for(;this.lastUncommintedNumber!==this.currentNumber;)n()-t>this.maxWaitTime?(console.warn(`Waited over 30 seconds for a transaction to commit, resyncing ${this.account.accountAddress.toString()}`),await this.initialize()):(await e(this.sleepTime),await this.update())}catch(t){console.error("error in synchronizing this account sequence number with the one on chain",t)}finally{this.lock=!1}}}};export{r as a};
2
+ //# sourceMappingURL=chunk-E2NVC2VR.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/transactions/management/accountSequenceNumber.ts"],"sourcesContent":["/**\n * A wrapper that handles and manages an account sequence number.\n *\n * Submit up to `maximumInFlight` transactions per account in parallel with a timeout of `sleepTime`\n * If local assumes `maximumInFlight` are in flight, determine the actual committed state from the network\n * If there are less than `maximumInFlight` due to some being committed, adjust the window\n * If `maximumInFlight` are in flight, wait `sleepTime` seconds before re-evaluating\n * If ever waiting more than `maxWaitTime` restart the sequence number to the current on-chain state\n *\n * Assumptions:\n * Accounts are expected to be managed by a single AccountSequenceNumber and not used otherwise.\n * They are initialized to the current on-chain state, so if there are already transactions in\n * flight, they may take some time to reset.\n * Accounts are automatically initialized if not explicitly\n *\n * Notes:\n * This is co-routine safe, that is many async tasks can be reading from this concurrently.\n * The state of an account cannot be used across multiple AccountSequenceNumber services.\n * The synchronize method will create a barrier that prevents additional nextSequenceNumber\n * calls until it is complete.\n * This only manages the distribution of sequence numbers it does not help handle transaction\n * failures.\n * If a transaction fails, you should call synchronize and wait for timeouts.\n */\n\nimport { AptosConfig } from \"../../api/aptosConfig\";\nimport { Account } from \"../../account\";\nimport { getInfo } from \"../../internal/account\";\nimport { sleep } from \"../../utils/helpers\";\n\n// returns `now` time in seconds\nconst now = () => Math.floor(Date.now() / 1000);\n\nexport class AccountSequenceNumber {\n readonly aptosConfig: AptosConfig;\n\n readonly account: Account;\n\n // sequence number on chain\n lastUncommintedNumber: bigint | null = null;\n\n // local sequence number\n currentNumber: bigint | null = null;\n\n /**\n * We want to guarantee that we preserve ordering of workers to requests.\n *\n * `lock` is used to try to prevent multiple coroutines from accessing a shared resource at the same time,\n * which can result in race conditions and data inconsistency.\n * This code actually doesn't do it though, since we aren't giving out a slot, it is still somewhat a race condition.\n *\n * The ideal solution is likely that each thread grabs the next number from a incremental integer.\n * When they complete, they increment that number and that entity is able to enter the `lock`.\n * That would guarantee ordering.\n */\n lock = false;\n\n maxWaitTime: number;\n\n maximumInFlight: number;\n\n sleepTime: number;\n\n constructor(\n aptosConfig: AptosConfig,\n account: Account,\n maxWaitTime: number,\n maximumInFlight: number,\n sleepTime: number,\n ) {\n this.aptosConfig = aptosConfig;\n this.account = account;\n this.maxWaitTime = maxWaitTime;\n this.maximumInFlight = maximumInFlight;\n this.sleepTime = sleepTime;\n }\n\n /**\n * Returns the next available sequence number for this account\n *\n * @returns next available sequence number\n */\n async nextSequenceNumber(): Promise<bigint | null> {\n /* eslint-disable no-await-in-loop */\n while (this.lock) {\n await sleep(this.sleepTime);\n }\n\n this.lock = true;\n let nextNumber = BigInt(0);\n try {\n if (this.lastUncommintedNumber === null || this.currentNumber === null) {\n await this.initialize();\n }\n\n if (this.currentNumber! - this.lastUncommintedNumber! >= this.maximumInFlight) {\n await this.update();\n\n const startTime = now();\n while (this.currentNumber! - this.lastUncommintedNumber! >= this.maximumInFlight) {\n await sleep(this.sleepTime);\n if (now() - startTime > this.maxWaitTime) {\n /* eslint-disable no-console */\n console.warn(\n `Waited over 30 seconds for a transaction to commit, resyncing ${this.account.accountAddress.toString()}`,\n );\n await this.initialize();\n } else {\n await this.update();\n }\n }\n }\n nextNumber = this.currentNumber!;\n this.currentNumber! += BigInt(1);\n } catch (e) {\n console.error(\"error in getting next sequence number for this account\", e);\n } finally {\n this.lock = false;\n }\n return nextNumber;\n }\n\n /**\n * Initializes this account with the sequence number on chain\n */\n async initialize(): Promise<void> {\n const { sequence_number: sequenceNumber } = await getInfo({\n aptosConfig: this.aptosConfig,\n accountAddress: this.account.accountAddress,\n });\n this.currentNumber = BigInt(sequenceNumber);\n this.lastUncommintedNumber = BigInt(sequenceNumber);\n }\n\n /**\n * Updates this account sequence number with the one on-chain\n *\n * @returns on-chain sequence number for this account\n */\n async update(): Promise<bigint> {\n const { sequence_number: sequenceNumber } = await getInfo({\n aptosConfig: this.aptosConfig,\n accountAddress: this.account.accountAddress,\n });\n this.lastUncommintedNumber = BigInt(sequenceNumber);\n return this.lastUncommintedNumber;\n }\n\n /**\n * Synchronizes local sequence number with the seqeunce number on chain for this account.\n *\n * Poll the network until all submitted transactions have either been committed or until\n * the maximum wait time has elapsed\n */\n async synchronize(): Promise<void> {\n if (this.lastUncommintedNumber === this.currentNumber) return;\n\n /* eslint-disable no-await-in-loop */\n while (this.lock) {\n await sleep(this.sleepTime);\n }\n\n this.lock = true;\n\n try {\n await this.update();\n const startTime = now();\n while (this.lastUncommintedNumber !== this.currentNumber) {\n if (now() - startTime > this.maxWaitTime) {\n /* eslint-disable no-console */\n console.warn(\n `Waited over 30 seconds for a transaction to commit, resyncing ${this.account.accountAddress.toString()}`,\n );\n await this.initialize();\n } else {\n await sleep(this.sleepTime);\n await this.update();\n }\n }\n } catch (e) {\n console.error(\"error in synchronizing this account sequence number with the one on chain\", e);\n } finally {\n this.lock = false;\n }\n }\n}\n"],"mappings":"kFA+BA,IAAMA,EAAM,IAAM,KAAK,MAAM,KAAK,IAAI,EAAI,GAAI,EAEjCC,EAAN,KAA4B,CA8BjC,YACEC,EACAC,EACAC,EACAC,EACAC,EACA,CA9BF,2BAAuC,KAGvC,mBAA+B,KAa/B,UAAO,GAeL,KAAK,YAAcJ,EACnB,KAAK,QAAUC,EACf,KAAK,YAAcC,EACnB,KAAK,gBAAkBC,EACvB,KAAK,UAAYC,CACnB,CAOA,MAAM,oBAA6C,CAEjD,KAAO,KAAK,MACV,MAAMC,EAAM,KAAK,SAAS,EAG5B,KAAK,KAAO,GACZ,IAAIC,EAAa,OAAO,CAAC,EACzB,GAAI,CAKF,IAJI,KAAK,wBAA0B,MAAQ,KAAK,gBAAkB,OAChE,MAAM,KAAK,WAAW,EAGpB,KAAK,cAAiB,KAAK,uBAA0B,KAAK,gBAAiB,CAC7E,MAAM,KAAK,OAAO,EAElB,IAAMC,EAAYT,EAAI,EACtB,KAAO,KAAK,cAAiB,KAAK,uBAA0B,KAAK,iBAC/D,MAAMO,EAAM,KAAK,SAAS,EACtBP,EAAI,EAAIS,EAAY,KAAK,aAE3B,QAAQ,KACN,iEAAiE,KAAK,QAAQ,eAAe,SAAS,CAAC,EACzG,EACA,MAAM,KAAK,WAAW,GAEtB,MAAM,KAAK,OAAO,CAGxB,CACAD,EAAa,KAAK,cAClB,KAAK,eAAkB,OAAO,CAAC,CACjC,OAASE,EAAG,CACV,QAAQ,MAAM,yDAA0DA,CAAC,CAC3E,QAAE,CACA,KAAK,KAAO,EACd,CACA,OAAOF,CACT,CAKA,MAAM,YAA4B,CAChC,GAAM,CAAE,gBAAiBG,CAAe,EAAI,MAAMC,EAAQ,CACxD,YAAa,KAAK,YAClB,eAAgB,KAAK,QAAQ,cAC/B,CAAC,EACD,KAAK,cAAgB,OAAOD,CAAc,EAC1C,KAAK,sBAAwB,OAAOA,CAAc,CACpD,CAOA,MAAM,QAA0B,CAC9B,GAAM,CAAE,gBAAiBA,CAAe,EAAI,MAAMC,EAAQ,CACxD,YAAa,KAAK,YAClB,eAAgB,KAAK,QAAQ,cAC/B,CAAC,EACD,YAAK,sBAAwB,OAAOD,CAAc,EAC3C,KAAK,qBACd,CAQA,MAAM,aAA6B,CACjC,GAAI,KAAK,wBAA0B,KAAK,cAGxC,MAAO,KAAK,MACV,MAAMJ,EAAM,KAAK,SAAS,EAG5B,KAAK,KAAO,GAEZ,GAAI,CACF,MAAM,KAAK,OAAO,EAClB,IAAME,EAAYT,EAAI,EACtB,KAAO,KAAK,wBAA0B,KAAK,eACrCA,EAAI,EAAIS,EAAY,KAAK,aAE3B,QAAQ,KACN,iEAAiE,KAAK,QAAQ,eAAe,SAAS,CAAC,EACzG,EACA,MAAM,KAAK,WAAW,IAEtB,MAAMF,EAAM,KAAK,SAAS,EAC1B,MAAM,KAAK,OAAO,EAGxB,OAASG,EAAG,CACV,QAAQ,MAAM,4EAA6EA,CAAC,CAC9F,QAAE,CACA,KAAK,KAAO,EACd,EACF,CACF","names":["now","AccountSequenceNumber","aptosConfig","account","maxWaitTime","maximumInFlight","sleepTime","sleep","nextNumber","startTime","e","sequenceNumber","getInfo"]}
@@ -0,0 +1,2 @@
1
+ import{b as t}from"./chunk-BCUSI3N6.mjs";var o=r=>typeof r=="string"?t.isValid(r).valid?r:Buffer.from(r,"utf8"):r;export{o as a};
2
+ //# sourceMappingURL=chunk-F7EMGK4M.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as l,b as s,c as u,d as c,e as d,f as m,g as U}from"./chunk-QIAHBEEW.mjs";import{a as o}from"./chunk-52C73T26.mjs";import{b as z}from"./chunk-AOCNYMMX.mjs";var t=class n extends o{constructor(e){super();this.values=e}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){if(!(this.values[0]instanceof s)&&this.values[0]!==void 0)throw new Error("Script function arguments only accept u8 vectors");e.serializeU32AsUleb128(4),e.serialize(this)}static U8(e){let r;if(Array.isArray(e)&&typeof e[0]=="number")r=e;else if(typeof e=="string"){let i=z.fromHexInput(e);r=Array.from(i.toUint8Array())}else if(e instanceof Uint8Array)r=Array.from(e);else throw new Error("Invalid input type");return new n(r.map(i=>new s(i)))}static U16(e){return new n(e.map(r=>new u(r)))}static U32(e){return new n(e.map(r=>new c(r)))}static U64(e){return new n(e.map(r=>new d(r)))}static U128(e){return new n(e.map(r=>new m(r)))}static U256(e){return new n(e.map(r=>new U(r)))}static Bool(e){return new n(e.map(r=>new l(r)))}static MoveString(e){return new n(e.map(r=>new a(r)))}serialize(e){e.serializeVector(this.values)}static deserialize(e,r){let i=e.deserializeUleb128AsU32(),y=new Array;for(let w=0;w<i;w+=1)y.push(r.deserialize(e));return new n(y)}},a=class n extends o{constructor(e){super();this.value=e}serialize(e){e.serializeStr(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){let r=this.bcsToBytes().slice(1);t.U8(r).serializeForScriptFunction(e)}static deserialize(e){return new n(e.deserializeStr())}},f=class n extends o{constructor(e){super();typeof e<"u"&&e!==null?this.vec=new t([e]):this.vec=new t([]),[this.value]=this.vec.values}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}unwrap(){if(this.isSome())return this.vec.values[0];throw new Error("Called unwrap on a MoveOption with no value")}isSome(){return this.vec.values.length===1}serialize(e){this.vec.serialize(e)}static U8(e){return new n(e!=null?new s(e):void 0)}static U16(e){return new n(e!=null?new u(e):void 0)}static U32(e){return new n(e!=null?new c(e):void 0)}static U64(e){return new n(e!=null?new d(e):void 0)}static U128(e){return new n(e!=null?new m(e):void 0)}static U256(e){return new n(e!=null?new U(e):void 0)}static Bool(e){return new n(e!=null?new l(e):void 0)}static MoveString(e){return new n(e!=null?new a(e):void 0)}static deserialize(e,r){let i=t.deserialize(e,r);return new n(i.values[0])}};export{t as a,a as b,f as c};
2
- //# sourceMappingURL=chunk-FS3NSGBF.mjs.map
1
+ import{a as l,b as s,c as u,d as c,e as d,f as m,g as U}from"./chunk-SRDIYE3M.mjs";import{a as o}from"./chunk-36QXVFR5.mjs";import{b as w}from"./chunk-BCUSI3N6.mjs";var t=class n extends o{constructor(e){super(),this.values=e}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){if(!(this.values[0]instanceof s)&&this.values[0]!==void 0)throw new Error("Script function arguments only accept u8 vectors");e.serializeU32AsUleb128(4),e.serialize(this)}static U8(e){let r;if(Array.isArray(e)&&typeof e[0]=="number")r=e;else if(typeof e=="string"){let i=w.fromHexInput(e);r=Array.from(i.toUint8Array())}else if(e instanceof Uint8Array)r=Array.from(e);else throw new Error("Invalid input type");return new n(r.map(i=>new s(i)))}static U16(e){return new n(e.map(r=>new u(r)))}static U32(e){return new n(e.map(r=>new c(r)))}static U64(e){return new n(e.map(r=>new d(r)))}static U128(e){return new n(e.map(r=>new m(r)))}static U256(e){return new n(e.map(r=>new U(r)))}static Bool(e){return new n(e.map(r=>new l(r)))}static MoveString(e){return new n(e.map(r=>new a(r)))}serialize(e){e.serializeVector(this.values)}static deserialize(e,r){let i=e.deserializeUleb128AsU32(),p=new Array;for(let y=0;y<i;y+=1)p.push(r.deserialize(e));return new n(p)}},a=class n extends o{constructor(e){super(),this.value=e}serialize(e){e.serializeStr(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){let r=this.bcsToBytes().slice(1);t.U8(r).serializeForScriptFunction(e)}static deserialize(e){return new n(e.deserializeStr())}},z=class n extends o{constructor(e){super(),typeof e<"u"&&e!==null?this.vec=new t([e]):this.vec=new t([]),[this.value]=this.vec.values}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}unwrap(){if(this.isSome())return this.vec.values[0];throw new Error("Called unwrap on a MoveOption with no value")}isSome(){return this.vec.values.length===1}serialize(e){this.vec.serialize(e)}static U8(e){return new n(e!=null?new s(e):void 0)}static U16(e){return new n(e!=null?new u(e):void 0)}static U32(e){return new n(e!=null?new c(e):void 0)}static U64(e){return new n(e!=null?new d(e):void 0)}static U128(e){return new n(e!=null?new m(e):void 0)}static U256(e){return new n(e!=null?new U(e):void 0)}static Bool(e){return new n(e!=null?new l(e):void 0)}static MoveString(e){return new n(e!=null?new a(e):void 0)}static deserialize(e,r){let i=t.deserialize(e,r);return new n(i.values[0])}};export{t as a,a as b,z as c};
2
+ //# sourceMappingURL=chunk-G56GPLTB.mjs.map
@@ -1,2 +1,2 @@
1
- var s=class extends Error{constructor(e,t,a){super(a);this.name="AptosApiError",this.url=t.url,this.status=t.status,this.statusText=t.statusText,this.data=t.data,this.request=e}};export{s as a};
2
- //# sourceMappingURL=chunk-6FBKUTGF.mjs.map
1
+ var s=class extends Error{constructor(e,t,a){super(a),this.name="AptosApiError",this.url=t.url,this.status=t.status,this.statusText=t.statusText,this.data=t.data,this.request=e}};export{s as a};
2
+ //# sourceMappingURL=chunk-GHYE26Q5.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as i,b as t,c as n,d as o}from"./chunk-62P5CJAJ.mjs";import{a as s}from"./chunk-BIAEC6FO.mjs";var r=class{constructor(e){this.config=e}async getFungibleAssetMetadata(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),i({aptosConfig:this.config,...e})}async getFungibleAssetMetadataByAssetType(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),(await i({aptosConfig:this.config,options:{where:{asset_type:{_eq:e.assetType}}}}))[0]}async getFungibleAssetActivities(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),t({aptosConfig:this.config,...e})}async getCurrentFungibleAssetBalances(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),n({aptosConfig:this.config,...e})}async transferFungibleAsset(e){return o({aptosConfig:this.config,...e})}};export{r as a};
2
- //# sourceMappingURL=chunk-P3UFJZY5.mjs.map
1
+ import{a as i,b as t,c as n,d as o}from"./chunk-HMARHACL.mjs";import{a as s}from"./chunk-5YLAWRI2.mjs";var r=class{constructor(e){this.config=e}async getFungibleAssetMetadata(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),i({aptosConfig:this.config,...e})}async getFungibleAssetMetadataByAssetType(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),(await i({aptosConfig:this.config,options:{where:{asset_type:{_eq:e.assetType}}}}))[0]}async getFungibleAssetActivities(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),t({aptosConfig:this.config,...e})}async getCurrentFungibleAssetBalances(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),n({aptosConfig:this.config,...e})}async transferFungibleAsset(e){return o({aptosConfig:this.config,...e})}};export{r as a};
2
+ //# sourceMappingURL=chunk-GIAABV7R.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/api/fungibleAsset.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n AnyNumber,\n GetCurrentFungibleAssetBalancesResponse,\n GetFungibleAssetActivitiesResponse,\n GetFungibleAssetMetadataResponse,\n PaginationArgs,\n WhereArg,\n} from \"../types\";\nimport {\n getCurrentFungibleAssetBalances,\n getFungibleAssetActivities,\n getFungibleAssetMetadata,\n transferFungibleAsset,\n} from \"../internal/fungibleAsset\";\nimport {\n CurrentFungibleAssetBalancesBoolExp,\n FungibleAssetActivitiesBoolExp,\n FungibleAssetMetadataBoolExp,\n} from \"../types/generated/types\";\nimport { ProcessorType } from \"../utils/const\";\nimport { AptosConfig } from \"./aptosConfig\";\nimport { waitForIndexerOnVersion } from \"./utils\";\nimport { Account } from \"../account\";\nimport { AccountAddressInput } from \"../core\";\nimport { InputGenerateTransactionOptions } from \"../transactions\";\nimport { SimpleTransaction } from \"../transactions/instances/simpleTransaction\";\n\n/**\n * A class to query all `FungibleAsset` related queries on Aptos.\n */\nexport class FungibleAsset {\n constructor(readonly config: AptosConfig) {}\n\n /**\n * Queries all fungible asset metadata.\n *\n * @example\n * const fungibleAsset = await aptos.getFungibleAssetMetadata()\n *\n * @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying\n * @param args.options Optional configuration for pagination and filtering\n *\n * @returns A list of fungible asset metadata\n */\n async getFungibleAssetMetadata(args?: {\n minimumLedgerVersion?: AnyNumber;\n options?: PaginationArgs & WhereArg<FungibleAssetMetadataBoolExp>;\n }): Promise<GetFungibleAssetMetadataResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args?.minimumLedgerVersion,\n processorType: ProcessorType.FUNGIBLE_ASSET_PROCESSOR,\n });\n return getFungibleAssetMetadata({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries a fungible asset metadata\n *\n * This query returns the fungible asset metadata for a specific fungible asset.\n *\n * @example\n * const fungibleAsset = await aptos.getFungibleAssetMetadataByAssetType({assetType:\"0x123::test_coin::TestCoin\"})\n *\n * @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying\n * @param args.assetType The asset type of the fungible asset.\n * e.g\n * \"0x1::aptos_coin::AptosCoin\" for Aptos Coin\n * \"0xc2948283c2ce03aafbb294821de7ee684b06116bb378ab614fa2de07a99355a8\" - address format if this is fungible asset\n *\n * @returns A fungible asset metadata item\n */\n async getFungibleAssetMetadataByAssetType(args: {\n assetType: string;\n minimumLedgerVersion?: AnyNumber;\n }): Promise<GetFungibleAssetMetadataResponse[0]> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args?.minimumLedgerVersion,\n processorType: ProcessorType.FUNGIBLE_ASSET_PROCESSOR,\n });\n const data = await getFungibleAssetMetadata({\n aptosConfig: this.config,\n options: {\n where: {\n asset_type: { _eq: args.assetType },\n },\n },\n });\n\n return data[0];\n }\n\n /**\n * Queries all fungible asset activities\n *\n * @example\n * const fungibleAssetActivities = await aptos.getFungibleAssetActivities()\n *\n * @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying\n * @param args.options Optional configuration for pagination and filtering\n *\n * @returns A list of fungible asset metadata\n */\n async getFungibleAssetActivities(args?: {\n minimumLedgerVersion?: AnyNumber;\n options?: PaginationArgs & WhereArg<FungibleAssetActivitiesBoolExp>;\n }): Promise<GetFungibleAssetActivitiesResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args?.minimumLedgerVersion,\n processorType: ProcessorType.FUNGIBLE_ASSET_PROCESSOR,\n });\n return getFungibleAssetActivities({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries all fungible asset balances\n *\n * @example\n * const fungibleAssetBalances = await aptos.getCurrentFungibleAssetBalances()\n *\n * @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying\n * @param args.options Optional configuration for pagination and filtering\n *\n * @returns A list of fungible asset metadata\n */\n async getCurrentFungibleAssetBalances(args?: {\n minimumLedgerVersion?: AnyNumber;\n options?: PaginationArgs & WhereArg<CurrentFungibleAssetBalancesBoolExp>;\n }): Promise<GetCurrentFungibleAssetBalancesResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args?.minimumLedgerVersion,\n processorType: ProcessorType.FUNGIBLE_ASSET_PROCESSOR,\n });\n return getCurrentFungibleAssetBalances({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Transfer `amount` of fungible asset from sender's primary store to recipient's primary store.\n *\n * Use this method to transfer any fungible asset including fungible token.\n *\n * @example\n * const transaction = await aptos.transferFungibleAsset({\n * sender: alice,\n * fungibleAssetMetadataAddress: \"0x123\",\n * recipient: \"0x456\",\n * amount: 5\n * })\n *\n * @param sender The sender account\n * @param fungibleAssetMetadataAddress The fungible asset account address.\n * For example if you’re transferring USDT this would be the USDT address\n * @param recipient The recipient account address\n * @param amount Number of assets to transfer\n *\n * @returns A SimpleTransaction that can be simulated or submitted to chain.\n */\n async transferFungibleAsset(args: {\n sender: Account;\n fungibleAssetMetadataAddress: AccountAddressInput;\n recipient: AccountAddressInput;\n amount: AnyNumber;\n options?: InputGenerateTransactionOptions;\n }): Promise<SimpleTransaction> {\n return transferFungibleAsset({ aptosConfig: this.config, ...args });\n }\n}\n"],"mappings":"uGAiCO,IAAMA,EAAN,KAAoB,CACzB,YAAqBC,EAAqB,CAArB,YAAAA,CAAsB,CAa3C,MAAM,yBAAyBC,EAGe,CAC5C,aAAMC,EAAwB,CAC5B,OAAQ,KAAK,OACb,qBAAsBD,GAAM,qBAC5B,wCACF,CAAC,EACME,EAAyB,CAAE,YAAa,KAAK,OAAQ,GAAGF,CAAK,CAAC,CACvE,CAkBA,MAAM,oCAAoCA,EAGO,CAC/C,aAAMC,EAAwB,CAC5B,OAAQ,KAAK,OACb,qBAAsBD,GAAM,qBAC5B,wCACF,CAAC,GACY,MAAME,EAAyB,CAC1C,YAAa,KAAK,OAClB,QAAS,CACP,MAAO,CACL,WAAY,CAAE,IAAKF,EAAK,SAAU,CACpC,CACF,CACF,CAAC,GAEW,CAAC,CACf,CAaA,MAAM,2BAA2BA,EAGe,CAC9C,aAAMC,EAAwB,CAC5B,OAAQ,KAAK,OACb,qBAAsBD,GAAM,qBAC5B,wCACF,CAAC,EACMG,EAA2B,CAAE,YAAa,KAAK,OAAQ,GAAGH,CAAK,CAAC,CACzE,CAaA,MAAM,gCAAgCA,EAGe,CACnD,aAAMC,EAAwB,CAC5B,OAAQ,KAAK,OACb,qBAAsBD,GAAM,qBAC5B,wCACF,CAAC,EACMI,EAAgC,CAAE,YAAa,KAAK,OAAQ,GAAGJ,CAAK,CAAC,CAC9E,CAuBA,MAAM,sBAAsBA,EAMG,CAC7B,OAAOK,EAAsB,CAAE,YAAa,KAAK,OAAQ,GAAGL,CAAK,CAAC,CACpE,CACF","names":["FungibleAsset","config","args","waitForIndexerOnVersion","getFungibleAssetMetadata","getFungibleAssetActivities","getCurrentFungibleAssetBalances","transferFungibleAsset"]}
@@ -0,0 +1,2 @@
1
+ import{a as d}from"./chunk-PPO4IXE4.mjs";import{a as A}from"./chunk-CWUH4PNH.mjs";import{a as T}from"./chunk-477G7LHJ.mjs";import{a as y}from"./chunk-NZETF6Z4.mjs";import{d as g,e as a,h as m,i as p,j as f}from"./chunk-K7HX7JQH.mjs";import{a as i,b as s,c as r,d as e,e as c,g as u}from"./chunk-5VIESFOC.mjs";var h=class{constructor(n){this.config=n,this.build=new y(this.config),this.simulate=new A(this.config),this.submit=new T(this.config),this.batch=new d(this.config)}async getTransactions(n){return i({aptosConfig:this.config,...n})}async getTransactionByVersion(n){return r({aptosConfig:this.config,...n})}async getTransactionByHash(n){return e({aptosConfig:this.config,...n})}async isPendingTransaction(n){return c({aptosConfig:this.config,...n})}async waitForTransaction(n){return u({aptosConfig:this.config,...n})}async getGasPriceEstimation(){return s({aptosConfig:this.config})}getSigningMessage(n){return g(n)}async publishPackageTransaction(n){return p({aptosConfig:this.config,...n})}async rotateAuthKey(n){return f({aptosConfig:this.config,...n})}sign(n){return a({...n})}signAsFeePayer(n){let{signer:t,transaction:o}=n;if(!o.feePayerAddress)throw new Error(`Transaction ${o} is not a Fee Payer transaction`);return o.feePayerAddress=t.accountAddress,a({signer:t,transaction:o})}async batchTransactionsForSingleAccount(n){try{let{sender:t,data:o,options:P}=n;this.batch.forSingleAccount({sender:t,data:o,options:P})}catch(t){throw new Error(`failed to submit transactions with error: ${t}`)}}async signAndSubmitTransaction(n){let{signer:t,transaction:o}=n;return m({aptosConfig:this.config,signer:t,transaction:o})}};export{h as a};
2
+ //# sourceMappingURL=chunk-GKJ2NJG5.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/api/transaction.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { AptosConfig } from \"./aptosConfig\";\nimport {\n getGasPriceEstimation,\n getTransactionByHash,\n getTransactionByVersion,\n getTransactions,\n isTransactionPending,\n waitForTransaction,\n} from \"../internal/transaction\";\nimport {\n AnyNumber,\n CommittedTransactionResponse,\n GasEstimation,\n HexInput,\n PaginationArgs,\n PendingTransactionResponse,\n TransactionResponse,\n WaitForTransactionOptions,\n} from \"../types\";\nimport {\n getSigningMessage,\n publicPackageTransaction,\n rotateAuthKey,\n signAndSubmitTransaction,\n signTransaction,\n} from \"../internal/transactionSubmission\";\nimport {\n AccountAuthenticator,\n AnyRawTransaction,\n InputGenerateTransactionOptions,\n InputGenerateTransactionPayloadData,\n} from \"../transactions\";\nimport { AccountAddressInput, PrivateKey } from \"../core\";\nimport { Account } from \"../account\";\nimport { Build } from \"./transactionSubmission/build\";\nimport { Simulate } from \"./transactionSubmission/simulate\";\nimport { Submit } from \"./transactionSubmission/submit\";\nimport { TransactionManagement } from \"./transactionSubmission/management\";\nimport { SimpleTransaction } from \"../transactions/instances/simpleTransaction\";\n\nexport class Transaction {\n readonly config: AptosConfig;\n\n readonly build: Build;\n\n readonly simulate: Simulate;\n\n readonly submit: Submit;\n\n readonly batch: TransactionManagement;\n\n constructor(config: AptosConfig) {\n this.config = config;\n this.build = new Build(this.config);\n this.simulate = new Simulate(this.config);\n this.submit = new Submit(this.config);\n this.batch = new TransactionManagement(this.config);\n }\n\n /**\n * Queries on-chain transactions. This function will not return pending\n * transactions. For that, use `getTransactionsByHash`.\n *\n * @example\n * const transactions = await aptos.getTransactions()\n *\n * @param args.options.offset The number transaction to start with\n * @param args.options.limit Number of results to return\n *\n * @returns Array of on-chain transactions\n */\n async getTransactions(args?: { options?: PaginationArgs }): Promise<TransactionResponse[]> {\n return getTransactions({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Queries on-chain transaction by version. This function will not return pending transactions.\n *\n * @example\n * const transaction = await aptos.getTransactions({ledgerVersion:1})\n *\n * @param args.ledgerVersion - Transaction version is an unsigned 64-bit number.\n * @returns On-chain transaction. Only on-chain transactions have versions, so this\n * function cannot be used to query pending transactions.\n */\n async getTransactionByVersion(args: { ledgerVersion: AnyNumber }): Promise<TransactionResponse> {\n return getTransactionByVersion({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Queries on-chain transaction by transaction hash. This function will return pending transactions.\n *\n * @example\n * const transaction = await aptos.getTransactionByHash({transactionHash:\"0x123\"})\n *\n * @param args.transactionHash - Transaction hash should be hex-encoded bytes string with 0x prefix.\n * @returns Transaction from mempool (pending) or on-chain (committed) transaction\n */\n async getTransactionByHash(args: { transactionHash: HexInput }): Promise<TransactionResponse> {\n return getTransactionByHash({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Defines if specified transaction is currently in pending state\n *\n * To create a transaction hash:\n *\n * 1. Create a hash message from the bytes: \"Aptos::Transaction\" bytes + the BCS-serialized Transaction bytes.\n * 2. Apply hash algorithm SHA3-256 to the hash message bytes.\n * 3. Hex-encode the hash bytes with 0x prefix.\n *\n * @example\n * const isPendingTransaction = await aptos.isPendingTransaction({transactionHash:\"0x123\"})\n *\n * @param args.transactionHash A hash of transaction\n * @returns `true` if transaction is in pending state and `false` otherwise\n */\n async isPendingTransaction(args: { transactionHash: HexInput }): Promise<boolean> {\n return isTransactionPending({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Waits for a transaction to move past the pending state.\n *\n * There are 4 cases.\n * 1. Transaction is successfully processed and committed to the chain.\n * - The function will resolve with the transaction response from the API.\n * 2. Transaction is rejected for some reason, and is therefore not committed to the blockchain.\n * - The function will throw an AptosApiError with an HTTP status code indicating some problem with the request.\n * 3. Transaction is committed but execution failed, meaning no changes were\n * written to the blockchain state.\n * - If `checkSuccess` is true, the function will throw a FailedTransactionError\n * If `checkSuccess` is false, the function will resolve with the transaction response where the `success` field is false.\n * 4. Transaction does not move past the pending state within `args.options.timeoutSecs` seconds.\n * - The function will throw a WaitForTransactionError\n *\n * @example\n * const transaction = await aptos.waitForTransaction({transactionHash:\"0x123\"})\n *\n * @param args.transactionHash The hash of a transaction previously submitted to the blockchain.\n * @param args.options.timeoutSecs Timeout in seconds. Defaults to 20 seconds.\n * @param args.options.checkSuccess A boolean which controls whether the function will error if the transaction failed.\n * Defaults to true. See case 3 above.\n * @returns The transaction on-chain. See above for more details.\n */\n async waitForTransaction(args: {\n transactionHash: HexInput;\n options?: WaitForTransactionOptions;\n }): Promise<CommittedTransactionResponse> {\n return waitForTransaction({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Gives an estimate of the gas unit price required to get a\n * transaction on chain in a reasonable amount of time.\n * For more information {@link https://api.mainnet.aptoslabs.com/v1/spec#/operations/estimate_gas_price}\n *\n * @returns Object holding the outputs of the estimate gas API\n *\n * @example\n * const gasPrice = await aptos.waitForTransaction()\n */\n async getGasPriceEstimation(): Promise<GasEstimation> {\n return getGasPriceEstimation({\n aptosConfig: this.config,\n });\n }\n\n /**\n * Returns a signing message for a transaction.\n *\n * This allows a user to sign a transaction using their own preferred signing method, and\n * then submit it to the network.\n *\n * @example\n * const transaction = await aptos.transaction.build.simple({...})\n * const message = await aptos.getSigningMessage({transaction})\n *\n * @param args.transaction A raw transaction for signing elsewhere\n */\n // eslint-disable-next-line class-methods-use-this\n getSigningMessage(args: { transaction: AnyRawTransaction }): Uint8Array {\n return getSigningMessage(args);\n }\n\n /**\n * Generates a transaction to publish a move package to chain.\n *\n * To get the `metadataBytes` and `byteCode`, can compile using Aptos CLI with command\n * `aptos move compile --save-metadata ...`,\n * For more info {@link https://aptos.dev/tutorials/your-first-dapp/#step-4-publish-a-move-module}\n *\n * @example\n * const transaction = await aptos.publishPackageTransaction({\n * account: alice,\n * metadataBytes,\n * moduleBytecode: [byteCode],\n * })\n *\n * @param args.account The publisher account\n * @param args.metadataBytes The package metadata bytes\n * @param args.moduleBytecode An array of the bytecode of each module in the package in compiler output order\n *\n * @returns A SimpleTransaction that can be simulated or submitted to chain\n */\n async publishPackageTransaction(args: {\n account: AccountAddressInput;\n metadataBytes: HexInput;\n moduleBytecode: Array<HexInput>;\n options?: InputGenerateTransactionOptions;\n }): Promise<SimpleTransaction> {\n return publicPackageTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Rotate an account's auth key. After rotation, only the new private key can be used to sign txns for\n * the account.\n * Note: Only legacy Ed25519 scheme is supported for now.\n * More info: {@link https://aptos.dev/guides/account-management/key-rotation/}\n *\n * @example\n * const response = await aptos.rotateAuthKey({\n * fromAccount: alice,\n * toNewPrivateKey: new ED25519PublicKey(\"0x123\"),\n * })\n *\n * @param args.fromAccount The account to rotate the auth key for\n * @param args.toNewPrivateKey The new private key to rotate to\n *\n * @returns PendingTransactionResponse\n */\n async rotateAuthKey(args: { fromAccount: Account; toNewPrivateKey: PrivateKey }): Promise<TransactionResponse> {\n return rotateAuthKey({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Sign a transaction that can later be submitted to chain\n *\n * @example\n * const transaction = await aptos.transaction.build.simple({...})\n * const transaction = await aptos.transaction.sign({\n * signer: alice,\n * transaction\n * })\n *\n * @param args.signer The signer account\n * @param args.transaction A raw transaction to sign on\n *\n * @returns AccountAuthenticator\n */\n // eslint-disable-next-line class-methods-use-this\n sign(args: { signer: Account; transaction: AnyRawTransaction }): AccountAuthenticator {\n return signTransaction({\n ...args,\n });\n }\n\n /**\n * Sign a transaction as a fee payer that can later be submitted to chain\n *\n * @example\n * const transaction = await aptos.transaction.build.simple({...})\n * const transaction = await aptos.transaction.signAsFeePayer({\n * signer: alice,\n * transaction\n * })\n *\n * @param args.signer The fee payer signer account\n * @param args.transaction A raw transaction to sign on\n *\n * @returns AccountAuthenticator\n */\n // eslint-disable-next-line class-methods-use-this\n signAsFeePayer(args: { signer: Account; transaction: AnyRawTransaction }): AccountAuthenticator {\n const { signer, transaction } = args;\n\n // if transaction doesnt hold a \"feePayerAddress\" prop it means\n // this is not a fee payer transaction\n if (!transaction.feePayerAddress) {\n throw new Error(`Transaction ${transaction} is not a Fee Payer transaction`);\n }\n\n // Set the feePayerAddress to the signer account address\n transaction.feePayerAddress = signer.accountAddress;\n\n return signTransaction({\n signer,\n transaction,\n });\n }\n\n // TRANSACTION SUBMISSION //\n\n /**\n * @deprecated Prefer to use `aptos.transaction.batch.forSingleAccount()`\n *\n * Batch transactions for a single account.\n *\n * This function uses a transaction worker that receives payloads to be processed\n * and submitted to chain.\n * Note that this process is best for submitting multiple transactions that\n * dont rely on each other, i.e batch funds, batch token mints, etc.\n *\n * If any worker failure, the functions throws an error.\n *\n * @param args.sender The sender account to sign and submit the transaction\n * @param args.data An array of transaction payloads\n * @param args.options optional. Transaction generation configurations (excluding accountSequenceNumber)\n *\n * @return void. Throws if any error\n */\n async batchTransactionsForSingleAccount(args: {\n sender: Account;\n data: InputGenerateTransactionPayloadData[];\n options?: Omit<InputGenerateTransactionOptions, \"accountSequenceNumber\">;\n }): Promise<void> {\n try {\n const { sender, data, options } = args;\n this.batch.forSingleAccount({ sender, data, options });\n } catch (error: any) {\n throw new Error(`failed to submit transactions with error: ${error}`);\n }\n }\n\n /**\n * Sign and submit a single signer transaction to chain\n *\n * @param args.signer The signer account to sign the transaction\n * @param args.transaction An instance of a RawTransaction, plus optional secondary/fee payer addresses\n *\n * @example\n * const transaction = await aptos.transaction.build.simple({...})\n * const transaction = await aptos.signAndSubmitTransaction({\n * signer: alice,\n * transaction\n * })\n *\n * @return PendingTransactionResponse\n */\n async signAndSubmitTransaction(args: {\n signer: Account;\n transaction: AnyRawTransaction;\n }): Promise<PendingTransactionResponse> {\n const { signer, transaction } = args;\n return signAndSubmitTransaction({\n aptosConfig: this.config,\n signer,\n transaction,\n });\n }\n}\n"],"mappings":"qTA2CO,IAAMA,EAAN,KAAkB,CAWvB,YAAYC,EAAqB,CAC/B,KAAK,OAASA,EACd,KAAK,MAAQ,IAAIC,EAAM,KAAK,MAAM,EAClC,KAAK,SAAW,IAAIC,EAAS,KAAK,MAAM,EACxC,KAAK,OAAS,IAAIC,EAAO,KAAK,MAAM,EACpC,KAAK,MAAQ,IAAIC,EAAsB,KAAK,MAAM,CACpD,CAcA,MAAM,gBAAgBC,EAAqE,CACzF,OAAOC,EAAgB,CACrB,YAAa,KAAK,OAClB,GAAGD,CACL,CAAC,CACH,CAYA,MAAM,wBAAwBA,EAAkE,CAC9F,OAAOE,EAAwB,CAC7B,YAAa,KAAK,OAClB,GAAGF,CACL,CAAC,CACH,CAWA,MAAM,qBAAqBA,EAAmE,CAC5F,OAAOG,EAAqB,CAC1B,YAAa,KAAK,OAClB,GAAGH,CACL,CAAC,CACH,CAiBA,MAAM,qBAAqBA,EAAuD,CAChF,OAAOI,EAAqB,CAC1B,YAAa,KAAK,OAClB,GAAGJ,CACL,CAAC,CACH,CA0BA,MAAM,mBAAmBA,EAGiB,CACxC,OAAOK,EAAmB,CACxB,YAAa,KAAK,OAClB,GAAGL,CACL,CAAC,CACH,CAYA,MAAM,uBAAgD,CACpD,OAAOM,EAAsB,CAC3B,YAAa,KAAK,MACpB,CAAC,CACH,CAeA,kBAAkBN,EAAsD,CACtE,OAAOO,EAAkBP,CAAI,CAC/B,CAsBA,MAAM,0BAA0BA,EAKD,CAC7B,OAAOQ,EAAyB,CAAE,YAAa,KAAK,OAAQ,GAAGR,CAAK,CAAC,CACvE,CAmBA,MAAM,cAAcA,EAA2F,CAC7G,OAAOS,EAAc,CAAE,YAAa,KAAK,OAAQ,GAAGT,CAAK,CAAC,CAC5D,CAkBA,KAAKA,EAAiF,CACpF,OAAOU,EAAgB,CACrB,GAAGV,CACL,CAAC,CACH,CAkBA,eAAeA,EAAiF,CAC9F,GAAM,CAAE,OAAAW,EAAQ,YAAAC,CAAY,EAAIZ,EAIhC,GAAI,CAACY,EAAY,gBACf,MAAM,IAAI,MAAM,eAAeA,CAAW,iCAAiC,EAI7E,OAAAA,EAAY,gBAAkBD,EAAO,eAE9BD,EAAgB,CACrB,OAAAC,EACA,YAAAC,CACF,CAAC,CACH,CAsBA,MAAM,kCAAkCZ,EAItB,CAChB,GAAI,CACF,GAAM,CAAE,OAAAa,EAAQ,KAAAC,EAAM,QAAAC,CAAQ,EAAIf,EAClC,KAAK,MAAM,iBAAiB,CAAE,OAAAa,EAAQ,KAAAC,EAAM,QAAAC,CAAQ,CAAC,CACvD,OAASC,EAAY,CACnB,MAAM,IAAI,MAAM,6CAA6CA,CAAK,EAAE,CACtE,CACF,CAiBA,MAAM,yBAAyBhB,EAGS,CACtC,GAAM,CAAE,OAAAW,EAAQ,YAAAC,CAAY,EAAIZ,EAChC,OAAOiB,EAAyB,CAC9B,YAAa,KAAK,OAClB,OAAAN,EACA,YAAAC,CACF,CAAC,CACH,CACF","names":["Transaction","config","Build","Simulate","Submit","TransactionManagement","args","getTransactions","getTransactionByVersion","getTransactionByHash","isTransactionPending","waitForTransaction","getGasPriceEstimation","getSigningMessage","publicPackageTransaction","rotateAuthKey","signTransaction","signer","transaction","sender","data","options","error","signAndSubmitTransaction"]}
@@ -1,2 +1,2 @@
1
- import{b as o}from"./chunk-IOSQVDZI.mjs";import{a as u,b as r}from"./chunk-FS3NSGBF.mjs";import{e as t}from"./chunk-QIAHBEEW.mjs";import{a as i}from"./chunk-52C73T26.mjs";var c=class extends i{constructor(e){super();this.accountAddress=o.ONE;this.moduleName=new r("account");this.structName=new r("RotationProofChallenge");this.sequenceNumber=new t(e.sequenceNumber),this.originator=e.originator,this.currentAuthKey=e.currentAuthKey,this.newPublicKey=u.U8(e.newPublicKey.toUint8Array())}serialize(e){e.serialize(this.accountAddress),e.serialize(this.moduleName),e.serialize(this.structName),e.serialize(this.sequenceNumber),e.serialize(this.originator),e.serialize(this.currentAuthKey),e.serialize(this.newPublicKey)}};export{c as a};
2
- //# sourceMappingURL=chunk-QTRYMRYK.mjs.map
1
+ import{b as o}from"./chunk-QRS4DGP3.mjs";import{a as u,b as r}from"./chunk-G56GPLTB.mjs";import{e as t}from"./chunk-SRDIYE3M.mjs";import{a as i}from"./chunk-36QXVFR5.mjs";var c=class extends i{constructor(e){super();this.accountAddress=o.ONE;this.moduleName=new r("account");this.structName=new r("RotationProofChallenge");this.sequenceNumber=new t(e.sequenceNumber),this.originator=e.originator,this.currentAuthKey=e.currentAuthKey,this.newPublicKey=u.U8(e.newPublicKey.toUint8Array())}serialize(e){e.serialize(this.accountAddress),e.serialize(this.moduleName),e.serialize(this.structName),e.serialize(this.sequenceNumber),e.serialize(this.originator),e.serialize(this.currentAuthKey),e.serialize(this.newPublicKey)}};export{c as a};
2
+ //# sourceMappingURL=chunk-GM56MMNJ.mjs.map
@@ -0,0 +1,2 @@
1
+ import{a as c}from"./chunk-K7HX7JQH.mjs";import{c as p}from"./chunk-MJPUASSD.mjs";import{e as o}from"./chunk-JQIGQMNZ.mjs";import{o as u,r as g,s as A}from"./chunk-S3EDNXZE.mjs";import{f as a,i as r}from"./chunk-U3YYSIIT.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-HMARHACL.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\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\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\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\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":"kOA+CA,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,CAEA,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,CAEA,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,EAEA,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"]}
@@ -0,0 +1,2 @@
1
+ import{a as i}from"./chunk-BO2TLWNT.mjs";import{a as e}from"./chunk-AQAH67IV.mjs";import{a as r}from"./chunk-36QXVFR5.mjs";var n=class o extends r{constructor(t,a){super(),this.raw_txn=t,this.authenticator=a}serialize(t){this.raw_txn.serialize(t),this.authenticator.serialize(t)}static deserialize(t){let a=i.deserialize(t),s=e.deserialize(t);return new o(a,s)}};export{n as a};
2
+ //# sourceMappingURL=chunk-HNEAPYNI.mjs.map
@@ -1,2 +1,2 @@
1
- import{b as s}from"./chunk-IOSQVDZI.mjs";import{f as n}from"./chunk-IR46T46A.mjs";import{p as g,u as d}from"./chunk-S4SEFF4K.mjs";async function m(e){let{aptosConfig:t,poolAddress:o}=e,r=s.from(o).toStringLong(),i=await n({aptosConfig:t,query:{query:d,variables:{where_condition:{pool_address:{_eq:r}}}}});return i.num_active_delegator_per_pool[0]?i.num_active_delegator_per_pool[0].num_active_delegator:0}async function f(e){let{aptosConfig:t,options:o}=e,r={query:d,variables:{order_by:o?.orderBy}};return(await n({aptosConfig:t,query:r})).num_active_delegator_per_pool}async function A(e){let{aptosConfig:t,delegatorAddress:o,poolAddress:r}=e,a={query:g,variables:{delegatorAddress:s.from(o).toStringLong(),poolAddress:s.from(r).toStringLong()}};return(await n({aptosConfig:t,query:a})).delegated_staking_activities}export{m as a,f as b,A as c};
2
- //# sourceMappingURL=chunk-S2LTZKM4.mjs.map
1
+ import{e as n}from"./chunk-JQIGQMNZ.mjs";import{p as g,u as d}from"./chunk-S3EDNXZE.mjs";import{b as s}from"./chunk-QRS4DGP3.mjs";async function m(e){let{aptosConfig:t,poolAddress:o}=e,r=s.from(o).toStringLong(),i=await n({aptosConfig:t,query:{query:d,variables:{where_condition:{pool_address:{_eq:r}}}}});return i.num_active_delegator_per_pool[0]?i.num_active_delegator_per_pool[0].num_active_delegator:0}async function f(e){let{aptosConfig:t,options:o}=e,r={query:d,variables:{order_by:o?.orderBy}};return(await n({aptosConfig:t,query:r})).num_active_delegator_per_pool}async function A(e){let{aptosConfig:t,delegatorAddress:o,poolAddress:r}=e,a={query:g,variables:{delegatorAddress:s.from(o).toStringLong(),poolAddress:s.from(r).toStringLong()}};return(await n({aptosConfig:t,query:a})).delegated_staking_activities}export{m as a,f as b,A as c};
2
+ //# sourceMappingURL=chunk-HSJTQLI2.mjs.map
@@ -1,2 +1,2 @@
1
- import{a,c}from"./chunk-O4JRPZZM.mjs";import{a as n,c as s}from"./chunk-CNMQNPNV.mjs";import{a as y}from"./chunk-R5QUBEH6.mjs";import{b as l}from"./chunk-WFZDFFBM.mjs";import{a as u}from"./chunk-NPFNYP75.mjs";var b=class t extends l{constructor(e){super();if(this.publicKey=e,e instanceof n)this.variant=0;else if(e instanceof a)this.variant=1;else throw new Error("Unsupported public key type")}verifySignature(e){let{message:r,signature:i}=e;return i instanceof o?this.publicKey.verifySignature({message:r,signature:i.signature}):!1}authKey(){return u.fromSchemeAndBytes({scheme:2,input:this.toUint8Array()})}toUint8Array(){return this.bcsToBytes()}serialize(e){e.serializeU32AsUleb128(this.variant),this.publicKey.serialize(e)}static deserialize(e){let r=e.deserializeUleb128AsU32(),i;switch(r){case 0:i=n.deserialize(e);break;case 1:i=a.deserialize(e);break;default:throw new Error(`Unknown variant index for AnyPublicKey: ${r}`)}return new t(i)}static isPublicKey(e){return e instanceof t}isEd25519(){return this.publicKey instanceof n}isSecp256k1PublicKey(){return this.publicKey instanceof a}},o=class t extends y{constructor(e){super();if(this.signature=e,e instanceof s)this.variant=0;else if(e instanceof c)this.variant=1;else throw new Error("Unsupported signature type")}toUint8Array(){return this.bcsToBytes()}serialize(e){e.serializeU32AsUleb128(this.variant),this.signature.serialize(e)}static deserialize(e){let r=e.deserializeUleb128AsU32(),i;switch(r){case 0:i=s.deserialize(e);break;case 1:i=c.deserialize(e);break;default:throw new Error(`Unknown variant index for AnySignature: ${r}`)}return new t(i)}};export{b as a,o as b};
2
- //# sourceMappingURL=chunk-AT2A6UGB.mjs.map
1
+ import{a,c}from"./chunk-2X7A4HUS.mjs";import{a as n,c as s}from"./chunk-T2AGN5YT.mjs";import{b as l}from"./chunk-4NHWV5AI.mjs";import{a as y}from"./chunk-UGPALAPN.mjs";import{a as u}from"./chunk-5EN52MUT.mjs";var b=class t extends l{constructor(e){if(super(),this.publicKey=e,e instanceof n)this.variant=0;else if(e instanceof a)this.variant=1;else throw new Error("Unsupported public key type")}verifySignature(e){let{message:r,signature:i}=e;return i instanceof o?this.publicKey.verifySignature({message:r,signature:i.signature}):!1}authKey(){return u.fromSchemeAndBytes({scheme:2,input:this.toUint8Array()})}toUint8Array(){return this.bcsToBytes()}serialize(e){e.serializeU32AsUleb128(this.variant),this.publicKey.serialize(e)}static deserialize(e){let r=e.deserializeUleb128AsU32(),i;switch(r){case 0:i=n.deserialize(e);break;case 1:i=a.deserialize(e);break;default:throw new Error(`Unknown variant index for AnyPublicKey: ${r}`)}return new t(i)}static isPublicKey(e){return e instanceof t}isEd25519(){return this.publicKey instanceof n}isSecp256k1PublicKey(){return this.publicKey instanceof a}},o=class t extends y{constructor(e){if(super(),this.signature=e,e instanceof s)this.variant=0;else if(e instanceof c)this.variant=1;else throw new Error("Unsupported signature type")}toUint8Array(){return this.bcsToBytes()}serialize(e){e.serializeU32AsUleb128(this.variant),this.signature.serialize(e)}static deserialize(e){let r=e.deserializeUleb128AsU32(),i;switch(r){case 0:i=s.deserialize(e);break;case 1:i=c.deserialize(e);break;default:throw new Error(`Unknown variant index for AnySignature: ${r}`)}return new t(i)}};export{b as a,o as b};
2
+ //# sourceMappingURL=chunk-IENCDVPF.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/core/crypto/singleKey.ts"],"sourcesContent":["import { Deserializer, Serializer } from \"../../bcs\";\nimport { AnyPublicKeyVariant, AnySignatureVariant, SigningScheme as AuthenticationKeyScheme } from \"../../types\";\nimport { AuthenticationKey } from \"../authenticationKey\";\nimport { Ed25519PublicKey, Ed25519Signature } from \"./ed25519\";\nimport { AccountPublicKey, PublicKey, VerifySignatureArgs } from \"./publicKey\";\nimport { Secp256k1PublicKey, Secp256k1Signature } from \"./secp256k1\";\nimport { Signature } from \"./signature\";\n\n/**\n * Represents any public key supported by Aptos.\n *\n * Since [AIP-55](https://github.com/aptos-foundation/AIPs/pull/263) Aptos supports\n * `Legacy` and `Unified` authentication keys.\n *\n * Any unified authentication key is represented in the SDK as `AnyPublicKey`.\n */\nexport class AnyPublicKey extends AccountPublicKey {\n /**\n * Reference to the inner public key\n */\n public readonly publicKey: PublicKey;\n\n /**\n * Index of the underlying enum variant\n */\n public readonly variant: AnyPublicKeyVariant;\n\n // region Constructors\n\n constructor(publicKey: PublicKey) {\n super();\n this.publicKey = publicKey;\n if (publicKey instanceof Ed25519PublicKey) {\n this.variant = AnyPublicKeyVariant.Ed25519;\n } else if (publicKey instanceof Secp256k1PublicKey) {\n this.variant = AnyPublicKeyVariant.Secp256k1;\n } else {\n throw new Error(\"Unsupported public key type\");\n }\n }\n\n // endregion\n\n // region AccountPublicKey\n\n verifySignature(args: VerifySignatureArgs): boolean {\n const { message, signature } = args;\n if (!(signature instanceof AnySignature)) {\n return false;\n }\n\n return this.publicKey.verifySignature({\n message,\n signature: signature.signature,\n });\n }\n\n authKey(): AuthenticationKey {\n return AuthenticationKey.fromSchemeAndBytes({\n scheme: AuthenticationKeyScheme.SingleKey,\n input: this.toUint8Array(),\n });\n }\n\n toUint8Array() {\n return this.bcsToBytes();\n }\n\n // endregion\n\n // region Serializable\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(this.variant);\n this.publicKey.serialize(serializer);\n }\n\n static deserialize(deserializer: Deserializer): AnyPublicKey {\n const variantIndex = deserializer.deserializeUleb128AsU32();\n let publicKey: PublicKey;\n switch (variantIndex) {\n case AnyPublicKeyVariant.Ed25519:\n publicKey = Ed25519PublicKey.deserialize(deserializer);\n break;\n case AnyPublicKeyVariant.Secp256k1:\n publicKey = Secp256k1PublicKey.deserialize(deserializer);\n break;\n default:\n throw new Error(`Unknown variant index for AnyPublicKey: ${variantIndex}`);\n }\n return new AnyPublicKey(publicKey);\n }\n\n // endregion\n\n /**\n * @deprecated use `instanceof AnyPublicKey` instead.\n */\n static isPublicKey(publicKey: AccountPublicKey): publicKey is AnyPublicKey {\n return publicKey instanceof AnyPublicKey;\n }\n\n /**\n * @deprecated use `publicKey instanceof Ed25519PublicKey` instead.\n */\n isEd25519(): boolean {\n return this.publicKey instanceof Ed25519PublicKey;\n }\n\n /**\n * @deprecated use `publicKey instanceof Secp256k1PublicKey` instead.\n */\n isSecp256k1PublicKey(): boolean {\n return this.publicKey instanceof Secp256k1PublicKey;\n }\n}\n\n/**\n * Instance of signature that uses the SingleKey authentication scheme.\n * This signature can only be generated by a `SingleKeySigner`, since it uses the\n * same authentication scheme.\n */\nexport class AnySignature extends Signature {\n public readonly signature: Signature;\n\n /**\n * Index of the underlying enum variant\n */\n private readonly variant: AnySignatureVariant;\n\n // region Constructors\n\n constructor(signature: Signature) {\n super();\n this.signature = signature;\n\n if (signature instanceof Ed25519Signature) {\n this.variant = AnySignatureVariant.Ed25519;\n } else if (signature instanceof Secp256k1Signature) {\n this.variant = AnySignatureVariant.Secp256k1;\n } else {\n throw new Error(\"Unsupported signature type\");\n }\n }\n\n // endregion\n\n // region AccountSignature\n\n toUint8Array() {\n return this.bcsToBytes();\n }\n\n // endregion\n\n // region Serializable\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(this.variant);\n this.signature.serialize(serializer);\n }\n\n static deserialize(deserializer: Deserializer): AnySignature {\n const variantIndex = deserializer.deserializeUleb128AsU32();\n let signature: Signature;\n switch (variantIndex) {\n case AnySignatureVariant.Ed25519:\n signature = Ed25519Signature.deserialize(deserializer);\n break;\n case AnySignatureVariant.Secp256k1:\n signature = Secp256k1Signature.deserialize(deserializer);\n break;\n default:\n throw new Error(`Unknown variant index for AnySignature: ${variantIndex}`);\n }\n return new AnySignature(signature);\n }\n\n // endregion\n}\n"],"mappings":"iNAgBO,IAAMA,EAAN,MAAMC,UAAqBC,CAAiB,CAajD,YAAYC,EAAsB,CAChC,MAAM,EACN,QAAK,UAAYA,EACbA,aAAqBC,EACvB,KAAK,QAAU,UACND,aAAqBE,EAC9B,KAAK,QAAU,MAEf,OAAM,IAAI,MAAM,6BAA6B,CAEjD,CAMA,gBAAgBC,EAAoC,CAClD,GAAM,CAAE,QAAAC,EAAS,UAAAC,CAAU,EAAIF,EAC/B,OAAME,aAAqBC,EAIpB,KAAK,UAAU,gBAAgB,CACpC,QAAAF,EACA,UAAWC,EAAU,SACvB,CAAC,EANQ,EAOX,CAEA,SAA6B,CAC3B,OAAOE,EAAkB,mBAAmB,CAC1C,SACA,MAAO,KAAK,aAAa,CAC3B,CAAC,CACH,CAEA,cAAe,CACb,OAAO,KAAK,WAAW,CACzB,CAMA,UAAUC,EAA8B,CACtCA,EAAW,sBAAsB,KAAK,OAAO,EAC7C,KAAK,UAAU,UAAUA,CAAU,CACrC,CAEA,OAAO,YAAYC,EAA0C,CAC3D,IAAMC,EAAeD,EAAa,wBAAwB,EACtDT,EACJ,OAAQU,EAAc,CACpB,OACEV,EAAYC,EAAiB,YAAYQ,CAAY,EACrD,MACF,OACET,EAAYE,EAAmB,YAAYO,CAAY,EACvD,MACF,QACE,MAAM,IAAI,MAAM,2CAA2CC,CAAY,EAAE,CAC7E,CACA,OAAO,IAAIZ,EAAaE,CAAS,CACnC,CAOA,OAAO,YAAYA,EAAwD,CACzE,OAAOA,aAAqBF,CAC9B,CAKA,WAAqB,CACnB,OAAO,KAAK,qBAAqBG,CACnC,CAKA,sBAAgC,CAC9B,OAAO,KAAK,qBAAqBC,CACnC,CACF,EAOaI,EAAN,MAAMK,UAAqBC,CAAU,CAU1C,YAAYP,EAAsB,CAChC,MAAM,EACN,QAAK,UAAYA,EAEbA,aAAqBQ,EACvB,KAAK,QAAU,UACNR,aAAqBS,EAC9B,KAAK,QAAU,MAEf,OAAM,IAAI,MAAM,4BAA4B,CAEhD,CAMA,cAAe,CACb,OAAO,KAAK,WAAW,CACzB,CAMA,UAAUN,EAA8B,CACtCA,EAAW,sBAAsB,KAAK,OAAO,EAC7C,KAAK,UAAU,UAAUA,CAAU,CACrC,CAEA,OAAO,YAAYC,EAA0C,CAC3D,IAAMC,EAAeD,EAAa,wBAAwB,EACtDJ,EACJ,OAAQK,EAAc,CACpB,OACEL,EAAYQ,EAAiB,YAAYJ,CAAY,EACrD,MACF,OACEJ,EAAYS,EAAmB,YAAYL,CAAY,EACvD,MACF,QACE,MAAM,IAAI,MAAM,2CAA2CC,CAAY,EAAE,CAC7E,CACA,OAAO,IAAIC,EAAaN,CAAS,CACnC,CAGF","names":["AnyPublicKey","_AnyPublicKey","AccountPublicKey","publicKey","Ed25519PublicKey","Secp256k1PublicKey","args","message","signature","AnySignature","AuthenticationKey","serializer","deserializer","variantIndex","_AnySignature","Signature","Ed25519Signature","Secp256k1Signature"]}
1
+ {"version":3,"sources":["../../src/core/crypto/singleKey.ts"],"sourcesContent":["import { Deserializer, Serializer } from \"../../bcs\";\nimport { AnyPublicKeyVariant, AnySignatureVariant, SigningScheme as AuthenticationKeyScheme } from \"../../types\";\nimport { AuthenticationKey } from \"../authenticationKey\";\nimport { Ed25519PublicKey, Ed25519Signature } from \"./ed25519\";\nimport { AccountPublicKey, PublicKey, VerifySignatureArgs } from \"./publicKey\";\nimport { Secp256k1PublicKey, Secp256k1Signature } from \"./secp256k1\";\nimport { Signature } from \"./signature\";\n\n/**\n * Represents any public key supported by Aptos.\n *\n * Since [AIP-55](https://github.com/aptos-foundation/AIPs/pull/263) Aptos supports\n * `Legacy` and `Unified` authentication keys.\n *\n * Any unified authentication key is represented in the SDK as `AnyPublicKey`.\n */\nexport class AnyPublicKey extends AccountPublicKey {\n /**\n * Reference to the inner public key\n */\n public readonly publicKey: PublicKey;\n\n /**\n * Index of the underlying enum variant\n */\n public readonly variant: AnyPublicKeyVariant;\n\n // region Constructors\n\n constructor(publicKey: PublicKey) {\n super();\n this.publicKey = publicKey;\n if (publicKey instanceof Ed25519PublicKey) {\n this.variant = AnyPublicKeyVariant.Ed25519;\n } else if (publicKey instanceof Secp256k1PublicKey) {\n this.variant = AnyPublicKeyVariant.Secp256k1;\n } else {\n throw new Error(\"Unsupported public key type\");\n }\n }\n\n // endregion\n\n // region AccountPublicKey\n\n verifySignature(args: VerifySignatureArgs): boolean {\n const { message, signature } = args;\n if (!(signature instanceof AnySignature)) {\n return false;\n }\n\n return this.publicKey.verifySignature({\n message,\n signature: signature.signature,\n });\n }\n\n authKey(): AuthenticationKey {\n return AuthenticationKey.fromSchemeAndBytes({\n scheme: AuthenticationKeyScheme.SingleKey,\n input: this.toUint8Array(),\n });\n }\n\n toUint8Array() {\n return this.bcsToBytes();\n }\n\n // endregion\n\n // region Serializable\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(this.variant);\n this.publicKey.serialize(serializer);\n }\n\n static deserialize(deserializer: Deserializer): AnyPublicKey {\n const variantIndex = deserializer.deserializeUleb128AsU32();\n let publicKey: PublicKey;\n switch (variantIndex) {\n case AnyPublicKeyVariant.Ed25519:\n publicKey = Ed25519PublicKey.deserialize(deserializer);\n break;\n case AnyPublicKeyVariant.Secp256k1:\n publicKey = Secp256k1PublicKey.deserialize(deserializer);\n break;\n default:\n throw new Error(`Unknown variant index for AnyPublicKey: ${variantIndex}`);\n }\n return new AnyPublicKey(publicKey);\n }\n\n // endregion\n\n /**\n * @deprecated use `instanceof AnyPublicKey` instead.\n */\n static isPublicKey(publicKey: AccountPublicKey): publicKey is AnyPublicKey {\n return publicKey instanceof AnyPublicKey;\n }\n\n /**\n * @deprecated use `publicKey instanceof Ed25519PublicKey` instead.\n */\n isEd25519(): boolean {\n return this.publicKey instanceof Ed25519PublicKey;\n }\n\n /**\n * @deprecated use `publicKey instanceof Secp256k1PublicKey` instead.\n */\n isSecp256k1PublicKey(): boolean {\n return this.publicKey instanceof Secp256k1PublicKey;\n }\n}\n\n/**\n * Instance of signature that uses the SingleKey authentication scheme.\n * This signature can only be generated by a `SingleKeySigner`, since it uses the\n * same authentication scheme.\n */\nexport class AnySignature extends Signature {\n public readonly signature: Signature;\n\n /**\n * Index of the underlying enum variant\n */\n private readonly variant: AnySignatureVariant;\n\n // region Constructors\n\n constructor(signature: Signature) {\n super();\n this.signature = signature;\n\n if (signature instanceof Ed25519Signature) {\n this.variant = AnySignatureVariant.Ed25519;\n } else if (signature instanceof Secp256k1Signature) {\n this.variant = AnySignatureVariant.Secp256k1;\n } else {\n throw new Error(\"Unsupported signature type\");\n }\n }\n\n // endregion\n\n // region AccountSignature\n\n toUint8Array() {\n return this.bcsToBytes();\n }\n\n // endregion\n\n // region Serializable\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(this.variant);\n this.signature.serialize(serializer);\n }\n\n static deserialize(deserializer: Deserializer): AnySignature {\n const variantIndex = deserializer.deserializeUleb128AsU32();\n let signature: Signature;\n switch (variantIndex) {\n case AnySignatureVariant.Ed25519:\n signature = Ed25519Signature.deserialize(deserializer);\n break;\n case AnySignatureVariant.Secp256k1:\n signature = Secp256k1Signature.deserialize(deserializer);\n break;\n default:\n throw new Error(`Unknown variant index for AnySignature: ${variantIndex}`);\n }\n return new AnySignature(signature);\n }\n\n // endregion\n}\n"],"mappings":"iNAgBO,IAAMA,EAAN,MAAMC,UAAqBC,CAAiB,CAajD,YAAYC,EAAsB,CAGhC,GAFA,MAAM,EACN,KAAK,UAAYA,EACbA,aAAqBC,EACvB,KAAK,QAAU,UACND,aAAqBE,EAC9B,KAAK,QAAU,MAEf,OAAM,IAAI,MAAM,6BAA6B,CAEjD,CAMA,gBAAgBC,EAAoC,CAClD,GAAM,CAAE,QAAAC,EAAS,UAAAC,CAAU,EAAIF,EAC/B,OAAME,aAAqBC,EAIpB,KAAK,UAAU,gBAAgB,CACpC,QAAAF,EACA,UAAWC,EAAU,SACvB,CAAC,EANQ,EAOX,CAEA,SAA6B,CAC3B,OAAOE,EAAkB,mBAAmB,CAC1C,SACA,MAAO,KAAK,aAAa,CAC3B,CAAC,CACH,CAEA,cAAe,CACb,OAAO,KAAK,WAAW,CACzB,CAMA,UAAUC,EAA8B,CACtCA,EAAW,sBAAsB,KAAK,OAAO,EAC7C,KAAK,UAAU,UAAUA,CAAU,CACrC,CAEA,OAAO,YAAYC,EAA0C,CAC3D,IAAMC,EAAeD,EAAa,wBAAwB,EACtDT,EACJ,OAAQU,EAAc,CACpB,OACEV,EAAYC,EAAiB,YAAYQ,CAAY,EACrD,MACF,OACET,EAAYE,EAAmB,YAAYO,CAAY,EACvD,MACF,QACE,MAAM,IAAI,MAAM,2CAA2CC,CAAY,EAAE,CAC7E,CACA,OAAO,IAAIZ,EAAaE,CAAS,CACnC,CAOA,OAAO,YAAYA,EAAwD,CACzE,OAAOA,aAAqBF,CAC9B,CAKA,WAAqB,CACnB,OAAO,KAAK,qBAAqBG,CACnC,CAKA,sBAAgC,CAC9B,OAAO,KAAK,qBAAqBC,CACnC,CACF,EAOaI,EAAN,MAAMK,UAAqBC,CAAU,CAU1C,YAAYP,EAAsB,CAIhC,GAHA,MAAM,EACN,KAAK,UAAYA,EAEbA,aAAqBQ,EACvB,KAAK,QAAU,UACNR,aAAqBS,EAC9B,KAAK,QAAU,MAEf,OAAM,IAAI,MAAM,4BAA4B,CAEhD,CAMA,cAAe,CACb,OAAO,KAAK,WAAW,CACzB,CAMA,UAAUN,EAA8B,CACtCA,EAAW,sBAAsB,KAAK,OAAO,EAC7C,KAAK,UAAU,UAAUA,CAAU,CACrC,CAEA,OAAO,YAAYC,EAA0C,CAC3D,IAAMC,EAAeD,EAAa,wBAAwB,EACtDJ,EACJ,OAAQK,EAAc,CACpB,OACEL,EAAYQ,EAAiB,YAAYJ,CAAY,EACrD,MACF,OACEJ,EAAYS,EAAmB,YAAYL,CAAY,EACvD,MACF,QACE,MAAM,IAAI,MAAM,2CAA2CC,CAAY,EAAE,CAC7E,CACA,OAAO,IAAIC,EAAaN,CAAS,CACnC,CAGF","names":["AnyPublicKey","_AnyPublicKey","AccountPublicKey","publicKey","Ed25519PublicKey","Secp256k1PublicKey","args","message","signature","AnySignature","AuthenticationKey","serializer","deserializer","variantIndex","_AnySignature","Signature","Ed25519Signature","Secp256k1Signature"]}
@@ -1,2 +1,2 @@
1
- import{c as r}from"./chunk-NBCHJ75L.mjs";import{b as i}from"./chunk-UDRSFVAK.mjs";import{b as t}from"./chunk-52C73T26.mjs";async function v(a){let{aptosConfig:o,payload:n,options:s}=a,p=await r({...n,aptosConfig:o}),e=new t;p.serialize(e);let l=e.toUint8Array(),{data:d}=await i({aptosConfig:o,path:"view",originMethod:"view",contentType:"application/x.aptos.view_function+bcs",params:{ledger_version:s?.ledgerVersion},body:l});return d}export{v as a};
2
- //# sourceMappingURL=chunk-2G4ZSGL4.mjs.map
1
+ import{c as r}from"./chunk-TGQARO3F.mjs";import{b as i}from"./chunk-YMB2XW2O.mjs";import{b as t}from"./chunk-36QXVFR5.mjs";async function v(a){let{aptosConfig:o,payload:n,options:s}=a,p=await r({...n,aptosConfig:o}),e=new t;p.serialize(e);let l=e.toUint8Array(),{data:d}=await i({aptosConfig:o,path:"view",originMethod:"view",contentType:"application/x.aptos.view_function+bcs",params:{ledger_version:s?.ledgerVersion},body:l});return d}export{v as a};
2
+ //# sourceMappingURL=chunk-IZQV2SU6.mjs.map
@@ -0,0 +1,2 @@
1
+ import{a as c}from"./chunk-IZQV2SU6.mjs";import{a as e,b as s,c as r,d as n,e as t,g as i,h as a}from"./chunk-JQIGQMNZ.mjs";var g=class{constructor(o){this.config=o}async getLedgerInfo(){return e({aptosConfig:this.config})}async getChainId(){return(await this.getLedgerInfo()).chain_id}async getBlockByVersion(o){return s({aptosConfig:this.config,...o})}async getBlockByHeight(o){return r({aptosConfig:this.config,...o})}async view(o){return c({aptosConfig:this.config,...o})}async getChainTopUserTransactions(o){return n({aptosConfig:this.config,...o})}async queryIndexer(o){return t({aptosConfig:this.config,...o})}async getIndexerLastSuccessVersion(){return i({aptosConfig:this.config})}async getProcessorStatus(o){return a({aptosConfig:this.config,processorType:o})}};export{g as a};
2
+ //# sourceMappingURL=chunk-J6OFSYUA.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/api/general.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { AptosConfig } from \"./aptosConfig\";\nimport {\n getBlockByHeight,\n getBlockByVersion,\n getChainTopUserTransactions,\n getIndexerLastSuccessVersion,\n getLedgerInfo,\n getProcessorStatus,\n queryIndexer,\n} from \"../internal/general\";\nimport { view } from \"../internal/view\";\nimport {\n AnyNumber,\n Block,\n GetChainTopUserTransactionsResponse,\n GetProcessorStatusResponse,\n GraphqlQuery,\n LedgerInfo,\n LedgerVersionArg,\n MoveValue,\n} from \"../types\";\nimport { ProcessorType } from \"../utils/const\";\nimport { InputViewFunctionData } from \"../transactions\";\n\n/**\n * A class to query all `General` Aptos related queries\n */\nexport class General {\n readonly config: AptosConfig;\n\n constructor(config: AptosConfig) {\n this.config = config;\n }\n\n /**\n * Queries for the Aptos ledger info\n *\n * @returns Aptos Ledger Info\n *\n * @example\n * const ledgerInfo = await aptos.getLedgerInfo()\n * // an example of the returned data\n * ```\n * {\n * \"chain_id\": 4,\n * \"epoch\": \"8\",\n * \"ledger_version\": \"714\",\n * \"oldest_ledger_version\": \"0\",\n * \"ledger_timestamp\": \"1694695496521775\",\n * \"node_role\": \"validator\",\n * \"oldest_block_height\": \"0\",\n * \"block_height\": \"359\",\n * \"git_hash\": \"c82193f36f4e185fed9f68c4ad21f6c6dd390c6e\"\n * }\n * ```\n */\n async getLedgerInfo(): Promise<LedgerInfo> {\n return getLedgerInfo({ aptosConfig: this.config });\n }\n\n /**\n * Queries for the chain id\n *\n * @example\n * const chainId = await aptos.getChainId()\n *\n * @returns The chain id\n */\n async getChainId(): Promise<number> {\n const result = await this.getLedgerInfo();\n return result.chain_id;\n }\n\n /**\n * Queries for block by transaction version\n *\n * @example\n * const block = await aptos.getBlockByVersion({ledgerVersion:5})\n *\n * @param args.ledgerVersion Ledger version to lookup block information for\n * @param args.options.withTransactions If set to true, include all transactions in the block\n *\n * @returns Block information with optional transactions\n */\n async getBlockByVersion(args: {\n ledgerVersion: AnyNumber;\n options?: { withTransactions?: boolean };\n }): Promise<Block> {\n return getBlockByVersion({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Get block by block height\n *\n * @example\n * const block = await aptos.getBlockByVersion({blockHeight:5})\n *\n * @param args.blockHeight Block height to lookup. Starts at 0\n * @param args.options.withTransactions If set to true, include all transactions in the block\n *\n * @returns Block with optional transactions\n */\n async getBlockByHeight(args: { blockHeight: AnyNumber; options?: { withTransactions?: boolean } }): Promise<Block> {\n return getBlockByHeight({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries for a Move view function\n * @param args.payload Payload for the view function\n * @param args.options.ledgerVersion The ledger version to query, if not provided it will get the latest version\n *\n * @example\n * const data = await aptos.view({\n * payload: {\n * function: \"0x1::coin::balance\",\n * typeArguments: [\"0x1::aptos_coin::AptosCoin\"],\n * functionArguments: [accountAddress],\n * }\n * })\n *\n * @returns an array of Move values\n */\n async view<T extends Array<MoveValue>>(args: {\n payload: InputViewFunctionData;\n options?: LedgerVersionArg;\n }): Promise<T> {\n return view<T>({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries top user transactions\n *\n * @example\n * const topUserTransactions = await aptos.getChainTopUserTransactions({limit:5})\n *\n * @param args.limit The number of transactions to return\n * @returns GetChainTopUserTransactionsResponse\n */\n async getChainTopUserTransactions(args: { limit: number }): Promise<GetChainTopUserTransactionsResponse> {\n return getChainTopUserTransactions({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * A generic function for retrieving data from Aptos Indexer.\n * For more detailed queries specification see\n * {@link https://cloud.hasura.io/public/graphiql?endpoint=https://api.mainnet.aptoslabs.com/v1/graphql}\n *\n * @example\n * const topUserTransactions = await aptos.queryIndexer({\n * query: `query MyQuery {\n * ledger_infos {\n * chain_id\n * }}`;\n * })\n *\n * @param args.query.query A GraphQL query\n * @param args.query.variables The variables for the query\n *\n * @return The provided T type\n */\n async queryIndexer<T extends {}>(args: { query: GraphqlQuery }): Promise<T> {\n return queryIndexer<T>({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Queries for the last successful indexer version\n *\n * This is useful to tell what ledger version the indexer is updated to, as it can be behind the full nodes.\n *\n * @example\n * const version = await aptos.getIndexerLastSuccessVersion()\n */\n async getIndexerLastSuccessVersion(): Promise<bigint> {\n return getIndexerLastSuccessVersion({ aptosConfig: this.config });\n }\n\n /**\n * Query the processor status for a specific processor type.\n *\n * @example\n * const status = await aptos.getProcessorStatus({processorType:\"account_transactions_processor\"})\n *\n * @param processorType The processor type to query\n * @returns\n */\n async getProcessorStatus(processorType: ProcessorType): Promise<GetProcessorStatusResponse[0]> {\n return getProcessorStatus({ aptosConfig: this.config, processorType });\n }\n}\n"],"mappings":"4HA8BO,IAAMA,EAAN,KAAc,CAGnB,YAAYC,EAAqB,CAC/B,KAAK,OAASA,CAChB,CAwBA,MAAM,eAAqC,CACzC,OAAOC,EAAc,CAAE,YAAa,KAAK,MAAO,CAAC,CACnD,CAUA,MAAM,YAA8B,CAElC,OADe,MAAM,KAAK,cAAc,GAC1B,QAChB,CAaA,MAAM,kBAAkBC,EAGL,CACjB,OAAOC,EAAkB,CACvB,YAAa,KAAK,OAClB,GAAGD,CACL,CAAC,CACH,CAaA,MAAM,iBAAiBA,EAA4F,CACjH,OAAOE,EAAiB,CAAE,YAAa,KAAK,OAAQ,GAAGF,CAAK,CAAC,CAC/D,CAkBA,MAAM,KAAiCA,EAGxB,CACb,OAAOG,EAAQ,CAAE,YAAa,KAAK,OAAQ,GAAGH,CAAK,CAAC,CACtD,CAWA,MAAM,4BAA4BA,EAAuE,CACvG,OAAOI,EAA4B,CACjC,YAAa,KAAK,OAClB,GAAGJ,CACL,CAAC,CACH,CAoBA,MAAM,aAA2BA,EAA2C,CAC1E,OAAOK,EAAgB,CACrB,YAAa,KAAK,OAClB,GAAGL,CACL,CAAC,CACH,CAUA,MAAM,8BAAgD,CACpD,OAAOM,EAA6B,CAAE,YAAa,KAAK,MAAO,CAAC,CAClE,CAWA,MAAM,mBAAmBC,EAAsE,CAC7F,OAAOC,EAAmB,CAAE,YAAa,KAAK,OAAQ,cAAAD,CAAc,CAAC,CACvE,CACF","names":["General","config","getLedgerInfo","args","getBlockByVersion","getBlockByHeight","view","getChainTopUserTransactions","queryIndexer","getIndexerLastSuccessVersion","processorType","getProcessorStatus"]}
@@ -0,0 +1,2 @@
1
+ import{a as t}from"./chunk-5YLAWRI2.mjs";import{a as o,b as r,c as s}from"./chunk-TM7NDDT3.mjs";var a=class{constructor(e){this.config=e}async getTableItem(e){return o({aptosConfig:this.config,...e})}async getTableItemsData(e){return await t({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"default_processor"}),r({aptosConfig:this.config,...e})}async getTableItemsMetadata(e){return await t({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"default_processor"}),s({aptosConfig:this.config,...e})}};export{a};
2
+ //# sourceMappingURL=chunk-JB5H65CE.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/api/table.ts"],"sourcesContent":["import { getTableItem, getTableItemsData, getTableItemsMetadata } from \"../internal/table\";\nimport {\n TableItemRequest,\n LedgerVersionArg,\n AnyNumber,\n PaginationArgs,\n WhereArg,\n OrderByArg,\n GetTableItemsDataResponse,\n GetTableItemsMetadataResponse,\n} from \"../types\";\nimport { TableItemsBoolExp, TableMetadatasBoolExp } from \"../types/generated/types\";\nimport { ProcessorType } from \"../utils\";\nimport { AptosConfig } from \"./aptosConfig\";\nimport { waitForIndexerOnVersion } from \"./utils\";\n\n/**\n * A class to query all `Table` Aptos related queries\n */\nexport class Table {\n readonly config: AptosConfig;\n\n constructor(config: AptosConfig) {\n this.config = config;\n }\n\n /**\n * Queries for a table item for a table identified by the handle and the key for the item.\n * Key and value types need to be passed in to help with key serialization and value deserialization.\n *\n * Note, this query calls the fullnode server\n *\n * @example https://api.devnet.aptoslabs.com/v1/accounts/0x1/resource/0x1::coin::CoinInfo%3C0x1::aptos_coin::AptosCoin%3E\n * const tableItem = await aptos.getTableItem({\n * handle: \"0x1b854694ae746cdbd8d44186ca4929b2b337df21d1c74633be19b2710552fdca\",\n * data: {\n * key_type: \"address\", // Move type of table key\n * value_type: \"u128\", // Move type of table value\n * key: \"0x619dc29a0aac8fa146714058e8dd6d2d0f3bdf5f6331907bf91f3acd81e6935\" // Value of table key\n * },\n * })\n *\n * @param args.handle A pointer to where that table is stored\n * @param args.data Object that describes table item\n * @param args.options.ledgerVersion The ledger version to query, if not provided it will get the latest version\n *\n * @returns Table item value rendered in JSON\n */\n async getTableItem<T>(args: { handle: string; data: TableItemRequest; options?: LedgerVersionArg }): Promise<T> {\n return getTableItem<T>({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries for a table items data.\n *\n * Optional `options.where` param can be passed to filter the response.\n *\n * Note, this query calls the indexer server\n *\n * @example\n * const data = await aptos.getTableItemsData({\n * options: { where: {\n * table_handle: { _eq: \"0x1b854694ae746cdbd8d44186ca4929b2b337df21d1c74633be19b2710552fdca\" },\n * transaction_version: { _eq: \"0\" }\n * }\n * },\n * });\n *\n * @returns GetTableItemsDataResponse\n */\n async getTableItemsData(args: {\n minimumLedgerVersion?: AnyNumber;\n options?: PaginationArgs & WhereArg<TableItemsBoolExp> & OrderByArg<GetTableItemsDataResponse[0]>;\n }): Promise<GetTableItemsDataResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.DEFAULT,\n });\n return getTableItemsData({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries for a table items metadata.\n *\n * Optional `options.where` param can be passed to filter the response.\n *\n * Note, this query calls the indexer server\n *\n * @example\n * const data = await aptos.getTableItemsMetadata({\n * options: { where: { handle: { _eq: \"0x1b854694ae746cdbd8d44186ca4929b2b337df21d1c74633be19b2710552fdca\" } } },\n * });\n *\n * @returns GetTableItemsMetadataResponse\n */\n async getTableItemsMetadata(args: {\n minimumLedgerVersion?: AnyNumber;\n options?: PaginationArgs & WhereArg<TableMetadatasBoolExp> & OrderByArg<GetTableItemsMetadataResponse[0]>;\n }): Promise<GetTableItemsMetadataResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.DEFAULT,\n });\n return getTableItemsMetadata({ aptosConfig: this.config, ...args });\n }\n}\n"],"mappings":"gGAmBO,IAAMA,EAAN,KAAY,CAGjB,YAAYC,EAAqB,CAC/B,KAAK,OAASA,CAChB,CAwBA,MAAM,aAAgBC,EAA0F,CAC9G,OAAOC,EAAgB,CAAE,YAAa,KAAK,OAAQ,GAAGD,CAAK,CAAC,CAC9D,CAoBA,MAAM,kBAAkBA,EAGe,CACrC,aAAME,EAAwB,CAC5B,OAAQ,KAAK,OACb,qBAAsBF,EAAK,qBAC3B,iCACF,CAAC,EACMG,EAAkB,CAAE,YAAa,KAAK,OAAQ,GAAGH,CAAK,CAAC,CAChE,CAgBA,MAAM,sBAAsBA,EAGe,CACzC,aAAME,EAAwB,CAC5B,OAAQ,KAAK,OACb,qBAAsBF,EAAK,qBAC3B,iCACF,CAAC,EACMI,EAAsB,CAAE,YAAa,KAAK,OAAQ,GAAGJ,CAAK,CAAC,CACpE,CACF","names":["Table","config","args","getTableItem","waitForIndexerOnVersion","getTableItemsData","getTableItemsMetadata"]}
@@ -0,0 +1,2 @@
1
+ import{c as T,d as c}from"./chunk-BO2TLWNT.mjs";import{f as A,g as a}from"./chunk-CYNQRMO5.mjs";import{sha3_256 as y}from"@noble/hashes/sha3";function d(e){return e.feePayerAddress?new c(e.rawTransaction,e.secondarySignerAddresses??[],e.feePayerAddress):e.secondarySignerAddresses?new T(e.rawTransaction,e.secondarySignerAddresses):e.rawTransaction}function n(e,r){let i=y.create();if(!r.startsWith("APTOS::"))throw new Error(`Domain separator needs to start with 'APTOS::'. Provided - ${r}`);i.update(r);let s=i.digest(),o=e,t=new Uint8Array(s.length+o.length);return t.set(s),t.set(o,s.length),t}function u(e){return n(e.bcsToBytes(),`APTOS::${e.constructor.name}`)}function S(e){let r=d(e);return e.feePayerAddress?n(r.bcsToBytes(),a):e.secondarySignerAddresses?n(r.bcsToBytes(),a):n(r.bcsToBytes(),A)}export{d as a,n as b,u as c,S as d};
2
+ //# sourceMappingURL=chunk-JFIAWBCK.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/transactions/transactionBuilder/signingMessage.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * This file handles the generation of the signing message.\n */\nimport { sha3_256 as sha3Hash } from \"@noble/hashes/sha3\";\nimport { RAW_TRANSACTION_SALT, RAW_TRANSACTION_WITH_DATA_SALT } from \"../../utils/const\";\nimport { FeePayerRawTransaction, MultiAgentRawTransaction } from \"../instances\";\nimport { AnyRawTransaction, AnyRawTransactionInstance } from \"../types\";\nimport { Serializable } from \"../../bcs\";\n\n/**\n * Derive the raw transaction type - FeePayerRawTransaction or MultiAgentRawTransaction or RawTransaction\n *\n * @param transaction A aptos transaction type\n *\n * @returns FeePayerRawTransaction | MultiAgentRawTransaction | RawTransaction\n */\nexport function deriveTransactionType(transaction: AnyRawTransaction): AnyRawTransactionInstance {\n if (transaction.feePayerAddress) {\n return new FeePayerRawTransaction(\n transaction.rawTransaction,\n transaction.secondarySignerAddresses ?? [],\n transaction.feePayerAddress,\n );\n }\n if (transaction.secondarySignerAddresses) {\n return new MultiAgentRawTransaction(transaction.rawTransaction, transaction.secondarySignerAddresses);\n }\n\n return transaction.rawTransaction;\n}\n\n/**\n * Generates the 'signing message' form of a message to be signed.\n *\n * @param bytes The byte representation of the message to be signed and sent to the chain\n * @param domainSeparator A domain separator that starts with 'APTOS::'\n *\n * @returns The Uint8Array of the signing message\n */\nexport function generateSigningMessage(bytes: Uint8Array, domainSeparator: string): Uint8Array {\n const hash = sha3Hash.create();\n\n if (!domainSeparator.startsWith(\"APTOS::\")) {\n throw new Error(`Domain separator needs to start with 'APTOS::'. Provided - ${domainSeparator}`);\n }\n\n hash.update(domainSeparator);\n\n const prefix = hash.digest();\n\n const body = bytes;\n\n const mergedArray = new Uint8Array(prefix.length + body.length);\n mergedArray.set(prefix);\n mergedArray.set(body, prefix.length);\n\n return mergedArray;\n}\n\n/**\n * Generates the 'signing message' form of a serilizable value. It bcs serializes the value and uses the name of\n * its constructor as the domain separator.\n *\n * @param serializable An object that has a bcs serialized form\n *\n * @returns The Uint8Array of the signing message\n */\nexport function generateSigningMessageForSerializable(serializable: Serializable): Uint8Array {\n return generateSigningMessage(serializable.bcsToBytes(), `APTOS::${serializable.constructor.name}`);\n}\n\n/**\n * Generates the 'signing message' form of a transaction. It derives the type of transaction and\n * applies the appropriate domain separator based on if there is extra data such as a fee payer or\n * secondary signers.\n *\n * @param transaction A transaction that is to be signed\n *\n * @returns The Uint8Array of the signing message\n */\nexport function generateSigningMessageForTransaction(transaction: AnyRawTransaction): Uint8Array {\n const rawTxn = deriveTransactionType(transaction);\n if (transaction.feePayerAddress) {\n return generateSigningMessage(rawTxn.bcsToBytes(), RAW_TRANSACTION_WITH_DATA_SALT);\n }\n if (transaction.secondarySignerAddresses) {\n return generateSigningMessage(rawTxn.bcsToBytes(), RAW_TRANSACTION_WITH_DATA_SALT);\n }\n return generateSigningMessage(rawTxn.bcsToBytes(), RAW_TRANSACTION_SALT);\n}\n"],"mappings":"gGAMA,OAAS,YAAYA,MAAgB,qBAa9B,SAASC,EAAsBC,EAA2D,CAC/F,OAAIA,EAAY,gBACP,IAAIC,EACTD,EAAY,eACZA,EAAY,0BAA4B,CAAC,EACzCA,EAAY,eACd,EAEEA,EAAY,yBACP,IAAIE,EAAyBF,EAAY,eAAgBA,EAAY,wBAAwB,EAG/FA,EAAY,cACrB,CAUO,SAASG,EAAuBC,EAAmBC,EAAqC,CAC7F,IAAMC,EAAOC,EAAS,OAAO,EAE7B,GAAI,CAACF,EAAgB,WAAW,SAAS,EACvC,MAAM,IAAI,MAAM,+DAA+DA,CAAe,EAAE,EAGlGC,EAAK,OAAOD,CAAe,EAE3B,IAAMG,EAASF,EAAK,OAAO,EAErBG,EAAOL,EAEPM,EAAc,IAAI,WAAWF,EAAO,OAASC,EAAK,MAAM,EAC9D,OAAAC,EAAY,IAAIF,CAAM,EACtBE,EAAY,IAAID,EAAMD,EAAO,MAAM,EAE5BE,CACT,CAUO,SAASC,EAAsCC,EAAwC,CAC5F,OAAOT,EAAuBS,EAAa,WAAW,EAAG,UAAUA,EAAa,YAAY,IAAI,EAAE,CACpG,CAWO,SAASC,EAAqCb,EAA4C,CAC/F,IAAMc,EAASf,EAAsBC,CAAW,EAChD,OAAIA,EAAY,gBACPG,EAAuBW,EAAO,WAAW,EAAGC,CAA8B,EAE/Ef,EAAY,yBACPG,EAAuBW,EAAO,WAAW,EAAGC,CAA8B,EAE5EZ,EAAuBW,EAAO,WAAW,EAAGE,CAAoB,CACzE","names":["sha3Hash","deriveTransactionType","transaction","FeePayerRawTransaction","MultiAgentRawTransaction","generateSigningMessage","bytes","domainSeparator","hash","sha3Hash","prefix","body","mergedArray","generateSigningMessageForSerializable","serializable","generateSigningMessageForTransaction","rawTxn","RAW_TRANSACTION_WITH_DATA_SALT","RAW_TRANSACTION_SALT"]}
@@ -0,0 +1,2 @@
1
+ import{m as p,v as a}from"./chunk-S3EDNXZE.mjs";import{b as n}from"./chunk-S2VSJJRJ.mjs";import{c}from"./chunk-YMB2XW2O.mjs";async function h(o){let{aptosConfig:t}=o,{data:s}=await n({aptosConfig:t,originMethod:"getLedgerInfo",path:""});return s}async function d(o){let{aptosConfig:t,ledgerVersion:s,options:e}=o,{data:r}=await n({aptosConfig:t,originMethod:"getBlockByVersion",path:`blocks/by_version/${s}`,params:{with_transactions:e?.withTransactions}});return r}async function C(o){let{aptosConfig:t,blockHeight:s,options:e}=o,{data:r}=await n({aptosConfig:t,originMethod:"getBlockByHeight",path:`blocks/by_height/${s}`,params:{with_transactions:e?.withTransactions}});return r}async function l(o){let{aptosConfig:t,limit:s}=o;return(await i({aptosConfig:t,query:{query:p,variables:{limit:s}},originMethod:"getChainTopUserTransactions"})).user_transactions}async function i(o){let{aptosConfig:t,query:s,originMethod:e}=o,{data:r}=await c({aptosConfig:t,originMethod:e??"queryIndexer",path:"",body:s,overrides:{WITH_CREDENTIALS:!1}});return r}async function g(o){let{aptosConfig:t}=o;return(await i({aptosConfig:t,query:{query:a},originMethod:"getProcessorStatuses"})).processor_status}async function m(o){let t=await g({aptosConfig:o.aptosConfig});return BigInt(t[0].last_success_version)}async function T(o){let{aptosConfig:t,processorType:s}=o;return(await i({aptosConfig:t,query:{query:a,variables:{where_condition:{processor:{_eq:s}}}},originMethod:"getProcessorStatus"})).processor_status[0]}export{h as a,d as b,C as c,l as d,i as e,g as f,m as g,T as h};
2
+ //# sourceMappingURL=chunk-JQIGQMNZ.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/internal/general.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/general}. By moving the methods out into a separate file,\n * other namespaces and processes can access these methods without depending on the entire\n * general namespace and without having a dependency cycle error.\n */\n\nimport { AptosConfig } from \"../api/aptosConfig\";\nimport { getAptosFullNode, postAptosIndexer } from \"../client\";\nimport {\n AnyNumber,\n Block,\n GetChainTopUserTransactionsResponse,\n GetProcessorStatusResponse,\n GraphqlQuery,\n LedgerInfo,\n} from \"../types\";\nimport { GetChainTopUserTransactionsQuery, GetProcessorStatusQuery } from \"../types/generated/operations\";\nimport { GetChainTopUserTransactions, GetProcessorStatus } from \"../types/generated/queries\";\nimport { ProcessorType } from \"../utils/const\";\n\nexport async function getLedgerInfo(args: { aptosConfig: AptosConfig }): Promise<LedgerInfo> {\n const { aptosConfig } = args;\n const { data } = await getAptosFullNode<{}, LedgerInfo>({\n aptosConfig,\n originMethod: \"getLedgerInfo\",\n path: \"\",\n });\n return data;\n}\n\nexport async function getBlockByVersion(args: {\n aptosConfig: AptosConfig;\n ledgerVersion: AnyNumber;\n options?: { withTransactions?: boolean };\n}): Promise<Block> {\n const { aptosConfig, ledgerVersion, options } = args;\n const { data } = await getAptosFullNode<{}, Block>({\n aptosConfig,\n originMethod: \"getBlockByVersion\",\n path: `blocks/by_version/${ledgerVersion}`,\n params: { with_transactions: options?.withTransactions },\n });\n return data;\n}\n\nexport async function getBlockByHeight(args: {\n aptosConfig: AptosConfig;\n blockHeight: AnyNumber;\n options?: { withTransactions?: boolean };\n}): Promise<Block> {\n const { aptosConfig, blockHeight, options } = args;\n const { data } = await getAptosFullNode<{}, Block>({\n aptosConfig,\n originMethod: \"getBlockByHeight\",\n path: `blocks/by_height/${blockHeight}`,\n params: { with_transactions: options?.withTransactions },\n });\n return data;\n}\n\nexport async function getChainTopUserTransactions(args: {\n aptosConfig: AptosConfig;\n limit: number;\n}): Promise<GetChainTopUserTransactionsResponse> {\n const { aptosConfig, limit } = args;\n const graphqlQuery = {\n query: GetChainTopUserTransactions,\n variables: { limit },\n };\n\n const data = await queryIndexer<GetChainTopUserTransactionsQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getChainTopUserTransactions\",\n });\n\n return data.user_transactions;\n}\n\nexport async function queryIndexer<T extends {}>(args: {\n aptosConfig: AptosConfig;\n query: GraphqlQuery;\n originMethod?: string;\n}): Promise<T> {\n const { aptosConfig, query, originMethod } = args;\n const { data } = await postAptosIndexer<GraphqlQuery, T>({\n aptosConfig,\n originMethod: originMethod ?? \"queryIndexer\",\n path: \"\",\n body: query,\n overrides: { WITH_CREDENTIALS: false },\n });\n return data;\n}\n\nexport async function getProcessorStatuses(args: { aptosConfig: AptosConfig }): Promise<GetProcessorStatusResponse> {\n const { aptosConfig } = args;\n\n const graphqlQuery = {\n query: GetProcessorStatus,\n };\n\n const data = await queryIndexer<GetProcessorStatusQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getProcessorStatuses\",\n });\n\n return data.processor_status;\n}\n\nexport async function getIndexerLastSuccessVersion(args: { aptosConfig: AptosConfig }): Promise<bigint> {\n const response = await getProcessorStatuses({ aptosConfig: args.aptosConfig });\n return BigInt(response[0].last_success_version);\n}\n\nexport async function getProcessorStatus(args: {\n aptosConfig: AptosConfig;\n processorType: ProcessorType;\n}): Promise<GetProcessorStatusResponse[0]> {\n const { aptosConfig, processorType } = args;\n\n const whereCondition: { processor: { _eq: string } } = {\n processor: { _eq: processorType },\n };\n\n const graphqlQuery = {\n query: GetProcessorStatus,\n variables: {\n where_condition: whereCondition,\n },\n };\n\n const data = await queryIndexer<GetProcessorStatusQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getProcessorStatus\",\n });\n\n return data.processor_status[0];\n}\n"],"mappings":"6HAwBA,eAAsBA,EAAcC,EAAyD,CAC3F,GAAM,CAAE,YAAAC,CAAY,EAAID,EAClB,CAAE,KAAAE,CAAK,EAAI,MAAMC,EAAiC,CACtD,YAAAF,EACA,aAAc,gBACd,KAAM,EACR,CAAC,EACD,OAAOC,CACT,CAEA,eAAsBE,EAAkBJ,EAIrB,CACjB,GAAM,CAAE,YAAAC,EAAa,cAAAI,EAAe,QAAAC,CAAQ,EAAIN,EAC1C,CAAE,KAAAE,CAAK,EAAI,MAAMC,EAA4B,CACjD,YAAAF,EACA,aAAc,oBACd,KAAM,qBAAqBI,CAAa,GACxC,OAAQ,CAAE,kBAAmBC,GAAS,gBAAiB,CACzD,CAAC,EACD,OAAOJ,CACT,CAEA,eAAsBK,EAAiBP,EAIpB,CACjB,GAAM,CAAE,YAAAC,EAAa,YAAAO,EAAa,QAAAF,CAAQ,EAAIN,EACxC,CAAE,KAAAE,CAAK,EAAI,MAAMC,EAA4B,CACjD,YAAAF,EACA,aAAc,mBACd,KAAM,oBAAoBO,CAAW,GACrC,OAAQ,CAAE,kBAAmBF,GAAS,gBAAiB,CACzD,CAAC,EACD,OAAOJ,CACT,CAEA,eAAsBO,EAA4BT,EAGD,CAC/C,GAAM,CAAE,YAAAC,EAAa,MAAAS,CAAM,EAAIV,EAY/B,OANa,MAAMW,EAA+C,CAChE,YAAAV,EACA,MAPmB,CACnB,MAAOW,EACP,UAAW,CAAE,MAAAF,CAAM,CACrB,EAKE,aAAc,6BAChB,CAAC,GAEW,iBACd,CAEA,eAAsBC,EAA2BX,EAIlC,CACb,GAAM,CAAE,YAAAC,EAAa,MAAAY,EAAO,aAAAC,CAAa,EAAId,EACvC,CAAE,KAAAE,CAAK,EAAI,MAAMa,EAAkC,CACvD,YAAAd,EACA,aAAca,GAAgB,eAC9B,KAAM,GACN,KAAMD,EACN,UAAW,CAAE,iBAAkB,EAAM,CACvC,CAAC,EACD,OAAOX,CACT,CAEA,eAAsBc,EAAqBhB,EAAyE,CAClH,GAAM,CAAE,YAAAC,CAAY,EAAID,EAYxB,OANa,MAAMW,EAAsC,CACvD,YAAAV,EACA,MANmB,CACnB,MAAOgB,CACT,EAKE,aAAc,sBAChB,CAAC,GAEW,gBACd,CAEA,eAAsBC,EAA6BlB,EAAqD,CACtG,IAAMmB,EAAW,MAAMH,EAAqB,CAAE,YAAahB,EAAK,WAAY,CAAC,EAC7E,OAAO,OAAOmB,EAAS,CAAC,EAAE,oBAAoB,CAChD,CAEA,eAAsBC,EAAmBpB,EAGE,CACzC,GAAM,CAAE,YAAAC,EAAa,cAAAoB,CAAc,EAAIrB,EAmBvC,OANa,MAAMW,EAAsC,CACvD,YAAAV,EACA,MATmB,CACnB,MAAOgB,EACP,UAAW,CACT,gBAPmD,CACrD,UAAW,CAAE,IAAKI,CAAc,CAClC,CAME,CACF,EAKE,aAAc,oBAChB,CAAC,GAEW,iBAAiB,CAAC,CAChC","names":["getLedgerInfo","args","aptosConfig","data","getAptosFullNode","getBlockByVersion","ledgerVersion","options","getBlockByHeight","blockHeight","getChainTopUserTransactions","limit","queryIndexer","GetChainTopUserTransactions","query","originMethod","postAptosIndexer","getProcessorStatuses","GetProcessorStatus","getIndexerLastSuccessVersion","response","getProcessorStatus","processorType"]}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=chunk-JXCZTOYC.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,2 @@
1
+ import{a as g,f as d,g as C,i as w}from"./chunk-TGQARO3F.mjs";import{a as I}from"./chunk-3HSXKDOC.mjs";import{b as f}from"./chunk-YMB2XW2O.mjs";import{a as P}from"./chunk-2YZSEM2G.mjs";import{d as l}from"./chunk-JFIAWBCK.mjs";import{a as T}from"./chunk-GM56MMNJ.mjs";import{c as A,m as s}from"./chunk-U3YYSIIT.mjs";import{b as p}from"./chunk-QRS4DGP3.mjs";import{a as r}from"./chunk-G56GPLTB.mjs";import{b as y}from"./chunk-SRDIYE3M.mjs";async function b(t){let a=await h(t);return x(t,a)}async function h(t){let{aptosConfig:a,data:n}=t,e,o;return"bytecode"in n?o=await g(n):"multisigAddress"in n?(e={aptosConfig:a,multisigAddress:n.multisigAddress,function:n.function,functionArguments:n.functionArguments,typeArguments:n.typeArguments,abi:n.abi},o=await g(e)):(e={aptosConfig:a,function:n.function,functionArguments:n.functionArguments,typeArguments:n.typeArguments,abi:n.abi},o=await g(e)),o}async function x(t,a){let{aptosConfig:n,sender:e,options:o}=t,i;if(D(t)&&(i=p.ZERO.toString()),G(t)){let{secondarySignerAddresses:c}=t;return d({aptosConfig:n,sender:e,payload:a,options:o,secondarySignerAddresses:c,feePayerAddress:i})}return d({aptosConfig:n,sender:e,payload:a,options:o,feePayerAddress:i})}function D(t){return t.withFeePayer===!0}function G(t){return"secondarySignerAddresses"in t}function Q(t){let{transaction:a}=t;return l(a)}function U(t){let{signer:a,transaction:n}=t;return a.signTransactionWithAuthenticator(n)}async function X(t){let{aptosConfig:a,transaction:n,signerPublicKey:e,secondarySignersPublicKeys:o,feePayerPublicKey:i,options:c}=t,u=C({transaction:n,signerPublicKey:e,secondarySignersPublicKeys:o,feePayerPublicKey:i,options:c}),{data:m}=await f({aptosConfig:a,body:u,path:"transactions/simulate",params:{estimate_gas_unit_price:t.options?.estimateGasUnitPrice??!1,estimate_max_gas_amount:t.options?.estimateMaxGasAmount??!1,estimate_prioritized_gas_unit_price:t.options?.estimatePrioritizedGasUnitPrice??!1},originMethod:"simulateTransaction",contentType:"application/x.aptos.signed_transaction+bcs"});return m}async function _(t){let{aptosConfig:a}=t,n=w({...t}),{data:e}=await f({aptosConfig:a,body:n,path:"transactions",originMethod:"submitTransaction",contentType:"application/x.aptos.signed_transaction+bcs"});return e}async function K(t){let{aptosConfig:a,signer:n,transaction:e}=t,o=U({signer:n,transaction:e});return _({aptosConfig:a,transaction:e,senderAuthenticator:o})}var B={typeParameters:[],parameters:[s.u8(),new s(s.u8())]};async function Y(t){let{aptosConfig:a,account:n,metadataBytes:e,moduleBytecode:o,options:i}=t,c=o.map(u=>r.U8(u));return b({aptosConfig:a,sender:p.from(n),data:{function:"0x1::code::publish_package_txn",functionArguments:[r.U8(e),new r(c)],abi:B},options:i})}var M={typeParameters:[],parameters:[new A,s.u8(),new A,s.u8(),s.u8(),s.u8()]};async function $(t){let{aptosConfig:a,fromAccount:n,toNewPrivateKey:e}=t,o=await I({aptosConfig:a,accountAddress:n.accountAddress}),i=P.fromPrivateKey({privateKey:e,legacy:!0}),u=new T({sequenceNumber:BigInt(o.sequence_number),originator:n.accountAddress,currentAuthKey:p.from(o.authentication_key),newPublicKey:i.publicKey}).bcsToBytes(),m=n.sign(u),S=i.sign(u),R=await b({aptosConfig:a,sender:n.accountAddress,data:{function:"0x1::account::rotate_authentication_key",functionArguments:[new y(n.signingScheme),r.U8(n.publicKey.toUint8Array()),new y(i.signingScheme),r.U8(i.publicKey.toUint8Array()),r.U8(m.toUint8Array()),r.U8(S.toUint8Array())],abi:M}});return K({aptosConfig:a,signer:n,transaction:R})}export{b as a,h as b,x as c,Q as d,U as e,X as f,_ as g,K as h,Y as i,$ as j};
2
+ //# sourceMappingURL=chunk-K7HX7JQH.mjs.map