@aptos-labs/ts-sdk 1.15.0-win.2 → 1.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (266) hide show
  1. package/dist/common/cli/index.js +1 -1
  2. package/dist/common/cli/index.js.map +1 -1
  3. package/dist/common/index.js +3 -3
  4. package/dist/common/index.js.map +1 -1
  5. package/dist/esm/account/Account.mjs +1 -1
  6. package/dist/esm/account/Ed25519Account.mjs +1 -1
  7. package/dist/esm/account/MultiKeyAccount.mjs +1 -1
  8. package/dist/esm/account/SingleKeyAccount.mjs +1 -1
  9. package/dist/esm/account/index.mjs +1 -1
  10. package/dist/esm/api/account.d.mts +1 -1
  11. package/dist/esm/api/account.mjs +1 -1
  12. package/dist/esm/api/ans.mjs +1 -1
  13. package/dist/esm/api/aptos.mjs +1 -1
  14. package/dist/esm/api/coin.d.mts +2 -2
  15. package/dist/esm/api/coin.mjs +1 -1
  16. package/dist/esm/api/digitalAsset.d.mts +2 -2
  17. package/dist/esm/api/digitalAsset.mjs +1 -1
  18. package/dist/esm/api/event.d.mts +1 -1
  19. package/dist/esm/api/event.mjs +1 -1
  20. package/dist/esm/api/faucet.mjs +1 -1
  21. package/dist/esm/api/fungibleAsset.d.mts +1 -1
  22. package/dist/esm/api/fungibleAsset.mjs +1 -1
  23. package/dist/esm/api/general.d.mts +2 -2
  24. package/dist/esm/api/general.mjs +1 -1
  25. package/dist/esm/api/index.mjs +1 -1
  26. package/dist/esm/api/staking.d.mts +2 -2
  27. package/dist/esm/api/staking.mjs +1 -1
  28. package/dist/esm/api/table.d.mts +1 -1
  29. package/dist/esm/api/table.mjs +1 -1
  30. package/dist/esm/api/transaction.d.mts +1 -1
  31. package/dist/esm/api/transaction.mjs +1 -1
  32. package/dist/esm/api/transactionSubmission/build.mjs +1 -1
  33. package/dist/esm/api/transactionSubmission/management.mjs +1 -1
  34. package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
  35. package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
  36. package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
  37. package/dist/esm/api/utils.mjs +1 -1
  38. package/dist/esm/bcs/index.mjs +1 -1
  39. package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -1
  40. package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -1
  41. package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
  42. package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
  43. package/dist/esm/bcs/serializer.mjs +1 -1
  44. package/dist/esm/{chunk-CEHCDA3G.mjs → chunk-2XVDVF5C.mjs} +2 -2
  45. package/dist/esm/{chunk-J77BLQCV.mjs → chunk-43HKFNUB.mjs} +2 -2
  46. package/dist/esm/{chunk-JDDYOCHY.mjs → chunk-43YYG5VO.mjs} +2 -2
  47. package/dist/esm/{chunk-BHLICYAI.mjs → chunk-4D42AAH3.mjs} +2 -2
  48. package/dist/esm/{chunk-36QXVFR5.mjs → chunk-4KMISR2H.mjs} +2 -2
  49. package/dist/esm/{chunk-SRDIYE3M.mjs → chunk-5NSXEM3O.mjs} +2 -2
  50. package/dist/esm/{chunk-7VRZLDIJ.mjs → chunk-5SQAHWDI.mjs} +2 -2
  51. package/dist/esm/{chunk-S2VSJJRJ.mjs → chunk-5TTCAW72.mjs} +2 -2
  52. package/dist/esm/{chunk-PYGUW7SU.mjs → chunk-6JFZZLRC.mjs} +2 -2
  53. package/dist/esm/{chunk-EKOTTHRQ.mjs → chunk-6SK246YU.mjs} +2 -2
  54. package/dist/esm/{chunk-P6GWG2CY.mjs → chunk-A7J2UMLS.mjs} +2 -2
  55. package/dist/esm/{chunk-UGPALAPN.mjs → chunk-AFTMLXYT.mjs} +2 -2
  56. package/dist/esm/{chunk-25HG3O2C.mjs → chunk-AKJZL3HT.mjs} +2 -2
  57. package/dist/esm/{chunk-2O5VFH5O.mjs → chunk-AR3GW64L.mjs} +2 -2
  58. package/dist/esm/{chunk-EU7EBOVD.mjs → chunk-AWPRGMUP.mjs} +2 -2
  59. package/dist/esm/{chunk-UEELI2FS.mjs → chunk-BCLP2ENK.mjs} +2 -2
  60. package/dist/esm/{chunk-DCF2OTJS.mjs → chunk-CCQRMKD2.mjs} +2 -2
  61. package/dist/esm/{chunk-SGTNW5YI.mjs → chunk-CX4BEIQT.mjs} +2 -2
  62. package/dist/esm/{chunk-TUMYQZ27.mjs → chunk-DBC2JY65.mjs} +2 -2
  63. package/dist/esm/{chunk-AJIDUBBG.mjs → chunk-DO444YYD.mjs} +2 -2
  64. package/dist/esm/{chunk-4W3ZDREO.mjs → chunk-DPWXEJP6.mjs} +2 -2
  65. package/dist/esm/{chunk-C6HODGUS.mjs → chunk-EUUIYMYC.mjs} +2 -2
  66. package/dist/esm/{chunk-4NHWV5AI.mjs → chunk-F7J7ZW4H.mjs} +2 -2
  67. package/dist/esm/{chunk-Y3RPWX6U.mjs → chunk-FLUCRNGU.mjs} +2 -2
  68. package/dist/esm/{chunk-N3U47Y6Y.mjs → chunk-FNKDXPPQ.mjs} +2 -2
  69. package/dist/esm/{chunk-5WFN54GV.mjs → chunk-FVN6MJTH.mjs} +2 -2
  70. package/dist/esm/{chunk-JP4W2YJF.mjs → chunk-FW6TF3O2.mjs} +2 -2
  71. package/dist/esm/{chunk-MV6ORORF.mjs → chunk-FWPK5KC2.mjs} +2 -2
  72. package/dist/esm/{chunk-DZJ2RMX3.mjs → chunk-HMTYASEZ.mjs} +2 -2
  73. package/dist/esm/{chunk-T4J32V4F.mjs → chunk-HZ3YB6TN.mjs} +2 -2
  74. package/dist/esm/{chunk-UQU5WAX2.mjs → chunk-I3MG3W4J.mjs} +2 -2
  75. package/dist/esm/chunk-ISIUQQMV.mjs +2 -0
  76. package/dist/esm/chunk-ISIUQQMV.mjs.map +1 -0
  77. package/dist/esm/{chunk-MJPUASSD.mjs → chunk-JE7INUQ2.mjs} +2 -2
  78. package/dist/esm/{chunk-UPSCPEEE.mjs → chunk-JHBMHOSV.mjs} +2 -2
  79. package/dist/esm/{chunk-KAGLWBIJ.mjs → chunk-JNDRFTEA.mjs} +2 -2
  80. package/dist/esm/{chunk-I6ST47U7.mjs → chunk-JWTZDA6A.mjs} +2 -2
  81. package/dist/esm/{chunk-35EWRSDK.mjs → chunk-LF6IQT54.mjs} +2 -2
  82. package/dist/esm/{chunk-C4RK5AB6.mjs → chunk-LGOZUIGE.mjs} +2 -2
  83. package/dist/esm/chunk-LKVJZTBM.mjs +2 -0
  84. package/dist/esm/{chunk-BVV56I3P.mjs.map → chunk-LKVJZTBM.mjs.map} +1 -1
  85. package/dist/esm/{chunk-SSSWFYAX.mjs → chunk-LM7CN4LT.mjs} +2 -2
  86. package/dist/esm/{chunk-TLLWFCCP.mjs → chunk-LVYNEPH4.mjs} +2 -2
  87. package/dist/esm/{chunk-BO2TLWNT.mjs → chunk-LX53BIRN.mjs} +2 -2
  88. package/dist/esm/{chunk-BZCARW2P.mjs → chunk-MEXWNZY6.mjs} +2 -2
  89. package/dist/esm/chunk-NYXLPBKE.mjs +2 -0
  90. package/dist/esm/{chunk-CJDEPZ4J.mjs.map → chunk-NYXLPBKE.mjs.map} +1 -1
  91. package/dist/esm/{chunk-2ZGHK5BB.mjs → chunk-OIH4KBXW.mjs} +2 -2
  92. package/dist/esm/{chunk-QYJF7C23.mjs → chunk-OLKEU7WZ.mjs} +2 -2
  93. package/dist/esm/{chunk-GWPTNJTQ.mjs → chunk-OO5EJW3B.mjs} +2 -2
  94. package/dist/esm/{chunk-L7LLGJRG.mjs → chunk-OOH7MH2H.mjs} +2 -2
  95. package/dist/esm/{chunk-PF57EOJY.mjs → chunk-P2CIREOD.mjs} +2 -2
  96. package/dist/esm/{chunk-7FIS3GNZ.mjs → chunk-QIELBIZW.mjs} +2 -2
  97. package/dist/esm/{chunk-NNUKSGEX.mjs → chunk-QKV2H27T.mjs} +2 -2
  98. package/dist/esm/{chunk-AJU3EBVX.mjs → chunk-R5NNAF5B.mjs} +2 -2
  99. package/dist/esm/{chunk-DQOIESL4.mjs → chunk-RC6B45PP.mjs} +2 -2
  100. package/dist/esm/{chunk-U3YYSIIT.mjs → chunk-S5AGI7RQ.mjs} +2 -2
  101. package/dist/esm/{chunk-2XK53QFA.mjs → chunk-T2WZWN6W.mjs} +2 -2
  102. package/dist/esm/{chunk-ECVKW776.mjs → chunk-TAVPFLW5.mjs} +2 -2
  103. package/dist/esm/{chunk-GM56MMNJ.mjs → chunk-TZCETTAW.mjs} +2 -2
  104. package/dist/esm/{chunk-QRS4DGP3.mjs → chunk-UEI62FBQ.mjs} +2 -2
  105. package/dist/esm/{chunk-CWO2JAUL.mjs → chunk-UF5B4XMN.mjs} +2 -2
  106. package/dist/esm/{chunk-64MINNG2.mjs → chunk-V367QLY3.mjs} +2 -2
  107. package/dist/esm/{chunk-6QJOCI5Y.mjs → chunk-V3DEJBS6.mjs} +2 -2
  108. package/dist/esm/{chunk-EW3AR5V3.mjs → chunk-V6J6AW5T.mjs} +2 -2
  109. package/dist/esm/{chunk-VC4A47VQ.mjs → chunk-VEB6NALT.mjs} +2 -2
  110. package/dist/esm/{chunk-AG3TUKNI.mjs → chunk-VJL6AF64.mjs} +2 -2
  111. package/dist/esm/{chunk-5EN52MUT.mjs → chunk-WNVUG2UF.mjs} +2 -2
  112. package/dist/esm/{chunk-B7X6PSE7.mjs → chunk-WZSVQBPA.mjs} +2 -2
  113. package/dist/esm/{chunk-ZJMW5Z76.mjs → chunk-X6BYF2UD.mjs} +2 -2
  114. package/dist/esm/{chunk-YMB2XW2O.mjs → chunk-XHEZAVN3.mjs} +2 -2
  115. package/dist/esm/{chunk-JFIAWBCK.mjs → chunk-XXBMHWNV.mjs} +2 -2
  116. package/dist/esm/{chunk-G56GPLTB.mjs → chunk-YJIRT3GJ.mjs} +2 -2
  117. package/dist/esm/{chunk-OUTRV57V.mjs → chunk-YMHX6GC2.mjs} +2 -2
  118. package/dist/esm/{chunk-GCBRNHAO.mjs → chunk-YTJ73ZX3.mjs} +2 -2
  119. package/dist/esm/{chunk-M3YZNSJI.mjs → chunk-ZMXURV35.mjs} +2 -2
  120. package/dist/esm/cli/index.mjs +1 -1
  121. package/dist/esm/cli/localNode.mjs +1 -1
  122. package/dist/esm/client/core.mjs +1 -1
  123. package/dist/esm/client/get.mjs +1 -1
  124. package/dist/esm/client/index.mjs +1 -1
  125. package/dist/esm/client/post.mjs +1 -1
  126. package/dist/esm/core/account/index.mjs +1 -1
  127. package/dist/esm/core/account/utils/address.mjs +1 -1
  128. package/dist/esm/core/account/utils/index.mjs +1 -1
  129. package/dist/esm/core/accountAddress.mjs +1 -1
  130. package/dist/esm/core/authenticationKey.mjs +1 -1
  131. package/dist/esm/core/crypto/ed25519.mjs +1 -1
  132. package/dist/esm/core/crypto/index.mjs +1 -1
  133. package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
  134. package/dist/esm/core/crypto/multiKey.mjs +1 -1
  135. package/dist/esm/core/crypto/publicKey.mjs +1 -1
  136. package/dist/esm/core/crypto/secp256k1.mjs +1 -1
  137. package/dist/esm/core/crypto/signature.mjs +1 -1
  138. package/dist/esm/core/crypto/singleKey.mjs +1 -1
  139. package/dist/esm/core/index.mjs +1 -1
  140. package/dist/esm/index.mjs +1 -1
  141. package/dist/esm/internal/account.d.mts +1 -1
  142. package/dist/esm/internal/account.mjs +1 -1
  143. package/dist/esm/internal/ans.mjs +1 -1
  144. package/dist/esm/internal/coin.d.mts +3 -3
  145. package/dist/esm/internal/coin.mjs +1 -1
  146. package/dist/esm/internal/digitalAsset.mjs +1 -1
  147. package/dist/esm/internal/event.d.mts +1 -1
  148. package/dist/esm/internal/event.mjs +1 -1
  149. package/dist/esm/internal/faucet.d.mts +3 -3
  150. package/dist/esm/internal/faucet.mjs +1 -1
  151. package/dist/esm/internal/fungibleAsset.d.mts +1 -1
  152. package/dist/esm/internal/fungibleAsset.mjs +1 -1
  153. package/dist/esm/internal/general.mjs +1 -1
  154. package/dist/esm/internal/staking.d.mts +2 -2
  155. package/dist/esm/internal/staking.mjs +1 -1
  156. package/dist/esm/internal/table.mjs +1 -1
  157. package/dist/esm/internal/transaction.mjs +1 -1
  158. package/dist/esm/internal/transactionSubmission.d.mts +4 -4
  159. package/dist/esm/internal/transactionSubmission.mjs +1 -1
  160. package/dist/esm/internal/view.mjs +1 -1
  161. package/dist/esm/transactions/authenticator/account.mjs +1 -1
  162. package/dist/esm/transactions/authenticator/index.mjs +1 -1
  163. package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
  164. package/dist/esm/transactions/index.mjs +1 -1
  165. package/dist/esm/transactions/instances/chainId.mjs +1 -1
  166. package/dist/esm/transactions/instances/identifier.mjs +1 -1
  167. package/dist/esm/transactions/instances/index.mjs +1 -1
  168. package/dist/esm/transactions/instances/moduleId.mjs +1 -1
  169. package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
  170. package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
  171. package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
  172. package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
  173. package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
  174. package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
  175. package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
  176. package/dist/esm/transactions/management/index.mjs +1 -1
  177. package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
  178. package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
  179. package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
  180. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
  181. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
  182. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
  183. package/dist/esm/transactions/typeTag/index.mjs +1 -1
  184. package/dist/esm/transactions/typeTag/parser.mjs +1 -1
  185. package/dist/esm/utils/index.mjs +1 -1
  186. package/dist/esm/utils/normalizeBundle.mjs +1 -1
  187. package/dist/esm/version.d.mts +1 -1
  188. package/dist/esm/version.mjs +1 -1
  189. package/package.json +1 -1
  190. package/src/cli/localNode.ts +11 -1
  191. package/src/transactions/transactionBuilder/remoteAbi.ts +13 -0
  192. package/src/version.ts +1 -1
  193. package/dist/esm/chunk-BVV56I3P.mjs +0 -2
  194. package/dist/esm/chunk-CJDEPZ4J.mjs +0 -2
  195. package/dist/esm/chunk-L54P6EGN.mjs +0 -2
  196. package/dist/esm/chunk-L54P6EGN.mjs.map +0 -1
  197. /package/dist/esm/{chunk-CEHCDA3G.mjs.map → chunk-2XVDVF5C.mjs.map} +0 -0
  198. /package/dist/esm/{chunk-J77BLQCV.mjs.map → chunk-43HKFNUB.mjs.map} +0 -0
  199. /package/dist/esm/{chunk-JDDYOCHY.mjs.map → chunk-43YYG5VO.mjs.map} +0 -0
  200. /package/dist/esm/{chunk-BHLICYAI.mjs.map → chunk-4D42AAH3.mjs.map} +0 -0
  201. /package/dist/esm/{chunk-36QXVFR5.mjs.map → chunk-4KMISR2H.mjs.map} +0 -0
  202. /package/dist/esm/{chunk-SRDIYE3M.mjs.map → chunk-5NSXEM3O.mjs.map} +0 -0
  203. /package/dist/esm/{chunk-7VRZLDIJ.mjs.map → chunk-5SQAHWDI.mjs.map} +0 -0
  204. /package/dist/esm/{chunk-S2VSJJRJ.mjs.map → chunk-5TTCAW72.mjs.map} +0 -0
  205. /package/dist/esm/{chunk-PYGUW7SU.mjs.map → chunk-6JFZZLRC.mjs.map} +0 -0
  206. /package/dist/esm/{chunk-EKOTTHRQ.mjs.map → chunk-6SK246YU.mjs.map} +0 -0
  207. /package/dist/esm/{chunk-P6GWG2CY.mjs.map → chunk-A7J2UMLS.mjs.map} +0 -0
  208. /package/dist/esm/{chunk-UGPALAPN.mjs.map → chunk-AFTMLXYT.mjs.map} +0 -0
  209. /package/dist/esm/{chunk-25HG3O2C.mjs.map → chunk-AKJZL3HT.mjs.map} +0 -0
  210. /package/dist/esm/{chunk-2O5VFH5O.mjs.map → chunk-AR3GW64L.mjs.map} +0 -0
  211. /package/dist/esm/{chunk-EU7EBOVD.mjs.map → chunk-AWPRGMUP.mjs.map} +0 -0
  212. /package/dist/esm/{chunk-UEELI2FS.mjs.map → chunk-BCLP2ENK.mjs.map} +0 -0
  213. /package/dist/esm/{chunk-DCF2OTJS.mjs.map → chunk-CCQRMKD2.mjs.map} +0 -0
  214. /package/dist/esm/{chunk-SGTNW5YI.mjs.map → chunk-CX4BEIQT.mjs.map} +0 -0
  215. /package/dist/esm/{chunk-TUMYQZ27.mjs.map → chunk-DBC2JY65.mjs.map} +0 -0
  216. /package/dist/esm/{chunk-AJIDUBBG.mjs.map → chunk-DO444YYD.mjs.map} +0 -0
  217. /package/dist/esm/{chunk-4W3ZDREO.mjs.map → chunk-DPWXEJP6.mjs.map} +0 -0
  218. /package/dist/esm/{chunk-C6HODGUS.mjs.map → chunk-EUUIYMYC.mjs.map} +0 -0
  219. /package/dist/esm/{chunk-4NHWV5AI.mjs.map → chunk-F7J7ZW4H.mjs.map} +0 -0
  220. /package/dist/esm/{chunk-Y3RPWX6U.mjs.map → chunk-FLUCRNGU.mjs.map} +0 -0
  221. /package/dist/esm/{chunk-N3U47Y6Y.mjs.map → chunk-FNKDXPPQ.mjs.map} +0 -0
  222. /package/dist/esm/{chunk-5WFN54GV.mjs.map → chunk-FVN6MJTH.mjs.map} +0 -0
  223. /package/dist/esm/{chunk-JP4W2YJF.mjs.map → chunk-FW6TF3O2.mjs.map} +0 -0
  224. /package/dist/esm/{chunk-MV6ORORF.mjs.map → chunk-FWPK5KC2.mjs.map} +0 -0
  225. /package/dist/esm/{chunk-DZJ2RMX3.mjs.map → chunk-HMTYASEZ.mjs.map} +0 -0
  226. /package/dist/esm/{chunk-T4J32V4F.mjs.map → chunk-HZ3YB6TN.mjs.map} +0 -0
  227. /package/dist/esm/{chunk-UQU5WAX2.mjs.map → chunk-I3MG3W4J.mjs.map} +0 -0
  228. /package/dist/esm/{chunk-MJPUASSD.mjs.map → chunk-JE7INUQ2.mjs.map} +0 -0
  229. /package/dist/esm/{chunk-UPSCPEEE.mjs.map → chunk-JHBMHOSV.mjs.map} +0 -0
  230. /package/dist/esm/{chunk-KAGLWBIJ.mjs.map → chunk-JNDRFTEA.mjs.map} +0 -0
  231. /package/dist/esm/{chunk-I6ST47U7.mjs.map → chunk-JWTZDA6A.mjs.map} +0 -0
  232. /package/dist/esm/{chunk-35EWRSDK.mjs.map → chunk-LF6IQT54.mjs.map} +0 -0
  233. /package/dist/esm/{chunk-C4RK5AB6.mjs.map → chunk-LGOZUIGE.mjs.map} +0 -0
  234. /package/dist/esm/{chunk-SSSWFYAX.mjs.map → chunk-LM7CN4LT.mjs.map} +0 -0
  235. /package/dist/esm/{chunk-TLLWFCCP.mjs.map → chunk-LVYNEPH4.mjs.map} +0 -0
  236. /package/dist/esm/{chunk-BO2TLWNT.mjs.map → chunk-LX53BIRN.mjs.map} +0 -0
  237. /package/dist/esm/{chunk-BZCARW2P.mjs.map → chunk-MEXWNZY6.mjs.map} +0 -0
  238. /package/dist/esm/{chunk-2ZGHK5BB.mjs.map → chunk-OIH4KBXW.mjs.map} +0 -0
  239. /package/dist/esm/{chunk-QYJF7C23.mjs.map → chunk-OLKEU7WZ.mjs.map} +0 -0
  240. /package/dist/esm/{chunk-GWPTNJTQ.mjs.map → chunk-OO5EJW3B.mjs.map} +0 -0
  241. /package/dist/esm/{chunk-L7LLGJRG.mjs.map → chunk-OOH7MH2H.mjs.map} +0 -0
  242. /package/dist/esm/{chunk-PF57EOJY.mjs.map → chunk-P2CIREOD.mjs.map} +0 -0
  243. /package/dist/esm/{chunk-7FIS3GNZ.mjs.map → chunk-QIELBIZW.mjs.map} +0 -0
  244. /package/dist/esm/{chunk-NNUKSGEX.mjs.map → chunk-QKV2H27T.mjs.map} +0 -0
  245. /package/dist/esm/{chunk-AJU3EBVX.mjs.map → chunk-R5NNAF5B.mjs.map} +0 -0
  246. /package/dist/esm/{chunk-DQOIESL4.mjs.map → chunk-RC6B45PP.mjs.map} +0 -0
  247. /package/dist/esm/{chunk-U3YYSIIT.mjs.map → chunk-S5AGI7RQ.mjs.map} +0 -0
  248. /package/dist/esm/{chunk-2XK53QFA.mjs.map → chunk-T2WZWN6W.mjs.map} +0 -0
  249. /package/dist/esm/{chunk-ECVKW776.mjs.map → chunk-TAVPFLW5.mjs.map} +0 -0
  250. /package/dist/esm/{chunk-GM56MMNJ.mjs.map → chunk-TZCETTAW.mjs.map} +0 -0
  251. /package/dist/esm/{chunk-QRS4DGP3.mjs.map → chunk-UEI62FBQ.mjs.map} +0 -0
  252. /package/dist/esm/{chunk-CWO2JAUL.mjs.map → chunk-UF5B4XMN.mjs.map} +0 -0
  253. /package/dist/esm/{chunk-64MINNG2.mjs.map → chunk-V367QLY3.mjs.map} +0 -0
  254. /package/dist/esm/{chunk-6QJOCI5Y.mjs.map → chunk-V3DEJBS6.mjs.map} +0 -0
  255. /package/dist/esm/{chunk-EW3AR5V3.mjs.map → chunk-V6J6AW5T.mjs.map} +0 -0
  256. /package/dist/esm/{chunk-VC4A47VQ.mjs.map → chunk-VEB6NALT.mjs.map} +0 -0
  257. /package/dist/esm/{chunk-AG3TUKNI.mjs.map → chunk-VJL6AF64.mjs.map} +0 -0
  258. /package/dist/esm/{chunk-5EN52MUT.mjs.map → chunk-WNVUG2UF.mjs.map} +0 -0
  259. /package/dist/esm/{chunk-B7X6PSE7.mjs.map → chunk-WZSVQBPA.mjs.map} +0 -0
  260. /package/dist/esm/{chunk-ZJMW5Z76.mjs.map → chunk-X6BYF2UD.mjs.map} +0 -0
  261. /package/dist/esm/{chunk-YMB2XW2O.mjs.map → chunk-XHEZAVN3.mjs.map} +0 -0
  262. /package/dist/esm/{chunk-JFIAWBCK.mjs.map → chunk-XXBMHWNV.mjs.map} +0 -0
  263. /package/dist/esm/{chunk-G56GPLTB.mjs.map → chunk-YJIRT3GJ.mjs.map} +0 -0
  264. /package/dist/esm/{chunk-OUTRV57V.mjs.map → chunk-YMHX6GC2.mjs.map} +0 -0
  265. /package/dist/esm/{chunk-GCBRNHAO.mjs.map → chunk-YTJ73ZX3.mjs.map} +0 -0
  266. /package/dist/esm/{chunk-M3YZNSJI.mjs.map → chunk-ZMXURV35.mjs.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{b as c}from"./chunk-QRS4DGP3.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-KAGLWBIJ.mjs.map
1
+ import{b as c}from"./chunk-UEI62FBQ.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-JNDRFTEA.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as d}from"./chunk-UGPALAPN.mjs";import{a as u}from"./chunk-F7EMGK4M.mjs";import{e as g,j as h}from"./chunk-LR65XHSF.mjs";import{a as f}from"./chunk-4NHWV5AI.mjs";import{a as p}from"./chunk-36QXVFR5.mjs";import{b as s}from"./chunk-BCUSI3N6.mjs";import{sha3_256 as H}from"@noble/hashes/sha3";import{secp256k1 as o}from"@noble/curves/secp256k1";import{HDKey as S}from"@scure/bip32";var n=class n extends f{constructor(e){super();let r=s.fromHexInput(e);if(r.toUint8Array().length!==n.LENGTH)throw new Error(`PublicKey length should be ${n.LENGTH}`);this.key=r}verifySignature(e){let{message:r,signature:i}=e;if(!(i instanceof y))return!1;let l=u(r),c=s.fromHexInput(l).toUint8Array(),A=H(c),x=i.toUint8Array();return o.verify(x,A,this.key.toUint8Array(),{lowS:!0})}toUint8Array(){return this.key.toUint8Array()}serialize(e){e.serializeBytes(this.key.toUint8Array())}static deserialize(e){let r=e.deserializeBytes();return new n(r)}static isPublicKey(e){return e instanceof n}};n.LENGTH=65;var m=n,t=class t extends p{constructor(e){super();let r=s.fromHexInput(e);if(r.toUint8Array().length!==t.LENGTH)throw new Error(`PrivateKey length should be ${t.LENGTH}`);this.key=r}static generate(){let e=o.utils.randomPrivateKey();return new t(e)}static fromDerivationPath(e,r){if(!g(e))throw new Error(`Invalid derivation path ${e}`);return t.fromDerivationPathInner(e,h(r))}static fromDerivationPathInner(e,r){let{privateKey:i}=S.fromMasterSeed(r).derive(e);if(i===null)throw new Error("Invalid key");return new t(i)}sign(e){let r=u(e),i=s.fromHexInput(r),l=H(i.toUint8Array()),c=o.sign(l,this.key.toUint8Array(),{lowS:!0});return new y(c.toCompactRawBytes())}publicKey(){let e=o.getPublicKey(this.key.toUint8Array(),!1);return new m(e)}toUint8Array(){return this.key.toUint8Array()}toString(){return this.key.toString()}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let r=e.deserializeBytes();return new t(r)}static isPrivateKey(e){return e instanceof t}};t.LENGTH=32;var v=t,a=class a extends d{constructor(e){super();let r=s.fromHexInput(e);if(r.toUint8Array().length!==a.LENGTH)throw new Error(`Signature length should be ${a.LENGTH}, received ${r.toUint8Array().length}`);this.data=r}toUint8Array(){return this.data.toUint8Array()}serialize(e){e.serializeBytes(this.data.toUint8Array())}static deserialize(e){let r=e.deserializeBytes();return new a(r)}};a.LENGTH=64;var y=a;export{m as a,v as b,y as c};
2
- //# sourceMappingURL=chunk-I6ST47U7.mjs.map
1
+ import{a as d}from"./chunk-AFTMLXYT.mjs";import{a as u}from"./chunk-F7EMGK4M.mjs";import{e as g,j as h}from"./chunk-LR65XHSF.mjs";import{a as f}from"./chunk-F7J7ZW4H.mjs";import{a as p}from"./chunk-4KMISR2H.mjs";import{b as s}from"./chunk-BCUSI3N6.mjs";import{sha3_256 as H}from"@noble/hashes/sha3";import{secp256k1 as o}from"@noble/curves/secp256k1";import{HDKey as S}from"@scure/bip32";var n=class n extends f{constructor(e){super();let r=s.fromHexInput(e);if(r.toUint8Array().length!==n.LENGTH)throw new Error(`PublicKey length should be ${n.LENGTH}`);this.key=r}verifySignature(e){let{message:r,signature:i}=e;if(!(i instanceof y))return!1;let l=u(r),c=s.fromHexInput(l).toUint8Array(),A=H(c),x=i.toUint8Array();return o.verify(x,A,this.key.toUint8Array(),{lowS:!0})}toUint8Array(){return this.key.toUint8Array()}serialize(e){e.serializeBytes(this.key.toUint8Array())}static deserialize(e){let r=e.deserializeBytes();return new n(r)}static isPublicKey(e){return e instanceof n}};n.LENGTH=65;var m=n,t=class t extends p{constructor(e){super();let r=s.fromHexInput(e);if(r.toUint8Array().length!==t.LENGTH)throw new Error(`PrivateKey length should be ${t.LENGTH}`);this.key=r}static generate(){let e=o.utils.randomPrivateKey();return new t(e)}static fromDerivationPath(e,r){if(!g(e))throw new Error(`Invalid derivation path ${e}`);return t.fromDerivationPathInner(e,h(r))}static fromDerivationPathInner(e,r){let{privateKey:i}=S.fromMasterSeed(r).derive(e);if(i===null)throw new Error("Invalid key");return new t(i)}sign(e){let r=u(e),i=s.fromHexInput(r),l=H(i.toUint8Array()),c=o.sign(l,this.key.toUint8Array(),{lowS:!0});return new y(c.toCompactRawBytes())}publicKey(){let e=o.getPublicKey(this.key.toUint8Array(),!1);return new m(e)}toUint8Array(){return this.key.toUint8Array()}toString(){return this.key.toString()}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let r=e.deserializeBytes();return new t(r)}static isPrivateKey(e){return e instanceof t}};t.LENGTH=32;var v=t,a=class a extends d{constructor(e){super();let r=s.fromHexInput(e);if(r.toUint8Array().length!==a.LENGTH)throw new Error(`Signature length should be ${a.LENGTH}, received ${r.toUint8Array().length}`);this.data=r}toUint8Array(){return this.data.toUint8Array()}serialize(e){e.serializeBytes(this.data.toUint8Array())}static deserialize(e){let r=e.deserializeBytes();return new a(r)}};a.LENGTH=64;var y=a;export{m as a,v as b,y as c};
2
+ //# sourceMappingURL=chunk-JWTZDA6A.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-B7X6PSE7.mjs";import{b as i}from"./chunk-QRS4DGP3.mjs";import{a as d}from"./chunk-36QXVFR5.mjs";var o=class t extends d{constructor(e,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-35EWRSDK.mjs.map
1
+ import{a as s}from"./chunk-WZSVQBPA.mjs";import{b as i}from"./chunk-UEI62FBQ.mjs";import{a as d}from"./chunk-4KMISR2H.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-LF6IQT54.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as d,b}from"./chunk-2O5VFH5O.mjs";import{a as h,b as z}from"./chunk-EU7EBOVD.mjs";import{a as p,b as g}from"./chunk-JDDYOCHY.mjs";import{a as o,c as y}from"./chunk-SGTNW5YI.mjs";import{a as c}from"./chunk-36QXVFR5.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-C4RK5AB6.mjs.map
1
+ import{a as d,b}from"./chunk-AR3GW64L.mjs";import{a as h,b as z}from"./chunk-AWPRGMUP.mjs";import{a as p,b as g}from"./chunk-43YYG5VO.mjs";import{a as o,c as y}from"./chunk-CX4BEIQT.mjs";import{a as c}from"./chunk-4KMISR2H.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-LGOZUIGE.mjs.map
@@ -0,0 +1,2 @@
1
+ import{c as w}from"./chunk-JE7INUQ2.mjs";import{a as x,b as f,c as l,d as U,e as M,f as C,g as O,h as B,i as _,k as V,l as G,m as j,n as k,o as z,p as D,r as i,s as L}from"./chunk-JHBMHOSV.mjs";import{c as I}from"./chunk-MEXWNZY6.mjs";import{n as S}from"./chunk-S5AGI7RQ.mjs";import{a as c,b as F,c as T}from"./chunk-YJIRT3GJ.mjs";import{a as A,b as m,c as h,d,e as v,f as $,g as p}from"./chunk-5NSXEM3O.mjs";import{b as E}from"./chunk-UEI62FBQ.mjs";var R=new TextEncoder;function Y(n){return n?.map(e=>f(e)?w(e):e)??[]}async function P(n,e,t,u){let r=await I({aptosConfig:u,accountAddress:n,moduleName:e});if(r.abi)return r.abi.exposed_functions.find(o=>o.name===t)}async function Z(n,e,t,u){let r=await P(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=L(r),y=[];for(let s=o;s<r.params.length;s+=1)y.push(w(r.params[s],{allowGenerics:!0}));return{signers:o,typeParameters:r.generic_type_params,parameters:y}}async function a(n,e,t,u){let r=await P(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 s=0;s<r.params.length;s+=1)o.push(w(r.params[s],{allowGenerics:!0}));let y=[];for(let s=0;s<r.return.length;s+=1)y.push(w(r.return[s],{allowGenerics:!0}));return{typeParameters:r.generic_type_params,parameters:o,returnTypes:y}}function nn(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 g(t,o,u,r)}function g(n,e,t,u){return C(n)?(b(e,n,t),n):X(n,e,t,u)}function X(n,e,t,u){if(e.isBool()){if(x(n))return new A(n);if(f(n)){if(n==="true")return new A(!0);if(n==="false")return new A(!1)}i("boolean",t)}if(e.isAddress()){if(f(n))return E.fromString(n);i("string | AccountAddress",t)}if(e.isU8()){if(l(n))return new m(n);if(f(n))return new m(Number.parseInt(n,10));i("number",t)}if(e.isU16()){if(l(n))return new h(n);if(f(n))return new h(Number.parseInt(n,10));i("number",t)}if(e.isU32()){if(l(n))return new d(n);if(f(n))return new d(Number.parseInt(n,10));i("number",t)}if(e.isU64()){if(U(n))return new v(BigInt(n));i("bigint | number | string",t)}if(e.isU128()){if(U(n))return new $(BigInt(n));i("bigint | number | string",t)}if(e.isU256()){if(U(n))return new p(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 g(n,u[r],t,u)}if(e.isVector()){if(e.value.isU8()){if(f(n))return c.U8(R.encode(n));if(n instanceof Uint8Array)return c.U8(n);if(n instanceof ArrayBuffer)return c.U8(new Uint8Array(n))}if(Array.isArray(n))return new c(n.map(r=>g(r,e.value,t,u)));throw new Error(`Type mismatch for argument ${t}, type '${e.toString()}'`)}if(e.isStruct()){if(e.isString()){if(f(n))return new F(n);i("string",t)}if(e.isObject()){if(f(n))return E.fromString(n);i("string | AccountAddress",t)}if(e.isOption())return M(n)?new T(null):new T(g(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 b(n,e,t){if(n.isBool()){if(O(e))return;i("Bool",t)}if(n.isAddress()){if(B(e))return;i("AccountAddress",t)}if(n.isU8()){if(V(e))return;i("U8",t)}if(n.isU16()){if(G(e))return;i("U16",t)}if(n.isU32()){if(j(e))return;i("U32",t)}if(n.isU64()){if(k(e))return;i("U64",t)}if(n.isU128()){if(z(e))return;i("U128",t)}if(n.isU256()){if(D(e))return;i("U256",t)}if(n.isVector()){if(e instanceof c){e.values.length>0&&b(n.value,e.values[0],t);return}i("MoveVector",t)}if(n instanceof S){if(n.isString()){if(_(e))return;i("MoveString",t)}if(n.isObject()){if(B(e))return;i("AccountAddress",t)}if(n.isOption()){if(e instanceof T){e.value!==void 0&&b(n.value.typeArgs[0],e.value,t);return}i("MoveOption",t)}}throw new Error(`Type mismatch for argument ${t}, expected '${n.toString()}'`)}export{Y as a,P as b,Z as c,a as d,nn as e,g as f};
2
+ //# sourceMappingURL=chunk-LKVJZTBM.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/transactions/transactionBuilder/remoteAbi.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { parseTypeTag } from \"../typeTag/parser\";\nimport { TypeTag, TypeTagStruct } from \"../typeTag\";\nimport { AptosConfig } from \"../../api/aptosConfig\";\nimport {\n EntryFunctionArgumentTypes,\n SimpleEntryFunctionArgumentTypes,\n EntryFunctionABI,\n ViewFunctionABI,\n FunctionABI,\n} from \"../types\";\nimport { Bool, MoveOption, MoveString, MoveVector, U128, U16, U256, U32, U64, U8 } from \"../../bcs\";\nimport { AccountAddress } from \"../../core\";\nimport { getModule } from \"../../internal/account\";\nimport {\n findFirstNonSignerArg,\n isBcsAddress,\n isBcsBool,\n isBcsString,\n isBcsU128,\n isBcsU16,\n isBcsU256,\n isBcsU32,\n isBcsU64,\n isBcsU8,\n isBool,\n isEncodedEntryFunctionArgument,\n isLargeNumber,\n isNull,\n isNumber,\n isString,\n throwTypeMismatch,\n} from \"./helpers\";\nimport { MoveFunction } from \"../../types\";\n\nconst TEXT_ENCODER = new TextEncoder();\n\n/**\n * Convert type arguments to only type tags, allowing for string representations of type tags\n */\nexport function standardizeTypeTags(typeArguments?: Array<TypeTag | string>): Array<TypeTag> {\n return (\n typeArguments?.map((typeArg: string | TypeTag): TypeTag => {\n // Convert to TypeTag if it's a string representation\n if (isString(typeArg)) {\n return parseTypeTag(typeArg);\n }\n return typeArg;\n }) ?? []\n );\n}\n\n/**\n * Fetches a function ABI from the on-chain module ABI. It doesn't validate whether it's a view or entry function.\n * @param moduleAddress\n * @param moduleName\n * @param functionName\n * @param aptosConfig\n */\nexport async function fetchFunctionAbi(\n moduleAddress: string,\n moduleName: string,\n functionName: string,\n aptosConfig: AptosConfig,\n): Promise<MoveFunction | undefined> {\n // This fetch from the API is currently cached\n const module = await getModule({ aptosConfig, accountAddress: moduleAddress, moduleName });\n\n if (module.abi) {\n return module.abi.exposed_functions.find((func) => func.name === functionName);\n }\n\n return undefined;\n}\n\n/**\n * Fetches the ABI for an entry function from the module\n *\n * @param moduleAddress\n * @param moduleName\n * @param functionName\n * @param aptosConfig\n */\nexport async function fetchEntryFunctionAbi(\n moduleAddress: string,\n moduleName: string,\n functionName: string,\n aptosConfig: AptosConfig,\n): Promise<EntryFunctionABI> {\n const functionAbi = await fetchFunctionAbi(moduleAddress, moduleName, functionName, aptosConfig);\n\n // If there's no ABI, then the function is invalid\n if (!functionAbi) {\n throw new Error(`Could not find entry function ABI for '${moduleAddress}::${moduleName}::${functionName}'`);\n }\n\n // Non-entry functions also can't be used\n if (!functionAbi.is_entry) {\n throw new Error(`'${moduleAddress}::${moduleName}::${functionName}' is not an entry function`);\n }\n\n // Remove the signer arguments\n const numSigners = findFirstNonSignerArg(functionAbi);\n const params: TypeTag[] = [];\n for (let i = numSigners; i < functionAbi.params.length; i += 1) {\n params.push(parseTypeTag(functionAbi.params[i], { allowGenerics: true }));\n }\n\n return {\n signers: numSigners,\n typeParameters: functionAbi.generic_type_params,\n parameters: params,\n };\n}\n\n/**\n * Fetches the ABI for a view function from the module\n *\n * @param moduleAddress\n * @param moduleName\n * @param functionName\n * @param aptosConfig\n */\nexport async function fetchViewFunctionAbi(\n moduleAddress: string,\n moduleName: string,\n functionName: string,\n aptosConfig: AptosConfig,\n): Promise<ViewFunctionABI> {\n const functionAbi = await fetchFunctionAbi(moduleAddress, moduleName, functionName, aptosConfig);\n\n // If there's no ABI, then the function is invalid\n if (!functionAbi) {\n throw new Error(`Could not find view function ABI for '${moduleAddress}::${moduleName}::${functionName}'`);\n }\n\n // Non-view functions can't be used\n if (!functionAbi.is_view) {\n throw new Error(`'${moduleAddress}::${moduleName}::${functionName}' is not an view function`);\n }\n\n // Type tag parameters for the function\n const params: TypeTag[] = [];\n for (let i = 0; i < functionAbi.params.length; i += 1) {\n params.push(parseTypeTag(functionAbi.params[i], { allowGenerics: true }));\n }\n\n // The return types of the view function\n const returnTypes: TypeTag[] = [];\n for (let i = 0; i < functionAbi.return.length; i += 1) {\n returnTypes.push(parseTypeTag(functionAbi.return[i], { allowGenerics: true }));\n }\n\n return {\n typeParameters: functionAbi.generic_type_params,\n parameters: params,\n returnTypes,\n };\n}\n\n/**\n * Converts a non-BCS encoded argument into BCS encoded, if necessary\n * @param functionName\n * @param functionAbi\n * @param arg\n * @param position\n */\nexport function convertArgument(\n functionName: string,\n functionAbi: FunctionABI,\n arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes,\n position: number,\n genericTypeParams: Array<TypeTag>,\n) {\n // Ensure not too many arguments\n if (position >= functionAbi.parameters.length) {\n throw new Error(`Too many arguments for '${functionName}', expected ${functionAbi.parameters.length}`);\n }\n\n const param = functionAbi.parameters[position];\n return checkOrConvertArgument(arg, param, position, genericTypeParams);\n}\n\nexport function checkOrConvertArgument(\n arg: SimpleEntryFunctionArgumentTypes | EntryFunctionArgumentTypes,\n param: TypeTag,\n position: number,\n genericTypeParams: Array<TypeTag>,\n) {\n // If the argument is bcs encoded, we can just use it directly\n if (isEncodedEntryFunctionArgument(arg)) {\n // Ensure the type matches the ABI\n checkType(param, arg, position);\n return arg;\n }\n\n // If it is not BCS encoded, we will need to convert it with the ABI\n return parseArg(arg, param, position, genericTypeParams);\n}\n\n/**\n * Parses a non-BCS encoded argument into a BCS encoded argument recursively\n * @param arg\n * @param param\n * @param position\n * @param genericTypeParams\n */\nfunction parseArg(\n arg: SimpleEntryFunctionArgumentTypes,\n param: TypeTag,\n position: number,\n genericTypeParams: Array<TypeTag>,\n): EntryFunctionArgumentTypes {\n if (param.isBool()) {\n if (isBool(arg)) {\n return new Bool(arg);\n }\n throwTypeMismatch(\"boolean\", position);\n }\n // TODO: support uint8array?\n if (param.isAddress()) {\n if (isString(arg)) {\n return AccountAddress.fromString(arg);\n }\n throwTypeMismatch(\"string | AccountAddress\", position);\n }\n if (param.isU8()) {\n if (isNumber(arg)) {\n return new U8(arg);\n }\n throwTypeMismatch(\"number\", position);\n }\n if (param.isU16()) {\n if (isNumber(arg)) {\n return new U16(arg);\n }\n throwTypeMismatch(\"number\", position);\n }\n if (param.isU32()) {\n if (isNumber(arg)) {\n return new U32(arg);\n }\n throwTypeMismatch(\"number\", position);\n }\n if (param.isU64()) {\n if (isLargeNumber(arg)) {\n return new U64(BigInt(arg));\n }\n throwTypeMismatch(\"bigint | number | string\", position);\n }\n if (param.isU128()) {\n if (isLargeNumber(arg)) {\n return new U128(BigInt(arg));\n }\n throwTypeMismatch(\"bigint | number | string\", position);\n }\n if (param.isU256()) {\n if (isLargeNumber(arg)) {\n return new U256(BigInt(arg));\n }\n throwTypeMismatch(\"bigint | number | string\", position);\n }\n\n // Generic needs to use the sub-type\n if (param.isGeneric()) {\n const genericIndex = param.value;\n if (genericIndex < 0 || genericIndex >= genericTypeParams.length) {\n throw new Error(`Generic argument ${param.toString()} is invalid for argument ${position}`);\n }\n\n return checkOrConvertArgument(arg, genericTypeParams[genericIndex], position, genericTypeParams);\n }\n\n // We have to special case some vectors for Vector<u8>\n if (param.isVector()) {\n // Check special case for Vector<u8>\n if (param.value.isU8()) {\n // We don't allow vector<u8>, but we convert strings to UTF8 uint8array\n // This is legacy behavior from the original SDK\n if (isString(arg)) {\n return MoveVector.U8(TEXT_ENCODER.encode(arg));\n }\n if (arg instanceof Uint8Array) {\n return MoveVector.U8(arg);\n }\n if (arg instanceof ArrayBuffer) {\n return MoveVector.U8(new Uint8Array(arg));\n }\n }\n\n // TODO: Support Uint16Array, Uint32Array, BigUint64Array?\n\n if (Array.isArray(arg)) {\n return new MoveVector(arg.map((item) => checkOrConvertArgument(item, param.value, position, genericTypeParams)));\n }\n\n throw new Error(`Type mismatch for argument ${position}, type '${param.toString()}'`);\n }\n\n // Handle structs as they're more complex\n if (param.isStruct()) {\n if (param.isString()) {\n if (isString(arg)) {\n return new MoveString(arg);\n }\n throwTypeMismatch(\"string\", position);\n }\n if (param.isObject()) {\n // The inner type of Object doesn't matter, since it's just syntactic sugar\n if (isString(arg)) {\n return AccountAddress.fromString(arg);\n }\n throwTypeMismatch(\"string | AccountAddress\", position);\n }\n\n if (param.isOption()) {\n // Empty option must be handled specially\n if (isNull(arg)) {\n // Note: This is a placeholder U8 type, and does not match the actual type, as that can't be dynamically grabbed\n return new MoveOption<U8>(null);\n }\n\n return new MoveOption(checkOrConvertArgument(arg, param.value.typeArgs[0], position, genericTypeParams));\n }\n\n throw new Error(`Unsupported struct input type for argument ${position}, type '${param.toString()}'`);\n }\n\n throw new Error(`Type mismatch for argument ${position}, type '${param.toString()}'`);\n}\n\n/**\n * Checks that the type of an already BCS encoded argument matches the ABI\n * @param param\n * @param arg\n * @param position\n */\nfunction checkType(param: TypeTag, arg: EntryFunctionArgumentTypes, position: number) {\n if (param.isBool()) {\n if (isBcsBool(arg)) {\n return;\n }\n throwTypeMismatch(\"Bool\", position);\n }\n if (param.isAddress()) {\n if (isBcsAddress(arg)) {\n return;\n }\n throwTypeMismatch(\"AccountAddress\", position);\n }\n if (param.isU8()) {\n if (isBcsU8(arg)) {\n return;\n }\n throwTypeMismatch(\"U8\", position);\n }\n if (param.isU16()) {\n if (isBcsU16(arg)) {\n return;\n }\n throwTypeMismatch(\"U16\", position);\n }\n if (param.isU32()) {\n if (isBcsU32(arg)) {\n return;\n }\n throwTypeMismatch(\"U32\", position);\n }\n if (param.isU64()) {\n if (isBcsU64(arg)) {\n return;\n }\n throwTypeMismatch(\"U64\", position);\n }\n if (param.isU128()) {\n if (isBcsU128(arg)) {\n return;\n }\n throwTypeMismatch(\"U128\", position);\n }\n if (param.isU256()) {\n if (isBcsU256(arg)) {\n return;\n }\n throwTypeMismatch(\"U256\", position);\n }\n if (param.isVector()) {\n if (arg instanceof MoveVector) {\n // If there's anything in it, check that the inner types match\n // Note that since it's typed, the first item should be the same as the rest\n if (arg.values.length > 0) {\n checkType(param.value, arg.values[0], position);\n }\n\n return;\n }\n throwTypeMismatch(\"MoveVector\", position);\n }\n\n // Handle structs as they're more complex\n if (param instanceof TypeTagStruct) {\n if (param.isString()) {\n if (isBcsString(arg)) {\n return;\n }\n throwTypeMismatch(\"MoveString\", position);\n }\n if (param.isObject()) {\n if (isBcsAddress(arg)) {\n return;\n }\n throwTypeMismatch(\"AccountAddress\", position);\n }\n if (param.isOption()) {\n if (arg instanceof MoveOption) {\n // If there's a value, we can check the inner type (otherwise it doesn't really matter)\n if (arg.value !== undefined) {\n checkType(param.value.typeArgs[0], arg.value, position);\n }\n return;\n }\n throwTypeMismatch(\"MoveOption\", position);\n }\n }\n\n throw new Error(`Type mismatch for argument ${position}, expected '${param.toString()}'`);\n}\n"],"mappings":"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","names":["TEXT_ENCODER","standardizeTypeTags","typeArguments","typeArg","isString","parseTypeTag","fetchFunctionAbi","moduleAddress","moduleName","functionName","aptosConfig","module","getModule","func","fetchEntryFunctionAbi","functionAbi","numSigners","findFirstNonSignerArg","params","i","fetchViewFunctionAbi","returnTypes","convertArgument","arg","position","genericTypeParams","param","checkOrConvertArgument","isEncodedEntryFunctionArgument","checkType","parseArg","isBool","Bool","throwTypeMismatch","AccountAddress","isNumber","U8","U16","U32","isLargeNumber","U64","U128","U256","genericIndex","MoveVector","item","MoveString","isNull","MoveOption","isBcsBool","isBcsAddress","isBcsU8","isBcsU16","isBcsU32","isBcsU64","isBcsU128","isBcsU256","TypeTagStruct","isBcsString"]}
1
+ {"version":3,"sources":["../../src/transactions/transactionBuilder/remoteAbi.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { parseTypeTag } from \"../typeTag/parser\";\nimport { TypeTag, TypeTagStruct } from \"../typeTag\";\nimport { AptosConfig } from \"../../api/aptosConfig\";\nimport {\n EntryFunctionArgumentTypes,\n SimpleEntryFunctionArgumentTypes,\n EntryFunctionABI,\n ViewFunctionABI,\n FunctionABI,\n} from \"../types\";\nimport { Bool, MoveOption, MoveString, MoveVector, U128, U16, U256, U32, U64, U8 } from \"../../bcs\";\nimport { AccountAddress } from \"../../core\";\nimport { getModule } from \"../../internal/account\";\nimport {\n findFirstNonSignerArg,\n isBcsAddress,\n isBcsBool,\n isBcsString,\n isBcsU128,\n isBcsU16,\n isBcsU256,\n isBcsU32,\n isBcsU64,\n isBcsU8,\n isBool,\n isEncodedEntryFunctionArgument,\n isLargeNumber,\n isNull,\n isNumber,\n isString,\n throwTypeMismatch,\n} from \"./helpers\";\nimport { MoveFunction } from \"../../types\";\n\nconst TEXT_ENCODER = new TextEncoder();\n\n/**\n * Convert type arguments to only type tags, allowing for string representations of type tags\n */\nexport function standardizeTypeTags(typeArguments?: Array<TypeTag | string>): Array<TypeTag> {\n return (\n typeArguments?.map((typeArg: string | TypeTag): TypeTag => {\n // Convert to TypeTag if it's a string representation\n if (isString(typeArg)) {\n return parseTypeTag(typeArg);\n }\n return typeArg;\n }) ?? []\n );\n}\n\n/**\n * Fetches a function ABI from the on-chain module ABI. It doesn't validate whether it's a view or entry function.\n * @param moduleAddress\n * @param moduleName\n * @param functionName\n * @param aptosConfig\n */\nexport async function fetchFunctionAbi(\n moduleAddress: string,\n moduleName: string,\n functionName: string,\n aptosConfig: AptosConfig,\n): Promise<MoveFunction | undefined> {\n // This fetch from the API is currently cached\n const module = await getModule({ aptosConfig, accountAddress: moduleAddress, moduleName });\n\n if (module.abi) {\n return module.abi.exposed_functions.find((func) => func.name === functionName);\n }\n\n return undefined;\n}\n\n/**\n * Fetches the ABI for an entry function from the module\n *\n * @param moduleAddress\n * @param moduleName\n * @param functionName\n * @param aptosConfig\n */\nexport async function fetchEntryFunctionAbi(\n moduleAddress: string,\n moduleName: string,\n functionName: string,\n aptosConfig: AptosConfig,\n): Promise<EntryFunctionABI> {\n const functionAbi = await fetchFunctionAbi(moduleAddress, moduleName, functionName, aptosConfig);\n\n // If there's no ABI, then the function is invalid\n if (!functionAbi) {\n throw new Error(`Could not find entry function ABI for '${moduleAddress}::${moduleName}::${functionName}'`);\n }\n\n // Non-entry functions also can't be used\n if (!functionAbi.is_entry) {\n throw new Error(`'${moduleAddress}::${moduleName}::${functionName}' is not an entry function`);\n }\n\n // Remove the signer arguments\n const numSigners = findFirstNonSignerArg(functionAbi);\n const params: TypeTag[] = [];\n for (let i = numSigners; i < functionAbi.params.length; i += 1) {\n params.push(parseTypeTag(functionAbi.params[i], { allowGenerics: true }));\n }\n\n return {\n signers: numSigners,\n typeParameters: functionAbi.generic_type_params,\n parameters: params,\n };\n}\n\n/**\n * Fetches the ABI for a view function from the module\n *\n * @param moduleAddress\n * @param moduleName\n * @param functionName\n * @param aptosConfig\n */\nexport async function fetchViewFunctionAbi(\n moduleAddress: string,\n moduleName: string,\n functionName: string,\n aptosConfig: AptosConfig,\n): Promise<ViewFunctionABI> {\n const functionAbi = await fetchFunctionAbi(moduleAddress, moduleName, functionName, aptosConfig);\n\n // If there's no ABI, then the function is invalid\n if (!functionAbi) {\n throw new Error(`Could not find view function ABI for '${moduleAddress}::${moduleName}::${functionName}'`);\n }\n\n // Non-view functions can't be used\n if (!functionAbi.is_view) {\n throw new Error(`'${moduleAddress}::${moduleName}::${functionName}' is not an view function`);\n }\n\n // Type tag parameters for the function\n const params: TypeTag[] = [];\n for (let i = 0; i < functionAbi.params.length; i += 1) {\n params.push(parseTypeTag(functionAbi.params[i], { allowGenerics: true }));\n }\n\n // The return types of the view function\n const returnTypes: TypeTag[] = [];\n for (let i = 0; i < functionAbi.return.length; i += 1) {\n returnTypes.push(parseTypeTag(functionAbi.return[i], { allowGenerics: true }));\n }\n\n return {\n typeParameters: functionAbi.generic_type_params,\n parameters: params,\n returnTypes,\n };\n}\n\n/**\n * Converts a non-BCS encoded argument into BCS encoded, if necessary\n * @param functionName\n * @param functionAbi\n * @param arg\n * @param position\n */\nexport function convertArgument(\n functionName: string,\n functionAbi: FunctionABI,\n arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes,\n position: number,\n genericTypeParams: Array<TypeTag>,\n) {\n // Ensure not too many arguments\n if (position >= functionAbi.parameters.length) {\n throw new Error(`Too many arguments for '${functionName}', expected ${functionAbi.parameters.length}`);\n }\n\n const param = functionAbi.parameters[position];\n return checkOrConvertArgument(arg, param, position, genericTypeParams);\n}\n\nexport function checkOrConvertArgument(\n arg: SimpleEntryFunctionArgumentTypes | EntryFunctionArgumentTypes,\n param: TypeTag,\n position: number,\n genericTypeParams: Array<TypeTag>,\n) {\n // If the argument is bcs encoded, we can just use it directly\n if (isEncodedEntryFunctionArgument(arg)) {\n // Ensure the type matches the ABI\n checkType(param, arg, position);\n return arg;\n }\n\n // If it is not BCS encoded, we will need to convert it with the ABI\n return parseArg(arg, param, position, genericTypeParams);\n}\n\n/**\n * Parses a non-BCS encoded argument into a BCS encoded argument recursively\n * @param arg\n * @param param\n * @param position\n * @param genericTypeParams\n */\nfunction parseArg(\n arg: SimpleEntryFunctionArgumentTypes,\n param: TypeTag,\n position: number,\n genericTypeParams: Array<TypeTag>,\n): EntryFunctionArgumentTypes {\n if (param.isBool()) {\n if (isBool(arg)) {\n return new Bool(arg);\n }\n if (isString(arg)) {\n if (arg === \"true\") return new Bool(true);\n if (arg === \"false\") return new Bool(false);\n }\n throwTypeMismatch(\"boolean\", position);\n }\n // TODO: support uint8array?\n if (param.isAddress()) {\n if (isString(arg)) {\n return AccountAddress.fromString(arg);\n }\n throwTypeMismatch(\"string | AccountAddress\", position);\n }\n if (param.isU8()) {\n if (isNumber(arg)) {\n return new U8(arg);\n }\n if (isString(arg)) {\n return new U8(Number.parseInt(arg, 10));\n }\n throwTypeMismatch(\"number\", position);\n }\n if (param.isU16()) {\n if (isNumber(arg)) {\n return new U16(arg);\n }\n if (isString(arg)) {\n return new U16(Number.parseInt(arg, 10));\n }\n throwTypeMismatch(\"number\", position);\n }\n if (param.isU32()) {\n if (isNumber(arg)) {\n return new U32(arg);\n }\n if (isString(arg)) {\n return new U32(Number.parseInt(arg, 10));\n }\n throwTypeMismatch(\"number\", position);\n }\n if (param.isU64()) {\n if (isLargeNumber(arg)) {\n return new U64(BigInt(arg));\n }\n throwTypeMismatch(\"bigint | number | string\", position);\n }\n if (param.isU128()) {\n if (isLargeNumber(arg)) {\n return new U128(BigInt(arg));\n }\n throwTypeMismatch(\"bigint | number | string\", position);\n }\n if (param.isU256()) {\n if (isLargeNumber(arg)) {\n return new U256(BigInt(arg));\n }\n throwTypeMismatch(\"bigint | number | string\", position);\n }\n\n // Generic needs to use the sub-type\n if (param.isGeneric()) {\n const genericIndex = param.value;\n if (genericIndex < 0 || genericIndex >= genericTypeParams.length) {\n throw new Error(`Generic argument ${param.toString()} is invalid for argument ${position}`);\n }\n\n return checkOrConvertArgument(arg, genericTypeParams[genericIndex], position, genericTypeParams);\n }\n\n // We have to special case some vectors for Vector<u8>\n if (param.isVector()) {\n // Check special case for Vector<u8>\n if (param.value.isU8()) {\n // We don't allow vector<u8>, but we convert strings to UTF8 uint8array\n // This is legacy behavior from the original SDK\n if (isString(arg)) {\n return MoveVector.U8(TEXT_ENCODER.encode(arg));\n }\n if (arg instanceof Uint8Array) {\n return MoveVector.U8(arg);\n }\n if (arg instanceof ArrayBuffer) {\n return MoveVector.U8(new Uint8Array(arg));\n }\n }\n\n // TODO: Support Uint16Array, Uint32Array, BigUint64Array?\n\n if (Array.isArray(arg)) {\n return new MoveVector(arg.map((item) => checkOrConvertArgument(item, param.value, position, genericTypeParams)));\n }\n\n throw new Error(`Type mismatch for argument ${position}, type '${param.toString()}'`);\n }\n\n // Handle structs as they're more complex\n if (param.isStruct()) {\n if (param.isString()) {\n if (isString(arg)) {\n return new MoveString(arg);\n }\n throwTypeMismatch(\"string\", position);\n }\n if (param.isObject()) {\n // The inner type of Object doesn't matter, since it's just syntactic sugar\n if (isString(arg)) {\n return AccountAddress.fromString(arg);\n }\n throwTypeMismatch(\"string | AccountAddress\", position);\n }\n\n if (param.isOption()) {\n // Empty option must be handled specially\n if (isNull(arg)) {\n // Note: This is a placeholder U8 type, and does not match the actual type, as that can't be dynamically grabbed\n return new MoveOption<U8>(null);\n }\n\n return new MoveOption(checkOrConvertArgument(arg, param.value.typeArgs[0], position, genericTypeParams));\n }\n\n throw new Error(`Unsupported struct input type for argument ${position}, type '${param.toString()}'`);\n }\n\n throw new Error(`Type mismatch for argument ${position}, type '${param.toString()}'`);\n}\n\n/**\n * Checks that the type of an already BCS encoded argument matches the ABI\n * @param param\n * @param arg\n * @param position\n */\nfunction checkType(param: TypeTag, arg: EntryFunctionArgumentTypes, position: number) {\n if (param.isBool()) {\n if (isBcsBool(arg)) {\n return;\n }\n throwTypeMismatch(\"Bool\", position);\n }\n if (param.isAddress()) {\n if (isBcsAddress(arg)) {\n return;\n }\n throwTypeMismatch(\"AccountAddress\", position);\n }\n if (param.isU8()) {\n if (isBcsU8(arg)) {\n return;\n }\n throwTypeMismatch(\"U8\", position);\n }\n if (param.isU16()) {\n if (isBcsU16(arg)) {\n return;\n }\n throwTypeMismatch(\"U16\", position);\n }\n if (param.isU32()) {\n if (isBcsU32(arg)) {\n return;\n }\n throwTypeMismatch(\"U32\", position);\n }\n if (param.isU64()) {\n if (isBcsU64(arg)) {\n return;\n }\n throwTypeMismatch(\"U64\", position);\n }\n if (param.isU128()) {\n if (isBcsU128(arg)) {\n return;\n }\n throwTypeMismatch(\"U128\", position);\n }\n if (param.isU256()) {\n if (isBcsU256(arg)) {\n return;\n }\n throwTypeMismatch(\"U256\", position);\n }\n if (param.isVector()) {\n if (arg instanceof MoveVector) {\n // If there's anything in it, check that the inner types match\n // Note that since it's typed, the first item should be the same as the rest\n if (arg.values.length > 0) {\n checkType(param.value, arg.values[0], position);\n }\n\n return;\n }\n throwTypeMismatch(\"MoveVector\", position);\n }\n\n // Handle structs as they're more complex\n if (param instanceof TypeTagStruct) {\n if (param.isString()) {\n if (isBcsString(arg)) {\n return;\n }\n throwTypeMismatch(\"MoveString\", position);\n }\n if (param.isObject()) {\n if (isBcsAddress(arg)) {\n return;\n }\n throwTypeMismatch(\"AccountAddress\", position);\n }\n if (param.isOption()) {\n if (arg instanceof MoveOption) {\n // If there's a value, we can check the inner type (otherwise it doesn't really matter)\n if (arg.value !== undefined) {\n checkType(param.value.typeArgs[0], arg.value, position);\n }\n return;\n }\n throwTypeMismatch(\"MoveOption\", position);\n }\n }\n\n throw new Error(`Type mismatch for argument ${position}, expected '${param.toString()}'`);\n}\n"],"mappings":"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","names":["TEXT_ENCODER","standardizeTypeTags","typeArguments","typeArg","isString","parseTypeTag","fetchFunctionAbi","moduleAddress","moduleName","functionName","aptosConfig","module","getModule","func","fetchEntryFunctionAbi","functionAbi","numSigners","findFirstNonSignerArg","params","i","fetchViewFunctionAbi","returnTypes","convertArgument","arg","position","genericTypeParams","param","checkOrConvertArgument","isEncodedEntryFunctionArgument","checkType","parseArg","isBool","Bool","throwTypeMismatch","AccountAddress","isNumber","U8","U16","U32","isLargeNumber","U64","U128","U256","genericIndex","MoveVector","item","MoveString","isNull","MoveOption","isBcsBool","isBcsAddress","isBcsU8","isBcsU16","isBcsU32","isBcsU64","isBcsU128","isBcsU256","TypeTagStruct","isBcsString"]}
@@ -1,2 +1,2 @@
1
- import{f as e,g as s,h as t,i as o,j as r,k as i,l as a,m,n as c,o as g,p as u,q as p,r as d}from"./chunk-7FIS3GNZ.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-SSSWFYAX.mjs.map
1
+ import{f as e,g as s,h as t,i as o,j as r,k as i,l as a,m,n as c,o as g,p as u,q as p,r as d}from"./chunk-QIELBIZW.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-LM7CN4LT.mjs.map
@@ -1,2 +1,2 @@
1
- import{b as s}from"./chunk-6EMN3BOV.mjs";import{f as r}from"./chunk-EW3AR5V3.mjs";import{a as o}from"./chunk-FVA2OPG4.mjs";var i=class{constructor(n){this.config=n}async simple(n){return r({aptosConfig:this.config,...n})}async multiAgent(n){return r({aptosConfig:this.config,...n})}};o([s],i.prototype,"simple",1),o([s],i.prototype,"multiAgent",1);export{i as a};
2
- //# sourceMappingURL=chunk-TLLWFCCP.mjs.map
1
+ import{b as s}from"./chunk-6EMN3BOV.mjs";import{f as r}from"./chunk-V6J6AW5T.mjs";import{a as o}from"./chunk-FVA2OPG4.mjs";var i=class{constructor(n){this.config=n}async simple(n){return r({aptosConfig:this.config,...n})}async multiAgent(n){return r({aptosConfig:this.config,...n})}};o([s],i.prototype,"simple",1),o([s],i.prototype,"multiAgent",1);export{i as a};
2
+ //# sourceMappingURL=chunk-LVYNEPH4.mjs.map
@@ -1,2 +1,2 @@
1
- import{b as h}from"./chunk-7VRZLDIJ.mjs";import{a as y}from"./chunk-PF57EOJY.mjs";import{b as n}from"./chunk-QRS4DGP3.mjs";import{a as _}from"./chunk-36QXVFR5.mjs";var t=class i extends _{constructor(e,s,a,r,c,d,l){super(),this.sender=e,this.sequence_number=s,this.payload=a,this.max_gas_amount=r,this.gas_unit_price=c,this.expiration_timestamp_secs=d,this.chain_id=l}serialize(e){this.sender.serialize(e),e.serializeU64(this.sequence_number),this.payload.serialize(e),e.serializeU64(this.max_gas_amount),e.serializeU64(this.gas_unit_price),e.serializeU64(this.expiration_timestamp_secs),this.chain_id.serialize(e)}static deserialize(e){let s=n.deserialize(e),a=e.deserializeU64(),r=h.deserialize(e),c=e.deserializeU64(),d=e.deserializeU64(),l=e.deserializeU64(),m=y.deserialize(e);return new i(s,a,r,c,d,l,m)}},o=class extends _{static deserialize(e){let s=e.deserializeUleb128AsU32();switch(s){case 0:return u.load(e);case 1:return p.load(e);default:throw new Error(`Unknown variant index for RawTransactionWithData: ${s}`)}}},u=class i extends o{constructor(e,s){super(),this.raw_txn=e,this.secondary_signer_addresses=s}serialize(e){e.serializeU32AsUleb128(0),this.raw_txn.serialize(e),e.serializeVector(this.secondary_signer_addresses)}static load(e){let s=t.deserialize(e),a=e.deserializeVector(n);return new i(s,a)}},p=class i extends o{constructor(e,s,a){super(),this.raw_txn=e,this.secondary_signer_addresses=s,this.fee_payer_address=a}serialize(e){e.serializeU32AsUleb128(1),this.raw_txn.serialize(e),e.serializeVector(this.secondary_signer_addresses),this.fee_payer_address.serialize(e)}static load(e){let s=t.deserialize(e),a=e.deserializeVector(n),r=n.deserialize(e);return new i(s,a,r)}};export{t as a,o as b,u as c,p as d};
2
- //# sourceMappingURL=chunk-BO2TLWNT.mjs.map
1
+ import{b as h}from"./chunk-5SQAHWDI.mjs";import{a as y}from"./chunk-P2CIREOD.mjs";import{b as n}from"./chunk-UEI62FBQ.mjs";import{a as _}from"./chunk-4KMISR2H.mjs";var t=class i extends _{constructor(e,s,a,r,c,d,l){super(),this.sender=e,this.sequence_number=s,this.payload=a,this.max_gas_amount=r,this.gas_unit_price=c,this.expiration_timestamp_secs=d,this.chain_id=l}serialize(e){this.sender.serialize(e),e.serializeU64(this.sequence_number),this.payload.serialize(e),e.serializeU64(this.max_gas_amount),e.serializeU64(this.gas_unit_price),e.serializeU64(this.expiration_timestamp_secs),this.chain_id.serialize(e)}static deserialize(e){let s=n.deserialize(e),a=e.deserializeU64(),r=h.deserialize(e),c=e.deserializeU64(),d=e.deserializeU64(),l=e.deserializeU64(),m=y.deserialize(e);return new i(s,a,r,c,d,l,m)}},o=class extends _{static deserialize(e){let s=e.deserializeUleb128AsU32();switch(s){case 0:return u.load(e);case 1:return p.load(e);default:throw new Error(`Unknown variant index for RawTransactionWithData: ${s}`)}}},u=class i extends o{constructor(e,s){super(),this.raw_txn=e,this.secondary_signer_addresses=s}serialize(e){e.serializeU32AsUleb128(0),this.raw_txn.serialize(e),e.serializeVector(this.secondary_signer_addresses)}static load(e){let s=t.deserialize(e),a=e.deserializeVector(n);return new i(s,a)}},p=class i extends o{constructor(e,s,a){super(),this.raw_txn=e,this.secondary_signer_addresses=s,this.fee_payer_address=a}serialize(e){e.serializeU32AsUleb128(1),this.raw_txn.serialize(e),e.serializeVector(this.secondary_signer_addresses),this.fee_payer_address.serialize(e)}static load(e){let s=t.deserialize(e),a=e.deserializeVector(n),r=n.deserialize(e);return new i(s,a,r)}};export{t as a,o as b,u as c,p as d};
2
+ //# sourceMappingURL=chunk-LX53BIRN.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as P}from"./chunk-EKOTTHRQ.mjs";import{a as v}from"./chunk-AH44UPM4.mjs";import{e as d}from"./chunk-2ZGHK5BB.mjs";import{d as C,e as w,f as h,g as k,h as T,j as b,k as O,l as q}from"./chunk-S3EDNXZE.mjs";import{b as p,c as f}from"./chunk-S2VSJJRJ.mjs";import{a as _}from"./chunk-GHYE26Q5.mjs";import{a as A}from"./chunk-J77BLQCV.mjs";import{a as m}from"./chunk-JDDYOCHY.mjs";import{b as y}from"./chunk-I6ST47U7.mjs";import{b as l}from"./chunk-SGTNW5YI.mjs";import{a as g}from"./chunk-5EN52MUT.mjs";import{b as c}from"./chunk-QRS4DGP3.mjs";async function S(t){let{aptosConfig:n,accountAddress:e}=t,{data:o}=await p({aptosConfig:n,originMethod:"getInfo",path:`accounts/${c.from(e).toString()}`});return o}async function H(t){let{aptosConfig:n,accountAddress:e,options:o}=t;return f({aptosConfig:n,originMethod:"getModules",path:`accounts/${c.from(e).toString()}/modules`,params:{ledger_version:o?.ledgerVersion,start:o?.offset,limit:o?.limit??1e3}})}async function J(t){return t.options?.ledgerVersion!==void 0?G(t):v(async()=>G(t),`module-${t.accountAddress}-${t.moduleName}`,1e3*60*5)()}async function G(t){let{aptosConfig:n,accountAddress:e,moduleName:o,options:s}=t,{data:r}=await p({aptosConfig:n,originMethod:"getModule",path:`accounts/${c.from(e).toString()}/module/${o}`,params:{ledger_version:s?.ledgerVersion}});return r}async function U(t){let{aptosConfig:n,accountAddress:e,options:o}=t;return f({aptosConfig:n,originMethod:"getTransactions",path:`accounts/${c.from(e).toString()}/transactions`,params:{start:o?.offset,limit:o?.limit}})}async function X(t){let{aptosConfig:n,accountAddress:e,options:o}=t;return f({aptosConfig:n,originMethod:"getResources",path:`accounts/${c.from(e).toString()}/resources`,params:{ledger_version:o?.ledgerVersion,start:o?.offset,limit:o?.limit??999}})}async function K(t){let{aptosConfig:n,accountAddress:e,resourceType:o,options:s}=t,{data:r}=await p({aptosConfig:n,originMethod:"getResource",path:`accounts/${c.from(e).toString()}/resource/${o}`,params:{ledger_version:s?.ledgerVersion}});return r.data}async function Q(t){let{aptosConfig:n,authenticationKey:e,options:o}=t,s=await K({aptosConfig:n,accountAddress:"0x1",resourceType:"0x1::account::OriginatingAddress",options:o}),{address_map:{handle:r}}=s,a=c.from(e);try{let i=await P({aptosConfig:n,handle:r,data:{key:a.toString(),key_type:"address",value_type:"address"},options:o});return c.from(i)}catch(i){if(i instanceof _&&i.data.error_code==="table_item_not_found")return a;throw i}}async function Y(t){let{aptosConfig:n,accountAddress:e}=t,s={owner_address:{_eq:c.from(e).toStringLong()},amount:{_gt:0}},a=await d({aptosConfig:n,query:{query:O,variables:{where_condition:s}},originMethod:"getAccountTokensCount"});return a.current_token_ownerships_v2_aggregate.aggregate?a.current_token_ownerships_v2_aggregate.aggregate.count:0}async function Z(t){let{aptosConfig:n,accountAddress:e,options:o}=t,r={owner_address:{_eq:c.from(e).toStringLong()},amount:{_gt:0}};o?.tokenStandard&&(r.token_standard={_eq:o?.tokenStandard});let a={query:T,variables:{where_condition:r,offset:o?.offset,limit:o?.limit,order_by:o?.orderBy}};return(await d({aptosConfig:n,query:a,originMethod:"getAccountOwnedTokens"})).current_token_ownerships_v2}async function oo(t){let{aptosConfig:n,accountAddress:e,collectionAddress:o,options:s}=t,r=c.from(e).toStringLong(),a=c.from(o).toStringLong(),i={owner_address:{_eq:r},current_token_data:{collection_id:{_eq:a}},amount:{_gt:0}};s?.tokenStandard&&(i.token_standard={_eq:s?.tokenStandard});let u={query:b,variables:{where_condition:i,offset:s?.offset,limit:s?.limit,order_by:s?.orderBy}};return(await d({aptosConfig:n,query:u,originMethod:"getAccountOwnedTokensFromCollectionAddress"})).current_token_ownerships_v2}async function to(t){let{aptosConfig:n,accountAddress:e,options:o}=t,r={owner_address:{_eq:c.from(e).toStringLong()},amount:{_gt:0}};o?.tokenStandard&&(r.current_collection={token_standard:{_eq:o?.tokenStandard}});let a={query:h,variables:{where_condition:r,offset:o?.offset,limit:o?.limit,order_by:o?.orderBy}};return(await d({aptosConfig:n,query:a,originMethod:"getAccountCollectionsWithOwnedTokens"})).current_collection_ownership_v2_view}async function eo(t){let{aptosConfig:n,accountAddress:e}=t,o=c.from(e).toStringLong(),r=await d({aptosConfig:n,query:{query:q,variables:{address:o}},originMethod:"getAccountTransactionsCount"});return r.account_transactions_aggregate.aggregate?r.account_transactions_aggregate.aggregate.count:0}async function no(t){let{aptosConfig:n,accountAddress:e,coinType:o}=t,s=c.from(e).toStringLong(),r=await I({aptosConfig:n,accountAddress:s,options:{where:{asset_type:{_eq:o}}}});return r[0]?r[0].amount:0}async function I(t){let{aptosConfig:n,accountAddress:e,options:o}=t,s=c.from(e).toStringLong(),r={...o?.where,owner_address:{_eq:s}},a={query:w,variables:{where_condition:r,offset:o?.offset,limit:o?.limit,order_by:o?.orderBy}};return(await d({aptosConfig:n,query:a,originMethod:"getAccountCoinsData"})).current_fungible_asset_balances}async function ro(t){let{aptosConfig:n,accountAddress:e}=t,o=c.from(e).toStringLong(),r=await d({aptosConfig:n,query:{query:C,variables:{address:o}},originMethod:"getAccountCoinsCount"});if(!r.current_fungible_asset_balances_aggregate.aggregate)throw Error("Failed to get the count of account coins");return r.current_fungible_asset_balances_aggregate.aggregate.count}async function so(t){let{aptosConfig:n,accountAddress:e,options:o}=t,r={owner_address:{_eq:c.from(e).toStringLong()}},a={query:k,variables:{where_condition:r,offset:o?.offset,limit:o?.limit,order_by:o?.orderBy}};return(await d({aptosConfig:n,query:a,originMethod:"getAccountOwnedObjects"})).current_objects}async function co(t){let{aptosConfig:n,privateKey:e}=t,o=new m(e.publicKey());if(e instanceof y){let r=g.fromPublicKey({publicKey:o}).derivedAddress();return A.fromPrivateKey({privateKey:e,address:r})}if(e instanceof l){let s=g.fromPublicKey({publicKey:o});if(await M({authKey:s,aptosConfig:n})){let u=s.derivedAddress();return A.fromPrivateKey({privateKey:e,address:u,legacy:!1})}let a=g.fromPublicKey({publicKey:o.publicKey});if(await M({authKey:a,aptosConfig:n})){let u=a.derivedAddress();return A.fromPrivateKey({privateKey:e,address:u,legacy:!0})}}throw new Error(`Can't derive account from private key ${e}`)}async function M(t){let{aptosConfig:n,authKey:e}=t,o=await Q({aptosConfig:n,authenticationKey:e.derivedAddress()});try{return await S({aptosConfig:n,accountAddress:o}),!0}catch(s){if(s.status===404)return!1;throw new Error(`Error while looking for an account info ${o.toString()}`)}}export{S as a,H as b,J as c,U as d,X as e,K as f,Q as g,Y as h,Z as i,oo as j,to as k,eo as l,no as m,I as n,ro as o,so as p,co as q,M as r};
2
- //# sourceMappingURL=chunk-BZCARW2P.mjs.map
1
+ import{a as P}from"./chunk-6SK246YU.mjs";import{a as v}from"./chunk-AH44UPM4.mjs";import{e as d}from"./chunk-OIH4KBXW.mjs";import{d as C,e as w,f as h,g as k,h as T,j as b,k as O,l as q}from"./chunk-S3EDNXZE.mjs";import{b as p,c as f}from"./chunk-5TTCAW72.mjs";import{a as _}from"./chunk-GHYE26Q5.mjs";import{a as A}from"./chunk-43HKFNUB.mjs";import{a as m}from"./chunk-43YYG5VO.mjs";import{b as l}from"./chunk-CX4BEIQT.mjs";import{b as y}from"./chunk-JWTZDA6A.mjs";import{a as g}from"./chunk-WNVUG2UF.mjs";import{b as c}from"./chunk-UEI62FBQ.mjs";async function S(t){let{aptosConfig:n,accountAddress:e}=t,{data:o}=await p({aptosConfig:n,originMethod:"getInfo",path:`accounts/${c.from(e).toString()}`});return o}async function H(t){let{aptosConfig:n,accountAddress:e,options:o}=t;return f({aptosConfig:n,originMethod:"getModules",path:`accounts/${c.from(e).toString()}/modules`,params:{ledger_version:o?.ledgerVersion,start:o?.offset,limit:o?.limit??1e3}})}async function J(t){return t.options?.ledgerVersion!==void 0?G(t):v(async()=>G(t),`module-${t.accountAddress}-${t.moduleName}`,1e3*60*5)()}async function G(t){let{aptosConfig:n,accountAddress:e,moduleName:o,options:s}=t,{data:r}=await p({aptosConfig:n,originMethod:"getModule",path:`accounts/${c.from(e).toString()}/module/${o}`,params:{ledger_version:s?.ledgerVersion}});return r}async function U(t){let{aptosConfig:n,accountAddress:e,options:o}=t;return f({aptosConfig:n,originMethod:"getTransactions",path:`accounts/${c.from(e).toString()}/transactions`,params:{start:o?.offset,limit:o?.limit}})}async function X(t){let{aptosConfig:n,accountAddress:e,options:o}=t;return f({aptosConfig:n,originMethod:"getResources",path:`accounts/${c.from(e).toString()}/resources`,params:{ledger_version:o?.ledgerVersion,start:o?.offset,limit:o?.limit??999}})}async function K(t){let{aptosConfig:n,accountAddress:e,resourceType:o,options:s}=t,{data:r}=await p({aptosConfig:n,originMethod:"getResource",path:`accounts/${c.from(e).toString()}/resource/${o}`,params:{ledger_version:s?.ledgerVersion}});return r.data}async function Q(t){let{aptosConfig:n,authenticationKey:e,options:o}=t,s=await K({aptosConfig:n,accountAddress:"0x1",resourceType:"0x1::account::OriginatingAddress",options:o}),{address_map:{handle:r}}=s,a=c.from(e);try{let i=await P({aptosConfig:n,handle:r,data:{key:a.toString(),key_type:"address",value_type:"address"},options:o});return c.from(i)}catch(i){if(i instanceof _&&i.data.error_code==="table_item_not_found")return a;throw i}}async function Y(t){let{aptosConfig:n,accountAddress:e}=t,s={owner_address:{_eq:c.from(e).toStringLong()},amount:{_gt:0}},a=await d({aptosConfig:n,query:{query:O,variables:{where_condition:s}},originMethod:"getAccountTokensCount"});return a.current_token_ownerships_v2_aggregate.aggregate?a.current_token_ownerships_v2_aggregate.aggregate.count:0}async function Z(t){let{aptosConfig:n,accountAddress:e,options:o}=t,r={owner_address:{_eq:c.from(e).toStringLong()},amount:{_gt:0}};o?.tokenStandard&&(r.token_standard={_eq:o?.tokenStandard});let a={query:T,variables:{where_condition:r,offset:o?.offset,limit:o?.limit,order_by:o?.orderBy}};return(await d({aptosConfig:n,query:a,originMethod:"getAccountOwnedTokens"})).current_token_ownerships_v2}async function oo(t){let{aptosConfig:n,accountAddress:e,collectionAddress:o,options:s}=t,r=c.from(e).toStringLong(),a=c.from(o).toStringLong(),i={owner_address:{_eq:r},current_token_data:{collection_id:{_eq:a}},amount:{_gt:0}};s?.tokenStandard&&(i.token_standard={_eq:s?.tokenStandard});let u={query:b,variables:{where_condition:i,offset:s?.offset,limit:s?.limit,order_by:s?.orderBy}};return(await d({aptosConfig:n,query:u,originMethod:"getAccountOwnedTokensFromCollectionAddress"})).current_token_ownerships_v2}async function to(t){let{aptosConfig:n,accountAddress:e,options:o}=t,r={owner_address:{_eq:c.from(e).toStringLong()},amount:{_gt:0}};o?.tokenStandard&&(r.current_collection={token_standard:{_eq:o?.tokenStandard}});let a={query:h,variables:{where_condition:r,offset:o?.offset,limit:o?.limit,order_by:o?.orderBy}};return(await d({aptosConfig:n,query:a,originMethod:"getAccountCollectionsWithOwnedTokens"})).current_collection_ownership_v2_view}async function eo(t){let{aptosConfig:n,accountAddress:e}=t,o=c.from(e).toStringLong(),r=await d({aptosConfig:n,query:{query:q,variables:{address:o}},originMethod:"getAccountTransactionsCount"});return r.account_transactions_aggregate.aggregate?r.account_transactions_aggregate.aggregate.count:0}async function no(t){let{aptosConfig:n,accountAddress:e,coinType:o}=t,s=c.from(e).toStringLong(),r=await I({aptosConfig:n,accountAddress:s,options:{where:{asset_type:{_eq:o}}}});return r[0]?r[0].amount:0}async function I(t){let{aptosConfig:n,accountAddress:e,options:o}=t,s=c.from(e).toStringLong(),r={...o?.where,owner_address:{_eq:s}},a={query:w,variables:{where_condition:r,offset:o?.offset,limit:o?.limit,order_by:o?.orderBy}};return(await d({aptosConfig:n,query:a,originMethod:"getAccountCoinsData"})).current_fungible_asset_balances}async function ro(t){let{aptosConfig:n,accountAddress:e}=t,o=c.from(e).toStringLong(),r=await d({aptosConfig:n,query:{query:C,variables:{address:o}},originMethod:"getAccountCoinsCount"});if(!r.current_fungible_asset_balances_aggregate.aggregate)throw Error("Failed to get the count of account coins");return r.current_fungible_asset_balances_aggregate.aggregate.count}async function so(t){let{aptosConfig:n,accountAddress:e,options:o}=t,r={owner_address:{_eq:c.from(e).toStringLong()}},a={query:k,variables:{where_condition:r,offset:o?.offset,limit:o?.limit,order_by:o?.orderBy}};return(await d({aptosConfig:n,query:a,originMethod:"getAccountOwnedObjects"})).current_objects}async function co(t){let{aptosConfig:n,privateKey:e}=t,o=new m(e.publicKey());if(e instanceof y){let r=g.fromPublicKey({publicKey:o}).derivedAddress();return A.fromPrivateKey({privateKey:e,address:r})}if(e instanceof l){let s=g.fromPublicKey({publicKey:o});if(await M({authKey:s,aptosConfig:n})){let u=s.derivedAddress();return A.fromPrivateKey({privateKey:e,address:u,legacy:!1})}let a=g.fromPublicKey({publicKey:o.publicKey});if(await M({authKey:a,aptosConfig:n})){let u=a.derivedAddress();return A.fromPrivateKey({privateKey:e,address:u,legacy:!0})}}throw new Error(`Can't derive account from private key ${e}`)}async function M(t){let{aptosConfig:n,authKey:e}=t,o=await Q({aptosConfig:n,authenticationKey:e.derivedAddress()});try{return await S({aptosConfig:n,accountAddress:o}),!0}catch(s){if(s.status===404)return!1;throw new Error(`Error while looking for an account info ${o.toString()}`)}}export{S as a,H as b,J as c,U as d,X as e,K as f,Q as g,Y as h,Z as i,oo as j,to as k,eo as l,no as m,I as n,ro as o,so as p,co as q,M as r};
2
+ //# sourceMappingURL=chunk-MEXWNZY6.mjs.map
@@ -0,0 +1,2 @@
1
+ var o="1.16.0";export{o as a};
2
+ //# sourceMappingURL=chunk-NYXLPBKE.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/version.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * The current version of the SDK\n *\n * hardcoded for now, we would want to have it injected dynamically\n */\nexport const VERSION = \"1.15.0\";\n"],"mappings":"AAQO,IAAMA,EAAU","names":["VERSION"]}
1
+ {"version":3,"sources":["../../src/version.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * The current version of the SDK\n *\n * hardcoded for now, we would want to have it injected dynamically\n */\nexport const VERSION = \"1.16.0\";\n"],"mappings":"AAQO,IAAMA,EAAU","names":["VERSION"]}
@@ -1,2 +1,2 @@
1
- import{m as p,v as a}from"./chunk-S3EDNXZE.mjs";import{c}from"./chunk-YMB2XW2O.mjs";import{b as n}from"./chunk-S2VSJJRJ.mjs";async function h(o){let{aptosConfig:t}=o,{data:s}=await n({aptosConfig:t,originMethod:"getLedgerInfo",path:""});return s}async function d(o){let{aptosConfig:t,ledgerVersion:s,options:e}=o,{data:r}=await n({aptosConfig:t,originMethod:"getBlockByVersion",path:`blocks/by_version/${s}`,params:{with_transactions:e?.withTransactions}});return r}async function C(o){let{aptosConfig:t,blockHeight:s,options:e}=o,{data:r}=await n({aptosConfig:t,originMethod:"getBlockByHeight",path:`blocks/by_height/${s}`,params:{with_transactions:e?.withTransactions}});return r}async function l(o){let{aptosConfig:t,limit:s}=o;return(await i({aptosConfig:t,query:{query:p,variables:{limit:s}},originMethod:"getChainTopUserTransactions"})).user_transactions}async function i(o){let{aptosConfig:t,query:s,originMethod:e}=o,{data:r}=await c({aptosConfig:t,originMethod:e??"queryIndexer",path:"",body:s,overrides:{WITH_CREDENTIALS:!1}});return r}async function g(o){let{aptosConfig:t}=o;return(await i({aptosConfig:t,query:{query:a},originMethod:"getProcessorStatuses"})).processor_status}async function m(o){let t=await g({aptosConfig:o.aptosConfig});return BigInt(t[0].last_success_version)}async function T(o){let{aptosConfig:t,processorType:s}=o;return(await i({aptosConfig:t,query:{query:a,variables:{where_condition:{processor:{_eq:s}}}},originMethod:"getProcessorStatus"})).processor_status[0]}export{h as a,d as b,C as c,l as d,i as e,g as f,m as g,T as h};
2
- //# sourceMappingURL=chunk-2ZGHK5BB.mjs.map
1
+ import{m as p,v as a}from"./chunk-S3EDNXZE.mjs";import{b as n}from"./chunk-5TTCAW72.mjs";import{c}from"./chunk-XHEZAVN3.mjs";async function h(o){let{aptosConfig:t}=o,{data:s}=await n({aptosConfig:t,originMethod:"getLedgerInfo",path:""});return s}async function d(o){let{aptosConfig:t,ledgerVersion:s,options:e}=o,{data:r}=await n({aptosConfig:t,originMethod:"getBlockByVersion",path:`blocks/by_version/${s}`,params:{with_transactions:e?.withTransactions}});return r}async function C(o){let{aptosConfig:t,blockHeight:s,options:e}=o,{data:r}=await n({aptosConfig:t,originMethod:"getBlockByHeight",path:`blocks/by_height/${s}`,params:{with_transactions:e?.withTransactions}});return r}async function l(o){let{aptosConfig:t,limit:s}=o;return(await i({aptosConfig:t,query:{query:p,variables:{limit:s}},originMethod:"getChainTopUserTransactions"})).user_transactions}async function i(o){let{aptosConfig:t,query:s,originMethod:e}=o,{data:r}=await c({aptosConfig:t,originMethod:e??"queryIndexer",path:"",body:s,overrides:{WITH_CREDENTIALS:!1}});return r}async function g(o){let{aptosConfig:t}=o;return(await i({aptosConfig:t,query:{query:a},originMethod:"getProcessorStatuses"})).processor_status}async function m(o){let t=await g({aptosConfig:o.aptosConfig});return BigInt(t[0].last_success_version)}async function T(o){let{aptosConfig:t,processorType:s}=o;return(await i({aptosConfig:t,query:{query:a,variables:{where_condition:{processor:{_eq:s}}}},originMethod:"getProcessorStatus"})).processor_status[0]}export{h as a,d as b,C as c,l as d,i as e,g as f,m as g,T as h};
2
+ //# sourceMappingURL=chunk-OIH4KBXW.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as r,b as i,c as s}from"./chunk-NNUKSGEX.mjs";import{a as o}from"./chunk-M3YZNSJI.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-QYJF7C23.mjs.map
1
+ import{a as o}from"./chunk-ZMXURV35.mjs";import{a as r,b as i,c as s}from"./chunk-QKV2H27T.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-OLKEU7WZ.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as r}from"./chunk-EW3AR5V3.mjs";import{f as t,i as o}from"./chunk-U3YYSIIT.mjs";import{e as n}from"./chunk-CYNQRMO5.mjs";var u={typeParameters:[{constraints:[]}],parameters:[new o,new t]};async function y(e){let{aptosConfig:i,sender:s,recipient:c,amount:p,coinType:a,options:m}=e;return r({aptosConfig:i,sender:s,data:{function:"0x1::aptos_account::transfer_coins",typeArguments:[a??n],functionArguments:[c,p],abi:u},options:m})}export{y as a};
2
- //# sourceMappingURL=chunk-GWPTNJTQ.mjs.map
1
+ import{a as r}from"./chunk-V6J6AW5T.mjs";import{f as t,i as o}from"./chunk-S5AGI7RQ.mjs";import{e as n}from"./chunk-CYNQRMO5.mjs";var u={typeParameters:[{constraints:[]}],parameters:[new o,new t]};async function y(e){let{aptosConfig:i,sender:s,recipient:c,amount:p,coinType:a,options:m}=e;return r({aptosConfig:i,sender:s,data:{function:"0x1::aptos_account::transfer_coins",typeArguments:[a??n],functionArguments:[c,p],abi:u},options:m})}export{y as a};
2
+ //# sourceMappingURL=chunk-OO5EJW3B.mjs.map
@@ -1,2 +1,2 @@
1
- import{e as a}from"./chunk-2ZGHK5BB.mjs";import{q as d}from"./chunk-S3EDNXZE.mjs";import{b as p}from"./chunk-QRS4DGP3.mjs";var g=300,y=o=>{if(o&&o.length>g)throw new Error(`Event type length exceeds the maximum length of ${g}`)};async function f(o){let{aptosConfig:n,eventType:e,options:t}=o,r={where:{account_address:{_eq:"0x0000000000000000000000000000000000000000000000000000000000000000"},creation_number:{_eq:"0"},sequence_number:{_eq:"0"},indexed_type:{_eq:e}},pagination:t,orderBy:t?.orderBy};return c({aptosConfig:n,options:r})}async function h(o){let{accountAddress:n,aptosConfig:e,creationNumber:t,options:s}=o,i={where:{account_address:{_eq:p.from(n).toStringLong()},creation_number:{_eq:t}},pagination:s,orderBy:s?.orderBy};return c({aptosConfig:e,options:i})}async function _(o){let{accountAddress:n,aptosConfig:e,eventType:t,options:s}=o,i={where:{account_address:{_eq:p.from(n).toStringLong()},indexed_type:{_eq:t}},pagination:s,orderBy:s?.orderBy};return c({aptosConfig:e,options:i})}async function c(o){let{aptosConfig:n,options:e}=o;y(e?.where?.indexed_type?._eq);let t={query:d,variables:{where_condition:e?.where,offset:e?.offset,limit:e?.limit,order_by:e?.orderBy}};return(await a({aptosConfig:n,query:t,originMethod:"getEvents"})).events}export{f as a,h as b,_ as c,c as d};
2
- //# sourceMappingURL=chunk-L7LLGJRG.mjs.map
1
+ import{e as a}from"./chunk-OIH4KBXW.mjs";import{q as d}from"./chunk-S3EDNXZE.mjs";import{b as p}from"./chunk-UEI62FBQ.mjs";var g=300,y=o=>{if(o&&o.length>g)throw new Error(`Event type length exceeds the maximum length of ${g}`)};async function f(o){let{aptosConfig:n,eventType:e,options:t}=o,r={where:{account_address:{_eq:"0x0000000000000000000000000000000000000000000000000000000000000000"},creation_number:{_eq:"0"},sequence_number:{_eq:"0"},indexed_type:{_eq:e}},pagination:t,orderBy:t?.orderBy};return c({aptosConfig:n,options:r})}async function h(o){let{accountAddress:n,aptosConfig:e,creationNumber:t,options:s}=o,i={where:{account_address:{_eq:p.from(n).toStringLong()},creation_number:{_eq:t}},pagination:s,orderBy:s?.orderBy};return c({aptosConfig:e,options:i})}async function _(o){let{accountAddress:n,aptosConfig:e,eventType:t,options:s}=o,i={where:{account_address:{_eq:p.from(n).toStringLong()},indexed_type:{_eq:t}},pagination:s,orderBy:s?.orderBy};return c({aptosConfig:e,options:i})}async function c(o){let{aptosConfig:n,options:e}=o;y(e?.where?.indexed_type?._eq);let t={query:d,variables:{where_condition:e?.where,offset:e?.offset,limit:e?.limit,order_by:e?.orderBy}};return(await a({aptosConfig:n,query:t,originMethod:"getEvents"})).events}export{f as a,h as b,_ as c,c as d};
2
+ //# sourceMappingURL=chunk-OOH7MH2H.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as i}from"./chunk-36QXVFR5.mjs";var r=class a extends i{constructor(e){super(),this.chainId=e}serialize(e){e.serializeU8(this.chainId)}static deserialize(e){let s=e.deserializeU8();return new a(s)}};export{r as a};
2
- //# sourceMappingURL=chunk-PF57EOJY.mjs.map
1
+ import{a as i}from"./chunk-4KMISR2H.mjs";var r=class a extends i{constructor(e){super(),this.chainId=e}serialize(e){e.serializeU8(this.chainId)}static deserialize(e){let s=e.deserializeU8();return new a(s)}};export{r as a};
2
+ //# sourceMappingURL=chunk-P2CIREOD.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as m}from"./chunk-EW3AR5V3.mjs";import{a as g}from"./chunk-AG3TUKNI.mjs";import{e as A}from"./chunk-2ZGHK5BB.mjs";import{t as f}from"./chunk-S3EDNXZE.mjs";import{b as w}from"./chunk-QRS4DGP3.mjs";var T=["A name must be between 3 and 63 characters long,","and can only contain lowercase a-z, 0-9, and hyphens.","A name may not start or end with a hyphen."].join(" ");function E(e){return!(!e||e.length<3||e.length>63||!/^[a-z\d][a-z\d-]{1,61}[a-z\d]$/.test(e))}function c(e){let[n,t,...o]=e.replace(/\.apt$/,"").split(".");if(o.length>0)throw new Error(`${e} is invalid. A name can only have two parts, a domain and a subdomain separated by a "."`);if(!E(n))throw new Error(`${n} is not valid. ${T}`);if(t&&!E(t))throw new Error(`${t} is not valid. ${T}`);return{domainName:t||n,subdomainName:t?n:void 0}}var z="0x37368b46ce665362562c6d1d4ec01a08c8644c488690df5a17e13ba163e20221",G="0x585fc9f0f0c54183b039ffc770ca282ebd87307916c215a3e692f2f8e4305e82",P={testnet:"0x5f8fd2347449685cf41d4db97926ec3a096eaf381332be4f1318ad4d16a8497c",mainnet:"0x867ed1f6bf916171b1de3ee92849b8978b7d1b9e0a8cc982a3d19d535dfd9c0c",local:G,custom:null,devnet:null};function d(e){let n=P[e.network];if(!n)throw new Error(`The ANS contract is not deployed to ${e.network}`);return n}var b=e=>{if(e&&typeof e=="object"&&"vec"in e&&Array.isArray(e.vec))return e.vec[0]};async function V(e){let{aptosConfig:n,name:t}=e,o=d(n),{domainName:r,subdomainName:s}=c(t),i=await g({aptosConfig:n,payload:{function:`${o}::router::get_owner_addr`,functionArguments:[r,s]}}),a=b(i[0]);return a?w.from(a):void 0}async function j(e){let{aptosConfig:n,expiration:t,name:o,sender:r,targetAddress:s,toAddress:i,options:a,transferable:u}=e,p=d(n),{domainName:N,subdomainName:l}=c(o),S=t.policy==="subdomain:independent"||t.policy==="subdomain:follow-domain";if(l&&!S)throw new Error("Subdomains must have an expiration policy of either 'subdomain:independent' or 'subdomain:follow-domain'");if(S&&!l)throw new Error(`Policy is set to ${t.policy} but no subdomain was provided`);if(t.policy==="domain"){let h=t.years??1;if(h!==1)throw new Error("For now, names can only be registered for 1 year at a time");let D=h*31536e3;return await m({aptosConfig:n,sender:r.accountAddress.toString(),data:{function:`${p}::router::register_domain`,functionArguments:[N,D,s,i]},options:a})}if(!l)throw new Error(`${t.policy} requires a subdomain to be provided.`);let _=await I({aptosConfig:n,name:N});if(!_)throw new Error("The domain does not exist");let x=t.policy==="subdomain:independent"?t.expirationDate:_;if(x>_)throw new Error("The subdomain expiration time cannot be greater than the domain expiration time");return await m({aptosConfig:n,sender:r.accountAddress.toString(),data:{function:`${p}::router::register_subdomain`,functionArguments:[N,l,Math.round(x/1e3),t.policy==="subdomain:follow-domain"?1:0,!!u,s,i]},options:a})}async function I(e){let{aptosConfig:n,name:t}=e,o=d(n),{domainName:r,subdomainName:s}=c(t);try{let i=await g({aptosConfig:n,payload:{function:`${o}::router::get_expiration`,functionArguments:[r,s]}});return Number(i[0])*1e3}catch{return}}async function Y(e){let{aptosConfig:n,address:t}=e,o=d(n),r=await g({aptosConfig:n,payload:{function:`${o}::router::get_primary_name`,functionArguments:[w.from(t).toString()]}}),s=b(r[1]),i=b(r[0]);if(s)return[i,s].filter(Boolean).join(".")}async function K(e){let{aptosConfig:n,sender:t,name:o,options:r}=e,s=d(n);if(!o)return await m({aptosConfig:n,sender:t.accountAddress.toString(),data:{function:`${s}::router::clear_primary_name`,functionArguments:[]},options:r});let{domainName:i,subdomainName:a}=c(o);return await m({aptosConfig:n,sender:t.accountAddress.toString(),data:{function:`${s}::router::set_primary_name`,functionArguments:[i,a]},options:r})}async function W(e){let{aptosConfig:n,name:t}=e,o=d(n),{domainName:r,subdomainName:s}=c(t),i=await g({aptosConfig:n,payload:{function:`${o}::router::get_target_addr`,functionArguments:[r,s]}}),a=b(i[0]);return a?w.from(a):void 0}async function F(e){let{aptosConfig:n,sender:t,name:o,address:r,options:s}=e,i=d(n),{domainName:a,subdomainName:u}=c(o);return await m({aptosConfig:n,sender:t.accountAddress.toString(),data:{function:`${i}::router::set_target_addr`,functionArguments:[a,u,r]},options:s})}async function H(e){let{aptosConfig:n,name:t}=e,{domainName:o,subdomainName:r=""}=c(t),a=(await A({aptosConfig:n,query:{query:f,variables:{where_condition:{domain:{_eq:o},subdomain:{_eq:r},is_active:{_eq:!0}},limit:1}},originMethod:"getName"})).current_aptos_names[0];return a&&(a=y(a)),a}async function J(e){let{aptosConfig:n,options:t,accountAddress:o}=e,r=await C({aptosConfig:n});return(await A({aptosConfig:n,originMethod:"getAccountNames",query:{query:f,variables:{limit:t?.limit,offset:t?.offset,order_by:t?.orderBy,where_condition:{...e.options?.where??{},owner_address:{_eq:o.toString()},expiration_timestamp:{_gte:r}}}}})).current_aptos_names.map(y)}async function X(e){let{aptosConfig:n,options:t,accountAddress:o}=e,r=await C({aptosConfig:n});return(await A({aptosConfig:n,originMethod:"getAccountDomains",query:{query:f,variables:{limit:t?.limit,offset:t?.offset,order_by:t?.orderBy,where_condition:{...e.options?.where??{},owner_address:{_eq:o.toString()},expiration_timestamp:{_gte:r},subdomain:{_eq:""}}}}})).current_aptos_names.map(y)}async function Z(e){let{aptosConfig:n,options:t,accountAddress:o}=e,r=await C({aptosConfig:n});return(await A({aptosConfig:n,originMethod:"getAccountSubdomains",query:{query:f,variables:{limit:t?.limit,offset:t?.offset,order_by:t?.orderBy,where_condition:{...e.options?.where??{},owner_address:{_eq:o.toString()},expiration_timestamp:{_gte:r},subdomain:{_neq:""}}}}})).current_aptos_names.map(y)}async function ee(e){let{aptosConfig:n,options:t,domain:o}=e;return(await A({aptosConfig:n,originMethod:"getDomainSubdomains",query:{query:f,variables:{limit:t?.limit,offset:t?.offset,order_by:t?.orderBy,where_condition:{...e.options?.where??{},domain:{_eq:o},subdomain:{_neq:""},is_active:{_eq:!0}}}}})).current_aptos_names.map(y)}async function C(e){let{aptosConfig:n}=e,t=d(n),[o]=await g({aptosConfig:n,payload:{function:`${t}::config::reregistration_grace_sec`,functionArguments:[]}}),r=o/60/60/24,s=()=>new Date;return new Date(s().setDate(s().getDate()-r)).toISOString()}async function ne(e){let{aptosConfig:n,sender:t,name:o,years:r=1,options:s}=e,i=d(n),a=r*31536e3,{domainName:u,subdomainName:p}=c(o);if(p)throw new Error("Subdomains cannot be renewed");if(r!==1)throw new Error("Currently, only 1 year renewals are supported");return await m({aptosConfig:n,sender:t.accountAddress.toString(),data:{function:`${i}::router::renew_domain`,functionArguments:[u,a]},options:s})}function y(e){return{...e,expiration_timestamp:new Date(e.expiration_timestamp).getTime()}}export{T as a,E as b,c,z as d,G as e,V as f,j as g,I as h,Y as i,K as j,W as k,F as l,H as m,J as n,X as o,Z as p,ee as q,ne as r};
2
- //# sourceMappingURL=chunk-7FIS3GNZ.mjs.map
1
+ import{a as g}from"./chunk-VJL6AF64.mjs";import{a as m}from"./chunk-V6J6AW5T.mjs";import{e as A}from"./chunk-OIH4KBXW.mjs";import{t as f}from"./chunk-S3EDNXZE.mjs";import{b as w}from"./chunk-UEI62FBQ.mjs";var T=["A name must be between 3 and 63 characters long,","and can only contain lowercase a-z, 0-9, and hyphens.","A name may not start or end with a hyphen."].join(" ");function E(e){return!(!e||e.length<3||e.length>63||!/^[a-z\d][a-z\d-]{1,61}[a-z\d]$/.test(e))}function c(e){let[n,t,...o]=e.replace(/\.apt$/,"").split(".");if(o.length>0)throw new Error(`${e} is invalid. A name can only have two parts, a domain and a subdomain separated by a "."`);if(!E(n))throw new Error(`${n} is not valid. ${T}`);if(t&&!E(t))throw new Error(`${t} is not valid. ${T}`);return{domainName:t||n,subdomainName:t?n:void 0}}var z="0x37368b46ce665362562c6d1d4ec01a08c8644c488690df5a17e13ba163e20221",G="0x585fc9f0f0c54183b039ffc770ca282ebd87307916c215a3e692f2f8e4305e82",P={testnet:"0x5f8fd2347449685cf41d4db97926ec3a096eaf381332be4f1318ad4d16a8497c",mainnet:"0x867ed1f6bf916171b1de3ee92849b8978b7d1b9e0a8cc982a3d19d535dfd9c0c",local:G,custom:null,devnet:null};function d(e){let n=P[e.network];if(!n)throw new Error(`The ANS contract is not deployed to ${e.network}`);return n}var b=e=>{if(e&&typeof e=="object"&&"vec"in e&&Array.isArray(e.vec))return e.vec[0]};async function V(e){let{aptosConfig:n,name:t}=e,o=d(n),{domainName:r,subdomainName:s}=c(t),i=await g({aptosConfig:n,payload:{function:`${o}::router::get_owner_addr`,functionArguments:[r,s]}}),a=b(i[0]);return a?w.from(a):void 0}async function j(e){let{aptosConfig:n,expiration:t,name:o,sender:r,targetAddress:s,toAddress:i,options:a,transferable:u}=e,p=d(n),{domainName:N,subdomainName:l}=c(o),S=t.policy==="subdomain:independent"||t.policy==="subdomain:follow-domain";if(l&&!S)throw new Error("Subdomains must have an expiration policy of either 'subdomain:independent' or 'subdomain:follow-domain'");if(S&&!l)throw new Error(`Policy is set to ${t.policy} but no subdomain was provided`);if(t.policy==="domain"){let h=t.years??1;if(h!==1)throw new Error("For now, names can only be registered for 1 year at a time");let D=h*31536e3;return await m({aptosConfig:n,sender:r.accountAddress.toString(),data:{function:`${p}::router::register_domain`,functionArguments:[N,D,s,i]},options:a})}if(!l)throw new Error(`${t.policy} requires a subdomain to be provided.`);let _=await I({aptosConfig:n,name:N});if(!_)throw new Error("The domain does not exist");let x=t.policy==="subdomain:independent"?t.expirationDate:_;if(x>_)throw new Error("The subdomain expiration time cannot be greater than the domain expiration time");return await m({aptosConfig:n,sender:r.accountAddress.toString(),data:{function:`${p}::router::register_subdomain`,functionArguments:[N,l,Math.round(x/1e3),t.policy==="subdomain:follow-domain"?1:0,!!u,s,i]},options:a})}async function I(e){let{aptosConfig:n,name:t}=e,o=d(n),{domainName:r,subdomainName:s}=c(t);try{let i=await g({aptosConfig:n,payload:{function:`${o}::router::get_expiration`,functionArguments:[r,s]}});return Number(i[0])*1e3}catch{return}}async function Y(e){let{aptosConfig:n,address:t}=e,o=d(n),r=await g({aptosConfig:n,payload:{function:`${o}::router::get_primary_name`,functionArguments:[w.from(t).toString()]}}),s=b(r[1]),i=b(r[0]);if(s)return[i,s].filter(Boolean).join(".")}async function K(e){let{aptosConfig:n,sender:t,name:o,options:r}=e,s=d(n);if(!o)return await m({aptosConfig:n,sender:t.accountAddress.toString(),data:{function:`${s}::router::clear_primary_name`,functionArguments:[]},options:r});let{domainName:i,subdomainName:a}=c(o);return await m({aptosConfig:n,sender:t.accountAddress.toString(),data:{function:`${s}::router::set_primary_name`,functionArguments:[i,a]},options:r})}async function W(e){let{aptosConfig:n,name:t}=e,o=d(n),{domainName:r,subdomainName:s}=c(t),i=await g({aptosConfig:n,payload:{function:`${o}::router::get_target_addr`,functionArguments:[r,s]}}),a=b(i[0]);return a?w.from(a):void 0}async function F(e){let{aptosConfig:n,sender:t,name:o,address:r,options:s}=e,i=d(n),{domainName:a,subdomainName:u}=c(o);return await m({aptosConfig:n,sender:t.accountAddress.toString(),data:{function:`${i}::router::set_target_addr`,functionArguments:[a,u,r]},options:s})}async function H(e){let{aptosConfig:n,name:t}=e,{domainName:o,subdomainName:r=""}=c(t),a=(await A({aptosConfig:n,query:{query:f,variables:{where_condition:{domain:{_eq:o},subdomain:{_eq:r},is_active:{_eq:!0}},limit:1}},originMethod:"getName"})).current_aptos_names[0];return a&&(a=y(a)),a}async function J(e){let{aptosConfig:n,options:t,accountAddress:o}=e,r=await C({aptosConfig:n});return(await A({aptosConfig:n,originMethod:"getAccountNames",query:{query:f,variables:{limit:t?.limit,offset:t?.offset,order_by:t?.orderBy,where_condition:{...e.options?.where??{},owner_address:{_eq:o.toString()},expiration_timestamp:{_gte:r}}}}})).current_aptos_names.map(y)}async function X(e){let{aptosConfig:n,options:t,accountAddress:o}=e,r=await C({aptosConfig:n});return(await A({aptosConfig:n,originMethod:"getAccountDomains",query:{query:f,variables:{limit:t?.limit,offset:t?.offset,order_by:t?.orderBy,where_condition:{...e.options?.where??{},owner_address:{_eq:o.toString()},expiration_timestamp:{_gte:r},subdomain:{_eq:""}}}}})).current_aptos_names.map(y)}async function Z(e){let{aptosConfig:n,options:t,accountAddress:o}=e,r=await C({aptosConfig:n});return(await A({aptosConfig:n,originMethod:"getAccountSubdomains",query:{query:f,variables:{limit:t?.limit,offset:t?.offset,order_by:t?.orderBy,where_condition:{...e.options?.where??{},owner_address:{_eq:o.toString()},expiration_timestamp:{_gte:r},subdomain:{_neq:""}}}}})).current_aptos_names.map(y)}async function ee(e){let{aptosConfig:n,options:t,domain:o}=e;return(await A({aptosConfig:n,originMethod:"getDomainSubdomains",query:{query:f,variables:{limit:t?.limit,offset:t?.offset,order_by:t?.orderBy,where_condition:{...e.options?.where??{},domain:{_eq:o},subdomain:{_neq:""},is_active:{_eq:!0}}}}})).current_aptos_names.map(y)}async function C(e){let{aptosConfig:n}=e,t=d(n),[o]=await g({aptosConfig:n,payload:{function:`${t}::config::reregistration_grace_sec`,functionArguments:[]}}),r=o/60/60/24,s=()=>new Date;return new Date(s().setDate(s().getDate()-r)).toISOString()}async function ne(e){let{aptosConfig:n,sender:t,name:o,years:r=1,options:s}=e,i=d(n),a=r*31536e3,{domainName:u,subdomainName:p}=c(o);if(p)throw new Error("Subdomains cannot be renewed");if(r!==1)throw new Error("Currently, only 1 year renewals are supported");return await m({aptosConfig:n,sender:t.accountAddress.toString(),data:{function:`${i}::router::renew_domain`,functionArguments:[u,a]},options:s})}function y(e){return{...e,expiration_timestamp:new Date(e.expiration_timestamp).getTime()}}export{T as a,E as b,c,z as d,G as e,V as f,j as g,I as h,Y as i,K as j,W as k,F as l,H as m,J as n,X as o,Z as p,ee as q,ne as r};
2
+ //# sourceMappingURL=chunk-QIELBIZW.mjs.map
@@ -1,2 +1,2 @@
1
- import{e as n}from"./chunk-2ZGHK5BB.mjs";import{p as g,u as d}from"./chunk-S3EDNXZE.mjs";import{b as s}from"./chunk-QRS4DGP3.mjs";async function m(e){let{aptosConfig:t,poolAddress:o}=e,r=s.from(o).toStringLong(),i=await n({aptosConfig:t,query:{query:d,variables:{where_condition:{pool_address:{_eq:r}}}}});return i.num_active_delegator_per_pool[0]?i.num_active_delegator_per_pool[0].num_active_delegator:0}async function f(e){let{aptosConfig:t,options:o}=e,r={query:d,variables:{order_by:o?.orderBy}};return(await n({aptosConfig:t,query:r})).num_active_delegator_per_pool}async function A(e){let{aptosConfig:t,delegatorAddress:o,poolAddress:r}=e,a={query:g,variables:{delegatorAddress:s.from(o).toStringLong(),poolAddress:s.from(r).toStringLong()}};return(await n({aptosConfig:t,query:a})).delegated_staking_activities}export{m as a,f as b,A as c};
2
- //# sourceMappingURL=chunk-NNUKSGEX.mjs.map
1
+ import{e as n}from"./chunk-OIH4KBXW.mjs";import{p as g,u as d}from"./chunk-S3EDNXZE.mjs";import{b as s}from"./chunk-UEI62FBQ.mjs";async function m(e){let{aptosConfig:t,poolAddress:o}=e,r=s.from(o).toStringLong(),i=await n({aptosConfig:t,query:{query:d,variables:{where_condition:{pool_address:{_eq:r}}}}});return i.num_active_delegator_per_pool[0]?i.num_active_delegator_per_pool[0].num_active_delegator:0}async function f(e){let{aptosConfig:t,options:o}=e,r={query:d,variables:{order_by:o?.orderBy}};return(await n({aptosConfig:t,query:r})).num_active_delegator_per_pool}async function A(e){let{aptosConfig:t,delegatorAddress:o,poolAddress:r}=e,a={query:g,variables:{delegatorAddress:s.from(o).toStringLong(),poolAddress:s.from(r).toStringLong()}};return(await n({aptosConfig:t,query:a})).delegated_staking_activities}export{m as a,f as b,A as c};
2
+ //# sourceMappingURL=chunk-QKV2H27T.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as R}from"./chunk-AH44UPM4.mjs";import{g as x,h as P}from"./chunk-2ZGHK5BB.mjs";import{b as c,c as A}from"./chunk-S2VSJJRJ.mjs";import{a as C}from"./chunk-GHYE26Q5.mjs";import{d as w}from"./chunk-CYNQRMO5.mjs";import{a as h}from"./chunk-3JPVQHOR.mjs";async function v(o){let{aptosConfig:n,options:t}=o;return A({aptosConfig:n,originMethod:"getTransactions",path:"transactions",params:{start:t?.offset,limit:t?.limit}})}async function D(o){let{aptosConfig:n}=o;return R(async()=>{let{data:t}=await c({aptosConfig:n,originMethod:"getGasPriceEstimation",path:"estimate_gas_price"});return t},`gas-price-${n.network}`,1e3*60*5)()}async function N(o){let{aptosConfig:n,ledgerVersion:t}=o,{data:s}=await c({aptosConfig:n,originMethod:"getTransactionByVersion",path:`transactions/by_version/${t}`});return s}async function T(o){let{aptosConfig:n,transactionHash:t}=o,{data:s}=await c({aptosConfig:n,path:`transactions/by_hash/${t}`,originMethod:"getTransactionByHash"});return s}async function G(o){let{aptosConfig:n,transactionHash:t}=o;try{return(await T({aptosConfig:n,transactionHash:t})).type==="pending_transaction"}catch(s){if(s?.status===404)return!0;throw s}}async function b(o){let{aptosConfig:n,transactionHash:t}=o,{data:s}=await c({aptosConfig:n,path:`transactions/wait_by_hash/${t}`,originMethod:"longWaitForTransaction"});return s}async function W(o){let{aptosConfig:n,transactionHash:t,options:s}=o,r=s?.timeoutSecs??20,u=s?.checkSuccess??!0,a=!0,p=0,e,g,m=200,E=1.5;function d(i){if(!(i instanceof C)||(g=i,i.status!==404&&i.status>=400&&i.status<500))throw i}try{e=await T({aptosConfig:n,transactionHash:t}),a=e.type==="pending_transaction"}catch(i){d(i)}if(a){let i=Date.now();try{e=await b({aptosConfig:n,transactionHash:t}),a=e.type==="pending_transaction"}catch(l){d(l)}p=(Date.now()-i)/1e3}for(;a&&!(p>=r);){try{if(e=await T({aptosConfig:n,transactionHash:t}),a=e.type==="pending_transaction",!a)break}catch(i){d(i)}await h(m),p+=m/1e3,m*=E}if(e===void 0)throw g||new f(`Fetching transaction ${t} failed and timed out after ${r} seconds`,e);if(e.type==="pending_transaction")throw new f(`Transaction ${t} timed out in pending state after ${r} seconds`,e);if(!u)return e;if(!e.success)throw new y(`Transaction ${t} failed with an error: ${e.vm_status}`,e);return e}async function O(o){let{aptosConfig:n,processorType:t}=o,s=BigInt(o.minimumLedgerVersion),r=3e3,u=new Date().getTime(),a=BigInt(-1);for(;a<s;){if(new Date().getTime()-u>r)throw new Error("waitForLastSuccessIndexerVersionSync timeout");if(t===void 0?a=await x({aptosConfig:n}):a=(await P({aptosConfig:n,processorType:t})).last_success_version,a>=s)break;await h(200)}}var f=class extends Error{constructor(n,t){super(n),this.lastSubmittedTransaction=t}},y=class extends Error{constructor(n,t){super(n),this.transaction=t}};export{v as a,D as b,N as c,T as d,G as e,b as f,W as g,O as h,f as i,y as j};
2
- //# sourceMappingURL=chunk-AJU3EBVX.mjs.map
1
+ import{a as R}from"./chunk-AH44UPM4.mjs";import{g as x,h as P}from"./chunk-OIH4KBXW.mjs";import{b as c,c as A}from"./chunk-5TTCAW72.mjs";import{a as C}from"./chunk-GHYE26Q5.mjs";import{d as w}from"./chunk-CYNQRMO5.mjs";import{a as h}from"./chunk-3JPVQHOR.mjs";async function v(o){let{aptosConfig:n,options:t}=o;return A({aptosConfig:n,originMethod:"getTransactions",path:"transactions",params:{start:t?.offset,limit:t?.limit}})}async function D(o){let{aptosConfig:n}=o;return R(async()=>{let{data:t}=await c({aptosConfig:n,originMethod:"getGasPriceEstimation",path:"estimate_gas_price"});return t},`gas-price-${n.network}`,1e3*60*5)()}async function N(o){let{aptosConfig:n,ledgerVersion:t}=o,{data:s}=await c({aptosConfig:n,originMethod:"getTransactionByVersion",path:`transactions/by_version/${t}`});return s}async function T(o){let{aptosConfig:n,transactionHash:t}=o,{data:s}=await c({aptosConfig:n,path:`transactions/by_hash/${t}`,originMethod:"getTransactionByHash"});return s}async function G(o){let{aptosConfig:n,transactionHash:t}=o;try{return(await T({aptosConfig:n,transactionHash:t})).type==="pending_transaction"}catch(s){if(s?.status===404)return!0;throw s}}async function b(o){let{aptosConfig:n,transactionHash:t}=o,{data:s}=await c({aptosConfig:n,path:`transactions/wait_by_hash/${t}`,originMethod:"longWaitForTransaction"});return s}async function W(o){let{aptosConfig:n,transactionHash:t,options:s}=o,r=s?.timeoutSecs??20,u=s?.checkSuccess??!0,a=!0,p=0,e,g,m=200,E=1.5;function d(i){if(!(i instanceof C)||(g=i,i.status!==404&&i.status>=400&&i.status<500))throw i}try{e=await T({aptosConfig:n,transactionHash:t}),a=e.type==="pending_transaction"}catch(i){d(i)}if(a){let i=Date.now();try{e=await b({aptosConfig:n,transactionHash:t}),a=e.type==="pending_transaction"}catch(l){d(l)}p=(Date.now()-i)/1e3}for(;a&&!(p>=r);){try{if(e=await T({aptosConfig:n,transactionHash:t}),a=e.type==="pending_transaction",!a)break}catch(i){d(i)}await h(m),p+=m/1e3,m*=E}if(e===void 0)throw g||new f(`Fetching transaction ${t} failed and timed out after ${r} seconds`,e);if(e.type==="pending_transaction")throw new f(`Transaction ${t} timed out in pending state after ${r} seconds`,e);if(!u)return e;if(!e.success)throw new y(`Transaction ${t} failed with an error: ${e.vm_status}`,e);return e}async function O(o){let{aptosConfig:n,processorType:t}=o,s=BigInt(o.minimumLedgerVersion),r=3e3,u=new Date().getTime(),a=BigInt(-1);for(;a<s;){if(new Date().getTime()-u>r)throw new Error("waitForLastSuccessIndexerVersionSync timeout");if(t===void 0?a=await x({aptosConfig:n}):a=(await P({aptosConfig:n,processorType:t})).last_success_version,a>=s)break;await h(200)}}var f=class extends Error{constructor(n,t){super(n),this.lastSubmittedTransaction=t}},y=class extends Error{constructor(n,t){super(n),this.transaction=t}};export{v as a,D as b,N as c,T as d,G as e,b as f,W as g,O as h,f as i,y as j};
2
+ //# sourceMappingURL=chunk-R5NNAF5B.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as d}from"./chunk-EW3AR5V3.mjs";import{f as M}from"./chunk-BVV56I3P.mjs";import{c as V}from"./chunk-MJPUASSD.mjs";import{e as b}from"./chunk-2ZGHK5BB.mjs";import{A as q,n as x,y as E,z as G}from"./chunk-S3EDNXZE.mjs";import{b as w,f as v,i as h,l as A,m as f,n as s,q as p,s as g}from"./chunk-U3YYSIIT.mjs";import{b as u}from"./chunk-QRS4DGP3.mjs";import{a as I,b as c}from"./chunk-G56GPLTB.mjs";import{a as T,e as S}from"./chunk-SRDIYE3M.mjs";import{d as O}from"./chunk-56CNRT2K.mjs";var C={BOOLEAN:"bool",U8:"u8",U16:"u16",U32:"u32",U64:"u64",U128:"u128",U256:"u256",ADDRESS:"address",STRING:"0x1::string::String",ARRAY:"vector<u8>"},m="0x4::token::Token";async function It(t){let{aptosConfig:o,digitalAssetAddress:n}=t,e={token_data_id:{_eq:u.from(n).toStringLong()}};return(await b({aptosConfig:o,query:{query:q,variables:{where_condition:e}},originMethod:"getDigitalAssetData"})).current_token_datas_v2[0]}async function _t(t){let{aptosConfig:o,digitalAssetAddress:n}=t,e={token_data_id:{_eq:u.from(n).toStringLong()},amount:{_gt:0}};return(await b({aptosConfig:o,query:{query:G,variables:{where_condition:e}},originMethod:"getCurrentDigitalAssetOwnership"})).current_token_ownerships_v2[0]}async function Pt(t){let{aptosConfig:o,ownerAddress:n,options:e}=t,r={owner_address:{_eq:u.from(n).toStringLong()},amount:{_gt:0}},i={query:G,variables:{where_condition:r,offset:e?.offset,limit:e?.limit,order_by:e?.orderBy}};return(await b({aptosConfig:o,query:i,originMethod:"getOwnedDigitalAssets"})).current_token_ownerships_v2}async function kt(t){let{aptosConfig:o,digitalAssetAddress:n,options:e}=t,r={token_data_id:{_eq:u.from(n).toStringLong()}},i={query:E,variables:{where_condition:r,offset:e?.offset,limit:e?.limit,order_by:e?.orderBy}};return(await b({aptosConfig:o,query:i,originMethod:"getDigitalAssetActivity"})).token_activities_v2}var Q={typeParameters:[],parameters:[new s(p()),new v,new s(p()),new s(p()),new w,new w,new w,new w,new w,new w,new w,new w,new w,new v,new v]};async function Dt(t){let{aptosConfig:o,options:n,creator:e}=t;return d({aptosConfig:o,sender:e.accountAddress,data:{function:"0x4::aptos_token::create_collection",functionArguments:[new c(t.description),new S(t.maxSupply??O),new c(t.name),new c(t.uri),new T(t.mutableDescription??!0),new T(t.mutableRoyalty??!0),new T(t.mutableURI??!0),new T(t.mutableTokenDescription??!0),new T(t.mutableTokenName??!0),new T(t.mutableTokenProperties??!0),new T(t.mutableTokenURI??!0),new T(t.tokensBurnableByCreator??!0),new T(t.tokensFreezableByCreator??!0),new S(t.royaltyNumerator??0),new S(t.royaltyDenominator??1)],abi:Q},options:n})}async function U(t){let{aptosConfig:o,creatorAddress:n,collectionName:e,options:r}=t,i=u.from(n),a={collection_name:{_eq:e},creator_address:{_eq:i.toStringLong()}};return r?.tokenStandard&&(a.token_standard={_eq:r?.tokenStandard??"v2"}),(await b({aptosConfig:o,query:{query:x,variables:{where_condition:a}},originMethod:"getCollectionData"})).current_collections_v2[0]}async function St(t){let{aptosConfig:o,collectionId:n}=t,r={collection_id:{_eq:u.from(n).toStringLong()}};return(await b({aptosConfig:o,query:{query:x,variables:{where_condition:r}},originMethod:"getCollectionData"})).current_collections_v2[0]}async function vt(t){return(await U(t)).collection_id}var F={typeParameters:[],parameters:[new s(p()),new s(p()),new s(p()),new s(p()),new f(new s(p())),new f(new s(p())),new f(f.u8())]};async function ht(t){let{aptosConfig:o,options:n,creator:e,collection:r,description:i,name:a,uri:l,propertyKeys:y,propertyTypes:P,propertyValues:_}=t,k=P?.map(D=>C[D]);return d({aptosConfig:o,sender:e.accountAddress,data:{function:"0x4::aptos_token::mint",functionArguments:[new c(r),new c(i),new c(a),new c(l),I.MoveString(y??[]),I.MoveString(k??[]),R(_??[],k??[])],abi:F},options:n})}var N={typeParameters:[{constraints:["key"]}],parameters:[new s(g(new A(0))),new h]};async function xt(t){let{aptosConfig:o,sender:n,digitalAssetAddress:e,recipient:r,digitalAssetType:i,options:a}=t;return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x1::object::transfer",typeArguments:[i??m],functionArguments:[u.from(e),u.from(r)],abi:N},options:a})}var Y={typeParameters:[],parameters:[new s(p()),new s(p()),new s(p()),new s(p()),new f(new s(p())),new f(new s(p())),new f(f.u8()),new h]};async function Gt(t){let{aptosConfig:o,account:n,collection:e,description:r,name:i,uri:a,recipient:l,propertyKeys:y,propertyTypes:P,propertyValues:_,options:k}=t;if(y?.length!==_?.length)throw new Error("Property keys and property values counts do not match");if(P?.length!==_?.length)throw new Error("Property types and property values counts do not match");let D=P?.map(K=>C[K]);return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::mint_soul_bound",functionArguments:[e,r,i,a,I.MoveString(y??[]),I.MoveString(D??[]),R(_??[],D??[]),l],abi:Y},options:k})}var z={typeParameters:[{constraints:["key"]}],parameters:[new s(g(new A(0)))]};async function Bt(t){let{aptosConfig:o,creator:n,digitalAssetAddress:e,digitalAssetType:r,options:i}=t;return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::burn",typeArguments:[r??m],functionArguments:[u.from(e)],abi:z},options:i})}var L={typeParameters:[{constraints:["key"]}],parameters:[new s(g(new A(0)))]};async function Ot(t){let{aptosConfig:o,creator:n,digitalAssetAddress:e,digitalAssetType:r,options:i}=t;return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::freeze_transfer",typeArguments:[r??m],functionArguments:[e],abi:L},options:i})}var j={typeParameters:[{constraints:["key"]}],parameters:[new s(g(new A(0)))]};async function Et(t){let{aptosConfig:o,creator:n,digitalAssetAddress:e,digitalAssetType:r,options:i}=t;return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::unfreeze_transfer",typeArguments:[r??m],functionArguments:[e],abi:j},options:i})}var X={typeParameters:[{constraints:["key"]}],parameters:[new s(g(new A(0))),new s(p())]};async function qt(t){let{aptosConfig:o,creator:n,description:e,digitalAssetAddress:r,digitalAssetType:i,options:a}=t;return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::set_description",typeArguments:[i??m],functionArguments:[u.from(r),new c(e)],abi:X},options:a})}var H={typeParameters:[{constraints:["key"]}],parameters:[new s(g(new A(0))),new s(p())]};async function Vt(t){let{aptosConfig:o,creator:n,name:e,digitalAssetAddress:r,digitalAssetType:i,options:a}=t;return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::set_name",typeArguments:[i??m],functionArguments:[u.from(r),new c(e)],abi:H},options:a})}var J={typeParameters:[{constraints:["key"]}],parameters:[new s(g(new A(0))),new s(p())]};async function Mt(t){let{aptosConfig:o,creator:n,uri:e,digitalAssetAddress:r,digitalAssetType:i,options:a}=t;return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::set_uri",typeArguments:[i??m],functionArguments:[u.from(r),new c(e)],abi:J},options:a})}var W={typeParameters:[{constraints:["key"]}],parameters:[new s(g(new A(0))),new s(p()),new s(p()),f.u8()]};async function Rt(t){let{aptosConfig:o,creator:n,propertyKey:e,propertyType:r,propertyValue:i,digitalAssetAddress:a,digitalAssetType:l,options:y}=t;return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::add_property",typeArguments:[l??m],functionArguments:[u.from(a),new c(e),new c(C[r]),I.U8(B(i,C[r]))],abi:W},options:y})}var Z={typeParameters:[{constraints:["key"]}],parameters:[new s(g(new A(0))),new s(p())]};async function Kt(t){let{aptosConfig:o,creator:n,propertyKey:e,digitalAssetAddress:r,digitalAssetType:i,options:a}=t;return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::remove_property",typeArguments:[i??m],functionArguments:[u.from(r),new c(e)],abi:Z},options:a})}var $={typeParameters:[{constraints:["key"]}],parameters:[new s(g(new A(0))),new s(p()),new s(p()),f.u8()]};async function Qt(t){let{aptosConfig:o,creator:n,propertyKey:e,propertyType:r,propertyValue:i,digitalAssetAddress:a,digitalAssetType:l,options:y}=t;return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::update_property",typeArguments:[l??m],functionArguments:[u.from(a),new c(e),new c(C[r]),B(i,C[r])],abi:$},options:y})}var tt={typeParameters:[{constraints:["key"]},{constraints:[]}],parameters:[new s(g(new A(0))),new s(p()),new A(1)]};async function Ut(t){let{aptosConfig:o,creator:n,propertyKey:e,propertyType:r,propertyValue:i,digitalAssetAddress:a,digitalAssetType:l,options:y}=t;return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::add_typed_property",typeArguments:[l??m,C[r]],functionArguments:[u.from(a),new c(e),i],abi:tt},options:y})}var et={typeParameters:[{constraints:["key"]},{constraints:[]}],parameters:[new s(g(new A(0))),new s(p()),new A(1)]};async function Ft(t){let{aptosConfig:o,creator:n,propertyKey:e,propertyType:r,propertyValue:i,digitalAssetAddress:a,digitalAssetType:l,options:y}=t;return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::update_typed_property",typeArguments:[l??m,C[r]],functionArguments:[u.from(a),new c(e),i],abi:et},options:y})}function R(t,o){let n=new Array;return o.forEach((e,r)=>{n.push(B(t[r],e))}),n}function B(t,o){let n=V(o);return M(t,n,0,[]).bcsToBytes()}export{It as a,_t as b,Pt as c,kt as d,Dt as e,U as f,St as g,vt as h,ht as i,xt as j,Gt as k,Bt as l,Ot as m,Et as n,qt as o,Vt as p,Mt as q,Rt as r,Kt as s,Qt as t,Ut as u,Ft as v};
2
- //# sourceMappingURL=chunk-DQOIESL4.mjs.map
1
+ import{a as d}from"./chunk-V6J6AW5T.mjs";import{f as M}from"./chunk-LKVJZTBM.mjs";import{c as V}from"./chunk-JE7INUQ2.mjs";import{e as b}from"./chunk-OIH4KBXW.mjs";import{A as q,n as x,y as E,z as G}from"./chunk-S3EDNXZE.mjs";import{b as w,f as v,i as h,l as A,m as f,n as s,q as p,s as g}from"./chunk-S5AGI7RQ.mjs";import{a as I,b as c}from"./chunk-YJIRT3GJ.mjs";import{a as T,e as S}from"./chunk-5NSXEM3O.mjs";import{b as u}from"./chunk-UEI62FBQ.mjs";import{d as O}from"./chunk-56CNRT2K.mjs";var C={BOOLEAN:"bool",U8:"u8",U16:"u16",U32:"u32",U64:"u64",U128:"u128",U256:"u256",ADDRESS:"address",STRING:"0x1::string::String",ARRAY:"vector<u8>"},m="0x4::token::Token";async function It(t){let{aptosConfig:o,digitalAssetAddress:n}=t,e={token_data_id:{_eq:u.from(n).toStringLong()}};return(await b({aptosConfig:o,query:{query:q,variables:{where_condition:e}},originMethod:"getDigitalAssetData"})).current_token_datas_v2[0]}async function _t(t){let{aptosConfig:o,digitalAssetAddress:n}=t,e={token_data_id:{_eq:u.from(n).toStringLong()},amount:{_gt:0}};return(await b({aptosConfig:o,query:{query:G,variables:{where_condition:e}},originMethod:"getCurrentDigitalAssetOwnership"})).current_token_ownerships_v2[0]}async function Pt(t){let{aptosConfig:o,ownerAddress:n,options:e}=t,r={owner_address:{_eq:u.from(n).toStringLong()},amount:{_gt:0}},i={query:G,variables:{where_condition:r,offset:e?.offset,limit:e?.limit,order_by:e?.orderBy}};return(await b({aptosConfig:o,query:i,originMethod:"getOwnedDigitalAssets"})).current_token_ownerships_v2}async function kt(t){let{aptosConfig:o,digitalAssetAddress:n,options:e}=t,r={token_data_id:{_eq:u.from(n).toStringLong()}},i={query:E,variables:{where_condition:r,offset:e?.offset,limit:e?.limit,order_by:e?.orderBy}};return(await b({aptosConfig:o,query:i,originMethod:"getDigitalAssetActivity"})).token_activities_v2}var Q={typeParameters:[],parameters:[new s(p()),new v,new s(p()),new s(p()),new w,new w,new w,new w,new w,new w,new w,new w,new w,new v,new v]};async function Dt(t){let{aptosConfig:o,options:n,creator:e}=t;return d({aptosConfig:o,sender:e.accountAddress,data:{function:"0x4::aptos_token::create_collection",functionArguments:[new c(t.description),new S(t.maxSupply??O),new c(t.name),new c(t.uri),new T(t.mutableDescription??!0),new T(t.mutableRoyalty??!0),new T(t.mutableURI??!0),new T(t.mutableTokenDescription??!0),new T(t.mutableTokenName??!0),new T(t.mutableTokenProperties??!0),new T(t.mutableTokenURI??!0),new T(t.tokensBurnableByCreator??!0),new T(t.tokensFreezableByCreator??!0),new S(t.royaltyNumerator??0),new S(t.royaltyDenominator??1)],abi:Q},options:n})}async function U(t){let{aptosConfig:o,creatorAddress:n,collectionName:e,options:r}=t,i=u.from(n),a={collection_name:{_eq:e},creator_address:{_eq:i.toStringLong()}};return r?.tokenStandard&&(a.token_standard={_eq:r?.tokenStandard??"v2"}),(await b({aptosConfig:o,query:{query:x,variables:{where_condition:a}},originMethod:"getCollectionData"})).current_collections_v2[0]}async function St(t){let{aptosConfig:o,collectionId:n}=t,r={collection_id:{_eq:u.from(n).toStringLong()}};return(await b({aptosConfig:o,query:{query:x,variables:{where_condition:r}},originMethod:"getCollectionData"})).current_collections_v2[0]}async function vt(t){return(await U(t)).collection_id}var F={typeParameters:[],parameters:[new s(p()),new s(p()),new s(p()),new s(p()),new f(new s(p())),new f(new s(p())),new f(f.u8())]};async function ht(t){let{aptosConfig:o,options:n,creator:e,collection:r,description:i,name:a,uri:l,propertyKeys:y,propertyTypes:P,propertyValues:_}=t,k=P?.map(D=>C[D]);return d({aptosConfig:o,sender:e.accountAddress,data:{function:"0x4::aptos_token::mint",functionArguments:[new c(r),new c(i),new c(a),new c(l),I.MoveString(y??[]),I.MoveString(k??[]),R(_??[],k??[])],abi:F},options:n})}var N={typeParameters:[{constraints:["key"]}],parameters:[new s(g(new A(0))),new h]};async function xt(t){let{aptosConfig:o,sender:n,digitalAssetAddress:e,recipient:r,digitalAssetType:i,options:a}=t;return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x1::object::transfer",typeArguments:[i??m],functionArguments:[u.from(e),u.from(r)],abi:N},options:a})}var Y={typeParameters:[],parameters:[new s(p()),new s(p()),new s(p()),new s(p()),new f(new s(p())),new f(new s(p())),new f(f.u8()),new h]};async function Gt(t){let{aptosConfig:o,account:n,collection:e,description:r,name:i,uri:a,recipient:l,propertyKeys:y,propertyTypes:P,propertyValues:_,options:k}=t;if(y?.length!==_?.length)throw new Error("Property keys and property values counts do not match");if(P?.length!==_?.length)throw new Error("Property types and property values counts do not match");let D=P?.map(K=>C[K]);return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::mint_soul_bound",functionArguments:[e,r,i,a,I.MoveString(y??[]),I.MoveString(D??[]),R(_??[],D??[]),l],abi:Y},options:k})}var z={typeParameters:[{constraints:["key"]}],parameters:[new s(g(new A(0)))]};async function Bt(t){let{aptosConfig:o,creator:n,digitalAssetAddress:e,digitalAssetType:r,options:i}=t;return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::burn",typeArguments:[r??m],functionArguments:[u.from(e)],abi:z},options:i})}var L={typeParameters:[{constraints:["key"]}],parameters:[new s(g(new A(0)))]};async function Ot(t){let{aptosConfig:o,creator:n,digitalAssetAddress:e,digitalAssetType:r,options:i}=t;return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::freeze_transfer",typeArguments:[r??m],functionArguments:[e],abi:L},options:i})}var j={typeParameters:[{constraints:["key"]}],parameters:[new s(g(new A(0)))]};async function Et(t){let{aptosConfig:o,creator:n,digitalAssetAddress:e,digitalAssetType:r,options:i}=t;return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::unfreeze_transfer",typeArguments:[r??m],functionArguments:[e],abi:j},options:i})}var X={typeParameters:[{constraints:["key"]}],parameters:[new s(g(new A(0))),new s(p())]};async function qt(t){let{aptosConfig:o,creator:n,description:e,digitalAssetAddress:r,digitalAssetType:i,options:a}=t;return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::set_description",typeArguments:[i??m],functionArguments:[u.from(r),new c(e)],abi:X},options:a})}var H={typeParameters:[{constraints:["key"]}],parameters:[new s(g(new A(0))),new s(p())]};async function Vt(t){let{aptosConfig:o,creator:n,name:e,digitalAssetAddress:r,digitalAssetType:i,options:a}=t;return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::set_name",typeArguments:[i??m],functionArguments:[u.from(r),new c(e)],abi:H},options:a})}var J={typeParameters:[{constraints:["key"]}],parameters:[new s(g(new A(0))),new s(p())]};async function Mt(t){let{aptosConfig:o,creator:n,uri:e,digitalAssetAddress:r,digitalAssetType:i,options:a}=t;return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::set_uri",typeArguments:[i??m],functionArguments:[u.from(r),new c(e)],abi:J},options:a})}var W={typeParameters:[{constraints:["key"]}],parameters:[new s(g(new A(0))),new s(p()),new s(p()),f.u8()]};async function Rt(t){let{aptosConfig:o,creator:n,propertyKey:e,propertyType:r,propertyValue:i,digitalAssetAddress:a,digitalAssetType:l,options:y}=t;return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::add_property",typeArguments:[l??m],functionArguments:[u.from(a),new c(e),new c(C[r]),I.U8(B(i,C[r]))],abi:W},options:y})}var Z={typeParameters:[{constraints:["key"]}],parameters:[new s(g(new A(0))),new s(p())]};async function Kt(t){let{aptosConfig:o,creator:n,propertyKey:e,digitalAssetAddress:r,digitalAssetType:i,options:a}=t;return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::remove_property",typeArguments:[i??m],functionArguments:[u.from(r),new c(e)],abi:Z},options:a})}var $={typeParameters:[{constraints:["key"]}],parameters:[new s(g(new A(0))),new s(p()),new s(p()),f.u8()]};async function Qt(t){let{aptosConfig:o,creator:n,propertyKey:e,propertyType:r,propertyValue:i,digitalAssetAddress:a,digitalAssetType:l,options:y}=t;return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::update_property",typeArguments:[l??m],functionArguments:[u.from(a),new c(e),new c(C[r]),B(i,C[r])],abi:$},options:y})}var tt={typeParameters:[{constraints:["key"]},{constraints:[]}],parameters:[new s(g(new A(0))),new s(p()),new A(1)]};async function Ut(t){let{aptosConfig:o,creator:n,propertyKey:e,propertyType:r,propertyValue:i,digitalAssetAddress:a,digitalAssetType:l,options:y}=t;return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::add_typed_property",typeArguments:[l??m,C[r]],functionArguments:[u.from(a),new c(e),i],abi:tt},options:y})}var et={typeParameters:[{constraints:["key"]},{constraints:[]}],parameters:[new s(g(new A(0))),new s(p()),new A(1)]};async function Ft(t){let{aptosConfig:o,creator:n,propertyKey:e,propertyType:r,propertyValue:i,digitalAssetAddress:a,digitalAssetType:l,options:y}=t;return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::update_typed_property",typeArguments:[l??m,C[r]],functionArguments:[u.from(a),new c(e),i],abi:et},options:y})}function R(t,o){let n=new Array;return o.forEach((e,r)=>{n.push(B(t[r],e))}),n}function B(t,o){let n=V(o);return M(t,n,0,[]).bcsToBytes()}export{It as a,_t as b,Pt as c,kt as d,Dt as e,U as f,St as g,vt as h,ht as i,xt as j,Gt as k,Bt as l,Ot as m,Et as n,qt as o,Vt as p,Mt as q,Rt as r,Kt as s,Qt as t,Ut as u,Ft as v};
2
+ //# sourceMappingURL=chunk-RC6B45PP.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as n}from"./chunk-B7X6PSE7.mjs";import{b as a}from"./chunk-QRS4DGP3.mjs";import{a as v}from"./chunk-36QXVFR5.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-U3YYSIIT.mjs.map
1
+ import{a as n}from"./chunk-WZSVQBPA.mjs";import{b as a}from"./chunk-UEI62FBQ.mjs";import{a as v}from"./chunk-4KMISR2H.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-S5AGI7RQ.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as d}from"./chunk-GHYE26Q5.mjs";import{a as R}from"./chunk-CJDEPZ4J.mjs";var l={400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",429:"Too Many Requests",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable"};async function c(s,p){let{url:n,method:a,body:i,contentType:u,params:t,overrides:e,originMethod:o}=s,r={...e?.HEADERS,"x-aptos-client":`aptos-typescript-sdk/${R}`,"content-type":u??"application/json","x-aptos-typescript-sdk-origin-method":o};return e?.AUTH_TOKEN&&(r.Authorization=`Bearer ${e?.AUTH_TOKEN}`),e?.API_KEY&&(r.Authorization=`Bearer ${e?.API_KEY}`),p.provider({url:n,method:a,body:i,params:t,headers:r,overrides:e})}async function w(s,p,n){let{url:a,path:i}=s,u=i?`${a}/${i}`:a,t=await c({...s,url:u},p.client),e={status:t.status,statusText:t.statusText,data:t.data,headers:t.headers,config:t.config,request:t.request,url:u};if(e.status===401)throw new d(s,e,`Error: ${e.data}`);if(n==="Indexer"){let r=e.data;if(r.errors)throw new d(s,e,`Indexer error: ${r.errors[0].message}`??`Indexer unhandled Error ${t.status} : ${t.statusText}`);e.data=r.data}if(e.status>=200&&e.status<300)return e;let o;throw e&&e.data&&"message"in e.data&&"error_code"in e.data?o=JSON.stringify(e.data):e.status in l?o=l[e.status]:o=`Unhandled Error ${e.status} : ${e.statusText}`,new d(s,e,`${n} error: ${o}`)}export{c as a,w as b};
2
- //# sourceMappingURL=chunk-2XK53QFA.mjs.map
1
+ import{a as d}from"./chunk-GHYE26Q5.mjs";import{a as R}from"./chunk-NYXLPBKE.mjs";var l={400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",429:"Too Many Requests",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable"};async function c(s,p){let{url:n,method:a,body:i,contentType:u,params:t,overrides:e,originMethod:o}=s,r={...e?.HEADERS,"x-aptos-client":`aptos-typescript-sdk/${R}`,"content-type":u??"application/json","x-aptos-typescript-sdk-origin-method":o};return e?.AUTH_TOKEN&&(r.Authorization=`Bearer ${e?.AUTH_TOKEN}`),e?.API_KEY&&(r.Authorization=`Bearer ${e?.API_KEY}`),p.provider({url:n,method:a,body:i,params:t,headers:r,overrides:e})}async function w(s,p,n){let{url:a,path:i}=s,u=i?`${a}/${i}`:a,t=await c({...s,url:u},p.client),e={status:t.status,statusText:t.statusText,data:t.data,headers:t.headers,config:t.config,request:t.request,url:u};if(e.status===401)throw new d(s,e,`Error: ${e.data}`);if(n==="Indexer"){let r=e.data;if(r.errors)throw new d(s,e,`Indexer error: ${r.errors[0].message}`??`Indexer unhandled Error ${t.status} : ${t.statusText}`);e.data=r.data}if(e.status>=200&&e.status<300)return e;let o;throw e&&e.data&&"message"in e.data&&"error_code"in e.data?o=JSON.stringify(e.data):e.status in l?o=l[e.status]:o=`Unhandled Error ${e.status} : ${e.statusText}`,new d(s,e,`${n} error: ${o}`)}export{c as a,w as b};
2
+ //# sourceMappingURL=chunk-T2WZWN6W.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as o,b as c}from"./chunk-U6Z4FNB7.mjs";import{a as l}from"./chunk-5WFN54GV.mjs";import{a as h,h as d}from"./chunk-EW3AR5V3.mjs";import{g as u}from"./chunk-AJU3EBVX.mjs";import g from"eventemitter3";var m="fulfilled",f=(n=>(n.TransactionSent="transactionSent",n.TransactionSendFailed="transactionSendFailed",n.TransactionExecuted="transactionExecuted",n.TransactionExecutionFailed="transactionExecutionFailed",n.ExecutionFinish="executionFinish",n))(f||{}),p=class extends g{constructor(t,e,a=30,n=100,i=10){super();this.taskQueue=new o;this.transactionsQueue=new o;this.outstandingTransactions=new o;this.sentTransactions=[];this.executedTransactions=[];this.aptosConfig=t,this.account=e,this.started=!1,this.accountSequnceNumber=new l(t,e,a,n,i)}async submitNextTransaction(){try{for(;;){let t=await this.accountSequnceNumber.nextSequenceNumber();if(t===null)return;let e=await this.generateNextTransaction(this.account,t);if(!e)return;let a=d({aptosConfig:this.aptosConfig,transaction:e,signer:this.account});await this.outstandingTransactions.enqueue([a,t])}}catch(t){if(t instanceof c)return;throw new Error(`Submit transaction failed for ${this.account.accountAddress.toString()} with error ${t}`)}}async processTransactions(){try{for(;;){let t=[],e=[],[a,n]=await this.outstandingTransactions.dequeue();for(t.push(a),e.push(n);!this.outstandingTransactions.isEmpty();)[a,n]=await this.outstandingTransactions.dequeue(),t.push(a),e.push(n);let i=await Promise.allSettled(t);for(let s=0;s<i.length&&s<e.length;s+=1){let r=i[s];n=e[s],r.status===m?(this.sentTransactions.push([r.value.hash,n,null]),this.emit("transactionSent",{message:`transaction hash ${r.value.hash} has been committed to chain`,transactionHash:r.value.hash}),await this.checkTransaction(r,n)):(this.sentTransactions.push([r.status,n,r.reason]),this.emit("transactionSendFailed",{message:`failed to commit transaction ${this.sentTransactions.length} with error ${r.reason}`,error:r.reason}))}this.emit("executionFinish",{message:`execute ${i.length} transactions finished`})}}catch(t){if(t instanceof c)return;throw new Error(`Process execution failed for ${this.account.accountAddress.toString()} with error ${t}`)}}async checkTransaction(t,e){try{let a=[];a.push(u({aptosConfig:this.aptosConfig,transactionHash:t.value.hash}));let n=await Promise.allSettled(a);for(let i=0;i<n.length;i+=1){let s=n[i];s.status===m?(this.executedTransactions.push([s.value.hash,e,null]),this.emit("transactionExecuted",{message:`transaction hash ${s.value.hash} has been executed on chain`,transactionHash:t.value.hash})):(this.executedTransactions.push([s.status,e,s.reason]),this.emit("transactionExecutionFailed",{message:`failed to execute transaction ${this.executedTransactions.length} with error ${s.reason}`,error:s.reason}))}}catch(a){throw new Error(`Check transaction failed for ${this.account.accountAddress.toString()} with error ${a}`)}}async push(t,e){this.transactionsQueue.enqueue([t,e])}async generateNextTransaction(t,e){if(this.transactionsQueue.isEmpty())return;let[a,n]=await this.transactionsQueue.dequeue();return h({aptosConfig:this.aptosConfig,sender:t.accountAddress,data:a,options:{...n,accountSequenceNumber:e}})}async run(){try{for(;!this.taskQueue.isCancelled();)await(await this.taskQueue.dequeue())()}catch(t){throw new Error(`Unable to start transaction batching: ${t}`)}}start(){if(this.started)throw new Error("worker has already started");this.started=!0,this.taskQueue.enqueue(()=>this.submitNextTransaction()),this.taskQueue.enqueue(()=>this.processTransactions()),this.run()}stop(){if(this.taskQueue.isCancelled())throw new Error("worker has already stopped");this.started=!1,this.taskQueue.cancel()}};export{m as a,f as b,p as c};
2
- //# sourceMappingURL=chunk-ECVKW776.mjs.map
1
+ import{a as o,b as c}from"./chunk-U6Z4FNB7.mjs";import{a as l}from"./chunk-FVN6MJTH.mjs";import{a as h,h as d}from"./chunk-V6J6AW5T.mjs";import{g as u}from"./chunk-R5NNAF5B.mjs";import g from"eventemitter3";var m="fulfilled",f=(n=>(n.TransactionSent="transactionSent",n.TransactionSendFailed="transactionSendFailed",n.TransactionExecuted="transactionExecuted",n.TransactionExecutionFailed="transactionExecutionFailed",n.ExecutionFinish="executionFinish",n))(f||{}),p=class extends g{constructor(t,e,a=30,n=100,i=10){super();this.taskQueue=new o;this.transactionsQueue=new o;this.outstandingTransactions=new o;this.sentTransactions=[];this.executedTransactions=[];this.aptosConfig=t,this.account=e,this.started=!1,this.accountSequnceNumber=new l(t,e,a,n,i)}async submitNextTransaction(){try{for(;;){let t=await this.accountSequnceNumber.nextSequenceNumber();if(t===null)return;let e=await this.generateNextTransaction(this.account,t);if(!e)return;let a=d({aptosConfig:this.aptosConfig,transaction:e,signer:this.account});await this.outstandingTransactions.enqueue([a,t])}}catch(t){if(t instanceof c)return;throw new Error(`Submit transaction failed for ${this.account.accountAddress.toString()} with error ${t}`)}}async processTransactions(){try{for(;;){let t=[],e=[],[a,n]=await this.outstandingTransactions.dequeue();for(t.push(a),e.push(n);!this.outstandingTransactions.isEmpty();)[a,n]=await this.outstandingTransactions.dequeue(),t.push(a),e.push(n);let i=await Promise.allSettled(t);for(let s=0;s<i.length&&s<e.length;s+=1){let r=i[s];n=e[s],r.status===m?(this.sentTransactions.push([r.value.hash,n,null]),this.emit("transactionSent",{message:`transaction hash ${r.value.hash} has been committed to chain`,transactionHash:r.value.hash}),await this.checkTransaction(r,n)):(this.sentTransactions.push([r.status,n,r.reason]),this.emit("transactionSendFailed",{message:`failed to commit transaction ${this.sentTransactions.length} with error ${r.reason}`,error:r.reason}))}this.emit("executionFinish",{message:`execute ${i.length} transactions finished`})}}catch(t){if(t instanceof c)return;throw new Error(`Process execution failed for ${this.account.accountAddress.toString()} with error ${t}`)}}async checkTransaction(t,e){try{let a=[];a.push(u({aptosConfig:this.aptosConfig,transactionHash:t.value.hash}));let n=await Promise.allSettled(a);for(let i=0;i<n.length;i+=1){let s=n[i];s.status===m?(this.executedTransactions.push([s.value.hash,e,null]),this.emit("transactionExecuted",{message:`transaction hash ${s.value.hash} has been executed on chain`,transactionHash:t.value.hash})):(this.executedTransactions.push([s.status,e,s.reason]),this.emit("transactionExecutionFailed",{message:`failed to execute transaction ${this.executedTransactions.length} with error ${s.reason}`,error:s.reason}))}}catch(a){throw new Error(`Check transaction failed for ${this.account.accountAddress.toString()} with error ${a}`)}}async push(t,e){this.transactionsQueue.enqueue([t,e])}async generateNextTransaction(t,e){if(this.transactionsQueue.isEmpty())return;let[a,n]=await this.transactionsQueue.dequeue();return h({aptosConfig:this.aptosConfig,sender:t.accountAddress,data:a,options:{...n,accountSequenceNumber:e}})}async run(){try{for(;!this.taskQueue.isCancelled();)await(await this.taskQueue.dequeue())()}catch(t){throw new Error(`Unable to start transaction batching: ${t}`)}}start(){if(this.started)throw new Error("worker has already started");this.started=!0,this.taskQueue.enqueue(()=>this.submitNextTransaction()),this.taskQueue.enqueue(()=>this.processTransactions()),this.run()}stop(){if(this.taskQueue.isCancelled())throw new Error("worker has already stopped");this.started=!1,this.taskQueue.cancel()}};export{m as a,f as b,p as c};
2
+ //# sourceMappingURL=chunk-TAVPFLW5.mjs.map
@@ -1,2 +1,2 @@
1
- import{b as o}from"./chunk-QRS4DGP3.mjs";import{a as u,b as r}from"./chunk-G56GPLTB.mjs";import{e as t}from"./chunk-SRDIYE3M.mjs";import{a as i}from"./chunk-36QXVFR5.mjs";var c=class extends i{constructor(e){super();this.accountAddress=o.ONE;this.moduleName=new r("account");this.structName=new r("RotationProofChallenge");this.sequenceNumber=new t(e.sequenceNumber),this.originator=e.originator,this.currentAuthKey=e.currentAuthKey,this.newPublicKey=u.U8(e.newPublicKey.toUint8Array())}serialize(e){e.serialize(this.accountAddress),e.serialize(this.moduleName),e.serialize(this.structName),e.serialize(this.sequenceNumber),e.serialize(this.originator),e.serialize(this.currentAuthKey),e.serialize(this.newPublicKey)}};export{c as a};
2
- //# sourceMappingURL=chunk-GM56MMNJ.mjs.map
1
+ import{a as u,b as r}from"./chunk-YJIRT3GJ.mjs";import{e as t}from"./chunk-5NSXEM3O.mjs";import{b as o}from"./chunk-UEI62FBQ.mjs";import{a as i}from"./chunk-4KMISR2H.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-TZCETTAW.mjs.map
@@ -1,2 +1,2 @@
1
- import{a}from"./chunk-36QXVFR5.mjs";import{a as i}from"./chunk-LG7RJQ57.mjs";import{bytesToHex as o,hexToBytes as l}from"@noble/hashes/utils";var h=(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))(h||{}),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(d){throw new i(`Hex characters are invalid: ${d?.message}`,"invalid_hex_chars")}return new r(n)}static from(t){return t instanceof r?t:t instanceof Uint8Array?new r(t):r.fromString(t)}static fromStrict(t){return t instanceof r?t:t instanceof Uint8Array?new r(t):r.fromStringStrict(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");var c=r;export{h as a,c as b};
2
- //# sourceMappingURL=chunk-QRS4DGP3.mjs.map
1
+ import{a}from"./chunk-4KMISR2H.mjs";import{a as i}from"./chunk-LG7RJQ57.mjs";import{bytesToHex as o,hexToBytes as l}from"@noble/hashes/utils";var h=(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))(h||{}),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(d){throw new i(`Hex characters are invalid: ${d?.message}`,"invalid_hex_chars")}return new r(n)}static from(t){return t instanceof r?t:t instanceof Uint8Array?new r(t):r.fromString(t)}static fromStrict(t){return t instanceof r?t:t instanceof Uint8Array?new r(t):r.fromStringStrict(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");var c=r;export{h as a,c as b};
2
+ //# sourceMappingURL=chunk-UEI62FBQ.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as n}from"./chunk-M3YZNSJI.mjs";import{a as s,b as t,c as r,d as i,e as c,f as u,g as d,h as A,i as g,j as m,k as a,l as p,m as f,n as y,o as C,p as O,q as T}from"./chunk-BZCARW2P.mjs";import{e as o}from"./chunk-CYNQRMO5.mjs";var l=class{constructor(e){this.config=e}async getAccountInfo(e){return s({aptosConfig:this.config,...e})}async getAccountModules(e){return t({aptosConfig:this.config,...e})}async getAccountModule(e){return r({aptosConfig:this.config,...e})}async getAccountTransactions(e){return i({aptosConfig:this.config,...e})}async getAccountResources(e){return c({aptosConfig:this.config,...e})}async getAccountResource(e){return u({aptosConfig:this.config,...e})}async lookupOriginalAccountAddress(e){return d({aptosConfig:this.config,...e})}async getAccountTokensCount(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"account_transactions_processor"}),A({aptosConfig:this.config,...e})}async getAccountOwnedTokens(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),g({aptosConfig:this.config,...e})}async getAccountOwnedTokensFromCollectionAddress(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),m({aptosConfig:this.config,...e})}async getAccountCollectionsWithOwnedTokens(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),a({aptosConfig:this.config,...e})}async getAccountTransactionsCount(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"account_transactions_processor"}),p({aptosConfig:this.config,...e})}async getAccountCoinsData(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"fungible_asset_processor"}),y({aptosConfig:this.config,...e})}async getAccountCoinsCount(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"fungible_asset_processor"}),C({aptosConfig:this.config,...e})}async getAccountAPTAmount(e){return this.getAccountCoinAmount({coinType:o,...e})}async getAccountCoinAmount(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"fungible_asset_processor"}),f({aptosConfig:this.config,...e})}async getAccountOwnedObjects(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"default_processor"}),O({aptosConfig:this.config,...e})}async deriveAccountFromPrivateKey(e){return T({aptosConfig:this.config,...e})}};export{l as a};
2
- //# sourceMappingURL=chunk-CWO2JAUL.mjs.map
1
+ import{a as n}from"./chunk-ZMXURV35.mjs";import{a as s,b as t,c as r,d as i,e as c,f as u,g as d,h as A,i as g,j as m,k as a,l as p,m as f,n as y,o as C,p as O,q as T}from"./chunk-MEXWNZY6.mjs";import{e as o}from"./chunk-CYNQRMO5.mjs";var l=class{constructor(e){this.config=e}async getAccountInfo(e){return s({aptosConfig:this.config,...e})}async getAccountModules(e){return t({aptosConfig:this.config,...e})}async getAccountModule(e){return r({aptosConfig:this.config,...e})}async getAccountTransactions(e){return i({aptosConfig:this.config,...e})}async getAccountResources(e){return c({aptosConfig:this.config,...e})}async getAccountResource(e){return u({aptosConfig:this.config,...e})}async lookupOriginalAccountAddress(e){return d({aptosConfig:this.config,...e})}async getAccountTokensCount(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"account_transactions_processor"}),A({aptosConfig:this.config,...e})}async getAccountOwnedTokens(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),g({aptosConfig:this.config,...e})}async getAccountOwnedTokensFromCollectionAddress(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),m({aptosConfig:this.config,...e})}async getAccountCollectionsWithOwnedTokens(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),a({aptosConfig:this.config,...e})}async getAccountTransactionsCount(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"account_transactions_processor"}),p({aptosConfig:this.config,...e})}async getAccountCoinsData(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"fungible_asset_processor"}),y({aptosConfig:this.config,...e})}async getAccountCoinsCount(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"fungible_asset_processor"}),C({aptosConfig:this.config,...e})}async getAccountAPTAmount(e){return this.getAccountCoinAmount({coinType:o,...e})}async getAccountCoinAmount(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"fungible_asset_processor"}),f({aptosConfig:this.config,...e})}async getAccountOwnedObjects(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"default_processor"}),O({aptosConfig:this.config,...e})}async deriveAccountFromPrivateKey(e){return T({aptosConfig:this.config,...e})}};export{l as a};
2
+ //# sourceMappingURL=chunk-UF5B4XMN.mjs.map
@@ -1,2 +1,2 @@
1
- import{g as e}from"./chunk-AJU3EBVX.mjs";import{d as c}from"./chunk-YMB2XW2O.mjs";import{d as r}from"./chunk-CYNQRMO5.mjs";import{b as s}from"./chunk-QRS4DGP3.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-64MINNG2.mjs.map
1
+ import{g as e}from"./chunk-R5NNAF5B.mjs";import{d as c}from"./chunk-XHEZAVN3.mjs";import{d as r}from"./chunk-CYNQRMO5.mjs";import{b as s}from"./chunk-UEI62FBQ.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-V367QLY3.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as i}from"./chunk-C4RK5AB6.mjs";import{a as b,b as g}from"./chunk-2O5VFH5O.mjs";import{a as h,c as p}from"./chunk-SGTNW5YI.mjs";import{b as a}from"./chunk-QRS4DGP3.mjs";import{a as y}from"./chunk-36QXVFR5.mjs";var n=class extends y{static deserialize(e){let r=e.deserializeUleb128AsU32();switch(r){case 0:return o.load(e);case 1:return d.load(e);case 2:return u.load(e);case 3:return l.load(e);case 4:return A.load(e);default:throw new Error(`Unknown variant index for TransactionAuthenticator: ${r}`)}}},o=class s extends n{constructor(e,r){super(),this.public_key=e,this.signature=r}serialize(e){e.serializeU32AsUleb128(0),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let r=h.deserialize(e),t=p.deserialize(e);return new s(r,t)}},d=class s extends n{constructor(e,r){super(),this.public_key=e,this.signature=r}serialize(e){e.serializeU32AsUleb128(1),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let r=b.deserialize(e),t=g.deserialize(e);return new s(r,t)}},u=class s extends n{constructor(e,r,t){super(),this.sender=e,this.secondary_signer_addresses=r,this.secondary_signers=t}serialize(e){e.serializeU32AsUleb128(2),this.sender.serialize(e),e.serializeVector(this.secondary_signer_addresses),e.serializeVector(this.secondary_signers)}static load(e){let r=i.deserialize(e),t=e.deserializeVector(a),c=e.deserializeVector(i);return new s(r,t,c)}},l=class s extends n{constructor(e,r,t,c){super(),this.sender=e,this.secondary_signer_addresses=r,this.secondary_signers=t,this.fee_payer=c}serialize(e){e.serializeU32AsUleb128(3),this.sender.serialize(e),e.serializeVector(this.secondary_signer_addresses),e.serializeVector(this.secondary_signers),this.fee_payer.address.serialize(e),this.fee_payer.authenticator.serialize(e)}static load(e){let r=i.deserialize(e),t=e.deserializeVector(a),c=e.deserializeVector(i),_=a.deserialize(e),z=i.deserialize(e),S={address:_,authenticator:z};return new s(r,t,c,S)}},A=class s extends n{constructor(e){super(),this.sender=e}serialize(e){e.serializeU32AsUleb128(4),this.sender.serialize(e)}static load(e){let r=i.deserialize(e);return new s(r)}};export{n as a,o as b,d as c,u as d,l as e,A as f};
2
- //# sourceMappingURL=chunk-6QJOCI5Y.mjs.map
1
+ import{a as i}from"./chunk-LGOZUIGE.mjs";import{a as b,b as g}from"./chunk-AR3GW64L.mjs";import{a as h,c as p}from"./chunk-CX4BEIQT.mjs";import{b as a}from"./chunk-UEI62FBQ.mjs";import{a as y}from"./chunk-4KMISR2H.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-V3DEJBS6.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as g,f as d,g as C,i as w}from"./chunk-MV6ORORF.mjs";import{a as I}from"./chunk-BZCARW2P.mjs";import{b as f}from"./chunk-YMB2XW2O.mjs";import{a as P}from"./chunk-J77BLQCV.mjs";import{d as l}from"./chunk-JFIAWBCK.mjs";import{a as T}from"./chunk-GM56MMNJ.mjs";import{c as A,m as s}from"./chunk-U3YYSIIT.mjs";import{b as p}from"./chunk-QRS4DGP3.mjs";import{a as r}from"./chunk-G56GPLTB.mjs";import{b as y}from"./chunk-SRDIYE3M.mjs";async function b(t){let a=await h(t);return x(t,a)}async function h(t){let{aptosConfig:a,data:n}=t,e,o;return"bytecode"in n?o=await g(n):"multisigAddress"in n?(e={aptosConfig:a,multisigAddress:n.multisigAddress,function:n.function,functionArguments:n.functionArguments,typeArguments:n.typeArguments,abi:n.abi},o=await g(e)):(e={aptosConfig:a,function:n.function,functionArguments:n.functionArguments,typeArguments:n.typeArguments,abi:n.abi},o=await g(e)),o}async function x(t,a){let{aptosConfig:n,sender:e,options:o}=t,i;if(D(t)&&(i=p.ZERO.toString()),G(t)){let{secondarySignerAddresses:c}=t;return d({aptosConfig:n,sender:e,payload:a,options:o,secondarySignerAddresses:c,feePayerAddress:i})}return d({aptosConfig:n,sender:e,payload:a,options:o,feePayerAddress:i})}function D(t){return t.withFeePayer===!0}function G(t){return"secondarySignerAddresses"in t}function Q(t){let{transaction:a}=t;return l(a)}function U(t){let{signer:a,transaction:n}=t;return a.signTransactionWithAuthenticator(n)}async function X(t){let{aptosConfig:a,transaction:n,signerPublicKey:e,secondarySignersPublicKeys:o,feePayerPublicKey:i,options:c}=t,u=C({transaction:n,signerPublicKey:e,secondarySignersPublicKeys:o,feePayerPublicKey:i,options:c}),{data:m}=await f({aptosConfig:a,body:u,path:"transactions/simulate",params:{estimate_gas_unit_price:t.options?.estimateGasUnitPrice??!1,estimate_max_gas_amount:t.options?.estimateMaxGasAmount??!1,estimate_prioritized_gas_unit_price:t.options?.estimatePrioritizedGasUnitPrice??!1},originMethod:"simulateTransaction",contentType:"application/x.aptos.signed_transaction+bcs"});return m}async function _(t){let{aptosConfig:a}=t,n=w({...t}),{data:e}=await f({aptosConfig:a,body:n,path:"transactions",originMethod:"submitTransaction",contentType:"application/x.aptos.signed_transaction+bcs"});return e}async function K(t){let{aptosConfig:a,signer:n,transaction:e}=t,o=U({signer:n,transaction:e});return _({aptosConfig:a,transaction:e,senderAuthenticator:o})}var B={typeParameters:[],parameters:[s.u8(),new s(s.u8())]};async function Y(t){let{aptosConfig:a,account:n,metadataBytes:e,moduleBytecode:o,options:i}=t,c=o.map(u=>r.U8(u));return b({aptosConfig:a,sender:p.from(n),data:{function:"0x1::code::publish_package_txn",functionArguments:[r.U8(e),new r(c)],abi:B},options:i})}var M={typeParameters:[],parameters:[new A,s.u8(),new A,s.u8(),s.u8(),s.u8()]};async function $(t){let{aptosConfig:a,fromAccount:n,toNewPrivateKey:e}=t,o=await I({aptosConfig:a,accountAddress:n.accountAddress}),i=P.fromPrivateKey({privateKey:e,legacy:!0}),u=new T({sequenceNumber:BigInt(o.sequence_number),originator:n.accountAddress,currentAuthKey:p.from(o.authentication_key),newPublicKey:i.publicKey}).bcsToBytes(),m=n.sign(u),S=i.sign(u),R=await b({aptosConfig:a,sender:n.accountAddress,data:{function:"0x1::account::rotate_authentication_key",functionArguments:[new y(n.signingScheme),r.U8(n.publicKey.toUint8Array()),new y(i.signingScheme),r.U8(i.publicKey.toUint8Array()),r.U8(m.toUint8Array()),r.U8(S.toUint8Array())],abi:M}});return K({aptosConfig:a,signer:n,transaction:R})}export{b as a,h as b,x as c,Q as d,U as e,X as f,_ as g,K as h,Y as i,$ as j};
2
- //# sourceMappingURL=chunk-EW3AR5V3.mjs.map
1
+ import{a as g,f as d,g as C,i as w}from"./chunk-FWPK5KC2.mjs";import{a as I}from"./chunk-MEXWNZY6.mjs";import{b as f}from"./chunk-XHEZAVN3.mjs";import{a as P}from"./chunk-43HKFNUB.mjs";import{d as l}from"./chunk-XXBMHWNV.mjs";import{a as T}from"./chunk-TZCETTAW.mjs";import{c as A,m as s}from"./chunk-S5AGI7RQ.mjs";import{a as r}from"./chunk-YJIRT3GJ.mjs";import{b as y}from"./chunk-5NSXEM3O.mjs";import{b as p}from"./chunk-UEI62FBQ.mjs";async function b(t){let a=await h(t);return x(t,a)}async function h(t){let{aptosConfig:a,data:n}=t,e,o;return"bytecode"in n?o=await g(n):"multisigAddress"in n?(e={aptosConfig:a,multisigAddress:n.multisigAddress,function:n.function,functionArguments:n.functionArguments,typeArguments:n.typeArguments,abi:n.abi},o=await g(e)):(e={aptosConfig:a,function:n.function,functionArguments:n.functionArguments,typeArguments:n.typeArguments,abi:n.abi},o=await g(e)),o}async function x(t,a){let{aptosConfig:n,sender:e,options:o}=t,i;if(D(t)&&(i=p.ZERO.toString()),G(t)){let{secondarySignerAddresses:c}=t;return d({aptosConfig:n,sender:e,payload:a,options:o,secondarySignerAddresses:c,feePayerAddress:i})}return d({aptosConfig:n,sender:e,payload:a,options:o,feePayerAddress:i})}function D(t){return t.withFeePayer===!0}function G(t){return"secondarySignerAddresses"in t}function Q(t){let{transaction:a}=t;return l(a)}function U(t){let{signer:a,transaction:n}=t;return a.signTransactionWithAuthenticator(n)}async function X(t){let{aptosConfig:a,transaction:n,signerPublicKey:e,secondarySignersPublicKeys:o,feePayerPublicKey:i,options:c}=t,u=C({transaction:n,signerPublicKey:e,secondarySignersPublicKeys:o,feePayerPublicKey:i,options:c}),{data:m}=await f({aptosConfig:a,body:u,path:"transactions/simulate",params:{estimate_gas_unit_price:t.options?.estimateGasUnitPrice??!1,estimate_max_gas_amount:t.options?.estimateMaxGasAmount??!1,estimate_prioritized_gas_unit_price:t.options?.estimatePrioritizedGasUnitPrice??!1},originMethod:"simulateTransaction",contentType:"application/x.aptos.signed_transaction+bcs"});return m}async function _(t){let{aptosConfig:a}=t,n=w({...t}),{data:e}=await f({aptosConfig:a,body:n,path:"transactions",originMethod:"submitTransaction",contentType:"application/x.aptos.signed_transaction+bcs"});return e}async function K(t){let{aptosConfig:a,signer:n,transaction:e}=t,o=U({signer:n,transaction:e});return _({aptosConfig:a,transaction:e,senderAuthenticator:o})}var B={typeParameters:[],parameters:[s.u8(),new s(s.u8())]};async function Y(t){let{aptosConfig:a,account:n,metadataBytes:e,moduleBytecode:o,options:i}=t,c=o.map(u=>r.U8(u));return b({aptosConfig:a,sender:p.from(n),data:{function:"0x1::code::publish_package_txn",functionArguments:[r.U8(e),new r(c)],abi:B},options:i})}var M={typeParameters:[],parameters:[new A,s.u8(),new A,s.u8(),s.u8(),s.u8()]};async function $(t){let{aptosConfig:a,fromAccount:n,toNewPrivateKey:e}=t,o=await I({aptosConfig:a,accountAddress:n.accountAddress}),i=P.fromPrivateKey({privateKey:e,legacy:!0}),u=new T({sequenceNumber:BigInt(o.sequence_number),originator:n.accountAddress,currentAuthKey:p.from(o.authentication_key),newPublicKey:i.publicKey}).bcsToBytes(),m=n.sign(u),S=i.sign(u),R=await b({aptosConfig:a,sender:n.accountAddress,data:{function:"0x1::account::rotate_authentication_key",functionArguments:[new y(n.signingScheme),r.U8(n.publicKey.toUint8Array()),new y(i.signingScheme),r.U8(i.publicKey.toUint8Array()),r.U8(m.toUint8Array()),r.U8(S.toUint8Array())],abi:M}});return K({aptosConfig:a,signer:n,transaction:R})}export{b as a,h as b,x as c,Q as d,U as e,X as f,_ as g,K as h,Y as i,$ as j};
2
+ //# sourceMappingURL=chunk-V6J6AW5T.mjs.map