@aptos-labs/ts-sdk 0.0.6 → 0.0.8

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 (439) hide show
  1. package/README.md +26 -5
  2. package/dist/browser/index.d.ts +1097 -519
  3. package/dist/browser/index.global.js +49 -28
  4. package/dist/browser/index.global.js.map +1 -1
  5. package/dist/common/index.d.ts +1097 -519
  6. package/dist/common/index.js +48 -27
  7. package/dist/common/index.js.map +1 -1
  8. package/dist/esm/api/account.d.mts +72 -47
  9. package/dist/esm/api/account.mjs +1 -1
  10. package/dist/esm/api/ans.d.mts +214 -18
  11. package/dist/esm/api/ans.mjs +1 -1
  12. package/dist/esm/api/aptos.d.mts +9 -0
  13. package/dist/esm/api/aptos.mjs +1 -1
  14. package/dist/esm/api/aptosConfig.d.mts +2 -2
  15. package/dist/esm/api/aptosConfig.mjs +1 -1
  16. package/dist/esm/api/coin.d.mts +6 -5
  17. package/dist/esm/api/coin.mjs +1 -1
  18. package/dist/esm/api/digitalAsset.d.mts +24 -21
  19. package/dist/esm/api/digitalAsset.mjs +1 -1
  20. package/dist/esm/api/event.d.mts +12 -14
  21. package/dist/esm/api/event.mjs +1 -1
  22. package/dist/esm/api/faucet.d.mts +4 -4
  23. package/dist/esm/api/faucet.mjs +1 -1
  24. package/dist/esm/api/fungibleAsset.d.mts +71 -30
  25. package/dist/esm/api/fungibleAsset.mjs +1 -1
  26. package/dist/esm/api/general.d.mts +12 -5
  27. package/dist/esm/api/general.mjs +1 -1
  28. package/dist/esm/api/index.d.mts +5 -0
  29. package/dist/esm/api/index.mjs +1 -1
  30. package/dist/esm/api/staking.d.mts +13 -9
  31. package/dist/esm/api/staking.mjs +1 -1
  32. package/dist/esm/api/transaction.d.mts +36 -2
  33. package/dist/esm/api/transaction.mjs +1 -1
  34. package/dist/esm/api/transactionSubmission/build.d.mts +54 -0
  35. package/dist/esm/api/transactionSubmission/build.mjs +2 -0
  36. package/dist/esm/api/transactionSubmission/sign.d.mts +51 -0
  37. package/dist/esm/api/transactionSubmission/sign.mjs +2 -0
  38. package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -0
  39. package/dist/esm/api/transactionSubmission/simulate.d.mts +54 -0
  40. package/dist/esm/api/transactionSubmission/simulate.mjs +2 -0
  41. package/dist/esm/api/transactionSubmission/simulate.mjs.map +1 -0
  42. package/dist/esm/api/transactionSubmission/submit.d.mts +52 -0
  43. package/dist/esm/api/transactionSubmission/submit.mjs +2 -0
  44. package/dist/esm/api/transactionSubmission/submit.mjs.map +1 -0
  45. package/dist/esm/api/transactionSubmission.d.mts +25 -54
  46. package/dist/esm/api/transactionSubmission.mjs +1 -1
  47. package/dist/esm/api/utils.d.mts +21 -0
  48. package/dist/esm/api/utils.mjs +2 -0
  49. package/dist/esm/api/utils.mjs.map +1 -0
  50. package/dist/esm/bcs/deserializer.d.mts +4 -4
  51. package/dist/esm/bcs/deserializer.mjs +1 -1
  52. package/dist/esm/bcs/index.mjs +1 -1
  53. package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -1
  54. package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -1
  55. package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
  56. package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
  57. package/dist/esm/bcs/serializer.d.mts +4 -4
  58. package/dist/esm/bcs/serializer.mjs +1 -1
  59. package/dist/esm/{chunk-UAAI3NCA.mjs → chunk-2SAKPC5Q.mjs} +2 -2
  60. package/dist/esm/chunk-2YQXX64E.mjs +2 -0
  61. package/dist/esm/chunk-2YQXX64E.mjs.map +1 -0
  62. package/dist/esm/chunk-3F5WV6US.mjs +2 -0
  63. package/dist/esm/chunk-3F5WV6US.mjs.map +1 -0
  64. package/dist/esm/{chunk-ARVSIDVB.mjs → chunk-3RMXGSHK.mjs} +2 -2
  65. package/dist/esm/chunk-3RMXGSHK.mjs.map +1 -0
  66. package/dist/esm/{chunk-4ADA5BE7.mjs → chunk-53DS6NBQ.mjs} +2 -2
  67. package/dist/esm/chunk-5CUNY7X2.mjs +2 -0
  68. package/dist/esm/chunk-5CUNY7X2.mjs.map +1 -0
  69. package/dist/esm/{chunk-QWVR4RCV.mjs → chunk-5OPOJ43H.mjs} +2 -2
  70. package/dist/esm/{chunk-V45RFKH7.mjs → chunk-5UY5OKXR.mjs} +2 -2
  71. package/dist/esm/chunk-5UY5OKXR.mjs.map +1 -0
  72. package/dist/esm/chunk-5ZVCSKFX.mjs +2 -0
  73. package/dist/esm/chunk-5ZVCSKFX.mjs.map +1 -0
  74. package/dist/esm/{chunk-HVADSXTB.mjs → chunk-73VWOS4Z.mjs} +2 -2
  75. package/dist/esm/chunk-ALFESCPU.mjs +2 -0
  76. package/dist/esm/chunk-ALFESCPU.mjs.map +1 -0
  77. package/dist/esm/chunk-APSQ4M23.mjs +2 -0
  78. package/dist/esm/chunk-APSQ4M23.mjs.map +1 -0
  79. package/dist/esm/{chunk-U25N2VWA.mjs → chunk-AZUWHKN5.mjs} +2 -2
  80. package/dist/esm/{chunk-WX43AJTD.mjs → chunk-BQSE5HHW.mjs} +45 -24
  81. package/dist/esm/chunk-BQSE5HHW.mjs.map +1 -0
  82. package/dist/esm/chunk-CCXMVVXD.mjs +2 -0
  83. package/dist/esm/chunk-CCXMVVXD.mjs.map +1 -0
  84. package/dist/esm/{chunk-JZNLZMUC.mjs → chunk-CJPCOS4R.mjs} +2 -2
  85. package/dist/esm/{chunk-S36IYY6K.mjs → chunk-CL5B2QNS.mjs} +2 -2
  86. package/dist/esm/chunk-CLJLQXFQ.mjs +2 -0
  87. package/dist/esm/chunk-CLJLQXFQ.mjs.map +1 -0
  88. package/dist/esm/{chunk-EWTHPMEE.mjs → chunk-CU2DINU4.mjs} +2 -2
  89. package/dist/esm/chunk-EFRFDFS4.mjs +2 -0
  90. package/dist/esm/chunk-EFRFDFS4.mjs.map +1 -0
  91. package/dist/esm/chunk-EOC4UI5B.mjs +2 -0
  92. package/dist/esm/{chunk-KC64ESLO.mjs.map → chunk-EOC4UI5B.mjs.map} +1 -1
  93. package/dist/esm/{chunk-HA6JD5R6.mjs → chunk-F6K26WV5.mjs} +2 -2
  94. package/dist/esm/{chunk-HA6JD5R6.mjs.map → chunk-F6K26WV5.mjs.map} +1 -1
  95. package/dist/esm/chunk-F7EWDYTE.mjs +2 -0
  96. package/dist/esm/chunk-F7EWDYTE.mjs.map +1 -0
  97. package/dist/esm/{chunk-44MGBJ73.mjs → chunk-FZ56IS3E.mjs} +2 -2
  98. package/dist/esm/chunk-G36AY4R7.mjs +2 -0
  99. package/dist/esm/chunk-G36AY4R7.mjs.map +1 -0
  100. package/dist/esm/chunk-GEZSEAL5.mjs +2 -0
  101. package/dist/esm/chunk-GEZSEAL5.mjs.map +1 -0
  102. package/dist/esm/chunk-GIZLK7M7.mjs +2 -0
  103. package/dist/esm/chunk-GIZLK7M7.mjs.map +1 -0
  104. package/dist/esm/chunk-GMG4VR3K.mjs +2 -0
  105. package/dist/esm/chunk-GMG4VR3K.mjs.map +1 -0
  106. package/dist/esm/{chunk-U6SZNNVL.mjs → chunk-GXPGRCSW.mjs} +2 -2
  107. package/dist/esm/{chunk-U6SZNNVL.mjs.map → chunk-GXPGRCSW.mjs.map} +1 -1
  108. package/dist/esm/{chunk-GEFQFRL3.mjs → chunk-HC5VMNXA.mjs} +2 -2
  109. package/dist/esm/chunk-HTI5LEST.mjs +2 -0
  110. package/dist/esm/chunk-HTI5LEST.mjs.map +1 -0
  111. package/dist/esm/chunk-IELTCGLP.mjs +2 -0
  112. package/dist/esm/chunk-IELTCGLP.mjs.map +1 -0
  113. package/dist/esm/chunk-IHYTP2EW.mjs +1 -0
  114. package/dist/esm/chunk-IHYTP2EW.mjs.map +1 -0
  115. package/dist/esm/chunk-JI2BBZ2W.mjs +2 -0
  116. package/dist/esm/{chunk-3JVGSFHP.mjs.map → chunk-JI2BBZ2W.mjs.map} +1 -1
  117. package/dist/esm/chunk-KKER5KL4.mjs +2 -0
  118. package/dist/esm/chunk-KKER5KL4.mjs.map +1 -0
  119. package/dist/esm/chunk-KNMWDGP4.mjs +2 -0
  120. package/dist/esm/chunk-KNMWDGP4.mjs.map +1 -0
  121. package/dist/esm/{chunk-YYRDFZE6.mjs → chunk-KZSJ5MFF.mjs} +2 -2
  122. package/dist/esm/{chunk-YYRDFZE6.mjs.map → chunk-KZSJ5MFF.mjs.map} +1 -1
  123. package/dist/esm/chunk-MWAMLQ25.mjs +2 -0
  124. package/dist/esm/chunk-MWAMLQ25.mjs.map +1 -0
  125. package/dist/esm/chunk-NL72WE3E.mjs +2 -0
  126. package/dist/esm/{chunk-TIH6ARYP.mjs.map → chunk-NL72WE3E.mjs.map} +1 -1
  127. package/dist/esm/chunk-NZSGGL25.mjs +2 -0
  128. package/dist/esm/chunk-NZSGGL25.mjs.map +1 -0
  129. package/dist/esm/chunk-OBOOY2QD.mjs +2 -0
  130. package/dist/esm/chunk-OBOOY2QD.mjs.map +1 -0
  131. package/dist/esm/chunk-OT2UDMUU.mjs +2 -0
  132. package/dist/esm/chunk-OT2UDMUU.mjs.map +1 -0
  133. package/dist/esm/chunk-OZZDXS26.mjs +2 -0
  134. package/dist/esm/chunk-OZZDXS26.mjs.map +1 -0
  135. package/dist/esm/chunk-P5747ZYC.mjs +2 -0
  136. package/dist/esm/chunk-P5747ZYC.mjs.map +1 -0
  137. package/dist/esm/{chunk-BPYLPPEQ.mjs → chunk-PL2VA73L.mjs} +2 -2
  138. package/dist/esm/chunk-PXTMLJKO.mjs +2 -0
  139. package/dist/esm/{chunk-JDS7K2WI.mjs → chunk-QCBIJCU4.mjs} +2 -2
  140. package/dist/esm/chunk-QEXAMHPU.mjs +2 -0
  141. package/dist/esm/chunk-QEXAMHPU.mjs.map +1 -0
  142. package/dist/esm/{chunk-KQXRH5FK.mjs → chunk-QNTV5NMH.mjs} +2 -2
  143. package/dist/esm/{chunk-EQ5BEDJ7.mjs → chunk-RCM3K5JL.mjs} +2 -2
  144. package/dist/esm/chunk-RLG3WOTH.mjs +2 -0
  145. package/dist/esm/chunk-RLG3WOTH.mjs.map +1 -0
  146. package/dist/esm/chunk-SDPICQ5B.mjs +2 -0
  147. package/dist/esm/{chunk-FYIFBLHU.mjs.map → chunk-SDPICQ5B.mjs.map} +1 -1
  148. package/dist/esm/chunk-SGTFMSOG.mjs +2 -0
  149. package/dist/esm/chunk-SGTFMSOG.mjs.map +1 -0
  150. package/dist/esm/chunk-SO6EE5DX.mjs +2 -0
  151. package/dist/esm/chunk-SO6EE5DX.mjs.map +1 -0
  152. package/dist/esm/chunk-SRGPSANH.mjs +2 -0
  153. package/dist/esm/chunk-SRGPSANH.mjs.map +1 -0
  154. package/dist/esm/{chunk-UPLWWSB4.mjs → chunk-SSJQOXEP.mjs} +2 -2
  155. package/dist/esm/chunk-TZ623H2V.mjs +2 -0
  156. package/dist/esm/chunk-TZ623H2V.mjs.map +1 -0
  157. package/dist/esm/chunk-U6Z4FNB7.mjs +2 -0
  158. package/dist/esm/chunk-U6Z4FNB7.mjs.map +1 -0
  159. package/dist/esm/{chunk-GTC7WHMV.mjs → chunk-UDMADMVO.mjs} +1 -1
  160. package/dist/esm/{chunk-GTC7WHMV.mjs.map → chunk-UDMADMVO.mjs.map} +1 -1
  161. package/dist/esm/chunk-UIVJXLRM.mjs +1 -0
  162. package/dist/esm/chunk-UIVJXLRM.mjs.map +1 -0
  163. package/dist/esm/chunk-UKSA4H2O.mjs +2 -0
  164. package/dist/esm/chunk-UKSA4H2O.mjs.map +1 -0
  165. package/dist/esm/chunk-UW6HQ643.mjs +2 -0
  166. package/dist/esm/chunk-UW6HQ643.mjs.map +1 -0
  167. package/dist/esm/chunk-UWXDXOFK.mjs +2 -0
  168. package/dist/esm/chunk-UWXDXOFK.mjs.map +1 -0
  169. package/dist/esm/chunk-VQ7LYNMD.mjs +2 -0
  170. package/dist/esm/chunk-VQ7LYNMD.mjs.map +1 -0
  171. package/dist/esm/{chunk-U3LO2FSJ.mjs → chunk-WTGGCH34.mjs} +2 -2
  172. package/dist/esm/{chunk-X32O46IB.mjs → chunk-XITLXPBK.mjs} +2 -2
  173. package/dist/esm/chunk-XMUUI6HG.mjs +2 -0
  174. package/dist/esm/{chunk-R3KWVOFG.mjs.map → chunk-XMUUI6HG.mjs.map} +1 -1
  175. package/dist/esm/chunk-XX2Z26FH.mjs +2 -0
  176. package/dist/esm/chunk-XX2Z26FH.mjs.map +1 -0
  177. package/dist/esm/chunk-Y6PVFMBS.mjs +2 -0
  178. package/dist/esm/chunk-Y6PVFMBS.mjs.map +1 -0
  179. package/dist/esm/{chunk-VWVEDCBM.mjs → chunk-YN6UIVFB.mjs} +2 -2
  180. package/dist/esm/chunk-ZFK7QD3B.mjs +2 -0
  181. package/dist/esm/chunk-ZFK7QD3B.mjs.map +1 -0
  182. package/dist/esm/chunk-ZJUDDSWN.mjs +2 -0
  183. package/dist/esm/chunk-ZJUDDSWN.mjs.map +1 -0
  184. package/dist/esm/client/core.mjs +1 -1
  185. package/dist/esm/client/get.d.mts +1 -1
  186. package/dist/esm/client/get.mjs +1 -1
  187. package/dist/esm/client/index.mjs +1 -1
  188. package/dist/esm/client/post.mjs +1 -1
  189. package/dist/esm/core/account.mjs +1 -1
  190. package/dist/esm/core/accountAddress.d.mts +9 -9
  191. package/dist/esm/core/accountAddress.mjs +1 -1
  192. package/dist/esm/core/authenticationKey.mjs +1 -1
  193. package/dist/esm/core/crypto/anyPublicKey.d.mts +5 -0
  194. package/dist/esm/core/crypto/anyPublicKey.mjs +1 -1
  195. package/dist/esm/core/crypto/anySignature.mjs +1 -1
  196. package/dist/esm/core/crypto/asymmetricCrypto.mjs +1 -1
  197. package/dist/esm/core/crypto/ed25519.d.mts +3 -0
  198. package/dist/esm/core/crypto/ed25519.mjs +1 -1
  199. package/dist/esm/core/crypto/index.d.mts +2 -2
  200. package/dist/esm/core/crypto/index.mjs +1 -1
  201. package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
  202. package/dist/esm/core/crypto/multiKey.d.mts +2 -0
  203. package/dist/esm/core/crypto/multiKey.mjs +1 -1
  204. package/dist/esm/core/crypto/secp256k1.d.mts +3 -0
  205. package/dist/esm/core/crypto/secp256k1.mjs +1 -1
  206. package/dist/esm/core/hex.mjs +1 -1
  207. package/dist/esm/core/index.d.mts +2 -2
  208. package/dist/esm/core/index.mjs +1 -1
  209. package/dist/esm/index.d.mts +17 -10
  210. package/dist/esm/index.mjs +1 -1
  211. package/dist/esm/internal/account.d.mts +20 -33
  212. package/dist/esm/internal/account.mjs +1 -1
  213. package/dist/esm/internal/ans.d.mts +78 -14
  214. package/dist/esm/internal/ans.mjs +1 -1
  215. package/dist/esm/internal/coin.d.mts +6 -5
  216. package/dist/esm/internal/coin.mjs +1 -1
  217. package/dist/esm/internal/digitalAsset.d.mts +12 -21
  218. package/dist/esm/internal/digitalAsset.mjs +1 -1
  219. package/dist/esm/internal/event.d.mts +5 -12
  220. package/dist/esm/internal/event.mjs +1 -1
  221. package/dist/esm/internal/faucet.d.mts +2 -2
  222. package/dist/esm/internal/faucet.mjs +1 -1
  223. package/dist/esm/internal/fungibleAsset.d.mts +40 -22
  224. package/dist/esm/internal/fungibleAsset.mjs +1 -1
  225. package/dist/esm/internal/general.d.mts +9 -5
  226. package/dist/esm/internal/general.mjs +1 -1
  227. package/dist/esm/internal/staking.d.mts +4 -6
  228. package/dist/esm/internal/staking.mjs +1 -1
  229. package/dist/esm/internal/transaction.d.mts +12 -4
  230. package/dist/esm/internal/transaction.mjs +1 -1
  231. package/dist/esm/internal/transactionSubmission.d.mts +29 -41
  232. package/dist/esm/internal/transactionSubmission.mjs +1 -1
  233. package/dist/esm/transactions/authenticator/account.d.mts +5 -0
  234. package/dist/esm/transactions/authenticator/account.mjs +1 -1
  235. package/dist/esm/transactions/authenticator/index.d.mts +1 -0
  236. package/dist/esm/transactions/authenticator/index.mjs +1 -1
  237. package/dist/esm/transactions/authenticator/transaction.d.mts +1 -0
  238. package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
  239. package/dist/esm/transactions/index.d.mts +5 -4
  240. package/dist/esm/transactions/index.mjs +1 -1
  241. package/dist/esm/transactions/instances/chainId.mjs +1 -1
  242. package/dist/esm/transactions/instances/identifier.mjs +1 -1
  243. package/dist/esm/transactions/instances/index.d.mts +1 -0
  244. package/dist/esm/transactions/instances/index.mjs +1 -1
  245. package/dist/esm/transactions/instances/moduleId.mjs +1 -1
  246. package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
  247. package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
  248. package/dist/esm/transactions/instances/signedTransaction.d.mts +1 -0
  249. package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
  250. package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
  251. package/dist/esm/transactions/management/accountSequenceNumber.d.mts +89 -0
  252. package/dist/esm/transactions/management/accountSequenceNumber.mjs +2 -0
  253. package/dist/esm/transactions/management/accountSequenceNumber.mjs.map +1 -0
  254. package/dist/esm/transactions/management/asyncQueue.d.mts +58 -0
  255. package/dist/esm/transactions/management/asyncQueue.mjs +2 -0
  256. package/dist/esm/transactions/management/asyncQueue.mjs.map +1 -0
  257. package/dist/esm/transactions/management/index.d.mts +36 -0
  258. package/dist/esm/transactions/management/index.mjs +2 -0
  259. package/dist/esm/transactions/management/index.mjs.map +1 -0
  260. package/dist/esm/transactions/management/transactionWorker.d.mts +135 -0
  261. package/dist/esm/transactions/management/transactionWorker.mjs +2 -0
  262. package/dist/esm/transactions/management/transactionWorker.mjs.map +1 -0
  263. package/dist/esm/transactions/transactionBuilder/helpers.d.mts +3 -1
  264. package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
  265. package/dist/esm/transactions/transactionBuilder/index.d.mts +4 -3
  266. package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
  267. package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +3 -1
  268. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
  269. package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +6 -8
  270. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
  271. package/dist/esm/transactions/typeTag/index.mjs +1 -1
  272. package/dist/esm/transactions/typeTag/parser.mjs +1 -1
  273. package/dist/esm/transactions/types.d.mts +18 -43
  274. package/dist/esm/types/generated/operations.d.mts +30 -4
  275. package/dist/esm/types/generated/queries.d.mts +8 -5
  276. package/dist/esm/types/generated/queries.mjs +1 -1
  277. package/dist/esm/types/index.d.mts +27 -9
  278. package/dist/esm/types/index.mjs +1 -1
  279. package/dist/esm/types/indexer.d.mts +3 -2
  280. package/dist/esm/utils/const.d.mts +18 -1
  281. package/dist/esm/utils/const.mjs +1 -1
  282. package/dist/esm/utils/index.d.mts +1 -1
  283. package/dist/esm/utils/index.mjs +1 -1
  284. package/dist/esm/version.d.mts +1 -1
  285. package/dist/esm/version.mjs +1 -1
  286. package/package.json +1 -1
  287. package/src/api/account.ts +150 -53
  288. package/src/api/ans.ts +252 -16
  289. package/src/api/aptos.ts +20 -0
  290. package/src/api/aptosConfig.ts +2 -2
  291. package/src/api/coin.ts +4 -8
  292. package/src/api/digitalAsset.ts +75 -25
  293. package/src/api/event.ts +28 -17
  294. package/src/api/faucet.ts +12 -9
  295. package/src/api/fungibleAsset.ts +76 -35
  296. package/src/api/general.ts +19 -3
  297. package/src/api/staking.ts +30 -11
  298. package/src/api/transaction.ts +16 -1
  299. package/src/api/transactionSubmission/build.ts +42 -0
  300. package/src/api/transactionSubmission/sign.ts +44 -0
  301. package/src/api/transactionSubmission/simulate.ts +56 -0
  302. package/src/api/transactionSubmission/submit.ts +53 -0
  303. package/src/api/transactionSubmission.ts +31 -128
  304. package/src/api/utils.ts +37 -0
  305. package/src/bcs/deserializer.ts +4 -4
  306. package/src/bcs/serializer.ts +4 -4
  307. package/src/client/core.ts +6 -4
  308. package/src/client/get.ts +7 -6
  309. package/src/core/accountAddress.ts +20 -22
  310. package/src/core/crypto/anyPublicKey.ts +12 -0
  311. package/src/core/crypto/ed25519.ts +13 -0
  312. package/src/core/crypto/index.ts +2 -0
  313. package/src/core/crypto/secp256k1.ts +12 -0
  314. package/src/core/hex.ts +5 -7
  315. package/src/index.ts +1 -0
  316. package/src/internal/account.ts +56 -50
  317. package/src/internal/ans.ts +423 -24
  318. package/src/internal/coin.ts +6 -8
  319. package/src/internal/digitalAsset.ts +15 -25
  320. package/src/internal/event.ts +7 -14
  321. package/src/internal/faucet.ts +10 -6
  322. package/src/internal/fungibleAsset.ts +36 -18
  323. package/src/internal/general.ts +30 -3
  324. package/src/internal/queries/ansTokenFragment.graphql +9 -0
  325. package/src/internal/queries/getNames.graphql +11 -0
  326. package/src/internal/queries/getNumberOfDelegatorsQuery.graphql +5 -5
  327. package/src/internal/queries/getProcessorStatus.graphql +2 -2
  328. package/src/internal/staking.ts +12 -14
  329. package/src/internal/transaction.ts +23 -26
  330. package/src/internal/transactionSubmission.ts +63 -25
  331. package/src/transactions/authenticator/account.ts +16 -0
  332. package/src/transactions/instances/moduleId.ts +1 -1
  333. package/src/transactions/management/accountSequenceNumber.ts +186 -0
  334. package/src/transactions/management/asyncQueue.ts +107 -0
  335. package/src/transactions/management/index.ts +2 -0
  336. package/src/transactions/management/transactionWorker.ts +275 -0
  337. package/src/transactions/transactionBuilder/helpers.ts +28 -1
  338. package/src/transactions/transactionBuilder/remoteAbi.ts +35 -28
  339. package/src/transactions/transactionBuilder/transactionBuilder.ts +46 -67
  340. package/src/transactions/typeTag/parser.ts +1 -1
  341. package/src/transactions/types.ts +16 -47
  342. package/src/types/generated/operations.ts +33 -2
  343. package/src/types/generated/queries.ts +38 -4
  344. package/src/types/index.ts +67 -11
  345. package/src/types/indexer.ts +3 -0
  346. package/src/utils/const.ts +18 -0
  347. package/src/version.ts +1 -1
  348. package/dist/esm/chunk-2W744GUN.mjs +0 -2
  349. package/dist/esm/chunk-2W744GUN.mjs.map +0 -1
  350. package/dist/esm/chunk-3JVGSFHP.mjs +0 -2
  351. package/dist/esm/chunk-4RVIA63I.mjs +0 -2
  352. package/dist/esm/chunk-4RVIA63I.mjs.map +0 -1
  353. package/dist/esm/chunk-62SCW5NH.mjs +0 -2
  354. package/dist/esm/chunk-62SCW5NH.mjs.map +0 -1
  355. package/dist/esm/chunk-7MNEEVXY.mjs +0 -2
  356. package/dist/esm/chunk-7MNEEVXY.mjs.map +0 -1
  357. package/dist/esm/chunk-AAIBCWZY.mjs +0 -2
  358. package/dist/esm/chunk-AAIBCWZY.mjs.map +0 -1
  359. package/dist/esm/chunk-ARVSIDVB.mjs.map +0 -1
  360. package/dist/esm/chunk-BFSEVKNA.mjs +0 -2
  361. package/dist/esm/chunk-BFSEVKNA.mjs.map +0 -1
  362. package/dist/esm/chunk-BP5ZO7NK.mjs +0 -2
  363. package/dist/esm/chunk-BP5ZO7NK.mjs.map +0 -1
  364. package/dist/esm/chunk-BV4OOU5Y.mjs +0 -2
  365. package/dist/esm/chunk-BV4OOU5Y.mjs.map +0 -1
  366. package/dist/esm/chunk-BWMNPUTK.mjs +0 -2
  367. package/dist/esm/chunk-BWMNPUTK.mjs.map +0 -1
  368. package/dist/esm/chunk-EFIYW4WK.mjs +0 -2
  369. package/dist/esm/chunk-EGOYLZBU.mjs +0 -2
  370. package/dist/esm/chunk-EGOYLZBU.mjs.map +0 -1
  371. package/dist/esm/chunk-EYXHVA6W.mjs +0 -2
  372. package/dist/esm/chunk-EYXHVA6W.mjs.map +0 -1
  373. package/dist/esm/chunk-FYIFBLHU.mjs +0 -2
  374. package/dist/esm/chunk-IG5CHHSI.mjs +0 -2
  375. package/dist/esm/chunk-IG5CHHSI.mjs.map +0 -1
  376. package/dist/esm/chunk-IXMB2GOK.mjs +0 -2
  377. package/dist/esm/chunk-IXMB2GOK.mjs.map +0 -1
  378. package/dist/esm/chunk-J5ZFOJN2.mjs +0 -2
  379. package/dist/esm/chunk-J5ZFOJN2.mjs.map +0 -1
  380. package/dist/esm/chunk-KC64ESLO.mjs +0 -2
  381. package/dist/esm/chunk-NGCFPQ22.mjs +0 -2
  382. package/dist/esm/chunk-NGCFPQ22.mjs.map +0 -1
  383. package/dist/esm/chunk-NTD3H2S4.mjs +0 -2
  384. package/dist/esm/chunk-NTD3H2S4.mjs.map +0 -1
  385. package/dist/esm/chunk-NYFVEKF6.mjs +0 -2
  386. package/dist/esm/chunk-NYFVEKF6.mjs.map +0 -1
  387. package/dist/esm/chunk-NZIJV4O2.mjs +0 -2
  388. package/dist/esm/chunk-NZIJV4O2.mjs.map +0 -1
  389. package/dist/esm/chunk-P32MY5YF.mjs +0 -2
  390. package/dist/esm/chunk-P32MY5YF.mjs.map +0 -1
  391. package/dist/esm/chunk-Q6N6QACD.mjs +0 -2
  392. package/dist/esm/chunk-Q6N6QACD.mjs.map +0 -1
  393. package/dist/esm/chunk-R26XML3D.mjs +0 -2
  394. package/dist/esm/chunk-R26XML3D.mjs.map +0 -1
  395. package/dist/esm/chunk-R3KWVOFG.mjs +0 -2
  396. package/dist/esm/chunk-RYETO74W.mjs +0 -2
  397. package/dist/esm/chunk-RYETO74W.mjs.map +0 -1
  398. package/dist/esm/chunk-TCTZCPQ6.mjs +0 -1
  399. package/dist/esm/chunk-TIH6ARYP.mjs +0 -2
  400. package/dist/esm/chunk-TQD4IGUM.mjs +0 -2
  401. package/dist/esm/chunk-TQD4IGUM.mjs.map +0 -1
  402. package/dist/esm/chunk-UNQNACJT.mjs +0 -2
  403. package/dist/esm/chunk-UNQNACJT.mjs.map +0 -1
  404. package/dist/esm/chunk-V45RFKH7.mjs.map +0 -1
  405. package/dist/esm/chunk-VMQWW5UT.mjs +0 -2
  406. package/dist/esm/chunk-VMQWW5UT.mjs.map +0 -1
  407. package/dist/esm/chunk-VOYW2TZW.mjs +0 -2
  408. package/dist/esm/chunk-VOYW2TZW.mjs.map +0 -1
  409. package/dist/esm/chunk-VYAVLUPJ.mjs +0 -2
  410. package/dist/esm/chunk-VYAVLUPJ.mjs.map +0 -1
  411. package/dist/esm/chunk-WKY5ENCK.mjs +0 -2
  412. package/dist/esm/chunk-WKY5ENCK.mjs.map +0 -1
  413. package/dist/esm/chunk-WX43AJTD.mjs.map +0 -1
  414. package/dist/esm/chunk-Y5DJPHJT.mjs +0 -2
  415. package/dist/esm/chunk-Y5DJPHJT.mjs.map +0 -1
  416. package/dist/esm/chunk-Y7VR7X5W.mjs +0 -2
  417. package/dist/esm/chunk-Y7VR7X5W.mjs.map +0 -1
  418. package/dist/esm/chunk-Z2UDRTHA.mjs +0 -2
  419. package/dist/esm/chunk-Z2UDRTHA.mjs.map +0 -1
  420. /package/dist/esm/{chunk-TCTZCPQ6.mjs.map → api/transactionSubmission/build.mjs.map} +0 -0
  421. /package/dist/esm/{chunk-UAAI3NCA.mjs.map → chunk-2SAKPC5Q.mjs.map} +0 -0
  422. /package/dist/esm/{chunk-4ADA5BE7.mjs.map → chunk-53DS6NBQ.mjs.map} +0 -0
  423. /package/dist/esm/{chunk-QWVR4RCV.mjs.map → chunk-5OPOJ43H.mjs.map} +0 -0
  424. /package/dist/esm/{chunk-HVADSXTB.mjs.map → chunk-73VWOS4Z.mjs.map} +0 -0
  425. /package/dist/esm/{chunk-U25N2VWA.mjs.map → chunk-AZUWHKN5.mjs.map} +0 -0
  426. /package/dist/esm/{chunk-JZNLZMUC.mjs.map → chunk-CJPCOS4R.mjs.map} +0 -0
  427. /package/dist/esm/{chunk-S36IYY6K.mjs.map → chunk-CL5B2QNS.mjs.map} +0 -0
  428. /package/dist/esm/{chunk-EWTHPMEE.mjs.map → chunk-CU2DINU4.mjs.map} +0 -0
  429. /package/dist/esm/{chunk-44MGBJ73.mjs.map → chunk-FZ56IS3E.mjs.map} +0 -0
  430. /package/dist/esm/{chunk-GEFQFRL3.mjs.map → chunk-HC5VMNXA.mjs.map} +0 -0
  431. /package/dist/esm/{chunk-BPYLPPEQ.mjs.map → chunk-PL2VA73L.mjs.map} +0 -0
  432. /package/dist/esm/{chunk-EFIYW4WK.mjs.map → chunk-PXTMLJKO.mjs.map} +0 -0
  433. /package/dist/esm/{chunk-JDS7K2WI.mjs.map → chunk-QCBIJCU4.mjs.map} +0 -0
  434. /package/dist/esm/{chunk-KQXRH5FK.mjs.map → chunk-QNTV5NMH.mjs.map} +0 -0
  435. /package/dist/esm/{chunk-EQ5BEDJ7.mjs.map → chunk-RCM3K5JL.mjs.map} +0 -0
  436. /package/dist/esm/{chunk-UPLWWSB4.mjs.map → chunk-SSJQOXEP.mjs.map} +0 -0
  437. /package/dist/esm/{chunk-U3LO2FSJ.mjs.map → chunk-WTGGCH34.mjs.map} +0 -0
  438. /package/dist/esm/{chunk-X32O46IB.mjs.map → chunk-XITLXPBK.mjs.map} +0 -0
  439. /package/dist/esm/{chunk-VWVEDCBM.mjs.map → chunk-YN6UIVFB.mjs.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{a,b,c,d,e,f,g}from"../../chunk-X32O46IB.mjs";import"../../chunk-HA6JD5R6.mjs";import"../../chunk-DNDWTM7A.mjs";import"../../chunk-TIH6ARYP.mjs";import"../../chunk-FBPNHF54.mjs";import"../../chunk-Y7VR7X5W.mjs";import"../../chunk-4WPQQPUF.mjs";import"../../chunk-ZWH2ESXT.mjs";export{a as Bool,f as U128,c as U16,g as U256,d as U32,e as U64,b as U8};
1
+ import{a,b,c,d,e,f,g}from"../../chunk-XITLXPBK.mjs";import"../../chunk-F6K26WV5.mjs";import"../../chunk-DNDWTM7A.mjs";import"../../chunk-NL72WE3E.mjs";import"../../chunk-FBPNHF54.mjs";import"../../chunk-ALFESCPU.mjs";import"../../chunk-4WPQQPUF.mjs";import"../../chunk-ZWH2ESXT.mjs";export{a as Bool,f as U128,c as U16,g as U256,d as U32,e as U64,b as U8};
2
2
  //# sourceMappingURL=movePrimitives.mjs.map
@@ -1,2 +1,2 @@
1
- import{a,b,c}from"../../chunk-4ADA5BE7.mjs";import"../../chunk-X32O46IB.mjs";import"../../chunk-HA6JD5R6.mjs";import"../../chunk-DNDWTM7A.mjs";import"../../chunk-TIH6ARYP.mjs";import"../../chunk-FBPNHF54.mjs";import"../../chunk-Y7VR7X5W.mjs";import"../../chunk-4WPQQPUF.mjs";import"../../chunk-ZWH2ESXT.mjs";export{c as MoveOption,b as MoveString,a as MoveVector};
1
+ import{a,b,c}from"../../chunk-53DS6NBQ.mjs";import"../../chunk-XITLXPBK.mjs";import"../../chunk-F6K26WV5.mjs";import"../../chunk-DNDWTM7A.mjs";import"../../chunk-NL72WE3E.mjs";import"../../chunk-FBPNHF54.mjs";import"../../chunk-ALFESCPU.mjs";import"../../chunk-4WPQQPUF.mjs";import"../../chunk-ZWH2ESXT.mjs";export{c as MoveOption,b as MoveString,a as MoveVector};
2
2
  //# sourceMappingURL=moveStructs.mjs.map
@@ -171,10 +171,10 @@ declare class Serializer {
171
171
  * @param values The array of BCS Serializable values
172
172
  * @example
173
173
  * const addresses = new Array<AccountAddress>(
174
- * AccountAddress.fromRelaxed("0x1"),
175
- * AccountAddress.fromRelaxed("0x2"),
176
- * AccountAddress.fromRelaxed("0xa"),
177
- * AccountAddress.fromRelaxed("0xb"),
174
+ * AccountAddress.from("0x1"),
175
+ * AccountAddress.from("0x2"),
176
+ * AccountAddress.from("0xa"),
177
+ * AccountAddress.from("0xb"),
178
178
  * );
179
179
  * const serializer = new Serializer();
180
180
  * serializer.serializeVector(addresses);
@@ -1,2 +1,2 @@
1
- import{a,b,c,d,e}from"../chunk-HA6JD5R6.mjs";import"../chunk-DNDWTM7A.mjs";import"../chunk-TIH6ARYP.mjs";import"../chunk-FBPNHF54.mjs";import"../chunk-ZWH2ESXT.mjs";export{a as Serializable,b as Serializer,c as ensureBoolean,d as outOfRangeErrorMessage,e as validateNumberInRange};
1
+ import{a,b,c,d,e}from"../chunk-F6K26WV5.mjs";import"../chunk-DNDWTM7A.mjs";import"../chunk-NL72WE3E.mjs";import"../chunk-FBPNHF54.mjs";import"../chunk-ZWH2ESXT.mjs";export{a as Serializable,b as Serializer,c as ensureBoolean,d as outOfRangeErrorMessage,e as validateNumberInRange};
2
2
  //# sourceMappingURL=serializer.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as o,b as r}from"./chunk-4ADA5BE7.mjs";import{e as u}from"./chunk-X32O46IB.mjs";import{b as t}from"./chunk-NZIJV4O2.mjs";import{a as i}from"./chunk-HA6JD5R6.mjs";var c=class extends i{constructor(e){super();this.accountAddress=t.ONE;this.moduleName=new r("account");this.structName=new r("RotationProofChallenge");this.sequenceNumber=new u(e.sequenceNumber),this.originator=e.originator,this.currentAuthKey=e.currentAuthKey,this.newPublicKey=o.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-UAAI3NCA.mjs.map
1
+ import{a as o,b as r}from"./chunk-53DS6NBQ.mjs";import{e as u}from"./chunk-XITLXPBK.mjs";import{b as t}from"./chunk-G36AY4R7.mjs";import{a as i}from"./chunk-F6K26WV5.mjs";var c=class extends i{constructor(e){super();this.accountAddress=t.ONE;this.moduleName=new r("account");this.structName=new r("RotationProofChallenge");this.sequenceNumber=new u(e.sequenceNumber),this.originator=e.originator,this.currentAuthKey=e.currentAuthKey,this.newPublicKey=o.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-2SAKPC5Q.mjs.map
@@ -0,0 +1,2 @@
1
+ import{a as d}from"./chunk-EFRFDFS4.mjs";import{a as y}from"./chunk-RLG3WOTH.mjs";import{a as b}from"./chunk-P5747ZYC.mjs";import{a as A}from"./chunk-ZFK7QD3B.mjs";import{a as c}from"./chunk-MWAMLQ25.mjs";import{a as g}from"./chunk-SRGPSANH.mjs";import{a as f}from"./chunk-QEXAMHPU.mjs";import{a as m}from"./chunk-VQ7LYNMD.mjs";import{a as u}from"./chunk-KNMWDGP4.mjs";import{a as h}from"./chunk-5ZVCSKFX.mjs";import{a as p}from"./chunk-XX2Z26FH.mjs";import{a as e}from"./chunk-NZSGGL25.mjs";import{a as l}from"./chunk-UWXDXOFK.mjs";import{a as S}from"./chunk-3RMXGSHK.mjs";import{a as r}from"./chunk-5UY5OKXR.mjs";import{a}from"./chunk-IELTCGLP.mjs";var i=class{constructor(n){this.config=new S(n),this.account=new e(this.config),this.ans=new l(this.config),this.coin=new r(this.config),this.digitalAsset=new a(this.config),this.event=new c(this.config),this.faucet=new g(this.config),this.fungibleAsset=new f(this.config),this.general=new m(this.config),this.staking=new u(this.config),this.transaction=new h(this.config),this.transactionSubmission=new p(this.config),this.build=new d(this.config),this.sign=new y(this.config),this.simulate=new b(this.config),this.submit=new A(this.config)}};function t(w,n,v){Object.getOwnPropertyNames(n.prototype).forEach(o=>{let s=Object.getOwnPropertyDescriptor(n.prototype,o);s&&(s.value=function(...k){return this[v][o](...k)},Object.defineProperty(w.prototype,o,s))})}t(i,e,"account");t(i,l,"ans");t(i,r,"coin");t(i,a,"digitalAsset");t(i,c,"event");t(i,g,"faucet");t(i,f,"fungibleAsset");t(i,m,"general");t(i,u,"staking");t(i,h,"transaction");t(i,p,"transactionSubmission");t(i,d,"build");t(i,y,"sign");t(i,b,"simulate");t(i,A,"submit");export{i as a};
2
+ //# sourceMappingURL=chunk-2YQXX64E.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/api/aptos.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Account } from \"./account\";\nimport { AptosConfig } from \"./aptosConfig\";\nimport { Coin } from \"./coin\";\nimport { DigitalAsset } from \"./digitalAsset\";\nimport { Event } from \"./event\";\nimport { Faucet } from \"./faucet\";\nimport { FungibleAsset } from \"./fungibleAsset\";\nimport { General } from \"./general\";\nimport { ANS } from \"./ans\";\nimport { Staking } from \"./staking\";\nimport { Transaction } from \"./transaction\";\nimport { TransactionSubmission } from \"./transactionSubmission\";\nimport { Build } from \"./transactionSubmission/build\";\nimport { Sign } from \"./transactionSubmission/sign\";\nimport { Simulate } from \"./transactionSubmission/simulate\";\nimport { Submit } from \"./transactionSubmission/submit\";\n\n/**\n * This class is the main entry point into Aptos's\n * APIs and separates functionality into different namespaces.\n *\n * To use the SDK, create a new Aptos instance to get access\n * to all the sdk functionality.\n */\nexport class Aptos {\n readonly config: AptosConfig;\n\n readonly account: Account;\n\n readonly ans: ANS;\n\n readonly coin: Coin;\n\n readonly digitalAsset: DigitalAsset;\n\n readonly event: Event;\n\n readonly faucet: Faucet;\n\n readonly fungibleAsset: FungibleAsset;\n\n readonly general: General;\n\n readonly staking: Staking;\n\n readonly transaction: Transaction;\n\n readonly transactionSubmission: TransactionSubmission;\n\n readonly build: Build;\n\n readonly sign: Sign;\n\n readonly simulate: Simulate;\n\n readonly submit: Submit;\n\n constructor(settings?: AptosConfig) {\n this.config = new AptosConfig(settings);\n this.account = new Account(this.config);\n this.ans = new ANS(this.config);\n this.coin = new Coin(this.config);\n this.digitalAsset = new DigitalAsset(this.config);\n this.event = new Event(this.config);\n this.faucet = new Faucet(this.config);\n this.fungibleAsset = new FungibleAsset(this.config);\n this.general = new General(this.config);\n this.staking = new Staking(this.config);\n this.transaction = new Transaction(this.config);\n this.transactionSubmission = new TransactionSubmission(this.config);\n this.build = new Build(this.config);\n this.sign = new Sign(this.config);\n this.simulate = new Simulate(this.config);\n this.submit = new Submit(this.config);\n }\n}\n\nexport interface Aptos\n extends Account,\n Coin,\n DigitalAsset,\n Event,\n Faucet,\n FungibleAsset,\n General,\n Staking,\n Transaction,\n ANS,\n TransactionSubmission {}\n\n/**\nIn TypeScript, we can’t inherit or extend from more than one class,\nMixins helps us to get around that by creating a partial classes\nthat we can combine to form a single class that contains all the methods and properties from the partial classes.\n{@link https://www.typescriptlang.org/docs/handbook/mixins.html#alternative-pattern}\n\nHere, we combine any subclass and the Aptos class.\n*/\nfunction applyMixin(targetClass: any, baseClass: any, baseClassProp: string) {\n // Mixin instance methods\n Object.getOwnPropertyNames(baseClass.prototype).forEach((propertyName) => {\n const propertyDescriptor = Object.getOwnPropertyDescriptor(baseClass.prototype, propertyName);\n if (!propertyDescriptor) return;\n // eslint-disable-next-line func-names\n propertyDescriptor.value = function (...args: any) {\n return (this as any)[baseClassProp][propertyName](...args);\n };\n Object.defineProperty(targetClass.prototype, propertyName, propertyDescriptor);\n });\n}\n\napplyMixin(Aptos, Account, \"account\");\napplyMixin(Aptos, ANS, \"ans\");\napplyMixin(Aptos, Coin, \"coin\");\napplyMixin(Aptos, DigitalAsset, \"digitalAsset\");\napplyMixin(Aptos, Event, \"event\");\napplyMixin(Aptos, Faucet, \"faucet\");\napplyMixin(Aptos, FungibleAsset, \"fungibleAsset\");\napplyMixin(Aptos, General, \"general\");\napplyMixin(Aptos, Staking, \"staking\");\napplyMixin(Aptos, Transaction, \"transaction\");\napplyMixin(Aptos, TransactionSubmission, \"transactionSubmission\");\napplyMixin(Aptos, Build, \"build\");\napplyMixin(Aptos, Sign, \"sign\");\napplyMixin(Aptos, Simulate, \"simulate\");\napplyMixin(Aptos, Submit, \"submit\");\n"],"mappings":"2oBA2BO,IAAMA,EAAN,KAAY,CAiCjB,YAAYC,EAAwB,CAClC,KAAK,OAAS,IAAIC,EAAYD,CAAQ,EACtC,KAAK,QAAU,IAAIE,EAAQ,KAAK,MAAM,EACtC,KAAK,IAAM,IAAIC,EAAI,KAAK,MAAM,EAC9B,KAAK,KAAO,IAAIC,EAAK,KAAK,MAAM,EAChC,KAAK,aAAe,IAAIC,EAAa,KAAK,MAAM,EAChD,KAAK,MAAQ,IAAIC,EAAM,KAAK,MAAM,EAClC,KAAK,OAAS,IAAIC,EAAO,KAAK,MAAM,EACpC,KAAK,cAAgB,IAAIC,EAAc,KAAK,MAAM,EAClD,KAAK,QAAU,IAAIC,EAAQ,KAAK,MAAM,EACtC,KAAK,QAAU,IAAIC,EAAQ,KAAK,MAAM,EACtC,KAAK,YAAc,IAAIC,EAAY,KAAK,MAAM,EAC9C,KAAK,sBAAwB,IAAIC,EAAsB,KAAK,MAAM,EAClE,KAAK,MAAQ,IAAIC,EAAM,KAAK,MAAM,EAClC,KAAK,KAAO,IAAIC,EAAK,KAAK,MAAM,EAChC,KAAK,SAAW,IAAIC,EAAS,KAAK,MAAM,EACxC,KAAK,OAAS,IAAIC,EAAO,KAAK,MAAM,CACtC,CACF,EAuBA,SAASC,EAAWC,EAAkBC,EAAgBC,EAAuB,CAE3E,OAAO,oBAAoBD,EAAU,SAAS,EAAE,QAASE,GAAiB,CACxE,IAAMC,EAAqB,OAAO,yBAAyBH,EAAU,UAAWE,CAAY,EACvFC,IAELA,EAAmB,MAAQ,YAAaC,EAAW,CACjD,OAAQ,KAAaH,CAAa,EAAEC,CAAY,EAAE,GAAGE,CAAI,CAC3D,EACA,OAAO,eAAeL,EAAY,UAAWG,EAAcC,CAAkB,EAC/E,CAAC,CACH,CAEAL,EAAWlB,EAAOG,EAAS,SAAS,EACpCe,EAAWlB,EAAOI,EAAK,KAAK,EAC5Bc,EAAWlB,EAAOK,EAAM,MAAM,EAC9Ba,EAAWlB,EAAOM,EAAc,cAAc,EAC9CY,EAAWlB,EAAOO,EAAO,OAAO,EAChCW,EAAWlB,EAAOQ,EAAQ,QAAQ,EAClCU,EAAWlB,EAAOS,EAAe,eAAe,EAChDS,EAAWlB,EAAOU,EAAS,SAAS,EACpCQ,EAAWlB,EAAOW,EAAS,SAAS,EACpCO,EAAWlB,EAAOY,EAAa,aAAa,EAC5CM,EAAWlB,EAAOa,EAAuB,uBAAuB,EAChEK,EAAWlB,EAAOc,EAAO,OAAO,EAChCI,EAAWlB,EAAOe,EAAM,MAAM,EAC9BG,EAAWlB,EAAOgB,EAAU,UAAU,EACtCE,EAAWlB,EAAOiB,EAAQ,QAAQ","names":["Aptos","settings","AptosConfig","Account","ANS","Coin","DigitalAsset","Event","Faucet","FungibleAsset","General","Staking","Transaction","TransactionSubmission","Build","Sign","Simulate","Submit","applyMixin","targetClass","baseClass","baseClassProp","propertyName","propertyDescriptor","args"]}
@@ -0,0 +1,2 @@
1
+ import{e as d,j as m}from"./chunk-LR65XHSF.mjs";import{a as p,b as g,c as h}from"./chunk-PXTMLJKO.mjs";import{b as s}from"./chunk-NL72WE3E.mjs";import{sha3_256 as f}from"@noble/hashes/sha3";import{secp256k1 as o}from"@noble/curves/secp256k1";import{HDKey as H}from"@scure/bip32";var i=class i extends p{constructor(e){super();let t=s.fromHexInput(e);if(t.toUint8Array().length!==i.LENGTH)throw new Error(`PublicKey length should be ${i.LENGTH}`);this.key=t}toUint8Array(){return this.key.toUint8Array()}toString(){return this.key.toString()}verifySignature(e){let{message:t,signature:a}=e,y=s.fromHexInput(t).toUint8Array(),v=f(y),x=a.toUint8Array();return o.verify(x,v,this.toUint8Array())}serialize(e){e.serializeBytes(this.key.toUint8Array())}static deserialize(e){let t=e.deserializeBytes();return new i(t)}static load(e){let t=e.deserializeBytes();return new i(t)}static isPublicKey(e){return e instanceof i}};i.LENGTH=65;var u=i,r=class r extends g{constructor(e){super();let t=s.fromHexInput(e);if(t.toUint8Array().length!==r.LENGTH)throw new Error(`PrivateKey length should be ${r.LENGTH}`);this.key=t}toUint8Array(){return this.key.toUint8Array()}toString(){return this.key.toString()}sign(e){let t=s.fromHexInput(e),a=f(t.toUint8Array()),y=o.sign(a,this.key.toUint8Array());return new c(y.toCompactRawBytes())}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let t=e.deserializeBytes();return new r(t)}static generate(){let e=o.utils.randomPrivateKey();return new r(e)}publicKey(){let e=o.getPublicKey(this.key.toUint8Array(),!1);return new u(e)}static fromDerivationPath(e,t){if(!d(e))throw new Error(`Invalid derivation path ${e}`);return r.fromDerivationPathInner(e,m(t))}static fromDerivationPathInner(e,t){let{privateKey:a}=H.fromMasterSeed(t).derive(e);if(a===null)throw new Error("Invalid key");return new r(a)}static isPrivateKey(e){return e instanceof r}};r.LENGTH=32;var S=r,n=class n extends h{constructor(e){super();let t=s.fromHexInput(e);if(t.toUint8Array().length!==n.LENGTH)throw new Error(`Signature length should be ${n.LENGTH}, recieved ${t.toUint8Array().length}`);this.data=t}toUint8Array(){return this.data.toUint8Array()}toString(){return this.data.toString()}serialize(e){e.serializeBytes(this.data.toUint8Array())}static deserialize(e){let t=e.deserializeBytes();return new n(t)}static load(e){let t=e.deserializeBytes();return new n(t)}static isSignature(e){return e instanceof n}};n.LENGTH=64;var c=n;export{u as a,S as b,c};
2
+ //# sourceMappingURL=chunk-3F5WV6US.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/core/crypto/secp256k1.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { sha3_256 } from \"@noble/hashes/sha3\";\nimport { secp256k1 } from \"@noble/curves/secp256k1\";\nimport { HDKey } from \"@scure/bip32\";\nimport { PrivateKey, PublicKey, Signature } from \"./asymmetricCrypto\";\nimport { Deserializer, Serializer } from \"../../bcs\";\nimport { Hex } from \"../hex\";\nimport { HexInput } from \"../../types\";\nimport { isValidBIP44Path, mnemonicToSeed } from \"./hdKey\";\n\n/**\n * Represents the Secp256k1 ecdsa public key\n *\n * Secp256k1 authentication key is represented in the SDK as `AnyPublicKey`.\n */\nexport class Secp256k1PublicKey extends PublicKey {\n // Secp256k1 ecdsa public keys contain a prefix indicating compression and two 32-byte coordinates.\n static readonly LENGTH: number = 65;\n\n // Hex value of the public key\n private readonly key: Hex;\n\n /**\n * Create a new PublicKey instance from a Uint8Array or String.\n *\n * @param hexInput A HexInput (string or Uint8Array)\n */\n constructor(hexInput: HexInput) {\n super();\n\n const hex = Hex.fromHexInput(hexInput);\n if (hex.toUint8Array().length !== Secp256k1PublicKey.LENGTH) {\n throw new Error(`PublicKey length should be ${Secp256k1PublicKey.LENGTH}`);\n }\n this.key = hex;\n }\n\n /**\n * Get the public key in bytes (Uint8Array).\n *\n * @returns Uint8Array representation of the public key\n */\n toUint8Array(): Uint8Array {\n return this.key.toUint8Array();\n }\n\n /**\n * Get the public key as a hex string with the 0x prefix.\n *\n * @returns string representation of the public key\n */\n toString(): string {\n return this.key.toString();\n }\n\n /**\n * Verifies a signed data with a public key\n *\n * @param args.message message\n * @param args.signature The signature\n * @returns true if the signature is valid\n */\n verifySignature(args: { message: HexInput; signature: Secp256k1Signature }): boolean {\n const { message, signature } = args;\n const msgHex = Hex.fromHexInput(message).toUint8Array();\n const sha3Message = sha3_256(msgHex);\n const rawSignature = signature.toUint8Array();\n return secp256k1.verify(rawSignature, sha3Message, this.toUint8Array());\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeBytes(this.key.toUint8Array());\n }\n\n static deserialize(deserializer: Deserializer): Secp256k1PublicKey {\n const bytes = deserializer.deserializeBytes();\n return new Secp256k1PublicKey(bytes);\n }\n\n static load(deserializer: Deserializer): Secp256k1PublicKey {\n const bytes = deserializer.deserializeBytes();\n return new Secp256k1PublicKey(bytes);\n }\n\n static isPublicKey(publicKey: PublicKey): publicKey is Secp256k1PublicKey {\n return publicKey instanceof Secp256k1PublicKey;\n }\n}\n\n/**\n * A Secp256k1 ecdsa private key\n */\nexport class Secp256k1PrivateKey extends PrivateKey {\n /**\n * Length of Secp256k1 ecdsa private key\n */\n static readonly LENGTH: number = 32;\n\n /**\n * The private key bytes\n * @private\n */\n private readonly key: Hex;\n\n /**\n * Create a new PrivateKey instance from a Uint8Array or String.\n *\n * @param hexInput A HexInput (string or Uint8Array)\n */\n constructor(hexInput: HexInput) {\n super();\n\n const privateKeyHex = Hex.fromHexInput(hexInput);\n if (privateKeyHex.toUint8Array().length !== Secp256k1PrivateKey.LENGTH) {\n throw new Error(`PrivateKey length should be ${Secp256k1PrivateKey.LENGTH}`);\n }\n\n this.key = privateKeyHex;\n }\n\n /**\n * Get the private key in bytes (Uint8Array).\n *\n * @returns\n */\n toUint8Array(): Uint8Array {\n return this.key.toUint8Array();\n }\n\n /**\n * Get the private key as a hex string with the 0x prefix.\n *\n * @returns string representation of the private key\n */\n toString(): string {\n return this.key.toString();\n }\n\n /**\n * Sign the given message with the private key.\n *\n * @param message in HexInput format\n * @returns Signature\n */\n sign(message: HexInput): Secp256k1Signature {\n const msgHex = Hex.fromHexInput(message);\n const sha3Message = sha3_256(msgHex.toUint8Array());\n const signature = secp256k1.sign(sha3Message, this.key.toUint8Array());\n return new Secp256k1Signature(signature.toCompactRawBytes());\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeBytes(this.toUint8Array());\n }\n\n static deserialize(deserializer: Deserializer): Secp256k1PrivateKey {\n const bytes = deserializer.deserializeBytes();\n return new Secp256k1PrivateKey(bytes);\n }\n\n /**\n * Generate a new random private key.\n *\n * @returns Secp256k1PrivateKey\n */\n static generate(): Secp256k1PrivateKey {\n const hexInput = secp256k1.utils.randomPrivateKey();\n return new Secp256k1PrivateKey(hexInput);\n }\n\n /**\n * Derive the Secp256k1PublicKey from this private key.\n *\n * @returns Secp256k1PublicKey\n */\n publicKey(): Secp256k1PublicKey {\n const bytes = secp256k1.getPublicKey(this.key.toUint8Array(), false);\n return new Secp256k1PublicKey(bytes);\n }\n\n /**\n * Derives a private key from a mnemonic seed phrase.\n *\n * @param path the BIP44 path\n * @param mnemonics the mnemonic seed phrase\n *\n * @returns The generated key\n */\n static fromDerivationPath(path: string, mnemonics: string): Secp256k1PrivateKey {\n if (!isValidBIP44Path(path)) {\n throw new Error(`Invalid derivation path ${path}`);\n }\n return Secp256k1PrivateKey.fromDerivationPathInner(path, mnemonicToSeed(mnemonics));\n }\n\n /**\n * A private inner function so we can separate from the main fromDerivationPath() method\n * to add tests to verify we create the keys correctly.\n *\n * @param path the BIP44 path\n * @param seed the seed phrase created by the mnemonics\n *\n * @returns The generated key\n */\n private static fromDerivationPathInner(path: string, seed: Uint8Array): Secp256k1PrivateKey {\n const { privateKey } = HDKey.fromMasterSeed(seed).derive(path);\n // library returns privateKey as Uint8Array | null\n if (privateKey === null) {\n throw new Error(\"Invalid key\");\n }\n\n return new Secp256k1PrivateKey(privateKey);\n }\n\n static isPrivateKey(privateKey: PrivateKey): privateKey is Secp256k1PrivateKey {\n return privateKey instanceof Secp256k1PrivateKey;\n }\n}\n\n/**\n * A signature of a message signed using an Secp256k1 ecdsa private key\n */\nexport class Secp256k1Signature extends Signature {\n /**\n * Secp256k1 ecdsa signatures are 256-bit.\n */\n static readonly LENGTH = 64;\n\n /**\n * The signature bytes\n * @private\n */\n private readonly data: Hex;\n\n /**\n * Create a new Signature instance from a Uint8Array or String.\n *\n * @param hexInput A HexInput (string or Uint8Array)\n */\n constructor(hexInput: HexInput) {\n super();\n\n const hex = Hex.fromHexInput(hexInput);\n if (hex.toUint8Array().length !== Secp256k1Signature.LENGTH) {\n throw new Error(`Signature length should be ${Secp256k1Signature.LENGTH}, recieved ${hex.toUint8Array().length}`);\n }\n this.data = hex;\n }\n\n /**\n * Get the signature in bytes (Uint8Array).\n *\n * @returns Uint8Array representation of the signature\n */\n toUint8Array(): Uint8Array {\n return this.data.toUint8Array();\n }\n\n /**\n * Get the signature as a hex string with the 0x prefix.\n *\n * @returns string representation of the signature\n */\n toString(): string {\n return this.data.toString();\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeBytes(this.data.toUint8Array());\n }\n\n static deserialize(deserializer: Deserializer): Secp256k1Signature {\n const hex = deserializer.deserializeBytes();\n return new Secp256k1Signature(hex);\n }\n\n static load(deserializer: Deserializer): Secp256k1Signature {\n const bytes = deserializer.deserializeBytes();\n return new Secp256k1Signature(bytes);\n }\n\n static isSignature(signature: Signature): signature is Secp256k1Signature {\n return signature instanceof Secp256k1Signature;\n }\n}\n"],"mappings":"gJAGA,OAAS,YAAAA,MAAgB,qBACzB,OAAS,aAAAC,MAAiB,0BAC1B,OAAS,SAAAC,MAAa,eAYf,IAAMC,EAAN,MAAMA,UAA2BC,CAAU,CAYhD,YAAYC,EAAoB,CAC9B,MAAM,EAEN,IAAMC,EAAMC,EAAI,aAAaF,CAAQ,EACrC,GAAIC,EAAI,aAAa,EAAE,SAAWH,EAAmB,OACnD,MAAM,IAAI,MAAM,8BAA8BA,EAAmB,MAAM,EAAE,EAE3E,KAAK,IAAMG,CACb,CAOA,cAA2B,CACzB,OAAO,KAAK,IAAI,aAAa,CAC/B,CAOA,UAAmB,CACjB,OAAO,KAAK,IAAI,SAAS,CAC3B,CASA,gBAAgBE,EAAqE,CACnF,GAAM,CAAE,QAAAC,EAAS,UAAAC,CAAU,EAAIF,EACzBG,EAASJ,EAAI,aAAaE,CAAO,EAAE,aAAa,EAChDG,EAAcC,EAASF,CAAM,EAC7BG,EAAeJ,EAAU,aAAa,EAC5C,OAAOK,EAAU,OAAOD,EAAcF,EAAa,KAAK,aAAa,CAAC,CACxE,CAEA,UAAUI,EAA8B,CACtCA,EAAW,eAAe,KAAK,IAAI,aAAa,CAAC,CACnD,CAEA,OAAO,YAAYC,EAAgD,CACjE,IAAMC,EAAQD,EAAa,iBAAiB,EAC5C,OAAO,IAAId,EAAmBe,CAAK,CACrC,CAEA,OAAO,KAAKD,EAAgD,CAC1D,IAAMC,EAAQD,EAAa,iBAAiB,EAC5C,OAAO,IAAId,EAAmBe,CAAK,CACrC,CAEA,OAAO,YAAYC,EAAuD,CACxE,OAAOA,aAAqBhB,CAC9B,CACF,EAxEaA,EAEK,OAAiB,GAF5B,IAAMiB,EAANjB,EA6EMkB,EAAN,MAAMA,UAA4BC,CAAW,CAiBlD,YAAYjB,EAAoB,CAC9B,MAAM,EAEN,IAAMkB,EAAgBhB,EAAI,aAAaF,CAAQ,EAC/C,GAAIkB,EAAc,aAAa,EAAE,SAAWF,EAAoB,OAC9D,MAAM,IAAI,MAAM,+BAA+BA,EAAoB,MAAM,EAAE,EAG7E,KAAK,IAAME,CACb,CAOA,cAA2B,CACzB,OAAO,KAAK,IAAI,aAAa,CAC/B,CAOA,UAAmB,CACjB,OAAO,KAAK,IAAI,SAAS,CAC3B,CAQA,KAAKd,EAAuC,CAC1C,IAAME,EAASJ,EAAI,aAAaE,CAAO,EACjCG,EAAcC,EAASF,EAAO,aAAa,CAAC,EAC5CD,EAAYK,EAAU,KAAKH,EAAa,KAAK,IAAI,aAAa,CAAC,EACrE,OAAO,IAAIY,EAAmBd,EAAU,kBAAkB,CAAC,CAC7D,CAEA,UAAUM,EAA8B,CACtCA,EAAW,eAAe,KAAK,aAAa,CAAC,CAC/C,CAEA,OAAO,YAAYC,EAAiD,CAClE,IAAMC,EAAQD,EAAa,iBAAiB,EAC5C,OAAO,IAAII,EAAoBH,CAAK,CACtC,CAOA,OAAO,UAAgC,CACrC,IAAMb,EAAWU,EAAU,MAAM,iBAAiB,EAClD,OAAO,IAAIM,EAAoBhB,CAAQ,CACzC,CAOA,WAAgC,CAC9B,IAAMa,EAAQH,EAAU,aAAa,KAAK,IAAI,aAAa,EAAG,EAAK,EACnE,OAAO,IAAIK,EAAmBF,CAAK,CACrC,CAUA,OAAO,mBAAmBO,EAAcC,EAAwC,CAC9E,GAAI,CAACC,EAAiBF,CAAI,EACxB,MAAM,IAAI,MAAM,2BAA2BA,CAAI,EAAE,EAEnD,OAAOJ,EAAoB,wBAAwBI,EAAMG,EAAeF,CAAS,CAAC,CACpF,CAWA,OAAe,wBAAwBD,EAAcI,EAAuC,CAC1F,GAAM,CAAE,WAAAC,CAAW,EAAIC,EAAM,eAAeF,CAAI,EAAE,OAAOJ,CAAI,EAE7D,GAAIK,IAAe,KACjB,MAAM,IAAI,MAAM,aAAa,EAG/B,OAAO,IAAIT,EAAoBS,CAAU,CAC3C,CAEA,OAAO,aAAaA,EAA2D,CAC7E,OAAOA,aAAsBT,CAC/B,CACF,EA7HaA,EAIK,OAAiB,GAJ5B,IAAMW,EAANX,EAkIMY,EAAN,MAAMA,UAA2BC,CAAU,CAiBhD,YAAY7B,EAAoB,CAC9B,MAAM,EAEN,IAAMC,EAAMC,EAAI,aAAaF,CAAQ,EACrC,GAAIC,EAAI,aAAa,EAAE,SAAW2B,EAAmB,OACnD,MAAM,IAAI,MAAM,8BAA8BA,EAAmB,MAAM,cAAc3B,EAAI,aAAa,EAAE,MAAM,EAAE,EAElH,KAAK,KAAOA,CACd,CAOA,cAA2B,CACzB,OAAO,KAAK,KAAK,aAAa,CAChC,CAOA,UAAmB,CACjB,OAAO,KAAK,KAAK,SAAS,CAC5B,CAEA,UAAUU,EAA8B,CACtCA,EAAW,eAAe,KAAK,KAAK,aAAa,CAAC,CACpD,CAEA,OAAO,YAAYC,EAAgD,CACjE,IAAMX,EAAMW,EAAa,iBAAiB,EAC1C,OAAO,IAAIgB,EAAmB3B,CAAG,CACnC,CAEA,OAAO,KAAKW,EAAgD,CAC1D,IAAMC,EAAQD,EAAa,iBAAiB,EAC5C,OAAO,IAAIgB,EAAmBf,CAAK,CACrC,CAEA,OAAO,YAAYR,EAAuD,CACxE,OAAOA,aAAqBuB,CAC9B,CACF,EA9DaA,EAIK,OAAS,GAJpB,IAAMT,EAANS","names":["sha3_256","secp256k1","HDKey","_Secp256k1PublicKey","PublicKey","hexInput","hex","Hex","args","message","signature","msgHex","sha3Message","sha3_256","rawSignature","secp256k1","serializer","deserializer","bytes","publicKey","Secp256k1PublicKey","_Secp256k1PrivateKey","PrivateKey","privateKeyHex","Secp256k1Signature","path","mnemonics","isValidBIP44Path","mnemonicToSeed","seed","privateKey","HDKey","Secp256k1PrivateKey","_Secp256k1Signature","Signature"]}
@@ -1,2 +1,2 @@
1
- import{b as n}from"./chunk-KC64ESLO.mjs";import{a as r,b as t,c as o}from"./chunk-LV33NV4J.mjs";import l from"@aptos-labs/aptos-client";var i=class{constructor(e){this.network=e?.network??n,this.fullnode=e?.fullnode,this.faucet=e?.faucet,this.indexer=e?.indexer,this.client=e?.client??{provider:l},this.clientConfig=e?.clientConfig??{}}getRequestUrl(e){switch(e){case 0:if(this.fullnode!==void 0)return this.fullnode;if(this.network==="custom")throw new Error("Please provide a custom full node url");return t[this.network];case 2:if(this.faucet!==void 0)return this.faucet;if(this.network==="custom")throw new Error("Please provide a custom faucet url");return o[this.network];case 1:if(this.indexer!==void 0)return this.indexer;if(this.network==="custom")throw new Error("Please provide a custom indexer url");return r[this.network];default:throw Error(`apiType ${e} is not supported`)}}isIndexerRequest(e){return r[this.network]===e}};export{i as a};
2
- //# sourceMappingURL=chunk-ARVSIDVB.mjs.map
1
+ import{b as n}from"./chunk-EOC4UI5B.mjs";import{a as r,b as t,c as o}from"./chunk-LV33NV4J.mjs";import l from"@aptos-labs/aptos-client";var i=class{constructor(e){this.network=e?.network??n,this.fullnode=e?.fullnode,this.faucet=e?.faucet,this.indexer=e?.indexer,this.client=e?.client??{provider:l},this.clientConfig=e?.clientConfig??{}}getRequestUrl(e){switch(e){case 0:if(this.fullnode!==void 0)return this.fullnode;if(this.network==="custom")throw new Error("Please provide a custom full node url");return t[this.network];case 2:if(this.faucet!==void 0)return this.faucet;if(this.network==="custom")throw new Error("Please provide a custom faucet url");return o[this.network];case 1:if(this.indexer!==void 0)return this.indexer;if(this.network==="custom")throw new Error("Please provide a custom indexer url");return r[this.network];default:throw Error(`apiType ${e} is not supported`)}}isIndexerRequest(e){return r[this.network]===e}};export{i as a};
2
+ //# sourceMappingURL=chunk-3RMXGSHK.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/api/aptosConfig.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport aptosClient from \"@aptos-labs/aptos-client\";\nimport { AptosSettings, ClientConfig, Client } from \"../types\";\nimport { NetworkToNodeAPI, NetworkToFaucetAPI, NetworkToIndexerAPI, Network } from \"../utils/apiEndpoints\";\nimport { AptosApiType, DEFAULT_NETWORK } from \"../utils/const\";\n\n/**\n * This class holds the config information for the SDK client instance.\n */\nexport class AptosConfig {\n /** The Network that this SDK is associated with. Defaults to DEVNET */\n readonly network: Network;\n\n /**\n * The client instance the SDK uses. Defaults to `@aptos-labs/aptos-client\n */\n readonly client: Client;\n\n /**\n * The optional hardcoded fullnode URL to send requests to instead of using the network\n */\n readonly fullnode?: string;\n\n /**\n * The optional hardcoded faucet URL to send requests to instead of using the network\n */\n readonly faucet?: string;\n\n /**\n * The optional hardcoded indexer URL to send requests to instead of using the network\n */\n readonly indexer?: string;\n\n readonly clientConfig?: ClientConfig;\n\n constructor(settings?: AptosSettings) {\n this.network = settings?.network ?? DEFAULT_NETWORK;\n this.fullnode = settings?.fullnode;\n this.faucet = settings?.faucet;\n this.indexer = settings?.indexer;\n this.client = settings?.client ?? { provider: aptosClient };\n this.clientConfig = settings?.clientConfig ?? {};\n }\n\n /**\n * Returns the URL endpoint to send the request to.\n * If a custom URL was provided in the config, that URL is returned.\n * If a custom URL was provided but not URL endpoints, an error is thrown.\n * Otherwise, the URL endpoint is derived from the network.\n *\n * @param apiType - The type of Aptos API to get the URL for.\n *\n * @internal\n */\n getRequestUrl(apiType: AptosApiType): string {\n switch (apiType) {\n case AptosApiType.FULLNODE:\n if (this.fullnode !== undefined) return this.fullnode;\n if (this.network === Network.CUSTOM) throw new Error(\"Please provide a custom full node url\");\n return NetworkToNodeAPI[this.network];\n case AptosApiType.FAUCET:\n if (this.faucet !== undefined) return this.faucet;\n if (this.network === Network.CUSTOM) throw new Error(\"Please provide a custom faucet url\");\n return NetworkToFaucetAPI[this.network];\n case AptosApiType.INDEXER:\n if (this.indexer !== undefined) return this.indexer;\n if (this.network === Network.CUSTOM) throw new Error(\"Please provide a custom indexer url\");\n return NetworkToIndexerAPI[this.network];\n default:\n throw Error(`apiType ${apiType} is not supported`);\n }\n }\n\n /**\n * Checks if the URL is a known indexer endpoint\n *\n * @internal\n * */\n isIndexerRequest(url: string): boolean {\n return NetworkToIndexerAPI[this.network] === url;\n }\n}\n"],"mappings":"gGAGA,OAAOA,MAAiB,2BAQjB,IAAMC,EAAN,KAAkB,CA0BvB,YAAYC,EAA0B,CACpC,KAAK,QAAUA,GAAU,SAAWC,EACpC,KAAK,SAAWD,GAAU,SAC1B,KAAK,OAASA,GAAU,OACxB,KAAK,QAAUA,GAAU,QACzB,KAAK,OAASA,GAAU,QAAU,CAAE,SAAUE,CAAY,EAC1D,KAAK,aAAeF,GAAU,cAAgB,CAAC,CACjD,CAYA,cAAcG,EAA+B,CAC3C,OAAQA,EAAS,CACf,OACE,GAAI,KAAK,WAAa,OAAW,OAAO,KAAK,SAC7C,GAAI,KAAK,mBAA4B,MAAM,IAAI,MAAM,uCAAuC,EAC5F,OAAOC,EAAiB,KAAK,OAAO,EACtC,OACE,GAAI,KAAK,SAAW,OAAW,OAAO,KAAK,OAC3C,GAAI,KAAK,mBAA4B,MAAM,IAAI,MAAM,oCAAoC,EACzF,OAAOC,EAAmB,KAAK,OAAO,EACxC,OACE,GAAI,KAAK,UAAY,OAAW,OAAO,KAAK,QAC5C,GAAI,KAAK,mBAA4B,MAAM,IAAI,MAAM,qCAAqC,EAC1F,OAAOC,EAAoB,KAAK,OAAO,EACzC,QACE,MAAM,MAAM,WAAWH,CAAO,mBAAmB,CACrD,CACF,CAOA,iBAAiBI,EAAsB,CACrC,OAAOD,EAAoB,KAAK,OAAO,IAAMC,CAC/C,CACF","names":["aptosClient","AptosConfig","settings","DEFAULT_NETWORK","aptosClient","apiType","NetworkToNodeAPI","NetworkToFaucetAPI","NetworkToIndexerAPI","url"]}
@@ -1,2 +1,2 @@
1
- import{a as l,b as s,c as u,d as c,e as d,f as m,g as U}from"./chunk-X32O46IB.mjs";import{a as o}from"./chunk-HA6JD5R6.mjs";import{b as z}from"./chunk-TIH6ARYP.mjs";var t=class n extends o{constructor(e){super();this.values=e}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){if(!(this.values[0]instanceof s)&&this.values[0]!==void 0)throw new Error("Script function arguments only accept u8 vectors");e.serializeU32AsUleb128(4),e.serialize(this)}static U8(e){let r;if(Array.isArray(e)&&typeof e[0]=="number")r=e;else if(typeof e=="string"){let i=z.fromHexInput(e);r=Array.from(i.toUint8Array())}else if(e instanceof Uint8Array)r=Array.from(e);else throw new Error("Invalid input type");return new n(r.map(i=>new s(i)))}static U16(e){return new n(e.map(r=>new u(r)))}static U32(e){return new n(e.map(r=>new c(r)))}static U64(e){return new n(e.map(r=>new d(r)))}static U128(e){return new n(e.map(r=>new m(r)))}static U256(e){return new n(e.map(r=>new U(r)))}static Bool(e){return new n(e.map(r=>new l(r)))}static MoveString(e){return new n(e.map(r=>new a(r)))}serialize(e){e.serializeVector(this.values)}static deserialize(e,r){let i=e.deserializeUleb128AsU32(),y=new Array;for(let w=0;w<i;w+=1)y.push(r.deserialize(e));return new n(y)}},a=class n extends o{constructor(e){super();this.value=e}serialize(e){e.serializeStr(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){let r=this.bcsToBytes().slice(1);t.U8(r).serializeForScriptFunction(e)}static deserialize(e){return new n(e.deserializeStr())}},f=class n extends o{constructor(e){super();typeof e<"u"&&e!==null?this.vec=new t([e]):this.vec=new t([]),[this.value]=this.vec.values}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}unwrap(){if(this.isSome())return this.vec.values[0];throw new Error("Called unwrap on a MoveOption with no value")}isSome(){return this.vec.values.length===1}serialize(e){this.vec.serialize(e)}static U8(e){return new n(e!=null?new s(e):void 0)}static U16(e){return new n(e!=null?new u(e):void 0)}static U32(e){return new n(e!=null?new c(e):void 0)}static U64(e){return new n(e!=null?new d(e):void 0)}static U128(e){return new n(e!=null?new m(e):void 0)}static U256(e){return new n(e!=null?new U(e):void 0)}static Bool(e){return new n(e!=null?new l(e):void 0)}static MoveString(e){return new n(e!=null?new a(e):void 0)}static deserialize(e,r){let i=t.deserialize(e,r);return new n(i.values[0])}};export{t as a,a as b,f as c};
2
- //# sourceMappingURL=chunk-4ADA5BE7.mjs.map
1
+ import{a as l,b as s,c as u,d as c,e as d,f as m,g as U}from"./chunk-XITLXPBK.mjs";import{a as o}from"./chunk-F6K26WV5.mjs";import{b as z}from"./chunk-NL72WE3E.mjs";var t=class n extends o{constructor(e){super();this.values=e}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){if(!(this.values[0]instanceof s)&&this.values[0]!==void 0)throw new Error("Script function arguments only accept u8 vectors");e.serializeU32AsUleb128(4),e.serialize(this)}static U8(e){let r;if(Array.isArray(e)&&typeof e[0]=="number")r=e;else if(typeof e=="string"){let i=z.fromHexInput(e);r=Array.from(i.toUint8Array())}else if(e instanceof Uint8Array)r=Array.from(e);else throw new Error("Invalid input type");return new n(r.map(i=>new s(i)))}static U16(e){return new n(e.map(r=>new u(r)))}static U32(e){return new n(e.map(r=>new c(r)))}static U64(e){return new n(e.map(r=>new d(r)))}static U128(e){return new n(e.map(r=>new m(r)))}static U256(e){return new n(e.map(r=>new U(r)))}static Bool(e){return new n(e.map(r=>new l(r)))}static MoveString(e){return new n(e.map(r=>new a(r)))}serialize(e){e.serializeVector(this.values)}static deserialize(e,r){let i=e.deserializeUleb128AsU32(),y=new Array;for(let w=0;w<i;w+=1)y.push(r.deserialize(e));return new n(y)}},a=class n extends o{constructor(e){super();this.value=e}serialize(e){e.serializeStr(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){let r=this.bcsToBytes().slice(1);t.U8(r).serializeForScriptFunction(e)}static deserialize(e){return new n(e.deserializeStr())}},f=class n extends o{constructor(e){super();typeof e<"u"&&e!==null?this.vec=new t([e]):this.vec=new t([]),[this.value]=this.vec.values}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}unwrap(){if(this.isSome())return this.vec.values[0];throw new Error("Called unwrap on a MoveOption with no value")}isSome(){return this.vec.values.length===1}serialize(e){this.vec.serialize(e)}static U8(e){return new n(e!=null?new s(e):void 0)}static U16(e){return new n(e!=null?new u(e):void 0)}static U32(e){return new n(e!=null?new c(e):void 0)}static U64(e){return new n(e!=null?new d(e):void 0)}static U128(e){return new n(e!=null?new m(e):void 0)}static U256(e){return new n(e!=null?new U(e):void 0)}static Bool(e){return new n(e!=null?new l(e):void 0)}static MoveString(e){return new n(e!=null?new a(e):void 0)}static deserialize(e,r){let i=t.deserialize(e,r);return new n(i.values[0])}};export{t as a,a as b,f as c};
2
+ //# sourceMappingURL=chunk-53DS6NBQ.mjs.map
@@ -0,0 +1,2 @@
1
+ import{a as p,b as f,c as T,d as U,e as M,f as O,g as C,h as m,i as V,k as _,l as G,m as j,n as k,o as H,p as z,r,s as L}from"./chunk-F7EWDYTE.mjs";import{c as w}from"./chunk-GXPGRCSW.mjs";import{n as I}from"./chunk-YN6UIVFB.mjs";import{c as x}from"./chunk-SGTFMSOG.mjs";import{a as c,b as v,c as y}from"./chunk-53DS6NBQ.mjs";import{a as h,b as E,c as B,d as S,e as b,f as $,g as F}from"./chunk-XITLXPBK.mjs";import{b as g}from"./chunk-G36AY4R7.mjs";import{b as d}from"./chunk-NL72WE3E.mjs";function Z(n){return n?.map(e=>f(e)?w(e):e)??[]}async function P(n,e,t,i){let s=(await x({aptosConfig:i,accountAddress:n,moduleName:e})).abi?.exposed_functions.find(o=>o.name===t);if(!s)throw new Error(`Could not find entry function ABI for '${n}::${e}::${t}'`);if(!s.is_entry)throw new Error(`'${n}::${e}::${t}' is not an entry function`);let q=L(s),l=[];for(let o=q;o<s.params.length;o+=1)l.push(w(s.params[o],{allowGenerics:!0}));return{typeParameters:s.generic_type_params,parameters:l}}function a(n,e,t,i,u){if(i>=e.parameters.length)throw new Error(`Too many arguments for '${n}', expected ${e.parameters.length}`);let s=e.parameters[i];return A(t,s,i,u)}function A(n,e,t,i){return O(n)?(J(e,n,t),n):D(n,e,t,i)}function D(n,e,t,i){if(e.isBool()){if(p(n))return new h(n);r("boolean",t)}if(e.isAddress()){if(f(n))return g.fromString(n);r("string",t)}if(e.isU8()){if(T(n))return new E(n);r("number",t)}if(e.isU16()){if(T(n))return new B(n);r("number",t)}if(e.isU32()){if(T(n))return new S(n);r("number",t)}if(e.isU64()){if(U(n))return new b(BigInt(n));r("bigint | number | string",t)}if(e.isU128()){if(U(n))return new $(BigInt(n));r("bigint | number | string",t)}if(e.isU256()){if(U(n))return new F(BigInt(n));r("bigint | number | string",t)}if(e.isGeneric()){let u=e.value;if(u<0||u>=i.length)throw new Error(`Generic argument ${e.toString()} is invalid for argument ${t}`);A(n,i[u],t,i)}if(e.isVector()){if(e.value.isU8()){if(f(n))try{return c.U8(d.fromHexInput(n).toUint8Array())}catch{throw new Error(`vector<u8> must be passed in as a hex string or a Uint8array, type '${e.toString()}'`)}if(n instanceof Uint8Array)return c.U8(n)}if(Array.isArray(n))return new c(n.map(u=>A(u,e.value,t,i)));throw new Error(`Type mismatch for argument ${t}, type '${e.toString()}'`)}if(e.isStruct()){if(e.isString()){if(f(n))return new v(n);r("string",t)}if(e.isObject()){if(f(n))return g.fromString(n);r("string",t)}if(e.isOption())return M(n)?new y(null):new y(A(n,e.value.typeArgs[0],t,i));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 J(n,e,t){if(n.isBool()){if(C(e))return;r("Bool",t)}if(n.isAddress()){if(m(e))return;r("AccountAddress",t)}if(n.isU8()){if(_(e))return;r("U8",t)}if(n.isU16()){if(G(e))return;r("U16",t)}if(n.isU32()){if(j(e))return;r("U32",t)}if(n.isU64()){if(k(e))return;r("U64",t)}if(n.isU128()){if(H(e))return;r("U128",t)}if(n.isU256()){if(z(e))return;r("U256",t)}if(n.isVector()){if(e instanceof c)return;r("MoveVector",t)}if(n instanceof I){if(n.isString()){if(V(e))return;r("MoveString",t)}if(n.isObject()){if(m(e))return;r("AccountAddress",t)}if(n.isOption()){if(e instanceof y)return;r("MoveOption",t)}}throw new Error(`Type mismatch for argument ${t}, expected '${n.toString()}'`)}export{Z as a,P as b,a as c,A as d};
2
+ //# sourceMappingURL=chunk-5CUNY7X2.mjs.map
@@ -0,0 +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 { EntryFunctionArgumentTypes, SimpleEntryFunctionArgumentTypes, EntryFunctionABI } from \"../types\";\nimport { Bool, MoveOption, MoveString, MoveVector, U128, U16, U256, U32, U64, U8 } from \"../../bcs\";\nimport { AccountAddress, Hex } 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\";\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 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 // This fetch from the API is currently cached\n const module = await getModule({ aptosConfig, accountAddress: moduleAddress, moduleName });\n\n const functionAbi = module.abi?.exposed_functions.find((func) => func.name === functionName);\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 first = findFirstNonSignerArg(functionAbi);\n const params: TypeTag[] = [];\n for (let i = first; i < functionAbi.params.length; i += 1) {\n params.push(parseTypeTag(functionAbi.params[i], { allowGenerics: true }));\n }\n\n return {\n typeParameters: functionAbi.generic_type_params,\n parameters: params,\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: EntryFunctionABI,\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\", 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 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 if (isString(arg)) {\n try {\n return MoveVector.U8(Hex.fromHexInput(arg).toUint8Array());\n } catch (e: any) {\n // This is a bit of a hack to not reuse code, but also have a better error message\n throw new Error(`vector<u8> must be passed in as a hex string or a Uint8array, type '${param.toString()}'`);\n }\n }\n if (arg instanceof Uint8Array) {\n return MoveVector.U8(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\", 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 // TODO: More introspection to verify the type\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 // TODO: more introspection for the type\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":["standardizeTypeTags","typeArguments","typeArg","isString","parseTypeTag","fetchEntryFunctionAbi","moduleAddress","moduleName","functionName","aptosConfig","functionAbi","getModule","func","first","findFirstNonSignerArg","params","i","convertArgument","arg","position","genericTypeParams","param","checkOrConvertArgument","isEncodedEntryFunctionArgument","checkType","parseArg","isBool","Bool","throwTypeMismatch","AccountAddress","isNumber","U8","U16","U32","isLargeNumber","U64","U128","U256","genericIndex","MoveVector","Hex","item","MoveString","isNull","MoveOption","isBcsBool","isBcsAddress","isBcsU8","isBcsU16","isBcsU32","isBcsU64","isBcsU128","isBcsU256","TypeTagStruct","isBcsString"]}
@@ -1,2 +1,2 @@
1
- import{c as i}from"./chunk-62SCW5NH.mjs";import{c as e}from"./chunk-RYETO74W.mjs";import{c as a}from"./chunk-EFIYW4WK.mjs";var s=class t extends a{constructor(r){super();this.signature=r}toUint8Array(){return this.signature.toUint8Array()}toString(){return this.signature.toString()}serialize(r){if(this.signature instanceof e)r.serializeU32AsUleb128(0),this.signature.serialize(r);else if(this.signature instanceof i)r.serializeU32AsUleb128(1),this.signature.serialize(r);else throw new Error("Unknown signature type")}static deserialize(r){let n=r.deserializeUleb128AsU32();switch(n){case 0:return new t(e.load(r));case 1:return new t(i.load(r));default:throw new Error(`Unknown variant index for AnySignature: ${n}`)}}};export{s as a};
2
- //# sourceMappingURL=chunk-QWVR4RCV.mjs.map
1
+ import{c as i}from"./chunk-3F5WV6US.mjs";import{c as e}from"./chunk-UW6HQ643.mjs";import{c as a}from"./chunk-PXTMLJKO.mjs";var s=class t extends a{constructor(r){super();this.signature=r}toUint8Array(){return this.signature.toUint8Array()}toString(){return this.signature.toString()}serialize(r){if(this.signature instanceof e)r.serializeU32AsUleb128(0),this.signature.serialize(r);else if(this.signature instanceof i)r.serializeU32AsUleb128(1),this.signature.serialize(r);else throw new Error("Unknown signature type")}static deserialize(r){let n=r.deserializeUleb128AsU32();switch(n){case 0:return new t(e.load(r));case 1:return new t(i.load(r));default:throw new Error(`Unknown variant index for AnySignature: ${n}`)}}};export{s as a};
2
+ //# sourceMappingURL=chunk-5OPOJ43H.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as o}from"./chunk-IXMB2GOK.mjs";var t=class{constructor(n){this.config=n}async transferCoinTransaction(n){return o({aptosConfig:this.config,...n})}};export{t as a};
2
- //# sourceMappingURL=chunk-V45RFKH7.mjs.map
1
+ import{a as o}from"./chunk-TZ623H2V.mjs";var t=class{constructor(n){this.config=n}async transferCoinTransaction(n){return o({aptosConfig:this.config,...n})}};export{t as a};
2
+ //# sourceMappingURL=chunk-5UY5OKXR.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/api/coin.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Account, AccountAddressInput } from \"../core\";\nimport { transferCoinTransaction } from \"../internal/coin\";\nimport { SingleSignerTransaction, InputGenerateTransactionOptions } from \"../transactions/types\";\nimport { AnyNumber, MoveStructId } from \"../types\";\nimport { AptosConfig } from \"./aptosConfig\";\n\n/**\n * A class to handle all `Coin` operations\n */\nexport class Coin {\n constructor(readonly config: AptosConfig) {}\n\n /**\n * Generate a transfer coin transaction that can be simulated and/or signed and submitted\n *\n * @param args.sender The sender account\n * @param args.recipient The recipient address\n * @param args.amount The amount to transfer\n * @param args.coinType optional. The coin struct type to transfer. Defaults to 0x1::aptos_coin::AptosCoin\n *\n * @returns SingleSignerTransaction\n */\n async transferCoinTransaction(args: {\n sender: Account;\n recipient: AccountAddressInput;\n amount: AnyNumber;\n coinType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }): Promise<SingleSignerTransaction> {\n return transferCoinTransaction({ aptosConfig: this.config, ...args });\n }\n}\n"],"mappings":"yCAYO,IAAMA,EAAN,KAAW,CAChB,YAAqBC,EAAqB,CAArB,YAAAA,CAAsB,CAY3C,MAAM,wBAAwBC,EAMO,CACnC,OAAOC,EAAwB,CAAE,YAAa,KAAK,OAAQ,GAAGD,CAAK,CAAC,CACtE,CACF","names":["Coin","config","args","transferCoinTransaction"]}
@@ -0,0 +1,2 @@
1
+ import{d as e}from"./chunk-CLJLQXFQ.mjs";import{a as o,b as s,c as t,d as i,e as a,f as r}from"./chunk-GEZSEAL5.mjs";var c=class{constructor(n){this.config=n}async getTransactions(n){return o({aptosConfig:this.config,...n})}async getTransactionByVersion(n){return t({aptosConfig:this.config,...n})}async getTransactionByHash(n){return i({aptosConfig:this.config,...n})}async isPendingTransaction(n){return a({aptosConfig:this.config,...n})}async waitForTransaction(n){return r({aptosConfig:this.config,...n})}async getGasPriceEstimation(){return s({aptosConfig:this.config})}getSigningMessage(n){return e(n)}};export{c as a};
2
+ //# sourceMappingURL=chunk-5ZVCSKFX.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/api/transaction.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { AptosConfig } from \"./aptosConfig\";\nimport {\n getGasPriceEstimation,\n getTransactionByHash,\n getTransactionByVersion,\n getTransactions,\n isTransactionPending,\n waitForTransaction,\n} from \"../internal/transaction\";\nimport {\n AnyNumber,\n CommittedTransactionResponse,\n GasEstimation,\n HexInput,\n PaginationArgs,\n TransactionResponse,\n WaitForTransactionOptions,\n} from \"../types\";\nimport { getSigningMessage } from \"../internal/transactionSubmission\";\nimport { AnyRawTransaction } from \"../transactions\";\n\nexport class Transaction {\n readonly config: AptosConfig;\n\n constructor(config: AptosConfig) {\n this.config = config;\n }\n\n /**\n * Queries on-chain transactions. This function will not return pending\n * transactions. For that, use `getTransactionsByHash`.\n *\n * @param args.options.offset The number transaction to start with\n * @param args.options.limit Number of results to return\n *\n * @returns Array of on-chain transactions\n */\n async getTransactions(args?: { options?: PaginationArgs }): Promise<TransactionResponse[]> {\n return getTransactions({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Queries on-chain transaction by version. This function will not return pending transactions.\n *\n * @param args.ledgerVersion - Transaction version is an unsigned 64-bit number.\n * @returns On-chain transaction. Only on-chain transactions have versions, so this\n * function cannot be used to query pending transactions.\n */\n async getTransactionByVersion(args: { ledgerVersion: AnyNumber }): Promise<TransactionResponse> {\n return getTransactionByVersion({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Queries on-chain transaction by transaction hash. This function will return pending transactions.\n * @param args.transactionHash - Transaction hash should be hex-encoded bytes string with 0x prefix.\n * @returns Transaction from mempool (pending) or on-chain (committed) transaction\n */\n async getTransactionByHash(args: { transactionHash: HexInput }): Promise<TransactionResponse> {\n return getTransactionByHash({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Defines if specified transaction is currently in pending state\n *\n * To create a transaction hash:\n *\n * 1. Create a hash message from the bytes: \"Aptos::Transaction\" bytes + the BCS-serialized Transaction bytes.\n * 2. Apply hash algorithm SHA3-256 to the hash message bytes.\n * 3. Hex-encode the hash bytes with 0x prefix.\n *\n * @param args.transactionHash A hash of transaction\n * @returns `true` if transaction is in pending state and `false` otherwise\n */\n async isPendingTransaction(args: { transactionHash: HexInput }): Promise<boolean> {\n return isTransactionPending({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Waits for a transaction to move past the pending state.\n *\n * There are 4 cases.\n * 1. Transaction is successfully processed and committed to the chain.\n * - The function will resolve with the transaction response from the API.\n * 2. Transaction is rejected for some reason, and is therefore not committed to the blockchain.\n * - The function will throw an AptosApiError with an HTTP status code indicating some problem with the request.\n * 3. Transaction is committed but execution failed, meaning no changes were\n * written to the blockchain state.\n * - If `checkSuccess` is true, the function will throw a FailedTransactionError\n * If `checkSuccess` is false, the function will resolve with the transaction response where the `success` field is false.\n * 4. Transaction does not move past the pending state within `args.options.timeoutSecs` seconds.\n * - The function will throw a WaitForTransactionError\n *\n *\n * @param args.transactionHash The hash of a transaction previously submitted to the blockchain.\n * @param args.options.timeoutSecs Timeout in seconds. Defaults to 20 seconds.\n * @param args.options.checkSuccess A boolean which controls whether the function will error if the transaction failed.\n * Defaults to true. See case 3 above.\n * @returns The transaction on-chain. See above for more details.\n */\n async waitForTransaction(args: {\n transactionHash: HexInput;\n options?: WaitForTransactionOptions;\n }): Promise<CommittedTransactionResponse> {\n return waitForTransaction({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Gives an estimate of the gas unit price required to get a\n * transaction on chain in a reasonable amount of time.\n * For more information {@link https://fullnode.mainnet.aptoslabs.com/v1/spec#/operations/estimate_gas_price}\n *\n * @returns Object holding the outputs of the estimate gas API\n * @example\n * ```\n * {\n * gas_estimate: number;\n * deprioritized_gas_estimate?: number;\n * prioritized_gas_estimate?: number;\n * }\n * ```\n */\n async getGasPriceEstimation(): Promise<GasEstimation> {\n return getGasPriceEstimation({\n aptosConfig: this.config,\n });\n }\n\n /**\n * Returns a signing message for a transaction.\n *\n * This allows a user to sign a transaction using their own preferred signing method, and\n * then submit it to the network.\n * @param args.transaction A raw transaction for signing elsewhere\n */\n // eslint-disable-next-line class-methods-use-this\n getSigningMessage(args: { transaction: AnyRawTransaction }): Uint8Array {\n return getSigningMessage(args);\n }\n}\n"],"mappings":"qHAwBO,IAAMA,EAAN,KAAkB,CAGvB,YAAYC,EAAqB,CAC/B,KAAK,OAASA,CAChB,CAWA,MAAM,gBAAgBC,EAAqE,CACzF,OAAOC,EAAgB,CACrB,YAAa,KAAK,OAClB,GAAGD,CACL,CAAC,CACH,CASA,MAAM,wBAAwBA,EAAkE,CAC9F,OAAOE,EAAwB,CAC7B,YAAa,KAAK,OAClB,GAAGF,CACL,CAAC,CACH,CAOA,MAAM,qBAAqBA,EAAmE,CAC5F,OAAOG,EAAqB,CAC1B,YAAa,KAAK,OAClB,GAAGH,CACL,CAAC,CACH,CAcA,MAAM,qBAAqBA,EAAuD,CAChF,OAAOI,EAAqB,CAC1B,YAAa,KAAK,OAClB,GAAGJ,CACL,CAAC,CACH,CAwBA,MAAM,mBAAmBA,EAGiB,CACxC,OAAOK,EAAmB,CACxB,YAAa,KAAK,OAClB,GAAGL,CACL,CAAC,CACH,CAiBA,MAAM,uBAAgD,CACpD,OAAOM,EAAsB,CAC3B,YAAa,KAAK,MACpB,CAAC,CACH,CAUA,kBAAkBN,EAAsD,CACtE,OAAOO,EAAkBP,CAAI,CAC/B,CACF","names":["Transaction","config","args","getTransactions","getTransactionByVersion","getTransactionByHash","isTransactionPending","waitForTransaction","getGasPriceEstimation","getSigningMessage"]}
@@ -1,2 +1,2 @@
1
- import{a as i}from"./chunk-BPYLPPEQ.mjs";import{a as r}from"./chunk-HA6JD5R6.mjs";var t=class l extends r{constructor(e){super();this.value=new i(e)}serialize(e){e.serialize(this.value)}serializeForEntryFunction(e){e.serializeU32AsUleb128(this.value.value.length),e.serialize(this)}static deserialize(e,s){let a=i.deserialize(e,s);return new l(a.value)}};export{t as a};
2
- //# sourceMappingURL=chunk-HVADSXTB.mjs.map
1
+ import{a as i}from"./chunk-PL2VA73L.mjs";import{a as r}from"./chunk-F6K26WV5.mjs";var t=class l extends r{constructor(e){super();this.value=new i(e)}serialize(e){e.serialize(this.value)}serializeForEntryFunction(e){e.serializeU32AsUleb128(this.value.value.length),e.serialize(this)}static deserialize(e,s){let a=i.deserialize(e,s);return new l(a.value)}};export{t as a};
2
+ //# sourceMappingURL=chunk-73VWOS4Z.mjs.map
@@ -0,0 +1,2 @@
1
+ var p=(i=>(i.JSON="application/json",i.BCS="application/x-bcs",i.BCS_SIGNED_TRANSACTION="application/x.aptos.signed_transaction+bcs",i))(p||{}),a=(t=>(t[t.Bool=0]="Bool",t[t.U8=1]="U8",t[t.U64=2]="U64",t[t.U128=3]="U128",t[t.Address=4]="Address",t[t.Signer=5]="Signer",t[t.Vector=6]="Vector",t[t.Struct=7]="Struct",t[t.U16=8]="U16",t[t.U32=9]="U32",t[t.U256=10]="U256",t[t.Reference=254]="Reference",t[t.Generic=255]="Generic",t))(a||{}),g=(o=>(o[o.U8=0]="U8",o[o.U64=1]="U64",o[o.U128=2]="U128",o[o.Address=3]="Address",o[o.U8Vector=4]="U8Vector",o[o.Bool=5]="Bool",o[o.U16=6]="U16",o[o.U32=7]="U32",o[o.U256=8]="U256",o))(g||{}),y=(i=>(i[i.Script=0]="Script",i[i.EntryFunction=2]="EntryFunction",i[i.Multisig=3]="Multisig",i))(y||{}),u=(r=>(r[r.MultiAgentTransaction=0]="MultiAgentTransaction",r[r.FeePayerTransaction=1]="FeePayerTransaction",r))(u||{}),d=(e=>(e[e.Ed25519=0]="Ed25519",e[e.MultiEd25519=1]="MultiEd25519",e[e.MultiAgent=2]="MultiAgent",e[e.FeePayer=3]="FeePayer",e[e.SingleSender=4]="SingleSender",e))(d||{}),c=(n=>(n[n.Ed25519=0]="Ed25519",n[n.MultiEd25519=1]="MultiEd25519",n[n.SingleKey=2]="SingleKey",n[n.MultiKey=3]="MultiKey",n))(c||{}),l=(r=>(r[r.Ed25519=0]="Ed25519",r[r.Secp256k1=1]="Secp256k1",r))(l||{}),_=(r=>(r[r.Ed25519=0]="Ed25519",r[r.Secp256k1=1]="Secp256k1",r))(_||{}),x=(e=>(e.Pending="pending_transaction",e.User="user_transaction",e.Genesis="genesis_transaction",e.BlockMetadata="block_metadata_transaction",e.StateCheckpoint="state_checkpoint_transaction",e))(x||{});function b(s){return s.type==="pending_transaction"}function k(s){return s.type==="user_transaction"}function f(s){return s.type==="genesis_transaction"}function E(s){return s.type==="block_metadata_transaction"}function C(s){return s.type==="state_checkpoint_transaction"}function U(s){return"signature"in s&&s.signature==="ed25519_signature"}function T(s){return"signature"in s&&s.signature==="secp256k1_ecdsa_signature"}function A(s){return s.type==="multi_agent_signature"}function W(s){return s.type==="fee_payer_signature"}function P(s){return s.type==="multi_ed25519_signature"}var v=(i=>(i.PRIVATE="private",i.PUBLIC="public",i.FRIEND="friend",i))(v||{}),M=(n=>(n.STORE="store",n.DROP="drop",n.KEY="key",n.COPY="copy",n))(M||{}),h=(r=>(r.VALIDATOR="validator",r.FULL_NODE="full_node",r))(h||{}),m=(n=>(n[n.Ed25519=0]="Ed25519",n[n.MultiEd25519=1]="MultiEd25519",n[n.SingleKey=2]="SingleKey",n[n.MultiKey=3]="MultiKey",n))(m||{}),R=(r=>(r[r.Ed25519=0]="Ed25519",r[r.Secp256k1Ecdsa=2]="Secp256k1Ecdsa",r))(R||{}),S=(e=>(e[e.DeriveAuid=251]="DeriveAuid",e[e.DeriveObjectAddressFromObject=252]="DeriveObjectAddressFromObject",e[e.DeriveObjectAddressFromGuid=253]="DeriveObjectAddressFromGuid",e[e.DeriveObjectAddressFromSeed=254]="DeriveObjectAddressFromSeed",e[e.DeriveResourceAccountAddress=255]="DeriveResourceAccountAddress",e))(S||{});export{p as a,a as b,g as c,y as d,u as e,d as f,c as g,l as h,_ as i,x as j,b as k,k as l,f as m,E as n,C as o,U as p,T as q,A as r,W as s,P as t,v as u,M as v,h as w,m as x,R as y,S as z};
2
+ //# sourceMappingURL=chunk-ALFESCPU.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/types/index.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Network } from \"../utils/apiEndpoints\";\nimport { OrderBy, TokenStandard } from \"./indexer\";\n\nexport * from \"./indexer\";\n\nexport enum MimeType {\n /**\n * JSON representation, used for transaction submission and accept type JSON output\n */\n JSON = \"application/json\",\n /**\n * BCS representation, used for accept type BCS output\n */\n BCS = \"application/x-bcs\",\n /**\n * BCS representation, used for transaction submission in BCS input\n */\n BCS_SIGNED_TRANSACTION = \"application/x.aptos.signed_transaction+bcs\",\n}\n\n/**\n * Hex data as input to a function\n */\nexport type HexInput = string | Uint8Array;\n\n/**\n * TypeTag enum as they are represented in Rust\n * {@link https://github.com/aptos-labs/aptos-core/blob/main/third_party/move/move-core/types/src/language_storage.rs#L27}\n */\nexport enum TypeTagVariants {\n Bool = 0,\n U8 = 1,\n U64 = 2,\n U128 = 3,\n Address = 4,\n Signer = 5,\n Vector = 6,\n Struct = 7,\n U16 = 8,\n U32 = 9,\n U256 = 10,\n Reference = 254, // This is specifically a placeholder and does not represent a real type\n Generic = 255, // This is specifically a placeholder and does not represent a real type\n}\n\n/**\n * Script transaction arguments enum as they are represented in Rust\n * {@link https://github.com/aptos-labs/aptos-core/blob/main/third_party/move/move-core/types/src/transaction_argument.rs#L11}\n */\nexport enum ScriptTransactionArgumentVariants {\n U8 = 0,\n U64 = 1,\n U128 = 2,\n Address = 3,\n U8Vector = 4,\n Bool = 5,\n U16 = 6,\n U32 = 7,\n U256 = 8,\n}\n\n/**\n * Transaction payload enum as they are represented in Rust\n * {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/mod.rs#L478}\n */\nexport enum TransactionPayloadVariants {\n Script = 0,\n EntryFunction = 2,\n Multisig = 3,\n}\n\n/**\n * Transaction variants enum as they are represented in Rust\n * {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/mod.rs#L440}\n */\nexport enum TransactionVariants {\n MultiAgentTransaction = 0,\n FeePayerTransaction = 1,\n}\n\n/**\n * Transaction Authenticator enum as they are represented in Rust\n * {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/authenticator.rs#L44}\n */\nexport enum TransactionAuthenticatorVariant {\n Ed25519 = 0,\n MultiEd25519 = 1,\n MultiAgent = 2,\n FeePayer = 3,\n SingleSender = 4,\n}\n\n/**\n * Transaction Authenticator enum as they are represented in Rust\n * {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/authenticator.rs#L414}\n */\nexport enum AccountAuthenticatorVariant {\n Ed25519 = 0,\n MultiEd25519 = 1,\n SingleKey = 2,\n MultiKey = 3,\n}\n\nexport enum AnyPublicKeyVariant {\n Ed25519 = 0,\n Secp256k1 = 1,\n}\n\nexport enum AnySignatureVariant {\n Ed25519 = 0,\n Secp256k1 = 1,\n}\n\n/**\n * BCS types\n */\nexport type Uint8 = number;\nexport type Uint16 = number;\nexport type Uint32 = number;\nexport type Uint64 = bigint;\nexport type Uint128 = bigint;\nexport type Uint256 = bigint;\nexport type AnyNumber = number | bigint;\n\n/**\n * Set of configuration options that can be provided when initializing the SDK.\n * The purpose of these options is to configure various aspects of the SDK's\n * behavior and interaction with the Aptos network\n */\nexport type AptosSettings = {\n readonly network?: Network;\n\n readonly fullnode?: string;\n\n readonly faucet?: string;\n\n readonly indexer?: string;\n\n readonly clientConfig?: ClientConfig;\n\n readonly client?: Client;\n};\n\n/**\n *\n * Controls the number of results that are returned and the starting position of those results.\n * @param offset parameter specifies the starting position of the query result within the set of data. Default is 0.\n * @param limit specifies the maximum number of items or records to return in a query result. Default is 25.\n */\nexport interface PaginationArgs {\n offset?: AnyNumber;\n limit?: number;\n}\n\nexport interface TokenStandardArg {\n tokenStandard?: TokenStandard;\n}\n\nexport interface OrderByArg<T extends {}> {\n orderBy?: OrderBy<T>;\n}\n\nexport interface WhereArg<T extends {}> {\n where?: T;\n}\n\n/**\n * QUERY TYPES\n */\n\n/**\n * A configuration object we can pass with the request to the server.\n *\n * @param AUTH_TOKEN - an auth token to send with a faucet request\n * @param API_KEY - api key generated from developer portal {@link https://developers.aptoslabs.com/manage/api-keys}}\n * @param HEADERS - extra headers we want to send with the request\n * @param WITH_CREDENTIALS - whether to carry cookies. By default, it is set to true and cookies will be sent\n */\nexport type ClientConfig = {\n AUTH_TOKEN?: string;\n API_KEY?: string;\n HEADERS?: Record<string, string | number | boolean>;\n WITH_CREDENTIALS?: boolean;\n};\n\nexport interface ClientRequest<Req> {\n url: string;\n method: \"GET\" | \"POST\";\n body?: Req;\n contentType?: string;\n params?: any;\n overrides?: ClientConfig;\n headers?: Record<string, any>;\n}\n\nexport interface ClientResponse<Res> {\n status: number;\n statusText: string;\n data: Res;\n config?: any;\n request?: any;\n response?: any;\n headers?: any;\n}\n\nexport interface Client {\n provider<Req, Res>(requestOptions: ClientRequest<Req>): Promise<ClientResponse<Res>>;\n}\n\n/**\n * The API request type\n *\n * @param url - the url to make the request to, i.e https://fullnode.aptoslabs.devnet.com/v1\n * @param method - the request method \"GET\" | \"POST\"\n * @param endpoint (optional) - the endpoint to make the request to, i.e transactions\n * @param body (optional) - the body of the request\n * @param contentType (optional) - the content type to set the `content-type` header to,\n * by default is set to `application/json`\n * @param params (optional) - query params to add to the request\n * @param originMethod (optional) - the local method the request came from\n * @param overrides (optional) - a `ClientConfig` object type to override request data\n */\nexport type AptosRequest = {\n url: string;\n method: \"GET\" | \"POST\";\n path?: string;\n body?: any;\n contentType?: string;\n acceptType?: string;\n params?: Record<string, string | AnyNumber | boolean | undefined>;\n originMethod?: string;\n overrides?: ClientConfig;\n};\n\n/**\n * Specifies ledger version of transactions. By default latest version will be used\n */\nexport type LedgerVersionArg = {\n ledgerVersion?: AnyNumber;\n};\n\n/**\n * RESPONSE TYPES\n */\n\n/**\n * Type holding the outputs of the estimate gas API\n */\nexport type GasEstimation = {\n /**\n * The deprioritized estimate for the gas unit price\n */\n deprioritized_gas_estimate?: number;\n /**\n * The current estimate for the gas unit price\n */\n gas_estimate: number;\n /**\n * The prioritized estimate for the gas unit price\n */\n prioritized_gas_estimate?: number;\n};\n\nexport type MoveResource = {\n type: MoveStructId;\n data: {};\n};\n\nexport type AccountData = {\n sequence_number: string;\n authentication_key: string;\n};\n\nexport type MoveModuleBytecode = {\n bytecode: string;\n abi?: MoveModule;\n};\n\n/**\n * TRANSACTION TYPES\n */\n\nexport enum TransactionResponseType {\n Pending = \"pending_transaction\",\n User = \"user_transaction\",\n Genesis = \"genesis_transaction\",\n BlockMetadata = \"block_metadata_transaction\",\n StateCheckpoint = \"state_checkpoint_transaction\",\n}\n\nexport type TransactionResponse = PendingTransactionResponse | CommittedTransactionResponse;\nexport type CommittedTransactionResponse =\n | UserTransactionResponse\n | GenesisTransactionResponse\n | BlockMetadataTransactionResponse\n | StateCheckpointTransactionResponse;\n\nexport function isPendingTransactionResponse(response: TransactionResponse): response is PendingTransactionResponse {\n return response.type === TransactionResponseType.Pending;\n}\n\nexport function isUserTransactionResponse(response: TransactionResponse): response is UserTransactionResponse {\n return response.type === TransactionResponseType.User;\n}\n\nexport function isGenesisTransactionResponse(response: TransactionResponse): response is GenesisTransactionResponse {\n return response.type === TransactionResponseType.Genesis;\n}\n\nexport function isBlockMetadataTransactionResponse(\n response: TransactionResponse,\n): response is BlockMetadataTransactionResponse {\n return response.type === TransactionResponseType.BlockMetadata;\n}\n\nexport function isStateCheckpointTransactionResponse(\n response: TransactionResponse,\n): response is StateCheckpointTransactionResponse {\n return response.type === TransactionResponseType.StateCheckpoint;\n}\n\nexport type PendingTransactionResponse = {\n type: TransactionResponseType.Pending;\n hash: string;\n sender: string;\n sequence_number: string;\n max_gas_amount: string;\n gas_unit_price: string;\n expiration_timestamp_secs: string;\n payload: TransactionPayloadResponse;\n signature?: TransactionSignature;\n};\n\nexport type UserTransactionResponse = {\n type: TransactionResponseType.User;\n version: string;\n hash: string;\n state_change_hash: string;\n event_root_hash: string;\n state_checkpoint_hash?: string;\n gas_used: string;\n /**\n * Whether the transaction was successful\n */\n success: boolean;\n /**\n * The VM status of the transaction, can tell useful information in a failure\n */\n vm_status: string;\n accumulator_root_hash: string;\n /**\n * Final state of resources changed by the transaction\n */\n changes: Array<WriteSetChange>;\n sender: string;\n sequence_number: string;\n max_gas_amount: string;\n gas_unit_price: string;\n expiration_timestamp_secs: string;\n payload: TransactionPayloadResponse;\n signature?: TransactionSignature;\n /**\n * Events generated by the transaction\n */\n events: Array<Event>;\n timestamp: string;\n};\n\nexport type GenesisTransactionResponse = {\n type: TransactionResponseType.Genesis;\n version: string;\n hash: string;\n state_change_hash: string;\n event_root_hash: string;\n state_checkpoint_hash?: string;\n gas_used: string;\n /**\n * Whether the transaction was successful\n */\n success: boolean;\n /**\n * The VM status of the transaction, can tell useful information in a failure\n */\n vm_status: string;\n accumulator_root_hash: string;\n /**\n * Final state of resources changed by the transaction\n */\n changes: Array<WriteSetChange>;\n payload: GenesisPayload;\n /**\n * Events emitted during genesis\n */\n events: Array<Event>;\n};\n\nexport type BlockMetadataTransactionResponse = {\n type: TransactionResponseType.BlockMetadata;\n version: string;\n hash: string;\n state_change_hash: string;\n event_root_hash: string;\n state_checkpoint_hash?: string;\n gas_used: string;\n /**\n * Whether the transaction was successful\n */\n success: boolean;\n /**\n * The VM status of the transaction, can tell useful information in a failure\n */\n vm_status: string;\n accumulator_root_hash: string;\n /**\n * Final state of resources changed by the transaction\n */\n changes: Array<WriteSetChange>;\n id: string;\n epoch: string;\n round: string;\n /**\n * The events emitted at the block creation\n */\n events: Array<Event>;\n /**\n * Previous block votes\n */\n previous_block_votes_bitvec: Array<number>;\n proposer: string;\n /**\n * The indices of the proposers who failed to propose\n */\n failed_proposer_indices: Array<number>;\n timestamp: string;\n};\n\nexport type StateCheckpointTransactionResponse = {\n type: TransactionResponseType.StateCheckpoint;\n version: string;\n hash: string;\n state_change_hash: string;\n event_root_hash: string;\n state_checkpoint_hash?: string;\n gas_used: string;\n /**\n * Whether the transaction was successful\n */\n success: boolean;\n /**\n * The VM status of the transaction, can tell useful information in a failure\n */\n vm_status: string;\n accumulator_root_hash: string;\n /**\n * Final state of resources changed by the transaction\n */\n changes: Array<WriteSetChange>;\n timestamp: string;\n};\n\n/**\n * WRITESET CHANGE TYPES\n */\n\nexport type WriteSetChange =\n | WriteSetChangeDeleteModule\n | WriteSetChangeDeleteResource\n | WriteSetChangeDeleteTableItem\n | WriteSetChangeWriteModule\n | WriteSetChangeWriteResource\n | WriteSetChangeWriteTableItem;\n\nexport type WriteSetChangeDeleteModule = {\n type: string;\n address: string;\n /**\n * State key hash\n */\n state_key_hash: string;\n module: MoveModuleId;\n};\n\nexport type WriteSetChangeDeleteResource = {\n type: string;\n address: string;\n state_key_hash: string;\n resource: string;\n};\n\nexport type WriteSetChangeDeleteTableItem = {\n type: string;\n state_key_hash: string;\n handle: string;\n key: string;\n data?: DeletedTableData;\n};\n\nexport type WriteSetChangeWriteModule = {\n type: string;\n address: string;\n state_key_hash: string;\n data: MoveModuleBytecode;\n};\n\nexport type WriteSetChangeWriteResource = {\n type: string;\n address: string;\n state_key_hash: string;\n data: MoveResource;\n};\n\nexport type WriteSetChangeWriteTableItem = {\n type: string;\n state_key_hash: string;\n handle: string;\n key: string;\n value: string;\n data?: DecodedTableData;\n};\n\nexport type DecodedTableData = {\n /**\n * Key of table in JSON\n */\n key: any;\n /**\n * Type of key\n */\n key_type: string;\n /**\n * Value of table in JSON\n */\n value: any;\n /**\n * Type of value\n */\n value_type: string;\n};\n\n/**\n * Deleted table data\n */\nexport type DeletedTableData = {\n /**\n * Deleted key\n */\n key: any;\n /**\n * Deleted key type\n */\n key_type: string;\n};\n\nexport type TransactionPayloadResponse = EntryFunctionPayloadResponse | ScriptPayloadResponse | MultisigPayloadResponse;\n\nexport type EntryFunctionPayloadResponse = {\n type: string;\n function: MoveFunctionId;\n /**\n * Type arguments of the function\n */\n type_arguments: Array<string>;\n /**\n * Arguments of the function\n */\n arguments: Array<any>;\n};\n\nexport type ScriptPayloadResponse = {\n type: string;\n code: MoveScriptBytecode;\n /**\n * Type arguments of the function\n */\n type_arguments: Array<string>;\n /**\n * Arguments of the function\n */\n arguments: Array<any>;\n};\n\nexport type MultisigPayloadResponse = {\n type: string;\n multisig_address: string;\n transaction_payload?: EntryFunctionPayloadResponse;\n};\n\nexport type GenesisPayload = {\n type: string;\n write_set: WriteSet;\n};\n\n/**\n * Move script bytecode\n */\nexport type MoveScriptBytecode = {\n bytecode: string;\n abi?: MoveFunction;\n};\n\n/**\n * These are the JSON representations of transaction signatures returned from the node API.\n */\nexport type TransactionSignature =\n | TransactionEd25519Signature\n | TransactionSecp256k1Signature\n | TransactionMultiEd25519Signature\n | TransactionMultiAgentSignature\n | TransactionFeePayerSignature;\n\nexport function isEd25519Signature(signature: TransactionSignature): signature is TransactionFeePayerSignature {\n return \"signature\" in signature && signature.signature === \"ed25519_signature\";\n}\n\nexport function isSecp256k1Signature(signature: TransactionSignature): signature is TransactionFeePayerSignature {\n return \"signature\" in signature && signature.signature === \"secp256k1_ecdsa_signature\";\n}\n\nexport function isMultiAgentSignature(signature: TransactionSignature): signature is TransactionMultiAgentSignature {\n return signature.type === \"multi_agent_signature\";\n}\n\nexport function isFeePayerSignature(signature: TransactionSignature): signature is TransactionFeePayerSignature {\n return signature.type === \"fee_payer_signature\";\n}\n\nexport function isMultiEd25519Signature(\n signature: TransactionSignature,\n): signature is TransactionMultiEd25519Signature {\n return signature.type === \"multi_ed25519_signature\";\n}\n\nexport type TransactionEd25519Signature = {\n type: string;\n public_key: string;\n signature: \"ed25519_signature\";\n};\n\nexport type TransactionSecp256k1Signature = {\n type: string;\n public_key: string;\n signature: \"secp256k1_ecdsa_signature\";\n};\n\nexport type TransactionMultiEd25519Signature = {\n type: \"multi_ed25519_signature\";\n /**\n * The public keys for the Ed25519 signature\n */\n public_keys: Array<string>;\n /**\n * Signature associated with the public keys in the same order\n */\n signatures: Array<string>;\n /**\n * The number of signatures required for a successful transaction\n */\n threshold: number;\n bitmap: string;\n};\n\nexport type TransactionMultiAgentSignature = {\n type: \"multi_agent_signature\";\n sender: AccountSignature;\n /**\n * The other involved parties' addresses\n */\n secondary_signer_addresses: Array<string>;\n /**\n * The associated signatures, in the same order as the secondary addresses\n */\n secondary_signers: Array<AccountSignature>;\n};\n\nexport type TransactionFeePayerSignature = {\n type: \"fee_payer_signature\";\n sender: AccountSignature;\n /**\n * The other involved parties' addresses\n */\n secondary_signer_addresses: Array<string>;\n /**\n * The associated signatures, in the same order as the secondary addresses\n */\n secondary_signers: Array<AccountSignature>;\n fee_payer_address: string;\n fee_payer_signer: AccountSignature;\n};\n\n/**\n * The union of all single account signatures.\n */\nexport type AccountSignature =\n | TransactionEd25519Signature\n | TransactionSecp256k1Signature\n | TransactionMultiEd25519Signature;\n\nexport type WriteSet = ScriptWriteSet | DirectWriteSet;\n\nexport type ScriptWriteSet = {\n type: string;\n execute_as: string;\n script: ScriptPayloadResponse;\n};\n\nexport type DirectWriteSet = {\n type: string;\n changes: Array<WriteSetChange>;\n events: Array<Event>;\n};\n\nexport type EventGuid = {\n creation_number: string;\n account_address: string;\n};\n\nexport type Event = {\n guid: EventGuid;\n sequence_number: string;\n type: string;\n /**\n * The JSON representation of the event\n */\n data: any;\n};\n\n/**\n * Map of Move types to local TypeScript types\n */\nexport type MoveUint8Type = number;\nexport type MoveUint16Type = number;\nexport type MoveUint32Type = number;\nexport type MoveUint64Type = string;\nexport type MoveUint128Type = string;\nexport type MoveUint256Type = string;\nexport type MoveAddressType = string;\nexport type MoveObjectType = string;\nexport type MoveOptionType = MoveType | null | undefined;\n/**\n * This is the format for a fully qualified struct, resource, or entry function in Move.\n */\nexport type MoveStructId = `${string}::${string}::${string}`;\n// These are the same, unfortunately, it reads really strangely to take a StructId for a Function and there wasn't a\n// good middle ground name.\nexport type MoveFunctionId = MoveStructId;\n\n// TODO: Add support for looking up ABI to add proper typing\nexport type MoveStructType = {};\n\nexport type MoveType =\n | boolean\n | string\n | MoveUint8Type\n | MoveUint16Type\n | MoveUint32Type\n | MoveUint64Type\n | MoveUint128Type\n | MoveUint256Type\n | MoveAddressType\n | MoveObjectType\n | MoveStructType\n | Array<MoveType>;\n\n/**\n * Possible Move values acceptable by move functions (entry, view)\n *\n * Map of a Move value to the corresponding TypeScript value\n *\n * `Bool -> boolean`\n *\n * `u8, u16, u32 -> number`\n *\n * `u64, u128, u256 -> string`\n *\n * `String -> string`\n *\n * `Address -> 0x${string}`\n *\n * `Struct - 0x${string}::${string}::${string}`\n *\n * `Object -> 0x${string}`\n *\n * `Vector -> Array<MoveValue>`\n *\n * `Option -> MoveValue | null | undefined`\n */\nexport type MoveValue =\n | boolean\n | string\n | MoveUint8Type\n | MoveUint16Type\n | MoveUint32Type\n | MoveUint64Type\n | MoveUint128Type\n | MoveUint256Type\n | MoveAddressType\n | MoveObjectType\n | MoveStructId\n | MoveOptionType\n | Array<MoveValue>;\n\n/**\n * Move module id is a string representation of Move module.\n * Module name is case-sensitive.\n */\nexport type MoveModuleId = `${string}::${string}`;\n\n/**\n * Move function visibility\n */\nexport enum MoveFunctionVisibility {\n PRIVATE = \"private\",\n PUBLIC = \"public\",\n FRIEND = \"friend\",\n}\n\n/**\n * Move function ability\n */\nexport enum MoveAbility {\n STORE = \"store\",\n DROP = \"drop\",\n KEY = \"key\",\n COPY = \"copy\",\n}\n\n/**\n * Move abilities tied to the generic type param and associated with the function that uses it\n */\nexport type MoveFunctionGenericTypeParam = {\n constraints: Array<MoveAbility>;\n};\n\n/**\n * Move struct field\n */\nexport type MoveStructField = {\n name: string;\n type: string;\n};\n\n/**\n * A Move module\n */\nexport type MoveModule = {\n address: string;\n name: string;\n /**\n * Friends of the module\n */\n friends: Array<MoveModuleId>;\n /**\n * Public functions of the module\n */\n exposed_functions: Array<MoveFunction>;\n /**\n * Structs of the module\n */\n structs: Array<MoveStruct>;\n};\n\n/**\n * A move struct\n */\nexport type MoveStruct = {\n name: string;\n /**\n * Whether the struct is a native struct of Move\n */\n is_native: boolean;\n /**\n * Abilities associated with the struct\n */\n abilities: Array<MoveAbility>;\n /**\n * Generic types associated with the struct\n */\n generic_type_params: Array<MoveFunctionGenericTypeParam>;\n /**\n * Fields associated with the struct\n */\n fields: Array<MoveStructField>;\n};\n\n/**\n * Move function\n */\nexport type MoveFunction = {\n name: string;\n visibility: MoveFunctionVisibility;\n /**\n * Whether the function can be called as an entry function directly in a transaction\n */\n is_entry: boolean;\n /**\n * Whether the function is a view function or not\n */\n is_view: boolean;\n /**\n * Generic type params associated with the Move function\n */\n generic_type_params: Array<MoveFunctionGenericTypeParam>;\n /**\n * Parameters associated with the move function\n */\n params: Array<string>;\n /**\n * Return type of the function\n */\n return: Array<string>;\n};\n\nexport enum RoleType {\n VALIDATOR = \"validator\",\n FULL_NODE = \"full_node\",\n}\n\nexport type LedgerInfo = {\n /**\n * Chain ID of the current chain\n */\n chain_id: number;\n epoch: string;\n ledger_version: string;\n oldest_ledger_version: string;\n ledger_timestamp: string;\n node_role: RoleType;\n oldest_block_height: string;\n block_height: string;\n /**\n * Git hash of the build of the API endpoint. Can be used to determine the exact\n * software version used by the API endpoint.\n */\n git_hash?: string;\n};\n\n/**\n * A Block type\n */\nexport type Block = {\n block_height: string;\n block_hash: string;\n block_timestamp: string;\n first_version: string;\n last_version: string;\n /**\n * The transactions in the block in sequential order\n */\n transactions?: Array<TransactionResponse>;\n};\n\n/**\n * The data needed to generate a View Request payload\n */\nexport type InputViewRequestData = {\n function: MoveFunctionId;\n typeArguments?: Array<MoveStructId>;\n functionArguments?: Array<MoveValue>;\n};\n\n// REQUEST TYPES\n\n/**\n * View request for the Move view function API\n *\n * `type MoveFunctionId = ${string}::${string}::${string}`;\n */\nexport type ViewRequest = {\n function: MoveFunctionId;\n /**\n * Type arguments of the function\n */\n typeArguments: Array<MoveStructId>;\n /**\n * Arguments of the function\n */\n functionArguments: Array<MoveValue>;\n};\n\n/**\n * Table Item request for the GetTableItem API\n */\nexport type TableItemRequest = {\n key_type: MoveValue;\n value_type: MoveValue;\n /**\n * The value of the table item's key\n */\n key: any;\n};\n\n/**\n * A list of Authentication Key schemes that are supported by Aptos.\n *\n * They are combinations of signing schemes and derive schemes.\n */\nexport type AuthenticationKeyScheme = SigningScheme | DeriveScheme;\n\nexport enum SigningScheme {\n /**\n * For Ed25519PublicKey\n */\n Ed25519 = 0,\n /**\n * For MultiEd25519PublicKey\n */\n MultiEd25519 = 1,\n /**\n * For SingleKey ecdsa\n */\n SingleKey = 2,\n\n MultiKey = 3,\n}\n\nexport enum SigningSchemeInput {\n /**\n * For Ed25519PublicKey\n */\n Ed25519 = 0,\n /**\n * For Secp256k1Ecdsa\n */\n Secp256k1Ecdsa = 2,\n}\n\n/**\n * Scheme used for deriving account addresses from other data\n */\nexport enum DeriveScheme {\n /**\n * Derives an address using an AUID, used for objects\n */\n DeriveAuid = 251,\n /**\n * Derives an address from another object address\n */\n DeriveObjectAddressFromObject = 252,\n /**\n * Derives an address from a GUID, used for objects\n */\n DeriveObjectAddressFromGuid = 253,\n /**\n * Derives an address from seed bytes, used for named objects\n */\n DeriveObjectAddressFromSeed = 254,\n /**\n * Derives an address from seed bytes, used for resource accounts\n */\n DeriveResourceAccountAddress = 255,\n}\n\n/**\n * Option properties to pass for waitForTransaction() function\n */\nexport type WaitForTransactionOptions = {\n timeoutSecs?: number;\n checkSuccess?: boolean;\n waitForIndexer?: boolean;\n};\n\n/**\n * Input type to generate an account using Single Signer\n * Ed25519 or Legacy Ed25519\n */\nexport type GenerateAccountWithEd25519 = {\n scheme: SigningSchemeInput.Ed25519;\n legacy: boolean;\n};\n\n/**\n * Input type to generate an account using Single Signer\n * Secp256k1\n */\nexport type GenerateAccountWithSingleSignerSecp256k1Key = {\n scheme: SigningSchemeInput.Secp256k1Ecdsa;\n legacy?: false;\n};\n\nexport type GenerateAccount = GenerateAccountWithEd25519 | GenerateAccountWithSingleSignerSecp256k1Key;\n"],"mappings":"AAQO,IAAKA,OAIVA,EAAA,KAAO,mBAIPA,EAAA,IAAM,oBAINA,EAAA,uBAAyB,6CAZfA,OAAA,IAwBAC,OACVA,IAAA,KAAO,GAAP,OACAA,IAAA,GAAK,GAAL,KACAA,IAAA,IAAM,GAAN,MACAA,IAAA,KAAO,GAAP,OACAA,IAAA,QAAU,GAAV,UACAA,IAAA,OAAS,GAAT,SACAA,IAAA,OAAS,GAAT,SACAA,IAAA,OAAS,GAAT,SACAA,IAAA,IAAM,GAAN,MACAA,IAAA,IAAM,GAAN,MACAA,IAAA,KAAO,IAAP,OACAA,IAAA,UAAY,KAAZ,YACAA,IAAA,QAAU,KAAV,UAbUA,OAAA,IAoBAC,OACVA,IAAA,GAAK,GAAL,KACAA,IAAA,IAAM,GAAN,MACAA,IAAA,KAAO,GAAP,OACAA,IAAA,QAAU,GAAV,UACAA,IAAA,SAAW,GAAX,WACAA,IAAA,KAAO,GAAP,OACAA,IAAA,IAAM,GAAN,MACAA,IAAA,IAAM,GAAN,MACAA,IAAA,KAAO,GAAP,OATUA,OAAA,IAgBAC,OACVA,IAAA,OAAS,GAAT,SACAA,IAAA,cAAgB,GAAhB,gBACAA,IAAA,SAAW,GAAX,WAHUA,OAAA,IAUAC,OACVA,IAAA,sBAAwB,GAAxB,wBACAA,IAAA,oBAAsB,GAAtB,sBAFUA,OAAA,IASAC,OACVA,IAAA,QAAU,GAAV,UACAA,IAAA,aAAe,GAAf,eACAA,IAAA,WAAa,GAAb,aACAA,IAAA,SAAW,GAAX,WACAA,IAAA,aAAe,GAAf,eALUA,OAAA,IAYAC,OACVA,IAAA,QAAU,GAAV,UACAA,IAAA,aAAe,GAAf,eACAA,IAAA,UAAY,GAAZ,YACAA,IAAA,SAAW,GAAX,WAJUA,OAAA,IAOAC,OACVA,IAAA,QAAU,GAAV,UACAA,IAAA,UAAY,GAAZ,YAFUA,OAAA,IAKAC,OACVA,IAAA,QAAU,GAAV,UACAA,IAAA,UAAY,GAAZ,YAFUA,OAAA,IA8KAC,OACVA,EAAA,QAAU,sBACVA,EAAA,KAAO,mBACPA,EAAA,QAAU,sBACVA,EAAA,cAAgB,6BAChBA,EAAA,gBAAkB,+BALRA,OAAA,IAeL,SAASC,EAA6BC,EAAuE,CAClH,OAAOA,EAAS,OAAS,qBAC3B,CAEO,SAASC,EAA0BD,EAAoE,CAC5G,OAAOA,EAAS,OAAS,kBAC3B,CAEO,SAASE,EAA6BF,EAAuE,CAClH,OAAOA,EAAS,OAAS,qBAC3B,CAEO,SAASG,EACdH,EAC8C,CAC9C,OAAOA,EAAS,OAAS,4BAC3B,CAEO,SAASI,EACdJ,EACgD,CAChD,OAAOA,EAAS,OAAS,8BAC3B,CAmSO,SAASK,EAAmBC,EAA4E,CAC7G,MAAO,cAAeA,GAAaA,EAAU,YAAc,mBAC7D,CAEO,SAASC,EAAqBD,EAA4E,CAC/G,MAAO,cAAeA,GAAaA,EAAU,YAAc,2BAC7D,CAEO,SAASE,EAAsBF,EAA8E,CAClH,OAAOA,EAAU,OAAS,uBAC5B,CAEO,SAASG,EAAoBH,EAA4E,CAC9G,OAAOA,EAAU,OAAS,qBAC5B,CAEO,SAASI,EACdJ,EAC+C,CAC/C,OAAOA,EAAU,OAAS,yBAC5B,CAoLO,IAAKK,OACVA,EAAA,QAAU,UACVA,EAAA,OAAS,SACTA,EAAA,OAAS,SAHCA,OAAA,IASAC,OACVA,EAAA,MAAQ,QACRA,EAAA,KAAO,OACPA,EAAA,IAAM,MACNA,EAAA,KAAO,OAJGA,OAAA,IA6FAC,OACVA,EAAA,UAAY,YACZA,EAAA,UAAY,YAFFA,OAAA,IAsFAC,OAIVA,IAAA,QAAU,GAAV,UAIAA,IAAA,aAAe,GAAf,eAIAA,IAAA,UAAY,GAAZ,YAEAA,IAAA,SAAW,GAAX,WAdUA,OAAA,IAiBAC,OAIVA,IAAA,QAAU,GAAV,UAIAA,IAAA,eAAiB,GAAjB,iBARUA,OAAA,IAcAC,OAIVA,IAAA,WAAa,KAAb,aAIAA,IAAA,8BAAgC,KAAhC,gCAIAA,IAAA,4BAA8B,KAA9B,8BAIAA,IAAA,4BAA8B,KAA9B,8BAIAA,IAAA,6BAA+B,KAA/B,+BApBUA,OAAA","names":["MimeType","TypeTagVariants","ScriptTransactionArgumentVariants","TransactionPayloadVariants","TransactionVariants","TransactionAuthenticatorVariant","AccountAuthenticatorVariant","AnyPublicKeyVariant","AnySignatureVariant","TransactionResponseType","isPendingTransactionResponse","response","isUserTransactionResponse","isGenesisTransactionResponse","isBlockMetadataTransactionResponse","isStateCheckpointTransactionResponse","isEd25519Signature","signature","isSecp256k1Signature","isMultiAgentSignature","isFeePayerSignature","isMultiEd25519Signature","MoveFunctionVisibility","MoveAbility","RoleType","SigningScheme","SigningSchemeInput","DeriveScheme"]}
@@ -0,0 +1,2 @@
1
+ import{g as e}from"./chunk-GEZSEAL5.mjs";async function m(o){if(o.minimumLedgerVersion!==void 0){let r=[];for(let i of o.processorTypes)r.push(e({aptosConfig:o.config,minimumLedgerVersion:o.minimumLedgerVersion,processorType:i}));await Promise.all(r)}}export{m as a};
2
+ //# sourceMappingURL=chunk-APSQ4M23.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/api/utils.ts"],"sourcesContent":["import { waitForIndexer } from \"../internal/transaction\";\nimport { ProcessorType } from \"../utils\";\nimport { AptosConfig } from \"./aptosConfig\";\nimport { AnyNumber } from \"../types\";\n\n/**\n * Utility function to handle optional waiting on indexer for APIs\n *\n * This is purposely placed here to not expose this internal function.\n * @param args\n */\nexport async function waitForIndexerOnVersion(args: {\n config: AptosConfig;\n minimumLedgerVersion?: AnyNumber;\n processorTypes: Array<ProcessorType>;\n}) {\n if (args.minimumLedgerVersion !== undefined) {\n // eslint-disable-next-line no-restricted-syntax\n\n // Collect all of the promises to wait at the same time\n // TODO(greg): This needs to be refactored to be handled at the query time. It involves rewriting\n // a bunch of the logic for wait for indexer\n const promises: Array<Promise<void>> = [];\n // eslint-disable-next-line no-restricted-syntax\n for (const processorType of args.processorTypes) {\n promises.push(\n waitForIndexer({\n aptosConfig: args.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType,\n }),\n );\n }\n\n await Promise.all(promises);\n }\n}\n"],"mappings":"yCAWA,eAAsBA,EAAwBC,EAI3C,CACD,GAAIA,EAAK,uBAAyB,OAAW,CAM3C,IAAMC,EAAiC,CAAC,EAExC,QAAWC,KAAiBF,EAAK,eAC/BC,EAAS,KACPE,EAAe,CACb,YAAaH,EAAK,OAClB,qBAAsBA,EAAK,qBAC3B,cAAAE,CACF,CAAC,CACH,EAGF,MAAM,QAAQ,IAAID,CAAQ,CAC5B,CACF","names":["waitForIndexerOnVersion","args","promises","processorType","waitForIndexer"]}
@@ -1,2 +1,2 @@
1
- import{a as l,c as h}from"./chunk-RYETO74W.mjs";import{a as E,c as b}from"./chunk-EFIYW4WK.mjs";import{b as u}from"./chunk-TIH6ARYP.mjs";var i=class i extends E{constructor(e){super();let{publicKeys:t,threshold:r}=e;if(t.length>i.MAX_KEYS||t.length<i.MIN_KEYS)throw new Error(`Must have between ${i.MIN_KEYS} and ${i.MAX_KEYS} public keys, inclusive`);if(r<i.MIN_THRESHOLD||r>t.length)throw new Error(`Threshold must be between ${i.MIN_THRESHOLD} and ${t.length}, inclusive`);this.publicKeys=t,this.threshold=r}toUint8Array(){let e=new Uint8Array(this.publicKeys.length*l.LENGTH+1);return this.publicKeys.forEach((t,r)=>{e.set(t.toUint8Array(),r*l.LENGTH)}),e[this.publicKeys.length*l.LENGTH]=this.threshold,e}toString(){return u.fromHexInput(this.toUint8Array()).toString()}verifySignature(e){throw new Error("TODO - Method not implemented.")}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let t=e.deserializeBytes(),r=t[t.length-1],o=[];for(let a=0;a<t.length-1;a+=l.LENGTH){let s=a;o.push(new l(t.subarray(s,s+l.LENGTH)))}return new i({publicKeys:o,threshold:r})}};i.MAX_KEYS=32,i.MIN_KEYS=2,i.MIN_THRESHOLD=1;var g=i,n=class n extends b{constructor(e){super();let{signatures:t,bitmap:r}=e;if(r.length!==n.BITMAP_LEN)throw new Error(`"bitmap" length should be ${n.BITMAP_LEN}`);if(t.length>n.MAX_SIGNATURES_SUPPORTED)throw new Error(`The number of signatures cannot be greater than ${n.MAX_SIGNATURES_SUPPORTED}`);this.signatures=t,this.bitmap=r}toUint8Array(){let e=new Uint8Array(this.signatures.length*h.LENGTH+n.BITMAP_LEN);return this.signatures.forEach((t,r)=>{e.set(t.toUint8Array(),r*h.LENGTH)}),e.set(this.bitmap,this.signatures.length*h.LENGTH),e}toString(){return u.fromHexInput(this.toUint8Array()).toString()}static createBitmap(e){let{bits:t}=e,r=128,o=new Uint8Array([0,0,0,0]),a=new Set;return t.forEach(s=>{if(s>=n.MAX_SIGNATURES_SUPPORTED)throw new Error(`Cannot have a signature larger than ${n.MAX_SIGNATURES_SUPPORTED-1}.`);if(a.has(s))throw new Error("Duplicate bits detected.");a.add(s);let c=Math.floor(s/8),y=o[c];y|=r>>s%8,o[c]=y}),o}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let t=e.deserializeBytes(),r=t.subarray(t.length-4),o=[];for(let a=0;a<t.length-r.length;a+=h.LENGTH){let s=a;o.push(new h(t.subarray(s,s+h.LENGTH)))}return new n({signatures:o,bitmap:r})}};n.MAX_SIGNATURES_SUPPORTED=32,n.BITMAP_LEN=4;var p=n;export{g as a,p as b};
2
- //# sourceMappingURL=chunk-U25N2VWA.mjs.map
1
+ import{a as l,c as h}from"./chunk-UW6HQ643.mjs";import{a as E,c as b}from"./chunk-PXTMLJKO.mjs";import{b as u}from"./chunk-NL72WE3E.mjs";var i=class i extends E{constructor(e){super();let{publicKeys:t,threshold:r}=e;if(t.length>i.MAX_KEYS||t.length<i.MIN_KEYS)throw new Error(`Must have between ${i.MIN_KEYS} and ${i.MAX_KEYS} public keys, inclusive`);if(r<i.MIN_THRESHOLD||r>t.length)throw new Error(`Threshold must be between ${i.MIN_THRESHOLD} and ${t.length}, inclusive`);this.publicKeys=t,this.threshold=r}toUint8Array(){let e=new Uint8Array(this.publicKeys.length*l.LENGTH+1);return this.publicKeys.forEach((t,r)=>{e.set(t.toUint8Array(),r*l.LENGTH)}),e[this.publicKeys.length*l.LENGTH]=this.threshold,e}toString(){return u.fromHexInput(this.toUint8Array()).toString()}verifySignature(e){throw new Error("TODO - Method not implemented.")}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let t=e.deserializeBytes(),r=t[t.length-1],o=[];for(let a=0;a<t.length-1;a+=l.LENGTH){let s=a;o.push(new l(t.subarray(s,s+l.LENGTH)))}return new i({publicKeys:o,threshold:r})}};i.MAX_KEYS=32,i.MIN_KEYS=2,i.MIN_THRESHOLD=1;var g=i,n=class n extends b{constructor(e){super();let{signatures:t,bitmap:r}=e;if(r.length!==n.BITMAP_LEN)throw new Error(`"bitmap" length should be ${n.BITMAP_LEN}`);if(t.length>n.MAX_SIGNATURES_SUPPORTED)throw new Error(`The number of signatures cannot be greater than ${n.MAX_SIGNATURES_SUPPORTED}`);this.signatures=t,this.bitmap=r}toUint8Array(){let e=new Uint8Array(this.signatures.length*h.LENGTH+n.BITMAP_LEN);return this.signatures.forEach((t,r)=>{e.set(t.toUint8Array(),r*h.LENGTH)}),e.set(this.bitmap,this.signatures.length*h.LENGTH),e}toString(){return u.fromHexInput(this.toUint8Array()).toString()}static createBitmap(e){let{bits:t}=e,r=128,o=new Uint8Array([0,0,0,0]),a=new Set;return t.forEach(s=>{if(s>=n.MAX_SIGNATURES_SUPPORTED)throw new Error(`Cannot have a signature larger than ${n.MAX_SIGNATURES_SUPPORTED-1}.`);if(a.has(s))throw new Error("Duplicate bits detected.");a.add(s);let c=Math.floor(s/8),y=o[c];y|=r>>s%8,o[c]=y}),o}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let t=e.deserializeBytes(),r=t.subarray(t.length-4),o=[];for(let a=0;a<t.length-r.length;a+=h.LENGTH){let s=a;o.push(new h(t.subarray(s,s+h.LENGTH)))}return new n({signatures:o,bitmap:r})}};n.MAX_SIGNATURES_SUPPORTED=32,n.BITMAP_LEN=4;var p=n;export{g as a,p as b};
2
+ //# sourceMappingURL=chunk-AZUWHKN5.mjs.map
@@ -15,6 +15,16 @@ var i=`
15
15
  transaction_timestamp
16
16
  transaction_version
17
17
  type
18
+ }
19
+ `,a=`
20
+ fragment AnsTokenFragment on current_aptos_names {
21
+ domain
22
+ expiration_timestamp
23
+ registered_address
24
+ subdomain
25
+ token_standard
26
+ is_primary
27
+ owner_address
18
28
  }
19
29
  `,s=`
20
30
  fragment CurrentTokenOwnershipFields on current_token_ownerships_v2 {
@@ -62,7 +72,7 @@ var i=`
62
72
  }
63
73
  }
64
74
  }
65
- `,a=`
75
+ `,_=`
66
76
  query getAccountCoinsCount($address: String) {
67
77
  current_fungible_asset_balances_aggregate(
68
78
  where: {owner_address: {_eq: $address}}
@@ -72,7 +82,7 @@ var i=`
72
82
  }
73
83
  }
74
84
  }
75
- `,_=`
85
+ `,u=`
76
86
  query getAccountCoinsData($where_condition: current_fungible_asset_balances_bool_exp!, $offset: Int, $limit: Int, $order_by: [current_fungible_asset_balances_order_by!]) {
77
87
  current_fungible_asset_balances(
78
88
  where: $where_condition
@@ -105,7 +115,7 @@ var i=`
105
115
  }
106
116
  }
107
117
  }
108
- `,u=`
118
+ `,c=`
109
119
  query getAccountCollectionsWithOwnedTokens($where_condition: current_collection_ownership_v2_view_bool_exp!, $offset: Int, $limit: Int, $order_by: [current_collection_ownership_v2_view_order_by!]) {
110
120
  current_collection_ownership_v2_view(
111
121
  where: $where_condition
@@ -139,7 +149,7 @@ var i=`
139
149
  single_token_uri
140
150
  }
141
151
  }
142
- `,c=`
152
+ `,d=`
143
153
  query getAccountOwnedObjects($where_condition: current_objects_bool_exp, $offset: Int, $limit: Int, $order_by: [current_objects_order_by!]) {
144
154
  current_objects(
145
155
  where: $where_condition
@@ -167,7 +177,7 @@ var i=`
167
177
  ...CurrentTokenOwnershipFields
168
178
  }
169
179
  }
170
- ${s}`,d=`
180
+ ${s}`,y=`
171
181
  query getAccountOwnedTokensByTokenData($where_condition: current_token_ownerships_v2_bool_exp!, $offset: Int, $limit: Int, $order_by: [current_token_ownerships_v2_order_by!]) {
172
182
  current_token_ownerships_v2(
173
183
  where: $where_condition
@@ -178,7 +188,7 @@ var i=`
178
188
  ...CurrentTokenOwnershipFields
179
189
  }
180
190
  }
181
- ${s}`,y=`
191
+ ${s}`,p=`
182
192
  query getAccountOwnedTokensFromCollection($where_condition: current_token_ownerships_v2_bool_exp!, $offset: Int, $limit: Int, $order_by: [current_token_ownerships_v2_order_by!]) {
183
193
  current_token_ownerships_v2(
184
194
  where: $where_condition
@@ -189,7 +199,7 @@ var i=`
189
199
  ...CurrentTokenOwnershipFields
190
200
  }
191
201
  }
192
- ${s}`,p=`
202
+ ${s}`,m=`
193
203
  query getAccountTokensCount($where_condition: current_token_ownerships_v2_bool_exp, $offset: Int, $limit: Int) {
194
204
  current_token_ownerships_v2_aggregate(
195
205
  where: $where_condition
@@ -209,13 +219,13 @@ var i=`
209
219
  }
210
220
  }
211
221
  }
212
- `,m=`
222
+ `,b=`
213
223
  query getChainTopUserTransactions($limit: Int) {
214
224
  user_transactions(limit: $limit, order_by: {version: desc}) {
215
225
  version
216
226
  }
217
227
  }
218
- `,b=`
228
+ `,T=`
219
229
  query getCollectionData($where_condition: current_collections_v2_bool_exp!) {
220
230
  current_collections_v2(where: $where_condition) {
221
231
  collection_id
@@ -234,7 +244,7 @@ var i=`
234
244
  uri
235
245
  }
236
246
  }
237
- `,T=`
247
+ `,k=`
238
248
  query getCurrentFungibleAssetBalances($where_condition: current_fungible_asset_balances_bool_exp, $offset: Int, $limit: Int) {
239
249
  current_fungible_asset_balances(
240
250
  where: $where_condition
@@ -252,7 +262,7 @@ var i=`
252
262
  token_standard
253
263
  }
254
264
  }
255
- `,k=`
265
+ `,$=`
256
266
  query getDelegatedStakingActivities($delegatorAddress: String, $poolAddress: String) {
257
267
  delegated_staking_activities(
258
268
  where: {delegator_address: {_eq: $delegatorAddress}, pool_address: {_eq: $poolAddress}}
@@ -265,7 +275,7 @@ var i=`
265
275
  transaction_version
266
276
  }
267
277
  }
268
- `,v=`
278
+ `,f=`
269
279
  query getEvents($where_condition: events_bool_exp, $offset: Int, $limit: Int, $order_by: [events_order_by!]) {
270
280
  events(
271
281
  where: $where_condition
@@ -284,7 +294,7 @@ var i=`
284
294
  indexed_type
285
295
  }
286
296
  }
287
- `,f=`
297
+ `,v=`
288
298
  query getFungibleAssetActivities($where_condition: fungible_asset_activities_bool_exp, $offset: Int, $limit: Int) {
289
299
  fungible_asset_activities(
290
300
  where: $where_condition
@@ -309,7 +319,7 @@ var i=`
309
319
  type
310
320
  }
311
321
  }
312
- `,$=`
322
+ `,h=`
313
323
  query getFungibleAssetMetadata($where_condition: fungible_asset_metadata_bool_exp, $offset: Int, $limit: Int) {
314
324
  fungible_asset_metadata(where: $where_condition, offset: $offset, limit: $limit) {
315
325
  icon_uri
@@ -326,22 +336,33 @@ var i=`
326
336
  token_standard
327
337
  }
328
338
  }
329
- `,h=`
330
- query getNumberOfDelegators($where_condition: num_active_delegator_per_pool_bool_exp!, $order_by: [num_active_delegator_per_pool_order_by!]) {
339
+ `,A=`
340
+ query getNames($offset: Int, $limit: Int, $where_condition: current_aptos_names_bool_exp, $order_by: [current_aptos_names_order_by!]) {
341
+ current_aptos_names(
342
+ limit: $limit
343
+ where: $where_condition
344
+ order_by: $order_by
345
+ offset: $offset
346
+ ) {
347
+ ...AnsTokenFragment
348
+ }
349
+ }
350
+ ${a}`,w=`
351
+ query getNumberOfDelegators($where_condition: num_active_delegator_per_pool_bool_exp, $order_by: [num_active_delegator_per_pool_order_by!]) {
331
352
  num_active_delegator_per_pool(where: $where_condition, order_by: $order_by) {
332
353
  num_active_delegator
333
354
  pool_address
334
355
  }
335
356
  }
336
- `,A=`
337
- query getProcessorStatus {
338
- processor_status {
357
+ `,G=`
358
+ query getProcessorStatus($where_condition: processor_status_bool_exp) {
359
+ processor_status(where: $where_condition) {
339
360
  last_success_version
340
361
  processor
341
362
  last_updated
342
363
  }
343
364
  }
344
- `,w=`
365
+ `,C=`
345
366
  query getTokenActivity($where_condition: token_activities_v2_bool_exp!, $offset: Int, $limit: Int, $order_by: [token_activities_v2_order_by!]) {
346
367
  token_activities_v2(
347
368
  where: $where_condition
@@ -352,7 +373,7 @@ var i=`
352
373
  ...TokenActivitiesFields
353
374
  }
354
375
  }
355
- ${i}`,G=`
376
+ ${i}`,q=`
356
377
  query getCurrentTokenOwnership($where_condition: current_token_ownerships_v2_bool_exp!, $offset: Int, $limit: Int, $order_by: [current_token_ownerships_v2_order_by!]) {
357
378
  current_token_ownerships_v2(
358
379
  where: $where_condition
@@ -363,7 +384,7 @@ var i=`
363
384
  ...CurrentTokenOwnershipFields
364
385
  }
365
386
  }
366
- ${s}`,C=`
387
+ ${s}`,Q=`
367
388
  query getTokenData($where_condition: current_token_datas_v2_bool_exp, $offset: Int, $limit: Int, $order_by: [current_token_datas_v2_order_by!]) {
368
389
  current_token_datas_v2(
369
390
  where: $where_condition
@@ -402,5 +423,5 @@ var i=`
402
423
  }
403
424
  }
404
425
  }
405
- `,q=(n,o,e)=>n();function Q(n,o=q){return{getAccountCoinsCount(e,t){return o(r=>n.request(a,e,{...t,...r}),"getAccountCoinsCount","query")},getAccountCoinsData(e,t){return o(r=>n.request(_,e,{...t,...r}),"getAccountCoinsData","query")},getAccountCollectionsWithOwnedTokens(e,t){return o(r=>n.request(u,e,{...t,...r}),"getAccountCollectionsWithOwnedTokens","query")},getAccountOwnedObjects(e,t){return o(r=>n.request(c,e,{...t,...r}),"getAccountOwnedObjects","query")},getAccountOwnedTokens(e,t){return o(r=>n.request(l,e,{...t,...r}),"getAccountOwnedTokens","query")},getAccountOwnedTokensByTokenData(e,t){return o(r=>n.request(d,e,{...t,...r}),"getAccountOwnedTokensByTokenData","query")},getAccountOwnedTokensFromCollection(e,t){return o(r=>n.request(y,e,{...t,...r}),"getAccountOwnedTokensFromCollection","query")},getAccountTokensCount(e,t){return o(r=>n.request(p,e,{...t,...r}),"getAccountTokensCount","query")},getAccountTransactionsCount(e,t){return o(r=>n.request(g,e,{...t,...r}),"getAccountTransactionsCount","query")},getChainTopUserTransactions(e,t){return o(r=>n.request(m,e,{...t,...r}),"getChainTopUserTransactions","query")},getCollectionData(e,t){return o(r=>n.request(b,e,{...t,...r}),"getCollectionData","query")},getCurrentFungibleAssetBalances(e,t){return o(r=>n.request(T,e,{...t,...r}),"getCurrentFungibleAssetBalances","query")},getDelegatedStakingActivities(e,t){return o(r=>n.request(k,e,{...t,...r}),"getDelegatedStakingActivities","query")},getEvents(e,t){return o(r=>n.request(v,e,{...t,...r}),"getEvents","query")},getFungibleAssetActivities(e,t){return o(r=>n.request(f,e,{...t,...r}),"getFungibleAssetActivities","query")},getFungibleAssetMetadata(e,t){return o(r=>n.request($,e,{...t,...r}),"getFungibleAssetMetadata","query")},getNumberOfDelegators(e,t){return o(r=>n.request(h,e,{...t,...r}),"getNumberOfDelegators","query")},getProcessorStatus(e,t){return o(r=>n.request(A,e,{...t,...r}),"getProcessorStatus","query")},getTokenActivity(e,t){return o(r=>n.request(w,e,{...t,...r}),"getTokenActivity","query")},getCurrentTokenOwnership(e,t){return o(r=>n.request(G,e,{...t,...r}),"getCurrentTokenOwnership","query")},getTokenData(e,t){return o(r=>n.request(C,e,{...t,...r}),"getTokenData","query")}}}export{i as a,s as b,a as c,_ as d,u as e,c as f,l as g,d as h,y as i,p as j,g as k,m as l,b as m,T as n,k as o,v as p,f as q,$ as r,h as s,A as t,w as u,G as v,C as w,Q as x};
406
- //# sourceMappingURL=chunk-WX43AJTD.mjs.map
426
+ `,O=(n,o,e)=>n();function x(n,o=O){return{getAccountCoinsCount(e,t){return o(r=>n.request(_,e,{...t,...r}),"getAccountCoinsCount","query")},getAccountCoinsData(e,t){return o(r=>n.request(u,e,{...t,...r}),"getAccountCoinsData","query")},getAccountCollectionsWithOwnedTokens(e,t){return o(r=>n.request(c,e,{...t,...r}),"getAccountCollectionsWithOwnedTokens","query")},getAccountOwnedObjects(e,t){return o(r=>n.request(d,e,{...t,...r}),"getAccountOwnedObjects","query")},getAccountOwnedTokens(e,t){return o(r=>n.request(l,e,{...t,...r}),"getAccountOwnedTokens","query")},getAccountOwnedTokensByTokenData(e,t){return o(r=>n.request(y,e,{...t,...r}),"getAccountOwnedTokensByTokenData","query")},getAccountOwnedTokensFromCollection(e,t){return o(r=>n.request(p,e,{...t,...r}),"getAccountOwnedTokensFromCollection","query")},getAccountTokensCount(e,t){return o(r=>n.request(m,e,{...t,...r}),"getAccountTokensCount","query")},getAccountTransactionsCount(e,t){return o(r=>n.request(g,e,{...t,...r}),"getAccountTransactionsCount","query")},getChainTopUserTransactions(e,t){return o(r=>n.request(b,e,{...t,...r}),"getChainTopUserTransactions","query")},getCollectionData(e,t){return o(r=>n.request(T,e,{...t,...r}),"getCollectionData","query")},getCurrentFungibleAssetBalances(e,t){return o(r=>n.request(k,e,{...t,...r}),"getCurrentFungibleAssetBalances","query")},getDelegatedStakingActivities(e,t){return o(r=>n.request($,e,{...t,...r}),"getDelegatedStakingActivities","query")},getEvents(e,t){return o(r=>n.request(f,e,{...t,...r}),"getEvents","query")},getFungibleAssetActivities(e,t){return o(r=>n.request(v,e,{...t,...r}),"getFungibleAssetActivities","query")},getFungibleAssetMetadata(e,t){return o(r=>n.request(h,e,{...t,...r}),"getFungibleAssetMetadata","query")},getNames(e,t){return o(r=>n.request(A,e,{...t,...r}),"getNames","query")},getNumberOfDelegators(e,t){return o(r=>n.request(w,e,{...t,...r}),"getNumberOfDelegators","query")},getProcessorStatus(e,t){return o(r=>n.request(G,e,{...t,...r}),"getProcessorStatus","query")},getTokenActivity(e,t){return o(r=>n.request(C,e,{...t,...r}),"getTokenActivity","query")},getCurrentTokenOwnership(e,t){return o(r=>n.request(q,e,{...t,...r}),"getCurrentTokenOwnership","query")},getTokenData(e,t){return o(r=>n.request(Q,e,{...t,...r}),"getTokenData","query")}}}export{i as a,a as b,s as c,_ as d,u as e,c as f,d as g,l as h,y as i,p as j,m as k,g as l,b as m,T as n,k as o,$ as p,f as q,v as r,h as s,A as t,w as u,G as v,C as w,q as x,Q as y,x as z};
427
+ //# sourceMappingURL=chunk-BQSE5HHW.mjs.map