@aptos-labs/ts-sdk 1.34.0 → 1.35.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 (419) hide show
  1. package/README.md +8 -9
  2. package/dist/common/{accountAddress-CDtCLtJA.d.ts → accountAddress-CuHovHdK.d.ts} +19 -0
  3. package/dist/common/chunk-RX5UBAME.js +4 -0
  4. package/dist/common/chunk-RX5UBAME.js.map +1 -0
  5. package/dist/common/cli/index.d.ts +1 -1
  6. package/dist/common/cli/index.js +1 -1
  7. package/dist/common/cli/index.js.map +1 -1
  8. package/dist/common/index.d.ts +489 -241
  9. package/dist/common/index.js +32 -32
  10. package/dist/common/index.js.map +1 -1
  11. package/dist/esm/account/AbstractKeylessAccount.mjs +1 -1
  12. package/dist/esm/account/AbstractedAccount.mjs +1 -1
  13. package/dist/esm/account/Account.d.mts +1 -1
  14. package/dist/esm/account/Account.mjs +1 -1
  15. package/dist/esm/account/AccountUtils.mjs +1 -1
  16. package/dist/esm/account/Ed25519Account.d.mts +2 -2
  17. package/dist/esm/account/Ed25519Account.mjs +1 -1
  18. package/dist/esm/account/EphemeralKeyPair.mjs +1 -1
  19. package/dist/esm/account/FederatedKeylessAccount.mjs +1 -1
  20. package/dist/esm/account/KeylessAccount.mjs +1 -1
  21. package/dist/esm/account/MultiEd25519Account.d.mts +108 -0
  22. package/dist/esm/account/MultiEd25519Account.mjs +2 -0
  23. package/dist/esm/account/MultiKeyAccount.d.mts +1 -2
  24. package/dist/esm/account/MultiKeyAccount.mjs +1 -1
  25. package/dist/esm/account/SingleKeyAccount.mjs +1 -1
  26. package/dist/esm/account/index.d.mts +1 -0
  27. package/dist/esm/account/index.mjs +1 -1
  28. package/dist/esm/account/utils.mjs +1 -1
  29. package/dist/esm/api/account/abstraction.mjs +1 -1
  30. package/dist/esm/api/account.d.mts +1 -1
  31. package/dist/esm/api/account.mjs +1 -1
  32. package/dist/esm/api/ans.mjs +1 -1
  33. package/dist/esm/api/aptos.d.mts +3 -1
  34. package/dist/esm/api/aptos.mjs +1 -1
  35. package/dist/esm/api/aptosConfig.mjs +1 -1
  36. package/dist/esm/api/coin.d.mts +2 -2
  37. package/dist/esm/api/coin.mjs +1 -1
  38. package/dist/esm/api/digitalAsset.mjs +1 -1
  39. package/dist/esm/api/event.mjs +1 -1
  40. package/dist/esm/api/experimental.d.mts +83 -0
  41. package/dist/esm/api/experimental.mjs +2 -0
  42. package/dist/esm/api/experimental.mjs.map +1 -0
  43. package/dist/esm/api/faucet.mjs +1 -1
  44. package/dist/esm/api/fungibleAsset.mjs +1 -1
  45. package/dist/esm/api/general.mjs +1 -1
  46. package/dist/esm/api/index.d.mts +1 -0
  47. package/dist/esm/api/index.mjs +1 -1
  48. package/dist/esm/api/keyless.mjs +1 -1
  49. package/dist/esm/api/object.mjs +1 -1
  50. package/dist/esm/api/staking.mjs +1 -1
  51. package/dist/esm/api/table.mjs +1 -1
  52. package/dist/esm/api/transaction.mjs +1 -1
  53. package/dist/esm/api/transactionSubmission/build.mjs +1 -1
  54. package/dist/esm/api/transactionSubmission/management.mjs +1 -1
  55. package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
  56. package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -1
  57. package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
  58. package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
  59. package/dist/esm/api/utils.mjs +1 -1
  60. package/dist/esm/bcs/deserializer.mjs +1 -1
  61. package/dist/esm/bcs/index.mjs +1 -1
  62. package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -1
  63. package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -1
  64. package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
  65. package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
  66. package/dist/esm/bcs/serializer.mjs +1 -1
  67. package/dist/esm/{chunk-P7SE5LQE.mjs → chunk-27ESCVVC.mjs} +2 -2
  68. package/dist/esm/chunk-2SAYQUUX.mjs +2 -0
  69. package/dist/esm/chunk-2SAYQUUX.mjs.map +1 -0
  70. package/dist/esm/{chunk-UTXEW2FT.mjs → chunk-2TRQERBL.mjs} +2 -2
  71. package/dist/esm/chunk-2V636AYW.mjs +2 -0
  72. package/dist/esm/{chunk-L6FONDPA.mjs → chunk-2YKERRHD.mjs} +2 -2
  73. package/dist/esm/chunk-2ZLFQBT2.mjs +2 -0
  74. package/dist/esm/chunk-2ZLFQBT2.mjs.map +1 -0
  75. package/dist/esm/{chunk-XDIX7NIP.mjs → chunk-3LDVJ2YK.mjs} +2 -2
  76. package/dist/esm/{chunk-J7HRQ2IH.mjs → chunk-44EHAKKW.mjs} +2 -2
  77. package/dist/esm/{chunk-2FNFUTFJ.mjs → chunk-53IBOHXB.mjs} +2 -2
  78. package/dist/esm/{chunk-X6IHNXWY.mjs → chunk-5H5D6QVX.mjs} +2 -2
  79. package/dist/esm/{chunk-G4O6FXCF.mjs → chunk-5W2ERBGY.mjs} +2 -2
  80. package/dist/esm/{chunk-VOCI2675.mjs → chunk-67A5U2X6.mjs} +2 -2
  81. package/dist/esm/{chunk-XXHZQFYW.mjs → chunk-6IJZRG3U.mjs} +2 -2
  82. package/dist/esm/{chunk-N4DM5FYH.mjs → chunk-6KZT3KFZ.mjs} +2 -2
  83. package/dist/esm/chunk-752TOOCA.mjs +2 -0
  84. package/dist/esm/chunk-752TOOCA.mjs.map +1 -0
  85. package/dist/esm/{chunk-ZP5EBIBE.mjs → chunk-7A2KHJ3D.mjs} +2 -2
  86. package/dist/esm/{chunk-ROT6S6BM.mjs → chunk-7CRQNXR5.mjs} +2 -2
  87. package/dist/esm/{chunk-TM6IKHMX.mjs → chunk-7OUPEQRN.mjs} +2 -2
  88. package/dist/esm/chunk-A3VO773Q.mjs +2 -0
  89. package/dist/esm/{chunk-DWJ3PGWE.mjs → chunk-AEGA5N2W.mjs} +2 -2
  90. package/dist/esm/{chunk-BI3BTSUB.mjs → chunk-AIPHJFJL.mjs} +2 -2
  91. package/dist/esm/{chunk-HLJE5XGE.mjs → chunk-AQWKKSRN.mjs} +2 -2
  92. package/dist/esm/{chunk-D6T3NYOA.mjs → chunk-B23VO5TB.mjs} +2 -2
  93. package/dist/esm/{chunk-42T3UGSW.mjs → chunk-BHVSIRNF.mjs} +2 -2
  94. package/dist/esm/chunk-BMPHQ3E7.mjs +2 -0
  95. package/dist/esm/{chunk-EGZI6EJ2.mjs → chunk-BPHCRTHD.mjs} +2 -2
  96. package/dist/esm/{chunk-XH3BEKII.mjs → chunk-BQYKFATL.mjs} +2 -2
  97. package/dist/esm/chunk-BY3XFRUM.mjs +2 -0
  98. package/dist/esm/{chunk-EY2JUXEC.mjs.map → chunk-BY3XFRUM.mjs.map} +1 -1
  99. package/dist/esm/{chunk-DBIZE7G6.mjs → chunk-CGTMSLVZ.mjs} +2 -2
  100. package/dist/esm/{chunk-4T75XRI2.mjs → chunk-CPAAEEF4.mjs} +2 -2
  101. package/dist/esm/{chunk-DMS7K76O.mjs → chunk-CPFQUFVD.mjs} +2 -2
  102. package/dist/esm/chunk-CXLNTATW.mjs +2 -0
  103. package/dist/esm/chunk-CXLNTATW.mjs.map +1 -0
  104. package/dist/esm/{chunk-Q7RG7KQS.mjs → chunk-DAJFOJ3L.mjs} +2 -2
  105. package/dist/esm/chunk-DOVH6HPL.mjs +2 -0
  106. package/dist/esm/{chunk-U2SJIG2T.mjs → chunk-E5PAUR4N.mjs} +2 -2
  107. package/dist/esm/{chunk-6LGXFXXR.mjs → chunk-EGCL6KA6.mjs} +2 -2
  108. package/dist/esm/{chunk-TOBQ5UE6.mjs → chunk-ERLDXTIY.mjs} +2 -2
  109. package/dist/esm/{chunk-CSG67JHZ.mjs → chunk-FJ5J7CVW.mjs} +2 -2
  110. package/dist/esm/{chunk-DLLDRANJ.mjs → chunk-FOEPRHAC.mjs} +2 -2
  111. package/dist/esm/{chunk-6JTNS5O6.mjs → chunk-G5F5ZOH5.mjs} +2 -2
  112. package/dist/esm/chunk-GFPEB22G.mjs +1 -0
  113. package/dist/esm/chunk-GFPEB22G.mjs.map +1 -0
  114. package/dist/esm/{chunk-AZWVCBK2.mjs → chunk-GI4AR6DQ.mjs} +2 -2
  115. package/dist/esm/{chunk-Y3Y4DVCK.mjs → chunk-GRRBXHVG.mjs} +2 -2
  116. package/dist/esm/{chunk-HT2WC3QV.mjs → chunk-GTVMJJQQ.mjs} +2 -2
  117. package/dist/esm/{chunk-HL2O3T57.mjs → chunk-GU4MD5ST.mjs} +2 -2
  118. package/dist/esm/chunk-H4YAL2IL.mjs +2 -0
  119. package/dist/esm/{chunk-X24PSWCX.mjs → chunk-HBTJN4RJ.mjs} +2 -2
  120. package/dist/esm/{chunk-IDTLNF4M.mjs → chunk-HHWJHOFZ.mjs} +2 -2
  121. package/dist/esm/{chunk-OURSLL3I.mjs → chunk-HKL4MFNL.mjs} +2 -2
  122. package/dist/esm/{chunk-G6RLN6ET.mjs → chunk-HVIF6DW6.mjs} +2 -2
  123. package/dist/esm/{chunk-VKDTI6NX.mjs → chunk-HYJQHVDZ.mjs} +2 -2
  124. package/dist/esm/chunk-HYJQHVDZ.mjs.map +1 -0
  125. package/dist/esm/{chunk-XAPQNCTN.mjs → chunk-ILUFGYLO.mjs} +2 -2
  126. package/dist/esm/{chunk-ABXES4FS.mjs → chunk-IMYNN4TW.mjs} +2 -2
  127. package/dist/esm/{chunk-2GIPNLDO.mjs → chunk-IOHESHLR.mjs} +2 -2
  128. package/dist/esm/{chunk-GQX5KMF7.mjs → chunk-JNNFNYDO.mjs} +2 -2
  129. package/dist/esm/{chunk-3HFZN7L5.mjs → chunk-K233I26C.mjs} +2 -2
  130. package/dist/esm/{chunk-AC3BISWL.mjs → chunk-KK5HUWF6.mjs} +2 -2
  131. package/dist/esm/chunk-KSLLV3ZC.mjs +2 -0
  132. package/dist/esm/chunk-KSLLV3ZC.mjs.map +1 -0
  133. package/dist/esm/{chunk-N7C6LQPZ.mjs → chunk-L6KVC7CJ.mjs} +2 -2
  134. package/dist/esm/{chunk-Q4C4U6I4.mjs → chunk-LQOSHBB7.mjs} +2 -2
  135. package/dist/esm/{chunk-XKUIMGKU.mjs → chunk-LS3IDL2N.mjs} +2 -2
  136. package/dist/esm/{chunk-HFCWJ6QL.mjs → chunk-MAWGZICD.mjs} +2 -2
  137. package/dist/esm/{chunk-JF66JS2R.mjs → chunk-MFLHAVIW.mjs} +2 -2
  138. package/dist/esm/chunk-OLGEN23M.mjs +2 -0
  139. package/dist/esm/{chunk-4UK4MUSD.mjs → chunk-ONGH5DXZ.mjs} +2 -2
  140. package/dist/esm/{chunk-4776UXL6.mjs → chunk-OPD5EKOA.mjs} +2 -2
  141. package/dist/esm/{chunk-V2EXS6TM.mjs → chunk-P5CM4C2G.mjs} +2 -2
  142. package/dist/esm/{chunk-BBUN4IO4.mjs → chunk-PC25RPDV.mjs} +2 -2
  143. package/dist/esm/{chunk-N6YTF76Q.mjs → chunk-PDAWVDI7.mjs} +2 -2
  144. package/dist/esm/chunk-PIPDQFL2.mjs +2 -0
  145. package/dist/esm/chunk-PIPDQFL2.mjs.map +1 -0
  146. package/dist/esm/{chunk-6PBMD2BQ.mjs → chunk-PWGTRRSJ.mjs} +2 -2
  147. package/dist/esm/{chunk-PWYJWTEM.mjs → chunk-PYY2RXFP.mjs} +2 -2
  148. package/dist/esm/chunk-PYY2RXFP.mjs.map +1 -0
  149. package/dist/esm/chunk-QUJM5W4L.mjs +2 -0
  150. package/dist/esm/chunk-QUJM5W4L.mjs.map +1 -0
  151. package/dist/esm/{chunk-H4GZWYIG.mjs → chunk-QYJKCRVA.mjs} +2 -2
  152. package/dist/esm/{chunk-X2CPDUOS.mjs → chunk-R6QCPXQG.mjs} +2 -2
  153. package/dist/esm/chunk-R6QCPXQG.mjs.map +1 -0
  154. package/dist/esm/{chunk-33CBJFX2.mjs → chunk-RDPWCN4B.mjs} +2 -2
  155. package/dist/esm/{chunk-MT2RJ7H3.mjs → chunk-RIINVEZA.mjs} +2 -2
  156. package/dist/esm/{chunk-EBMEXURY.mjs → chunk-RXHER6EA.mjs} +2 -2
  157. package/dist/esm/chunk-SJDHW55X.mjs +2 -0
  158. package/dist/esm/chunk-SJDHW55X.mjs.map +1 -0
  159. package/dist/esm/{chunk-KEJAUCQF.mjs → chunk-T7X4GZDU.mjs} +2 -2
  160. package/dist/esm/{chunk-BUTMGMSD.mjs → chunk-TH5JCPN2.mjs} +2 -2
  161. package/dist/esm/{chunk-ORMOQWWH.mjs → chunk-TKXEVD7A.mjs} +2 -2
  162. package/dist/esm/{chunk-FN4C3CKC.mjs → chunk-TTY5GFMN.mjs} +2 -2
  163. package/dist/esm/chunk-TWETGZ3W.mjs +2 -0
  164. package/dist/esm/chunk-TWETGZ3W.mjs.map +1 -0
  165. package/dist/esm/{chunk-PR3W2QEH.mjs → chunk-U4DEYWFT.mjs} +2 -2
  166. package/dist/esm/{chunk-7CYCKCVU.mjs → chunk-UJJGIPOA.mjs} +2 -2
  167. package/dist/esm/{chunk-ZCEBDPBJ.mjs → chunk-US2HZFOM.mjs} +2 -2
  168. package/dist/esm/{chunk-S47HA7O7.mjs → chunk-VDYUMBOT.mjs} +2 -2
  169. package/dist/esm/chunk-VHY6ZATX.mjs +2 -0
  170. package/dist/esm/chunk-VHY6ZATX.mjs.map +1 -0
  171. package/dist/esm/{chunk-TDGUMBON.mjs → chunk-VWZEJTGP.mjs} +2 -2
  172. package/dist/esm/{chunk-TDGUMBON.mjs.map → chunk-VWZEJTGP.mjs.map} +1 -1
  173. package/dist/esm/{chunk-3EY7MT2M.mjs → chunk-W2C5KRUQ.mjs} +2 -2
  174. package/dist/esm/{chunk-O37BZP2G.mjs → chunk-W4SMZ6IW.mjs} +2 -2
  175. package/dist/esm/chunk-WFKPVKU3.mjs +2 -0
  176. package/dist/esm/chunk-WFKPVKU3.mjs.map +1 -0
  177. package/dist/esm/{chunk-CXNF73OX.mjs → chunk-WHVCUVZP.mjs} +2 -2
  178. package/dist/esm/{chunk-QBFGY74I.mjs → chunk-WLDYBSOG.mjs} +2 -2
  179. package/dist/esm/{chunk-HEAWDTLG.mjs → chunk-XRVZAEQO.mjs} +2 -2
  180. package/dist/esm/chunk-XSBUL2WP.mjs +2 -0
  181. package/dist/esm/chunk-XSBUL2WP.mjs.map +1 -0
  182. package/dist/esm/{chunk-DNWFDS7F.mjs → chunk-XW3BXTCZ.mjs} +2 -2
  183. package/dist/esm/{chunk-L2AQG3G3.mjs → chunk-Y65PKZLK.mjs} +2 -2
  184. package/dist/esm/{chunk-WXDA4CCR.mjs → chunk-YAGIE4GN.mjs} +2 -2
  185. package/dist/esm/{chunk-CRFLR3ZY.mjs → chunk-YLUULY6G.mjs} +2 -2
  186. package/dist/esm/{chunk-SCBYJU6K.mjs → chunk-YWSDONJJ.mjs} +2 -2
  187. package/dist/esm/{chunk-BYHCW7MI.mjs → chunk-YXYYII5S.mjs} +2 -2
  188. package/dist/esm/{chunk-XTOIL6MB.mjs → chunk-ZD2TY5N3.mjs} +2 -2
  189. package/dist/esm/{chunk-5BSMF22B.mjs → chunk-ZS2IVRHT.mjs} +2 -2
  190. package/dist/esm/cli/index.mjs +1 -1
  191. package/dist/esm/cli/localNode.mjs +1 -1
  192. package/dist/esm/client/core.d.mts +36 -1
  193. package/dist/esm/client/core.mjs +1 -1
  194. package/dist/esm/client/get.d.mts +35 -1
  195. package/dist/esm/client/get.mjs +1 -1
  196. package/dist/esm/client/index.d.mts +3 -3
  197. package/dist/esm/client/index.mjs +1 -1
  198. package/dist/esm/client/post.d.mts +34 -1
  199. package/dist/esm/client/post.mjs +1 -1
  200. package/dist/esm/core/account/index.mjs +1 -1
  201. package/dist/esm/core/account/utils/address.mjs +1 -1
  202. package/dist/esm/core/account/utils/index.mjs +1 -1
  203. package/dist/esm/core/accountAddress.mjs +1 -1
  204. package/dist/esm/core/authenticationKey.mjs +1 -1
  205. package/dist/esm/core/crypto/abstraction.mjs +1 -1
  206. package/dist/esm/core/crypto/ed25519.mjs +1 -1
  207. package/dist/esm/core/crypto/ephemeral.mjs +1 -1
  208. package/dist/esm/core/crypto/federatedKeyless.mjs +1 -1
  209. package/dist/esm/core/crypto/index.d.mts +1 -1
  210. package/dist/esm/core/crypto/index.mjs +1 -1
  211. package/dist/esm/core/crypto/keyless.mjs +1 -1
  212. package/dist/esm/core/crypto/multiEd25519.d.mts +17 -2
  213. package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
  214. package/dist/esm/core/crypto/multiKey.d.mts +33 -15
  215. package/dist/esm/core/crypto/multiKey.mjs +1 -1
  216. package/dist/esm/core/crypto/privateKey.mjs +1 -1
  217. package/dist/esm/core/crypto/proof.mjs +1 -1
  218. package/dist/esm/core/crypto/publicKey.mjs +1 -1
  219. package/dist/esm/core/crypto/secp256k1.mjs +1 -1
  220. package/dist/esm/core/crypto/signature.mjs +1 -1
  221. package/dist/esm/core/crypto/singleKey.mjs +1 -1
  222. package/dist/esm/core/crypto/utils.mjs +1 -1
  223. package/dist/esm/core/hex.mjs +1 -1
  224. package/dist/esm/core/index.d.mts +1 -1
  225. package/dist/esm/core/index.mjs +1 -1
  226. package/dist/esm/errors/index.mjs +1 -1
  227. package/dist/esm/index.d.mts +6 -4
  228. package/dist/esm/index.mjs +1 -1
  229. package/dist/esm/internal/abstraction.mjs +1 -1
  230. package/dist/esm/internal/account.mjs +1 -1
  231. package/dist/esm/internal/ans.mjs +1 -1
  232. package/dist/esm/internal/coin.mjs +1 -1
  233. package/dist/esm/internal/digitalAsset.mjs +1 -1
  234. package/dist/esm/internal/event.mjs +1 -1
  235. package/dist/esm/internal/experimental.d.mts +52 -0
  236. package/dist/esm/internal/experimental.mjs +2 -0
  237. package/dist/esm/internal/experimental.mjs.map +1 -0
  238. package/dist/esm/internal/faucet.mjs +1 -1
  239. package/dist/esm/internal/fungibleAsset.mjs +1 -1
  240. package/dist/esm/internal/general.mjs +1 -1
  241. package/dist/esm/internal/keyless.mjs +1 -1
  242. package/dist/esm/internal/object.mjs +1 -1
  243. package/dist/esm/internal/staking.mjs +1 -1
  244. package/dist/esm/internal/table.mjs +1 -1
  245. package/dist/esm/internal/transaction.mjs +1 -1
  246. package/dist/esm/internal/transactionSubmission.mjs +1 -1
  247. package/dist/esm/internal/view.mjs +1 -1
  248. package/dist/esm/transactions/authenticator/account.mjs +1 -1
  249. package/dist/esm/transactions/authenticator/index.mjs +1 -1
  250. package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
  251. package/dist/esm/transactions/index.mjs +1 -1
  252. package/dist/esm/transactions/instances/chainId.mjs +1 -1
  253. package/dist/esm/transactions/instances/identifier.mjs +1 -1
  254. package/dist/esm/transactions/instances/index.mjs +1 -1
  255. package/dist/esm/transactions/instances/moduleId.mjs +1 -1
  256. package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
  257. package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
  258. package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
  259. package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
  260. package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
  261. package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
  262. package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
  263. package/dist/esm/transactions/management/index.mjs +1 -1
  264. package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
  265. package/dist/esm/transactions/scriptComposer/index.mjs +1 -1
  266. package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
  267. package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
  268. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
  269. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
  270. package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +2 -2
  271. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
  272. package/dist/esm/transactions/typeTag/index.mjs +1 -1
  273. package/dist/esm/transactions/typeTag/parser.mjs +1 -1
  274. package/dist/esm/types/index.mjs +1 -1
  275. package/dist/esm/types/types.d.mts +19 -0
  276. package/dist/esm/types/types.mjs +1 -1
  277. package/dist/esm/utils/helpers.mjs +1 -1
  278. package/dist/esm/utils/index.mjs +1 -1
  279. package/dist/esm/utils/normalizeBundle.mjs +1 -1
  280. package/dist/esm/version.d.mts +1 -1
  281. package/dist/esm/version.mjs +1 -1
  282. package/package.json +2 -7
  283. package/src/account/MultiEd25519Account.ts +154 -0
  284. package/src/account/MultiKeyAccount.ts +1 -2
  285. package/src/account/index.ts +1 -0
  286. package/src/api/account.ts +1 -1
  287. package/src/api/aptos.ts +6 -0
  288. package/src/api/aptosConfig.ts +2 -2
  289. package/src/api/experimental.ts +64 -0
  290. package/src/client/core.ts +120 -0
  291. package/src/client/get.ts +73 -1
  292. package/src/client/post.ts +70 -1
  293. package/src/core/crypto/multiEd25519.ts +19 -3
  294. package/src/core/crypto/multiKey.ts +76 -52
  295. package/src/core/hex.ts +3 -1
  296. package/src/internal/experimental.ts +55 -0
  297. package/src/internal/view.ts +4 -4
  298. package/src/transactions/transactionBuilder/transactionBuilder.ts +7 -0
  299. package/src/types/types.ts +20 -0
  300. package/src/version.ts +1 -1
  301. package/dist/common/chunk-ZYPBABLQ.js +0 -4
  302. package/dist/common/chunk-ZYPBABLQ.js.map +0 -1
  303. package/dist/esm/chunk-4YLUM62M.mjs +0 -2
  304. package/dist/esm/chunk-66HHRRIX.mjs +0 -2
  305. package/dist/esm/chunk-66HHRRIX.mjs.map +0 -1
  306. package/dist/esm/chunk-7C2RDOWS.mjs +0 -1
  307. package/dist/esm/chunk-7DPHPPMG.mjs +0 -2
  308. package/dist/esm/chunk-7DPHPPMG.mjs.map +0 -1
  309. package/dist/esm/chunk-DNJQWGB7.mjs +0 -2
  310. package/dist/esm/chunk-DPW6ELCQ.mjs +0 -2
  311. package/dist/esm/chunk-EMURYYVO.mjs +0 -2
  312. package/dist/esm/chunk-EY2JUXEC.mjs +0 -2
  313. package/dist/esm/chunk-F2ZTBAJJ.mjs +0 -2
  314. package/dist/esm/chunk-F2ZTBAJJ.mjs.map +0 -1
  315. package/dist/esm/chunk-I7YHK6ZF.mjs +0 -2
  316. package/dist/esm/chunk-I7YHK6ZF.mjs.map +0 -1
  317. package/dist/esm/chunk-PNSF3E67.mjs +0 -2
  318. package/dist/esm/chunk-PNSF3E67.mjs.map +0 -1
  319. package/dist/esm/chunk-PWYJWTEM.mjs.map +0 -1
  320. package/dist/esm/chunk-STY74NUA.mjs +0 -2
  321. package/dist/esm/chunk-STY74NUA.mjs.map +0 -1
  322. package/dist/esm/chunk-ULHOJ2BE.mjs +0 -2
  323. package/dist/esm/chunk-ULHOJ2BE.mjs.map +0 -1
  324. package/dist/esm/chunk-V7G2EDNR.mjs +0 -2
  325. package/dist/esm/chunk-V7G2EDNR.mjs.map +0 -1
  326. package/dist/esm/chunk-VKDTI6NX.mjs.map +0 -1
  327. package/dist/esm/chunk-WCMW2L3P.mjs +0 -2
  328. package/dist/esm/chunk-X2CPDUOS.mjs.map +0 -1
  329. package/dist/esm/chunk-XJJVJOX5.mjs +0 -2
  330. package/dist/esm/chunk-YIF242TF.mjs +0 -2
  331. package/dist/esm/chunk-YIF242TF.mjs.map +0 -1
  332. /package/dist/esm/{chunk-7C2RDOWS.mjs.map → account/MultiEd25519Account.mjs.map} +0 -0
  333. /package/dist/esm/{chunk-P7SE5LQE.mjs.map → chunk-27ESCVVC.mjs.map} +0 -0
  334. /package/dist/esm/{chunk-UTXEW2FT.mjs.map → chunk-2TRQERBL.mjs.map} +0 -0
  335. /package/dist/esm/{chunk-XJJVJOX5.mjs.map → chunk-2V636AYW.mjs.map} +0 -0
  336. /package/dist/esm/{chunk-L6FONDPA.mjs.map → chunk-2YKERRHD.mjs.map} +0 -0
  337. /package/dist/esm/{chunk-XDIX7NIP.mjs.map → chunk-3LDVJ2YK.mjs.map} +0 -0
  338. /package/dist/esm/{chunk-J7HRQ2IH.mjs.map → chunk-44EHAKKW.mjs.map} +0 -0
  339. /package/dist/esm/{chunk-2FNFUTFJ.mjs.map → chunk-53IBOHXB.mjs.map} +0 -0
  340. /package/dist/esm/{chunk-X6IHNXWY.mjs.map → chunk-5H5D6QVX.mjs.map} +0 -0
  341. /package/dist/esm/{chunk-G4O6FXCF.mjs.map → chunk-5W2ERBGY.mjs.map} +0 -0
  342. /package/dist/esm/{chunk-VOCI2675.mjs.map → chunk-67A5U2X6.mjs.map} +0 -0
  343. /package/dist/esm/{chunk-XXHZQFYW.mjs.map → chunk-6IJZRG3U.mjs.map} +0 -0
  344. /package/dist/esm/{chunk-N4DM5FYH.mjs.map → chunk-6KZT3KFZ.mjs.map} +0 -0
  345. /package/dist/esm/{chunk-ZP5EBIBE.mjs.map → chunk-7A2KHJ3D.mjs.map} +0 -0
  346. /package/dist/esm/{chunk-ROT6S6BM.mjs.map → chunk-7CRQNXR5.mjs.map} +0 -0
  347. /package/dist/esm/{chunk-TM6IKHMX.mjs.map → chunk-7OUPEQRN.mjs.map} +0 -0
  348. /package/dist/esm/{chunk-WCMW2L3P.mjs.map → chunk-A3VO773Q.mjs.map} +0 -0
  349. /package/dist/esm/{chunk-DWJ3PGWE.mjs.map → chunk-AEGA5N2W.mjs.map} +0 -0
  350. /package/dist/esm/{chunk-BI3BTSUB.mjs.map → chunk-AIPHJFJL.mjs.map} +0 -0
  351. /package/dist/esm/{chunk-HLJE5XGE.mjs.map → chunk-AQWKKSRN.mjs.map} +0 -0
  352. /package/dist/esm/{chunk-D6T3NYOA.mjs.map → chunk-B23VO5TB.mjs.map} +0 -0
  353. /package/dist/esm/{chunk-42T3UGSW.mjs.map → chunk-BHVSIRNF.mjs.map} +0 -0
  354. /package/dist/esm/{chunk-4YLUM62M.mjs.map → chunk-BMPHQ3E7.mjs.map} +0 -0
  355. /package/dist/esm/{chunk-EGZI6EJ2.mjs.map → chunk-BPHCRTHD.mjs.map} +0 -0
  356. /package/dist/esm/{chunk-XH3BEKII.mjs.map → chunk-BQYKFATL.mjs.map} +0 -0
  357. /package/dist/esm/{chunk-DBIZE7G6.mjs.map → chunk-CGTMSLVZ.mjs.map} +0 -0
  358. /package/dist/esm/{chunk-4T75XRI2.mjs.map → chunk-CPAAEEF4.mjs.map} +0 -0
  359. /package/dist/esm/{chunk-DMS7K76O.mjs.map → chunk-CPFQUFVD.mjs.map} +0 -0
  360. /package/dist/esm/{chunk-Q7RG7KQS.mjs.map → chunk-DAJFOJ3L.mjs.map} +0 -0
  361. /package/dist/esm/{chunk-DPW6ELCQ.mjs.map → chunk-DOVH6HPL.mjs.map} +0 -0
  362. /package/dist/esm/{chunk-U2SJIG2T.mjs.map → chunk-E5PAUR4N.mjs.map} +0 -0
  363. /package/dist/esm/{chunk-6LGXFXXR.mjs.map → chunk-EGCL6KA6.mjs.map} +0 -0
  364. /package/dist/esm/{chunk-TOBQ5UE6.mjs.map → chunk-ERLDXTIY.mjs.map} +0 -0
  365. /package/dist/esm/{chunk-CSG67JHZ.mjs.map → chunk-FJ5J7CVW.mjs.map} +0 -0
  366. /package/dist/esm/{chunk-DLLDRANJ.mjs.map → chunk-FOEPRHAC.mjs.map} +0 -0
  367. /package/dist/esm/{chunk-6JTNS5O6.mjs.map → chunk-G5F5ZOH5.mjs.map} +0 -0
  368. /package/dist/esm/{chunk-AZWVCBK2.mjs.map → chunk-GI4AR6DQ.mjs.map} +0 -0
  369. /package/dist/esm/{chunk-Y3Y4DVCK.mjs.map → chunk-GRRBXHVG.mjs.map} +0 -0
  370. /package/dist/esm/{chunk-HT2WC3QV.mjs.map → chunk-GTVMJJQQ.mjs.map} +0 -0
  371. /package/dist/esm/{chunk-HL2O3T57.mjs.map → chunk-GU4MD5ST.mjs.map} +0 -0
  372. /package/dist/esm/{chunk-EMURYYVO.mjs.map → chunk-H4YAL2IL.mjs.map} +0 -0
  373. /package/dist/esm/{chunk-X24PSWCX.mjs.map → chunk-HBTJN4RJ.mjs.map} +0 -0
  374. /package/dist/esm/{chunk-IDTLNF4M.mjs.map → chunk-HHWJHOFZ.mjs.map} +0 -0
  375. /package/dist/esm/{chunk-OURSLL3I.mjs.map → chunk-HKL4MFNL.mjs.map} +0 -0
  376. /package/dist/esm/{chunk-G6RLN6ET.mjs.map → chunk-HVIF6DW6.mjs.map} +0 -0
  377. /package/dist/esm/{chunk-XAPQNCTN.mjs.map → chunk-ILUFGYLO.mjs.map} +0 -0
  378. /package/dist/esm/{chunk-ABXES4FS.mjs.map → chunk-IMYNN4TW.mjs.map} +0 -0
  379. /package/dist/esm/{chunk-2GIPNLDO.mjs.map → chunk-IOHESHLR.mjs.map} +0 -0
  380. /package/dist/esm/{chunk-GQX5KMF7.mjs.map → chunk-JNNFNYDO.mjs.map} +0 -0
  381. /package/dist/esm/{chunk-3HFZN7L5.mjs.map → chunk-K233I26C.mjs.map} +0 -0
  382. /package/dist/esm/{chunk-AC3BISWL.mjs.map → chunk-KK5HUWF6.mjs.map} +0 -0
  383. /package/dist/esm/{chunk-N7C6LQPZ.mjs.map → chunk-L6KVC7CJ.mjs.map} +0 -0
  384. /package/dist/esm/{chunk-Q4C4U6I4.mjs.map → chunk-LQOSHBB7.mjs.map} +0 -0
  385. /package/dist/esm/{chunk-XKUIMGKU.mjs.map → chunk-LS3IDL2N.mjs.map} +0 -0
  386. /package/dist/esm/{chunk-HFCWJ6QL.mjs.map → chunk-MAWGZICD.mjs.map} +0 -0
  387. /package/dist/esm/{chunk-JF66JS2R.mjs.map → chunk-MFLHAVIW.mjs.map} +0 -0
  388. /package/dist/esm/{chunk-DNJQWGB7.mjs.map → chunk-OLGEN23M.mjs.map} +0 -0
  389. /package/dist/esm/{chunk-4UK4MUSD.mjs.map → chunk-ONGH5DXZ.mjs.map} +0 -0
  390. /package/dist/esm/{chunk-4776UXL6.mjs.map → chunk-OPD5EKOA.mjs.map} +0 -0
  391. /package/dist/esm/{chunk-V2EXS6TM.mjs.map → chunk-P5CM4C2G.mjs.map} +0 -0
  392. /package/dist/esm/{chunk-BBUN4IO4.mjs.map → chunk-PC25RPDV.mjs.map} +0 -0
  393. /package/dist/esm/{chunk-N6YTF76Q.mjs.map → chunk-PDAWVDI7.mjs.map} +0 -0
  394. /package/dist/esm/{chunk-6PBMD2BQ.mjs.map → chunk-PWGTRRSJ.mjs.map} +0 -0
  395. /package/dist/esm/{chunk-H4GZWYIG.mjs.map → chunk-QYJKCRVA.mjs.map} +0 -0
  396. /package/dist/esm/{chunk-33CBJFX2.mjs.map → chunk-RDPWCN4B.mjs.map} +0 -0
  397. /package/dist/esm/{chunk-MT2RJ7H3.mjs.map → chunk-RIINVEZA.mjs.map} +0 -0
  398. /package/dist/esm/{chunk-EBMEXURY.mjs.map → chunk-RXHER6EA.mjs.map} +0 -0
  399. /package/dist/esm/{chunk-KEJAUCQF.mjs.map → chunk-T7X4GZDU.mjs.map} +0 -0
  400. /package/dist/esm/{chunk-BUTMGMSD.mjs.map → chunk-TH5JCPN2.mjs.map} +0 -0
  401. /package/dist/esm/{chunk-ORMOQWWH.mjs.map → chunk-TKXEVD7A.mjs.map} +0 -0
  402. /package/dist/esm/{chunk-FN4C3CKC.mjs.map → chunk-TTY5GFMN.mjs.map} +0 -0
  403. /package/dist/esm/{chunk-PR3W2QEH.mjs.map → chunk-U4DEYWFT.mjs.map} +0 -0
  404. /package/dist/esm/{chunk-7CYCKCVU.mjs.map → chunk-UJJGIPOA.mjs.map} +0 -0
  405. /package/dist/esm/{chunk-ZCEBDPBJ.mjs.map → chunk-US2HZFOM.mjs.map} +0 -0
  406. /package/dist/esm/{chunk-S47HA7O7.mjs.map → chunk-VDYUMBOT.mjs.map} +0 -0
  407. /package/dist/esm/{chunk-3EY7MT2M.mjs.map → chunk-W2C5KRUQ.mjs.map} +0 -0
  408. /package/dist/esm/{chunk-O37BZP2G.mjs.map → chunk-W4SMZ6IW.mjs.map} +0 -0
  409. /package/dist/esm/{chunk-CXNF73OX.mjs.map → chunk-WHVCUVZP.mjs.map} +0 -0
  410. /package/dist/esm/{chunk-QBFGY74I.mjs.map → chunk-WLDYBSOG.mjs.map} +0 -0
  411. /package/dist/esm/{chunk-HEAWDTLG.mjs.map → chunk-XRVZAEQO.mjs.map} +0 -0
  412. /package/dist/esm/{chunk-DNWFDS7F.mjs.map → chunk-XW3BXTCZ.mjs.map} +0 -0
  413. /package/dist/esm/{chunk-L2AQG3G3.mjs.map → chunk-Y65PKZLK.mjs.map} +0 -0
  414. /package/dist/esm/{chunk-WXDA4CCR.mjs.map → chunk-YAGIE4GN.mjs.map} +0 -0
  415. /package/dist/esm/{chunk-CRFLR3ZY.mjs.map → chunk-YLUULY6G.mjs.map} +0 -0
  416. /package/dist/esm/{chunk-SCBYJU6K.mjs.map → chunk-YWSDONJJ.mjs.map} +0 -0
  417. /package/dist/esm/{chunk-BYHCW7MI.mjs.map → chunk-YXYYII5S.mjs.map} +0 -0
  418. /package/dist/esm/{chunk-XTOIL6MB.mjs.map → chunk-ZD2TY5N3.mjs.map} +0 -0
  419. /package/dist/esm/{chunk-5BSMF22B.mjs.map → chunk-ZS2IVRHT.mjs.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{a as r}from"./chunk-2FNFUTFJ.mjs";import{i as d,n as a,q as i}from"./chunk-G4O6FXCF.mjs";import{j as m}from"./chunk-42T3UGSW.mjs";async function y(n){let{aptosConfig:t,sender:o,authenticationFunction:e,options:s}=n,{moduleAddress:c,moduleName:u,functionName:p}=m(e);return r({aptosConfig:t,sender:o,data:{function:"0x1::account_abstraction::add_authentication_function",typeArguments:[],functionArguments:[c,u,p],abi:{typeParameters:[],parameters:[new d,new a(i()),new a(i())]}},options:s})}async function I(n){let{aptosConfig:t,sender:o,authenticationFunction:e,options:s}=n,{moduleAddress:c,moduleName:u,functionName:p}=m(e);return r({aptosConfig:t,sender:o,data:{function:"0x1::account_abstraction::remove_authentication_function",typeArguments:[],functionArguments:[c,u,p],abi:{typeParameters:[],parameters:[new d,new a(i()),new a(i())]}},options:s})}async function C(n){let{aptosConfig:t,sender:o,options:e}=n;return r({aptosConfig:t,sender:o,data:{function:"0x1::account_abstraction::remove_authenticator",typeArguments:[],functionArguments:[],abi:{typeParameters:[],parameters:[]}},options:e})}export{y as a,I as b,C as c};
2
- //# sourceMappingURL=chunk-BBUN4IO4.mjs.map
1
+ import{a as r}from"./chunk-53IBOHXB.mjs";import{i as d,n as a,q as i}from"./chunk-5W2ERBGY.mjs";import{j as m}from"./chunk-BHVSIRNF.mjs";async function y(n){let{aptosConfig:t,sender:o,authenticationFunction:e,options:s}=n,{moduleAddress:c,moduleName:u,functionName:p}=m(e);return r({aptosConfig:t,sender:o,data:{function:"0x1::account_abstraction::add_authentication_function",typeArguments:[],functionArguments:[c,u,p],abi:{typeParameters:[],parameters:[new d,new a(i()),new a(i())]}},options:s})}async function I(n){let{aptosConfig:t,sender:o,authenticationFunction:e,options:s}=n,{moduleAddress:c,moduleName:u,functionName:p}=m(e);return r({aptosConfig:t,sender:o,data:{function:"0x1::account_abstraction::remove_authentication_function",typeArguments:[],functionArguments:[c,u,p],abi:{typeParameters:[],parameters:[new d,new a(i()),new a(i())]}},options:s})}async function C(n){let{aptosConfig:t,sender:o,options:e}=n;return r({aptosConfig:t,sender:o,data:{function:"0x1::account_abstraction::remove_authenticator",typeArguments:[],functionArguments:[],abi:{typeParameters:[],parameters:[]}},options:e})}export{y as a,I as b,C as c};
2
+ //# sourceMappingURL=chunk-PC25RPDV.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as e}from"./chunk-EBMEXURY.mjs";var r=class t extends e{constructor(i){super(),this.identifier=i}serialize(i){i.serializeStr(this.identifier)}static deserialize(i){let s=i.deserializeStr();return new t(s)}};export{r as a};
2
- //# sourceMappingURL=chunk-N6YTF76Q.mjs.map
1
+ import{a as e}from"./chunk-RXHER6EA.mjs";var r=class t extends e{constructor(i){super(),this.identifier=i}serialize(i){i.serializeStr(this.identifier)}static deserialize(i){let s=i.deserializeStr();return new t(s)}};export{r as a};
2
+ //# sourceMappingURL=chunk-PDAWVDI7.mjs.map
@@ -0,0 +1,2 @@
1
+ import{a as w,d as dn,e as An,g as $}from"./chunk-XRVZAEQO.mjs";import{r as un}from"./chunk-IMYNN4TW.mjs";import{a as sn}from"./chunk-W2C5KRUQ.mjs";import{b as cn}from"./chunk-GRRBXHVG.mjs";import{a as on}from"./chunk-KK5HUWF6.mjs";import{a as rn}from"./chunk-ONGH5DXZ.mjs";import{a as f}from"./chunk-YWSDONJJ.mjs";import{a as an}from"./chunk-T7X4GZDU.mjs";import{a as Y,c as nn,d as tn}from"./chunk-27ESCVVC.mjs";import{c as z,d as L,e as Z,f as F,g as j,h as J,i as Q}from"./chunk-44EHAKKW.mjs";import{a as X}from"./chunk-LS3IDL2N.mjs";import{b as D,c as en,d as M,e as R,f as T}from"./chunk-BQYKFATL.mjs";import{a as q,b as l,c as H,d as h,e as x,f as B}from"./chunk-BPHCRTHD.mjs";import{b as O,c as V}from"./chunk-QUJM5W4L.mjs";import{a as E,b as p}from"./chunk-2TRQERBL.mjs";import{a as G}from"./chunk-JNNFNYDO.mjs";import{a as v}from"./chunk-XW3BXTCZ.mjs";import{i as b,j as k}from"./chunk-HVIF6DW6.mjs";import{b as N,d as W}from"./chunk-7OUPEQRN.mjs";import{a as C}from"./chunk-YOZBVVKL.mjs";import{a as U}from"./chunk-BMPHQ3E7.mjs";import{g as S}from"./chunk-4RXKALLC.mjs";import{b as K,c as _}from"./chunk-RJ7F4JDV.mjs";import{j as y}from"./chunk-BHVSIRNF.mjs";import{b as u}from"./chunk-LQOSHBB7.mjs";import{b as P}from"./chunk-VHY6ZATX.mjs";import{sha3_256 as ln}from"@noble/hashes/sha3";async function Ln(n){if(un(n))return wn(n);let{moduleAddress:e,moduleName:t,functionName:i}=y(n.function),r=await yn({key:"entry-function",moduleAddress:e,moduleName:t,functionName:i,aptosConfig:n.aptosConfig,abi:n.abi,fetch:dn});return hn({...n,abi:r})}function hn(n){let e=n.abi,{moduleAddress:t,moduleName:i,functionName:r}=y(n.function),a=w(n.typeArguments);if(a.length!==e.typeParameters.length)throw new Error(`Type argument count mismatch, expected ${e.typeParameters.length}, received ${a.length}`);let o=n.functionArguments.map((s,d)=>$(n.function,e,s,d,a));if(o.length!==e.parameters.length)throw new Error(`Too few arguments for '${t}::${i}::${r}', expected ${e.parameters.length} but got ${o.length}`);let c=F.build(`${t}::${i}`,r,a,o);if("multisigAddress"in n){let s=u.from(n.multisigAddress);return new Z(new J(s,new Q(c)))}return new L(c)}async function Zn(n){let{moduleAddress:e,moduleName:t,functionName:i}=y(n.function),r=await yn({key:"view-function",moduleAddress:e,moduleName:t,functionName:i,aptosConfig:n.aptosConfig,abi:n.abi,fetch:An});return Tn({abi:r,...n})}function Tn(n){let e=n.abi,{moduleAddress:t,moduleName:i,functionName:r}=y(n.function),a=w(n.typeArguments);if(a.length!==e.typeParameters.length)throw new Error(`Type argument count mismatch, expected ${e.typeParameters.length}, received ${a.length}`);let o=n?.functionArguments?.map((c,s)=>$(n.function,e,c,s,a))??[];if(o.length!==e.parameters.length)throw new Error(`Too few arguments for '${t}::${i}::${r}', expected ${e.parameters.length} but got ${o.length}`);return F.build(`${t}::${i}`,r,a,o)}function wn(n){return new z(new j(P.fromHexInput(n.bytecode).toUint8Array(),w(n.typeArguments),n.functionArguments))}async function In(n){let{aptosConfig:e,sender:t,payload:i,options:r,feePayerAddress:a}=n,o=async()=>S[e.network]?{chainId:S[e.network]}:{chainId:(await on({aptosConfig:e})).chain_id},c=async()=>r?.gasUnitPrice?{gasEstimate:r.gasUnitPrice}:{gasEstimate:(await cn({aptosConfig:e})).gas_estimate},s=async()=>{let g=async()=>r?.accountSequenceNumber!==void 0?r.accountSequenceNumber:(await sn({aptosConfig:e,accountAddress:t})).sequence_number;if(a&&u.from(a).equals(u.ZERO))try{return await g()}catch{return 0}else return g()},[{chainId:d},{gasEstimate:m},I]=await Promise.all([o(),c(),s()]),{maxGasAmount:fn,gasUnitPrice:gn,expireTimestamp:pn}={maxGasAmount:r?.maxGasAmount?BigInt(r.maxGasAmount):BigInt(2e5),gasUnitPrice:r?.gasUnitPrice??BigInt(m),expireTimestamp:r?.expireTimestamp??BigInt(Math.floor(Date.now()/1e3)+20)};return new Y(u.from(t),BigInt(I),i,BigInt(fn),BigInt(gn),BigInt(pn),new X(d))}async function jn(n){let{aptosConfig:e,sender:t,payload:i,options:r,feePayerAddress:a}=n,o=await In({aptosConfig:e,sender:t,payload:i,options:r,feePayerAddress:a});if("secondarySignerAddresses"in n){let c=n.secondarySignerAddresses?.map(s=>u.from(s))??[];return new rn(o,c,n.feePayerAddress?u.from(n.feePayerAddress):void 0)}return new an(o,n.feePayerAddress?u.from(n.feePayerAddress):void 0)}function Jn(n){let{signerPublicKey:e,transaction:t,secondarySignersPublicKeys:i,feePayerPublicKey:r}=n,a=A(e);if(t.feePayerAddress){let c=new tn(t.rawTransaction,t.secondarySignerAddresses??[],t.feePayerAddress),s=[];t.secondarySignerAddresses&&(i?s=i.map(I=>A(I)):s=Array.from({length:t.secondarySignerAddresses.length},()=>A(void 0)));let d=A(r),m=new R(a,t.secondarySignerAddresses??[],s,{address:t.feePayerAddress,authenticator:d});return new f(c.raw_txn,m).bcsToBytes()}if(t.secondarySignerAddresses){let c=new nn(t.rawTransaction,t.secondarySignerAddresses),s=[];i?s=i.map(m=>A(m)):s=Array.from({length:t.secondarySignerAddresses.length},()=>A(void 0));let d=new M(a,t.secondarySignerAddresses,s);return new f(c.raw_txn,d).bcsToBytes()}let o;if(a instanceof l)o=new D(a.public_key,a.signature);else if(a instanceof h||a instanceof x)o=new T(a);else if(a instanceof B)o=new T(a);else throw new Error("Invalid public key");return new f(t.rawTransaction,o).bcsToBytes()}function A(n){if(!n)return new B;let t=b.isInstance(n)||v.isInstance(n)||G.isInstance(n)?new E(n):n,i=new W(new Uint8Array(64));if(N.isInstance(t))return new l(t,i);if(E.isInstance(t))return b.isInstance(t.publicKey)?new h(t,new p(k.getSimulationSignature())):new h(t,new p(i));if(O.isInstance(t))return new x(t,new V({signatures:t.publicKeys.map(()=>new p(i)),bitmap:t.createBitmap({bits:Array(t.publicKeys.length).fill(0).map((r,a)=>a)})}));throw new Error("Unsupported PublicKey used for simulations")}function Pn(n){let{transaction:e,feePayerAuthenticator:t,additionalSignersAuthenticators:i}=n,r=U(q,n.senderAuthenticator),a;if(e.feePayerAddress){if(!t)throw new Error("Must provide a feePayerAuthenticator argument to generate a signed fee payer transaction");a=new R(r,e.secondarySignerAddresses??[],i??[],{address:e.feePayerAddress,authenticator:t})}else if(e.secondarySignerAddresses){if(!i)throw new Error("Must provide a additionalSignersAuthenticators argument to generate a signed multi agent transaction");a=new M(r,e.secondarySignerAddresses,i)}else r instanceof l?a=new D(r.public_key,r.signature):r instanceof H?a=new en(r.public_key,r.signature):a=new T(r);return new f(e.rawTransaction,a).bcsToBytes()}function mn(n){let e=ln.create();for(let t of n)e.update(t);return e.digest()}var Sn=mn(["APTOS::Transaction"]);function Qn(n){let e=Pn(n);return new P(mn([Sn,new Uint8Array([0]),e])).toString()}async function yn({key:n,moduleAddress:e,moduleName:t,functionName:i,aptosConfig:r,abi:a,fetch:o}){return a!==void 0?a:C(async()=>o(e,t,i,r),`${n}-${r.network}-${e}-${t}-${i}`,1e3*60*5)()}export{Ln as a,hn as b,Zn as c,Tn as d,In as e,jn as f,Jn as g,A as h,Pn as i,mn as j,Qn as k};
2
+ //# sourceMappingURL=chunk-PIPDQFL2.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/transactions/transactionBuilder/transactionBuilder.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * This file handles the transaction creation lifecycle.\n * It holds different operations to generate a transaction payload, a raw transaction,\n * and a signed transaction that can be simulated, signed and submitted to chain.\n */\nimport { sha3_256 as sha3Hash } from \"@noble/hashes/sha3\";\nimport { AptosConfig } from \"../../api/aptosConfig\";\nimport { AccountAddress, AccountAddressInput, Hex, PublicKey } from \"../../core\";\nimport {\n AnyPublicKey,\n AnySignature,\n KeylessPublicKey,\n KeylessSignature,\n Secp256k1PublicKey,\n FederatedKeylessPublicKey,\n MultiKey,\n MultiKeySignature,\n} from \"../../core/crypto\";\nimport { Ed25519PublicKey, Ed25519Signature } from \"../../core/crypto/ed25519\";\nimport { getInfo } from \"../../internal/account\";\nimport { getLedgerInfo } from \"../../internal/general\";\nimport { getGasPriceEstimation } from \"../../internal/transaction\";\nimport { NetworkToChainId } from \"../../utils/apiEndpoints\";\nimport { DEFAULT_MAX_GAS_AMOUNT, DEFAULT_TXN_EXP_SEC_FROM_NOW } from \"../../utils/const\";\nimport { normalizeBundle } from \"../../utils/normalizeBundle\";\nimport {\n AccountAuthenticator,\n AccountAuthenticatorEd25519,\n AccountAuthenticatorMultiEd25519,\n AccountAuthenticatorMultiKey,\n AccountAuthenticatorNoAccountAuthenticator,\n AccountAuthenticatorSingleKey,\n} from \"../authenticator/account\";\nimport {\n TransactionAuthenticator,\n TransactionAuthenticatorEd25519,\n TransactionAuthenticatorFeePayer,\n TransactionAuthenticatorMultiAgent,\n TransactionAuthenticatorMultiEd25519,\n TransactionAuthenticatorSingleSender,\n} from \"../authenticator/transaction\";\nimport {\n ChainId,\n EntryFunction,\n FeePayerRawTransaction,\n MultiAgentRawTransaction,\n MultiSig,\n MultiSigTransactionPayload,\n RawTransaction,\n Script,\n TransactionPayloadEntryFunction,\n TransactionPayloadMultiSig,\n TransactionPayloadScript,\n} from \"../instances\";\nimport { SignedTransaction } from \"../instances/signedTransaction\";\nimport {\n AnyRawTransaction,\n AnyTransactionPayloadInstance,\n EntryFunctionArgumentTypes,\n InputGenerateMultiAgentRawTransactionArgs,\n InputGenerateRawTransactionArgs,\n InputGenerateSingleSignerRawTransactionArgs,\n InputGenerateTransactionOptions,\n InputScriptData,\n InputSimulateTransactionData,\n InputMultiSigDataWithRemoteABI,\n InputEntryFunctionDataWithRemoteABI,\n InputGenerateTransactionPayloadDataWithRemoteABI,\n InputSubmitTransactionData,\n InputGenerateTransactionPayloadDataWithABI,\n InputEntryFunctionDataWithABI,\n InputMultiSigDataWithABI,\n InputViewFunctionDataWithRemoteABI,\n InputViewFunctionDataWithABI,\n FunctionABI,\n} from \"../types\";\nimport { convertArgument, fetchEntryFunctionAbi, fetchViewFunctionAbi, standardizeTypeTags } from \"./remoteAbi\";\nimport { memoizeAsync } from \"../../utils/memoize\";\nimport { isScriptDataInput } from \"./helpers\";\nimport { SimpleTransaction } from \"../instances/simpleTransaction\";\nimport { MultiAgentTransaction } from \"../instances/multiAgentTransaction\";\nimport { getFunctionParts } from \"../../utils/helpers\";\n\n/**\n * Builds a transaction payload based on the provided arguments and returns a transaction payload.\n * This function uses the RemoteABI by default, but can also utilize a specified ABI.\n * When we call our `generateTransactionPayload` function with the relevant type properties,\n * Typescript can infer the return type based on the appropriate function overload.\n * @param args - The input data for generating the transaction payload.\n * @param args.function - The function to be called, specified in the format \"moduleAddress::moduleName::functionName\".\n * @param args.functionArguments - The arguments to pass to the function.\n * @param args.typeArguments - The type arguments for the function.\n * @param args.aptosConfig - The configuration settings for Aptos.\n * @param args.abi - The ABI to use for the transaction, if not using the RemoteABI.\n *\n * @returns TransactionPayload - The generated transaction payload, which can be of type TransactionPayloadScript,\n * TransactionPayloadMultiSig, or TransactionPayloadEntryFunction.\n * @group Implementation\n * @category Transactions\n */\nexport async function generateTransactionPayload(args: InputScriptData): Promise<TransactionPayloadScript>;\n/**\n * @group Implementation\n * @category Transactions\n */\nexport async function generateTransactionPayload(\n args: InputEntryFunctionDataWithRemoteABI,\n): Promise<TransactionPayloadEntryFunction>;\n/**\n * @group Implementation\n * @category Transactions\n */\nexport async function generateTransactionPayload(\n args: InputMultiSigDataWithRemoteABI,\n): Promise<TransactionPayloadMultiSig>;\n\n/**\n * Builds a transaction payload based on the data argument and returns\n * a transaction payload - TransactionPayloadScript | TransactionPayloadMultiSig | TransactionPayloadEntryFunction\n *\n * This uses the RemoteABI by default, and the remote ABI can be skipped by using generateTransactionPayloadWithABI\n *\n * @param args.data GenerateTransactionPayloadData\n *\n * @return TransactionPayload\n * @group Implementation\n * @category Transactions\n */\nexport async function generateTransactionPayload(\n args: InputGenerateTransactionPayloadDataWithRemoteABI,\n): Promise<AnyTransactionPayloadInstance> {\n if (isScriptDataInput(args)) {\n return generateTransactionPayloadScript(args);\n }\n const { moduleAddress, moduleName, functionName } = getFunctionParts(args.function);\n\n const functionAbi = await fetchAbi({\n key: \"entry-function\",\n moduleAddress,\n moduleName,\n functionName,\n aptosConfig: args.aptosConfig,\n abi: args.abi,\n fetch: fetchEntryFunctionAbi,\n });\n\n // Fill in the ABI\n return generateTransactionPayloadWithABI({ ...args, abi: functionAbi });\n}\n\n/**\n * Generates a transaction payload using the provided ABI and function details.\n * This function helps create a properly structured transaction payload for executing a specific function on a module.\n *\n * @param args - The input data required to generate the transaction payload.\n * @param args.abi - The ABI of the function to be executed.\n * @param args.function - The fully qualified name of the function in the format `moduleAddress::moduleName::functionName`.\n * @param args.typeArguments - An array of type arguments that correspond to the function's type parameters.\n * @param args.functionArguments - An array of arguments to be passed to the function.\n * @param args.multisigAddress - (Optional) The address for a multisig transaction if applicable.\n *\n * @throws Error if the type argument count does not match the ABI or if the number of function arguments is incorrect.\n * @group Implementation\n * @category Transactions\n */\nexport function generateTransactionPayloadWithABI(args: InputEntryFunctionDataWithABI): TransactionPayloadEntryFunction;\n/**\n * @group Implementation\n * @category Transactions\n */\nexport function generateTransactionPayloadWithABI(args: InputMultiSigDataWithABI): TransactionPayloadMultiSig;\n/**\n * @group Implementation\n * @category Transactions\n */\nexport function generateTransactionPayloadWithABI(\n args: InputGenerateTransactionPayloadDataWithABI,\n): AnyTransactionPayloadInstance {\n const functionAbi = args.abi;\n const { moduleAddress, moduleName, functionName } = getFunctionParts(args.function);\n\n // Ensure that all type arguments are typed properly\n const typeArguments = standardizeTypeTags(args.typeArguments);\n\n // Check the type argument count against the ABI\n if (typeArguments.length !== functionAbi.typeParameters.length) {\n throw new Error(\n `Type argument count mismatch, expected ${functionAbi.typeParameters.length}, received ${typeArguments.length}`,\n );\n }\n\n // Check all BCS types, and convert any non-BCS types\n const functionArguments: Array<EntryFunctionArgumentTypes> = args.functionArguments.map((arg, i) =>\n /**\n * Converts the argument for a specified function using its ABI and type arguments.\n * This function helps ensure that the correct number of arguments is provided for the function call.\n *\n * @param args - The arguments for the function call.\n * @param args.function - The specific function to be invoked.\n * @param functionAbi - The ABI (Application Binary Interface) of the function, which includes parameter details.\n * @param arg - The argument to be converted.\n * @param i - The index of the argument in the function call.\n * @param typeArguments - Additional type arguments that may be required for the conversion.\n * @group Implementation\n * @category Transactions\n */\n // TODO: Fix JSDoc\n convertArgument(args.function, functionAbi, arg, i, typeArguments),\n );\n\n // Check that all arguments are accounted for\n if (functionArguments.length !== functionAbi.parameters.length) {\n throw new Error(\n // eslint-disable-next-line max-len\n `Too few arguments for '${moduleAddress}::${moduleName}::${functionName}', expected ${functionAbi.parameters.length} but got ${functionArguments.length}`,\n );\n }\n\n // Generate entry function payload\n const entryFunctionPayload = EntryFunction.build(\n `${moduleAddress}::${moduleName}`,\n functionName,\n typeArguments,\n functionArguments,\n );\n\n // Send it as multi sig if it's a multisig payload\n if (\"multisigAddress\" in args) {\n const multisigAddress = AccountAddress.from(args.multisigAddress);\n return new TransactionPayloadMultiSig(\n new MultiSig(multisigAddress, new MultiSigTransactionPayload(entryFunctionPayload)),\n );\n }\n\n // Otherwise send as an entry function\n return new TransactionPayloadEntryFunction(entryFunctionPayload);\n}\n\n/**\n * Generates the payload for a view function call using the provided arguments.\n * This function helps in preparing the necessary data to interact with a specific view function on the blockchain.\n *\n * @param args - The input data required to generate the view function payload.\n * @param args.function - The function identifier in the format \"moduleAddress::moduleName::functionName\".\n * @param args.aptosConfig - Configuration settings for the Aptos client.\n * @param args.abi - The ABI (Application Binary Interface) of the module.\n *\n * @returns The generated payload for the view function call.\n * @group Implementation\n * @category Transactions\n */\nexport async function generateViewFunctionPayload(args: InputViewFunctionDataWithRemoteABI): Promise<EntryFunction> {\n const { moduleAddress, moduleName, functionName } = getFunctionParts(args.function);\n\n const functionAbi = await fetchAbi({\n key: \"view-function\",\n moduleAddress,\n moduleName,\n functionName,\n aptosConfig: args.aptosConfig,\n abi: args.abi,\n fetch: fetchViewFunctionAbi,\n });\n\n // Fill in the ABI\n return generateViewFunctionPayloadWithABI({ abi: functionAbi, ...args });\n}\n\n/**\n * Generates a payload for a view function call using the provided ABI and arguments.\n * This function ensures that the type arguments and function arguments are correctly formatted\n * and match the expected counts as defined in the ABI.\n *\n * @param args - The input data for generating the view function payload.\n * @param args.abi - The ABI of the function to be called.\n * @param args.function - The full name of the function in the format \"moduleAddress::moduleName::functionName\".\n * @param args.typeArguments - An array of type arguments to be used in the function call.\n * @param args.functionArguments - An array of arguments to be passed to the function.\n *\n * @throws Error if the type argument count does not match the ABI or if the function arguments\n * do not match the expected parameters defined in the ABI.\n * @group Implementation\n * @category Transactions\n */\nexport function generateViewFunctionPayloadWithABI(args: InputViewFunctionDataWithABI): EntryFunction {\n const functionAbi = args.abi;\n const { moduleAddress, moduleName, functionName } = getFunctionParts(args.function);\n\n // Ensure that all type arguments are typed properly\n const typeArguments = standardizeTypeTags(args.typeArguments);\n\n // Check the type argument count against the ABI\n if (typeArguments.length !== functionAbi.typeParameters.length) {\n throw new Error(\n `Type argument count mismatch, expected ${functionAbi.typeParameters.length}, received ${typeArguments.length}`,\n );\n }\n\n // Check all BCS types, and convert any non-BCS types\n const functionArguments: Array<EntryFunctionArgumentTypes> =\n args?.functionArguments?.map((arg, i) => convertArgument(args.function, functionAbi, arg, i, typeArguments)) ?? [];\n\n // Check that all arguments are accounted for\n if (functionArguments.length !== functionAbi.parameters.length) {\n throw new Error(\n // eslint-disable-next-line max-len\n `Too few arguments for '${moduleAddress}::${moduleName}::${functionName}', expected ${functionAbi.parameters.length} but got ${functionArguments.length}`,\n );\n }\n\n // Generate entry function payload\n return EntryFunction.build(`${moduleAddress}::${moduleName}`, functionName, typeArguments, functionArguments);\n}\n\n/**\n * Generates a transaction payload script based on the provided input data.\n * This function helps in creating a structured script for transaction processing.\n *\n * @param args - The input data required to generate the transaction payload script.\n * @param args.bytecode - The bytecode to be converted into a Uint8Array.\n * @param args.typeArguments - The type arguments that will be standardized.\n * @param args.functionArguments - The arguments for the function being called.\n * @returns A new instance of TransactionPayloadScript.\n * @group Implementation\n * @category Transactions\n */\nfunction generateTransactionPayloadScript(args: InputScriptData) {\n return new TransactionPayloadScript(\n new Script(\n Hex.fromHexInput(args.bytecode).toUint8Array(),\n standardizeTypeTags(args.typeArguments),\n args.functionArguments,\n ),\n );\n}\n\n/**\n * Generates a raw transaction that can be sent to the Aptos network.\n *\n * @param args - The arguments for generating the raw transaction.\n * @param args.aptosConfig - The configuration for the Aptos network.\n * @param args.sender - The transaction's sender account address as a hex input.\n * @param args.payload - The transaction payload, which can be created using generateTransactionPayload().\n * @param args.options - Optional parameters for transaction generation.\n * @param args.feePayerAddress - The address of the fee payer for sponsored transactions.\n *\n * @returns RawTransaction - The generated raw transaction.\n * @group Implementation\n * @category Transactions\n */\nexport async function generateRawTransaction(args: {\n aptosConfig: AptosConfig;\n sender: AccountAddressInput;\n payload: AnyTransactionPayloadInstance;\n options?: InputGenerateTransactionOptions;\n feePayerAddress?: AccountAddressInput;\n}): Promise<RawTransaction> {\n const { aptosConfig, sender, payload, options, feePayerAddress } = args;\n\n const getChainId = async () => {\n if (NetworkToChainId[aptosConfig.network]) {\n return { chainId: NetworkToChainId[aptosConfig.network] };\n }\n const info = await getLedgerInfo({ aptosConfig });\n return { chainId: info.chain_id };\n };\n\n const getGasUnitPrice = async () => {\n if (options?.gasUnitPrice) {\n return { gasEstimate: options.gasUnitPrice };\n }\n const estimation = await getGasPriceEstimation({ aptosConfig });\n return { gasEstimate: estimation.gas_estimate };\n };\n\n const getSequenceNumberForAny = async () => {\n const getSequenceNumber = async () => {\n if (options?.accountSequenceNumber !== undefined) {\n return options.accountSequenceNumber;\n }\n\n return (await getInfo({ aptosConfig, accountAddress: sender })).sequence_number;\n };\n\n /**\n * Check if is sponsored transaction to honor AIP-52\n * {@link https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-52.md}\n * @group Implementation\n * @category Transactions\n */\n if (feePayerAddress && AccountAddress.from(feePayerAddress).equals(AccountAddress.ZERO)) {\n // Handle sponsored transaction generation with the option that\n // the main signer has not been created on chain\n try {\n // Check if main signer has been created on chain, if not assign sequence number 0\n return await getSequenceNumber();\n } catch (e: any) {\n return 0;\n }\n } else {\n return getSequenceNumber();\n }\n };\n const [{ chainId }, { gasEstimate }, sequenceNumber] = await Promise.all([\n getChainId(),\n getGasUnitPrice(),\n getSequenceNumberForAny(),\n ]);\n\n const { maxGasAmount, gasUnitPrice, expireTimestamp } = {\n maxGasAmount: options?.maxGasAmount ? BigInt(options.maxGasAmount) : BigInt(DEFAULT_MAX_GAS_AMOUNT),\n gasUnitPrice: options?.gasUnitPrice ?? BigInt(gasEstimate),\n expireTimestamp: options?.expireTimestamp ?? BigInt(Math.floor(Date.now() / 1000) + DEFAULT_TXN_EXP_SEC_FROM_NOW),\n };\n\n return new RawTransaction(\n AccountAddress.from(sender),\n BigInt(sequenceNumber),\n payload,\n BigInt(maxGasAmount),\n BigInt(gasUnitPrice),\n BigInt(expireTimestamp),\n new ChainId(chainId),\n );\n}\n\n/**\n * Generates a transaction based on the provided arguments.\n * This function can create both simple and multi-agent transactions, allowing for flexible transaction handling.\n *\n * @param args - The input arguments for generating the transaction.\n * @param args.aptosConfig - The configuration settings for Aptos.\n * @param args.sender - The transaction's sender account address as a hex input.\n * @param args.payload - The transaction payload, which can be created using `generateTransactionPayload()`.\n * @param args.options - Optional. Transaction options object.\n * @param args.secondarySignerAddresses - Optional. An array of addresses for additional signers in a multi-signature transaction.\n * @param args.feePayerAddress - Optional. The address of the fee payer for sponsored transactions.\n * @returns An instance of a transaction, which may include secondary signer addresses and a fee payer address.\n * @group Implementation\n * @category Transactions\n */\nexport async function buildTransaction(args: InputGenerateSingleSignerRawTransactionArgs): Promise<SimpleTransaction>;\n/**\n * @group Implementation\n * @category Transactions\n */\nexport async function buildTransaction(args: InputGenerateMultiAgentRawTransactionArgs): Promise<MultiAgentTransaction>;\n\n/**\n * Generates a transaction based on the provided arguments\n *\n * Note: we can start with one function to support all different payload/transaction types,\n * and if to complex to use, we could have function for each type\n *\n * @param args.aptosConfig AptosConfig\n * @param args.sender The transaction's sender account address as a hex input\n * @param args.payload The transaction payload - can create by using generateTransactionPayload()\n * @param args.options optional. Transaction options object\n * @param args.secondarySignerAddresses optional. For when want to create a multi signers transaction\n * @param args.feePayerAddress optional. For when want to create a fee payer (aka sponsored) transaction\n *\n * @return An instance of a RawTransaction, plus optional secondary/fee payer addresses\n * ```\n * {\n * rawTransaction: RawTransaction,\n * secondarySignerAddresses?: Array<AccountAddress>,\n * feePayerAddress?: AccountAddress\n * }\n * ```\n * @group Implementation\n * @category Transactions\n */\nexport async function buildTransaction(args: InputGenerateRawTransactionArgs): Promise<AnyRawTransaction> {\n const { aptosConfig, sender, payload, options, feePayerAddress } = args;\n // generate raw transaction\n const rawTxn = await generateRawTransaction({\n aptosConfig,\n sender,\n payload,\n options,\n feePayerAddress,\n });\n\n // if multi agent transaction\n if (\"secondarySignerAddresses\" in args) {\n const signers: Array<AccountAddress> =\n args.secondarySignerAddresses?.map((signer) => AccountAddress.from(signer)) ?? [];\n\n return new MultiAgentTransaction(\n rawTxn,\n signers,\n args.feePayerAddress ? AccountAddress.from(args.feePayerAddress) : undefined,\n );\n }\n // return the raw transaction\n return new SimpleTransaction(rawTxn, args.feePayerAddress ? AccountAddress.from(args.feePayerAddress) : undefined);\n}\n\n/**\n * Generate a signed transaction for simulation before submitting it to the chain.\n * This function helps in preparing a transaction that can be simulated, allowing users to verify its validity and expected behavior.\n *\n * @param args - The input data required to generate the signed transaction for simulation.\n * @param args.transaction - An Aptos transaction type to sign.\n * @param args.signerPublicKey - The public key of the signer.\n * @param args.secondarySignersPublicKeys - Optional. The public keys of secondary signers if it is a multi-signer transaction.\n * @param args.feePayerPublicKey - Optional. The public key of the fee payer in a sponsored transaction.\n * @param args.options - Optional. Additional options for simulating the transaction.\n *\n * @returns A signed serialized transaction that can be simulated.\n * @group Implementation\n * @category Transactions\n */\nexport function generateSignedTransactionForSimulation(args: InputSimulateTransactionData): Uint8Array {\n const { signerPublicKey, transaction, secondarySignersPublicKeys, feePayerPublicKey } = args;\n\n const accountAuthenticator = getAuthenticatorForSimulation(signerPublicKey);\n\n // fee payer transaction\n if (transaction.feePayerAddress) {\n const transactionToSign = new FeePayerRawTransaction(\n transaction.rawTransaction,\n transaction.secondarySignerAddresses ?? [],\n transaction.feePayerAddress,\n );\n let secondaryAccountAuthenticators: Array<AccountAuthenticator> = [];\n if (transaction.secondarySignerAddresses) {\n if (secondarySignersPublicKeys) {\n secondaryAccountAuthenticators = secondarySignersPublicKeys.map((publicKey) =>\n getAuthenticatorForSimulation(publicKey),\n );\n } else {\n secondaryAccountAuthenticators = Array.from({ length: transaction.secondarySignerAddresses.length }, () =>\n getAuthenticatorForSimulation(undefined),\n );\n }\n }\n const feePayerAuthenticator = getAuthenticatorForSimulation(feePayerPublicKey);\n\n const transactionAuthenticator = new TransactionAuthenticatorFeePayer(\n accountAuthenticator,\n transaction.secondarySignerAddresses ?? [],\n secondaryAccountAuthenticators,\n {\n address: transaction.feePayerAddress,\n authenticator: feePayerAuthenticator,\n },\n );\n return new SignedTransaction(transactionToSign.raw_txn, transactionAuthenticator).bcsToBytes();\n }\n\n // multi agent transaction\n if (transaction.secondarySignerAddresses) {\n const transactionToSign = new MultiAgentRawTransaction(\n transaction.rawTransaction,\n transaction.secondarySignerAddresses,\n );\n\n let secondaryAccountAuthenticators: Array<AccountAuthenticator> = [];\n\n if (secondarySignersPublicKeys) {\n secondaryAccountAuthenticators = secondarySignersPublicKeys.map((publicKey) =>\n getAuthenticatorForSimulation(publicKey),\n );\n } else {\n secondaryAccountAuthenticators = Array.from({ length: transaction.secondarySignerAddresses.length }, () =>\n getAuthenticatorForSimulation(undefined),\n );\n }\n\n const transactionAuthenticator = new TransactionAuthenticatorMultiAgent(\n accountAuthenticator,\n transaction.secondarySignerAddresses,\n secondaryAccountAuthenticators,\n );\n\n return new SignedTransaction(transactionToSign.raw_txn, transactionAuthenticator).bcsToBytes();\n }\n\n // single signer raw transaction\n let transactionAuthenticator;\n if (accountAuthenticator instanceof AccountAuthenticatorEd25519) {\n transactionAuthenticator = new TransactionAuthenticatorEd25519(\n accountAuthenticator.public_key,\n accountAuthenticator.signature,\n );\n } else if (\n accountAuthenticator instanceof AccountAuthenticatorSingleKey ||\n accountAuthenticator instanceof AccountAuthenticatorMultiKey\n ) {\n transactionAuthenticator = new TransactionAuthenticatorSingleSender(accountAuthenticator);\n } else if (accountAuthenticator instanceof AccountAuthenticatorNoAccountAuthenticator) {\n transactionAuthenticator = new TransactionAuthenticatorSingleSender(accountAuthenticator);\n } else {\n throw new Error(\"Invalid public key\");\n }\n return new SignedTransaction(transaction.rawTransaction, transactionAuthenticator).bcsToBytes();\n}\n\n/**\n * @group Implementation\n * @category Transactions\n */\nexport function getAuthenticatorForSimulation(publicKey?: PublicKey) {\n if (!publicKey) {\n return new AccountAuthenticatorNoAccountAuthenticator();\n }\n\n // Wrap the public key types below with AnyPublicKey as they are only support through single sender.\n // Learn more about AnyPublicKey here - https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-55.md\n const convertToAnyPublicKey =\n KeylessPublicKey.isInstance(publicKey) ||\n FederatedKeylessPublicKey.isInstance(publicKey) ||\n Secp256k1PublicKey.isInstance(publicKey);\n const accountPublicKey = convertToAnyPublicKey ? new AnyPublicKey(publicKey) : publicKey;\n\n // No need to for the signature to be matching in scheme. All that matters for simulations is that it's not valid\n const invalidSignature = new Ed25519Signature(new Uint8Array(64));\n\n if (Ed25519PublicKey.isInstance(accountPublicKey)) {\n return new AccountAuthenticatorEd25519(accountPublicKey, invalidSignature);\n }\n\n if (AnyPublicKey.isInstance(accountPublicKey)) {\n if (KeylessPublicKey.isInstance(accountPublicKey.publicKey)) {\n return new AccountAuthenticatorSingleKey(\n accountPublicKey,\n new AnySignature(KeylessSignature.getSimulationSignature()),\n );\n }\n return new AccountAuthenticatorSingleKey(accountPublicKey, new AnySignature(invalidSignature));\n }\n\n if (MultiKey.isInstance(accountPublicKey)) {\n return new AccountAuthenticatorMultiKey(\n accountPublicKey,\n new MultiKeySignature({\n signatures: accountPublicKey.publicKeys.map(() => new AnySignature(invalidSignature)),\n bitmap: accountPublicKey.createBitmap({\n bits: Array(accountPublicKey.publicKeys.length)\n .fill(0)\n .map((_, i) => i),\n }),\n }),\n );\n }\n\n throw new Error(\"Unsupported PublicKey used for simulations\");\n}\n\n/**\n * Generate a signed transaction ready for submission to the blockchain.\n * This function prepares the transaction by authenticating the sender and any additional signers based on the provided arguments.\n *\n * @param args - The input data required to generate the signed transaction.\n * @param args.transaction - An Aptos transaction type containing the details of the transaction.\n * @param args.senderAuthenticator - The account authenticator of the transaction sender.\n * @param args.feePayerAuthenticator - The authenticator for the fee payer, required if the transaction has a fee payer address.\n * @param args.additionalSignersAuthenticators - Optional authenticators for additional signers in a multi-signer transaction.\n *\n * @returns A Uint8Array representing the signed transaction in bytes.\n *\n * @throws Error if the feePayerAuthenticator is not provided for a fee payer transaction.\n * @throws Error if additionalSignersAuthenticators are not provided for a multi-signer transaction.\n * @group Implementation\n * @category Transactions\n */\nexport function generateSignedTransaction(args: InputSubmitTransactionData): Uint8Array {\n const { transaction, feePayerAuthenticator, additionalSignersAuthenticators } = args;\n const senderAuthenticator = normalizeBundle(AccountAuthenticator, args.senderAuthenticator);\n\n let txnAuthenticator: TransactionAuthenticator;\n if (transaction.feePayerAddress) {\n if (!feePayerAuthenticator) {\n throw new Error(\"Must provide a feePayerAuthenticator argument to generate a signed fee payer transaction\");\n }\n txnAuthenticator = new TransactionAuthenticatorFeePayer(\n senderAuthenticator,\n transaction.secondarySignerAddresses ?? [],\n additionalSignersAuthenticators ?? [],\n {\n address: transaction.feePayerAddress,\n authenticator: feePayerAuthenticator,\n },\n );\n } else if (transaction.secondarySignerAddresses) {\n if (!additionalSignersAuthenticators) {\n throw new Error(\n \"Must provide a additionalSignersAuthenticators argument to generate a signed multi agent transaction\",\n );\n }\n txnAuthenticator = new TransactionAuthenticatorMultiAgent(\n senderAuthenticator,\n transaction.secondarySignerAddresses,\n additionalSignersAuthenticators,\n );\n } else if (senderAuthenticator instanceof AccountAuthenticatorEd25519) {\n txnAuthenticator = new TransactionAuthenticatorEd25519(\n senderAuthenticator.public_key,\n senderAuthenticator.signature,\n );\n } else if (senderAuthenticator instanceof AccountAuthenticatorMultiEd25519) {\n txnAuthenticator = new TransactionAuthenticatorMultiEd25519(\n senderAuthenticator.public_key,\n senderAuthenticator.signature,\n );\n } else {\n txnAuthenticator = new TransactionAuthenticatorSingleSender(senderAuthenticator);\n }\n\n return new SignedTransaction(transaction.rawTransaction, txnAuthenticator).bcsToBytes();\n}\n\n/**\n * Hashes the set of values using a SHA-3 256 hash algorithm.\n * @param input - An array of UTF-8 strings or Uint8Array byte arrays to be hashed.\n * @group Implementation\n * @category Transactions\n */\nexport function hashValues(input: (Uint8Array | string)[]): Uint8Array {\n const hash = sha3Hash.create();\n for (const item of input) {\n hash.update(item);\n }\n return hash.digest();\n}\n\n/**\n * The domain separated prefix for hashing transactions\n * @group Implementation\n * @category Transactions\n */\nconst TRANSACTION_PREFIX = hashValues([\"APTOS::Transaction\"]);\n\n/**\n * Generates a user transaction hash for the provided transaction payload, which must already have an authenticator.\n * This function helps ensure the integrity and uniqueness of the transaction by producing a hash based on the signed transaction data.\n *\n * @param args - The input data required to submit the transaction.\n * @param args.authenticator - The authenticator for the transaction.\n * @param args.payload - The payload containing the transaction details.\n * @param args.sender - The address of the sender initiating the transaction.\n * @param args.sequenceNumber - The sequence number of the transaction for the sender.\n * @group Implementation\n * @category Transactions\n */\nexport function generateUserTransactionHash(args: InputSubmitTransactionData): string {\n const signedTransaction = generateSignedTransaction(args);\n\n // Transaction signature is defined as, the domain separated prefix based on struct (Transaction)\n // Then followed by the type of the transaction for the enum, UserTransaction is 0\n // Then followed by BCS encoded bytes of the signed transaction\n return new Hex(hashValues([TRANSACTION_PREFIX, new Uint8Array([0]), signedTransaction])).toString();\n}\n\n/**\n * Fetches and caches ABIs while allowing for pass-through on provided ABIs.\n *\n * @param key - A unique identifier for the cached ABI.\n * @param moduleAddress - The address of the module from which to fetch the ABI.\n * @param moduleName - The name of the module containing the function.\n * @param functionName - The name of the function whose ABI is being fetched.\n * @param aptosConfig - Configuration settings for Aptos.\n * @param abi - An optional ABI to use if already available.\n * @param fetch - A function to fetch the ABI if it is not provided.\n * @group Implementation\n * @category Transactions\n */\nasync function fetchAbi<T extends FunctionABI>({\n key,\n moduleAddress,\n moduleName,\n functionName,\n aptosConfig,\n abi,\n fetch,\n}: {\n key: string;\n moduleAddress: string;\n moduleName: string;\n functionName: string;\n aptosConfig: AptosConfig;\n abi?: T;\n fetch: (moduleAddress: string, moduleName: string, functionName: string, aptosConfig: AptosConfig) => Promise<T>;\n}): Promise<T> {\n if (abi !== undefined) {\n return abi;\n }\n\n // We fetch the entry function ABI, and then pretend that we already had the ABI\n return memoizeAsync(\n async () => fetch(moduleAddress, moduleName, functionName, aptosConfig),\n `${key}-${aptosConfig.network}-${moduleAddress}-${moduleName}-${functionName}`,\n 1000 * 60 * 5, // 5 minutes\n )();\n}\n"],"mappings":"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","names":["sha3Hash","generateTransactionPayload","args","isScriptDataInput","generateTransactionPayloadScript","moduleAddress","moduleName","functionName","getFunctionParts","functionAbi","fetchAbi","fetchEntryFunctionAbi","generateTransactionPayloadWithABI","typeArguments","standardizeTypeTags","functionArguments","arg","i","convertArgument","entryFunctionPayload","EntryFunction","multisigAddress","AccountAddress","TransactionPayloadMultiSig","MultiSig","MultiSigTransactionPayload","TransactionPayloadEntryFunction","generateViewFunctionPayload","fetchViewFunctionAbi","generateViewFunctionPayloadWithABI","TransactionPayloadScript","Script","Hex","generateRawTransaction","aptosConfig","sender","payload","options","feePayerAddress","getChainId","NetworkToChainId","getLedgerInfo","getGasUnitPrice","getGasPriceEstimation","getSequenceNumberForAny","getSequenceNumber","getInfo","chainId","gasEstimate","sequenceNumber","maxGasAmount","gasUnitPrice","expireTimestamp","RawTransaction","ChainId","buildTransaction","rawTxn","signers","signer","MultiAgentTransaction","SimpleTransaction","generateSignedTransactionForSimulation","signerPublicKey","transaction","secondarySignersPublicKeys","feePayerPublicKey","accountAuthenticator","getAuthenticatorForSimulation","transactionToSign","FeePayerRawTransaction","secondaryAccountAuthenticators","publicKey","feePayerAuthenticator","transactionAuthenticator","TransactionAuthenticatorFeePayer","SignedTransaction","MultiAgentRawTransaction","TransactionAuthenticatorMultiAgent","AccountAuthenticatorEd25519","TransactionAuthenticatorEd25519","AccountAuthenticatorSingleKey","AccountAuthenticatorMultiKey","TransactionAuthenticatorSingleSender","AccountAuthenticatorNoAccountAuthenticator","accountPublicKey","KeylessPublicKey","FederatedKeylessPublicKey","Secp256k1PublicKey","AnyPublicKey","invalidSignature","Ed25519Signature","Ed25519PublicKey","AnySignature","KeylessSignature","MultiKey","MultiKeySignature","_","generateSignedTransaction","additionalSignersAuthenticators","senderAuthenticator","normalizeBundle","AccountAuthenticator","txnAuthenticator","AccountAuthenticatorMultiEd25519","TransactionAuthenticatorMultiEd25519","hashValues","input","hash","sha3Hash","item","TRANSACTION_PREFIX","generateUserTransactionHash","signedTransaction","key","abi","fetch","memoizeAsync"]}
@@ -1,2 +1,2 @@
1
- import{b as t,d as a}from"./chunk-TM6IKHMX.mjs";import{a as l}from"./chunk-EMURYYVO.mjs";import{a as u}from"./chunk-WCMW2L3P.mjs";import{a as o}from"./chunk-XTOIL6MB.mjs";import{b as s}from"./chunk-STY74NUA.mjs";var c=class i extends l{constructor(e){super();let r=e.constructor.name;switch(r){case t.name:this.publicKey=e,this.variant=0;break;default:throw new Error(`Unsupported key for EphemeralPublicKey - ${r}`)}}verifySignature(e){let{message:r,signature:n}=e;return this.publicKey.verifySignature({message:r,signature:n.signature})}serialize(e){if(this.publicKey instanceof t)e.serializeU32AsUleb128(0),this.publicKey.serialize(e);else throw new Error("Unknown public key type")}static deserialize(e){let r=e.deserializeUleb128AsU32();switch(r){case 0:return new i(t.deserialize(e));default:throw new Error(`Unknown variant index for EphemeralPublicKey: ${r}`)}}static isPublicKey(e){return e instanceof i}},p=class i extends u{constructor(e){super();let r=e.constructor.name;switch(r){case a.name:this.signature=e;break;default:throw new Error(`Unsupported signature for EphemeralSignature - ${r}`)}}static fromHex(e){let r=s.fromHexInput(e),n=new o(r.toUint8Array());return i.deserialize(n)}serialize(e){if(this.signature instanceof a)e.serializeU32AsUleb128(0),this.signature.serialize(e);else throw new Error("Unknown signature type")}static deserialize(e){let r=e.deserializeUleb128AsU32();switch(r){case 0:return new i(a.deserialize(e));default:throw new Error(`Unknown variant index for EphemeralSignature: ${r}`)}}};export{c as a,p as b};
2
- //# sourceMappingURL=chunk-6PBMD2BQ.mjs.map
1
+ import{b as t,d as a}from"./chunk-7OUPEQRN.mjs";import{a as l}from"./chunk-H4YAL2IL.mjs";import{a as u}from"./chunk-A3VO773Q.mjs";import{a as o}from"./chunk-ZD2TY5N3.mjs";import{b as s}from"./chunk-VHY6ZATX.mjs";var c=class i extends l{constructor(e){super();let r=e.constructor.name;switch(r){case t.name:this.publicKey=e,this.variant=0;break;default:throw new Error(`Unsupported key for EphemeralPublicKey - ${r}`)}}verifySignature(e){let{message:r,signature:n}=e;return this.publicKey.verifySignature({message:r,signature:n.signature})}serialize(e){if(this.publicKey instanceof t)e.serializeU32AsUleb128(0),this.publicKey.serialize(e);else throw new Error("Unknown public key type")}static deserialize(e){let r=e.deserializeUleb128AsU32();switch(r){case 0:return new i(t.deserialize(e));default:throw new Error(`Unknown variant index for EphemeralPublicKey: ${r}`)}}static isPublicKey(e){return e instanceof i}},p=class i extends u{constructor(e){super();let r=e.constructor.name;switch(r){case a.name:this.signature=e;break;default:throw new Error(`Unsupported signature for EphemeralSignature - ${r}`)}}static fromHex(e){let r=s.fromHexInput(e),n=new o(r.toUint8Array());return i.deserialize(n)}serialize(e){if(this.signature instanceof a)e.serializeU32AsUleb128(0),this.signature.serialize(e);else throw new Error("Unknown signature type")}static deserialize(e){let r=e.deserializeUleb128AsU32();switch(r){case 0:return new i(a.deserialize(e));default:throw new Error(`Unknown variant index for EphemeralSignature: ${r}`)}}};export{c as a,p as b};
2
+ //# sourceMappingURL=chunk-PWGTRRSJ.mjs.map
@@ -1,2 +1,2 @@
1
- import{c as p}from"./chunk-7DPHPPMG.mjs";import{b as a}from"./chunk-ULHOJ2BE.mjs";import{b as s}from"./chunk-EBMEXURY.mjs";async function F(n){let{aptosConfig:e,payload:o,options:t}=n,i=await p({...o,aptosConfig:e}),r=new s;i.serialize(r);let u=r.toUint8Array(),{data:d}=await a({aptosConfig:e,path:"view",originMethod:"view",contentType:"application/x.aptos.view_function+bcs",params:{ledger_version:t?.ledgerVersion},body:u});return d}async function M(n){let{aptosConfig:e,payload:o,options:t}=n,{data:i}=await a({aptosConfig:e,originMethod:"viewJson",path:"view",params:{ledger_version:t?.ledgerVersion},body:{function:o.function,type_arguments:o.typeArguments??[],arguments:o.functionArguments??[]}});return i}export{F as a,M as b};
2
- //# sourceMappingURL=chunk-PWYJWTEM.mjs.map
1
+ import{c as p}from"./chunk-PIPDQFL2.mjs";import{c as a}from"./chunk-752TOOCA.mjs";import{b as s}from"./chunk-RXHER6EA.mjs";async function F(n){let{aptosConfig:e,payload:o,options:t}=n,i=await p({...o,aptosConfig:e}),r=new s;i.serialize(r);let u=r.toUint8Array(),{data:d}=await a({aptosConfig:e,path:"view",originMethod:"view",contentType:"application/x.aptos.view_function+bcs",params:{ledger_version:t?.ledgerVersion},body:u});return d}async function C(n){let{aptosConfig:e,payload:o,options:t}=n,{data:i}=await a({aptosConfig:e,originMethod:"viewJson",path:"view",params:{ledger_version:t?.ledgerVersion},body:{function:o.function,type_arguments:o.typeArguments??[],arguments:o.functionArguments??[]}});return i}export{F as a,C as b};
2
+ //# sourceMappingURL=chunk-PYY2RXFP.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/internal/view.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { LedgerVersionArg, MimeType, MoveValue } from \"../types\";\nimport { AptosConfig } from \"../api/aptosConfig\";\nimport {\n generateViewFunctionPayload,\n InputViewFunctionData,\n InputViewFunctionJsonData,\n ViewFunctionJsonPayload,\n} from \"../transactions\";\nimport { Serializer } from \"../bcs\";\nimport { postAptosFullNode } from \"../client\";\n\nexport async function view<T extends Array<MoveValue> = Array<MoveValue>>(args: {\n aptosConfig: AptosConfig;\n payload: InputViewFunctionData;\n options?: LedgerVersionArg;\n}): Promise<T> {\n const { aptosConfig, payload, options } = args;\n const viewFunctionPayload = await generateViewFunctionPayload({\n ...payload,\n aptosConfig,\n });\n\n const serializer = new Serializer();\n viewFunctionPayload.serialize(serializer);\n const bytes = serializer.toUint8Array();\n\n const { data } = await postAptosFullNode<Uint8Array, T>({\n aptosConfig,\n path: \"view\",\n originMethod: \"view\",\n contentType: MimeType.BCS_VIEW_FUNCTION,\n params: { ledger_version: options?.ledgerVersion },\n body: bytes,\n });\n\n return data;\n}\n\nexport async function viewJson<T extends Array<MoveValue> = Array<MoveValue>>(args: {\n aptosConfig: AptosConfig;\n payload: InputViewFunctionJsonData;\n options?: LedgerVersionArg;\n}): Promise<T> {\n const { aptosConfig, payload, options } = args;\n const { data } = await postAptosFullNode<ViewFunctionJsonPayload, T>({\n aptosConfig,\n originMethod: \"viewJson\",\n path: \"view\",\n params: { ledger_version: options?.ledgerVersion },\n body: {\n function: payload.function,\n type_arguments: payload.typeArguments ?? [],\n arguments: payload.functionArguments ?? [],\n },\n });\n\n return data;\n}\n"],"mappings":"2HAcA,eAAsBA,EAAoDC,EAI3D,CACb,GAAM,CAAE,YAAAC,EAAa,QAAAC,EAAS,QAAAC,CAAQ,EAAIH,EACpCI,EAAsB,MAAMC,EAA4B,CAC5D,GAAGH,EACH,YAAAD,CACF,CAAC,EAEKK,EAAa,IAAIC,EACvBH,EAAoB,UAAUE,CAAU,EACxC,IAAME,EAAQF,EAAW,aAAa,EAEhC,CAAE,KAAAG,CAAK,EAAI,MAAMC,EAAiC,CACtD,YAAAT,EACA,KAAM,OACN,aAAc,OACd,oDACA,OAAQ,CAAE,eAAgBE,GAAS,aAAc,EACjD,KAAMK,CACR,CAAC,EAED,OAAOC,CACT,CAEA,eAAsBE,EAAwDX,EAI/D,CACb,GAAM,CAAE,YAAAC,EAAa,QAAAC,EAAS,QAAAC,CAAQ,EAAIH,EACpC,CAAE,KAAAS,CAAK,EAAI,MAAMC,EAA8C,CACnE,YAAAT,EACA,aAAc,WACd,KAAM,OACN,OAAQ,CAAE,eAAgBE,GAAS,aAAc,EACjD,KAAM,CACJ,SAAUD,EAAQ,SAClB,eAAgBA,EAAQ,eAAiB,CAAC,EAC1C,UAAWA,EAAQ,mBAAqB,CAAC,CAC3C,CACF,CAAC,EAED,OAAOO,CACT","names":["view","args","aptosConfig","payload","options","viewFunctionPayload","generateViewFunctionPayload","serializer","Serializer","bytes","data","postAptosFullNode","viewJson"]}
@@ -0,0 +1,2 @@
1
+ import{a as u,b}from"./chunk-2TRQERBL.mjs";import{b as p}from"./chunk-H4YAL2IL.mjs";import{a as g}from"./chunk-A3VO773Q.mjs";import{a as m}from"./chunk-TTY5GFMN.mjs";function S(l){let e=l;return e-=e>>1&1431655765,e=(e&858993459)+(e>>2&858993459),(e+(e>>4)&252645135)*16843009>>24}var h=class extends p{constructor(e){super(),this.publicKeys=e.publicKeys}createBitmap(e){let{bits:t}=e,r=128,i=new Uint8Array([0,0,0,0]),a=new Set;return t.forEach((n,o)=>{if(o+1>this.publicKeys.length)throw new Error(`Signature index ${o+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),y=i[c];y|=r>>n%8,i[c]=y}),i}getIndex(e){let t=this.publicKeys.findIndex(r=>r.toString()===e.toString());if(t!==-1)return t;throw new Error(`Public key ${e} not found in multi key set ${this.publicKeys}`)}},f=class l extends h{constructor(e){let{publicKeys:t,signaturesRequired:r}=e;if(super({publicKeys:t}),r<1)throw new Error("The number of required signatures needs to be greater than 0");if(t.length<r)throw new Error(`Provided ${t.length} public keys is smaller than the ${r} required signatures`);this.publicKeys=t.map(i=>i instanceof u?i:new u(i)),this.signaturesRequired=r}verifySignature(e){throw new Error("not implemented")}authKey(){return m.fromSchemeAndBytes({scheme:3,input:this.toUint8Array()})}serialize(e){e.serializeVector(this.publicKeys),e.serializeU8(this.signaturesRequired)}static deserialize(e){let t=e.deserializeVector(u),r=e.deserializeU8();return new l({publicKeys:t,signaturesRequired:r})}getIndex(e){let t=e instanceof u?e:new u(e);return super.getIndex(t)}static isInstance(e){return"publicKeys"in e&&"signaturesRequired"in e}},s=class s extends g{constructor(e){super();let{signatures:t,bitmap:r}=e;if(t.length>s.MAX_SIGNATURES_SUPPORTED)throw new Error(`The number of signatures cannot be greater than ${s.MAX_SIGNATURES_SUPPORTED}`);if(this.signatures=t.map(a=>a instanceof b?a:new b(a)),!(r instanceof Uint8Array))this.bitmap=s.createBitmap({bits:r});else{if(r.length!==s.BITMAP_LEN)throw new Error(`"bitmap" length should be ${s.BITMAP_LEN}`);this.bitmap=r}let i=this.bitmap.reduce((a,n)=>a+S(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:t}=e,r=128,i=new Uint8Array([0,0,0,0]),a=new Set;return t.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 o=Math.floor(n/8),c=i[o];c|=r>>n%8,i[o]=c}),i}serialize(e){e.serializeVector(this.signatures),e.serializeBytes(this.bitmap)}static deserialize(e){let t=e.deserializeVector(b),r=e.deserializeBytes();return new s({signatures:t,bitmap:r})}};s.BITMAP_LEN=4,s.MAX_SIGNATURES_SUPPORTED=s.BITMAP_LEN*8;var d=s;export{h as a,f as b,d as c};
2
+ //# sourceMappingURL=chunk-QUJM5W4L.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/core/crypto/multiKey.ts"],"sourcesContent":["import { SigningScheme as AuthenticationKeyScheme } from \"../../types\";\nimport { Deserializer } from \"../../bcs/deserializer\";\nimport { Serializer } from \"../../bcs/serializer\";\nimport { AuthenticationKey } from \"../authenticationKey\";\nimport { AccountPublicKey, PublicKey, VerifySignatureArgs } from \"./publicKey\";\nimport { Signature } from \"./signature\";\nimport { AnyPublicKey, AnySignature } from \"./singleKey\";\n\n/**\n * Counts the number of set bits (1s) in a byte.\n * This function can help you determine the population count of a given byte value.\n *\n * @param byte - The byte value for which to count the number of set bits.\n * @group Implementation\n * @category Serialization\n */\n/* eslint-disable no-bitwise */\nfunction bitCount(byte: number) {\n let n = byte;\n n -= (n >> 1) & 0x55555555;\n n = (n & 0x33333333) + ((n >> 2) & 0x33333333);\n return (((n + (n >> 4)) & 0xf0f0f0f) * 0x1010101) >> 24;\n}\n/* eslint-enable no-bitwise */\n\nexport abstract class AbstractMultiKey extends AccountPublicKey {\n publicKeys: PublicKey[];\n\n constructor(args: { publicKeys: PublicKey[] }) {\n super();\n this.publicKeys = args.publicKeys;\n }\n\n /**\n * Create a bitmap that holds the mapping from the original public keys\n * to the signatures passed in\n *\n * @param args.bits array of the index mapping to the matching public keys\n * @returns Uint8array bit map\n * @group Implementation\n * @category Serialization\n */\n createBitmap(args: { bits: number[] }): Uint8Array {\n const { bits } = args;\n // Bits are read from left to right. e.g. 0b10000000 represents the first bit is set in one byte.\n // The decimal value of 0b10000000 is 128.\n const firstBitInByte = 128;\n const bitmap = new Uint8Array([0, 0, 0, 0]);\n\n // Check if duplicates exist in bits\n const dupCheckSet = new Set();\n\n bits.forEach((bit: number, idx: number) => {\n if (idx + 1 > this.publicKeys.length) {\n throw new Error(`Signature index ${idx + 1} is out of public keys range, ${this.publicKeys.length}.`);\n }\n\n if (dupCheckSet.has(bit)) {\n throw new Error(`Duplicate bit ${bit} detected.`);\n }\n\n dupCheckSet.add(bit);\n\n const byteOffset = Math.floor(bit / 8);\n\n let byte = bitmap[byteOffset];\n\n // eslint-disable-next-line no-bitwise\n byte |= firstBitInByte >> bit % 8;\n\n bitmap[byteOffset] = byte;\n });\n\n return bitmap;\n }\n\n /**\n * Get the index of the provided public key.\n *\n * This function retrieves the index of a specified public key within the MultiKey.\n * If the public key does not exist, it throws an error.\n *\n * @param publicKey - The public key to find the index for.\n * @returns The corresponding index of the public key, if it exists.\n * @throws Error - If the public key is not found in the MultiKey.\n * @group Implementation\n * @category Serialization\n */\n getIndex(publicKey: PublicKey): number {\n const index = this.publicKeys.findIndex((pk) => pk.toString() === publicKey.toString());\n\n if (index !== -1) {\n return index;\n }\n throw new Error(`Public key ${publicKey} not found in multi key set ${this.publicKeys}`);\n }\n}\n\n/**\n * Represents a multi-key authentication scheme for accounts, allowing multiple public keys\n * to be associated with a single account. This class enforces a minimum number of valid signatures\n * required to authorize actions, ensuring enhanced security for multi-agent accounts.\n *\n * The public keys of each individual agent can be any type of public key supported by Aptos.\n * Since [AIP-55](https://github.com/aptos-foundation/AIPs/pull/263), Aptos supports\n * `Legacy` and `Unified` authentication keys.\n * @group Implementation\n * @category Serialization\n */\nexport class MultiKey extends AbstractMultiKey {\n /**\n * List of any public keys\n * @group Implementation\n * @category Serialization\n */\n public readonly publicKeys: AnyPublicKey[];\n\n /**\n * The minimum number of valid signatures required, for the number of public keys specified\n * @group Implementation\n * @category Serialization\n */\n public readonly signaturesRequired: number;\n\n /**\n * Signature for a K-of-N multi-sig transaction.\n * This constructor initializes a multi-signature transaction with the provided signatures and bitmap.\n *\n * @param args An object containing the parameters for the multi-signature transaction.\n * @param args.signatures A list of signatures.\n * @param args.bitmap A bitmap represented as a Uint8Array or an array of numbers, where each bit indicates whether a\n * corresponding signature is present. A maximum of 32 signatures is supported, and the length of the bitmap must be 4 bytes.\n *\n * @throws Error if the number of signatures exceeds the maximum supported, if the bitmap length is incorrect, or if the number\n * of signatures does not match the bitmap.\n * @group Implementation\n * @category Serialization\n */\n // region Constructors\n constructor(args: { publicKeys: Array<PublicKey>; signaturesRequired: number }) {\n const { publicKeys, signaturesRequired } = args;\n super({ publicKeys });\n\n // Validate number of public keys is greater than signature required\n if (signaturesRequired < 1) {\n throw new Error(\"The number of required signatures needs to be greater than 0\");\n }\n\n // Validate number of public keys is greater than signature required\n if (publicKeys.length < signaturesRequired) {\n throw new Error(\n `Provided ${publicKeys.length} public keys is smaller than the ${signaturesRequired} required signatures`,\n );\n }\n\n // Make sure that all keys are normalized to the SingleKey authentication scheme\n this.publicKeys = publicKeys.map((publicKey) =>\n publicKey instanceof AnyPublicKey ? publicKey : new AnyPublicKey(publicKey),\n );\n\n this.signaturesRequired = signaturesRequired;\n }\n\n // endregion\n\n // region AccountPublicKey\n\n /**\n * Verifies the provided signature against the given message.\n * This function helps ensure the integrity and authenticity of the message by checking if the signature is valid.\n *\n * @param args - The arguments for verifying the signature.\n * @param args.message - The message that was signed.\n * @param args.signature - The signature to verify.\n * @group Implementation\n * @category Serialization\n */\n // eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars\n verifySignature(args: VerifySignatureArgs): boolean {\n throw new Error(\"not implemented\");\n }\n\n /**\n * Generates an authentication key based on the current instance's byte representation.\n * This key can be used for secure authentication processes within the system.\n *\n * @returns {AuthenticationKey} The generated authentication key.\n * @group Implementation\n * @category Serialization\n */\n authKey(): AuthenticationKey {\n return AuthenticationKey.fromSchemeAndBytes({\n scheme: AuthenticationKeyScheme.MultiKey,\n input: this.toUint8Array(),\n });\n }\n\n // endregion\n\n // region Serializable\n\n /**\n * Serializes the object by writing its signatures and bitmap to the provided serializer.\n * This allows the object to be converted into a format suitable for transmission or storage.\n *\n * @param serializer - The serializer instance used to perform the serialization.\n * @group Implementation\n * @category Serialization\n */\n serialize(serializer: Serializer): void {\n serializer.serializeVector(this.publicKeys);\n serializer.serializeU8(this.signaturesRequired);\n }\n\n /**\n * Deserializes a MultiKeySignature from the provided deserializer.\n * This function retrieves the signatures and bitmap necessary for creating a MultiKeySignature object.\n *\n * @param deserializer - The deserializer instance used to read the serialized data.\n * @group Implementation\n * @category Serialization\n */\n static deserialize(deserializer: Deserializer): MultiKey {\n const keys = deserializer.deserializeVector(AnyPublicKey);\n const signaturesRequired = deserializer.deserializeU8();\n\n return new MultiKey({ publicKeys: keys, signaturesRequired });\n }\n\n // endregion\n\n /**\n * Get the index of the provided public key.\n *\n * This function retrieves the index of a specified public key within the MultiKey.\n * If the public key does not exist, it throws an error.\n *\n * @param publicKey - The public key to find the index for.\n * @returns The corresponding index of the public key, if it exists.\n * @throws Error - If the public key is not found in the MultiKey.\n * @group Implementation\n */\n getIndex(publicKey: PublicKey): number {\n const anyPublicKey = publicKey instanceof AnyPublicKey ? publicKey : new AnyPublicKey(publicKey);\n return super.getIndex(anyPublicKey);\n }\n\n public static isInstance(value: PublicKey): value is MultiKey {\n return \"publicKeys\" in value && \"signaturesRequired\" in value;\n }\n}\n\n/**\n * Represents a multi-signature transaction using Ed25519 signatures.\n * This class allows for the creation and management of a K-of-N multi-signature scheme,\n * where a specified number of signatures are required to authorize a transaction.\n *\n * It includes functionality to validate the number of signatures against a bitmap,\n * which indicates which public keys have signed the transaction.\n * @group Implementation\n * @category Serialization\n */\nexport class MultiKeySignature extends Signature {\n /**\n * Number of bytes in the bitmap representing who signed the transaction (32-bits)\n * @group Implementation\n * @category Serialization\n */\n static BITMAP_LEN: number = 4;\n\n /**\n * Maximum number of Ed25519 signatures supported\n * @group Implementation\n * @category Serialization\n */\n static MAX_SIGNATURES_SUPPORTED = MultiKeySignature.BITMAP_LEN * 8;\n\n /**\n * The list of underlying Ed25519 signatures\n * @group Implementation\n * @category Serialization\n */\n public readonly signatures: AnySignature[];\n\n /**\n * 32-bit Bitmap representing who signed the transaction\n *\n * This is represented where each public key can be masked to determine whether the message was signed by that key.\n * @group Implementation\n * @category Serialization\n */\n public readonly bitmap: Uint8Array;\n\n /**\n * Signature for a K-of-N multi-sig transaction.\n *\n * @see {@link\n * https://aptos.dev/integration/creating-a-signed-transaction/#multisignature-transactions | Creating a Signed Transaction}\n *\n * @param args.signatures A list of signatures\n * @param args.bitmap 4 bytes, at most 32 signatures are supported. If Nth bit value is `1`, the Nth\n * signature should be provided in `signatures`. Bits are read from left to right\n * @group Implementation\n * @category Serialization\n */\n constructor(args: { signatures: Array<Signature | AnySignature>; bitmap: Uint8Array | number[] }) {\n super();\n const { signatures, bitmap } = args;\n\n if (signatures.length > MultiKeySignature.MAX_SIGNATURES_SUPPORTED) {\n throw new Error(`The number of signatures cannot be greater than ${MultiKeySignature.MAX_SIGNATURES_SUPPORTED}`);\n }\n\n // Make sure that all signatures are normalized to the SingleKey authentication scheme\n this.signatures = signatures.map((signature) =>\n signature instanceof AnySignature ? signature : new AnySignature(signature),\n );\n\n if (!(bitmap instanceof Uint8Array)) {\n this.bitmap = MultiKeySignature.createBitmap({ bits: bitmap });\n } else if (bitmap.length !== MultiKeySignature.BITMAP_LEN) {\n throw new Error(`\"bitmap\" length should be ${MultiKeySignature.BITMAP_LEN}`);\n } else {\n this.bitmap = bitmap;\n }\n\n const nSignatures = this.bitmap.reduce((acc, byte) => acc + bitCount(byte), 0);\n if (nSignatures !== this.signatures.length) {\n throw new Error(`Expecting ${nSignatures} signatures from the bitmap, but got ${this.signatures.length}`);\n }\n }\n\n /**\n * Helper method to create a bitmap out of the specified bit positions\n * @param args.bits The bitmap positions that should be set. A position starts at index 0.\n * Valid position should range between 0 and 31.\n * @example\n * Here's an example of valid `bits`\n * ```\n * [0, 2, 31]\n * ```\n * `[0, 2, 31]` means the 1st, 3rd and 32nd bits should be set in the bitmap.\n * The result bitmap should be 0b1010000000000000000000000000001\n *\n * @returns bitmap that is 32bit long\n * @group Implementation\n * @category Serialization\n */\n static createBitmap(args: { bits: number[] }): Uint8Array {\n const { bits } = args;\n // Bits are read from left to right. e.g. 0b10000000 represents the first bit is set in one byte.\n // The decimal value of 0b10000000 is 128.\n const firstBitInByte = 128;\n const bitmap = new Uint8Array([0, 0, 0, 0]);\n\n // Check if duplicates exist in bits\n const dupCheckSet = new Set();\n\n bits.forEach((bit: number) => {\n if (bit >= MultiKeySignature.MAX_SIGNATURES_SUPPORTED) {\n throw new Error(`Cannot have a signature larger than ${MultiKeySignature.MAX_SIGNATURES_SUPPORTED - 1}.`);\n }\n\n if (dupCheckSet.has(bit)) {\n throw new Error(\"Duplicate bits detected.\");\n }\n\n dupCheckSet.add(bit);\n\n const byteOffset = Math.floor(bit / 8);\n\n let byte = bitmap[byteOffset];\n\n // eslint-disable-next-line no-bitwise\n byte |= firstBitInByte >> bit % 8;\n\n bitmap[byteOffset] = byte;\n });\n\n return bitmap;\n }\n\n // region Serializable\n\n serialize(serializer: Serializer): void {\n // Note: we should not need to serialize the vector length, as it can be derived from the bitmap\n serializer.serializeVector(this.signatures);\n serializer.serializeBytes(this.bitmap);\n }\n\n static deserialize(deserializer: Deserializer): MultiKeySignature {\n const signatures = deserializer.deserializeVector(AnySignature);\n const bitmap = deserializer.deserializeBytes();\n return new MultiKeySignature({ signatures, bitmap });\n }\n\n // endregion\n}\n"],"mappings":"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","names":["bitCount","byte","n","AbstractMultiKey","AccountPublicKey","args","bits","firstBitInByte","bitmap","dupCheckSet","bit","idx","byteOffset","publicKey","index","pk","MultiKey","_MultiKey","publicKeys","signaturesRequired","AnyPublicKey","AuthenticationKey","serializer","deserializer","keys","anyPublicKey","value","_MultiKeySignature","Signature","signatures","signature","AnySignature","nSignatures","acc","MultiKeySignature"]}
@@ -1,2 +1,2 @@
1
- import{a as t,b as n,c as o,d as r}from"./chunk-HL2O3T57.mjs";import{a as s}from"./chunk-JF66JS2R.mjs";import{b as i}from"./chunk-Q4C4U6I4.mjs";var a=class{constructor(e){this.config=e}async getFungibleAssetMetadata(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),t({aptosConfig:this.config,...e})}async getFungibleAssetMetadataByAssetType(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),(await t({aptosConfig:this.config,options:{where:{asset_type:{_eq:e.assetType}}}}))[0]}async getFungibleAssetMetadataByCreatorAddress(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),await t({aptosConfig:this.config,options:{where:{creator_address:{_eq:i.from(e.creatorAddress).toStringLong()}}}})}async getFungibleAssetActivities(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),n({aptosConfig:this.config,...e})}async getCurrentFungibleAssetBalances(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),o({aptosConfig:this.config,...e})}async transferFungibleAsset(e){return r({aptosConfig:this.config,...e})}};export{a};
2
- //# sourceMappingURL=chunk-H4GZWYIG.mjs.map
1
+ import{a as t,b as n,c as o,d as r}from"./chunk-GU4MD5ST.mjs";import{a as s}from"./chunk-MFLHAVIW.mjs";import{b as i}from"./chunk-LQOSHBB7.mjs";var a=class{constructor(e){this.config=e}async getFungibleAssetMetadata(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),t({aptosConfig:this.config,...e})}async getFungibleAssetMetadataByAssetType(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),(await t({aptosConfig:this.config,options:{where:{asset_type:{_eq:e.assetType}}}}))[0]}async getFungibleAssetMetadataByCreatorAddress(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),await t({aptosConfig:this.config,options:{where:{creator_address:{_eq:i.from(e.creatorAddress).toStringLong()}}}})}async getFungibleAssetActivities(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),n({aptosConfig:this.config,...e})}async getCurrentFungibleAssetBalances(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),o({aptosConfig:this.config,...e})}async transferFungibleAsset(e){return r({aptosConfig:this.config,...e})}};export{a};
2
+ //# sourceMappingURL=chunk-QYJKCRVA.mjs.map
@@ -1,2 +1,2 @@
1
- var d=(e=>(e.JSON="application/json",e.BCS="application/x-bcs",e.BCS_SIGNED_TRANSACTION="application/x.aptos.signed_transaction+bcs",e.BCS_VIEW_FUNCTION="application/x.aptos.view_function+bcs",e))(d||{}),y=(t=>(t[t.Bool=0]="Bool",t[t.U8=1]="U8",t[t.U64=2]="U64",t[t.U128=3]="U128",t[t.Address=4]="Address",t[t.Signer=5]="Signer",t[t.Vector=6]="Vector",t[t.Struct=7]="Struct",t[t.U16=8]="U16",t[t.U32=9]="U32",t[t.U256=10]="U256",t[t.Reference=254]="Reference",t[t.Generic=255]="Generic",t))(y||{}),u=(r=>(r[r.U8=0]="U8",r[r.U64=1]="U64",r[r.U128=2]="U128",r[r.Address=3]="Address",r[r.U8Vector=4]="U8Vector",r[r.Bool=5]="Bool",r[r.U16=6]="U16",r[r.U32=7]="U32",r[r.U256=8]="U256",r[r.Serialized=9]="Serialized",r))(u||{}),c=(o=>(o[o.Script=0]="Script",o[o.EntryFunction=2]="EntryFunction",o[o.Multisig=3]="Multisig",o))(c||{}),l=(i=>(i[i.MultiAgentTransaction=0]="MultiAgentTransaction",i[i.FeePayerTransaction=1]="FeePayerTransaction",i))(l||{}),_=(n=>(n[n.Ed25519=0]="Ed25519",n[n.MultiEd25519=1]="MultiEd25519",n[n.MultiAgent=2]="MultiAgent",n[n.FeePayer=3]="FeePayer",n[n.SingleSender=4]="SingleSender",n))(_||{}),x=(p=>(p[p.Ed25519=0]="Ed25519",p[p.MultiEd25519=1]="MultiEd25519",p[p.SingleKey=2]="SingleKey",p[p.MultiKey=3]="MultiKey",p[p.NoAccountAuthenticator=4]="NoAccountAuthenticator",p[p.Abstraction=5]="Abstraction",p))(x||{}),h=(i=>(i.Ed25519="ed25519",i.Secp256k1="secp256k1",i))(h||{}),v=(e=>(e[e.Ed25519=0]="Ed25519",e[e.Secp256k1=1]="Secp256k1",e[e.Keyless=3]="Keyless",e[e.FederatedKeyless=4]="FederatedKeyless",e))(v||{}),R=(o=>(o[o.Ed25519=0]="Ed25519",o[o.Secp256k1=1]="Secp256k1",o[o.Keyless=3]="Keyless",o))(R||{}),M=(a=>(a[a.Ed25519=0]="Ed25519",a))(M||{}),m=(a=>(a[a.Ed25519=0]="Ed25519",a))(m||{}),b=(a=>(a[a.ZkProof=0]="ZkProof",a))(b||{}),k=(a=>(a[a.Groth16=0]="Groth16",a))(k||{}),S=(g=>(g.Pending="pending_transaction",g.User="user_transaction",g.Genesis="genesis_transaction",g.BlockMetadata="block_metadata_transaction",g.StateCheckpoint="state_checkpoint_transaction",g.Validator="validator_transaction",g.BlockEpilogue="block_epilogue_transaction",g))(S||{});function F(s){return s.type==="pending_transaction"}function I(s){return s.type==="user_transaction"}function B(s){return s.type==="genesis_transaction"}function G(s){return s.type==="block_metadata_transaction"}function O(s){return s.type==="state_checkpoint_transaction"}function P(s){return s.type==="validator_transaction"}function A(s){return s.type==="block_epilogue_transaction"}function N(s){return"signature"in s&&s.signature==="ed25519_signature"}function D(s){return"signature"in s&&s.signature==="secp256k1_ecdsa_signature"}function q(s){return s.type==="multi_agent_signature"}function H(s){return s.type==="fee_payer_signature"}function j(s){return s.type==="multi_ed25519_signature"}var f=(o=>(o.PRIVATE="private",o.PUBLIC="public",o.FRIEND="friend",o))(f||{}),C=(e=>(e.STORE="store",e.DROP="drop",e.KEY="key",e.COPY="copy",e))(C||{}),T=(i=>(i.VALIDATOR="validator",i.FULL_NODE="full_node",i))(T||{}),E=(e=>(e[e.Ed25519=0]="Ed25519",e[e.MultiEd25519=1]="MultiEd25519",e[e.SingleKey=2]="SingleKey",e[e.MultiKey=3]="MultiKey",e))(E||{}),U=(i=>(i[i.Ed25519=0]="Ed25519",i[i.Secp256k1Ecdsa=2]="Secp256k1Ecdsa",i))(U||{}),W=(n=>(n[n.DeriveAuid=251]="DeriveAuid",n[n.DeriveObjectAddressFromObject=252]="DeriveObjectAddressFromObject",n[n.DeriveObjectAddressFromGuid=253]="DeriveObjectAddressFromGuid",n[n.DeriveObjectAddressFromSeed=254]="DeriveObjectAddressFromSeed",n[n.DeriveResourceAccountAddress=255]="DeriveResourceAccountAddress",n))(W||{});export{d as a,y as b,u as c,c as d,l as e,_ as f,x as g,h,v as i,R as j,M as k,m as l,b as m,k as n,S as o,F as p,I as q,B as r,G as s,O as t,P as u,A as v,N as w,D as x,q as y,H as z,j as A,f as B,C,T as D,E,U as F,W as G};
2
- //# sourceMappingURL=chunk-X2CPDUOS.mjs.map
1
+ var d=(e=>(e.JSON="application/json",e.BCS="application/x-bcs",e.BCS_SIGNED_TRANSACTION="application/x.aptos.signed_transaction+bcs",e.BCS_VIEW_FUNCTION="application/x.aptos.view_function+bcs",e))(d||{}),y=(t=>(t[t.Bool=0]="Bool",t[t.U8=1]="U8",t[t.U64=2]="U64",t[t.U128=3]="U128",t[t.Address=4]="Address",t[t.Signer=5]="Signer",t[t.Vector=6]="Vector",t[t.Struct=7]="Struct",t[t.U16=8]="U16",t[t.U32=9]="U32",t[t.U256=10]="U256",t[t.Reference=254]="Reference",t[t.Generic=255]="Generic",t))(y||{}),u=(r=>(r[r.U8=0]="U8",r[r.U64=1]="U64",r[r.U128=2]="U128",r[r.Address=3]="Address",r[r.U8Vector=4]="U8Vector",r[r.Bool=5]="Bool",r[r.U16=6]="U16",r[r.U32=7]="U32",r[r.U256=8]="U256",r[r.Serialized=9]="Serialized",r))(u||{}),c=(o=>(o[o.Script=0]="Script",o[o.EntryFunction=2]="EntryFunction",o[o.Multisig=3]="Multisig",o))(c||{}),l=(i=>(i[i.MultiAgentTransaction=0]="MultiAgentTransaction",i[i.FeePayerTransaction=1]="FeePayerTransaction",i))(l||{}),_=(n=>(n[n.Ed25519=0]="Ed25519",n[n.MultiEd25519=1]="MultiEd25519",n[n.MultiAgent=2]="MultiAgent",n[n.FeePayer=3]="FeePayer",n[n.SingleSender=4]="SingleSender",n))(_||{}),x=(p=>(p[p.Ed25519=0]="Ed25519",p[p.MultiEd25519=1]="MultiEd25519",p[p.SingleKey=2]="SingleKey",p[p.MultiKey=3]="MultiKey",p[p.NoAccountAuthenticator=4]="NoAccountAuthenticator",p[p.Abstraction=5]="Abstraction",p))(x||{}),h=(i=>(i.Ed25519="ed25519",i.Secp256k1="secp256k1",i))(h||{}),v=(e=>(e[e.Ed25519=0]="Ed25519",e[e.Secp256k1=1]="Secp256k1",e[e.Keyless=3]="Keyless",e[e.FederatedKeyless=4]="FederatedKeyless",e))(v||{}),R=(o=>(o[o.Ed25519=0]="Ed25519",o[o.Secp256k1=1]="Secp256k1",o[o.Keyless=3]="Keyless",o))(R||{}),M=(a=>(a[a.Ed25519=0]="Ed25519",a))(M||{}),m=(a=>(a[a.Ed25519=0]="Ed25519",a))(m||{}),b=(a=>(a[a.ZkProof=0]="ZkProof",a))(b||{}),k=(a=>(a[a.Groth16=0]="Groth16",a))(k||{}),S=(g=>(g.Pending="pending_transaction",g.User="user_transaction",g.Genesis="genesis_transaction",g.BlockMetadata="block_metadata_transaction",g.StateCheckpoint="state_checkpoint_transaction",g.Validator="validator_transaction",g.BlockEpilogue="block_epilogue_transaction",g))(S||{});function F(s){return s.type==="pending_transaction"}function B(s){return s.type==="user_transaction"}function I(s){return s.type==="genesis_transaction"}function G(s){return s.type==="block_metadata_transaction"}function O(s){return s.type==="state_checkpoint_transaction"}function P(s){return s.type==="validator_transaction"}function A(s){return s.type==="block_epilogue_transaction"}function q(s){return"signature"in s&&s.signature==="ed25519_signature"}function N(s){return"signature"in s&&s.signature==="secp256k1_ecdsa_signature"}function D(s){return s.type==="multi_agent_signature"}function H(s){return s.type==="fee_payer_signature"}function j(s){return s.type==="multi_ed25519_signature"}var f=(o=>(o.PRIVATE="private",o.PUBLIC="public",o.FRIEND="friend",o))(f||{}),C=(e=>(e.STORE="store",e.DROP="drop",e.KEY="key",e.COPY="copy",e))(C||{}),T=(i=>(i.VALIDATOR="validator",i.FULL_NODE="full_node",i))(T||{}),E=(e=>(e[e.Ed25519=0]="Ed25519",e[e.MultiEd25519=1]="MultiEd25519",e[e.SingleKey=2]="SingleKey",e[e.MultiKey=3]="MultiKey",e))(E||{}),U=(i=>(i[i.Ed25519=0]="Ed25519",i[i.Secp256k1Ecdsa=2]="Secp256k1Ecdsa",i))(U||{}),W=(n=>(n[n.DeriveAuid=251]="DeriveAuid",n[n.DeriveObjectAddressFromObject=252]="DeriveObjectAddressFromObject",n[n.DeriveObjectAddressFromGuid=253]="DeriveObjectAddressFromGuid",n[n.DeriveObjectAddressFromSeed=254]="DeriveObjectAddressFromSeed",n[n.DeriveResourceAccountAddress=255]="DeriveResourceAccountAddress",n))(W||{});export{d as a,y as b,u as c,c as d,l as e,_ as f,x as g,h,v as i,R as j,M as k,m as l,b as m,k as n,S as o,F as p,B as q,I as r,G as s,O as t,P as u,A as v,q as w,N as x,D as y,H as z,j as A,f as B,C,T as D,E,U as F,W as G};
2
+ //# sourceMappingURL=chunk-R6QCPXQG.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/types/types.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Network } from \"../utils/apiEndpoints\";\nimport { OrderBy, TokenStandard } from \"./indexer\";\n\n/**\n * Different MIME types used for data interchange in transactions and responses.\n */\nexport enum MimeType {\n /**\n * JSON representation, used for transaction submission and accept type JSON output\n */\n JSON = \"application/json\",\n /**\n * BCS representation, used for accept type BCS output\n */\n BCS = \"application/x-bcs\",\n /**\n * BCS representation, used for transaction submission in BCS input\n */\n BCS_SIGNED_TRANSACTION = \"application/x.aptos.signed_transaction+bcs\",\n BCS_VIEW_FUNCTION = \"application/x.aptos.view_function+bcs\",\n}\n\n/**\n * Hexadecimal data input for functions, supporting both string and Uint8Array formats.\n */\nexport type HexInput = string | Uint8Array;\n\n/**\n * Variants of type tags used in the system, encompassing various data types and structures.\n * {@link https://github.com/aptos-labs/aptos-core/blob/main/third_party/move/move-core/types/src/language_storage.rs#L27}\n */\nexport enum TypeTagVariants {\n Bool = 0,\n U8 = 1,\n U64 = 2,\n U128 = 3,\n Address = 4,\n Signer = 5,\n Vector = 6,\n Struct = 7,\n U16 = 8,\n U32 = 9,\n U256 = 10,\n Reference = 254, // This is specifically a placeholder and does not represent a real type\n Generic = 255, // This is specifically a placeholder and does not represent a real type\n}\n\n/**\n * Variants of script transaction arguments used in Rust, encompassing various data types for transaction processing.\n * {@link https://github.com/aptos-labs/aptos-core/blob/main/third_party/move/move-core/types/src/transaction_argument.rs#L11}\n */\nexport enum ScriptTransactionArgumentVariants {\n U8 = 0,\n U64 = 1,\n U128 = 2,\n Address = 3,\n U8Vector = 4,\n Bool = 5,\n U16 = 6,\n U32 = 7,\n U256 = 8,\n Serialized = 9,\n}\n\n/**\n * The payload for various transaction types in the system.\n * {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/mod.rs#L478}\n */\nexport enum TransactionPayloadVariants {\n Script = 0,\n EntryFunction = 2,\n Multisig = 3,\n}\n\n/**\n * Variants of transactions used in the system.\n * {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/mod.rs#L440}\n */\nexport enum TransactionVariants {\n MultiAgentTransaction = 0,\n FeePayerTransaction = 1,\n}\n\n/**\n * Variants of transaction authenticators used in the system.\n * {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/authenticator.rs#L44}\n */\nexport enum TransactionAuthenticatorVariant {\n Ed25519 = 0,\n MultiEd25519 = 1,\n MultiAgent = 2,\n FeePayer = 3,\n SingleSender = 4,\n}\n\n/**\n * Variants of account authenticators used in transactions.\n * {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/authenticator.rs#L414}\n */\nexport enum AccountAuthenticatorVariant {\n Ed25519 = 0,\n MultiEd25519 = 1,\n SingleKey = 2,\n MultiKey = 3,\n NoAccountAuthenticator = 4,\n Abstraction = 5,\n}\n\n/**\n * Variants of private keys that can comply with the AIP-80 standard.\n * {@link https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-80.md}\n */\nexport enum PrivateKeyVariants {\n Ed25519 = \"ed25519\",\n Secp256k1 = \"secp256k1\",\n}\n\n/**\n * Variants of public keys used in cryptographic operations.\n */\nexport enum AnyPublicKeyVariant {\n Ed25519 = 0,\n Secp256k1 = 1,\n Keyless = 3,\n FederatedKeyless = 4,\n}\n\n/**\n * Variants of signature types used for cryptographic operations.\n */\nexport enum AnySignatureVariant {\n Ed25519 = 0,\n Secp256k1 = 1,\n Keyless = 3,\n}\n\n/**\n * Variants of ephemeral public keys used in cryptographic operations.\n */\nexport enum EphemeralPublicKeyVariant {\n Ed25519 = 0,\n}\n\n/**\n * Variants of ephemeral signatures used for secure communication.\n */\nexport enum EphemeralSignatureVariant {\n Ed25519 = 0,\n}\n\n/**\n * Variants of ephemeral certificates used in secure transactions.\n */\nexport enum EphemeralCertificateVariant {\n ZkProof = 0,\n}\n\n/**\n * Variants of zero-knowledge proofs used in cryptographic operations.\n */\nexport enum ZkpVariant {\n Groth16 = 0,\n}\n\n/**\n * BCS types\n */\nexport type Uint8 = number;\n\n/**\n * A 16-bit unsigned integer.\n */\nexport type Uint16 = number;\n\n/**\n * A 32-bit unsigned integer.\n */\nexport type Uint32 = number;\n\n/**\n * A 64-bit unsigned integer value.\n */\nexport type Uint64 = bigint;\n\n/**\n * A 128-bit unsigned integer used for precise arithmetic operations.\n */\nexport type Uint128 = bigint;\n\n/**\n * A 256-bit unsigned integer used for precise numerical calculations.\n */\nexport type Uint256 = bigint;\n\n/**\n * A number or a bigint value.\n */\nexport type AnyNumber = number | bigint;\n\n/**\n * Configuration options for initializing the SDK, allowing customization of its behavior and interaction with the Aptos network.\n */\nexport type AptosSettings = {\n readonly network?: Network;\n\n readonly fullnode?: string;\n\n readonly faucet?: string;\n\n readonly indexer?: string;\n\n readonly pepper?: string;\n\n readonly prover?: string;\n\n readonly clientConfig?: ClientConfig;\n\n readonly client?: Client;\n\n readonly fullnodeConfig?: FullNodeConfig;\n\n readonly indexerConfig?: IndexerConfig;\n\n readonly faucetConfig?: FaucetConfig;\n};\n\n/**\n * Defines the parameters for paginating query results, including the starting position and maximum number of items to return.\n * @param offset Specifies the starting position of the query result. Default is 0.\n * @param limit Specifies the maximum number of items to return. Default is 25.\n */\nexport interface PaginationArgs {\n offset?: AnyNumber;\n limit?: number;\n}\n\n/**\n * Represents the arguments for specifying a token standard.\n *\n * @param tokenStandard - Optional standard of the token.\n */\nexport interface TokenStandardArg {\n tokenStandard?: TokenStandard;\n}\n\nexport interface OrderByArg<T extends {}> {\n orderBy?: OrderBy<T>;\n}\n\nexport interface WhereArg<T extends {}> {\n where?: T;\n}\n\n/**\n * QUERY TYPES\n */\n\n/**\n * A configuration object for requests to the server, including API key, extra headers, and cookie handling options.\n */\nexport type ClientConfig = ClientHeadersType & {\n WITH_CREDENTIALS?: boolean;\n API_KEY?: string;\n};\n\n/**\n * A configuration object for a Fullnode, allowing for the inclusion of extra headers in requests.\n */\nexport type FullNodeConfig = ClientHeadersType;\n\n/**\n * An Indexer configuration object for sending requests with additional headers.\n */\nexport type IndexerConfig = ClientHeadersType;\n\n/**\n * A configuration object for a faucet, including optional authentication and headers for requests.\n */\nexport type FaucetConfig = ClientHeadersType & {\n AUTH_TOKEN?: string;\n};\n\n/**\n * General type definition for client headers.\n */\nexport type ClientHeadersType = {\n HEADERS?: Record<string, string | number | boolean>;\n};\n\n/**\n * Represents a client for making requests to a service provider.\n *\n * @param Req - The type of the request payload.\n * @param Res - The type of the response payload.\n */\nexport interface ClientRequest<Req> {\n url: string;\n method: \"GET\" | \"POST\";\n originMethod?: string;\n body?: Req;\n contentType?: string;\n acceptType?: string;\n params?: any;\n overrides?: ClientConfig & FullNodeConfig & IndexerConfig & FaucetConfig;\n headers?: Record<string, any>;\n}\n\nexport interface ClientResponse<Res> {\n status: number;\n statusText: string;\n data: Res;\n config?: any;\n request?: any;\n response?: any;\n headers?: any;\n}\n\nexport interface Client {\n /**\n * Sends a request to the specified URL with the given options.\n *\n * @param requestOptions - The options for the request.\n * @param requestOptions.url - The URL to send the request to.\n * @param requestOptions.method - The HTTP method to use, either \"GET\" or \"POST\".\n * @param requestOptions.path - An optional path to append to the URL.\n * @param requestOptions.body - The body of the request, applicable for POST requests.\n * @param requestOptions.contentType - The content type of the request body.\n * @param requestOptions.acceptType - The expected content type of the response.\n * @param requestOptions.params - Optional parameters to include in the request.\n * @param requestOptions.originMethod - An optional method to specify the origin of the request.\n * @param requestOptions.overrides - Optional configuration overrides for the request.\n */\n provider<Req, Res>(requestOptions: ClientRequest<Req>): Promise<ClientResponse<Res>>;\n\n /**\n * Sends a request to the specified URL with the given options, that returns a binary response\n *\n * @experimental\n * @param requestOptions - The options for the request.\n * @param requestOptions.url - The URL to send the request to.\n * @param requestOptions.method - The HTTP method to use, either \"GET\" or \"POST\".\n * @param requestOptions.path - An optional path to append to the URL.\n * @param requestOptions.body - The body of the request, applicable for POST requests.\n * @param requestOptions.contentType - The content type of the request body.\n * @param requestOptions.acceptType - The expected content type of the response.\n * @param requestOptions.params - Optional parameters to include in the request.\n * @param requestOptions.originMethod - An optional method to specify the origin of the request.\n * @param requestOptions.overrides - Optional configuration overrides for the request.\n */\n binaryProvider?: <Req>(requestOptions: ClientRequest<Req>) => Promise<ClientResponse<Buffer>>;\n}\n\n/**\n * The API request type\n *\n * @param url - the url to make the request to, i.e. https://fullnode.devnet.aptoslabs.com/v1\n * @param method - the request method \"GET\" | \"POST\"\n * @param endpoint (optional) - the endpoint to make the request to, i.e. transactions\n * @param body (optional) - the body of the request\n * @param contentType (optional) - the content type to set the `content-type` header to,\n * by default is set to `application/json`\n * @param acceptType (optional) - the content type to set the `accept-type` header to,\n * by default is set to `application/json`\n * @param params (optional) - query params to add to the request\n * @param originMethod (optional) - the local method the request came from\n * @param overrides (optional) - a `ClientConfig` object type to override request data\n */\nexport type AptosRequest = {\n url: string;\n method: \"GET\" | \"POST\";\n path?: string;\n body?: any;\n contentType?: string;\n acceptType?: string;\n params?: Record<string, string | AnyNumber | boolean | undefined>;\n originMethod?: string;\n overrides?: ClientConfig & FullNodeConfig & IndexerConfig & FaucetConfig;\n};\n\n/**\n * The API response type\n *\n * @param status - the response status. i.e. 200\n * @param statusText - the response message\n * @param data the response data\n * @param url the url the request was made to\n * @param headers the response headers\n * @param config (optional) - the request object\n * @param request (optional) - the request object\n */\nexport interface AptosResponse<Req, Res> {\n status: number;\n statusText: string;\n data: Res;\n url: string;\n headers: any;\n config?: any;\n request?: Req;\n}\n\n/**\n * The ledger version of transactions, defaulting to the latest version if not specified.\n */\nexport type LedgerVersionArg = {\n ledgerVersion?: AnyNumber;\n};\n\n/**\n * RESPONSE TYPES\n */\n\n/**\n * The output of the estimate gas API, including the deprioritized estimate for the gas unit price.\n */\nexport type GasEstimation = {\n /**\n * The deprioritized estimate for the gas unit price\n */\n deprioritized_gas_estimate?: number;\n /**\n * The current estimate for the gas unit price\n */\n gas_estimate: number;\n /**\n * The prioritized estimate for the gas unit price\n */\n prioritized_gas_estimate?: number;\n};\n\nexport type MoveResource<T = {}> = {\n type: MoveStructId;\n data: T;\n};\n\n/**\n * The data associated with an account, including its sequence number.\n */\nexport type AccountData = {\n sequence_number: string;\n authentication_key: string;\n};\n\n/**\n * A Move module containing an address.\n */\nexport type MoveModuleBytecode = {\n bytecode: string;\n abi?: MoveModule;\n};\n\n/**\n * TRANSACTION TYPES\n */\n\n/**\n * Different types of transaction responses that can occur in the system.\n */\nexport enum TransactionResponseType {\n Pending = \"pending_transaction\",\n User = \"user_transaction\",\n Genesis = \"genesis_transaction\",\n BlockMetadata = \"block_metadata_transaction\",\n StateCheckpoint = \"state_checkpoint_transaction\",\n Validator = \"validator_transaction\",\n BlockEpilogue = \"block_epilogue_transaction\",\n}\n\n/**\n * The response for a transaction, which can be either pending or committed.\n */\nexport type TransactionResponse = PendingTransactionResponse | CommittedTransactionResponse;\n\n/**\n * The response for a committed transaction, which can be one of several transaction types.\n */\nexport type CommittedTransactionResponse =\n | UserTransactionResponse\n | GenesisTransactionResponse\n | BlockMetadataTransactionResponse\n | StateCheckpointTransactionResponse\n | ValidatorTransactionResponse\n | BlockEpilogueTransactionResponse;\n\n/**\n * Determine if the given transaction response is currently pending.\n *\n * @param response - The transaction response to evaluate.\n * @returns A boolean indicating whether the transaction is pending.\n */\nexport function isPendingTransactionResponse(response: TransactionResponse): response is PendingTransactionResponse {\n return response.type === TransactionResponseType.Pending;\n}\n\n/**\n * Determines if the given transaction response is a user transaction.\n *\n * @param response - The transaction response to evaluate.\n * @returns A boolean indicating whether the transaction is of type User.\n */\nexport function isUserTransactionResponse(response: TransactionResponse): response is UserTransactionResponse {\n return response.type === TransactionResponseType.User;\n}\n\n/**\n * Determines if the given transaction response is a Genesis transaction.\n *\n * @param response - The transaction response to evaluate.\n * @returns A boolean indicating whether the transaction is a Genesis transaction.\n */\nexport function isGenesisTransactionResponse(response: TransactionResponse): response is GenesisTransactionResponse {\n return response.type === TransactionResponseType.Genesis;\n}\n\n/**\n * Determine if the given transaction response is of type BlockMetadata.\n *\n * @param response - The transaction response to evaluate.\n * @returns A boolean indicating whether the response is a BlockMetadata transaction.\n */\nexport function isBlockMetadataTransactionResponse(\n response: TransactionResponse,\n): response is BlockMetadataTransactionResponse {\n return response.type === TransactionResponseType.BlockMetadata;\n}\n\n/**\n * Determines if the provided transaction response is a state checkpoint transaction.\n *\n * @param response - The transaction response to evaluate.\n * @returns A boolean indicating whether the transaction response is of type StateCheckpoint.\n */\nexport function isStateCheckpointTransactionResponse(\n response: TransactionResponse,\n): response is StateCheckpointTransactionResponse {\n return response.type === TransactionResponseType.StateCheckpoint;\n}\n\n/**\n * Determine if the given transaction response is of type Validator.\n *\n * @param response - The transaction response to evaluate.\n * @returns A boolean indicating whether the transaction response is a Validator type.\n */\nexport function isValidatorTransactionResponse(\n response: TransactionResponse,\n): response is ValidatorTransactionResponse {\n return response.type === TransactionResponseType.Validator;\n}\n\n/**\n * Determines if the given transaction response is of the type Block Epilogue.\n *\n * @param response - The transaction response to evaluate.\n * @returns A boolean indicating whether the response is a Block Epilogue transaction.\n */\nexport function isBlockEpilogueTransactionResponse(\n response: TransactionResponse,\n): response is BlockEpilogueTransactionResponse {\n return response.type === TransactionResponseType.BlockEpilogue;\n}\n\n/**\n * The response for a pending transaction, indicating that the transaction is still being processed.\n */\nexport type PendingTransactionResponse = {\n type: TransactionResponseType.Pending;\n hash: string;\n sender: string;\n sequence_number: string;\n max_gas_amount: string;\n gas_unit_price: string;\n expiration_timestamp_secs: string;\n payload: TransactionPayloadResponse;\n signature?: TransactionSignature;\n};\n\n/**\n * The response structure for a user transaction.\n */\nexport type UserTransactionResponse = {\n type: TransactionResponseType.User;\n version: string;\n hash: string;\n state_change_hash: string;\n event_root_hash: string;\n state_checkpoint_hash: string | null;\n gas_used: string;\n /**\n * Whether the transaction was successful\n */\n success: boolean;\n /**\n * The VM status of the transaction, can tell useful information in a failure\n */\n vm_status: string;\n accumulator_root_hash: string;\n /**\n * Final state of resources changed by the transaction\n */\n changes: Array<WriteSetChange>;\n sender: string;\n sequence_number: string;\n max_gas_amount: string;\n gas_unit_price: string;\n expiration_timestamp_secs: string;\n payload: TransactionPayloadResponse;\n signature?: TransactionSignature;\n /**\n * Events generated by the transaction\n */\n events: Array<Event>;\n timestamp: string;\n};\n\n/**\n * The response for a genesis transaction, indicating the type of transaction.\n */\nexport type GenesisTransactionResponse = {\n type: TransactionResponseType.Genesis;\n version: string;\n hash: string;\n state_change_hash: string;\n event_root_hash: string;\n state_checkpoint_hash?: string;\n gas_used: string;\n /**\n * Whether the transaction was successful\n */\n success: boolean;\n /**\n * The VM status of the transaction, can tell useful information in a failure\n */\n vm_status: string;\n accumulator_root_hash: string;\n /**\n * Final state of resources changed by the transaction\n */\n changes: Array<WriteSetChange>;\n payload: GenesisPayload;\n /**\n * Events emitted during genesis\n */\n events: Array<Event>;\n};\n\n/**\n * The structure representing a blockchain block with its height.\n */\nexport type BlockMetadataTransactionResponse = {\n type: TransactionResponseType.BlockMetadata;\n version: string;\n hash: string;\n state_change_hash: string;\n event_root_hash: string;\n state_checkpoint_hash: string | null;\n gas_used: string;\n /**\n * Whether the transaction was successful\n */\n success: boolean;\n /**\n * The VM status of the transaction, can tell useful information in a failure\n */\n vm_status: string;\n accumulator_root_hash: string;\n /**\n * Final state of resources changed by the transaction\n */\n changes: Array<WriteSetChange>;\n id: string;\n epoch: string;\n round: string;\n /**\n * The events emitted at the block creation\n */\n events: Array<Event>;\n /**\n * Previous block votes\n */\n previous_block_votes_bitvec: Array<number>;\n proposer: string;\n /**\n * The indices of the proposers who failed to propose\n */\n failed_proposer_indices: Array<number>;\n timestamp: string;\n};\n\n/**\n * The response for a state checkpoint transaction, indicating the type of transaction.\n */\nexport type StateCheckpointTransactionResponse = {\n type: TransactionResponseType.StateCheckpoint;\n version: string;\n hash: string;\n state_change_hash: string;\n event_root_hash: string;\n state_checkpoint_hash: string | null;\n gas_used: string;\n /**\n * Whether the transaction was successful\n */\n success: boolean;\n /**\n * The VM status of the transaction, can tell useful information in a failure\n */\n vm_status: string;\n accumulator_root_hash: string;\n /**\n * Final state of resources changed by the transaction\n */\n changes: Array<WriteSetChange>;\n timestamp: string;\n};\n\n/**\n * The response for a validator transaction, indicating the type of transaction.\n */\nexport type ValidatorTransactionResponse = {\n type: TransactionResponseType.Validator;\n version: string;\n hash: string;\n state_change_hash: string;\n event_root_hash: string;\n state_checkpoint_hash: string | null;\n gas_used: string;\n /**\n * Whether the transaction was successful\n */\n success: boolean;\n /**\n * The VM status of the transaction, can tell useful information in a failure\n */\n vm_status: string;\n accumulator_root_hash: string;\n /**\n * Final state of resources changed by the transaction\n */\n changes: Array<WriteSetChange>;\n /**\n * The events emitted by the validator transaction\n */\n events: Array<Event>;\n timestamp: string;\n};\n\n/**\n * Describes the gas state of the block, indicating whether the block gas limit has been reached.\n */\nexport type BlockEndInfo = {\n block_gas_limit_reached: boolean;\n block_output_limit_reached: boolean;\n block_effective_block_gas_units: number;\n block_approx_output_size: number;\n};\n\n/**\n * A transaction executed at the end of a block that tracks data from the entire block.\n */\nexport type BlockEpilogueTransactionResponse = {\n type: TransactionResponseType.BlockEpilogue;\n version: string;\n hash: string;\n state_change_hash: string;\n event_root_hash: string;\n state_checkpoint_hash: string | null;\n gas_used: string;\n /**\n * Whether the transaction was successful\n */\n success: boolean;\n /**\n * The VM status of the transaction, can tell useful information in a failure\n */\n vm_status: string;\n accumulator_root_hash: string;\n /**\n * Final state of resources changed by the transaction\n */\n changes: Array<WriteSetChange>;\n timestamp: string;\n block_end_info: BlockEndInfo | null;\n};\n\n/**\n * WRITESET CHANGE TYPES\n */\n\n/**\n * A union type that encompasses both script and direct write sets for data operations.\n */\nexport type WriteSetChange =\n | WriteSetChangeDeleteModule\n | WriteSetChangeDeleteResource\n | WriteSetChangeDeleteTableItem\n | WriteSetChangeWriteModule\n | WriteSetChangeWriteResource\n | WriteSetChangeWriteTableItem;\n\n/**\n * The structure for a module deletion change in a write set.\n */\nexport type WriteSetChangeDeleteModule = {\n type: string;\n address: string;\n /**\n * State key hash\n */\n state_key_hash: string;\n module: MoveModuleId;\n};\n\n/**\n * The payload for a resource deletion in a write set change.\n */\nexport type WriteSetChangeDeleteResource = {\n type: string;\n address: string;\n state_key_hash: string;\n resource: string;\n};\n\n/**\n * The payload for a write set change that deletes a table item.\n */\nexport type WriteSetChangeDeleteTableItem = {\n type: string;\n state_key_hash: string;\n handle: string;\n key: string;\n data?: DeletedTableData;\n};\n\n/**\n * The structure for a write module change in a write set.\n */\nexport type WriteSetChangeWriteModule = {\n type: string;\n address: string;\n state_key_hash: string;\n data: MoveModuleBytecode;\n};\n\n/**\n * The resource associated with a write set change, identified by its type.\n */\nexport type WriteSetChangeWriteResource = {\n type: string;\n address: string;\n state_key_hash: string;\n data: MoveResource;\n};\n\n/**\n * The structure for a write operation on a table in a write set change.\n */\nexport type WriteSetChangeWriteTableItem = {\n type: string;\n state_key_hash: string;\n handle: string;\n key: string;\n value: string;\n data?: DecodedTableData;\n};\n\n/**\n * The decoded data for a table, including its key in JSON format.\n */\nexport type DecodedTableData = {\n /**\n * Key of table in JSON\n */\n key: any;\n /**\n * Type of key\n */\n key_type: string;\n /**\n * Value of table in JSON\n */\n value: any;\n /**\n * Type of value\n */\n value_type: string;\n};\n\n/**\n * Data for a deleted table entry.\n */\nexport type DeletedTableData = {\n /**\n * Deleted key\n */\n key: any;\n /**\n * Deleted key type\n */\n key_type: string;\n};\n\n/**\n * The payload for a transaction response, which can be an entry function, script, or multisig payload.\n */\nexport type TransactionPayloadResponse = EntryFunctionPayloadResponse | ScriptPayloadResponse | MultisigPayloadResponse;\n\n/**\n * The response payload for an entry function, containing the type of the entry.\n */\nexport type EntryFunctionPayloadResponse = {\n type: string;\n function: MoveFunctionId;\n /**\n * Type arguments of the function\n */\n type_arguments: Array<string>;\n /**\n * Arguments of the function\n */\n arguments: Array<any>;\n};\n\n/**\n * The payload for a script response, containing the type of the script.\n */\nexport type ScriptPayloadResponse = {\n type: string;\n code: MoveScriptBytecode;\n /**\n * Type arguments of the function\n */\n type_arguments: Array<string>;\n /**\n * Arguments of the function\n */\n arguments: Array<any>;\n};\n\n/**\n * The response payload for a multisig transaction, containing the type of the transaction.\n */\nexport type MultisigPayloadResponse = {\n type: string;\n multisig_address: string;\n transaction_payload?: EntryFunctionPayloadResponse;\n};\n\n/**\n * The payload for the genesis block containing the type of the payload.\n */\nexport type GenesisPayload = {\n type: string;\n write_set: WriteSet;\n};\n\n/**\n * The bytecode for a Move script.\n */\nexport type MoveScriptBytecode = {\n bytecode: string;\n abi?: MoveFunction;\n};\n\n/**\n * JSON representations of transaction signatures returned from the node API.\n */\nexport type TransactionSignature =\n | TransactionEd25519Signature\n | TransactionSecp256k1Signature\n | TransactionMultiEd25519Signature\n | TransactionMultiAgentSignature\n | TransactionFeePayerSignature;\n\n/**\n * Determine if the provided signature is an Ed25519 signature.\n * This function checks for the presence of the \"signature\" property\n * and verifies that its value is \"ed25519_signature\".\n *\n * @param signature - The transaction signature to be checked.\n * @returns A boolean indicating whether the signature is an Ed25519 signature.\n */\nexport function isEd25519Signature(signature: TransactionSignature): signature is TransactionFeePayerSignature {\n return \"signature\" in signature && signature.signature === \"ed25519_signature\";\n}\n\n/**\n * Determine if the provided signature is a valid secp256k1 ECDSA signature.\n *\n * @param signature - The transaction signature to validate.\n * @returns A boolean indicating whether the signature is a secp256k1 ECDSA signature.\n */\nexport function isSecp256k1Signature(signature: TransactionSignature): signature is TransactionFeePayerSignature {\n return \"signature\" in signature && signature.signature === \"secp256k1_ecdsa_signature\";\n}\n\n/**\n * Determine if the provided transaction signature is a multi-agent signature.\n *\n * @param signature - The transaction signature to evaluate.\n * @returns A boolean indicating whether the signature is a multi-agent signature.\n */\nexport function isMultiAgentSignature(signature: TransactionSignature): signature is TransactionMultiAgentSignature {\n return signature.type === \"multi_agent_signature\";\n}\n\n/**\n * Determine if the provided signature is a fee payer signature.\n *\n * @param signature - The transaction signature to evaluate.\n * @returns A boolean indicating whether the signature is a fee payer signature.\n */\nexport function isFeePayerSignature(signature: TransactionSignature): signature is TransactionFeePayerSignature {\n return signature.type === \"fee_payer_signature\";\n}\n\n/**\n * Determine if the provided signature is of type \"multi_ed25519_signature\".\n *\n * @param signature - The transaction signature to check.\n * @returns A boolean indicating whether the signature is a multi-ed25519 signature.\n */\nexport function isMultiEd25519Signature(\n signature: TransactionSignature,\n): signature is TransactionMultiEd25519Signature {\n return signature.type === \"multi_ed25519_signature\";\n}\n\n/**\n * The signature for a transaction using the Ed25519 algorithm.\n */\nexport type TransactionEd25519Signature = {\n type: string;\n public_key: string;\n signature: \"ed25519_signature\";\n};\n\n/**\n * The structure for a Secp256k1 signature in a transaction.\n */\nexport type TransactionSecp256k1Signature = {\n type: string;\n public_key: string;\n signature: \"secp256k1_ecdsa_signature\";\n};\n\n/**\n * The structure for a multi-signature transaction using Ed25519.\n */\nexport type TransactionMultiEd25519Signature = {\n type: \"multi_ed25519_signature\";\n /**\n * The public keys for the Ed25519 signature\n */\n public_keys: Array<string>;\n /**\n * Signature associated with the public keys in the same order\n */\n signatures: Array<string>;\n /**\n * The number of signatures required for a successful transaction\n */\n threshold: number;\n bitmap: string;\n};\n\n/**\n * The structure for a multi-agent signature in a transaction.\n */\nexport type TransactionMultiAgentSignature = {\n type: \"multi_agent_signature\";\n sender: AccountSignature;\n /**\n * The other involved parties' addresses\n */\n secondary_signer_addresses: Array<string>;\n /**\n * The associated signatures, in the same order as the secondary addresses\n */\n secondary_signers: Array<AccountSignature>;\n};\n\n/**\n * The signature of the fee payer in a transaction.\n */\nexport type TransactionFeePayerSignature = {\n type: \"fee_payer_signature\";\n sender: AccountSignature;\n /**\n * The other involved parties' addresses\n */\n secondary_signer_addresses: Array<string>;\n /**\n * The associated signatures, in the same order as the secondary addresses\n */\n secondary_signers: Array<AccountSignature>;\n fee_payer_address: string;\n fee_payer_signer: AccountSignature;\n};\n\n/**\n * The union of all single account signatures, including Ed25519, Secp256k1, and MultiEd25519 signatures.\n */\nexport type AccountSignature =\n | TransactionEd25519Signature\n | TransactionSecp256k1Signature\n | TransactionMultiEd25519Signature;\n\nexport type WriteSet = ScriptWriteSet | DirectWriteSet;\n\n/**\n * The set of properties for writing scripts, including the type of script.\n */\nexport type ScriptWriteSet = {\n type: string;\n execute_as: string;\n script: ScriptPayloadResponse;\n};\n\n/**\n * The set of direct write operations, identified by a type string.\n */\nexport type DirectWriteSet = {\n type: string;\n changes: Array<WriteSetChange>;\n events: Array<Event>;\n};\n\n/**\n * The structure for an event's unique identifier, including its creation number.\n */\n\n/**\n * The structure for an event, identified by a unique GUID.\n */\nexport type EventGuid = {\n creation_number: string;\n account_address: string;\n};\n\nexport type Event = {\n guid: EventGuid;\n sequence_number: string;\n type: string;\n /**\n * The JSON representation of the event\n */\n data: any;\n};\n\n/**\n * A number representing a Move uint8 type.\n */\nexport type MoveUint8Type = number;\n\n/**\n * A 16-bit unsigned integer used in the Move programming language.\n */\nexport type MoveUint16Type = number;\n\n/**\n * A 32-bit unsigned integer type used in Move programming.\n */\nexport type MoveUint32Type = number;\n\n/**\n * A string representation of a 64-bit unsigned integer used in Move programming.\n */\nexport type MoveUint64Type = string;\n\n/**\n * A string representing a 128-bit unsigned integer in the Move programming language.\n */\nexport type MoveUint128Type = string;\n\n/**\n * A string representation of a 256-bit unsigned integer used in Move programming.\n */\nexport type MoveUint256Type = string;\n\n/**\n * A string representing a Move address.\n */\nexport type MoveAddressType = string;\n\n/**\n * The type for identifying objects to be moved within the system.\n */\nexport type MoveObjectType = string;\n\n/**\n * The type for move options, which can be a MoveType, null, or undefined.\n */\nexport type MoveOptionType = MoveType | null | undefined;\n\n/**\n * A structure representing a move with a name.\n */\nexport type MoveStructId = `${string}::${string}::${string}`;\n\n/**\n * The move function containing its name. Same as MoveStructId since it reads weird to take a StructId for a Function.\n */\nexport type MoveFunctionId = MoveStructId;\n\n// TODO: Add support for looking up ABI to add proper typing\nexport type MoveStructType = {};\n\n/**\n * A union type that encompasses various data types used in Move, including primitive types, address types, object types, and\n * arrays of MoveType.\n */\nexport type MoveType =\n | boolean\n | string\n | MoveUint8Type\n | MoveUint16Type\n | MoveUint32Type\n | MoveUint64Type\n | MoveUint128Type\n | MoveUint256Type\n | MoveAddressType\n | MoveObjectType\n | MoveStructType\n | Array<MoveType>;\n\n/**\n * Possible Move values acceptable by move functions (entry, view)\n *\n * Map of a Move value to the corresponding TypeScript value\n *\n * `Bool -> boolean`\n *\n * `u8, u16, u32 -> number`\n *\n * `u64, u128, u256 -> string`\n *\n * `String -> string`\n *\n * `Address -> 0x${string}`\n *\n * `Struct - 0x${string}::${string}::${string}`\n *\n * `Object -> 0x${string}`\n *\n * `Vector -> Array<MoveValue>`\n *\n * `Option -> MoveValue | null | undefined`\n */\nexport type MoveValue =\n | boolean\n | string\n | MoveUint8Type\n | MoveUint16Type\n | MoveUint32Type\n | MoveUint64Type\n | MoveUint128Type\n | MoveUint256Type\n | MoveAddressType\n | MoveObjectType\n | MoveStructId\n | MoveOptionType\n | Array<MoveValue>;\n\n/**\n * A string representation of a Move module, formatted as `module_name::function_name`.\n * Module names are case-sensitive.\n */\nexport type MoveModuleId = `${string}::${string}`;\n\n/**\n * Specifies the visibility levels for move functions, controlling access permissions.\n */\nexport enum MoveFunctionVisibility {\n PRIVATE = \"private\",\n PUBLIC = \"public\",\n FRIEND = \"friend\",\n}\n\n/**\n * Abilities related to moving items within the system.\n */\nexport enum MoveAbility {\n STORE = \"store\",\n DROP = \"drop\",\n KEY = \"key\",\n COPY = \"copy\",\n}\n\n/**\n * Move abilities associated with the generic type parameter of a function.\n */\nexport type MoveFunctionGenericTypeParam = {\n constraints: Array<MoveAbility>;\n};\n\n/**\n * A field in a Move struct, identified by its name.\n */\nexport type MoveStructField = {\n name: string;\n type: string;\n};\n\n/**\n * A Move module\n */\nexport type MoveModule = {\n address: string;\n name: string;\n /**\n * Friends of the module\n */\n friends: Array<MoveModuleId>;\n /**\n * Public functions of the module\n */\n exposed_functions: Array<MoveFunction>;\n /**\n * Structs of the module\n */\n structs: Array<MoveStruct>;\n};\n\n/**\n * A move struct\n */\nexport type MoveStruct = {\n name: string;\n /**\n * Whether the struct is a native struct of Move\n */\n is_native: boolean;\n /**\n * Whether the struct is a module event (aka v2 event). This will be false for v1\n * events because the value is derived from the #[event] attribute on the struct in\n * the Move source code. This attribute is only relevant for v2 events.\n */\n is_event: boolean;\n /**\n * Abilities associated with the struct\n */\n abilities: Array<MoveAbility>;\n /**\n * Generic types associated with the struct\n */\n generic_type_params: Array<MoveFunctionGenericTypeParam>;\n /**\n * Fields associated with the struct\n */\n fields: Array<MoveStructField>;\n};\n\n/**\n * Move function\n */\nexport type MoveFunction = {\n name: string;\n visibility: MoveFunctionVisibility;\n /**\n * Whether the function can be called as an entry function directly in a transaction\n */\n is_entry: boolean;\n /**\n * Whether the function is a view function or not\n */\n is_view: boolean;\n /**\n * Generic type params associated with the Move function\n */\n generic_type_params: Array<MoveFunctionGenericTypeParam>;\n /**\n * Parameters associated with the move function\n */\n params: Array<string>;\n /**\n * Return type of the function\n */\n return: Array<string>;\n};\n\n/**\n * Roles that can be assigned within the system, indicating different levels of access and functionality.\n */\nexport enum RoleType {\n VALIDATOR = \"validator\",\n FULL_NODE = \"full_node\",\n}\n\n/**\n * Information about the current blockchain ledger, including its chain ID.\n */\nexport type LedgerInfo = {\n /**\n * Chain ID of the current chain\n */\n chain_id: number;\n epoch: string;\n ledger_version: string;\n oldest_ledger_version: string;\n ledger_timestamp: string;\n node_role: RoleType;\n oldest_block_height: string;\n block_height: string;\n /**\n * Git hash of the build of the API endpoint. Can be used to determine the exact\n * software version used by the API endpoint.\n */\n git_hash?: string;\n};\n\n/**\n * A Block type\n */\nexport type Block = {\n block_height: string;\n block_hash: string;\n block_timestamp: string;\n first_version: string;\n last_version: string;\n /**\n * The transactions in the block in sequential order\n */\n transactions?: Array<TransactionResponse>;\n};\n\n// REQUEST TYPES\n\n/**\n * The request payload for the GetTableItem API.\n */\nexport type TableItemRequest = {\n key_type: MoveValue;\n value_type: MoveValue;\n /**\n * The value of the table item's key\n */\n key: any;\n};\n\n/**\n * A list of supported Authentication Key schemes in Aptos, consisting of combinations of signing schemes and derive schemes.\n */\nexport type AuthenticationKeyScheme = SigningScheme | DeriveScheme;\n\n/**\n * Different schemes for signing keys used in cryptographic operations.\n */\nexport enum SigningScheme {\n /**\n * For Ed25519PublicKey\n */\n Ed25519 = 0,\n /**\n * For MultiEd25519PublicKey\n */\n MultiEd25519 = 1,\n /**\n * For SingleKey ecdsa\n */\n SingleKey = 2,\n\n MultiKey = 3,\n}\n\n/**\n * Specifies the signing schemes available for cryptographic operations.\n */\nexport enum SigningSchemeInput {\n /**\n * For Ed25519PublicKey\n */\n Ed25519 = 0,\n /**\n * For Secp256k1Ecdsa\n */\n Secp256k1Ecdsa = 2,\n}\n\n/**\n * Specifies the schemes for deriving account addresses from various data sources.\n */\nexport enum DeriveScheme {\n /**\n * Derives an address using an AUID, used for objects\n */\n DeriveAuid = 251,\n /**\n * Derives an address from another object address\n */\n DeriveObjectAddressFromObject = 252,\n /**\n * Derives an address from a GUID, used for objects\n */\n DeriveObjectAddressFromGuid = 253,\n /**\n * Derives an address from seed bytes, used for named objects\n */\n DeriveObjectAddressFromSeed = 254,\n /**\n * Derives an address from seed bytes, used for resource accounts\n */\n DeriveResourceAccountAddress = 255,\n}\n\n/**\n * Options for configuring the behavior of the waitForTransaction() function.\n */\nexport type WaitForTransactionOptions = {\n timeoutSecs?: number;\n checkSuccess?: boolean;\n // Default behavior is to wait for the indexer. Set this to false to disable waiting.\n waitForIndexer?: boolean;\n};\n\n/**\n * Input type to generate an account using the Ed25519 signing scheme.\n */\nexport type GenerateAccountWithEd25519 = {\n scheme: SigningSchemeInput.Ed25519;\n legacy: boolean;\n};\n\n/**\n * Input type to generate an account with a Single Signer using Secp256k1.\n */\nexport type GenerateAccountWithSingleSignerSecp256k1Key = {\n scheme: SigningSchemeInput.Secp256k1Ecdsa;\n legacy?: false;\n};\n\nexport type GenerateAccount = GenerateAccountWithEd25519 | GenerateAccountWithSingleSignerSecp256k1Key;\n"],"mappings":"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","names":["MimeType","TypeTagVariants","ScriptTransactionArgumentVariants","TransactionPayloadVariants","TransactionVariants","TransactionAuthenticatorVariant","AccountAuthenticatorVariant","PrivateKeyVariants","AnyPublicKeyVariant","AnySignatureVariant","EphemeralPublicKeyVariant","EphemeralSignatureVariant","EphemeralCertificateVariant","ZkpVariant","TransactionResponseType","isPendingTransactionResponse","response","isUserTransactionResponse","isGenesisTransactionResponse","isBlockMetadataTransactionResponse","isStateCheckpointTransactionResponse","isValidatorTransactionResponse","isBlockEpilogueTransactionResponse","isEd25519Signature","signature","isSecp256k1Signature","isMultiAgentSignature","isFeePayerSignature","isMultiEd25519Signature","MoveFunctionVisibility","MoveAbility","RoleType","SigningScheme","SigningSchemeInput","DeriveScheme"]}
@@ -1,2 +1,2 @@
1
- import{c as s}from"./chunk-AC3BISWL.mjs";import{w as i,x as m}from"./chunk-VHNX2NUR.mjs";import{b as n}from"./chunk-ULHOJ2BE.mjs";async function b(t){let{aptosConfig:a,handle:e,data:o,options:r}=t;return(await n({aptosConfig:a,originMethod:"getTableItem",path:`tables/${e}/item`,params:{ledger_version:r?.ledgerVersion},body:o})).data}async function f(t){let{aptosConfig:a,options:e}=t,o={query:i,variables:{where_condition:e?.where,offset:e?.offset,limit:e?.limit,order_by:e?.orderBy}};return(await s({aptosConfig:a,query:o,originMethod:"getTableItemsData"})).table_items}async function T(t){let{aptosConfig:a,options:e}=t,o={query:m,variables:{where_condition:e?.where,offset:e?.offset,limit:e?.limit,order_by:e?.orderBy}};return(await s({aptosConfig:a,query:o,originMethod:"getTableItemsMetadata"})).table_metadatas}export{b as a,f as b,T as c};
2
- //# sourceMappingURL=chunk-33CBJFX2.mjs.map
1
+ import{c as s}from"./chunk-KK5HUWF6.mjs";import{w as i,x as m}from"./chunk-VHNX2NUR.mjs";import{c as n}from"./chunk-752TOOCA.mjs";async function b(t){let{aptosConfig:a,handle:e,data:o,options:r}=t;return(await n({aptosConfig:a,originMethod:"getTableItem",path:`tables/${e}/item`,params:{ledger_version:r?.ledgerVersion},body:o})).data}async function f(t){let{aptosConfig:a,options:e}=t,o={query:i,variables:{where_condition:e?.where,offset:e?.offset,limit:e?.limit,order_by:e?.orderBy}};return(await s({aptosConfig:a,query:o,originMethod:"getTableItemsData"})).table_items}async function T(t){let{aptosConfig:a,options:e}=t,o={query:m,variables:{where_condition:e?.where,offset:e?.offset,limit:e?.limit,order_by:e?.orderBy}};return(await s({aptosConfig:a,query:o,originMethod:"getTableItemsMetadata"})).table_metadatas}export{b as a,f as b,T as c};
2
+ //# sourceMappingURL=chunk-RDPWCN4B.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as r}from"./chunk-EBMEXURY.mjs";import{b as i}from"./chunk-STY74NUA.mjs";var t=class a extends r{constructor(e){super(),this.value=i.fromHexInput(e).toUint8Array()}serialize(e){e.serializeFixedBytes(this.value)}serializeForEntryFunction(e){e.serialize(this)}serializeForScriptFunction(e){e.serialize(this)}static deserialize(e,s){let o=e.deserializeFixedBytes(s);return new a(o)}};export{t as a};
2
- //# sourceMappingURL=chunk-MT2RJ7H3.mjs.map
1
+ import{a as r}from"./chunk-RXHER6EA.mjs";import{b as i}from"./chunk-VHY6ZATX.mjs";var t=class a extends r{constructor(e){super(),this.value=i.fromHexInput(e).toUint8Array()}serialize(e){e.serializeFixedBytes(this.value)}serializeForEntryFunction(e){e.serialize(this)}serializeForScriptFunction(e){e.serialize(this)}static deserialize(e,s){let o=e.deserializeFixedBytes(s);return new a(o)}};export{t as a};
2
+ //# sourceMappingURL=chunk-RIINVEZA.mjs.map
@@ -1,2 +1,2 @@
1
- import{b as c}from"./chunk-STY74NUA.mjs";import{a as U,b,c as f,d as h,e as l,f as y}from"./chunk-56CNRT2K.mjs";import{a as s}from"./chunk-KDMSOCZY.mjs";var B=class{bcsToBytes(){let e=new n;return this.serialize(e),e.toUint8Array()}bcsToHex(){let e=this.bcsToBytes();return c.fromHexInput(e)}toStringWithoutPrefix(){return this.bcsToHex().toStringWithoutPrefix()}toString(){return`0x${this.toStringWithoutPrefix()}`}},n=class{constructor(e=64){if(e<=0)throw new Error("Length needs to be greater than 0");this.buffer=new ArrayBuffer(e),this.offset=0}ensureBufferWillHandleSize(e){for(;this.buffer.byteLength<this.offset+e;){let t=new ArrayBuffer(this.buffer.byteLength*2);new Uint8Array(t).set(new Uint8Array(this.buffer)),this.buffer=t}}appendToBuffer(e){this.ensureBufferWillHandleSize(e.length),new Uint8Array(this.buffer,this.offset).set(e),this.offset+=e.length}serializeWithFunction(e,t,i){this.ensureBufferWillHandleSize(t);let a=new DataView(this.buffer,this.offset);e.apply(a,[0,i,!0]),this.offset+=t}serializeStr(e){let t=new TextEncoder;this.serializeBytes(t.encode(e))}serializeBytes(e){this.serializeU32AsUleb128(e.length),this.appendToBuffer(e)}serializeFixedBytes(e){this.appendToBuffer(e)}serializeBool(e){p(e);let t=e?1:0;this.appendToBuffer(new Uint8Array([t]))}serializeU8(e){this.appendToBuffer(new Uint8Array([e]))}serializeU16(e){this.serializeWithFunction(DataView.prototype.setUint16,2,e)}serializeU32(e){this.serializeWithFunction(DataView.prototype.setUint32,4,e)}serializeU64(e){let t=BigInt(e)&BigInt(f),i=BigInt(e)>>BigInt(32);this.serializeU32(Number(t)),this.serializeU32(Number(i))}serializeU128(e){let t=BigInt(e)&h,i=BigInt(e)>>BigInt(64);this.serializeU64(t),this.serializeU64(i)}serializeU256(e){let t=BigInt(e)&l,i=BigInt(e)>>BigInt(128);this.serializeU128(t),this.serializeU128(i)}serializeU32AsUleb128(e){let t=e,i=[];for(;t>>>7;)i.push(t&127|128),t>>>=7;i.push(t),this.appendToBuffer(new Uint8Array(i))}toUint8Array(){return new Uint8Array(this.buffer).slice(0,this.offset)}serialize(e){e.serialize(this)}serializeVector(e){this.serializeU32AsUleb128(e.length),e.forEach(t=>{t.serialize(this)})}serializeOption(e,t){let i=e!==void 0;this.serializeBool(i),i&&(typeof e=="string"?this.serializeStr(e):e instanceof Uint8Array?t!==void 0?this.serializeFixedBytes(e):this.serializeBytes(e):e.serialize(this))}serializeOptionStr(e){e===void 0?this.serializeU32AsUleb128(0):(this.serializeU32AsUleb128(1),this.serializeStr(e))}};s([o(0,U)],n.prototype,"serializeU8",1),s([o(0,b)],n.prototype,"serializeU16",1),s([o(0,f)],n.prototype,"serializeU32",1),s([o(BigInt(0),h)],n.prototype,"serializeU64",1),s([o(BigInt(0),l)],n.prototype,"serializeU128",1),s([o(BigInt(0),y)],n.prototype,"serializeU256",1),s([o(0,f)],n.prototype,"serializeU32AsUleb128",1);function p(r){if(typeof r!="boolean")throw new Error(`${r} is not a boolean value`)}var A=(r,e,t)=>`${r} is out of range: [${e}, ${t}]`;function z(r,e,t){let i=BigInt(r);if(i>BigInt(t)||i<BigInt(e))throw new Error(A(r,e,t))}function o(r,e){return(t,i,a)=>{let g=a.value;return a.value=function(u){return z(u,r,e),g.apply(this,[u])},a}}export{B as a,n as b,p as c,A as d,z as e};
2
- //# sourceMappingURL=chunk-EBMEXURY.mjs.map
1
+ import{b as c}from"./chunk-VHY6ZATX.mjs";import{a as U,b,c as f,d as h,e as l,f as y}from"./chunk-56CNRT2K.mjs";import{a as s}from"./chunk-KDMSOCZY.mjs";var B=class{bcsToBytes(){let e=new n;return this.serialize(e),e.toUint8Array()}bcsToHex(){let e=this.bcsToBytes();return c.fromHexInput(e)}toStringWithoutPrefix(){return this.bcsToHex().toStringWithoutPrefix()}toString(){return`0x${this.toStringWithoutPrefix()}`}},n=class{constructor(e=64){if(e<=0)throw new Error("Length needs to be greater than 0");this.buffer=new ArrayBuffer(e),this.offset=0}ensureBufferWillHandleSize(e){for(;this.buffer.byteLength<this.offset+e;){let t=new ArrayBuffer(this.buffer.byteLength*2);new Uint8Array(t).set(new Uint8Array(this.buffer)),this.buffer=t}}appendToBuffer(e){this.ensureBufferWillHandleSize(e.length),new Uint8Array(this.buffer,this.offset).set(e),this.offset+=e.length}serializeWithFunction(e,t,i){this.ensureBufferWillHandleSize(t);let a=new DataView(this.buffer,this.offset);e.apply(a,[0,i,!0]),this.offset+=t}serializeStr(e){let t=new TextEncoder;this.serializeBytes(t.encode(e))}serializeBytes(e){this.serializeU32AsUleb128(e.length),this.appendToBuffer(e)}serializeFixedBytes(e){this.appendToBuffer(e)}serializeBool(e){p(e);let t=e?1:0;this.appendToBuffer(new Uint8Array([t]))}serializeU8(e){this.appendToBuffer(new Uint8Array([e]))}serializeU16(e){this.serializeWithFunction(DataView.prototype.setUint16,2,e)}serializeU32(e){this.serializeWithFunction(DataView.prototype.setUint32,4,e)}serializeU64(e){let t=BigInt(e)&BigInt(f),i=BigInt(e)>>BigInt(32);this.serializeU32(Number(t)),this.serializeU32(Number(i))}serializeU128(e){let t=BigInt(e)&h,i=BigInt(e)>>BigInt(64);this.serializeU64(t),this.serializeU64(i)}serializeU256(e){let t=BigInt(e)&l,i=BigInt(e)>>BigInt(128);this.serializeU128(t),this.serializeU128(i)}serializeU32AsUleb128(e){let t=e,i=[];for(;t>>>7;)i.push(t&127|128),t>>>=7;i.push(t),this.appendToBuffer(new Uint8Array(i))}toUint8Array(){return new Uint8Array(this.buffer).slice(0,this.offset)}serialize(e){e.serialize(this)}serializeVector(e){this.serializeU32AsUleb128(e.length),e.forEach(t=>{t.serialize(this)})}serializeOption(e,t){let i=e!==void 0;this.serializeBool(i),i&&(typeof e=="string"?this.serializeStr(e):e instanceof Uint8Array?t!==void 0?this.serializeFixedBytes(e):this.serializeBytes(e):e.serialize(this))}serializeOptionStr(e){e===void 0?this.serializeU32AsUleb128(0):(this.serializeU32AsUleb128(1),this.serializeStr(e))}};s([o(0,U)],n.prototype,"serializeU8",1),s([o(0,b)],n.prototype,"serializeU16",1),s([o(0,f)],n.prototype,"serializeU32",1),s([o(BigInt(0),h)],n.prototype,"serializeU64",1),s([o(BigInt(0),l)],n.prototype,"serializeU128",1),s([o(BigInt(0),y)],n.prototype,"serializeU256",1),s([o(0,f)],n.prototype,"serializeU32AsUleb128",1);function p(r){if(typeof r!="boolean")throw new Error(`${r} is not a boolean value`)}var A=(r,e,t)=>`${r} is out of range: [${e}, ${t}]`;function z(r,e,t){let i=BigInt(r);if(i>BigInt(t)||i<BigInt(e))throw new Error(A(r,e,t))}function o(r,e){return(t,i,a)=>{let g=a.value;return a.value=function(u){return z(u,r,e),g.apply(this,[u])},a}}export{B as a,n as b,p as c,A as d,z as e};
2
+ //# sourceMappingURL=chunk-RXHER6EA.mjs.map
@@ -0,0 +1,2 @@
1
+ import{c as u,d as f}from"./chunk-TWETGZ3W.mjs";async function p(e){let{aptosConfig:t,overrides:s,params:n,contentType:o,acceptType:r,path:i,originMethod:a,type:d}=e,R=t.getRequestUrl(d);return u({url:R,method:"GET",originMethod:a,path:i,contentType:o,acceptType:r,params:n,overrides:{...t.clientConfig,...s}},t,e.type)}async function c(e){let{aptosConfig:t,overrides:s,params:n,contentType:o,acceptType:r,path:i,originMethod:a,type:d}=e,R=t.getRequestUrl(d);return f({url:R,method:"GET",originMethod:a,path:i,contentType:o,acceptType:r,params:n,overrides:{...t.clientConfig,...s}},t,e.type)}async function m(e){let{aptosConfig:t}=e;return p({...e,type:"Fullnode",overrides:{...t.clientConfig,...t.fullnodeConfig,...e.overrides,HEADERS:{...t.clientConfig?.HEADERS,...t.fullnodeConfig?.HEADERS}}})}async function q(e){let{aptosConfig:t}=e;return c({...e,type:"Fullnode",overrides:{...t.clientConfig,...t.fullnodeConfig,...e.overrides,HEADERS:{...t.clientConfig?.HEADERS,...t.fullnodeConfig?.HEADERS}}})}async function A(e){return p({...e,type:"Pepper"})}async function h(e){let t=[],s,n=e.params;do{let o=await p({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}async function C(e){let t=[],s,n=e.params,o=n.limit;do{let r=await p({type:"Fullnode",aptosConfig:e.aptosConfig,originMethod:e.originMethod,path:e.path,params:n,overrides:e.overrides});if(s=r.headers["x-aptos-cursor"],delete r.headers,t.push(...r.data),n.offset=s,o!==void 0){let i=o-t.length;if(i<=0)break;n.limit=i}}while(s!=null);return t}export{p as a,c as b,m as c,q as d,A as e,h as f,C as g};
2
+ //# sourceMappingURL=chunk-SJDHW55X.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/client/get.ts"],"sourcesContent":["import { AptosConfig } from \"../api/aptosConfig\";\nimport { aptosBinaryRequest, aptosRequest } from \"./core\";\nimport { AptosResponse, AnyNumber, ClientConfig, MimeType } from \"../types\";\nimport { AptosApiType } from \"../utils/const\";\n\n/**\n * Options for making a GET request, including configuration for the API client.\n * @group Implementation\n * @category Client\n */\nexport type GetRequestOptions = {\n /**\n * The config for the API client\n * @group Implementation\n * @category Client\n */\n aptosConfig: AptosConfig;\n /**\n * The type of API endpoint to call e.g. fullnode, indexer, etc\n * @group Implementation\n * @category Client\n */\n type: AptosApiType;\n /**\n * The name of the API method\n * @group Implementation\n * @category Client\n */\n originMethod: string;\n /**\n * The URL path to the API method\n * @group Implementation\n * @category Client\n */\n path: string;\n /**\n * The content type of the request body\n * @group Implementation\n * @category Client\n */\n contentType?: MimeType;\n /**\n * The accepted content type of the response of the API\n * @group Implementation\n * @category Client\n */\n acceptType?: MimeType;\n /**\n * The query parameters for the request\n * @group Implementation\n * @category Client\n */\n params?: Record<string, string | AnyNumber | boolean | undefined>;\n /**\n * Specific client overrides for this request to override aptosConfig\n * @group Implementation\n * @category Client\n */\n overrides?: ClientConfig;\n};\n\n/**\n * Options for making a request to the Aptos API, excluding the \"type\" field.\n * @group Implementation\n * @category Client\n */\nexport type GetAptosRequestOptions = Omit<GetRequestOptions, \"type\">;\n\n/**\n * Executes a GET request to retrieve data based on the provided options.\n *\n * @param options - The options for the GET request.\n * @param options.aptosConfig - The configuration object for Aptos requests.\n * @param options.overrides - Optional overrides for the request configuration.\n * @param options.params - Query parameters to include in the request.\n * @param options.contentType - The content type of the request.\n * @param options.acceptType - The accepted response type.\n * @param options.path - The specific path for the request.\n * @param options.originMethod - The original method of the request.\n * @param options.type - The type of request being made.\n * @returns The response from the GET request.\n * @group Implementation\n * @category Client\n */\nexport async function get<Req extends {}, Res extends {}>(\n options: GetRequestOptions,\n): Promise<AptosResponse<Req, Res>> {\n const { aptosConfig, overrides, params, contentType, acceptType, path, originMethod, type } = options;\n const url = aptosConfig.getRequestUrl(type);\n\n return aptosRequest<Req, Res>(\n {\n url,\n method: \"GET\",\n originMethod,\n path,\n contentType,\n acceptType,\n params,\n overrides: {\n ...aptosConfig.clientConfig,\n ...overrides,\n },\n },\n aptosConfig,\n options.type,\n );\n}\n\n/**\n * Executes a GET request to retrieve data based on the provided options.\n *\n * @param options - The options for the GET request.\n * @param options.aptosConfig - The configuration object for Aptos requests.\n * @param options.overrides - Optional overrides for the request configuration.\n * @param options.params - Query parameters to include in the request.\n * @param options.contentType - The content type of the request.\n * @param options.acceptType - The accepted response type.\n * @param options.path - The specific path for the request.\n * @param options.originMethod - The original method of the request.\n * @param options.type - The type of request being made.\n * @returns The response from the GET request.\n * @group Implementation\n * @category Client\n * @experimental\n */\nexport async function getBinary<Req extends {}>(options: GetRequestOptions): Promise<AptosResponse<Req, Buffer>> {\n const { aptosConfig, overrides, params, contentType, acceptType, path, originMethod, type } = options;\n const url = aptosConfig.getRequestUrl(type);\n\n return aptosBinaryRequest<Req>(\n {\n url,\n method: \"GET\",\n originMethod,\n path,\n contentType,\n acceptType,\n params,\n overrides: {\n ...aptosConfig.clientConfig,\n ...overrides,\n },\n },\n aptosConfig,\n options.type,\n );\n}\n\n/**\n * Retrieves data from the Aptos full node using the provided options.\n *\n * @param options - The options for the request to the Aptos full node.\n * @param options.aptosConfig - Configuration settings specific to the Aptos client and full node.\n * @param options.aptosConfig.clientConfig - The client configuration settings.\n * @param options.aptosConfig.fullnodeConfig - The full node configuration settings.\n * @param options.overrides - Additional overrides for the request.\n * @param options.type - The type of API request being made.\n *\n * @returns A promise that resolves with the response from the Aptos full node.\n * @group Implementation\n * @category Client\n */\nexport async function getAptosFullNode<Req extends {}, Res extends {}>(\n options: GetAptosRequestOptions,\n): Promise<AptosResponse<Req, Res>> {\n const { aptosConfig } = options;\n\n return get<Req, Res>({\n ...options,\n type: AptosApiType.FULLNODE,\n overrides: {\n ...aptosConfig.clientConfig,\n ...aptosConfig.fullnodeConfig,\n ...options.overrides,\n HEADERS: { ...aptosConfig.clientConfig?.HEADERS, ...aptosConfig.fullnodeConfig?.HEADERS },\n },\n });\n}\n\n/**\n * Retrieves data from the Aptos full node using the provided options.\n *\n * @param options - The options for the request to the Aptos full node.\n * @param options.aptosConfig - Configuration settings specific to the Aptos client and full node.\n * @param options.aptosConfig.clientConfig - The client configuration settings.\n * @param options.aptosConfig.fullnodeConfig - The full node configuration settings.\n * @param options.overrides - Additional overrides for the request.\n * @param options.type - The type of API request being made.\n *\n * @returns A promise that resolves with the response from the Aptos full node.\n * @group Implementation\n * @category Client\n * @experimental\n */\nexport async function getBinaryAptosFullNode<Req extends {}>(\n options: GetAptosRequestOptions,\n): Promise<AptosResponse<Req, Buffer>> {\n const { aptosConfig } = options;\n\n return getBinary<Req>({\n ...options,\n type: AptosApiType.FULLNODE,\n overrides: {\n ...aptosConfig.clientConfig,\n ...aptosConfig.fullnodeConfig,\n ...options.overrides,\n HEADERS: { ...aptosConfig.clientConfig?.HEADERS, ...aptosConfig.fullnodeConfig?.HEADERS },\n },\n });\n}\n\n/**\n * Makes a GET request to the Aptos Pepper service to retrieve data.\n *\n * @param options - The options for the request.\n * @param options.param1 - Description of param1.\n * @param options.param2 - Description of param2.\n * @returns AptosResponse - The response from the Aptos Pepper service.\n * @group Implementation\n * @category Client\n */\nexport async function getAptosPepperService<Req extends {}, Res extends {}>(\n options: GetAptosRequestOptions,\n): Promise<AptosResponse<Req, Res>> {\n return get<Req, Res>({ ...options, type: AptosApiType.PEPPER });\n}\n\n/**\n * This function is a helper for paginating using a function wrapping an API\n * @group Implementation\n * @category Client\n */\nexport async function paginateWithCursor<Req extends Record<string, any>, Res extends Array<{}>>(\n options: GetAptosRequestOptions,\n): Promise<Res> {\n const out: any[] = [];\n let cursor: string | undefined;\n const requestParams = options.params as { start?: string; limit?: number };\n do {\n // eslint-disable-next-line no-await-in-loop\n const response = await get<Req, Res>({\n type: AptosApiType.FULLNODE,\n aptosConfig: options.aptosConfig,\n originMethod: options.originMethod,\n path: options.path,\n params: requestParams,\n overrides: options.overrides,\n });\n /**\n * the cursor is a \"state key\" from the API perspective. Client\n * should not need to \"care\" what it represents but just use it\n * to query the next chunk of data.\n * @group Implementation\n * @category Client\n */\n cursor = response.headers[\"x-aptos-cursor\"];\n // Now that we have the cursor (if any), we remove the headers before\n // adding these to the output of this function.\n delete response.headers;\n out.push(...response.data);\n requestParams.start = cursor;\n } while (cursor !== null && cursor !== undefined);\n return out as Res;\n}\n\n/// This function is a helper for paginating using a function wrapping an API using offset instead of start\nexport async function paginateWithObfuscatedCursor<Req extends Record<string, any>, Res extends Array<{}>>(\n options: GetAptosRequestOptions,\n): Promise<Res> {\n const out: any[] = [];\n let cursor: string | undefined;\n const requestParams = options.params as { offset?: string; limit?: number };\n const totalLimit = requestParams.limit;\n do {\n // eslint-disable-next-line no-await-in-loop\n const response = await get<Req, Res>({\n type: AptosApiType.FULLNODE,\n aptosConfig: options.aptosConfig,\n originMethod: options.originMethod,\n path: options.path,\n params: requestParams,\n overrides: options.overrides,\n });\n /**\n * the cursor is a \"state key\" from the API perspective. Client\n * should not need to \"care\" what it represents but just use it\n * to query the next chunk of data.\n */\n cursor = response.headers[\"x-aptos-cursor\"];\n // Now that we have the cursor (if any), we remove the headers before\n // adding these to the output of this function.\n delete response.headers;\n out.push(...response.data);\n requestParams.offset = cursor;\n\n // Re-evaluate length\n if (totalLimit !== undefined) {\n const newLimit = totalLimit - out.length;\n if (newLimit <= 0) {\n break;\n }\n requestParams.limit = newLimit;\n }\n } while (cursor !== null && cursor !== undefined);\n return out as Res;\n}\n"],"mappings":"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","names":["get","options","aptosConfig","overrides","params","contentType","acceptType","path","originMethod","type","url","aptosRequest","getBinary","aptosBinaryRequest","getAptosFullNode","getBinaryAptosFullNode","getAptosPepperService","paginateWithCursor","out","cursor","requestParams","response","paginateWithObfuscatedCursor","totalLimit","newLimit"]}
@@ -1,2 +1,2 @@
1
- import{a as n}from"./chunk-P7SE5LQE.mjs";import{b as a}from"./chunk-Q4C4U6I4.mjs";import{a as i}from"./chunk-EBMEXURY.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-KEJAUCQF.mjs.map
1
+ import{a as n}from"./chunk-27ESCVVC.mjs";import{b as a}from"./chunk-LQOSHBB7.mjs";import{a as i}from"./chunk-RXHER6EA.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-T7X4GZDU.mjs.map
@@ -1,7 +1,7 @@
1
- import{b as T}from"./chunk-42T3UGSW.mjs";var N=(r=>(r[r.API_ERROR=0]="API_ERROR",r[r.EXTERNAL_API_ERROR=1]="EXTERNAL_API_ERROR",r[r.SESSION_EXPIRED=2]="SESSION_EXPIRED",r[r.INVALID_STATE=3]="INVALID_STATE",r[r.UNKNOWN=4]="UNKNOWN",r))(N||{}),l=(s=>(s.REAUTHENTICATE="Re-authentiate to continue using your keyless account",s.REAUTHENTICATE_UNSURE="Try re-authentiating. If the error persists join the telegram group at https://t.me/+h5CN-W35yUFiYzkx for further support",s.UPDATE_REQUEST_PARAMS="Update the invalid request parameters and reauthenticate.",s.RATE_LIMIT_EXCEEDED="Cache the keyless account and reuse it to avoid making too many requests. Keyless accounts are valid until either the EphemeralKeyPair expires, when the JWK is rotated, or when the proof verifying key is changed, whichever comes soonest.",s.SERVER_ERROR="Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx",s.CALL_PRECHECK="Call `await account.checkKeylessAccountValidity()` to wait for asyncronous changes and check for account validity before signing or serializing.",s.REINSTANTIATE="Try instantiating the account again. Avoid manipulating the account object directly",s.JOIN_SUPPORT_GROUP="For support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx",s.UNKNOWN="Error unknown. For support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx",s))(l||{}),u=(e=>(e[e.EPHEMERAL_KEY_PAIR_EXPIRED=0]="EPHEMERAL_KEY_PAIR_EXPIRED",e[e.PROOF_NOT_FOUND=1]="PROOF_NOT_FOUND",e[e.ASYNC_PROOF_FETCH_FAILED=2]="ASYNC_PROOF_FETCH_FAILED",e[e.INVALID_PROOF_VERIFICATION_FAILED=3]="INVALID_PROOF_VERIFICATION_FAILED",e[e.INVALID_PROOF_VERIFICATION_KEY_NOT_FOUND=4]="INVALID_PROOF_VERIFICATION_KEY_NOT_FOUND",e[e.INVALID_JWT_SIG=5]="INVALID_JWT_SIG",e[e.INVALID_JWT_JWK_NOT_FOUND=6]="INVALID_JWT_JWK_NOT_FOUND",e[e.INVALID_JWT_ISS_NOT_RECOGNIZED=7]="INVALID_JWT_ISS_NOT_RECOGNIZED",e[e.INVALID_JWT_FEDERATED_ISS_NOT_SUPPORTED=8]="INVALID_JWT_FEDERATED_ISS_NOT_SUPPORTED",e[e.INVALID_TW_SIG_VERIFICATION_FAILED=9]="INVALID_TW_SIG_VERIFICATION_FAILED",e[e.INVALID_TW_SIG_PUBLIC_KEY_NOT_FOUND=10]="INVALID_TW_SIG_PUBLIC_KEY_NOT_FOUND",e[e.INVALID_EXPIRY_HORIZON=11]="INVALID_EXPIRY_HORIZON",e[e.JWT_PARSING_ERROR=12]="JWT_PARSING_ERROR",e[e.JWK_FETCH_FAILED=13]="JWK_FETCH_FAILED",e[e.JWK_FETCH_FAILED_FEDERATED=14]="JWK_FETCH_FAILED_FEDERATED",e[e.RATE_LIMIT_EXCEEDED=15]="RATE_LIMIT_EXCEEDED",e[e.PEPPER_SERVICE_INTERNAL_ERROR=16]="PEPPER_SERVICE_INTERNAL_ERROR",e[e.PEPPER_SERVICE_BAD_REQUEST=17]="PEPPER_SERVICE_BAD_REQUEST",e[e.PEPPER_SERVICE_OTHER=18]="PEPPER_SERVICE_OTHER",e[e.PROVER_SERVICE_INTERNAL_ERROR=19]="PROVER_SERVICE_INTERNAL_ERROR",e[e.PROVER_SERVICE_BAD_REQUEST=20]="PROVER_SERVICE_BAD_REQUEST",e[e.PROVER_SERVICE_OTHER=21]="PROVER_SERVICE_OTHER",e[e.FULL_NODE_CONFIG_LOOKUP_ERROR=22]="FULL_NODE_CONFIG_LOOKUP_ERROR",e[e.FULL_NODE_VERIFICATION_KEY_LOOKUP_ERROR=23]="FULL_NODE_VERIFICATION_KEY_LOOKUP_ERROR",e[e.FULL_NODE_JWKS_LOOKUP_ERROR=24]="FULL_NODE_JWKS_LOOKUP_ERROR",e[e.FULL_NODE_OTHER=25]="FULL_NODE_OTHER",e[e.UNKNOWN=26]="UNKNOWN",e))(u||{}),A={0:["The ephemeral keypair has expired.",2,"Re-authentiate to continue using your keyless account"],1:["The required proof could not be found.",3,"Call `await account.checkKeylessAccountValidity()` to wait for asyncronous changes and check for account validity before signing or serializing."],2:["The required proof failed to fetch.",3,"Try re-authentiating. If the error persists join the telegram group at https://t.me/+h5CN-W35yUFiYzkx for further support"],3:["The provided proof is invalid.",3,"Try re-authentiating. If the error persists join the telegram group at https://t.me/+h5CN-W35yUFiYzkx for further support"],4:["The verification key used to authenticate was updated.",2,"Re-authentiate to continue using your keyless account"],5:["The JWK was found, but JWT failed verification",3,"Try re-authentiating. If the error persists join the telegram group at https://t.me/+h5CN-W35yUFiYzkx for further support"],6:["The JWK required to verify the JWT could not be found. The JWK may have been rotated out.",2,"Re-authentiate to continue using your keyless account"],7:["The JWT issuer is not recognized.",3,"Update the invalid request parameters and reauthenticate."],8:["The JWT issuer is not supported by the Federated Keyless ",0,"Try re-authentiating. If the error persists join the telegram group at https://t.me/+h5CN-W35yUFiYzkx for further support"],9:["The training wheels signature is invalid.",3,"Try re-authentiating. If the error persists join the telegram group at https://t.me/+h5CN-W35yUFiYzkx for further support"],10:["The public key used to verify the training wheels signature was not found.",2,"Re-authentiate to continue using your keyless account"],11:["The expiry horizon is invalid.",2,"Re-authentiate to continue using your keyless account"],13:["Failed to fetch JWKS.",1,"For support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],14:["Failed to fetch JWKS for Federated Keyless provider.",1,"For support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],15:["Rate limit exceeded. Too many requests in a short period.",0,"Cache the keyless account and reuse it to avoid making too many requests. Keyless accounts are valid until either the EphemeralKeyPair expires, when the JWK is rotated, or when the proof verifying key is changed, whichever comes soonest."],16:["Internal error from Pepper service.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],17:["Bad request sent to Pepper service.",0,"Update the invalid request parameters and reauthenticate."],18:["Unknown error from Pepper service.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],19:["Internal error from Prover service.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],20:["Bad request sent to Prover service.",0,"Update the invalid request parameters and reauthenticate."],21:["Unknown error from Prover service.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],12:["Error when parsing JWT. This should never happen. Join https://t.me/+h5CN-W35yUFiYzkx for support",3,"Try instantiating the account again. Avoid manipulating the account object directly"],22:["Error when looking up on-chain keyless configuration.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],23:["Error when looking up on-chain verification key.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],24:["Error when looking up on-chain JWKS.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],25:["Unknown error from full node.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],26:["An unknown error has occurred.",4,"Error unknown. For support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"]},O=class i extends Error{constructor(o){let{innerError:E,category:t,resolutionTip:R,type:r,message:_=A[r][0],details:n}=o;super(_),this.name="KeylessError",this.innerError=E,this.category=t,this.resolutionTip=R,this.type=r,this.details=n,this.message=i.constructMessage(_,R,E,n)}static constructMessage(o,E,t,R){let r=`
1
+ import{b as T}from"./chunk-BHVSIRNF.mjs";var N=(r=>(r[r.API_ERROR=0]="API_ERROR",r[r.EXTERNAL_API_ERROR=1]="EXTERNAL_API_ERROR",r[r.SESSION_EXPIRED=2]="SESSION_EXPIRED",r[r.INVALID_STATE=3]="INVALID_STATE",r[r.UNKNOWN=4]="UNKNOWN",r))(N||{}),l=(s=>(s.REAUTHENTICATE="Re-authentiate to continue using your keyless account",s.REAUTHENTICATE_UNSURE="Try re-authentiating. If the error persists join the telegram group at https://t.me/+h5CN-W35yUFiYzkx for further support",s.UPDATE_REQUEST_PARAMS="Update the invalid request parameters and reauthenticate.",s.RATE_LIMIT_EXCEEDED="Cache the keyless account and reuse it to avoid making too many requests. Keyless accounts are valid until either the EphemeralKeyPair expires, when the JWK is rotated, or when the proof verifying key is changed, whichever comes soonest.",s.SERVER_ERROR="Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx",s.CALL_PRECHECK="Call `await account.checkKeylessAccountValidity()` to wait for asyncronous changes and check for account validity before signing or serializing.",s.REINSTANTIATE="Try instantiating the account again. Avoid manipulating the account object directly",s.JOIN_SUPPORT_GROUP="For support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx",s.UNKNOWN="Error unknown. For support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx",s))(l||{}),u=(e=>(e[e.EPHEMERAL_KEY_PAIR_EXPIRED=0]="EPHEMERAL_KEY_PAIR_EXPIRED",e[e.PROOF_NOT_FOUND=1]="PROOF_NOT_FOUND",e[e.ASYNC_PROOF_FETCH_FAILED=2]="ASYNC_PROOF_FETCH_FAILED",e[e.INVALID_PROOF_VERIFICATION_FAILED=3]="INVALID_PROOF_VERIFICATION_FAILED",e[e.INVALID_PROOF_VERIFICATION_KEY_NOT_FOUND=4]="INVALID_PROOF_VERIFICATION_KEY_NOT_FOUND",e[e.INVALID_JWT_SIG=5]="INVALID_JWT_SIG",e[e.INVALID_JWT_JWK_NOT_FOUND=6]="INVALID_JWT_JWK_NOT_FOUND",e[e.INVALID_JWT_ISS_NOT_RECOGNIZED=7]="INVALID_JWT_ISS_NOT_RECOGNIZED",e[e.INVALID_JWT_FEDERATED_ISS_NOT_SUPPORTED=8]="INVALID_JWT_FEDERATED_ISS_NOT_SUPPORTED",e[e.INVALID_TW_SIG_VERIFICATION_FAILED=9]="INVALID_TW_SIG_VERIFICATION_FAILED",e[e.INVALID_TW_SIG_PUBLIC_KEY_NOT_FOUND=10]="INVALID_TW_SIG_PUBLIC_KEY_NOT_FOUND",e[e.INVALID_EXPIRY_HORIZON=11]="INVALID_EXPIRY_HORIZON",e[e.JWT_PARSING_ERROR=12]="JWT_PARSING_ERROR",e[e.JWK_FETCH_FAILED=13]="JWK_FETCH_FAILED",e[e.JWK_FETCH_FAILED_FEDERATED=14]="JWK_FETCH_FAILED_FEDERATED",e[e.RATE_LIMIT_EXCEEDED=15]="RATE_LIMIT_EXCEEDED",e[e.PEPPER_SERVICE_INTERNAL_ERROR=16]="PEPPER_SERVICE_INTERNAL_ERROR",e[e.PEPPER_SERVICE_BAD_REQUEST=17]="PEPPER_SERVICE_BAD_REQUEST",e[e.PEPPER_SERVICE_OTHER=18]="PEPPER_SERVICE_OTHER",e[e.PROVER_SERVICE_INTERNAL_ERROR=19]="PROVER_SERVICE_INTERNAL_ERROR",e[e.PROVER_SERVICE_BAD_REQUEST=20]="PROVER_SERVICE_BAD_REQUEST",e[e.PROVER_SERVICE_OTHER=21]="PROVER_SERVICE_OTHER",e[e.FULL_NODE_CONFIG_LOOKUP_ERROR=22]="FULL_NODE_CONFIG_LOOKUP_ERROR",e[e.FULL_NODE_VERIFICATION_KEY_LOOKUP_ERROR=23]="FULL_NODE_VERIFICATION_KEY_LOOKUP_ERROR",e[e.FULL_NODE_JWKS_LOOKUP_ERROR=24]="FULL_NODE_JWKS_LOOKUP_ERROR",e[e.FULL_NODE_OTHER=25]="FULL_NODE_OTHER",e[e.UNKNOWN=26]="UNKNOWN",e))(u||{}),A={0:["The ephemeral keypair has expired.",2,"Re-authentiate to continue using your keyless account"],1:["The required proof could not be found.",3,"Call `await account.checkKeylessAccountValidity()` to wait for asyncronous changes and check for account validity before signing or serializing."],2:["The required proof failed to fetch.",3,"Try re-authentiating. If the error persists join the telegram group at https://t.me/+h5CN-W35yUFiYzkx for further support"],3:["The provided proof is invalid.",3,"Try re-authentiating. If the error persists join the telegram group at https://t.me/+h5CN-W35yUFiYzkx for further support"],4:["The verification key used to authenticate was updated.",2,"Re-authentiate to continue using your keyless account"],5:["The JWK was found, but JWT failed verification",3,"Try re-authentiating. If the error persists join the telegram group at https://t.me/+h5CN-W35yUFiYzkx for further support"],6:["The JWK required to verify the JWT could not be found. The JWK may have been rotated out.",2,"Re-authentiate to continue using your keyless account"],7:["The JWT issuer is not recognized.",3,"Update the invalid request parameters and reauthenticate."],8:["The JWT issuer is not supported by the Federated Keyless ",0,"Try re-authentiating. If the error persists join the telegram group at https://t.me/+h5CN-W35yUFiYzkx for further support"],9:["The training wheels signature is invalid.",3,"Try re-authentiating. If the error persists join the telegram group at https://t.me/+h5CN-W35yUFiYzkx for further support"],10:["The public key used to verify the training wheels signature was not found.",2,"Re-authentiate to continue using your keyless account"],11:["The expiry horizon is invalid.",2,"Re-authentiate to continue using your keyless account"],13:["Failed to fetch JWKS.",1,"For support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],14:["Failed to fetch JWKS for Federated Keyless provider.",1,"For support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],15:["Rate limit exceeded. Too many requests in a short period.",0,"Cache the keyless account and reuse it to avoid making too many requests. Keyless accounts are valid until either the EphemeralKeyPair expires, when the JWK is rotated, or when the proof verifying key is changed, whichever comes soonest."],16:["Internal error from Pepper service.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],17:["Bad request sent to Pepper service.",0,"Update the invalid request parameters and reauthenticate."],18:["Unknown error from Pepper service.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],19:["Internal error from Prover service.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],20:["Bad request sent to Prover service.",0,"Update the invalid request parameters and reauthenticate."],21:["Unknown error from Prover service.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],12:["Error when parsing JWT. This should never happen. Join https://t.me/+h5CN-W35yUFiYzkx for support",3,"Try instantiating the account again. Avoid manipulating the account object directly"],22:["Error when looking up on-chain keyless configuration.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],23:["Error when looking up on-chain verification key.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],24:["Error when looking up on-chain JWKS.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],25:["Unknown error from full node.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],26:["An unknown error has occurred.",4,"Error unknown. For support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"]},O=class i extends Error{constructor(o){let{innerError:E,category:t,resolutionTip:R,type:r,message:_=A[r][0],details:n}=o;super(_),this.name="KeylessError",this.innerError=E,this.category=t,this.resolutionTip=R,this.type=r,this.details=n,this.message=i.constructMessage(_,R,E,n)}static constructMessage(o,E,t,R){let r=`
2
2
  Message: ${o}`;return R&&(r+=`
3
3
  Details: ${R}`),t instanceof I?r+=`
4
4
  AptosApiError: ${t.message}`:t!==void 0&&(r+=`
5
5
  Error: ${T(t)}`),r+=`
6
6
  KeylessErrorResolutionTip: ${E}`,r}static fromErrorType(o){let{error:E,type:t,details:R}=o,[r,_,n]=A[t];return new i({message:r,details:R,innerError:E,category:_,resolutionTip:n,type:t})}},I=class extends Error{constructor({apiType:o,aptosRequest:E,aptosResponse:t}){super(P({apiType:o,aptosRequest:E,aptosResponse:t})),this.name="AptosApiError",this.url=t.url,this.status=t.status,this.statusText=t.statusText,this.data=t.data,this.request=E}};function P({apiType:i,aptosRequest:o,aptosResponse:E}){let t=E.headers?.traceparent?.split("-")[1],R=t?`(trace_id:${t}) `:"",r=`Request to [${i}]: ${o.method} ${E.url??o.url} ${R}failed with`;return i==="Indexer"&&E.data?.errors?.[0]?.message!=null?`${r}: ${E.data.errors[0].message}`:E.data?.message!=null&&E.data?.error_code!=null?`${r}: ${JSON.stringify(E.data)}`:`${r} status: ${E.statusText}(code:${E.status}) and response body: ${S(E.data)}`}var a=400;function S(i){let o=JSON.stringify(i);return o.length<=a?o:`truncated(original_size:${o.length}): ${o.slice(0,a/2)}...${o.slice(-a/2)}`}export{N as a,l as b,u as c,O as d,I as e};
7
- //# sourceMappingURL=chunk-BUTMGMSD.mjs.map
7
+ //# sourceMappingURL=chunk-TH5JCPN2.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as s,c as d,e as t}from"./chunk-EBMEXURY.mjs";import{a as l,b as n,c as o,d as z,e as c,f as u}from"./chunk-56CNRT2K.mjs";var U=class i extends s{constructor(e){super(),d(e),this.value=e}serialize(e){e.serializeBool(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(5),e.serialize(this)}deserialize(e){return new a(e.deserializeU256())}static deserialize(e){return new i(e.deserializeBool())}},p=class i extends s{constructor(e){super(),t(e,0,l),this.value=e}serialize(e){e.serializeU8(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(0),e.serialize(this)}static deserialize(e){return new i(e.deserializeU8())}},b=class i extends s{constructor(e){super(),t(e,0,n),this.value=e}serialize(e){e.serializeU16(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(6),e.serialize(this)}static deserialize(e){return new i(e.deserializeU16())}},y=class i extends s{constructor(e){super(),t(e,0,o),this.value=e}serialize(e){e.serializeU32(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(7),e.serialize(this)}static deserialize(e){return new i(e.deserializeU32())}},m=class i extends s{constructor(e){super(),t(e,BigInt(0),z),this.value=BigInt(e)}serialize(e){e.serializeU64(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(1),e.serialize(this)}static deserialize(e){return new i(e.deserializeU64())}},B=class i extends s{constructor(e){super(),t(e,BigInt(0),c),this.value=BigInt(e)}serialize(e){e.serializeU128(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(2),e.serialize(this)}static deserialize(e){return new i(e.deserializeU128())}},a=class i extends s{constructor(e){super(),t(e,BigInt(0),u),this.value=BigInt(e)}serialize(e){e.serializeU256(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(8),e.serialize(this)}static deserialize(e){return new i(e.deserializeU256())}};export{U as a,p as b,b as c,y as d,m as e,B as f,a as g};
2
- //# sourceMappingURL=chunk-ORMOQWWH.mjs.map
1
+ import{a as s,c as d,e as t}from"./chunk-RXHER6EA.mjs";import{a as l,b as n,c as o,d as z,e as c,f as u}from"./chunk-56CNRT2K.mjs";var U=class i extends s{constructor(e){super(),d(e),this.value=e}serialize(e){e.serializeBool(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(5),e.serialize(this)}deserialize(e){return new a(e.deserializeU256())}static deserialize(e){return new i(e.deserializeBool())}},p=class i extends s{constructor(e){super(),t(e,0,l),this.value=e}serialize(e){e.serializeU8(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(0),e.serialize(this)}static deserialize(e){return new i(e.deserializeU8())}},b=class i extends s{constructor(e){super(),t(e,0,n),this.value=e}serialize(e){e.serializeU16(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(6),e.serialize(this)}static deserialize(e){return new i(e.deserializeU16())}},y=class i extends s{constructor(e){super(),t(e,0,o),this.value=e}serialize(e){e.serializeU32(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(7),e.serialize(this)}static deserialize(e){return new i(e.deserializeU32())}},m=class i extends s{constructor(e){super(),t(e,BigInt(0),z),this.value=BigInt(e)}serialize(e){e.serializeU64(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(1),e.serialize(this)}static deserialize(e){return new i(e.deserializeU64())}},B=class i extends s{constructor(e){super(),t(e,BigInt(0),c),this.value=BigInt(e)}serialize(e){e.serializeU128(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(2),e.serialize(this)}static deserialize(e){return new i(e.deserializeU128())}},a=class i extends s{constructor(e){super(),t(e,BigInt(0),u),this.value=BigInt(e)}serialize(e){e.serializeU256(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(8),e.serialize(this)}static deserialize(e){return new i(e.deserializeU256())}};export{U as a,p as b,b as c,y as d,m as e,B as f,a as g};
2
+ //# sourceMappingURL=chunk-TKXEVD7A.mjs.map
@@ -1,2 +1,2 @@
1
- import{b as c}from"./chunk-Q4C4U6I4.mjs";import{a as o}from"./chunk-EBMEXURY.mjs";import{b as n}from"./chunk-STY74NUA.mjs";import{sha3_256 as d}from"@noble/hashes/sha3";var r=class r extends o{constructor(t){super();let{data:e}=t,i=n.fromHexInput(e);if(i.toUint8Array().length!==r.LENGTH)throw new Error(`Authentication Key length should be ${r.LENGTH}`);this.data=i}serialize(t){t.serializeFixedBytes(this.data.toUint8Array())}static deserialize(t){let e=t.deserializeFixedBytes(r.LENGTH);return new r({data:e})}toUint8Array(){return this.data.toUint8Array()}static fromSchemeAndBytes(t){let{scheme:e,input:i}=t,u=n.fromHexInput(i).toUint8Array(),h=new Uint8Array([...u,e]),a=d.create();a.update(h);let y=a.digest();return new r({data:y})}static fromPublicKeyAndScheme(t){let{publicKey:e}=t;return e.authKey()}static fromPublicKey(t){let{publicKey:e}=t;return e.authKey()}derivedAddress(){return new c(this.data.toUint8Array())}};r.LENGTH=32;var s=r;export{s as a};
2
- //# sourceMappingURL=chunk-FN4C3CKC.mjs.map
1
+ import{b as c}from"./chunk-LQOSHBB7.mjs";import{a as o}from"./chunk-RXHER6EA.mjs";import{b as n}from"./chunk-VHY6ZATX.mjs";import{sha3_256 as d}from"@noble/hashes/sha3";var r=class r extends o{constructor(t){super();let{data:e}=t,i=n.fromHexInput(e);if(i.toUint8Array().length!==r.LENGTH)throw new Error(`Authentication Key length should be ${r.LENGTH}`);this.data=i}serialize(t){t.serializeFixedBytes(this.data.toUint8Array())}static deserialize(t){let e=t.deserializeFixedBytes(r.LENGTH);return new r({data:e})}toUint8Array(){return this.data.toUint8Array()}static fromSchemeAndBytes(t){let{scheme:e,input:i}=t,u=n.fromHexInput(i).toUint8Array(),h=new Uint8Array([...u,e]),a=d.create();a.update(h);let y=a.digest();return new r({data:y})}static fromPublicKeyAndScheme(t){let{publicKey:e}=t;return e.authKey()}static fromPublicKey(t){let{publicKey:e}=t;return e.authKey()}derivedAddress(){return new c(this.data.toUint8Array())}};r.LENGTH=32;var s=r;export{s as a};
2
+ //# sourceMappingURL=chunk-TTY5GFMN.mjs.map
@@ -0,0 +1,2 @@
1
+ import{e as u}from"./chunk-TH5JCPN2.mjs";import{a as f}from"./chunk-BY3XFRUM.mjs";async function p(s,R){let{url:t,method:n,body:i,contentType:a,params:o,overrides:e,originMethod:r}=s,d={...e?.HEADERS,"x-aptos-client":`aptos-typescript-sdk/${f}`,"content-type":a??"application/json","x-aptos-typescript-sdk-origin-method":r};return e?.AUTH_TOKEN&&(d.Authorization=`Bearer ${e?.AUTH_TOKEN}`),e?.API_KEY&&(d.Authorization=`Bearer ${e?.API_KEY}`),R.provider({url:t,method:n,body:i,params:o,headers:d,overrides:e})}async function A(s,R){if(R.binaryProvider===void 0)throw new Error("Binary provider is not provided");let{url:t,method:n,body:i,contentType:a,acceptType:o,params:e,overrides:r,originMethod:d}=s,c={...r?.HEADERS,"x-aptos-client":`aptos-typescript-sdk/${f}`,"content-type":a??"application/json",accept:o??"application/x-bcs","x-aptos-typescript-sdk-origin-method":d};return r?.AUTH_TOKEN&&(c.Authorization=`Bearer ${r?.AUTH_TOKEN}`),r?.API_KEY&&(c.Authorization=`Bearer ${r?.API_KEY}`),R.binaryProvider({acceptType:"application/x-bcs",url:t,method:n,body:i,params:e,headers:c,overrides:r})}async function B(s,R,t){let{url:n,path:i}=s,a=i?`${n}/${i}`:n,o=await p({...s,url:a},R.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 u({apiType:t,aptosRequest:s,aptosResponse:e});if(t==="Indexer"){let r=e.data;if(r.errors)throw new u({apiType:t,aptosRequest:s,aptosResponse:e});e.data=r.data}else if((t==="Pepper"||t==="Prover")&&e.status>=400)throw new u({apiType:t,aptosRequest:s,aptosResponse:e});if(e.status>=200&&e.status<300)return e;throw new u({apiType:t,aptosRequest:s,aptosResponse:e})}async function b(s,R,t){let{url:n,path:i}=s,a=i?`${n}/${i}`:n,o=await A({...s,url:a},R.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 u({apiType:t,aptosRequest:s,aptosResponse:e});if(t==="Indexer"){let r=e.data;if(r.errors)throw new u({apiType:t,aptosRequest:s,aptosResponse:e});e.data=r.data}else if((t==="Pepper"||t==="Prover")&&e.status>=400)throw new u({apiType:t,aptosRequest:s,aptosResponse:e});if(e.status>=200&&e.status<300)return e;throw new u({apiType:t,aptosRequest:s,aptosResponse:e})}export{p as a,A as b,B as c,b as d};
2
+ //# sourceMappingURL=chunk-TWETGZ3W.mjs.map