@aptos-labs/ts-sdk 5.1.1-side-effect-free.1 → 5.1.2

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 (420) hide show
  1. package/README.md +4 -4
  2. package/dist/common/{account-Dr4y1uZG.d.ts → account-147vfOGb.d.ts} +1 -0
  3. package/dist/common/chunk-347THBDE.js +4 -0
  4. package/dist/common/chunk-347THBDE.js.map +1 -0
  5. package/dist/common/cli/index.d.ts +3 -1
  6. package/dist/common/cli/index.js +1 -1
  7. package/dist/common/cli/index.js.map +1 -1
  8. package/dist/common/index.d.ts +15 -82
  9. package/dist/common/index.js +34 -34
  10. package/dist/common/index.js.map +1 -1
  11. package/dist/esm/account/AbstractKeylessAccount.mjs +1 -1
  12. package/dist/esm/account/AbstractKeylessAccount.mjs.map +1 -1
  13. package/dist/esm/account/AbstractedAccount.mjs +1 -1
  14. package/dist/esm/account/AbstractedAccount.mjs.map +1 -1
  15. package/dist/esm/account/Account.mjs +1 -1
  16. package/dist/esm/account/Account.mjs.map +1 -1
  17. package/dist/esm/account/AccountUtils.mjs +1 -1
  18. package/dist/esm/account/AccountUtils.mjs.map +1 -1
  19. package/dist/esm/account/DerivableAbstractedAccount.mjs +1 -1
  20. package/dist/esm/account/DerivableAbstractedAccount.mjs.map +1 -1
  21. package/dist/esm/account/Ed25519Account.mjs +1 -1
  22. package/dist/esm/account/Ed25519Account.mjs.map +1 -1
  23. package/dist/esm/account/EphemeralKeyPair.mjs +1 -1
  24. package/dist/esm/account/EphemeralKeyPair.mjs.map +1 -1
  25. package/dist/esm/account/FederatedKeylessAccount.mjs +1 -1
  26. package/dist/esm/account/FederatedKeylessAccount.mjs.map +1 -1
  27. package/dist/esm/account/KeylessAccount.mjs +1 -1
  28. package/dist/esm/account/KeylessAccount.mjs.map +1 -1
  29. package/dist/esm/account/MultiEd25519Account.mjs +1 -1
  30. package/dist/esm/account/MultiEd25519Account.mjs.map +1 -1
  31. package/dist/esm/account/MultiKeyAccount.mjs +1 -1
  32. package/dist/esm/account/MultiKeyAccount.mjs.map +1 -1
  33. package/dist/esm/account/SingleKeyAccount.mjs +1 -1
  34. package/dist/esm/account/SingleKeyAccount.mjs.map +1 -1
  35. package/dist/esm/account/index.mjs +1 -1
  36. package/dist/esm/account/index.mjs.map +1 -1
  37. package/dist/esm/account/utils.mjs +1 -1
  38. package/dist/esm/account/utils.mjs.map +1 -1
  39. package/dist/esm/api/account/abstraction.mjs +1 -1
  40. package/dist/esm/api/account/abstraction.mjs.map +1 -1
  41. package/dist/esm/api/account.d.mts +1 -1
  42. package/dist/esm/api/account.mjs +1 -1
  43. package/dist/esm/api/account.mjs.map +1 -1
  44. package/dist/esm/api/ans.mjs +1 -1
  45. package/dist/esm/api/ans.mjs.map +1 -1
  46. package/dist/esm/api/aptos.d.mts +14 -81
  47. package/dist/esm/api/aptos.mjs +1 -1
  48. package/dist/esm/api/aptos.mjs.map +1 -1
  49. package/dist/esm/api/aptosConfig.mjs +1 -1
  50. package/dist/esm/api/aptosConfig.mjs.map +1 -1
  51. package/dist/esm/api/coin.mjs +1 -1
  52. package/dist/esm/api/coin.mjs.map +1 -1
  53. package/dist/esm/api/digitalAsset.mjs +1 -1
  54. package/dist/esm/api/digitalAsset.mjs.map +1 -1
  55. package/dist/esm/api/faucet.mjs +1 -1
  56. package/dist/esm/api/faucet.mjs.map +1 -1
  57. package/dist/esm/api/fungibleAsset.mjs +1 -1
  58. package/dist/esm/api/fungibleAsset.mjs.map +1 -1
  59. package/dist/esm/api/general.mjs +1 -1
  60. package/dist/esm/api/general.mjs.map +1 -1
  61. package/dist/esm/api/index.d.mts +2 -2
  62. package/dist/esm/api/index.mjs +1 -1
  63. package/dist/esm/api/index.mjs.map +1 -1
  64. package/dist/esm/api/keyless.mjs +1 -1
  65. package/dist/esm/api/keyless.mjs.map +1 -1
  66. package/dist/esm/api/object.mjs +1 -1
  67. package/dist/esm/api/object.mjs.map +1 -1
  68. package/dist/esm/api/staking.mjs +1 -1
  69. package/dist/esm/api/staking.mjs.map +1 -1
  70. package/dist/esm/api/table.mjs +1 -1
  71. package/dist/esm/api/table.mjs.map +1 -1
  72. package/dist/esm/api/transaction.mjs +1 -1
  73. package/dist/esm/api/transaction.mjs.map +1 -1
  74. package/dist/esm/api/transactionSubmission/build.mjs +1 -1
  75. package/dist/esm/api/transactionSubmission/build.mjs.map +1 -1
  76. package/dist/esm/api/transactionSubmission/helpers.mjs +1 -1
  77. package/dist/esm/api/transactionSubmission/helpers.mjs.map +1 -1
  78. package/dist/esm/api/transactionSubmission/management.mjs +1 -1
  79. package/dist/esm/api/transactionSubmission/management.mjs.map +1 -1
  80. package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
  81. package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -1
  82. package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
  83. package/dist/esm/api/transactionSubmission/simulate.mjs.map +1 -1
  84. package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
  85. package/dist/esm/api/transactionSubmission/submit.mjs.map +1 -1
  86. package/dist/esm/api/utils.mjs +1 -1
  87. package/dist/esm/api/utils.mjs.map +1 -1
  88. package/dist/esm/bcs/consts.mjs +1 -1
  89. package/dist/esm/bcs/consts.mjs.map +1 -1
  90. package/dist/esm/bcs/deserializer.mjs +1 -1
  91. package/dist/esm/bcs/deserializer.mjs.map +1 -1
  92. package/dist/esm/bcs/index.mjs +1 -1
  93. package/dist/esm/bcs/index.mjs.map +1 -1
  94. package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -1
  95. package/dist/esm/bcs/serializable/entryFunctionBytes.mjs.map +1 -1
  96. package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -1
  97. package/dist/esm/bcs/serializable/fixedBytes.mjs.map +1 -1
  98. package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
  99. package/dist/esm/bcs/serializable/movePrimitives.mjs.map +1 -1
  100. package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
  101. package/dist/esm/bcs/serializable/moveStructs.mjs.map +1 -1
  102. package/dist/esm/bcs/serializer.mjs +1 -1
  103. package/dist/esm/bcs/serializer.mjs.map +1 -1
  104. package/dist/esm/chunk-2OPKZKOB.mjs +2 -0
  105. package/dist/esm/chunk-2OPKZKOB.mjs.map +1 -0
  106. package/dist/esm/chunk-2PASUPUO.mjs +2 -0
  107. package/dist/esm/chunk-2PASUPUO.mjs.map +1 -0
  108. package/dist/esm/chunk-35DKMW7Q.mjs +2 -0
  109. package/dist/esm/chunk-35DKMW7Q.mjs.map +1 -0
  110. package/dist/esm/chunk-4QMXOWHP.mjs +1 -0
  111. package/dist/esm/chunk-4QMXOWHP.mjs.map +1 -0
  112. package/dist/esm/chunk-4WPQQPUF.mjs +1 -0
  113. package/dist/esm/chunk-4WPQQPUF.mjs.map +1 -0
  114. package/dist/esm/chunk-56CNRT2K.mjs +2 -0
  115. package/dist/esm/chunk-56CNRT2K.mjs.map +1 -0
  116. package/dist/esm/chunk-5HXLZHDW.mjs +1 -0
  117. package/dist/esm/chunk-5HXLZHDW.mjs.map +1 -0
  118. package/dist/esm/chunk-626KB2UQ.mjs +2 -0
  119. package/dist/esm/chunk-626KB2UQ.mjs.map +1 -0
  120. package/dist/esm/chunk-7ECCT6PK.mjs +1 -0
  121. package/dist/esm/chunk-7ECCT6PK.mjs.map +1 -0
  122. package/dist/esm/chunk-A5L76YP7.mjs +2 -0
  123. package/dist/esm/chunk-A5L76YP7.mjs.map +1 -0
  124. package/dist/esm/chunk-AQW4BUKF.mjs +2 -0
  125. package/dist/esm/chunk-AQW4BUKF.mjs.map +1 -0
  126. package/dist/esm/chunk-C3Q23D22.mjs +2 -0
  127. package/dist/esm/chunk-C3Q23D22.mjs.map +1 -0
  128. package/dist/esm/chunk-CW35YAMN.mjs +2 -0
  129. package/dist/esm/chunk-CW35YAMN.mjs.map +1 -0
  130. package/dist/esm/chunk-E2U27PNC.mjs +2 -0
  131. package/dist/esm/chunk-E2U27PNC.mjs.map +1 -0
  132. package/dist/esm/chunk-EBMEXURY.mjs +2 -0
  133. package/dist/esm/chunk-EBMEXURY.mjs.map +1 -0
  134. package/dist/esm/chunk-FC72YL4B.mjs +2 -0
  135. package/dist/esm/chunk-FC72YL4B.mjs.map +1 -0
  136. package/dist/esm/chunk-FD6FGKYY.mjs +1 -0
  137. package/dist/esm/chunk-FD6FGKYY.mjs.map +1 -0
  138. package/dist/esm/chunk-FGFLPH5K.mjs +2 -0
  139. package/dist/esm/chunk-FGFLPH5K.mjs.map +1 -0
  140. package/dist/esm/chunk-FLZPUYXQ.mjs +2 -0
  141. package/dist/esm/chunk-FLZPUYXQ.mjs.map +1 -0
  142. package/dist/esm/chunk-FZY4PMEE.mjs +1 -0
  143. package/dist/esm/chunk-FZY4PMEE.mjs.map +1 -0
  144. package/dist/esm/chunk-G3MHXDYA.mjs +1 -0
  145. package/dist/esm/chunk-G3MHXDYA.mjs.map +1 -0
  146. package/dist/esm/chunk-GOXRBEIJ.mjs +2 -0
  147. package/dist/esm/chunk-GOXRBEIJ.mjs.map +1 -0
  148. package/dist/esm/chunk-GQ3UIDPQ.mjs +2 -0
  149. package/dist/esm/chunk-GQ3UIDPQ.mjs.map +1 -0
  150. package/dist/esm/chunk-H3EP5CGP.mjs +2 -0
  151. package/dist/esm/chunk-H3EP5CGP.mjs.map +1 -0
  152. package/dist/esm/chunk-HGLO5LDS.mjs +1 -0
  153. package/dist/esm/chunk-HGLO5LDS.mjs.map +1 -0
  154. package/dist/esm/chunk-IF4UU2MT.mjs +2 -0
  155. package/dist/esm/chunk-IF4UU2MT.mjs.map +1 -0
  156. package/dist/esm/chunk-KDMSOCZY.mjs +2 -0
  157. package/dist/esm/chunk-KDMSOCZY.mjs.map +1 -0
  158. package/dist/esm/chunk-LA56UDUK.mjs +2 -0
  159. package/dist/esm/chunk-LA56UDUK.mjs.map +1 -0
  160. package/dist/esm/chunk-LAPXUUHK.mjs +2 -0
  161. package/dist/esm/chunk-LAPXUUHK.mjs.map +1 -0
  162. package/dist/esm/chunk-MCFQE4GC.mjs +2 -0
  163. package/dist/esm/chunk-MCFQE4GC.mjs.map +1 -0
  164. package/dist/esm/chunk-MT2RJ7H3.mjs +2 -0
  165. package/dist/esm/chunk-MT2RJ7H3.mjs.map +1 -0
  166. package/dist/esm/chunk-N6YTF76Q.mjs +2 -0
  167. package/dist/esm/chunk-N6YTF76Q.mjs.map +1 -0
  168. package/dist/esm/chunk-NCKJ7X57.mjs +2 -0
  169. package/dist/esm/chunk-NCKJ7X57.mjs.map +1 -0
  170. package/dist/esm/chunk-NECL5FCQ.mjs +1 -0
  171. package/dist/esm/chunk-NECL5FCQ.mjs.map +1 -0
  172. package/dist/esm/chunk-OLILO7VD.mjs +2 -0
  173. package/dist/esm/chunk-OLILO7VD.mjs.map +1 -0
  174. package/dist/esm/chunk-ORMOQWWH.mjs +2 -0
  175. package/dist/esm/chunk-ORMOQWWH.mjs.map +1 -0
  176. package/dist/esm/chunk-P5HCJN3A.mjs +2 -0
  177. package/dist/esm/chunk-P5HCJN3A.mjs.map +1 -0
  178. package/dist/esm/chunk-PJTG745G.mjs +4 -0
  179. package/dist/esm/chunk-PJTG745G.mjs.map +1 -0
  180. package/dist/esm/chunk-PSSIJHHC.mjs +2 -0
  181. package/dist/esm/chunk-PSSIJHHC.mjs.map +1 -0
  182. package/dist/esm/chunk-Q4W3WJ2U.mjs +2 -0
  183. package/dist/esm/chunk-Q4W3WJ2U.mjs.map +1 -0
  184. package/dist/esm/chunk-QNARIAVM.mjs +2 -0
  185. package/dist/esm/chunk-QNARIAVM.mjs.map +1 -0
  186. package/dist/esm/chunk-QREVMGQZ.mjs +2 -0
  187. package/dist/esm/chunk-QREVMGQZ.mjs.map +1 -0
  188. package/dist/esm/chunk-R7FWJP3N.mjs +2 -0
  189. package/dist/esm/chunk-R7FWJP3N.mjs.map +1 -0
  190. package/dist/esm/chunk-RGKRCZ36.mjs +4 -0
  191. package/dist/esm/chunk-RGKRCZ36.mjs.map +1 -0
  192. package/dist/esm/chunk-RQX6JOEN.mjs +2 -0
  193. package/dist/esm/chunk-RQX6JOEN.mjs.map +1 -0
  194. package/dist/esm/chunk-STY74NUA.mjs +2 -0
  195. package/dist/esm/chunk-STY74NUA.mjs.map +1 -0
  196. package/dist/esm/chunk-TOBQ5UE6.mjs +2 -0
  197. package/dist/esm/chunk-TOBQ5UE6.mjs.map +1 -0
  198. package/dist/esm/chunk-UL777LTI.mjs +494 -0
  199. package/dist/esm/chunk-UL777LTI.mjs.map +1 -0
  200. package/dist/esm/chunk-UYVPNUH3.mjs +1 -0
  201. package/dist/esm/chunk-UYVPNUH3.mjs.map +1 -0
  202. package/dist/esm/chunk-V3MBJJTL.mjs +1 -0
  203. package/dist/esm/chunk-V3MBJJTL.mjs.map +1 -0
  204. package/dist/esm/chunk-V74WPKSY.mjs +2 -0
  205. package/dist/esm/chunk-V74WPKSY.mjs.map +1 -0
  206. package/dist/esm/chunk-WCMW2L3P.mjs +2 -0
  207. package/dist/esm/chunk-WCMW2L3P.mjs.map +1 -0
  208. package/dist/esm/chunk-WSR5EBJM.mjs +2 -0
  209. package/dist/esm/chunk-WSR5EBJM.mjs.map +1 -0
  210. package/dist/esm/chunk-XJJVJOX5.mjs +2 -0
  211. package/dist/esm/chunk-XJJVJOX5.mjs.map +1 -0
  212. package/dist/esm/chunk-XKUIMGKU.mjs +2 -0
  213. package/dist/esm/chunk-XKUIMGKU.mjs.map +1 -0
  214. package/dist/esm/chunk-YOZBVVKL.mjs +2 -0
  215. package/dist/esm/chunk-YOZBVVKL.mjs.map +1 -0
  216. package/dist/esm/chunk-YS5IUILF.mjs +2 -0
  217. package/dist/esm/chunk-YS5IUILF.mjs.map +1 -0
  218. package/dist/esm/chunk-YZHAI55C.mjs +7 -0
  219. package/dist/esm/chunk-YZHAI55C.mjs.map +1 -0
  220. package/dist/esm/chunk-ZP4DWSQA.mjs +2 -0
  221. package/dist/esm/chunk-ZP4DWSQA.mjs.map +1 -0
  222. package/dist/esm/chunk-ZYE7UTJZ.mjs +2 -0
  223. package/dist/esm/chunk-ZYE7UTJZ.mjs.map +1 -0
  224. package/dist/esm/cli/index.mjs +1 -1
  225. package/dist/esm/cli/index.mjs.map +1 -1
  226. package/dist/esm/cli/localNode.d.mts +2 -0
  227. package/dist/esm/cli/localNode.mjs +1 -1
  228. package/dist/esm/cli/localNode.mjs.map +1 -1
  229. package/dist/esm/cli/move.mjs +1 -1
  230. package/dist/esm/cli/move.mjs.map +1 -1
  231. package/dist/esm/client/core.mjs +1 -1
  232. package/dist/esm/client/core.mjs.map +1 -1
  233. package/dist/esm/client/get.mjs +1 -1
  234. package/dist/esm/client/get.mjs.map +1 -1
  235. package/dist/esm/client/index.mjs +1 -1
  236. package/dist/esm/client/index.mjs.map +1 -1
  237. package/dist/esm/client/post.mjs +1 -1
  238. package/dist/esm/client/post.mjs.map +1 -1
  239. package/dist/esm/core/account/index.mjs +1 -1
  240. package/dist/esm/core/account/index.mjs.map +1 -1
  241. package/dist/esm/core/account/utils/address.mjs +1 -1
  242. package/dist/esm/core/account/utils/address.mjs.map +1 -1
  243. package/dist/esm/core/account/utils/index.mjs +1 -1
  244. package/dist/esm/core/account/utils/index.mjs.map +1 -1
  245. package/dist/esm/core/accountAddress.mjs +1 -3
  246. package/dist/esm/core/accountAddress.mjs.map +1 -1
  247. package/dist/esm/core/authenticationKey.mjs +1 -1
  248. package/dist/esm/core/authenticationKey.mjs.map +1 -1
  249. package/dist/esm/core/common.mjs +1 -1
  250. package/dist/esm/core/common.mjs.map +1 -1
  251. package/dist/esm/core/crypto/abstraction.mjs +1 -1
  252. package/dist/esm/core/crypto/abstraction.mjs.map +1 -1
  253. package/dist/esm/core/crypto/deserializationUtils.mjs +1 -1
  254. package/dist/esm/core/crypto/deserializationUtils.mjs.map +1 -1
  255. package/dist/esm/core/crypto/ed25519.mjs +1 -1
  256. package/dist/esm/core/crypto/ed25519.mjs.map +1 -1
  257. package/dist/esm/core/crypto/ephemeral.mjs +1 -1
  258. package/dist/esm/core/crypto/ephemeral.mjs.map +1 -1
  259. package/dist/esm/core/crypto/federatedKeyless.mjs +1 -1
  260. package/dist/esm/core/crypto/federatedKeyless.mjs.map +1 -1
  261. package/dist/esm/core/crypto/hdKey.mjs +1 -1
  262. package/dist/esm/core/crypto/hdKey.mjs.map +1 -1
  263. package/dist/esm/core/crypto/index.mjs +1 -1
  264. package/dist/esm/core/crypto/index.mjs.map +1 -1
  265. package/dist/esm/core/crypto/keyless.mjs +1 -1
  266. package/dist/esm/core/crypto/keyless.mjs.map +1 -1
  267. package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
  268. package/dist/esm/core/crypto/multiEd25519.mjs.map +1 -1
  269. package/dist/esm/core/crypto/multiKey.mjs +1 -3
  270. package/dist/esm/core/crypto/multiKey.mjs.map +1 -1
  271. package/dist/esm/core/crypto/poseidon.mjs +1 -1
  272. package/dist/esm/core/crypto/poseidon.mjs.map +1 -1
  273. package/dist/esm/core/crypto/privateKey.mjs +1 -1
  274. package/dist/esm/core/crypto/privateKey.mjs.map +1 -1
  275. package/dist/esm/core/crypto/proof.mjs +1 -1
  276. package/dist/esm/core/crypto/proof.mjs.map +1 -1
  277. package/dist/esm/core/crypto/publicKey.mjs +1 -1
  278. package/dist/esm/core/crypto/publicKey.mjs.map +1 -1
  279. package/dist/esm/core/crypto/secp256k1.mjs +1 -1
  280. package/dist/esm/core/crypto/secp256k1.mjs.map +1 -1
  281. package/dist/esm/core/crypto/secp256r1.mjs +1 -1
  282. package/dist/esm/core/crypto/secp256r1.mjs.map +1 -1
  283. package/dist/esm/core/crypto/signature.mjs +1 -1
  284. package/dist/esm/core/crypto/signature.mjs.map +1 -1
  285. package/dist/esm/core/crypto/singleKey.mjs +1 -1
  286. package/dist/esm/core/crypto/singleKey.mjs.map +1 -1
  287. package/dist/esm/core/crypto/types.mjs +1 -0
  288. package/dist/esm/core/crypto/utils.mjs +1 -1
  289. package/dist/esm/core/crypto/utils.mjs.map +1 -1
  290. package/dist/esm/core/hex.mjs +1 -1
  291. package/dist/esm/core/hex.mjs.map +1 -1
  292. package/dist/esm/core/index.mjs +1 -1
  293. package/dist/esm/core/index.mjs.map +1 -1
  294. package/dist/esm/errors/index.mjs +1 -6
  295. package/dist/esm/errors/index.mjs.map +1 -1
  296. package/dist/esm/index.d.mts +1 -1
  297. package/dist/esm/index.mjs +1 -1
  298. package/dist/esm/index.mjs.map +1 -1
  299. package/dist/esm/internal/abstraction.mjs +1 -1
  300. package/dist/esm/internal/abstraction.mjs.map +1 -1
  301. package/dist/esm/internal/account.mjs +1 -1
  302. package/dist/esm/internal/account.mjs.map +1 -1
  303. package/dist/esm/internal/ans.mjs +1 -1
  304. package/dist/esm/internal/ans.mjs.map +1 -1
  305. package/dist/esm/internal/coin.mjs +1 -1
  306. package/dist/esm/internal/coin.mjs.map +1 -1
  307. package/dist/esm/internal/digitalAsset.mjs +1 -1
  308. package/dist/esm/internal/digitalAsset.mjs.map +1 -1
  309. package/dist/esm/internal/faucet.mjs +1 -1
  310. package/dist/esm/internal/faucet.mjs.map +1 -1
  311. package/dist/esm/internal/fungibleAsset.mjs +1 -1
  312. package/dist/esm/internal/fungibleAsset.mjs.map +1 -1
  313. package/dist/esm/internal/general.mjs +1 -1
  314. package/dist/esm/internal/general.mjs.map +1 -1
  315. package/dist/esm/internal/keyless.mjs +1 -1
  316. package/dist/esm/internal/keyless.mjs.map +1 -1
  317. package/dist/esm/internal/object.mjs +1 -1
  318. package/dist/esm/internal/object.mjs.map +1 -1
  319. package/dist/esm/internal/staking.mjs +1 -1
  320. package/dist/esm/internal/staking.mjs.map +1 -1
  321. package/dist/esm/internal/table.mjs +1 -1
  322. package/dist/esm/internal/table.mjs.map +1 -1
  323. package/dist/esm/internal/transaction.mjs +1 -1
  324. package/dist/esm/internal/transaction.mjs.map +1 -1
  325. package/dist/esm/internal/transactionSubmission.mjs +1 -1
  326. package/dist/esm/internal/transactionSubmission.mjs.map +1 -1
  327. package/dist/esm/internal/utils/index.mjs +1 -1
  328. package/dist/esm/internal/utils/index.mjs.map +1 -1
  329. package/dist/esm/internal/utils/utils.mjs +1 -1
  330. package/dist/esm/internal/utils/utils.mjs.map +1 -1
  331. package/dist/esm/internal/view.mjs +1 -1
  332. package/dist/esm/internal/view.mjs.map +1 -1
  333. package/dist/esm/transactions/authenticator/account.mjs +1 -1
  334. package/dist/esm/transactions/authenticator/account.mjs.map +1 -1
  335. package/dist/esm/transactions/authenticator/index.mjs +1 -1
  336. package/dist/esm/transactions/authenticator/index.mjs.map +1 -1
  337. package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
  338. package/dist/esm/transactions/authenticator/transaction.mjs.map +1 -1
  339. package/dist/esm/transactions/index.mjs +1 -1
  340. package/dist/esm/transactions/index.mjs.map +1 -1
  341. package/dist/esm/transactions/instances/chainId.mjs +1 -1
  342. package/dist/esm/transactions/instances/chainId.mjs.map +1 -1
  343. package/dist/esm/transactions/instances/identifier.mjs +1 -1
  344. package/dist/esm/transactions/instances/identifier.mjs.map +1 -1
  345. package/dist/esm/transactions/instances/index.mjs +1 -1
  346. package/dist/esm/transactions/instances/index.mjs.map +1 -1
  347. package/dist/esm/transactions/instances/moduleId.mjs +1 -1
  348. package/dist/esm/transactions/instances/moduleId.mjs.map +1 -1
  349. package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
  350. package/dist/esm/transactions/instances/multiAgentTransaction.mjs.map +1 -1
  351. package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
  352. package/dist/esm/transactions/instances/rawTransaction.mjs.map +1 -1
  353. package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
  354. package/dist/esm/transactions/instances/rotationProofChallenge.mjs.map +1 -1
  355. package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
  356. package/dist/esm/transactions/instances/signedTransaction.mjs.map +1 -1
  357. package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
  358. package/dist/esm/transactions/instances/simpleTransaction.mjs.map +1 -1
  359. package/dist/esm/transactions/instances/transactionArgument.mjs +1 -0
  360. package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
  361. package/dist/esm/transactions/instances/transactionPayload.mjs.map +1 -1
  362. package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
  363. package/dist/esm/transactions/management/accountSequenceNumber.mjs.map +1 -1
  364. package/dist/esm/transactions/management/asyncQueue.mjs +1 -1
  365. package/dist/esm/transactions/management/asyncQueue.mjs.map +1 -1
  366. package/dist/esm/transactions/management/index.mjs +1 -1
  367. package/dist/esm/transactions/management/index.mjs.map +1 -1
  368. package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
  369. package/dist/esm/transactions/management/transactionWorker.mjs.map +1 -1
  370. package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
  371. package/dist/esm/transactions/transactionBuilder/helpers.mjs.map +1 -1
  372. package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
  373. package/dist/esm/transactions/transactionBuilder/index.mjs.map +1 -1
  374. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
  375. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs.map +1 -1
  376. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
  377. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs.map +1 -1
  378. package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +2 -2
  379. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
  380. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs.map +1 -1
  381. package/dist/esm/transactions/typeTag/index.mjs +1 -1
  382. package/dist/esm/transactions/typeTag/index.mjs.map +1 -1
  383. package/dist/esm/transactions/typeTag/parser.mjs +1 -1
  384. package/dist/esm/transactions/typeTag/parser.mjs.map +1 -1
  385. package/dist/esm/transactions/types.mjs +1 -0
  386. package/dist/esm/types/abstraction.mjs +1 -1
  387. package/dist/esm/types/abstraction.mjs.map +1 -1
  388. package/dist/esm/types/generated/queries.mjs +1 -493
  389. package/dist/esm/types/generated/queries.mjs.map +1 -1
  390. package/dist/esm/types/generated/types.mjs +1 -1
  391. package/dist/esm/types/generated/types.mjs.map +1 -1
  392. package/dist/esm/types/index.mjs +1 -1
  393. package/dist/esm/types/index.mjs.map +1 -1
  394. package/dist/esm/types/indexer.mjs +1 -0
  395. package/dist/esm/types/types.mjs +1 -1
  396. package/dist/esm/types/types.mjs.map +1 -1
  397. package/dist/esm/utils/apiEndpoints.d.mts +1 -0
  398. package/dist/esm/utils/apiEndpoints.mjs +1 -1
  399. package/dist/esm/utils/apiEndpoints.mjs.map +1 -1
  400. package/dist/esm/utils/const.mjs +1 -1
  401. package/dist/esm/utils/const.mjs.map +1 -1
  402. package/dist/esm/utils/helpers.mjs +1 -1
  403. package/dist/esm/utils/helpers.mjs.map +1 -1
  404. package/dist/esm/utils/index.mjs +1 -1
  405. package/dist/esm/utils/index.mjs.map +1 -1
  406. package/dist/esm/utils/memoize.mjs +1 -1
  407. package/dist/esm/utils/memoize.mjs.map +1 -1
  408. package/dist/esm/utils/normalizeBundle.mjs +1 -1
  409. package/dist/esm/utils/normalizeBundle.mjs.map +1 -1
  410. package/dist/esm/version.d.mts +1 -1
  411. package/dist/esm/version.mjs +1 -1
  412. package/dist/esm/version.mjs.map +1 -1
  413. package/package.json +1 -22
  414. package/src/api/aptos.ts +51 -193
  415. package/src/cli/localNode.ts +13 -2
  416. package/src/internal/ans.ts +1 -0
  417. package/src/utils/apiEndpoints.ts +9 -2
  418. package/src/version.ts +1 -1
  419. package/dist/common/chunk-AWFAHZSB.js +0 -4
  420. package/dist/common/chunk-AWFAHZSB.js.map +0 -1
@@ -1,2 +1,2 @@
1
- import{AccountAuthenticatorSingleKey as c}from"../transactions/authenticator/account";import{SigningScheme as y,SigningSchemeInput as r}from"../types";import{AccountAddress as p}from"../core/accountAddress";import{AnyPublicKey as A,AnySignature as S,Ed25519PrivateKey as u,Secp256k1PrivateKey as g}from"../core/crypto";import{generateSigningMessageForTransaction as K}from"../transactions/transactionBuilder/signingMessage";function D(i){return typeof i=="object"&&i!==null&&"getAnyPublicKey"in i&&typeof i.getAnyPublicKey=="function"}class a{constructor(e){this.signingScheme=y.SingleKey;const{privateKey:t,address:n}=e;this.privateKey=t,this.publicKey=new A(t.publicKey()),this.accountAddress=n?p.from(n):this.publicKey.authKey().derivedAddress()}getAnyPublicKey(){return this.publicKey}static generate(e={}){const{scheme:t=r.Ed25519}=e;let n;switch(t){case r.Ed25519:n=u.generate();break;case r.Secp256k1Ecdsa:n=g.generate();break;default:throw new Error(`Unsupported signature scheme ${t}`)}return new a({privateKey:n})}static fromDerivationPath(e){const{scheme:t=r.Ed25519,path:n,mnemonic:o}=e;let s;switch(t){case r.Ed25519:s=u.fromDerivationPath(n,o);break;case r.Secp256k1Ecdsa:s=g.fromDerivationPath(n,o);break;default:throw new Error(`Unsupported signature scheme ${t}`)}return new a({privateKey:s})}verifySignature(e){return this.publicKey.verifySignature(e)}async verifySignatureAsync(e){return this.publicKey.verifySignatureAsync({...e,signature:e.signature})}signWithAuthenticator(e){return new c(this.publicKey,this.sign(e))}signTransactionWithAuthenticator(e){return new c(this.publicKey,this.signTransaction(e))}sign(e){return new S(this.privateKey.sign(e))}signTransaction(e){return this.sign(K(e))}static fromEd25519Account(e){return new a({privateKey:e.privateKey,address:e.accountAddress})}}export{a as SingleKeyAccount,D as isSingleKeySigner};
1
+ import{cb as a,db as b}from"../chunk-PJTG745G.mjs";import"../chunk-A5L76YP7.mjs";import"../chunk-5HXLZHDW.mjs";import"../chunk-GOXRBEIJ.mjs";import"../chunk-XJJVJOX5.mjs";import"../chunk-QNARIAVM.mjs";import"../chunk-2PASUPUO.mjs";import"../chunk-C3Q23D22.mjs";import"../chunk-NECL5FCQ.mjs";import"../chunk-4QMXOWHP.mjs";import"../chunk-RQX6JOEN.mjs";import"../chunk-WSR5EBJM.mjs";import"../chunk-WCMW2L3P.mjs";import"../chunk-V74WPKSY.mjs";import"../chunk-UYVPNUH3.mjs";import"../chunk-G3MHXDYA.mjs";import"../chunk-626KB2UQ.mjs";import"../chunk-XKUIMGKU.mjs";import"../chunk-N6YTF76Q.mjs";import"../chunk-FGFLPH5K.mjs";import"../chunk-QREVMGQZ.mjs";import"../chunk-V3MBJJTL.mjs";import"../chunk-ZP4DWSQA.mjs";import"../chunk-2OPKZKOB.mjs";import"../chunk-FC72YL4B.mjs";import"../chunk-YS5IUILF.mjs";import"../chunk-PSSIJHHC.mjs";import"../chunk-YOZBVVKL.mjs";import"../chunk-R7FWJP3N.mjs";import"../chunk-UL777LTI.mjs";import"../chunk-7ECCT6PK.mjs";import"../chunk-AQW4BUKF.mjs";import"../chunk-E2U27PNC.mjs";import"../chunk-LAPXUUHK.mjs";import"../chunk-HGLO5LDS.mjs";import"../chunk-CW35YAMN.mjs";import"../chunk-YZHAI55C.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-TOBQ5UE6.mjs";import"../chunk-MT2RJ7H3.mjs";import"../chunk-Q4W3WJ2U.mjs";import"../chunk-ORMOQWWH.mjs";import"../chunk-FLZPUYXQ.mjs";import"../chunk-LA56UDUK.mjs";import"../chunk-ZYE7UTJZ.mjs";import"../chunk-RGKRCZ36.mjs";import"../chunk-FD6FGKYY.mjs";import"../chunk-MCFQE4GC.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-EBMEXURY.mjs";import"../chunk-STY74NUA.mjs";import"../chunk-IF4UU2MT.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-NCKJ7X57.mjs";import"../chunk-P5HCJN3A.mjs";import"../chunk-OLILO7VD.mjs";import"../chunk-H3EP5CGP.mjs";import"../chunk-KDMSOCZY.mjs";export{b as SingleKeyAccount,a as isSingleKeySigner};
2
2
  //# sourceMappingURL=SingleKeyAccount.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/account/SingleKeyAccount.ts"],"sourcesContent":["import { AccountAuthenticatorSingleKey } from \"../transactions/authenticator/account\";\nimport { type HexInput, SigningScheme, SigningSchemeInput } from \"../types\";\nimport { AccountAddress, AccountAddressInput } from \"../core/accountAddress\";\nimport {\n AnyPublicKey,\n AnySignature,\n Ed25519PrivateKey,\n KeylessSignature,\n PrivateKeyInput,\n Secp256k1PrivateKey,\n Signature,\n} from \"../core/crypto\";\nimport type { Account } from \"./Account\";\nimport { generateSigningMessageForTransaction } from \"../transactions/transactionBuilder/signingMessage\";\nimport { AnyRawTransaction } from \"../transactions/types\";\nimport { Ed25519Account } from \"./Ed25519Account\";\nimport { AptosConfig } from \"../api\";\n\n/**\n * An interface which defines if an Account utilizes SingleKey signing.\n *\n * Such an account will use the AnyPublicKey enum to represent its public key when deriving the auth key.\n */\nexport interface SingleKeySigner extends Account {\n getAnyPublicKey(): AnyPublicKey;\n}\n\nexport function isSingleKeySigner(obj: unknown): obj is SingleKeySigner {\n return (\n typeof obj === \"object\" &&\n obj !== null &&\n \"getAnyPublicKey\" in obj &&\n typeof (obj as any).getAnyPublicKey === \"function\"\n );\n}\n\nexport type SingleKeySignerOrLegacyEd25519Account = SingleKeySigner | Ed25519Account;\n\n/**\n * Arguments required to create a single key signer.\n *\n * @param privateKey - The private key used for signing.\n * @param address - Optional account address associated with the signer.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\nexport interface SingleKeySignerConstructorArgs {\n privateKey: PrivateKeyInput;\n address?: AccountAddressInput;\n}\n\n/**\n * Arguments for generating a single key signer.\n *\n * @param scheme - The signing scheme to be used.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\nexport interface SingleKeySignerGenerateArgs {\n scheme?: SigningSchemeInput;\n}\n\n/**\n * The arguments for generating a single key signer from a specified derivation path.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\nexport type SingleKeySignerFromDerivationPathArgs = SingleKeySignerGenerateArgs & {\n path: string;\n mnemonic: string;\n};\n\n/**\n * Arguments required to verify a single key signature for a given message.\n *\n * @param message - The message to be verified, represented in hexadecimal format.\n * @param signature - The signature that corresponds to the message.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\nexport interface VerifySingleKeySignatureArgs {\n message: HexInput;\n signature: AnySignature;\n}\n\n/**\n * Signer implementation for the SingleKey authentication scheme.\n * This class extends a SingleKeyAccount by adding signing capabilities through a valid private key.\n * Currently, the only supported signature schemes are Ed25519 and Secp256k1.\n *\n * Note: Generating a signer instance does not create the account on-chain.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\nexport class SingleKeyAccount implements Account, SingleKeySigner {\n /**\n * Private key associated with the account\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n readonly privateKey: PrivateKeyInput;\n\n readonly publicKey: AnyPublicKey;\n\n readonly accountAddress: AccountAddress;\n\n readonly signingScheme = SigningScheme.SingleKey;\n\n /**\n * Creates an instance of the SingleKeySigner using the provided private key and address.\n * This allows for signing transactions and messages with the specified private key.\n *\n * @param args - The constructor arguments for initializing the SingleKeySigner.\n * @param args.privateKey - The private key used for signing.\n * @param args.address - The optional account address; if not provided, it will derive the address from the public key.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n constructor(args: SingleKeySignerConstructorArgs) {\n const { privateKey, address } = args;\n this.privateKey = privateKey;\n this.publicKey = new AnyPublicKey(privateKey.publicKey());\n this.accountAddress = address ? AccountAddress.from(address) : this.publicKey.authKey().derivedAddress();\n }\n\n getAnyPublicKey(): AnyPublicKey {\n return this.publicKey;\n }\n\n /**\n * Derives an account from a randomly generated private key based on the specified signing scheme.\n * The default generation scheme is Ed25519, but it can also support Secp256k1Ecdsa.\n *\n * @param args - The arguments for generating the account.\n * @param args.scheme - The signing scheme to use for generating the private key. Defaults to SigningSchemeInput.Ed25519.\n * @returns An account with the generated private key based on the specified signing scheme.\n * @throws Error if an unsupported signature scheme is provided.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n static generate(args: SingleKeySignerGenerateArgs = {}) {\n const { scheme = SigningSchemeInput.Ed25519 } = args;\n let privateKey: PrivateKeyInput;\n switch (scheme) {\n case SigningSchemeInput.Ed25519:\n privateKey = Ed25519PrivateKey.generate();\n break;\n case SigningSchemeInput.Secp256k1Ecdsa:\n privateKey = Secp256k1PrivateKey.generate();\n break;\n default:\n throw new Error(`Unsupported signature scheme ${scheme}`);\n }\n return new SingleKeyAccount({ privateKey });\n }\n\n /**\n * Derives an account using a specified BIP44 path and mnemonic seed phrase, defaulting to the Ed25519 signature scheme.\n * This function allows you to create a single key account based on the provided derivation path and mnemonic.\n *\n * @param args - The arguments for deriving the account.\n * @param args.scheme - The signature scheme to derive the private key with. Defaults to Ed25519.\n * @param args.path - The BIP44 derive hardened path (e.g. m/44'/637'/0'/0'/0') for Ed25519, or non-hardened path\n * (e.g. m/44'/637'/0'/0/0) for secp256k1.\n * Detailed description: {@link https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki}\n * @param args.mnemonic - The mnemonic seed phrase of the account.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n static fromDerivationPath(args: SingleKeySignerFromDerivationPathArgs) {\n const { scheme = SigningSchemeInput.Ed25519, path, mnemonic } = args;\n let privateKey: PrivateKeyInput;\n switch (scheme) {\n case SigningSchemeInput.Ed25519:\n privateKey = Ed25519PrivateKey.fromDerivationPath(path, mnemonic);\n break;\n case SigningSchemeInput.Secp256k1Ecdsa:\n privateKey = Secp256k1PrivateKey.fromDerivationPath(path, mnemonic);\n break;\n default:\n throw new Error(`Unsupported signature scheme ${scheme}`);\n }\n return new SingleKeyAccount({ privateKey });\n }\n\n /**\n * Verify the given message and signature with the public key.\n *\n * @param args - The arguments for verifying the signature.\n * @param args.message - The raw message data in HexInput format.\n * @param args.signature - The signed message signature.\n * @returns A boolean indicating whether the signature is valid.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n verifySignature(args: VerifySingleKeySignatureArgs): boolean {\n return this.publicKey.verifySignature(args);\n }\n\n /**\n * Verify the given message and signature with the account's public key.\n *\n * This function checks if the provided signature is valid for the given message using the account's public key.\n *\n * @param args - The arguments for verifying the signature.\n * @param args.message - The raw message data in HexInput format.\n * @param args.signature - The signed message signature.\n * @param args.options.throwErrorWithReason - Whether to throw an error with the reason for the verification failure.\n * @returns A boolean indicating whether the signature is valid for the message.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n async verifySignatureAsync(args: {\n aptosConfig: AptosConfig;\n message: HexInput;\n signature: Signature;\n options?: { throwErrorWithReason?: boolean };\n }): Promise<boolean> {\n return this.publicKey.verifySignatureAsync({\n ...args,\n signature: args.signature,\n });\n }\n\n /**\n * Sign a message using the account's private key and return an AccountAuthenticator containing the signature along with the\n * account's public key.\n * @param message - The signing message, represented as binary input in hexadecimal format.\n * @returns An instance of AccountAuthenticatorSingleKey containing the signature and the public key.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n signWithAuthenticator(message: HexInput): AccountAuthenticatorSingleKey {\n return new AccountAuthenticatorSingleKey(this.publicKey, this.sign(message));\n }\n\n /**\n * Sign a transaction using the account's private key.\n * This function returns an AccountAuthenticator that contains the signature of the transaction along with the account's public key.\n * @param transaction - The raw transaction to be signed.\n * @returns An AccountAuthenticatorSingleKey containing the signature of the transaction and the account's public key.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n signTransactionWithAuthenticator(transaction: AnyRawTransaction): AccountAuthenticatorSingleKey {\n return new AccountAuthenticatorSingleKey(this.publicKey, this.signTransaction(transaction));\n }\n\n /**\n * Sign the given message using the account's private key.\n * @param message - The message to be signed in HexInput format.\n * @returns A new AnySignature containing the signature of the message.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n sign(message: HexInput): AnySignature {\n return new AnySignature(this.privateKey.sign(message));\n }\n\n /**\n * Sign the given transaction using the account's private key.\n * This function generates a signing message for the transaction and then signs it.\n *\n * @param transaction - The transaction to be signed.\n * @returns Signature - The resulting signature for the signed transaction.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n signTransaction(transaction: AnyRawTransaction): AnySignature {\n return this.sign(generateSigningMessageForTransaction(transaction));\n }\n\n // endregion\n\n static fromEd25519Account(account: Ed25519Account): SingleKeyAccount {\n return new SingleKeyAccount({ privateKey: account.privateKey, address: account.accountAddress });\n }\n}\n"],"mappings":"AAAA,OAAS,iCAAAA,MAAqC,wCAC9C,OAAwB,iBAAAC,EAAe,sBAAAC,MAA0B,WACjE,OAAS,kBAAAC,MAA2C,yBACpD,OACE,gBAAAC,EACA,gBAAAC,EACA,qBAAAC,EAGA,uBAAAC,MAEK,iBAEP,OAAS,wCAAAC,MAA4C,oDAc9C,SAASC,EAAkBC,EAAsC,CACtE,OACE,OAAOA,GAAQ,UACfA,IAAQ,MACR,oBAAqBA,GACrB,OAAQA,EAAY,iBAAoB,UAE5C,CA4DO,MAAMC,CAAqD,CAwBhE,YAAYC,EAAsC,CAZlD,KAAS,cAAgBX,EAAc,UAarC,KAAM,CAAE,WAAAY,EAAY,QAAAC,CAAQ,EAAIF,EAChC,KAAK,WAAaC,EAClB,KAAK,UAAY,IAAIT,EAAaS,EAAW,UAAU,CAAC,EACxD,KAAK,eAAiBC,EAAUX,EAAe,KAAKW,CAAO,EAAI,KAAK,UAAU,QAAQ,EAAE,eAAe,CACzG,CAEA,iBAAgC,CAC9B,OAAO,KAAK,SACd,CAaA,OAAO,SAASF,EAAoC,CAAC,EAAG,CACtD,KAAM,CAAE,OAAAG,EAASb,EAAmB,OAAQ,EAAIU,EAChD,IAAIC,EACJ,OAAQE,EAAQ,CACd,KAAKb,EAAmB,QACtBW,EAAaP,EAAkB,SAAS,EACxC,MACF,KAAKJ,EAAmB,eACtBW,EAAaN,EAAoB,SAAS,EAC1C,MACF,QACE,MAAM,IAAI,MAAM,gCAAgCQ,CAAM,EAAE,CAC5D,CACA,OAAO,IAAIJ,EAAiB,CAAE,WAAAE,CAAW,CAAC,CAC5C,CAeA,OAAO,mBAAmBD,EAA6C,CACrE,KAAM,CAAE,OAAAG,EAASb,EAAmB,QAAS,KAAAc,EAAM,SAAAC,CAAS,EAAIL,EAChE,IAAIC,EACJ,OAAQE,EAAQ,CACd,KAAKb,EAAmB,QACtBW,EAAaP,EAAkB,mBAAmBU,EAAMC,CAAQ,EAChE,MACF,KAAKf,EAAmB,eACtBW,EAAaN,EAAoB,mBAAmBS,EAAMC,CAAQ,EAClE,MACF,QACE,MAAM,IAAI,MAAM,gCAAgCF,CAAM,EAAE,CAC5D,CACA,OAAO,IAAIJ,EAAiB,CAAE,WAAAE,CAAW,CAAC,CAC5C,CAYA,gBAAgBD,EAA6C,CAC3D,OAAO,KAAK,UAAU,gBAAgBA,CAAI,CAC5C,CAeA,MAAM,qBAAqBA,EAKN,CACnB,OAAO,KAAK,UAAU,qBAAqB,CACzC,GAAGA,EACH,UAAWA,EAAK,SAClB,CAAC,CACH,CAUA,sBAAsBM,EAAkD,CACtE,OAAO,IAAIlB,EAA8B,KAAK,UAAW,KAAK,KAAKkB,CAAO,CAAC,CAC7E,CAUA,iCAAiCC,EAA+D,CAC9F,OAAO,IAAInB,EAA8B,KAAK,UAAW,KAAK,gBAAgBmB,CAAW,CAAC,CAC5F,CASA,KAAKD,EAAiC,CACpC,OAAO,IAAIb,EAAa,KAAK,WAAW,KAAKa,CAAO,CAAC,CACvD,CAWA,gBAAgBC,EAA8C,CAC5D,OAAO,KAAK,KAAKX,EAAqCW,CAAW,CAAC,CACpE,CAIA,OAAO,mBAAmBC,EAA2C,CACnE,OAAO,IAAIT,EAAiB,CAAE,WAAYS,EAAQ,WAAY,QAASA,EAAQ,cAAe,CAAC,CACjG,CACF","names":["AccountAuthenticatorSingleKey","SigningScheme","SigningSchemeInput","AccountAddress","AnyPublicKey","AnySignature","Ed25519PrivateKey","Secp256k1PrivateKey","generateSigningMessageForTransaction","isSingleKeySigner","obj","SingleKeyAccount","args","privateKey","address","scheme","path","mnemonic","message","transaction","account"]}
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,2 +1,2 @@
1
- export*from"./Ed25519Account";export*from"./Account";export*from"./SingleKeyAccount";export*from"./EphemeralKeyPair";export*from"./KeylessAccount";export*from"./AbstractKeylessAccount";export*from"./FederatedKeylessAccount";export*from"./MultiKeyAccount";export*from"./MultiEd25519Account";export*from"./AccountUtils";export*from"./AbstractedAccount";export*from"./DerivableAbstractedAccount";
1
+ import{bb as a,cb as b,db as c,eb as d,fb as e,gb as f,hb as g,ib as h,jb as i,kb as j,lb as k,mb as l,ob as m,pb as n,qb as o}from"../chunk-PJTG745G.mjs";import"../chunk-A5L76YP7.mjs";import"../chunk-5HXLZHDW.mjs";import"../chunk-GOXRBEIJ.mjs";import"../chunk-XJJVJOX5.mjs";import"../chunk-QNARIAVM.mjs";import"../chunk-2PASUPUO.mjs";import"../chunk-C3Q23D22.mjs";import"../chunk-NECL5FCQ.mjs";import"../chunk-4QMXOWHP.mjs";import"../chunk-RQX6JOEN.mjs";import"../chunk-WSR5EBJM.mjs";import"../chunk-WCMW2L3P.mjs";import"../chunk-V74WPKSY.mjs";import"../chunk-UYVPNUH3.mjs";import"../chunk-G3MHXDYA.mjs";import"../chunk-626KB2UQ.mjs";import"../chunk-XKUIMGKU.mjs";import"../chunk-N6YTF76Q.mjs";import"../chunk-FGFLPH5K.mjs";import"../chunk-QREVMGQZ.mjs";import"../chunk-V3MBJJTL.mjs";import"../chunk-ZP4DWSQA.mjs";import"../chunk-2OPKZKOB.mjs";import"../chunk-FC72YL4B.mjs";import"../chunk-YS5IUILF.mjs";import"../chunk-PSSIJHHC.mjs";import"../chunk-YOZBVVKL.mjs";import"../chunk-R7FWJP3N.mjs";import"../chunk-UL777LTI.mjs";import"../chunk-7ECCT6PK.mjs";import"../chunk-AQW4BUKF.mjs";import"../chunk-E2U27PNC.mjs";import"../chunk-LAPXUUHK.mjs";import"../chunk-HGLO5LDS.mjs";import"../chunk-CW35YAMN.mjs";import"../chunk-YZHAI55C.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-TOBQ5UE6.mjs";import"../chunk-MT2RJ7H3.mjs";import"../chunk-Q4W3WJ2U.mjs";import"../chunk-ORMOQWWH.mjs";import"../chunk-FLZPUYXQ.mjs";import"../chunk-LA56UDUK.mjs";import"../chunk-ZYE7UTJZ.mjs";import"../chunk-RGKRCZ36.mjs";import"../chunk-FD6FGKYY.mjs";import"../chunk-MCFQE4GC.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-EBMEXURY.mjs";import"../chunk-STY74NUA.mjs";import"../chunk-IF4UU2MT.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-NCKJ7X57.mjs";import"../chunk-P5HCJN3A.mjs";import"../chunk-OLILO7VD.mjs";import"../chunk-H3EP5CGP.mjs";import"../chunk-KDMSOCZY.mjs";export{g as AbstractKeylessAccount,n as AbstractedAccount,d as Account,m as AccountUtils,o as DerivableAbstractedAccount,a as Ed25519Account,e as EphemeralKeyPair,j as FederatedKeylessAccount,i as KeylessAccount,l as MultiEd25519Account,k as MultiKeyAccount,c as SingleKeyAccount,h as TransactionAndProof,f as isKeylessSigner,b as isSingleKeySigner};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/account/index.ts"],"sourcesContent":["export * from \"./Ed25519Account\";\nexport * from \"./Account\";\nexport * from \"./SingleKeyAccount\";\nexport * from \"./EphemeralKeyPair\";\nexport * from \"./KeylessAccount\";\nexport * from \"./AbstractKeylessAccount\";\nexport * from \"./FederatedKeylessAccount\";\nexport * from \"./MultiKeyAccount\";\nexport * from \"./MultiEd25519Account\";\nexport * from \"./AccountUtils\";\nexport * from \"./AbstractedAccount\";\nexport * from \"./DerivableAbstractedAccount\";\n"],"mappings":"AAAA,WAAc,mBACd,WAAc,YACd,WAAc,qBACd,WAAc,qBACd,WAAc,mBACd,WAAc,2BACd,WAAc,4BACd,WAAc,oBACd,WAAc,wBACd,WAAc,iBACd,WAAc,sBACd,WAAc","names":[]}
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,2 +1,2 @@
1
- import{SigningScheme as r}from"../types";import{AccountAddress as s}from"../core";function a(i){const e=i.deserializeUleb128AsU32();if(!Object.values(r).includes(e))throw new Error(`Deserialization of Account failed: SigningScheme variant ${e} is invalid`);return{address:s.deserialize(i),signingScheme:e}}export{a as deserializeSchemeAndAddress};
1
+ import{nb as a}from"../chunk-PJTG745G.mjs";import"../chunk-A5L76YP7.mjs";import"../chunk-5HXLZHDW.mjs";import"../chunk-GOXRBEIJ.mjs";import"../chunk-XJJVJOX5.mjs";import"../chunk-QNARIAVM.mjs";import"../chunk-2PASUPUO.mjs";import"../chunk-C3Q23D22.mjs";import"../chunk-NECL5FCQ.mjs";import"../chunk-4QMXOWHP.mjs";import"../chunk-RQX6JOEN.mjs";import"../chunk-WSR5EBJM.mjs";import"../chunk-WCMW2L3P.mjs";import"../chunk-V74WPKSY.mjs";import"../chunk-UYVPNUH3.mjs";import"../chunk-G3MHXDYA.mjs";import"../chunk-626KB2UQ.mjs";import"../chunk-XKUIMGKU.mjs";import"../chunk-N6YTF76Q.mjs";import"../chunk-FGFLPH5K.mjs";import"../chunk-QREVMGQZ.mjs";import"../chunk-V3MBJJTL.mjs";import"../chunk-ZP4DWSQA.mjs";import"../chunk-2OPKZKOB.mjs";import"../chunk-FC72YL4B.mjs";import"../chunk-YS5IUILF.mjs";import"../chunk-PSSIJHHC.mjs";import"../chunk-YOZBVVKL.mjs";import"../chunk-R7FWJP3N.mjs";import"../chunk-UL777LTI.mjs";import"../chunk-7ECCT6PK.mjs";import"../chunk-AQW4BUKF.mjs";import"../chunk-E2U27PNC.mjs";import"../chunk-LAPXUUHK.mjs";import"../chunk-HGLO5LDS.mjs";import"../chunk-CW35YAMN.mjs";import"../chunk-YZHAI55C.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-TOBQ5UE6.mjs";import"../chunk-MT2RJ7H3.mjs";import"../chunk-Q4W3WJ2U.mjs";import"../chunk-ORMOQWWH.mjs";import"../chunk-FLZPUYXQ.mjs";import"../chunk-LA56UDUK.mjs";import"../chunk-ZYE7UTJZ.mjs";import"../chunk-RGKRCZ36.mjs";import"../chunk-FD6FGKYY.mjs";import"../chunk-MCFQE4GC.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-EBMEXURY.mjs";import"../chunk-STY74NUA.mjs";import"../chunk-IF4UU2MT.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-NCKJ7X57.mjs";import"../chunk-P5HCJN3A.mjs";import"../chunk-OLILO7VD.mjs";import"../chunk-H3EP5CGP.mjs";import"../chunk-KDMSOCZY.mjs";export{a as deserializeSchemeAndAddress};
2
2
  //# sourceMappingURL=utils.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/account/utils.ts"],"sourcesContent":["import { SigningScheme } from \"../types\";\nimport { AccountAddress } from \"../core\";\nimport { Deserializer } from \"../bcs/deserializer\";\n\nexport function deserializeSchemeAndAddress(deserializer: Deserializer): {\n address: AccountAddress;\n signingScheme: SigningScheme;\n} {\n const signingScheme = deserializer.deserializeUleb128AsU32();\n // Validate that signingScheme is a valid SigningScheme value\n if (!Object.values(SigningScheme).includes(signingScheme)) {\n throw new Error(`Deserialization of Account failed: SigningScheme variant ${signingScheme} is invalid`);\n }\n const address = AccountAddress.deserialize(deserializer);\n return { address, signingScheme };\n}\n"],"mappings":"AAAA,OAAS,iBAAAA,MAAqB,WAC9B,OAAS,kBAAAC,MAAsB,UAGxB,SAASC,EAA4BC,EAG1C,CACA,MAAMC,EAAgBD,EAAa,wBAAwB,EAE3D,GAAI,CAAC,OAAO,OAAOH,CAAa,EAAE,SAASI,CAAa,EACtD,MAAM,IAAI,MAAM,4DAA4DA,CAAa,aAAa,EAGxG,MAAO,CAAE,QADOH,EAAe,YAAYE,CAAY,EACrC,cAAAC,CAAc,CAClC","names":["SigningScheme","AccountAddress","deserializeSchemeAndAddress","deserializer","signingScheme"]}
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,2 +1,2 @@
1
- import{AccountAddress as e}from"../../core";import{addAuthenticationFunctionTransaction as a,removeAuthenticationFunctionTransaction as r,removeDispatchableAuthenticatorTransaction as u}from"../../internal/abstraction";import{view as d}from"../../internal/view";import{TypeTagAddress as p}from"../../transactions";import{getFunctionParts as A}from"../../utils/helpers";class C{constructor(n){this.config=n;this.isAccountAbstractionEnabled=async n=>{const o=await this.getAuthenticationFunction(n),{moduleAddress:t,moduleName:i,functionName:s}=A(n.authenticationFunction);return o?.some(c=>e.fromString(t).equals(c.moduleAddress)&&i===c.moduleName&&s===c.functionName)??!1};this.enableAccountAbstractionTransaction=this.addAuthenticationFunctionTransaction;this.disableAccountAbstractionTransaction=async n=>{const{accountAddress:o,authenticationFunction:t,options:i}=n;return t?this.removeAuthenticationFunctionTransaction({accountAddress:o,authenticationFunction:t,options:i}):this.removeDispatchableAuthenticatorTransaction({accountAddress:o,options:i})}}async addAuthenticationFunctionTransaction(n){const{accountAddress:o,authenticationFunction:t,options:i}=n;return a({aptosConfig:this.config,authenticationFunction:t,sender:o,options:i})}async removeAuthenticationFunctionTransaction(n){const{accountAddress:o,authenticationFunction:t,options:i}=n;return r({aptosConfig:this.config,sender:o,authenticationFunction:t,options:i})}async removeDispatchableAuthenticatorTransaction(n){const{accountAddress:o,options:t}=n;return u({aptosConfig:this.config,sender:o,options:t})}async getAuthenticationFunction(n){const{accountAddress:o}=n,[{vec:t}]=await d({aptosConfig:this.config,payload:{function:"0x1::account_abstraction::dispatchable_authenticator",functionArguments:[e.from(o)],abi:{typeParameters:[],parameters:[new p],returnTypes:[]}}});if(t.length!==0)return t[0].map(i=>({moduleAddress:e.fromString(i.module_address),moduleName:i.module_name,functionName:i.function_name}))}}export{C as AccountAbstraction};
1
+ import{Vc as a}from"../../chunk-PJTG745G.mjs";import"../../chunk-A5L76YP7.mjs";import"../../chunk-5HXLZHDW.mjs";import"../../chunk-GOXRBEIJ.mjs";import"../../chunk-XJJVJOX5.mjs";import"../../chunk-QNARIAVM.mjs";import"../../chunk-2PASUPUO.mjs";import"../../chunk-C3Q23D22.mjs";import"../../chunk-NECL5FCQ.mjs";import"../../chunk-4QMXOWHP.mjs";import"../../chunk-RQX6JOEN.mjs";import"../../chunk-WSR5EBJM.mjs";import"../../chunk-WCMW2L3P.mjs";import"../../chunk-V74WPKSY.mjs";import"../../chunk-UYVPNUH3.mjs";import"../../chunk-G3MHXDYA.mjs";import"../../chunk-626KB2UQ.mjs";import"../../chunk-XKUIMGKU.mjs";import"../../chunk-N6YTF76Q.mjs";import"../../chunk-FGFLPH5K.mjs";import"../../chunk-QREVMGQZ.mjs";import"../../chunk-V3MBJJTL.mjs";import"../../chunk-ZP4DWSQA.mjs";import"../../chunk-2OPKZKOB.mjs";import"../../chunk-FC72YL4B.mjs";import"../../chunk-YS5IUILF.mjs";import"../../chunk-PSSIJHHC.mjs";import"../../chunk-YOZBVVKL.mjs";import"../../chunk-R7FWJP3N.mjs";import"../../chunk-UL777LTI.mjs";import"../../chunk-7ECCT6PK.mjs";import"../../chunk-AQW4BUKF.mjs";import"../../chunk-E2U27PNC.mjs";import"../../chunk-LAPXUUHK.mjs";import"../../chunk-HGLO5LDS.mjs";import"../../chunk-CW35YAMN.mjs";import"../../chunk-YZHAI55C.mjs";import"../../chunk-FZY4PMEE.mjs";import"../../chunk-TOBQ5UE6.mjs";import"../../chunk-MT2RJ7H3.mjs";import"../../chunk-Q4W3WJ2U.mjs";import"../../chunk-ORMOQWWH.mjs";import"../../chunk-FLZPUYXQ.mjs";import"../../chunk-LA56UDUK.mjs";import"../../chunk-ZYE7UTJZ.mjs";import"../../chunk-RGKRCZ36.mjs";import"../../chunk-FD6FGKYY.mjs";import"../../chunk-MCFQE4GC.mjs";import"../../chunk-4WPQQPUF.mjs";import"../../chunk-EBMEXURY.mjs";import"../../chunk-STY74NUA.mjs";import"../../chunk-IF4UU2MT.mjs";import"../../chunk-56CNRT2K.mjs";import"../../chunk-NCKJ7X57.mjs";import"../../chunk-P5HCJN3A.mjs";import"../../chunk-OLILO7VD.mjs";import"../../chunk-H3EP5CGP.mjs";import"../../chunk-KDMSOCZY.mjs";export{a as AccountAbstraction};
2
2
  //# sourceMappingURL=abstraction.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/api/account/abstraction.ts"],"sourcesContent":["import { AccountAddress, AccountAddressInput } from \"../../core\";\nimport {\n addAuthenticationFunctionTransaction,\n removeAuthenticationFunctionTransaction,\n removeDispatchableAuthenticatorTransaction,\n} from \"../../internal/abstraction\";\nimport { view } from \"../../internal/view\";\nimport { InputGenerateTransactionOptions, TypeTagAddress } from \"../../transactions\";\nimport { MoveFunctionId } from \"../../types\";\nimport { getFunctionParts } from \"../../utils/helpers\";\nimport { AptosConfig } from \"../aptosConfig\";\n\nexport class AccountAbstraction {\n constructor(readonly config: AptosConfig) {}\n\n /**\n * Adds a dispatchable authentication function to the account.\n *\n * @example\n * ```ts\n * const txn = await aptos.abstraction.addAuthenticationFunctionTransaction({\n * accountAddress: alice.accountAddress,\n * authenticationFunction: `${alice.accountAddress}::any_authenticator::authenticate`,\n * });\n *\n * const txn = await aptos.signAndSubmitTransaction({ signer: alice, transaction});\n * await aptos.waitForTransaction({ transactionHash: txn.hash });\n * ```\n *\n * @param args.accountAddress - The account to add the authentication function to.\n * @param args.authenticationFunction - The authentication function info to add.\n * @param args.options - The options for the transaction.\n * @returns A transaction to add the authentication function to the account.\n */\n public async addAuthenticationFunctionTransaction(args: {\n accountAddress: AccountAddressInput;\n authenticationFunction: string;\n options?: InputGenerateTransactionOptions;\n }) {\n const { accountAddress, authenticationFunction, options } = args;\n return addAuthenticationFunctionTransaction({\n aptosConfig: this.config,\n authenticationFunction,\n sender: accountAddress,\n options,\n });\n }\n\n /**\n * Removes a dispatchable authentication function from the account.\n *\n * @example\n * ```ts\n * const txn = await aptos.abstraction.removeAuthenticationFunctionTransaction({\n * accountAddress: alice.accountAddress,\n * authenticationFunction: `${alice.accountAddress}::any_authenticator::authenticate`,\n * });\n *\n * const txn = await aptos.signAndSubmitTransaction({ signer: alice, transaction: txn });\n * await aptos.waitForTransaction({ transactionHash: txn.hash });\n * ```\n *\n * @param args.accountAddress - The account to remove the authentication function from.\n * @param args.authenticationFunction - The authentication function info to remove.\n * @param args.options - The options for the transaction.\n * @returns A transaction to remove the authentication function from the account.\n */\n public async removeAuthenticationFunctionTransaction(args: {\n accountAddress: AccountAddressInput;\n authenticationFunction: string;\n options?: InputGenerateTransactionOptions;\n }) {\n const { accountAddress, authenticationFunction, options } = args;\n return removeAuthenticationFunctionTransaction({\n aptosConfig: this.config,\n sender: accountAddress,\n authenticationFunction,\n options,\n });\n }\n\n /**\n * Removes a dispatchable authenticator from the account.\n *\n * @example\n * ```ts\n * const txn = await aptos.abstraction.removeDispatchableAuthenticatorTransaction({\n * accountAddress: alice.accountAddress,\n * });\n *\n * const txn = await aptos.signAndSubmitTransaction({ signer: alice, transaction: txn });\n * await aptos.waitForTransaction({ transactionHash: txn.hash });\n * ```\n *\n * @param args.accountAddress - The account to remove the authenticator from.\n * @param args.options - The options for the transaction.\n * @returns A transaction to remove the authenticator from the account.\n */\n public async removeDispatchableAuthenticatorTransaction(args: {\n accountAddress: AccountAddressInput;\n options?: InputGenerateTransactionOptions;\n }) {\n const { accountAddress, options } = args;\n return removeDispatchableAuthenticatorTransaction({ aptosConfig: this.config, sender: accountAddress, options });\n }\n\n /**\n * Gets the dispatchable authentication function for the account.\n *\n * @example\n * ```ts\n * const functionInfos = await aptos.abstraction.getAuthenticationFunction({\n * accountAddress: alice.accountAddress,\n * });\n *\n * if (functionInfos) {\n * console.log(`Account ${alice.accountAddress.toString()} is using account abstraction!`);\n * } else {\n * console.log(`Account ${alice.accountAddress.toString()} is not using account abstraction.`);\n * }\n * ```\n *\n * @param args.accountAddress - The account to get the dispatchable authentication function for.\n * @returns The dispatchable authentication function for the account.\n */\n public async getAuthenticationFunction(args: { accountAddress: AccountAddressInput }) {\n const { accountAddress } = args;\n const [{ vec: functionInfoOption }] = await view<\n [{ vec: { function_name: string; module_name: string; module_address: string }[][] }]\n >({\n aptosConfig: this.config,\n payload: {\n function: \"0x1::account_abstraction::dispatchable_authenticator\",\n functionArguments: [AccountAddress.from(accountAddress)],\n abi: { typeParameters: [], parameters: [new TypeTagAddress()], returnTypes: [] },\n },\n });\n\n if (functionInfoOption.length === 0) return undefined;\n\n return functionInfoOption[0].map((functionInfo) => ({\n moduleAddress: AccountAddress.fromString(functionInfo.module_address),\n moduleName: functionInfo.module_name,\n functionName: functionInfo.function_name,\n }));\n }\n\n /**\n * Will return true if the account is abstracted, otherwise false.\n *\n * @example\n * ```ts\n * const isAccountAbstractionEnabled = await aptos.abstraction.isAccountAbstractionEnabled({\n * accountAddress: alice.accountAddress,\n * authenticationFunction: `${alice.accountAddress}::any_authenticator::authenticate`,\n * });\n * if (isAccountAbstractionEnabled) {\n * console.log(`Account ${alice.accountAddress.toString()} is using account abstraction!`);\n * } else {\n * console.log(`Account ${alice.accountAddress.toString()} is not using account abstraction.`);\n * }\n * ```\n *\n * @param args.accountAddress - The account to check.\n * @returns Whether the account is abstracted.\n */\n public isAccountAbstractionEnabled = async (args: {\n accountAddress: AccountAddressInput;\n authenticationFunction: string;\n }) => {\n const functionInfos = await this.getAuthenticationFunction(args);\n const { moduleAddress, moduleName, functionName } = getFunctionParts(args.authenticationFunction as MoveFunctionId);\n return (\n functionInfos?.some(\n (functionInfo) =>\n AccountAddress.fromString(moduleAddress).equals(functionInfo.moduleAddress) &&\n moduleName === functionInfo.moduleName &&\n functionName === functionInfo.functionName,\n ) ?? false\n );\n };\n\n /**\n * Creates a transaction to enable account abstraction with the given authentication function.\n *\n * @example\n * ```ts\n * const txn = await aptos.abstraction.enableAccountAbstractionTransaction({\n * accountAddress: alice.accountAddress,\n * authenticationFunction: `{alice.accountAddress}::any_authenticator::authenticate`,\n * });\n *\n * const txn = await aptos.signAndSubmitTransaction({ signer: alice, transaction: txn });\n * await aptos.waitForTransaction({ transactionHash: txn.hash });\n * ```\n *\n * @param args.accountAddress - The account to enable account abstraction for.\n * @param args.authenticationFunction - The authentication function info to use.\n * @param args.options - The options for the transaction.\n * @returns A transaction to enable account abstraction for the account.\n */\n public enableAccountAbstractionTransaction = this.addAuthenticationFunctionTransaction;\n\n /**\n * Creates a transaction to disable account abstraction. If an authentication function is provided, it will specify to\n * remove the authentication function.\n *\n * @example\n * ```ts\n * const txn = await aptos.abstraction.disableAccountAbstractionTransaction({\n * accountAddress: alice.accountAddress,\n * authenticationFunction: `${alice.accountAddress}::any_authenticator::authenticate`,\n * });\n *\n * const txn = await aptos.signAndSubmitTransaction({ signer: alice, transaction: txn });\n * await aptos.waitForTransaction({ transactionHash: txn.hash });\n * ```\n *\n * @param args.accountAddress - The account to disable account abstraction for.\n * @param args.authenticationFunction - The authentication function info to remove.\n * @param args.options - The options for the transaction.\n * @returns A transaction to disable account abstraction for the account.\n */\n public disableAccountAbstractionTransaction = async (args: {\n accountAddress: AccountAddressInput;\n authenticationFunction?: string;\n options?: InputGenerateTransactionOptions;\n }) => {\n const { accountAddress, authenticationFunction, options } = args;\n if (authenticationFunction) {\n return this.removeAuthenticationFunctionTransaction({\n accountAddress,\n authenticationFunction,\n options,\n });\n }\n return this.removeDispatchableAuthenticatorTransaction({ accountAddress, options });\n };\n}\n"],"mappings":"AAAA,OAAS,kBAAAA,MAA2C,aACpD,OACE,wCAAAC,EACA,2CAAAC,EACA,8CAAAC,MACK,6BACP,OAAS,QAAAC,MAAY,sBACrB,OAA0C,kBAAAC,MAAsB,qBAEhE,OAAS,oBAAAC,MAAwB,sBAG1B,MAAMC,CAAmB,CAC9B,YAAqBC,EAAqB,CAArB,YAAAA,EAyJrB,KAAO,4BAA8B,MAAOC,GAGtC,CACJ,MAAMC,EAAgB,MAAM,KAAK,0BAA0BD,CAAI,EACzD,CAAE,cAAAE,EAAe,WAAAC,EAAY,aAAAC,CAAa,EAAIP,EAAiBG,EAAK,sBAAwC,EAClH,OACEC,GAAe,KACZI,GACCd,EAAe,WAAWW,CAAa,EAAE,OAAOG,EAAa,aAAa,GAC1EF,IAAeE,EAAa,YAC5BD,IAAiBC,EAAa,YAClC,GAAK,EAET,EAqBA,KAAO,oCAAsC,KAAK,qCAsBlD,KAAO,qCAAuC,MAAOL,GAI/C,CACJ,KAAM,CAAE,eAAAM,EAAgB,uBAAAC,EAAwB,QAAAC,CAAQ,EAAIR,EAC5D,OAAIO,EACK,KAAK,wCAAwC,CAClD,eAAAD,EACA,uBAAAC,EACA,QAAAC,CACF,CAAC,EAEI,KAAK,2CAA2C,CAAE,eAAAF,EAAgB,QAAAE,CAAQ,CAAC,CACpF,CAhO2C,CAqB3C,MAAa,qCAAqCR,EAI/C,CACD,KAAM,CAAE,eAAAM,EAAgB,uBAAAC,EAAwB,QAAAC,CAAQ,EAAIR,EAC5D,OAAOR,EAAqC,CAC1C,YAAa,KAAK,OAClB,uBAAAe,EACA,OAAQD,EACR,QAAAE,CACF,CAAC,CACH,CAqBA,MAAa,wCAAwCR,EAIlD,CACD,KAAM,CAAE,eAAAM,EAAgB,uBAAAC,EAAwB,QAAAC,CAAQ,EAAIR,EAC5D,OAAOP,EAAwC,CAC7C,YAAa,KAAK,OAClB,OAAQa,EACR,uBAAAC,EACA,QAAAC,CACF,CAAC,CACH,CAmBA,MAAa,2CAA2CR,EAGrD,CACD,KAAM,CAAE,eAAAM,EAAgB,QAAAE,CAAQ,EAAIR,EACpC,OAAON,EAA2C,CAAE,YAAa,KAAK,OAAQ,OAAQY,EAAgB,QAAAE,CAAQ,CAAC,CACjH,CAqBA,MAAa,0BAA0BR,EAA+C,CACpF,KAAM,CAAE,eAAAM,CAAe,EAAIN,EACrB,CAAC,CAAE,IAAKS,CAAmB,CAAC,EAAI,MAAMd,EAE1C,CACA,YAAa,KAAK,OAClB,QAAS,CACP,SAAU,uDACV,kBAAmB,CAACJ,EAAe,KAAKe,CAAc,CAAC,EACvD,IAAK,CAAE,eAAgB,CAAC,EAAG,WAAY,CAAC,IAAIV,CAAgB,EAAG,YAAa,CAAC,CAAE,CACjF,CACF,CAAC,EAED,GAAIa,EAAmB,SAAW,EAElC,OAAOA,EAAmB,CAAC,EAAE,IAAKJ,IAAkB,CAClD,cAAed,EAAe,WAAWc,EAAa,cAAc,EACpE,WAAYA,EAAa,YACzB,aAAcA,EAAa,aAC7B,EAAE,CACJ,CA6FF","names":["AccountAddress","addAuthenticationFunctionTransaction","removeAuthenticationFunctionTransaction","removeDispatchableAuthenticatorTransaction","view","TypeTagAddress","getFunctionParts","AccountAbstraction","config","args","functionInfos","moduleAddress","moduleName","functionName","functionInfo","accountAddress","authenticationFunction","options","functionInfoOption"]}
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -2,9 +2,9 @@ import { GetAccountOwnedTokensQueryResponse, GetAccountOwnedTokensFromCollection
2
2
  import { A as AptosConfig, m as AccountAddressInput, c9 as AccountData, c6 as LedgerVersionArg, ca as MoveModuleBytecode, bQ as CursorPaginationArgs, bP as PaginationArgs, cc as TransactionResponse, c8 as MoveResource, d8 as MoveStructId, bN as AnyNumber, n as AccountAddress, bR as TokenStandardArg, bS as OrderByArg, bT as WhereArg, L as PrivateKeyInput } from '../account-BortO8g2.mjs';
3
3
  import { CurrentFungibleAssetBalancesBoolExp } from '../types/generated/types.mjs';
4
4
  import { A as Account$1 } from '../Ed25519Account-CPwej6wB.mjs';
5
- import { AccountAbstraction } from './account/abstraction.mjs';
6
5
  import { BaseAccountPublicKey } from '../core/crypto/types.mjs';
7
6
  import { AccountInfo } from '../internal/account.mjs';
7
+ import { AccountAbstraction } from './account/abstraction.mjs';
8
8
  import '../types/generated/operations.mjs';
9
9
  import '../utils/apiEndpoints.mjs';
10
10
  import '../utils/const.mjs';
@@ -1,2 +1,2 @@
1
- import{AccountAddress as c,createObjectAddress as m}from"../core";import{deriveAccountFromPrivateKey as p,getAccountCoinsCount as f,getAccountCoinsData as y,getAccountCollectionsWithOwnedTokens as C,getAccountOwnedObjects as l,getAccountOwnedTokens as O,getAccountOwnedTokensFromCollectionAddress as T,getAccountsForPublicKey as P,getAccountTokensCount as R,getAccountTransactionsCount as S,getBalance as L,getInfo as h,getModule as V,getModules as b,getModulesPage as I,getResource as w,getResources as M,getResourcesPage as N,getTransactions as E,lookupOriginalAccountAddress as v,deriveOwnedAccountsFromSigner as _}from"../internal/account";import{APTOS_COIN as d,APTOS_FA as k,ProcessorType as n}from"../utils/const";import{waitForIndexerOnVersion as o}from"./utils";import{view as a}from"../internal/view";import{isEncodedStruct as B,parseEncodedStruct as F}from"../utils";import{memoizeAsync as G}from"../utils/memoize";import{AccountAbstraction as K}from"./account/abstraction";class Le{constructor(e){this.config=e;this.abstraction=new K(e)}async getAccountInfo(e){return h({aptosConfig:this.config,...e})}async getAccountModules(e){return b({aptosConfig:this.config,...e})}async getAccountModulesPage(e){return I({aptosConfig:this.config,...e})}async getAccountModule(e){return V({aptosConfig:this.config,...e})}async getAccountTransactions(e){return E({aptosConfig:this.config,...e})}async getAccountResources(e){return M({aptosConfig:this.config,...e})}async getAccountResourcesPage(e){return N({aptosConfig:this.config,...e})}async getAccountResource(e){return w({aptosConfig:this.config,...e})}async lookupOriginalAccountAddress(e){return v({aptosConfig:this.config,...e})}async getAccountTokensCount(e){return await o({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:n.ACCOUNT_TRANSACTION_PROCESSOR}),R({aptosConfig:this.config,...e})}async getAccountOwnedTokens(e){return await o({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:n.TOKEN_V2_PROCESSOR}),O({aptosConfig:this.config,...e})}async getAccountOwnedTokensFromCollectionAddress(e){return await o({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:n.TOKEN_V2_PROCESSOR}),T({aptosConfig:this.config,...e})}async getAccountCollectionsWithOwnedTokens(e){return await o({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:n.TOKEN_V2_PROCESSOR}),C({aptosConfig:this.config,...e})}async getAccountTransactionsCount(e){return await o({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:n.ACCOUNT_TRANSACTION_PROCESSOR}),S({aptosConfig:this.config,...e})}async getAccountCoinsData(e){return await o({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:n.FUNGIBLE_ASSET_PROCESSOR}),y({aptosConfig:this.config,...e})}async getAccountCoinsCount(e){return await o({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:n.FUNGIBLE_ASSET_PROCESSOR}),f({aptosConfig:this.config,...e})}async getAccountAPTAmount(e){return this.getAccountCoinAmount({coinType:d,faMetadataAddress:k,...e})}async getAccountCoinAmount(e){const{accountAddress:g,coinType:s,faMetadataAddress:i}=e;let u=s;s===void 0&&i!==void 0&&(u=await G(async()=>{try{const t=(await a({aptosConfig:this.config,payload:{function:"0x1::coin::paired_coin",functionArguments:[i]}}))[0];if(t.vec.length>0&&B(t.vec[0]))return F(t.vec[0])}catch{}},`coin-mapping-${i.toString()}`,1e3*60*5)());let r;if(s!==void 0&&i!==void 0)r=c.from(i).toStringLong();else if(s!==void 0&&i===void 0)s===d?r=c.A.toStringLong():r=m(c.A,s).toStringLong();else if(s===void 0&&i!==void 0){const t=c.from(i);r=t.toStringLong(),t===c.A&&(u=d)}else throw new Error("Either coinType, faMetadataAddress, or both must be provided");if(u!==void 0){const[t]=await a({aptosConfig:this.config,payload:{function:"0x1::coin::balance",typeArguments:[u],functionArguments:[g]}});return parseInt(t,10)}const[A]=await a({aptosConfig:this.config,payload:{function:"0x1::primary_fungible_store::balance",typeArguments:["0x1::object::ObjectCore"],functionArguments:[g,r]}});return parseInt(A,10)}async getBalance(e){return L({aptosConfig:this.config,...e})}async getAccountOwnedObjects(e){return await o({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:n.DEFAULT}),l({aptosConfig:this.config,...e})}async deriveAccountFromPrivateKey(e){return await o({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:n.ACCOUNT_RESTORATION_PROCESSOR}),await o({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:n.OBJECT_PROCESSOR}),p({aptosConfig:this.config,...e})}async deriveOwnedAccountsFromSigner(e){return await o({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:n.ACCOUNT_RESTORATION_PROCESSOR}),await o({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:n.OBJECT_PROCESSOR}),_({aptosConfig:this.config,...e})}async getAccountsForPublicKey(e){return await o({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:n.ACCOUNT_RESTORATION_PROCESSOR}),await o({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:n.OBJECT_PROCESSOR}),P({aptosConfig:this.config,...e})}}export{Le as Account};
1
+ import{Wc as a}from"../chunk-PJTG745G.mjs";import"../chunk-A5L76YP7.mjs";import"../chunk-5HXLZHDW.mjs";import"../chunk-GOXRBEIJ.mjs";import"../chunk-XJJVJOX5.mjs";import"../chunk-QNARIAVM.mjs";import"../chunk-2PASUPUO.mjs";import"../chunk-C3Q23D22.mjs";import"../chunk-NECL5FCQ.mjs";import"../chunk-4QMXOWHP.mjs";import"../chunk-RQX6JOEN.mjs";import"../chunk-WSR5EBJM.mjs";import"../chunk-WCMW2L3P.mjs";import"../chunk-V74WPKSY.mjs";import"../chunk-UYVPNUH3.mjs";import"../chunk-G3MHXDYA.mjs";import"../chunk-626KB2UQ.mjs";import"../chunk-XKUIMGKU.mjs";import"../chunk-N6YTF76Q.mjs";import"../chunk-FGFLPH5K.mjs";import"../chunk-QREVMGQZ.mjs";import"../chunk-V3MBJJTL.mjs";import"../chunk-ZP4DWSQA.mjs";import"../chunk-2OPKZKOB.mjs";import"../chunk-FC72YL4B.mjs";import"../chunk-YS5IUILF.mjs";import"../chunk-PSSIJHHC.mjs";import"../chunk-YOZBVVKL.mjs";import"../chunk-R7FWJP3N.mjs";import"../chunk-UL777LTI.mjs";import"../chunk-7ECCT6PK.mjs";import"../chunk-AQW4BUKF.mjs";import"../chunk-E2U27PNC.mjs";import"../chunk-LAPXUUHK.mjs";import"../chunk-HGLO5LDS.mjs";import"../chunk-CW35YAMN.mjs";import"../chunk-YZHAI55C.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-TOBQ5UE6.mjs";import"../chunk-MT2RJ7H3.mjs";import"../chunk-Q4W3WJ2U.mjs";import"../chunk-ORMOQWWH.mjs";import"../chunk-FLZPUYXQ.mjs";import"../chunk-LA56UDUK.mjs";import"../chunk-ZYE7UTJZ.mjs";import"../chunk-RGKRCZ36.mjs";import"../chunk-FD6FGKYY.mjs";import"../chunk-MCFQE4GC.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-EBMEXURY.mjs";import"../chunk-STY74NUA.mjs";import"../chunk-IF4UU2MT.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-NCKJ7X57.mjs";import"../chunk-P5HCJN3A.mjs";import"../chunk-OLILO7VD.mjs";import"../chunk-H3EP5CGP.mjs";import"../chunk-KDMSOCZY.mjs";export{a as Account};
2
2
  //# sourceMappingURL=account.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/api/account.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Account as AccountModule } from \"../account\";\nimport {\n AccountAddress,\n AccountAddressInput,\n createObjectAddress,\n BaseAccountPublicKey,\n PrivateKeyInput,\n} from \"../core\";\nimport {\n AccountData,\n AnyNumber,\n CursorPaginationArgs,\n GetAccountCoinsDataResponse,\n GetAccountCollectionsWithOwnedTokenResponse,\n GetAccountOwnedTokensFromCollectionResponse,\n GetAccountOwnedTokensQueryResponse,\n GetObjectDataQueryResponse,\n LedgerVersionArg,\n MoveModuleBytecode,\n MoveResource,\n MoveStructId,\n MoveValue,\n OrderByArg,\n PaginationArgs,\n TokenStandardArg,\n TransactionResponse,\n WhereArg,\n} from \"../types\";\nimport {\n deriveAccountFromPrivateKey,\n getAccountCoinsCount,\n getAccountCoinsData,\n getAccountCollectionsWithOwnedTokens,\n getAccountOwnedObjects,\n getAccountOwnedTokens,\n getAccountOwnedTokensFromCollectionAddress,\n getAccountsForPublicKey,\n getAccountTokensCount,\n getAccountTransactionsCount,\n getBalance,\n getInfo,\n getModule,\n getModules,\n getModulesPage,\n getResource,\n getResources,\n getResourcesPage,\n getTransactions,\n lookupOriginalAccountAddress,\n deriveOwnedAccountsFromSigner,\n AccountInfo,\n} from \"../internal/account\";\nimport { APTOS_COIN, APTOS_FA, ProcessorType } from \"../utils/const\";\nimport { AptosConfig } from \"./aptosConfig\";\nimport { waitForIndexerOnVersion } from \"./utils\";\nimport { CurrentFungibleAssetBalancesBoolExp } from \"../types/generated/types\";\nimport { view } from \"../internal/view\";\nimport { isEncodedStruct, parseEncodedStruct } from \"../utils\";\nimport { memoizeAsync } from \"../utils/memoize\";\nimport { AccountAbstraction } from \"./account/abstraction\";\n\n/**\n * A class to query all `Account` related queries on Aptos.\n * @group Account\n */\nexport class Account {\n abstraction: AccountAbstraction;\n\n /**\n * Creates an instance of the Aptos client with the provided configuration.\n *\n * @param config - The configuration settings for the Aptos client.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * async function runExample() {\n * // Initialize the Aptos client with testnet configuration\n * const config = new AptosConfig({ network: Network.TESTNET }); // specify your own network if needed\n * const aptos = new Aptos(config);\n *\n * console.log(\"Aptos client initialized:\", aptos);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Account\n */\n constructor(readonly config: AptosConfig) {\n this.abstraction = new AccountAbstraction(config);\n }\n\n /**\n * Queries the current state for an Aptos account given its account address.\n *\n * @param args - The arguments for retrieving account information.\n * @param args.accountAddress - The Aptos account address to query.\n * @returns The account data.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Retrieve account information for a specific address\n * const accountInfo = await aptos.getAccountInfo({ accountAddress: \"0x1\" }); // replace with a real account address\n * console.log(accountInfo);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Account\n */\n async getAccountInfo(args: { accountAddress: AccountAddressInput }): Promise<AccountData> {\n return getInfo({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries for all modules in an account given an account address.\n * This function may call the API multiple times to auto paginate through results.\n *\n * @param args.accountAddress - The Aptos account address to query modules for.\n * @param args.options.limit - The maximum number of results to return.\n * @param args.options.ledgerVersion - The ledger version to query; if not provided, it retrieves the latest version.\n *\n * @returns - The account modules associated with the specified address.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Fetching account modules for a specific account\n * const accountModules = await aptos.getAccountModules({\n * accountAddress: \"0x1\", // replace with a real account address\n * options: {\n * limit: 10, // limiting to 10 modules\n * },\n * });\n *\n * console.log(accountModules);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Account\n */\n async getAccountModules(args: {\n accountAddress: AccountAddressInput;\n options?: { limit?: number } & LedgerVersionArg;\n }): Promise<MoveModuleBytecode[]> {\n return getModules({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries for a page of modules in an account given an account address.\n *\n * @param args.accountAddress - The Aptos account address to query modules for.\n * @param args.options.cursor - The cursor to start returning results from. Note, this is obfuscated and is not an index.\n * @param args.options.limit - The maximum number of results to return.\n * @param args.options.ledgerVersion - The ledger version to query; if not provided, it retrieves the latest version.\n *\n * @returns - The account modules associated with the specified address. Along with a cursor for future pagination. If the cursor is undefined, it means there are no more modules to fetch.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Fetching account modules for a specific account\n * const {modules, cursor} = await aptos.getAccountModulesPage({\n * accountAddress: \"0x1\", // replace with a real account address\n * options: {\n * cursor: undefined, // starting from the first module\n * limit: 10, // limiting to 10 modules\n * },\n * });\n *\n * console.log(modules);\n * console.log(`More to fetch: ${cursor !== undefined}`);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Account\n */\n async getAccountModulesPage(args: {\n accountAddress: AccountAddressInput;\n options?: CursorPaginationArgs & LedgerVersionArg;\n }): Promise<{ modules: MoveModuleBytecode[]; cursor: string | undefined }> {\n return getModulesPage({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries for a specific account module given an account address and module name.\n *\n * @param args.accountAddress - The Aptos account address.\n * @param args.moduleName - The name of the module.\n * @param args.options.ledgerVersion - The ledger version to query; if not provided, it will get the latest version.\n *\n * @returns The account module associated with the specified account address and module name.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Get the account module for a specific account address and module name\n * const module = await aptos.getAccountModule({\n * accountAddress: \"0x1\", // replace with a real account address\n * moduleName: \"MyModule\" // specify the module name\n * });\n *\n * console.log(module);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Account\n */\n async getAccountModule(args: {\n accountAddress: AccountAddressInput;\n moduleName: string;\n options?: LedgerVersionArg;\n }): Promise<MoveModuleBytecode> {\n return getModule({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries account transactions given an account address.\n * This function may call the API multiple times to auto paginate and retrieve all account transactions.\n *\n * @param args.accountAddress - The Aptos account address to query transactions for.\n * @param args.options - Optional pagination arguments.\n * @param args.options.offset - The number of transactions to start returning results from.\n * @param args.options.limit - The maximum number of results to return.\n *\n * @returns The account transactions.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Fetch transactions for a specific account\n * const transactions = await aptos.getAccountTransactions({\n * accountAddress: \"0x1\", // replace with a real account address\n * options: {\n * offset: 0, // starting from the first transaction\n * limit: 10, // limiting to 10 transactions\n * },\n * });\n *\n * console.log(transactions);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Account\n */\n async getAccountTransactions(args: {\n accountAddress: AccountAddressInput;\n options?: PaginationArgs;\n }): Promise<TransactionResponse[]> {\n return getTransactions({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Queries all account resources given an account address.\n * This function may call the API multiple times to auto paginate through results.\n *\n * @param args.accountAddress - The Aptos account address to query resources for.\n * @param args.options.limit - The maximum number of results to return.\n * @param args.options.ledgerVersion - The ledger version to query; if not provided, it will get the latest version.\n * @returns Account resources.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Fetching account resources for a specific account address\n * const resources = await aptos.getAccountResources({ accountAddress: \"0x1\" }); // replace with a real account address\n * console.log(resources);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Account\n */\n async getAccountResources(args: {\n accountAddress: AccountAddressInput;\n options?: PaginationArgs & LedgerVersionArg;\n }): Promise<MoveResource[]> {\n return getResources({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries a page of account resources given an account address.\n *\n * @param args.accountAddress - The Aptos account address to query resources for.\n * @param args.options.cursor - The cursor to start returning results from. Note, this is obfuscated and is not an index.\n * @param args.options.limit - The maximum number of results to return.\n * @param args.options.ledgerVersion - The ledger version to query; if not provided, it will get the latest version.\n * @returns Account resources.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Fetching account resources for a specific account address\n * const resources = await aptos.getAccountResourcesPage({\n * accountAddress: \"0x1\", // replace with a real account address\n * options: {\n * cursor: undefined, // starting from the first resource\n * limit: 10, // limiting to 10 resources\n * },\n * });\n * console.log(resources);\n * console.log(`More to fetch: ${resources.cursor !== undefined}`);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Account\n */\n async getAccountResourcesPage(args: {\n accountAddress: AccountAddressInput;\n options?: CursorPaginationArgs & LedgerVersionArg;\n }): Promise<{ resources: MoveResource[]; cursor: string | undefined }> {\n return getResourcesPage({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries a specific account resource given an account address and resource type.\n *\n * @template T - The typed output of the resource.\n * @param args.accountAddress - The Aptos account address to query.\n * @param args.resourceType - The string representation of an on-chain Move struct type, e.g., \"0x1::aptos_coin::AptosCoin\".\n * @param args.options.ledgerVersion - The ledger version to query; if not provided, it will get the latest version.\n * @returns The account resource of the specified type.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Get the account resource for a specific account address and resource type\n * const resource = await aptos.getAccountResource({\n * accountAddress: \"0x1\", // replace with a real account address\n * resourceType: \"0x1::aptos_coin::AptosCoin\"\n * });\n *\n * console.log(resource);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Account\n */\n async getAccountResource<T extends {} = any>(args: {\n accountAddress: AccountAddressInput;\n resourceType: MoveStructId;\n options?: LedgerVersionArg;\n }): Promise<T> {\n return getResource<T>({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Looks up the account address for a given authentication key, handling both rotated and non-rotated keys.\n *\n * @param args.authenticationKey - The authentication key for which to look up the account address.\n * @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.\n * @param args.options.ledgerVersion - The ledger version to query; if not provided, it will get the latest version.\n * @returns Promise<AccountAddress> - The account address associated with the authentication key.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Look up the original account address for a given authentication key\n * const accountAddress = await aptos.lookupOriginalAccountAddress({\n * authenticationKey: \"0x1\", // replace with a real authentication key\n * });\n *\n * console.log(\"Original Account Address:\", accountAddress);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Account\n */\n async lookupOriginalAccountAddress(args: {\n authenticationKey: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n options?: LedgerVersionArg;\n }): Promise<AccountAddress> {\n return lookupOriginalAccountAddress({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries the current count of tokens owned by a specified account.\n *\n * @param args - The parameters for the query.\n * @param args.accountAddress - The account address to query the token count for.\n * @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.\n * @returns The current count of tokens owned by the account.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Get the count of tokens owned by the account\n * const tokensCount = await aptos.getAccountTokensCount({ accountAddress: \"0x1\" }); // replace with a real account address\n * console.log(`Tokens Count: ${tokensCount}`);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Account\n */\n async getAccountTokensCount(args: {\n accountAddress: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n }): Promise<number> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.ACCOUNT_TRANSACTION_PROCESSOR,\n });\n return getAccountTokensCount({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Queries the tokens currently owned by a specified account, including NFTs and fungible tokens.\n * If desired, you can filter the results by a specific token standard.\n *\n * @param args.accountAddress The account address for which to retrieve owned tokens.\n * @param args.minimumLedgerVersion Optional ledger version to sync up to before querying.\n * @param args.options.tokenStandard Optional filter for the NFT standard to query for.\n * @param args.options.offset Optional number to start returning results from.\n * @param args.options.limit Optional number of results to return.\n * @param args.options.orderBy Optional order to sort the tokens by.\n * @returns An array of tokens with their respective data.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Get the tokens owned by a specific account\n * const accountOwnedTokens = await aptos.getAccountOwnedTokens({\n * accountAddress: \"0x1\", // replace with a real account address\n * options: {\n * limit: 10, // specify how many tokens to return\n * orderBy: \"created_at\", // specify the order of the results\n * },\n * });\n *\n * console.log(accountOwnedTokens);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Account\n */\n async getAccountOwnedTokens(args: {\n accountAddress: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n options?: TokenStandardArg & PaginationArgs & OrderByArg<GetAccountOwnedTokensQueryResponse[0]>;\n }): Promise<GetAccountOwnedTokensQueryResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.TOKEN_V2_PROCESSOR,\n });\n return getAccountOwnedTokens({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Queries all current tokens of a specific collection that an account owns by the collection address.\n * This query returns all tokens (v1 and v2 standards) an account owns, including NFTs, fungible, soulbound, etc.\n * If you want to get only the token from a specific standard, you can pass an optional tokenStandard parameter.\n *\n * @param args.accountAddress - The account address we want to get the tokens for.\n * @param args.collectionAddress - The address of the collection being queried.\n * @param args.minimumLedgerVersion - Optional ledger version to sync up to, before querying.\n * @param args.options.tokenStandard - The NFT standard to query for.\n * @param args.options.offset - The number token to start returning results from.\n * @param args.options.limit - The number of results to return.\n * @param args.options.orderBy - The order to sort the tokens by.\n * @returns Tokens array with the token data.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Get tokens owned by a specific account in a specific collection\n * const accountOwnedTokens = await aptos.getAccountOwnedTokensFromCollectionAddress({\n * accountAddress: \"0x1\", // replace with a real account address\n * collectionAddress: \"0x2\", // replace with a real collection address\n * });\n *\n * console.log(accountOwnedTokens);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Account\n */\n async getAccountOwnedTokensFromCollectionAddress(args: {\n accountAddress: AccountAddressInput;\n collectionAddress: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n options?: TokenStandardArg & PaginationArgs & OrderByArg<GetAccountOwnedTokensFromCollectionResponse[0]>;\n }): Promise<GetAccountOwnedTokensFromCollectionResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.TOKEN_V2_PROCESSOR,\n });\n return getAccountOwnedTokensFromCollectionAddress({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Queries for all collections that an account currently has tokens for, including NFTs, fungible tokens, and soulbound tokens.\n * If you want to filter by a specific token standard, you can pass an optional tokenStandard parameter.\n *\n * @param args.accountAddress - The account address we want to get the collections for.\n * @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.\n * @param args.options.tokenStandard - The NFT standard to query for.\n * @param args.options.offset - The number of the collection to start returning results from.\n * @param args.options.limit - The number of results to return.\n * @param args.options.orderBy - The order to sort the tokens by.\n * @returns Collections array with the collections data.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Get account collections with owned tokens for a specific account\n * const accountCollectionsWithOwnedTokens = await aptos.getAccountCollectionsWithOwnedTokens({\n * accountAddress: \"0x1\", // replace with a real account address\n * options: {\n * tokenStandard: \"NFT\", // specify the token standard if needed\n * limit: 10, // specify the number of results to return\n * },\n * });\n *\n * console.log(accountCollectionsWithOwnedTokens);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Account\n */\n async getAccountCollectionsWithOwnedTokens(args: {\n accountAddress: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n options?: TokenStandardArg & PaginationArgs & OrderByArg<GetAccountCollectionsWithOwnedTokenResponse[0]>;\n }): Promise<GetAccountCollectionsWithOwnedTokenResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.TOKEN_V2_PROCESSOR,\n });\n return getAccountCollectionsWithOwnedTokens({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Queries the current count of transactions submitted by an account.\n *\n * @param args - The parameters for the query.\n * @param args.accountAddress - The account address we want to get the total count for.\n * @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.\n * @returns Current count of transactions made by an account.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Get the count of transactions for a specific account\n * const accountTransactionsCount = await aptos.getAccountTransactionsCount({\n * accountAddress: \"0x1\", // replace with a real account address\n * minimumLedgerVersion: 1, // specify your own minimum ledger version if needed\n * });\n *\n * console.log(accountTransactionsCount);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Account\n */\n async getAccountTransactionsCount(args: {\n accountAddress: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n }): Promise<number> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.ACCOUNT_TRANSACTION_PROCESSOR,\n });\n return getAccountTransactionsCount({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Retrieves the coins data for a specified account.\n *\n * @param args.accountAddress - The account address for which to retrieve the coin's data.\n * @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.\n * @param args.options.offset - Optional. The number of coins to start returning results from.\n * @param args.options.limit - Optional. The number of results to return.\n * @param args.options.orderBy - Optional. The order to sort the coins by.\n * @param args.options.where - Optional. Filter the results by specific criteria.\n * @returns An array containing the coins data for the specified account.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Fetching coins data for a specific account\n * const accountCoinsData = await aptos.getAccountCoinsData({\n * accountAddress: \"0x1\", // replace with a real account address\n * options: {\n * limit: 10, // specify the number of results to return\n * orderBy: { asset_type: \"asc\" }, // specify the order of results\n * },\n * });\n *\n * console.log(accountCoinsData);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Account\n */\n async getAccountCoinsData(args: {\n accountAddress: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n options?: PaginationArgs &\n OrderByArg<GetAccountCoinsDataResponse[0]> &\n WhereArg<CurrentFungibleAssetBalancesBoolExp>;\n }): Promise<GetAccountCoinsDataResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.FUNGIBLE_ASSET_PROCESSOR,\n });\n return getAccountCoinsData({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Retrieves the current count of an account's coins aggregated across all types.\n *\n * @param args The parameters for the account coins count query.\n * @param args.accountAddress The account address we want to get the total count for.\n * @param args.minimumLedgerVersion Optional ledger version to sync up to before querying.\n * @returns The current count of the aggregated coins for the specified account.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Getting the account coins count for a specific account\n * const accountCoinsCount = await aptos.getAccountCoinsCount({ accountAddress: \"0x1\" }); // replace with a real account address\n * console.log(\"Account Coins Count:\", accountCoinsCount);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Account\n */\n async getAccountCoinsCount(args: {\n accountAddress: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n }): Promise<number> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.FUNGIBLE_ASSET_PROCESSOR,\n });\n return getAccountCoinsCount({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Retrieves the current amount of APT for a specified account. If the account does not exist, it will return 0.\n *\n * @param args The arguments for the account query.\n * @param args.accountAddress The account address for which to retrieve the APT amount.\n * @param args.minimumLedgerVersion Optional ledger version to sync up to before querying.\n * @returns The current amount of APT for the specified account.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Get the APT amount for a specific account\n * const accountAPTAmount = await aptos.getAccountAPTAmount({ accountAddress: \"0x1\" }); // replace with a real account address\n * console.log(\"Account APT Amount:\", accountAPTAmount);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Account\n */\n async getAccountAPTAmount(args: {\n accountAddress: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n }): Promise<number> {\n return this.getAccountCoinAmount({ coinType: APTOS_COIN, faMetadataAddress: APTOS_FA, ...args });\n }\n\n /**\n * Queries the current amount of a specified coin held by an account.\n *\n * @deprecated Use `getBalance({ accountAddress, asset })` instead.\n * This method is slated for removal in a future release.\n *\n * @param args The parameters for querying the account's coin amount.\n * @param args.accountAddress The account address to query for the coin amount.\n * @param args.coinType The coin type to query. Note: If not provided, it may be automatically populated if `faMetadataAddress`\n * is specified.\n * @param args.faMetadataAddress The fungible asset metadata address to query. Note: If not provided, it may be automatically\n * populated if `coinType` is specified.\n * @returns The current amount of the specified coin held by the account.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Prefer the new API\n * const amount = await aptos.getBalance({ accountAddress: \"0x1\", asset: \"0x1::aptos_coin::AptosCoin\" });\n * console.log(`Balance: ${amount}`);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Account\n */\n async getAccountCoinAmount(args: {\n accountAddress: AccountAddressInput;\n coinType?: MoveStructId;\n faMetadataAddress?: AccountAddressInput;\n }): Promise<number> {\n const { accountAddress, coinType, faMetadataAddress } = args;\n\n // Attempt to populate the CoinType field if the FA address is provided.\n // We cannot do this internally due to dependency cycles issue.\n let coinAssetType: MoveStructId | undefined = coinType;\n if (coinType === undefined && faMetadataAddress !== undefined) {\n coinAssetType = await memoizeAsync(\n async () => {\n try {\n const pairedCoinTypeStruct = (\n await view<[{ vec: [MoveStructId] }]>({\n aptosConfig: this.config,\n payload: { function: \"0x1::coin::paired_coin\", functionArguments: [faMetadataAddress] },\n })\n )[0];\n\n // Check if the Option has a value, and if so, parse the struct\n if (pairedCoinTypeStruct.vec.length > 0 && isEncodedStruct(pairedCoinTypeStruct.vec[0])) {\n return parseEncodedStruct(pairedCoinTypeStruct.vec[0]);\n }\n } catch (error) {\n /* No paired coin type found */\n }\n return undefined;\n },\n `coin-mapping-${faMetadataAddress.toString()}`,\n 1000 * 60 * 5, // 5 minutes\n )();\n }\n\n let faAddress: string;\n\n if (coinType !== undefined && faMetadataAddress !== undefined) {\n faAddress = AccountAddress.from(faMetadataAddress).toStringLong();\n } else if (coinType !== undefined && faMetadataAddress === undefined) {\n // TODO Move to a separate function as defined in the AIP for coin migration\n if (coinType === APTOS_COIN) {\n faAddress = AccountAddress.A.toStringLong();\n } else {\n faAddress = createObjectAddress(AccountAddress.A, coinType).toStringLong();\n }\n } else if (coinType === undefined && faMetadataAddress !== undefined) {\n const addr = AccountAddress.from(faMetadataAddress);\n faAddress = addr.toStringLong();\n if (addr === AccountAddress.A) {\n coinAssetType = APTOS_COIN;\n }\n // The paired CoinType should be populated outside of this function in another\n // async call. We cannot do this internally due to dependency cycles issue.\n } else {\n throw new Error(\"Either coinType, faMetadataAddress, or both must be provided\");\n }\n\n // When there is a coin mapping, use that first, otherwise use the fungible asset address\n // TODO: This function's signature at the top, returns number, but it could be greater than can be represented\n if (coinAssetType !== undefined) {\n const [balanceStr] = await view<[string]>({\n aptosConfig: this.config,\n payload: {\n function: \"0x1::coin::balance\",\n typeArguments: [coinAssetType],\n functionArguments: [accountAddress],\n },\n });\n return parseInt(balanceStr, 10);\n }\n const [balanceStr] = await view<[string]>({\n aptosConfig: this.config,\n payload: {\n function: \"0x1::primary_fungible_store::balance\",\n typeArguments: [\"0x1::object::ObjectCore\"],\n functionArguments: [accountAddress, faAddress],\n },\n });\n return parseInt(balanceStr, 10);\n }\n\n /**\n * Retrieves the balance for an account and asset.\n *\n * @param args The parameters for the balance query.\n * @param args.accountAddress The account address to query.\n * @param args.asset The asset to query: Move struct ID (e.g., `0x1::aptos_coin::AptosCoin`) or FA metadata address.\n * @returns The balance as a number.\n *\n * @example\n * ```ts\n * const aptos = new Aptos(new AptosConfig());\n * // APT coin by type\n * const apt = await aptos.getBalance({ accountAddress: \"0x1\", asset: \"0x1::aptos_coin::AptosCoin\" });\n * // Some FA by metadata address\n * const fa = await aptos.getBalance({ accountAddress: \"0x1\", asset: \"0xa\" });\n * ```\n * @group Account\n */\n async getBalance(args: {\n accountAddress: AccountAddressInput;\n asset: MoveStructId | AccountAddressInput;\n }): Promise<number> {\n return getBalance({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries an account's owned objects.\n *\n * @param args.accountAddress The account address we want to get the objects for.\n * @param args.minimumLedgerVersion Optional ledger version to sync up to before querying.\n * @param args.options.offset The starting position to start returning results from.\n * @param args.options.limit The number of results to return.\n * @param args.options.orderBy The order to sort the objects by.\n * @returns Objects array with the object data.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Get the objects owned by the specified account\n * const accountOwnedObjects = await aptos.getAccountOwnedObjects({\n * accountAddress: \"0x1\", // replace with a real account address\n * minimumLedgerVersion: 1, // optional, specify if needed\n * options: {\n * offset: 0, // optional, specify if needed\n * limit: 10, // optional, specify if needed\n * orderBy: \"created_at\", // optional, specify if needed\n * },\n * });\n *\n * console.log(accountOwnedObjects);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Account\n */\n async getAccountOwnedObjects(args: {\n accountAddress: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n options?: PaginationArgs & OrderByArg<GetObjectDataQueryResponse[0]>;\n }): Promise<GetObjectDataQueryResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.DEFAULT,\n });\n return getAccountOwnedObjects({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Derives an account by providing a private key. This function resolves the provided private key type and derives the public\n * key from it.\n *\n * If the privateKey is a Secp256k1 type, it derives the account using the derived public key and auth key using the SingleKey\n * scheme locally.\n * If the privateKey is an ED25519 type, it looks up the authentication key on chain to determine whether it is a Legacy ED25519\n * key or a Unified ED25519 key, and then derives the account based on that.\n *\n * @param args - The arguments for deriving the account.\n * @param args.privateKey - An account private key.\n * @returns The derived Account type.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network, Ed25519PrivateKey } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Deriving an account from a private key\n * const account = await aptos.deriveAccountFromPrivateKey({\n * privateKey: new Ed25519PrivateKey(\"0x123\") // replace with a real private key\n * });\n *\n * console.log(account);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Account\n * @deprecated Note that more inspection is needed by the user to determine which account exists on-chain\n */\n async deriveAccountFromPrivateKey(args: {\n privateKey: PrivateKeyInput;\n minimumLedgerVersion?: AnyNumber;\n options?: {\n throwIfNoAccountFound?: boolean;\n };\n }): Promise<AccountModule> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.ACCOUNT_RESTORATION_PROCESSOR,\n });\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.OBJECT_PROCESSOR,\n });\n return deriveAccountFromPrivateKey({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Derives all accounts owned by a signer. This function takes a signer (either an Account or PrivateKey)\n * and returns all accounts that can be derived from it, ordered by the most recently used account first.\n *\n * Note, this function will not return accounts that require more than one signer to be used.\n *\n * @param args - The arguments for deriving owned accounts\n * @param args.signer - The signer to derive accounts from (Account or PrivateKey)\n * @param args.minimumLedgerVersion - The minimum ledger version to wait for before querying\n * @param args.options.includeUnverified - Whether to include unverified accounts in the results. Unverified accounts\n * are accounts that can be authenticated with the signer, but there is no history of the signer using the account.\n * Default is false.\n * @param args.options.noMultiKey - If true, do not include multi-key accounts in the results. Default is false.\n * @returns Promise resolving to an array of derived Account objects\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network, Ed25519Account } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function getOwnedAccounts() {\n * const signer = Ed25519Account.generate();\n * const accounts = await aptos.deriveOwnedAccountsFromSigner({\n * signer\n * });\n * const account = accounts[0];\n * console.log(account);\n * }\n * ```\n * @group Account\n */\n async deriveOwnedAccountsFromSigner(args: {\n signer: AccountModule | PrivateKeyInput;\n minimumLedgerVersion?: AnyNumber;\n options?: { includeUnverified?: boolean; noMultiKey?: boolean };\n }): Promise<AccountModule[]> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.ACCOUNT_RESTORATION_PROCESSOR,\n });\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.OBJECT_PROCESSOR,\n });\n return deriveOwnedAccountsFromSigner({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Gets all account info (address, account public key, last transaction version) that have are associated with a public key and **related public keys**\n *\n * For a given public key, it will query all multikeys that the public key is part of. Then for the provided public key and\n * any multikeys found in the previous step, it will query for any accounts that have an auth key that matches any of the\n * public keys.\n *\n * Note: If an Ed25519PublicKey or an AnyPublicKey that wraps Ed25519PublicKey is passed in, it will query for both legacy and single singer cases.\n *\n * @param args - The arguments for getting accounts for a public key\n * @param args.publicKey - The public key to look up accounts for\n * @param args.minimumLedgerVersion - The minimum ledger version to wait for before querying\n * @param args.options.includeUnverified - Whether to include unverified accounts in the results. Unverified accounts\n * are accounts that can be authenticated with the signer, but there is no history of the signer using the account. Default\n * is false.\n * @param args.options.noMultiKey - Whether to exclude multi-key accounts in the results. Default is false.\n * @returns Promise resolving to an array of account addresses and their associated public keys\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network, Ed25519PrivateKey } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function getAccounts() {\n * const privateKey = Ed25519PrivateKey.generate();\n * const publicKey = privateKey.publicKey();\n * const accounts = await aptos.getAccountsForPublicKey({\n * publicKey\n * });\n * console.log(accounts);\n * }\n * ```\n * @group Account\n */\n async getAccountsForPublicKey(args: {\n publicKey: BaseAccountPublicKey;\n minimumLedgerVersion?: AnyNumber;\n options?: { includeUnverified?: boolean; noMultiKey?: boolean };\n }): Promise<AccountInfo[]> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.ACCOUNT_RESTORATION_PROCESSOR,\n });\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.OBJECT_PROCESSOR,\n });\n return getAccountsForPublicKey({\n aptosConfig: this.config,\n ...args,\n });\n }\n}\n"],"mappings":"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","names":["AccountAddress","createObjectAddress","deriveAccountFromPrivateKey","getAccountCoinsCount","getAccountCoinsData","getAccountCollectionsWithOwnedTokens","getAccountOwnedObjects","getAccountOwnedTokens","getAccountOwnedTokensFromCollectionAddress","getAccountsForPublicKey","getAccountTokensCount","getAccountTransactionsCount","getBalance","getInfo","getModule","getModules","getModulesPage","getResource","getResources","getResourcesPage","getTransactions","lookupOriginalAccountAddress","deriveOwnedAccountsFromSigner","APTOS_COIN","APTOS_FA","ProcessorType","waitForIndexerOnVersion","view","isEncodedStruct","parseEncodedStruct","memoizeAsync","AccountAbstraction","Account","config","args","accountAddress","coinType","faMetadataAddress","coinAssetType","pairedCoinTypeStruct","faAddress","addr","balanceStr"]}
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,2 +1,2 @@
1
- import{getExpiration as e,getOwnerAddress as s,registerName as t,getPrimaryName as o,setPrimaryName as r,getTargetAddress as i,setTargetAddress as a,renewDomain as m,getName as c,getAccountDomains as g,getAccountSubdomains as u,getAccountNames as p,getDomainSubdomains as A}from"../internal/ans";class k{constructor(n){this.config=n}async getOwnerAddress(n){return s({aptosConfig:this.config,...n})}async getExpiration(n){return e({aptosConfig:this.config,...n})}async getTargetAddress(n){return i({aptosConfig:this.config,...n})}async setTargetAddress(n){return a({aptosConfig:this.config,...n})}async getPrimaryName(n){return o({aptosConfig:this.config,...n})}async setPrimaryName(n){return r({aptosConfig:this.config,...n})}async registerName(n){return t({aptosConfig:this.config,...n})}async renewDomain(n){return m({aptosConfig:this.config,...n})}async getName(n){return c({aptosConfig:this.config,...n})}async getAccountNames(n){return p({aptosConfig:this.config,...n})}async getAccountDomains(n){return g({aptosConfig:this.config,...n})}async getAccountSubdomains(n){return u({aptosConfig:this.config,...n})}async getDomainSubdomains(n){return A({aptosConfig:this.config,...n})}}export{k as ANS};
1
+ import{Zd as a}from"../chunk-PJTG745G.mjs";import"../chunk-A5L76YP7.mjs";import"../chunk-5HXLZHDW.mjs";import"../chunk-GOXRBEIJ.mjs";import"../chunk-XJJVJOX5.mjs";import"../chunk-QNARIAVM.mjs";import"../chunk-2PASUPUO.mjs";import"../chunk-C3Q23D22.mjs";import"../chunk-NECL5FCQ.mjs";import"../chunk-4QMXOWHP.mjs";import"../chunk-RQX6JOEN.mjs";import"../chunk-WSR5EBJM.mjs";import"../chunk-WCMW2L3P.mjs";import"../chunk-V74WPKSY.mjs";import"../chunk-UYVPNUH3.mjs";import"../chunk-G3MHXDYA.mjs";import"../chunk-626KB2UQ.mjs";import"../chunk-XKUIMGKU.mjs";import"../chunk-N6YTF76Q.mjs";import"../chunk-FGFLPH5K.mjs";import"../chunk-QREVMGQZ.mjs";import"../chunk-V3MBJJTL.mjs";import"../chunk-ZP4DWSQA.mjs";import"../chunk-2OPKZKOB.mjs";import"../chunk-FC72YL4B.mjs";import"../chunk-YS5IUILF.mjs";import"../chunk-PSSIJHHC.mjs";import"../chunk-YOZBVVKL.mjs";import"../chunk-R7FWJP3N.mjs";import"../chunk-UL777LTI.mjs";import"../chunk-7ECCT6PK.mjs";import"../chunk-AQW4BUKF.mjs";import"../chunk-E2U27PNC.mjs";import"../chunk-LAPXUUHK.mjs";import"../chunk-HGLO5LDS.mjs";import"../chunk-CW35YAMN.mjs";import"../chunk-YZHAI55C.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-TOBQ5UE6.mjs";import"../chunk-MT2RJ7H3.mjs";import"../chunk-Q4W3WJ2U.mjs";import"../chunk-ORMOQWWH.mjs";import"../chunk-FLZPUYXQ.mjs";import"../chunk-LA56UDUK.mjs";import"../chunk-ZYE7UTJZ.mjs";import"../chunk-RGKRCZ36.mjs";import"../chunk-FD6FGKYY.mjs";import"../chunk-MCFQE4GC.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-EBMEXURY.mjs";import"../chunk-STY74NUA.mjs";import"../chunk-IF4UU2MT.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-NCKJ7X57.mjs";import"../chunk-P5HCJN3A.mjs";import"../chunk-OLILO7VD.mjs";import"../chunk-H3EP5CGP.mjs";import"../chunk-KDMSOCZY.mjs";export{a as ANS};
2
2
  //# sourceMappingURL=ans.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/api/ans.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Account } from \"../account\";\nimport { AccountAddress, AccountAddressInput } from \"../core\";\nimport {\n RegisterNameParameters,\n getExpiration,\n getOwnerAddress,\n registerName,\n getPrimaryName,\n setPrimaryName,\n getTargetAddress,\n setTargetAddress,\n renewDomain,\n getName,\n getAccountDomains,\n GetAccountDomainsArgs,\n GetAccountSubdomainsArgs,\n getAccountSubdomains,\n getAccountNames,\n GetAccountNamesArgs,\n getDomainSubdomains,\n GetDomainSubdomainsArgs,\n} from \"../internal/ans\";\nimport { GetANSNameResponse } from \"../types\";\nimport { InputGenerateTransactionOptions } from \"../transactions/types\";\nimport { AptosConfig } from \"./aptosConfig\";\nimport { SimpleTransaction } from \"../transactions/instances/simpleTransaction\";\n\n/**\n * A class to handle all `ANS` operations.\n * @group ANS\n */\nexport class ANS {\n /**\n * Initializes a new instance of the Aptos class with the provided configuration.\n * This allows you to interact with the Aptos blockchain using the specified network settings.\n *\n * @param config - The configuration settings for the Aptos client.\n * @param config.network - The network to connect to (e.g., mainnet, testnet).\n * @param config.nodeUrl - The URL of the Aptos node to connect to.\n * @param config.faucetUrl - The URL of the faucet to use for funding accounts.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * async function runExample() {\n * // Create a configuration for connecting to the Aptos testnet\n * const config = new AptosConfig({ network: Network.TESTNET });\n *\n * // Initialize the Aptos client with the configuration\n * const aptos = new Aptos(config);\n *\n * console.log(\"Aptos client initialized:\", aptos);\n * }\n * runExample().catch(console.error);\n * ```\n * @group ANS\n */\n constructor(readonly config: AptosConfig) {}\n\n /**\n * Retrieve the owner address of a specified domain name or subdomain name from the contract.\n *\n * @param args - The arguments for retrieving the owner address.\n * @param args.name - A string representing the name of the domain or subdomain to retrieve the owner address for.\n *\n * @returns AccountAddress if the name is owned, undefined otherwise.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Retrieve the owner address of \"test.aptos\"\n * const owner = await aptos.getOwnerAddress({ name: \"test.aptos\" });\n * console.log(owner); // Logs the owner address or undefined if not owned\n * }\n * runExample().catch(console.error);\n * ```\n * @group ANS\n */\n async getOwnerAddress(args: { name: string }): Promise<AccountAddress | undefined> {\n return getOwnerAddress({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Retrieve the expiration time of a domain name or subdomain name from the contract.\n *\n * @param args - The arguments for retrieving the expiration.\n * @param args.name - A string of the name to retrieve.\n *\n * @returns number as a unix timestamp in milliseconds.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Get the expiration time for the domain \"test.aptos\"\n * const exp = await aptos.getExpiration({ name: \"test.aptos\" });\n *\n * // Log the expiration date\n * console.log(new Date(exp)); // Outputs the expiration date\n * }\n * runExample().catch(console.error);\n * ```\n * @group ANS\n */\n async getExpiration(args: { name: string }): Promise<number | undefined> {\n return getExpiration({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Retrieve the target address of a domain or subdomain name, which indicates the address the name points to for use on-chain.\n * Note that the target address can point to addresses that do not own the name.\n *\n * @param args - The arguments for retrieving the target address.\n * @param args.name - A string representing the name, which can be a primary name, a subdomain, or a combination (e.g.,\n * \"primary\", \"primary.apt\", \"secondary.primary\", \"secondary.primary.apt\").\n *\n * @returns AccountAddress if the name has a target, undefined otherwise.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Retrieve the target address for the specified domain name\n * const targetAddr = await aptos.getTargetAddress({ name: \"test.aptos\" });\n *\n * console.log(targetAddr); // Logs the target address, e.g., 0x123...\n * }\n * runExample().catch(console.error);\n * ```\n * @group ANS\n */\n async getTargetAddress(args: { name: string }): Promise<AccountAddress | undefined> {\n return getTargetAddress({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Sets the target address of a domain or subdomain name, pointing it to a specified address for use on-chain.\n * The target address can be different from the owner of the name.\n *\n * @param args - The arguments for setting the target address.\n * @param args.sender - The account initiating the transaction.\n * @param args.name - A string representing the domain or subdomain name (e.g., \"test.aptos\").\n * @param args.address - The AccountAddressInput of the address to set the domain or subdomain to.\n * @param args.options - Optional settings for generating the transaction.\n *\n * @returns SimpleTransaction\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Setting the target address for a domain name\n * const sender = Account.generate(); // replace with a real account\n * const address = \"0x1\"; // replace with a real account address\n *\n * await aptos.setTargetAddress({\n * sender: sender,\n * name: \"test.aptos\",\n * address: address,\n * });\n *\n * const targetAddress = await aptos.getTargetAddress({ name: \"test.aptos\" });\n * console.log(targetAddress); // Should log the address set for \"test.aptos\"\n * }\n * runExample().catch(console.error);\n * ```\n * @group ANS\n */\n async setTargetAddress(args: {\n sender: Account;\n name: string;\n address: AccountAddressInput;\n options?: InputGenerateTransactionOptions;\n }): Promise<SimpleTransaction> {\n return setTargetAddress({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Retrieve the primary name for an account. An account can have multiple names, but only one primary name, which may not exist.\n *\n * @param args - The arguments for retrieving the primary name.\n * @param args.address - An AccountAddressInput (address) of the account.\n *\n * @returns A string if the account has a primary name, undefined otherwise.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Retrieve the primary name for the specified account address\n * const name = await aptos.getPrimaryName({ address: \"0x1\" }); // replace with a real account address\n * console.log(name);\n * }\n * runExample().catch(console.error);\n * ```\n * @group ANS\n */\n async getPrimaryName(args: { address: AccountAddressInput }): Promise<string | undefined> {\n return getPrimaryName({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Sets the primary name for the sender account, allowing them to designate a single primary name among potentially multiple\n * names. An account may not have a primary name.\n *\n * @param args - The arguments for setting the primary name.\n * @param args.sender - The sender account.\n * @param args.name - A string representing the name to set as primary (e.g., \"test.aptos\").\n * @param args.options - Optional transaction options.\n *\n * @returns SimpleTransaction\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Set the primary name for the sender account\n * const sender = Account.generate(); // replace with a real account\n * await aptos.setPrimaryName({ sender, name: \"test.aptos\" });\n *\n * const primaryName = await aptos.getPrimaryName({ address: sender.accountAddress });\n * console.log(\"Primary Name:\", primaryName); // Should log: \"Primary Name: test.aptos\"\n * }\n * runExample().catch(console.error);\n * ```\n * @group ANS\n */\n async setPrimaryName(args: {\n sender: Account;\n name?: string;\n options?: InputGenerateTransactionOptions;\n }): Promise<SimpleTransaction> {\n return setPrimaryName({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Registers a new name.\n *\n * This function allows you to register a domain or subdomain name with specific expiration policies and options.\n *\n * @param args.sender - The sender account.\n * @param args.name - A string of the name to register. This can be inclusive or exclusive of the .apt suffix. Examples include:\n * \"test\", \"test.apt\", \"test.aptos.apt\", etc.\n * @param args.expiration - An object with the expiration policy of the name.\n * @param args.expiration.policy - 'domain' | 'subdomain:follow-domain' | 'subdomain:independent'.\n * - domain: Years is required and the name will expire after the given number of years.\n * - subdomain:follow-domain: The name will expire at the same time as the domain name.\n * - subdomain:independent: The name will expire at the given date.\n * @param args.expiration.expirationDate - An epoch number in milliseconds of the date when the subdomain will expire. Only\n * applicable when the policy is set to 'subdomain:independent'.\n * @param args.transferable - Determines if the subdomain being minted is soul-bound. Applicable only to subdomains.\n * @param args.targetAddress optional - The address the domain name will resolve to. If not provided, the sender's address will\n * be used.\n * @param args.toAddress optional - The address to send the domain name to. If not provided, the transaction will be sent to the\n * router.\n *\n * @returns SimpleTransaction\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Registering a subdomain name assuming def.apt is already registered and belongs to the sender alice.\n * const txn = await aptos.registerName({\n * sender: \"0x1\", // replace with a real sender account\n * name: \"test.aptos.apt\",\n * expiration: {\n * policy: \"subdomain:independent\",\n * expirationDate: Date.now() + 30 * 24 * 60 * 60 * 1000, // expires in 30 days\n * },\n * });\n *\n * console.log(\"Transaction:\", txn);\n * }\n * runExample().catch(console.error);\n * ```\n * @group ANS\n */\n async registerName(args: Omit<RegisterNameParameters, \"aptosConfig\">): Promise<SimpleTransaction> {\n return registerName({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Renews a domain name for one year.\n * If a domain name was minted with V1 of the contract, it will automatically be upgraded to V2 via this transaction.\n *\n * @param args - The arguments for renewing the domain.\n * @param args.sender - The sender account, which must be the domain owner.\n * @param args.name - A string representing the domain to renew. Subdomains cannot be renewed.\n * @param args.years - The number of years to renew the name. Currently, only one year is permitted.\n * @param args.options - Optional transaction options.\n *\n * @returns SimpleTransaction\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Renew the domain \"test\" for one year\n * const transaction = await aptos.renewDomain({\n * sender: Account.generate(), // replace with a real account\n * name: \"test\"\n * });\n *\n * console.log(transaction);\n * }\n * runExample().catch(console.error);\n * ```\n * @group ANS\n */\n async renewDomain(args: {\n sender: Account;\n name: string;\n years?: 1;\n options?: InputGenerateTransactionOptions;\n }): Promise<SimpleTransaction> {\n return renewDomain({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Fetches a single name from the indexer based on the provided name argument.\n *\n * @param args - The arguments for retrieving the name.\n * @param args.name - A string of the name to retrieve, e.g. \"test.aptos.apt\" or \"test.apt\" or \"test\".\n * Can be inclusive or exclusive of the .apt suffix and can be a subdomain.\n *\n * @returns A promise of an ANSName or undefined if the name is not active.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Fetching a name from the indexer\n * const name = await aptos.getName({ name: \"test.aptos\" }); // replace with a real name\n * console.log(name);\n * }\n * runExample().catch(console.error);\n * ```\n * @group ANS\n */\n async getName(args: { name: string }): Promise<GetANSNameResponse[0] | undefined> {\n return getName({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Fetches all names for an account, including both top-level domains and subdomains.\n *\n * @param args - The arguments for fetching account names.\n * @param args.accountAddress - An AccountAddressInput of the address to retrieve names for.\n * @param args.options - Optional parameters for fetching names.\n * @param args.options.offset - Optional, the offset to start from when fetching names.\n * @param args.options.limit - Optional, a number of the names to fetch per request.\n * @param args.options.orderBy - The order to sort the names by.\n * @param args.options.where - Additional filters to apply to the query.\n *\n * @returns A promise of an array of ANSName.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Fetch account names for a specific address\n * const accountNames = await aptos.getAccountNames({\n * accountAddress: \"0x1\", // replace with a real account address\n * options: {\n * limit: 10, // specify how many names to fetch\n * orderBy: \"name\", // specify the order by which to sort the names\n * },\n * });\n *\n * console.log(accountNames);\n * }\n * runExample().catch(console.error);\n * ```\n * @group ANS\n */\n async getAccountNames(args: GetAccountNamesArgs): Promise<GetANSNameResponse> {\n return getAccountNames({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Fetches all top-level domain names for a specified account.\n *\n * @param args - The arguments for retrieving account domains.\n * @param args.accountAddress - An AccountAddressInput of the address to retrieve domain names for.\n * @param args.options.offset - Optional, the offset to start from when fetching names.\n * @param args.options.limit - Optional, a number of the names to fetch per request.\n * @param args.options.orderBy - The order to sort the names by.\n * @param args.options.where - Additional filters to apply to the query.\n *\n * @returns A promise of an array of ANSName.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Fetching all top-level domain names for a specific account\n * const domains = await aptos.getAccountDomains({\n * accountAddress: \"0x1\", // replace with a real account address\n * options: {\n * limit: 10, // specify the number of names to fetch\n * offset: 0, // specify the offset for pagination\n * orderBy: \"created_at\", // specify the order by which to sort the names\n * where: {\n * // additional filters can be specified here\n * },\n * },\n * });\n *\n * console.log(domains);\n * }\n * runExample().catch(console.error);\n * ```\n * @group ANS\n */\n async getAccountDomains(args: GetAccountDomainsArgs): Promise<GetANSNameResponse> {\n return getAccountDomains({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Fetches all subdomain names for a specified account.\n *\n * @param args - The arguments for retrieving subdomains.\n * @param args.accountAddress - The address to retrieve subdomain names for.\n * @param args.options - Optional parameters for fetching subdomains.\n * @param args.options.offset - The offset to start from when fetching names.\n * @param args.options.limit - The number of names to fetch per request.\n * @param args.options.orderBy - The order to sort the names by.\n * @param args.options.where - Additional filters to apply to the query.\n *\n * @returns A promise of an array of ANSName.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Fetching subdomain names for a specific account\n * const subdomains = await aptos.getAccountSubdomains({\n * accountAddress: \"0x1\", // replace with a real account address\n * options: {\n * limit: 10, // specify the number of subdomains to fetch\n * offset: 0, // specify the offset for pagination\n * orderBy: \"name\", // specify the order by which to sort the names\n * },\n * });\n *\n * console.log(subdomains);\n * }\n * runExample().catch(console.error);\n * ```\n * @group ANS\n */\n async getAccountSubdomains(args: GetAccountSubdomainsArgs): Promise<GetANSNameResponse> {\n return getAccountSubdomains({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Fetches all subdomain names for a given domain, excluding the domain itself.\n *\n * @param args - The arguments for fetching subdomains.\n * @param args.domain - A string of the domain name, e.g., \"test.apt\" or \"test\" (without the suffix of .apt).\n * @param args.options - Optional parameters for fetching subdomains.\n * @param args.options.offset - Optional, the offset to start from when fetching names.\n * @param args.options.limit - Optional, the number of names to fetch per request.\n * @param args.options.orderBy - The order to sort the names by.\n * @param args.options.where - Additional filters to apply to the query.\n *\n * @returns A promise that resolves to an array of ANSName.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Fetching subdomains for a specific domain\n * const subdomains = await aptos.getDomainSubdomains({\n * domain: \"test\", // replace with your domain\n * options: {\n * limit: 10, // specify the number of subdomains to fetch\n * offset: 0, // specify the starting point for fetching\n * orderBy: \"name\", // specify the order by which to sort the results\n * },\n * });\n *\n * console.log(subdomains);\n * }\n * runExample().catch(console.error);\n * ```\n * @group ANS\n */\n async getDomainSubdomains(args: GetDomainSubdomainsArgs): Promise<GetANSNameResponse> {\n return getDomainSubdomains({ aptosConfig: this.config, ...args });\n }\n}\n"],"mappings":"AAKA,OAEE,iBAAAA,EACA,mBAAAC,EACA,gBAAAC,EACA,kBAAAC,EACA,kBAAAC,EACA,oBAAAC,EACA,oBAAAC,EACA,eAAAC,EACA,WAAAC,EACA,qBAAAC,EAGA,wBAAAC,EACA,mBAAAC,EAEA,uBAAAC,MAEK,kBAUA,MAAMC,CAAI,CA2Bf,YAAqBC,EAAqB,CAArB,YAAAA,CAAsB,CA0B3C,MAAM,gBAAgBC,EAA6D,CACjF,OAAOd,EAAgB,CAAE,YAAa,KAAK,OAAQ,GAAGc,CAAK,CAAC,CAC9D,CA4BA,MAAM,cAAcA,EAAqD,CACvE,OAAOf,EAAc,CAAE,YAAa,KAAK,OAAQ,GAAGe,CAAK,CAAC,CAC5D,CA6BA,MAAM,iBAAiBA,EAA6D,CAClF,OAAOV,EAAiB,CAAE,YAAa,KAAK,OAAQ,GAAGU,CAAK,CAAC,CAC/D,CAuCA,MAAM,iBAAiBA,EAKQ,CAC7B,OAAOT,EAAiB,CAAE,YAAa,KAAK,OAAQ,GAAGS,CAAK,CAAC,CAC/D,CA0BA,MAAM,eAAeA,EAAqE,CACxF,OAAOZ,EAAe,CAAE,YAAa,KAAK,OAAQ,GAAGY,CAAK,CAAC,CAC7D,CAgCA,MAAM,eAAeA,EAIU,CAC7B,OAAOX,EAAe,CAAE,YAAa,KAAK,OAAQ,GAAGW,CAAK,CAAC,CAC7D,CAiDA,MAAM,aAAaA,EAA+E,CAChG,OAAOb,EAAa,CAAE,YAAa,KAAK,OAAQ,GAAGa,CAAK,CAAC,CAC3D,CAkCA,MAAM,YAAYA,EAKa,CAC7B,OAAOR,EAAY,CAAE,YAAa,KAAK,OAAQ,GAAGQ,CAAK,CAAC,CAC1D,CA2BA,MAAM,QAAQA,EAAoE,CAChF,OAAOP,EAAQ,CAAE,YAAa,KAAK,OAAQ,GAAGO,CAAK,CAAC,CACtD,CAsCA,MAAM,gBAAgBA,EAAwD,CAC5E,OAAOJ,EAAgB,CAAE,YAAa,KAAK,OAAQ,GAAGI,CAAK,CAAC,CAC9D,CAyCA,MAAM,kBAAkBA,EAA0D,CAChF,OAAON,EAAkB,CAAE,YAAa,KAAK,OAAQ,GAAGM,CAAK,CAAC,CAChE,CAuCA,MAAM,qBAAqBA,EAA6D,CACtF,OAAOL,EAAqB,CAAE,YAAa,KAAK,OAAQ,GAAGK,CAAK,CAAC,CACnE,CAuCA,MAAM,oBAAoBA,EAA4D,CACpF,OAAOH,EAAoB,CAAE,YAAa,KAAK,OAAQ,GAAGG,CAAK,CAAC,CAClE,CACF","names":["getExpiration","getOwnerAddress","registerName","getPrimaryName","setPrimaryName","getTargetAddress","setTargetAddress","renewDomain","getName","getAccountDomains","getAccountSubdomains","getAccountNames","getDomainSubdomains","ANS","config","args"]}
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -11,7 +11,6 @@ import { Transaction } from './transaction.mjs';
11
11
  import { Table } from './table.mjs';
12
12
  import { Keyless } from './keyless.mjs';
13
13
  import { AptosObject } from './object.mjs';
14
- import { AccountAbstraction } from './account/abstraction.mjs';
15
14
  import '../types/indexer.mjs';
16
15
  import '../types/generated/operations.mjs';
17
16
  import '../types/generated/types.mjs';
@@ -22,6 +21,7 @@ import '../utils/const.mjs';
22
21
  import '../core/common.mjs';
23
22
  import '../internal/account.mjs';
24
23
  import '../account/MultiEd25519Account.mjs';
24
+ import './account/abstraction.mjs';
25
25
  import '../internal/digitalAsset.mjs';
26
26
  import '../internal/ans.mjs';
27
27
  import '../internal/transactionSubmission.mjs';
@@ -71,20 +71,18 @@ import '../account/FederatedKeylessAccount.mjs';
71
71
  */
72
72
  declare class Aptos {
73
73
  readonly config: AptosConfig;
74
- private _account?;
75
- private _abstraction?;
76
- private _ans?;
77
- private _coin?;
78
- private _digitalAsset?;
79
- private _faucet?;
80
- private _fungibleAsset?;
81
- private _general?;
82
- private _staking?;
83
- private _transaction?;
84
- private _table?;
85
- private _keyless?;
86
- private _object?;
87
- static mixinsApplied: Set<string>;
74
+ readonly account: Account;
75
+ readonly ans: ANS;
76
+ readonly coin: Coin;
77
+ readonly digitalAsset: DigitalAsset;
78
+ readonly faucet: Faucet;
79
+ readonly fungibleAsset: FungibleAsset;
80
+ readonly general: General;
81
+ readonly staking: Staking;
82
+ readonly transaction: Transaction;
83
+ readonly table: Table;
84
+ readonly keyless: Keyless;
85
+ readonly object: AptosObject;
88
86
  /**
89
87
  * Initializes a new instance of the Aptos client with the provided configuration settings.
90
88
  * This allows you to interact with various Aptos functionalities such as accounts, transactions, and events.
@@ -107,74 +105,9 @@ declare class Aptos {
107
105
  * @group Client
108
106
  */
109
107
  constructor(config?: AptosConfig);
110
- /**
111
- * Lazy-loaded getter for Account functionality.
112
- * Only instantiates and applies mixin when first accessed.
113
- */
114
- get account(): Account;
115
- /**
116
- * Lazy-loaded getter for AccountAbstraction functionality.
117
- * Only instantiates and applies mixin when first accessed.
118
- */
119
- get abstraction(): AccountAbstraction;
120
- /**
121
- * Lazy-loaded getter for ANS functionality.
122
- * Only instantiates and applies mixin when first accessed.
123
- */
124
- get ans(): ANS;
125
- /**
126
- * Lazy-loaded getter for Coin functionality.
127
- * Only instantiates and applies mixin when first accessed.
128
- */
129
- get coin(): Coin;
130
- /**
131
- * Lazy-loaded getter for DigitalAsset functionality.
132
- * Only instantiates and applies mixin when first accessed.
133
- */
134
- get digitalAsset(): DigitalAsset;
135
- /**
136
- * Lazy-loaded getter for Faucet functionality.
137
- * Only instantiates and applies mixin when first accessed.
138
- */
139
- get faucet(): Faucet;
140
- /**
141
- * Lazy-loaded getter for FungibleAsset functionality.
142
- * Only instantiates and applies mixin when first accessed.
143
- */
144
- get fungibleAsset(): FungibleAsset;
145
- /**
146
- * Lazy-loaded getter for General functionality.
147
- * Only instantiates and applies mixin when first accessed.
148
- */
149
- get general(): General;
150
- /**
151
- * Lazy-loaded getter for Staking functionality.
152
- * Only instantiates and applies mixin when first accessed.
153
- */
154
- get staking(): Staking;
155
- /**
156
- * Lazy-loaded getter for Transaction functionality.
157
- * Only instantiates and applies mixin when first accessed.
158
- */
159
- get transaction(): Transaction;
160
- /**
161
- * Lazy-loaded getter for Table functionality.
162
- * Only instantiates and applies mixin when first accessed.
163
- */
164
- get table(): Table;
165
- /**
166
- * Lazy-loaded getter for Keyless functionality.
167
- * Only instantiates and applies mixin when first accessed.
168
- */
169
- get keyless(): Keyless;
170
- /**
171
- * Lazy-loaded getter for AptosObject functionality.
172
- * Only instantiates and applies mixin when first accessed.
173
- */
174
- get object(): AptosObject;
175
108
  setIgnoreTransactionSubmitter(ignore: boolean): void;
176
109
  }
177
- interface Aptos extends Account, AccountAbstraction, ANS, Coin, DigitalAsset, Faucet, FungibleAsset, General, Keyless, Staking, Table, AptosObject, Omit<Transaction, "build" | "simulate" | "submit" | "batch"> {
110
+ interface Aptos extends Account, ANS, Coin, DigitalAsset, Event, Faucet, FungibleAsset, General, Keyless, Staking, Table, AptosObject, Omit<Transaction, "build" | "simulate" | "submit" | "batch"> {
178
111
  }
179
112
 
180
113
  export { Aptos };
@@ -1,2 +1,2 @@
1
- import{Account as c}from"./account";import{AptosConfig as k}from"./aptosConfig";import{Coin as g}from"./coin";import{DigitalAsset as f}from"./digitalAsset";import{Faucet as u}from"./faucet";import{FungibleAsset as l}from"./fungibleAsset";import{General as h}from"./general";import{ANS as b}from"./ans";import{Staking as p}from"./staking";import{Transaction as A}from"./transaction";import{Table as m}from"./table";import{Keyless as _}from"./keyless";import{AptosObject as y}from"./object";import{AccountAbstraction as w}from"./account/abstraction";const t=class t{constructor(e){this.config=e??new k}get account(){return this._account||(i(t,c,"account"),this._account=new c(this.config)),this._account}get abstraction(){return this._abstraction||(i(t,w,"abstraction"),this._abstraction=new w(this.config)),this._abstraction}get ans(){return this._ans||(i(t,b,"ans"),this._ans=new b(this.config)),this._ans}get coin(){return this._coin||(i(t,g,"coin"),this._coin=new g(this.config)),this._coin}get digitalAsset(){return this._digitalAsset||(i(t,f,"digitalAsset"),this._digitalAsset=new f(this.config)),this._digitalAsset}get faucet(){return this._faucet||(i(t,u,"faucet"),this._faucet=new u(this.config)),this._faucet}get fungibleAsset(){return this._fungibleAsset||(i(t,l,"fungibleAsset"),this._fungibleAsset=new l(this.config)),this._fungibleAsset}get general(){return this._general||(i(t,h,"general"),this._general=new h(this.config)),this._general}get staking(){return this._staking||(i(t,p,"staking"),this._staking=new p(this.config)),this._staking}get transaction(){return this._transaction||(i(t,A,"transaction"),this._transaction=new A(this.config)),this._transaction}get table(){return this._table||(i(t,m,"table"),this._table=new m(this.config)),this._table}get keyless(){return this._keyless||(i(t,_,"keyless"),this._keyless=new _(this.config)),this._keyless}get object(){return this._object||(i(t,y,"object"),this._object=new y(this.config)),this._object}setIgnoreTransactionSubmitter(e){this.config.setIgnoreTransactionSubmitter(e)}};t.mixinsApplied=new Set;let a=t;function v(s,e,r){Object.getOwnPropertyNames(e.prototype).forEach(n=>{const o=Object.getOwnPropertyDescriptor(e.prototype,n);o&&(n==="constructor"||s.prototype[n]||Object.defineProperty(s.prototype,n,{value:function(...d){return this[r][n](...d)},writable:o.writable,configurable:o.configurable,enumerable:o.enumerable}))})}function i(s,e,r){const n=`${s.name}-${e.name}-${r}`;a.mixinsApplied.has(n)||(v(s,e,r),a.mixinsApplied.add(n))}export{a as Aptos};
1
+ import{te as a}from"../chunk-PJTG745G.mjs";import"../chunk-A5L76YP7.mjs";import"../chunk-5HXLZHDW.mjs";import"../chunk-GOXRBEIJ.mjs";import"../chunk-XJJVJOX5.mjs";import"../chunk-QNARIAVM.mjs";import"../chunk-2PASUPUO.mjs";import"../chunk-C3Q23D22.mjs";import"../chunk-NECL5FCQ.mjs";import"../chunk-4QMXOWHP.mjs";import"../chunk-RQX6JOEN.mjs";import"../chunk-WSR5EBJM.mjs";import"../chunk-WCMW2L3P.mjs";import"../chunk-V74WPKSY.mjs";import"../chunk-UYVPNUH3.mjs";import"../chunk-G3MHXDYA.mjs";import"../chunk-626KB2UQ.mjs";import"../chunk-XKUIMGKU.mjs";import"../chunk-N6YTF76Q.mjs";import"../chunk-FGFLPH5K.mjs";import"../chunk-QREVMGQZ.mjs";import"../chunk-V3MBJJTL.mjs";import"../chunk-ZP4DWSQA.mjs";import"../chunk-2OPKZKOB.mjs";import"../chunk-FC72YL4B.mjs";import"../chunk-YS5IUILF.mjs";import"../chunk-PSSIJHHC.mjs";import"../chunk-YOZBVVKL.mjs";import"../chunk-R7FWJP3N.mjs";import"../chunk-UL777LTI.mjs";import"../chunk-7ECCT6PK.mjs";import"../chunk-AQW4BUKF.mjs";import"../chunk-E2U27PNC.mjs";import"../chunk-LAPXUUHK.mjs";import"../chunk-HGLO5LDS.mjs";import"../chunk-CW35YAMN.mjs";import"../chunk-YZHAI55C.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-TOBQ5UE6.mjs";import"../chunk-MT2RJ7H3.mjs";import"../chunk-Q4W3WJ2U.mjs";import"../chunk-ORMOQWWH.mjs";import"../chunk-FLZPUYXQ.mjs";import"../chunk-LA56UDUK.mjs";import"../chunk-ZYE7UTJZ.mjs";import"../chunk-RGKRCZ36.mjs";import"../chunk-FD6FGKYY.mjs";import"../chunk-MCFQE4GC.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-EBMEXURY.mjs";import"../chunk-STY74NUA.mjs";import"../chunk-IF4UU2MT.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-NCKJ7X57.mjs";import"../chunk-P5HCJN3A.mjs";import"../chunk-OLILO7VD.mjs";import"../chunk-H3EP5CGP.mjs";import"../chunk-KDMSOCZY.mjs";export{a as Aptos};
2
2
  //# sourceMappingURL=aptos.mjs.map
@@ -1 +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 { Faucet } from \"./faucet\";\nimport { FungibleAsset } from \"./fungibleAsset\";\nimport { General } from \"./general\";\nimport { ANS } from \"./ans\";\nimport { Staking } from \"./staking\";\nimport { Transaction } from \"./transaction\";\nimport { Table } from \"./table\";\nimport { Keyless } from \"./keyless\";\nimport { AptosObject } from \"./object\";\nimport { AccountAbstraction } from \"./account/abstraction\";\n\n/**\n * The main entry point for interacting with the Aptos APIs,\n * providing access to various functionalities organized into\n * distinct namespaces.\n *\n * To utilize the SDK, instantiate a new Aptos object to gain\n * access to the complete range of SDK features.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * async function runExample() {\n * // Create a configuration for connecting to the Aptos testnet\n * const config = new AptosConfig({ network: Network.TESTNET });\n *\n * // Initialize the Aptos client with the configuration\n * const aptos = new Aptos(config);\n *\n * console.log(\"Aptos client initialized:\", aptos);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Client\n */\nexport class Aptos {\n readonly config: AptosConfig;\n\n // Private fields to store lazy-loaded instances\n private _account?: Account;\n private _abstraction?: AccountAbstraction;\n private _ans?: ANS;\n private _coin?: Coin;\n private _digitalAsset?: DigitalAsset;\n private _faucet?: Faucet;\n private _fungibleAsset?: FungibleAsset;\n private _general?: General;\n private _staking?: Staking;\n private _transaction?: Transaction;\n private _table?: Table;\n private _keyless?: Keyless;\n private _object?: AptosObject;\n\n // Track which mixins have been applied\n static mixinsApplied = new Set<string>();\n\n /**\n * Initializes a new instance of the Aptos client with the provided configuration settings.\n * This allows you to interact with various Aptos functionalities such as accounts, transactions, and events.\n *\n * @param settings - Configuration settings for the Aptos client.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * async function runExample() {\n * // Create a new Aptos client with default settings\n * const config = new AptosConfig({ network: Network.TESTNET }); // Specify your own settings if needed\n * const aptos = new Aptos(config);\n *\n * console.log(\"Aptos client initialized:\", aptos);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Client\n */\n constructor(config?: AptosConfig) {\n this.config = config ?? new AptosConfig();\n }\n\n /**\n * Lazy-loaded getter for Account functionality.\n * Only instantiates and applies mixin when first accessed.\n */\n get account(): Account {\n if (!this._account) {\n ensureMixinApplied(Aptos, Account, \"account\");\n this._account = new Account(this.config);\n }\n return this._account;\n }\n\n /**\n * Lazy-loaded getter for AccountAbstraction functionality.\n * Only instantiates and applies mixin when first accessed.\n */\n get abstraction(): AccountAbstraction {\n if (!this._abstraction) {\n ensureMixinApplied(Aptos, AccountAbstraction, \"abstraction\");\n this._abstraction = new AccountAbstraction(this.config);\n }\n return this._abstraction;\n }\n\n /**\n * Lazy-loaded getter for ANS functionality.\n * Only instantiates and applies mixin when first accessed.\n */\n get ans(): ANS {\n if (!this._ans) {\n ensureMixinApplied(Aptos, ANS, \"ans\");\n this._ans = new ANS(this.config);\n }\n return this._ans;\n }\n\n /**\n * Lazy-loaded getter for Coin functionality.\n * Only instantiates and applies mixin when first accessed.\n */\n get coin(): Coin {\n if (!this._coin) {\n ensureMixinApplied(Aptos, Coin, \"coin\");\n this._coin = new Coin(this.config);\n }\n return this._coin;\n }\n\n /**\n * Lazy-loaded getter for DigitalAsset functionality.\n * Only instantiates and applies mixin when first accessed.\n */\n get digitalAsset(): DigitalAsset {\n if (!this._digitalAsset) {\n ensureMixinApplied(Aptos, DigitalAsset, \"digitalAsset\");\n this._digitalAsset = new DigitalAsset(this.config);\n }\n return this._digitalAsset;\n }\n\n /**\n * Lazy-loaded getter for Faucet functionality.\n * Only instantiates and applies mixin when first accessed.\n */\n get faucet(): Faucet {\n if (!this._faucet) {\n ensureMixinApplied(Aptos, Faucet, \"faucet\");\n this._faucet = new Faucet(this.config);\n }\n return this._faucet;\n }\n\n /**\n * Lazy-loaded getter for FungibleAsset functionality.\n * Only instantiates and applies mixin when first accessed.\n */\n get fungibleAsset(): FungibleAsset {\n if (!this._fungibleAsset) {\n ensureMixinApplied(Aptos, FungibleAsset, \"fungibleAsset\");\n this._fungibleAsset = new FungibleAsset(this.config);\n }\n return this._fungibleAsset;\n }\n\n /**\n * Lazy-loaded getter for General functionality.\n * Only instantiates and applies mixin when first accessed.\n */\n get general(): General {\n if (!this._general) {\n ensureMixinApplied(Aptos, General, \"general\");\n this._general = new General(this.config);\n }\n return this._general;\n }\n\n /**\n * Lazy-loaded getter for Staking functionality.\n * Only instantiates and applies mixin when first accessed.\n */\n get staking(): Staking {\n if (!this._staking) {\n ensureMixinApplied(Aptos, Staking, \"staking\");\n this._staking = new Staking(this.config);\n }\n return this._staking;\n }\n\n /**\n * Lazy-loaded getter for Transaction functionality.\n * Only instantiates and applies mixin when first accessed.\n */\n get transaction(): Transaction {\n if (!this._transaction) {\n ensureMixinApplied(Aptos, Transaction, \"transaction\");\n this._transaction = new Transaction(this.config);\n }\n return this._transaction;\n }\n\n /**\n * Lazy-loaded getter for Table functionality.\n * Only instantiates and applies mixin when first accessed.\n */\n get table(): Table {\n if (!this._table) {\n ensureMixinApplied(Aptos, Table, \"table\");\n this._table = new Table(this.config);\n }\n return this._table;\n }\n\n /**\n * Lazy-loaded getter for Keyless functionality.\n * Only instantiates and applies mixin when first accessed.\n */\n get keyless(): Keyless {\n if (!this._keyless) {\n ensureMixinApplied(Aptos, Keyless, \"keyless\");\n this._keyless = new Keyless(this.config);\n }\n return this._keyless;\n }\n\n /**\n * Lazy-loaded getter for AptosObject functionality.\n * Only instantiates and applies mixin when first accessed.\n */\n get object(): AptosObject {\n if (!this._object) {\n ensureMixinApplied(Aptos, AptosObject, \"object\");\n this._object = new AptosObject(this.config);\n }\n return this._object;\n }\n\n setIgnoreTransactionSubmitter(ignore: boolean) {\n this.config.setIgnoreTransactionSubmitter(ignore);\n }\n}\n\n// extends Aptos interface so all the methods and properties\n// from the other classes will be recognized by typescript.\n// Note: Mixins are applied lazily when the corresponding property is first accessed.\nexport interface Aptos\n extends Account,\n AccountAbstraction,\n ANS,\n Coin,\n DigitalAsset,\n Faucet,\n FungibleAsset,\n General,\n Keyless,\n Staking,\n Table,\n AptosObject,\n Omit<Transaction, \"build\" | \"simulate\" | \"submit\" | \"batch\"> {}\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 * @group Client\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\n // Skip constructor and properties that already exist\n if (propertyName === \"constructor\" || targetClass.prototype[propertyName]) {\n return;\n }\n\n // Define new method that calls through baseClassProp\n Object.defineProperty(targetClass.prototype, propertyName, {\n value: function (...args: any[]) {\n return (this as any)[baseClassProp][propertyName](...args);\n },\n writable: propertyDescriptor.writable,\n configurable: propertyDescriptor.configurable,\n enumerable: propertyDescriptor.enumerable,\n });\n });\n}\n\n/**\n * Ensures a mixin is applied only once when the corresponding functionality is first accessed.\n * This enables lazy loading - mixins are only applied when their functionality is actually used.\n */\nfunction ensureMixinApplied(targetClass: any, baseClass: any, baseClassProp: string) {\n const mixinKey = `${targetClass.name}-${baseClass.name}-${baseClassProp}`;\n if (Aptos.mixinsApplied.has(mixinKey)) {\n return;\n }\n\n applyMixin(targetClass, baseClass, baseClassProp);\n Aptos.mixinsApplied.add(mixinKey);\n}\n"],"mappings":"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","names":["Account","AptosConfig","Coin","DigitalAsset","Faucet","FungibleAsset","General","ANS","Staking","Transaction","Table","Keyless","AptosObject","AccountAbstraction","_Aptos","config","ensureMixinApplied","ignore","Aptos","applyMixin","targetClass","baseClass","baseClassProp","propertyName","propertyDescriptor","args","mixinKey"]}
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,2 +1,2 @@
1
- import t from"@aptos-labs/aptos-client";import{NetworkToNodeAPI as u,NetworkToFaucetAPI as f,NetworkToIndexerAPI as a,Network as r,NetworkToPepperAPI as o,NetworkToProverAPI as i}from"../utils/apiEndpoints";import{AptosApiType as n,DEFAULT_MAX_GAS_AMOUNT as l,DEFAULT_TXN_EXP_SEC_FROM_NOW as s}from"../utils/const";class I{constructor(e){if(e?.fullnode||e?.indexer||e?.faucet||e?.pepper||e?.prover){if(e?.network===r.CUSTOM)console.info("Note: using CUSTOM network will require queries to lookup ChainId");else if(!e?.network)throw new Error("Custom endpoints require a network to be specified")}this.network=e?.network??r.DEVNET,this.fullnode=e?.fullnode,this.faucet=e?.faucet,this.pepper=e?.pepper,this.prover=e?.prover,this.indexer=e?.indexer,this.client=e?.client??{provider:t},this.clientConfig=e?.clientConfig??{},this.fullnodeConfig=e?.fullnodeConfig??{},this.indexerConfig=e?.indexerConfig??{},this.faucetConfig=e?.faucetConfig??{},this.transactionGenerationConfig=e?.transactionGenerationConfig??{},this.pluginConfig=e?.pluginSettings?{...e.pluginSettings,IGNORE_TRANSACTION_SUBMITTER:!1}:void 0}getRequestUrl(e){switch(e){case n.FULLNODE:if(this.fullnode!==void 0)return this.fullnode;if(this.network===r.CUSTOM)throw new Error("Please provide a custom full node url");return u[this.network];case n.FAUCET:if(this.faucet!==void 0)return this.faucet;if(this.network===r.TESTNET)throw new Error("There is no way to programmatically mint testnet APT, you must use the minting site at https://aptos.dev/network/faucet");if(this.network===r.MAINNET)throw new Error("There is no mainnet faucet");if(this.network===r.CUSTOM)throw new Error("Please provide a custom faucet url");return f[this.network];case n.INDEXER:if(this.indexer!==void 0)return this.indexer;if(this.network===r.CUSTOM)throw new Error("Please provide a custom indexer url");return a[this.network];case n.PEPPER:if(this.pepper!==void 0)return this.pepper;if(this.network===r.CUSTOM)throw new Error("Please provide a custom pepper service url");return o[this.network];case n.PROVER:if(this.prover!==void 0)return this.prover;if(this.network===r.CUSTOM)throw new Error("Please provide a custom prover service url");return i[this.network];default:throw Error(`apiType ${e} is not supported`)}}isPepperServiceRequest(e){return o[this.network]===e}isProverServiceRequest(e){return i[this.network]===e}getDefaultMaxGasAmount(){return this.transactionGenerationConfig?.defaultMaxGasAmount??l}getDefaultTxnExpirySecFromNow(){return this.transactionGenerationConfig?.defaultTxnExpirySecFromNow??s}setIgnoreTransactionSubmitter(e){this.pluginConfig&&(this.pluginConfig.IGNORE_TRANSACTION_SUBMITTER=e)}getTransactionSubmitter(){if(this.pluginConfig!==void 0&&this.pluginConfig.IGNORE_TRANSACTION_SUBMITTER!==!0)return this.pluginConfig.TRANSACTION_SUBMITTER}}export{I as AptosConfig};
1
+ import{a}from"../chunk-NCKJ7X57.mjs";import"../chunk-P5HCJN3A.mjs";import"../chunk-OLILO7VD.mjs";import"../chunk-KDMSOCZY.mjs";export{a as AptosConfig};
2
2
  //# sourceMappingURL=aptosConfig.mjs.map