@aptos-labs/ts-sdk 1.33.1 → 1.33.2

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 (690) hide show
  1. package/README.md +4 -6
  2. package/dist/common/{accountAddress-BHsGaOsa.d.ts → accountAddress-Cf1amU98.d.ts} +279 -0
  3. package/dist/common/{chunk-F43XVDYJ.js → chunk-IHUCZKG2.js} +1 -1
  4. package/dist/common/chunk-IHUCZKG2.js.map +1 -0
  5. package/dist/common/cli/index.d.ts +47 -9
  6. package/dist/common/cli/index.js +1 -1
  7. package/dist/common/cli/index.js.map +1 -1
  8. package/dist/common/index.d.ts +1941 -225
  9. package/dist/common/index.js +33 -33
  10. package/dist/common/index.js.map +1 -1
  11. package/dist/esm/{Ed25519Account-B3xHXAQe.d.mts → Ed25519Account-D4j3_WIS.d.mts} +122 -12
  12. package/dist/esm/account/AbstractKeylessAccount.d.mts +81 -7
  13. package/dist/esm/account/AbstractKeylessAccount.mjs +1 -1
  14. package/dist/esm/account/Account.d.mts +5 -4
  15. package/dist/esm/account/Account.mjs +1 -1
  16. package/dist/esm/account/AccountUtils.d.mts +64 -0
  17. package/dist/esm/account/AccountUtils.mjs +2 -0
  18. package/dist/esm/account/Ed25519Account.d.mts +3 -2
  19. package/dist/esm/account/Ed25519Account.mjs +1 -1
  20. package/dist/esm/account/EphemeralKeyPair.d.mts +29 -1
  21. package/dist/esm/account/EphemeralKeyPair.mjs +1 -1
  22. package/dist/esm/account/FederatedKeylessAccount.d.mts +25 -5
  23. package/dist/esm/account/FederatedKeylessAccount.mjs +1 -1
  24. package/dist/esm/account/KeylessAccount.d.mts +30 -5
  25. package/dist/esm/account/KeylessAccount.mjs +1 -1
  26. package/dist/esm/account/MultiKeyAccount.d.mts +40 -5
  27. package/dist/esm/account/MultiKeyAccount.mjs +1 -1
  28. package/dist/esm/account/SingleKeyAccount.d.mts +4 -3
  29. package/dist/esm/account/SingleKeyAccount.mjs +1 -1
  30. package/dist/esm/account/index.d.mts +4 -2
  31. package/dist/esm/account/index.mjs +1 -1
  32. package/dist/esm/account/utils.d.mts +18 -0
  33. package/dist/esm/account/utils.mjs +2 -0
  34. package/dist/esm/account/utils.mjs.map +1 -0
  35. package/dist/esm/api/account.d.mts +25 -4
  36. package/dist/esm/api/account.mjs +1 -1
  37. package/dist/esm/api/ans.d.mts +18 -2
  38. package/dist/esm/api/ans.mjs +1 -1
  39. package/dist/esm/api/aptos.d.mts +5 -2
  40. package/dist/esm/api/aptos.mjs +1 -1
  41. package/dist/esm/api/aptosConfig.d.mts +16 -0
  42. package/dist/esm/api/aptosConfig.mjs +1 -1
  43. package/dist/esm/api/coin.d.mts +5 -1
  44. package/dist/esm/api/coin.mjs +1 -1
  45. package/dist/esm/api/digitalAsset.d.mts +29 -2
  46. package/dist/esm/api/digitalAsset.mjs +1 -1
  47. package/dist/esm/api/event.d.mts +6 -0
  48. package/dist/esm/api/event.mjs +1 -1
  49. package/dist/esm/api/faucet.d.mts +11 -2
  50. package/dist/esm/api/faucet.mjs +1 -1
  51. package/dist/esm/api/fungibleAsset.d.mts +11 -2
  52. package/dist/esm/api/fungibleAsset.mjs +1 -1
  53. package/dist/esm/api/general.d.mts +14 -1
  54. package/dist/esm/api/general.mjs +1 -1
  55. package/dist/esm/api/index.d.mts +3 -2
  56. package/dist/esm/api/index.mjs +1 -1
  57. package/dist/esm/api/keyless.d.mts +8 -2
  58. package/dist/esm/api/keyless.mjs +1 -1
  59. package/dist/esm/api/object.d.mts +3 -0
  60. package/dist/esm/api/object.mjs +1 -1
  61. package/dist/esm/api/staking.d.mts +5 -0
  62. package/dist/esm/api/staking.mjs +1 -1
  63. package/dist/esm/api/table.d.mts +5 -0
  64. package/dist/esm/api/table.mjs +1 -1
  65. package/dist/esm/api/transaction.d.mts +23 -6
  66. package/dist/esm/api/transaction.mjs +1 -1
  67. package/dist/esm/api/transactionSubmission/build.d.mts +6 -1
  68. package/dist/esm/api/transactionSubmission/build.mjs +1 -1
  69. package/dist/esm/api/transactionSubmission/helpers.d.mts +2 -0
  70. package/dist/esm/api/transactionSubmission/helpers.mjs +1 -1
  71. package/dist/esm/api/transactionSubmission/management.d.mts +8 -2
  72. package/dist/esm/api/transactionSubmission/management.mjs +1 -1
  73. package/dist/esm/api/transactionSubmission/sign.d.mts +7 -2
  74. package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
  75. package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -1
  76. package/dist/esm/api/transactionSubmission/simulate.d.mts +6 -1
  77. package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
  78. package/dist/esm/api/transactionSubmission/submit.d.mts +6 -1
  79. package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
  80. package/dist/esm/api/utils.d.mts +1 -0
  81. package/dist/esm/api/utils.mjs +1 -1
  82. package/dist/esm/bcs/deserializer.d.mts +42 -1
  83. package/dist/esm/bcs/deserializer.mjs +1 -1
  84. package/dist/esm/bcs/index.mjs +1 -1
  85. package/dist/esm/bcs/serializable/entryFunctionBytes.d.mts +10 -0
  86. package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -1
  87. package/dist/esm/bcs/serializable/fixedBytes.d.mts +12 -0
  88. package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -1
  89. package/dist/esm/bcs/serializable/movePrimitives.d.mts +24 -0
  90. package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
  91. package/dist/esm/bcs/serializable/moveStructs.d.mts +56 -0
  92. package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
  93. package/dist/esm/bcs/serializer.d.mts +60 -0
  94. package/dist/esm/bcs/serializer.mjs +1 -1
  95. package/dist/esm/{chunk-PMGK5IHB.mjs → chunk-2FBJWTJD.mjs} +2 -2
  96. package/dist/esm/chunk-2FBJWTJD.mjs.map +1 -0
  97. package/dist/esm/{chunk-L4SWQLAJ.mjs → chunk-2N5KYALM.mjs} +2 -2
  98. package/dist/esm/chunk-2N5KYALM.mjs.map +1 -0
  99. package/dist/esm/{chunk-7V35JAAF.mjs → chunk-2TJ6OTVD.mjs} +2 -2
  100. package/dist/esm/chunk-2TJ6OTVD.mjs.map +1 -0
  101. package/dist/esm/{chunk-GVNK3UMT.mjs → chunk-2UXW3EB7.mjs} +2 -2
  102. package/dist/esm/chunk-2UXW3EB7.mjs.map +1 -0
  103. package/dist/esm/{chunk-UJSTWN32.mjs → chunk-2WCATZVL.mjs} +2 -2
  104. package/dist/esm/{chunk-UJSTWN32.mjs.map → chunk-2WCATZVL.mjs.map} +1 -1
  105. package/dist/esm/{chunk-FZDEGDUY.mjs → chunk-35DKMW7Q.mjs} +1 -1
  106. package/dist/esm/chunk-35DKMW7Q.mjs.map +1 -0
  107. package/dist/esm/{chunk-WFK3XRQX.mjs → chunk-3RCAJICY.mjs} +2 -2
  108. package/dist/esm/chunk-3RCAJICY.mjs.map +1 -0
  109. package/dist/esm/{chunk-KCWRCWNT.mjs → chunk-43GCGE6C.mjs} +2 -2
  110. package/dist/esm/chunk-43GCGE6C.mjs.map +1 -0
  111. package/dist/esm/{chunk-4DP3PEYK.mjs → chunk-4EUS4E6S.mjs} +2 -2
  112. package/dist/esm/chunk-4EUS4E6S.mjs.map +1 -0
  113. package/dist/esm/chunk-4RXKALLC.mjs +2 -0
  114. package/dist/esm/chunk-4RXKALLC.mjs.map +1 -0
  115. package/dist/esm/chunk-4YLUM62M.mjs +2 -0
  116. package/dist/esm/chunk-4YLUM62M.mjs.map +1 -0
  117. package/dist/esm/{chunk-SNYYEVJA.mjs → chunk-4ZYPDCSP.mjs} +2 -2
  118. package/dist/esm/chunk-4ZYPDCSP.mjs.map +1 -0
  119. package/dist/esm/{chunk-F2WY2DEY.mjs → chunk-5EBUWO2M.mjs} +2 -2
  120. package/dist/esm/chunk-5EBUWO2M.mjs.map +1 -0
  121. package/dist/esm/{chunk-5LGKGWLX.mjs → chunk-5EYTHMRZ.mjs} +2 -2
  122. package/dist/esm/chunk-5EYTHMRZ.mjs.map +1 -0
  123. package/dist/esm/{chunk-DBTKJMLV.mjs → chunk-5PXDPMF2.mjs} +2 -2
  124. package/dist/esm/chunk-5PXDPMF2.mjs.map +1 -0
  125. package/dist/esm/chunk-5VMAJTTV.mjs +2 -0
  126. package/dist/esm/chunk-5VMAJTTV.mjs.map +1 -0
  127. package/dist/esm/{chunk-YEWZAR76.mjs → chunk-5YWH3XPN.mjs} +2 -2
  128. package/dist/esm/chunk-5YWH3XPN.mjs.map +1 -0
  129. package/dist/esm/{chunk-QI7OREBM.mjs → chunk-67ZVDKJF.mjs} +2 -2
  130. package/dist/esm/chunk-67ZVDKJF.mjs.map +1 -0
  131. package/dist/esm/{chunk-U6OCK6T4.mjs → chunk-6CXMDJQR.mjs} +2 -2
  132. package/dist/esm/chunk-6CXMDJQR.mjs.map +1 -0
  133. package/dist/esm/chunk-6IEZPA4H.mjs +2 -0
  134. package/dist/esm/chunk-6IEZPA4H.mjs.map +1 -0
  135. package/dist/esm/{chunk-N62NUAHT.mjs → chunk-6YHDZLRN.mjs} +2 -2
  136. package/dist/esm/chunk-6YHDZLRN.mjs.map +1 -0
  137. package/dist/esm/chunk-6YWYAVFS.mjs +2 -0
  138. package/dist/esm/chunk-6YWYAVFS.mjs.map +1 -0
  139. package/dist/esm/chunk-77AEKF7K.mjs +2 -0
  140. package/dist/esm/{chunk-YD2BMHH7.mjs.map → chunk-77AEKF7K.mjs.map} +1 -1
  141. package/dist/esm/{chunk-XOLU6UP3.mjs → chunk-7IY3DTEF.mjs} +2 -2
  142. package/dist/esm/chunk-7IY3DTEF.mjs.map +1 -0
  143. package/dist/esm/{chunk-2CJC43CV.mjs → chunk-A5L76YP7.mjs} +1 -1
  144. package/dist/esm/chunk-A5L76YP7.mjs.map +1 -0
  145. package/dist/esm/{chunk-ICMELYCL.mjs → chunk-AFEHO5PP.mjs} +2 -2
  146. package/dist/esm/chunk-AFEHO5PP.mjs.map +1 -0
  147. package/dist/esm/{chunk-NK67FECB.mjs → chunk-AXYARCYT.mjs} +2 -2
  148. package/dist/esm/chunk-AXYARCYT.mjs.map +1 -0
  149. package/dist/esm/{chunk-AOROYJ74.mjs → chunk-AZWVCBK2.mjs} +2 -2
  150. package/dist/esm/chunk-AZWVCBK2.mjs.map +1 -0
  151. package/dist/esm/{chunk-U3T4ZT7B.mjs → chunk-BGSEBFFC.mjs} +2 -2
  152. package/dist/esm/chunk-BGSEBFFC.mjs.map +1 -0
  153. package/dist/esm/{chunk-6ZOVTYLJ.mjs → chunk-BI3BTSUB.mjs} +2 -2
  154. package/dist/esm/chunk-BI3BTSUB.mjs.map +1 -0
  155. package/dist/esm/{chunk-OIOGOW6I.mjs → chunk-C3Q23D22.mjs} +1 -1
  156. package/dist/esm/chunk-C3Q23D22.mjs.map +1 -0
  157. package/dist/esm/{chunk-VQZMI3EZ.mjs → chunk-CWKNJZB6.mjs} +2 -2
  158. package/dist/esm/chunk-CWKNJZB6.mjs.map +1 -0
  159. package/dist/esm/{chunk-V4FKFCBL.mjs → chunk-DAFSKSZ5.mjs} +1 -1
  160. package/dist/esm/chunk-DAFSKSZ5.mjs.map +1 -0
  161. package/dist/esm/{chunk-IBZKCBN5.mjs → chunk-DOQV5BSA.mjs} +2 -2
  162. package/dist/esm/chunk-DOQV5BSA.mjs.map +1 -0
  163. package/dist/esm/chunk-DPW6ELCQ.mjs +2 -0
  164. package/dist/esm/chunk-DPW6ELCQ.mjs.map +1 -0
  165. package/dist/esm/{chunk-IK2NYNKG.mjs → chunk-DYATTONT.mjs} +2 -2
  166. package/dist/esm/chunk-DYATTONT.mjs.map +1 -0
  167. package/dist/esm/{chunk-ALNQK276.mjs → chunk-E5HGSOG2.mjs} +2 -2
  168. package/dist/esm/chunk-E5HGSOG2.mjs.map +1 -0
  169. package/dist/esm/{chunk-2MN7DW2J.mjs → chunk-E7JDVKFY.mjs} +2 -2
  170. package/dist/esm/chunk-E7JDVKFY.mjs.map +1 -0
  171. package/dist/esm/{chunk-AJ5JHBAE.mjs → chunk-EBMEXURY.mjs} +2 -2
  172. package/dist/esm/chunk-EBMEXURY.mjs.map +1 -0
  173. package/dist/esm/chunk-EMURYYVO.mjs +2 -0
  174. package/dist/esm/chunk-EMURYYVO.mjs.map +1 -0
  175. package/dist/esm/chunk-F2ZTBAJJ.mjs +2 -0
  176. package/dist/esm/chunk-F2ZTBAJJ.mjs.map +1 -0
  177. package/dist/esm/{chunk-UGIHQFID.mjs → chunk-FIEMUPXF.mjs} +2 -2
  178. package/dist/esm/chunk-FIEMUPXF.mjs.map +1 -0
  179. package/dist/esm/{chunk-AKIO3OIT.mjs → chunk-FN4C3CKC.mjs} +2 -2
  180. package/dist/esm/chunk-FN4C3CKC.mjs.map +1 -0
  181. package/dist/esm/{chunk-H3C3VTHS.mjs → chunk-FZD5RWSZ.mjs} +2 -2
  182. package/dist/esm/chunk-FZD5RWSZ.mjs.map +1 -0
  183. package/dist/esm/{chunk-T6ADNZE5.mjs → chunk-G4O6FXCF.mjs} +2 -2
  184. package/dist/esm/chunk-G4O6FXCF.mjs.map +1 -0
  185. package/dist/esm/{chunk-GMKKHGXK.mjs → chunk-GOXRBEIJ.mjs} +1 -1
  186. package/dist/esm/chunk-GOXRBEIJ.mjs.map +1 -0
  187. package/dist/esm/chunk-GP4TLDVZ.mjs +1 -0
  188. package/dist/esm/chunk-GP4TLDVZ.mjs.map +1 -0
  189. package/dist/esm/{chunk-BAEIZAP7.mjs → chunk-HBH2NQKU.mjs} +2 -2
  190. package/dist/esm/chunk-HBH2NQKU.mjs.map +1 -0
  191. package/dist/esm/{chunk-ZMMLM6ZJ.mjs → chunk-IDTLNF4M.mjs} +2 -2
  192. package/dist/esm/chunk-IDTLNF4M.mjs.map +1 -0
  193. package/dist/esm/{chunk-PXMNAP2Q.mjs → chunk-IEUEMBFD.mjs} +2 -2
  194. package/dist/esm/chunk-IEUEMBFD.mjs.map +1 -0
  195. package/dist/esm/{chunk-6Q2O5G3J.mjs → chunk-IF4UU2MT.mjs} +1 -1
  196. package/dist/esm/chunk-IF4UU2MT.mjs.map +1 -0
  197. package/dist/esm/{chunk-LPVGVTWT.mjs → chunk-JBEUUULP.mjs} +2 -2
  198. package/dist/esm/chunk-JBEUUULP.mjs.map +1 -0
  199. package/dist/esm/chunk-JJM6ELMS.mjs +2 -0
  200. package/dist/esm/chunk-JJM6ELMS.mjs.map +1 -0
  201. package/dist/esm/{chunk-2ESU5N3V.mjs → chunk-KOORZTHC.mjs} +2 -2
  202. package/dist/esm/chunk-KOORZTHC.mjs.map +1 -0
  203. package/dist/esm/{chunk-2QGJDHME.mjs → chunk-KVM2SGSF.mjs} +2 -2
  204. package/dist/esm/chunk-KVM2SGSF.mjs.map +1 -0
  205. package/dist/esm/{chunk-5PVZ4N42.mjs → chunk-M77M6NSB.mjs} +2 -2
  206. package/dist/esm/chunk-M77M6NSB.mjs.map +1 -0
  207. package/dist/esm/{chunk-G4KAHJXB.mjs → chunk-MCLYDS3O.mjs} +2 -2
  208. package/dist/esm/chunk-MCLYDS3O.mjs.map +1 -0
  209. package/dist/esm/{chunk-46O23AOD.mjs → chunk-MLSAZJZK.mjs} +2 -2
  210. package/dist/esm/chunk-MLSAZJZK.mjs.map +1 -0
  211. package/dist/esm/{chunk-BRV3RLKW.mjs → chunk-MT2RJ7H3.mjs} +2 -2
  212. package/dist/esm/chunk-MT2RJ7H3.mjs.map +1 -0
  213. package/dist/esm/chunk-MWBRD43V.mjs +2 -0
  214. package/dist/esm/chunk-MWBRD43V.mjs.map +1 -0
  215. package/dist/esm/{chunk-ACVIE7IE.mjs → chunk-N4DM5FYH.mjs} +2 -2
  216. package/dist/esm/chunk-N4DM5FYH.mjs.map +1 -0
  217. package/dist/esm/{chunk-LGTOOAQI.mjs → chunk-N6YTF76Q.mjs} +2 -2
  218. package/dist/esm/chunk-N6YTF76Q.mjs.map +1 -0
  219. package/dist/esm/{chunk-7N7FEBZA.mjs → chunk-NBNZ53ZV.mjs} +2 -2
  220. package/dist/esm/chunk-NBNZ53ZV.mjs.map +1 -0
  221. package/dist/esm/{chunk-CX6KECGV.mjs → chunk-NWLJ6RW7.mjs} +2 -2
  222. package/dist/esm/chunk-NWLJ6RW7.mjs.map +1 -0
  223. package/dist/esm/{chunk-VIZHWYI5.mjs → chunk-NYETBDSR.mjs} +2 -2
  224. package/dist/esm/chunk-NYETBDSR.mjs.map +1 -0
  225. package/dist/esm/{chunk-SK3LIS4Z.mjs → chunk-OEQ2U7GK.mjs} +2 -2
  226. package/dist/esm/chunk-OEQ2U7GK.mjs.map +1 -0
  227. package/dist/esm/{chunk-2C27NY4D.mjs → chunk-OHZURQPY.mjs} +2 -2
  228. package/dist/esm/chunk-OHZURQPY.mjs.map +1 -0
  229. package/dist/esm/{chunk-333QBK32.mjs → chunk-ONTWK5FU.mjs} +2 -2
  230. package/dist/esm/chunk-ONTWK5FU.mjs.map +1 -0
  231. package/dist/esm/chunk-OR6GFWLG.mjs +2 -0
  232. package/dist/esm/chunk-OR6GFWLG.mjs.map +1 -0
  233. package/dist/esm/{chunk-42H7WETG.mjs → chunk-ORMOQWWH.mjs} +2 -2
  234. package/dist/esm/chunk-ORMOQWWH.mjs.map +1 -0
  235. package/dist/esm/{chunk-S5SQJRAV.mjs → chunk-OROPNHRY.mjs} +2 -2
  236. package/dist/esm/chunk-OROPNHRY.mjs.map +1 -0
  237. package/dist/esm/{chunk-VWGB5BHW.mjs → chunk-OSBRPVVI.mjs} +2 -2
  238. package/dist/esm/chunk-OSBRPVVI.mjs.map +1 -0
  239. package/dist/esm/{chunk-NZ7M6NG2.mjs → chunk-P7A5RILV.mjs} +2 -2
  240. package/dist/esm/{chunk-JNO7KPMG.mjs → chunk-Q4C4U6I4.mjs} +2 -2
  241. package/dist/esm/chunk-Q4C4U6I4.mjs.map +1 -0
  242. package/dist/esm/{chunk-HMMNQFVM.mjs → chunk-QHC5DKVZ.mjs} +2 -2
  243. package/dist/esm/chunk-QHC5DKVZ.mjs.map +1 -0
  244. package/dist/esm/{chunk-F45G3GP3.mjs → chunk-QHEKBHNU.mjs} +2 -2
  245. package/dist/esm/chunk-QQEK7WVP.mjs +2 -0
  246. package/dist/esm/chunk-QQEK7WVP.mjs.map +1 -0
  247. package/dist/esm/{chunk-J7PJSK3J.mjs → chunk-RJ7F4JDV.mjs} +1 -1
  248. package/dist/esm/chunk-RJ7F4JDV.mjs.map +1 -0
  249. package/dist/esm/{chunk-BUAHUVAD.mjs → chunk-ROT6S6BM.mjs} +2 -2
  250. package/dist/esm/chunk-ROT6S6BM.mjs.map +1 -0
  251. package/dist/esm/{chunk-LKKI2KAP.mjs → chunk-S4LZMY2L.mjs} +2 -2
  252. package/dist/esm/chunk-S4LZMY2L.mjs.map +1 -0
  253. package/dist/esm/{chunk-33CVOPIN.mjs → chunk-S7RZGC56.mjs} +2 -2
  254. package/dist/esm/{chunk-33CVOPIN.mjs.map → chunk-S7RZGC56.mjs.map} +1 -1
  255. package/dist/esm/{chunk-SPRNSFUV.mjs → chunk-STY74NUA.mjs} +2 -2
  256. package/dist/esm/chunk-STY74NUA.mjs.map +1 -0
  257. package/dist/esm/{chunk-ZMBXHMVQ.mjs → chunk-TOBQ5UE6.mjs} +2 -2
  258. package/dist/esm/chunk-TOBQ5UE6.mjs.map +1 -0
  259. package/dist/esm/{chunk-7T26VA2W.mjs → chunk-UC23V7PU.mjs} +2 -2
  260. package/dist/esm/chunk-UC23V7PU.mjs.map +1 -0
  261. package/dist/esm/{chunk-4MTSP4S2.mjs → chunk-V6VPMNWJ.mjs} +2 -2
  262. package/dist/esm/chunk-V6VPMNWJ.mjs.map +1 -0
  263. package/dist/esm/{chunk-JMPHD4BP.mjs → chunk-VUIHJIMX.mjs} +2 -2
  264. package/dist/esm/chunk-VUIHJIMX.mjs.map +1 -0
  265. package/dist/esm/{chunk-2KSMV5KD.mjs → chunk-VV4HCOJQ.mjs} +2 -2
  266. package/dist/esm/chunk-VV4HCOJQ.mjs.map +1 -0
  267. package/dist/esm/{chunk-XZN344G4.mjs → chunk-VVXBVJXD.mjs} +2 -2
  268. package/dist/esm/chunk-VVXBVJXD.mjs.map +1 -0
  269. package/dist/esm/{chunk-IHGA5KAD.mjs → chunk-W4BSN6SK.mjs} +1 -1
  270. package/dist/esm/chunk-W4BSN6SK.mjs.map +1 -0
  271. package/dist/esm/chunk-WCMW2L3P.mjs +2 -0
  272. package/dist/esm/chunk-WCMW2L3P.mjs.map +1 -0
  273. package/dist/esm/{chunk-UFPYCROT.mjs → chunk-WQRGDSPD.mjs} +2 -2
  274. package/dist/esm/chunk-WQRGDSPD.mjs.map +1 -0
  275. package/dist/esm/chunk-WUWPN7XV.mjs +2 -0
  276. package/dist/esm/chunk-WUWPN7XV.mjs.map +1 -0
  277. package/dist/esm/{chunk-LA5HJILW.mjs → chunk-X6UNY6YM.mjs} +2 -2
  278. package/dist/esm/chunk-X6UNY6YM.mjs.map +1 -0
  279. package/dist/esm/chunk-XJJVJOX5.mjs +2 -0
  280. package/dist/esm/{chunk-UGTIALNW.mjs.map → chunk-XJJVJOX5.mjs.map} +1 -1
  281. package/dist/esm/{chunk-OPO5EYF7.mjs → chunk-XKUIMGKU.mjs} +2 -2
  282. package/dist/esm/chunk-XKUIMGKU.mjs.map +1 -0
  283. package/dist/esm/chunk-XTJOA5QN.mjs +2 -0
  284. package/dist/esm/chunk-XTJOA5QN.mjs.map +1 -0
  285. package/dist/esm/chunk-XTOIL6MB.mjs +2 -0
  286. package/dist/esm/chunk-XTOIL6MB.mjs.map +1 -0
  287. package/dist/esm/{chunk-ZMS3AOEZ.mjs → chunk-XY43TPRH.mjs} +2 -2
  288. package/dist/esm/chunk-XY43TPRH.mjs.map +1 -0
  289. package/dist/esm/{chunk-EGV3HFE3.mjs → chunk-XYB6KYKW.mjs} +2 -2
  290. package/dist/esm/chunk-XYB6KYKW.mjs.map +1 -0
  291. package/dist/esm/{chunk-RCA73RVB.mjs → chunk-XZ4JRYCE.mjs} +2 -2
  292. package/dist/esm/chunk-XZ4JRYCE.mjs.map +1 -0
  293. package/dist/esm/{chunk-4XB3BB5Z.mjs → chunk-YCQUYDZI.mjs} +2 -2
  294. package/dist/esm/chunk-YCQUYDZI.mjs.map +1 -0
  295. package/dist/esm/{chunk-HBIDHQ2M.mjs → chunk-YOZBVVKL.mjs} +1 -1
  296. package/dist/esm/chunk-YOZBVVKL.mjs.map +1 -0
  297. package/dist/esm/chunk-ZAIVZDOL.mjs +2 -0
  298. package/dist/esm/chunk-ZAIVZDOL.mjs.map +1 -0
  299. package/dist/esm/{chunk-ZXVN3HXB.mjs → chunk-ZGVNZE7J.mjs} +2 -2
  300. package/dist/esm/chunk-ZGVNZE7J.mjs.map +1 -0
  301. package/dist/esm/{chunk-YJVZFYBX.mjs → chunk-ZPV7HPA4.mjs} +2 -2
  302. package/dist/esm/chunk-ZPV7HPA4.mjs.map +1 -0
  303. package/dist/esm/cli/index.mjs +1 -1
  304. package/dist/esm/cli/localNode.d.mts +20 -8
  305. package/dist/esm/cli/localNode.mjs +1 -1
  306. package/dist/esm/cli/move.d.mts +26 -0
  307. package/dist/esm/cli/move.mjs +1 -1
  308. package/dist/esm/client/core.d.mts +4 -0
  309. package/dist/esm/client/core.mjs +1 -1
  310. package/dist/esm/client/get.d.mts +33 -1
  311. package/dist/esm/client/get.mjs +1 -1
  312. package/dist/esm/client/index.d.mts +1 -1
  313. package/dist/esm/client/index.mjs +1 -1
  314. package/dist/esm/client/post.d.mts +37 -0
  315. package/dist/esm/client/post.mjs +1 -1
  316. package/dist/esm/core/account/index.mjs +1 -1
  317. package/dist/esm/core/account/utils/address.d.mts +6 -0
  318. package/dist/esm/core/account/utils/address.mjs +1 -1
  319. package/dist/esm/core/account/utils/index.mjs +1 -1
  320. package/dist/esm/core/accountAddress.d.mts +46 -0
  321. package/dist/esm/core/accountAddress.mjs +1 -1
  322. package/dist/esm/core/authenticationKey.d.mts +1 -1
  323. package/dist/esm/core/authenticationKey.mjs +1 -1
  324. package/dist/esm/core/common.d.mts +14 -0
  325. package/dist/esm/core/common.mjs +1 -1
  326. package/dist/esm/core/crypto/ed25519.d.mts +57 -5
  327. package/dist/esm/core/crypto/ed25519.mjs +1 -1
  328. package/dist/esm/core/crypto/ephemeral.d.mts +23 -1
  329. package/dist/esm/core/crypto/ephemeral.mjs +1 -1
  330. package/dist/esm/core/crypto/federatedKeyless.d.mts +13 -1
  331. package/dist/esm/core/crypto/federatedKeyless.mjs +1 -1
  332. package/dist/esm/core/crypto/hdKey.d.mts +28 -0
  333. package/dist/esm/core/crypto/hdKey.mjs +1 -1
  334. package/dist/esm/core/crypto/index.d.mts +2 -2
  335. package/dist/esm/core/crypto/index.mjs +1 -1
  336. package/dist/esm/core/crypto/keyless.d.mts +131 -1
  337. package/dist/esm/core/crypto/keyless.mjs +1 -1
  338. package/dist/esm/core/crypto/multiEd25519.d.mts +41 -1
  339. package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
  340. package/dist/esm/core/crypto/multiKey.d.mts +38 -1
  341. package/dist/esm/core/crypto/multiKey.mjs +1 -1
  342. package/dist/esm/core/crypto/poseidon.d.mts +10 -0
  343. package/dist/esm/core/crypto/poseidon.mjs +1 -1
  344. package/dist/esm/core/crypto/privateKey.d.mts +9 -1
  345. package/dist/esm/core/crypto/privateKey.mjs +1 -1
  346. package/dist/esm/core/crypto/proof.d.mts +2 -0
  347. package/dist/esm/core/crypto/proof.mjs +1 -1
  348. package/dist/esm/core/crypto/publicKey.d.mts +1 -1
  349. package/dist/esm/core/crypto/publicKey.mjs +1 -1
  350. package/dist/esm/core/crypto/secp256k1.d.mts +50 -3
  351. package/dist/esm/core/crypto/secp256k1.mjs +1 -1
  352. package/dist/esm/core/crypto/signature.d.mts +6 -0
  353. package/dist/esm/core/crypto/signature.mjs +1 -1
  354. package/dist/esm/core/crypto/singleKey.d.mts +36 -2
  355. package/dist/esm/core/crypto/singleKey.mjs +1 -1
  356. package/dist/esm/core/crypto/utils.d.mts +2 -0
  357. package/dist/esm/core/crypto/utils.mjs +1 -1
  358. package/dist/esm/core/hex.d.mts +20 -0
  359. package/dist/esm/core/hex.mjs +1 -1
  360. package/dist/esm/core/index.d.mts +2 -2
  361. package/dist/esm/core/index.mjs +1 -1
  362. package/dist/esm/errors/index.mjs +1 -1
  363. package/dist/esm/index.d.mts +5 -4
  364. package/dist/esm/index.mjs +1 -1
  365. package/dist/esm/internal/account.d.mts +24 -4
  366. package/dist/esm/internal/account.mjs +1 -1
  367. package/dist/esm/internal/ans.d.mts +27 -2
  368. package/dist/esm/internal/ans.mjs +1 -1
  369. package/dist/esm/internal/coin.d.mts +3 -1
  370. package/dist/esm/internal/coin.mjs +1 -1
  371. package/dist/esm/internal/digitalAsset.d.mts +31 -2
  372. package/dist/esm/internal/digitalAsset.mjs +1 -1
  373. package/dist/esm/internal/event.d.mts +5 -0
  374. package/dist/esm/internal/event.mjs +1 -1
  375. package/dist/esm/internal/faucet.d.mts +5 -0
  376. package/dist/esm/internal/faucet.mjs +1 -1
  377. package/dist/esm/internal/fungibleAsset.d.mts +8 -2
  378. package/dist/esm/internal/fungibleAsset.mjs +1 -1
  379. package/dist/esm/internal/general.d.mts +7 -0
  380. package/dist/esm/internal/general.mjs +1 -1
  381. package/dist/esm/internal/keyless.d.mts +6 -2
  382. package/dist/esm/internal/keyless.mjs +1 -1
  383. package/dist/esm/internal/object.d.mts +2 -0
  384. package/dist/esm/internal/object.mjs +1 -1
  385. package/dist/esm/internal/staking.d.mts +5 -1
  386. package/dist/esm/internal/staking.mjs +1 -1
  387. package/dist/esm/internal/table.d.mts +3 -0
  388. package/dist/esm/internal/table.mjs +1 -1
  389. package/dist/esm/internal/transaction.d.mts +14 -0
  390. package/dist/esm/internal/transaction.mjs +1 -1
  391. package/dist/esm/internal/transactionSubmission.d.mts +16 -5
  392. package/dist/esm/internal/transactionSubmission.mjs +1 -1
  393. package/dist/esm/internal/view.d.mts +2 -1
  394. package/dist/esm/internal/view.mjs +1 -1
  395. package/dist/esm/{publicKey-BVXX1nVl.d.mts → publicKey-BMtGNNLg.d.mts} +36 -0
  396. package/dist/esm/transactions/authenticator/account.d.mts +28 -1
  397. package/dist/esm/transactions/authenticator/account.mjs +1 -1
  398. package/dist/esm/transactions/authenticator/index.d.mts +2 -1
  399. package/dist/esm/transactions/authenticator/index.mjs +1 -1
  400. package/dist/esm/transactions/authenticator/transaction.d.mts +23 -2
  401. package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
  402. package/dist/esm/transactions/index.d.mts +2 -1
  403. package/dist/esm/transactions/index.mjs +1 -1
  404. package/dist/esm/transactions/instances/chainId.d.mts +8 -0
  405. package/dist/esm/transactions/instances/chainId.mjs +1 -1
  406. package/dist/esm/transactions/instances/identifier.d.mts +8 -0
  407. package/dist/esm/transactions/instances/identifier.mjs +1 -1
  408. package/dist/esm/transactions/instances/index.d.mts +2 -1
  409. package/dist/esm/transactions/instances/index.mjs +1 -1
  410. package/dist/esm/transactions/instances/moduleId.d.mts +10 -0
  411. package/dist/esm/transactions/instances/moduleId.mjs +1 -1
  412. package/dist/esm/transactions/instances/multiAgentTransaction.d.mts +8 -0
  413. package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
  414. package/dist/esm/transactions/instances/rawTransaction.d.mts +30 -0
  415. package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
  416. package/dist/esm/transactions/instances/rotationProofChallenge.d.mts +7 -1
  417. package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
  418. package/dist/esm/transactions/instances/signedTransaction.d.mts +10 -1
  419. package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
  420. package/dist/esm/transactions/instances/simpleTransaction.d.mts +8 -0
  421. package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
  422. package/dist/esm/transactions/instances/transactionArgument.d.mts +16 -0
  423. package/dist/esm/transactions/instances/transactionPayload.d.mts +48 -0
  424. package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
  425. package/dist/esm/transactions/management/accountSequenceNumber.d.mts +19 -2
  426. package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
  427. package/dist/esm/transactions/management/asyncQueue.d.mts +16 -0
  428. package/dist/esm/transactions/management/asyncQueue.mjs +1 -1
  429. package/dist/esm/transactions/management/index.d.mts +3 -2
  430. package/dist/esm/transactions/management/index.mjs +1 -1
  431. package/dist/esm/transactions/management/transactionWorker.d.mts +45 -7
  432. package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
  433. package/dist/esm/transactions/transactionBuilder/helpers.d.mts +64 -1
  434. package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
  435. package/dist/esm/transactions/transactionBuilder/index.d.mts +2 -1
  436. package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
  437. package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +14 -1
  438. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
  439. package/dist/esm/transactions/transactionBuilder/signingMessage.d.mts +10 -1
  440. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
  441. package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +42 -1
  442. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
  443. package/dist/esm/transactions/typeTag/index.d.mts +82 -0
  444. package/dist/esm/transactions/typeTag/index.mjs +1 -1
  445. package/dist/esm/transactions/typeTag/parser.d.mts +8 -0
  446. package/dist/esm/transactions/typeTag/parser.mjs +1 -1
  447. package/dist/esm/transactions/types.d.mts +80 -1
  448. package/dist/esm/types/index.mjs +1 -1
  449. package/dist/esm/types/indexer.d.mts +52 -0
  450. package/dist/esm/types/keyless.d.mts +12 -0
  451. package/dist/esm/utils/apiEndpoints.d.mts +30 -0
  452. package/dist/esm/utils/apiEndpoints.mjs +1 -1
  453. package/dist/esm/utils/const.d.mts +24 -0
  454. package/dist/esm/utils/const.mjs +1 -1
  455. package/dist/esm/utils/helpers.d.mts +20 -0
  456. package/dist/esm/utils/helpers.mjs +1 -1
  457. package/dist/esm/utils/index.mjs +1 -1
  458. package/dist/esm/utils/memoize.d.mts +4 -0
  459. package/dist/esm/utils/memoize.mjs +1 -1
  460. package/dist/esm/utils/normalizeBundle.d.mts +8 -0
  461. package/dist/esm/utils/normalizeBundle.mjs +1 -1
  462. package/dist/esm/version.d.mts +1 -1
  463. package/dist/esm/version.mjs +1 -1
  464. package/package.json +19 -20
  465. package/src/account/AbstractKeylessAccount.ts +80 -9
  466. package/src/account/Account.ts +51 -6
  467. package/src/account/AccountUtils.ts +216 -0
  468. package/src/account/Ed25519Account.ts +26 -0
  469. package/src/account/EphemeralKeyPair.ts +30 -0
  470. package/src/account/FederatedKeylessAccount.ts +10 -3
  471. package/src/account/KeylessAccount.ts +13 -1
  472. package/src/account/MultiKeyAccount.ts +75 -12
  473. package/src/account/SingleKeyAccount.ts +63 -6
  474. package/src/account/index.ts +1 -0
  475. package/src/account/utils.ts +16 -0
  476. package/src/api/account.ts +22 -2
  477. package/src/api/ans.ts +15 -0
  478. package/src/api/aptos.ts +3 -0
  479. package/src/api/aptosConfig.ts +24 -0
  480. package/src/api/coin.ts +3 -0
  481. package/src/api/digitalAsset.ts +26 -0
  482. package/src/api/event.ts +6 -0
  483. package/src/api/faucet.ts +11 -2
  484. package/src/api/fungibleAsset.ts +8 -0
  485. package/src/api/general.ts +12 -0
  486. package/src/api/keyless.ts +6 -0
  487. package/src/api/object.ts +3 -0
  488. package/src/api/staking.ts +5 -0
  489. package/src/api/table.ts +5 -0
  490. package/src/api/transaction.ts +19 -3
  491. package/src/api/transactionSubmission/build.ts +4 -0
  492. package/src/api/transactionSubmission/helpers.ts +2 -0
  493. package/src/api/transactionSubmission/management.ts +5 -0
  494. package/src/api/transactionSubmission/sign.ts +4 -0
  495. package/src/api/transactionSubmission/simulate.ts +4 -0
  496. package/src/api/transactionSubmission/submit.ts +4 -0
  497. package/src/api/utils.ts +1 -0
  498. package/src/bcs/deserializer.ts +47 -1
  499. package/src/bcs/serializable/entryFunctionBytes.ts +10 -0
  500. package/src/bcs/serializable/fixedBytes.ts +12 -0
  501. package/src/bcs/serializable/movePrimitives.ts +26 -0
  502. package/src/bcs/serializable/moveStructs.ts +56 -0
  503. package/src/bcs/serializer.ts +64 -1
  504. package/src/cli/localNode.ts +22 -8
  505. package/src/cli/move.ts +26 -0
  506. package/src/client/core.ts +4 -0
  507. package/src/client/get.ts +75 -1
  508. package/src/client/post.ts +37 -0
  509. package/src/core/account/utils/address.ts +6 -0
  510. package/src/core/accountAddress.ts +46 -0
  511. package/src/core/authenticationKey.ts +22 -0
  512. package/src/core/common.ts +14 -0
  513. package/src/core/crypto/ed25519.ts +58 -4
  514. package/src/core/crypto/ephemeral.ts +22 -0
  515. package/src/core/crypto/federatedKeyless.ts +12 -0
  516. package/src/core/crypto/hdKey.ts +29 -0
  517. package/src/core/crypto/keyless.ts +134 -0
  518. package/src/core/crypto/multiEd25519.ts +40 -0
  519. package/src/core/crypto/multiKey.ts +37 -1
  520. package/src/core/crypto/poseidon.ts +20 -0
  521. package/src/core/crypto/privateKey.ts +8 -0
  522. package/src/core/crypto/proof.ts +2 -0
  523. package/src/core/crypto/publicKey.ts +14 -0
  524. package/src/core/crypto/secp256k1.ts +49 -2
  525. package/src/core/crypto/signature.ts +8 -0
  526. package/src/core/crypto/singleKey.ts +34 -2
  527. package/src/core/crypto/utils.ts +2 -0
  528. package/src/core/hex.ts +20 -0
  529. package/src/internal/account.ts +27 -7
  530. package/src/internal/ans.ts +27 -0
  531. package/src/internal/coin.ts +1 -0
  532. package/src/internal/digitalAsset.ts +30 -0
  533. package/src/internal/event.ts +6 -0
  534. package/src/internal/faucet.ts +5 -0
  535. package/src/internal/fungibleAsset.ts +5 -0
  536. package/src/internal/general.ts +7 -0
  537. package/src/internal/keyless.ts +4 -0
  538. package/src/internal/object.ts +2 -0
  539. package/src/internal/staking.ts +5 -1
  540. package/src/internal/table.ts +3 -0
  541. package/src/internal/transaction.ts +16 -0
  542. package/src/internal/transactionSubmission.ts +15 -2
  543. package/src/transactions/authenticator/account.ts +26 -0
  544. package/src/transactions/authenticator/transaction.ts +20 -0
  545. package/src/transactions/instances/chainId.ts +8 -0
  546. package/src/transactions/instances/identifier.ts +8 -0
  547. package/src/transactions/instances/moduleId.ts +10 -0
  548. package/src/transactions/instances/multiAgentTransaction.ts +8 -0
  549. package/src/transactions/instances/rawTransaction.ts +30 -0
  550. package/src/transactions/instances/rotationProofChallenge.ts +6 -0
  551. package/src/transactions/instances/signedTransaction.ts +8 -0
  552. package/src/transactions/instances/simpleTransaction.ts +8 -0
  553. package/src/transactions/instances/transactionArgument.ts +16 -0
  554. package/src/transactions/instances/transactionPayload.ts +50 -0
  555. package/src/transactions/management/accountSequenceNumber.ts +16 -0
  556. package/src/transactions/management/asyncQueue.ts +16 -0
  557. package/src/transactions/management/transactionWorker.ts +42 -5
  558. package/src/transactions/transactionBuilder/helpers.ts +82 -10
  559. package/src/transactions/transactionBuilder/remoteAbi.ts +20 -0
  560. package/src/transactions/transactionBuilder/signingMessage.ts +10 -0
  561. package/src/transactions/transactionBuilder/transactionBuilder.ts +58 -0
  562. package/src/transactions/typeTag/index.ts +82 -0
  563. package/src/transactions/typeTag/parser.ts +24 -0
  564. package/src/transactions/types.ts +78 -0
  565. package/src/types/indexer.ts +52 -0
  566. package/src/types/keyless.ts +12 -0
  567. package/src/utils/apiEndpoints.ts +30 -2
  568. package/src/utils/const.ts +24 -1
  569. package/src/utils/helpers.ts +22 -0
  570. package/src/utils/memoize.ts +6 -0
  571. package/src/utils/normalizeBundle.ts +8 -1
  572. package/src/version.ts +1 -1
  573. package/dist/common/chunk-F43XVDYJ.js.map +0 -1
  574. package/dist/esm/chunk-2C27NY4D.mjs.map +0 -1
  575. package/dist/esm/chunk-2CJC43CV.mjs.map +0 -1
  576. package/dist/esm/chunk-2ESU5N3V.mjs.map +0 -1
  577. package/dist/esm/chunk-2KSMV5KD.mjs.map +0 -1
  578. package/dist/esm/chunk-2MN7DW2J.mjs.map +0 -1
  579. package/dist/esm/chunk-2QGJDHME.mjs.map +0 -1
  580. package/dist/esm/chunk-333QBK32.mjs.map +0 -1
  581. package/dist/esm/chunk-372SLYVR.mjs +0 -2
  582. package/dist/esm/chunk-372SLYVR.mjs.map +0 -1
  583. package/dist/esm/chunk-42H7WETG.mjs.map +0 -1
  584. package/dist/esm/chunk-46O23AOD.mjs.map +0 -1
  585. package/dist/esm/chunk-4DI5SPSK.mjs +0 -2
  586. package/dist/esm/chunk-4DI5SPSK.mjs.map +0 -1
  587. package/dist/esm/chunk-4DP3PEYK.mjs.map +0 -1
  588. package/dist/esm/chunk-4MTSP4S2.mjs.map +0 -1
  589. package/dist/esm/chunk-4O5XDQDO.mjs +0 -2
  590. package/dist/esm/chunk-4O5XDQDO.mjs.map +0 -1
  591. package/dist/esm/chunk-4OV2A6PJ.mjs +0 -2
  592. package/dist/esm/chunk-4OV2A6PJ.mjs.map +0 -1
  593. package/dist/esm/chunk-4XB3BB5Z.mjs.map +0 -1
  594. package/dist/esm/chunk-5B3SMBXQ.mjs +0 -2
  595. package/dist/esm/chunk-5B3SMBXQ.mjs.map +0 -1
  596. package/dist/esm/chunk-5LGKGWLX.mjs.map +0 -1
  597. package/dist/esm/chunk-5PVZ4N42.mjs.map +0 -1
  598. package/dist/esm/chunk-6Q2O5G3J.mjs.map +0 -1
  599. package/dist/esm/chunk-6ZOVTYLJ.mjs.map +0 -1
  600. package/dist/esm/chunk-7N7FEBZA.mjs.map +0 -1
  601. package/dist/esm/chunk-7T26VA2W.mjs.map +0 -1
  602. package/dist/esm/chunk-7V35JAAF.mjs.map +0 -1
  603. package/dist/esm/chunk-ACVIE7IE.mjs.map +0 -1
  604. package/dist/esm/chunk-AJ5JHBAE.mjs.map +0 -1
  605. package/dist/esm/chunk-AKIO3OIT.mjs.map +0 -1
  606. package/dist/esm/chunk-ALNQK276.mjs.map +0 -1
  607. package/dist/esm/chunk-AOROYJ74.mjs.map +0 -1
  608. package/dist/esm/chunk-BAEIZAP7.mjs.map +0 -1
  609. package/dist/esm/chunk-BRV3RLKW.mjs.map +0 -1
  610. package/dist/esm/chunk-BUAHUVAD.mjs.map +0 -1
  611. package/dist/esm/chunk-C2HCRGQU.mjs +0 -2
  612. package/dist/esm/chunk-C2HCRGQU.mjs.map +0 -1
  613. package/dist/esm/chunk-CDEYH77E.mjs +0 -2
  614. package/dist/esm/chunk-CDEYH77E.mjs.map +0 -1
  615. package/dist/esm/chunk-CX6KECGV.mjs.map +0 -1
  616. package/dist/esm/chunk-D3OEQLUE.mjs +0 -2
  617. package/dist/esm/chunk-D3OEQLUE.mjs.map +0 -1
  618. package/dist/esm/chunk-DBTKJMLV.mjs.map +0 -1
  619. package/dist/esm/chunk-DC2IESER.mjs +0 -2
  620. package/dist/esm/chunk-DC2IESER.mjs.map +0 -1
  621. package/dist/esm/chunk-EGV3HFE3.mjs.map +0 -1
  622. package/dist/esm/chunk-ELXJ5A4B.mjs +0 -2
  623. package/dist/esm/chunk-ELXJ5A4B.mjs.map +0 -1
  624. package/dist/esm/chunk-F2WY2DEY.mjs.map +0 -1
  625. package/dist/esm/chunk-FZDEGDUY.mjs.map +0 -1
  626. package/dist/esm/chunk-G4KAHJXB.mjs.map +0 -1
  627. package/dist/esm/chunk-GAEAYY44.mjs +0 -1
  628. package/dist/esm/chunk-GMKKHGXK.mjs.map +0 -1
  629. package/dist/esm/chunk-GVNK3UMT.mjs.map +0 -1
  630. package/dist/esm/chunk-H3C3VTHS.mjs.map +0 -1
  631. package/dist/esm/chunk-HBIDHQ2M.mjs.map +0 -1
  632. package/dist/esm/chunk-HMMNQFVM.mjs.map +0 -1
  633. package/dist/esm/chunk-IBZKCBN5.mjs.map +0 -1
  634. package/dist/esm/chunk-ICMELYCL.mjs.map +0 -1
  635. package/dist/esm/chunk-IHGA5KAD.mjs.map +0 -1
  636. package/dist/esm/chunk-IK2NYNKG.mjs.map +0 -1
  637. package/dist/esm/chunk-J3E4UMBB.mjs +0 -2
  638. package/dist/esm/chunk-J3E4UMBB.mjs.map +0 -1
  639. package/dist/esm/chunk-J7PJSK3J.mjs.map +0 -1
  640. package/dist/esm/chunk-JMPHD4BP.mjs.map +0 -1
  641. package/dist/esm/chunk-JNO7KPMG.mjs.map +0 -1
  642. package/dist/esm/chunk-KCWRCWNT.mjs.map +0 -1
  643. package/dist/esm/chunk-L4SWQLAJ.mjs.map +0 -1
  644. package/dist/esm/chunk-LA5HJILW.mjs.map +0 -1
  645. package/dist/esm/chunk-LGTOOAQI.mjs.map +0 -1
  646. package/dist/esm/chunk-LKKI2KAP.mjs.map +0 -1
  647. package/dist/esm/chunk-LPVGVTWT.mjs.map +0 -1
  648. package/dist/esm/chunk-MHN6XY4Z.mjs +0 -2
  649. package/dist/esm/chunk-MHN6XY4Z.mjs.map +0 -1
  650. package/dist/esm/chunk-N62NUAHT.mjs.map +0 -1
  651. package/dist/esm/chunk-NK67FECB.mjs.map +0 -1
  652. package/dist/esm/chunk-OIOGOW6I.mjs.map +0 -1
  653. package/dist/esm/chunk-OPO5EYF7.mjs.map +0 -1
  654. package/dist/esm/chunk-P6KX7AS2.mjs +0 -2
  655. package/dist/esm/chunk-P6KX7AS2.mjs.map +0 -1
  656. package/dist/esm/chunk-PMGK5IHB.mjs.map +0 -1
  657. package/dist/esm/chunk-PXMNAP2Q.mjs.map +0 -1
  658. package/dist/esm/chunk-QI7OREBM.mjs.map +0 -1
  659. package/dist/esm/chunk-RCA73RVB.mjs.map +0 -1
  660. package/dist/esm/chunk-S5SQJRAV.mjs.map +0 -1
  661. package/dist/esm/chunk-SK3LIS4Z.mjs.map +0 -1
  662. package/dist/esm/chunk-SNYYEVJA.mjs.map +0 -1
  663. package/dist/esm/chunk-SPRNSFUV.mjs.map +0 -1
  664. package/dist/esm/chunk-T6ADNZE5.mjs.map +0 -1
  665. package/dist/esm/chunk-TCXYTPUR.mjs +0 -2
  666. package/dist/esm/chunk-TCXYTPUR.mjs.map +0 -1
  667. package/dist/esm/chunk-U3T4ZT7B.mjs.map +0 -1
  668. package/dist/esm/chunk-U6OCK6T4.mjs.map +0 -1
  669. package/dist/esm/chunk-UFPYCROT.mjs.map +0 -1
  670. package/dist/esm/chunk-UGIHQFID.mjs.map +0 -1
  671. package/dist/esm/chunk-UGTIALNW.mjs +0 -2
  672. package/dist/esm/chunk-V4FKFCBL.mjs.map +0 -1
  673. package/dist/esm/chunk-V5NDNR36.mjs +0 -2
  674. package/dist/esm/chunk-V5NDNR36.mjs.map +0 -1
  675. package/dist/esm/chunk-VIZHWYI5.mjs.map +0 -1
  676. package/dist/esm/chunk-VQZMI3EZ.mjs.map +0 -1
  677. package/dist/esm/chunk-VWGB5BHW.mjs.map +0 -1
  678. package/dist/esm/chunk-WFK3XRQX.mjs.map +0 -1
  679. package/dist/esm/chunk-XOLU6UP3.mjs.map +0 -1
  680. package/dist/esm/chunk-XZN344G4.mjs.map +0 -1
  681. package/dist/esm/chunk-YD2BMHH7.mjs +0 -2
  682. package/dist/esm/chunk-YEWZAR76.mjs.map +0 -1
  683. package/dist/esm/chunk-YJVZFYBX.mjs.map +0 -1
  684. package/dist/esm/chunk-ZMBXHMVQ.mjs.map +0 -1
  685. package/dist/esm/chunk-ZMMLM6ZJ.mjs.map +0 -1
  686. package/dist/esm/chunk-ZMS3AOEZ.mjs.map +0 -1
  687. package/dist/esm/chunk-ZXVN3HXB.mjs.map +0 -1
  688. /package/dist/esm/{chunk-GAEAYY44.mjs.map → account/AccountUtils.mjs.map} +0 -0
  689. /package/dist/esm/{chunk-NZ7M6NG2.mjs.map → chunk-P7A5RILV.mjs.map} +0 -0
  690. /package/dist/esm/{chunk-F45G3GP3.mjs.map → chunk-QHEKBHNU.mjs.map} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/core/hex.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { bytesToHex, hexToBytes } from \"@noble/hashes/utils\";\nimport { ParsingError, ParsingResult } from \"./common\";\nimport { HexInput } from \"../types\";\n\n/**\n * Provides reasons for parsing failures related to hexadecimal values.\n */\nexport enum HexInvalidReason {\n TOO_SHORT = \"too_short\",\n INVALID_LENGTH = \"invalid_length\",\n INVALID_HEX_CHARS = \"invalid_hex_chars\",\n}\n\n/**\n * NOTE: Do not use this class when working with account addresses; use AccountAddress instead.\n * When accepting hex data as input to a function, prefer to accept HexInput and\n *\n * A helper class for working with hex data. Hex data, when represented as a string,\n * generally looks like this, for example: 0xaabbcc, 45cd32, etc.\n *\n * then use the static helper methods of this class to convert it into the desired\n * format. This enables the greatest flexibility for the developer.\n *\n * Example usage:\n * ```typescript\n * getTransactionByHash(txnHash: HexInput): Promise<Transaction> {\n * const txnHashString = Hex.fromHexInput(txnHash).toString();\n * return await getTransactionByHashInner(txnHashString);\n * }\n * ```\n * This call to `Hex.fromHexInput().toString()` converts the HexInput to a hex string\n * with a leading 0x prefix, regardless of what the input format was.\n *\n * Other ways to chain the functions together:\n * - `Hex.fromHexString({ hexInput: \"0x1f\" }).toUint8Array()`\n * - `new Hex([1, 3]).toStringWithoutPrefix()`\n */\nexport class Hex {\n private readonly data: Uint8Array;\n\n /**\n * Create a new Hex instance from a Uint8Array.\n *\n * @param data - The Uint8Array containing the data to initialize the Hex instance.\n */\n constructor(data: Uint8Array) {\n this.data = data;\n }\n\n // ===\n // Methods for representing an instance of Hex as other types.\n // ===\n\n /**\n * Get the inner hex data as a Uint8Array. The inner data is already a Uint8Array, so no conversion takes place.\n *\n * @returns Hex data as Uint8Array\n */\n toUint8Array(): Uint8Array {\n return this.data;\n }\n\n /**\n * Get the hex data as a string without the 0x prefix.\n *\n * @returns Hex string without 0x prefix\n */\n toStringWithoutPrefix(): string {\n return bytesToHex(this.data);\n }\n\n /**\n * Get the hex data as a string with the 0x prefix.\n *\n * @returns Hex string with 0x prefix\n */\n toString(): string {\n return `0x${this.toStringWithoutPrefix()}`;\n }\n\n // ===\n // Methods for creating an instance of Hex from other types.\n // ===\n\n /**\n * Converts a hex string into a Hex instance, allowing for both prefixed and non-prefixed formats.\n *\n * @param str - A hex string, with or without the 0x prefix.\n *\n * @throws ParsingError - If the hex string is too short, has an odd number of characters, or contains invalid hex characters.\n *\n * @returns Hex - The resulting Hex instance created from the provided string.\n */\n static fromHexString(str: string): Hex {\n let input = str;\n\n if (input.startsWith(\"0x\")) {\n input = input.slice(2);\n }\n\n if (input.length === 0) {\n throw new ParsingError(\n \"Hex string is too short, must be at least 1 char long, excluding the optional leading 0x.\",\n HexInvalidReason.TOO_SHORT,\n );\n }\n\n if (input.length % 2 !== 0) {\n throw new ParsingError(\"Hex string must be an even number of hex characters.\", HexInvalidReason.INVALID_LENGTH);\n }\n\n try {\n return new Hex(hexToBytes(input));\n } catch (error: any) {\n throw new ParsingError(\n `Hex string contains invalid hex characters: ${error?.message}`,\n HexInvalidReason.INVALID_HEX_CHARS,\n );\n }\n }\n\n /**\n * Converts an instance of HexInput, which can be a string or a Uint8Array, into a Hex instance.\n * This function is useful for transforming hexadecimal representations into a structured Hex object for further manipulation.\n *\n * @param hexInput - A HexInput which can be a string or Uint8Array.\n * @returns A Hex instance created from the provided hexInput.\n */\n static fromHexInput(hexInput: HexInput): Hex {\n if (hexInput instanceof Uint8Array) return new Hex(hexInput);\n return Hex.fromHexString(hexInput);\n }\n\n /**\n * Converts an instance of HexInput, which can be a string or a Uint8Array, into a Uint8Array.\n *\n * @param hexInput - A HexInput which can be a string or Uint8Array.\n * @returns A Uint8Array created from the provided hexInput.\n */\n static hexInputToUint8Array(hexInput: HexInput): Uint8Array {\n if (hexInput instanceof Uint8Array) return hexInput;\n return Hex.fromHexString(hexInput).toUint8Array();\n }\n\n /**\n * Converts a HexInput (string or Uint8Array) to a hex string with '0x' prefix.\n *\n * @param hexInput - The input to convert, either a hex string (with/without '0x' prefix) or Uint8Array\n * @returns A hex string with '0x' prefix (e.g., \"0x1234\")\n *\n * @example\n * ```typescript\n * Hex.hexInputToString(\"1234\") // returns \"0x1234\"\n * Hex.hexInputToString(\"0x1234\") // returns \"0x1234\"\n * Hex.hexInputToString(new Uint8Array([0x12, 0x34])) // returns \"0x1234\"\n * ```\n */\n static hexInputToString(hexInput: HexInput): string {\n return Hex.fromHexInput(hexInput).toString();\n }\n\n /**\n * Converts a HexInput (string or Uint8Array) to a hex string without '0x' prefix.\n *\n * @param hexInput - The input to convert, either a hex string (with/without '0x' prefix) or Uint8Array\n * @returns A hex string without '0x' prefix (e.g., \"1234\")\n *\n * @example\n * ```typescript\n * Hex.hexInputToStringWithoutPrefix(\"1234\") // returns \"1234\"\n * Hex.hexInputToStringWithoutPrefix(\"0x1234\") // returns \"1234\"\n * Hex.hexInputToStringWithoutPrefix(new Uint8Array([0x12, 0x34])) // returns \"1234\"\n * ```\n */\n static hexInputToStringWithoutPrefix(hexInput: HexInput): string {\n return Hex.fromHexInput(hexInput).toStringWithoutPrefix();\n }\n\n // ===\n // Methods for checking validity.\n // ===\n\n /**\n * Check if the provided string is a valid hexadecimal representation.\n *\n * @param str - A hex string representing byte data.\n *\n * @returns An object containing:\n * - valid: A boolean indicating whether the string is valid.\n * - invalidReason: The reason for invalidity if the string is not valid.\n * - invalidReasonMessage: A message explaining why the string is invalid.\n */\n static isValid(str: string): ParsingResult<HexInvalidReason> {\n try {\n Hex.fromHexString(str);\n return { valid: true };\n } catch (error: any) {\n return {\n valid: false,\n invalidReason: error?.invalidReason,\n invalidReasonMessage: error?.message,\n };\n }\n }\n\n /**\n * Determine if two Hex instances are equal by comparing their underlying byte data.\n *\n * @param other The Hex instance to compare to.\n * @returns true if the Hex instances are equal, false if not.\n */\n equals(other: Hex): boolean {\n if (this.data.length !== other.data.length) return false;\n return this.data.every((value, index) => value === other.data[index]);\n }\n}\n\nexport const hexToAsciiString = (hex: string) => new TextDecoder().decode(Hex.fromHexInput(hex).toUint8Array());\n"],"mappings":"yCAGA,OAAS,cAAAA,EAAY,cAAAC,MAAkB,sBAOhC,IAAKC,OACVA,EAAA,UAAY,YACZA,EAAA,eAAiB,iBACjBA,EAAA,kBAAoB,oBAHVA,OAAA,IA8BCC,EAAN,MAAMC,CAAI,CAQf,YAAYC,EAAkB,CAC5B,KAAK,KAAOA,CACd,CAWA,cAA2B,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AKE,CAAK,CAAC,CACtE,CACF,EAEaC,EAAoBC,GAAgB,IAAI,YAAY,EAAE,OAAOd,EAAI,aAAac,CAAG,EAAE,aAAa,CAAC","names":["bytesToHex","hexToBytes","HexInvalidReason","Hex","_Hex","data","bytesToHex","str","input","ParsingError","hexToBytes","error","hexInput","other","value","index","hexToAsciiString","hex"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/transactions/typeTag/index.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable class-methods-use-this */\n/* eslint-disable max-classes-per-file */\nimport { Deserializer } from \"../../bcs/deserializer\";\nimport { Serializable, Serializer } from \"../../bcs/serializer\";\nimport { AccountAddress } from \"../../core\";\nimport { Identifier } from \"../instances/identifier\";\nimport { TypeTagVariants } from \"../../types\";\n\n/**\n * Represents a type tag in the serialization framework, serving as a base class for various specific type tags.\n * This class provides methods for serialization and deserialization of type tags, as well as type checking methods\n * to determine the specific type of the tag at runtime.\n *\n * @extends Serializable\n */\nexport abstract class TypeTag extends Serializable {\n abstract serialize(serializer: Serializer): void;\n\n /**\n * Deserializes a StructTag from the provided deserializer.\n * This function allows you to reconstruct a StructTag object from its serialized form.\n *\n * @param deserializer - The deserializer instance used to read the serialized data.\n */\n deserialize(deserializer: Deserializer): StructTag {\n const address = AccountAddress.deserialize(deserializer);\n const moduleName = Identifier.deserialize(deserializer);\n const name = Identifier.deserialize(deserializer);\n const typeArgs = deserializer.deserializeVector(TypeTag);\n return new StructTag(address, moduleName, name, typeArgs);\n }\n\n static deserialize(deserializer: Deserializer): TypeTag {\n const index = deserializer.deserializeUleb128AsU32();\n switch (index) {\n case TypeTagVariants.Bool:\n return TypeTagBool.load(deserializer);\n case TypeTagVariants.U8:\n return TypeTagU8.load(deserializer);\n case TypeTagVariants.U64:\n return TypeTagU64.load(deserializer);\n case TypeTagVariants.U128:\n return TypeTagU128.load(deserializer);\n case TypeTagVariants.Address:\n return TypeTagAddress.load(deserializer);\n case TypeTagVariants.Signer:\n return TypeTagSigner.load(deserializer);\n case TypeTagVariants.Vector:\n return TypeTagVector.load(deserializer);\n case TypeTagVariants.Struct:\n return TypeTagStruct.load(deserializer);\n case TypeTagVariants.U16:\n return TypeTagU16.load(deserializer);\n case TypeTagVariants.U32:\n return TypeTagU32.load(deserializer);\n case TypeTagVariants.U256:\n return TypeTagU256.load(deserializer);\n case TypeTagVariants.Generic:\n // This is only used for ABI representation, and cannot actually be used as a type.\n return TypeTagGeneric.load(deserializer);\n default:\n throw new Error(`Unknown variant index for TypeTag: ${index}`);\n }\n }\n\n abstract toString(): string;\n\n /**\n * Determines if the current instance is of type TypeTagBool.\n *\n * @returns {boolean} True if the instance is a TypeTagBool, otherwise false.\n */\n isBool(): this is TypeTagBool {\n return this instanceof TypeTagBool;\n }\n\n /**\n * Determines if the current instance is of type TypeTagAddress.\n *\n * @returns {boolean} True if the instance is a TypeTagAddress, otherwise false.\n */\n isAddress(): this is TypeTagAddress {\n return this instanceof TypeTagAddress;\n }\n\n /**\n * Determines if the current instance is of type TypeTagGeneric.\n *\n * @returns {boolean} Returns true if the instance is a TypeTagGeneric, otherwise false.\n */\n isGeneric(): this is TypeTagGeneric {\n return this instanceof TypeTagGeneric;\n }\n\n /**\n * Determine if the current instance is a TypeTagSigner.\n *\n * @returns {boolean} Returns true if the instance is a TypeTagSigner, otherwise false.\n */\n isSigner(): this is TypeTagSigner {\n return this instanceof TypeTagSigner;\n }\n\n /**\n * Checks if the current instance is a vector type.\n * This can help determine the specific type of data structure being used.\n *\n * @returns {boolean} True if the instance is of type TypeTagVector, otherwise false.\n */\n isVector(): this is TypeTagVector {\n return this instanceof TypeTagVector;\n }\n\n /**\n * Determines if the current instance is a structure type.\n *\n * @returns {boolean} True if the instance is of type TypeTagStruct, otherwise false.\n */\n isStruct(): this is TypeTagStruct {\n return this instanceof TypeTagStruct;\n }\n\n /**\n * Determines if the current instance is of type `TypeTagU8`.\n *\n * @returns {boolean} Returns true if the instance is of type `TypeTagU8`, otherwise false.\n */\n isU8(): this is TypeTagU8 {\n return this instanceof TypeTagU8;\n }\n\n /**\n * Checks if the current instance is of type TypeTagU16.\n *\n * @returns {boolean} True if the instance is TypeTagU16, otherwise false.\n */\n isU16(): this is TypeTagU16 {\n return this instanceof TypeTagU16;\n }\n\n /**\n * Checks if the current instance is of type TypeTagU32.\n *\n * @returns {boolean} Returns true if the instance is TypeTagU32, otherwise false.\n */\n isU32(): this is TypeTagU32 {\n return this instanceof TypeTagU32;\n }\n\n /**\n * Checks if the current instance is of type TypeTagU64.\n *\n * @returns {boolean} True if the instance is a TypeTagU64, otherwise false.\n */\n isU64(): this is TypeTagU64 {\n return this instanceof TypeTagU64;\n }\n\n /**\n * Determines if the current instance is of the TypeTagU128 type.\n *\n * @returns {boolean} True if the instance is of TypeTagU128, otherwise false.\n */\n isU128(): this is TypeTagU128 {\n return this instanceof TypeTagU128;\n }\n\n /**\n * Checks if the current instance is of type TypeTagU256.\n *\n * @returns {boolean} Returns true if the instance is of type TypeTagU256, otherwise false.\n */\n isU256(): this is TypeTagU256 {\n return this instanceof TypeTagU256;\n }\n\n isPrimitive(): boolean {\n return (\n this instanceof TypeTagSigner ||\n this instanceof TypeTagAddress ||\n this instanceof TypeTagBool ||\n this instanceof TypeTagU8 ||\n this instanceof TypeTagU16 ||\n this instanceof TypeTagU32 ||\n this instanceof TypeTagU64 ||\n this instanceof TypeTagU128 ||\n this instanceof TypeTagU256\n );\n }\n}\n\n/**\n * Represents a boolean type tag in the type system.\n * This class extends the base TypeTag class and provides\n * methods for serialization and deserialization of the boolean\n * type tag.\n *\n * @extends TypeTag\n */\nexport class TypeTagBool extends TypeTag {\n /**\n * Returns the string representation of the object.\n *\n * @returns {string} The string representation of the object.\n */\n toString(): string {\n return \"bool\";\n }\n\n /**\n * Serializes the current instance's properties into a provided serializer.\n * This function ensures that the address, module name, name, and type arguments are properly serialized.\n *\n * @param serializer - The serializer instance used to serialize the properties.\n */\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TypeTagVariants.Bool);\n }\n\n /**\n * Deserializes a StructTag and returns a new TypeTagStruct instance.\n *\n * @param _deserializer - The deserializer used to read the StructTag data.\n */\n static load(_deserializer: Deserializer): TypeTagBool {\n return new TypeTagBool();\n }\n}\n\n/**\n * Represents a type tag for an 8-bit unsigned integer (u8).\n * This class extends the base TypeTag class and provides methods\n * for serialization and deserialization specific to the u8 type.\n *\n * @extends TypeTag\n */\nexport class TypeTagU8 extends TypeTag {\n toString(): string {\n return \"u8\";\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TypeTagVariants.U8);\n }\n\n static load(_deserializer: Deserializer): TypeTagU8 {\n return new TypeTagU8();\n }\n}\n\n/**\n * Represents a type tag for unsigned 16-bit integers (u16).\n * This class extends the base TypeTag class and provides methods for serialization and deserialization.\n *\n * @extends TypeTag\n */\nexport class TypeTagU16 extends TypeTag {\n toString(): string {\n return \"u16\";\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TypeTagVariants.U16);\n }\n\n static load(_deserializer: Deserializer): TypeTagU16 {\n return new TypeTagU16();\n }\n}\n\n/**\n * Represents a type tag for a 32-bit unsigned integer (u32).\n * This class extends the base TypeTag class and provides methods for serialization\n * and deserialization specific to the u32 type.\n *\n * @extends TypeTag\n */\nexport class TypeTagU32 extends TypeTag {\n toString(): string {\n return \"u32\";\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TypeTagVariants.U32);\n }\n\n static load(_deserializer: Deserializer): TypeTagU32 {\n return new TypeTagU32();\n }\n}\n\n/**\n * Represents a type tag for 64-bit unsigned integers (u64).\n * This class extends the base TypeTag class and provides methods for serialization and deserialization.\n *\n * @extends TypeTag\n */\nexport class TypeTagU64 extends TypeTag {\n toString(): string {\n return \"u64\";\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TypeTagVariants.U64);\n }\n\n static load(_deserializer: Deserializer): TypeTagU64 {\n return new TypeTagU64();\n }\n}\n\n/**\n * Represents a type tag for the u128 data type.\n * This class extends the base TypeTag class and provides methods for serialization and deserialization.\n *\n * @extends TypeTag\n */\nexport class TypeTagU128 extends TypeTag {\n toString(): string {\n return \"u128\";\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TypeTagVariants.U128);\n }\n\n static load(_deserializer: Deserializer): TypeTagU128 {\n return new TypeTagU128();\n }\n}\n\n/**\n * Represents a type tag for the U256 data type.\n * This class extends the base TypeTag class and provides methods for serialization and deserialization.\n *\n * @extends TypeTag\n */\nexport class TypeTagU256 extends TypeTag {\n toString(): string {\n return \"u256\";\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TypeTagVariants.U256);\n }\n\n static load(_deserializer: Deserializer): TypeTagU256 {\n return new TypeTagU256();\n }\n}\n\n/**\n * Represents a type tag for an address in the system.\n * This class extends the TypeTag class and provides functionality\n * to serialize the address type and load it from a deserializer.\n *\n * @extends TypeTag\n */\nexport class TypeTagAddress extends TypeTag {\n toString(): string {\n return \"address\";\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TypeTagVariants.Address);\n }\n\n static load(_deserializer: Deserializer): TypeTagAddress {\n return new TypeTagAddress();\n }\n}\n\n/**\n * Represents a type tag for a signer in the system.\n * This class extends the base TypeTag and provides specific functionality\n * related to the signer type.\n *\n * @extends TypeTag\n */\nexport class TypeTagSigner extends TypeTag {\n toString(): string {\n return \"signer\";\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TypeTagVariants.Signer);\n }\n\n static load(_deserializer: Deserializer): TypeTagSigner {\n return new TypeTagSigner();\n }\n}\n\n/**\n * Represents a reference to a type tag in the type system.\n * This class extends the TypeTag class and provides functionality\n * to serialize and deserialize type tag references.\n *\n * @extends TypeTag\n */\nexport class TypeTagReference extends TypeTag {\n toString(): `&${string}` {\n return `&${this.value.toString()}`;\n }\n\n /**\n * Initializes a new instance of the class with the specified parameters.\n *\n * @param value - The TypeTag to reference.\n */\n constructor(public readonly value: TypeTag) {\n super();\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TypeTagVariants.Reference);\n }\n\n static load(deserializer: Deserializer): TypeTagReference {\n const value = TypeTag.deserialize(deserializer);\n return new TypeTagReference(value);\n }\n}\n\n/**\n * Represents a generic type tag used for type parameters in entry functions.\n * Generics are not serialized into a real type, so they cannot be used as a type directly.\n *\n * @extends TypeTag\n */\nexport class TypeTagGeneric extends TypeTag {\n toString(): `T${number}` {\n return `T${this.value}`;\n }\n\n constructor(public readonly value: number) {\n super();\n if (value < 0) throw new Error(\"Generic type parameter index cannot be negative\");\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TypeTagVariants.Generic);\n serializer.serializeU32(this.value);\n }\n\n static load(deserializer: Deserializer): TypeTagGeneric {\n const value = deserializer.deserializeU32();\n return new TypeTagGeneric(value);\n }\n}\n\n/**\n * Represents a vector type tag, which encapsulates a single type tag value.\n * This class extends the base TypeTag class and provides methods for serialization,\n * deserialization, and string representation of the vector type tag.\n *\n * @extends TypeTag\n */\nexport class TypeTagVector extends TypeTag {\n toString(): `vector<${string}>` {\n return `vector<${this.value.toString()}>`;\n }\n\n constructor(public readonly value: TypeTag) {\n super();\n }\n\n /**\n * Creates a new TypeTagVector instance with a TypeTagU8 type.\n *\n * @returns {TypeTagVector} A new TypeTagVector initialized with TypeTagU8.\n */\n static u8(): TypeTagVector {\n return new TypeTagVector(new TypeTagU8());\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TypeTagVariants.Vector);\n this.value.serialize(serializer);\n }\n\n static load(deserializer: Deserializer): TypeTagVector {\n const value = TypeTag.deserialize(deserializer);\n return new TypeTagVector(value);\n }\n}\n\n/**\n * Represents a structured type tag in the system, extending the base TypeTag class.\n * This class encapsulates information about a specific structure, including its address,\n * module name, and type arguments, and provides methods for serialization and type checking.\n *\n * @param value - The StructTag instance containing the details of the structured type.\n */\nexport class TypeTagStruct extends TypeTag {\n toString(): `0x${string}::${string}::${string}` {\n // Collect type args and add it if there are any\n let typePredicate = \"\";\n if (this.value.typeArgs.length > 0) {\n typePredicate = `<${this.value.typeArgs.map((typeArg) => typeArg.toString()).join(\", \")}>`;\n }\n\n return `${this.value.address.toString()}::${this.value.moduleName.identifier}::${\n this.value.name.identifier\n }${typePredicate}`;\n }\n\n constructor(public readonly value: StructTag) {\n super();\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TypeTagVariants.Struct);\n this.value.serialize(serializer);\n }\n\n static load(deserializer: Deserializer): TypeTagStruct {\n const value = StructTag.deserialize(deserializer);\n return new TypeTagStruct(value);\n }\n\n /**\n * Determines if the provided address, module name, and struct name match the current type tag.\n *\n * @param address - The account address to compare against the type tag.\n * @param moduleName - The name of the module to compare against the type tag.\n * @param structName - The name of the struct to compare against the type tag.\n * @returns True if the address, module name, and struct name match the type tag; otherwise, false.\n */\n isTypeTag(address: AccountAddress, moduleName: string, structName: string): boolean {\n return (\n this.value.moduleName.identifier === moduleName &&\n this.value.name.identifier === structName &&\n this.value.address.equals(address)\n );\n }\n\n /**\n * Checks if the provided value is of type string.\n * This function can help ensure that the data being processed is in the correct format before further operations.\n *\n * @returns {boolean} Returns true if the value is a string, otherwise false.\n */\n isString(): boolean {\n return this.isTypeTag(AccountAddress.ONE, \"string\", \"String\");\n }\n\n /**\n * Checks if the specified account address is of type \"option\".\n *\n * @returns {boolean} Returns true if the account address is an option type, otherwise false.\n */\n isOption(): boolean {\n return this.isTypeTag(AccountAddress.ONE, \"option\", \"Option\");\n }\n\n /**\n * Checks if the provided value is of type 'object'.\n * This function helps determine if a value can be treated as an object type in the context of the SDK.\n *\n * @returns {boolean} Returns true if the value is an object, otherwise false.\n */\n isObject(): boolean {\n return this.isTypeTag(AccountAddress.ONE, \"object\", \"Object\");\n }\n}\n\n/**\n * Represents a structured tag that includes an address, module name,\n * name, and type arguments. This class is used to define and manage\n * structured data types within the SDK.\n *\n * @property {AccountAddress} address - The address associated with the struct tag.\n * @property {Identifier} moduleName - The name of the module that contains the struct.\n * @property {Identifier} name - The name of the struct.\n * @property {Array<TypeTag>} typeArgs - An array of type arguments associated with the struct.\n */\nexport class StructTag extends Serializable {\n public readonly address: AccountAddress;\n\n public readonly moduleName: Identifier;\n\n public readonly name: Identifier;\n\n public readonly typeArgs: Array<TypeTag>;\n\n constructor(address: AccountAddress, module_name: Identifier, name: Identifier, type_args: Array<TypeTag>) {\n super();\n this.address = address;\n this.moduleName = module_name;\n this.name = name;\n this.typeArgs = type_args;\n }\n\n serialize(serializer: Serializer): void {\n serializer.serialize(this.address);\n serializer.serialize(this.moduleName);\n serializer.serialize(this.name);\n serializer.serializeVector(this.typeArgs);\n }\n\n static deserialize(deserializer: Deserializer): StructTag {\n const address = AccountAddress.deserialize(deserializer);\n const moduleName = Identifier.deserialize(deserializer);\n const name = Identifier.deserialize(deserializer);\n const typeArgs = deserializer.deserializeVector(TypeTag);\n return new StructTag(address, moduleName, name, typeArgs);\n }\n}\n\n/**\n * Retrieves the StructTag for the AptosCoin, which represents the Aptos Coin in the Aptos blockchain.\n *\n * @returns {StructTag} The StructTag for the AptosCoin.\n */\nexport function aptosCoinStructTag(): StructTag {\n return new StructTag(AccountAddress.ONE, new Identifier(\"aptos_coin\"), new Identifier(\"AptosCoin\"), []);\n}\n\n/**\n * Returns a new StructTag representing a string type.\n *\n * @returns {StructTag} A StructTag for the string type.\n */\nexport function stringStructTag(): StructTag {\n return new StructTag(AccountAddress.ONE, new Identifier(\"string\"), new Identifier(\"String\"), []);\n}\n\n/**\n * Creates a new StructTag for the Option type with the specified type argument.\n * This can help in defining a specific instance of an Option type in your application.\n *\n * @param typeArg - The type tag that specifies the type of the value contained in the Option.\n */\nexport function optionStructTag(typeArg: TypeTag): StructTag {\n return new StructTag(AccountAddress.ONE, new Identifier(\"option\"), new Identifier(\"Option\"), [typeArg]);\n}\n\n/**\n * Creates a new StructTag for the Object type with the specified type argument.\n * This function helps in defining a structured representation of an Object with a specific type.\n *\n * @param typeArg - The type tag that specifies the type of the Object.\n */\nexport function objectStructTag(typeArg: TypeTag): StructTag {\n return new StructTag(AccountAddress.ONE, new Identifier(\"object\"), new Identifier(\"Object\"), [typeArg]);\n}\n"],"mappings":"2HAmBO,IAAeA,EAAf,MAAeC,UAAgBC,CAAa,CASjD,YAAYC,EAAuC,CACjD,IAAMC,EAAUC,EAAe,YAAYF,CAAY,EACjDG,EAAaC,EAAW,YAAYJ,CAAY,EAChDK,EAAOD,EAAW,YAAYJ,CAAY,EAC1CM,EAAWN,EAAa,kBAAkBF,CAAO,EACvD,OAAO,IAAIS,EAAUN,EAASE,EAAYE,EAAMC,CAAQ,CAC1D,CAEA,OAAO,YAAYN,EAAqC,CACtD,IAAMQ,EAAQR,EAAa,wBAAwB,EACnD,OAAQQ,EAAO,CACb,OACE,OAAOC,EAAY,KAAKT,CAAY,EACtC,OACE,OAAOU,EAAU,KAAKV,CAAY,EACpC,OACE,OAAOW,EAAW,KAAKX,CAAY,EACrC,OACE,OAAOY,EAAY,KAAKZ,CAAY,EACtC,OACE,OAAOa,EAAe,KAAKb,CAAY,EACzC,OACE,OAAOc,EAAc,KAAKd,CAAY,EACxC,OACE,OAAOe,EAAc,KAAKf,CAAY,EACxC,OACE,OAAOgB,EAAc,KAAKhB,CAAY,EACxC,OACE,OAAOiB,EAAW,KAAKjB,CAAY,EACrC,OACE,OAAOkB,EAAW,KAAKlB,CAAY,EACrC,QACE,OAAOmB,EAAY,KAAKnB,CAAY,EACtC,SAEE,OAAOoB,EAAe,KAAKpB,CAAY,EACzC,QACE,MAAM,IAAI,MAAM,sCAAsCQ,CAAK,EAAE,CACjE,CACF,CASA,QAA8B,CAC5B,OAAO,gBAAgBC,CACzB,CAOA,WAAoC,CAClC,OAAO,gBAAgBI,CACzB,CAOA,WAAoC,CAClC,OAAO,gBAAgBO,C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IAAItC,EAAUL,EAAe,IAAK,IAAIE,EAAW,QAAQ,EAAG,IAAIA,EAAW,QAAQ,EAAG,CAAC,CAAC,CACjG,CAQO,SAAS0C,EAAgBP,EAA6B,CAC3D,OAAO,IAAIhC,EAAUL,EAAe,IAAK,IAAIE,EAAW,QAAQ,EAAG,IAAIA,EAAW,QAAQ,EAAG,CAACmC,CAAO,CAAC,CACxG,CAQO,SAASQ,EAAgBR,EAA6B,CAC3D,OAAO,IAAIhC,EAAUL,EAAe,IAAK,IAAIE,EAAW,QAAQ,EAAG,IAAIA,EAAW,QAAQ,EAAG,CAACmC,CAAO,CAAC,CACxG","names":["TypeTag","_TypeTag","Serializable","deserializer","address","AccountAddress","moduleName","Identifier","name","typeArgs","StructTag","index","TypeTagBool","TypeTagU8","TypeTagU64","TypeTagU128","TypeTagAddress","TypeTagSigner","TypeTagVector","TypeTagStruct","TypeTagU16","TypeTagU32","TypeTagU256","TypeTagGeneric","_TypeTagBool","serializer","_deserializer","_TypeTagU8","_TypeTagU16","_TypeTagU32","_TypeTagU64","_TypeTagU128","_TypeTagU256","_TypeTagAddress","_TypeTagSigner","TypeTagReference","_TypeTagReference","value","_TypeTagGeneric","_TypeTagVector","_TypeTagStruct","typePredicate","typeArg","structName","_StructTag","module_name","type_args","aptosCoinStructTag","stringStructTag","optionStructTag","objectStructTag"]}
@@ -1,2 +0,0 @@
1
- import{a as o,b as l}from"./chunk-JMPHD4BP.mjs";import{b as m}from"./chunk-MHN6XY4Z.mjs";import{a as g}from"./chunk-4O5XDQDO.mjs";import{a as y}from"./chunk-AKIO3OIT.mjs";function d(h){let e=h;return e-=e>>1&1431655765,e=(e&858993459)+(e>>2&858993459),(e+(e>>4)&252645135)*16843009>>24}var p=class h extends m{constructor(e){super();let{publicKeys:r,signaturesRequired:t}=e;if(t<1)throw new Error("The number of required signatures needs to be greater than 0");if(r.length<t)throw new Error(`Provided ${r.length} public keys is smaller than the ${t} required signatures`);this.publicKeys=r.map(i=>i instanceof o?i:new o(i)),this.signaturesRequired=t}verifySignature(e){throw new Error("not implemented")}authKey(){return y.fromSchemeAndBytes({scheme:3,input:this.toUint8Array()})}serialize(e){e.serializeVector(this.publicKeys),e.serializeU8(this.signaturesRequired)}static deserialize(e){let r=e.deserializeVector(o),t=e.deserializeU8();return new h({publicKeys:r,signaturesRequired:t})}createBitmap(e){let{bits:r}=e,t=128,i=new Uint8Array([0,0,0,0]),a=new Set;return r.forEach((n,u)=>{if(u+1>this.publicKeys.length)throw new Error(`Signature index ${u+1} is out of public keys range, ${this.publicKeys.length}.`);if(a.has(n))throw new Error(`Duplicate bit ${n} detected.`);a.add(n);let c=Math.floor(n/8),b=i[c];b|=t>>n%8,i[c]=b}),i}getIndex(e){let r=e instanceof o?e:new o(e),t=this.publicKeys.findIndex(i=>i.toString()===r.toString());if(t!==-1)return t;throw new Error("Public key not found in MultiKey")}static isInstance(e){return"publicKeys"in e&&"signaturesRequired"in e}},s=class s extends g{constructor(e){super();let{signatures:r,bitmap:t}=e;if(r.length>s.MAX_SIGNATURES_SUPPORTED)throw new Error(`The number of signatures cannot be greater than ${s.MAX_SIGNATURES_SUPPORTED}`);if(this.signatures=r.map(a=>a instanceof l?a:new l(a)),!(t instanceof Uint8Array))this.bitmap=s.createBitmap({bits:t});else{if(t.length!==s.BITMAP_LEN)throw new Error(`"bitmap" length should be ${s.BITMAP_LEN}`);this.bitmap=t}let i=this.bitmap.reduce((a,n)=>a+d(n),0);if(i!==this.signatures.length)throw new Error(`Expecting ${i} signatures from the bitmap, but got ${this.signatures.length}`)}static createBitmap(e){let{bits:r}=e,t=128,i=new Uint8Array([0,0,0,0]),a=new Set;return r.forEach(n=>{if(n>=s.MAX_SIGNATURES_SUPPORTED)throw new Error(`Cannot have a signature larger than ${s.MAX_SIGNATURES_SUPPORTED-1}.`);if(a.has(n))throw new Error("Duplicate bits detected.");a.add(n);let u=Math.floor(n/8),c=i[u];c|=t>>n%8,i[u]=c}),i}serialize(e){e.serializeVector(this.signatures),e.serializeBytes(this.bitmap)}static deserialize(e){let r=e.deserializeVector(l),t=e.deserializeBytes();return new s({signatures:r,bitmap:t})}};s.BITMAP_LEN=4,s.MAX_SIGNATURES_SUPPORTED=s.BITMAP_LEN*8;var f=s;export{p as a,f as b};
2
- //# sourceMappingURL=chunk-TCXYTPUR.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/core/crypto/multiKey.ts"],"sourcesContent":["import { SigningScheme as AuthenticationKeyScheme } from \"../../types\";\nimport { Deserializer } from \"../../bcs/deserializer\";\nimport { Serializer } from \"../../bcs/serializer\";\nimport { AuthenticationKey } from \"../authenticationKey\";\nimport { AccountPublicKey, PublicKey, VerifySignatureArgs } from \"./publicKey\";\nimport { Signature } from \"./signature\";\nimport { AnyPublicKey, AnySignature } from \"./singleKey\";\n\n/**\n * Counts the number of set bits (1s) in a byte.\n * This function can help you determine the population count of a given byte value.\n *\n * @param byte - The byte value for which to count the number of set bits.\n */\n/* eslint-disable no-bitwise */\nfunction bitCount(byte: number) {\n let n = byte;\n n -= (n >> 1) & 0x55555555;\n n = (n & 0x33333333) + ((n >> 2) & 0x33333333);\n return (((n + (n >> 4)) & 0xf0f0f0f) * 0x1010101) >> 24;\n}\n/* eslint-enable no-bitwise */\n\n/**\n * Represents a multi-key authentication scheme for accounts, allowing multiple public keys\n * to be associated with a single account. This class enforces a minimum number of valid signatures\n * required to authorize actions, ensuring enhanced security for multi-agent accounts.\n *\n * The public keys of each individual agent can be any type of public key supported by Aptos.\n * Since [AIP-55](https://github.com/aptos-foundation/AIPs/pull/263), Aptos supports\n * `Legacy` and `Unified` authentication keys.\n */\nexport class MultiKey extends AccountPublicKey {\n /**\n * List of any public keys\n */\n public readonly publicKeys: AnyPublicKey[];\n\n /**\n * The minimum number of valid signatures required, for the number of public keys specified\n */\n public readonly signaturesRequired: number;\n\n /**\n * Signature for a K-of-N multi-sig transaction.\n * This constructor initializes a multi-signature transaction with the provided signatures and bitmap.\n *\n * @param args An object containing the parameters for the multi-signature transaction.\n * @param args.signatures A list of signatures.\n * @param args.bitmap A bitmap represented as a Uint8Array or an array of numbers, where each bit indicates whether a\n * corresponding signature is present. A maximum of 32 signatures is supported, and the length of the bitmap must be 4 bytes.\n *\n * @throws Error if the number of signatures exceeds the maximum supported, if the bitmap length is incorrect, or if the number\n * of signatures does not match the bitmap.\n */\n // region Constructors\n constructor(args: { publicKeys: Array<PublicKey>; signaturesRequired: number }) {\n super();\n const { publicKeys, signaturesRequired } = args;\n\n // Validate number of public keys is greater than signature required\n if (signaturesRequired < 1) {\n throw new Error(\"The number of required signatures needs to be greater than 0\");\n }\n\n // Validate number of public keys is greater than signature required\n if (publicKeys.length < signaturesRequired) {\n throw new Error(\n `Provided ${publicKeys.length} public keys is smaller than the ${signaturesRequired} required signatures`,\n );\n }\n\n // Make sure that all keys are normalized to the SingleKey authentication scheme\n this.publicKeys = publicKeys.map((publicKey) =>\n publicKey instanceof AnyPublicKey ? publicKey : new AnyPublicKey(publicKey),\n );\n\n this.signaturesRequired = signaturesRequired;\n }\n\n // endregion\n\n // region AccountPublicKey\n\n /**\n * Verifies the provided signature against the given message.\n * This function helps ensure the integrity and authenticity of the message by checking if the signature is valid.\n *\n * @param args - The arguments for verifying the signature.\n * @param args.message - The message that was signed.\n * @param args.signature - The signature to verify.\n */\n // eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars\n verifySignature(args: VerifySignatureArgs): boolean {\n throw new Error(\"not implemented\");\n }\n\n /**\n * Generates an authentication key based on the current instance's byte representation.\n * This key can be used for secure authentication processes within the system.\n *\n * @returns {AuthenticationKey} The generated authentication key.\n */\n authKey(): AuthenticationKey {\n return AuthenticationKey.fromSchemeAndBytes({\n scheme: AuthenticationKeyScheme.MultiKey,\n input: this.toUint8Array(),\n });\n }\n\n // endregion\n\n // region Serializable\n\n /**\n * Serializes the object by writing its signatures and bitmap to the provided serializer.\n * This allows the object to be converted into a format suitable for transmission or storage.\n *\n * @param serializer - The serializer instance used to perform the serialization.\n */\n serialize(serializer: Serializer): void {\n serializer.serializeVector(this.publicKeys);\n serializer.serializeU8(this.signaturesRequired);\n }\n\n /**\n * Deserializes a MultiKeySignature from the provided deserializer.\n * This function retrieves the signatures and bitmap necessary for creating a MultiKeySignature object.\n *\n * @param deserializer - The deserializer instance used to read the serialized data.\n */\n static deserialize(deserializer: Deserializer): MultiKey {\n const keys = deserializer.deserializeVector(AnyPublicKey);\n const signaturesRequired = deserializer.deserializeU8();\n\n return new MultiKey({ publicKeys: keys, signaturesRequired });\n }\n\n // endregion\n\n /**\n * Create a bitmap that holds the mapping from the original public keys\n * to the signatures passed in\n *\n * @param args.bits array of the index mapping to the matching public keys\n * @returns Uint8array bit map\n */\n createBitmap(args: { bits: number[] }): Uint8Array {\n const { bits } = args;\n // Bits are read from left to right. e.g. 0b10000000 represents the first bit is set in one byte.\n // The decimal value of 0b10000000 is 128.\n const firstBitInByte = 128;\n const bitmap = new Uint8Array([0, 0, 0, 0]);\n\n // Check if duplicates exist in bits\n const dupCheckSet = new Set();\n\n bits.forEach((bit: number, idx: number) => {\n if (idx + 1 > this.publicKeys.length) {\n throw new Error(`Signature index ${idx + 1} is out of public keys range, ${this.publicKeys.length}.`);\n }\n\n if (dupCheckSet.has(bit)) {\n throw new Error(`Duplicate bit ${bit} detected.`);\n }\n\n dupCheckSet.add(bit);\n\n const byteOffset = Math.floor(bit / 8);\n\n let byte = bitmap[byteOffset];\n\n // eslint-disable-next-line no-bitwise\n byte |= firstBitInByte >> bit % 8;\n\n bitmap[byteOffset] = byte;\n });\n\n return bitmap;\n }\n\n /**\n * Get the index of the provided public key.\n *\n * This function retrieves the index of a specified public key within the MultiKey.\n * If the public key does not exist, it throws an error.\n *\n * @param publicKey - The public key to find the index for.\n * @returns The corresponding index of the public key, if it exists.\n * @throws Error - If the public key is not found in the MultiKey.\n */\n getIndex(publicKey: PublicKey): number {\n const anyPublicKey = publicKey instanceof AnyPublicKey ? publicKey : new AnyPublicKey(publicKey);\n const index = this.publicKeys.findIndex((pk) => pk.toString() === anyPublicKey.toString());\n\n if (index !== -1) {\n return index;\n }\n throw new Error(\"Public key not found in MultiKey\");\n }\n\n public static isInstance(value: PublicKey): value is MultiKey {\n return \"publicKeys\" in value && \"signaturesRequired\" in value;\n }\n}\n\n/**\n * Represents a multi-signature transaction using Ed25519 signatures.\n * This class allows for the creation and management of a K-of-N multi-signature scheme,\n * where a specified number of signatures are required to authorize a transaction.\n *\n * It includes functionality to validate the number of signatures against a bitmap,\n * which indicates which public keys have signed the transaction.\n */\nexport class MultiKeySignature extends Signature {\n /**\n * Number of bytes in the bitmap representing who signed the transaction (32-bits)\n */\n static BITMAP_LEN: number = 4;\n\n /**\n * Maximum number of Ed25519 signatures supported\n */\n static MAX_SIGNATURES_SUPPORTED = MultiKeySignature.BITMAP_LEN * 8;\n\n /**\n * The list of underlying Ed25519 signatures\n */\n public readonly signatures: AnySignature[];\n\n /**\n * 32-bit Bitmap representing who signed the transaction\n *\n * This is represented where each public key can be masked to determine whether the message was signed by that key.\n */\n public readonly bitmap: Uint8Array;\n\n /**\n * Signature for a K-of-N multi-sig transaction.\n *\n * @see {@link\n * https://aptos.dev/integration/creating-a-signed-transaction/#multisignature-transactions | Creating a Signed Transaction}\n *\n * @param args.signatures A list of signatures\n * @param args.bitmap 4 bytes, at most 32 signatures are supported. If Nth bit value is `1`, the Nth\n * signature should be provided in `signatures`. Bits are read from left to right\n */\n constructor(args: { signatures: Array<Signature | AnySignature>; bitmap: Uint8Array | number[] }) {\n super();\n const { signatures, bitmap } = args;\n\n if (signatures.length > MultiKeySignature.MAX_SIGNATURES_SUPPORTED) {\n throw new Error(`The number of signatures cannot be greater than ${MultiKeySignature.MAX_SIGNATURES_SUPPORTED}`);\n }\n\n // Make sure that all signatures are normalized to the SingleKey authentication scheme\n this.signatures = signatures.map((signature) =>\n signature instanceof AnySignature ? signature : new AnySignature(signature),\n );\n\n if (!(bitmap instanceof Uint8Array)) {\n this.bitmap = MultiKeySignature.createBitmap({ bits: bitmap });\n } else if (bitmap.length !== MultiKeySignature.BITMAP_LEN) {\n throw new Error(`\"bitmap\" length should be ${MultiKeySignature.BITMAP_LEN}`);\n } else {\n this.bitmap = bitmap;\n }\n\n const nSignatures = this.bitmap.reduce((acc, byte) => acc + bitCount(byte), 0);\n if (nSignatures !== this.signatures.length) {\n throw new Error(`Expecting ${nSignatures} signatures from the bitmap, but got ${this.signatures.length}`);\n }\n }\n\n /**\n * Helper method to create a bitmap out of the specified bit positions\n * @param args.bits The bitmap positions that should be set. A position starts at index 0.\n * Valid position should range between 0 and 31.\n * @example\n * Here's an example of valid `bits`\n * ```\n * [0, 2, 31]\n * ```\n * `[0, 2, 31]` means the 1st, 3rd and 32nd bits should be set in the bitmap.\n * The result bitmap should be 0b1010000000000000000000000000001\n *\n * @returns bitmap that is 32bit long\n */\n static createBitmap(args: { bits: number[] }): Uint8Array {\n const { bits } = args;\n // Bits are read from left to right. e.g. 0b10000000 represents the first bit is set in one byte.\n // The decimal value of 0b10000000 is 128.\n const firstBitInByte = 128;\n const bitmap = new Uint8Array([0, 0, 0, 0]);\n\n // Check if duplicates exist in bits\n const dupCheckSet = new Set();\n\n bits.forEach((bit: number) => {\n if (bit >= MultiKeySignature.MAX_SIGNATURES_SUPPORTED) {\n throw new Error(`Cannot have a signature larger than ${MultiKeySignature.MAX_SIGNATURES_SUPPORTED - 1}.`);\n }\n\n if (dupCheckSet.has(bit)) {\n throw new Error(\"Duplicate bits detected.\");\n }\n\n dupCheckSet.add(bit);\n\n const byteOffset = Math.floor(bit / 8);\n\n let byte = bitmap[byteOffset];\n\n // eslint-disable-next-line no-bitwise\n byte |= firstBitInByte >> bit % 8;\n\n bitmap[byteOffset] = byte;\n });\n\n return bitmap;\n }\n\n // region Serializable\n\n serialize(serializer: Serializer): void {\n // Note: we should not need to serialize the vector length, as it can be derived from the bitmap\n serializer.serializeVector(this.signatures);\n serializer.serializeBytes(this.bitmap);\n }\n\n static deserialize(deserializer: Deserializer): MultiKeySignature {\n const signatures = deserializer.deserializeVector(AnySignature);\n const bitmap = deserializer.deserializeBytes();\n return new MultiKeySignature({ signatures, bitmap });\n }\n\n // endregion\n}\n"],"mappings":"2KAeA,SAASA,EAASC,EAAc,CAC9B,IAAIC,EAAID,EACR,OAAAC,GAAMA,GAAK,EAAK,WAChBA,GAAKA,EAAI,YAAgBA,GAAK,EAAK,YACzBA,GAAKA,GAAK,GAAM,WAAa,UAAc,EACvD,CAYO,IAAMC,EAAN,MAAMC,UAAiBC,CAAiB,CAwB7C,YAAYC,EAAoE,CAC9E,MAAM,EACN,GAAM,CAAE,WAAAC,EAAY,mBAAAC,CAAmB,EAAIF,EAG3C,GAAIE,EAAqB,EACvB,MAAM,IAAI,MAAM,8DAA8D,EAIhF,GAAID,EAAW,OAASC,EACtB,MAAM,IAAI,MACR,YAAYD,EAAW,MAAM,oCAAoCC,CAAkB,sBACrF,EAIF,KAAK,WAAaD,EAAW,IAAKE,GAChCA,aAAqBC,EAAeD,EAAY,IAAIC,EAAaD,CAAS,CAC5E,EAEA,KAAK,mBAAqBD,CAC5B,CAeA,gBAAgBF,EAAoC,CAClD,MAAM,IAAI,MAAM,iBAAiB,CACnC,CAQA,SAA6B,CAC3B,OAAOK,EAAkB,mBAAmB,CAC1C,SACA,MAAO,KAAK,aAAa,CAC3B,CAAC,CACH,CAYA,UAAUC,EAA8B,CACtCA,EAAW,gBAAgB,KAAK,UAAU,EAC1CA,EAAW,YAAY,KAAK,kBAAkB,CAChD,CAQA,OAAO,YAAYC,EAAsC,CACvD,IAAMC,EAAOD,EAAa,kBAAkBH,CAAY,EAClDF,EAAqBK,EAAa,cAAc,EAEtD,OAAO,IAAIT,EAAS,CAAE,WAAYU,EAAM,mBAAAN,CAAmB,CAAC,CAC9D,CAWA,aAAaF,EAAsC,CACjD,GAAM,CAAE,KAAAS,CAAK,EAAIT,EAGXU,EAAiB,IACjBC,EAAS,IAAI,WAAW,CAAC,EAAG,EAAG,EAAG,CAAC,CAAC,EAGpCC,E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,KAAK,OAAST,EAGhB,IAAMc,EAAc,KAAK,OAAO,OAAO,CAACC,EAAK/B,IAAS+B,EAAMhC,EAASC,CAAI,EAAG,CAAC,EAC7E,GAAI8B,IAAgB,KAAK,WAAW,OAClC,MAAM,IAAI,MAAM,aAAaA,CAAW,wCAAwC,KAAK,WAAW,MAAM,EAAE,CAE5G,CAgBA,OAAO,aAAazB,EAAsC,CACxD,GAAM,CAAE,KAAAS,CAAK,EAAIT,EAGXU,EAAiB,IACjBC,EAAS,IAAI,WAAW,CAAC,EAAG,EAAG,EAAG,CAAC,CAAC,EAGpCC,EAAc,IAAI,IAExB,OAAAH,EAAK,QAASI,GAAgB,CAC5B,GAAIA,GAAOO,EAAkB,yBAC3B,MAAM,IAAI,MAAM,uCAAuCA,EAAkB,yBAA2B,CAAC,GAAG,EAG1G,GAAIR,EAAY,IAAIC,CAAG,EACrB,MAAM,IAAI,MAAM,0BAA0B,EAG5CD,EAAY,IAAIC,CAAG,EAEnB,IAAME,EAAa,KAAK,MAAMF,EAAM,CAAC,EAEjClB,EAAOgB,EAAOI,CAAU,EAG5BpB,GAAQe,GAAkBG,EAAM,EAEhCF,EAAOI,CAAU,EAAIpB,CACvB,CAAC,EAEMgB,CACT,CAIA,UAAUL,EAA8B,CAEtCA,EAAW,gBAAgB,KAAK,UAAU,EAC1CA,EAAW,eAAe,KAAK,MAAM,CACvC,CAEA,OAAO,YAAYC,EAA+C,CAChE,IAAMe,EAAaf,EAAa,kBAAkBiB,CAAY,EACxDb,EAASJ,EAAa,iBAAiB,EAC7C,OAAO,IAAIa,EAAkB,CAAE,WAAAE,EAAY,OAAAX,CAAO,CAAC,CACrD,CAGF,EA3HaS,EAIJ,WAAqB,EAJjBA,EASJ,yBAA2BA,EAAkB,WAAa,EAT5D,IAAMO,EAANP","names":["bitCount","byte","n","MultiKey","_MultiKey","AccountPublicKey","args","publicKeys","signaturesRequired","publicKey","AnyPublicKey","AuthenticationKey","serializer","deserializer","keys","bits","firstBitInByte","bitmap","dupCheckSet","bit","idx","byteOffset","anyPublicKey","index","pk","value","_MultiKeySignature","Signature","signatures","signature","AnySignature","nSignatures","acc","MultiKeySignature"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/core/crypto/federatedKeyless.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { AccountPublicKey, PublicKey } from \"./publicKey\";\nimport { Deserializer, Serializer } from \"../../bcs\";\nimport { HexInput, AnyPublicKeyVariant, SigningScheme } from \"../../types\";\nimport { AuthenticationKey } from \"../authenticationKey\";\nimport { AccountAddress, AccountAddressInput } from \"../accountAddress\";\nimport { KeylessPublicKey, KeylessSignature } from \"./keyless\";\n\n/**\n * Represents the FederatedKeylessPublicKey public key\n *\n * These keys use an on-chain address as a source of truth for the JWK used to verify signatures.\n *\n * FederatedKeylessPublicKey authentication key is represented in the SDK as `AnyPublicKey`.\n */\nexport class FederatedKeylessPublicKey extends AccountPublicKey {\n /**\n * The address that contains the JWK set to be used for verification.\n */\n readonly jwkAddress: AccountAddress;\n\n /**\n * The inner public key which contains the standard Keyless public key.\n */\n readonly keylessPublicKey: KeylessPublicKey;\n\n constructor(jwkAddress: AccountAddressInput, keylessPublicKey: KeylessPublicKey) {\n super();\n this.jwkAddress = AccountAddress.from(jwkAddress);\n this.keylessPublicKey = keylessPublicKey;\n }\n\n /**\n * Get the authentication key for the federated keyless public key\n *\n * @returns AuthenticationKey\n */\n authKey(): AuthenticationKey {\n const serializer = new Serializer();\n serializer.serializeU32AsUleb128(AnyPublicKeyVariant.FederatedKeyless);\n serializer.serializeFixedBytes(this.bcsToBytes());\n return AuthenticationKey.fromSchemeAndBytes({\n scheme: SigningScheme.SingleKey,\n input: serializer.toUint8Array(),\n });\n }\n\n /**\n * Verifies a signed data with a public key\n *\n * @param args.message message\n * @param args.signature The signature\n * @returns true if the signature is valid\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars, class-methods-use-this\n verifySignature(args: { message: HexInput; signature: KeylessSignature }): boolean {\n throw new Error(\"Not yet implemented\");\n }\n\n serialize(serializer: Serializer): void {\n this.jwkAddress.serialize(serializer);\n this.keylessPublicKey.serialize(serializer);\n }\n\n static deserialize(deserializer: Deserializer): FederatedKeylessPublicKey {\n const jwkAddress = AccountAddress.deserialize(deserializer);\n const keylessPublicKey = KeylessPublicKey.deserialize(deserializer);\n return new FederatedKeylessPublicKey(jwkAddress, keylessPublicKey);\n }\n\n static isPublicKey(publicKey: PublicKey): publicKey is FederatedKeylessPublicKey {\n return publicKey instanceof FederatedKeylessPublicKey;\n }\n\n /**\n * Creates a FederatedKeylessPublicKey from the JWT components plus pepper\n *\n * @param args.iss the iss of the identity\n * @param args.uidKey the key to use to get the uidVal in the JWT token\n * @param args.uidVal the value of the uidKey in the JWT token\n * @param args.aud the client ID of the application\n * @param args.pepper The pepper used to maintain privacy of the account\n * @returns FederatedKeylessPublicKey\n */\n static create(args: {\n iss: string;\n uidKey: string;\n uidVal: string;\n aud: string;\n pepper: HexInput;\n jwkAddress: AccountAddressInput;\n }): FederatedKeylessPublicKey {\n return new FederatedKeylessPublicKey(args.jwkAddress, KeylessPublicKey.create(args));\n }\n\n static fromJwtAndPepper(args: {\n jwt: string;\n pepper: HexInput;\n jwkAddress: AccountAddressInput;\n uidKey?: string;\n }): FederatedKeylessPublicKey {\n return new FederatedKeylessPublicKey(args.jwkAddress, KeylessPublicKey.fromJwtAndPepper(args));\n }\n\n static isInstance(publicKey: PublicKey) {\n return (\n \"jwkAddress\" in publicKey &&\n publicKey.jwkAddress instanceof AccountAddress &&\n \"keylessPublicKey\" in publicKey &&\n publicKey.keylessPublicKey instanceof KeylessPublicKey\n );\n }\n}\n"],"mappings":"6MAiBO,IAAMA,EAAN,MAAMC,UAAkCC,CAAiB,CAW9D,YAAYC,EAAiCC,EAAoC,CAC/E,MAAM,EACN,KAAK,WAAaC,EAAe,KAAKF,CAAU,EAChD,KAAK,iBAAmBC,CAC1B,CAOA,SAA6B,CAC3B,IAAME,EAAa,IAAIC,EACvB,OAAAD,EAAW,uBAA0D,EACrEA,EAAW,oBAAoB,KAAK,WAAW,CAAC,EACzCE,EAAkB,mBAAmB,CAC1C,SACA,MAAOF,EAAW,aAAa,CACjC,CAAC,CACH,CAUA,gBAAgBG,EAAmE,CACjF,MAAM,IAAI,MAAM,qBAAqB,CACvC,CAEA,UAAUH,EAA8B,CACtC,KAAK,WAAW,UAAUA,CAAU,EACpC,KAAK,iBAAiB,UAAUA,CAAU,CAC5C,CAEA,OAAO,YAAYI,EAAuD,CACxE,IAAMP,EAAaE,EAAe,YAAYK,CAAY,EACpDN,EAAmBO,EAAiB,YAAYD,CAAY,EAClE,OAAO,IAAIT,EAA0BE,EAAYC,CAAgB,CACnE,CAEA,OAAO,YAAYQ,EAA8D,CAC/E,OAAOA,aAAqBX,CAC9B,CAYA,OAAO,OAAOQ,EAOgB,CAC5B,OAAO,IAAIR,EAA0BQ,EAAK,WAAYE,EAAiB,OAAOF,CAAI,CAAC,CACrF,CAEA,OAAO,iBAAiBA,EAKM,CAC5B,OAAO,IAAIR,EAA0BQ,EAAK,WAAYE,EAAiB,iBAAiBF,CAAI,CAAC,CAC/F,CAEA,OAAO,WAAWG,EAAsB,CACtC,MACE,eAAgBA,GAChBA,EAAU,sBAAsBP,GAChC,qBAAsBO,GACtBA,EAAU,4BAA4BD,CAE1C,CACF","names":["FederatedKeylessPublicKey","_FederatedKeylessPublicKey","AccountPublicKey","jwkAddress","keylessPublicKey","AccountAddress","serializer","Serializer","AuthenticationKey","args","deserializer","KeylessPublicKey","publicKey"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/api/object.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { AnyNumber, GetObjectDataQueryResponse, OrderByArg, PaginationArgs } from \"../types\";\nimport { AccountAddressInput } from \"../core\";\nimport { AptosConfig } from \"./aptosConfig\";\nimport { ProcessorType } from \"../utils\";\nimport { waitForIndexerOnVersion } from \"./utils\";\nimport { getObjectDataByObjectAddress } from \"../internal/object\";\n\n/**\n * A class to query all `Object` related queries on Aptos.\n */\nexport class AptosObject {\n /**\n * Creates an instance of the Aptos client with the provided configuration.\n * This allows interaction with the Aptos blockchain using the specified settings.\n *\n * @param config - The configuration settings for the Aptos client.\n * @param config.network - The network to connect to (e.g., mainnet, testnet).\n * @param config.nodeUrl - The URL of the Aptos node to connect to.\n * @param config.faucetUrl - The URL of the faucet for funding accounts (optional).\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * async function runExample() {\n * // Create a configuration for the Aptos client\n * const config = new AptosConfig({\n * network: Network.TESTNET, // Specify the desired network\n * nodeUrl: \"https://testnet.aptos.dev\", // Replace with your node URL\n * });\n *\n * // Create an instance of the Aptos client\n * const aptos = new Aptos(config);\n *\n * console.log(\"Aptos client created successfully\", aptos);\n * }\n * runExample().catch(console.error);\n * ```\n */\n constructor(readonly config: AptosConfig) {}\n\n /**\n * Fetches the object data based on the specified object address.\n *\n * @param args.objectAddress - The object address to retrieve data for.\n * @param args.minimumLedgerVersion - Optional minimum ledger version to wait for.\n * @param args.options - Optional configuration options for pagination and ordering.\n *\n * @returns The object data corresponding to the provided address.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Fetching object data by object address\n * const objectData = await aptos.getObjectDataByObjectAddress({\n * objectAddress: \"0x1\", // replace with a real object address\n * });\n *\n * console.log(objectData);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async getObjectDataByObjectAddress(args: {\n objectAddress: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n options?: PaginationArgs & OrderByArg<GetObjectDataQueryResponse[0]>;\n }): Promise<GetObjectDataQueryResponse[0]> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.OBJECT_PROCESSOR,\n });\n return getObjectDataByObjectAddress({\n aptosConfig: this.config,\n ...args,\n });\n }\n}\n"],"mappings":"kFAaO,IAAMA,EAAN,KAAkB,CA6BvB,YAAqBC,EAAqB,CAArB,YAAAA,CAAsB,CA6B3C,MAAM,6BAA6BC,EAIQ,CACzC,aAAMC,EAAwB,CAC5B,OAAQ,KAAK,OACb,qBAAsBD,EAAK,qBAC3B,iCACF,CAAC,EACME,EAA6B,CAClC,YAAa,KAAK,OAClB,GAAGF,CACL,CAAC,CACH,CACF","names":["AptosObject","config","args","waitForIndexerOnVersion","getObjectDataByObjectAddress"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/api/digitalAsset.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n AnyNumber,\n GetCollectionDataResponse,\n GetCurrentTokenOwnershipResponse,\n GetOwnedTokensResponse,\n GetTokenActivityResponse,\n GetTokenDataResponse,\n MoveStructId,\n OrderByArg,\n PaginationArgs,\n TokenStandardArg,\n} from \"../types\";\nimport { AccountAddress, AccountAddressInput } from \"../core\";\nimport { Account } from \"../account\";\nimport { InputGenerateTransactionOptions } from \"../transactions/types\";\nimport {\n addDigitalAssetPropertyTransaction,\n addDigitalAssetTypedPropertyTransaction,\n burnDigitalAssetTransaction,\n CreateCollectionOptions,\n createCollectionTransaction,\n freezeDigitalAssetTransferTransaction,\n getCollectionData,\n getCollectionDataByCollectionId,\n getCollectionDataByCreatorAddress,\n getCollectionDataByCreatorAddressAndCollectionName,\n getCollectionId,\n getCurrentDigitalAssetOwnership,\n getDigitalAssetActivity,\n getDigitalAssetData,\n getOwnedDigitalAssets,\n mintDigitalAssetTransaction,\n mintSoulBoundTransaction,\n PropertyType,\n PropertyValue,\n removeDigitalAssetPropertyTransaction,\n setDigitalAssetDescriptionTransaction,\n setDigitalAssetNameTransaction,\n setDigitalAssetURITransaction,\n transferDigitalAssetTransaction,\n unfreezeDigitalAssetTransferTransaction,\n updateDigitalAssetPropertyTransaction,\n updateDigitalAssetTypedPropertyTransaction,\n} from \"../internal/digitalAsset\";\nimport { ProcessorType } from \"../utils/const\";\nimport { AptosConfig } from \"./aptosConfig\";\nimport { waitForIndexerOnVersion } from \"./utils\";\nimport { SimpleTransaction } from \"../transactions/instances/simpleTransaction\";\n\n/**\n * A class to query all `DigitalAsset` related queries on Aptos.\n */\nexport class DigitalAsset {\n /**\n * Initializes a new instance of the Aptos client with the specified configuration.\n * This allows you to interact with the Aptos blockchain using the provided settings.\n *\n * @param config - The configuration settings for the Aptos client.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * async function runExample() {\n * // Create a configuration for the Aptos client\n * const config = new AptosConfig({ network: Network.TESTNET }); // Specify your desired network\n *\n * // Initialize the Aptos client with the configuration\n * const aptos = new Aptos(config);\n *\n * console.log(\"Aptos client initialized:\", aptos);\n * }\n * runExample().catch(console.error);\n * ```\n */\n constructor(readonly config: AptosConfig) {}\n\n /**\n * Queries data of a specific collection by the collection creator address and the collection name.\n * This function is deprecated; use `getCollectionDataByCreatorAddressAndCollectionName` instead.\n *\n * If a creator account has two collections with the same name in v1 and v2, you can pass an optional `tokenStandard` parameter\n * to query a specific standard.\n *\n * @param args - The arguments for querying the collection data.\n * @param args.creatorAddress - The address of the collection's creator.\n * @param args.collectionName - The name of the collection.\n * @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.\n * @param args.options - Optional parameters for the query.\n * @param args.options.tokenStandard - The token standard to query.\n * @returns GetCollectionDataResponse - The response type containing the collection data.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Querying collection data by creator address and collection name\n * const collection = await aptos.getCollectionData({\n * creatorAddress: \"0x1\", // replace with a real creator address\n * collectionName: \"myCollection\", // specify your collection name\n * });\n *\n * console.log(collection);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async getCollectionData(args: {\n creatorAddress: AccountAddressInput;\n collectionName: string;\n minimumLedgerVersion?: AnyNumber;\n options?: TokenStandardArg;\n }): Promise<GetCollectionDataResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.TOKEN_V2_PROCESSOR,\n });\n\n const { creatorAddress, collectionName, options } = args;\n const address = AccountAddress.from(creatorAddress);\n\n const whereCondition: any = {\n collection_name: { _eq: collectionName },\n creator_address: { _eq: address.toStringLong() },\n };\n if (options?.tokenStandard) {\n whereCondition.token_standard = { _eq: options?.tokenStandard ?? \"v2\" };\n }\n\n return getCollectionData({ aptosConfig: this.config, options: { where: whereCondition } });\n }\n\n /**\n * Queries data of a specific collection by the collection creator address and the collection name.\n * If a creator account has multiple collections with the same name across different versions,\n * specify the `tokenStandard` parameter to query a specific standard.\n *\n * @param args.creatorAddress - The address of the collection's creator.\n * @param args.collectionName - The name of the collection.\n * @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.\n * @param args.options.tokenStandard - Optional token standard to query.\n * @returns GetCollectionDataResponse - The response type containing collection data.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Fetching collection data by creator address and collection name\n * const collection = await aptos.getCollectionDataByCreatorAddressAndCollectionName({\n * creatorAddress: \"0x1\", // replace with a real creator address\n * collectionName: \"myCollection\",\n * minimumLedgerVersion: 1, // optional, specify if needed\n * options: { tokenStandard: \"v2\" } // optional, specify if needed\n * });\n *\n * console.log(collection);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async getCollectionDataByCreatorAddressAndCollectionName(args: {\n creatorAddress: AccountAddressInput;\n collectionName: string;\n minimumLedgerVersion?: AnyNumber;\n options?: TokenStandardArg & PaginationArgs;\n }): Promise<GetCollectionDataResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.TOKEN_V2_PROCESSOR,\n });\n\n return getCollectionDataByCreatorAddressAndCollectionName({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Retrieves data for a specific collection created by a given creator address.\n * This function allows you to query collection data while optionally specifying a minimum ledger version and pagination options.\n *\n * @param args.creatorAddress - The address of the collection's creator.\n * @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.\n * @param args.options.tokenStandard - Optional token standard to query.\n * @param args.options.pagination - Optional pagination arguments.\n * @returns GetCollectionDataResponse - The response type containing collection data.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Retrieve collection data by creator address\n * const collectionData = await aptos.getCollectionDataByCreatorAddress({\n * creatorAddress: \"0x1\", // replace with a real creator address\n * minimumLedgerVersion: 1, // specify the minimum ledger version if needed\n * options: {\n * tokenStandard: \"v2\", // specify the token standard if needed\n * pagination: { limit: 10, offset: 0 } // specify pagination options if needed\n * }\n * });\n *\n * console.log(collectionData);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async getCollectionDataByCreatorAddress(args: {\n creatorAddress: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n options?: TokenStandardArg & PaginationArgs;\n }): Promise<GetCollectionDataResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.TOKEN_V2_PROCESSOR,\n });\n\n return getCollectionDataByCreatorAddress({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries data of a specific collection by the collection ID.\n *\n * @param args.collectionId - The ID of the collection, which is the same as the address of the collection object.\n * @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.\n * @param args.options - Optional parameters for token standard and pagination.\n * @returns GetCollectionDataResponse - The response type containing the collection data.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Fetching collection data by collection ID\n * const collection = await aptos.getCollectionDataByCollectionId({\n * collectionId: \"0x123\", // replace with a real collection ID\n * });\n *\n * console.log(collection);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async getCollectionDataByCollectionId(args: {\n collectionId: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n options?: TokenStandardArg & PaginationArgs;\n }): Promise<GetCollectionDataResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.TOKEN_V2_PROCESSOR,\n });\n return getCollectionDataByCollectionId({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries the ID of a specified collection.\n * This ID corresponds to the collection's object address in V2, while V1 does not utilize objects and lacks an address.\n *\n * @param args.creatorAddress - The address of the collection's creator.\n * @param args.collectionName - The name of the collection.\n * @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.\n * @param args.options.tokenStandard - The token standard to query.\n * @returns The collection ID.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Fetching the collection ID for a specific creator and collection name\n * const collectionId = await aptos.getCollectionId({\n * creatorAddress: \"0x1\", // replace with a real creator address\n * collectionName: \"myCollection\"\n * });\n *\n * console.log(\"Collection ID:\", collectionId);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async getCollectionId(args: {\n creatorAddress: AccountAddressInput;\n collectionName: string;\n minimumLedgerVersion?: AnyNumber;\n options?: TokenStandardArg;\n }): Promise<string> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.TOKEN_V2_PROCESSOR,\n });\n return getCollectionId({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Retrieves digital asset data using the address of a digital asset.\n *\n * @param args - The parameters for the request.\n * @param args.digitalAssetAddress - The address of the digital asset.\n * @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.\n * @returns GetTokenDataResponse containing relevant data for the digital asset.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Fetching digital asset data for a specific address\n * const digitalAsset = await aptos.getDigitalAssetData({\n * digitalAssetAddress: \"0x123\", // replace with a real digital asset address\n * });\n *\n * console.log(digitalAsset);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async getDigitalAssetData(args: {\n digitalAssetAddress: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n }): Promise<GetTokenDataResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.TOKEN_V2_PROCESSOR,\n });\n return getDigitalAssetData({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Retrieves the current ownership data of a specified digital asset using its address.\n *\n * @param args The parameters for the request.\n * @param args.digitalAssetAddress The address of the digital asset.\n * @param args.minimumLedgerVersion Optional ledger version to sync up to before querying.\n *\n * @returns GetCurrentTokenOwnershipResponse containing relevant ownership data of the digital asset.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Getting the current ownership of a digital asset\n * const digitalAssetOwner = await aptos.getCurrentDigitalAssetOwnership({\n * digitalAssetAddress: \"0x123\", // replace with a real digital asset address\n * });\n *\n * console.log(digitalAssetOwner);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async getCurrentDigitalAssetOwnership(args: {\n digitalAssetAddress: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n }): Promise<GetCurrentTokenOwnershipResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.TOKEN_V2_PROCESSOR,\n });\n return getCurrentDigitalAssetOwnership({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Retrieves the digital assets owned by a specified address.\n *\n * @param args.ownerAddress The address of the owner.\n * @param args.minimumLedgerVersion Optional ledger version to sync up to before querying.\n * @param args.options Optional pagination and ordering parameters for the response.\n *\n * @returns GetOwnedTokensResponse containing ownership data of the digital assets belonging to the ownerAddress.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Fetching the digital assets owned by the specified address\n * const digitalAssets = await aptos.getOwnedDigitalAssets({\n * ownerAddress: \"0x1\", // replace with a real account address\n * });\n *\n * console.log(digitalAssets);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async getOwnedDigitalAssets(args: {\n ownerAddress: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n options?: PaginationArgs & OrderByArg<GetOwnedTokensResponse[0]>;\n }): Promise<GetOwnedTokensResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.TOKEN_V2_PROCESSOR,\n });\n return getOwnedDigitalAssets({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Retrieves the activity data for a specified digital asset using its address.\n *\n * @param args - The parameters for the request.\n * @param args.digitalAssetAddress - The address of the digital asset.\n * @param args.minimumLedgerVersion - Optional minimum ledger version to sync up to before querying.\n * @param args.options - Optional pagination and ordering parameters.\n *\n * @returns A promise that resolves to the activity data related to the digital asset.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Get the activity data for a digital asset\n * const digitalAssetActivity = await aptos.getDigitalAssetActivity({\n * digitalAssetAddress: \"0x123\", // replace with a real digital asset address\n * });\n *\n * console.log(digitalAssetActivity);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async getDigitalAssetActivity(args: {\n digitalAssetAddress: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n options?: PaginationArgs & OrderByArg<GetTokenActivityResponse[0]>;\n }): Promise<GetTokenActivityResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.TOKEN_V2_PROCESSOR,\n });\n return getDigitalAssetActivity({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Creates a new collection within the specified account.\n *\n * @param args.creator - The account of the collection's creator.\n * @param args.description - The description of the collection.\n * @param args.name - The name of the collection.\n * @param args.uri - The URI to additional info about the collection.\n * @param args.options - Optional parameters for generating the transaction.\n *\n * The parameters below are optional:\n * @param args.maxSupply - Controls the max supply of the digital assets. Defaults to MAX_U64_BIG_INT.\n * @param args.mutableDescription - Controls mutability of the collection's description. Defaults to true.\n * @param args.mutableRoyalty - Controls mutability of the collection's royalty. Defaults to true.\n * @param args.mutableUri - Controls mutability of the collection's URI. Defaults to true.\n * @param args.mutableTokenDescription - Controls mutability of the digital asset's description. Defaults to true.\n * @param args.mutableTokenName - Controls mutability of the digital asset's name. Defaults to true.\n * @param args.mutableTokenProperties - Controls mutability of digital asset's properties. Defaults to true.\n * @param args.mutableTokenUri - Controls mutability of the digital asset's URI. Defaults to true.\n * @param args.tokensBurnableByCreator - Controls whether digital assets can be burnable by the creator. Defaults to true.\n * @param args.tokensFreezableByCreator - Controls whether digital assets can be frozen by the creator. Defaults to true.\n * @param args.royaltyNumerator - The numerator of the royalty to be paid to the creator when a digital asset is transferred.\n * Defaults to 0.\n * @param args.royaltyDenominator - The denominator of the royalty to be paid to the creator when a digital asset is\n * transferred. Defaults to 1.\n *\n * @returns A SimpleTransaction that when submitted will create the collection.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Creating a new collection transaction\n * const transaction = await aptos.createCollectionTransaction({\n * creator: Account.generate(), // Replace with a real account\n * description: \"A unique collection of digital assets.\",\n * name: \"My Digital Collection\",\n * uri: \"https://mycollection.com\",\n * });\n *\n * console.log(\"Transaction created:\", transaction);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async createCollectionTransaction(\n args: {\n creator: Account;\n description: string;\n name: string;\n uri: string;\n options?: InputGenerateTransactionOptions;\n } & CreateCollectionOptions,\n ): Promise<SimpleTransaction> {\n return createCollectionTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Create a transaction to mint a digital asset into the creator's account within an existing collection.\n * This function helps you generate a transaction that can be simulated or submitted to the blockchain for minting a digital asset.\n *\n * @param args.creator - The creator of the collection.\n * @param args.collection - The name of the collection the digital asset belongs to.\n * @param args.description - The description of the digital asset.\n * @param args.name - The name of the digital asset.\n * @param args.uri - The URI to additional info about the digital asset.\n * @param args.propertyKeys - Optional array of property keys for the digital asset.\n * @param args.propertyTypes - Optional array of property types for the digital asset.\n * @param args.propertyValues - Optional array of property values for the digital asset.\n * @param args.options - Optional transaction generation options.\n *\n * @returns A SimpleTransaction that can be simulated or submitted to the chain.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Creating a transaction to mint a digital asset\n * const transaction = await aptos.mintDigitalAssetTransaction({\n * creator: Account.generate(), // replace with a real account\n * collection: \"MyCollection\",\n * description: \"This is a digital asset.\",\n * name: \"MyDigitalAsset\",\n * uri: \"https://example.com/my-digital-asset\",\n * });\n *\n * console.log(transaction);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async mintDigitalAssetTransaction(args: {\n creator: Account;\n collection: string;\n description: string;\n name: string;\n uri: string;\n propertyKeys?: Array<string>;\n propertyTypes?: Array<PropertyType>;\n propertyValues?: Array<PropertyValue>;\n options?: InputGenerateTransactionOptions;\n }): Promise<SimpleTransaction> {\n return mintDigitalAssetTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Transfer ownership of a non-fungible digital asset.\n * This function allows you to transfer a digital asset only if it is not frozen, meaning the ownership transfer is not disabled.\n *\n * @param args The arguments for transferring the digital asset.\n * @param args.sender The sender account of the current digital asset owner.\n * @param args.digitalAssetAddress The address of the digital asset being transferred.\n * @param args.recipient The account address of the recipient.\n * @param args.digitalAssetType Optional. The type of the digital asset, defaults to \"0x4::token::Token\".\n * @param args.options Optional. Additional options for generating the transaction.\n *\n * @returns A SimpleTransaction that can be simulated or submitted to the chain.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Transfer a digital asset\n * const transaction = await aptos.transferDigitalAssetTransaction({\n * sender: Account.generate(), // replace with a real sender account\n * digitalAssetAddress: \"0x123\", // replace with a real digital asset address\n * recipient: \"0x456\", // replace with a real recipient account address\n * });\n *\n * console.log(transaction);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async transferDigitalAssetTransaction(args: {\n sender: Account;\n digitalAssetAddress: AccountAddressInput;\n recipient: AccountAddress;\n digitalAssetType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }): Promise<SimpleTransaction> {\n return transferDigitalAssetTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Mint a soul bound digital asset into a recipient's account.\n * This function allows you to create a unique digital asset that is bound to a specific account.\n *\n * @param args - The arguments for minting the soul bound transaction.\n * @param args.account - The account that mints the digital asset.\n * @param args.collection - The collection name that the digital asset belongs to.\n * @param args.description - The digital asset description.\n * @param args.name - The digital asset name.\n * @param args.uri - The digital asset URL.\n * @param args.recipient - The account address where the digital asset will be created.\n * @param args.propertyKeys - The property keys for storing on-chain properties.\n * @param args.propertyTypes - The type of property values.\n * @param args.propertyValues - The property values to be stored on-chain.\n * @param args.options - Additional options for generating the transaction.\n *\n * @returns A SimpleTransaction that can be simulated or submitted to the chain.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Mint a soul bound digital asset\n * const transaction = await aptos.mintSoulBoundTransaction({\n * account: Account.generate(), // Replace with a real account\n * collection: \"collectionName\",\n * description: \"collectionDescription\",\n * name: \"digitalAssetName\",\n * uri: \"digital-asset-uri.com\",\n * recipient: \"0x123\" // Replace with a real recipient account address\n * });\n *\n * console.log(transaction);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async mintSoulBoundTransaction(args: {\n account: Account;\n collection: string;\n description: string;\n name: string;\n uri: string;\n recipient: AccountAddressInput;\n propertyKeys?: Array<string>;\n propertyTypes?: Array<PropertyType>;\n propertyValues?: Array<PropertyValue>;\n options?: InputGenerateTransactionOptions;\n }): Promise<SimpleTransaction> {\n return mintSoulBoundTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Burn a digital asset by its creator, allowing for the removal of a specified digital asset from the blockchain.\n *\n * @param args The arguments for burning the digital asset.\n * @param args.creator The creator account that is burning the digital asset.\n * @param args.digitalAssetAddress The address of the digital asset to be burned.\n * @param args.digitalAssetType Optional. The type of the digital asset being burned.\n * @param args.options Optional. Additional options for generating the transaction.\n *\n * @returns A SimpleTransaction that can be simulated or submitted to the chain.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network, Account } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * const creator = Account.generate(); // Replace with a real creator account\n * const transaction = await aptos.burnDigitalAssetTransaction({\n * creator: creator,\n * digitalAssetAddress: \"0x123\", // Replace with a real digital asset address\n * });\n *\n * console.log(transaction);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async burnDigitalAssetTransaction(args: {\n creator: Account;\n digitalAssetAddress: AccountAddressInput;\n digitalAssetType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }) {\n return burnDigitalAssetTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Freeze the ability to transfer a specified digital asset.\n * This function allows the creator to restrict the transfer capability of a digital asset.\n *\n * @param args The arguments for freezing the digital asset transfer.\n * @param args.creator The creator account initiating the freeze.\n * @param args.digitalAssetAddress The address of the digital asset to be frozen.\n * @param args.digitalAssetType Optional. The type of the digital asset being frozen.\n * @param args.options Optional. Additional options for generating the transaction.\n *\n * @returns A SimpleTransaction that can be simulated or submitted to the chain.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Freeze the digital asset transfer\n * const transaction = await aptos.freezeDigitalAssetTransaferTransaction({\n * creator: Account.generate(), // Replace with a real account if needed\n * digitalAssetAddress: \"0x123\", // Replace with a real digital asset address\n * });\n *\n * console.log(transaction);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async freezeDigitalAssetTransaferTransaction(args: {\n creator: Account;\n digitalAssetAddress: AccountAddressInput;\n digitalAssetType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }) {\n return freezeDigitalAssetTransferTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Unfreeze the ability to transfer a digital asset.\n * This function allows the specified creator account to unfreeze the transfer of a digital asset identified by its address.\n *\n * @param args The parameters for unfreezing the digital asset transfer.\n * @param args.creator The creator account that is unfreezing the digital asset transfer.\n * @param args.digitalAssetAddress The address of the digital asset to unfreeze.\n * @param args.digitalAssetType Optional. The type of the digital asset being unfrozen.\n * @param args.options Optional. Additional options for generating the transaction.\n *\n * @returns A SimpleTransaction that can be simulated or submitted to the chain.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Unfreeze the ability to transfer a digital asset\n * const transaction = await aptos.unfreezeDigitalAssetTransaferTransaction({\n * creator: Account.generate(), // replace with a real creator account\n * digitalAssetAddress: \"0x123\", // replace with a real digital asset address\n * });\n *\n * console.log(transaction);\n * }\n * runExample().catch(console.error);\n * ```\n */\n // TODO: Rename Transafer to Transfer\n async unfreezeDigitalAssetTransaferTransaction(args: {\n creator: Account;\n digitalAssetAddress: AccountAddressInput;\n digitalAssetType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }) {\n return unfreezeDigitalAssetTransferTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Set the digital asset description to provide additional context or information about the asset.\n *\n * @param args The parameters for setting the digital asset description.\n * @param args.creator The creator account responsible for the digital asset.\n * @param args.description The digital asset description to be set.\n * @param args.digitalAssetAddress The address of the digital asset.\n * @param args.digitalAssetType Optional. The type of the digital asset.\n * @param args.options Optional. Additional options for generating the transaction.\n *\n * @returns A SimpleTransaction that can be simulated or submitted to the chain.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Set the digital asset description\n * const transaction = await aptos.setDigitalAssetDescriptionTransaction({\n * creator: Account.generate(), // replace with a real account\n * description: \"This is a digital asset description.\",\n * digitalAssetAddress: \"0x123\", // replace with a real digital asset address\n * });\n *\n * console.log(transaction);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async setDigitalAssetDescriptionTransaction(args: {\n creator: Account;\n description: string;\n digitalAssetAddress: AccountAddressInput;\n digitalAssetType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }) {\n return setDigitalAssetDescriptionTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Set the digital asset name, allowing you to define a name for a specific digital asset on the blockchain.\n *\n * @param args The parameters for setting the digital asset name.\n * @param args.creator The creator account responsible for the transaction.\n * @param args.name The desired name for the digital asset.\n * @param args.digitalAssetAddress The address of the digital asset.\n * @param args.digitalAssetType Optional. The type of the digital asset, represented as a Move struct ID.\n * @param args.options Optional. Additional options for generating the transaction.\n *\n * @returns A SimpleTransaction that can be simulated or submitted to the blockchain.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network, Account } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * const creator = Account.generate(); // Generate a new account for the creator\n * const digitalAssetAddress = \"0x123\"; // replace with a real digital asset address\n *\n * // Set the digital asset name\n * const transaction = await aptos.setDigitalAssetNameTransaction({\n * creator: creator,\n * name: \"digitalAssetName\",\n * digitalAssetAddress: digitalAssetAddress,\n * });\n *\n * console.log(transaction);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async setDigitalAssetNameTransaction(args: {\n creator: Account;\n name: string;\n digitalAssetAddress: AccountAddressInput;\n digitalAssetType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }) {\n return setDigitalAssetNameTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Set the URI for a digital asset, allowing you to associate a unique identifier with the asset.\n *\n * @param args The parameters for the transaction.\n * @param args.creator The creator account initiating the transaction.\n * @param args.uri The digital asset URI to be set.\n * @param args.digitalAssetAddress The address of the digital asset.\n * @param args.digitalAssetType Optional. The type of the digital asset.\n * @param args.options Optional. Additional options for generating the transaction.\n * @returns A SimpleTransaction that can be simulated or submitted to the chain.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Set the URI for a digital asset\n * const transaction = await aptos.setDigitalAssetURITransaction({\n * creator: Account.generate(), // Replace with a real creator account\n * uri: \"digital-asset-uri.com\",\n * digitalAssetAddress: \"0x123\", // Replace with a real digital asset address\n * });\n *\n * console.log(transaction);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async setDigitalAssetURITransaction(args: {\n creator: Account;\n uri: string;\n digitalAssetAddress: AccountAddressInput;\n digitalAssetType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }) {\n return setDigitalAssetURITransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Add a digital asset property to the blockchain.\n * This function allows you to specify a new property for a digital asset, including its key, type, and value.\n *\n * @param args - The arguments for adding a digital asset property.\n * @param args.creator - The account that mints the digital asset.\n * @param args.propertyKey - The property key for storing on-chain properties.\n * @param args.propertyType - The type of property value.\n * @param args.propertyValue - The property value to be stored on-chain.\n * @param args.digitalAssetAddress - The digital asset address.\n * @param args.digitalAssetType - (Optional) The type of the digital asset.\n * @param args.options - (Optional) Options for generating the transaction.\n * @returns A SimpleTransaction that can be simulated or submitted to the chain.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Add a digital asset property\n * const transaction = await aptos.addDigitalAssetPropertyTransaction({\n * creator: Account.generate(), // Replace with a real account\n * propertyKey: \"newKey\",\n * propertyType: \"BOOLEAN\",\n * propertyValue: true,\n * digitalAssetAddress: \"0x123\", // Replace with a real digital asset address\n * });\n *\n * console.log(transaction);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async addDigitalAssetPropertyTransaction(args: {\n creator: Account;\n propertyKey: string;\n propertyType: PropertyType;\n propertyValue: PropertyValue;\n digitalAssetAddress: AccountAddressInput;\n digitalAssetType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }) {\n return addDigitalAssetPropertyTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Remove a digital asset property from the blockchain.\n * This function allows you to delete an existing property associated with a digital asset.\n *\n * @param args The parameters required to remove the digital asset property.\n * @param args.creator The account that mints the digital asset.\n * @param args.propertyKey The property key for storing on-chain properties.\n * @param args.propertyType The type of property value.\n * @param args.propertyValue The property value to be stored on-chain.\n * @param args.digitalAssetAddress The digital asset address.\n * @param args.digitalAssetType Optional. The type of the digital asset.\n * @param args.options Optional. Additional options for generating the transaction.\n *\n * @returns A SimpleTransaction that can be simulated or submitted to the chain.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Remove a digital asset property\n * const transaction = await aptos.removeDigitalAssetPropertyTransaction({\n * creator: Account.generate(), // replace with a real account\n * propertyKey: \"newKey\",\n * propertyType: \"BOOLEAN\",\n * propertyValue: true,\n * digitalAssetAddress: \"0x123\", // replace with a real digital asset address\n * });\n *\n * console.log(transaction);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async removeDigitalAssetPropertyTransaction(args: {\n creator: Account;\n propertyKey: string;\n propertyType: PropertyType;\n propertyValue: PropertyValue;\n digitalAssetAddress: AccountAddressInput;\n digitalAssetType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }) {\n return removeDigitalAssetPropertyTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Update a digital asset property on-chain.\n *\n * @param args The parameters for updating the digital asset property.\n * @param args.creator The account that mints the digital asset.\n * @param args.digitalAssetAddress The address of the digital asset.\n * @param args.propertyKey The property key for storing on-chain properties.\n * @param args.propertyType The type of property value.\n * @param args.propertyValue The property value to be stored on-chain.\n * @param args.digitalAssetType Optional. The type of the digital asset.\n * @param args.options Optional. Additional options for generating the transaction.\n *\n * @returns A SimpleTransaction that can be simulated or submitted to the chain.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Update a digital asset property\n * const transaction = await aptos.updateDigitalAssetPropertyTransaction({\n * creator: Account.generate(), // replace with a real account\n * propertyKey: \"newKey\",\n * propertyType: \"BOOLEAN\",\n * propertyValue: false,\n * digitalAssetAddress: \"0x123\", // replace with a real digital asset address\n * });\n *\n * console.log(transaction);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async updateDigitalAssetPropertyTransaction(args: {\n creator: Account;\n propertyKey: string;\n propertyType: PropertyType;\n propertyValue: PropertyValue;\n digitalAssetAddress: AccountAddressInput;\n digitalAssetType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }) {\n return updateDigitalAssetPropertyTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Add a typed digital asset property to the blockchain.\n * This function allows you to define and store a specific property for a digital asset, enabling better categorization and\n * management of digital assets.\n *\n * @param args - The parameters for adding the typed property.\n * @param args.creator - The account that mints the digital asset.\n * @param args.propertyKey - The property key for storing on-chain properties.\n * @param args.propertyType - The type of property value.\n * @param args.propertyValue - The property value to be stored on-chain.\n * @param args.digitalAssetAddress - The digital asset address.\n * @param args.digitalAssetType - The optional type of the digital asset.\n * @param args.options - Optional transaction generation options.\n *\n * @returns A SimpleTransaction that can be simulated or submitted to the chain.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Adding a typed digital asset property\n * const transaction = await aptos.addDigitalAssetTypedPropertyTransaction({\n * creator: Account.generate(), // replace with a real account\n * propertyKey: \"typedKey\",\n * propertyType: \"STRING\",\n * propertyValue: \"hello\",\n * digitalAssetAddress: \"0x123\", // replace with a real digital asset address\n * });\n *\n * console.log(transaction);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async addDigitalAssetTypedPropertyTransaction(args: {\n creator: Account;\n propertyKey: string;\n propertyType: PropertyType;\n propertyValue: PropertyValue;\n digitalAssetAddress: AccountAddressInput;\n digitalAssetType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }) {\n return addDigitalAssetTypedPropertyTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Update a typed digital asset property on-chain.\n * This function allows you to modify the properties of a digital asset, enabling dynamic updates to its attributes.\n *\n * @param args - The arguments for updating the digital asset property.\n * @param args.creator - The account that mints the digital asset.\n * @param args.propertyKey - The property key for storing on-chain properties.\n * @param args.propertyType - The type of property value.\n * @param args.propertyValue - The property value to be stored on-chain.\n * @param args.digitalAssetAddress - The digital asset address.\n * @param args.digitalAssetType - (Optional) The type of the digital asset.\n * @param args.options - (Optional) Additional options for generating the transaction.\n *\n * @returns A SimpleTransaction that can be simulated or submitted to the chain.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Update a typed digital asset property\n * const transaction = await aptos.updateDigitalAssetTypedPropertyTransaction({\n * creator: Account.generate(), // replace with a real account\n * propertyKey: \"typedKey\",\n * propertyType: \"U8\",\n * propertyValue: 2,\n * digitalAssetAddress: \"0x123\", // replace with a real digital asset address\n * });\n *\n * console.log(transaction);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async updateDigitalAssetTypedPropertyTransaction(args: {\n creator: Account;\n propertyKey: string;\n propertyType: PropertyType;\n propertyValue: PropertyValue;\n digitalAssetAddress: AccountAddressInput;\n digitalAssetType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }) {\n return updateDigitalAssetTypedPropertyTransaction({ aptosConfig: this.config, ...args });\n }\n}\n"],"mappings":"kRAuDO,IAAMA,EAAN,KAAmB,CAuBxB,YAAqBC,EAAqB,CAArB,YAAAA,CAAsB,CAoC3C,MAAM,kBAAkBC,EAKe,CACrC,MAAMC,EAAwB,CAC5B,OAAQ,KAAK,OACb,qBAAsBD,EAAK,qBAC3B,kCACF,CAAC,EAED,GAAM,CAAE,eAAAE,EAAgB,eAAAC,EAAgB,QAAAC,CAAQ,EAAIJ,EAC9CK,EAAUC,EAAe,KAAKJ,CAAc,EAE5CK,EAAsB,CAC1B,gBAAiB,CAAE,IAAKJ,CAAe,EACvC,gBAAiB,CAAE,IAAKE,EAAQ,aAAa,CAAE,CACjD,EACA,OAAID,GAAS,gBACXG,EAAe,eAAiB,CAAE,IAAKH,GAAS,eAAiB,IAAK,GAGjEI,EAAkB,CAAE,YAAa,KAAK,OAAQ,QAAS,CAAE,MAAOD,CAAe,CAAE,CAAC,CAC3F,CAkCA,MAAM,mDAAmDP,EAKlB,CACrC,aAAMC,EAAwB,CAC5B,OAAQ,KAAK,OACb,qBAAsBD,EAAK,qBAC3B,kCACF,CAAC,EAEMS,EAAmD,CAAE,YAAa,KAAK,OAAQ,GAAGT,CAAK,CAAC,CACjG,CAmCA,MAAM,kCAAkCA,EAID,CACrC,aAAMC,EAAwB,CAC5B,OAAQ,KAAK,OACb,qBAAsBD,EAAK,qBAC3B,kCACF,CAAC,EAEMU,EAAkC,CAAE,YAAa,KAAK,OAAQ,GAAGV,CAAK,CAAC,CAChF,CA4BA,MAAM,gCAAgCA,EAIC,CACrC,aAAMC,EAAwB,CAC5B,OAAQ,KAAK,OACb,qBAAsBD,EAAK,qBAC3B,kCACF,CAAC,EACMW,EAAgC,CAAE,YAAa,KAAK,OAAQ,GAAGX,CA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set","config","args","waitForIndexerOnVersion","creatorAddress","collectionName","options","address","AccountAddress","whereCondition","getCollectionData","getCollectionDataByCreatorAddressAndCollectionName","getCollectionDataByCreatorAddress","getCollectionDataByCollectionId","getCollectionId","getDigitalAssetData","getCurrentDigitalAssetOwnership","getOwnedDigitalAssets","getDigitalAssetActivity","createCollectionTransaction","mintDigitalAssetTransaction","transferDigitalAssetTransaction","mintSoulBoundTransaction","burnDigitalAssetTransaction","freezeDigitalAssetTransferTransaction","unfreezeDigitalAssetTransferTransaction","setDigitalAssetDescriptionTransaction","setDigitalAssetNameTransaction","setDigitalAssetURITransaction","addDigitalAssetPropertyTransaction","removeDigitalAssetPropertyTransaction","updateDigitalAssetPropertyTransaction","addDigitalAssetTypedPropertyTransaction","updateDigitalAssetTypedPropertyTransaction"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/api/transactionSubmission/simulate.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { PublicKey } from \"../../core\";\nimport { simulateTransaction } from \"../../internal/transactionSubmission\";\nimport { AnyRawTransaction, InputSimulateTransactionOptions } from \"../../transactions\";\nimport { UserTransactionResponse } from \"../../types\";\nimport { AptosConfig } from \"../aptosConfig\";\nimport { ValidateFeePayerDataOnSimulation } from \"./helpers\";\n\n/**\n * A class to handle all `Simulate` transaction operations.\n */\nexport class Simulate {\n readonly config: AptosConfig;\n\n /**\n * Initializes a new instance of the Aptos client with the specified configuration.\n * This allows you to interact with the Aptos blockchain using the provided settings.\n *\n * @param config - The configuration settings for the Aptos client.\n * @param config.network - The network to connect to (e.g., TESTNET, MAINNET).\n * @param config.nodeUrl - The URL of the Aptos node to connect to.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * async function runExample() {\n * // Create a configuration for the Aptos client\n * const config = new AptosConfig({ network: Network.TESTNET }); // Specify your desired network\n *\n * // Initialize the Aptos client with the configuration\n * const aptos = new Aptos(config);\n *\n * console.log(\"Aptos client initialized:\", aptos);\n * }\n * runExample().catch(console.error);\n * ```\n */\n constructor(config: AptosConfig) {\n this.config = config;\n }\n\n /**\n * Simulates a transaction based on the provided parameters and returns the result.\n * This function helps you understand the outcome of a transaction before executing it on the blockchain.\n *\n * @param args - The parameters for simulating the transaction.\n * @param args.signerPublicKey - The public key of the signer for the transaction (optional).\n * @param args.transaction - The raw transaction data to simulate.\n * @param args.feePayerPublicKey - The public key of the fee payer (optional).\n * @param args.options - Additional options for simulating the transaction (optional).\n *\n * @example\n * ```typescript\n * import {\n * Account,\n * Aptos,\n * AptosConfig,\n * Network,\n * } from \"@aptos-labs/ts-sdk\";\n *\n * async function example() {\n * let sender = Account.generate();\n * let receiver = Account.generate();\n *\n * // 0. Set up the client and test accounts\n * const config = new AptosConfig({ network: Network.DEVNET });\n * const aptos = new Aptos(config);\n *\n * await aptos.fundAccount({\n * accountAddress: sender.accountAddress,\n * amount: 100_000_000,\n * });\n *\n * // 1. Build the transaction to preview the impact of it\n * const transaction = await aptos.transaction.build.simple({\n * sender: sender.accountAddress,\n * data: {\n * // All transactions on Aptos are implemented via smart contracts.\n * function: \"0x1::aptos_account::transfer\",\n * functionArguments: [receiver.accountAddress, 100],\n * },\n * });\n *\n * // 2. Simulate to see what would happen if we execute this transaction\n * const [userTransactionResponse] = await aptos.transaction.simulate.simple({\n * signerPublicKey: sender.publicKey,\n * transaction,\n * });\n * console.log(userTransactionResponse);\n *\n * // If the fee looks ok, continue to signing!\n * // ...\n * }\n *\n * example();\n * ```\n */\n @ValidateFeePayerDataOnSimulation\n async simple(args: {\n signerPublicKey?: PublicKey;\n transaction: AnyRawTransaction;\n feePayerPublicKey?: PublicKey;\n options?: InputSimulateTransactionOptions;\n }): Promise<Array<UserTransactionResponse>> {\n return simulateTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Simulates a multi-agent transaction by generating a signed transaction and posting it to the Aptos full node.\n * This function helps in understanding the outcome of a transaction involving multiple signers before it is executed.\n *\n * @param args - The parameters for simulating the transaction.\n * @param args.signerPublicKey - The public key of the primary signer (optional).\n * @param args.transaction - The raw transaction to be simulated.\n * @param args.secondarySignersPublicKeys - An array of public keys for secondary signers (optional).\n * Each element of the array can be optional, allowing the corresponding key check to be skipped.\n * @param args.feePayerPublicKey - The public key of the fee payer (optional).\n * @param args.options - Options for simulating the transaction (optional).\n *\n * @example\n * ```typescript\n * import {\n * Account,\n * Aptos,\n * AptosConfig,\n * Network,\n * } from \"@aptos-labs/ts-sdk\";\n *\n * async function example() {\n * let sender1 = Account.generate();\n * let sender2 = Account.generate();\n * let receiver = Account.generate();\n *\n * // 0. Set up the client and test accounts\n * const config = new AptosConfig({ network: Network.DEVNET });\n * const aptos = new Aptos(config);\n *\n * await aptos.fundAccount({\n * accountAddress: sender.accountAddress,\n * amount: 100_000_000,\n * });\n *\n * // 1. Build\n * console.log(\"\\n=== 1. Building the transaction ===\\n\");\n * const transaction = await aptos.transaction.build.multiAgent({\n * sender: sender1.accountAddress,\n * secondarySignerAddresses: [sender2.accountAddress],\n * data: {\n * // REPLACE WITH YOUR MULTI-AGENT FUNCTION HERE\n * function:\n * \"<REPLACE WITH YOUR MULTI AGENT MOVE ENTRY FUNCTION> (Syntax {address}::{module}::{function})\",\n * functionArguments: [],\n * },\n * });\n * console.log(\"Transaction:\", transaction);\n *\n * // 2. Simulate (Optional)\n * console.log(\"\\n === 2. Simulating Response (Optional) === \\n\");\n * const [userTransactionResponse] = await aptos.transaction.simulate.multiAgent(\n * {\n * signerPublicKey: sender1.publicKey,\n * secondarySignersPublicKeys: [sender2.publicKey],\n * transaction,\n * },\n * );\n * console.log(userTransactionResponse);\n *\n * // If the fee looks ok, continue to signing!\n * // ...\n * }\n *\n * example();\n * ```\n */\n @ValidateFeePayerDataOnSimulation\n async multiAgent(args: {\n signerPublicKey?: PublicKey;\n transaction: AnyRawTransaction;\n secondarySignersPublicKeys?: Array<PublicKey | undefined>;\n feePayerPublicKey?: PublicKey;\n options?: InputSimulateTransactionOptions;\n }): Promise<Array<UserTransactionResponse>> {\n return simulateTransaction({ aptosConfig: this.config, ...args });\n }\n}\n"],"mappings":"2HAaO,IAAMA,EAAN,KAAe,CA2BpB,YAAYC,EAAqB,CAC/B,KAAK,OAASA,CAChB,CA2DA,MAAM,OAAOC,EAK+B,CAC1C,OAAOC,EAAoB,CAAE,YAAa,KAAK,OAAQ,GAAGD,CAAK,CAAC,CAClE,CAsEA,MAAM,WAAWA,EAM2B,CAC1C,OAAOC,EAAoB,CAAE,YAAa,KAAK,OAAQ,GAAGD,CAAK,CAAC,CAClE,CACF,EAtFQE,EAAA,CADLC,GAvFUL,EAwFL,sBA6EAI,EAAA,CADLC,GApKUL,EAqKL","names":["Simulate","config","args","simulateTransaction","__decorateClass","ValidateFeePayerDataOnSimulation"]}
@@ -1,2 +0,0 @@
1
- import{a}from"./chunk-AJ5JHBAE.mjs";var e=class extends a{};export{e as a};
2
- //# sourceMappingURL=chunk-UGTIALNW.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/utils/helpers.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { decode } from \"js-base64\";\nimport { MoveStructId } from \"../types\";\n\n/**\n * Sleep for the specified amount of time in milliseconds.\n * This function can be used to introduce delays in asynchronous operations.\n *\n * @param timeMs - The time in milliseconds to sleep.\n */\nexport async function sleep(timeMs: number): Promise<null> {\n return new Promise((resolve) => {\n setTimeout(resolve, timeMs);\n });\n}\n\n/**\n * Get the error message from an unknown error.\n *\n * @param error The error to get the message from\n * @returns The error message\n */\nexport function getErrorMessage(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n\nexport const nowInSeconds = () => Math.floor(Date.now() / 1000);\n\n/**\n * Floors the given timestamp to the nearest whole hour.\n * This function is useful for normalizing timestamps to hourly intervals.\n *\n * @param timestampInSeconds - The timestamp in seconds to be floored.\n */\nexport function floorToWholeHour(timestampInSeconds: number): number {\n const date = new Date(timestampInSeconds * 1000);\n // Reset minutes and seconds to zero\n date.setMinutes(0);\n date.setSeconds(0);\n date.setMilliseconds(0);\n return Math.floor(date.getTime() / 1000);\n}\n\n/**\n * Decodes a base64 URL-encoded string into its original form.\n * This function is useful for converting base64 URL-encoded data back to a readable format.\n *\n * @param base64Url - The base64 URL-encoded string to decode.\n * @returns The decoded string.\n */\nexport function base64UrlDecode(base64Url: string): string {\n // Replace base64url-specific characters\n const base64 = base64Url.replace(/-/g, \"+\").replace(/_/g, \"/\");\n // Pad the string with '=' characters if needed\n const paddedBase64 = base64 + \"==\".substring(0, (3 - (base64.length % 3)) % 3);\n const decodedString = decode(paddedBase64);\n return decodedString;\n}\n\n/**\n * Amount is represented in the smallest unit format on chain, this function converts\n * a human-readable amount format to the smallest unit format\n * @example\n * human-readable amount format: 500\n * on chain amount format when decimal is 8: 50000000000\n *\n * @param value The value in human-readable format\n * @param decimal The token decimal\n * @returns The value in the smallest units\n */\nexport const convertAmountFromHumanReadableToOnChain = (value: number, decimal: number) => value * 10 ** decimal;\n\n/**\n * Amount is represented in the smallest unit format on chain, this function converts\n * the smallest unit format to a human-readable amount format\n * @example\n * human-readable amount format: 500\n * on chain amount format when decimal is 8: 50000000000\n *\n * @param value The value in human-readable format\n * @param decimal The token decimal\n * @returns The value in the smallest units\n */\nexport const convertAmountFromOnChainToHumanReadable = (value: number, decimal: number) => value / 10 ** decimal;\n\n/**\n * Convert a hex string to an ascii string with the `0x` prefix.\n *\n * `0x6170746f735f636f696e` --> `aptos_coin`\n *\n * @param hex The hex string to convert (e.g. `0x6170746f735f636f696e`)\n * @returns The ascii string\n */\nconst hexToAscii = (hex: string) => {\n let str = \"\";\n for (let n = 2; n < hex.length; n += 2) {\n str += String.fromCharCode(parseInt(hex.substring(n, n + 2), 16));\n }\n return str;\n};\n\n/**\n * Convert an encoded struct to a MoveStructId.\n *\n * @example\n * const structObj = {\n * account_address: \"0x1\",\n * module_name: \"0x6170746f735f636f696e\",\n * struct_name: \"0x4170746f73436f696e\",\n * };\n * // structId is \"0x1::aptos_coin::AptosCoin\"\n * const structId = parseEncodedStruct(structObj);\n *\n * @param structObj The struct with account_address, module_name, and struct_name properties\n * @returns The MoveStructId\n */\nexport const parseEncodedStruct = (structObj: {\n account_address: string;\n module_name: string;\n struct_name: string;\n}): MoveStructId => {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n const { account_address, module_name, struct_name } = structObj;\n const moduleName = hexToAscii(module_name);\n const structName = hexToAscii(struct_name);\n return `${account_address}::${moduleName}::${structName}`;\n};\n\n/**\n * Determines whether the given object is an encoded struct type with the following properties:\n * - account_address: string\n * - module_name: string\n * - struct_name: string\n *\n * @param structObj The object to check\n * @returns Whether the object is an encoded struct type\n */\nexport const isEncodedStruct = (\n structObj: any,\n): structObj is {\n account_address: string;\n module_name: string;\n struct_name: string;\n} =>\n typeof structObj === \"object\" &&\n !Array.isArray(structObj) &&\n structObj !== null &&\n \"account_address\" in structObj &&\n \"module_name\" in structObj &&\n \"struct_name\" in structObj &&\n typeof structObj.account_address === \"string\" &&\n typeof structObj.module_name === \"string\" &&\n typeof structObj.struct_name === \"string\";\n"],"mappings":"AAGA,OAAS,UAAAA,MAAc,YASvB,eAAsBC,EAAMC,EAA+B,CACzD,OAAO,IAAI,QAASC,GAAY,CAC9B,WAAWA,EAASD,CAAM,CAC5B,CAAC,CACH,CAQO,SAASE,EAAgBC,EAAwB,CACtD,OAAOA,aAAiB,MAAQA,EAAM,QAAU,OAAOA,CAAK,CAC9D,CAEO,IAAMC,EAAe,IAAM,KAAK,MAAM,KAAK,IAAI,EAAI,GAAI,EAQvD,SAASC,EAAiBC,EAAoC,CACnE,IAAMC,EAAO,IAAI,KAAKD,EAAqB,GAAI,EAE/C,OAAAC,EAAK,WAAW,CAAC,EACjBA,EAAK,WAAW,CAAC,EACjBA,EAAK,gBAAgB,CAAC,EACf,KAAK,MAAMA,EAAK,QAAQ,EAAI,GAAI,CACzC,CASO,SAASC,EAAgBC,EAA2B,CAEzD,IAAMC,EAASD,EAAU,QAAQ,KAAM,GAAG,EAAE,QAAQ,KAAM,GAAG,EAEvDE,EAAeD,EAAS,KAAK,UAAU,GAAI,EAAKA,EAAO,OAAS,GAAM,CAAC,EAE7E,OADsBZ,EAAOa,CAAY,CAE3C,CAaO,IAAMC,EAA0C,CAACC,EAAeC,IAAoBD,EAAQ,IAAMC,EAa5FC,EAA0C,CAACF,EAAeC,IAAoBD,EAAQ,IAAMC,EAUnGE,EAAcC,GAAgB,CAClC,IAAIC,EAAM,GACV,QAASC,EAAI,EAAGA,EAAIF,EAAI,OAAQE,GAAK,EACnCD,GAAO,OAAO,aAAa,SAASD,EAAI,UAAUE,EAAGA,EAAI,CAAC,EAAG,EAAE,CAAC,EAElE,OAAOD,CACT,EAiBaE,EAAsBC,GAIf,CAElB,GAAM,CAAE,gBAAAC,EAAiB,YAAAC,EAAa,YAAAC,CAAY,EAAIH,EAChDI,EAAaT,EAAWO,CAAW,EACnCG,EAAaV,EAAWQ,CAAW,EACzC,MAAO,GAAGF,CAAe,KAAKG,CAAU,KAAKC,CAAU,EACzD,EAWaC,EACXN,GAMA,OAAOA,GAAc,UACrB,CAAC,MAAM,QAAQA,CAAS,GACxBA,IAAc,MACd,oBAAqBA,GACrB,gBAAiBA,GACjB,gBAAiBA,GACjB,OAAOA,EAAU,iBAAoB,UACrC,OAAOA,EAAU,aAAgB,UACjC,OAAOA,EAAU,aAAgB","names":["decode","sleep","timeMs","resolve","getErrorMessage","error","nowInSeconds","floorToWholeHour","timestampInSeconds","date","base64UrlDecode","base64Url","base64","paddedBase64","convertAmountFromHumanReadableToOnChain","value","decimal","convertAmountFromOnChainToHumanReadable","hexToAscii","hex","str","n","parseEncodedStruct","structObj","account_address","module_name","struct_name","moduleName","structName","isEncodedStruct"]}
@@ -1,2 +0,0 @@
1
- import{a as t,b as n,c as i,d as r,e as o}from"./chunk-D3OEQLUE.mjs";import f from"@aptos-labs/aptos-client";var l=class{constructor(e){this.network=e?.network??"devnet",this.fullnode=e?.fullnode,this.faucet=e?.faucet,this.pepper=e?.pepper,this.prover=e?.prover,this.indexer=e?.indexer,this.client=e?.client??{provider:f},this.clientConfig=e?.clientConfig??{},this.fullnodeConfig=e?.fullnodeConfig??{},this.indexerConfig=e?.indexerConfig??{},this.faucetConfig=e?.faucetConfig??{}}getRequestUrl(e){switch(e){case"Fullnode":if(this.fullnode!==void 0)return this.fullnode;if(this.network==="custom")throw new Error("Please provide a custom full node url");return n[this.network];case"Faucet":if(this.faucet!==void 0)return this.faucet;if(this.network==="custom")throw new Error("Please provide a custom faucet url");return i[this.network];case"Indexer":if(this.indexer!==void 0)return this.indexer;if(this.network==="custom")throw new Error("Please provide a custom indexer url");return t[this.network];case"Pepper":if(this.pepper!==void 0)return this.pepper;if(this.network==="custom")throw new Error("Please provide a custom pepper service url");return r[this.network];case"Prover":if(this.prover!==void 0)return this.prover;if(this.network==="custom")throw new Error("Please provide a custom prover service url");return o[this.network];default:throw Error(`apiType ${e} is not supported`)}}isPepperServiceRequest(e){return r[this.network]===e}isProverServiceRequest(e){return o[this.network]===e}};export{l as a};
2
- //# sourceMappingURL=chunk-V5NDNR36.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/api/aptosConfig.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport aptosClient from \"@aptos-labs/aptos-client\";\nimport { AptosSettings, ClientConfig, Client, FullNodeConfig, IndexerConfig, FaucetConfig } from \"../types\";\nimport {\n NetworkToNodeAPI,\n NetworkToFaucetAPI,\n NetworkToIndexerAPI,\n Network,\n NetworkToPepperAPI,\n NetworkToProverAPI,\n} from \"../utils/apiEndpoints\";\nimport { AptosApiType } from \"../utils/const\";\n\n/**\n * Represents the configuration settings for an Aptos SDK client instance.\n * This class allows customization of various endpoints and client settings.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * async function runExample() {\n * // Create a configuration for connecting to the Aptos testnet\n * const config = new AptosConfig({ network: Network.TESTNET });\n *\n * // Initialize the Aptos client with the configuration\n * const aptos = new Aptos(config);\n *\n * console.log(\"Aptos client initialized:\", aptos);\n * }\n * runExample().catch(console.error);\n * ```\n */\nexport class AptosConfig {\n /**\n * The Network that this SDK is associated with. Defaults to DEVNET\n */\n readonly network: Network;\n\n /**\n * The client instance the SDK uses. Defaults to `@aptos-labs/aptos-client\n */\n readonly client: Client;\n\n /**\n * The optional hardcoded fullnode URL to send requests to instead of using the network\n */\n readonly fullnode?: string;\n\n /**\n * The optional hardcoded faucet URL to send requests to instead of using the network\n */\n readonly faucet?: string;\n\n /**\n * The optional hardcoded pepper service URL to send requests to instead of using the network\n */\n readonly pepper?: string;\n\n /**\n * The optional hardcoded prover service URL to send requests to instead of using the network\n */\n readonly prover?: string;\n\n /**\n * The optional hardcoded indexer URL to send requests to instead of using the network\n */\n readonly indexer?: string;\n\n /**\n * Optional client configurations\n */\n readonly clientConfig?: ClientConfig;\n\n /**\n * Optional specific Fullnode configurations\n */\n readonly fullnodeConfig?: FullNodeConfig;\n\n /**\n * Optional specific Indexer configurations\n */\n readonly indexerConfig?: IndexerConfig;\n\n /**\n * Optional specific Faucet configurations\n */\n readonly faucetConfig?: FaucetConfig;\n\n /**\n * Initializes an instance of the Aptos client with the specified settings.\n * This allows users to configure various aspects of the client, such as network and endpoints.\n *\n * @param settings - Optional configuration settings for the Aptos client.\n * @param settings.network - The network to connect to, defaults to `Network.DEVNET`.\n * @param settings.fullnode - The fullnode endpoint to use for requests.\n * @param settings.faucet - The faucet endpoint for obtaining test tokens.\n * @param settings.pepper - The pepper used for transaction signing.\n * @param settings.prover - The prover endpoint for transaction verification.\n * @param settings.indexer - The indexer endpoint for querying blockchain data.\n * @param settings.client - Custom client settings, defaults to a standard Aptos client.\n * @param settings.clientConfig - Additional configuration for the client.\n * @param settings.fullnodeConfig - Additional configuration for the fullnode.\n * @param settings.indexerConfig - Additional configuration for the indexer.\n * @param settings.faucetConfig - Additional configuration for the faucet.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * async function runExample() {\n * // Create a new Aptos client with default settings\n * const config = new AptosConfig({ network: Network.TESTNET }); // Specify the network\n * const aptos = new Aptos(config);\n *\n * console.log(\"Aptos client initialized:\", aptos);\n * }\n * runExample().catch(console.error);\n * ```\n */\n constructor(settings?: AptosSettings) {\n this.network = settings?.network ?? Network.DEVNET;\n this.fullnode = settings?.fullnode;\n this.faucet = settings?.faucet;\n this.pepper = settings?.pepper;\n this.prover = settings?.prover;\n this.indexer = settings?.indexer;\n this.client = settings?.client ?? { provider: aptosClient };\n this.clientConfig = settings?.clientConfig ?? {};\n this.fullnodeConfig = settings?.fullnodeConfig ?? {};\n this.indexerConfig = settings?.indexerConfig ?? {};\n this.faucetConfig = settings?.faucetConfig ?? {};\n }\n\n /**\n * Returns the URL endpoint to send the request to based on the specified API type.\n * If a custom URL was provided in the configuration, that URL is returned. Otherwise, the URL endpoint is derived from the network.\n *\n * @param apiType - The type of Aptos API to get the URL for. This can be one of the following: FULLNODE, FAUCET, INDEXER, PEPPER, PROVER.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network, AptosApiType } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Getting the request URL for the FULLNODE API\n * const url = config.getRequestUrl(AptosApiType.FULLNODE);\n * console.log(\"Request URL for FULLNODE:\", url);\n * }\n * runExample().catch(console.error);\n * ```\n */\n getRequestUrl(apiType: AptosApiType): string {\n switch (apiType) {\n case AptosApiType.FULLNODE:\n if (this.fullnode !== undefined) return this.fullnode;\n if (this.network === Network.CUSTOM) throw new Error(\"Please provide a custom full node url\");\n return NetworkToNodeAPI[this.network];\n case AptosApiType.FAUCET:\n if (this.faucet !== undefined) return this.faucet;\n if (this.network === Network.CUSTOM) throw new Error(\"Please provide a custom faucet url\");\n return NetworkToFaucetAPI[this.network];\n case AptosApiType.INDEXER:\n if (this.indexer !== undefined) return this.indexer;\n if (this.network === Network.CUSTOM) throw new Error(\"Please provide a custom indexer url\");\n return NetworkToIndexerAPI[this.network];\n case AptosApiType.PEPPER:\n if (this.pepper !== undefined) return this.pepper;\n if (this.network === Network.CUSTOM) throw new Error(\"Please provide a custom pepper service url\");\n return NetworkToPepperAPI[this.network];\n case AptosApiType.PROVER:\n if (this.prover !== undefined) return this.prover;\n if (this.network === Network.CUSTOM) throw new Error(\"Please provide a custom prover service url\");\n return NetworkToProverAPI[this.network];\n default:\n throw Error(`apiType ${apiType} is not supported`);\n }\n }\n\n /**\n * Checks if the provided URL is a known pepper service endpoint.\n *\n * @param url - The URL to check against the known pepper service endpoints.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * const url = \"https://example.pepper.service\"; // replace with a real pepper service URL\n *\n * // Check if the URL is a known pepper service endpoint\n * const isPepperService = config.isPepperServiceRequest(url);\n *\n * console.log(`Is the URL a known pepper service? ${isPepperService}`);\n * }\n * runExample().catch(console.error);\n * ```\n */\n isPepperServiceRequest(url: string): boolean {\n return NetworkToPepperAPI[this.network] === url;\n }\n\n /**\n * Checks if the provided URL is a known prover service endpoint.\n *\n * @param url - The URL to check against known prover service endpoints.\n * @returns A boolean indicating whether the URL is a known prover service endpoint.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * // Check if the URL is a known prover service endpoint\n * const url = \"https://prover.testnet.aptos.dev\"; // replace with a real URL if needed\n * const isProver = config.isProverServiceRequest(url);\n *\n * console.log(`Is the URL a known prover service? ${isProver}`);\n * ```\n */\n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B,KAAK,OAAO,EACxC,QACE,MAAM,MAAM,WAAWL,CAAO,mBAAmB,CACrD,CACF,CAyBA,uBAAuBM,EAAsB,CAC3C,OAAOF,EAAmB,KAAK,OAAO,IAAME,CAC9C,CAsBA,uBAAuBA,EAAsB,CAC3C,OAAOD,EAAmB,KAAK,OAAO,IAAMC,CAC9C,CACF","names":["aptosClient","AptosConfig","settings","aptosClient","apiType","NetworkToNodeAPI","NetworkToFaucetAPI","NetworkToIndexerAPI","NetworkToPepperAPI","NetworkToProverAPI","url"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/internal/faucet.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/faucet}. By moving the methods out into a separate file,\n * other namespaces and processes can access these methods without depending on the entire\n * faucet namespace and without having a dependency cycle error.\n */\n\nimport { AptosConfig } from \"../api/aptosConfig\";\nimport { postAptosFaucet } from \"../client\";\nimport { AccountAddress, AccountAddressInput } from \"../core\";\nimport { TransactionResponseType, UserTransactionResponse, WaitForTransactionOptions } from \"../types\";\nimport { DEFAULT_TXN_TIMEOUT_SEC } from \"../utils/const\";\nimport { waitForTransaction } from \"./transaction\";\n\n/**\n * Funds an account with a specified amount of tokens from the Aptos faucet.\n * This function is useful for quickly providing a new or existing account with tokens to facilitate transactions.\n *\n * @param args - The arguments for funding the account.\n * @param args.aptosConfig - The configuration settings for connecting to the Aptos network.\n * @param args.accountAddress - The address of the account to be funded.\n * @param args.amount - The amount of tokens to fund the account with.\n * @param args.options - Optional parameters for the transaction.\n * @param args.options.timeoutSecs - The maximum time to wait for the transaction to complete, in seconds.\n * @param args.options.checkSuccess - A flag indicating whether to check if the transaction was successful.\n *\n * @throws Error if the transaction does not return a user transaction type.\n */\nexport async function fundAccount(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n amount: number;\n options?: WaitForTransactionOptions;\n}): Promise<UserTransactionResponse> {\n const { aptosConfig, accountAddress, amount, options } = args;\n const timeout = options?.timeoutSecs || DEFAULT_TXN_TIMEOUT_SEC;\n const { data } = await postAptosFaucet<any, { txn_hashes: Array<string> }>({\n aptosConfig,\n path: \"fund\",\n body: {\n address: AccountAddress.from(accountAddress).toString(),\n amount,\n },\n originMethod: \"fundAccount\",\n });\n\n const txnHash = data.txn_hashes[0];\n\n const res = await waitForTransaction({\n aptosConfig,\n transactionHash: txnHash,\n options: {\n timeoutSecs: timeout,\n checkSuccess: options?.checkSuccess,\n },\n });\n\n // Response is always User transaction for a user submitted transaction\n if (res.type === TransactionResponseType.User) {\n return res;\n }\n\n throw new Error(`Unexpected transaction received for fund account: ${res.type}`);\n}\n"],"mappings":"oKA+BA,eAAsBA,EAAYC,EAKG,CACnC,GAAM,CAAE,YAAAC,EAAa,eAAAC,EAAgB,OAAAC,EAAQ,QAAAC,CAAQ,EAAIJ,EACnDK,EAAUD,GAAS,aAAe,GAClC,CAAE,KAAAE,CAAK,EAAI,MAAMC,EAAoD,CACzE,YAAAN,EACA,KAAM,OACN,KAAM,CACJ,QAASO,EAAe,KAAKN,CAAc,EAAE,SAAS,EACtD,OAAAC,CACF,EACA,aAAc,aAChB,CAAC,EAEKM,EAAUH,EAAK,WAAW,CAAC,EAE3BI,EAAM,MAAMC,EAAmB,CACnC,YAAAV,EACA,gBAAiBQ,EACjB,QAAS,CACP,YAAaJ,EACb,aAAcD,GAAS,YACzB,CACF,CAAC,EAGD,GAAIM,EAAI,OAAS,mBACf,OAAOA,EAGT,MAAM,IAAI,MAAM,qDAAqDA,EAAI,IAAI,EAAE,CACjF","names":["fundAccount","args","aptosConfig","accountAddress","amount","options","timeout","data","postAptosFaucet","AccountAddress","txnHash","res","waitForTransaction"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/cli/localNode.ts"],"sourcesContent":["/* eslint-disable no-console */\n\nimport { ChildProcessWithoutNullStreams, spawn } from \"child_process\";\nimport kill from \"tree-kill\";\nimport { platform } from \"os\";\n\nimport { sleep } from \"../utils/helpers\";\n\n/**\n * Represents a local node for running a testnet environment.\n * This class provides methods to start, stop, and check the status of the local testnet process.\n * It manages the lifecycle of the node process and ensures that it is operational before executing tests.\n */\nexport class LocalNode {\n readonly MAXIMUM_WAIT_TIME_SEC = 75;\n\n readonly READINESS_ENDPOINT = \"http://127.0.0.1:8070/\";\n\n showStdout: boolean = true;\n\n process: ChildProcessWithoutNullStreams | null = null;\n\n constructor(args?: { showStdout?: boolean }) {\n this.showStdout = args?.showStdout ?? true;\n }\n\n /**\n * Kills the current process and all its descendant processes.\n *\n * @returns {Promise<void>} A promise that resolves to true if the process was successfully killed.\n * @throws {Error} If there is an error while attempting to kill the process.\n */\n async stop(): Promise<void> {\n await new Promise((resolve, reject) => {\n if (!this.process?.pid) return;\n\n /**\n * Terminates the process associated with the given process ID.\n *\n * @param pid - The process ID of the process to be terminated.\n * @param callback - A function that is called after the termination attempt is complete.\n * @param callback.err - An error object if the termination failed; otherwise, null.\n * @param callback.resolve - A boolean indicating whether the termination was successful.\n */\n kill(this.process.pid, (err) => {\n if (err) {\n reject(err);\n } else {\n resolve(true);\n }\n });\n });\n }\n\n /**\n * Runs a local testnet and waits for the process to be up.\n * If the local node process is already running, it returns without starting the process.\n *\n * @returns {Promise<void>} A promise that resolves when the process is up.\n */\n async run(): Promise<void> {\n const nodeIsUp = await this.checkIfProcessIsUp();\n if (nodeIsUp) {\n return;\n }\n this.start();\n await this.waitUntilProcessIsUp();\n }\n\n /**\n * Starts the local testnet by running the Aptos node with the specified command-line arguments.\n *\n * @returns {void}\n *\n * @throws {Error} If there is an issue starting the local testnet.\n */\n start(): void {\n const cliCommand = \"npx\";\n const cliArgs = [\"aptos\", \"node\", \"run-localnet\", \"--force-restart\", \"--assume-yes\", \"--with-indexer-api\"];\n\n const currentPlatform = platform();\n let childProcess;\n // Check if current OS is windows\n if (currentPlatform === \"win32\") {\n childProcess = spawn(cliCommand, cliArgs, { shell: true });\n } else {\n childProcess = spawn(cliCommand, cliArgs);\n }\n\n this.process = childProcess;\n\n childProcess.stderr?.on(\"data\", (data: any) => {\n const str = data.toString();\n // Print local node output error log\n console.log(str);\n });\n\n childProcess.stdout?.on(\"data\", (data: any) => {\n const str = data.toString();\n // Print local node output log\n if (this.showStdout) {\n console.log(str);\n }\n });\n }\n\n /**\n * Waits for the local testnet process to be operational within a specified maximum wait time.\n * This function continuously checks if the process is up and will throw an error if it fails to start.\n *\n * @returns Promise<boolean> - Resolves to true if the process is up, otherwise throws an error.\n */\n async waitUntilProcessIsUp(): Promise<boolean> {\n let operational = await this.checkIfProcessIsUp();\n const start = Date.now() / 1000;\n let last = start;\n\n while (!operational && start + this.MAXIMUM_WAIT_TIME_SEC > last) {\n // eslint-disable-next-line no-await-in-loop\n await sleep(1000);\n // eslint-disable-next-line no-await-in-loop\n operational = await this.checkIfProcessIsUp();\n last = Date.now() / 1000;\n }\n\n // If we are here it means something blocks the process to start.\n // Might worth checking if another process is running on port 8080\n if (!operational) {\n throw new Error(\"Process failed to start\");\n }\n\n return true;\n }\n\n /**\n * Checks if the local testnet is up by querying the readiness endpoint.\n *\n * @returns Promise<boolean> - A promise that resolves to true if the testnet is up, otherwise false.\n */\n async checkIfProcessIsUp(): Promise<boolean> {\n try {\n // Query readiness endpoint\n const data = await fetch(this.READINESS_ENDPOINT);\n if (data.status === 200) {\n return true;\n }\n return false;\n } catch (err: any) {\n return false;\n }\n }\n}\n"],"mappings":"yCAEA,OAAyC,SAAAA,MAAa,gBACtD,OAAOC,MAAU,YACjB,OAAS,YAAAC,MAAgB,KASlB,IAAMC,EAAN,KAAgB,CASrB,YAAYC,EAAiC,CAR7C,KAAS,sBAAwB,GAEjC,KAAS,mBAAqB,yBAE9B,gBAAsB,GAEtB,aAAiD,KAG/C,KAAK,WAAaA,GAAM,YAAc,EACxC,CAQA,MAAM,MAAsB,CAC1B,MAAM,IAAI,QAAQ,CAACC,EAASC,IAAW,CAChC,KAAK,SAAS,KAUnBC,EAAK,KAAK,QAAQ,IAAMC,GAAQ,CAC1BA,EACFF,EAAOE,CAAG,EAEVH,EAAQ,EAAI,CAEhB,CAAC,CACH,CAAC,CACH,CAQA,MAAM,KAAqB,CACR,MAAM,KAAK,mBAAmB,IAI/C,KAAK,MAAM,EACX,MAAM,KAAK,qBAAqB,EAClC,CASA,OAAc,CACZ,IAAMI,EAAa,MACbC,EAAU,CAAC,QAAS,OAAQ,eAAgB,kBAAmB,eAAgB,oBAAoB,EAEnGC,EAAkBC,EAAS,EAC7BC,EAEAF,IAAoB,QACtBE,EAAeC,EAAML,EAAYC,EAAS,CAAE,MAAO,EAAK,CAAC,EAEzDG,EAAeC,EAAML,EAAYC,CAAO,EAG1C,KAAK,QAAUG,EAEfA,EAAa,QAAQ,GAAG,OAASE,GAAc,CAC7C,IAAMC,EAAMD,EAAK,SAAS,EAE1B,QAAQ,IAAIC,CAAG,CACjB,CAAC,EAEDH,EAAa,QAAQ,GAAG,OAASE,GAAc,CAC7C,IAAMC,EAAMD,EAAK,SAAS,EAEtB,KAAK,YACP,QAAQ,IAAIC,CAAG,CAEnB,CAAC,CACH,CAQA,MAAM,sBAAyC,CAC7C,IAAIC,EAAc,MAAM,KAAK,mBAAmB,EAC1CC,EAAQ,KAAK,IAAI,EAAI,IACvBC,EAAOD,EAEX,KAAO,CAACD,GAAeC,EAAQ,KAAK,sBAAwBC,GAE1D,MAAMC,EAAM,GAAI,EAEhBH,EAAc,MAAM,KAAK,mBAAmB,EAC5CE,EAAO,KAAK,IAAI,EAAI,IAKtB,GAAI,CAACF,EACH,MAAM,IAAI,MAAM,yBAAyB,EAG3C,MAAO,EACT,CAOA,MAAM,oBAAuC,CAC3C,GAAI,CAGF,OADa,MAAM,MAAM,KAAK,kBAAkB,GACvC,SAAW,GAItB,MAAmB,CACjB,MAAO,EACT,CACF,CACF","names":["spawn","kill","platform","LocalNode","args","resolve","reject","kill","err","cliCommand","cliArgs","currentPlatform","platform","childProcess","spawn","data","str","operational","start","last","sleep"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/client/core.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { AptosConfig } from \"../api/aptosConfig\";\nimport { VERSION } from \"../version\";\nimport { AnyNumber, AptosRequest, AptosResponse, Client, ClientRequest, ClientResponse, MimeType } from \"../types\";\nimport { AptosApiType } from \"../utils\";\nimport { AptosApiError } from \"../errors\";\n\n/**\n * Sends a request using the specified options and returns the response.\n *\n * @param options - The options for the request.\n * @param options.url - The URL to send the request to.\n * @param options.method - The HTTP method to use for the request.\n * @param options.body - The body of the request.\n * @param options.contentType - The content type of the request.\n * @param options.params - The query parameters to include in the request.\n * @param options.overrides - Additional overrides for the request.\n * @param options.overrides.HEADERS - Custom headers to include in the request.\n * @param options.overrides.AUTH_TOKEN - The authorization token for the request.\n * @param options.overrides.API_KEY - The API key for the request.\n * @param options.originMethod - The origin method for the request.\n * @param client - The client used to make the request.\n *\n * @returns The response from the request.\n */\nexport async function request<Req, Res>(options: ClientRequest<Req>, client: Client): Promise<ClientResponse<Res>> {\n const { url, method, body, contentType, params, overrides, originMethod } = options;\n const headers: Record<string, string | AnyNumber | boolean | undefined> = {\n ...overrides?.HEADERS,\n \"x-aptos-client\": `aptos-typescript-sdk/${VERSION}`,\n \"content-type\": contentType ?? MimeType.JSON,\n \"x-aptos-typescript-sdk-origin-method\": originMethod,\n };\n\n if (overrides?.AUTH_TOKEN) {\n headers.Authorization = `Bearer ${overrides?.AUTH_TOKEN}`;\n }\n if (overrides?.API_KEY) {\n headers.Authorization = `Bearer ${overrides?.API_KEY}`;\n }\n\n /*\n * make a call using the @aptos-labs/aptos-client package\n * {@link https://www.npmjs.com/package/@aptos-labs/aptos-client}\n */\n return client.provider<Req, Res>({\n url,\n method,\n body,\n params,\n headers,\n overrides,\n });\n}\n\n/**\n * The main function to use when making an API request, returning the response or throwing an AptosApiError on failure.\n *\n * @param aptosRequestOpts - Options for the Aptos request, including the URL and path.\n * @param aptosConfig - The configuration information for the SDK client instance.\n * @param apiType - The type of API being accessed, which determines how the response is handled.\n * @returns The response from the API request or throws an AptosApiError if the request fails.\n */\nexport async function aptosRequest<Req extends {}, Res extends {}>(\n aptosRequestOpts: AptosRequest,\n aptosConfig: AptosConfig,\n apiType: AptosApiType,\n): Promise<AptosResponse<Req, Res>> {\n const { url, path } = aptosRequestOpts;\n const fullUrl = path ? `${url}/${path}` : url;\n const clientResponse = await request<Req, Res>({ ...aptosRequestOpts, url: fullUrl }, aptosConfig.client);\n\n const aptosResponse: AptosResponse<Req, Res> = {\n status: clientResponse.status,\n statusText: clientResponse.statusText ?? \"No status text provided\",\n data: clientResponse.data,\n headers: clientResponse.headers,\n config: clientResponse.config,\n request: clientResponse.request,\n url: fullUrl,\n };\n\n // Handle case for `Unauthorized` error (i.e. API_KEY error)\n if (aptosResponse.status === 401) {\n throw new AptosApiError({ apiType, aptosRequest: aptosRequestOpts, aptosResponse });\n }\n\n // to support both fullnode and indexer responses,\n // check if it is an indexer query, and adjust response.data\n if (apiType === AptosApiType.INDEXER) {\n const indexerResponse = aptosResponse.data as any;\n // Handle Indexer general errors\n if (indexerResponse.errors) {\n throw new AptosApiError({\n apiType,\n aptosRequest: aptosRequestOpts,\n aptosResponse,\n });\n }\n aptosResponse.data = indexerResponse.data as Res;\n } else if (apiType === AptosApiType.PEPPER || apiType === AptosApiType.PROVER) {\n if (aptosResponse.status >= 400) {\n throw new AptosApiError({ apiType, aptosRequest: aptosRequestOpts, aptosResponse });\n }\n }\n\n if (aptosResponse.status >= 200 && aptosResponse.status < 300) {\n return aptosResponse;\n }\n\n // We have to explicitly check for all request types, because if the error is a non-indexer error, but\n // comes from an indexer request (e.g. 404), we'll need to mention it appropriately\n throw new AptosApiError({ apiType, aptosRequest: aptosRequestOpts, aptosResponse });\n}\n"],"mappings":"kFA2BA,eAAsBA,EAAkBC,EAA6BC,EAA8C,CACjH,GAAM,CAAE,IAAAC,EAAK,OAAAC,EAAQ,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AOA,EAAc,OAAS,IACxD,OAAOA,EAKT,MAAM,IAAIC,EAAc,CAAE,QAAAL,EAAS,aAAcF,EAAkB,cAAAM,CAAc,CAAC,CACpF","names":["request","options","client","url","method","body","contentType","params","overrides","originMethod","headers","VERSION","aptosRequest","aptosRequestOpts","aptosConfig","apiType","path","fullUrl","clientResponse","aptosResponse","AptosApiError","indexerResponse"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/internal/transaction.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/transaction}. By moving the methods out into a separate file,\n * other namespaces and processes can access these methods without depending on the entire\n * transaction namespace and without having a dependency cycle error.\n */\n\nimport { AptosConfig } from \"../api/aptosConfig\";\nimport { getAptosFullNode, paginateWithCursor } from \"../client\";\nimport { AptosApiError } from \"../errors\";\nimport {\n TransactionResponseType,\n type AnyNumber,\n type GasEstimation,\n type HexInput,\n type PaginationArgs,\n type TransactionResponse,\n WaitForTransactionOptions,\n CommittedTransactionResponse,\n Block,\n} from \"../types\";\nimport { DEFAULT_TXN_TIMEOUT_SEC, ProcessorType } from \"../utils/const\";\nimport { sleep } from \"../utils/helpers\";\nimport { memoizeAsync } from \"../utils/memoize\";\nimport { getIndexerLastSuccessVersion, getProcessorStatus } from \"./general\";\n\n/**\n * Retrieve a list of transactions based on the specified options.\n *\n * @param {Object} args - The parameters for retrieving transactions.\n * @param {Object} args.aptosConfig - The configuration object for Aptos.\n * @param {Object} args.options - The options for pagination.\n * @param {number} args.options.offset - The number of transactions to skip before starting to collect the result set.\n * @param {number} args.options.limit - The maximum number of transactions to return.\n */\nexport async function getTransactions(args: {\n aptosConfig: AptosConfig;\n options?: PaginationArgs;\n}): Promise<TransactionResponse[]> {\n const { aptosConfig, options } = args;\n return paginateWithCursor<{}, TransactionResponse[]>({\n aptosConfig,\n originMethod: \"getTransactions\",\n path: \"transactions\",\n params: { start: options?.offset, limit: options?.limit },\n });\n}\n\n/**\n * Retrieves the estimated gas price for transactions on the Aptos network.\n * This function helps users understand the current gas price, which is essential for transaction planning and cost estimation.\n *\n * @param args - The configuration parameters for the Aptos network.\n * @param args.aptosConfig - The configuration object containing network details.\n */\nexport async function getGasPriceEstimation(args: { aptosConfig: AptosConfig }) {\n const { aptosConfig } = args;\n\n return memoizeAsync(\n async () => {\n const { data } = await getAptosFullNode<{}, GasEstimation>({\n aptosConfig,\n originMethod: \"getGasPriceEstimation\",\n path: \"estimate_gas_price\",\n });\n return data;\n },\n `gas-price-${aptosConfig.network}`,\n 1000 * 60 * 5, // 5 minutes\n )();\n}\n\n/**\n * Retrieves the transaction details associated with a specific ledger version.\n *\n * @param args - The arguments for the transaction retrieval.\n * @param args.aptosConfig - The configuration settings for the Aptos client.\n * @param args.ledgerVersion - The ledger version for which to retrieve the transaction.\n * @returns The transaction details for the specified ledger version.\n */\nexport async function getTransactionByVersion(args: {\n aptosConfig: AptosConfig;\n ledgerVersion: AnyNumber;\n}): Promise<TransactionResponse> {\n const { aptosConfig, ledgerVersion } = args;\n const { data } = await getAptosFullNode<{}, TransactionResponse>({\n aptosConfig,\n originMethod: \"getTransactionByVersion\",\n path: `transactions/by_version/${ledgerVersion}`,\n });\n return data;\n}\n\n/**\n * Retrieves transaction details using the specified transaction hash.\n *\n * @param args - The arguments for retrieving the transaction.\n * @param args.aptosConfig - The configuration settings for the Aptos client.\n * @param args.transactionHash - The hash of the transaction to retrieve.\n * @returns A promise that resolves to the transaction details.\n */\nexport async function getTransactionByHash(args: {\n aptosConfig: AptosConfig;\n transactionHash: HexInput;\n}): Promise<TransactionResponse> {\n const { aptosConfig, transactionHash } = args;\n const { data } = await getAptosFullNode<{}, TransactionResponse>({\n aptosConfig,\n path: `transactions/by_hash/${transactionHash}`,\n originMethod: \"getTransactionByHash\",\n });\n return data;\n}\n\n/**\n * Checks if a transaction is currently pending based on its hash.\n * This function helps determine the status of a transaction in the Aptos network.\n *\n * @param args - The arguments for checking the transaction status.\n * @param args.aptosConfig - The configuration settings for connecting to the Aptos network.\n * @param args.transactionHash - The hash of the transaction to check.\n * @returns A boolean indicating whether the transaction is pending.\n * @throws An error if the transaction cannot be retrieved due to reasons other than a 404 status.\n */\nexport async function isTransactionPending(args: {\n aptosConfig: AptosConfig;\n transactionHash: HexInput;\n}): Promise<boolean> {\n const { aptosConfig, transactionHash } = args;\n try {\n const transaction = await getTransactionByHash({ aptosConfig, transactionHash });\n return transaction.type === TransactionResponseType.Pending;\n } catch (e: any) {\n if (e?.status === 404) {\n return true;\n }\n throw e;\n }\n}\n\n/**\n * Waits for a transaction to be confirmed by its hash.\n * This function allows you to monitor the status of a transaction until it is finalized.\n *\n * @param args - The arguments for the function.\n * @param args.aptosConfig - The configuration settings for the Aptos client.\n * @param args.transactionHash - The hash of the transaction to wait for.\n */\nexport async function longWaitForTransaction(args: {\n aptosConfig: AptosConfig;\n transactionHash: HexInput;\n}): Promise<TransactionResponse> {\n const { aptosConfig, transactionHash } = args;\n const { data } = await getAptosFullNode<{}, TransactionResponse>({\n aptosConfig,\n path: `transactions/wait_by_hash/${transactionHash}`,\n originMethod: \"longWaitForTransaction\",\n });\n return data;\n}\n\n/**\n * Waits for a transaction to be confirmed on the blockchain and handles potential errors during the process.\n * This function allows you to monitor the status of a transaction until it is either confirmed or fails.\n *\n * @param args - The arguments for waiting for a transaction.\n * @param args.aptosConfig - The configuration settings for Aptos.\n * @param args.transactionHash - The hash of the transaction to wait for.\n * @param args.options - Optional settings for waiting, including timeout and success check.\n * @param args.options.timeoutSecs - The maximum time to wait for the transaction in seconds. Defaults to a predefined value.\n * @param args.options.checkSuccess - A flag indicating whether to check the success status of the transaction. Defaults to true.\n * @returns A promise that resolves to the transaction response once the transaction is confirmed.\n * @throws WaitForTransactionError if the transaction times out or remains pending.\n * @throws FailedTransactionError if the transaction fails.\n */\nexport async function waitForTransaction(args: {\n aptosConfig: AptosConfig;\n transactionHash: HexInput;\n options?: WaitForTransactionOptions;\n}): Promise<CommittedTransactionResponse> {\n const { aptosConfig, transactionHash, options } = args;\n const timeoutSecs = options?.timeoutSecs ?? DEFAULT_TXN_TIMEOUT_SEC;\n const checkSuccess = options?.checkSuccess ?? true;\n\n let isPending = true;\n let timeElapsed = 0;\n let lastTxn: TransactionResponse | undefined;\n let lastError: AptosApiError | undefined;\n let backoffIntervalMs = 200;\n const backoffMultiplier = 1.5;\n\n /**\n * Handles API errors by throwing the last error or a timeout error for a failed transaction.\n *\n * @param e - The error object that occurred during the API call.\n * @throws {Error} Throws the last error if it exists; otherwise, throws a WaitForTransactionError indicating a timeout.\n */\n function handleAPIError(e: any) {\n // In short, this means we will retry if it was an AptosApiError and the code was 404 or 5xx.\n const isAptosApiError = e instanceof AptosApiError;\n if (!isAptosApiError) {\n throw e; // This would be unexpected\n }\n lastError = e;\n const isRequestError = e.status !== 404 && e.status >= 400 && e.status < 500;\n if (isRequestError) {\n throw e;\n }\n }\n\n // check to see if the txn is already on the blockchain\n try {\n lastTxn = await getTransactionByHash({ aptosConfig, transactionHash });\n isPending = lastTxn.type === TransactionResponseType.Pending;\n } catch (e) {\n handleAPIError(e);\n }\n\n // If the transaction is pending, we do a long wait once to avoid polling\n if (isPending) {\n const startTime = Date.now();\n try {\n lastTxn = await longWaitForTransaction({ aptosConfig, transactionHash });\n isPending = lastTxn.type === TransactionResponseType.Pending;\n } catch (e) {\n handleAPIError(e);\n }\n timeElapsed = (Date.now() - startTime) / 1000;\n }\n\n // Now we do polling to see if the transaction is still pending\n while (isPending) {\n if (timeElapsed >= timeoutSecs) {\n break;\n }\n try {\n // eslint-disable-next-line no-await-in-loop\n lastTxn = await getTransactionByHash({ aptosConfig, transactionHash });\n\n isPending = lastTxn.type === TransactionResponseType.Pending;\n\n if (!isPending) {\n break;\n }\n } catch (e) {\n handleAPIError(e);\n }\n // eslint-disable-next-line no-await-in-loop\n await sleep(backoffIntervalMs);\n timeElapsed += backoffIntervalMs / 1000; // Convert to seconds\n backoffIntervalMs *= backoffMultiplier;\n }\n\n // There is a chance that lastTxn is still undefined. Let's throw the last error otherwise a WaitForTransactionError\n if (lastTxn === undefined) {\n if (lastError) {\n throw lastError;\n } else {\n throw new WaitForTransactionError(\n `Fetching transaction ${transactionHash} failed and timed out after ${timeoutSecs} seconds`,\n lastTxn,\n );\n }\n }\n\n if (lastTxn.type === TransactionResponseType.Pending) {\n throw new WaitForTransactionError(\n `Transaction ${transactionHash} timed out in pending state after ${timeoutSecs} seconds`,\n lastTxn,\n );\n }\n if (!checkSuccess) {\n return lastTxn;\n }\n if (!lastTxn.success) {\n throw new FailedTransactionError(\n `Transaction ${transactionHash} failed with an error: ${lastTxn.vm_status}`,\n lastTxn,\n );\n }\n\n return lastTxn;\n}\n\n/**\n * Waits for the indexer to sync up to the specified ledger version. The timeout is 3 seconds.\n *\n * @param args - The arguments for the function.\n * @param args.aptosConfig - The configuration object for Aptos.\n * @param args.minimumLedgerVersion - The minimum ledger version that the indexer should sync to.\n * @param args.processorType - (Optional) The type of processor to check the last success version from.\n */\nexport async function waitForIndexer(args: {\n aptosConfig: AptosConfig;\n minimumLedgerVersion: AnyNumber;\n processorType?: ProcessorType;\n}): Promise<void> {\n const { aptosConfig, processorType } = args;\n const minimumLedgerVersion = BigInt(args.minimumLedgerVersion);\n const timeoutMilliseconds = 3000; // 3 seconds\n const startTime = new Date().getTime();\n let indexerVersion = BigInt(-1);\n\n while (indexerVersion < minimumLedgerVersion) {\n // check for timeout\n if (new Date().getTime() - startTime > timeoutMilliseconds) {\n throw new Error(\"waitForLastSuccessIndexerVersionSync timeout\");\n }\n\n if (processorType === undefined) {\n // Get the last success version from all processor\n // eslint-disable-next-line no-await-in-loop\n indexerVersion = await getIndexerLastSuccessVersion({ aptosConfig });\n } else {\n // Get the last success version from the specific processor\n // eslint-disable-next-line no-await-in-loop\n const processor = await getProcessorStatus({ aptosConfig, processorType });\n indexerVersion = processor.last_success_version;\n }\n\n if (indexerVersion >= minimumLedgerVersion) {\n // break out immediately if we are synced\n break;\n }\n\n // eslint-disable-next-line no-await-in-loop\n await sleep(200);\n }\n}\n\n/**\n * Represents an error that occurs when waiting for a transaction to complete.\n * This error is thrown by the `waitForTransaction` function when a transaction\n * times out or when the transaction response is undefined.\n *\n * @param message - A descriptive message for the error.\n * @param lastSubmittedTransaction - The last submitted transaction response, if available.\n */\nexport class WaitForTransactionError extends Error {\n public readonly lastSubmittedTransaction: TransactionResponse | undefined;\n\n /**\n * Constructs an instance of the class with a specified message and transaction response.\n *\n * @param message - The message associated with the transaction.\n * @param lastSubmittedTransaction - The transaction response object containing details about the transaction.\n */\n constructor(message: string, lastSubmittedTransaction: TransactionResponse | undefined) {\n super(message);\n this.lastSubmittedTransaction = lastSubmittedTransaction;\n }\n}\n\n/**\n * Represents an error that occurs when a transaction fails.\n * This error is thrown by the `waitForTransaction` function when the `checkSuccess` parameter is set to true.\n *\n * @param message - A description of the error.\n * @param transaction - The transaction response associated with the failure.\n */\nexport class FailedTransactionError extends Error {\n public readonly transaction: TransactionResponse;\n\n constructor(message: string, transaction: TransactionResponse) {\n super(message);\n this.transaction = transaction;\n }\n}\n\n/**\n * Retrieves a block from the Aptos blockchain by its ledger version.\n * This function allows you to obtain detailed information about a specific block, including its transactions if requested.\n *\n * @param args - The arguments for retrieving the block.\n * @param args.aptosConfig - The configuration object for connecting to the Aptos node.\n * @param args.ledgerVersion - The ledger version of the block to retrieve.\n * @param args.options - Optional parameters for the request.\n * @param args.options.withTransactions - Indicates whether to include transactions in the block data.\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: block } = await getAptosFullNode<{}, Block>({\n aptosConfig,\n originMethod: \"getBlockByVersion\",\n path: `blocks/by_version/${ledgerVersion}`,\n params: { with_transactions: options?.withTransactions },\n });\n\n return fillBlockTransactions({ block, ...args });\n}\n\n/**\n * Retrieves a block from the Aptos blockchain by its height.\n *\n * @param args - The parameters for retrieving the block.\n * @param args.aptosConfig - The configuration object for connecting to the Aptos network.\n * @param args.blockHeight - The height of the block to retrieve.\n * @param args.options - Optional parameters for the request.\n * @param args.options.withTransactions - Indicates whether to include transactions in the block data.\n * @returns A promise that resolves to the block data, potentially including its transactions.\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: block } = await getAptosFullNode<{}, Block>({\n aptosConfig,\n originMethod: \"getBlockByHeight\",\n path: `blocks/by_height/${blockHeight}`,\n params: { with_transactions: options?.withTransactions },\n });\n return fillBlockTransactions({ block, ...args });\n}\n\n/**\n * Fills in the block with transactions if not enough were returned. This function ensures that the block contains all relevant\n * transactions by fetching any missing ones based on the specified options.\n * @param args - The arguments for filling the block transactions.\n * @param args.aptosConfig - The configuration settings for Aptos.\n * @param args.block - The block object that will be filled with transactions.\n * @param args.options - Optional settings for fetching transactions.\n * @param args.options.withTransactions - Indicates whether to include transactions in the block.\n */\nasync function fillBlockTransactions(args: {\n aptosConfig: AptosConfig;\n block: Block;\n options?: { withTransactions?: boolean };\n}) {\n const { aptosConfig, block, options } = args;\n if (options?.withTransactions) {\n // Transactions should be filled, but this ensures it\n block.transactions = block.transactions ?? [];\n\n const lastTxn = block.transactions[block.transactions.length - 1];\n const firstVersion = BigInt(block.first_version);\n const lastVersion = BigInt(block.last_version);\n\n // Convert the transaction to the type\n const curVersion: string | undefined = (lastTxn as any)?.version;\n let latestVersion;\n\n // This time, if we don't have any transactions, we will try once with the start of the block\n if (curVersion === undefined) {\n latestVersion = firstVersion - 1n;\n } else {\n latestVersion = BigInt(curVersion);\n }\n\n // If we have all the transactions in the block, we can skip out, otherwise we need to fill the transactions\n if (latestVersion === lastVersion) {\n return block;\n }\n\n // For now, we will grab all the transactions in groups of 100, but we can make this more efficient by trying larger\n // amounts\n const fetchFutures = [];\n const pageSize = 100n;\n for (let i = latestVersion + 1n; i < lastVersion; i += BigInt(100)) {\n fetchFutures.push(\n getTransactions({\n aptosConfig,\n options: {\n offset: i,\n limit: Math.min(Number(pageSize), Number(lastVersion - i + 1n)),\n },\n }),\n );\n }\n\n // Combine all the futures\n const responses = await Promise.all(fetchFutures);\n for (const txns of responses) {\n block.transactions.push(...txns);\n }\n }\n\n return block;\n}\n"],"mappings":"oQAsCA,eAAsBA,EAAgBC,EAGH,CACjC,GAAM,CAAE,YAAAC,EAAa,QAAAC,CAAQ,EAAIF,EACjC,OAAOG,EAA8C,CACnD,YAAAF,EACA,aAAc,kBACd,KAAM,eACN,OAAQ,CAAE,MAAOC,GAAS,OAAQ,MAAOA,GAAS,KAAM,CAC1D,CAAC,CACH,CASA,eAAsBE,EAAsBJ,EAAoC,CAC9E,GAAM,CAAE,YAAAC,CAAY,EAAID,EAExB,OAAOK,EACL,SAAY,CACV,GAAM,CAAE,KAAAC,CAAK,EAAI,MAAMC,EAAoC,CACzD,YAAAN,EACA,aAAc,wBACd,KAAM,oBACR,CAAC,EACD,OAAOK,CACT,EACA,aAAaL,EAAY,OAAO,GAChC,IAAO,GAAK,CACd,EAAE,CACJ,CAUA,eAAsBO,EAAwBR,EAGb,CAC/B,GAAM,CAAE,YAAAC,EAAa,cAAAQ,CAAc,EAAIT,EACjC,CAAE,KAAAM,CAAK,EAAI,MAAMC,EAA0C,CAC/D,YAAAN,EACA,aAAc,0BACd,KAAM,2BAA2BQ,CAAa,EAChD,CAAC,EACD,OAAOH,CACT,CAUA,eAAsBI,EAAqBV,EAGV,CAC/B,GAAM,CAAE,YAAAC,EAAa,gBAAAU,CAAgB,EAAIX,EACnC,CAAE,KAAAM,CAAK,EAAI,MAAMC,EAA0C,CAC/D,YAAAN,EACA,KAAM,wBAAwBU,CAAe,GAC7C,aAAc,sBAChB,CAAC,EACD,OAAOL,CACT,CAYA,eAAsBM,EAAqBZ,EAGtB,CACnB,GAAM,CAAE,YAAAC,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,EAAgB,GAAIG,EAAIL,EAAaK,GAAK,OAAO,GAAG,EAC/DF,EAAa,KACXlD,EAAgB,CACd,YAAAE,EACA,QAAS,CACP,OAAQkD,EACR,MAAO,KAAK,IAAI,OAAOD,CAAQ,EAAG,OAAOJ,EAAcK,EAAI,EAAE,CAAC,CAChE,CACF,CAAC,CACH,EAIF,IAAMC,EAAY,MAAM,QAAQ,IAAIH,CAAY,EAChD,QAAWI,KAAQD,EACjBX,EAAM,aAAa,KAAK,GAAGY,CAAI,CAEnC,CAEA,OAAOZ,CACT","names":["getTransactions","args","aptosConfig","options","paginateWithCursor","getGasPriceEstimation","memoizeAsync","data","getAptosFullNode","getTransactionByVersion","ledgerVersion","getTransactionByHash","transactionHash","isTransactionPending","e","longWaitForTransaction","waitForTransaction","timeoutSecs","checkSuccess","isPending","timeElapsed","lastTxn","lastError","backoffIntervalMs","backoffMultiplier","handleAPIError","AptosApiError","startTime","sleep","WaitForTransactionError","FailedTransactionError","waitForIndexer","processorType","minimumLedgerVersion","timeoutMilliseconds","indexerVersion","getIndexerLastSuccessVersion","getProcessorStatus","message","lastSubmittedTransaction","transaction","getBlockByVersion","block","fillBlockTransactions","getBlockByHeight","blockHeight","firstVersion","lastVersion","curVersion","latestVersion","fetchFutures","pageSize","i","responses","txns"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/transactions/instances/rawTransaction.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/* eslint-disable @typescript-eslint/naming-convention */\n\nimport { Deserializer } from \"../../bcs/deserializer\";\nimport { Serializable, Serializer } from \"../../bcs/serializer\";\nimport { ChainId } from \"./chainId\";\nimport { AccountAddress } from \"../../core\";\nimport { TransactionPayload } from \"./transactionPayload\";\nimport { TransactionVariants } from \"../../types\";\n\n/**\n * Represents a raw transaction that can be serialized and deserialized.\n * Raw transactions contain the metadata and payloads that can be submitted to the Aptos chain for execution.\n * They must be signed before the Aptos chain can execute them.\n */\nexport class RawTransaction extends Serializable {\n public readonly sender: AccountAddress;\n\n public readonly sequence_number: bigint;\n\n public readonly payload: TransactionPayload;\n\n public readonly max_gas_amount: bigint;\n\n public readonly gas_unit_price: bigint;\n\n public readonly expiration_timestamp_secs: bigint;\n\n public readonly chain_id: ChainId;\n\n /**\n * RawTransactions contain the metadata and payloads that can be submitted to Aptos chain for execution.\n * RawTransactions must be signed before Aptos chain can execute them.\n *\n * @param sender The sender Account Address\n * @param sequence_number Sequence number of this transaction. This must match the sequence number stored in\n * the sender's account at the time the transaction executes.\n * @param payload Instructions for the Aptos Blockchain, including publishing a module,\n * execute an entry function or execute a script payload.\n * @param max_gas_amount Maximum total gas to spend for this transaction. The account must have more\n * than this gas or the transaction will be discarded during validation.\n * @param gas_unit_price Price to be paid per gas unit.\n * @param expiration_timestamp_secs The blockchain timestamp at which the blockchain would discard this transaction.\n * @param chain_id The chain ID of the blockchain that this transaction is intended to be run on.\n */\n constructor(\n sender: AccountAddress,\n sequence_number: bigint,\n payload: TransactionPayload,\n max_gas_amount: bigint,\n gas_unit_price: bigint,\n expiration_timestamp_secs: bigint,\n chain_id: ChainId,\n ) {\n super();\n this.sender = sender;\n this.sequence_number = sequence_number;\n this.payload = payload;\n this.max_gas_amount = max_gas_amount;\n this.gas_unit_price = gas_unit_price;\n this.expiration_timestamp_secs = expiration_timestamp_secs;\n this.chain_id = chain_id;\n }\n\n /**\n * Serializes the transaction data, including the fee payer transaction type, raw transaction, secondary signer addresses,\n * and fee payer address.\n * This function is essential for preparing the transaction for transmission or storage in a serialized format.\n *\n * @param serializer - The serializer instance used to serialize the transaction data.\n */\n serialize(serializer: Serializer): void {\n this.sender.serialize(serializer);\n serializer.serializeU64(this.sequence_number);\n this.payload.serialize(serializer);\n serializer.serializeU64(this.max_gas_amount);\n serializer.serializeU64(this.gas_unit_price);\n serializer.serializeU64(this.expiration_timestamp_secs);\n this.chain_id.serialize(serializer);\n }\n\n /**\n * Deserialize a Raw Transaction With Data.\n * This function retrieves the appropriate raw transaction based on the variant index provided by the deserializer.\n *\n * @param deserializer - An instance of the Deserializer used to read the serialized data.\n */\n static deserialize(deserializer: Deserializer): RawTransaction {\n const sender = AccountAddress.deserialize(deserializer);\n const sequence_number = deserializer.deserializeU64();\n const payload = TransactionPayload.deserialize(deserializer);\n const max_gas_amount = deserializer.deserializeU64();\n const gas_unit_price = deserializer.deserializeU64();\n const expiration_timestamp_secs = deserializer.deserializeU64();\n const chain_id = ChainId.deserialize(deserializer);\n return new RawTransaction(\n sender,\n sequence_number,\n payload,\n max_gas_amount,\n gas_unit_price,\n expiration_timestamp_secs,\n chain_id,\n );\n }\n}\n\n/**\n * Represents a raw transaction with associated data that can be serialized and deserialized.\n *\n * @extends Serializable\n */\nexport abstract class RawTransactionWithData extends Serializable {\n /**\n * Serialize a Raw Transaction With Data\n */\n abstract serialize(serializer: Serializer): void;\n\n /**\n * Deserialize a Raw Transaction With Data\n */\n static deserialize(deserializer: Deserializer): RawTransactionWithData {\n // index enum variant\n const index = deserializer.deserializeUleb128AsU32();\n switch (index) {\n case TransactionVariants.MultiAgentTransaction:\n return MultiAgentRawTransaction.load(deserializer);\n case TransactionVariants.FeePayerTransaction:\n return FeePayerRawTransaction.load(deserializer);\n default:\n throw new Error(`Unknown variant index for RawTransactionWithData: ${index}`);\n }\n }\n}\n\n/**\n * Represents a multi-agent transaction that can be serialized and deserialized.\n *\n * @extends RawTransactionWithData\n */\nexport class MultiAgentRawTransaction extends RawTransactionWithData {\n /**\n * The raw transaction\n */\n public readonly raw_txn: RawTransaction;\n\n /**\n * The secondary signers on this transaction\n */\n public readonly secondary_signer_addresses: Array<AccountAddress>;\n\n constructor(raw_txn: RawTransaction, secondary_signer_addresses: Array<AccountAddress>) {\n super();\n this.raw_txn = raw_txn;\n this.secondary_signer_addresses = secondary_signer_addresses;\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TransactionVariants.MultiAgentTransaction);\n this.raw_txn.serialize(serializer);\n serializer.serializeVector(this.secondary_signer_addresses);\n }\n\n /**\n * Deserializes a Fee Payer Raw Transaction from the provided deserializer.\n * This function allows you to reconstruct a Fee Payer Raw Transaction object, which includes the raw transaction data,\n * secondary signer addresses, and the fee payer address.\n *\n * @param deserializer - The deserializer used to read the raw transaction data.\n * @returns A FeePayerRawTransaction object constructed from the deserialized data.\n */\n static load(deserializer: Deserializer): MultiAgentRawTransaction {\n const rawTxn = RawTransaction.deserialize(deserializer);\n const secondarySignerAddresses = deserializer.deserializeVector(AccountAddress);\n\n return new MultiAgentRawTransaction(rawTxn, secondarySignerAddresses);\n }\n}\n\n/**\n * Represents a Fee Payer Transaction that can be serialized and deserialized.\n */\nexport class FeePayerRawTransaction extends RawTransactionWithData {\n /**\n * The raw transaction\n */\n public readonly raw_txn: RawTransaction;\n\n /**\n * The secondary signers on this transaction - optional and can be empty\n */\n public readonly secondary_signer_addresses: Array<AccountAddress>;\n\n /**\n * The fee payer account address\n */\n public readonly fee_payer_address: AccountAddress;\n\n constructor(\n raw_txn: RawTransaction,\n secondary_signer_addresses: Array<AccountAddress>,\n fee_payer_address: AccountAddress,\n ) {\n super();\n this.raw_txn = raw_txn;\n this.secondary_signer_addresses = secondary_signer_addresses;\n this.fee_payer_address = fee_payer_address;\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TransactionVariants.FeePayerTransaction);\n this.raw_txn.serialize(serializer);\n serializer.serializeVector(this.secondary_signer_addresses);\n this.fee_payer_address.serialize(serializer);\n }\n\n static load(deserializer: Deserializer): FeePayerRawTransaction {\n const rawTxn = RawTransaction.deserialize(deserializer);\n const secondarySignerAddresses = deserializer.deserializeVector(AccountAddress);\n const feePayerAddress = AccountAddress.deserialize(deserializer);\n\n return new FeePayerRawTransaction(rawTxn, secondarySignerAddresses, feePayerAddress);\n }\n}\n"],"mappings":"oKAiBO,IAAMA,EAAN,MAAMC,UAAuBC,CAAa,CA8B/C,YACEC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EAC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AUA,OAAO,KAAKC,EAAsD,CAChE,IAAMW,EAAStB,EAAe,YAAYW,CAAY,EAChDY,EAA2BZ,EAAa,kBAAkBC,CAAc,EAE9E,OAAO,IAAIO,EAAyBG,EAAQC,CAAwB,CACtE,CACF,EAKaL,EAAN,MAAMM,UAA+BT,CAAuB,CAgBjE,YACEK,EACAC,EACAI,EACA,CACA,MAAM,EACN,KAAK,QAAUL,EACf,KAAK,2BAA6BC,EAClC,KAAK,kBAAoBI,CAC3B,CAEA,UAAUf,EAA8B,CACtCA,EAAW,uBAA6D,EACxE,KAAK,QAAQ,UAAUA,CAAU,EACjCA,EAAW,gBAAgB,KAAK,0BAA0B,EAC1D,KAAK,kBAAkB,UAAUA,CAAU,CAC7C,CAEA,OAAO,KAAKC,EAAoD,CAC9D,IAAMW,EAAStB,EAAe,YAAYW,CAAY,EAChDY,EAA2BZ,EAAa,kBAAkBC,CAAc,EACxEc,EAAkBd,EAAe,YAAYD,CAAY,EAE/D,OAAO,IAAIa,EAAuBF,EAAQC,EAA0BG,CAAe,CACrF,CACF","names":["RawTransaction","_RawTransaction","Serializable","sender","sequence_number","payload","max_gas_amount","gas_unit_price","expiration_timestamp_secs","chain_id","serializer","deserializer","AccountAddress","TransactionPayload","ChainId","RawTransactionWithData","index","MultiAgentRawTransaction","FeePayerRawTransaction","_MultiAgentRawTransaction","raw_txn","secondary_signer_addresses","rawTxn","secondarySignerAddresses","_FeePayerRawTransaction","fee_payer_address","feePayerAddress"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/core/crypto/multiEd25519.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Deserializer, Serializer } from \"../../bcs\";\nimport { SigningScheme as AuthenticationKeyScheme } from \"../../types\";\nimport { AuthenticationKey } from \"../authenticationKey\";\nimport { Ed25519PublicKey, Ed25519Signature } from \"./ed25519\";\nimport { AccountPublicKey, VerifySignatureArgs } from \"./publicKey\";\nimport { Signature } from \"./signature\";\n\n/**\n * Represents the public key of a K-of-N Ed25519 multi-sig transaction.\n *\n * A K-of-N multi-sig transaction requires at least K out of N authorized signers to sign the transaction\n * for it to be executed. This class encapsulates the logic for managing the public keys and the threshold\n * for valid signatures.\n *\n * @see {@link https://aptos.dev/integration/creating-a-signed-transaction/ | Creating a Signed Transaction}\n */\nexport class MultiEd25519PublicKey extends AccountPublicKey {\n /**\n * Maximum number of public keys supported\n */\n static readonly MAX_KEYS = 32;\n\n /**\n * Minimum number of public keys needed\n */\n static readonly MIN_KEYS = 2;\n\n /**\n * Minimum threshold for the number of valid signatures required\n */\n static readonly MIN_THRESHOLD = 1;\n\n /**\n * List of Ed25519 public keys for this LegacyMultiEd25519PublicKey\n */\n public readonly publicKeys: Ed25519PublicKey[];\n\n /**\n * The minimum number of valid signatures required, for the number of public keys specified\n */\n public readonly threshold: number;\n\n /**\n * Public key for a K-of-N multi-sig transaction. A K-of-N multi-sig transaction means that for such a\n * transaction to be executed, at least K out of the N authorized signers have signed the transaction\n * and passed the check conducted by the chain.\n *\n * @see {@link\n * https://aptos.dev/integration/creating-a-signed-transaction/ | Creating a Signed Transaction}\n * @param args - A wrapper to let you choose the param order.\n * @param args.publicKeys A list of public keys\n * @param args.threshold At least \"threshold\" signatures must be valid\n */\n constructor(args: { publicKeys: Ed25519PublicKey[]; threshold: number }) {\n super();\n const { publicKeys, threshold } = args;\n\n // Validate number of public keys\n if (publicKeys.length > MultiEd25519PublicKey.MAX_KEYS || publicKeys.length < MultiEd25519PublicKey.MIN_KEYS) {\n throw new Error(\n `Must have between ${MultiEd25519PublicKey.MIN_KEYS} and ` +\n `${MultiEd25519PublicKey.MAX_KEYS} public keys, inclusive`,\n );\n }\n\n // Validate threshold: must be between 1 and the number of public keys, inclusive\n if (threshold < MultiEd25519PublicKey.MIN_THRESHOLD || threshold > publicKeys.length) {\n throw new Error(\n `Threshold must be between ${MultiEd25519PublicKey.MIN_THRESHOLD} and ${publicKeys.length}, inclusive`,\n );\n }\n\n this.publicKeys = publicKeys;\n this.threshold = threshold;\n }\n\n // region AccountPublicKey\n\n /**\n * Verifies a multi-signature against a given message.\n * This function ensures that the provided signatures meet the required threshold and are valid for the given message.\n *\n * @param args - The arguments for verifying the signature.\n * @param args.message - The message that was signed.\n * @param args.signature - The multi-signature containing multiple signatures and a bitmap indicating which signatures are valid.\n * @returns True if the signature is valid; otherwise, false.\n * @throws Error if the bitmap and signatures length mismatch or if there are not enough valid signatures.\n */\n verifySignature(args: VerifySignatureArgs): boolean {\n const { message, signature } = args;\n if (!(signature instanceof MultiEd25519Signature)) {\n return false;\n }\n\n const indices: number[] = [];\n for (let i = 0; i < 4; i += 1) {\n for (let j = 0; j < 8; j += 1) {\n // eslint-disable-next-line no-bitwise\n const bitIsSet = (signature.bitmap[i] & (1 << (7 - j))) !== 0;\n if (bitIsSet) {\n const index = i * 8 + j;\n indices.push(index);\n }\n }\n }\n\n if (indices.length !== signature.signatures.length) {\n throw new Error(\"Bitmap and signatures length mismatch\");\n }\n\n if (indices.length < this.threshold) {\n throw new Error(\"Not enough signatures\");\n }\n\n for (let i = 0; i < indices.length; i += 1) {\n const publicKey = this.publicKeys[indices[i]];\n if (!publicKey.verifySignature({ message, signature: signature.signatures[i] })) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Generates an authentication key based on the current instance's byte representation.\n * This function is essential for creating a secure authentication key that can be used for various cryptographic operations.\n *\n * @returns {AuthenticationKey} The generated authentication key.\n */\n authKey(): AuthenticationKey {\n return AuthenticationKey.fromSchemeAndBytes({\n scheme: AuthenticationKeyScheme.MultiEd25519,\n input: this.toUint8Array(),\n });\n }\n\n /**\n * Converts a PublicKeys into Uint8Array (bytes) with: bytes = p1_bytes | ... | pn_bytes | threshold\n */\n toUint8Array(): Uint8Array {\n const bytes = new Uint8Array(this.publicKeys.length * Ed25519PublicKey.LENGTH + 1);\n this.publicKeys.forEach((k: Ed25519PublicKey, i: number) => {\n bytes.set(k.toUint8Array(), i * Ed25519PublicKey.LENGTH);\n });\n\n bytes[this.publicKeys.length * Ed25519PublicKey.LENGTH] = this.threshold;\n\n return bytes;\n }\n\n // endregion\n\n // region Serializable\n\n /**\n * Serializes the current instance into bytes using the provided serializer.\n * This allows for the conversion of the instance's data into a format suitable for transmission or storage.\n *\n * @param serializer - The serializer used to convert the instance into bytes.\n */\n serialize(serializer: Serializer): void {\n serializer.serializeBytes(this.toUint8Array());\n }\n\n /**\n * Deserializes a MultiEd25519Signature from the provided deserializer.\n * This function helps in reconstructing a MultiEd25519Signature object from its serialized byte representation.\n *\n * @param deserializer - The deserializer instance used to read the serialized data.\n */\n static deserialize(deserializer: Deserializer): MultiEd25519PublicKey {\n const bytes = deserializer.deserializeBytes();\n const threshold = bytes[bytes.length - 1];\n\n const keys: Ed25519PublicKey[] = [];\n\n for (let i = 0; i < bytes.length - 1; i += Ed25519PublicKey.LENGTH) {\n const begin = i;\n keys.push(new Ed25519PublicKey(bytes.subarray(begin, begin + Ed25519PublicKey.LENGTH)));\n }\n return new MultiEd25519PublicKey({ publicKeys: keys, threshold });\n }\n\n // endregion\n}\n\n/**\n * Represents the signature of a K-of-N Ed25519 multi-sig transaction.\n *\n * @see {@link https://aptos.dev/integration/creating-a-signed-transaction/#multisignature-transactions | Creating a Signed Transaction}\n */\nexport class MultiEd25519Signature extends Signature {\n /**\n * Maximum number of Ed25519 signatures supported\n */\n static MAX_SIGNATURES_SUPPORTED = 32;\n\n /**\n * Number of bytes in the bitmap representing who signed the transaction (32-bits)\n */\n static BITMAP_LEN: number = 4;\n\n /**\n * The list of underlying Ed25519 signatures\n */\n public readonly signatures: Ed25519Signature[];\n\n /**\n * 32-bit Bitmap representing who signed the transaction\n *\n * This is represented where each public key can be masked to determine whether the message was signed by that key.\n */\n public readonly bitmap: Uint8Array;\n\n /**\n * Signature for a K-of-N multi-sig transaction.\n *\n * @see {@link\n * https://aptos.dev/integration/creating-a-signed-transaction/#multisignature-transactions | Creating a Signed Transaction}\n *\n * @param args.signatures A list of signatures\n * @param args.bitmap 4 bytes, at most 32 signatures are supported. If Nth bit value is `1`, the Nth\n * signature should be provided in `signatures`. Bits are read from left to right.\n * Alternatively, you can specify an array of bitmap positions.\n * Valid position should range between 0 and 31.\n * @see MultiEd25519Signature.createBitmap\n */\n constructor(args: { signatures: Ed25519Signature[]; bitmap: Uint8Array | number[] }) {\n super();\n const { signatures, bitmap } = args;\n\n if (signatures.length > MultiEd25519Signature.MAX_SIGNATURES_SUPPORTED) {\n throw new Error(\n `The number of signatures cannot be greater than ${MultiEd25519Signature.MAX_SIGNATURES_SUPPORTED}`,\n );\n }\n this.signatures = signatures;\n\n if (!(bitmap instanceof Uint8Array)) {\n this.bitmap = MultiEd25519Signature.createBitmap({ bits: bitmap });\n } else if (bitmap.length !== MultiEd25519Signature.BITMAP_LEN) {\n throw new Error(`\"bitmap\" length should be ${MultiEd25519Signature.BITMAP_LEN}`);\n } else {\n this.bitmap = bitmap;\n }\n }\n\n // region AccountSignature\n\n /**\n * Converts a MultiSignature into Uint8Array (bytes) with `bytes = s1_bytes | ... | sn_bytes | bitmap`\n */\n toUint8Array(): Uint8Array {\n const bytes = new Uint8Array(this.signatures.length * Ed25519Signature.LENGTH + MultiEd25519Signature.BITMAP_LEN);\n this.signatures.forEach((k: Ed25519Signature, i: number) => {\n bytes.set(k.toUint8Array(), i * Ed25519Signature.LENGTH);\n });\n\n bytes.set(this.bitmap, this.signatures.length * Ed25519Signature.LENGTH);\n\n return bytes;\n }\n\n // endregion\n\n // region Serializable\n\n serialize(serializer: Serializer): void {\n serializer.serializeBytes(this.toUint8Array());\n }\n\n static deserialize(deserializer: Deserializer): MultiEd25519Signature {\n const bytes = deserializer.deserializeBytes();\n const bitmap = bytes.subarray(bytes.length - 4);\n\n const signatures: Ed25519Signature[] = [];\n\n for (let i = 0; i < bytes.length - bitmap.length; i += Ed25519Signature.LENGTH) {\n const begin = i;\n signatures.push(new Ed25519Signature(bytes.subarray(begin, begin + Ed25519Signature.LENGTH)));\n }\n return new MultiEd25519Signature({ signatures, bitmap });\n }\n\n // endregion\n\n /**\n * Helper method to create a bitmap out of the specified bit positions.\n * This function allows you to set specific bits in a 32-bit long bitmap based on the provided positions.\n *\n * @param args The arguments for creating the bitmap.\n * @param args.bits The bitmap positions that should be set. A position starts at index 0. Valid positions should range between 0 and 31.\n *\n * @example\n * Here's an example of valid `bits`\n * ```\n * [0, 2, 31]\n * ```\n * `[0, 2, 31]` means the 1st, 3rd and 32nd bits should be set in the bitmap.\n * The result bitmap should be 0b1010000000000000000000000000001\n *\n * @returns bitmap that is 32 bits long.\n */\n static createBitmap(args: { bits: number[] }): Uint8Array {\n const { bits } = args;\n // Bits are read from left to right. e.g. 0b10000000 represents the first bit is set in one byte.\n // The decimal value of 0b10000000 is 128.\n const firstBitInByte = 128;\n const bitmap = new Uint8Array([0, 0, 0, 0]);\n\n // Check if duplicates exist in bits\n const dupCheckSet = new Set();\n\n bits.forEach((bit: number, index) => {\n if (bit >= MultiEd25519Signature.MAX_SIGNATURES_SUPPORTED) {\n throw new Error(`Cannot have a signature larger than ${MultiEd25519Signature.MAX_SIGNATURES_SUPPORTED - 1}.`);\n }\n\n if (dupCheckSet.has(bit)) {\n throw new Error(\"Duplicate bits detected.\");\n }\n\n if (index > 0 && bit <= bits[index - 1]) {\n throw new Error(\"The bits need to be sorted in ascending order.\");\n }\n\n dupCheckSet.add(bit);\n\n const byteOffset = Math.floor(bit / 8);\n\n let byte = bitmap[byteOffset];\n\n // eslint-disable-next-line no-bitwise\n byte |= firstBitInByte >> bit % 8;\n\n bitmap[byteOffset] = byte;\n });\n\n return bitmap;\n }\n}\n"],"mappings":"2KAmBO,IAAMA,EAAN,MAAMA,UAA8BC,CAAiB,CAqC1D,YAAYC,EAA6D,CACvE,MAAM,EACN,GAAM,CAAE,WAAAC,EAAY,UAAAC,CAAU,EAAIF,EAGlC,GAAIC,EAAW,OAASH,EAAsB,UAAYG,EAAW,OAASH,EAAsB,SAClG,MAAM,IAAI,MACR,qBAAqBA,EAA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EAANc","names":["_MultiEd25519PublicKey","AccountPublicKey","args","publicKeys","threshold","message","signature","MultiEd25519Signature","indices","j","index","AuthenticationKey","bytes","Ed25519PublicKey","k","i","serializer","deserializer","keys","begin","MultiEd25519PublicKey","_MultiEd25519Signature","Signature","signatures","bitmap","Ed25519Signature","bits","firstBitInByte","dupCheckSet","bit","byteOffset","byte"]}
@@ -1,2 +0,0 @@
1
- var o="1.33.1";export{o as a};
2
- //# sourceMappingURL=chunk-YD2BMHH7.mjs.map