@aptos-labs/ts-sdk 1.32.0 → 1.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (414) hide show
  1. package/dist/common/{accountAddress-6RqI8Aam.d.ts → accountAddress-fJZJVSBc.d.ts} +2 -1
  2. package/dist/common/chunk-F43XVDYJ.js.map +1 -1
  3. package/dist/common/cli/index.d.ts +1 -1
  4. package/dist/common/cli/index.js.map +1 -1
  5. package/dist/common/index.d.ts +31 -116
  6. package/dist/common/index.js +31 -31
  7. package/dist/common/index.js.map +1 -1
  8. package/dist/esm/account/AbstractKeylessAccount.d.mts +0 -1
  9. package/dist/esm/account/AbstractKeylessAccount.mjs +1 -1
  10. package/dist/esm/account/Account.d.mts +0 -1
  11. package/dist/esm/account/Account.mjs +1 -1
  12. package/dist/esm/account/Ed25519Account.d.mts +0 -1
  13. package/dist/esm/account/Ed25519Account.mjs +1 -1
  14. package/dist/esm/account/EphemeralKeyPair.d.mts +0 -1
  15. package/dist/esm/account/EphemeralKeyPair.mjs +1 -1
  16. package/dist/esm/account/FederatedKeylessAccount.d.mts +0 -1
  17. package/dist/esm/account/FederatedKeylessAccount.mjs +1 -1
  18. package/dist/esm/account/KeylessAccount.d.mts +0 -1
  19. package/dist/esm/account/KeylessAccount.mjs +1 -1
  20. package/dist/esm/account/MultiKeyAccount.d.mts +0 -1
  21. package/dist/esm/account/MultiKeyAccount.mjs +1 -1
  22. package/dist/esm/account/SingleKeyAccount.d.mts +0 -1
  23. package/dist/esm/account/SingleKeyAccount.mjs +1 -1
  24. package/dist/esm/account/index.d.mts +0 -1
  25. package/dist/esm/account/index.mjs +1 -1
  26. package/dist/esm/api/account.d.mts +0 -1
  27. package/dist/esm/api/account.mjs +1 -1
  28. package/dist/esm/api/ans.d.mts +0 -1
  29. package/dist/esm/api/ans.mjs +1 -1
  30. package/dist/esm/api/aptos.d.mts +0 -2
  31. package/dist/esm/api/aptos.mjs +1 -1
  32. package/dist/esm/api/aptosConfig.d.mts +0 -1
  33. package/dist/esm/api/aptosConfig.mjs +1 -1
  34. package/dist/esm/api/coin.d.mts +0 -1
  35. package/dist/esm/api/coin.mjs +1 -1
  36. package/dist/esm/api/digitalAsset.d.mts +0 -1
  37. package/dist/esm/api/digitalAsset.mjs +1 -1
  38. package/dist/esm/api/event.d.mts +0 -1
  39. package/dist/esm/api/event.mjs +1 -1
  40. package/dist/esm/api/faucet.d.mts +0 -1
  41. package/dist/esm/api/faucet.mjs +1 -1
  42. package/dist/esm/api/fungibleAsset.d.mts +0 -1
  43. package/dist/esm/api/fungibleAsset.mjs +1 -1
  44. package/dist/esm/api/general.d.mts +0 -1
  45. package/dist/esm/api/general.mjs +1 -1
  46. package/dist/esm/api/index.d.mts +0 -2
  47. package/dist/esm/api/index.mjs +1 -1
  48. package/dist/esm/api/keyless.d.mts +0 -1
  49. package/dist/esm/api/keyless.mjs +1 -1
  50. package/dist/esm/api/object.d.mts +0 -1
  51. package/dist/esm/api/object.mjs +1 -1
  52. package/dist/esm/api/staking.d.mts +0 -1
  53. package/dist/esm/api/staking.mjs +1 -1
  54. package/dist/esm/api/table.d.mts +0 -1
  55. package/dist/esm/api/table.mjs +1 -1
  56. package/dist/esm/api/transaction.d.mts +0 -2
  57. package/dist/esm/api/transaction.mjs +1 -1
  58. package/dist/esm/api/transactionSubmission/build.d.mts +0 -66
  59. package/dist/esm/api/transactionSubmission/build.mjs +1 -1
  60. package/dist/esm/api/transactionSubmission/helpers.mjs +1 -1
  61. package/dist/esm/api/transactionSubmission/management.d.mts +0 -1
  62. package/dist/esm/api/transactionSubmission/management.mjs +1 -1
  63. package/dist/esm/api/transactionSubmission/sign.d.mts +0 -1
  64. package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
  65. package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -1
  66. package/dist/esm/api/transactionSubmission/simulate.d.mts +9 -9
  67. package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
  68. package/dist/esm/api/transactionSubmission/submit.d.mts +0 -1
  69. package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
  70. package/dist/esm/api/utils.d.mts +0 -1
  71. package/dist/esm/api/utils.mjs +1 -1
  72. package/dist/esm/bcs/consts.d.mts +0 -1
  73. package/dist/esm/bcs/deserializer.d.mts +0 -1
  74. package/dist/esm/bcs/index.d.mts +0 -1
  75. package/dist/esm/bcs/index.mjs +1 -1
  76. package/dist/esm/bcs/serializable/entryFunctionBytes.d.mts +0 -1
  77. package/dist/esm/bcs/serializable/fixedBytes.d.mts +0 -1
  78. package/dist/esm/bcs/serializable/movePrimitives.d.mts +0 -1
  79. package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
  80. package/dist/esm/bcs/serializable/moveStructs.d.mts +0 -1
  81. package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
  82. package/dist/esm/bcs/serializer.d.mts +0 -1
  83. package/dist/esm/{chunk-NHKAQRJB.mjs → chunk-2D7OMWVL.mjs} +2 -2
  84. package/dist/esm/{chunk-HEHVWRMO.mjs → chunk-2E3BT4YW.mjs} +2 -2
  85. package/dist/esm/{chunk-AHWZA3GD.mjs → chunk-476F5NJ6.mjs} +2 -2
  86. package/dist/esm/chunk-476F5NJ6.mjs.map +1 -0
  87. package/dist/esm/{chunk-IBMZYDAR.mjs → chunk-4IQZOAN7.mjs} +2 -2
  88. package/dist/esm/{chunk-6K4TOFCO.mjs → chunk-4ULPBQ3M.mjs} +2 -2
  89. package/dist/esm/{chunk-4DNCQM3S.mjs → chunk-4ZNSNWQL.mjs} +2 -2
  90. package/dist/esm/{chunk-WSFHH3BK.mjs → chunk-5O3RHPER.mjs} +2 -2
  91. package/dist/esm/{chunk-ZRWZIAF5.mjs → chunk-5XLZACVT.mjs} +2 -2
  92. package/dist/esm/{chunk-JDNI5VIJ.mjs → chunk-64IZ5PQR.mjs} +2 -2
  93. package/dist/esm/{chunk-DP3YPGIK.mjs → chunk-6AEXQEO2.mjs} +2 -2
  94. package/dist/esm/{chunk-AAATWCJT.mjs → chunk-737YW3CY.mjs} +2 -2
  95. package/dist/esm/{chunk-K4TJRYGQ.mjs → chunk-7ZA434Z3.mjs} +2 -2
  96. package/dist/esm/{chunk-E2NYQVP3.mjs → chunk-7ZVXQAG4.mjs} +2 -2
  97. package/dist/esm/{chunk-L2QVUMBV.mjs → chunk-A3USS2NC.mjs} +2 -2
  98. package/dist/esm/{chunk-2NHQQQZK.mjs → chunk-A7TJF3BX.mjs} +2 -2
  99. package/dist/esm/{chunk-XT5T5LAP.mjs → chunk-ALOYOMRE.mjs} +2 -2
  100. package/dist/esm/{chunk-XUP6VABV.mjs → chunk-B5BXB2BB.mjs} +2 -2
  101. package/dist/esm/{chunk-37Y54PJ5.mjs → chunk-BWV6OYLG.mjs} +2 -2
  102. package/dist/esm/{chunk-PW3ISXPN.mjs → chunk-CK5NDXQT.mjs} +2 -2
  103. package/dist/esm/{chunk-X3JPX7T6.mjs → chunk-D54FD6XE.mjs} +2 -2
  104. package/dist/esm/chunk-FD6FGKYY.mjs +1 -0
  105. package/dist/esm/{chunk-IDNDUJOK.mjs → chunk-FH27D7S3.mjs} +2 -2
  106. package/dist/esm/{chunk-DDVOBEJA.mjs → chunk-FSBEKFEF.mjs} +2 -2
  107. package/dist/esm/{chunk-YPBNYKOD.mjs → chunk-FUC7SLH7.mjs} +2 -2
  108. package/dist/esm/{chunk-46L6BAJG.mjs → chunk-GT7QFXER.mjs} +2 -2
  109. package/dist/esm/{chunk-H457BI3I.mjs → chunk-H7PDLUNP.mjs} +2 -2
  110. package/dist/esm/{chunk-CA3Q2X6B.mjs → chunk-HKVZ7CAG.mjs} +2 -2
  111. package/dist/esm/{chunk-JJUINAQE.mjs → chunk-HULCIESG.mjs} +2 -2
  112. package/dist/esm/chunk-HULCIESG.mjs.map +1 -0
  113. package/dist/esm/{chunk-QQM47PHZ.mjs → chunk-I3452DF5.mjs} +2 -2
  114. package/dist/esm/chunk-I5OYNCZS.mjs +1 -0
  115. package/dist/esm/chunk-IHGA5KAD.mjs +2 -0
  116. package/dist/esm/{chunk-I2NMCLNW.mjs.map → chunk-IHGA5KAD.mjs.map} +1 -1
  117. package/dist/esm/{chunk-J245N3XF.mjs → chunk-J7PJSK3J.mjs} +2 -2
  118. package/dist/esm/{chunk-J245N3XF.mjs.map → chunk-J7PJSK3J.mjs.map} +1 -1
  119. package/dist/esm/{chunk-VCY3JGZM.mjs → chunk-JKA22FG5.mjs} +2 -2
  120. package/dist/esm/{chunk-SBCLBDCP.mjs → chunk-JUQBFGUD.mjs} +2 -2
  121. package/dist/esm/{chunk-II654QZU.mjs → chunk-JYGAG754.mjs} +2 -2
  122. package/dist/esm/{chunk-LAAFLCDM.mjs → chunk-KKLF7DQV.mjs} +2 -2
  123. package/dist/esm/chunk-KPPM2BSC.mjs +2 -0
  124. package/dist/esm/chunk-KPPM2BSC.mjs.map +1 -0
  125. package/dist/esm/{chunk-JLD7DLKM.mjs → chunk-L3J2QVIY.mjs} +2 -2
  126. package/dist/esm/{chunk-MOGPSSTD.mjs → chunk-LK67PZX3.mjs} +2 -2
  127. package/dist/esm/{chunk-6LLGRGCN.mjs → chunk-LRN4ALMT.mjs} +2 -2
  128. package/dist/esm/{chunk-BLLHTGAP.mjs → chunk-LWXBEIFO.mjs} +2 -2
  129. package/dist/esm/{chunk-7WXDXBXK.mjs → chunk-LZ5PSDOS.mjs} +2 -2
  130. package/dist/esm/chunk-MCWOKFVH.mjs +2 -0
  131. package/dist/esm/chunk-MCWOKFVH.mjs.map +1 -0
  132. package/dist/esm/{chunk-GBVRCWCD.mjs → chunk-MV5PGWJQ.mjs} +2 -2
  133. package/dist/esm/{chunk-4YEOOZ2N.mjs → chunk-MWNYODWU.mjs} +2 -2
  134. package/dist/esm/{chunk-YNT7JHMS.mjs → chunk-O4MRRWRI.mjs} +2 -2
  135. package/dist/esm/chunk-OEM75TVE.mjs +2 -0
  136. package/dist/esm/chunk-OEM75TVE.mjs.map +1 -0
  137. package/dist/esm/{chunk-F2AIWA7L.mjs → chunk-OGBU52BQ.mjs} +2 -2
  138. package/dist/esm/{chunk-KT3DT5GV.mjs → chunk-P6RNNESB.mjs} +2 -2
  139. package/dist/esm/{chunk-WGIYSLH6.mjs → chunk-P74XXLE4.mjs} +2 -2
  140. package/dist/esm/{chunk-TM7OZT3W.mjs → chunk-Q3CWUEXI.mjs} +2 -2
  141. package/dist/esm/{chunk-OJBMR5CT.mjs → chunk-QK32EQSF.mjs} +2 -2
  142. package/dist/esm/{chunk-NARS3JDH.mjs → chunk-QLC7SSLJ.mjs} +2 -2
  143. package/dist/esm/chunk-QN7AK5PU.mjs +2 -0
  144. package/dist/esm/chunk-QN7AK5PU.mjs.map +1 -0
  145. package/dist/esm/{chunk-3XCYCFYI.mjs → chunk-QZT2M7UA.mjs} +2 -2
  146. package/dist/esm/{chunk-HXXELLHN.mjs → chunk-R2YT2IM5.mjs} +2 -2
  147. package/dist/esm/{chunk-HFWFDS6Y.mjs → chunk-RV7PNWDY.mjs} +2 -2
  148. package/dist/esm/{chunk-SU2WB34N.mjs → chunk-S22QVNK7.mjs} +2 -2
  149. package/dist/esm/{chunk-2QBCTW67.mjs → chunk-S3YVCCYI.mjs} +2 -2
  150. package/dist/esm/{chunk-KUL55M2H.mjs → chunk-SMFTISPN.mjs} +2 -2
  151. package/dist/esm/{chunk-FXUI3SSD.mjs → chunk-TQA6HY6A.mjs} +2 -2
  152. package/dist/esm/{chunk-L2SDI7PI.mjs → chunk-TTERI67T.mjs} +2 -2
  153. package/dist/esm/chunk-U2PRGW4O.mjs +2 -0
  154. package/dist/esm/chunk-U2PRGW4O.mjs.map +1 -0
  155. package/dist/esm/{chunk-DSKAMBBL.mjs → chunk-U7UTBXJD.mjs} +2 -2
  156. package/dist/esm/{chunk-5NJWJXSS.mjs → chunk-VAKNMHOA.mjs} +2 -2
  157. package/dist/esm/{chunk-ONFKJ57C.mjs → chunk-VELQA2Y3.mjs} +2 -2
  158. package/dist/esm/chunk-WTWWJWKC.mjs +2 -0
  159. package/dist/esm/chunk-WTWWJWKC.mjs.map +1 -0
  160. package/dist/esm/{chunk-AVPQOD67.mjs → chunk-WXLSHECY.mjs} +2 -2
  161. package/dist/esm/{chunk-OKE3FXIP.mjs → chunk-XOOYRVFK.mjs} +2 -2
  162. package/dist/esm/{chunk-6PJH53CK.mjs → chunk-XVPWTWPY.mjs} +2 -2
  163. package/dist/esm/{chunk-KA5FX53Q.mjs → chunk-Y5HLXDYG.mjs} +2 -2
  164. package/dist/esm/{chunk-5AKSORBJ.mjs → chunk-YITOC4Z6.mjs} +2 -2
  165. package/dist/esm/chunk-YQHOQJRQ.mjs +2 -0
  166. package/dist/esm/{chunk-AMCJQIOT.mjs.map → chunk-YQHOQJRQ.mjs.map} +1 -1
  167. package/dist/esm/{chunk-WKNX43KN.mjs → chunk-YT3IP57B.mjs} +2 -2
  168. package/dist/esm/cli/index.d.mts +0 -1
  169. package/dist/esm/cli/move.d.mts +0 -1
  170. package/dist/esm/client/core.d.mts +0 -1
  171. package/dist/esm/client/core.mjs +1 -1
  172. package/dist/esm/client/get.d.mts +0 -1
  173. package/dist/esm/client/get.mjs +1 -1
  174. package/dist/esm/client/index.d.mts +0 -1
  175. package/dist/esm/client/index.mjs +1 -1
  176. package/dist/esm/client/post.d.mts +0 -1
  177. package/dist/esm/client/post.mjs +1 -1
  178. package/dist/esm/core/account/index.d.mts +0 -1
  179. package/dist/esm/core/account/index.mjs +1 -1
  180. package/dist/esm/core/account/utils/address.d.mts +0 -1
  181. package/dist/esm/core/account/utils/address.mjs +1 -1
  182. package/dist/esm/core/account/utils/index.d.mts +0 -1
  183. package/dist/esm/core/account/utils/index.mjs +1 -1
  184. package/dist/esm/core/accountAddress.d.mts +0 -1
  185. package/dist/esm/core/accountAddress.mjs +1 -1
  186. package/dist/esm/core/authenticationKey.d.mts +0 -1
  187. package/dist/esm/core/authenticationKey.mjs +1 -1
  188. package/dist/esm/core/crypto/ed25519.d.mts +0 -1
  189. package/dist/esm/core/crypto/ed25519.mjs +1 -1
  190. package/dist/esm/core/crypto/ephemeral.d.mts +0 -1
  191. package/dist/esm/core/crypto/ephemeral.mjs +1 -1
  192. package/dist/esm/core/crypto/federatedKeyless.d.mts +0 -1
  193. package/dist/esm/core/crypto/federatedKeyless.mjs +1 -1
  194. package/dist/esm/core/crypto/index.d.mts +0 -1
  195. package/dist/esm/core/crypto/index.mjs +1 -1
  196. package/dist/esm/core/crypto/keyless.d.mts +0 -1
  197. package/dist/esm/core/crypto/keyless.mjs +1 -1
  198. package/dist/esm/core/crypto/multiEd25519.d.mts +0 -1
  199. package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
  200. package/dist/esm/core/crypto/multiKey.d.mts +0 -1
  201. package/dist/esm/core/crypto/multiKey.mjs +1 -1
  202. package/dist/esm/core/crypto/privateKey.d.mts +0 -1
  203. package/dist/esm/core/crypto/privateKey.mjs +1 -1
  204. package/dist/esm/core/crypto/proof.d.mts +0 -1
  205. package/dist/esm/core/crypto/proof.mjs +1 -1
  206. package/dist/esm/core/crypto/publicKey.d.mts +0 -1
  207. package/dist/esm/core/crypto/publicKey.mjs +1 -1
  208. package/dist/esm/core/crypto/secp256k1.d.mts +0 -1
  209. package/dist/esm/core/crypto/secp256k1.mjs +1 -1
  210. package/dist/esm/core/crypto/signature.d.mts +0 -1
  211. package/dist/esm/core/crypto/signature.mjs +1 -1
  212. package/dist/esm/core/crypto/singleKey.d.mts +0 -1
  213. package/dist/esm/core/crypto/singleKey.mjs +1 -1
  214. package/dist/esm/core/crypto/utils.d.mts +0 -1
  215. package/dist/esm/core/hex.d.mts +0 -1
  216. package/dist/esm/core/index.d.mts +0 -1
  217. package/dist/esm/core/index.mjs +1 -1
  218. package/dist/esm/errors/index.d.mts +0 -1
  219. package/dist/esm/errors/index.mjs +1 -1
  220. package/dist/esm/index.d.mts +4 -6
  221. package/dist/esm/index.mjs +1 -1
  222. package/dist/esm/internal/account.d.mts +0 -1
  223. package/dist/esm/internal/account.mjs +1 -1
  224. package/dist/esm/internal/ans.d.mts +0 -1
  225. package/dist/esm/internal/ans.mjs +1 -1
  226. package/dist/esm/internal/coin.d.mts +0 -1
  227. package/dist/esm/internal/coin.mjs +1 -1
  228. package/dist/esm/internal/digitalAsset.d.mts +0 -1
  229. package/dist/esm/internal/digitalAsset.mjs +1 -1
  230. package/dist/esm/internal/event.d.mts +0 -1
  231. package/dist/esm/internal/event.mjs +1 -1
  232. package/dist/esm/internal/faucet.d.mts +0 -1
  233. package/dist/esm/internal/faucet.mjs +1 -1
  234. package/dist/esm/internal/fungibleAsset.d.mts +0 -1
  235. package/dist/esm/internal/fungibleAsset.mjs +1 -1
  236. package/dist/esm/internal/general.d.mts +0 -1
  237. package/dist/esm/internal/general.mjs +1 -1
  238. package/dist/esm/internal/keyless.d.mts +0 -1
  239. package/dist/esm/internal/keyless.mjs +1 -1
  240. package/dist/esm/internal/object.d.mts +0 -1
  241. package/dist/esm/internal/object.mjs +1 -1
  242. package/dist/esm/internal/staking.d.mts +0 -1
  243. package/dist/esm/internal/staking.mjs +1 -1
  244. package/dist/esm/internal/table.d.mts +0 -1
  245. package/dist/esm/internal/table.mjs +1 -1
  246. package/dist/esm/internal/transaction.d.mts +0 -1
  247. package/dist/esm/internal/transaction.mjs +1 -1
  248. package/dist/esm/internal/transactionSubmission.d.mts +1 -2
  249. package/dist/esm/internal/transactionSubmission.mjs +1 -1
  250. package/dist/esm/internal/view.d.mts +0 -1
  251. package/dist/esm/internal/view.mjs +1 -1
  252. package/dist/esm/transactions/authenticator/account.d.mts +10 -2
  253. package/dist/esm/transactions/authenticator/account.mjs +1 -1
  254. package/dist/esm/transactions/authenticator/index.d.mts +1 -2
  255. package/dist/esm/transactions/authenticator/index.mjs +1 -1
  256. package/dist/esm/transactions/authenticator/transaction.d.mts +0 -1
  257. package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
  258. package/dist/esm/transactions/index.d.mts +3 -5
  259. package/dist/esm/transactions/index.mjs +1 -1
  260. package/dist/esm/transactions/instances/chainId.d.mts +0 -1
  261. package/dist/esm/transactions/instances/identifier.d.mts +0 -1
  262. package/dist/esm/transactions/instances/index.d.mts +0 -1
  263. package/dist/esm/transactions/instances/index.mjs +1 -1
  264. package/dist/esm/transactions/instances/moduleId.d.mts +0 -1
  265. package/dist/esm/transactions/instances/moduleId.mjs +1 -1
  266. package/dist/esm/transactions/instances/multiAgentTransaction.d.mts +0 -1
  267. package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
  268. package/dist/esm/transactions/instances/rawTransaction.d.mts +0 -1
  269. package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
  270. package/dist/esm/transactions/instances/rotationProofChallenge.d.mts +0 -1
  271. package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
  272. package/dist/esm/transactions/instances/signedTransaction.d.mts +0 -1
  273. package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
  274. package/dist/esm/transactions/instances/simpleTransaction.d.mts +0 -1
  275. package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
  276. package/dist/esm/transactions/instances/transactionArgument.d.mts +0 -1
  277. package/dist/esm/transactions/instances/transactionPayload.d.mts +0 -1
  278. package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
  279. package/dist/esm/transactions/management/accountSequenceNumber.d.mts +0 -1
  280. package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
  281. package/dist/esm/transactions/management/index.d.mts +0 -1
  282. package/dist/esm/transactions/management/index.mjs +1 -1
  283. package/dist/esm/transactions/management/transactionWorker.d.mts +0 -1
  284. package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
  285. package/dist/esm/transactions/transactionBuilder/helpers.d.mts +0 -1
  286. package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
  287. package/dist/esm/transactions/transactionBuilder/index.d.mts +1 -2
  288. package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
  289. package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +2 -23
  290. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
  291. package/dist/esm/transactions/transactionBuilder/signingMessage.d.mts +0 -1
  292. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
  293. package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +2 -3
  294. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
  295. package/dist/esm/transactions/typeTag/index.d.mts +0 -1
  296. package/dist/esm/transactions/typeTag/index.mjs +1 -1
  297. package/dist/esm/transactions/typeTag/parser.d.mts +0 -1
  298. package/dist/esm/transactions/typeTag/parser.mjs +1 -1
  299. package/dist/esm/transactions/types.d.mts +4 -12
  300. package/dist/esm/types/index.d.mts +0 -1
  301. package/dist/esm/types/index.mjs +1 -1
  302. package/dist/esm/types/types.d.mts +2 -2
  303. package/dist/esm/types/types.mjs +1 -1
  304. package/dist/esm/utils/const.d.mts +7 -1
  305. package/dist/esm/utils/const.mjs +1 -1
  306. package/dist/esm/utils/helpers.d.mts +0 -1
  307. package/dist/esm/utils/index.d.mts +1 -2
  308. package/dist/esm/utils/index.mjs +1 -1
  309. package/dist/esm/utils/normalizeBundle.d.mts +0 -1
  310. package/dist/esm/utils/normalizeBundle.mjs +1 -1
  311. package/dist/esm/version.d.mts +1 -1
  312. package/dist/esm/version.mjs +1 -1
  313. package/package.json +2 -3
  314. package/src/api/transactionSubmission/build.ts +1 -82
  315. package/src/api/transactionSubmission/helpers.ts +0 -6
  316. package/src/api/transactionSubmission/simulate.ts +9 -8
  317. package/src/internal/keyless.ts +11 -1
  318. package/src/internal/transactionSubmission.ts +1 -1
  319. package/src/transactions/authenticator/account.ts +19 -0
  320. package/src/transactions/index.ts +0 -1
  321. package/src/transactions/transactionBuilder/remoteAbi.ts +1 -55
  322. package/src/transactions/transactionBuilder/transactionBuilder.ts +25 -17
  323. package/src/transactions/types.ts +3 -13
  324. package/src/types/index.ts +0 -1
  325. package/src/types/types.ts +1 -0
  326. package/src/utils/const.ts +7 -0
  327. package/src/version.ts +1 -1
  328. package/dist/esm/chunk-3DQVGPFE.mjs +0 -2
  329. package/dist/esm/chunk-3DQVGPFE.mjs.map +0 -1
  330. package/dist/esm/chunk-4PBXTMN3.mjs +0 -2
  331. package/dist/esm/chunk-4PBXTMN3.mjs.map +0 -1
  332. package/dist/esm/chunk-AHWZA3GD.mjs.map +0 -1
  333. package/dist/esm/chunk-AMCJQIOT.mjs +0 -2
  334. package/dist/esm/chunk-EEB7EZFO.mjs +0 -2
  335. package/dist/esm/chunk-EEB7EZFO.mjs.map +0 -1
  336. package/dist/esm/chunk-G2GN4LH5.mjs +0 -2
  337. package/dist/esm/chunk-G2GN4LH5.mjs.map +0 -1
  338. package/dist/esm/chunk-I2NMCLNW.mjs +0 -2
  339. package/dist/esm/chunk-JJUINAQE.mjs.map +0 -1
  340. package/dist/esm/chunk-L56DQ4N3.mjs +0 -2
  341. package/dist/esm/chunk-L56DQ4N3.mjs.map +0 -1
  342. package/dist/esm/chunk-UIRAXHDH.mjs +0 -1
  343. package/dist/esm/chunk-WQF3IOXC.mjs +0 -2
  344. package/dist/esm/chunk-WQF3IOXC.mjs.map +0 -1
  345. package/dist/esm/chunk-XKOSS5KC.mjs +0 -2
  346. package/dist/esm/chunk-XKOSS5KC.mjs.map +0 -1
  347. package/dist/esm/chunk-YZ3YPLEU.mjs +0 -2
  348. package/dist/esm/chunk-YZ3YPLEU.mjs.map +0 -1
  349. package/dist/esm/transactions/script-composer/index.d.mts +0 -44
  350. package/dist/esm/transactions/script-composer/index.mjs +0 -2
  351. package/src/transactions/script-composer/index.ts +0 -76
  352. /package/dist/esm/{chunk-NHKAQRJB.mjs.map → chunk-2D7OMWVL.mjs.map} +0 -0
  353. /package/dist/esm/{chunk-HEHVWRMO.mjs.map → chunk-2E3BT4YW.mjs.map} +0 -0
  354. /package/dist/esm/{chunk-IBMZYDAR.mjs.map → chunk-4IQZOAN7.mjs.map} +0 -0
  355. /package/dist/esm/{chunk-6K4TOFCO.mjs.map → chunk-4ULPBQ3M.mjs.map} +0 -0
  356. /package/dist/esm/{chunk-4DNCQM3S.mjs.map → chunk-4ZNSNWQL.mjs.map} +0 -0
  357. /package/dist/esm/{chunk-WSFHH3BK.mjs.map → chunk-5O3RHPER.mjs.map} +0 -0
  358. /package/dist/esm/{chunk-ZRWZIAF5.mjs.map → chunk-5XLZACVT.mjs.map} +0 -0
  359. /package/dist/esm/{chunk-JDNI5VIJ.mjs.map → chunk-64IZ5PQR.mjs.map} +0 -0
  360. /package/dist/esm/{chunk-DP3YPGIK.mjs.map → chunk-6AEXQEO2.mjs.map} +0 -0
  361. /package/dist/esm/{chunk-AAATWCJT.mjs.map → chunk-737YW3CY.mjs.map} +0 -0
  362. /package/dist/esm/{chunk-K4TJRYGQ.mjs.map → chunk-7ZA434Z3.mjs.map} +0 -0
  363. /package/dist/esm/{chunk-E2NYQVP3.mjs.map → chunk-7ZVXQAG4.mjs.map} +0 -0
  364. /package/dist/esm/{chunk-L2QVUMBV.mjs.map → chunk-A3USS2NC.mjs.map} +0 -0
  365. /package/dist/esm/{chunk-2NHQQQZK.mjs.map → chunk-A7TJF3BX.mjs.map} +0 -0
  366. /package/dist/esm/{chunk-XT5T5LAP.mjs.map → chunk-ALOYOMRE.mjs.map} +0 -0
  367. /package/dist/esm/{chunk-XUP6VABV.mjs.map → chunk-B5BXB2BB.mjs.map} +0 -0
  368. /package/dist/esm/{chunk-37Y54PJ5.mjs.map → chunk-BWV6OYLG.mjs.map} +0 -0
  369. /package/dist/esm/{chunk-PW3ISXPN.mjs.map → chunk-CK5NDXQT.mjs.map} +0 -0
  370. /package/dist/esm/{chunk-X3JPX7T6.mjs.map → chunk-D54FD6XE.mjs.map} +0 -0
  371. /package/dist/esm/{chunk-UIRAXHDH.mjs.map → chunk-FD6FGKYY.mjs.map} +0 -0
  372. /package/dist/esm/{chunk-IDNDUJOK.mjs.map → chunk-FH27D7S3.mjs.map} +0 -0
  373. /package/dist/esm/{chunk-DDVOBEJA.mjs.map → chunk-FSBEKFEF.mjs.map} +0 -0
  374. /package/dist/esm/{chunk-YPBNYKOD.mjs.map → chunk-FUC7SLH7.mjs.map} +0 -0
  375. /package/dist/esm/{chunk-46L6BAJG.mjs.map → chunk-GT7QFXER.mjs.map} +0 -0
  376. /package/dist/esm/{chunk-H457BI3I.mjs.map → chunk-H7PDLUNP.mjs.map} +0 -0
  377. /package/dist/esm/{chunk-CA3Q2X6B.mjs.map → chunk-HKVZ7CAG.mjs.map} +0 -0
  378. /package/dist/esm/{chunk-QQM47PHZ.mjs.map → chunk-I3452DF5.mjs.map} +0 -0
  379. /package/dist/esm/{transactions/script-composer/index.mjs.map → chunk-I5OYNCZS.mjs.map} +0 -0
  380. /package/dist/esm/{chunk-VCY3JGZM.mjs.map → chunk-JKA22FG5.mjs.map} +0 -0
  381. /package/dist/esm/{chunk-SBCLBDCP.mjs.map → chunk-JUQBFGUD.mjs.map} +0 -0
  382. /package/dist/esm/{chunk-II654QZU.mjs.map → chunk-JYGAG754.mjs.map} +0 -0
  383. /package/dist/esm/{chunk-LAAFLCDM.mjs.map → chunk-KKLF7DQV.mjs.map} +0 -0
  384. /package/dist/esm/{chunk-JLD7DLKM.mjs.map → chunk-L3J2QVIY.mjs.map} +0 -0
  385. /package/dist/esm/{chunk-MOGPSSTD.mjs.map → chunk-LK67PZX3.mjs.map} +0 -0
  386. /package/dist/esm/{chunk-6LLGRGCN.mjs.map → chunk-LRN4ALMT.mjs.map} +0 -0
  387. /package/dist/esm/{chunk-BLLHTGAP.mjs.map → chunk-LWXBEIFO.mjs.map} +0 -0
  388. /package/dist/esm/{chunk-7WXDXBXK.mjs.map → chunk-LZ5PSDOS.mjs.map} +0 -0
  389. /package/dist/esm/{chunk-GBVRCWCD.mjs.map → chunk-MV5PGWJQ.mjs.map} +0 -0
  390. /package/dist/esm/{chunk-4YEOOZ2N.mjs.map → chunk-MWNYODWU.mjs.map} +0 -0
  391. /package/dist/esm/{chunk-YNT7JHMS.mjs.map → chunk-O4MRRWRI.mjs.map} +0 -0
  392. /package/dist/esm/{chunk-F2AIWA7L.mjs.map → chunk-OGBU52BQ.mjs.map} +0 -0
  393. /package/dist/esm/{chunk-KT3DT5GV.mjs.map → chunk-P6RNNESB.mjs.map} +0 -0
  394. /package/dist/esm/{chunk-WGIYSLH6.mjs.map → chunk-P74XXLE4.mjs.map} +0 -0
  395. /package/dist/esm/{chunk-TM7OZT3W.mjs.map → chunk-Q3CWUEXI.mjs.map} +0 -0
  396. /package/dist/esm/{chunk-OJBMR5CT.mjs.map → chunk-QK32EQSF.mjs.map} +0 -0
  397. /package/dist/esm/{chunk-NARS3JDH.mjs.map → chunk-QLC7SSLJ.mjs.map} +0 -0
  398. /package/dist/esm/{chunk-3XCYCFYI.mjs.map → chunk-QZT2M7UA.mjs.map} +0 -0
  399. /package/dist/esm/{chunk-HXXELLHN.mjs.map → chunk-R2YT2IM5.mjs.map} +0 -0
  400. /package/dist/esm/{chunk-HFWFDS6Y.mjs.map → chunk-RV7PNWDY.mjs.map} +0 -0
  401. /package/dist/esm/{chunk-SU2WB34N.mjs.map → chunk-S22QVNK7.mjs.map} +0 -0
  402. /package/dist/esm/{chunk-2QBCTW67.mjs.map → chunk-S3YVCCYI.mjs.map} +0 -0
  403. /package/dist/esm/{chunk-KUL55M2H.mjs.map → chunk-SMFTISPN.mjs.map} +0 -0
  404. /package/dist/esm/{chunk-FXUI3SSD.mjs.map → chunk-TQA6HY6A.mjs.map} +0 -0
  405. /package/dist/esm/{chunk-L2SDI7PI.mjs.map → chunk-TTERI67T.mjs.map} +0 -0
  406. /package/dist/esm/{chunk-DSKAMBBL.mjs.map → chunk-U7UTBXJD.mjs.map} +0 -0
  407. /package/dist/esm/{chunk-5NJWJXSS.mjs.map → chunk-VAKNMHOA.mjs.map} +0 -0
  408. /package/dist/esm/{chunk-ONFKJ57C.mjs.map → chunk-VELQA2Y3.mjs.map} +0 -0
  409. /package/dist/esm/{chunk-AVPQOD67.mjs.map → chunk-WXLSHECY.mjs.map} +0 -0
  410. /package/dist/esm/{chunk-OKE3FXIP.mjs.map → chunk-XOOYRVFK.mjs.map} +0 -0
  411. /package/dist/esm/{chunk-6PJH53CK.mjs.map → chunk-XVPWTWPY.mjs.map} +0 -0
  412. /package/dist/esm/{chunk-KA5FX53Q.mjs.map → chunk-Y5HLXDYG.mjs.map} +0 -0
  413. /package/dist/esm/{chunk-5AKSORBJ.mjs.map → chunk-YITOC4Z6.mjs.map} +0 -0
  414. /package/dist/esm/{chunk-WKNX43KN.mjs.map → chunk-YT3IP57B.mjs.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{i as s}from"./chunk-XUP6VABV.mjs";import{b as c}from"./chunk-MHN6XY4Z.mjs";import{a as d}from"./chunk-AKIO3OIT.mjs";import{b as i}from"./chunk-JNO7KPMG.mjs";import{b as n}from"./chunk-AJ5JHBAE.mjs";var u=class r extends c{constructor(e,t){super(),this.jwkAddress=i.from(e),this.keylessPublicKey=t}authKey(){let e=new n;return e.serializeU32AsUleb128(4),e.serializeFixedBytes(this.bcsToBytes()),d.fromSchemeAndBytes({scheme:2,input:e.toUint8Array()})}verifySignature(e){throw new Error("Not yet implemented")}serialize(e){this.jwkAddress.serialize(e),this.keylessPublicKey.serialize(e)}static deserialize(e){let t=i.deserialize(e),l=s.deserialize(e);return new r(t,l)}static isPublicKey(e){return e instanceof r}static create(e){return new r(e.jwkAddress,s.create(e))}static fromJwtAndPepper(e){return new r(e.jwkAddress,s.fromJwtAndPepper(e))}static isInstance(e){return"jwkAddress"in e&&e.jwkAddress instanceof i&&"keylessPublicKey"in e&&e.keylessPublicKey instanceof s}};export{u as a};
2
- //# sourceMappingURL=chunk-YPBNYKOD.mjs.map
1
+ import{i as s}from"./chunk-B5BXB2BB.mjs";import{b as c}from"./chunk-MHN6XY4Z.mjs";import{a as d}from"./chunk-AKIO3OIT.mjs";import{b as i}from"./chunk-JNO7KPMG.mjs";import{b as n}from"./chunk-AJ5JHBAE.mjs";var u=class r extends c{constructor(e,t){super(),this.jwkAddress=i.from(e),this.keylessPublicKey=t}authKey(){let e=new n;return e.serializeU32AsUleb128(4),e.serializeFixedBytes(this.bcsToBytes()),d.fromSchemeAndBytes({scheme:2,input:e.toUint8Array()})}verifySignature(e){throw new Error("Not yet implemented")}serialize(e){this.jwkAddress.serialize(e),this.keylessPublicKey.serialize(e)}static deserialize(e){let t=i.deserialize(e),l=s.deserialize(e);return new r(t,l)}static isPublicKey(e){return e instanceof r}static create(e){return new r(e.jwkAddress,s.create(e))}static fromJwtAndPepper(e){return new r(e.jwkAddress,s.fromJwtAndPepper(e))}static isInstance(e){return"jwkAddress"in e&&e.jwkAddress instanceof i&&"keylessPublicKey"in e&&e.keylessPublicKey instanceof s}};export{u as a};
2
+ //# sourceMappingURL=chunk-FUC7SLH7.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as h}from"./chunk-JJUINAQE.mjs";import{a as T}from"./chunk-KA5FX53Q.mjs";import{a as f}from"./chunk-3DQVGPFE.mjs";import{a as d}from"./chunk-6PJH53CK.mjs";import{d as c,e as u,f as g,i as m,j as p,k as y,l as A}from"./chunk-AHWZA3GD.mjs";import{a,b as o,c as i,d as s,e,g as r}from"./chunk-OJBMR5CT.mjs";var P=class{constructor(n){this.config=n,this.build=new f(this.config),this.simulate=new h(this.config),this.submit=new T(this.config),this.batch=new d(this.config)}async getTransactions(n){return a({aptosConfig:this.config,...n})}async getTransactionByVersion(n){return i({aptosConfig:this.config,...n})}async getTransactionByHash(n){return s({aptosConfig:this.config,...n})}async isPendingTransaction(n){return e({aptosConfig:this.config,...n})}async waitForTransaction(n){return r({aptosConfig:this.config,...n})}async getGasPriceEstimation(){return o({aptosConfig:this.config})}getSigningMessage(n){return c(n)}async publishPackageTransaction(n){return y({aptosConfig:this.config,...n})}async rotateAuthKey(n){return A({aptosConfig:this.config,...n})}sign(n){return u({...n})}signAsFeePayer(n){return g({...n})}async batchTransactionsForSingleAccount(n){try{let{sender:t,data:l,options:b}=n;this.batch.forSingleAccount({sender:t,data:l,options:b})}catch(t){throw new Error(`failed to submit transactions with error: ${t}`)}}async signAndSubmitTransaction(n){return m({aptosConfig:this.config,...n})}async signAndSubmitAsFeePayer(n){return p({aptosConfig:this.config,...n})}};export{P as a};
2
- //# sourceMappingURL=chunk-46L6BAJG.mjs.map
1
+ import{a as h}from"./chunk-HULCIESG.mjs";import{a as T}from"./chunk-Y5HLXDYG.mjs";import{a as f}from"./chunk-MCWOKFVH.mjs";import{a as d}from"./chunk-XVPWTWPY.mjs";import{d as c,e as u,f as g,i as m,j as p,k as y,l as A}from"./chunk-476F5NJ6.mjs";import{a,b as o,c as i,d as s,e,g as r}from"./chunk-QK32EQSF.mjs";var P=class{constructor(n){this.config=n,this.build=new f(this.config),this.simulate=new h(this.config),this.submit=new T(this.config),this.batch=new d(this.config)}async getTransactions(n){return a({aptosConfig:this.config,...n})}async getTransactionByVersion(n){return i({aptosConfig:this.config,...n})}async getTransactionByHash(n){return s({aptosConfig:this.config,...n})}async isPendingTransaction(n){return e({aptosConfig:this.config,...n})}async waitForTransaction(n){return r({aptosConfig:this.config,...n})}async getGasPriceEstimation(){return o({aptosConfig:this.config})}getSigningMessage(n){return c(n)}async publishPackageTransaction(n){return y({aptosConfig:this.config,...n})}async rotateAuthKey(n){return A({aptosConfig:this.config,...n})}sign(n){return u({...n})}signAsFeePayer(n){return g({...n})}async batchTransactionsForSingleAccount(n){try{let{sender:t,data:l,options:b}=n;this.batch.forSingleAccount({sender:t,data:l,options:b})}catch(t){throw new Error(`failed to submit transactions with error: ${t}`)}}async signAndSubmitTransaction(n){return m({aptosConfig:this.config,...n})}async signAndSubmitAsFeePayer(n){return p({aptosConfig:this.config,...n})}};export{P as a};
2
+ //# sourceMappingURL=chunk-GT7QFXER.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as O,b as _}from"./chunk-FXUI3SSD.mjs";import{d as E}from"./chunk-YZ3YPLEU.mjs";import{a as R}from"./chunk-7WXDXBXK.mjs";import{a as P,b as w}from"./chunk-LAAFLCDM.mjs";import{a as I}from"./chunk-YPBNYKOD.mjs";import{i as T,j as b,k as x,n as g,q as v,s as k}from"./chunk-XUP6VABV.mjs";import{b as m}from"./chunk-JNO7KPMG.mjs";import{d as r}from"./chunk-F45G3GP3.mjs";import{a as K}from"./chunk-AJ5JHBAE.mjs";import{b as h}from"./chunk-SPRNSFUV.mjs";import{e as F}from"./chunk-V4FKFCBL.mjs";import C from"eventemitter3";import{jwtDecode as D}from"jwt-decode";function se(f){return f!=null&&typeof f.checkKeylessAccountValidity=="function"}var p=class p extends K{constructor(e){super();let{address:i,ephemeralKeyPair:t,publicKey:o,uidKey:y,uidVal:n,aud:c,pepper:s,proof:a,proofFetchCallback:l,jwt:d,verificationKeyHash:u}=e;if(this.ephemeralKeyPair=t,this.publicKey=o,this.accountAddress=i?m.from(i):this.publicKey.authKey().derivedAddress(),this.uidKey=y,this.uidVal=n,this.aud=c,this.jwt=d,this.emitter=new C,this.proofOrPromise=a,a instanceof g)this.proof=a;else{if(l===void 0)throw new Error("Must provide callback for async proof fetch");this.emitter.on("proofFetchFinish",async N=>{await l(N),this.emitter.removeAllListeners()}),this.init(a)}this.signingScheme=2;let S=h.fromHexInput(s).toUint8Array();if(S.length!==p.PEPPER_LENGTH)throw new Error(`Pepper length in bytes should be ${p.PEPPER_LENGTH}`);if(this.pepper=S,u!==void 0){if(h.hexInputToUint8Array(u).length!==32)throw new Error("verificationKeyHash must be 32 bytes");this.verificationKeyHash=h.hexInputToUint8Array(u)}}async init(e){try{this.proof=await e,this.emitter.emit("proofFetchFinish",{status:"Success"})}catch(i){i instanceof Error?this.emitter.emit("proofFetchFinish",{status:"Failed",error:i.toString()}):this.emitter.emit("proofFetchFinish",{status:"Failed",error:"Unknown"})}}serialize(e){if(this.accountAddress.serialize(e),e.serializeStr(this.jwt),e.serializeStr(this.uidKey),e.serializeFixedBytes(this.pepper),this.ephemeralKeyPair.serialize(e),this.proof===void 0)throw new Error("Cannot serialize - proof undefined");this.proof.serialize(e),e.serializeOption(this.verificationKeyHash,32)}static partialDeserialize(e){let i=m.deserialize(e),t=e.deserializeStr(),o=e.deserializeStr(),y=e.deserializeFixedBytes(31),n=R.deserialize(e),c=g.deserialize(e),s=e.deserializeOption("fixedBytes",32);return{address:i,jwt:t,uidKey:o,pepper:y,ephemeralKeyPair:n,proof:c,verificationKeyHash:s}}isExpired(){return this.ephemeralKeyPair.isExpired()}signWithAuthenticator(e){let i=new w(this.sign(e)),t=new P(this.publicKey);return new E(t,i)}signTransactionWithAuthenticator(e){let i=new w(this.signTransaction(e)),t=new P(this.publicKey);return new E(t,i)}async waitForProofFetch(){this.proofOrPromise instanceof Promise&&await this.proofOrPromise}async checkKeylessAccountValidity(e){if(this.isExpired())throw r.fromErrorType({type:0});if(await this.waitForProofFetch(),this.proof===void 0)throw r.fromErrorType({type:2});let i=D(this.jwt,{header:!0});if(i.kid===void 0)throw r.fromErrorType({type:12,details:"checkKeylessAccountValidity failed. JWT is missing 'kid' in header. This should never happen."});if(this.verificationKeyHash!==void 0){let{verificationKey:t}=await v({aptosConfig:e});if(h.hexInputToString(t.hash())!==h.hexInputToString(this.verificationKeyHash))throw r.fromErrorType({type:4})}else console.warn("[Aptos SDK] The verification key hash was not set. Proof may be invalid if the verification key has rotated.");await p.fetchJWK({aptosConfig:e,publicKey:this.publicKey,kid:i.kid})}sign(e){let{expiryDateSecs:i}=this.ephemeralKeyPair;if(this.isExpired())throw r.fromErrorType({type:0});if(this.proof===void 0)throw r.fromErrorType({type:1,details:"Proof not found - make sure to call `await account.checkKeylessAccountValidity()` before signing."});let t=this.ephemeralKeyPair.getPublicKey(),o=this.ephemeralKeyPair.sign(e);return new b({jwtHeader:F(this.jwt.split(".")[0]),ephemeralCertificate:new x(this.proof,0),expiryDateSecs:i,ephemeralPublicKey:t,ephemeralSignature:o})}signTransaction(e){if(this.proof===void 0)throw r.fromErrorType({type:1,details:"Proof not found - make sure to call `await account.checkKeylessAccountValidity()` before signing."});let i=O(e),o=new A(i,this.proof.proof).hash();return this.sign(o)}verifySignature(e){let{message:i,signature:t}=e;return!(this.isExpired()||!this.ephemeralKeyPair.getPublicKey().verifySignature({message:i,signature:t.ephemeralSignature}))}static async fetchJWK(e){let{aptosConfig:i,publicKey:t,kid:o}=e,y=t instanceof T?t:t.keylessPublicKey,{iss:n}=y,c,s=t instanceof I?t.jwkAddress:void 0;try{c=await k({aptosConfig:i,jwkAddr:s})}catch(d){throw r.fromErrorType({type:24,error:d,details:`Failed to fetch ${s?"Federated":"Patched"}JWKs ${s?`for address ${s}`:"0x1"}`})}let a=c.get(n);if(a===void 0)throw r.fromErrorType({type:7,details:`JWKs for issuer ${n} not found.`});let l=a.find(d=>d.kid===o);if(l===void 0)throw r.fromErrorType({type:6,details:`JWK with kid '${o}' for issuer '${n}' not found.`});return l}};p.PEPPER_LENGTH=31;var H=p,A=class extends K{constructor(i,t){super();this.domainSeparator="APTOS::TransactionAndProof";this.transaction=i,this.proof=t}serialize(i){i.serializeFixedBytes(this.transaction.bcsToBytes()),i.serializeOption(this.proof)}hash(){return _(this.bcsToBytes(),this.domainSeparator)}};export{se as a,H as b,A as c};
2
- //# sourceMappingURL=chunk-H457BI3I.mjs.map
1
+ import{a as O,b as _}from"./chunk-TQA6HY6A.mjs";import{d as E}from"./chunk-OEM75TVE.mjs";import{a as R}from"./chunk-LZ5PSDOS.mjs";import{a as P,b as w}from"./chunk-KKLF7DQV.mjs";import{a as I}from"./chunk-FUC7SLH7.mjs";import{i as T,j as b,k as x,n as g,q as v,s as k}from"./chunk-B5BXB2BB.mjs";import{b as m}from"./chunk-JNO7KPMG.mjs";import{d as r}from"./chunk-F45G3GP3.mjs";import{a as K}from"./chunk-AJ5JHBAE.mjs";import{b as h}from"./chunk-SPRNSFUV.mjs";import{e as F}from"./chunk-V4FKFCBL.mjs";import C from"eventemitter3";import{jwtDecode as D}from"jwt-decode";function se(f){return f!=null&&typeof f.checkKeylessAccountValidity=="function"}var p=class p extends K{constructor(e){super();let{address:i,ephemeralKeyPair:t,publicKey:o,uidKey:y,uidVal:n,aud:c,pepper:s,proof:a,proofFetchCallback:l,jwt:d,verificationKeyHash:u}=e;if(this.ephemeralKeyPair=t,this.publicKey=o,this.accountAddress=i?m.from(i):this.publicKey.authKey().derivedAddress(),this.uidKey=y,this.uidVal=n,this.aud=c,this.jwt=d,this.emitter=new C,this.proofOrPromise=a,a instanceof g)this.proof=a;else{if(l===void 0)throw new Error("Must provide callback for async proof fetch");this.emitter.on("proofFetchFinish",async N=>{await l(N),this.emitter.removeAllListeners()}),this.init(a)}this.signingScheme=2;let S=h.fromHexInput(s).toUint8Array();if(S.length!==p.PEPPER_LENGTH)throw new Error(`Pepper length in bytes should be ${p.PEPPER_LENGTH}`);if(this.pepper=S,u!==void 0){if(h.hexInputToUint8Array(u).length!==32)throw new Error("verificationKeyHash must be 32 bytes");this.verificationKeyHash=h.hexInputToUint8Array(u)}}async init(e){try{this.proof=await e,this.emitter.emit("proofFetchFinish",{status:"Success"})}catch(i){i instanceof Error?this.emitter.emit("proofFetchFinish",{status:"Failed",error:i.toString()}):this.emitter.emit("proofFetchFinish",{status:"Failed",error:"Unknown"})}}serialize(e){if(this.accountAddress.serialize(e),e.serializeStr(this.jwt),e.serializeStr(this.uidKey),e.serializeFixedBytes(this.pepper),this.ephemeralKeyPair.serialize(e),this.proof===void 0)throw new Error("Cannot serialize - proof undefined");this.proof.serialize(e),e.serializeOption(this.verificationKeyHash,32)}static partialDeserialize(e){let i=m.deserialize(e),t=e.deserializeStr(),o=e.deserializeStr(),y=e.deserializeFixedBytes(31),n=R.deserialize(e),c=g.deserialize(e),s=e.deserializeOption("fixedBytes",32);return{address:i,jwt:t,uidKey:o,pepper:y,ephemeralKeyPair:n,proof:c,verificationKeyHash:s}}isExpired(){return this.ephemeralKeyPair.isExpired()}signWithAuthenticator(e){let i=new w(this.sign(e)),t=new P(this.publicKey);return new E(t,i)}signTransactionWithAuthenticator(e){let i=new w(this.signTransaction(e)),t=new P(this.publicKey);return new E(t,i)}async waitForProofFetch(){this.proofOrPromise instanceof Promise&&await this.proofOrPromise}async checkKeylessAccountValidity(e){if(this.isExpired())throw r.fromErrorType({type:0});if(await this.waitForProofFetch(),this.proof===void 0)throw r.fromErrorType({type:2});let i=D(this.jwt,{header:!0});if(i.kid===void 0)throw r.fromErrorType({type:12,details:"checkKeylessAccountValidity failed. JWT is missing 'kid' in header. This should never happen."});if(this.verificationKeyHash!==void 0){let{verificationKey:t}=await v({aptosConfig:e});if(h.hexInputToString(t.hash())!==h.hexInputToString(this.verificationKeyHash))throw r.fromErrorType({type:4})}else console.warn("[Aptos SDK] The verification key hash was not set. Proof may be invalid if the verification key has rotated.");await p.fetchJWK({aptosConfig:e,publicKey:this.publicKey,kid:i.kid})}sign(e){let{expiryDateSecs:i}=this.ephemeralKeyPair;if(this.isExpired())throw r.fromErrorType({type:0});if(this.proof===void 0)throw r.fromErrorType({type:1,details:"Proof not found - make sure to call `await account.checkKeylessAccountValidity()` before signing."});let t=this.ephemeralKeyPair.getPublicKey(),o=this.ephemeralKeyPair.sign(e);return new b({jwtHeader:F(this.jwt.split(".")[0]),ephemeralCertificate:new x(this.proof,0),expiryDateSecs:i,ephemeralPublicKey:t,ephemeralSignature:o})}signTransaction(e){if(this.proof===void 0)throw r.fromErrorType({type:1,details:"Proof not found - make sure to call `await account.checkKeylessAccountValidity()` before signing."});let i=O(e),o=new A(i,this.proof.proof).hash();return this.sign(o)}verifySignature(e){let{message:i,signature:t}=e;return!(this.isExpired()||!this.ephemeralKeyPair.getPublicKey().verifySignature({message:i,signature:t.ephemeralSignature}))}static async fetchJWK(e){let{aptosConfig:i,publicKey:t,kid:o}=e,y=t instanceof T?t:t.keylessPublicKey,{iss:n}=y,c,s=t instanceof I?t.jwkAddress:void 0;try{c=await k({aptosConfig:i,jwkAddr:s})}catch(d){throw r.fromErrorType({type:24,error:d,details:`Failed to fetch ${s?"Federated":"Patched"}JWKs ${s?`for address ${s}`:"0x1"}`})}let a=c.get(n);if(a===void 0)throw r.fromErrorType({type:7,details:`JWKs for issuer ${n} not found.`});let l=a.find(d=>d.kid===o);if(l===void 0)throw r.fromErrorType({type:6,details:`JWK with kid '${o}' for issuer '${n}' not found.`});return l}};p.PEPPER_LENGTH=31;var H=p,A=class extends K{constructor(i,t){super();this.domainSeparator="APTOS::TransactionAndProof";this.transaction=i,this.proof=t}serialize(i){i.serializeFixedBytes(this.transaction.bcsToBytes()),i.serializeOption(this.proof)}hash(){return _(this.bcsToBytes(),this.domainSeparator)}};export{se as a,H as b,A as c};
2
+ //# sourceMappingURL=chunk-H7PDLUNP.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as r,b as i,c as s}from"./chunk-ZRWZIAF5.mjs";import{a as o}from"./chunk-XT5T5LAP.mjs";var t=class{constructor(e){this.config=e}async getNumberOfDelegators(e){return await o({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"stake_processor"}),r({aptosConfig:this.config,...e})}async getNumberOfDelegatorsForAllPools(e){return await o({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"stake_processor"}),i({aptosConfig:this.config,...e})}async getDelegatedStakingActivities(e){return await o({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"stake_processor"}),s({aptosConfig:this.config,...e})}};export{t as a};
2
- //# sourceMappingURL=chunk-CA3Q2X6B.mjs.map
1
+ import{a as r,b as i,c as s}from"./chunk-5XLZACVT.mjs";import{a as o}from"./chunk-ALOYOMRE.mjs";var t=class{constructor(e){this.config=e}async getNumberOfDelegators(e){return await o({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"stake_processor"}),r({aptosConfig:this.config,...e})}async getNumberOfDelegatorsForAllPools(e){return await o({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"stake_processor"}),i({aptosConfig:this.config,...e})}async getDelegatedStakingActivities(e){return await o({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"stake_processor"}),s({aptosConfig:this.config,...e})}};export{t as a};
2
+ //# sourceMappingURL=chunk-HKVZ7CAG.mjs.map
@@ -1,2 +1,2 @@
1
- import{b as s}from"./chunk-I2NMCLNW.mjs";import{g as r}from"./chunk-AHWZA3GD.mjs";import{a as o}from"./chunk-KDMSOCZY.mjs";var i=class{constructor(n){this.config=n}async simple(n){return r({aptosConfig:this.config,...n})}async multiAgent(n){return r({aptosConfig:this.config,...n})}};o([s],i.prototype,"simple",1),o([s],i.prototype,"multiAgent",1);export{i as a};
2
- //# sourceMappingURL=chunk-JJUINAQE.mjs.map
1
+ import{b as s}from"./chunk-IHGA5KAD.mjs";import{g as r}from"./chunk-476F5NJ6.mjs";import{a as o}from"./chunk-KDMSOCZY.mjs";var i=class{constructor(n){this.config=n}async simple(n){return r({aptosConfig:this.config,...n})}async multiAgent(n){return r({aptosConfig:this.config,...n})}};o([s],i.prototype,"simple",1),o([s],i.prototype,"multiAgent",1);export{i as a};
2
+ //# sourceMappingURL=chunk-HULCIESG.mjs.map
@@ -0,0 +1 @@
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 +1,2 @@
1
- import{b as h,d as l}from"./chunk-L2SDI7PI.mjs";import{b as E}from"./chunk-MHN6XY4Z.mjs";import{a as p}from"./chunk-4O5XDQDO.mjs";import{a as g}from"./chunk-AKIO3OIT.mjs";var o=class o extends E{constructor(r){super();let{publicKeys:e,threshold:t}=r;if(e.length>o.MAX_KEYS||e.length<o.MIN_KEYS)throw new Error(`Must have between ${o.MIN_KEYS} and ${o.MAX_KEYS} public keys, inclusive`);if(t<o.MIN_THRESHOLD||t>e.length)throw new Error(`Threshold must be between ${o.MIN_THRESHOLD} and ${e.length}, inclusive`);this.publicKeys=e,this.threshold=t}verifySignature(r){let{message:e,signature:t}=r;if(!(t instanceof y))return!1;let s=[];for(let i=0;i<4;i+=1)for(let n=0;n<8;n+=1)if((t.bitmap[i]&1<<7-n)!==0){let u=i*8+n;s.push(u)}if(s.length!==t.signatures.length)throw new Error("Bitmap and signatures length mismatch");if(s.length<this.threshold)throw new Error("Not enough signatures");for(let i=0;i<s.length;i+=1)if(!this.publicKeys[s[i]].verifySignature({message:e,signature:t.signatures[i]}))return!1;return!0}authKey(){return g.fromSchemeAndBytes({scheme:1,input:this.toUint8Array()})}toUint8Array(){let r=new Uint8Array(this.publicKeys.length*h.LENGTH+1);return this.publicKeys.forEach((e,t)=>{r.set(e.toUint8Array(),t*h.LENGTH)}),r[this.publicKeys.length*h.LENGTH]=this.threshold,r}serialize(r){r.serializeBytes(this.toUint8Array())}static deserialize(r){let e=r.deserializeBytes(),t=e[e.length-1],s=[];for(let i=0;i<e.length-1;i+=h.LENGTH){let n=i;s.push(new h(e.subarray(n,n+h.LENGTH)))}return new o({publicKeys:s,threshold:t})}};o.MAX_KEYS=32,o.MIN_KEYS=2,o.MIN_THRESHOLD=1;var d=o,a=class a extends p{constructor(r){super();let{signatures:e,bitmap:t}=r;if(e.length>a.MAX_SIGNATURES_SUPPORTED)throw new Error(`The number of signatures cannot be greater than ${a.MAX_SIGNATURES_SUPPORTED}`);if(this.signatures=e,!(t instanceof Uint8Array))this.bitmap=a.createBitmap({bits:t});else{if(t.length!==a.BITMAP_LEN)throw new Error(`"bitmap" length should be ${a.BITMAP_LEN}`);this.bitmap=t}}toUint8Array(){let r=new Uint8Array(this.signatures.length*l.LENGTH+a.BITMAP_LEN);return this.signatures.forEach((e,t)=>{r.set(e.toUint8Array(),t*l.LENGTH)}),r.set(this.bitmap,this.signatures.length*l.LENGTH),r}serialize(r){r.serializeBytes(this.toUint8Array())}static deserialize(r){let e=r.deserializeBytes(),t=e.subarray(e.length-4),s=[];for(let i=0;i<e.length-t.length;i+=l.LENGTH){let n=i;s.push(new l(e.subarray(n,n+l.LENGTH)))}return new a({signatures:s,bitmap:t})}static createBitmap(r){let{bits:e}=r,t=128,s=new Uint8Array([0,0,0,0]),i=new Set;return e.forEach((n,c)=>{if(n>=a.MAX_SIGNATURES_SUPPORTED)throw new Error(`Cannot have a signature larger than ${a.MAX_SIGNATURES_SUPPORTED-1}.`);if(i.has(n))throw new Error("Duplicate bits detected.");if(c>0&&n<=e[c-1])throw new Error("The bits need to be sorted in ascending order.");i.add(n);let u=Math.floor(n/8),b=s[u];b|=t>>n%8,s[u]=b}),s}};a.MAX_SIGNATURES_SUPPORTED=32,a.BITMAP_LEN=4;var y=a;export{d as a,y as b};
2
- //# sourceMappingURL=chunk-QQM47PHZ.mjs.map
1
+ import{b as h,d as l}from"./chunk-TTERI67T.mjs";import{b as E}from"./chunk-MHN6XY4Z.mjs";import{a as p}from"./chunk-4O5XDQDO.mjs";import{a as g}from"./chunk-AKIO3OIT.mjs";var o=class o extends E{constructor(r){super();let{publicKeys:e,threshold:t}=r;if(e.length>o.MAX_KEYS||e.length<o.MIN_KEYS)throw new Error(`Must have between ${o.MIN_KEYS} and ${o.MAX_KEYS} public keys, inclusive`);if(t<o.MIN_THRESHOLD||t>e.length)throw new Error(`Threshold must be between ${o.MIN_THRESHOLD} and ${e.length}, inclusive`);this.publicKeys=e,this.threshold=t}verifySignature(r){let{message:e,signature:t}=r;if(!(t instanceof y))return!1;let s=[];for(let i=0;i<4;i+=1)for(let n=0;n<8;n+=1)if((t.bitmap[i]&1<<7-n)!==0){let u=i*8+n;s.push(u)}if(s.length!==t.signatures.length)throw new Error("Bitmap and signatures length mismatch");if(s.length<this.threshold)throw new Error("Not enough signatures");for(let i=0;i<s.length;i+=1)if(!this.publicKeys[s[i]].verifySignature({message:e,signature:t.signatures[i]}))return!1;return!0}authKey(){return g.fromSchemeAndBytes({scheme:1,input:this.toUint8Array()})}toUint8Array(){let r=new Uint8Array(this.publicKeys.length*h.LENGTH+1);return this.publicKeys.forEach((e,t)=>{r.set(e.toUint8Array(),t*h.LENGTH)}),r[this.publicKeys.length*h.LENGTH]=this.threshold,r}serialize(r){r.serializeBytes(this.toUint8Array())}static deserialize(r){let e=r.deserializeBytes(),t=e[e.length-1],s=[];for(let i=0;i<e.length-1;i+=h.LENGTH){let n=i;s.push(new h(e.subarray(n,n+h.LENGTH)))}return new o({publicKeys:s,threshold:t})}};o.MAX_KEYS=32,o.MIN_KEYS=2,o.MIN_THRESHOLD=1;var d=o,a=class a extends p{constructor(r){super();let{signatures:e,bitmap:t}=r;if(e.length>a.MAX_SIGNATURES_SUPPORTED)throw new Error(`The number of signatures cannot be greater than ${a.MAX_SIGNATURES_SUPPORTED}`);if(this.signatures=e,!(t instanceof Uint8Array))this.bitmap=a.createBitmap({bits:t});else{if(t.length!==a.BITMAP_LEN)throw new Error(`"bitmap" length should be ${a.BITMAP_LEN}`);this.bitmap=t}}toUint8Array(){let r=new Uint8Array(this.signatures.length*l.LENGTH+a.BITMAP_LEN);return this.signatures.forEach((e,t)=>{r.set(e.toUint8Array(),t*l.LENGTH)}),r.set(this.bitmap,this.signatures.length*l.LENGTH),r}serialize(r){r.serializeBytes(this.toUint8Array())}static deserialize(r){let e=r.deserializeBytes(),t=e.subarray(e.length-4),s=[];for(let i=0;i<e.length-t.length;i+=l.LENGTH){let n=i;s.push(new l(e.subarray(n,n+l.LENGTH)))}return new a({signatures:s,bitmap:t})}static createBitmap(r){let{bits:e}=r,t=128,s=new Uint8Array([0,0,0,0]),i=new Set;return e.forEach((n,c)=>{if(n>=a.MAX_SIGNATURES_SUPPORTED)throw new Error(`Cannot have a signature larger than ${a.MAX_SIGNATURES_SUPPORTED-1}.`);if(i.has(n))throw new Error("Duplicate bits detected.");if(c>0&&n<=e[c-1])throw new Error("The bits need to be sorted in ascending order.");i.add(n);let u=Math.floor(n/8),b=s[u];b|=t>>n%8,s[u]=b}),s}};a.MAX_SIGNATURES_SUPPORTED=32,a.BITMAP_LEN=4;var y=a;export{d as a,y as b};
2
+ //# sourceMappingURL=chunk-I3452DF5.mjs.map
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=chunk-I5OYNCZS.mjs.map
@@ -0,0 +1,2 @@
1
+ function i(r,o,t){let n=t.value;return t.value=async function(...e){let[a]=e;if(a.transaction.feePayerAddress&&!a.feePayerAuthenticator)throw new Error("You are submitting a Fee Payer transaction but missing the feePayerAuthenticator");return n.apply(this,e)},t}function u(r,o,t){let n=t.value;return t.value=async function(...e){return n.apply(this,e)},t}export{i as a,u as b};
2
+ //# sourceMappingURL=chunk-IHGA5KAD.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/api/transactionSubmission/helpers.ts"],"sourcesContent":["/**\n * Validates the fee payer data when submitting a transaction to ensure that the fee payer authenticator is provided if a fee\n * payer address is specified.\n * This helps prevent errors in transaction submission related to fee payer authentication.\n *\n * @param target - The target object where the method is defined.\n * @param propertyKey - The name of the method being decorated.\n * @param descriptor - The property descriptor for the method.\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 * class TransactionHandler {\n * @ValidateFeePayerDataOnSubmission\n * async submitTransaction(methodArgs: { transaction: { feePayerAddress: string }, feePayerAuthenticator?: string }) {\n * // Logic to submit the transaction\n * }\n * }\n *\n * async function runExample() {\n * const handler = new TransactionHandler();\n *\n * // Attempt to submit a transaction without a fee payer authenticator\n * try {\n * await handler.submitTransaction({\n * transaction: { feePayerAddress: \"0x1\" }, // replace with a real fee payer address\n * });\n * } catch (error) {\n * console.error(error.message); // Should log the error message\n * }\n *\n * // Submit a transaction with a fee payer authenticator\n * await handler.submitTransaction({\n * transaction: { feePayerAddress: \"0x1\" }, // replace with a real fee payer address\n * feePayerAuthenticator: \"authenticatorValue\", // replace with a real authenticator\n * });\n *\n * console.log(\"Transaction submitted successfully.\");\n * }\n * runExample().catch(console.error);\n * ```\n */\nexport function ValidateFeePayerDataOnSubmission(target: unknown, propertyKey: string, descriptor: PropertyDescriptor) {\n const originalMethod = descriptor.value;\n /* eslint-disable-next-line func-names, no-param-reassign */\n descriptor.value = async function (...args: any[]) {\n const [methodArgs] = args;\n\n if (methodArgs.transaction.feePayerAddress && !methodArgs.feePayerAuthenticator) {\n throw new Error(\"You are submitting a Fee Payer transaction but missing the feePayerAuthenticator\");\n }\n\n return originalMethod.apply(this, args);\n };\n\n return descriptor;\n}\n\n/**\n * Validates that the fee payer public key is provided when simulating a Fee Payer transaction.\n * This ensures that all necessary data is present for the simulation to proceed correctly.\n *\n * @param target - The target object where the method is defined.\n * @param propertyKey - The name of the method being decorated.\n * @param descriptor - The property descriptor for the method.\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 methodArgs = {\n * transaction: {\n * feePayerAddress: \"0x1\", // replace with a real fee payer address\n * },\n * feePayerPublicKey: undefined, // missing fee payer public key\n * };\n *\n * try {\n * // This will throw an error due to missing feePayerPublicKey\n * await aptos.someMethod(methodArgs);\n * } catch (error) {\n * console.error(error.message); // Output the error message\n * }\n * }\n * runExample().catch(console.error);\n * ```\n */\nexport function ValidateFeePayerDataOnSimulation(target: unknown, propertyKey: string, descriptor: PropertyDescriptor) {\n const originalMethod = descriptor.value;\n /* eslint-disable-next-line func-names, no-param-reassign */\n descriptor.value = async function (...args: any[]) {\n const [methodArgs] = args;\n\n if (methodArgs.transaction.feePayerAddress && !methodArgs.feePayerPublicKey) {\n throw new Error(\"You are simulating a Fee Payer transaction but missing the feePayerPublicKey\");\n }\n\n return originalMethod.apply(this, args);\n };\n\n return descriptor;\n}\n"],"mappings":"AA8CO,SAASA,EAAiCC,EAAiBC,EAAqBC,EAAgC,CACrH,IAAMC,EAAiBD,EAAW,MAElC,OAAAA,EAAW,MAAQ,kBAAmBE,EAAa,CACjD,GAAM,CAACC,CAAU,EAAID,EAErB,GAAIC,EAAW,YAAY,iBAAmB,CAACA,EAAW,sBACxD,MAAM,IAAI,MAAM,kFAAkF,EAGpG,OAAOF,EAAe,MAAM,KAAMC,CAAI,CACxC,EAEOF,CACT,CAmCO,SAASI,EAAiCN,EAAiBC,EAAqBC,EAAgC,CACrH,IAAMC,EAAiBD,EAAW,MAElC,OAAAA,EAAW,MAAQ,kBAAmBE,EAAa,CACjD,GAAM,CAACC,CAAU,EAAID,EAErB,GAAIC,EAAW,YAAY,iBAAmB,CAACA,EAAW,kBACxD,MAAM,IAAI,MAAM,8EAA8E,EAGhG,OAAOF,EAAe,MAAM,KAAMC,CAAI,CACxC,EAEOF,CACT","names":["ValidateFeePayerDataOnSubmission","target","propertyKey","descriptor","originalMethod","args","methodArgs","ValidateFeePayerDataOnSimulation"]}
1
+ {"version":3,"sources":["../../src/api/transactionSubmission/helpers.ts"],"sourcesContent":["/**\n * Validates the fee payer data when submitting a transaction to ensure that the fee payer authenticator is provided if a fee\n * payer address is specified.\n * This helps prevent errors in transaction submission related to fee payer authentication.\n *\n * @param target - The target object where the method is defined.\n * @param propertyKey - The name of the method being decorated.\n * @param descriptor - The property descriptor for the method.\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 * class TransactionHandler {\n * @ValidateFeePayerDataOnSubmission\n * async submitTransaction(methodArgs: { transaction: { feePayerAddress: string }, feePayerAuthenticator?: string }) {\n * // Logic to submit the transaction\n * }\n * }\n *\n * async function runExample() {\n * const handler = new TransactionHandler();\n *\n * // Attempt to submit a transaction without a fee payer authenticator\n * try {\n * await handler.submitTransaction({\n * transaction: { feePayerAddress: \"0x1\" }, // replace with a real fee payer address\n * });\n * } catch (error) {\n * console.error(error.message); // Should log the error message\n * }\n *\n * // Submit a transaction with a fee payer authenticator\n * await handler.submitTransaction({\n * transaction: { feePayerAddress: \"0x1\" }, // replace with a real fee payer address\n * feePayerAuthenticator: \"authenticatorValue\", // replace with a real authenticator\n * });\n *\n * console.log(\"Transaction submitted successfully.\");\n * }\n * runExample().catch(console.error);\n * ```\n */\nexport function ValidateFeePayerDataOnSubmission(target: unknown, propertyKey: string, descriptor: PropertyDescriptor) {\n const originalMethod = descriptor.value;\n /* eslint-disable-next-line func-names, no-param-reassign */\n descriptor.value = async function (...args: any[]) {\n const [methodArgs] = args;\n\n if (methodArgs.transaction.feePayerAddress && !methodArgs.feePayerAuthenticator) {\n throw new Error(\"You are submitting a Fee Payer transaction but missing the feePayerAuthenticator\");\n }\n\n return originalMethod.apply(this, args);\n };\n\n return descriptor;\n}\n\n/**\n * Validates that the fee payer public key is provided when simulating a Fee Payer transaction.\n * This ensures that all necessary data is present for the simulation to proceed correctly.\n *\n * @param target - The target object where the method is defined.\n * @param propertyKey - The name of the method being decorated.\n * @param descriptor - The property descriptor for the method.\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 methodArgs = {\n * transaction: {\n * feePayerAddress: \"0x1\", // replace with a real fee payer address\n * },\n * feePayerPublicKey: undefined, // missing fee payer public key\n * };\n *\n * try {\n * // This will throw an error due to missing feePayerPublicKey\n * await aptos.someMethod(methodArgs);\n * } catch (error) {\n * console.error(error.message); // Output the error message\n * }\n * }\n * runExample().catch(console.error);\n * ```\n */\nexport function ValidateFeePayerDataOnSimulation(target: unknown, propertyKey: string, descriptor: PropertyDescriptor) {\n const originalMethod = descriptor.value;\n /* eslint-disable-next-line func-names, no-param-reassign */\n descriptor.value = async function (...args: any[]) {\n return originalMethod.apply(this, args);\n };\n\n return descriptor;\n}\n"],"mappings":"AA8CO,SAASA,EAAiCC,EAAiBC,EAAqBC,EAAgC,CACrH,IAAMC,EAAiBD,EAAW,MAElC,OAAAA,EAAW,MAAQ,kBAAmBE,EAAa,CACjD,GAAM,CAACC,CAAU,EAAID,EAErB,GAAIC,EAAW,YAAY,iBAAmB,CAACA,EAAW,sBACxD,MAAM,IAAI,MAAM,kFAAkF,EAGpG,OAAOF,EAAe,MAAM,KAAMC,CAAI,CACxC,EAEOF,CACT,CAmCO,SAASI,EAAiCN,EAAiBC,EAAqBC,EAAgC,CACrH,IAAMC,EAAiBD,EAAW,MAElC,OAAAA,EAAW,MAAQ,kBAAmBE,EAAa,CACjD,OAAOD,EAAe,MAAM,KAAMC,CAAI,CACxC,EAEOF,CACT","names":["ValidateFeePayerDataOnSubmission","target","propertyKey","descriptor","originalMethod","args","methodArgs","ValidateFeePayerDataOnSimulation"]}
@@ -1,2 +1,2 @@
1
- var S=(O=>(O.FULLNODE="Fullnode",O.INDEXER="Indexer",O.FAUCET="Faucet",O.PEPPER="Pepper",O.PROVER="Prover",O))(S||{}),t=2e5,R=20,n=20,o="0x1::aptos_coin::AptosCoin",A="0x000000000000000000000000000000000000000000000000000000000000000a",T="APTOS::RawTransaction",a="APTOS::RawTransactionWithData",E=(_=>(_.ACCOUNT_TRANSACTION_PROCESSOR="account_transactions_processor",_.DEFAULT="default_processor",_.EVENTS_PROCESSOR="events_processor",_.FUNGIBLE_ASSET_PROCESSOR="fungible_asset_processor",_.STAKE_PROCESSOR="stake_processor",_.TOKEN_V2_PROCESSOR="token_v2_processor",_.USER_TRANSACTION_PROCESSOR="user_transaction_processor",_.OBJECT_PROCESSOR="objects_processor",_))(E||{});export{S as a,t as b,R as c,n as d,o as e,A as f,T as g,a as h,E as i};
2
- //# sourceMappingURL=chunk-J245N3XF.mjs.map
1
+ var t=(S=>(S.FULLNODE="Fullnode",S.INDEXER="Indexer",S.FAUCET="Faucet",S.PEPPER="Pepper",S.PROVER="Prover",S))(t||{}),O=2e5,o=20,R=20,n="0x1::aptos_coin::AptosCoin",A="0x000000000000000000000000000000000000000000000000000000000000000a",T="APTOS::RawTransaction",a="APTOS::RawTransactionWithData",E=(_=>(_.ACCOUNT_TRANSACTION_PROCESSOR="account_transactions_processor",_.DEFAULT="default_processor",_.EVENTS_PROCESSOR="events_processor",_.FUNGIBLE_ASSET_PROCESSOR="fungible_asset_processor",_.STAKE_PROCESSOR="stake_processor",_.TOKEN_V2_PROCESSOR="token_v2_processor",_.USER_TRANSACTION_PROCESSOR="user_transaction_processor",_.OBJECT_PROCESSOR="objects_processor",_))(E||{}),r=/^https:\/\/securetoken\.google\.com\/[a-zA-Z0-9-_]+$/;export{t as a,O as b,o as c,R as d,n as e,A as f,T as g,a as h,E as i,r as j};
2
+ //# sourceMappingURL=chunk-J7PJSK3J.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/const.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * Types of API endpoints used for routing requests in the Aptos network.\n */\nexport enum AptosApiType {\n FULLNODE = \"Fullnode\",\n INDEXER = \"Indexer\",\n FAUCET = \"Faucet\",\n PEPPER = \"Pepper\",\n PROVER = \"Prover\",\n}\n\n/**\n * The default max gas amount when none is given.\n *\n * This is the maximum number of gas units that will be used by a transaction before being rejected.\n *\n * Note that max gas amount varies based on the transaction. A larger transaction will go over this\n * default gas amount, and the value will need to be changed for the specific transaction.\n */\nexport const DEFAULT_MAX_GAS_AMOUNT = 200000;\n\n/**\n * The default transaction expiration seconds from now.\n *\n * This time is how long until the blockchain nodes will reject the transaction.\n *\n * Note that the transaction expiration time varies based on network connection and network load. It may need to be\n * increased for the transaction to be processed.\n */\nexport const DEFAULT_TXN_EXP_SEC_FROM_NOW = 20;\n\n/**\n * The default number of seconds to wait for a transaction to be processed.\n *\n * This time is the amount of time that the SDK will wait for a transaction to be processed when waiting for\n * the results of the transaction. It may take longer based on network connection and network load.\n */\nexport const DEFAULT_TXN_TIMEOUT_SEC = 20;\n\n/**\n * The default gas currency for the network.\n */\nexport const APTOS_COIN = \"0x1::aptos_coin::AptosCoin\";\nexport const APTOS_FA = \"0x000000000000000000000000000000000000000000000000000000000000000a\";\n\nexport const RAW_TRANSACTION_SALT = \"APTOS::RawTransaction\";\nexport const RAW_TRANSACTION_WITH_DATA_SALT = \"APTOS::RawTransactionWithData\";\n\n/**\n * Supported processor types for the indexer API, sourced from the processor_status table in the indexer database.\n * {@link https://cloud.hasura.io/public/graphiql?endpoint=https://api.mainnet.aptoslabs.com/v1/graphql}\n */\nexport enum ProcessorType {\n ACCOUNT_TRANSACTION_PROCESSOR = \"account_transactions_processor\",\n DEFAULT = \"default_processor\",\n EVENTS_PROCESSOR = \"events_processor\",\n // Fungible asset processor also handles coins\n FUNGIBLE_ASSET_PROCESSOR = \"fungible_asset_processor\",\n STAKE_PROCESSOR = \"stake_processor\",\n // Token V2 processor replaces Token processor (not only for digital assets)\n TOKEN_V2_PROCESSOR = \"token_v2_processor\",\n USER_TRANSACTION_PROCESSOR = \"user_transaction_processor\",\n OBJECT_PROCESSOR = \"objects_processor\",\n}\n"],"mappings":"AAMO,IAAKA,OACVA,EAAA,SAAW,WACXA,EAAA,QAAU,UACVA,EAAA,OAAS,SACTA,EAAA,OAAS,SACTA,EAAA,OAAS,SALCA,OAAA,IAgBCC,EAAyB,IAUzBC,EAA+B,GAQ/BC,EAA0B,GAK1BC,EAAa,6BACbC,EAAW,qEAEXC,EAAuB,wBACvBC,EAAiC,gCAMlCC,OACVA,EAAA,8BAAgC,iCAChCA,EAAA,QAAU,oBACVA,EAAA,iBAAmB,mBAEnBA,EAAA,yBAA2B,2BAC3BA,EAAA,gBAAkB,kBAElBA,EAAA,mBAAqB,qBACrBA,EAAA,2BAA6B,6BAC7BA,EAAA,iBAAmB,oBAVTA,OAAA","names":["AptosApiType","DEFAULT_MAX_GAS_AMOUNT","DEFAULT_TXN_EXP_SEC_FROM_NOW","DEFAULT_TXN_TIMEOUT_SEC","APTOS_COIN","APTOS_FA","RAW_TRANSACTION_SALT","RAW_TRANSACTION_WITH_DATA_SALT","ProcessorType"]}
1
+ {"version":3,"sources":["../../src/utils/const.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * Types of API endpoints used for routing requests in the Aptos network.\n */\nexport enum AptosApiType {\n FULLNODE = \"Fullnode\",\n INDEXER = \"Indexer\",\n FAUCET = \"Faucet\",\n PEPPER = \"Pepper\",\n PROVER = \"Prover\",\n}\n\n/**\n * The default max gas amount when none is given.\n *\n * This is the maximum number of gas units that will be used by a transaction before being rejected.\n *\n * Note that max gas amount varies based on the transaction. A larger transaction will go over this\n * default gas amount, and the value will need to be changed for the specific transaction.\n */\nexport const DEFAULT_MAX_GAS_AMOUNT = 200000;\n\n/**\n * The default transaction expiration seconds from now.\n *\n * This time is how long until the blockchain nodes will reject the transaction.\n *\n * Note that the transaction expiration time varies based on network connection and network load. It may need to be\n * increased for the transaction to be processed.\n */\nexport const DEFAULT_TXN_EXP_SEC_FROM_NOW = 20;\n\n/**\n * The default number of seconds to wait for a transaction to be processed.\n *\n * This time is the amount of time that the SDK will wait for a transaction to be processed when waiting for\n * the results of the transaction. It may take longer based on network connection and network load.\n */\nexport const DEFAULT_TXN_TIMEOUT_SEC = 20;\n\n/**\n * The default gas currency for the network.\n */\nexport const APTOS_COIN = \"0x1::aptos_coin::AptosCoin\";\nexport const APTOS_FA = \"0x000000000000000000000000000000000000000000000000000000000000000a\";\n\nexport const RAW_TRANSACTION_SALT = \"APTOS::RawTransaction\";\nexport const RAW_TRANSACTION_WITH_DATA_SALT = \"APTOS::RawTransactionWithData\";\n\n/**\n * Supported processor types for the indexer API, sourced from the processor_status table in the indexer database.\n * {@link https://cloud.hasura.io/public/graphiql?endpoint=https://api.mainnet.aptoslabs.com/v1/graphql}\n */\nexport enum ProcessorType {\n ACCOUNT_TRANSACTION_PROCESSOR = \"account_transactions_processor\",\n DEFAULT = \"default_processor\",\n EVENTS_PROCESSOR = \"events_processor\",\n // Fungible asset processor also handles coins\n FUNGIBLE_ASSET_PROCESSOR = \"fungible_asset_processor\",\n STAKE_PROCESSOR = \"stake_processor\",\n // Token V2 processor replaces Token processor (not only for digital assets)\n TOKEN_V2_PROCESSOR = \"token_v2_processor\",\n USER_TRANSACTION_PROCESSOR = \"user_transaction_processor\",\n OBJECT_PROCESSOR = \"objects_processor\",\n}\n\n/**\n * Regular expression pattern for Firebase Auth issuer URLs\n * Matches URLs in the format: https://securetoken.google.com/[project-id]\n * where project-id can contain letters, numbers, hyphens, and underscores\n */\nexport const FIREBASE_AUTH_ISS_PATTERN = /^https:\\/\\/securetoken\\.google\\.com\\/[a-zA-Z0-9-_]+$/;\n"],"mappings":"AAMO,IAAKA,OACVA,EAAA,SAAW,WACXA,EAAA,QAAU,UACVA,EAAA,OAAS,SACTA,EAAA,OAAS,SACTA,EAAA,OAAS,SALCA,OAAA,IAgBCC,EAAyB,IAUzBC,EAA+B,GAQ/BC,EAA0B,GAK1BC,EAAa,6BACbC,EAAW,qEAEXC,EAAuB,wBACvBC,EAAiC,gCAMlCC,OACVA,EAAA,8BAAgC,iCAChCA,EAAA,QAAU,oBACVA,EAAA,iBAAmB,mBAEnBA,EAAA,yBAA2B,2BAC3BA,EAAA,gBAAkB,kBAElBA,EAAA,mBAAqB,qBACrBA,EAAA,2BAA6B,6BAC7BA,EAAA,iBAAmB,oBAVTA,OAAA,IAkBCC,EAA4B","names":["AptosApiType","DEFAULT_MAX_GAS_AMOUNT","DEFAULT_TXN_EXP_SEC_FROM_NOW","DEFAULT_TXN_TIMEOUT_SEC","APTOS_COIN","APTOS_FA","RAW_TRANSACTION_SALT","RAW_TRANSACTION_WITH_DATA_SALT","ProcessorType","FIREBASE_AUTH_ISS_PATTERN"]}
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-K4TJRYGQ.mjs";import{a as e,c as n}from"./chunk-V4FKFCBL.mjs";var r=class{constructor(t,i,o,a,c){this.lastUncommintedNumber=null;this.currentNumber=null;this.lock=!1;this.aptosConfig=t,this.account=i,this.maxWaitTime=o,this.maximumInFlight=a,this.sleepTime=c}async nextSequenceNumber(){for(;this.lock;)await e(this.sleepTime);this.lock=!0;let t=BigInt(0);try{if((this.lastUncommintedNumber===null||this.currentNumber===null)&&await this.initialize(),this.currentNumber-this.lastUncommintedNumber>=this.maximumInFlight){await this.update();let i=n();for(;this.currentNumber-this.lastUncommintedNumber>=this.maximumInFlight;)await e(this.sleepTime),n()-i>this.maxWaitTime?(console.warn(`Waited over 30 seconds for a transaction to commit, re-syncing ${this.account.accountAddress.toString()}`),await this.initialize()):await this.update()}t=this.currentNumber,this.currentNumber+=BigInt(1)}catch(i){console.error("error in getting next sequence number for this account",i)}finally{this.lock=!1}return t}async initialize(){let{sequence_number:t}=await s({aptosConfig:this.aptosConfig,accountAddress:this.account.accountAddress});this.currentNumber=BigInt(t),this.lastUncommintedNumber=BigInt(t)}async update(){let{sequence_number:t}=await s({aptosConfig:this.aptosConfig,accountAddress:this.account.accountAddress});return this.lastUncommintedNumber=BigInt(t),this.lastUncommintedNumber}async synchronize(){if(this.lastUncommintedNumber!==this.currentNumber){for(;this.lock;)await e(this.sleepTime);this.lock=!0;try{await this.update();let t=n();for(;this.lastUncommintedNumber!==this.currentNumber;)n()-t>this.maxWaitTime?(console.warn(`Waited over 30 seconds for a transaction to commit, re-syncing ${this.account.accountAddress.toString()}`),await this.initialize()):(await e(this.sleepTime),await this.update())}catch(t){console.error("error in synchronizing this account sequence number with the one on chain",t)}finally{this.lock=!1}}}};export{r as a};
2
- //# sourceMappingURL=chunk-VCY3JGZM.mjs.map
1
+ import{a as s}from"./chunk-7ZA434Z3.mjs";import{a as e,c as n}from"./chunk-V4FKFCBL.mjs";var r=class{constructor(t,i,o,a,c){this.lastUncommintedNumber=null;this.currentNumber=null;this.lock=!1;this.aptosConfig=t,this.account=i,this.maxWaitTime=o,this.maximumInFlight=a,this.sleepTime=c}async nextSequenceNumber(){for(;this.lock;)await e(this.sleepTime);this.lock=!0;let t=BigInt(0);try{if((this.lastUncommintedNumber===null||this.currentNumber===null)&&await this.initialize(),this.currentNumber-this.lastUncommintedNumber>=this.maximumInFlight){await this.update();let i=n();for(;this.currentNumber-this.lastUncommintedNumber>=this.maximumInFlight;)await e(this.sleepTime),n()-i>this.maxWaitTime?(console.warn(`Waited over 30 seconds for a transaction to commit, re-syncing ${this.account.accountAddress.toString()}`),await this.initialize()):await this.update()}t=this.currentNumber,this.currentNumber+=BigInt(1)}catch(i){console.error("error in getting next sequence number for this account",i)}finally{this.lock=!1}return t}async initialize(){let{sequence_number:t}=await s({aptosConfig:this.aptosConfig,accountAddress:this.account.accountAddress});this.currentNumber=BigInt(t),this.lastUncommintedNumber=BigInt(t)}async update(){let{sequence_number:t}=await s({aptosConfig:this.aptosConfig,accountAddress:this.account.accountAddress});return this.lastUncommintedNumber=BigInt(t),this.lastUncommintedNumber}async synchronize(){if(this.lastUncommintedNumber!==this.currentNumber){for(;this.lock;)await e(this.sleepTime);this.lock=!0;try{await this.update();let t=n();for(;this.lastUncommintedNumber!==this.currentNumber;)n()-t>this.maxWaitTime?(console.warn(`Waited over 30 seconds for a transaction to commit, re-syncing ${this.account.accountAddress.toString()}`),await this.initialize()):(await e(this.sleepTime),await this.update())}catch(t){console.error("error in synchronizing this account sequence number with the one on chain",t)}finally{this.lock=!1}}}};export{r as a};
2
+ //# sourceMappingURL=chunk-JKA22FG5.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as i,b as o,c as a,d as c,e as p,f as d,g,h as u,i as A,j as y,k as m,l,m as T,n as f,o as C,p as I,q as O,r as P,s as D,t as V,u as S,v as h,w as R,x as G}from"./chunk-DP3YPGIK.mjs";import{a as e}from"./chunk-XT5T5LAP.mjs";import{b as s}from"./chunk-JNO7KPMG.mjs";var L=class{constructor(t){this.config=t}async getCollectionData(t){await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"});let{creatorAddress:N,collectionName:_,options:n}=t,w=s.from(N),r={collection_name:{_eq:_},creator_address:{_eq:w.toStringLong()}};return n?.tokenStandard&&(r.token_standard={_eq:n?.tokenStandard??"v2"}),d({aptosConfig:this.config,options:{where:r}})}async getCollectionDataByCreatorAddressAndCollectionName(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),g({aptosConfig:this.config,...t})}async getCollectionDataByCreatorAddress(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),u({aptosConfig:this.config,...t})}async getCollectionDataByCollectionId(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),A({aptosConfig:this.config,...t})}async getCollectionId(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),y({aptosConfig:this.config,...t})}async getDigitalAssetData(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),i({aptosConfig:this.config,...t})}async getCurrentDigitalAssetOwnership(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),o({aptosConfig:this.config,...t})}async getOwnedDigitalAssets(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),a({aptosConfig:this.config,...t})}async getDigitalAssetActivity(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),c({aptosConfig:this.config,...t})}async createCollectionTransaction(t){return p({aptosConfig:this.config,...t})}async mintDigitalAssetTransaction(t){return m({aptosConfig:this.config,...t})}async transferDigitalAssetTransaction(t){return l({aptosConfig:this.config,...t})}async mintSoulBoundTransaction(t){return T({aptosConfig:this.config,...t})}async burnDigitalAssetTransaction(t){return f({aptosConfig:this.config,...t})}async freezeDigitalAssetTransaferTransaction(t){return C({aptosConfig:this.config,...t})}async unfreezeDigitalAssetTransaferTransaction(t){return I({aptosConfig:this.config,...t})}async setDigitalAssetDescriptionTransaction(t){return O({aptosConfig:this.config,...t})}async setDigitalAssetNameTransaction(t){return P({aptosConfig:this.config,...t})}async setDigitalAssetURITransaction(t){return D({aptosConfig:this.config,...t})}async addDigitalAssetPropertyTransaction(t){return V({aptosConfig:this.config,...t})}async removeDigitalAssetPropertyTransaction(t){return S({aptosConfig:this.config,...t})}async updateDigitalAssetPropertyTransaction(t){return h({aptosConfig:this.config,...t})}async addDigitalAssetTypedPropertyTransaction(t){return R({aptosConfig:this.config,...t})}async updateDigitalAssetTypedPropertyTransaction(t){return G({aptosConfig:this.config,...t})}};export{L as a};
2
- //# sourceMappingURL=chunk-SBCLBDCP.mjs.map
1
+ import{a as i,b as o,c as a,d as c,e as p,f as d,g,h as u,i as A,j as y,k as m,l,m as T,n as f,o as C,p as I,q as O,r as P,s as D,t as V,u as S,v as h,w as R,x as G}from"./chunk-6AEXQEO2.mjs";import{a as e}from"./chunk-ALOYOMRE.mjs";import{b as s}from"./chunk-JNO7KPMG.mjs";var L=class{constructor(t){this.config=t}async getCollectionData(t){await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"});let{creatorAddress:N,collectionName:_,options:n}=t,w=s.from(N),r={collection_name:{_eq:_},creator_address:{_eq:w.toStringLong()}};return n?.tokenStandard&&(r.token_standard={_eq:n?.tokenStandard??"v2"}),d({aptosConfig:this.config,options:{where:r}})}async getCollectionDataByCreatorAddressAndCollectionName(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),g({aptosConfig:this.config,...t})}async getCollectionDataByCreatorAddress(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),u({aptosConfig:this.config,...t})}async getCollectionDataByCollectionId(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),A({aptosConfig:this.config,...t})}async getCollectionId(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),y({aptosConfig:this.config,...t})}async getDigitalAssetData(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),i({aptosConfig:this.config,...t})}async getCurrentDigitalAssetOwnership(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),o({aptosConfig:this.config,...t})}async getOwnedDigitalAssets(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),a({aptosConfig:this.config,...t})}async getDigitalAssetActivity(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),c({aptosConfig:this.config,...t})}async createCollectionTransaction(t){return p({aptosConfig:this.config,...t})}async mintDigitalAssetTransaction(t){return m({aptosConfig:this.config,...t})}async transferDigitalAssetTransaction(t){return l({aptosConfig:this.config,...t})}async mintSoulBoundTransaction(t){return T({aptosConfig:this.config,...t})}async burnDigitalAssetTransaction(t){return f({aptosConfig:this.config,...t})}async freezeDigitalAssetTransaferTransaction(t){return C({aptosConfig:this.config,...t})}async unfreezeDigitalAssetTransaferTransaction(t){return I({aptosConfig:this.config,...t})}async setDigitalAssetDescriptionTransaction(t){return O({aptosConfig:this.config,...t})}async setDigitalAssetNameTransaction(t){return P({aptosConfig:this.config,...t})}async setDigitalAssetURITransaction(t){return D({aptosConfig:this.config,...t})}async addDigitalAssetPropertyTransaction(t){return V({aptosConfig:this.config,...t})}async removeDigitalAssetPropertyTransaction(t){return S({aptosConfig:this.config,...t})}async updateDigitalAssetPropertyTransaction(t){return h({aptosConfig:this.config,...t})}async addDigitalAssetTypedPropertyTransaction(t){return R({aptosConfig:this.config,...t})}async updateDigitalAssetTypedPropertyTransaction(t){return G({aptosConfig:this.config,...t})}};export{L as a};
2
+ //# sourceMappingURL=chunk-JUQBFGUD.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as c}from"./chunk-NARS3JDH.mjs";import{a as n}from"./chunk-JLD7DLKM.mjs";import{c as i}from"./chunk-L2SDI7PI.mjs";var o=class{static generate(e={}){let{scheme:t=0,legacy:r=!0}=e;return t===0&&r?n.generate():c.generate({scheme:t})}static fromPrivateKey(e){let{privateKey:t,address:r,legacy:a=!0}=e;return t instanceof i&&a?new n({privateKey:t,address:r}):new c({privateKey:t,address:r})}static fromPrivateKeyAndAddress(e){return this.fromPrivateKey(e)}static fromDerivationPath(e){let{scheme:t=0,mnemonic:r,path:a,legacy:s=!0}=e;return t===0&&s?n.fromDerivationPath({mnemonic:r,path:a}):c.fromDerivationPath({scheme:t,mnemonic:r,path:a})}static authKey(e){let{publicKey:t}=e;return t.authKey()}verifySignature(e){return this.publicKey.verifySignature(e)}};export{o as a};
2
- //# sourceMappingURL=chunk-II654QZU.mjs.map
1
+ import{a as c}from"./chunk-QLC7SSLJ.mjs";import{a as n}from"./chunk-L3J2QVIY.mjs";import{c as i}from"./chunk-TTERI67T.mjs";var o=class{static generate(e={}){let{scheme:t=0,legacy:r=!0}=e;return t===0&&r?n.generate():c.generate({scheme:t})}static fromPrivateKey(e){let{privateKey:t,address:r,legacy:a=!0}=e;return t instanceof i&&a?new n({privateKey:t,address:r}):new c({privateKey:t,address:r})}static fromPrivateKeyAndAddress(e){return this.fromPrivateKey(e)}static fromDerivationPath(e){let{scheme:t=0,mnemonic:r,path:a,legacy:s=!0}=e;return t===0&&s?n.fromDerivationPath({mnemonic:r,path:a}):c.fromDerivationPath({scheme:t,mnemonic:r,path:a})}static authKey(e){let{publicKey:t}=e;return t.authKey()}verifySignature(e){return this.publicKey.verifySignature(e)}};export{o as a};
2
+ //# sourceMappingURL=chunk-JYGAG754.mjs.map
@@ -1,2 +1,2 @@
1
- import{a,c}from"./chunk-KUL55M2H.mjs";import{a as u}from"./chunk-YPBNYKOD.mjs";import{i as o,j as l}from"./chunk-XUP6VABV.mjs";import{b as n,d as s}from"./chunk-L2SDI7PI.mjs";import{b as p}from"./chunk-MHN6XY4Z.mjs";import{a as f}from"./chunk-4O5XDQDO.mjs";import{a as b}from"./chunk-AKIO3OIT.mjs";var K=class r extends p{constructor(e){if(super(),this.publicKey=e,e instanceof n)this.variant=0;else if(e instanceof a)this.variant=1;else if(e instanceof o)this.variant=3;else if(e instanceof u)this.variant=4;else throw new Error("Unsupported public key type")}verifySignature(e){let{message:t,signature:i}=e;return y.isInstance(i)?this.publicKey.verifySignature({message:t,signature:i.signature}):!1}authKey(){return b.fromSchemeAndBytes({scheme:2,input:this.toUint8Array()})}toUint8Array(){return this.bcsToBytes()}serialize(e){e.serializeU32AsUleb128(this.variant),this.publicKey.serialize(e)}static deserialize(e){let t=e.deserializeUleb128AsU32(),i;switch(t){case 0:i=n.deserialize(e);break;case 1:i=a.deserialize(e);break;case 3:i=o.deserialize(e);break;case 4:i=u.deserialize(e);break;default:throw new Error(`Unknown variant index for AnyPublicKey: ${t}`)}return new r(i)}static isPublicKey(e){return e instanceof r}isEd25519(){return this.publicKey instanceof n}isSecp256k1PublicKey(){return this.publicKey instanceof a}static isInstance(e){return"publicKey"in e&&"variant"in e}},y=class r extends f{constructor(e){if(super(),this.signature=e,e instanceof s)this.variant=0;else if(e instanceof c)this.variant=1;else if(e instanceof l)this.variant=3;else throw new Error("Unsupported signature type")}toUint8Array(){return console.warn("[Aptos SDK] Calls to AnySignature.toUint8Array() will soon return the underlying signature bytes. Use AnySignature.bcsToBytes() instead."),this.bcsToBytes()}serialize(e){e.serializeU32AsUleb128(this.variant),this.signature.serialize(e)}static deserialize(e){let t=e.deserializeUleb128AsU32(),i;switch(t){case 0:i=s.deserialize(e);break;case 1:i=c.deserialize(e);break;case 3:i=l.deserialize(e);break;default:throw new Error(`Unknown variant index for AnySignature: ${t}`)}return new r(i)}static isInstance(e){return"signature"in e&&typeof e.signature=="object"&&e.signature!==null&&"toUint8Array"in e.signature}};export{K as a,y as b};
2
- //# sourceMappingURL=chunk-LAAFLCDM.mjs.map
1
+ import{a,c}from"./chunk-SMFTISPN.mjs";import{a as u}from"./chunk-FUC7SLH7.mjs";import{i as o,j as l}from"./chunk-B5BXB2BB.mjs";import{b as n,d as s}from"./chunk-TTERI67T.mjs";import{b as p}from"./chunk-MHN6XY4Z.mjs";import{a as f}from"./chunk-4O5XDQDO.mjs";import{a as b}from"./chunk-AKIO3OIT.mjs";var K=class r extends p{constructor(e){if(super(),this.publicKey=e,e instanceof n)this.variant=0;else if(e instanceof a)this.variant=1;else if(e instanceof o)this.variant=3;else if(e instanceof u)this.variant=4;else throw new Error("Unsupported public key type")}verifySignature(e){let{message:t,signature:i}=e;return y.isInstance(i)?this.publicKey.verifySignature({message:t,signature:i.signature}):!1}authKey(){return b.fromSchemeAndBytes({scheme:2,input:this.toUint8Array()})}toUint8Array(){return this.bcsToBytes()}serialize(e){e.serializeU32AsUleb128(this.variant),this.publicKey.serialize(e)}static deserialize(e){let t=e.deserializeUleb128AsU32(),i;switch(t){case 0:i=n.deserialize(e);break;case 1:i=a.deserialize(e);break;case 3:i=o.deserialize(e);break;case 4:i=u.deserialize(e);break;default:throw new Error(`Unknown variant index for AnyPublicKey: ${t}`)}return new r(i)}static isPublicKey(e){return e instanceof r}isEd25519(){return this.publicKey instanceof n}isSecp256k1PublicKey(){return this.publicKey instanceof a}static isInstance(e){return"publicKey"in e&&"variant"in e}},y=class r extends f{constructor(e){if(super(),this.signature=e,e instanceof s)this.variant=0;else if(e instanceof c)this.variant=1;else if(e instanceof l)this.variant=3;else throw new Error("Unsupported signature type")}toUint8Array(){return console.warn("[Aptos SDK] Calls to AnySignature.toUint8Array() will soon return the underlying signature bytes. Use AnySignature.bcsToBytes() instead."),this.bcsToBytes()}serialize(e){e.serializeU32AsUleb128(this.variant),this.signature.serialize(e)}static deserialize(e){let t=e.deserializeUleb128AsU32(),i;switch(t){case 0:i=s.deserialize(e);break;case 1:i=c.deserialize(e);break;case 3:i=l.deserialize(e);break;default:throw new Error(`Unknown variant index for AnySignature: ${t}`)}return new r(i)}static isInstance(e){return"signature"in e&&typeof e.signature=="object"&&e.signature!==null&&"toUint8Array"in e.signature}};export{K as a,y as b};
2
+ //# sourceMappingURL=chunk-KKLF7DQV.mjs.map
@@ -0,0 +1,2 @@
1
+ import{a as _}from"./chunk-476F5NJ6.mjs";import{g}from"./chunk-7ZA434Z3.mjs";import{a as C}from"./chunk-VELQA2Y3.mjs";import{a as l}from"./chunk-P74XXLE4.mjs";import{a as v}from"./chunk-FUC7SLH7.mjs";import{i as k,l as E,m as S,n as b,q as y}from"./chunk-B5BXB2BB.mjs";import{b as h}from"./chunk-QZT2M7UA.mjs";import{e as A,f as x}from"./chunk-YT3IP57B.mjs";import{d as K}from"./chunk-F45G3GP3.mjs";import{j as w}from"./chunk-J7PJSK3J.mjs";import{a as u}from"./chunk-Q3CWUEXI.mjs";import{b as f}from"./chunk-SPRNSFUV.mjs";import{jwtDecode as T}from"jwt-decode";async function j(r){let{aptosConfig:i,jwt:a,ephemeralKeyPair:e,uidKey:p="sub",derivationPath:s}=r,t={jwt_b64:a,epk:e.getPublicKey().bcsToHex().toStringWithoutPrefix(),exp_date_secs:e.expiryDateSecs,epk_blinder:f.fromHexInput(e.blinder).toStringWithoutPrefix(),uid_key:p,derivation_path:s},{data:n}=await A({aptosConfig:i,path:"fetch",body:t,originMethod:"getPepper",overrides:{WITH_CREDENTIALS:!1}});return f.fromHexInput(n.pepper).toUint8Array()}async function F(r){let{aptosConfig:i,jwt:a,ephemeralKeyPair:e,pepper:p=await j(r),uidKey:s="sub",maxExpHorizonSecs:t=(await y({aptosConfig:i})).maxExpHorizonSecs}=r;if(f.fromHexInput(p).toUint8Array().length!==l.PEPPER_LENGTH)throw new Error(`Pepper needs to be ${l.PEPPER_LENGTH} bytes`);let n=T(a);if(typeof n.iat!="number")throw new Error("iat was not found");if(t<e.expiryDateSecs-n.iat)throw Error(`The EphemeralKeyPair is too long lived. It's lifespan must be less than ${t}`);let o={jwt_b64:a,epk:e.getPublicKey().bcsToHex().toStringWithoutPrefix(),epk_blinder:f.fromHexInput(e.blinder).toStringWithoutPrefix(),exp_date_secs:e.expiryDateSecs,exp_horizon_secs:t,pepper:f.fromHexInput(p).toStringWithoutPrefix(),uid_key:s},{data:c}=await x({aptosConfig:i,path:"prove",body:o,originMethod:"getProof",overrides:{WITH_CREDENTIALS:!1}}),d=c.proof,m=new E({a:d.a,b:d.b,c:d.c});return new b({proof:new S(m,0),trainingWheelsSignature:h.fromHex(c.training_wheels_signature),expHorizonSecs:t})}async function oe(r){let{aptosConfig:i,jwt:a,jwkAddress:e,uidKey:p,proofFetchCallback:s,pepper:t=await j(r)}=r,{verificationKey:n,maxExpHorizonSecs:o}=await y({aptosConfig:i}),c=F({...r,pepper:t,maxExpHorizonSecs:o}),d=s?c:await c;if(e!==void 0){let H=v.fromJwtAndPepper({jwt:a,pepper:t,jwkAddress:e,uidKey:p}),I=await g({aptosConfig:i,authenticationKey:H.authKey().derivedAddress()});return C.create({...r,address:I,proof:d,pepper:t,proofFetchCallback:s,jwkAddress:e,verificationKey:n})}let m=k.fromJwtAndPepper({jwt:a,pepper:t,uidKey:p}),P=await g({aptosConfig:i,authenticationKey:m.authKey().derivedAddress()});return l.create({...r,address:P,proof:d,pepper:t,proofFetchCallback:s,verificationKey:n})}async function re(r){let{aptosConfig:i,sender:a,iss:e,options:p}=r,{jwksUrl:s}=r;s===void 0&&(w.test(e)?s="https://www.googleapis.com/service_accounts/v1/jwk/securetoken@system.gserviceaccount.com":s=e.endsWith("/")?`${e}.well-known/jwks.json`:`${e}/.well-known/jwks.json`);let t;try{if(t=await fetch(s),!t.ok)throw new Error(`${t.status} ${t.statusText}`)}catch(o){let c;throw o instanceof Error?c=`${o.message}`:c=`error unknown - ${o}`,K.fromErrorType({type:14,details:`Failed to fetch JWKS at ${s}: ${c}`})}let n=await t.json();return _({aptosConfig:i,sender:a.accountAddress,data:{function:"0x1::jwks::update_federated_jwk_set",functionArguments:[e,u.MoveString(n.keys.map(o=>o.kid)),u.MoveString(n.keys.map(o=>o.alg)),u.MoveString(n.keys.map(o=>o.e)),u.MoveString(n.keys.map(o=>o.n))]},options:p})}export{j as a,F as b,oe as c,re as d};
2
+ //# sourceMappingURL=chunk-KPPM2BSC.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/internal/keyless.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/keyless}. By moving the methods out into a separate file,\n * other namespaces and processes can access these methods without depending on the entire\n * keyless namespace and without having a dependency cycle error.\n */\nimport { jwtDecode, JwtPayload } from \"jwt-decode\";\nimport { AptosConfig } from \"../api/aptosConfig\";\nimport { postAptosPepperService, postAptosProvingService } from \"../client\";\nimport {\n AccountAddressInput,\n EphemeralSignature,\n Groth16Zkp,\n Hex,\n KeylessPublicKey,\n MoveJWK,\n ZeroKnowledgeSig,\n ZkProof,\n getKeylessConfig,\n} from \"../core\";\nimport { HexInput, ZkpVariant } from \"../types\";\nimport { Account, EphemeralKeyPair, KeylessAccount, ProofFetchCallback } from \"../account\";\nimport { PepperFetchRequest, PepperFetchResponse, ProverRequest, ProverResponse } from \"../types/keyless\";\nimport { lookupOriginalAccountAddress } from \"./account\";\nimport { FederatedKeylessPublicKey } from \"../core/crypto/federatedKeyless\";\nimport { FederatedKeylessAccount } from \"../account/FederatedKeylessAccount\";\nimport { MoveVector } from \"../bcs\";\nimport { generateTransaction } from \"./transactionSubmission\";\nimport { InputGenerateTransactionOptions, SimpleTransaction } from \"../transactions\";\nimport { KeylessError, KeylessErrorType } from \"../errors\";\nimport { FIREBASE_AUTH_ISS_PATTERN } from \"../utils/const\";\n\n/**\n * Retrieves a pepper value based on the provided configuration and authentication details.\n *\n * @param args - The arguments required to fetch the pepper.\n * @param args.aptosConfig - The configuration object for Aptos.\n * @param args.jwt - The JSON Web Token used for authentication.\n * @param args.ephemeralKeyPair - The ephemeral key pair used for the operation.\n * @param args.uidKey - An optional unique identifier key (defaults to \"sub\").\n * @param args.derivationPath - An optional derivation path for the key.\n * @returns A Uint8Array containing the fetched pepper value.\n */\nexport async function getPepper(args: {\n aptosConfig: AptosConfig;\n jwt: string;\n ephemeralKeyPair: EphemeralKeyPair;\n uidKey?: string;\n derivationPath?: string;\n}): Promise<Uint8Array> {\n const { aptosConfig, jwt, ephemeralKeyPair, uidKey = \"sub\", derivationPath } = args;\n\n const body = {\n jwt_b64: jwt,\n epk: ephemeralKeyPair.getPublicKey().bcsToHex().toStringWithoutPrefix(),\n exp_date_secs: ephemeralKeyPair.expiryDateSecs,\n epk_blinder: Hex.fromHexInput(ephemeralKeyPair.blinder).toStringWithoutPrefix(),\n uid_key: uidKey,\n derivation_path: derivationPath,\n };\n const { data } = await postAptosPepperService<PepperFetchRequest, PepperFetchResponse>({\n aptosConfig,\n path: \"fetch\",\n body,\n originMethod: \"getPepper\",\n overrides: { WITH_CREDENTIALS: false },\n });\n return Hex.fromHexInput(data.pepper).toUint8Array();\n}\n\n/**\n * Generates a zero-knowledge proof based on the provided parameters.\n * This function is essential for creating a signed proof that can be used in various cryptographic operations.\n *\n * @param args - The parameters required to generate the proof.\n * @param args.aptosConfig - The configuration settings for Aptos.\n * @param args.jwt - The JSON Web Token used for authentication.\n * @param args.ephemeralKeyPair - The ephemeral key pair used for generating the proof.\n * @param args.pepper - An optional hex input used to enhance security (default is generated if not provided).\n * @param args.uidKey - An optional string that specifies the unique identifier key (defaults to \"sub\").\n * @throws Error if the pepper length is not valid or if the ephemeral key pair's lifespan exceeds the maximum allowed.\n */\nexport async function getProof(args: {\n aptosConfig: AptosConfig;\n jwt: string;\n ephemeralKeyPair: EphemeralKeyPair;\n pepper?: HexInput;\n uidKey?: string;\n maxExpHorizonSecs?: number;\n}): Promise<ZeroKnowledgeSig> {\n const {\n aptosConfig,\n jwt,\n ephemeralKeyPair,\n pepper = await getPepper(args),\n uidKey = \"sub\",\n maxExpHorizonSecs = (await getKeylessConfig({ aptosConfig })).maxExpHorizonSecs,\n } = args;\n if (Hex.fromHexInput(pepper).toUint8Array().length !== KeylessAccount.PEPPER_LENGTH) {\n throw new Error(`Pepper needs to be ${KeylessAccount.PEPPER_LENGTH} bytes`);\n }\n const decodedJwt = jwtDecode<JwtPayload>(jwt);\n if (typeof decodedJwt.iat !== \"number\") {\n throw new Error(\"iat was not found\");\n }\n if (maxExpHorizonSecs < ephemeralKeyPair.expiryDateSecs - decodedJwt.iat) {\n throw Error(`The EphemeralKeyPair is too long lived. It's lifespan must be less than ${maxExpHorizonSecs}`);\n }\n const json = {\n jwt_b64: jwt,\n epk: ephemeralKeyPair.getPublicKey().bcsToHex().toStringWithoutPrefix(),\n epk_blinder: Hex.fromHexInput(ephemeralKeyPair.blinder).toStringWithoutPrefix(),\n exp_date_secs: ephemeralKeyPair.expiryDateSecs,\n exp_horizon_secs: maxExpHorizonSecs,\n pepper: Hex.fromHexInput(pepper).toStringWithoutPrefix(),\n uid_key: uidKey,\n };\n\n const { data } = await postAptosProvingService<ProverRequest, ProverResponse>({\n aptosConfig,\n path: \"prove\",\n body: json,\n originMethod: \"getProof\",\n overrides: { WITH_CREDENTIALS: false },\n });\n\n const proofPoints = data.proof;\n const groth16Zkp = new Groth16Zkp({\n a: proofPoints.a,\n b: proofPoints.b,\n c: proofPoints.c,\n });\n\n const signedProof = new ZeroKnowledgeSig({\n proof: new ZkProof(groth16Zkp, ZkpVariant.Groth16),\n trainingWheelsSignature: EphemeralSignature.fromHex(data.training_wheels_signature),\n expHorizonSecs: maxExpHorizonSecs,\n });\n return signedProof;\n}\n\n/**\n * Derives a keyless account by fetching the necessary proof and looking up the original account address.\n * This function helps in creating a keyless account that can be used without managing private keys directly.\n *\n * @param args - The arguments required to derive the keyless account.\n * @param args.aptosConfig - The configuration settings for Aptos.\n * @param args.jwt - The JSON Web Token used for authentication.\n * @param args.ephemeralKeyPair - The ephemeral key pair used for cryptographic operations.\n * @param args.uidKey - An optional unique identifier key for the user.\n * @param args.pepper - An optional hexadecimal input used for additional security.\n * @param args.proofFetchCallback - An optional callback function to handle the proof fetch outcome.\n * @returns A keyless account object.\n */\nexport async function deriveKeylessAccount(args: {\n aptosConfig: AptosConfig;\n jwt: string;\n ephemeralKeyPair: EphemeralKeyPair;\n uidKey?: string;\n pepper?: HexInput;\n proofFetchCallback?: ProofFetchCallback;\n}): Promise<KeylessAccount>;\n\nexport async function deriveKeylessAccount(args: {\n aptosConfig: AptosConfig;\n jwt: string;\n ephemeralKeyPair: EphemeralKeyPair;\n jwkAddress: AccountAddressInput;\n uidKey?: string;\n pepper?: HexInput;\n proofFetchCallback?: ProofFetchCallback;\n}): Promise<FederatedKeylessAccount>;\n\nexport async function deriveKeylessAccount(args: {\n aptosConfig: AptosConfig;\n jwt: string;\n ephemeralKeyPair: EphemeralKeyPair;\n jwkAddress?: AccountAddressInput;\n uidKey?: string;\n pepper?: HexInput;\n proofFetchCallback?: ProofFetchCallback;\n}): Promise<KeylessAccount | FederatedKeylessAccount> {\n const { aptosConfig, jwt, jwkAddress, uidKey, proofFetchCallback, pepper = await getPepper(args) } = args;\n const { verificationKey, maxExpHorizonSecs } = await getKeylessConfig({ aptosConfig });\n\n const proofPromise = getProof({ ...args, pepper, maxExpHorizonSecs });\n // If a callback is provided, pass in the proof as a promise to KeylessAccount.create. This will make the proof be fetched in the\n // background and the callback will handle the outcome of the fetch. This allows the developer to not have to block on the proof fetch\n // allowing for faster rendering of UX.\n //\n // If no callback is provided, the just await the proof fetch and continue synchronously.\n const proof = proofFetchCallback ? proofPromise : await proofPromise;\n\n // Look up the original address to handle key rotations and then instantiate the account.\n if (jwkAddress !== undefined) {\n const publicKey = FederatedKeylessPublicKey.fromJwtAndPepper({ jwt, pepper, jwkAddress, uidKey });\n const address = await lookupOriginalAccountAddress({\n aptosConfig,\n authenticationKey: publicKey.authKey().derivedAddress(),\n });\n\n return FederatedKeylessAccount.create({\n ...args,\n address,\n proof,\n pepper,\n proofFetchCallback,\n jwkAddress,\n verificationKey,\n });\n }\n\n const publicKey = KeylessPublicKey.fromJwtAndPepper({ jwt, pepper, uidKey });\n const address = await lookupOriginalAccountAddress({\n aptosConfig,\n authenticationKey: publicKey.authKey().derivedAddress(),\n });\n return KeylessAccount.create({ ...args, address, proof, pepper, proofFetchCallback, verificationKey });\n}\n\nexport interface JWKS {\n keys: MoveJWK[];\n}\n\nexport async function updateFederatedKeylessJwkSetTransaction(args: {\n aptosConfig: AptosConfig;\n sender: Account;\n iss: string;\n jwksUrl?: string;\n options?: InputGenerateTransactionOptions;\n}): Promise<SimpleTransaction> {\n const { aptosConfig, sender, iss, options } = args;\n\n let { jwksUrl } = args;\n\n if (jwksUrl === undefined) {\n if (FIREBASE_AUTH_ISS_PATTERN.test(iss)) {\n jwksUrl = \"https://www.googleapis.com/service_accounts/v1/jwk/securetoken@system.gserviceaccount.com\";\n } else {\n jwksUrl = iss.endsWith(\"/\") ? `${iss}.well-known/jwks.json` : `${iss}/.well-known/jwks.json`;\n }\n }\n\n let response: Response;\n\n try {\n response = await fetch(jwksUrl);\n if (!response.ok) {\n throw new Error(`${response.status} ${response.statusText}`);\n }\n } catch (error) {\n let errorMessage: string;\n if (error instanceof Error) {\n errorMessage = `${error.message}`;\n } else {\n errorMessage = `error unknown - ${error}`;\n }\n throw KeylessError.fromErrorType({\n type: KeylessErrorType.JWK_FETCH_FAILED_FEDERATED,\n details: `Failed to fetch JWKS at ${jwksUrl}: ${errorMessage}`,\n });\n }\n\n const jwks: JWKS = await response.json();\n return generateTransaction({\n aptosConfig,\n sender: sender.accountAddress,\n data: {\n function: \"0x1::jwks::update_federated_jwk_set\",\n functionArguments: [\n iss,\n MoveVector.MoveString(jwks.keys.map((key) => key.kid)),\n MoveVector.MoveString(jwks.keys.map((key) => key.alg)),\n MoveVector.MoveString(jwks.keys.map((key) => key.e)),\n MoveVector.MoveString(jwks.keys.map((key) => key.n)),\n ],\n },\n options,\n });\n}\n"],"mappings":"0gBASA,OAAS,aAAAA,MAA6B,aAqCtC,eAAsBC,EAAUC,EAMR,CACtB,GAAM,CAAE,YAAAC,EAAa,IAAAC,EAAK,iBAAAC,EAAkB,OAAAC,EAAS,MAAO,eAAAC,CAAe,EAAIL,EAEzEM,EAAO,CACX,QAASJ,EACT,IAAKC,EAAiB,aAAa,EAAE,SAAS,EAAE,sBAAsB,EACtE,cAAeA,EAAiB,eAChC,YAAaI,EAAI,aAAaJ,EAAiB,OAAO,EAAE,sBAAsB,EAC9E,QAASC,EACT,gBAAiBC,CACnB,EACM,CAAE,KAAAG,CAAK,EAAI,MAAMC,EAAgE,CACrF,YAAAR,EACA,KAAM,QACN,KAAAK,EACA,aAAc,YACd,UAAW,CAAE,iBAAkB,EAAM,CACvC,CAAC,EACD,OAAOC,EAAI,aAAaC,EAAK,MAAM,EAAE,aAAa,CACpD,CAcA,eAAsBE,EAASV,EAOD,CAC5B,GAAM,CACJ,YAAAC,EACA,IAAAC,EACA,iBAAAC,EACA,OAAAQ,EAAS,MAAMZ,EAAUC,CAAI,EAC7B,OAAAI,EAAS,MACT,kBAAAQ,GAAqB,MAAMC,EAAiB,CAAE,YAAAZ,CAAY,CAAC,GAAG,iBAChE,EAAID,EACJ,GAAIO,EAAI,aAAaI,CAAM,EAAE,aAAa,EAAE,SAAWG,EAAe,cACpE,MAAM,IAAI,MAAM,sBAAsBA,EAAe,aAAa,QAAQ,EAE5E,IAAMC,EAAaC,EAAsBd,CAAG,EAC5C,GAAI,OAAOa,EAAW,KAAQ,SAC5B,MAAM,IAAI,MAAM,mBAAmB,EAErC,GAAIH,EAAoBT,EAAiB,eAAiBY,EAAW,IACnE,MAAM,MAAM,4EAA4EH,CAAiB,EAAE,EAE7G,IAAMK,EAAO,CACX,QAASf,EACT,IAAKC,EAAiB,aAAa,EAAE,SAAS,EAAE,sBAAsB,EACtE,YAAaI,EAAI,aAAaJ,EAAiB,OAAO,EAAE,sBAAsB,EAC9E,cAAeA,EAAiB,eAChC,iBAAkBS,EAClB,OAAQL,EAAI,aAAaI,CAAM,EAAE,sBAAsB,EACvD,QAASP,CACX,EAEM,CAAE,KAAAI,CAAK,EAAI,MAAMU,EAAuD,CAC5E,YAAAjB,EACA,KAAM,QACN,KAAMgB,EACN,aAAc,WACd,UAAW,CAAE,iBAAkB,EAAM,CACvC,CAAC,EAEKE,EAAcX,EAAK,MACnBY,EAAa,IAAIC,EAAW,CAChC,EAAGF,EAAY,EACf,EAAGA,EAAY,EACf,EAAGA,EAAY,CACjB,CAAC,EAOD,OALoB,IAAIG,EAAiB,CACvC,MAAO,IAAIC,EAAQH,GAA8B,EACjD,wBAAyBI,EAAmB,QAAQhB,EAAK,yBAAyB,EAClF,eAAgBI,CAClB,CAAC,CAEH,CAkCA,eAAsBa,GAAqBzB,EAQW,CACpD,GAAM,CAAE,YAAAC,EAAa,IAAAC,EAAK,WAAAwB,EAAY,OAAAtB,EAAQ,mBAAAuB,EAAoB,OAAAhB,EAAS,MAAMZ,EAAUC,CAAI,CAAE,EAAIA,EAC/F,CAAE,gBAAA4B,EAAiB,kBAAAhB,CAAkB,EAAI,MAAMC,EAAiB,CAAE,YAAAZ,CAAY,CAAC,EAE/E4B,EAAenB,EAAS,CAAE,GAAGV,EAAM,OAAAW,EAAQ,kBAAAC,CAAkB,CAAC,EAM9DkB,EAAQH,EAAqBE,EAAe,MAAMA,EAGxD,GAAIH,IAAe,OAAW,CAC5B,IAAMK,EAAYC,EAA0B,iBAAiB,CAAE,IAAA9B,EAAK,OAAAS,EAAQ,WAAAe,EAAY,OAAAtB,CAAO,CAAC,EAC1F6B,EAAU,MAAMC,EAA6B,CACjD,YAAAjC,EACA,kBAAmB8B,EAAU,QAAQ,EAAE,eAAe,CACxD,CAAC,EAED,OAAOI,EAAwB,OAAO,CACpC,GAAGnC,EACH,QAAAiC,EACA,MAAAH,EACA,OAAAnB,EACA,mBAAAgB,EACA,WAAAD,EACA,gBAAAE,CACF,CAAC,CACH,CAEA,IAAMG,EAAYK,EAAiB,iBAAiB,CAAE,IAAAlC,EAAK,OAAAS,EAAQ,OAAAP,CAAO,CAAC,EACrE6B,EAAU,MAAMC,EAA6B,CACjD,YAAAjC,EACA,kBAAmB8B,EAAU,QAAQ,EAAE,eAAe,CACxD,CAAC,EACD,OAAOjB,EAAe,OAAO,CAAE,GAAGd,EAAM,QAAAiC,EAAS,MAAAH,EAAO,OAAAnB,EAAQ,mBAAAgB,EAAoB,gBAAAC,CAAgB,CAAC,CACvG,CAMA,eAAsBS,GAAwCrC,EAM/B,CAC7B,GAAM,CAAE,YAAAC,EAAa,OAAAqC,EAAQ,IAAAC,EAAK,QAAAC,CAAQ,EAAIxC,EAE1C,CAAE,QAAAyC,CAAQ,EAAIzC,EAEdyC,IAAY,SACVC,EAA0B,KAAKH,CAAG,EACpCE,EAAU,4FAEVA,EAAUF,EAAI,SAAS,GAAG,EAAI,GAAGA,CAAG,wBAA0B,GAAGA,CAAG,0BAIxE,IAAII,EAEJ,GAAI,CAEF,GADAA,EAAW,MAAM,MAAMF,CAAO,EAC1B,CAACE,EAAS,GACZ,MAAM,IAAI,MAAM,GAAGA,EAAS,MAAM,IAAIA,EAAS,UAAU,EAAE,CAE/D,OAASC,EAAO,CACd,IAAIC,EACJ,MAAID,aAAiB,MACnBC,EAAe,GAAGD,EAAM,OAAO,GAE/BC,EAAe,mBAAmBD,CAAK,GAEnCE,EAAa,cAAc,CAC/B,QACA,QAAS,2BAA2BL,CAAO,KAAKI,CAAY,EAC9D,CAAC,CACH,CAEA,IAAME,EAAa,MAAMJ,EAAS,KAAK,EACvC,OAAOK,EAAoB,CACzB,YAAA/C,EACA,OAAQqC,EAAO,eACf,KAAM,CACJ,SAAU,sCACV,kBAAmB,CACjBC,EACAU,EAAW,WAAWF,EAAK,KAAK,IAAKG,GAAQA,EAAI,GAAG,CAAC,EACrDD,EAAW,WAAWF,EAAK,KAAK,IAAKG,GAAQA,EAAI,GAAG,CAAC,EACrDD,EAAW,WAAWF,EAAK,KAAK,IAAKG,GAAQA,EAAI,CAAC,CAAC,EACnDD,EAAW,WAAWF,EAAK,KAAK,IAAKG,GAAQA,EAAI,CAAC,CAAC,CACrD,CACF,EACA,QAAAV,CACF,CAAC,CACH","names":["jwtDecode","getPepper","args","aptosConfig","jwt","ephemeralKeyPair","uidKey","derivationPath","body","Hex","data","postAptosPepperService","getProof","pepper","maxExpHorizonSecs","getKeylessConfig","KeylessAccount","decodedJwt","jwtDecode","json","postAptosProvingService","proofPoints","groth16Zkp","Groth16Zkp","ZeroKnowledgeSig","ZkProof","EphemeralSignature","deriveKeylessAccount","jwkAddress","proofFetchCallback","verificationKey","proofPromise","proof","publicKey","FederatedKeylessPublicKey","address","lookupOriginalAccountAddress","FederatedKeylessAccount","KeylessPublicKey","updateFederatedKeylessJwkSetTransaction","sender","iss","options","jwksUrl","FIREBASE_AUTH_ISS_PATTERN","response","error","errorMessage","KeylessError","jwks","generateTransaction","MoveVector","key"]}
@@ -1,2 +1,2 @@
1
- import{d as s}from"./chunk-FXUI3SSD.mjs";import{b as i}from"./chunk-YZ3YPLEU.mjs";import{c as n}from"./chunk-L2SDI7PI.mjs";import{b as o}from"./chunk-JNO7KPMG.mjs";var c=class a{constructor(t){this.signingScheme=0;let{privateKey:e,address:r}=t;this.privateKey=e,this.publicKey=e.publicKey(),this.accountAddress=r?o.from(r):this.publicKey.authKey().derivedAddress()}static generate(){let t=n.generate();return new a({privateKey:t})}static fromDerivationPath(t){let{path:e,mnemonic:r}=t,u=n.fromDerivationPath(e,r);return new a({privateKey:u})}verifySignature(t){return this.publicKey.verifySignature(t)}signWithAuthenticator(t){return new i(this.publicKey,this.privateKey.sign(t))}signTransactionWithAuthenticator(t){return new i(this.publicKey,this.signTransaction(t))}sign(t){return this.privateKey.sign(t)}signTransaction(t){return this.sign(s(t))}};export{c as a};
2
- //# sourceMappingURL=chunk-JLD7DLKM.mjs.map
1
+ import{d as s}from"./chunk-TQA6HY6A.mjs";import{b as i}from"./chunk-OEM75TVE.mjs";import{c as n}from"./chunk-TTERI67T.mjs";import{b as o}from"./chunk-JNO7KPMG.mjs";var c=class a{constructor(t){this.signingScheme=0;let{privateKey:e,address:r}=t;this.privateKey=e,this.publicKey=e.publicKey(),this.accountAddress=r?o.from(r):this.publicKey.authKey().derivedAddress()}static generate(){let t=n.generate();return new a({privateKey:t})}static fromDerivationPath(t){let{path:e,mnemonic:r}=t,u=n.fromDerivationPath(e,r);return new a({privateKey:u})}verifySignature(t){return this.publicKey.verifySignature(t)}signWithAuthenticator(t){return new i(this.publicKey,this.privateKey.sign(t))}signTransactionWithAuthenticator(t){return new i(this.publicKey,this.signTransaction(t))}sign(t){return this.privateKey.sign(t)}signTransaction(t){return this.sign(s(t))}};export{c as a};
2
+ //# sourceMappingURL=chunk-L3J2QVIY.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as u}from"./chunk-2QBCTW67.mjs";import{a as A}from"./chunk-HFWFDS6Y.mjs";import{a as h}from"./chunk-CA3Q2X6B.mjs";import{a as y}from"./chunk-JDNI5VIJ.mjs";import{a as m}from"./chunk-46L6BAJG.mjs";import{a as d}from"./chunk-V5NDNR36.mjs";import{a as r}from"./chunk-2NHQQQZK.mjs";import{a}from"./chunk-SBCLBDCP.mjs";import{a as c}from"./chunk-6K4TOFCO.mjs";import{a as l}from"./chunk-5NJWJXSS.mjs";import{a as f}from"./chunk-OKE3FXIP.mjs";import{a as g}from"./chunk-AAATWCJT.mjs";import{a as s}from"./chunk-4YEOOZ2N.mjs";import{a as p}from"./chunk-E2NYQVP3.mjs";var t=class{constructor(n){this.config=new d(n),this.account=new s(this.config),this.ans=new p(this.config),this.coin=new r(this.config),this.digitalAsset=new a(this.config),this.event=new c(this.config),this.faucet=new l(this.config),this.fungibleAsset=new f(this.config),this.general=new g(this.config),this.staking=new h(this.config),this.transaction=new m(this.config),this.table=new y(this.config),this.keyless=new u(this.config),this.object=new A(this.config)}};function e(b,n,w){Object.getOwnPropertyNames(n.prototype).forEach(i=>{let o=Object.getOwnPropertyDescriptor(n.prototype,i);o&&(o.value=function(...j){return this[w][i](...j)},Object.defineProperty(b.prototype,i,o))})}e(t,s,"account");e(t,p,"ans");e(t,r,"coin");e(t,a,"digitalAsset");e(t,c,"event");e(t,l,"faucet");e(t,f,"fungibleAsset");e(t,g,"general");e(t,h,"staking");e(t,m,"transaction");e(t,y,"table");e(t,u,"keyless");e(t,A,"object");export{t as a};
2
- //# sourceMappingURL=chunk-MOGPSSTD.mjs.map
1
+ import{a as u}from"./chunk-S3YVCCYI.mjs";import{a as A}from"./chunk-RV7PNWDY.mjs";import{a as h}from"./chunk-HKVZ7CAG.mjs";import{a as y}from"./chunk-64IZ5PQR.mjs";import{a as m}from"./chunk-GT7QFXER.mjs";import{a as d}from"./chunk-V5NDNR36.mjs";import{a as r}from"./chunk-A7TJF3BX.mjs";import{a}from"./chunk-JUQBFGUD.mjs";import{a as c}from"./chunk-4ULPBQ3M.mjs";import{a as l}from"./chunk-VAKNMHOA.mjs";import{a as f}from"./chunk-XOOYRVFK.mjs";import{a as g}from"./chunk-737YW3CY.mjs";import{a as s}from"./chunk-MWNYODWU.mjs";import{a as p}from"./chunk-7ZVXQAG4.mjs";var t=class{constructor(n){this.config=new d(n),this.account=new s(this.config),this.ans=new p(this.config),this.coin=new r(this.config),this.digitalAsset=new a(this.config),this.event=new c(this.config),this.faucet=new l(this.config),this.fungibleAsset=new f(this.config),this.general=new g(this.config),this.staking=new h(this.config),this.transaction=new m(this.config),this.table=new y(this.config),this.keyless=new u(this.config),this.object=new A(this.config)}};function e(b,n,w){Object.getOwnPropertyNames(n.prototype).forEach(i=>{let o=Object.getOwnPropertyDescriptor(n.prototype,i);o&&(o.value=function(...j){return this[w][i](...j)},Object.defineProperty(b.prototype,i,o))})}e(t,s,"account");e(t,p,"ans");e(t,r,"coin");e(t,a,"digitalAsset");e(t,c,"event");e(t,l,"faucet");e(t,f,"fungibleAsset");e(t,g,"general");e(t,h,"staking");e(t,m,"transaction");e(t,y,"table");e(t,u,"keyless");e(t,A,"object");export{t as a};
2
+ //# sourceMappingURL=chunk-LK67PZX3.mjs.map
@@ -1,2 +1,2 @@
1
- import{b as p}from"./chunk-KT3DT5GV.mjs";async function r(e){let{aptosConfig:t,overrides:s,params:n,contentType:o,acceptType:i,path:a,originMethod:R,type:d}=e,u=t.getRequestUrl(d);return p({url:u,method:"GET",originMethod:R,path:a,contentType:o,acceptType:i,params:n,overrides:{...t.clientConfig,...s}},t,e.type)}async function y(e){let{aptosConfig:t}=e;return r({...e,type:"Fullnode",overrides:{...t.clientConfig,...t.fullnodeConfig,...e.overrides,HEADERS:{...t.clientConfig?.HEADERS,...t.fullnodeConfig?.HEADERS}}})}async function m(e){return r({...e,type:"Pepper"})}async function A(e){let t=[],s,n=e.params;do{let o=await r({type:"Fullnode",aptosConfig:e.aptosConfig,originMethod:e.originMethod,path:e.path,params:n,overrides:e.overrides});s=o.headers["x-aptos-cursor"],delete o.headers,t.push(...o.data),n.start=s}while(s!=null);return t}export{r as a,y as b,m as c,A as d};
2
- //# sourceMappingURL=chunk-6LLGRGCN.mjs.map
1
+ import{b as p}from"./chunk-P6RNNESB.mjs";async function r(e){let{aptosConfig:t,overrides:s,params:n,contentType:o,acceptType:i,path:a,originMethod:R,type:d}=e,u=t.getRequestUrl(d);return p({url:u,method:"GET",originMethod:R,path:a,contentType:o,acceptType:i,params:n,overrides:{...t.clientConfig,...s}},t,e.type)}async function y(e){let{aptosConfig:t}=e;return r({...e,type:"Fullnode",overrides:{...t.clientConfig,...t.fullnodeConfig,...e.overrides,HEADERS:{...t.clientConfig?.HEADERS,...t.fullnodeConfig?.HEADERS}}})}async function m(e){return r({...e,type:"Pepper"})}async function A(e){let t=[],s,n=e.params;do{let o=await r({type:"Fullnode",aptosConfig:e.aptosConfig,originMethod:e.originMethod,path:e.path,params:n,overrides:e.overrides});s=o.headers["x-aptos-cursor"],delete o.headers,t.push(...o.data),n.start=s}while(s!=null);return t}export{r as a,y as b,m as c,A as d};
2
+ //# sourceMappingURL=chunk-LRN4ALMT.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as o,b as l}from"./chunk-LAAFLCDM.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-BLLHTGAP.mjs.map
1
+ import{a as o,b as l}from"./chunk-KKLF7DQV.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-LWXBEIFO.mjs.map
@@ -1,2 +1,2 @@
1
- import{b as h,c as d,e as m}from"./chunk-GMKKHGXK.mjs";import{a as p,b as u}from"./chunk-3XCYCFYI.mjs";import{c as s}from"./chunk-L2SDI7PI.mjs";import{a as c}from"./chunk-AJ5JHBAE.mjs";import{b as y}from"./chunk-SPRNSFUV.mjs";import{c as b,d as K}from"./chunk-V4FKFCBL.mjs";import{a as l}from"./chunk-D52UKPQF.mjs";import{randomBytes as E}from"@noble/hashes/utils";var S=1209600,i=class i extends c{constructor(e){super();let{privateKey:r,expiryDateSecs:a,blinder:n}=e;this.privateKey=r,this.publicKey=new p(r.publicKey()),this.expiryDateSecs=a||K(b()+S),this.blinder=n!==void 0?y.fromHexInput(n).toUint8Array():v();let t=h(this.publicKey.bcsToBytes(),93);t.push(BigInt(this.expiryDateSecs)),t.push(d(this.blinder));let x=m(t);this.nonce=x.toString()}getPublicKey(){return this.publicKey}isExpired(){return Math.floor(Date.now()/1e3)>this.expiryDateSecs}serialize(e){e.serializeU32AsUleb128(this.publicKey.variant),e.serializeBytes(this.privateKey.toUint8Array()),e.serializeU64(this.expiryDateSecs),e.serializeFixedBytes(this.blinder)}static deserialize(e){let r=e.deserializeUleb128AsU32(),a;switch(r){case 0:a=s.deserialize(e);break;default:throw new Error(`Unknown variant index for EphemeralPublicKey: ${r}`)}let n=e.deserializeU64(),t=e.deserializeFixedBytes(31);return new i({privateKey:a,expiryDateSecs:Number(n),blinder:t})}static fromBytes(e){return i.deserialize(new l(e))}static generate(e){let r;switch(e?.scheme){case 0:default:r=s.generate()}return new i({privateKey:r,expiryDateSecs:e?.expiryDateSecs})}sign(e){if(this.isExpired())throw new Error("EphemeralKeyPair has expired");return new u(this.privateKey.sign(e))}};i.BLINDER_LENGTH=31;var o=i;function v(){return E(o.BLINDER_LENGTH)}export{o as a};
2
- //# sourceMappingURL=chunk-7WXDXBXK.mjs.map
1
+ import{a as p,b as u}from"./chunk-QZT2M7UA.mjs";import{b as h,c as d,e as m}from"./chunk-GMKKHGXK.mjs";import{c as s}from"./chunk-TTERI67T.mjs";import{a as l}from"./chunk-D52UKPQF.mjs";import{a as c}from"./chunk-AJ5JHBAE.mjs";import{b as y}from"./chunk-SPRNSFUV.mjs";import{c as b,d as K}from"./chunk-V4FKFCBL.mjs";import{randomBytes as E}from"@noble/hashes/utils";var S=1209600,i=class i extends c{constructor(e){super();let{privateKey:r,expiryDateSecs:a,blinder:n}=e;this.privateKey=r,this.publicKey=new p(r.publicKey()),this.expiryDateSecs=a||K(b()+S),this.blinder=n!==void 0?y.fromHexInput(n).toUint8Array():v();let t=h(this.publicKey.bcsToBytes(),93);t.push(BigInt(this.expiryDateSecs)),t.push(d(this.blinder));let x=m(t);this.nonce=x.toString()}getPublicKey(){return this.publicKey}isExpired(){return Math.floor(Date.now()/1e3)>this.expiryDateSecs}serialize(e){e.serializeU32AsUleb128(this.publicKey.variant),e.serializeBytes(this.privateKey.toUint8Array()),e.serializeU64(this.expiryDateSecs),e.serializeFixedBytes(this.blinder)}static deserialize(e){let r=e.deserializeUleb128AsU32(),a;switch(r){case 0:a=s.deserialize(e);break;default:throw new Error(`Unknown variant index for EphemeralPublicKey: ${r}`)}let n=e.deserializeU64(),t=e.deserializeFixedBytes(31);return new i({privateKey:a,expiryDateSecs:Number(n),blinder:t})}static fromBytes(e){return i.deserialize(new l(e))}static generate(e){let r;switch(e?.scheme){case 0:default:r=s.generate()}return new i({privateKey:r,expiryDateSecs:e?.expiryDateSecs})}sign(e){if(this.isExpired())throw new Error("EphemeralKeyPair has expired");return new u(this.privateKey.sign(e))}};i.BLINDER_LENGTH=31;var o=i;function v(){return E(o.BLINDER_LENGTH)}export{o as a};
2
+ //# sourceMappingURL=chunk-LZ5PSDOS.mjs.map
@@ -0,0 +1,2 @@
1
+ import{a as t}from"./chunk-476F5NJ6.mjs";var o=class{constructor(n){this.config=n}async simple(n){return t({aptosConfig:this.config,...n})}async multiAgent(n){return t({aptosConfig:this.config,...n})}};export{o as a};
2
+ //# sourceMappingURL=chunk-MCWOKFVH.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/api/transactionSubmission/build.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { AccountAddressInput } from \"../../core\";\nimport { generateTransaction } from \"../../internal/transactionSubmission\";\nimport { InputGenerateTransactionPayloadData, InputGenerateTransactionOptions } from \"../../transactions\";\nimport { MultiAgentTransaction } from \"../../transactions/instances/multiAgentTransaction\";\nimport { SimpleTransaction } from \"../../transactions/instances/simpleTransaction\";\nimport { AptosConfig } from \"../aptosConfig\";\n\n/**\n * A class to handle all `Build` transaction operations.\n */\nexport class Build {\n readonly config: AptosConfig;\n\n /**\n * Initializes a new instance of the Aptos client with the specified configuration.\n * This allows you to interact with the Aptos blockchain using the provided settings.\n *\n * @param config - The configuration settings for the Aptos client.\n * @param config.network - The network to connect to (e.g., TESTNET, MAINNET).\n * @param config.nodeUrl - The URL of the Aptos node to connect to.\n * @param config.account - The account details for authentication.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * async function runExample() {\n * // Create a configuration for the Aptos client\n * const config = new AptosConfig({\n * network: Network.TESTNET, // specify the network\n * nodeUrl: \"https://testnet.aptos.dev\", // specify the node URL\n * });\n *\n * // Initialize the Aptos client\n * const aptos = new Aptos(config);\n *\n * console.log(\"Aptos client initialized:\", aptos);\n * }\n * runExample().catch(console.error);\n * ```\n */\n constructor(config: AptosConfig) {\n this.config = config;\n }\n\n /**\n * Build a simple transaction.\n *\n * This function allows you to create a transaction with specified sender and data.\n *\n * @param args.sender - The sender account address.\n * @param args.data - The transaction data.\n * @param args.options - Optional transaction configurations.\n * @param args.withFeePayer - Whether there is a fee payer for the transaction.\n *\n * @returns SimpleTransaction\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Build a simple transaction\n * const transaction = await aptos.transaction.simple({\n * sender: \"0x1\", // replace with a real sender account address\n * data: {\n * function: \"0x1::aptos_account::transfer\",\n * functionArguments: [\"0x2\", 100], // replace with a real destination account address\n * },\n * options: {\n * gasUnitPrice: 100, // specify your own gas unit price if needed\n * maxGasAmount: 1000, // specify your own max gas amount if needed\n * },\n * });\n *\n * console.log(transaction);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async simple(args: {\n sender: AccountAddressInput;\n data: InputGenerateTransactionPayloadData;\n options?: InputGenerateTransactionOptions;\n withFeePayer?: boolean;\n }): Promise<SimpleTransaction> {\n return generateTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Build a multi-agent transaction that allows multiple signers to authorize a transaction.\n *\n * @param args - The parameters for creating the multi-agent transaction.\n * @param args.sender - The sender account address.\n * @param args.data - The transaction data.\n * @param args.secondarySignerAddresses - An array of the secondary signers' account addresses.\n * @param args.options - Optional transaction configurations.\n * @param args.withFeePayer - Whether there is a fee payer for the transaction.\n *\n * @returns MultiAgentTransaction\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Build a multi-agent transaction\n * const transaction = await aptos.multiAgent({\n * sender: \"0x1\", // replace with a real sender account address\n * data: {\n * // Transaction data structure\n * function: \"0x1::aptos_account::transfer\",\n * functionArguments: [\"0x2\", 100], // replace with a real destination account address and amount\n * },\n * secondarySignerAddresses: [\"0x3\", \"0x4\"], // replace with real secondary signer addresses\n * options: {\n * // Optional transaction configurations\n * maxGasAmount: \"1000\",\n * gasUnitPrice: \"1\",\n * },\n * });\n *\n * console.log(transaction);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async multiAgent(args: {\n sender: AccountAddressInput;\n data: InputGenerateTransactionPayloadData;\n secondarySignerAddresses: AccountAddressInput[];\n options?: InputGenerateTransactionOptions;\n withFeePayer?: boolean;\n }): Promise<MultiAgentTransaction> {\n return generateTransaction({ aptosConfig: this.config, ...args });\n }\n}\n"],"mappings":"yCAaO,IAAMA,EAAN,KAAY,CA+BjB,YAAYC,EAAqB,CAC/B,KAAK,OAASA,CAChB,CAwCA,MAAM,OAAOC,EAKkB,CAC7B,OAAOC,EAAoB,CAAE,YAAa,KAAK,OAAQ,GAAGD,CAAK,CAAC,CAClE,CA2CA,MAAM,WAAWA,EAMkB,CACjC,OAAOC,EAAoB,CAAE,YAAa,KAAK,OAAQ,GAAGD,CAAK,CAAC,CAClE,CACF","names":["Build","config","args","generateTransaction"]}
@@ -1,2 +1,2 @@
1
- import{b as g}from"./chunk-H457BI3I.mjs";import{e as a}from"./chunk-YZ3YPLEU.mjs";import{a as m,b as u}from"./chunk-BLLHTGAP.mjs";import{b as y}from"./chunk-JNO7KPMG.mjs";var p=class l{constructor(e){let{multiKey:s,signers:i,address:r}=e;this.publicKey=s,this.signingScheme=3,this.accountAddress=r?y.from(r):this.publicKey.authKey().derivedAddress();let t=[];for(let n of i)t.push(this.publicKey.getIndex(n.publicKey));let c=i.map((n,o)=>[n,t[o]]);c.sort((n,o)=>n[1]-o[1]),this.signers=c.map(n=>n[0]),this.signerIndicies=c.map(n=>n[1]),this.signaturesBitmap=this.publicKey.createBitmap({bits:t})}static fromPublicKeysAndSigners(e){let{publicKeys:s,signaturesRequired:i,signers:r}=e,t=new m({publicKeys:s,signaturesRequired:i});return new l({multiKey:t,signers:r})}static isMultiKeySigner(e){return e instanceof l}signWithAuthenticator(e){return new a(this.publicKey,this.sign(e))}signTransactionWithAuthenticator(e){return new a(this.publicKey,this.signTransaction(e))}async waitForProofFetch(){let s=this.signers.filter(i=>i instanceof g).map(async i=>i.waitForProofFetch());await Promise.all(s)}async checkKeylessAccountValidity(e){let i=this.signers.filter(r=>r instanceof g).map(r=>r.checkKeylessAccountValidity(e));await Promise.all(i)}sign(e){let s=[];for(let i of this.signers)s.push(i.sign(e));return new u({signatures:s,bitmap:this.signaturesBitmap})}signTransaction(e){let s=[];for(let i of this.signers)s.push(i.signTransaction(e));return new u({signatures:s,bitmap:this.signaturesBitmap})}verifySignature(e){let{message:s,signature:i}=e;if(!this.signerIndicies.every((t,c)=>c===0||t>=this.signerIndicies[c-1]))return!1;for(let t=0;t<i.signatures.length;t+=1){let c=i.signatures[t];if(!this.publicKey.publicKeys[this.signerIndicies[t]].verifySignature({message:s,signature:c}))return!1}return!0}};export{p as a};
2
- //# sourceMappingURL=chunk-GBVRCWCD.mjs.map
1
+ import{b as g}from"./chunk-H7PDLUNP.mjs";import{e as a}from"./chunk-OEM75TVE.mjs";import{a as m,b as u}from"./chunk-LWXBEIFO.mjs";import{b as y}from"./chunk-JNO7KPMG.mjs";var p=class l{constructor(e){let{multiKey:s,signers:i,address:r}=e;this.publicKey=s,this.signingScheme=3,this.accountAddress=r?y.from(r):this.publicKey.authKey().derivedAddress();let t=[];for(let n of i)t.push(this.publicKey.getIndex(n.publicKey));let c=i.map((n,o)=>[n,t[o]]);c.sort((n,o)=>n[1]-o[1]),this.signers=c.map(n=>n[0]),this.signerIndicies=c.map(n=>n[1]),this.signaturesBitmap=this.publicKey.createBitmap({bits:t})}static fromPublicKeysAndSigners(e){let{publicKeys:s,signaturesRequired:i,signers:r}=e,t=new m({publicKeys:s,signaturesRequired:i});return new l({multiKey:t,signers:r})}static isMultiKeySigner(e){return e instanceof l}signWithAuthenticator(e){return new a(this.publicKey,this.sign(e))}signTransactionWithAuthenticator(e){return new a(this.publicKey,this.signTransaction(e))}async waitForProofFetch(){let s=this.signers.filter(i=>i instanceof g).map(async i=>i.waitForProofFetch());await Promise.all(s)}async checkKeylessAccountValidity(e){let i=this.signers.filter(r=>r instanceof g).map(r=>r.checkKeylessAccountValidity(e));await Promise.all(i)}sign(e){let s=[];for(let i of this.signers)s.push(i.sign(e));return new u({signatures:s,bitmap:this.signaturesBitmap})}signTransaction(e){let s=[];for(let i of this.signers)s.push(i.signTransaction(e));return new u({signatures:s,bitmap:this.signaturesBitmap})}verifySignature(e){let{message:s,signature:i}=e;if(!this.signerIndicies.every((t,c)=>c===0||t>=this.signerIndicies[c-1]))return!1;for(let t=0;t<i.signatures.length;t+=1){let c=i.signatures[t];if(!this.publicKey.publicKeys[this.signerIndicies[t]].verifySignature({message:s,signature:c}))return!1}return!0}};export{p as a};
2
+ //# sourceMappingURL=chunk-MV5PGWJQ.mjs.map
@@ -1,4 +1,4 @@
1
- import{a as o}from"./chunk-XT5T5LAP.mjs";import{a as d}from"./chunk-NHKAQRJB.mjs";import{a as y,b as l,c as C,d as T,e as O,f as h,g as L,h as P,i as S,j as V,k as b,l as R,n as w,o as I,p as v,q as k}from"./chunk-K4TJRYGQ.mjs";import{a as f}from"./chunk-6ZOVTYLJ.mjs";import{a as p}from"./chunk-HBIDHQ2M.mjs";import{b as r}from"./chunk-JNO7KPMG.mjs";import{e as u,f as A}from"./chunk-J245N3XF.mjs";import{h as g,i as m}from"./chunk-V4FKFCBL.mjs";var M=class{constructor(e){this.config=e}async getAccountInfo(e){return y({aptosConfig:this.config,...e})}async getAccountModules(e){return l({aptosConfig:this.config,...e})}async getAccountModule(e){return C({aptosConfig:this.config,...e})}async getAccountTransactions(e){return T({aptosConfig:this.config,...e})}async getAccountResources(e){return O({aptosConfig:this.config,...e})}async getAccountResource(e){return h({aptosConfig:this.config,...e})}async lookupOriginalAccountAddress(e){return L({aptosConfig:this.config,...e})}async getAccountTokensCount(e){return await o({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"account_transactions_processor"}),P({aptosConfig:this.config,...e})}async getAccountOwnedTokens(e){return await o({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),S({aptosConfig:this.config,...e})}async getAccountOwnedTokensFromCollectionAddress(e){return await o({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),V({aptosConfig:this.config,...e})}async getAccountCollectionsWithOwnedTokens(e){return await o({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),b({aptosConfig:this.config,...e})}async getAccountTransactionsCount(e){return await o({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"account_transactions_processor"}),R({aptosConfig:this.config,...e})}async getAccountCoinsData(e){return await o({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"fungible_asset_processor"}),w({aptosConfig:this.config,...e})}async getAccountCoinsCount(e){return await o({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"fungible_asset_processor"}),I({aptosConfig:this.config,...e})}async getAccountAPTAmount(e){return this.getAccountCoinAmount({coinType:u,faMetadataAddress:A,...e})}async getAccountCoinAmount(e){let{accountAddress:a,coinType:s,faMetadataAddress:t,minimumLedgerVersion:N}=e;N&&console.warn(`minimumLedgerVersion is not used anymore, here for backward
1
+ import{a as o}from"./chunk-ALOYOMRE.mjs";import{a as d}from"./chunk-2D7OMWVL.mjs";import{a as y,b as l,c as C,d as T,e as O,f as h,g as L,h as P,i as S,j as V,k as b,l as R,n as w,o as I,p as v,q as k}from"./chunk-7ZA434Z3.mjs";import{a as f}from"./chunk-6ZOVTYLJ.mjs";import{b as r}from"./chunk-JNO7KPMG.mjs";import{a as p}from"./chunk-HBIDHQ2M.mjs";import{e as u,f as A}from"./chunk-J7PJSK3J.mjs";import{h as g,i as m}from"./chunk-V4FKFCBL.mjs";var M=class{constructor(e){this.config=e}async getAccountInfo(e){return y({aptosConfig:this.config,...e})}async getAccountModules(e){return l({aptosConfig:this.config,...e})}async getAccountModule(e){return C({aptosConfig:this.config,...e})}async getAccountTransactions(e){return T({aptosConfig:this.config,...e})}async getAccountResources(e){return O({aptosConfig:this.config,...e})}async getAccountResource(e){return h({aptosConfig:this.config,...e})}async lookupOriginalAccountAddress(e){return L({aptosConfig:this.config,...e})}async getAccountTokensCount(e){return await o({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"account_transactions_processor"}),P({aptosConfig:this.config,...e})}async getAccountOwnedTokens(e){return await o({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),S({aptosConfig:this.config,...e})}async getAccountOwnedTokensFromCollectionAddress(e){return await o({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),V({aptosConfig:this.config,...e})}async getAccountCollectionsWithOwnedTokens(e){return await o({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),b({aptosConfig:this.config,...e})}async getAccountTransactionsCount(e){return await o({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"account_transactions_processor"}),R({aptosConfig:this.config,...e})}async getAccountCoinsData(e){return await o({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"fungible_asset_processor"}),w({aptosConfig:this.config,...e})}async getAccountCoinsCount(e){return await o({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"fungible_asset_processor"}),I({aptosConfig:this.config,...e})}async getAccountAPTAmount(e){return this.getAccountCoinAmount({coinType:u,faMetadataAddress:A,...e})}async getAccountCoinAmount(e){let{accountAddress:a,coinType:s,faMetadataAddress:t,minimumLedgerVersion:N}=e;N&&console.warn(`minimumLedgerVersion is not used anymore, here for backward
2
2
  compatibility see https://github.com/aptos-labs/aptos-ts-sdk/pull/519,
3
3
  will be removed in the near future`);let c=s;s===void 0&&t!==void 0&&(c=await p(async()=>{try{let n=(await d({aptosConfig:this.config,payload:{function:"0x1::coin::paired_coin",functionArguments:[t]}})).at(0);if(n.vec.length>0&&m(n.vec[0]))return g(n.vec[0])}catch{}},`coin-mapping-${t.toString()}`,1e3*60*5)());let i;if(s!==void 0&&t!==void 0)i=r.from(t).toStringLong();else if(s!==void 0&&t===void 0)s===u?i=r.A.toStringLong():i=f(r.A,s).toStringLong();else if(s===void 0&&t!==void 0){let n=r.from(t);i=n.toStringLong(),n===r.A&&(c=u)}else throw new Error("Either coinType, faMetadataAddress, or both must be provided");if(c!==void 0){let[n]=await d({aptosConfig:this.config,payload:{function:"0x1::coin::balance",typeArguments:[c],functionArguments:[a]}});return parseInt(n,10)}let[E]=await d({aptosConfig:this.config,payload:{function:"0x1::primary_fungible_store::balance",typeArguments:["0x1::object::ObjectCore"],functionArguments:[a,i]}});return parseInt(E,10)}async getAccountOwnedObjects(e){return await o({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"default_processor"}),v({aptosConfig:this.config,...e})}async deriveAccountFromPrivateKey(e){return k({aptosConfig:this.config,...e})}};export{M as a};
4
- //# sourceMappingURL=chunk-4YEOOZ2N.mjs.map
4
+ //# sourceMappingURL=chunk-MWNYODWU.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as n}from"./chunk-X3JPX7T6.mjs";import{b as a}from"./chunk-JNO7KPMG.mjs";import{a as i}from"./chunk-AJ5JHBAE.mjs";var o=class t extends i{constructor(e,r){super(),this.rawTransaction=e,this.feePayerAddress=r}serialize(e){this.rawTransaction.serialize(e),this.feePayerAddress===void 0?e.serializeBool(!1):(e.serializeBool(!0),this.feePayerAddress.serialize(e))}static deserialize(e){let r=n.deserialize(e),d=e.deserializeBool(),s;return d&&(s=a.deserialize(e)),new t(r,s)}};export{o as a};
2
- //# sourceMappingURL=chunk-YNT7JHMS.mjs.map
1
+ import{a as n}from"./chunk-D54FD6XE.mjs";import{b as a}from"./chunk-JNO7KPMG.mjs";import{a as i}from"./chunk-AJ5JHBAE.mjs";var o=class t extends i{constructor(e,r){super(),this.rawTransaction=e,this.feePayerAddress=r}serialize(e){this.rawTransaction.serialize(e),this.feePayerAddress===void 0?e.serializeBool(!1):(e.serializeBool(!0),this.feePayerAddress.serialize(e))}static deserialize(e){let r=n.deserialize(e),d=e.deserializeBool(),s;return d&&(s=a.deserialize(e)),new t(r,s)}};export{o as a};
2
+ //# sourceMappingURL=chunk-O4MRRWRI.mjs.map
@@ -0,0 +1,2 @@
1
+ import{a as b,b as p}from"./chunk-I3452DF5.mjs";import{a as z,b as A}from"./chunk-LWXBEIFO.mjs";import{a as h,b as g}from"./chunk-KKLF7DQV.mjs";import{b as d,d as y}from"./chunk-TTERI67T.mjs";import{a as o}from"./chunk-AJ5JHBAE.mjs";var s=class extends o{static deserialize(e){let i=e.deserializeUleb128AsU32();switch(i){case 0:return u.load(e);case 1:return l.load(e);case 2:return n.load(e);case 3:return a.load(e);case 4:return c.load(e);default:throw new Error(`Unknown variant index for AccountAuthenticator: ${i}`)}}isEd25519(){return this instanceof u}isMultiEd25519(){return this instanceof l}isSingleKey(){return this instanceof n}isMultiKey(){return this instanceof a}},u=class t extends s{constructor(e,i){super(),this.public_key=e,this.signature=i}serialize(e){e.serializeU32AsUleb128(0),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let i=d.deserialize(e),r=y.deserialize(e);return new t(i,r)}},l=class t extends s{constructor(e,i){super(),this.public_key=e,this.signature=i}serialize(e){e.serializeU32AsUleb128(1),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let i=b.deserialize(e),r=p.deserialize(e);return new t(i,r)}},n=class t extends s{constructor(e,i){super(),this.public_key=e,this.signature=i}serialize(e){e.serializeU32AsUleb128(2),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let i=h.deserialize(e),r=g.deserialize(e);return new t(i,r)}},a=class t extends s{constructor(e,i){super(),this.public_keys=e,this.signatures=i}serialize(e){e.serializeU32AsUleb128(3),this.public_keys.serialize(e),this.signatures.serialize(e)}static load(e){let i=z.deserialize(e),r=A.deserialize(e);return new t(i,r)}},c=class t extends s{serialize(e){e.serializeU32AsUleb128(4)}static load(e){return new t}};export{s as a,u as b,l as c,n as d,a as e,c as f};
2
+ //# sourceMappingURL=chunk-OEM75TVE.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/transactions/authenticator/account.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/* eslint-disable @typescript-eslint/naming-convention */\n\nimport { Serializer, Deserializer, Serializable } from \"../../bcs\";\nimport { AnyPublicKey, AnySignature } from \"../../core/crypto\";\nimport { Ed25519PublicKey, Ed25519Signature } from \"../../core/crypto/ed25519\";\nimport { MultiEd25519PublicKey, MultiEd25519Signature } from \"../../core/crypto/multiEd25519\";\nimport { MultiKey, MultiKeySignature } from \"../../core/crypto/multiKey\";\nimport { AccountAuthenticatorVariant } from \"../../types\";\n\n/**\n * Represents an account authenticator that can handle multiple authentication variants.\n * This class serves as a base for different types of account authenticators, allowing for serialization\n * and deserialization of various authenticator types.\n *\n * @extends Serializable\n */\nexport abstract class AccountAuthenticator extends Serializable {\n abstract serialize(serializer: Serializer): void;\n\n /**\n * Deserializes an AccountAuthenticator from the provided deserializer.\n * This function helps in reconstructing the AccountAuthenticator object based on the variant index.\n *\n * @param deserializer - The deserializer instance used to read the serialized data.\n */\n static deserialize(deserializer: Deserializer): AccountAuthenticator {\n const index = deserializer.deserializeUleb128AsU32();\n switch (index) {\n case AccountAuthenticatorVariant.Ed25519:\n return AccountAuthenticatorEd25519.load(deserializer);\n case AccountAuthenticatorVariant.MultiEd25519:\n return AccountAuthenticatorMultiEd25519.load(deserializer);\n case AccountAuthenticatorVariant.SingleKey:\n return AccountAuthenticatorSingleKey.load(deserializer);\n case AccountAuthenticatorVariant.MultiKey:\n return AccountAuthenticatorMultiKey.load(deserializer);\n case AccountAuthenticatorVariant.NoAccountAuthenticator:\n return AccountAuthenticatorNoAccountAuthenticator.load(deserializer);\n default:\n throw new Error(`Unknown variant index for AccountAuthenticator: ${index}`);\n }\n }\n\n /**\n * Determines if the current instance is an Ed25519 account authenticator.\n *\n * @returns {boolean} True if the instance is of type AccountAuthenticatorEd25519, otherwise false.\n */\n isEd25519(): this is AccountAuthenticatorEd25519 {\n return this instanceof AccountAuthenticatorEd25519;\n }\n\n /**\n * Determines if the current instance is of type AccountAuthenticatorMultiEd25519.\n *\n * @returns {boolean} True if the instance is a multi-signature Ed25519 account authenticator, otherwise false.\n */\n isMultiEd25519(): this is AccountAuthenticatorMultiEd25519 {\n return this instanceof AccountAuthenticatorMultiEd25519;\n }\n\n /**\n * Determines if the current instance is of the type AccountAuthenticatorSingleKey.\n *\n * @returns {boolean} True if the instance is an AccountAuthenticatorSingleKey, otherwise false.\n */\n isSingleKey(): this is AccountAuthenticatorSingleKey {\n return this instanceof AccountAuthenticatorSingleKey;\n }\n\n /**\n * Determine if the current instance is of type AccountAuthenticatorMultiKey.\n *\n * @returns {boolean} Returns true if the instance is an AccountAuthenticatorMultiKey, otherwise false.\n */\n isMultiKey(): this is AccountAuthenticatorMultiKey {\n return this instanceof AccountAuthenticatorMultiKey;\n }\n}\n\n/**\n * Represents an Ed25519 transaction authenticator for multi-signer transactions.\n * This class encapsulates the account's Ed25519 public key and signature.\n *\n * @param public_key - The Ed25519 public key associated with the account.\n * @param signature - The Ed25519 signature for the account.\n */\nexport class AccountAuthenticatorEd25519 extends AccountAuthenticator {\n public readonly public_key: Ed25519PublicKey;\n\n public readonly signature: Ed25519Signature;\n\n /**\n * Creates an instance of the class with the specified public keys and signatures.\n *\n * @param public_key The public key used for verification.\n * @param signature The signatures corresponding to the public keys.\n */\n constructor(public_key: Ed25519PublicKey, signature: Ed25519Signature) {\n super();\n this.public_key = public_key;\n this.signature = signature;\n }\n\n /**\n * Serializes the account authenticator data into the provided serializer.\n * This function captures the multi-key variant, public keys, and signatures for serialization.\n *\n * @param serializer - The serializer instance used to perform the serialization.\n */\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(AccountAuthenticatorVariant.Ed25519);\n this.public_key.serialize(serializer);\n this.signature.serialize(serializer);\n }\n\n /**\n * Loads an instance of AccountAuthenticatorMultiKey from the provided deserializer.\n * This function helps in reconstructing the authenticator object using the deserialized public keys and signatures.\n *\n * @param deserializer - The deserializer used to extract the necessary data for loading the authenticator.\n */\n static load(deserializer: Deserializer): AccountAuthenticatorEd25519 {\n const public_key = Ed25519PublicKey.deserialize(deserializer);\n const signature = Ed25519Signature.deserialize(deserializer);\n return new AccountAuthenticatorEd25519(public_key, signature);\n }\n}\n\n/**\n * Represents a transaction authenticator for Multi Ed25519, designed for multi-signer transactions.\n *\n * @param public_key - The MultiEd25519 public key of the account.\n * @param signature - The MultiEd25519 signature of the account.\n */\nexport class AccountAuthenticatorMultiEd25519 extends AccountAuthenticator {\n public readonly public_key: MultiEd25519PublicKey;\n\n public readonly signature: MultiEd25519Signature;\n\n constructor(public_key: MultiEd25519PublicKey, signature: MultiEd25519Signature) {\n super();\n this.public_key = public_key;\n this.signature = signature;\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(AccountAuthenticatorVariant.MultiEd25519);\n this.public_key.serialize(serializer);\n this.signature.serialize(serializer);\n }\n\n static load(deserializer: Deserializer): AccountAuthenticatorMultiEd25519 {\n const public_key = MultiEd25519PublicKey.deserialize(deserializer);\n const signature = MultiEd25519Signature.deserialize(deserializer);\n return new AccountAuthenticatorMultiEd25519(public_key, signature);\n }\n}\n\n/**\n * Represents an account authenticator that utilizes a single key for signing.\n * This class is designed to handle authentication using a public key and its corresponding signature.\n *\n * @param public_key - The public key used for authentication.\n * @param signature - The signature associated with the public key.\n */\nexport class AccountAuthenticatorSingleKey extends AccountAuthenticator {\n public readonly public_key: AnyPublicKey;\n\n public readonly signature: AnySignature;\n\n constructor(public_key: AnyPublicKey, signature: AnySignature) {\n super();\n this.public_key = public_key;\n this.signature = signature;\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(AccountAuthenticatorVariant.SingleKey);\n this.public_key.serialize(serializer);\n this.signature.serialize(serializer);\n }\n\n static load(deserializer: Deserializer): AccountAuthenticatorSingleKey {\n const public_key = AnyPublicKey.deserialize(deserializer);\n const signature = AnySignature.deserialize(deserializer);\n return new AccountAuthenticatorSingleKey(public_key, signature);\n }\n}\n\n/**\n * Represents an account authenticator that supports multiple keys and signatures for multi-signature scenarios.\n *\n * @param public_keys - The public keys used for authentication.\n * @param signatures - The signatures corresponding to the public keys.\n */\nexport class AccountAuthenticatorMultiKey extends AccountAuthenticator {\n public readonly public_keys: MultiKey;\n\n public readonly signatures: MultiKeySignature;\n\n constructor(public_keys: MultiKey, signatures: MultiKeySignature) {\n super();\n this.public_keys = public_keys;\n this.signatures = signatures;\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(AccountAuthenticatorVariant.MultiKey);\n this.public_keys.serialize(serializer);\n this.signatures.serialize(serializer);\n }\n\n static load(deserializer: Deserializer): AccountAuthenticatorMultiKey {\n const public_keys = MultiKey.deserialize(deserializer);\n const signatures = MultiKeySignature.deserialize(deserializer);\n return new AccountAuthenticatorMultiKey(public_keys, signatures);\n }\n}\n\n/**\n * AccountAuthenticatorNoAccountAuthenticator for no account authenticator\n * It represents the absence of a public key for transaction simulation.\n * It allows skipping the public/auth key check during the simulation.\n */\nexport class AccountAuthenticatorNoAccountAuthenticator extends AccountAuthenticator {\n // eslint-disable-next-line class-methods-use-this\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(AccountAuthenticatorVariant.NoAccountAuthenticator);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static load(deserializer: Deserializer): AccountAuthenticatorNoAccountAuthenticator {\n return new AccountAuthenticatorNoAccountAuthenticator();\n }\n}\n"],"mappings":"yOAmBO,IAAeA,EAAf,cAA4CC,CAAa,CAS9D,OAAO,YAAYC,EAAkD,CACnE,IAAMC,EAAQD,EAAa,wBAAwB,EACnD,OAAQC,EAAO,CACb,OACE,OAAOC,EAA4B,KAAKF,CAAY,EACtD,OACE,OAAOG,EAAiC,KAAKH,CAAY,EAC3D,OACE,OAAOI,EAA8B,KAAKJ,CAAY,EACxD,OACE,OAAOK,EAA6B,KAAKL,CAAY,EACvD,OACE,OAAOM,EAA2C,KAAKN,CAAY,EACrE,QACE,MAAM,IAAI,MAAM,mDAAmDC,CAAK,EAAE,CAC9E,CACF,CAOA,WAAiD,CAC/C,OAAO,gBAAgBC,CACzB,CAOA,gBAA2D,CACzD,OAAO,gBAAgBC,CACzB,CAOA,aAAqD,CACnD,OAAO,gBAAgBC,CACzB,CAOA,YAAmD,CACjD,OAAO,gBAAgBC,CACzB,CACF,EASaH,EAAN,MAAMK,UAAoCT,CAAqB,CAWpE,YAAYU,EAA8BC,EAA6B,CACrE,MAAM,EACN,KAAK,WAAaD,EAClB,KAAK,UAAYC,CACnB,CAQA,UAAUC,EAA8B,CACtCA,EAAW,uBAAyD,EACpE,KAAK,WAAW,UAAUA,CAAU,EACpC,KAAK,UAAU,UAAUA,CAAU,CACrC,CAQA,OAAO,KAAKV,EAAyD,CACnE,IAAMQ,EAAaG,EAAiB,YAAYX,CAAY,EACtDS,EAAYG,EAAiB,YAAYZ,CAAY,EAC3D,OAAO,IAAIO,EAA4BC,EAAYC,CAAS,CAC9D,CACF,EAQaN,EAAN,MAAMU,UAAyCf,CAAqB,CAKzE,YAAYU,EAAmCC,EAAkC,CAC/E,MAAM,EACN,KAAK,WAAaD,EAClB,KAAK,UAAYC,CACnB,CAEA,UAAUC,EAA8B,CACtCA,EAAW,uBAA8D,EACzE,KAAK,WAAW,UAAUA,CAAU,EACpC,KAAK,UAAU,UAAUA,CAAU,CACrC,CAEA,OAAO,KAAKV,EAA8D,CACxE,IAAMQ,EAAaM,EAAsB,YAAYd,CAAY,EAC3DS,EAAYM,EAAsB,YAAYf,CAAY,EAChE,OAAO,IAAIa,EAAiCL,EAAYC,CAAS,CACnE,CACF,EASaL,EAAN,MAAMY,UAAsClB,CAAqB,CAKtE,YAAYU,EAA0BC,EAAyB,CAC7D,MAAM,EACN,KAAK,WAAaD,EAClB,KAAK,UAAYC,CACnB,CAEA,UAAUC,EAA8B,CACtCA,EAAW,uBAA2D,EACtE,KAAK,WAAW,UAAUA,CAAU,EACpC,KAAK,UAAU,UAAUA,CAAU,CACrC,CAEA,OAAO,KAAKV,EAA2D,CACrE,IAAMQ,EAAaS,EAAa,YAAYjB,CAAY,EAClDS,EAAYS,EAAa,YAAYlB,CAAY,EACvD,OAAO,IAAIgB,EAA8BR,EAAYC,CAAS,CAChE,CACF,EAQaJ,EAAN,MAAMc,UAAqCrB,CAAqB,CAKrE,YAAYsB,EAAuBC,EAA+B,CAChE,MAAM,EACN,KAAK,YAAcD,EACnB,KAAK,WAAaC,CACpB,CAEA,UAAUX,EAA8B,CACtCA,EAAW,uBAA0D,EACrE,KAAK,YAAY,UAAUA,CAAU,EACrC,KAAK,WAAW,UAAUA,CAAU,CACtC,CAEA,OAAO,KAAKV,EAA0D,CACpE,IAAMoB,EAAcE,EAAS,YAAYtB,CAAY,EAC/CqB,EAAaE,EAAkB,YAAYvB,CAAY,EAC7D,OAAO,IAAImB,EAA6BC,EAAaC,CAAU,CACjE,CACF,EAOaf,EAAN,MAAMkB,UAAmD1B,CAAqB,CAEnF,UAAUY,EAA8B,CACtCA,EAAW,uBAAwE,CACrF,CAGA,OAAO,KAAKV,EAAwE,CAClF,OAAO,IAAIwB,CACb,CACF","names":["AccountAuthenticator","Serializable","deserializer","index","AccountAuthenticatorEd25519","AccountAuthenticatorMultiEd25519","AccountAuthenticatorSingleKey","AccountAuthenticatorMultiKey","AccountAuthenticatorNoAccountAuthenticator","_AccountAuthenticatorEd25519","public_key","signature","serializer","Ed25519PublicKey","Ed25519Signature","_AccountAuthenticatorMultiEd25519","MultiEd25519PublicKey","MultiEd25519Signature","_AccountAuthenticatorSingleKey","AnyPublicKey","AnySignature","_AccountAuthenticatorMultiKey","public_keys","signatures","MultiKey","MultiKeySignature","_AccountAuthenticatorNoAccountAuthenticator"]}
@@ -1,2 +1,2 @@
1
- import{a as l}from"./chunk-VCY3JGZM.mjs";import{a as o,b as c}from"./chunk-2CJC43CV.mjs";import{a as h,i as d}from"./chunk-AHWZA3GD.mjs";import{g as u}from"./chunk-OJBMR5CT.mjs";import g from"eventemitter3";var m="fulfilled",f=(n=>(n.TransactionSent="transactionSent",n.TransactionSendFailed="transactionSendFailed",n.TransactionExecuted="transactionExecuted",n.TransactionExecutionFailed="transactionExecutionFailed",n.ExecutionFinish="executionFinish",n))(f||{}),p=class extends g{constructor(t,e,a=30,n=100,i=10){super();this.taskQueue=new o;this.transactionsQueue=new o;this.outstandingTransactions=new o;this.sentTransactions=[];this.executedTransactions=[];this.aptosConfig=t,this.account=e,this.started=!1,this.accountSequnceNumber=new l(t,e,a,n,i)}async submitNextTransaction(){try{for(;;){let t=await this.accountSequnceNumber.nextSequenceNumber();if(t===null)return;let e=await this.generateNextTransaction(this.account,t);if(!e)return;let a=d({aptosConfig:this.aptosConfig,transaction:e,signer:this.account});await this.outstandingTransactions.enqueue([a,t])}}catch(t){if(t instanceof c)return;throw new Error(`Submit transaction failed for ${this.account.accountAddress.toString()} with error ${t}`)}}async processTransactions(){try{for(;;){let t=[],e=[],[a,n]=await this.outstandingTransactions.dequeue();for(t.push(a),e.push(n);!this.outstandingTransactions.isEmpty();)[a,n]=await this.outstandingTransactions.dequeue(),t.push(a),e.push(n);let i=await Promise.allSettled(t);for(let s=0;s<i.length&&s<e.length;s+=1){let r=i[s];n=e[s],r.status===m?(this.sentTransactions.push([r.value.hash,n,null]),this.emit("transactionSent",{message:`transaction hash ${r.value.hash} has been committed to chain`,transactionHash:r.value.hash}),await this.checkTransaction(r,n)):(this.sentTransactions.push([r.status,n,r.reason]),this.emit("transactionSendFailed",{message:`failed to commit transaction ${this.sentTransactions.length} with error ${r.reason}`,error:r.reason}))}this.emit("executionFinish",{message:`execute ${i.length} transactions finished`})}}catch(t){if(t instanceof c)return;throw new Error(`Process execution failed for ${this.account.accountAddress.toString()} with error ${t}`)}}async checkTransaction(t,e){try{let a=[];a.push(u({aptosConfig:this.aptosConfig,transactionHash:t.value.hash}));let n=await Promise.allSettled(a);for(let i=0;i<n.length;i+=1){let s=n[i];s.status===m?(this.executedTransactions.push([s.value.hash,e,null]),this.emit("transactionExecuted",{message:`transaction hash ${s.value.hash} has been executed on chain`,transactionHash:t.value.hash})):(this.executedTransactions.push([s.status,e,s.reason]),this.emit("transactionExecutionFailed",{message:`failed to execute transaction ${this.executedTransactions.length} with error ${s.reason}`,error:s.reason}))}}catch(a){throw new Error(`Check transaction failed for ${this.account.accountAddress.toString()} with error ${a}`)}}async push(t,e){this.transactionsQueue.enqueue([t,e])}async generateNextTransaction(t,e){if(this.transactionsQueue.isEmpty())return;let[a,n]=await this.transactionsQueue.dequeue();return h({aptosConfig:this.aptosConfig,sender:t.accountAddress,data:a,options:{...n,accountSequenceNumber:e}})}async run(){try{for(;!this.taskQueue.isCancelled();)await(await this.taskQueue.dequeue())()}catch(t){throw new Error(`Unable to start transaction batching: ${t}`)}}start(){if(this.started)throw new Error("worker has already started");this.started=!0,this.taskQueue.enqueue(()=>this.submitNextTransaction()),this.taskQueue.enqueue(()=>this.processTransactions()),this.run()}stop(){if(this.taskQueue.isCancelled())throw new Error("worker has already stopped");this.started=!1,this.taskQueue.cancel()}};export{m as a,f as b,p as c};
2
- //# sourceMappingURL=chunk-F2AIWA7L.mjs.map
1
+ import{a as l}from"./chunk-JKA22FG5.mjs";import{a as o,b as c}from"./chunk-2CJC43CV.mjs";import{a as h,i as d}from"./chunk-476F5NJ6.mjs";import{g as u}from"./chunk-QK32EQSF.mjs";import g from"eventemitter3";var m="fulfilled",f=(n=>(n.TransactionSent="transactionSent",n.TransactionSendFailed="transactionSendFailed",n.TransactionExecuted="transactionExecuted",n.TransactionExecutionFailed="transactionExecutionFailed",n.ExecutionFinish="executionFinish",n))(f||{}),p=class extends g{constructor(t,e,a=30,n=100,i=10){super();this.taskQueue=new o;this.transactionsQueue=new o;this.outstandingTransactions=new o;this.sentTransactions=[];this.executedTransactions=[];this.aptosConfig=t,this.account=e,this.started=!1,this.accountSequnceNumber=new l(t,e,a,n,i)}async submitNextTransaction(){try{for(;;){let t=await this.accountSequnceNumber.nextSequenceNumber();if(t===null)return;let e=await this.generateNextTransaction(this.account,t);if(!e)return;let a=d({aptosConfig:this.aptosConfig,transaction:e,signer:this.account});await this.outstandingTransactions.enqueue([a,t])}}catch(t){if(t instanceof c)return;throw new Error(`Submit transaction failed for ${this.account.accountAddress.toString()} with error ${t}`)}}async processTransactions(){try{for(;;){let t=[],e=[],[a,n]=await this.outstandingTransactions.dequeue();for(t.push(a),e.push(n);!this.outstandingTransactions.isEmpty();)[a,n]=await this.outstandingTransactions.dequeue(),t.push(a),e.push(n);let i=await Promise.allSettled(t);for(let s=0;s<i.length&&s<e.length;s+=1){let r=i[s];n=e[s],r.status===m?(this.sentTransactions.push([r.value.hash,n,null]),this.emit("transactionSent",{message:`transaction hash ${r.value.hash} has been committed to chain`,transactionHash:r.value.hash}),await this.checkTransaction(r,n)):(this.sentTransactions.push([r.status,n,r.reason]),this.emit("transactionSendFailed",{message:`failed to commit transaction ${this.sentTransactions.length} with error ${r.reason}`,error:r.reason}))}this.emit("executionFinish",{message:`execute ${i.length} transactions finished`})}}catch(t){if(t instanceof c)return;throw new Error(`Process execution failed for ${this.account.accountAddress.toString()} with error ${t}`)}}async checkTransaction(t,e){try{let a=[];a.push(u({aptosConfig:this.aptosConfig,transactionHash:t.value.hash}));let n=await Promise.allSettled(a);for(let i=0;i<n.length;i+=1){let s=n[i];s.status===m?(this.executedTransactions.push([s.value.hash,e,null]),this.emit("transactionExecuted",{message:`transaction hash ${s.value.hash} has been executed on chain`,transactionHash:t.value.hash})):(this.executedTransactions.push([s.status,e,s.reason]),this.emit("transactionExecutionFailed",{message:`failed to execute transaction ${this.executedTransactions.length} with error ${s.reason}`,error:s.reason}))}}catch(a){throw new Error(`Check transaction failed for ${this.account.accountAddress.toString()} with error ${a}`)}}async push(t,e){this.transactionsQueue.enqueue([t,e])}async generateNextTransaction(t,e){if(this.transactionsQueue.isEmpty())return;let[a,n]=await this.transactionsQueue.dequeue();return h({aptosConfig:this.aptosConfig,sender:t.accountAddress,data:a,options:{...n,accountSequenceNumber:e}})}async run(){try{for(;!this.taskQueue.isCancelled();)await(await this.taskQueue.dequeue())()}catch(t){throw new Error(`Unable to start transaction batching: ${t}`)}}start(){if(this.started)throw new Error("worker has already started");this.started=!0,this.taskQueue.enqueue(()=>this.submitNextTransaction()),this.taskQueue.enqueue(()=>this.processTransactions()),this.run()}stop(){if(this.taskQueue.isCancelled())throw new Error("worker has already stopped");this.started=!1,this.taskQueue.cancel()}};export{m as a,f as b,p as c};
2
+ //# sourceMappingURL=chunk-OGBU52BQ.mjs.map
@@ -1,2 +1,2 @@
1
- import{e as r}from"./chunk-F45G3GP3.mjs";import{a as d}from"./chunk-AMCJQIOT.mjs";async function A(s,u){let{url:t,method:n,body:i,contentType:a,params:o,overrides:e,originMethod:R}=s,p={...e?.HEADERS,"x-aptos-client":`aptos-typescript-sdk/${d}`,"content-type":a??"application/json","x-aptos-typescript-sdk-origin-method":R};return e?.AUTH_TOKEN&&(p.Authorization=`Bearer ${e?.AUTH_TOKEN}`),e?.API_KEY&&(p.Authorization=`Bearer ${e?.API_KEY}`),u.provider({url:t,method:n,body:i,params:o,headers:p,overrides:e})}async function P(s,u,t){let{url:n,path:i}=s,a=i?`${n}/${i}`:n,o=await A({...s,url:a},u.client),e={status:o.status,statusText:o.statusText??"No status text provided",data:o.data,headers:o.headers,config:o.config,request:o.request,url:a};if(e.status===401)throw new r({apiType:t,aptosRequest:s,aptosResponse:e});if(t==="Indexer"){let R=e.data;if(R.errors)throw new r({apiType:t,aptosRequest:s,aptosResponse:e});e.data=R.data}else if((t==="Pepper"||t==="Prover")&&e.status>=400)throw new r({apiType:t,aptosRequest:s,aptosResponse:e});if(e.status>=200&&e.status<300)return e;throw new r({apiType:t,aptosRequest:s,aptosResponse:e})}export{A as a,P as b};
2
- //# sourceMappingURL=chunk-KT3DT5GV.mjs.map
1
+ import{e as r}from"./chunk-F45G3GP3.mjs";import{a as d}from"./chunk-YQHOQJRQ.mjs";async function A(s,u){let{url:t,method:n,body:i,contentType:a,params:o,overrides:e,originMethod:R}=s,p={...e?.HEADERS,"x-aptos-client":`aptos-typescript-sdk/${d}`,"content-type":a??"application/json","x-aptos-typescript-sdk-origin-method":R};return e?.AUTH_TOKEN&&(p.Authorization=`Bearer ${e?.AUTH_TOKEN}`),e?.API_KEY&&(p.Authorization=`Bearer ${e?.API_KEY}`),u.provider({url:t,method:n,body:i,params:o,headers:p,overrides:e})}async function P(s,u,t){let{url:n,path:i}=s,a=i?`${n}/${i}`:n,o=await A({...s,url:a},u.client),e={status:o.status,statusText:o.statusText??"No status text provided",data:o.data,headers:o.headers,config:o.config,request:o.request,url:a};if(e.status===401)throw new r({apiType:t,aptosRequest:s,aptosResponse:e});if(t==="Indexer"){let R=e.data;if(R.errors)throw new r({apiType:t,aptosRequest:s,aptosResponse:e});e.data=R.data}else if((t==="Pepper"||t==="Prover")&&e.status>=400)throw new r({apiType:t,aptosRequest:s,aptosResponse:e});if(e.status>=200&&e.status<300)return e;throw new r({apiType:t,aptosRequest:s,aptosResponse:e})}export{A as a,P as b};
2
+ //# sourceMappingURL=chunk-P6RNNESB.mjs.map
@@ -1,2 +1,2 @@
1
- import{b as K}from"./chunk-H457BI3I.mjs";import{i as m,r as u}from"./chunk-XUP6VABV.mjs";import{b as f}from"./chunk-SPRNSFUV.mjs";import{a as y}from"./chunk-D52UKPQF.mjs";var h=class c extends K{constructor(e){let r=m.create(e);super({publicKey:r,...e}),this.publicKey=r}serialize(e){super.serialize(e)}static deserialize(e){let{address:r,proof:l,ephemeralKeyPair:i,jwt:o,uidKey:t,pepper:s,verificationKeyHash:n}=K.partialDeserialize(e),{iss:a,aud:p,uidVal:d}=u({jwt:o,uidKey:t});return new c({address:r,proof:l,ephemeralKeyPair:i,iss:a,uidKey:t,uidVal:d,aud:p,pepper:s,jwt:o,verificationKeyHash:n})}static fromBytes(e){return c.deserialize(new y(f.hexInputToUint8Array(e)))}static create(e){let{address:r,proof:l,jwt:i,ephemeralKeyPair:o,pepper:t,uidKey:s="sub",proofFetchCallback:n,verificationKey:a}=e,{iss:p,aud:d,uidVal:g}=u({jwt:i,uidKey:s});return new c({address:r,proof:l,ephemeralKeyPair:o,iss:p,uidKey:s,uidVal:g,aud:d,pepper:t,jwt:i,proofFetchCallback:n,verificationKeyHash:a?a.hash():void 0})}};export{h as a};
2
- //# sourceMappingURL=chunk-WGIYSLH6.mjs.map
1
+ import{b as K}from"./chunk-H7PDLUNP.mjs";import{i as m,r as u}from"./chunk-B5BXB2BB.mjs";import{a as y}from"./chunk-D52UKPQF.mjs";import{b as f}from"./chunk-SPRNSFUV.mjs";var h=class c extends K{constructor(e){let r=m.create(e);super({publicKey:r,...e}),this.publicKey=r}serialize(e){super.serialize(e)}static deserialize(e){let{address:r,proof:l,ephemeralKeyPair:i,jwt:o,uidKey:t,pepper:s,verificationKeyHash:n}=K.partialDeserialize(e),{iss:a,aud:p,uidVal:d}=u({jwt:o,uidKey:t});return new c({address:r,proof:l,ephemeralKeyPair:i,iss:a,uidKey:t,uidVal:d,aud:p,pepper:s,jwt:o,verificationKeyHash:n})}static fromBytes(e){return c.deserialize(new y(f.hexInputToUint8Array(e)))}static create(e){let{address:r,proof:l,jwt:i,ephemeralKeyPair:o,pepper:t,uidKey:s="sub",proofFetchCallback:n,verificationKey:a}=e,{iss:p,aud:d,uidVal:g}=u({jwt:i,uidKey:s});return new c({address:r,proof:l,ephemeralKeyPair:o,iss:p,uidKey:s,uidVal:g,aud:d,pepper:t,jwt:i,proofFetchCallback:n,verificationKeyHash:a?a.hash():void 0})}};export{h as a};
2
+ //# sourceMappingURL=chunk-P74XXLE4.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as c,b as o,c as d,d as z,e as m,f as U,g as y}from"./chunk-42H7WETG.mjs";import{a as s}from"./chunk-AJ5JHBAE.mjs";import{b as u}from"./chunk-SPRNSFUV.mjs";import{a as b}from"./chunk-D52UKPQF.mjs";var t=class i extends s{constructor(e){super(),this.values=e}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){if(this.values[0]!==void 0&&!(this.values[0]instanceof o)){new p(this.bcsToBytes()).serializeForScriptFunction(e);return}e.serializeU32AsUleb128(4),e.serialize(this)}static U8(e){let r;if(Array.isArray(e)&&e.length===0)r=[];else if(Array.isArray(e)&&typeof e[0]=="number")r=e;else if(typeof e=="string"){let n=u.fromHexInput(e);r=Array.from(n.toUint8Array())}else if(e instanceof Uint8Array)r=Array.from(e);else throw new Error("Invalid input type, must be an number[], Uint8Array, or hex string");return new i(r.map(n=>new o(n)))}static U16(e){return new i(e.map(r=>new d(r)))}static U32(e){return new i(e.map(r=>new z(r)))}static U64(e){return new i(e.map(r=>new m(r)))}static U128(e){return new i(e.map(r=>new U(r)))}static U256(e){return new i(e.map(r=>new y(r)))}static Bool(e){return new i(e.map(r=>new c(r)))}static MoveString(e){return new i(e.map(r=>new a(r)))}serialize(e){e.serializeVector(this.values)}static deserialize(e,r){let n=e.deserializeUleb128AsU32(),l=new Array;for(let w=0;w<n;w+=1)l.push(r.deserialize(e));return new i(l)}},p=class i extends s{constructor(e){super(),this.value=u.fromHexInput(e).toUint8Array()}serialize(e){e.serializeBytes(this.value)}serializeForEntryFunction(e){this.serialize(e)}serializeForScriptFunction(e){e.serializeU32AsUleb128(9),this.serialize(e)}static deserialize(e){return new i(e.deserializeBytes())}toMoveVector(e){let r=new b(this.bcsToBytes());r.deserializeUleb128AsU32();let n=r.deserializeVector(e);return new t(n)}},a=class i extends s{constructor(e){super(),this.value=e}serialize(e){e.serializeStr(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){let n=new TextEncoder().encode(this.value);t.U8(n).serializeForScriptFunction(e)}static deserialize(e){return new i(e.deserializeStr())}},A=class i extends s{constructor(e){super(),typeof e<"u"&&e!==null?this.vec=new t([e]):this.vec=new t([]),[this.value]=this.vec.values}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}unwrap(){if(this.isSome())return this.vec.values[0];throw new Error("Called unwrap on a MoveOption with no value")}isSome(){return this.vec.values.length===1}serialize(e){this.vec.serialize(e)}static U8(e){return new i(e!=null?new o(e):void 0)}static U16(e){return new i(e!=null?new d(e):void 0)}static U32(e){return new i(e!=null?new z(e):void 0)}static U64(e){return new i(e!=null?new m(e):void 0)}static U128(e){return new i(e!=null?new U(e):void 0)}static U256(e){return new i(e!=null?new y(e):void 0)}static Bool(e){return new i(e!=null?new c(e):void 0)}static MoveString(e){return new i(e!=null?new a(e):void 0)}static deserialize(e,r){let n=t.deserialize(e,r);return new i(n.values[0])}};export{t as a,p as b,a as c,A as d};
2
- //# sourceMappingURL=chunk-TM7OZT3W.mjs.map
1
+ import{a as c,b as o,c as d,d as z,e as m,f as U,g as y}from"./chunk-42H7WETG.mjs";import{a as b}from"./chunk-D52UKPQF.mjs";import{a as s}from"./chunk-AJ5JHBAE.mjs";import{b as u}from"./chunk-SPRNSFUV.mjs";var t=class i extends s{constructor(e){super(),this.values=e}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){if(this.values[0]!==void 0&&!(this.values[0]instanceof o)){new p(this.bcsToBytes()).serializeForScriptFunction(e);return}e.serializeU32AsUleb128(4),e.serialize(this)}static U8(e){let r;if(Array.isArray(e)&&e.length===0)r=[];else if(Array.isArray(e)&&typeof e[0]=="number")r=e;else if(typeof e=="string"){let n=u.fromHexInput(e);r=Array.from(n.toUint8Array())}else if(e instanceof Uint8Array)r=Array.from(e);else throw new Error("Invalid input type, must be an number[], Uint8Array, or hex string");return new i(r.map(n=>new o(n)))}static U16(e){return new i(e.map(r=>new d(r)))}static U32(e){return new i(e.map(r=>new z(r)))}static U64(e){return new i(e.map(r=>new m(r)))}static U128(e){return new i(e.map(r=>new U(r)))}static U256(e){return new i(e.map(r=>new y(r)))}static Bool(e){return new i(e.map(r=>new c(r)))}static MoveString(e){return new i(e.map(r=>new a(r)))}serialize(e){e.serializeVector(this.values)}static deserialize(e,r){let n=e.deserializeUleb128AsU32(),l=new Array;for(let w=0;w<n;w+=1)l.push(r.deserialize(e));return new i(l)}},p=class i extends s{constructor(e){super(),this.value=u.fromHexInput(e).toUint8Array()}serialize(e){e.serializeBytes(this.value)}serializeForEntryFunction(e){this.serialize(e)}serializeForScriptFunction(e){e.serializeU32AsUleb128(9),this.serialize(e)}static deserialize(e){return new i(e.deserializeBytes())}toMoveVector(e){let r=new b(this.bcsToBytes());r.deserializeUleb128AsU32();let n=r.deserializeVector(e);return new t(n)}},a=class i extends s{constructor(e){super(),this.value=e}serialize(e){e.serializeStr(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){let n=new TextEncoder().encode(this.value);t.U8(n).serializeForScriptFunction(e)}static deserialize(e){return new i(e.deserializeStr())}},A=class i extends s{constructor(e){super(),typeof e<"u"&&e!==null?this.vec=new t([e]):this.vec=new t([]),[this.value]=this.vec.values}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}unwrap(){if(this.isSome())return this.vec.values[0];throw new Error("Called unwrap on a MoveOption with no value")}isSome(){return this.vec.values.length===1}serialize(e){this.vec.serialize(e)}static U8(e){return new i(e!=null?new o(e):void 0)}static U16(e){return new i(e!=null?new d(e):void 0)}static U32(e){return new i(e!=null?new z(e):void 0)}static U64(e){return new i(e!=null?new m(e):void 0)}static U128(e){return new i(e!=null?new U(e):void 0)}static U256(e){return new i(e!=null?new y(e):void 0)}static Bool(e){return new i(e!=null?new c(e):void 0)}static MoveString(e){return new i(e!=null?new a(e):void 0)}static deserialize(e,r){let n=t.deserialize(e,r);return new i(n.values[0])}};export{t as a,p as b,a as c,A as d};
2
+ //# sourceMappingURL=chunk-Q3CWUEXI.mjs.map
@@ -1,2 +1,2 @@
1
- import{e as x,f as B}from"./chunk-PW3ISXPN.mjs";import{a as k}from"./chunk-HBIDHQ2M.mjs";import{b as f,d as A}from"./chunk-6LLGRGCN.mjs";import{e as b}from"./chunk-F45G3GP3.mjs";import{d as C}from"./chunk-J245N3XF.mjs";import{a as d}from"./chunk-V4FKFCBL.mjs";async function H(o){let{aptosConfig:n,options:t}=o;return A({aptosConfig:n,originMethod:"getTransactions",path:"transactions",params:{start:t?.offset,limit:t?.limit}})}async function W(o){let{aptosConfig:n}=o;return k(async()=>{let{data:t}=await f({aptosConfig:n,originMethod:"getGasPriceEstimation",path:"estimate_gas_price"});return t},`gas-price-${n.network}`,1e3*60*5)()}async function O(o){let{aptosConfig:n,ledgerVersion:t}=o,{data:s}=await f({aptosConfig:n,originMethod:"getTransactionByVersion",path:`transactions/by_version/${t}`});return s}async function y(o){let{aptosConfig:n,transactionHash:t}=o,{data:s}=await f({aptosConfig:n,path:`transactions/by_hash/${t}`,originMethod:"getTransactionByHash"});return s}async function q(o){let{aptosConfig:n,transactionHash:t}=o;try{return(await y({aptosConfig:n,transactionHash:t})).type==="pending_transaction"}catch(s){if(s?.status===404)return!0;throw s}}async function R(o){let{aptosConfig:n,transactionHash:t}=o,{data:s}=await f({aptosConfig:n,path:`transactions/wait_by_hash/${t}`,originMethod:"longWaitForTransaction"});return s}async function z(o){let{aptosConfig:n,transactionHash:t,options:s}=o,r=s?.timeoutSecs??20,u=s?.checkSuccess??!0,e=!0,p=0,i,g,l=200,h=1.5;function c(a){if(!(a instanceof b)||(g=a,a.status!==404&&a.status>=400&&a.status<500))throw a}try{i=await y({aptosConfig:n,transactionHash:t}),e=i.type==="pending_transaction"}catch(a){c(a)}if(e){let a=Date.now();try{i=await R({aptosConfig:n,transactionHash:t}),e=i.type==="pending_transaction"}catch(w){c(w)}p=(Date.now()-a)/1e3}for(;e&&!(p>=r);){try{if(i=await y({aptosConfig:n,transactionHash:t}),e=i.type==="pending_transaction",!e)break}catch(a){c(a)}await d(l),p+=l/1e3,l*=h}if(i===void 0)throw g||new m(`Fetching transaction ${t} failed and timed out after ${r} seconds`,i);if(i.type==="pending_transaction")throw new m(`Transaction ${t} timed out in pending state after ${r} seconds`,i);if(!u)return i;if(!i.success)throw new T(`Transaction ${t} failed with an error: ${i.vm_status}`,i);return i}async function U(o){let{aptosConfig:n,processorType:t}=o,s=BigInt(o.minimumLedgerVersion),r=3e3,u=new Date().getTime(),e=BigInt(-1);for(;e<s;){if(new Date().getTime()-u>r)throw new Error("waitForLastSuccessIndexerVersionSync timeout");if(t===void 0?e=await x({aptosConfig:n}):e=(await B({aptosConfig:n,processorType:t})).last_success_version,e>=s)break;await d(200)}}var m=class extends Error{constructor(n,t){super(n),this.lastSubmittedTransaction=t}},T=class extends Error{constructor(n,t){super(n),this.transaction=t}};async function X(o){let{aptosConfig:n,ledgerVersion:t,options:s}=o,{data:r}=await f({aptosConfig:n,originMethod:"getBlockByVersion",path:`blocks/by_version/${t}`,params:{with_transactions:s?.withTransactions}});return P({block:r,...o})}async function j(o){let{aptosConfig:n,blockHeight:t,options:s}=o,{data:r}=await f({aptosConfig:n,originMethod:"getBlockByHeight",path:`blocks/by_height/${t}`,params:{with_transactions:s?.withTransactions}});return P({block:r,...o})}async function P(o){let{aptosConfig:n,block:t,options:s}=o;if(s?.withTransactions){t.transactions=t.transactions??[];let r=t.transactions[t.transactions.length-1],u=BigInt(t.first_version),e=BigInt(t.last_version),p=r?.version,i;if(p===void 0?i=u-1n:i=BigInt(p),i===e)return t;let g=[],l=100n;for(let c=i+1n;c<e;c+=BigInt(100))g.push(H({aptosConfig:n,options:{offset:c,limit:Math.min(Number(l),Number(e-c+1n))}}));let h=await Promise.all(g);for(let c of h)t.transactions.push(...c)}return t}export{H as a,W as b,O as c,y as d,q as e,R as f,z as g,U as h,m as i,T as j,X as k,j as l};
2
- //# sourceMappingURL=chunk-OJBMR5CT.mjs.map
1
+ import{e as x,f as B}from"./chunk-CK5NDXQT.mjs";import{a as k}from"./chunk-HBIDHQ2M.mjs";import{b as f,d as A}from"./chunk-LRN4ALMT.mjs";import{e as b}from"./chunk-F45G3GP3.mjs";import{d as C}from"./chunk-J7PJSK3J.mjs";import{a as d}from"./chunk-V4FKFCBL.mjs";async function H(o){let{aptosConfig:n,options:t}=o;return A({aptosConfig:n,originMethod:"getTransactions",path:"transactions",params:{start:t?.offset,limit:t?.limit}})}async function W(o){let{aptosConfig:n}=o;return k(async()=>{let{data:t}=await f({aptosConfig:n,originMethod:"getGasPriceEstimation",path:"estimate_gas_price"});return t},`gas-price-${n.network}`,1e3*60*5)()}async function O(o){let{aptosConfig:n,ledgerVersion:t}=o,{data:s}=await f({aptosConfig:n,originMethod:"getTransactionByVersion",path:`transactions/by_version/${t}`});return s}async function y(o){let{aptosConfig:n,transactionHash:t}=o,{data:s}=await f({aptosConfig:n,path:`transactions/by_hash/${t}`,originMethod:"getTransactionByHash"});return s}async function q(o){let{aptosConfig:n,transactionHash:t}=o;try{return(await y({aptosConfig:n,transactionHash:t})).type==="pending_transaction"}catch(s){if(s?.status===404)return!0;throw s}}async function R(o){let{aptosConfig:n,transactionHash:t}=o,{data:s}=await f({aptosConfig:n,path:`transactions/wait_by_hash/${t}`,originMethod:"longWaitForTransaction"});return s}async function z(o){let{aptosConfig:n,transactionHash:t,options:s}=o,r=s?.timeoutSecs??20,u=s?.checkSuccess??!0,e=!0,p=0,i,g,l=200,h=1.5;function c(a){if(!(a instanceof b)||(g=a,a.status!==404&&a.status>=400&&a.status<500))throw a}try{i=await y({aptosConfig:n,transactionHash:t}),e=i.type==="pending_transaction"}catch(a){c(a)}if(e){let a=Date.now();try{i=await R({aptosConfig:n,transactionHash:t}),e=i.type==="pending_transaction"}catch(w){c(w)}p=(Date.now()-a)/1e3}for(;e&&!(p>=r);){try{if(i=await y({aptosConfig:n,transactionHash:t}),e=i.type==="pending_transaction",!e)break}catch(a){c(a)}await d(l),p+=l/1e3,l*=h}if(i===void 0)throw g||new m(`Fetching transaction ${t} failed and timed out after ${r} seconds`,i);if(i.type==="pending_transaction")throw new m(`Transaction ${t} timed out in pending state after ${r} seconds`,i);if(!u)return i;if(!i.success)throw new T(`Transaction ${t} failed with an error: ${i.vm_status}`,i);return i}async function U(o){let{aptosConfig:n,processorType:t}=o,s=BigInt(o.minimumLedgerVersion),r=3e3,u=new Date().getTime(),e=BigInt(-1);for(;e<s;){if(new Date().getTime()-u>r)throw new Error("waitForLastSuccessIndexerVersionSync timeout");if(t===void 0?e=await x({aptosConfig:n}):e=(await B({aptosConfig:n,processorType:t})).last_success_version,e>=s)break;await d(200)}}var m=class extends Error{constructor(n,t){super(n),this.lastSubmittedTransaction=t}},T=class extends Error{constructor(n,t){super(n),this.transaction=t}};async function X(o){let{aptosConfig:n,ledgerVersion:t,options:s}=o,{data:r}=await f({aptosConfig:n,originMethod:"getBlockByVersion",path:`blocks/by_version/${t}`,params:{with_transactions:s?.withTransactions}});return P({block:r,...o})}async function j(o){let{aptosConfig:n,blockHeight:t,options:s}=o,{data:r}=await f({aptosConfig:n,originMethod:"getBlockByHeight",path:`blocks/by_height/${t}`,params:{with_transactions:s?.withTransactions}});return P({block:r,...o})}async function P(o){let{aptosConfig:n,block:t,options:s}=o;if(s?.withTransactions){t.transactions=t.transactions??[];let r=t.transactions[t.transactions.length-1],u=BigInt(t.first_version),e=BigInt(t.last_version),p=r?.version,i;if(p===void 0?i=u-1n:i=BigInt(p),i===e)return t;let g=[],l=100n;for(let c=i+1n;c<e;c+=BigInt(100))g.push(H({aptosConfig:n,options:{offset:c,limit:Math.min(Number(l),Number(e-c+1n))}}));let h=await Promise.all(g);for(let c of h)t.transactions.push(...c)}return t}export{H as a,W as b,O as c,y as d,q as e,R as f,z as g,U as h,m as i,T as j,X as k,j as l};
2
+ //# sourceMappingURL=chunk-QK32EQSF.mjs.map