@aptos-labs/ts-sdk 1.29.0 → 1.29.1

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 (305) hide show
  1. package/dist/common/index.d.ts +5 -0
  2. package/dist/common/index.js +3 -3
  3. package/dist/common/index.js.map +1 -1
  4. package/dist/esm/account/AbstractKeylessAccount.d.mts +1 -0
  5. package/dist/esm/account/AbstractKeylessAccount.mjs +1 -1
  6. package/dist/esm/account/Account.mjs +1 -1
  7. package/dist/esm/account/Ed25519Account.mjs +1 -1
  8. package/dist/esm/account/EphemeralKeyPair.mjs +1 -1
  9. package/dist/esm/account/FederatedKeylessAccount.mjs +1 -1
  10. package/dist/esm/account/KeylessAccount.d.mts +5 -1
  11. package/dist/esm/account/KeylessAccount.mjs +1 -1
  12. package/dist/esm/account/MultiKeyAccount.mjs +1 -1
  13. package/dist/esm/account/SingleKeyAccount.mjs +1 -1
  14. package/dist/esm/account/index.mjs +1 -1
  15. package/dist/esm/api/account.d.mts +1 -1
  16. package/dist/esm/api/account.mjs +1 -1
  17. package/dist/esm/api/ans.mjs +1 -1
  18. package/dist/esm/api/aptos.mjs +1 -1
  19. package/dist/esm/api/coin.d.mts +2 -2
  20. package/dist/esm/api/coin.mjs +1 -1
  21. package/dist/esm/api/digitalAsset.d.mts +2 -2
  22. package/dist/esm/api/digitalAsset.mjs +1 -1
  23. package/dist/esm/api/event.d.mts +1 -1
  24. package/dist/esm/api/event.mjs +1 -1
  25. package/dist/esm/api/faucet.mjs +1 -1
  26. package/dist/esm/api/fungibleAsset.d.mts +1 -1
  27. package/dist/esm/api/fungibleAsset.mjs +1 -1
  28. package/dist/esm/api/general.d.mts +2 -2
  29. package/dist/esm/api/general.mjs +1 -1
  30. package/dist/esm/api/index.mjs +1 -1
  31. package/dist/esm/api/keyless.d.mts +1 -1
  32. package/dist/esm/api/keyless.mjs +1 -1
  33. package/dist/esm/api/object.d.mts +2 -2
  34. package/dist/esm/api/object.mjs +1 -1
  35. package/dist/esm/api/staking.d.mts +2 -2
  36. package/dist/esm/api/staking.mjs +1 -1
  37. package/dist/esm/api/table.d.mts +1 -1
  38. package/dist/esm/api/table.mjs +1 -1
  39. package/dist/esm/api/transaction.mjs +1 -1
  40. package/dist/esm/api/transactionSubmission/build.mjs +1 -1
  41. package/dist/esm/api/transactionSubmission/management.mjs +1 -1
  42. package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
  43. package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
  44. package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
  45. package/dist/esm/api/utils.mjs +1 -1
  46. package/dist/esm/bcs/index.mjs +1 -1
  47. package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -1
  48. package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -1
  49. package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
  50. package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
  51. package/dist/esm/bcs/serializer.mjs +1 -1
  52. package/dist/esm/{chunk-MNVUSJEK.mjs → chunk-25NSCK4Q.mjs} +2 -2
  53. package/dist/esm/{chunk-HVMFZF6P.mjs → chunk-25TIHDS6.mjs} +2 -2
  54. package/dist/esm/{chunk-7VKFXX5Q.mjs → chunk-2TQIU7CG.mjs} +2 -2
  55. package/dist/esm/{chunk-F63E4CR7.mjs → chunk-3MCYLML2.mjs} +2 -2
  56. package/dist/esm/{chunk-53RB2PRH.mjs → chunk-3YKAGVHZ.mjs} +2 -2
  57. package/dist/esm/{chunk-RXE6NNOL.mjs → chunk-46D5QX3G.mjs} +2 -2
  58. package/dist/esm/chunk-555I4YHP.mjs +2 -0
  59. package/dist/esm/{chunk-UAEODDZS.mjs.map → chunk-555I4YHP.mjs.map} +1 -1
  60. package/dist/esm/{chunk-QBSU3L5Q.mjs → chunk-5655UVIK.mjs} +2 -2
  61. package/dist/esm/{chunk-YPHH6CAO.mjs → chunk-6QGVRNV6.mjs} +2 -2
  62. package/dist/esm/chunk-6RZZIOGH.mjs +2 -0
  63. package/dist/esm/chunk-6RZZIOGH.mjs.map +1 -0
  64. package/dist/esm/{chunk-CRA2MFJC.mjs → chunk-7V6DEA7G.mjs} +2 -2
  65. package/dist/esm/{chunk-HKBBA653.mjs → chunk-7ZLBJUVZ.mjs} +2 -2
  66. package/dist/esm/{chunk-S2KDCIZN.mjs → chunk-AFOPNDOJ.mjs} +2 -2
  67. package/dist/esm/{chunk-ADE6MVXC.mjs → chunk-B2CXRZL5.mjs} +2 -2
  68. package/dist/esm/{chunk-4HR32TSY.mjs → chunk-B6M7QBUO.mjs} +2 -2
  69. package/dist/esm/{chunk-45IUUCAV.mjs → chunk-BD6BJETG.mjs} +2 -2
  70. package/dist/esm/{chunk-MLDQ2TY2.mjs → chunk-BF4ZE37Q.mjs} +2 -2
  71. package/dist/esm/{chunk-STUXKQVZ.mjs → chunk-BKEJMQQ6.mjs} +2 -2
  72. package/dist/esm/{chunk-JH6VLTMS.mjs → chunk-BRFHAO2Y.mjs} +2 -2
  73. package/dist/esm/{chunk-LNEZEYYE.mjs → chunk-CCMHWJ3Q.mjs} +2 -2
  74. package/dist/esm/{chunk-KUOB4DDE.mjs → chunk-CPPBQDHB.mjs} +2 -2
  75. package/dist/esm/{chunk-5PCNWXRN.mjs → chunk-CVDR5SJR.mjs} +2 -2
  76. package/dist/esm/{chunk-GWSDIX6C.mjs → chunk-DAJOX4PL.mjs} +2 -2
  77. package/dist/esm/{chunk-WJRZWAIS.mjs → chunk-DAXKRXRK.mjs} +2 -2
  78. package/dist/esm/{chunk-4TB3AWQE.mjs → chunk-DF4WKSTK.mjs} +2 -2
  79. package/dist/esm/{chunk-YUNDX5I7.mjs → chunk-E37YRKWK.mjs} +2 -2
  80. package/dist/esm/{chunk-OKAQO57B.mjs → chunk-ECWOLU5T.mjs} +2 -2
  81. package/dist/esm/{chunk-YU3IYJRL.mjs → chunk-EV2USF7B.mjs} +2 -2
  82. package/dist/esm/{chunk-SDWE6WMM.mjs → chunk-EWZ2M5BW.mjs} +2 -2
  83. package/dist/esm/{chunk-QPB6EJVM.mjs → chunk-FRGXKOU5.mjs} +2 -2
  84. package/dist/esm/{chunk-ZROQH5YL.mjs → chunk-G7MWTE2J.mjs} +2 -2
  85. package/dist/esm/{chunk-2BTTX2KO.mjs → chunk-GFGX3QDP.mjs} +2 -2
  86. package/dist/esm/{chunk-HHGJXVAE.mjs → chunk-GGR3P2TG.mjs} +2 -2
  87. package/dist/esm/{chunk-A63SMUOU.mjs → chunk-HPZ2S4FE.mjs} +2 -2
  88. package/dist/esm/{chunk-P3TAY5PP.mjs → chunk-HSPBA2TZ.mjs} +2 -2
  89. package/dist/esm/{chunk-76OH2Z4Q.mjs → chunk-IMGLHDIA.mjs} +2 -2
  90. package/dist/esm/{chunk-367OG3DB.mjs → chunk-IYQISVDX.mjs} +2 -2
  91. package/dist/esm/chunk-K2O24YLZ.mjs +2 -0
  92. package/dist/esm/chunk-K2O24YLZ.mjs.map +1 -0
  93. package/dist/esm/{chunk-G5MGSV7Y.mjs → chunk-KA6FZNWP.mjs} +2 -2
  94. package/dist/esm/{chunk-O2BPA6TS.mjs → chunk-KXBIA4KR.mjs} +2 -2
  95. package/dist/esm/{chunk-3W2DHZXK.mjs → chunk-KYSDF3CA.mjs} +2 -2
  96. package/dist/esm/{chunk-IR4SLC2M.mjs → chunk-L5NY7TMI.mjs} +2 -2
  97. package/dist/esm/{chunk-BSAHPS6E.mjs → chunk-LDFTE4MM.mjs} +2 -2
  98. package/dist/esm/{chunk-G5XLMQ5E.mjs → chunk-LG3DAAPD.mjs} +2 -2
  99. package/dist/esm/{chunk-GDO6Q2FI.mjs → chunk-LGD5KU56.mjs} +2 -2
  100. package/dist/esm/{chunk-BOYYQAB4.mjs → chunk-LXLISEQ4.mjs} +2 -2
  101. package/dist/esm/{chunk-MQGW234H.mjs → chunk-M2QV232A.mjs} +2 -2
  102. package/dist/esm/chunk-MEWFJJJN.mjs +2 -0
  103. package/dist/esm/chunk-MEWFJJJN.mjs.map +1 -0
  104. package/dist/esm/{chunk-FZ5EYP3D.mjs → chunk-MO4IZXLK.mjs} +2 -2
  105. package/dist/esm/{chunk-H6YNXJNF.mjs → chunk-MS4MRLGA.mjs} +2 -2
  106. package/dist/esm/{chunk-A42BPAD4.mjs → chunk-N5JNKD5F.mjs} +2 -2
  107. package/dist/esm/{chunk-2F7Z7RMW.mjs → chunk-NH2S6SB2.mjs} +2 -2
  108. package/dist/esm/{chunk-TQWGQLM6.mjs → chunk-NNRAQP36.mjs} +2 -2
  109. package/dist/esm/{chunk-6UZ3VI5Y.mjs → chunk-OY2IX7HW.mjs} +2 -2
  110. package/dist/esm/{chunk-NWOMSL6K.mjs → chunk-PKXEB7XP.mjs} +2 -2
  111. package/dist/esm/{chunk-BA4RBST6.mjs → chunk-PNXUYOYI.mjs} +2 -2
  112. package/dist/esm/chunk-PUZ25PTD.mjs +2 -0
  113. package/dist/esm/chunk-PUZ25PTD.mjs.map +1 -0
  114. package/dist/esm/{chunk-Y2GWUE7C.mjs → chunk-QCUFTD7K.mjs} +2 -2
  115. package/dist/esm/{chunk-SUJLWCRN.mjs → chunk-QDIKOQRK.mjs} +2 -2
  116. package/dist/esm/{chunk-YDZBU2DJ.mjs → chunk-QIW56MUH.mjs} +2 -2
  117. package/dist/esm/{chunk-GDUAFXIQ.mjs → chunk-QLN2URFX.mjs} +2 -2
  118. package/dist/esm/{chunk-OHRL766V.mjs → chunk-QPP6BX53.mjs} +2 -2
  119. package/dist/esm/{chunk-SWNFKKRE.mjs → chunk-RNTXQYJQ.mjs} +2 -2
  120. package/dist/esm/{chunk-X34JJPW5.mjs → chunk-SAPUZZEU.mjs} +2 -2
  121. package/dist/esm/{chunk-Q3TAEOH5.mjs → chunk-SR24OGHJ.mjs} +2 -2
  122. package/dist/esm/{chunk-D3Q4BC3I.mjs → chunk-STGYDB5E.mjs} +2 -2
  123. package/dist/esm/{chunk-APN6AV5Q.mjs → chunk-SWHLSREF.mjs} +2 -2
  124. package/dist/esm/{chunk-L2QXU6F4.mjs → chunk-TL7DR54X.mjs} +2 -2
  125. package/dist/esm/{chunk-KUZ2YTJH.mjs → chunk-TMW2HIXC.mjs} +2 -2
  126. package/dist/esm/{chunk-R76DHMGR.mjs → chunk-TS3PYRAT.mjs} +2 -2
  127. package/dist/esm/{chunk-F3M2UQA4.mjs → chunk-TVFIUUVY.mjs} +2 -2
  128. package/dist/esm/{chunk-GMBSQDPO.mjs → chunk-U67PFBTL.mjs} +2 -2
  129. package/dist/esm/{chunk-WRRQ7L5K.mjs → chunk-WP7WF54Q.mjs} +2 -2
  130. package/dist/esm/{chunk-BWNTSJOC.mjs → chunk-WS4RPKL6.mjs} +2 -2
  131. package/dist/esm/{chunk-P2EIZ7WL.mjs → chunk-WWZ3METZ.mjs} +2 -2
  132. package/dist/esm/{chunk-S2W4D6NZ.mjs → chunk-X4KEZTUQ.mjs} +2 -2
  133. package/dist/esm/{chunk-F76N4MQO.mjs → chunk-XH7YKEYR.mjs} +2 -2
  134. package/dist/esm/{chunk-ELYS7CWV.mjs → chunk-XK3JFCP3.mjs} +2 -2
  135. package/dist/esm/{chunk-MAMPMCO7.mjs → chunk-XONG5JZ4.mjs} +2 -2
  136. package/dist/esm/{chunk-J64ARI4E.mjs → chunk-XXHW3ZT3.mjs} +2 -2
  137. package/dist/esm/{chunk-OMV7445F.mjs → chunk-Y7F2V3R6.mjs} +2 -2
  138. package/dist/esm/chunk-YHAPZP5A.mjs +2 -0
  139. package/dist/esm/chunk-YHAPZP5A.mjs.map +1 -0
  140. package/dist/esm/{chunk-P5V7OZNN.mjs → chunk-YJCZU6PR.mjs} +2 -2
  141. package/dist/esm/{chunk-5VD4MHB3.mjs → chunk-ZGO2SK6F.mjs} +2 -2
  142. package/dist/esm/cli/index.mjs +1 -1
  143. package/dist/esm/client/core.mjs +1 -1
  144. package/dist/esm/client/get.mjs +1 -1
  145. package/dist/esm/client/index.mjs +1 -1
  146. package/dist/esm/client/post.mjs +1 -1
  147. package/dist/esm/core/account/index.mjs +1 -1
  148. package/dist/esm/core/account/utils/address.mjs +1 -1
  149. package/dist/esm/core/account/utils/index.mjs +1 -1
  150. package/dist/esm/core/accountAddress.mjs +1 -1
  151. package/dist/esm/core/authenticationKey.mjs +1 -1
  152. package/dist/esm/core/crypto/ed25519.mjs +1 -1
  153. package/dist/esm/core/crypto/ephemeral.mjs +1 -1
  154. package/dist/esm/core/crypto/federatedKeyless.mjs +1 -1
  155. package/dist/esm/core/crypto/index.mjs +1 -1
  156. package/dist/esm/core/crypto/keyless.mjs +1 -1
  157. package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
  158. package/dist/esm/core/crypto/multiKey.mjs +1 -1
  159. package/dist/esm/core/crypto/proof.mjs +1 -1
  160. package/dist/esm/core/crypto/publicKey.mjs +1 -1
  161. package/dist/esm/core/crypto/secp256k1.mjs +1 -1
  162. package/dist/esm/core/crypto/signature.mjs +1 -1
  163. package/dist/esm/core/crypto/singleKey.mjs +1 -1
  164. package/dist/esm/core/index.mjs +1 -1
  165. package/dist/esm/index.mjs +1 -1
  166. package/dist/esm/internal/account.mjs +1 -1
  167. package/dist/esm/internal/ans.mjs +1 -1
  168. package/dist/esm/internal/coin.mjs +1 -1
  169. package/dist/esm/internal/digitalAsset.mjs +1 -1
  170. package/dist/esm/internal/event.mjs +1 -1
  171. package/dist/esm/internal/faucet.mjs +1 -1
  172. package/dist/esm/internal/fungibleAsset.mjs +1 -1
  173. package/dist/esm/internal/general.mjs +1 -1
  174. package/dist/esm/internal/keyless.mjs +1 -1
  175. package/dist/esm/internal/object.mjs +1 -1
  176. package/dist/esm/internal/staking.mjs +1 -1
  177. package/dist/esm/internal/table.mjs +1 -1
  178. package/dist/esm/internal/transaction.mjs +1 -1
  179. package/dist/esm/internal/transactionSubmission.mjs +1 -1
  180. package/dist/esm/internal/view.mjs +1 -1
  181. package/dist/esm/transactions/authenticator/account.mjs +1 -1
  182. package/dist/esm/transactions/authenticator/index.mjs +1 -1
  183. package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
  184. package/dist/esm/transactions/index.mjs +1 -1
  185. package/dist/esm/transactions/instances/chainId.mjs +1 -1
  186. package/dist/esm/transactions/instances/identifier.mjs +1 -1
  187. package/dist/esm/transactions/instances/index.mjs +1 -1
  188. package/dist/esm/transactions/instances/moduleId.mjs +1 -1
  189. package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
  190. package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
  191. package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
  192. package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
  193. package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
  194. package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
  195. package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
  196. package/dist/esm/transactions/management/index.mjs +1 -1
  197. package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
  198. package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
  199. package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
  200. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
  201. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
  202. package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +2 -2
  203. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
  204. package/dist/esm/transactions/typeTag/index.mjs +1 -1
  205. package/dist/esm/transactions/typeTag/parser.mjs +1 -1
  206. package/dist/esm/utils/index.mjs +1 -1
  207. package/dist/esm/utils/normalizeBundle.mjs +1 -1
  208. package/dist/esm/version.d.mts +1 -1
  209. package/dist/esm/version.mjs +1 -1
  210. package/package.json +21 -21
  211. package/src/account/AbstractKeylessAccount.ts +3 -2
  212. package/src/account/FederatedKeylessAccount.ts +3 -2
  213. package/src/account/KeylessAccount.ts +9 -2
  214. package/src/client/core.ts +1 -1
  215. package/src/transactions/transactionBuilder/transactionBuilder.ts +13 -2
  216. package/src/version.ts +1 -1
  217. package/dist/esm/chunk-CB6H4VMZ.mjs +0 -2
  218. package/dist/esm/chunk-CB6H4VMZ.mjs.map +0 -1
  219. package/dist/esm/chunk-E4O26ZJB.mjs +0 -2
  220. package/dist/esm/chunk-E4O26ZJB.mjs.map +0 -1
  221. package/dist/esm/chunk-MDJ66AA3.mjs +0 -2
  222. package/dist/esm/chunk-MDJ66AA3.mjs.map +0 -1
  223. package/dist/esm/chunk-UAEODDZS.mjs +0 -2
  224. package/dist/esm/chunk-XMW65WCQ.mjs +0 -2
  225. package/dist/esm/chunk-XMW65WCQ.mjs.map +0 -1
  226. package/dist/esm/chunk-Y3BATGHX.mjs +0 -2
  227. package/dist/esm/chunk-Y3BATGHX.mjs.map +0 -1
  228. /package/dist/esm/{chunk-MNVUSJEK.mjs.map → chunk-25NSCK4Q.mjs.map} +0 -0
  229. /package/dist/esm/{chunk-HVMFZF6P.mjs.map → chunk-25TIHDS6.mjs.map} +0 -0
  230. /package/dist/esm/{chunk-7VKFXX5Q.mjs.map → chunk-2TQIU7CG.mjs.map} +0 -0
  231. /package/dist/esm/{chunk-F63E4CR7.mjs.map → chunk-3MCYLML2.mjs.map} +0 -0
  232. /package/dist/esm/{chunk-53RB2PRH.mjs.map → chunk-3YKAGVHZ.mjs.map} +0 -0
  233. /package/dist/esm/{chunk-RXE6NNOL.mjs.map → chunk-46D5QX3G.mjs.map} +0 -0
  234. /package/dist/esm/{chunk-QBSU3L5Q.mjs.map → chunk-5655UVIK.mjs.map} +0 -0
  235. /package/dist/esm/{chunk-YPHH6CAO.mjs.map → chunk-6QGVRNV6.mjs.map} +0 -0
  236. /package/dist/esm/{chunk-CRA2MFJC.mjs.map → chunk-7V6DEA7G.mjs.map} +0 -0
  237. /package/dist/esm/{chunk-HKBBA653.mjs.map → chunk-7ZLBJUVZ.mjs.map} +0 -0
  238. /package/dist/esm/{chunk-S2KDCIZN.mjs.map → chunk-AFOPNDOJ.mjs.map} +0 -0
  239. /package/dist/esm/{chunk-ADE6MVXC.mjs.map → chunk-B2CXRZL5.mjs.map} +0 -0
  240. /package/dist/esm/{chunk-4HR32TSY.mjs.map → chunk-B6M7QBUO.mjs.map} +0 -0
  241. /package/dist/esm/{chunk-45IUUCAV.mjs.map → chunk-BD6BJETG.mjs.map} +0 -0
  242. /package/dist/esm/{chunk-MLDQ2TY2.mjs.map → chunk-BF4ZE37Q.mjs.map} +0 -0
  243. /package/dist/esm/{chunk-STUXKQVZ.mjs.map → chunk-BKEJMQQ6.mjs.map} +0 -0
  244. /package/dist/esm/{chunk-JH6VLTMS.mjs.map → chunk-BRFHAO2Y.mjs.map} +0 -0
  245. /package/dist/esm/{chunk-LNEZEYYE.mjs.map → chunk-CCMHWJ3Q.mjs.map} +0 -0
  246. /package/dist/esm/{chunk-KUOB4DDE.mjs.map → chunk-CPPBQDHB.mjs.map} +0 -0
  247. /package/dist/esm/{chunk-5PCNWXRN.mjs.map → chunk-CVDR5SJR.mjs.map} +0 -0
  248. /package/dist/esm/{chunk-GWSDIX6C.mjs.map → chunk-DAJOX4PL.mjs.map} +0 -0
  249. /package/dist/esm/{chunk-WJRZWAIS.mjs.map → chunk-DAXKRXRK.mjs.map} +0 -0
  250. /package/dist/esm/{chunk-4TB3AWQE.mjs.map → chunk-DF4WKSTK.mjs.map} +0 -0
  251. /package/dist/esm/{chunk-YUNDX5I7.mjs.map → chunk-E37YRKWK.mjs.map} +0 -0
  252. /package/dist/esm/{chunk-OKAQO57B.mjs.map → chunk-ECWOLU5T.mjs.map} +0 -0
  253. /package/dist/esm/{chunk-YU3IYJRL.mjs.map → chunk-EV2USF7B.mjs.map} +0 -0
  254. /package/dist/esm/{chunk-SDWE6WMM.mjs.map → chunk-EWZ2M5BW.mjs.map} +0 -0
  255. /package/dist/esm/{chunk-QPB6EJVM.mjs.map → chunk-FRGXKOU5.mjs.map} +0 -0
  256. /package/dist/esm/{chunk-ZROQH5YL.mjs.map → chunk-G7MWTE2J.mjs.map} +0 -0
  257. /package/dist/esm/{chunk-2BTTX2KO.mjs.map → chunk-GFGX3QDP.mjs.map} +0 -0
  258. /package/dist/esm/{chunk-HHGJXVAE.mjs.map → chunk-GGR3P2TG.mjs.map} +0 -0
  259. /package/dist/esm/{chunk-A63SMUOU.mjs.map → chunk-HPZ2S4FE.mjs.map} +0 -0
  260. /package/dist/esm/{chunk-P3TAY5PP.mjs.map → chunk-HSPBA2TZ.mjs.map} +0 -0
  261. /package/dist/esm/{chunk-76OH2Z4Q.mjs.map → chunk-IMGLHDIA.mjs.map} +0 -0
  262. /package/dist/esm/{chunk-367OG3DB.mjs.map → chunk-IYQISVDX.mjs.map} +0 -0
  263. /package/dist/esm/{chunk-G5MGSV7Y.mjs.map → chunk-KA6FZNWP.mjs.map} +0 -0
  264. /package/dist/esm/{chunk-O2BPA6TS.mjs.map → chunk-KXBIA4KR.mjs.map} +0 -0
  265. /package/dist/esm/{chunk-3W2DHZXK.mjs.map → chunk-KYSDF3CA.mjs.map} +0 -0
  266. /package/dist/esm/{chunk-IR4SLC2M.mjs.map → chunk-L5NY7TMI.mjs.map} +0 -0
  267. /package/dist/esm/{chunk-BSAHPS6E.mjs.map → chunk-LDFTE4MM.mjs.map} +0 -0
  268. /package/dist/esm/{chunk-G5XLMQ5E.mjs.map → chunk-LG3DAAPD.mjs.map} +0 -0
  269. /package/dist/esm/{chunk-GDO6Q2FI.mjs.map → chunk-LGD5KU56.mjs.map} +0 -0
  270. /package/dist/esm/{chunk-BOYYQAB4.mjs.map → chunk-LXLISEQ4.mjs.map} +0 -0
  271. /package/dist/esm/{chunk-MQGW234H.mjs.map → chunk-M2QV232A.mjs.map} +0 -0
  272. /package/dist/esm/{chunk-FZ5EYP3D.mjs.map → chunk-MO4IZXLK.mjs.map} +0 -0
  273. /package/dist/esm/{chunk-H6YNXJNF.mjs.map → chunk-MS4MRLGA.mjs.map} +0 -0
  274. /package/dist/esm/{chunk-A42BPAD4.mjs.map → chunk-N5JNKD5F.mjs.map} +0 -0
  275. /package/dist/esm/{chunk-2F7Z7RMW.mjs.map → chunk-NH2S6SB2.mjs.map} +0 -0
  276. /package/dist/esm/{chunk-TQWGQLM6.mjs.map → chunk-NNRAQP36.mjs.map} +0 -0
  277. /package/dist/esm/{chunk-6UZ3VI5Y.mjs.map → chunk-OY2IX7HW.mjs.map} +0 -0
  278. /package/dist/esm/{chunk-NWOMSL6K.mjs.map → chunk-PKXEB7XP.mjs.map} +0 -0
  279. /package/dist/esm/{chunk-BA4RBST6.mjs.map → chunk-PNXUYOYI.mjs.map} +0 -0
  280. /package/dist/esm/{chunk-Y2GWUE7C.mjs.map → chunk-QCUFTD7K.mjs.map} +0 -0
  281. /package/dist/esm/{chunk-SUJLWCRN.mjs.map → chunk-QDIKOQRK.mjs.map} +0 -0
  282. /package/dist/esm/{chunk-YDZBU2DJ.mjs.map → chunk-QIW56MUH.mjs.map} +0 -0
  283. /package/dist/esm/{chunk-GDUAFXIQ.mjs.map → chunk-QLN2URFX.mjs.map} +0 -0
  284. /package/dist/esm/{chunk-OHRL766V.mjs.map → chunk-QPP6BX53.mjs.map} +0 -0
  285. /package/dist/esm/{chunk-SWNFKKRE.mjs.map → chunk-RNTXQYJQ.mjs.map} +0 -0
  286. /package/dist/esm/{chunk-X34JJPW5.mjs.map → chunk-SAPUZZEU.mjs.map} +0 -0
  287. /package/dist/esm/{chunk-Q3TAEOH5.mjs.map → chunk-SR24OGHJ.mjs.map} +0 -0
  288. /package/dist/esm/{chunk-D3Q4BC3I.mjs.map → chunk-STGYDB5E.mjs.map} +0 -0
  289. /package/dist/esm/{chunk-APN6AV5Q.mjs.map → chunk-SWHLSREF.mjs.map} +0 -0
  290. /package/dist/esm/{chunk-L2QXU6F4.mjs.map → chunk-TL7DR54X.mjs.map} +0 -0
  291. /package/dist/esm/{chunk-KUZ2YTJH.mjs.map → chunk-TMW2HIXC.mjs.map} +0 -0
  292. /package/dist/esm/{chunk-R76DHMGR.mjs.map → chunk-TS3PYRAT.mjs.map} +0 -0
  293. /package/dist/esm/{chunk-F3M2UQA4.mjs.map → chunk-TVFIUUVY.mjs.map} +0 -0
  294. /package/dist/esm/{chunk-GMBSQDPO.mjs.map → chunk-U67PFBTL.mjs.map} +0 -0
  295. /package/dist/esm/{chunk-WRRQ7L5K.mjs.map → chunk-WP7WF54Q.mjs.map} +0 -0
  296. /package/dist/esm/{chunk-BWNTSJOC.mjs.map → chunk-WS4RPKL6.mjs.map} +0 -0
  297. /package/dist/esm/{chunk-P2EIZ7WL.mjs.map → chunk-WWZ3METZ.mjs.map} +0 -0
  298. /package/dist/esm/{chunk-S2W4D6NZ.mjs.map → chunk-X4KEZTUQ.mjs.map} +0 -0
  299. /package/dist/esm/{chunk-F76N4MQO.mjs.map → chunk-XH7YKEYR.mjs.map} +0 -0
  300. /package/dist/esm/{chunk-ELYS7CWV.mjs.map → chunk-XK3JFCP3.mjs.map} +0 -0
  301. /package/dist/esm/{chunk-MAMPMCO7.mjs.map → chunk-XONG5JZ4.mjs.map} +0 -0
  302. /package/dist/esm/{chunk-J64ARI4E.mjs.map → chunk-XXHW3ZT3.mjs.map} +0 -0
  303. /package/dist/esm/{chunk-OMV7445F.mjs.map → chunk-Y7F2V3R6.mjs.map} +0 -0
  304. /package/dist/esm/{chunk-P5V7OZNN.mjs.map → chunk-YJCZU6PR.mjs.map} +0 -0
  305. /package/dist/esm/{chunk-5VD4MHB3.mjs.map → chunk-ZGO2SK6F.mjs.map} +0 -0
@@ -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} 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 AccountAuthenticatorSingleKey,\n} from \"../authenticator/account\";\nimport {\n TransactionAuthenticator,\n TransactionAuthenticatorEd25519,\n TransactionAuthenticatorFeePayer,\n TransactionAuthenticatorMultiAgent,\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 { getFunctionParts, isScriptDataInput } from \"./helpers\";\nimport { SimpleTransaction } from \"../instances/simpleTransaction\";\nimport { MultiAgentTransaction } from \"../instances/multiAgentTransaction\";\n\n/**\n * We are defining function signatures, each with its specific input and output.\n * These are the possible function signature for our `generateTransactionPayload` function.\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 */\nexport async function generateTransactionPayload(args: InputScriptData): Promise<TransactionPayloadScript>;\nexport async function generateTransactionPayload(\n args: InputEntryFunctionDataWithRemoteABI,\n): Promise<TransactionPayloadEntryFunction>;\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 */\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\nexport function generateTransactionPayloadWithABI(args: InputEntryFunctionDataWithABI): TransactionPayloadEntryFunction;\nexport function generateTransactionPayloadWithABI(args: InputMultiSigDataWithABI): TransactionPayloadMultiSig;\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 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\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\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\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\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 *\n * @returns RawTransaction\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 */\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 * We are defining function signatures, each with its specific input and output.\n * These are the possible function signature for our `generateTransaction` function.\n * When we call our `generateTransaction` function with the relevant type properties,\n * Typescript can infer the return type based on the appropriate function overload.\n */\nexport async function buildTransaction(args: InputGenerateSingleSignerRawTransactionArgs): Promise<SimpleTransaction>;\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 */\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 * Simulate a transaction before signing and submit to chain\n *\n * @param args.transaction A aptos transaction type to sign\n * @param args.signerPublicKey The signer public key\n * @param args.secondarySignersPublicKeys optional. The secondary signers public keys if multi signers transaction\n * @param args.feePayerPublicKey optional. The fee payer public key is a fee payer (aka sponsored) transaction\n * @param args.options optional. SimulateTransactionOptions\n *\n * @returns A signed serialized transaction that can be simulated\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 (secondarySignersPublicKeys) {\n secondaryAccountAuthenticators = secondarySignersPublicKeys.map((publicKey) =>\n getAuthenticatorForSimulation(publicKey),\n );\n }\n if (!feePayerPublicKey) {\n throw new Error(\n \"Must provide a feePayerPublicKey argument to generate a signed fee payer transaction for simulation\",\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 throw new Error(\n \"Must provide a secondarySignersPublicKeys argument to generate a signed multi agent transaction for simulation\",\n );\n }\n\n secondaryAccountAuthenticators = secondarySignersPublicKeys.map((publicKey) =>\n getAuthenticatorForSimulation(publicKey),\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 (accountAuthenticator instanceof AccountAuthenticatorSingleKey) {\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\nexport function getAuthenticatorForSimulation(publicKey: PublicKey) {\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 // TODO add support for AnyMultiKey\n throw new Error(\"Unsupported public key\");\n}\n\n/**\n * Prepare a transaction to be submitted to chain\n *\n * @param args.transaction A aptos transaction type\n * @param args.senderAuthenticator The account authenticator of the transaction sender\n * @param args.secondarySignerAuthenticators optional. For when the transaction is a multi signers transaction\n *\n * @returns A SignedTransaction\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 {\n txnAuthenticator = new TransactionAuthenticatorSingleSender(senderAuthenticator);\n }\n\n return new SignedTransaction(transaction.rawTransaction, txnAuthenticator).bcsToBytes();\n}\n\n/**\n * Hashes the set of values with a SHA-3 256 hash\n * @param input array of UTF-8 strings or Uint8array byte arrays\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 transacitons\n */\nconst TRANSACTION_PREFIX = hashValues([\"APTOS::Transaction\"]);\n\n/**\n * Generates a user transaction hash for the given transaction payload. It must already have an authenticator\n * @param args InputSubmitTransactionData\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 with allowing for pass-through on provided ABIs\n * @param key\n * @param moduleAddress\n * @param moduleName\n * @param functionName\n * @param aptosConfig\n * @param abi\n * @param fetch\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":"2mCAQA,OAAS,YAAYA,OAAgB,qBA+FrC,eAAsBC,GACpBC,EACwC,CACxC,GAAIC,GAAkBD,CAAI,EACxB,OAAOE,GAAiCF,CAAI,EAE9C,GAAM,CAAE,cAAAG,EAAe,WAAAC,EAAY,aAAAC,CAAa,EAAIC,EAAiBN,EAAK,QAAQ,EAE5EO,EAAc,MAAMC,GAAS,CACjC,IAAK,iBACL,cAAAL,EACA,WAAAC,EACA,aAAAC,EACA,YAAaL,EAAK,YAClB,IAAKA,EAAK,IACV,MAAOS,EACT,CAAC,EAGD,OAAOC,GAAkC,CAAE,GAAGV,EAAM,IAAKO,CAAY,CAAC,CACxE,CAIO,SAASG,GACdV,EAC+B,CAC/B,IAAMO,EAAcP,EAAK,IACnB,CAAE,cAAAG,EAAe,WAAAC,EAAY,aAAAC,CAAa,EAAIC,EAAiBN,EAAK,QAAQ,EAG5EW,EAAgBC,EAAoBZ,EAAK,aAAa,EAG5D,GAAIW,EAAc,SAAWJ,EAAY,eAAe,OACtD,MAAM,IAAI,MACR,0CAA0CA,EAAY,eAAe,MAAM,cAAcI,EAAc,MAAM,EAC/G,EAIF,IAAME,EAAuDb,EAAK,kBAAkB,IAAI,CAACc,EAAKC,IAC5FC,EAAgBhB,EAAK,SAAUO,EAAaO,EAAKC,EAAGJ,CAAa,CACnE,EAGA,GAAIE,EAAkB,SAAWN,EAAY,WAAW,OACtD,MAAM,IAAI,MAER,0BAA0BJ,CAAa,KAAKC,CAAU,KAAKC,CAAY,eAAeE,EAAY,WAAW,MAAM,YAAYM,EAAkB,MAAM,EACzJ,EAIF,IAAMI,EAAuBC,EAAc,MACzC,GAAGf,CAAa,KAAKC,CAAU,GAC/BC,EACAM,EACAE,CACF,EAGA,GAAI,oBAAqBb,EAAM,CAC7B,IAAMmB,EAAkBC,EAAe,KAAKpB,EAAK,eAAe,EAChE,OAAO,IAAIqB,EACT,IAAIC,EAASH,EAAiB,IAAII,EAA2BN,CAAoB,CAAC,CACpF,CACF,CAGA,OAAO,IAAIO,EAAgCP,CAAoB,CACjE,CAEA,eAAsBQ,GAA4BzB,EAAkE,CAClH,GAAM,CAAE,cAAAG,EAAe,WAAAC,EAAY,aAAAC,CAAa,EAAIC,EAAiBN,EAAK,QAAQ,EAE5EO,EAAc,MAAMC,GAAS,CACjC,IAAK,gBACL,cAAAL,EACA,WAAAC,EACA,aAAAC,EACA,YAAaL,EAAK,YAClB,IAAKA,EAAK,IACV,MAAO0B,EACT,CAAC,EAGD,OAAOC,GAAmC,CAAE,IAAKpB,EAAa,GAAGP,CAAK,CAAC,CACzE,CAEO,SAAS2B,GAAmC3B,EAAmD,CACpG,IAAMO,EAAcP,EAAK,IACnB,CAAE,cAAAG,EAAe,WAAAC,EAAY,aAAAC,CAAa,EAAIC,EAAiBN,EAAK,QAAQ,EAG5EW,EAAgBC,EAAoBZ,EAAK,aAAa,EAG5D,GAAIW,EAAc,SAAWJ,EAAY,eAAe,OACtD,MAAM,IAAI,MACR,0CAA0CA,EAAY,eAAe,MAAM,cAAcI,EAAc,MAAM,EAC/G,EAIF,IAAME,EACJb,GAAM,mBAAmB,IAAI,CAACc,EAAKC,IAAMC,EAAgBhB,EAAK,SAAUO,EAAaO,EAAKC,EAAGJ,CAAa,CAAC,GAAK,CAAC,EAGnH,GAAIE,EAAkB,SAAWN,EAAY,WAAW,OACtD,MAAM,IAAI,MAER,0BAA0BJ,CAAa,KAAKC,CAAU,KAAKC,CAAY,eAAeE,EAAY,WAAW,MAAM,YAAYM,EAAkB,MAAM,EACzJ,EAIF,OAAOK,EAAc,MAAM,GAAGf,CAAa,KAAKC,CAAU,GAAIC,EAAcM,EAAeE,CAAiB,CAC9G,CAEA,SAASX,GAAiCF,EAAuB,CAC/D,OAAO,IAAI4B,EACT,IAAIC,EACFC,EAAI,aAAa9B,EAAK,QAAQ,EAAE,aAAa,EAC7CY,EAAoBZ,EAAK,aAAa,EACtCA,EAAK,iBACP,CACF,CACF,CAWA,eAAsB+B,GAAuB/B,EAMjB,CAC1B,GAAM,CAAE,YAAAgC,EAAa,OAAAC,EAAQ,QAAAC,EAAS,QAAAC,EAAS,gBAAAC,CAAgB,EAAIpC,EAE7DqC,EAAa,SACbC,EAAiBN,EAAY,OAAO,EAC/B,CAAE,QAASM,EAAiBN,EAAY,OAAO,CAAE,EAGnD,CAAE,SADI,MAAMO,EAAc,CAAE,YAAAP,CAAY,CAAC,GACzB,QAAS,EAG5BQ,EAAkB,SAClBL,GAAS,aACJ,CAAE,YAAaA,EAAQ,YAAa,EAGtC,CAAE,aADU,MAAMM,GAAsB,CAAE,YAAAT,CAAY,CAAC,GAC7B,YAAa,EAG1CU,EAA0B,SAAY,CAC1C,IAAMC,EAAoB,SACpBR,GAAS,wBAA0B,OAC9BA,EAAQ,uBAGT,MAAMS,GAAQ,CAAE,YAAAZ,EAAa,eAAgBC,CAAO,CAAC,GAAG,gBAOlE,GAAIG,GAAmBhB,EAAe,KAAKgB,CAAe,EAAE,OAAOhB,EAAe,IAAI,EAGpF,GAAI,CAEF,OAAO,MAAMuB,EAAkB,CACjC,MAAiB,CACf,MAAO,EACT,KAEA,QAAOA,EAAkB,CAE7B,EACM,CAAC,CAAE,QAAAE,CAAQ,EAAG,CAAE,YAAAC,CAAY,EAAGC,CAAc,EAAI,MAAM,QAAQ,IAAI,CACvEV,EAAW,EACXG,EAAgB,EAChBE,EAAwB,CAC1B,CAAC,EAEK,CAAE,aAAAM,GAAc,aAAAC,GAAc,gBAAAC,EAAgB,EAAI,CACtD,aAAcf,GAAS,aAAe,OAAOA,EAAQ,YAAY,EAAI,OAAO,GAAsB,EAClG,aAAcA,GAAS,cAAgB,OAAOW,CAAW,EACzD,gBAAiBX,GAAS,iBAAmB,OAAO,KAAK,MAAM,KAAK,IAAI,EAAI,GAAI,EAAI,EAA4B,CAClH,EAEA,OAAO,IAAIgB,EACT/B,EAAe,KAAKa,CAAM,EAC1B,OAAOc,CAAc,EACrBb,EACA,OAAOc,EAAY,EACnB,OAAOC,EAAY,EACnB,OAAOC,EAAe,EACtB,IAAIE,EAAQP,CAAO,CACrB,CACF,CAiCA,eAAsBQ,GAAiBrD,EAAmE,CACxG,GAAM,CAAE,YAAAgC,EAAa,OAAAC,EAAQ,QAAAC,EAAS,QAAAC,EAAS,gBAAAC,CAAgB,EAAIpC,EAE7DsD,EAAS,MAAMvB,GAAuB,CAC1C,YAAAC,EACA,OAAAC,EACA,QAAAC,EACA,QAAAC,EACA,gBAAAC,CACF,CAAC,EAGD,GAAI,6BAA8BpC,EAAM,CACtC,IAAMuD,EACJvD,EAAK,0BAA0B,IAAKwD,GAAWpC,EAAe,KAAKoC,CAAM,CAAC,GAAK,CAAC,EAElF,OAAO,IAAIC,EACTH,EACAC,EACAvD,EAAK,gBAAkBoB,EAAe,KAAKpB,EAAK,eAAe,EAAI,MACrE,CACF,CAEA,OAAO,IAAI0D,EAAkBJ,EAAQtD,EAAK,gBAAkBoB,EAAe,KAAKpB,EAAK,eAAe,EAAI,MAAS,CACnH,CAaO,SAAS2D,GAAuC3D,EAAgD,CACrG,GAAM,CAAE,gBAAA4D,EAAiB,YAAAC,EAAa,2BAAAC,EAA4B,kBAAAC,CAAkB,EAAI/D,EAElFgE,EAAuBC,EAA8BL,CAAe,EAG1E,GAAIC,EAAY,gBAAiB,CAC/B,IAAMK,EAAoB,IAAIC,EAC5BN,EAAY,eACZA,EAAY,0BAA4B,CAAC,EACzCA,EAAY,eACd,EACIO,EAA8D,CAAC,EAMnE,GALIN,IACFM,EAAiCN,EAA2B,IAAKO,GAC/DJ,EAA8BI,CAAS,CACzC,GAEE,CAACN,EACH,MAAM,IAAI,MACR,qGACF,EAEF,IAAMO,EAAwBL,EAA8BF,CAAiB,EAEvEQ,EAA2B,IAAIC,EACnCR,EACAH,EAAY,0BAA4B,CAAC,EACzCO,EACA,CACE,QAASP,EAAY,gBACrB,cAAeS,CACjB,CACF,EACA,OAAO,IAAIG,EAAkBP,EAAkB,QAASK,CAAwB,EAAE,WAAW,CAC/F,CAGA,GAAIV,EAAY,yBAA0B,CACxC,IAAMK,EAAoB,IAAIQ,EAC5Bb,EAAY,eACZA,EAAY,wBACd,EAEIO,EAA8D,CAAC,EAEnE,GAAI,CAACN,EACH,MAAM,IAAI,MACR,gHACF,EAGFM,EAAiCN,EAA2B,IAAKO,GAC/DJ,EAA8BI,CAAS,CACzC,EAEA,IAAME,EAA2B,IAAII,EACnCX,EACAH,EAAY,yBACZO,CACF,EAEA,OAAO,IAAIK,EAAkBP,EAAkB,QAASK,CAAwB,EAAE,WAAW,CAC/F,CAGA,IAAIA,EACJ,GAAIP,aAAgCY,EAClCL,EAA2B,IAAIM,EAC7Bb,EAAqB,WACrBA,EAAqB,SACvB,UACSA,aAAgCc,EACzCP,EAA2B,IAAIQ,EAAqCf,CAAoB,MAExF,OAAM,IAAI,MAAM,oBAAoB,EAEtC,OAAO,IAAIS,EAAkBZ,EAAY,eAAgBU,CAAwB,EAAE,WAAW,CAChG,CAEO,SAASN,EAA8BI,EAAsB,CAOlE,IAAMW,EAHJC,EAAiB,WAAWZ,CAAS,GACrCa,EAA0B,WAAWb,CAAS,GAC9Cc,EAAmB,WAAWd,CAAS,EACQ,IAAIe,EAAaf,CAAS,EAAIA,EAGzEgB,EAAmB,IAAIC,EAAiB,IAAI,WAAW,EAAE,CAAC,EAEhE,GAAIC,EAAiB,WAAWP,CAAgB,EAC9C,OAAO,IAAIJ,EAA4BI,EAAkBK,CAAgB,EAG3E,GAAID,EAAa,WAAWJ,CAAgB,EAC1C,OAAIC,EAAiB,WAAWD,EAAiB,SAAS,EACjD,IAAIF,EACTE,EACA,IAAIQ,EAAaC,EAAiB,uBAAuB,CAAC,CAC5D,EAEK,IAAIX,EAA8BE,EAAkB,IAAIQ,EAAaH,CAAgB,CAAC,EAI/F,MAAM,IAAI,MAAM,wBAAwB,CAC1C,CAWO,SAASK,GAA0B1F,EAA8C,CACtF,GAAM,CAAE,YAAA6D,EAAa,sBAAAS,EAAuB,gCAAAqB,CAAgC,EAAI3F,EAC1E4F,EAAsBC,EAAgBC,EAAsB9F,EAAK,mBAAmB,EAEtF+F,EACJ,GAAIlC,EAAY,gBAAiB,CAC/B,GAAI,CAACS,EACH,MAAM,IAAI,MAAM,0FAA0F,EAE5GyB,EAAmB,IAAIvB,EACrBoB,EACA/B,EAAY,0BAA4B,CAAC,EACzC8B,GAAmC,CAAC,EACpC,CACE,QAAS9B,EAAY,gBACrB,cAAeS,CACjB,CACF,CACF,SAAWT,EAAY,yBAA0B,CAC/C,GAAI,CAAC8B,EACH,MAAM,IAAI,MACR,sGACF,EAEFI,EAAmB,IAAIpB,EACrBiB,EACA/B,EAAY,yBACZ8B,CACF,CACF,MAAWC,aAA+BhB,EACxCmB,EAAmB,IAAIlB,EACrBe,EAAoB,WACpBA,EAAoB,SACtB,EAEAG,EAAmB,IAAIhB,EAAqCa,CAAmB,EAGjF,OAAO,IAAInB,EAAkBZ,EAAY,eAAgBkC,CAAgB,EAAE,WAAW,CACxF,CAMO,SAASC,GAAWC,EAA4C,CACrE,IAAMC,EAAOC,GAAS,OAAO,EAC7B,QAAWC,KAAQH,EACjBC,EAAK,OAAOE,CAAI,EAElB,OAAOF,EAAK,OAAO,CACrB,CAKA,IAAMG,GAAqBL,GAAW,CAAC,oBAAoB,CAAC,EAMrD,SAASM,GAA4BtG,EAA0C,CACpF,IAAMuG,EAAoBb,GAA0B1F,CAAI,EAKxD,OAAO,IAAI8B,EAAIkE,GAAW,CAACK,GAAoB,IAAI,WAAW,CAAC,CAAC,CAAC,EAAGE,CAAiB,CAAC,CAAC,EAAE,SAAS,CACpG,CAYA,eAAe/F,GAAgC,CAC7C,IAAAgG,EACA,cAAArG,EACA,WAAAC,EACA,aAAAC,EACA,YAAA2B,EACA,IAAAyE,EACA,MAAAC,CACF,EAQe,CACb,OAAID,IAAQ,OACHA,EAIFE,EACL,SAAYD,EAAMvG,EAAeC,EAAYC,EAAc2B,CAAW,EACtE,GAAGwE,CAAG,IAAIxE,EAAY,OAAO,IAAI7B,CAAa,IAAIC,CAAU,IAAIC,CAAY,GAC5E,IAAO,GAAK,CACd,EAAE,CACJ","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","TransactionAuthenticatorSingleSender","accountPublicKey","KeylessPublicKey","FederatedKeylessPublicKey","Secp256k1PublicKey","AnyPublicKey","invalidSignature","Ed25519Signature","Ed25519PublicKey","AnySignature","KeylessSignature","generateSignedTransaction","additionalSignersAuthenticators","senderAuthenticator","normalizeBundle","AccountAuthenticator","txnAuthenticator","hashValues","input","hash","sha3Hash","item","TRANSACTION_PREFIX","generateUserTransactionHash","signedTransaction","key","abi","fetch","memoizeAsync"]}
@@ -1,2 +1,2 @@
1
- import{e as x,f as B}from"./chunk-2BTTX2KO.mjs";import{a as k}from"./chunk-AH44UPM4.mjs";import{b as f,d as A}from"./chunk-YU3IYJRL.mjs";import{a as b}from"./chunk-TDGQGILY.mjs";import{d as C}from"./chunk-EXP5STXZ.mjs";import{a as d}from"./chunk-UAL27G6B.mjs";async function H(o){let{aptosConfig:n,options:t}=o;return A({aptosConfig:n,originMethod:"getTransactions",path:"transactions",params:{start:t?.offset,limit:t?.limit}})}async function G(o){let{aptosConfig:n}=o;return k(async()=>{let{data:t}=await f({aptosConfig:n,originMethod:"getGasPriceEstimation",path:"estimate_gas_price"});return t},`gas-price-${n.network}`,1e3*60*5)()}async function W(o){let{aptosConfig:n,ledgerVersion:t}=o,{data:s}=await f({aptosConfig:n,originMethod:"getTransactionByVersion",path:`transactions/by_version/${t}`});return s}async function y(o){let{aptosConfig:n,transactionHash:t}=o,{data:s}=await f({aptosConfig:n,path:`transactions/by_hash/${t}`,originMethod:"getTransactionByHash"});return s}async function O(o){let{aptosConfig:n,transactionHash:t}=o;try{return(await y({aptosConfig:n,transactionHash:t})).type==="pending_transaction"}catch(s){if(s?.status===404)return!0;throw s}}async function R(o){let{aptosConfig:n,transactionHash:t}=o,{data:s}=await f({aptosConfig:n,path:`transactions/wait_by_hash/${t}`,originMethod:"longWaitForTransaction"});return s}async function q(o){let{aptosConfig:n,transactionHash:t,options:s}=o,r=s?.timeoutSecs??20,u=s?.checkSuccess??!0,e=!0,p=0,i,g,l=200,h=1.5;function c(a){if(!(a instanceof b)||(g=a,a.status!==404&&a.status>=400&&a.status<500))throw a}try{i=await y({aptosConfig:n,transactionHash:t}),e=i.type==="pending_transaction"}catch(a){c(a)}if(e){let a=Date.now();try{i=await R({aptosConfig:n,transactionHash:t}),e=i.type==="pending_transaction"}catch(w){c(w)}p=(Date.now()-a)/1e3}for(;e&&!(p>=r);){try{if(i=await y({aptosConfig:n,transactionHash:t}),e=i.type==="pending_transaction",!e)break}catch(a){c(a)}await d(l),p+=l/1e3,l*=h}if(i===void 0)throw g||new m(`Fetching transaction ${t} failed and timed out after ${r} seconds`,i);if(i.type==="pending_transaction")throw new m(`Transaction ${t} timed out in pending state after ${r} seconds`,i);if(!u)return i;if(!i.success)throw new T(`Transaction ${t} failed with an error: ${i.vm_status}`,i);return i}async function z(o){let{aptosConfig:n,processorType:t}=o,s=BigInt(o.minimumLedgerVersion),r=3e3,u=new Date().getTime(),e=BigInt(-1);for(;e<s;){if(new Date().getTime()-u>r)throw new Error("waitForLastSuccessIndexerVersionSync timeout");if(t===void 0?e=await x({aptosConfig:n}):e=(await B({aptosConfig:n,processorType:t})).last_success_version,e>=s)break;await d(200)}}var m=class extends Error{constructor(n,t){super(n),this.lastSubmittedTransaction=t}},T=class extends Error{constructor(n,t){super(n),this.transaction=t}};async function U(o){let{aptosConfig:n,ledgerVersion:t,options:s}=o,{data:r}=await f({aptosConfig:n,originMethod:"getBlockByVersion",path:`blocks/by_version/${t}`,params:{with_transactions:s?.withTransactions}});return P({block:r,...o})}async function X(o){let{aptosConfig:n,blockHeight:t,options:s}=o,{data:r}=await f({aptosConfig:n,originMethod:"getBlockByHeight",path:`blocks/by_height/${t}`,params:{with_transactions:s?.withTransactions}});return P({block:r,...o})}async function P(o){let{aptosConfig:n,block:t,options:s}=o;if(s?.withTransactions){t.transactions=t.transactions??[];let r=t.transactions[t.transactions.length-1],u=BigInt(t.first_version),e=BigInt(t.last_version),p=r?.version,i;if(p===void 0?i=u-1n:i=BigInt(p),i===e)return t;let g=[],l=100n;for(let c=i+1n;c<e;c+=BigInt(100))g.push(H({aptosConfig:n,options:{offset:c,limit:Math.min(Number(l),Number(e-c+1n))}}));let h=await Promise.all(g);for(let c of h)t.transactions.push(...c)}return t}export{H as a,G as b,W as c,y as d,O as e,R as f,q as g,z as h,m as i,T as j,U as k,X as l};
2
- //# sourceMappingURL=chunk-FZ5EYP3D.mjs.map
1
+ import{e as x,f as B}from"./chunk-GFGX3QDP.mjs";import{a as k}from"./chunk-AH44UPM4.mjs";import{b as f,d as A}from"./chunk-EV2USF7B.mjs";import{a as b}from"./chunk-TDGQGILY.mjs";import{a as d}from"./chunk-UAL27G6B.mjs";import{d as C}from"./chunk-EXP5STXZ.mjs";async function H(o){let{aptosConfig:n,options:t}=o;return A({aptosConfig:n,originMethod:"getTransactions",path:"transactions",params:{start:t?.offset,limit:t?.limit}})}async function G(o){let{aptosConfig:n}=o;return k(async()=>{let{data:t}=await f({aptosConfig:n,originMethod:"getGasPriceEstimation",path:"estimate_gas_price"});return t},`gas-price-${n.network}`,1e3*60*5)()}async function W(o){let{aptosConfig:n,ledgerVersion:t}=o,{data:s}=await f({aptosConfig:n,originMethod:"getTransactionByVersion",path:`transactions/by_version/${t}`});return s}async function y(o){let{aptosConfig:n,transactionHash:t}=o,{data:s}=await f({aptosConfig:n,path:`transactions/by_hash/${t}`,originMethod:"getTransactionByHash"});return s}async function O(o){let{aptosConfig:n,transactionHash:t}=o;try{return(await y({aptosConfig:n,transactionHash:t})).type==="pending_transaction"}catch(s){if(s?.status===404)return!0;throw s}}async function R(o){let{aptosConfig:n,transactionHash:t}=o,{data:s}=await f({aptosConfig:n,path:`transactions/wait_by_hash/${t}`,originMethod:"longWaitForTransaction"});return s}async function q(o){let{aptosConfig:n,transactionHash:t,options:s}=o,r=s?.timeoutSecs??20,u=s?.checkSuccess??!0,e=!0,p=0,i,g,l=200,h=1.5;function c(a){if(!(a instanceof b)||(g=a,a.status!==404&&a.status>=400&&a.status<500))throw a}try{i=await y({aptosConfig:n,transactionHash:t}),e=i.type==="pending_transaction"}catch(a){c(a)}if(e){let a=Date.now();try{i=await R({aptosConfig:n,transactionHash:t}),e=i.type==="pending_transaction"}catch(w){c(w)}p=(Date.now()-a)/1e3}for(;e&&!(p>=r);){try{if(i=await y({aptosConfig:n,transactionHash:t}),e=i.type==="pending_transaction",!e)break}catch(a){c(a)}await d(l),p+=l/1e3,l*=h}if(i===void 0)throw g||new m(`Fetching transaction ${t} failed and timed out after ${r} seconds`,i);if(i.type==="pending_transaction")throw new m(`Transaction ${t} timed out in pending state after ${r} seconds`,i);if(!u)return i;if(!i.success)throw new T(`Transaction ${t} failed with an error: ${i.vm_status}`,i);return i}async function z(o){let{aptosConfig:n,processorType:t}=o,s=BigInt(o.minimumLedgerVersion),r=3e3,u=new Date().getTime(),e=BigInt(-1);for(;e<s;){if(new Date().getTime()-u>r)throw new Error("waitForLastSuccessIndexerVersionSync timeout");if(t===void 0?e=await x({aptosConfig:n}):e=(await B({aptosConfig:n,processorType:t})).last_success_version,e>=s)break;await d(200)}}var m=class extends Error{constructor(n,t){super(n),this.lastSubmittedTransaction=t}},T=class extends Error{constructor(n,t){super(n),this.transaction=t}};async function U(o){let{aptosConfig:n,ledgerVersion:t,options:s}=o,{data:r}=await f({aptosConfig:n,originMethod:"getBlockByVersion",path:`blocks/by_version/${t}`,params:{with_transactions:s?.withTransactions}});return P({block:r,...o})}async function X(o){let{aptosConfig:n,blockHeight:t,options:s}=o,{data:r}=await f({aptosConfig:n,originMethod:"getBlockByHeight",path:`blocks/by_height/${t}`,params:{with_transactions:s?.withTransactions}});return P({block:r,...o})}async function P(o){let{aptosConfig:n,block:t,options:s}=o;if(s?.withTransactions){t.transactions=t.transactions??[];let r=t.transactions[t.transactions.length-1],u=BigInt(t.first_version),e=BigInt(t.last_version),p=r?.version,i;if(p===void 0?i=u-1n:i=BigInt(p),i===e)return t;let g=[],l=100n;for(let c=i+1n;c<e;c+=BigInt(100))g.push(H({aptosConfig:n,options:{offset:c,limit:Math.min(Number(l),Number(e-c+1n))}}));let h=await Promise.all(g);for(let c of h)t.transactions.push(...c)}return t}export{H as a,G as b,W as c,y as d,O as e,R as f,q as g,z as h,m as i,T as j,U as k,X as l};
2
+ //# sourceMappingURL=chunk-MO4IZXLK.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as r}from"./chunk-A63SMUOU.mjs";import{b as i}from"./chunk-BCUSI3N6.mjs";var t=class a extends r{constructor(e){super(),this.value=i.fromHexInput(e).toUint8Array()}serialize(e){e.serializeFixedBytes(this.value)}serializeForEntryFunction(e){e.serialize(this)}serializeForScriptFunction(e){e.serialize(this)}static deserialize(e,s){let o=e.deserializeFixedBytes(s);return new a(o)}};export{t as a};
2
- //# sourceMappingURL=chunk-H6YNXJNF.mjs.map
1
+ import{a as r}from"./chunk-HPZ2S4FE.mjs";import{b as i}from"./chunk-BCUSI3N6.mjs";var t=class a extends r{constructor(e){super(),this.value=i.fromHexInput(e).toUint8Array()}serialize(e){e.serializeFixedBytes(this.value)}serializeForEntryFunction(e){e.serialize(this)}serializeForScriptFunction(e){e.serialize(this)}static deserialize(e,s){let o=e.deserializeFixedBytes(s);return new a(o)}};export{t as a};
2
+ //# sourceMappingURL=chunk-MS4MRLGA.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as i}from"./chunk-KUZ2YTJH.mjs";import{a as b,b as g}from"./chunk-45IUUCAV.mjs";import{b as h,d as p}from"./chunk-GWSDIX6C.mjs";import{b as a}from"./chunk-OHRL766V.mjs";import{a as y}from"./chunk-A63SMUOU.mjs";var n=class extends y{static deserialize(e){let r=e.deserializeUleb128AsU32();switch(r){case 0:return o.load(e);case 1:return d.load(e);case 2:return u.load(e);case 3:return l.load(e);case 4:return A.load(e);default:throw new Error(`Unknown variant index for TransactionAuthenticator: ${r}`)}}},o=class s extends n{constructor(e,r){super(),this.public_key=e,this.signature=r}serialize(e){e.serializeU32AsUleb128(0),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let r=h.deserialize(e),t=p.deserialize(e);return new s(r,t)}},d=class s extends n{constructor(e,r){super(),this.public_key=e,this.signature=r}serialize(e){e.serializeU32AsUleb128(1),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let r=b.deserialize(e),t=g.deserialize(e);return new s(r,t)}},u=class s extends n{constructor(e,r,t){super(),this.sender=e,this.secondary_signer_addresses=r,this.secondary_signers=t}serialize(e){e.serializeU32AsUleb128(2),this.sender.serialize(e),e.serializeVector(this.secondary_signer_addresses),e.serializeVector(this.secondary_signers)}static load(e){let r=i.deserialize(e),t=e.deserializeVector(a),c=e.deserializeVector(i);return new s(r,t,c)}},l=class s extends n{constructor(e,r,t,c){super(),this.sender=e,this.secondary_signer_addresses=r,this.secondary_signers=t,this.fee_payer=c}serialize(e){e.serializeU32AsUleb128(3),this.sender.serialize(e),e.serializeVector(this.secondary_signer_addresses),e.serializeVector(this.secondary_signers),this.fee_payer.address.serialize(e),this.fee_payer.authenticator.serialize(e)}static load(e){let r=i.deserialize(e),t=e.deserializeVector(a),c=e.deserializeVector(i),_=a.deserialize(e),z=i.deserialize(e),S={address:_,authenticator:z};return new s(r,t,c,S)}},A=class s extends n{constructor(e){super(),this.sender=e}serialize(e){e.serializeU32AsUleb128(4),this.sender.serialize(e)}static load(e){let r=i.deserialize(e);return new s(r)}};export{n as a,o as b,d as c,u as d,l as e,A as f};
2
- //# sourceMappingURL=chunk-A42BPAD4.mjs.map
1
+ import{a as i}from"./chunk-TMW2HIXC.mjs";import{a as b,b as g}from"./chunk-BD6BJETG.mjs";import{b as h,d as p}from"./chunk-DAJOX4PL.mjs";import{b as a}from"./chunk-QPP6BX53.mjs";import{a as y}from"./chunk-HPZ2S4FE.mjs";var n=class extends y{static deserialize(e){let r=e.deserializeUleb128AsU32();switch(r){case 0:return o.load(e);case 1:return d.load(e);case 2:return u.load(e);case 3:return l.load(e);case 4:return A.load(e);default:throw new Error(`Unknown variant index for TransactionAuthenticator: ${r}`)}}},o=class s extends n{constructor(e,r){super(),this.public_key=e,this.signature=r}serialize(e){e.serializeU32AsUleb128(0),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let r=h.deserialize(e),t=p.deserialize(e);return new s(r,t)}},d=class s extends n{constructor(e,r){super(),this.public_key=e,this.signature=r}serialize(e){e.serializeU32AsUleb128(1),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let r=b.deserialize(e),t=g.deserialize(e);return new s(r,t)}},u=class s extends n{constructor(e,r,t){super(),this.sender=e,this.secondary_signer_addresses=r,this.secondary_signers=t}serialize(e){e.serializeU32AsUleb128(2),this.sender.serialize(e),e.serializeVector(this.secondary_signer_addresses),e.serializeVector(this.secondary_signers)}static load(e){let r=i.deserialize(e),t=e.deserializeVector(a),c=e.deserializeVector(i);return new s(r,t,c)}},l=class s extends n{constructor(e,r,t,c){super(),this.sender=e,this.secondary_signer_addresses=r,this.secondary_signers=t,this.fee_payer=c}serialize(e){e.serializeU32AsUleb128(3),this.sender.serialize(e),e.serializeVector(this.secondary_signer_addresses),e.serializeVector(this.secondary_signers),this.fee_payer.address.serialize(e),this.fee_payer.authenticator.serialize(e)}static load(e){let r=i.deserialize(e),t=e.deserializeVector(a),c=e.deserializeVector(i),_=a.deserialize(e),z=i.deserialize(e),S={address:_,authenticator:z};return new s(r,t,c,S)}},A=class s extends n{constructor(e){super(),this.sender=e}serialize(e){e.serializeU32AsUleb128(4),this.sender.serialize(e)}static load(e){let r=i.deserialize(e);return new s(r)}};export{n as a,o as b,d as c,u as d,l as e,A as f};
2
+ //# sourceMappingURL=chunk-N5JNKD5F.mjs.map
@@ -1,2 +1,2 @@
1
- import{c as a}from"./chunk-IR4SLC2M.mjs";import e from"eventemitter3";var i=class extends e{constructor(t){super(),this.config=t}start(t){let{sender:n}=t;this.account=n,this.transactionWorker=new a(this.config,n),this.transactionWorker.start(),this.registerToEvents()}push(t){let{data:n,options:o}=t;for(let r of n)this.transactionWorker.push(r,o)}registerToEvents(){this.transactionWorker.on("transactionSent",async t=>{this.emit("transactionSent",t)}),this.transactionWorker.on("transactionSendFailed",async t=>{this.emit("transactionSendFailed",t)}),this.transactionWorker.on("transactionExecuted",async t=>{this.emit("transactionExecuted",t)}),this.transactionWorker.on("transactionExecutionFailed",async t=>{this.emit("transactionExecutionFailed",t)}),this.transactionWorker.on("executionFinish",async t=>{this.emit("executionFinish",t)})}forSingleAccount(t){try{let{sender:n,data:o,options:r}=t;this.start({sender:n}),this.push({data:o,options:r})}catch(n){throw new Error(`failed to submit transactions with error: ${n}`)}}};export{i as a};
2
- //# sourceMappingURL=chunk-2F7Z7RMW.mjs.map
1
+ import{c as a}from"./chunk-L5NY7TMI.mjs";import e from"eventemitter3";var i=class extends e{constructor(t){super(),this.config=t}start(t){let{sender:n}=t;this.account=n,this.transactionWorker=new a(this.config,n),this.transactionWorker.start(),this.registerToEvents()}push(t){let{data:n,options:o}=t;for(let r of n)this.transactionWorker.push(r,o)}registerToEvents(){this.transactionWorker.on("transactionSent",async t=>{this.emit("transactionSent",t)}),this.transactionWorker.on("transactionSendFailed",async t=>{this.emit("transactionSendFailed",t)}),this.transactionWorker.on("transactionExecuted",async t=>{this.emit("transactionExecuted",t)}),this.transactionWorker.on("transactionExecutionFailed",async t=>{this.emit("transactionExecutionFailed",t)}),this.transactionWorker.on("executionFinish",async t=>{this.emit("executionFinish",t)})}forSingleAccount(t){try{let{sender:n,data:o,options:r}=t;this.start({sender:n}),this.push({data:o,options:r})}catch(n){throw new Error(`failed to submit transactions with error: ${n}`)}}};export{i as a};
2
+ //# sourceMappingURL=chunk-NH2S6SB2.mjs.map
@@ -1,2 +1,2 @@
1
- import{c as l}from"./chunk-NWOMSL6K.mjs";import{a as k,b as c,d as A,e as g,f as P,g as z,h as D,i as m,j as L,l as R,m as X,n as q,o as H,p as J,q as K,s as i,t as Q}from"./chunk-53RB2PRH.mjs";import{c as j}from"./chunk-STUXKQVZ.mjs";import{b as S,c as I,d as x,e as M,f as O,g as C,h as _,i as V,n as G}from"./chunk-SUJLWCRN.mjs";import{b as d}from"./chunk-OHRL766V.mjs";import{a as y,c as F,d as s}from"./chunk-LNEZEYYE.mjs";import{a as w,b as h,c as B,d as E,e as v,f as $,g as b}from"./chunk-YPHH6CAO.mjs";var Y=new TextEncoder;function sn(n){return n?.map(e=>c(e)?l(e):e)??[]}async function W(n,e,t,u){let r=await j({aptosConfig:u,accountAddress:n,moduleName:e});if(r.abi)return r.abi.exposed_functions.find(o=>o.name===t)}async function fn(n,e,t,u){let r=await W(n,e,t,u);if(!r)throw new Error(`Could not find entry function ABI for '${n}::${e}::${t}'`);if(!r.is_entry)throw new Error(`'${n}::${e}::${t}' is not an entry function`);let o=Q(r),T=[];for(let f=o;f<r.params.length;f+=1)T.push(l(r.params[f],{allowGenerics:!0}));return{signers:o,typeParameters:r.generic_type_params,parameters:T}}async function on(n,e,t,u){let r=await W(n,e,t,u);if(!r)throw new Error(`Could not find view function ABI for '${n}::${e}::${t}'`);if(!r.is_view)throw new Error(`'${n}::${e}::${t}' is not an view function`);let o=[];for(let f=0;f<r.params.length;f+=1)o.push(l(r.params[f],{allowGenerics:!0}));let T=[];for(let f=0;f<r.return.length;f+=1)T.push(l(r.return[f],{allowGenerics:!0}));return{typeParameters:r.generic_type_params,parameters:o,returnTypes:T}}function cn(n,e,t,u,r){if(u>=e.parameters.length)throw new Error(`Too many arguments for '${n}', expected ${e.parameters.length}`);let o=e.parameters[u];return U(t,o,u,r)}function U(n,e,t,u){return z(n)?(p(e,n,t),n):Z(n,e,t,u)}function Z(n,e,t,u){if(e.isBool()){if(k(n))return new w(n);if(c(n)){if(n==="true")return new w(!0);if(n==="false")return new w(!1)}i("boolean",t)}if(e.isAddress()){if(c(n))return d.fromString(n);i("string | AccountAddress",t)}if(e.isU8()){let r=A(n);if(r!==void 0)return new h(r);i("number | string",t)}if(e.isU16()){let r=A(n);if(r!==void 0)return new B(r);i("number | string",t)}if(e.isU32()){let r=A(n);if(r!==void 0)return new E(r);i("number | string",t)}if(e.isU64()){if(g(n))return new v(BigInt(n));i("bigint | number | string",t)}if(e.isU128()){if(g(n))return new $(BigInt(n));i("bigint | number | string",t)}if(e.isU256()){if(g(n))return new b(BigInt(n));i("bigint | number | string",t)}if(e.isGeneric()){let r=e.value;if(r<0||r>=u.length)throw new Error(`Generic argument ${e.toString()} is invalid for argument ${t}`);return U(n,u[r],t,u)}if(e.isVector()){if(e.value.isU8()){if(c(n))return y.U8(Y.encode(n));if(n instanceof Uint8Array)return y.U8(n);if(n instanceof ArrayBuffer)return y.U8(new Uint8Array(n))}if(Array.isArray(n))return new y(n.map(r=>U(r,e.value,t,u)));throw new Error(`Type mismatch for argument ${t}, type '${e.toString()}'`)}if(e.isStruct()){if(e.isString()){if(c(n))return new F(n);i("string",t)}if(e.isObject()){if(c(n))return d.fromString(n);i("string | AccountAddress",t)}if(e.isOption()){if(P(n)){let r=e.value.typeArgs[0];return r instanceof S?new s(null):r instanceof V?new s(null):r instanceof I?new s(null):r instanceof x?new s(null):r instanceof M?new s(null):r instanceof O?new s(null):r instanceof C?new s(null):r instanceof _?new s(null):new s(null)}return new s(U(n,e.value.typeArgs[0],t,u))}throw new Error(`Unsupported struct input type for argument ${t}, type '${e.toString()}'`)}throw new Error(`Type mismatch for argument ${t}, type '${e.toString()}'`)}function p(n,e,t){if(n.isBool()){if(D(e))return;i("Bool",t)}if(n.isAddress()){if(m(e))return;i("AccountAddress",t)}if(n.isU8()){if(R(e))return;i("U8",t)}if(n.isU16()){if(X(e))return;i("U16",t)}if(n.isU32()){if(q(e))return;i("U32",t)}if(n.isU64()){if(H(e))return;i("U64",t)}if(n.isU128()){if(J(e))return;i("U128",t)}if(n.isU256()){if(K(e))return;i("U256",t)}if(n.isVector()){if(e instanceof y){e.values.length>0&&p(n.value,e.values[0],t);return}i("MoveVector",t)}if(n instanceof G){if(n.isString()){if(L(e))return;i("MoveString",t)}if(n.isObject()){if(m(e))return;i("AccountAddress",t)}if(n.isOption()){if(e instanceof s){e.value!==void 0&&p(n.value.typeArgs[0],e.value,t);return}i("MoveOption",t)}}throw new Error(`Type mismatch for argument ${t}, expected '${n.toString()}'`)}export{sn as a,W as b,fn as c,on as d,cn as e,U as f};
2
- //# sourceMappingURL=chunk-TQWGQLM6.mjs.map
1
+ import{a as k,b as c,d as A,e as g,f as P,g as z,h as D,i as m,j as L,l as R,m as X,n as q,o as H,p as J,q as K,s as i,t as Q}from"./chunk-3YKAGVHZ.mjs";import{c as l}from"./chunk-PKXEB7XP.mjs";import{c as j}from"./chunk-BKEJMQQ6.mjs";import{b as S,c as I,d as x,e as M,f as O,g as C,h as _,i as V,n as G}from"./chunk-QDIKOQRK.mjs";import{b as d}from"./chunk-QPP6BX53.mjs";import{a as y,c as F,d as s}from"./chunk-CCMHWJ3Q.mjs";import{a as w,b as h,c as B,d as E,e as v,f as $,g as b}from"./chunk-6QGVRNV6.mjs";var Y=new TextEncoder;function sn(n){return n?.map(e=>c(e)?l(e):e)??[]}async function W(n,e,t,u){let r=await j({aptosConfig:u,accountAddress:n,moduleName:e});if(r.abi)return r.abi.exposed_functions.find(o=>o.name===t)}async function fn(n,e,t,u){let r=await W(n,e,t,u);if(!r)throw new Error(`Could not find entry function ABI for '${n}::${e}::${t}'`);if(!r.is_entry)throw new Error(`'${n}::${e}::${t}' is not an entry function`);let o=Q(r),T=[];for(let f=o;f<r.params.length;f+=1)T.push(l(r.params[f],{allowGenerics:!0}));return{signers:o,typeParameters:r.generic_type_params,parameters:T}}async function on(n,e,t,u){let r=await W(n,e,t,u);if(!r)throw new Error(`Could not find view function ABI for '${n}::${e}::${t}'`);if(!r.is_view)throw new Error(`'${n}::${e}::${t}' is not an view function`);let o=[];for(let f=0;f<r.params.length;f+=1)o.push(l(r.params[f],{allowGenerics:!0}));let T=[];for(let f=0;f<r.return.length;f+=1)T.push(l(r.return[f],{allowGenerics:!0}));return{typeParameters:r.generic_type_params,parameters:o,returnTypes:T}}function cn(n,e,t,u,r){if(u>=e.parameters.length)throw new Error(`Too many arguments for '${n}', expected ${e.parameters.length}`);let o=e.parameters[u];return U(t,o,u,r)}function U(n,e,t,u){return z(n)?(p(e,n,t),n):Z(n,e,t,u)}function Z(n,e,t,u){if(e.isBool()){if(k(n))return new w(n);if(c(n)){if(n==="true")return new w(!0);if(n==="false")return new w(!1)}i("boolean",t)}if(e.isAddress()){if(c(n))return d.fromString(n);i("string | AccountAddress",t)}if(e.isU8()){let r=A(n);if(r!==void 0)return new h(r);i("number | string",t)}if(e.isU16()){let r=A(n);if(r!==void 0)return new B(r);i("number | string",t)}if(e.isU32()){let r=A(n);if(r!==void 0)return new E(r);i("number | string",t)}if(e.isU64()){if(g(n))return new v(BigInt(n));i("bigint | number | string",t)}if(e.isU128()){if(g(n))return new $(BigInt(n));i("bigint | number | string",t)}if(e.isU256()){if(g(n))return new b(BigInt(n));i("bigint | number | string",t)}if(e.isGeneric()){let r=e.value;if(r<0||r>=u.length)throw new Error(`Generic argument ${e.toString()} is invalid for argument ${t}`);return U(n,u[r],t,u)}if(e.isVector()){if(e.value.isU8()){if(c(n))return y.U8(Y.encode(n));if(n instanceof Uint8Array)return y.U8(n);if(n instanceof ArrayBuffer)return y.U8(new Uint8Array(n))}if(Array.isArray(n))return new y(n.map(r=>U(r,e.value,t,u)));throw new Error(`Type mismatch for argument ${t}, type '${e.toString()}'`)}if(e.isStruct()){if(e.isString()){if(c(n))return new F(n);i("string",t)}if(e.isObject()){if(c(n))return d.fromString(n);i("string | AccountAddress",t)}if(e.isOption()){if(P(n)){let r=e.value.typeArgs[0];return r instanceof S?new s(null):r instanceof V?new s(null):r instanceof I?new s(null):r instanceof x?new s(null):r instanceof M?new s(null):r instanceof O?new s(null):r instanceof C?new s(null):r instanceof _?new s(null):new s(null)}return new s(U(n,e.value.typeArgs[0],t,u))}throw new Error(`Unsupported struct input type for argument ${t}, type '${e.toString()}'`)}throw new Error(`Type mismatch for argument ${t}, type '${e.toString()}'`)}function p(n,e,t){if(n.isBool()){if(D(e))return;i("Bool",t)}if(n.isAddress()){if(m(e))return;i("AccountAddress",t)}if(n.isU8()){if(R(e))return;i("U8",t)}if(n.isU16()){if(X(e))return;i("U16",t)}if(n.isU32()){if(q(e))return;i("U32",t)}if(n.isU64()){if(H(e))return;i("U64",t)}if(n.isU128()){if(J(e))return;i("U128",t)}if(n.isU256()){if(K(e))return;i("U256",t)}if(n.isVector()){if(e instanceof y){e.values.length>0&&p(n.value,e.values[0],t);return}i("MoveVector",t)}if(n instanceof G){if(n.isString()){if(L(e))return;i("MoveString",t)}if(n.isObject()){if(m(e))return;i("AccountAddress",t)}if(n.isOption()){if(e instanceof s){e.value!==void 0&&p(n.value.typeArgs[0],e.value,t);return}i("MoveOption",t)}}throw new Error(`Type mismatch for argument ${t}, expected '${n.toString()}'`)}export{sn as a,W as b,fn as c,on as d,cn as e,U as f};
2
+ //# sourceMappingURL=chunk-NNRAQP36.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as c}from"./chunk-P2EIZ7WL.mjs";import{c as p}from"./chunk-NWOMSL6K.mjs";import{c as o}from"./chunk-2BTTX2KO.mjs";import{n as u,q as g,r as A}from"./chunk-VHNX2NUR.mjs";import{f as a,i as r}from"./chunk-SUJLWCRN.mjs";async function G(t){let{aptosConfig:s,options:e}=t,n={query:A,variables:{where_condition:e?.where,limit:e?.limit,offset:e?.offset}};return(await o({aptosConfig:s,query:n,originMethod:"getFungibleAssetMetadata"})).fungible_asset_metadata}async function h(t){let{aptosConfig:s,options:e}=t,n={query:g,variables:{where_condition:e?.where,limit:e?.limit,offset:e?.offset}};return(await o({aptosConfig:s,query:n,originMethod:"getFungibleAssetActivities"})).fungible_asset_activities}async function M(t){let{aptosConfig:s,options:e}=t,n={query:u,variables:{where_condition:e?.where,limit:e?.limit,offset:e?.offset}};return(await o({aptosConfig:s,query:n,originMethod:"getCurrentFungibleAssetBalances"})).current_fungible_asset_balances}var b={typeParameters:[{constraints:[]}],parameters:[p("0x1::object::Object"),new r,new a]};async function x(t){let{aptosConfig:s,sender:e,fungibleAssetMetadataAddress:n,recipient:i,amount:l,options:f}=t;return c({aptosConfig:s,sender:e.accountAddress,data:{function:"0x1::primary_fungible_store::transfer",typeArguments:["0x1::fungible_asset::Metadata"],functionArguments:[n,i,l],abi:b},options:f})}export{G as a,h as b,M as c,x as d};
2
- //# sourceMappingURL=chunk-6UZ3VI5Y.mjs.map
1
+ import{a as c}from"./chunk-WWZ3METZ.mjs";import{c as p}from"./chunk-PKXEB7XP.mjs";import{c as o}from"./chunk-GFGX3QDP.mjs";import{n as u,q as g,r as A}from"./chunk-VHNX2NUR.mjs";import{f as a,i as r}from"./chunk-QDIKOQRK.mjs";async function G(t){let{aptosConfig:s,options:e}=t,n={query:A,variables:{where_condition:e?.where,limit:e?.limit,offset:e?.offset}};return(await o({aptosConfig:s,query:n,originMethod:"getFungibleAssetMetadata"})).fungible_asset_metadata}async function h(t){let{aptosConfig:s,options:e}=t,n={query:g,variables:{where_condition:e?.where,limit:e?.limit,offset:e?.offset}};return(await o({aptosConfig:s,query:n,originMethod:"getFungibleAssetActivities"})).fungible_asset_activities}async function M(t){let{aptosConfig:s,options:e}=t,n={query:u,variables:{where_condition:e?.where,limit:e?.limit,offset:e?.offset}};return(await o({aptosConfig:s,query:n,originMethod:"getCurrentFungibleAssetBalances"})).current_fungible_asset_balances}var b={typeParameters:[{constraints:[]}],parameters:[p("0x1::object::Object"),new r,new a]};async function x(t){let{aptosConfig:s,sender:e,fungibleAssetMetadataAddress:n,recipient:i,amount:l,options:f}=t;return c({aptosConfig:s,sender:e.accountAddress,data:{function:"0x1::primary_fungible_store::transfer",typeArguments:["0x1::fungible_asset::Metadata"],functionArguments:[n,i,l],abi:b},options:f})}export{G as a,h as b,M as c,x as d};
2
+ //# sourceMappingURL=chunk-OY2IX7HW.mjs.map
@@ -1,2 +1,2 @@
1
- import{b as y,c as f,d as x,e as v,f as A,g as C,h as U,i as b,j as I,k as M,l as P,m as E,n as G,o as N}from"./chunk-SUJLWCRN.mjs";import{a as l}from"./chunk-YUNDX5I7.mjs";import{b as w}from"./chunk-OHRL766V.mjs";function V(e){return!!e.match(/^[_a-zA-Z0-9]+$/)}function W(e){return!!e.match(/\s/)}function $(e){return!!e.match(/^T[0-9]+$/)}function F(e){return!!e.match(/^&.+$/)}function k(e){switch(e){case"signer":case"address":case"bool":case"u8":case"u16":case"u32":case"u64":case"u128":case"u256":return!0;default:return!1}}function L(e,i){let c=i;for(;c<e.length;c+=1){let s=e[c];if(!W(s))break}return c}var R=(a=>(a.InvalidTypeTag="unknown type",a.UnexpectedGenericType="unexpected generic type",a.UnexpectedTypeArgumentClose="unexpected '>'",a.UnexpectedWhitespaceCharacter="unexpected whitespace character",a.UnexpectedComma="unexpected ','",a.TypeArgumentCountMismatch="type argument count doesn't match expected amount",a.MissingTypeArgumentClose="no matching '>' for '<'",a.MissingTypeArgument="no type argument before ','",a.UnexpectedPrimitiveTypeArguments="primitive types not expected to have type arguments",a.UnexpectedVectorTypeArgumentCount="vector type expected to have exactly one type argument",a.UnexpectedStructFormat="unexpected struct format, must be of the form 0xaddress::module_name::struct_name",a.InvalidModuleNameCharacter="module name must only contain alphanumeric or '_' characters",a.InvalidStructNameCharacter="struct name must only contain alphanumeric or '_' characters",a.InvalidAddress="struct address must be valid",a))(R||{}),t=class extends Error{constructor(i,c){super(`Failed to parse typeTag '${i}', ${c}`)}};function j(e,i){let c=i?.allowGenerics??!1,s=[],u=[],n=[],o=0,r="",T=1;for(;o<e.length;){let d=e[o];if(d==="<")s.push({savedExpectedTypes:T,savedStr:r,savedTypes:n}),r="",n=[],T=1;else if(d===">"){if(r!==""){let a=g(r,u,c);n.push(a)}let p=s.pop();if(p===void 0)throw new t(e,"unexpected '>'");if(T!==n.length)throw new t(e,"type argument count doesn't match expected amount");let{savedStr:m,savedTypes:h,savedExpectedTypes:_}=p;u=n,n=h,r=m,T=_}else if(d===","){if(s.length===0)throw new t(e,"unexpected ','");if(r.length===0)throw new t(e,"no type argument before ','");let p=g(r,u,c);u=[],n.push(p),r="",T+=1}else if(W(d)){let p=!1;if(r.length!==0){let h=g(r,u,c);u=[],n.push(h),r="",p=!0}o=L(e,o);let m=e[o];if(o<e.length&&p&&m!==","&&m!==">")throw new t(e,"unexpected whitespace character");continue}else r+=d;o+=1}if(s.length>0)throw new t(e,"no matching '>' for '<'");switch(n.length){case 0:return g(r,u,c);case 1:if(r==="")return n[0];throw new t(e,"unexpected ','");default:throw new t(e,"unexpected whitespace character")}}function g(e,i,c){let s=e.trim(),u=s.toLowerCase();if(k(u)&&i.length>0)throw new t(e,"primitive types not expected to have type arguments");switch(s.toLowerCase()){case"signer":return new I;case"bool":return new y;case"address":return new b;case"u8":return new f;case"u16":return new x;case"u32":return new v;case"u64":return new A;case"u128":return new C;case"u256":return new U;case"vector":if(i.length!==1)throw new t(e,"vector type expected to have exactly one type argument");return new E(i[0]);default:if(F(s)){let r=s.substring(1);return new M(g(r,i,c))}if($(s)){if(c)return new P(Number(s.split("T")[1]));throw new t(e,"unexpected generic type")}if(!s.match(/:/))throw new t(e,"unknown type");let n=s.split("::");if(n.length!==3)throw new t(e,"unexpected struct format, must be of the form 0xaddress::module_name::struct_name");let o;try{o=w.fromString(n[0])}catch{throw new t(e,"struct address must be valid")}if(!V(n[1]))throw new t(e,"module name must only contain alphanumeric or '_' characters");if(!V(n[2]))throw new t(e,"struct name must only contain alphanumeric or '_' characters");return new G(new N(o,new l(n[1]),new l(n[2]),i))}}export{R as a,t as b,j as c};
2
- //# sourceMappingURL=chunk-NWOMSL6K.mjs.map
1
+ import{b as y,c as f,d as x,e as v,f as A,g as C,h as U,i as b,j as I,k as M,l as P,m as E,n as G,o as N}from"./chunk-QDIKOQRK.mjs";import{a as l}from"./chunk-E37YRKWK.mjs";import{b as w}from"./chunk-QPP6BX53.mjs";function V(e){return!!e.match(/^[_a-zA-Z0-9]+$/)}function W(e){return!!e.match(/\s/)}function $(e){return!!e.match(/^T[0-9]+$/)}function F(e){return!!e.match(/^&.+$/)}function k(e){switch(e){case"signer":case"address":case"bool":case"u8":case"u16":case"u32":case"u64":case"u128":case"u256":return!0;default:return!1}}function L(e,i){let c=i;for(;c<e.length;c+=1){let s=e[c];if(!W(s))break}return c}var R=(a=>(a.InvalidTypeTag="unknown type",a.UnexpectedGenericType="unexpected generic type",a.UnexpectedTypeArgumentClose="unexpected '>'",a.UnexpectedWhitespaceCharacter="unexpected whitespace character",a.UnexpectedComma="unexpected ','",a.TypeArgumentCountMismatch="type argument count doesn't match expected amount",a.MissingTypeArgumentClose="no matching '>' for '<'",a.MissingTypeArgument="no type argument before ','",a.UnexpectedPrimitiveTypeArguments="primitive types not expected to have type arguments",a.UnexpectedVectorTypeArgumentCount="vector type expected to have exactly one type argument",a.UnexpectedStructFormat="unexpected struct format, must be of the form 0xaddress::module_name::struct_name",a.InvalidModuleNameCharacter="module name must only contain alphanumeric or '_' characters",a.InvalidStructNameCharacter="struct name must only contain alphanumeric or '_' characters",a.InvalidAddress="struct address must be valid",a))(R||{}),t=class extends Error{constructor(i,c){super(`Failed to parse typeTag '${i}', ${c}`)}};function j(e,i){let c=i?.allowGenerics??!1,s=[],u=[],n=[],o=0,r="",T=1;for(;o<e.length;){let d=e[o];if(d==="<")s.push({savedExpectedTypes:T,savedStr:r,savedTypes:n}),r="",n=[],T=1;else if(d===">"){if(r!==""){let a=g(r,u,c);n.push(a)}let p=s.pop();if(p===void 0)throw new t(e,"unexpected '>'");if(T!==n.length)throw new t(e,"type argument count doesn't match expected amount");let{savedStr:m,savedTypes:h,savedExpectedTypes:_}=p;u=n,n=h,r=m,T=_}else if(d===","){if(s.length===0)throw new t(e,"unexpected ','");if(r.length===0)throw new t(e,"no type argument before ','");let p=g(r,u,c);u=[],n.push(p),r="",T+=1}else if(W(d)){let p=!1;if(r.length!==0){let h=g(r,u,c);u=[],n.push(h),r="",p=!0}o=L(e,o);let m=e[o];if(o<e.length&&p&&m!==","&&m!==">")throw new t(e,"unexpected whitespace character");continue}else r+=d;o+=1}if(s.length>0)throw new t(e,"no matching '>' for '<'");switch(n.length){case 0:return g(r,u,c);case 1:if(r==="")return n[0];throw new t(e,"unexpected ','");default:throw new t(e,"unexpected whitespace character")}}function g(e,i,c){let s=e.trim(),u=s.toLowerCase();if(k(u)&&i.length>0)throw new t(e,"primitive types not expected to have type arguments");switch(s.toLowerCase()){case"signer":return new I;case"bool":return new y;case"address":return new b;case"u8":return new f;case"u16":return new x;case"u32":return new v;case"u64":return new A;case"u128":return new C;case"u256":return new U;case"vector":if(i.length!==1)throw new t(e,"vector type expected to have exactly one type argument");return new E(i[0]);default:if(F(s)){let r=s.substring(1);return new M(g(r,i,c))}if($(s)){if(c)return new P(Number(s.split("T")[1]));throw new t(e,"unexpected generic type")}if(!s.match(/:/))throw new t(e,"unknown type");let n=s.split("::");if(n.length!==3)throw new t(e,"unexpected struct format, must be of the form 0xaddress::module_name::struct_name");let o;try{o=w.fromString(n[0])}catch{throw new t(e,"struct address must be valid")}if(!V(n[1]))throw new t(e,"module name must only contain alphanumeric or '_' characters");if(!V(n[2]))throw new t(e,"struct name must only contain alphanumeric or '_' characters");return new G(new N(o,new l(n[1]),new l(n[2]),i))}}export{R as a,t as b,j as c};
2
+ //# sourceMappingURL=chunk-PKXEB7XP.mjs.map
@@ -1,2 +1,2 @@
1
- import{i as s}from"./chunk-G5XLMQ5E.mjs";import{b as u}from"./chunk-76OH2Z4Q.mjs";import{a as c}from"./chunk-G5MGSV7Y.mjs";import{b as t}from"./chunk-OHRL766V.mjs";import{b as d}from"./chunk-A63SMUOU.mjs";import{b as n}from"./chunk-BCUSI3N6.mjs";var o=class r extends u{constructor(e,i){super(),this.jwkAddress=t.from(e),this.keylessPublicKey=i}authKey(){let e=new d;return e.serializeU32AsUleb128(4),e.serializeFixedBytes(this.bcsToBytes()),c.fromSchemeAndBytes({scheme:2,input:e.toUint8Array()})}toUint8Array(){return this.bcsToBytes()}toString(){return n.fromHexInput(this.toUint8Array()).toString()}verifySignature(e){throw new Error("Not yet implemented")}serialize(e){this.jwkAddress.serialize(e),this.keylessPublicKey.serialize(e)}static deserialize(e){let i=t.deserialize(e),l=s.deserialize(e);return new r(i,l)}static isPublicKey(e){return e instanceof r}static create(e){return new r(e.jwkAddress,s.create(e))}static fromJwtAndPepper(e){return new r(e.jwkAddress,s.fromJwtAndPepper(e))}static isInstance(e){return"jwkAddress"in e&&e.jwkAddress instanceof t&&"keylessPublicKey"in e&&e.keylessPublicKey instanceof s}};export{o as a};
2
- //# sourceMappingURL=chunk-BA4RBST6.mjs.map
1
+ import{i as s}from"./chunk-LG3DAAPD.mjs";import{b as u}from"./chunk-IMGLHDIA.mjs";import{a as c}from"./chunk-KA6FZNWP.mjs";import{b as t}from"./chunk-QPP6BX53.mjs";import{b as d}from"./chunk-HPZ2S4FE.mjs";import{b as n}from"./chunk-BCUSI3N6.mjs";var o=class r extends u{constructor(e,i){super(),this.jwkAddress=t.from(e),this.keylessPublicKey=i}authKey(){let e=new d;return e.serializeU32AsUleb128(4),e.serializeFixedBytes(this.bcsToBytes()),c.fromSchemeAndBytes({scheme:2,input:e.toUint8Array()})}toUint8Array(){return this.bcsToBytes()}toString(){return n.fromHexInput(this.toUint8Array()).toString()}verifySignature(e){throw new Error("Not yet implemented")}serialize(e){this.jwkAddress.serialize(e),this.keylessPublicKey.serialize(e)}static deserialize(e){let i=t.deserialize(e),l=s.deserialize(e);return new r(i,l)}static isPublicKey(e){return e instanceof r}static create(e){return new r(e.jwkAddress,s.create(e))}static fromJwtAndPepper(e){return new r(e.jwkAddress,s.fromJwtAndPepper(e))}static isInstance(e){return"jwkAddress"in e&&e.jwkAddress instanceof t&&"keylessPublicKey"in e&&e.keylessPublicKey instanceof s}};export{o as a};
2
+ //# sourceMappingURL=chunk-PNXUYOYI.mjs.map
@@ -0,0 +1,2 @@
1
+ import{a as r}from"./chunk-TDGQGILY.mjs";import{a as d}from"./chunk-555I4YHP.mjs";async function A(s,u){let{url:t,method:n,body:i,contentType:a,params:o,overrides:e,originMethod:R}=s,p={...e?.HEADERS,"x-aptos-client":`aptos-typescript-sdk/${d}`,"content-type":a??"application/json","x-aptos-typescript-sdk-origin-method":R};return e?.AUTH_TOKEN&&(p.Authorization=`Bearer ${e?.AUTH_TOKEN}`),e?.API_KEY&&(p.Authorization=`Bearer ${e?.API_KEY}`),u.provider({url:t,method:n,body:i,params:o,headers:p,overrides:e})}async function P(s,u,t){let{url:n,path:i}=s,a=i?`${n}/${i}`:n,o=await A({...s,url:a},u.client),e={status:o.status,statusText:o.statusText??"No status text provided",data:o.data,headers:o.headers,config:o.config,request:o.request,url:a};if(e.status===401)throw new r({apiType:t,aptosRequest:s,aptosResponse:e});if(t==="Indexer"){let R=e.data;if(R.errors)throw new r({apiType:t,aptosRequest:s,aptosResponse:e});e.data=R.data}else if((t==="Pepper"||t==="Prover")&&e.status>=400)throw new r({apiType:t,aptosRequest:s,aptosResponse:e});if(e.status>=200&&e.status<300)return e;throw new r({apiType:t,aptosRequest:s,aptosResponse:e})}export{A as a,P as b};
2
+ //# sourceMappingURL=chunk-PUZ25PTD.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/client/core.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { AptosConfig } from \"../api/aptosConfig\";\nimport { AptosApiError, AptosResponse } from \"./types\";\nimport { VERSION } from \"../version\";\nimport { AnyNumber, AptosRequest, Client, ClientRequest, ClientResponse, MimeType } from \"../types\";\nimport { AptosApiType } from \"../utils\";\n\n/**\n * Given a url and method, sends the request with axios and\n * returns the response.\n */\nexport async function request<Req, Res>(options: ClientRequest<Req>, client: Client): Promise<ClientResponse<Res>> {\n const { url, method, body, contentType, params, overrides, originMethod } = options;\n const headers: Record<string, string | AnyNumber | boolean | undefined> = {\n ...overrides?.HEADERS,\n \"x-aptos-client\": `aptos-typescript-sdk/${VERSION}`,\n \"content-type\": contentType ?? MimeType.JSON,\n \"x-aptos-typescript-sdk-origin-method\": originMethod,\n };\n\n if (overrides?.AUTH_TOKEN) {\n headers.Authorization = `Bearer ${overrides?.AUTH_TOKEN}`;\n }\n if (overrides?.API_KEY) {\n headers.Authorization = `Bearer ${overrides?.API_KEY}`;\n }\n\n /*\n * make a call using the @aptos-labs/aptos-client package\n * {@link https://www.npmjs.com/package/@aptos-labs/aptos-client}\n */\n return client.provider<Req, Res>({\n url,\n method,\n body,\n params,\n headers,\n overrides,\n });\n}\n\n/**\n * The main function to use when doing an API request.\n *\n * @param aptosRequestOpts AptosRequest\n * @param aptosConfig The config information for the SDK client instance\n * @returns the response or AptosApiError\n */\nexport async function aptosRequest<Req extends {}, Res extends {}>(\n aptosRequestOpts: AptosRequest,\n aptosConfig: AptosConfig,\n apiType: AptosApiType,\n): Promise<AptosResponse<Req, Res>> {\n const { url, path } = aptosRequestOpts;\n const fullUrl = path ? `${url}/${path}` : url;\n const clientResponse = await request<Req, Res>({ ...aptosRequestOpts, url: fullUrl }, aptosConfig.client);\n\n const aptosResponse: AptosResponse<Req, Res> = {\n status: clientResponse.status,\n statusText: clientResponse.statusText ?? \"No status text provided\",\n data: clientResponse.data,\n headers: clientResponse.headers,\n config: clientResponse.config,\n request: clientResponse.request,\n url: fullUrl,\n };\n\n // Handle case for `Unauthorized` error (i.e API_KEY error)\n if (aptosResponse.status === 401) {\n throw new AptosApiError({ apiType, aptosRequest: aptosRequestOpts, aptosResponse });\n }\n\n // to support both fullnode and indexer responses,\n // check if it is an indexer query, and adjust response.data\n if (apiType === AptosApiType.INDEXER) {\n const indexerResponse = aptosResponse.data as any;\n // Handle Indexer general errors\n if (indexerResponse.errors) {\n throw new AptosApiError({\n apiType,\n aptosRequest: aptosRequestOpts,\n aptosResponse,\n });\n }\n aptosResponse.data = indexerResponse.data as Res;\n } else if (apiType === AptosApiType.PEPPER || apiType === AptosApiType.PROVER) {\n if (aptosResponse.status >= 400) {\n throw new AptosApiError({ apiType, aptosRequest: aptosRequestOpts, aptosResponse });\n }\n }\n\n if (aptosResponse.status >= 200 && aptosResponse.status < 300) {\n return aptosResponse;\n }\n\n // We have to explicitly check for all request types, because if the error is a non-indexer error, but\n // comes from an indexer request (e.g. 404), we'll need to mention it appropriately\n throw new AptosApiError({ apiType, aptosRequest: aptosRequestOpts, aptosResponse });\n}\n"],"mappings":"kFAaA,eAAsBA,EAAkBC,EAA6BC,EAA8C,CACjH,GAAM,CAAE,IAAAC,EAAK,OAAAC,EAAQ,KAAAC,EAAM,YAAAC,EAAa,OAAAC,EAAQ,UAAAC,EAAW,aAAAC,CAAa,EAAIR,EACtES,EAAoE,CACxE,GAAGF,GAAW,QACd,iBAAkB,wBAAwBG,CAAO,GACjD,eAAgBL,sBAChB,uCAAwCG,CAC1C,EAEA,OAAID,GAAW,aACbE,EAAQ,cAAgB,UAAUF,GAAW,UAAU,IAErDA,GAAW,UACbE,EAAQ,cAAgB,UAAUF,GAAW,OAAO,IAO/CN,EAAO,SAAmB,CAC/B,IAAAC,EACA,OAAAC,EACA,KAAAC,EACA,OAAAE,EACA,QAAAG,EACA,UAAAF,CACF,CAAC,CACH,CASA,eAAsBI,EACpBC,EACAC,EACAC,EACkC,CAClC,GAAM,CAAE,IAAAZ,EAAK,KAAAa,CAAK,EAAIH,EAChBI,EAAUD,EAAO,GAAGb,CAAG,IAAIa,CAAI,GAAKb,EACpCe,EAAiB,MAAMlB,EAAkB,CAAE,GAAGa,EAAkB,IAAKI,CAAQ,EAAGH,EAAY,MAAM,EAElGK,EAAyC,CAC7C,OAAQD,EAAe,OACvB,WAAYA,EAAe,YAAc,0BACzC,KAAMA,EAAe,KACrB,QAASA,EAAe,QACxB,OAAQA,EAAe,OACvB,QAASA,EAAe,QACxB,IAAKD,CACP,EAGA,GAAIE,EAAc,SAAW,IAC3B,MAAM,IAAIC,EAAc,CAAE,QAAAL,EAAS,aAAcF,EAAkB,cAAAM,CAAc,CAAC,EAKpF,GAAIJ,cAAkC,CACpC,IAAMM,EAAkBF,EAAc,KAEtC,GAAIE,EAAgB,OAClB,MAAM,IAAID,EAAc,CACtB,QAAAL,EACA,aAAcF,EACd,cAAAM,CACF,CAAC,EAEHA,EAAc,KAAOE,EAAgB,IACvC,UAAWN,cAAmCA,eACxCI,EAAc,QAAU,IAC1B,MAAM,IAAIC,EAAc,CAAE,QAAAL,EAAS,aAAcF,EAAkB,cAAAM,CAAc,CAAC,EAItF,GAAIA,EAAc,QAAU,KAAOA,EAAc,OAAS,IACxD,OAAOA,EAKT,MAAM,IAAIC,EAAc,CAAE,QAAAL,EAAS,aAAcF,EAAkB,cAAAM,CAAc,CAAC,CACpF","names":["request","options","client","url","method","body","contentType","params","overrides","originMethod","headers","VERSION","aptosRequest","aptosRequestOpts","aptosConfig","apiType","path","fullUrl","clientResponse","aptosResponse","AptosApiError","indexerResponse"]}
@@ -1,2 +1,2 @@
1
- import{a as r,b as t,c as o,d as s}from"./chunk-OMV7445F.mjs";var i=class{constructor(e){this.config=e}async getPepper(e){return r({aptosConfig:this.config,...e})}async getProof(e){return t({aptosConfig:this.config,...e})}async deriveKeylessAccount(e){return o({aptosConfig:this.config,...e})}async updateFederatedKeylessJwkSetTransaction(e){return s({aptosConfig:this.config,...e})}};export{i as a};
2
- //# sourceMappingURL=chunk-Y2GWUE7C.mjs.map
1
+ import{a as r,b as t,c as o,d as s}from"./chunk-Y7F2V3R6.mjs";var i=class{constructor(e){this.config=e}async getPepper(e){return r({aptosConfig:this.config,...e})}async getProof(e){return t({aptosConfig:this.config,...e})}async deriveKeylessAccount(e){return o({aptosConfig:this.config,...e})}async updateFederatedKeylessJwkSetTransaction(e){return s({aptosConfig:this.config,...e})}};export{i as a};
2
+ //# sourceMappingURL=chunk-QCUFTD7K.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as n}from"./chunk-YUNDX5I7.mjs";import{b as a}from"./chunk-OHRL766V.mjs";import{a as v}from"./chunk-A63SMUOU.mjs";var t=class extends v{static deserialize(e){let r=e.deserializeUleb128AsU32();switch(r){case 0:return c.load(e);case 1:return u.load(e);case 2:return p.load(e);case 3:return z.load(e);case 4:return S.load(e);case 5:return U.load(e);case 6:return y.load(e);case 7:return b.load(e);case 8:return d.load(e);case 9:return g.load(e);case 10:return T.load(e);case 255:return h.load(e);default:throw new Error(`Unknown variant index for TypeTag: ${r}`)}}isBool(){return this instanceof c}isAddress(){return this instanceof S}isGeneric(){return this instanceof h}isSigner(){return this instanceof U}isVector(){return this instanceof y}isStruct(){return this instanceof b}isU8(){return this instanceof u}isU16(){return this instanceof d}isU32(){return this instanceof g}isU64(){return this instanceof p}isU128(){return this instanceof z}isU256(){return this instanceof T}},c=class i extends t{toString(){return"bool"}serialize(e){e.serializeU32AsUleb128(0)}static load(e){return new i}},u=class i extends t{toString(){return"u8"}serialize(e){e.serializeU32AsUleb128(1)}static load(e){return new i}},d=class i extends t{toString(){return"u16"}serialize(e){e.serializeU32AsUleb128(8)}static load(e){return new i}},g=class i extends t{toString(){return"u32"}serialize(e){e.serializeU32AsUleb128(9)}static load(e){return new i}},p=class i extends t{toString(){return"u64"}serialize(e){e.serializeU32AsUleb128(2)}static load(e){return new i}},z=class i extends t{toString(){return"u128"}serialize(e){e.serializeU32AsUleb128(3)}static load(e){return new i}},T=class i extends t{toString(){return"u256"}serialize(e){e.serializeU32AsUleb128(10)}static load(e){return new i}},S=class i extends t{toString(){return"address"}serialize(e){e.serializeU32AsUleb128(4)}static load(e){return new i}},U=class i extends t{toString(){return"signer"}serialize(e){e.serializeU32AsUleb128(5)}static load(e){return new i}},x=class i extends t{constructor(r){super();this.value=r}toString(){return`&${this.value.toString()}`}serialize(r){r.serializeU32AsUleb128(254)}static load(r){let s=t.deserialize(r);return new i(s)}},h=class i extends t{constructor(r){super();this.value=r;if(r<0)throw new Error("Generic type parameter index cannot be negative")}toString(){return`T${this.value}`}serialize(r){r.serializeU32AsUleb128(255),r.serializeU32(this.value)}static load(r){let s=r.deserializeU32();return new i(s)}},y=class i extends t{constructor(r){super();this.value=r}toString(){return`vector<${this.value.toString()}>`}static u8(){return new i(new u)}serialize(r){r.serializeU32AsUleb128(6),this.value.serialize(r)}static load(r){let s=t.deserialize(r);return new i(s)}},b=class i extends t{constructor(r){super();this.value=r}toString(){let r="";return this.value.typeArgs.length>0&&(r=`<${this.value.typeArgs.map(s=>s.toString()).join(", ")}>`),`${this.value.address.toString()}::${this.value.moduleName.identifier}::${this.value.name.identifier}${r}`}serialize(r){r.serializeU32AsUleb128(7),this.value.serialize(r)}static load(r){let s=o.deserialize(r);return new i(s)}isTypeTag(r,s,l){return this.value.moduleName.identifier===s&&this.value.name.identifier===l&&this.value.address.equals(r)}isString(){return this.isTypeTag(a.ONE,"string","String")}isOption(){return this.isTypeTag(a.ONE,"option","Option")}isObject(){return this.isTypeTag(a.ONE,"object","Object")}},o=class i extends v{constructor(e,r,s,l){super(),this.address=e,this.moduleName=r,this.name=s,this.typeArgs=l}serialize(e){e.serialize(this.address),e.serialize(this.moduleName),e.serialize(this.name),e.serializeVector(this.typeArgs)}static deserialize(e){let r=a.deserialize(e),s=n.deserialize(e),l=n.deserialize(e),f=e.deserializeVector(t);return new i(r,s,l,f)}};function O(){return new o(a.ONE,new n("aptos_coin"),new n("AptosCoin"),[])}function E(){return new o(a.ONE,new n("string"),new n("String"),[])}function V(i){return new o(a.ONE,new n("option"),new n("Option"),[i])}function j(i){return new o(a.ONE,new n("object"),new n("Object"),[i])}export{t as a,c as b,u as c,d,g as e,p as f,z as g,T as h,S as i,U as j,x as k,h as l,y as m,b as n,o,O as p,E as q,V as r,j as s};
2
- //# sourceMappingURL=chunk-SUJLWCRN.mjs.map
1
+ import{a as n}from"./chunk-E37YRKWK.mjs";import{b as a}from"./chunk-QPP6BX53.mjs";import{a as v}from"./chunk-HPZ2S4FE.mjs";var t=class extends v{static deserialize(e){let r=e.deserializeUleb128AsU32();switch(r){case 0:return c.load(e);case 1:return u.load(e);case 2:return p.load(e);case 3:return z.load(e);case 4:return S.load(e);case 5:return U.load(e);case 6:return y.load(e);case 7:return b.load(e);case 8:return d.load(e);case 9:return g.load(e);case 10:return T.load(e);case 255:return h.load(e);default:throw new Error(`Unknown variant index for TypeTag: ${r}`)}}isBool(){return this instanceof c}isAddress(){return this instanceof S}isGeneric(){return this instanceof h}isSigner(){return this instanceof U}isVector(){return this instanceof y}isStruct(){return this instanceof b}isU8(){return this instanceof u}isU16(){return this instanceof d}isU32(){return this instanceof g}isU64(){return this instanceof p}isU128(){return this instanceof z}isU256(){return this instanceof T}},c=class i extends t{toString(){return"bool"}serialize(e){e.serializeU32AsUleb128(0)}static load(e){return new i}},u=class i extends t{toString(){return"u8"}serialize(e){e.serializeU32AsUleb128(1)}static load(e){return new i}},d=class i extends t{toString(){return"u16"}serialize(e){e.serializeU32AsUleb128(8)}static load(e){return new i}},g=class i extends t{toString(){return"u32"}serialize(e){e.serializeU32AsUleb128(9)}static load(e){return new i}},p=class i extends t{toString(){return"u64"}serialize(e){e.serializeU32AsUleb128(2)}static load(e){return new i}},z=class i extends t{toString(){return"u128"}serialize(e){e.serializeU32AsUleb128(3)}static load(e){return new i}},T=class i extends t{toString(){return"u256"}serialize(e){e.serializeU32AsUleb128(10)}static load(e){return new i}},S=class i extends t{toString(){return"address"}serialize(e){e.serializeU32AsUleb128(4)}static load(e){return new i}},U=class i extends t{toString(){return"signer"}serialize(e){e.serializeU32AsUleb128(5)}static load(e){return new i}},x=class i extends t{constructor(r){super();this.value=r}toString(){return`&${this.value.toString()}`}serialize(r){r.serializeU32AsUleb128(254)}static load(r){let s=t.deserialize(r);return new i(s)}},h=class i extends t{constructor(r){super();this.value=r;if(r<0)throw new Error("Generic type parameter index cannot be negative")}toString(){return`T${this.value}`}serialize(r){r.serializeU32AsUleb128(255),r.serializeU32(this.value)}static load(r){let s=r.deserializeU32();return new i(s)}},y=class i extends t{constructor(r){super();this.value=r}toString(){return`vector<${this.value.toString()}>`}static u8(){return new i(new u)}serialize(r){r.serializeU32AsUleb128(6),this.value.serialize(r)}static load(r){let s=t.deserialize(r);return new i(s)}},b=class i extends t{constructor(r){super();this.value=r}toString(){let r="";return this.value.typeArgs.length>0&&(r=`<${this.value.typeArgs.map(s=>s.toString()).join(", ")}>`),`${this.value.address.toString()}::${this.value.moduleName.identifier}::${this.value.name.identifier}${r}`}serialize(r){r.serializeU32AsUleb128(7),this.value.serialize(r)}static load(r){let s=o.deserialize(r);return new i(s)}isTypeTag(r,s,l){return this.value.moduleName.identifier===s&&this.value.name.identifier===l&&this.value.address.equals(r)}isString(){return this.isTypeTag(a.ONE,"string","String")}isOption(){return this.isTypeTag(a.ONE,"option","Option")}isObject(){return this.isTypeTag(a.ONE,"object","Object")}},o=class i extends v{constructor(e,r,s,l){super(),this.address=e,this.moduleName=r,this.name=s,this.typeArgs=l}serialize(e){e.serialize(this.address),e.serialize(this.moduleName),e.serialize(this.name),e.serializeVector(this.typeArgs)}static deserialize(e){let r=a.deserialize(e),s=n.deserialize(e),l=n.deserialize(e),f=e.deserializeVector(t);return new i(r,s,l,f)}};function O(){return new o(a.ONE,new n("aptos_coin"),new n("AptosCoin"),[])}function E(){return new o(a.ONE,new n("string"),new n("String"),[])}function V(i){return new o(a.ONE,new n("option"),new n("Option"),[i])}function j(i){return new o(a.ONE,new n("object"),new n("Object"),[i])}export{t as a,c as b,u as c,d,g as e,p as f,z as g,T as h,S as i,U as j,x as k,h as l,y as m,b as n,o,O as p,E as q,V as r,j as s};
2
+ //# sourceMappingURL=chunk-QDIKOQRK.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-YUNDX5I7.mjs";import{b as i}from"./chunk-OHRL766V.mjs";import{a as d}from"./chunk-A63SMUOU.mjs";var o=class t extends d{constructor(e,r){super(),this.address=e,this.name=r}static fromStr(e){let r=e.split("::");if(r.length!==2)throw new Error("Invalid module id.");return new t(i.fromString(r[0]),new s(r[1]))}serialize(e){this.address.serialize(e),this.name.serialize(e)}static deserialize(e){let r=i.deserialize(e),n=s.deserialize(e);return new t(r,n)}};export{o as a};
2
- //# sourceMappingURL=chunk-YDZBU2DJ.mjs.map
1
+ import{a as s}from"./chunk-E37YRKWK.mjs";import{b as i}from"./chunk-QPP6BX53.mjs";import{a as d}from"./chunk-HPZ2S4FE.mjs";var o=class t extends d{constructor(e,r){super(),this.address=e,this.name=r}static fromStr(e){let r=e.split("::");if(r.length!==2)throw new Error("Invalid module id.");return new t(i.fromString(r[0]),new s(r[1]))}serialize(e){this.address.serialize(e),this.name.serialize(e)}static deserialize(e){let r=i.deserialize(e),n=s.deserialize(e);return new t(r,n)}};export{o as a};
2
+ //# sourceMappingURL=chunk-QIW56MUH.mjs.map
@@ -1,2 +1,2 @@
1
- import{b as o}from"./chunk-F76N4MQO.mjs";import{a as r}from"./chunk-SDWE6WMM.mjs";var t=class{constructor(e){this.config=e}async getObjectDataByObjectAddress(e){return await r({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"objects_processor"}),o({aptosConfig:this.config,...e})}};export{t as a};
2
- //# sourceMappingURL=chunk-GDUAFXIQ.mjs.map
1
+ import{b as o}from"./chunk-XH7YKEYR.mjs";import{a as r}from"./chunk-EWZ2M5BW.mjs";var t=class{constructor(e){this.config=e}async getObjectDataByObjectAddress(e){return await r({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"objects_processor"}),o({aptosConfig:this.config,...e})}};export{t as a};
2
+ //# sourceMappingURL=chunk-QLN2URFX.mjs.map
@@ -1,2 +1,2 @@
1
- import{a}from"./chunk-A63SMUOU.mjs";import{a as i}from"./chunk-LG7RJQ57.mjs";import{bytesToHex as o,hexToBytes as l}from"@noble/hashes/utils";var g=(s=>(s.INCORRECT_NUMBER_OF_BYTES="incorrect_number_of_bytes",s.INVALID_HEX_CHARS="invalid_hex_chars",s.TOO_SHORT="too_short",s.TOO_LONG="too_long",s.LEADING_ZERO_X_REQUIRED="leading_zero_x_required",s.LONG_FORM_REQUIRED_UNLESS_SPECIAL="long_form_required_unless_special",s.INVALID_PADDING_ZEROES="INVALID_PADDING_ZEROES",s))(g||{}),r=class r extends a{constructor(t){if(super(),t.length!==r.LENGTH)throw new i("AccountAddress data should be exactly 32 bytes long","incorrect_number_of_bytes");this.data=t}isSpecial(){return this.data.slice(0,this.data.length-1).every(t=>t===0)&&this.data[this.data.length-1]<16}toString(){return`0x${this.toStringWithoutPrefix()}`}toStringWithoutPrefix(){let t=o(this.data);return this.isSpecial()&&(t=t[t.length-1]),t}toStringLong(){return`0x${this.toStringLongWithoutPrefix()}`}toStringLongWithoutPrefix(){return o(this.data)}toUint8Array(){return this.data}serialize(t){t.serializeFixedBytes(this.data)}serializeForEntryFunction(t){let e=this.bcsToBytes();t.serializeBytes(e)}serializeForScriptFunction(t){t.serializeU32AsUleb128(3),t.serialize(this)}static deserialize(t){let e=t.deserializeFixedBytes(r.LENGTH);return new r(e)}static fromStringStrict(t){if(!t.startsWith("0x"))throw new i("Hex string must start with a leading 0x.","leading_zero_x_required");let e=r.fromString(t);if(t.length!==r.LONG_STRING_LENGTH+2)if(e.isSpecial()){if(t.length!==3)throw new i(`The given hex string ${t} is a special address not in LONG form, it must be 0x0 to 0xf without padding zeroes.`,"INVALID_PADDING_ZEROES")}else throw new i(`The given hex string ${t} is not a special address, it must be represented as 0x + 64 chars.`,"long_form_required_unless_special");return e}static fromString(t){let e=t;if(t.startsWith("0x")&&(e=t.slice(2)),e.length===0)throw new i("Hex string is too short, must be 1 to 64 chars long, excluding the leading 0x.","too_short");if(e.length>64)throw new i("Hex string is too long, must be 1 to 64 chars long, excluding the leading 0x.","too_long");let n;try{n=l(e.padStart(64,"0"))}catch(c){throw new i(`Hex characters are invalid: ${c?.message}`,"invalid_hex_chars")}return new r(n)}static from(t){return typeof t=="string"?r.fromString(t):t instanceof Uint8Array?new r(t):t}static fromStrict(t){return typeof t=="string"?r.fromStringStrict(t):t instanceof Uint8Array?new r(t):t}static isValid(t){try{return t.strict?r.fromStrict(t.input):r.from(t.input),{valid:!0}}catch(e){return{valid:!1,invalidReason:e?.invalidReason,invalidReasonMessage:e?.message}}}equals(t){return this.data.length!==t.data.length?!1:this.data.every((e,n)=>e===t.data[n])}};r.LENGTH=32,r.LONG_STRING_LENGTH=64,r.ZERO=r.from("0x0"),r.ONE=r.from("0x1"),r.TWO=r.from("0x2"),r.THREE=r.from("0x3"),r.FOUR=r.from("0x4"),r.A=r.from("0xA");var d=r;export{g as a,d as b};
2
- //# sourceMappingURL=chunk-OHRL766V.mjs.map
1
+ import{a}from"./chunk-HPZ2S4FE.mjs";import{a as i}from"./chunk-LG7RJQ57.mjs";import{bytesToHex as o,hexToBytes as l}from"@noble/hashes/utils";var g=(s=>(s.INCORRECT_NUMBER_OF_BYTES="incorrect_number_of_bytes",s.INVALID_HEX_CHARS="invalid_hex_chars",s.TOO_SHORT="too_short",s.TOO_LONG="too_long",s.LEADING_ZERO_X_REQUIRED="leading_zero_x_required",s.LONG_FORM_REQUIRED_UNLESS_SPECIAL="long_form_required_unless_special",s.INVALID_PADDING_ZEROES="INVALID_PADDING_ZEROES",s))(g||{}),r=class r extends a{constructor(t){if(super(),t.length!==r.LENGTH)throw new i("AccountAddress data should be exactly 32 bytes long","incorrect_number_of_bytes");this.data=t}isSpecial(){return this.data.slice(0,this.data.length-1).every(t=>t===0)&&this.data[this.data.length-1]<16}toString(){return`0x${this.toStringWithoutPrefix()}`}toStringWithoutPrefix(){let t=o(this.data);return this.isSpecial()&&(t=t[t.length-1]),t}toStringLong(){return`0x${this.toStringLongWithoutPrefix()}`}toStringLongWithoutPrefix(){return o(this.data)}toUint8Array(){return this.data}serialize(t){t.serializeFixedBytes(this.data)}serializeForEntryFunction(t){let e=this.bcsToBytes();t.serializeBytes(e)}serializeForScriptFunction(t){t.serializeU32AsUleb128(3),t.serialize(this)}static deserialize(t){let e=t.deserializeFixedBytes(r.LENGTH);return new r(e)}static fromStringStrict(t){if(!t.startsWith("0x"))throw new i("Hex string must start with a leading 0x.","leading_zero_x_required");let e=r.fromString(t);if(t.length!==r.LONG_STRING_LENGTH+2)if(e.isSpecial()){if(t.length!==3)throw new i(`The given hex string ${t} is a special address not in LONG form, it must be 0x0 to 0xf without padding zeroes.`,"INVALID_PADDING_ZEROES")}else throw new i(`The given hex string ${t} is not a special address, it must be represented as 0x + 64 chars.`,"long_form_required_unless_special");return e}static fromString(t){let e=t;if(t.startsWith("0x")&&(e=t.slice(2)),e.length===0)throw new i("Hex string is too short, must be 1 to 64 chars long, excluding the leading 0x.","too_short");if(e.length>64)throw new i("Hex string is too long, must be 1 to 64 chars long, excluding the leading 0x.","too_long");let n;try{n=l(e.padStart(64,"0"))}catch(c){throw new i(`Hex characters are invalid: ${c?.message}`,"invalid_hex_chars")}return new r(n)}static from(t){return typeof t=="string"?r.fromString(t):t instanceof Uint8Array?new r(t):t}static fromStrict(t){return typeof t=="string"?r.fromStringStrict(t):t instanceof Uint8Array?new r(t):t}static isValid(t){try{return t.strict?r.fromStrict(t.input):r.from(t.input),{valid:!0}}catch(e){return{valid:!1,invalidReason:e?.invalidReason,invalidReasonMessage:e?.message}}}equals(t){return this.data.length!==t.data.length?!1:this.data.every((e,n)=>e===t.data[n])}};r.LENGTH=32,r.LONG_STRING_LENGTH=64,r.ZERO=r.from("0x0"),r.ONE=r.from("0x1"),r.TWO=r.from("0x2"),r.THREE=r.from("0x3"),r.FOUR=r.from("0x4"),r.A=r.from("0xA");var d=r;export{g as a,d as b};
2
+ //# sourceMappingURL=chunk-QPP6BX53.mjs.map
@@ -1,2 +1,2 @@
1
- import{b as o}from"./chunk-OHRL766V.mjs";import{a as u,c as r}from"./chunk-LNEZEYYE.mjs";import{e as t}from"./chunk-YPHH6CAO.mjs";import{a as i}from"./chunk-A63SMUOU.mjs";var c=class extends i{constructor(e){super();this.accountAddress=o.ONE;this.moduleName=new r("account");this.structName=new r("RotationProofChallenge");this.sequenceNumber=new t(e.sequenceNumber),this.originator=e.originator,this.currentAuthKey=e.currentAuthKey,this.newPublicKey=u.U8(e.newPublicKey.toUint8Array())}serialize(e){e.serialize(this.accountAddress),e.serialize(this.moduleName),e.serialize(this.structName),e.serialize(this.sequenceNumber),e.serialize(this.originator),e.serialize(this.currentAuthKey),e.serialize(this.newPublicKey)}};export{c as a};
2
- //# sourceMappingURL=chunk-SWNFKKRE.mjs.map
1
+ import{b as o}from"./chunk-QPP6BX53.mjs";import{a as u,c as r}from"./chunk-CCMHWJ3Q.mjs";import{e as t}from"./chunk-6QGVRNV6.mjs";import{a as i}from"./chunk-HPZ2S4FE.mjs";var c=class extends i{constructor(e){super();this.accountAddress=o.ONE;this.moduleName=new r("account");this.structName=new r("RotationProofChallenge");this.sequenceNumber=new t(e.sequenceNumber),this.originator=e.originator,this.currentAuthKey=e.currentAuthKey,this.newPublicKey=u.U8(e.newPublicKey.toUint8Array())}serialize(e){e.serialize(this.accountAddress),e.serialize(this.moduleName),e.serialize(this.structName),e.serialize(this.sequenceNumber),e.serialize(this.originator),e.serialize(this.currentAuthKey),e.serialize(this.newPublicKey)}};export{c as a};
2
+ //# sourceMappingURL=chunk-RNTXQYJQ.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as g}from"./chunk-R76DHMGR.mjs";import{a as u}from"./chunk-Y2GWUE7C.mjs";import{a as A}from"./chunk-GDUAFXIQ.mjs";import{a as h}from"./chunk-ELYS7CWV.mjs";import{a as y}from"./chunk-WJRZWAIS.mjs";import{a as m}from"./chunk-F3M2UQA4.mjs";import{a as p}from"./chunk-S2W4D6NZ.mjs";import{a as d}from"./chunk-NMD45OTM.mjs";import{a as r}from"./chunk-MNVUSJEK.mjs";import{a}from"./chunk-KUOB4DDE.mjs";import{a as c}from"./chunk-P3TAY5PP.mjs";import{a as l}from"./chunk-J64ARI4E.mjs";import{a as f}from"./chunk-BSAHPS6E.mjs";import{a as s}from"./chunk-4TB3AWQE.mjs";var t=class{constructor(n){this.config=new d(n),this.account=new s(this.config),this.ans=new p(this.config),this.coin=new r(this.config),this.digitalAsset=new a(this.config),this.event=new c(this.config),this.faucet=new l(this.config),this.fungibleAsset=new f(this.config),this.general=new g(this.config),this.staking=new h(this.config),this.transaction=new m(this.config),this.table=new y(this.config),this.keyless=new u(this.config),this.object=new A(this.config)}};function e(b,n,w){Object.getOwnPropertyNames(n.prototype).forEach(i=>{let o=Object.getOwnPropertyDescriptor(n.prototype,i);o&&(o.value=function(...j){return this[w][i](...j)},Object.defineProperty(b.prototype,i,o))})}e(t,s,"account");e(t,p,"ans");e(t,r,"coin");e(t,a,"digitalAsset");e(t,c,"event");e(t,l,"faucet");e(t,f,"fungibleAsset");e(t,g,"general");e(t,h,"staking");e(t,m,"transaction");e(t,y,"table");e(t,u,"keyless");e(t,A,"object");export{t as a};
2
- //# sourceMappingURL=chunk-X34JJPW5.mjs.map
1
+ import{a as h}from"./chunk-XK3JFCP3.mjs";import{a as y}from"./chunk-DAXKRXRK.mjs";import{a as m}from"./chunk-TVFIUUVY.mjs";import{a}from"./chunk-CPPBQDHB.mjs";import{a as c}from"./chunk-HSPBA2TZ.mjs";import{a as l}from"./chunk-XXHW3ZT3.mjs";import{a as f}from"./chunk-LDFTE4MM.mjs";import{a as g}from"./chunk-TS3PYRAT.mjs";import{a as u}from"./chunk-QCUFTD7K.mjs";import{a as A}from"./chunk-QLN2URFX.mjs";import{a as s}from"./chunk-DF4WKSTK.mjs";import{a as p}from"./chunk-X4KEZTUQ.mjs";import{a as d}from"./chunk-NMD45OTM.mjs";import{a as r}from"./chunk-25NSCK4Q.mjs";var t=class{constructor(n){this.config=new d(n),this.account=new s(this.config),this.ans=new p(this.config),this.coin=new r(this.config),this.digitalAsset=new a(this.config),this.event=new c(this.config),this.faucet=new l(this.config),this.fungibleAsset=new f(this.config),this.general=new g(this.config),this.staking=new h(this.config),this.transaction=new m(this.config),this.table=new y(this.config),this.keyless=new u(this.config),this.object=new A(this.config)}};function e(b,n,w){Object.getOwnPropertyNames(n.prototype).forEach(i=>{let o=Object.getOwnPropertyDescriptor(n.prototype,i);o&&(o.value=function(...j){return this[w][i](...j)},Object.defineProperty(b.prototype,i,o))})}e(t,s,"account");e(t,p,"ans");e(t,r,"coin");e(t,a,"digitalAsset");e(t,c,"event");e(t,l,"faucet");e(t,f,"fungibleAsset");e(t,g,"general");e(t,h,"staking");e(t,m,"transaction");e(t,y,"table");e(t,u,"keyless");e(t,A,"object");export{t as a};
2
+ //# sourceMappingURL=chunk-SAPUZZEU.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as t}from"./chunk-P2EIZ7WL.mjs";var o=class{constructor(n){this.config=n}async simple(n){return t({aptosConfig:this.config,...n})}async multiAgent(n){return t({aptosConfig:this.config,...n})}};export{o as a};
2
- //# sourceMappingURL=chunk-Q3TAEOH5.mjs.map
1
+ import{a as t}from"./chunk-WWZ3METZ.mjs";var o=class{constructor(n){this.config=n}async simple(n){return t({aptosConfig:this.config,...n})}async multiAgent(n){return t({aptosConfig:this.config,...n})}};export{o as a};
2
+ //# sourceMappingURL=chunk-SR24OGHJ.mjs.map
@@ -1,2 +1,2 @@
1
- import{c as s}from"./chunk-2BTTX2KO.mjs";import{w as i,x as m}from"./chunk-VHNX2NUR.mjs";import{b as n}from"./chunk-CRA2MFJC.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-D3Q4BC3I.mjs.map
1
+ import{c as s}from"./chunk-GFGX3QDP.mjs";import{w as i,x as m}from"./chunk-VHNX2NUR.mjs";import{b as n}from"./chunk-7V6DEA7G.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-STGYDB5E.mjs.map
@@ -1,2 +1,2 @@
1
- import{g as e}from"./chunk-FZ5EYP3D.mjs";import{b as s}from"./chunk-OHRL766V.mjs";import{d as c}from"./chunk-CRA2MFJC.mjs";import{d as r}from"./chunk-EXP5STXZ.mjs";async function x(a){let{aptosConfig:t,accountAddress:i,amount:p,options:n}=a,u=n?.timeoutSecs||20,{data:d}=await c({aptosConfig:t,path:"fund",body:{address:s.from(i).toString(),amount:p},originMethod:"fundAccount"}),m=d.txn_hashes[0],o=await e({aptosConfig:t,transactionHash:m,options:{timeoutSecs:u,checkSuccess:n?.checkSuccess}});if(o.type==="user_transaction")return o;throw new Error(`Unexpected transaction received for fund account: ${o.type}`)}export{x as a};
2
- //# sourceMappingURL=chunk-APN6AV5Q.mjs.map
1
+ import{g as e}from"./chunk-MO4IZXLK.mjs";import{b as s}from"./chunk-QPP6BX53.mjs";import{d as c}from"./chunk-7V6DEA7G.mjs";import{d as r}from"./chunk-EXP5STXZ.mjs";async function x(a){let{aptosConfig:t,accountAddress:i,amount:p,options:n}=a,u=n?.timeoutSecs||20,{data:d}=await c({aptosConfig:t,path:"fund",body:{address:s.from(i).toString(),amount:p},originMethod:"fundAccount"}),m=d.txn_hashes[0],o=await e({aptosConfig:t,transactionHash:m,options:{timeoutSecs:u,checkSuccess:n?.checkSuccess}});if(o.type==="user_transaction")return o;throw new Error(`Unexpected transaction received for fund account: ${o.type}`)}export{x as a};
2
+ //# sourceMappingURL=chunk-SWHLSREF.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as n}from"./chunk-QBSU3L5Q.mjs";import{b as a}from"./chunk-OHRL766V.mjs";import{a as i}from"./chunk-A63SMUOU.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-L2QXU6F4.mjs.map
1
+ import{a as n}from"./chunk-5655UVIK.mjs";import{b as a}from"./chunk-QPP6BX53.mjs";import{a as i}from"./chunk-HPZ2S4FE.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-TL7DR54X.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as d,b}from"./chunk-45IUUCAV.mjs";import{a as h,b as z}from"./chunk-HHGJXVAE.mjs";import{a as p,b as g}from"./chunk-GMBSQDPO.mjs";import{b as o,d as y}from"./chunk-GWSDIX6C.mjs";import{a as c}from"./chunk-A63SMUOU.mjs";var r=class extends c{static deserialize(i){let e=i.deserializeUleb128AsU32();switch(e){case 0:return u.load(i);case 1:return l.load(i);case 2:return n.load(i);case 3:return a.load(i);default:throw new Error(`Unknown variant index for AccountAuthenticator: ${e}`)}}isEd25519(){return this instanceof u}isMultiEd25519(){return this instanceof l}isSingleKey(){return this instanceof n}isMultiKey(){return this instanceof a}},u=class t extends r{constructor(i,e){super(),this.public_key=i,this.signature=e}serialize(i){i.serializeU32AsUleb128(0),this.public_key.serialize(i),this.signature.serialize(i)}static load(i){let e=o.deserialize(i),s=y.deserialize(i);return new t(e,s)}},l=class t extends r{constructor(i,e){super(),this.public_key=i,this.signature=e}serialize(i){i.serializeU32AsUleb128(1),this.public_key.serialize(i),this.signature.serialize(i)}static load(i){let e=d.deserialize(i),s=b.deserialize(i);return new t(e,s)}},n=class t extends r{constructor(i,e){super(),this.public_key=i,this.signature=e}serialize(i){i.serializeU32AsUleb128(2),this.public_key.serialize(i),this.signature.serialize(i)}static load(i){let e=p.deserialize(i),s=g.deserialize(i);return new t(e,s)}},a=class t extends r{constructor(i,e){super(),this.public_keys=i,this.signatures=e}serialize(i){i.serializeU32AsUleb128(3),this.public_keys.serialize(i),this.signatures.serialize(i)}static load(i){let e=h.deserialize(i),s=z.deserialize(i);return new t(e,s)}};export{r as a,u as b,l as c,n as d,a as e};
2
- //# sourceMappingURL=chunk-KUZ2YTJH.mjs.map
1
+ import{a as d,b}from"./chunk-BD6BJETG.mjs";import{a as h,b as z}from"./chunk-GGR3P2TG.mjs";import{a as p,b as g}from"./chunk-U67PFBTL.mjs";import{b as o,d as y}from"./chunk-DAJOX4PL.mjs";import{a as c}from"./chunk-HPZ2S4FE.mjs";var r=class extends c{static deserialize(i){let e=i.deserializeUleb128AsU32();switch(e){case 0:return u.load(i);case 1:return l.load(i);case 2:return n.load(i);case 3:return a.load(i);default:throw new Error(`Unknown variant index for AccountAuthenticator: ${e}`)}}isEd25519(){return this instanceof u}isMultiEd25519(){return this instanceof l}isSingleKey(){return this instanceof n}isMultiKey(){return this instanceof a}},u=class t extends r{constructor(i,e){super(),this.public_key=i,this.signature=e}serialize(i){i.serializeU32AsUleb128(0),this.public_key.serialize(i),this.signature.serialize(i)}static load(i){let e=o.deserialize(i),s=y.deserialize(i);return new t(e,s)}},l=class t extends r{constructor(i,e){super(),this.public_key=i,this.signature=e}serialize(i){i.serializeU32AsUleb128(1),this.public_key.serialize(i),this.signature.serialize(i)}static load(i){let e=d.deserialize(i),s=b.deserialize(i);return new t(e,s)}},n=class t extends r{constructor(i,e){super(),this.public_key=i,this.signature=e}serialize(i){i.serializeU32AsUleb128(2),this.public_key.serialize(i),this.signature.serialize(i)}static load(i){let e=p.deserialize(i),s=g.deserialize(i);return new t(e,s)}},a=class t extends r{constructor(i,e){super(),this.public_keys=i,this.signatures=e}serialize(i){i.serializeU32AsUleb128(3),this.public_keys.serialize(i),this.signatures.serialize(i)}static load(i){let e=h.deserialize(i),s=z.deserialize(i);return new t(e,s)}};export{r as a,u as b,l as c,n as d,a as e};
2
+ //# sourceMappingURL=chunk-TMW2HIXC.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as c,b as g}from"./chunk-ZROQH5YL.mjs";import{k as i,l as a}from"./chunk-FZ5EYP3D.mjs";import{a as e,b as n,c as s,e as r,f as t}from"./chunk-2BTTX2KO.mjs";var p=class{constructor(o){this.config=o}async getLedgerInfo(){return e({aptosConfig:this.config})}async getChainId(){return(await this.getLedgerInfo()).chain_id}async getBlockByVersion(o){return i({aptosConfig:this.config,...o})}async getBlockByHeight(o){return a({aptosConfig:this.config,...o})}async view(o){return c({aptosConfig:this.config,...o})}async viewJson(o){return g({aptosConfig:this.config,...o})}async getChainTopUserTransactions(o){return n({aptosConfig:this.config,...o})}async queryIndexer(o){return s({aptosConfig:this.config,...o})}async getIndexerLastSuccessVersion(){return r({aptosConfig:this.config})}async getProcessorStatus(o){return t({aptosConfig:this.config,processorType:o})}};export{p as a};
2
- //# sourceMappingURL=chunk-R76DHMGR.mjs.map
1
+ import{a as c,b as g}from"./chunk-G7MWTE2J.mjs";import{k as i,l as a}from"./chunk-MO4IZXLK.mjs";import{a as e,b as n,c as s,e as r,f as t}from"./chunk-GFGX3QDP.mjs";var p=class{constructor(o){this.config=o}async getLedgerInfo(){return e({aptosConfig:this.config})}async getChainId(){return(await this.getLedgerInfo()).chain_id}async getBlockByVersion(o){return i({aptosConfig:this.config,...o})}async getBlockByHeight(o){return a({aptosConfig:this.config,...o})}async view(o){return c({aptosConfig:this.config,...o})}async viewJson(o){return g({aptosConfig:this.config,...o})}async getChainTopUserTransactions(o){return n({aptosConfig:this.config,...o})}async queryIndexer(o){return s({aptosConfig:this.config,...o})}async getIndexerLastSuccessVersion(){return r({aptosConfig:this.config})}async getProcessorStatus(o){return t({aptosConfig:this.config,processorType:o})}};export{p as a};
2
+ //# sourceMappingURL=chunk-TS3PYRAT.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as d}from"./chunk-2F7Z7RMW.mjs";import{a as h}from"./chunk-JH6VLTMS.mjs";import{a as T}from"./chunk-HVMFZF6P.mjs";import{a as f}from"./chunk-Q3TAEOH5.mjs";import{d as c,e as u,f as g,i as m,j as p,k as y,l as A}from"./chunk-P2EIZ7WL.mjs";import{a,b as o,c as i,d as s,e,g as r}from"./chunk-FZ5EYP3D.mjs";var P=class{constructor(n){this.config=n,this.build=new f(this.config),this.simulate=new h(this.config),this.submit=new T(this.config),this.batch=new d(this.config)}async getTransactions(n){return a({aptosConfig:this.config,...n})}async getTransactionByVersion(n){return i({aptosConfig:this.config,...n})}async getTransactionByHash(n){return s({aptosConfig:this.config,...n})}async isPendingTransaction(n){return e({aptosConfig:this.config,...n})}async waitForTransaction(n){return r({aptosConfig:this.config,...n})}async getGasPriceEstimation(){return o({aptosConfig:this.config})}getSigningMessage(n){return c(n)}async publishPackageTransaction(n){return y({aptosConfig:this.config,...n})}async rotateAuthKey(n){return A({aptosConfig:this.config,...n})}sign(n){return u({...n})}signAsFeePayer(n){return g({...n})}async batchTransactionsForSingleAccount(n){try{let{sender:t,data:l,options:b}=n;this.batch.forSingleAccount({sender:t,data:l,options:b})}catch(t){throw new Error(`failed to submit transactions with error: ${t}`)}}async signAndSubmitTransaction(n){return m({aptosConfig:this.config,...n})}async signAndSubmitAsFeePayer(n){return p({aptosConfig:this.config,...n})}};export{P as a};
2
- //# sourceMappingURL=chunk-F3M2UQA4.mjs.map
1
+ import{a as T}from"./chunk-25TIHDS6.mjs";import{a as f}from"./chunk-SR24OGHJ.mjs";import{a as d}from"./chunk-NH2S6SB2.mjs";import{a as h}from"./chunk-BRFHAO2Y.mjs";import{d as c,e as u,f as g,i as m,j as p,k as y,l as A}from"./chunk-WWZ3METZ.mjs";import{a,b as o,c as i,d as s,e,g as r}from"./chunk-MO4IZXLK.mjs";var P=class{constructor(n){this.config=n,this.build=new f(this.config),this.simulate=new h(this.config),this.submit=new T(this.config),this.batch=new d(this.config)}async getTransactions(n){return a({aptosConfig:this.config,...n})}async getTransactionByVersion(n){return i({aptosConfig:this.config,...n})}async getTransactionByHash(n){return s({aptosConfig:this.config,...n})}async isPendingTransaction(n){return e({aptosConfig:this.config,...n})}async waitForTransaction(n){return r({aptosConfig:this.config,...n})}async getGasPriceEstimation(){return o({aptosConfig:this.config})}getSigningMessage(n){return c(n)}async publishPackageTransaction(n){return y({aptosConfig:this.config,...n})}async rotateAuthKey(n){return A({aptosConfig:this.config,...n})}sign(n){return u({...n})}signAsFeePayer(n){return g({...n})}async batchTransactionsForSingleAccount(n){try{let{sender:t,data:l,options:b}=n;this.batch.forSingleAccount({sender:t,data:l,options:b})}catch(t){throw new Error(`failed to submit transactions with error: ${t}`)}}async signAndSubmitTransaction(n){return m({aptosConfig:this.config,...n})}async signAndSubmitAsFeePayer(n){return p({aptosConfig:this.config,...n})}};export{P as a};
2
+ //# sourceMappingURL=chunk-TVFIUUVY.mjs.map
@@ -1,2 +1,2 @@
1
- import{a,c}from"./chunk-GDO6Q2FI.mjs";import{a as u}from"./chunk-BA4RBST6.mjs";import{i as o,j as l}from"./chunk-G5XLMQ5E.mjs";import{b as n,d as s}from"./chunk-GWSDIX6C.mjs";import{a as f}from"./chunk-MLDQ2TY2.mjs";import{b as p}from"./chunk-76OH2Z4Q.mjs";import{a as b}from"./chunk-G5MGSV7Y.mjs";var K=class r extends p{constructor(e){if(super(),this.publicKey=e,e instanceof n)this.variant=0;else if(e instanceof a)this.variant=1;else if(e instanceof o)this.variant=3;else if(e instanceof u)this.variant=4;else throw new Error("Unsupported public key type")}verifySignature(e){let{message:t,signature:i}=e;return y.isInstance(i)?this.publicKey.verifySignature({message:t,signature:i.signature}):!1}authKey(){return b.fromSchemeAndBytes({scheme:2,input:this.toUint8Array()})}toUint8Array(){return this.bcsToBytes()}serialize(e){e.serializeU32AsUleb128(this.variant),this.publicKey.serialize(e)}static deserialize(e){let t=e.deserializeUleb128AsU32(),i;switch(t){case 0:i=n.deserialize(e);break;case 1:i=a.deserialize(e);break;case 3:i=o.deserialize(e);break;case 4:i=u.deserialize(e);break;default:throw new Error(`Unknown variant index for AnyPublicKey: ${t}`)}return new r(i)}static isPublicKey(e){return e instanceof r}isEd25519(){return this.publicKey instanceof n}isSecp256k1PublicKey(){return this.publicKey instanceof a}static isInstance(e){return"publicKey"in e&&"variant"in e}},y=class r extends f{constructor(e){if(super(),this.signature=e,e instanceof s)this.variant=0;else if(e instanceof c)this.variant=1;else if(e instanceof l)this.variant=3;else throw new Error("Unsupported signature type")}toUint8Array(){return console.warn("[Aptos SDK] Calls to AnySignature.toUint8Array() will soon return the underlying signature bytes. Use AnySignature.bcsToBytes() instead."),this.bcsToBytes()}serialize(e){e.serializeU32AsUleb128(this.variant),this.signature.serialize(e)}static deserialize(e){let t=e.deserializeUleb128AsU32(),i;switch(t){case 0:i=s.deserialize(e);break;case 1:i=c.deserialize(e);break;case 3:i=l.deserialize(e);break;default:throw new Error(`Unknown variant index for AnySignature: ${t}`)}return new r(i)}static isInstance(e){return"signature"in e&&typeof e.signature=="object"&&e.signature!==null&&"toUint8Array"in e.signature}};export{K as a,y as b};
2
- //# sourceMappingURL=chunk-GMBSQDPO.mjs.map
1
+ import{a,c}from"./chunk-LGD5KU56.mjs";import{a as u}from"./chunk-PNXUYOYI.mjs";import{i as o,j as l}from"./chunk-LG3DAAPD.mjs";import{b as n,d as s}from"./chunk-DAJOX4PL.mjs";import{b as p}from"./chunk-IMGLHDIA.mjs";import{a as f}from"./chunk-BF4ZE37Q.mjs";import{a as b}from"./chunk-KA6FZNWP.mjs";var K=class r extends p{constructor(e){if(super(),this.publicKey=e,e instanceof n)this.variant=0;else if(e instanceof a)this.variant=1;else if(e instanceof o)this.variant=3;else if(e instanceof u)this.variant=4;else throw new Error("Unsupported public key type")}verifySignature(e){let{message:t,signature:i}=e;return y.isInstance(i)?this.publicKey.verifySignature({message:t,signature:i.signature}):!1}authKey(){return b.fromSchemeAndBytes({scheme:2,input:this.toUint8Array()})}toUint8Array(){return this.bcsToBytes()}serialize(e){e.serializeU32AsUleb128(this.variant),this.publicKey.serialize(e)}static deserialize(e){let t=e.deserializeUleb128AsU32(),i;switch(t){case 0:i=n.deserialize(e);break;case 1:i=a.deserialize(e);break;case 3:i=o.deserialize(e);break;case 4:i=u.deserialize(e);break;default:throw new Error(`Unknown variant index for AnyPublicKey: ${t}`)}return new r(i)}static isPublicKey(e){return e instanceof r}isEd25519(){return this.publicKey instanceof n}isSecp256k1PublicKey(){return this.publicKey instanceof a}static isInstance(e){return"publicKey"in e&&"variant"in e}},y=class r extends f{constructor(e){if(super(),this.signature=e,e instanceof s)this.variant=0;else if(e instanceof c)this.variant=1;else if(e instanceof l)this.variant=3;else throw new Error("Unsupported signature type")}toUint8Array(){return console.warn("[Aptos SDK] Calls to AnySignature.toUint8Array() will soon return the underlying signature bytes. Use AnySignature.bcsToBytes() instead."),this.bcsToBytes()}serialize(e){e.serializeU32AsUleb128(this.variant),this.signature.serialize(e)}static deserialize(e){let t=e.deserializeUleb128AsU32(),i;switch(t){case 0:i=s.deserialize(e);break;case 1:i=c.deserialize(e);break;case 3:i=l.deserialize(e);break;default:throw new Error(`Unknown variant index for AnySignature: ${t}`)}return new r(i)}static isInstance(e){return"signature"in e&&typeof e.signature=="object"&&e.signature!==null&&"toUint8Array"in e.signature}};export{K as a,y as b};
2
+ //# sourceMappingURL=chunk-U67PFBTL.mjs.map
@@ -1,2 +1,2 @@
1
- import{b as c}from"./chunk-OHRL766V.mjs";import{sha3_256 as n}from"@noble/hashes/sha3";var d=(e,r)=>{let t=e.bcsToBytes(),s=typeof r=="string"?Buffer.from(r,"utf8"):r,o=new Uint8Array([...t,...s,254]);return new c(n(o))},f=(e,r)=>{let t=e.bcsToBytes(),s=typeof r=="string"?Buffer.from(r,"utf8"):r,o=new Uint8Array([...t,...s,255]);return new c(n(o))},a=(e,r,t)=>{let s=`${r}::${t}`;return d(e,s)};export{d as a,f as b,a as c};
2
- //# sourceMappingURL=chunk-WRRQ7L5K.mjs.map
1
+ import{b as c}from"./chunk-QPP6BX53.mjs";import{sha3_256 as n}from"@noble/hashes/sha3";var d=(e,r)=>{let t=e.bcsToBytes(),s=typeof r=="string"?Buffer.from(r,"utf8"):r,o=new Uint8Array([...t,...s,254]);return new c(n(o))},f=(e,r)=>{let t=e.bcsToBytes(),s=typeof r=="string"?Buffer.from(r,"utf8"):r,o=new Uint8Array([...t,...s,255]);return new c(n(o))},a=(e,r,t)=>{let s=`${r}::${t}`;return d(e,s)};export{d as a,f as b,a as c};
2
+ //# sourceMappingURL=chunk-WP7WF54Q.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-STUXKQVZ.mjs";import{a as e,b as n}from"./chunk-UAL27G6B.mjs";var r=class{constructor(t,i,o,a,c){this.lastUncommintedNumber=null;this.currentNumber=null;this.lock=!1;this.aptosConfig=t,this.account=i,this.maxWaitTime=o,this.maximumInFlight=a,this.sleepTime=c}async nextSequenceNumber(){for(;this.lock;)await e(this.sleepTime);this.lock=!0;let t=BigInt(0);try{if((this.lastUncommintedNumber===null||this.currentNumber===null)&&await this.initialize(),this.currentNumber-this.lastUncommintedNumber>=this.maximumInFlight){await this.update();let i=n();for(;this.currentNumber-this.lastUncommintedNumber>=this.maximumInFlight;)await e(this.sleepTime),n()-i>this.maxWaitTime?(console.warn(`Waited over 30 seconds for a transaction to commit, resyncing ${this.account.accountAddress.toString()}`),await this.initialize()):await this.update()}t=this.currentNumber,this.currentNumber+=BigInt(1)}catch(i){console.error("error in getting next sequence number for this account",i)}finally{this.lock=!1}return t}async initialize(){let{sequence_number:t}=await s({aptosConfig:this.aptosConfig,accountAddress:this.account.accountAddress});this.currentNumber=BigInt(t),this.lastUncommintedNumber=BigInt(t)}async update(){let{sequence_number:t}=await s({aptosConfig:this.aptosConfig,accountAddress:this.account.accountAddress});return this.lastUncommintedNumber=BigInt(t),this.lastUncommintedNumber}async synchronize(){if(this.lastUncommintedNumber!==this.currentNumber){for(;this.lock;)await e(this.sleepTime);this.lock=!0;try{await this.update();let t=n();for(;this.lastUncommintedNumber!==this.currentNumber;)n()-t>this.maxWaitTime?(console.warn(`Waited over 30 seconds for a transaction to commit, resyncing ${this.account.accountAddress.toString()}`),await this.initialize()):(await e(this.sleepTime),await this.update())}catch(t){console.error("error in synchronizing this account sequence number with the one on chain",t)}finally{this.lock=!1}}}};export{r as a};
2
- //# sourceMappingURL=chunk-BWNTSJOC.mjs.map
1
+ import{a as s}from"./chunk-BKEJMQQ6.mjs";import{a as e,b as n}from"./chunk-UAL27G6B.mjs";var r=class{constructor(t,i,o,a,c){this.lastUncommintedNumber=null;this.currentNumber=null;this.lock=!1;this.aptosConfig=t,this.account=i,this.maxWaitTime=o,this.maximumInFlight=a,this.sleepTime=c}async nextSequenceNumber(){for(;this.lock;)await e(this.sleepTime);this.lock=!0;let t=BigInt(0);try{if((this.lastUncommintedNumber===null||this.currentNumber===null)&&await this.initialize(),this.currentNumber-this.lastUncommintedNumber>=this.maximumInFlight){await this.update();let i=n();for(;this.currentNumber-this.lastUncommintedNumber>=this.maximumInFlight;)await e(this.sleepTime),n()-i>this.maxWaitTime?(console.warn(`Waited over 30 seconds for a transaction to commit, resyncing ${this.account.accountAddress.toString()}`),await this.initialize()):await this.update()}t=this.currentNumber,this.currentNumber+=BigInt(1)}catch(i){console.error("error in getting next sequence number for this account",i)}finally{this.lock=!1}return t}async initialize(){let{sequence_number:t}=await s({aptosConfig:this.aptosConfig,accountAddress:this.account.accountAddress});this.currentNumber=BigInt(t),this.lastUncommintedNumber=BigInt(t)}async update(){let{sequence_number:t}=await s({aptosConfig:this.aptosConfig,accountAddress:this.account.accountAddress});return this.lastUncommintedNumber=BigInt(t),this.lastUncommintedNumber}async synchronize(){if(this.lastUncommintedNumber!==this.currentNumber){for(;this.lock;)await e(this.sleepTime);this.lock=!0;try{await this.update();let t=n();for(;this.lastUncommintedNumber!==this.currentNumber;)n()-t>this.maxWaitTime?(console.warn(`Waited over 30 seconds for a transaction to commit, resyncing ${this.account.accountAddress.toString()}`),await this.initialize()):(await e(this.sleepTime),await this.update())}catch(t){console.error("error in synchronizing this account sequence number with the one on chain",t)}finally{this.lock=!1}}}};export{r as a};
2
+ //# sourceMappingURL=chunk-WS4RPKL6.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as y,f as P,g as C,i as b}from"./chunk-MDJ66AA3.mjs";import{a as I}from"./chunk-STUXKQVZ.mjs";import{a as f}from"./chunk-RXE6NNOL.mjs";import{a as w}from"./chunk-QPB6EJVM.mjs";import{a as A}from"./chunk-Y3BATGHX.mjs";import{d as h}from"./chunk-O2BPA6TS.mjs";import{a as l}from"./chunk-SWNFKKRE.mjs";import{c as T,m as c}from"./chunk-SUJLWCRN.mjs";import{b as p}from"./chunk-OHRL766V.mjs";import{b as d}from"./chunk-CRA2MFJC.mjs";import{a as s}from"./chunk-LNEZEYYE.mjs";import{b as m}from"./chunk-YPHH6CAO.mjs";async function S(t){let e=await K(t);return U(t,e)}async function K(t){let{aptosConfig:e,data:n}=t,a,o;return"bytecode"in n?o=await y(n):"multisigAddress"in n?(a={aptosConfig:e,multisigAddress:n.multisigAddress,function:n.function,functionArguments:n.functionArguments,typeArguments:n.typeArguments,abi:n.abi},o=await y(a)):(a={aptosConfig:e,function:n.function,functionArguments:n.functionArguments,typeArguments:n.typeArguments,abi:n.abi},o=await y(a)),o}async function U(t,e){let{aptosConfig:n,sender:a,options:o}=t,i;if(_(t)&&(i=p.ZERO.toString()),B(t)){let{secondarySignerAddresses:r}=t;return P({aptosConfig:n,sender:a,payload:e,options:o,secondarySignerAddresses:r,feePayerAddress:i})}return P({aptosConfig:n,sender:a,payload:e,options:o,feePayerAddress:i})}function _(t){return t.withFeePayer===!0}function B(t){return"secondarySignerAddresses"in t}function Y(t){let{transaction:e}=t;return h(e)}function R(t){let{signer:e,transaction:n}=t;return e.signTransactionWithAuthenticator(n)}function x(t){let{signer:e,transaction:n}=t;if(!n.feePayerAddress)throw new Error(`Transaction ${n} is not a Fee Payer transaction`);return n.feePayerAddress=e.accountAddress,R({signer:e,transaction:n})}async function nn(t){let{aptosConfig:e,transaction:n,signerPublicKey:a,secondarySignersPublicKeys:o,feePayerPublicKey:i,options:r}=t,u=C({transaction:n,signerPublicKey:a,secondarySignersPublicKeys:o,feePayerPublicKey:i,options:r}),{data:g}=await d({aptosConfig:e,body:u,path:"transactions/simulate",params:{estimate_gas_unit_price:t.options?.estimateGasUnitPrice??!1,estimate_max_gas_amount:t.options?.estimateMaxGasAmount??!1,estimate_prioritized_gas_unit_price:t.options?.estimatePrioritizedGasUnitPrice??!1},originMethod:"simulateTransaction",contentType:"application/x.aptos.signed_transaction+bcs"});return g}async function F(t){let{aptosConfig:e}=t,n=b({...t}),{data:a}=await d({aptosConfig:e,body:n,path:"transactions",originMethod:"submitTransaction",contentType:"application/x.aptos.signed_transaction+bcs"});return a}async function M(t){let{aptosConfig:e,signer:n,feePayer:a,transaction:o}=t;(n instanceof A||n instanceof f)&&await n.waitForProofFetch(),(a instanceof A||a instanceof f)&&await a.waitForProofFetch();let i=t.feePayerAuthenticator||a&&x({signer:a,transaction:o}),r=R({signer:n,transaction:o});return F({aptosConfig:e,transaction:o,senderAuthenticator:r,feePayerAuthenticator:i})}async function tn(t){let{aptosConfig:e,senderAuthenticator:n,feePayer:a,transaction:o}=t;(a instanceof A||a instanceof f)&&await a.waitForProofFetch();let i=x({signer:a,transaction:o});return F({aptosConfig:e,transaction:o,senderAuthenticator:n,feePayerAuthenticator:i})}var v={typeParameters:[],parameters:[c.u8(),new c(c.u8())]};async function en(t){let{aptosConfig:e,account:n,metadataBytes:a,moduleBytecode:o,options:i}=t,r=o.map(u=>s.U8(u));return S({aptosConfig:e,sender:p.from(n),data:{function:"0x1::code::publish_package_txn",functionArguments:[s.U8(a),new s(r)],abi:v},options:i})}var N={typeParameters:[],parameters:[new T,c.u8(),new T,c.u8(),c.u8(),c.u8()]};async function an(t){let{aptosConfig:e,fromAccount:n,toNewPrivateKey:a}=t,o=await I({aptosConfig:e,accountAddress:n.accountAddress}),i=w.fromPrivateKey({privateKey:a,legacy:!0}),u=new l({sequenceNumber:BigInt(o.sequence_number),originator:n.accountAddress,currentAuthKey:p.from(o.authentication_key),newPublicKey:i.publicKey}).bcsToBytes(),g=n.sign(u),D=i.sign(u),G=await S({aptosConfig:e,sender:n.accountAddress,data:{function:"0x1::account::rotate_authentication_key",functionArguments:[new m(n.signingScheme),s.U8(n.publicKey.toUint8Array()),new m(i.signingScheme),s.U8(i.publicKey.toUint8Array()),s.U8(g.toUint8Array()),s.U8(D.toUint8Array())],abi:N}});return M({aptosConfig:e,signer:n,transaction:G})}export{S as a,K as b,U as c,Y as d,R as e,x as f,nn as g,F as h,M as i,tn as j,en as k,an as l};
2
- //# sourceMappingURL=chunk-P2EIZ7WL.mjs.map
1
+ import{a as y,f as P,g as C,i as b}from"./chunk-MEWFJJJN.mjs";import{a as I}from"./chunk-BKEJMQQ6.mjs";import{a as f}from"./chunk-46D5QX3G.mjs";import{a as w}from"./chunk-FRGXKOU5.mjs";import{a as A}from"./chunk-K2O24YLZ.mjs";import{d as h}from"./chunk-KXBIA4KR.mjs";import{a as l}from"./chunk-RNTXQYJQ.mjs";import{c as T,m as c}from"./chunk-QDIKOQRK.mjs";import{b as p}from"./chunk-QPP6BX53.mjs";import{b as d}from"./chunk-7V6DEA7G.mjs";import{a as s}from"./chunk-CCMHWJ3Q.mjs";import{b as m}from"./chunk-6QGVRNV6.mjs";async function S(t){let e=await K(t);return U(t,e)}async function K(t){let{aptosConfig:e,data:n}=t,a,o;return"bytecode"in n?o=await y(n):"multisigAddress"in n?(a={aptosConfig:e,multisigAddress:n.multisigAddress,function:n.function,functionArguments:n.functionArguments,typeArguments:n.typeArguments,abi:n.abi},o=await y(a)):(a={aptosConfig:e,function:n.function,functionArguments:n.functionArguments,typeArguments:n.typeArguments,abi:n.abi},o=await y(a)),o}async function U(t,e){let{aptosConfig:n,sender:a,options:o}=t,i;if(_(t)&&(i=p.ZERO.toString()),B(t)){let{secondarySignerAddresses:r}=t;return P({aptosConfig:n,sender:a,payload:e,options:o,secondarySignerAddresses:r,feePayerAddress:i})}return P({aptosConfig:n,sender:a,payload:e,options:o,feePayerAddress:i})}function _(t){return t.withFeePayer===!0}function B(t){return"secondarySignerAddresses"in t}function Y(t){let{transaction:e}=t;return h(e)}function R(t){let{signer:e,transaction:n}=t;return e.signTransactionWithAuthenticator(n)}function x(t){let{signer:e,transaction:n}=t;if(!n.feePayerAddress)throw new Error(`Transaction ${n} is not a Fee Payer transaction`);return n.feePayerAddress=e.accountAddress,R({signer:e,transaction:n})}async function nn(t){let{aptosConfig:e,transaction:n,signerPublicKey:a,secondarySignersPublicKeys:o,feePayerPublicKey:i,options:r}=t,u=C({transaction:n,signerPublicKey:a,secondarySignersPublicKeys:o,feePayerPublicKey:i,options:r}),{data:g}=await d({aptosConfig:e,body:u,path:"transactions/simulate",params:{estimate_gas_unit_price:t.options?.estimateGasUnitPrice??!1,estimate_max_gas_amount:t.options?.estimateMaxGasAmount??!1,estimate_prioritized_gas_unit_price:t.options?.estimatePrioritizedGasUnitPrice??!1},originMethod:"simulateTransaction",contentType:"application/x.aptos.signed_transaction+bcs"});return g}async function F(t){let{aptosConfig:e}=t,n=b({...t}),{data:a}=await d({aptosConfig:e,body:n,path:"transactions",originMethod:"submitTransaction",contentType:"application/x.aptos.signed_transaction+bcs"});return a}async function M(t){let{aptosConfig:e,signer:n,feePayer:a,transaction:o}=t;(n instanceof A||n instanceof f)&&await n.waitForProofFetch(),(a instanceof A||a instanceof f)&&await a.waitForProofFetch();let i=t.feePayerAuthenticator||a&&x({signer:a,transaction:o}),r=R({signer:n,transaction:o});return F({aptosConfig:e,transaction:o,senderAuthenticator:r,feePayerAuthenticator:i})}async function tn(t){let{aptosConfig:e,senderAuthenticator:n,feePayer:a,transaction:o}=t;(a instanceof A||a instanceof f)&&await a.waitForProofFetch();let i=x({signer:a,transaction:o});return F({aptosConfig:e,transaction:o,senderAuthenticator:n,feePayerAuthenticator:i})}var v={typeParameters:[],parameters:[c.u8(),new c(c.u8())]};async function en(t){let{aptosConfig:e,account:n,metadataBytes:a,moduleBytecode:o,options:i}=t,r=o.map(u=>s.U8(u));return S({aptosConfig:e,sender:p.from(n),data:{function:"0x1::code::publish_package_txn",functionArguments:[s.U8(a),new s(r)],abi:v},options:i})}var N={typeParameters:[],parameters:[new T,c.u8(),new T,c.u8(),c.u8(),c.u8()]};async function an(t){let{aptosConfig:e,fromAccount:n,toNewPrivateKey:a}=t,o=await I({aptosConfig:e,accountAddress:n.accountAddress}),i=w.fromPrivateKey({privateKey:a,legacy:!0}),u=new l({sequenceNumber:BigInt(o.sequence_number),originator:n.accountAddress,currentAuthKey:p.from(o.authentication_key),newPublicKey:i.publicKey}).bcsToBytes(),g=n.sign(u),D=i.sign(u),G=await S({aptosConfig:e,sender:n.accountAddress,data:{function:"0x1::account::rotate_authentication_key",functionArguments:[new m(n.signingScheme),s.U8(n.publicKey.toUint8Array()),new m(i.signingScheme),s.U8(i.publicKey.toUint8Array()),s.U8(g.toUint8Array()),s.U8(D.toUint8Array())],abi:N}});return M({aptosConfig:e,signer:n,transaction:G})}export{S as a,K as b,U as c,Y as d,R as e,x as f,nn as g,F as h,M as i,tn as j,en as k,an as l};
2
+ //# sourceMappingURL=chunk-WWZ3METZ.mjs.map
@@ -1,2 +1,2 @@
1
- import{h as e,i as s,j as t,k as o,l as r,m as i,n as a,o as m,p as c,q as g,r as u,s as p,t as d}from"./chunk-HKBBA653.mjs";var A=class{constructor(n){this.config=n}async getOwnerAddress(n){return e({aptosConfig:this.config,...n})}async getExpiration(n){return t({aptosConfig:this.config,...n})}async getTargetAddress(n){return i({aptosConfig:this.config,...n})}async setTargetAddress(n){return a({aptosConfig:this.config,...n})}async getPrimaryName(n){return o({aptosConfig:this.config,...n})}async setPrimaryName(n){return r({aptosConfig:this.config,...n})}async registerName(n){return s({aptosConfig:this.config,...n})}async renewDomain(n){return d({aptosConfig:this.config,...n})}async getName(n){return m({aptosConfig:this.config,...n})}async getAccountNames(n){return c({aptosConfig:this.config,...n})}async getAccountDomains(n){return g({aptosConfig:this.config,...n})}async getAccountSubdomains(n){return u({aptosConfig:this.config,...n})}async getDomainSubdomains(n){return p({aptosConfig:this.config,...n})}};export{A as a};
2
- //# sourceMappingURL=chunk-S2W4D6NZ.mjs.map
1
+ import{h as e,i as s,j as t,k as o,l as r,m as i,n as a,o as m,p as c,q as g,r as u,s as p,t as d}from"./chunk-7ZLBJUVZ.mjs";var A=class{constructor(n){this.config=n}async getOwnerAddress(n){return e({aptosConfig:this.config,...n})}async getExpiration(n){return t({aptosConfig:this.config,...n})}async getTargetAddress(n){return i({aptosConfig:this.config,...n})}async setTargetAddress(n){return a({aptosConfig:this.config,...n})}async getPrimaryName(n){return o({aptosConfig:this.config,...n})}async setPrimaryName(n){return r({aptosConfig:this.config,...n})}async registerName(n){return s({aptosConfig:this.config,...n})}async renewDomain(n){return d({aptosConfig:this.config,...n})}async getName(n){return m({aptosConfig:this.config,...n})}async getAccountNames(n){return c({aptosConfig:this.config,...n})}async getAccountDomains(n){return g({aptosConfig:this.config,...n})}async getAccountSubdomains(n){return u({aptosConfig:this.config,...n})}async getDomainSubdomains(n){return p({aptosConfig:this.config,...n})}};export{A as a};
2
+ //# sourceMappingURL=chunk-X4KEZTUQ.mjs.map
@@ -1,2 +1,2 @@
1
- import{c as a}from"./chunk-2BTTX2KO.mjs";import{u as n}from"./chunk-VHNX2NUR.mjs";import{b as s}from"./chunk-OHRL766V.mjs";async function d(e){let{aptosConfig:o,options:t}=e,r={query:n,variables:{where_condition:t?.where,offset:t?.offset,limit:t?.limit,order_by:t?.orderBy}};return(await a({aptosConfig:o,query:r,originMethod:"getObjectData"})).current_objects}async function f(e){let{aptosConfig:o,objectAddress:t,options:r}=e,c={object_address:{_eq:s.from(t).toStringLong()}};return(await d({aptosConfig:o,options:{...r,where:c}}))[0]}export{d as a,f as b};
2
- //# sourceMappingURL=chunk-F76N4MQO.mjs.map
1
+ import{c as a}from"./chunk-GFGX3QDP.mjs";import{u as n}from"./chunk-VHNX2NUR.mjs";import{b as s}from"./chunk-QPP6BX53.mjs";async function d(e){let{aptosConfig:o,options:t}=e,r={query:n,variables:{where_condition:t?.where,offset:t?.offset,limit:t?.limit,order_by:t?.orderBy}};return(await a({aptosConfig:o,query:r,originMethod:"getObjectData"})).current_objects}async function f(e){let{aptosConfig:o,objectAddress:t,options:r}=e,c={object_address:{_eq:s.from(t).toStringLong()}};return(await d({aptosConfig:o,options:{...r,where:c}}))[0]}export{d as a,f as b};
2
+ //# sourceMappingURL=chunk-XH7YKEYR.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as r,b as i,c as s}from"./chunk-OKAQO57B.mjs";import{a as o}from"./chunk-SDWE6WMM.mjs";var t=class{constructor(e){this.config=e}async getNumberOfDelegators(e){return await o({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"stake_processor"}),r({aptosConfig:this.config,...e})}async getNumberOfDelegatorsForAllPools(e){return await o({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"stake_processor"}),i({aptosConfig:this.config,...e})}async getDelegatedStakingActivities(e){return await o({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"stake_processor"}),s({aptosConfig:this.config,...e})}};export{t as a};
2
- //# sourceMappingURL=chunk-ELYS7CWV.mjs.map
1
+ import{a as r,b as i,c as s}from"./chunk-ECWOLU5T.mjs";import{a as o}from"./chunk-EWZ2M5BW.mjs";var t=class{constructor(e){this.config=e}async getNumberOfDelegators(e){return await o({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"stake_processor"}),r({aptosConfig:this.config,...e})}async getNumberOfDelegatorsForAllPools(e){return await o({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"stake_processor"}),i({aptosConfig:this.config,...e})}async getDelegatedStakingActivities(e){return await o({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"stake_processor"}),s({aptosConfig:this.config,...e})}};export{t as a};
2
+ //# sourceMappingURL=chunk-XK3JFCP3.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as n}from"./chunk-QBSU3L5Q.mjs";import{b as i}from"./chunk-OHRL766V.mjs";import{a as d}from"./chunk-A63SMUOU.mjs";var o=class t extends d{constructor(e,s,r){super(),this.rawTransaction=e,this.feePayerAddress=r,this.secondarySignerAddresses=s}serialize(e){this.rawTransaction.serialize(e),e.serializeVector(this.secondarySignerAddresses),this.feePayerAddress===void 0?e.serializeBool(!1):(e.serializeBool(!0),this.feePayerAddress.serialize(e))}static deserialize(e){let s=n.deserialize(e),r=e.deserializeVector(i),c=e.deserializeBool(),a;return c&&(a=i.deserialize(e)),new t(s,r,a)}};export{o as a};
2
- //# sourceMappingURL=chunk-MAMPMCO7.mjs.map
1
+ import{a as n}from"./chunk-5655UVIK.mjs";import{b as i}from"./chunk-QPP6BX53.mjs";import{a as d}from"./chunk-HPZ2S4FE.mjs";var o=class t extends d{constructor(e,s,r){super(),this.rawTransaction=e,this.feePayerAddress=r,this.secondarySignerAddresses=s}serialize(e){this.rawTransaction.serialize(e),e.serializeVector(this.secondarySignerAddresses),this.feePayerAddress===void 0?e.serializeBool(!1):(e.serializeBool(!0),this.feePayerAddress.serialize(e))}static deserialize(e){let s=n.deserialize(e),r=e.deserializeVector(i),c=e.deserializeBool(),a;return c&&(a=i.deserialize(e)),new t(s,r,a)}};export{o as a};
2
+ //# sourceMappingURL=chunk-XONG5JZ4.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as t}from"./chunk-APN6AV5Q.mjs";import{h as r}from"./chunk-FZ5EYP3D.mjs";var i=class{constructor(o){this.config=o}async fundAccount(o){let n=await t({aptosConfig:this.config,...o});return(o.options?.waitForIndexer===void 0||o.options?.waitForIndexer)&&await r({aptosConfig:this.config,minimumLedgerVersion:BigInt(n.version),processorType:"fungible_asset_processor"}),n}};export{i as a};
2
- //# sourceMappingURL=chunk-J64ARI4E.mjs.map
1
+ import{a as t}from"./chunk-SWHLSREF.mjs";import{h as r}from"./chunk-MO4IZXLK.mjs";var i=class{constructor(o){this.config=o}async fundAccount(o){let n=await t({aptosConfig:this.config,...o});return(o.options?.waitForIndexer===void 0||o.options?.waitForIndexer)&&await r({aptosConfig:this.config,minimumLedgerVersion:BigInt(n.version),processorType:"fungible_asset_processor"}),n}};export{i as a};
2
+ //# sourceMappingURL=chunk-XXHW3ZT3.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as j}from"./chunk-P2EIZ7WL.mjs";import{g}from"./chunk-STUXKQVZ.mjs";import{a as S}from"./chunk-CB6H4VMZ.mjs";import{a as l}from"./chunk-E4O26ZJB.mjs";import{a as C}from"./chunk-BA4RBST6.mjs";import{i as K,l as k,m as A,n as x,p as b}from"./chunk-G5XLMQ5E.mjs";import{b as P}from"./chunk-F63E4CR7.mjs";import{e as h,f as w}from"./chunk-CRA2MFJC.mjs";import{a as d}from"./chunk-LNEZEYYE.mjs";import{b as p}from"./chunk-BCUSI3N6.mjs";import{jwtDecode as E}from"jwt-decode";async function v(r){let{aptosConfig:s,jwt:i,ephemeralKeyPair:e,uidKey:a="sub",derivationPath:n}=r,t={jwt_b64:i,epk:e.getPublicKey().bcsToHex().toStringWithoutPrefix(),exp_date_secs:e.expiryDateSecs,epk_blinder:p.fromHexInput(e.blinder).toStringWithoutPrefix(),uid_key:a,derivation_path:n},{data:o}=await h({aptosConfig:s,path:"fetch",body:t,originMethod:"getPepper",overrides:{WITH_CREDENTIALS:!1}});return p.fromHexInput(o.pepper).toUint8Array()}async function _(r){let{aptosConfig:s,jwt:i,ephemeralKeyPair:e,pepper:a=await v(r),uidKey:n="sub"}=r;if(p.fromHexInput(a).toUint8Array().length!==l.PEPPER_LENGTH)throw new Error(`Pepper needs to be ${l.PEPPER_LENGTH} bytes`);let{maxExpHorizonSecs:t}=await b({aptosConfig:s}),o=E(i);if(typeof o.iat!="number")throw new Error("iat was not found");if(t<e.expiryDateSecs-o.iat)throw Error(`The EphemeralKeyPair is too long lived. It's lifespan must be less than ${t}`);let f={jwt_b64:i,epk:e.getPublicKey().bcsToHex().toStringWithoutPrefix(),epk_blinder:p.fromHexInput(e.blinder).toStringWithoutPrefix(),exp_date_secs:e.expiryDateSecs,exp_horizon_secs:t,pepper:p.fromHexInput(a).toStringWithoutPrefix(),uid_key:n},{data:u}=await w({aptosConfig:s,path:"prove",body:f,originMethod:"getProof",overrides:{WITH_CREDENTIALS:!1}}),c=u.proof,y=new k({a:c.a,b:c.b,c:c.c});return new x({proof:new A(y,0),trainingWheelsSignature:P.fromHex(u.training_wheels_signature),expHorizonSecs:t})}async function V(r){let{aptosConfig:s,jwt:i,jwkAddress:e,uidKey:a,proofFetchCallback:n,pepper:t=await v(r)}=r,o=_({...r,pepper:t}),f=n?o:await o;if(e!==void 0){let y=C.fromJwtAndPepper({jwt:i,pepper:t,jwkAddress:e,uidKey:a}),m=await g({aptosConfig:s,authenticationKey:y.authKey().derivedAddress()});return S.create({...r,address:m,proof:f,pepper:t,proofFetchCallback:n,jwkAddress:e})}let u=K.fromJwtAndPepper({jwt:i,pepper:t,uidKey:a}),c=await g({aptosConfig:s,authenticationKey:u.authKey().derivedAddress()});return l.create({...r,address:c,proof:f,pepper:t,proofFetchCallback:n})}async function O(r){let{aptosConfig:s,sender:i,iss:e}=r,a=r.jwksUrl??(e.endsWith("/")?`${e}.well-known/jwks.json`:`${e}/.well-known/jwks.json`),n=await fetch(a);if(!n.ok)throw new Error(`Failed to fetch JWKS: ${n.status} ${n.statusText}`);let t=await n.json();return j({aptosConfig:s,sender:i.accountAddress,data:{function:"0x1::jwks::update_federated_jwk_set",functionArguments:[e,d.MoveString(t.keys.map(o=>o.kid)),d.MoveString(t.keys.map(o=>o.alg)),d.MoveString(t.keys.map(o=>o.e)),d.MoveString(t.keys.map(o=>o.n))]}})}export{v as a,_ as b,V as c,O as d};
2
- //# sourceMappingURL=chunk-OMV7445F.mjs.map
1
+ import{a as j}from"./chunk-WWZ3METZ.mjs";import{g}from"./chunk-BKEJMQQ6.mjs";import{a as S}from"./chunk-6RZZIOGH.mjs";import{a as l}from"./chunk-YHAPZP5A.mjs";import{a as C}from"./chunk-PNXUYOYI.mjs";import{i as K,l as k,m as A,n as x,p as b}from"./chunk-LG3DAAPD.mjs";import{b as P}from"./chunk-3MCYLML2.mjs";import{e as h,f as w}from"./chunk-7V6DEA7G.mjs";import{a as d}from"./chunk-CCMHWJ3Q.mjs";import{b as p}from"./chunk-BCUSI3N6.mjs";import{jwtDecode as E}from"jwt-decode";async function v(r){let{aptosConfig:s,jwt:i,ephemeralKeyPair:e,uidKey:a="sub",derivationPath:n}=r,t={jwt_b64:i,epk:e.getPublicKey().bcsToHex().toStringWithoutPrefix(),exp_date_secs:e.expiryDateSecs,epk_blinder:p.fromHexInput(e.blinder).toStringWithoutPrefix(),uid_key:a,derivation_path:n},{data:o}=await h({aptosConfig:s,path:"fetch",body:t,originMethod:"getPepper",overrides:{WITH_CREDENTIALS:!1}});return p.fromHexInput(o.pepper).toUint8Array()}async function _(r){let{aptosConfig:s,jwt:i,ephemeralKeyPair:e,pepper:a=await v(r),uidKey:n="sub"}=r;if(p.fromHexInput(a).toUint8Array().length!==l.PEPPER_LENGTH)throw new Error(`Pepper needs to be ${l.PEPPER_LENGTH} bytes`);let{maxExpHorizonSecs:t}=await b({aptosConfig:s}),o=E(i);if(typeof o.iat!="number")throw new Error("iat was not found");if(t<e.expiryDateSecs-o.iat)throw Error(`The EphemeralKeyPair is too long lived. It's lifespan must be less than ${t}`);let f={jwt_b64:i,epk:e.getPublicKey().bcsToHex().toStringWithoutPrefix(),epk_blinder:p.fromHexInput(e.blinder).toStringWithoutPrefix(),exp_date_secs:e.expiryDateSecs,exp_horizon_secs:t,pepper:p.fromHexInput(a).toStringWithoutPrefix(),uid_key:n},{data:u}=await w({aptosConfig:s,path:"prove",body:f,originMethod:"getProof",overrides:{WITH_CREDENTIALS:!1}}),c=u.proof,y=new k({a:c.a,b:c.b,c:c.c});return new x({proof:new A(y,0),trainingWheelsSignature:P.fromHex(u.training_wheels_signature),expHorizonSecs:t})}async function V(r){let{aptosConfig:s,jwt:i,jwkAddress:e,uidKey:a,proofFetchCallback:n,pepper:t=await v(r)}=r,o=_({...r,pepper:t}),f=n?o:await o;if(e!==void 0){let y=C.fromJwtAndPepper({jwt:i,pepper:t,jwkAddress:e,uidKey:a}),m=await g({aptosConfig:s,authenticationKey:y.authKey().derivedAddress()});return S.create({...r,address:m,proof:f,pepper:t,proofFetchCallback:n,jwkAddress:e})}let u=K.fromJwtAndPepper({jwt:i,pepper:t,uidKey:a}),c=await g({aptosConfig:s,authenticationKey:u.authKey().derivedAddress()});return l.create({...r,address:c,proof:f,pepper:t,proofFetchCallback:n})}async function O(r){let{aptosConfig:s,sender:i,iss:e}=r,a=r.jwksUrl??(e.endsWith("/")?`${e}.well-known/jwks.json`:`${e}/.well-known/jwks.json`),n=await fetch(a);if(!n.ok)throw new Error(`Failed to fetch JWKS: ${n.status} ${n.statusText}`);let t=await n.json();return j({aptosConfig:s,sender:i.accountAddress,data:{function:"0x1::jwks::update_federated_jwk_set",functionArguments:[e,d.MoveString(t.keys.map(o=>o.kid)),d.MoveString(t.keys.map(o=>o.alg)),d.MoveString(t.keys.map(o=>o.e)),d.MoveString(t.keys.map(o=>o.n))]}})}export{v as a,_ as b,V as c,O as d};
2
+ //# sourceMappingURL=chunk-Y7F2V3R6.mjs.map
@@ -0,0 +1,2 @@
1
+ import{a as y}from"./chunk-K2O24YLZ.mjs";import{a as u}from"./chunk-B2CXRZL5.mjs";import{i as c,n as d}from"./chunk-LG3DAAPD.mjs";import{a as p}from"./chunk-KEYAPEAX.mjs";import{jwtDecode as h}from"jwt-decode";var f=class i extends y{constructor(e){let r=c.create(e);super({publicKey:r,...e}),this.publicKey=r}serialize(e){if(e.serializeStr(this.jwt),e.serializeStr(this.uidKey),e.serializeFixedBytes(this.pepper),this.ephemeralKeyPair.serialize(e),this.proof===void 0)throw new Error("Cannot serialize - proof undefined");this.proof.serialize(e)}static deserialize(e){let r=e.deserializeStr(),s=e.deserializeStr(),o=e.deserializeFixedBytes(31),a=u.deserialize(e),n=d.deserialize(e);return i.create({proof:n,pepper:o,uidKey:s,jwt:r,ephemeralKeyPair:a})}static fromBytes(e){return i.deserialize(new p(e))}static create(e){let{address:r,proof:s,jwt:o,ephemeralKeyPair:a,pepper:n,uidKey:l="sub",proofFetchCallback:K}=e,t=h(o);if(typeof t.iss!="string")throw new Error("iss was not found");if(typeof t.aud!="string")throw new Error("aud was not found or an array of values");let m=t[l];return new i({address:r,proof:s,ephemeralKeyPair:a,iss:t.iss,uidKey:l,uidVal:m,aud:t.aud,pepper:n,jwt:o,proofFetchCallback:K})}};export{f as a};
2
+ //# sourceMappingURL=chunk-YHAPZP5A.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/account/KeylessAccount.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { JwtPayload, jwtDecode } from \"jwt-decode\";\nimport { HexInput } from \"../types\";\nimport { AccountAddress } from \"../core/accountAddress\";\nimport { KeylessPublicKey, ZeroKnowledgeSig } from \"../core/crypto\";\n\nimport { EphemeralKeyPair } from \"./EphemeralKeyPair\";\nimport { Deserializer, Serializer } from \"../bcs\";\nimport { AbstractKeylessAccount, ProofFetchCallback } from \"./AbstractKeylessAccount\";\n\n/**\n * Account implementation for the Keyless authentication scheme.\n *\n * Used to represent a Keyless based account and sign transactions with it.\n *\n * Use KeylessAccount.create to instantiate a KeylessAccount with a JWT, proof and EphemeralKeyPair.\n *\n * When the proof expires or the JWT becomes invalid, the KeylessAccount must be instantiated again with a new JWT,\n * EphemeralKeyPair, and corresponding proof.\n */\nexport class KeylessAccount extends AbstractKeylessAccount {\n /**\n * The KeylessPublicKey associated with the account\n */\n readonly publicKey: KeylessPublicKey;\n\n // Use the static constructor 'create' instead.\n private constructor(args: {\n address?: AccountAddress;\n ephemeralKeyPair: EphemeralKeyPair;\n iss: string;\n uidKey: string;\n uidVal: string;\n aud: string;\n pepper: HexInput;\n proof: ZeroKnowledgeSig | Promise<ZeroKnowledgeSig>;\n proofFetchCallback?: ProofFetchCallback;\n jwt: string;\n }) {\n const publicKey = KeylessPublicKey.create(args);\n super({ publicKey, ...args });\n this.publicKey = publicKey;\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeStr(this.jwt);\n serializer.serializeStr(this.uidKey);\n serializer.serializeFixedBytes(this.pepper);\n this.ephemeralKeyPair.serialize(serializer);\n if (this.proof === undefined) {\n throw new Error(\"Cannot serialize - proof undefined\");\n }\n this.proof.serialize(serializer);\n }\n\n static deserialize(deserializer: Deserializer): KeylessAccount {\n const jwt = deserializer.deserializeStr();\n const uidKey = deserializer.deserializeStr();\n const pepper = deserializer.deserializeFixedBytes(31);\n const ephemeralKeyPair = EphemeralKeyPair.deserialize(deserializer);\n const proof = ZeroKnowledgeSig.deserialize(deserializer);\n return KeylessAccount.create({\n proof,\n pepper,\n uidKey,\n jwt,\n ephemeralKeyPair,\n });\n }\n\n static fromBytes(bytes: Uint8Array): KeylessAccount {\n return KeylessAccount.deserialize(new Deserializer(bytes));\n }\n\n static create(args: {\n address?: AccountAddress;\n proof: ZeroKnowledgeSig | Promise<ZeroKnowledgeSig>;\n jwt: string;\n ephemeralKeyPair: EphemeralKeyPair;\n pepper: HexInput;\n uidKey?: string;\n proofFetchCallback?: ProofFetchCallback;\n }): KeylessAccount {\n const { address, proof, jwt, ephemeralKeyPair, pepper, uidKey = \"sub\", proofFetchCallback } = args;\n\n const jwtPayload = jwtDecode<JwtPayload & { [key: string]: string }>(jwt);\n if (typeof jwtPayload.iss !== \"string\") {\n throw new Error(\"iss was not found\");\n }\n if (typeof jwtPayload.aud !== \"string\") {\n throw new Error(\"aud was not found or an array of values\");\n }\n const uidVal = jwtPayload[uidKey];\n return new KeylessAccount({\n address,\n proof,\n ephemeralKeyPair,\n iss: jwtPayload.iss,\n uidKey,\n uidVal,\n aud: jwtPayload.aud,\n pepper,\n jwt,\n proofFetchCallback,\n });\n }\n}\n"],"mappings":"2KAGA,OAAqB,aAAAA,MAAiB,aAmB/B,IAAMC,EAAN,MAAMC,UAAuBC,CAAuB,CAOjD,YAAYC,EAWjB,CACD,IAAMC,EAAYC,EAAiB,OAAOF,CAAI,EAC9C,MAAM,CAAE,UAAAC,EAAW,GAAGD,CAAK,CAAC,EAC5B,KAAK,UAAYC,CACnB,CAEA,UAAUE,EAA8B,CAKtC,GAJAA,EAAW,aAAa,KAAK,GAAG,EAChCA,EAAW,aAAa,KAAK,MAAM,EACnCA,EAAW,oBAAoB,KAAK,MAAM,EAC1C,KAAK,iBAAiB,UAAUA,CAAU,EACtC,KAAK,QAAU,OACjB,MAAM,IAAI,MAAM,oCAAoC,EAEtD,KAAK,MAAM,UAAUA,CAAU,CACjC,CAEA,OAAO,YAAYC,EAA4C,CAC7D,IAAMC,EAAMD,EAAa,eAAe,EAClCE,EAASF,EAAa,eAAe,EACrCG,EAASH,EAAa,sBAAsB,EAAE,EAC9CI,EAAmBC,EAAiB,YAAYL,CAAY,EAC5DM,EAAQC,EAAiB,YAAYP,CAAY,EACvD,OAAON,EAAe,OAAO,CAC3B,MAAAY,EACA,OAAAH,EACA,OAAAD,EACA,IAAAD,EACA,iBAAAG,CACF,CAAC,CACH,CAEA,OAAO,UAAUI,EAAmC,CAClD,OAAOd,EAAe,YAAY,IAAIe,EAAaD,CAAK,CAAC,CAC3D,CAEA,OAAO,OAAOZ,EAQK,CACjB,GAAM,CAAE,QAAAc,EAAS,MAAAJ,EAAO,IAAAL,EAAK,iBAAAG,EAAkB,OAAAD,EAAQ,OAAAD,EAAS,MAAO,mBAAAS,CAAmB,EAAIf,EAExFgB,EAAaC,EAAkDZ,CAAG,EACxE,GAAI,OAAOW,EAAW,KAAQ,SAC5B,MAAM,IAAI,MAAM,mBAAmB,EAErC,GAAI,OAAOA,EAAW,KAAQ,SAC5B,MAAM,IAAI,MAAM,yCAAyC,EAE3D,IAAME,EAASF,EAAWV,CAAM,EAChC,OAAO,IAAIR,EAAe,CACxB,QAAAgB,EACA,MAAAJ,EACA,iBAAAF,EACA,IAAKQ,EAAW,IAChB,OAAAV,EACA,OAAAY,EACA,IAAKF,EAAW,IAChB,OAAAT,EACA,IAAAF,EACA,mBAAAU,CACF,CAAC,CACH,CACF","names":["jwtDecode","KeylessAccount","_KeylessAccount","AbstractKeylessAccount","args","publicKey","KeylessPublicKey","serializer","deserializer","jwt","uidKey","pepper","ephemeralKeyPair","EphemeralKeyPair","proof","ZeroKnowledgeSig","bytes","Deserializer","address","proofFetchCallback","jwtPayload","jwtDecode","uidVal"]}