@aptos-labs/ts-sdk 5.0.0 → 5.1.1-side-effect-free.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (547) hide show
  1. package/dist/common/{account-BDwBREvt.d.ts → account-Dr4y1uZG.d.ts} +8 -2
  2. package/dist/common/chunk-AWFAHZSB.js +4 -0
  3. package/dist/common/{chunk-6MMUUJHX.js.map → chunk-AWFAHZSB.js.map} +1 -1
  4. package/dist/common/cli/index.d.ts +1 -1
  5. package/dist/common/cli/index.js +1 -1
  6. package/dist/common/cli/index.js.map +1 -1
  7. package/dist/common/index.d.ts +339 -10
  8. package/dist/common/index.js +33 -33
  9. package/dist/common/index.js.map +1 -1
  10. package/dist/esm/{Ed25519Account-8ETkcAk_.d.mts → Ed25519Account-CPwej6wB.d.mts} +1 -1
  11. package/dist/esm/account/AbstractKeylessAccount.d.mts +3 -3
  12. package/dist/esm/account/AbstractKeylessAccount.mjs +1 -1
  13. package/dist/esm/account/AbstractKeylessAccount.mjs.map +1 -1
  14. package/dist/esm/account/AbstractedAccount.d.mts +2 -2
  15. package/dist/esm/account/AbstractedAccount.mjs +1 -1
  16. package/dist/esm/account/AbstractedAccount.mjs.map +1 -1
  17. package/dist/esm/account/Account.d.mts +2 -2
  18. package/dist/esm/account/Account.mjs +1 -1
  19. package/dist/esm/account/Account.mjs.map +1 -1
  20. package/dist/esm/account/AccountUtils.d.mts +3 -3
  21. package/dist/esm/account/AccountUtils.mjs +1 -1
  22. package/dist/esm/account/AccountUtils.mjs.map +1 -1
  23. package/dist/esm/account/DerivableAbstractedAccount.d.mts +2 -2
  24. package/dist/esm/account/DerivableAbstractedAccount.mjs +1 -1
  25. package/dist/esm/account/DerivableAbstractedAccount.mjs.map +1 -1
  26. package/dist/esm/account/Ed25519Account.d.mts +2 -2
  27. package/dist/esm/account/Ed25519Account.mjs +1 -1
  28. package/dist/esm/account/Ed25519Account.mjs.map +1 -1
  29. package/dist/esm/account/EphemeralKeyPair.d.mts +1 -1
  30. package/dist/esm/account/EphemeralKeyPair.mjs +1 -1
  31. package/dist/esm/account/EphemeralKeyPair.mjs.map +1 -1
  32. package/dist/esm/account/FederatedKeylessAccount.d.mts +3 -3
  33. package/dist/esm/account/FederatedKeylessAccount.mjs +1 -1
  34. package/dist/esm/account/FederatedKeylessAccount.mjs.map +1 -1
  35. package/dist/esm/account/KeylessAccount.d.mts +3 -3
  36. package/dist/esm/account/KeylessAccount.mjs +1 -1
  37. package/dist/esm/account/KeylessAccount.mjs.map +1 -1
  38. package/dist/esm/account/MultiEd25519Account.d.mts +2 -2
  39. package/dist/esm/account/MultiEd25519Account.mjs +1 -1
  40. package/dist/esm/account/MultiEd25519Account.mjs.map +1 -1
  41. package/dist/esm/account/MultiKeyAccount.d.mts +3 -3
  42. package/dist/esm/account/MultiKeyAccount.mjs +1 -1
  43. package/dist/esm/account/MultiKeyAccount.mjs.map +1 -1
  44. package/dist/esm/account/SingleKeyAccount.d.mts +2 -2
  45. package/dist/esm/account/SingleKeyAccount.mjs +1 -1
  46. package/dist/esm/account/SingleKeyAccount.mjs.map +1 -1
  47. package/dist/esm/account/index.d.mts +3 -3
  48. package/dist/esm/account/index.mjs +1 -1
  49. package/dist/esm/account/index.mjs.map +1 -1
  50. package/dist/esm/account/utils.d.mts +1 -1
  51. package/dist/esm/account/utils.mjs +1 -1
  52. package/dist/esm/account/utils.mjs.map +1 -1
  53. package/dist/esm/{account-ClxOwjdh.d.mts → account-BortO8g2.d.mts} +6 -1
  54. package/dist/esm/api/account/abstraction.d.mts +1 -1
  55. package/dist/esm/api/account/abstraction.mjs +1 -1
  56. package/dist/esm/api/account/abstraction.mjs.map +1 -1
  57. package/dist/esm/api/account.d.mts +30 -9
  58. package/dist/esm/api/account.mjs +1 -1
  59. package/dist/esm/api/account.mjs.map +1 -1
  60. package/dist/esm/api/ans.d.mts +2 -2
  61. package/dist/esm/api/ans.mjs +1 -1
  62. package/dist/esm/api/ans.mjs.map +1 -1
  63. package/dist/esm/api/aptos.d.mts +3 -3
  64. package/dist/esm/api/aptos.mjs +1 -1
  65. package/dist/esm/api/aptos.mjs.map +1 -1
  66. package/dist/esm/api/aptosConfig.d.mts +1 -1
  67. package/dist/esm/api/aptosConfig.mjs +1 -1
  68. package/dist/esm/api/aptosConfig.mjs.map +1 -1
  69. package/dist/esm/api/coin.d.mts +1 -1
  70. package/dist/esm/api/coin.mjs +1 -1
  71. package/dist/esm/api/coin.mjs.map +1 -1
  72. package/dist/esm/api/digitalAsset.d.mts +2 -2
  73. package/dist/esm/api/digitalAsset.mjs +1 -1
  74. package/dist/esm/api/digitalAsset.mjs.map +1 -1
  75. package/dist/esm/api/faucet.d.mts +1 -1
  76. package/dist/esm/api/faucet.mjs +1 -1
  77. package/dist/esm/api/faucet.mjs.map +1 -1
  78. package/dist/esm/api/fungibleAsset.d.mts +2 -2
  79. package/dist/esm/api/fungibleAsset.mjs +1 -1
  80. package/dist/esm/api/fungibleAsset.mjs.map +1 -1
  81. package/dist/esm/api/general.d.mts +1 -1
  82. package/dist/esm/api/general.mjs +1 -1
  83. package/dist/esm/api/general.mjs.map +1 -1
  84. package/dist/esm/api/index.d.mts +3 -3
  85. package/dist/esm/api/index.mjs +1 -1
  86. package/dist/esm/api/index.mjs.map +1 -1
  87. package/dist/esm/api/keyless.d.mts +3 -3
  88. package/dist/esm/api/keyless.mjs +1 -1
  89. package/dist/esm/api/keyless.mjs.map +1 -1
  90. package/dist/esm/api/object.d.mts +1 -1
  91. package/dist/esm/api/object.mjs +1 -1
  92. package/dist/esm/api/object.mjs.map +1 -1
  93. package/dist/esm/api/staking.d.mts +1 -1
  94. package/dist/esm/api/staking.mjs +1 -1
  95. package/dist/esm/api/staking.mjs.map +1 -1
  96. package/dist/esm/api/table.d.mts +1 -1
  97. package/dist/esm/api/table.mjs +1 -1
  98. package/dist/esm/api/table.mjs.map +1 -1
  99. package/dist/esm/api/transaction.d.mts +2 -2
  100. package/dist/esm/api/transaction.mjs +1 -1
  101. package/dist/esm/api/transaction.mjs.map +1 -1
  102. package/dist/esm/api/transactionSubmission/build.d.mts +1 -1
  103. package/dist/esm/api/transactionSubmission/build.mjs +1 -1
  104. package/dist/esm/api/transactionSubmission/build.mjs.map +1 -1
  105. package/dist/esm/api/transactionSubmission/helpers.d.mts +1 -1
  106. package/dist/esm/api/transactionSubmission/helpers.mjs +1 -1
  107. package/dist/esm/api/transactionSubmission/helpers.mjs.map +1 -1
  108. package/dist/esm/api/transactionSubmission/management.d.mts +2 -2
  109. package/dist/esm/api/transactionSubmission/management.mjs +1 -1
  110. package/dist/esm/api/transactionSubmission/management.mjs.map +1 -1
  111. package/dist/esm/api/transactionSubmission/sign.d.mts +2 -2
  112. package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
  113. package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -1
  114. package/dist/esm/api/transactionSubmission/simulate.d.mts +1 -1
  115. package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
  116. package/dist/esm/api/transactionSubmission/simulate.mjs.map +1 -1
  117. package/dist/esm/api/transactionSubmission/submit.d.mts +1 -1
  118. package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
  119. package/dist/esm/api/transactionSubmission/submit.mjs.map +1 -1
  120. package/dist/esm/api/utils.d.mts +1 -1
  121. package/dist/esm/api/utils.mjs +1 -1
  122. package/dist/esm/api/utils.mjs.map +1 -1
  123. package/dist/esm/bcs/consts.d.mts +1 -1
  124. package/dist/esm/bcs/consts.mjs +1 -1
  125. package/dist/esm/bcs/consts.mjs.map +1 -1
  126. package/dist/esm/bcs/deserializer.d.mts +1 -1
  127. package/dist/esm/bcs/deserializer.mjs +1 -1
  128. package/dist/esm/bcs/deserializer.mjs.map +1 -1
  129. package/dist/esm/bcs/index.d.mts +1 -1
  130. package/dist/esm/bcs/index.mjs +1 -1
  131. package/dist/esm/bcs/index.mjs.map +1 -1
  132. package/dist/esm/bcs/serializable/entryFunctionBytes.d.mts +1 -1
  133. package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -1
  134. package/dist/esm/bcs/serializable/entryFunctionBytes.mjs.map +1 -1
  135. package/dist/esm/bcs/serializable/fixedBytes.d.mts +1 -1
  136. package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -1
  137. package/dist/esm/bcs/serializable/fixedBytes.mjs.map +1 -1
  138. package/dist/esm/bcs/serializable/movePrimitives.d.mts +1 -1
  139. package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
  140. package/dist/esm/bcs/serializable/movePrimitives.mjs.map +1 -1
  141. package/dist/esm/bcs/serializable/moveStructs.d.mts +1 -1
  142. package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
  143. package/dist/esm/bcs/serializable/moveStructs.mjs.map +1 -1
  144. package/dist/esm/bcs/serializer.d.mts +1 -1
  145. package/dist/esm/bcs/serializer.mjs +1 -1
  146. package/dist/esm/bcs/serializer.mjs.map +1 -1
  147. package/dist/esm/cli/index.d.mts +1 -1
  148. package/dist/esm/cli/index.mjs +1 -1
  149. package/dist/esm/cli/index.mjs.map +1 -1
  150. package/dist/esm/cli/localNode.mjs +1 -1
  151. package/dist/esm/cli/localNode.mjs.map +1 -1
  152. package/dist/esm/cli/move.d.mts +1 -1
  153. package/dist/esm/cli/move.mjs +1 -1
  154. package/dist/esm/cli/move.mjs.map +1 -1
  155. package/dist/esm/client/core.d.mts +1 -1
  156. package/dist/esm/client/core.mjs +1 -1
  157. package/dist/esm/client/core.mjs.map +1 -1
  158. package/dist/esm/client/get.d.mts +1 -1
  159. package/dist/esm/client/get.mjs +1 -1
  160. package/dist/esm/client/get.mjs.map +1 -1
  161. package/dist/esm/client/index.d.mts +1 -1
  162. package/dist/esm/client/index.mjs +1 -1
  163. package/dist/esm/client/index.mjs.map +1 -1
  164. package/dist/esm/client/post.d.mts +1 -1
  165. package/dist/esm/client/post.mjs +1 -1
  166. package/dist/esm/client/post.mjs.map +1 -1
  167. package/dist/esm/core/account/index.d.mts +2 -2
  168. package/dist/esm/core/account/index.mjs +1 -1
  169. package/dist/esm/core/account/index.mjs.map +1 -1
  170. package/dist/esm/core/account/utils/address.d.mts +13 -2
  171. package/dist/esm/core/account/utils/address.mjs +1 -1
  172. package/dist/esm/core/account/utils/address.mjs.map +1 -1
  173. package/dist/esm/core/account/utils/index.d.mts +2 -2
  174. package/dist/esm/core/account/utils/index.mjs +1 -1
  175. package/dist/esm/core/account/utils/index.mjs.map +1 -1
  176. package/dist/esm/core/accountAddress.d.mts +1 -1
  177. package/dist/esm/core/accountAddress.mjs +3 -1
  178. package/dist/esm/core/accountAddress.mjs.map +1 -1
  179. package/dist/esm/core/authenticationKey.d.mts +1 -1
  180. package/dist/esm/core/authenticationKey.mjs +1 -1
  181. package/dist/esm/core/authenticationKey.mjs.map +1 -1
  182. package/dist/esm/core/common.mjs +1 -1
  183. package/dist/esm/core/common.mjs.map +1 -1
  184. package/dist/esm/core/crypto/abstraction.d.mts +1 -1
  185. package/dist/esm/core/crypto/abstraction.mjs +1 -1
  186. package/dist/esm/core/crypto/abstraction.mjs.map +1 -1
  187. package/dist/esm/core/crypto/deserializationUtils.d.mts +1 -1
  188. package/dist/esm/core/crypto/deserializationUtils.mjs +1 -1
  189. package/dist/esm/core/crypto/deserializationUtils.mjs.map +1 -1
  190. package/dist/esm/core/crypto/ed25519.d.mts +1 -1
  191. package/dist/esm/core/crypto/ed25519.mjs +1 -1
  192. package/dist/esm/core/crypto/ed25519.mjs.map +1 -1
  193. package/dist/esm/core/crypto/ephemeral.d.mts +1 -1
  194. package/dist/esm/core/crypto/ephemeral.mjs +1 -1
  195. package/dist/esm/core/crypto/ephemeral.mjs.map +1 -1
  196. package/dist/esm/core/crypto/federatedKeyless.d.mts +2 -2
  197. package/dist/esm/core/crypto/federatedKeyless.mjs +1 -1
  198. package/dist/esm/core/crypto/federatedKeyless.mjs.map +1 -1
  199. package/dist/esm/core/crypto/hdKey.mjs +1 -1
  200. package/dist/esm/core/crypto/hdKey.mjs.map +1 -1
  201. package/dist/esm/core/crypto/index.d.mts +3 -2
  202. package/dist/esm/core/crypto/index.mjs +1 -1
  203. package/dist/esm/core/crypto/index.mjs.map +1 -1
  204. package/dist/esm/core/crypto/keyless.d.mts +2 -2
  205. package/dist/esm/core/crypto/keyless.mjs +1 -1
  206. package/dist/esm/core/crypto/keyless.mjs.map +1 -1
  207. package/dist/esm/core/crypto/multiEd25519.d.mts +1 -1
  208. package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
  209. package/dist/esm/core/crypto/multiEd25519.mjs.map +1 -1
  210. package/dist/esm/core/crypto/multiKey.d.mts +1 -1
  211. package/dist/esm/core/crypto/multiKey.mjs +3 -1
  212. package/dist/esm/core/crypto/multiKey.mjs.map +1 -1
  213. package/dist/esm/core/crypto/poseidon.mjs +1 -1
  214. package/dist/esm/core/crypto/poseidon.mjs.map +1 -1
  215. package/dist/esm/core/crypto/privateKey.d.mts +1 -1
  216. package/dist/esm/core/crypto/privateKey.mjs +1 -1
  217. package/dist/esm/core/crypto/privateKey.mjs.map +1 -1
  218. package/dist/esm/core/crypto/proof.d.mts +1 -1
  219. package/dist/esm/core/crypto/proof.mjs +1 -1
  220. package/dist/esm/core/crypto/proof.mjs.map +1 -1
  221. package/dist/esm/core/crypto/publicKey.d.mts +1 -1
  222. package/dist/esm/core/crypto/publicKey.mjs +1 -1
  223. package/dist/esm/core/crypto/publicKey.mjs.map +1 -1
  224. package/dist/esm/core/crypto/secp256k1.d.mts +1 -1
  225. package/dist/esm/core/crypto/secp256k1.mjs +1 -1
  226. package/dist/esm/core/crypto/secp256k1.mjs.map +1 -1
  227. package/dist/esm/core/crypto/secp256r1.d.mts +306 -0
  228. package/dist/esm/core/crypto/secp256r1.mjs +2 -0
  229. package/dist/esm/core/crypto/secp256r1.mjs.map +1 -0
  230. package/dist/esm/core/crypto/signature.d.mts +1 -1
  231. package/dist/esm/core/crypto/signature.mjs +1 -1
  232. package/dist/esm/core/crypto/signature.mjs.map +1 -1
  233. package/dist/esm/core/crypto/singleKey.d.mts +1 -1
  234. package/dist/esm/core/crypto/singleKey.mjs +1 -1
  235. package/dist/esm/core/crypto/singleKey.mjs.map +1 -1
  236. package/dist/esm/core/crypto/types.d.mts +1 -1
  237. package/dist/esm/core/crypto/types.mjs +0 -1
  238. package/dist/esm/core/crypto/utils.d.mts +1 -1
  239. package/dist/esm/core/crypto/utils.mjs +1 -1
  240. package/dist/esm/core/crypto/utils.mjs.map +1 -1
  241. package/dist/esm/core/hex.d.mts +1 -1
  242. package/dist/esm/core/hex.mjs +1 -1
  243. package/dist/esm/core/hex.mjs.map +1 -1
  244. package/dist/esm/core/index.d.mts +4 -3
  245. package/dist/esm/core/index.mjs +1 -1
  246. package/dist/esm/core/index.mjs.map +1 -1
  247. package/dist/esm/errors/index.d.mts +1 -1
  248. package/dist/esm/errors/index.mjs +6 -1
  249. package/dist/esm/errors/index.mjs.map +1 -1
  250. package/dist/esm/{federatedKeyless-CUPEnP-W.d.mts → federatedKeyless-CTzDAQTu.d.mts} +1 -1
  251. package/dist/esm/index.d.mts +5 -4
  252. package/dist/esm/index.mjs +1 -1
  253. package/dist/esm/index.mjs.map +1 -1
  254. package/dist/esm/internal/abstraction.d.mts +1 -1
  255. package/dist/esm/internal/abstraction.mjs +1 -1
  256. package/dist/esm/internal/abstraction.mjs.map +1 -1
  257. package/dist/esm/internal/account.d.mts +21 -3
  258. package/dist/esm/internal/account.mjs +1 -1
  259. package/dist/esm/internal/account.mjs.map +1 -1
  260. package/dist/esm/internal/ans.d.mts +2 -2
  261. package/dist/esm/internal/ans.mjs +1 -1
  262. package/dist/esm/internal/ans.mjs.map +1 -1
  263. package/dist/esm/internal/coin.d.mts +1 -1
  264. package/dist/esm/internal/coin.mjs +1 -1
  265. package/dist/esm/internal/coin.mjs.map +1 -1
  266. package/dist/esm/internal/digitalAsset.d.mts +2 -2
  267. package/dist/esm/internal/digitalAsset.mjs +1 -1
  268. package/dist/esm/internal/digitalAsset.mjs.map +1 -1
  269. package/dist/esm/internal/faucet.d.mts +1 -1
  270. package/dist/esm/internal/faucet.mjs +1 -1
  271. package/dist/esm/internal/faucet.mjs.map +1 -1
  272. package/dist/esm/internal/fungibleAsset.d.mts +2 -2
  273. package/dist/esm/internal/fungibleAsset.mjs +1 -1
  274. package/dist/esm/internal/fungibleAsset.mjs.map +1 -1
  275. package/dist/esm/internal/general.d.mts +1 -1
  276. package/dist/esm/internal/general.mjs +1 -1
  277. package/dist/esm/internal/general.mjs.map +1 -1
  278. package/dist/esm/internal/keyless.d.mts +3 -3
  279. package/dist/esm/internal/keyless.mjs +1 -1
  280. package/dist/esm/internal/keyless.mjs.map +1 -1
  281. package/dist/esm/internal/object.d.mts +1 -1
  282. package/dist/esm/internal/object.mjs +1 -1
  283. package/dist/esm/internal/object.mjs.map +1 -1
  284. package/dist/esm/internal/staking.d.mts +1 -1
  285. package/dist/esm/internal/staking.mjs +1 -1
  286. package/dist/esm/internal/staking.mjs.map +1 -1
  287. package/dist/esm/internal/table.d.mts +1 -1
  288. package/dist/esm/internal/table.mjs +1 -1
  289. package/dist/esm/internal/table.mjs.map +1 -1
  290. package/dist/esm/internal/transaction.d.mts +1 -1
  291. package/dist/esm/internal/transaction.mjs +1 -1
  292. package/dist/esm/internal/transaction.mjs.map +1 -1
  293. package/dist/esm/internal/transactionSubmission.d.mts +2 -2
  294. package/dist/esm/internal/transactionSubmission.mjs +1 -1
  295. package/dist/esm/internal/transactionSubmission.mjs.map +1 -1
  296. package/dist/esm/internal/utils/index.d.mts +1 -1
  297. package/dist/esm/internal/utils/index.mjs +1 -1
  298. package/dist/esm/internal/utils/index.mjs.map +1 -1
  299. package/dist/esm/internal/utils/utils.d.mts +1 -1
  300. package/dist/esm/internal/utils/utils.mjs +1 -1
  301. package/dist/esm/internal/utils/utils.mjs.map +1 -1
  302. package/dist/esm/internal/view.d.mts +1 -1
  303. package/dist/esm/internal/view.mjs +1 -1
  304. package/dist/esm/internal/view.mjs.map +1 -1
  305. package/dist/esm/transactions/authenticator/account.d.mts +1 -1
  306. package/dist/esm/transactions/authenticator/account.mjs +1 -1
  307. package/dist/esm/transactions/authenticator/account.mjs.map +1 -1
  308. package/dist/esm/transactions/authenticator/index.d.mts +1 -1
  309. package/dist/esm/transactions/authenticator/index.mjs +1 -1
  310. package/dist/esm/transactions/authenticator/index.mjs.map +1 -1
  311. package/dist/esm/transactions/authenticator/transaction.d.mts +1 -1
  312. package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
  313. package/dist/esm/transactions/authenticator/transaction.mjs.map +1 -1
  314. package/dist/esm/transactions/index.d.mts +1 -1
  315. package/dist/esm/transactions/index.mjs +1 -1
  316. package/dist/esm/transactions/index.mjs.map +1 -1
  317. package/dist/esm/transactions/instances/chainId.d.mts +1 -1
  318. package/dist/esm/transactions/instances/chainId.mjs +1 -1
  319. package/dist/esm/transactions/instances/chainId.mjs.map +1 -1
  320. package/dist/esm/transactions/instances/identifier.d.mts +1 -1
  321. package/dist/esm/transactions/instances/identifier.mjs +1 -1
  322. package/dist/esm/transactions/instances/identifier.mjs.map +1 -1
  323. package/dist/esm/transactions/instances/index.d.mts +1 -1
  324. package/dist/esm/transactions/instances/index.mjs +1 -1
  325. package/dist/esm/transactions/instances/index.mjs.map +1 -1
  326. package/dist/esm/transactions/instances/moduleId.d.mts +1 -1
  327. package/dist/esm/transactions/instances/moduleId.mjs +1 -1
  328. package/dist/esm/transactions/instances/moduleId.mjs.map +1 -1
  329. package/dist/esm/transactions/instances/multiAgentTransaction.d.mts +1 -1
  330. package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
  331. package/dist/esm/transactions/instances/multiAgentTransaction.mjs.map +1 -1
  332. package/dist/esm/transactions/instances/rawTransaction.d.mts +1 -1
  333. package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
  334. package/dist/esm/transactions/instances/rawTransaction.mjs.map +1 -1
  335. package/dist/esm/transactions/instances/rotationProofChallenge.d.mts +1 -1
  336. package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
  337. package/dist/esm/transactions/instances/rotationProofChallenge.mjs.map +1 -1
  338. package/dist/esm/transactions/instances/signedTransaction.d.mts +1 -1
  339. package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
  340. package/dist/esm/transactions/instances/signedTransaction.mjs.map +1 -1
  341. package/dist/esm/transactions/instances/simpleTransaction.d.mts +1 -1
  342. package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
  343. package/dist/esm/transactions/instances/simpleTransaction.mjs.map +1 -1
  344. package/dist/esm/transactions/instances/transactionArgument.d.mts +1 -1
  345. package/dist/esm/transactions/instances/transactionArgument.mjs +0 -1
  346. package/dist/esm/transactions/instances/transactionPayload.d.mts +1 -1
  347. package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
  348. package/dist/esm/transactions/instances/transactionPayload.mjs.map +1 -1
  349. package/dist/esm/transactions/management/accountSequenceNumber.d.mts +2 -2
  350. package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
  351. package/dist/esm/transactions/management/accountSequenceNumber.mjs.map +1 -1
  352. package/dist/esm/transactions/management/asyncQueue.mjs +1 -1
  353. package/dist/esm/transactions/management/asyncQueue.mjs.map +1 -1
  354. package/dist/esm/transactions/management/index.d.mts +2 -2
  355. package/dist/esm/transactions/management/index.mjs +1 -1
  356. package/dist/esm/transactions/management/index.mjs.map +1 -1
  357. package/dist/esm/transactions/management/transactionWorker.d.mts +2 -2
  358. package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
  359. package/dist/esm/transactions/management/transactionWorker.mjs.map +1 -1
  360. package/dist/esm/transactions/transactionBuilder/helpers.d.mts +1 -1
  361. package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
  362. package/dist/esm/transactions/transactionBuilder/helpers.mjs.map +1 -1
  363. package/dist/esm/transactions/transactionBuilder/index.d.mts +1 -1
  364. package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
  365. package/dist/esm/transactions/transactionBuilder/index.mjs.map +1 -1
  366. package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +1 -1
  367. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
  368. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs.map +1 -1
  369. package/dist/esm/transactions/transactionBuilder/signingMessage.d.mts +1 -1
  370. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
  371. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs.map +1 -1
  372. package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +1 -1
  373. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
  374. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs.map +1 -1
  375. package/dist/esm/transactions/typeTag/index.d.mts +1 -1
  376. package/dist/esm/transactions/typeTag/index.mjs +1 -1
  377. package/dist/esm/transactions/typeTag/index.mjs.map +1 -1
  378. package/dist/esm/transactions/typeTag/parser.d.mts +1 -1
  379. package/dist/esm/transactions/typeTag/parser.mjs +1 -1
  380. package/dist/esm/transactions/typeTag/parser.mjs.map +1 -1
  381. package/dist/esm/transactions/types.d.mts +1 -1
  382. package/dist/esm/transactions/types.mjs +0 -1
  383. package/dist/esm/types/abstraction.mjs +1 -1
  384. package/dist/esm/types/abstraction.mjs.map +1 -1
  385. package/dist/esm/types/generated/queries.mjs +493 -1
  386. package/dist/esm/types/generated/queries.mjs.map +1 -1
  387. package/dist/esm/types/generated/types.mjs +1 -1
  388. package/dist/esm/types/generated/types.mjs.map +1 -1
  389. package/dist/esm/types/index.d.mts +1 -1
  390. package/dist/esm/types/index.mjs +1 -1
  391. package/dist/esm/types/index.mjs.map +1 -1
  392. package/dist/esm/types/indexer.mjs +0 -1
  393. package/dist/esm/types/types.d.mts +1 -1
  394. package/dist/esm/types/types.mjs +1 -1
  395. package/dist/esm/types/types.mjs.map +1 -1
  396. package/dist/esm/utils/apiEndpoints.d.mts +1 -0
  397. package/dist/esm/utils/apiEndpoints.mjs +1 -1
  398. package/dist/esm/utils/apiEndpoints.mjs.map +1 -1
  399. package/dist/esm/utils/const.mjs +1 -1
  400. package/dist/esm/utils/const.mjs.map +1 -1
  401. package/dist/esm/utils/helpers.d.mts +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.d.mts +1 -1
  405. package/dist/esm/utils/index.mjs +1 -1
  406. package/dist/esm/utils/index.mjs.map +1 -1
  407. package/dist/esm/utils/memoize.mjs +1 -1
  408. package/dist/esm/utils/memoize.mjs.map +1 -1
  409. package/dist/esm/utils/normalizeBundle.d.mts +1 -1
  410. package/dist/esm/utils/normalizeBundle.mjs +1 -1
  411. package/dist/esm/utils/normalizeBundle.mjs.map +1 -1
  412. package/dist/esm/version.d.mts +1 -1
  413. package/dist/esm/version.mjs +1 -1
  414. package/dist/esm/version.mjs.map +1 -1
  415. package/package.json +40 -22
  416. package/src/api/account.ts +32 -7
  417. package/src/api/aptos.ts +25 -14
  418. package/src/core/account/utils/address.ts +22 -0
  419. package/src/core/crypto/index.ts +1 -0
  420. package/src/core/crypto/privateKey.ts +1 -0
  421. package/src/core/crypto/secp256k1.ts +9 -1
  422. package/src/core/crypto/secp256r1.ts +495 -0
  423. package/src/core/crypto/singleKey.ts +11 -0
  424. package/src/internal/account.ts +33 -0
  425. package/src/internal/ans.ts +1 -0
  426. package/src/types/types.ts +5 -0
  427. package/src/utils/apiEndpoints.ts +7 -0
  428. package/src/version.ts +1 -1
  429. package/dist/common/chunk-6MMUUJHX.js +0 -4
  430. package/dist/esm/chunk-35DKMW7Q.mjs +0 -2
  431. package/dist/esm/chunk-35DKMW7Q.mjs.map +0 -1
  432. package/dist/esm/chunk-4QMXOWHP.mjs +0 -1
  433. package/dist/esm/chunk-4QMXOWHP.mjs.map +0 -1
  434. package/dist/esm/chunk-4RXKALLC.mjs +0 -2
  435. package/dist/esm/chunk-4RXKALLC.mjs.map +0 -1
  436. package/dist/esm/chunk-4WPQQPUF.mjs +0 -1
  437. package/dist/esm/chunk-4WPQQPUF.mjs.map +0 -1
  438. package/dist/esm/chunk-56CNRT2K.mjs +0 -2
  439. package/dist/esm/chunk-56CNRT2K.mjs.map +0 -1
  440. package/dist/esm/chunk-5FI4545P.mjs +0 -2
  441. package/dist/esm/chunk-5FI4545P.mjs.map +0 -1
  442. package/dist/esm/chunk-5HXLZHDW.mjs +0 -1
  443. package/dist/esm/chunk-5HXLZHDW.mjs.map +0 -1
  444. package/dist/esm/chunk-6WDVDEQZ.mjs +0 -7
  445. package/dist/esm/chunk-6WDVDEQZ.mjs.map +0 -1
  446. package/dist/esm/chunk-7DQDJ2SA.mjs +0 -2
  447. package/dist/esm/chunk-7DQDJ2SA.mjs.map +0 -1
  448. package/dist/esm/chunk-7ECCT6PK.mjs +0 -1
  449. package/dist/esm/chunk-7ECCT6PK.mjs.map +0 -1
  450. package/dist/esm/chunk-A5L76YP7.mjs +0 -2
  451. package/dist/esm/chunk-A5L76YP7.mjs.map +0 -1
  452. package/dist/esm/chunk-B563XRSZ.mjs +0 -2
  453. package/dist/esm/chunk-B563XRSZ.mjs.map +0 -1
  454. package/dist/esm/chunk-C3Q23D22.mjs +0 -2
  455. package/dist/esm/chunk-C3Q23D22.mjs.map +0 -1
  456. package/dist/esm/chunk-CW35YAMN.mjs +0 -2
  457. package/dist/esm/chunk-CW35YAMN.mjs.map +0 -1
  458. package/dist/esm/chunk-DIGP2ALY.mjs +0 -4
  459. package/dist/esm/chunk-DIGP2ALY.mjs.map +0 -1
  460. package/dist/esm/chunk-DNRUDMMV.mjs +0 -2
  461. package/dist/esm/chunk-DNRUDMMV.mjs.map +0 -1
  462. package/dist/esm/chunk-EBMEXURY.mjs +0 -2
  463. package/dist/esm/chunk-EBMEXURY.mjs.map +0 -1
  464. package/dist/esm/chunk-EM52Z7T7.mjs +0 -2
  465. package/dist/esm/chunk-EM52Z7T7.mjs.map +0 -1
  466. package/dist/esm/chunk-ES2KP6BS.mjs +0 -2
  467. package/dist/esm/chunk-ES2KP6BS.mjs.map +0 -1
  468. package/dist/esm/chunk-FD6FGKYY.mjs +0 -1
  469. package/dist/esm/chunk-FD6FGKYY.mjs.map +0 -1
  470. package/dist/esm/chunk-FGFLPH5K.mjs +0 -2
  471. package/dist/esm/chunk-FGFLPH5K.mjs.map +0 -1
  472. package/dist/esm/chunk-FLZPUYXQ.mjs +0 -2
  473. package/dist/esm/chunk-FLZPUYXQ.mjs.map +0 -1
  474. package/dist/esm/chunk-FZY4PMEE.mjs +0 -1
  475. package/dist/esm/chunk-FZY4PMEE.mjs.map +0 -1
  476. package/dist/esm/chunk-G3MHXDYA.mjs +0 -1
  477. package/dist/esm/chunk-G3MHXDYA.mjs.map +0 -1
  478. package/dist/esm/chunk-GFFKEZ56.mjs +0 -2
  479. package/dist/esm/chunk-GFFKEZ56.mjs.map +0 -1
  480. package/dist/esm/chunk-GMQCQDW4.mjs +0 -2
  481. package/dist/esm/chunk-GMQCQDW4.mjs.map +0 -1
  482. package/dist/esm/chunk-GOXRBEIJ.mjs +0 -2
  483. package/dist/esm/chunk-GOXRBEIJ.mjs.map +0 -1
  484. package/dist/esm/chunk-HGLO5LDS.mjs +0 -1
  485. package/dist/esm/chunk-HGLO5LDS.mjs.map +0 -1
  486. package/dist/esm/chunk-HNBKTJPN.mjs +0 -2
  487. package/dist/esm/chunk-HNBKTJPN.mjs.map +0 -1
  488. package/dist/esm/chunk-HNBVYE3N.mjs +0 -2
  489. package/dist/esm/chunk-HNBVYE3N.mjs.map +0 -1
  490. package/dist/esm/chunk-IF4UU2MT.mjs +0 -2
  491. package/dist/esm/chunk-IF4UU2MT.mjs.map +0 -1
  492. package/dist/esm/chunk-IJE2LVZG.mjs +0 -2
  493. package/dist/esm/chunk-IJE2LVZG.mjs.map +0 -1
  494. package/dist/esm/chunk-KDMSOCZY.mjs +0 -2
  495. package/dist/esm/chunk-KDMSOCZY.mjs.map +0 -1
  496. package/dist/esm/chunk-LWL57YFU.mjs +0 -2
  497. package/dist/esm/chunk-LWL57YFU.mjs.map +0 -1
  498. package/dist/esm/chunk-MT2RJ7H3.mjs +0 -2
  499. package/dist/esm/chunk-MT2RJ7H3.mjs.map +0 -1
  500. package/dist/esm/chunk-N3O3ULF7.mjs +0 -2
  501. package/dist/esm/chunk-N3O3ULF7.mjs.map +0 -1
  502. package/dist/esm/chunk-N6YTF76Q.mjs +0 -2
  503. package/dist/esm/chunk-N6YTF76Q.mjs.map +0 -1
  504. package/dist/esm/chunk-NECL5FCQ.mjs +0 -1
  505. package/dist/esm/chunk-NECL5FCQ.mjs.map +0 -1
  506. package/dist/esm/chunk-OLILO7VD.mjs +0 -2
  507. package/dist/esm/chunk-OLILO7VD.mjs.map +0 -1
  508. package/dist/esm/chunk-ORMOQWWH.mjs +0 -2
  509. package/dist/esm/chunk-ORMOQWWH.mjs.map +0 -1
  510. package/dist/esm/chunk-Q4W3WJ2U.mjs +0 -2
  511. package/dist/esm/chunk-Q4W3WJ2U.mjs.map +0 -1
  512. package/dist/esm/chunk-QREVMGQZ.mjs +0 -2
  513. package/dist/esm/chunk-QREVMGQZ.mjs.map +0 -1
  514. package/dist/esm/chunk-RCSJFTST.mjs +0 -2
  515. package/dist/esm/chunk-RCSJFTST.mjs.map +0 -1
  516. package/dist/esm/chunk-RGKRCZ36.mjs +0 -4
  517. package/dist/esm/chunk-RGKRCZ36.mjs.map +0 -1
  518. package/dist/esm/chunk-ROT6S6BM.mjs +0 -2
  519. package/dist/esm/chunk-ROT6S6BM.mjs.map +0 -1
  520. package/dist/esm/chunk-RQX6JOEN.mjs +0 -2
  521. package/dist/esm/chunk-RQX6JOEN.mjs.map +0 -1
  522. package/dist/esm/chunk-STY74NUA.mjs +0 -2
  523. package/dist/esm/chunk-STY74NUA.mjs.map +0 -1
  524. package/dist/esm/chunk-TGRLDWXV.mjs +0 -2
  525. package/dist/esm/chunk-TGRLDWXV.mjs.map +0 -1
  526. package/dist/esm/chunk-TOBQ5UE6.mjs +0 -2
  527. package/dist/esm/chunk-TOBQ5UE6.mjs.map +0 -1
  528. package/dist/esm/chunk-UL777LTI.mjs +0 -494
  529. package/dist/esm/chunk-UL777LTI.mjs.map +0 -1
  530. package/dist/esm/chunk-UYVPNUH3.mjs +0 -1
  531. package/dist/esm/chunk-UYVPNUH3.mjs.map +0 -1
  532. package/dist/esm/chunk-V3MBJJTL.mjs +0 -1
  533. package/dist/esm/chunk-V3MBJJTL.mjs.map +0 -1
  534. package/dist/esm/chunk-V74WPKSY.mjs +0 -2
  535. package/dist/esm/chunk-V74WPKSY.mjs.map +0 -1
  536. package/dist/esm/chunk-WCMW2L3P.mjs +0 -2
  537. package/dist/esm/chunk-WCMW2L3P.mjs.map +0 -1
  538. package/dist/esm/chunk-WSR5EBJM.mjs +0 -2
  539. package/dist/esm/chunk-WSR5EBJM.mjs.map +0 -1
  540. package/dist/esm/chunk-XJJVJOX5.mjs +0 -2
  541. package/dist/esm/chunk-XJJVJOX5.mjs.map +0 -1
  542. package/dist/esm/chunk-XKUIMGKU.mjs +0 -2
  543. package/dist/esm/chunk-XKUIMGKU.mjs.map +0 -1
  544. package/dist/esm/chunk-YOZBVVKL.mjs +0 -2
  545. package/dist/esm/chunk-YOZBVVKL.mjs.map +0 -1
  546. package/dist/esm/chunk-ZP4DWSQA.mjs +0 -2
  547. package/dist/esm/chunk-ZP4DWSQA.mjs.map +0 -1
@@ -1,2 +1,2 @@
1
- import{Cd as a}from"../chunk-DIGP2ALY.mjs";import"../chunk-5HXLZHDW.mjs";import"../chunk-GOXRBEIJ.mjs";import"../chunk-ROT6S6BM.mjs";import"../chunk-XJJVJOX5.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-G3MHXDYA.mjs";import"../chunk-HNBKTJPN.mjs";import"../chunk-V74WPKSY.mjs";import"../chunk-UYVPNUH3.mjs";import"../chunk-A5L76YP7.mjs";import"../chunk-XKUIMGKU.mjs";import"../chunk-N6YTF76Q.mjs";import"../chunk-ZP4DWSQA.mjs";import"../chunk-QREVMGQZ.mjs";import"../chunk-FGFLPH5K.mjs";import"../chunk-V3MBJJTL.mjs";import"../chunk-ES2KP6BS.mjs";import"../chunk-EM52Z7T7.mjs";import"../chunk-TGRLDWXV.mjs";import"../chunk-N3O3ULF7.mjs";import"../chunk-YOZBVVKL.mjs";import"../chunk-GMQCQDW4.mjs";import"../chunk-UL777LTI.mjs";import"../chunk-7ECCT6PK.mjs";import"../chunk-DNRUDMMV.mjs";import"../chunk-GFFKEZ56.mjs";import"../chunk-LWL57YFU.mjs";import"../chunk-HGLO5LDS.mjs";import"../chunk-CW35YAMN.mjs";import"../chunk-6WDVDEQZ.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-7DQDJ2SA.mjs";import"../chunk-HNBVYE3N.mjs";import"../chunk-RGKRCZ36.mjs";import"../chunk-FD6FGKYY.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-IJE2LVZG.mjs";import"../chunk-EBMEXURY.mjs";import"../chunk-STY74NUA.mjs";import"../chunk-IF4UU2MT.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-RCSJFTST.mjs";import"../chunk-4RXKALLC.mjs";import"../chunk-OLILO7VD.mjs";import"../chunk-5FI4545P.mjs";import"../chunk-KDMSOCZY.mjs";export{a as FungibleAsset};
1
+ import{getCurrentFungibleAssetBalances as o,getFungibleAssetActivities as r,getFungibleAssetMetadata as n,transferFungibleAsset as a,transferFungibleAssetBetweenStores as g}from"../internal/fungibleAsset";import{ProcessorType as s}from"../utils/const";import{waitForIndexerOnVersion as t}from"./utils";import{AccountAddress as m}from"../core";class w{constructor(e){this.config=e}async getFungibleAssetMetadata(e){return await t({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:s.FUNGIBLE_ASSET_PROCESSOR}),n({aptosConfig:this.config,...e})}async getFungibleAssetMetadataByAssetType(e){return await t({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:s.FUNGIBLE_ASSET_PROCESSOR}),(await n({aptosConfig:this.config,options:{where:{asset_type:{_eq:e.assetType}}}}))[0]}async getFungibleAssetMetadataByCreatorAddress(e){return await t({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:s.FUNGIBLE_ASSET_PROCESSOR}),await n({aptosConfig:this.config,options:{where:{creator_address:{_eq:m.from(e.creatorAddress).toStringLong()}}}})}async getFungibleAssetActivities(e){return await t({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:s.FUNGIBLE_ASSET_PROCESSOR}),r({aptosConfig:this.config,...e})}async getCurrentFungibleAssetBalances(e){return await t({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:s.FUNGIBLE_ASSET_PROCESSOR}),o({aptosConfig:this.config,...e})}async transferFungibleAsset(e){return a({aptosConfig:this.config,...e})}async transferFungibleAssetBetweenStores(e){return g({aptosConfig:this.config,...e})}}export{w as FungibleAsset};
2
2
  //# sourceMappingURL=fungibleAsset.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"sources":["../../../src/api/fungibleAsset.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n AnyNumber,\n GetCurrentFungibleAssetBalancesResponse,\n GetFungibleAssetActivitiesResponse,\n GetFungibleAssetMetadataResponse,\n PaginationArgs,\n WhereArg,\n} from \"../types\";\nimport {\n getCurrentFungibleAssetBalances,\n getFungibleAssetActivities,\n getFungibleAssetMetadata,\n transferFungibleAsset,\n transferFungibleAssetBetweenStores,\n} from \"../internal/fungibleAsset\";\nimport {\n CurrentFungibleAssetBalancesBoolExp,\n FungibleAssetActivitiesBoolExp,\n FungibleAssetMetadataBoolExp,\n} from \"../types/generated/types\";\nimport { ProcessorType } from \"../utils/const\";\nimport { AptosConfig } from \"./aptosConfig\";\nimport { waitForIndexerOnVersion } from \"./utils\";\nimport { Account } from \"../account\";\nimport { AccountAddress, AccountAddressInput } from \"../core\";\nimport { InputGenerateTransactionOptions } from \"../transactions\";\nimport { SimpleTransaction } from \"../transactions/instances/simpleTransaction\";\n\n/**\n * A class for querying and managing fungible asset-related operations on the Aptos blockchain.\n * @group FungibleAsset\n */\nexport class FungibleAsset {\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 connecting to the Aptos network.\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 the Aptos client\n * const config = new AptosConfig({ network: Network.TESTNET }); // Specify your own network if needed\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 FungibleAsset\n */\n constructor(readonly config: AptosConfig) {}\n\n /**\n * Queries all fungible asset metadata.\n *\n * @param args Optional parameters for the query.\n * @param args.minimumLedgerVersion Optional ledger version to sync up to before querying.\n * @param args.options Optional configuration for pagination and filtering.\n *\n * @returns A list of fungible asset metadata.\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 fungible asset metadata\n * const fungibleAssets = await aptos.getFungibleAssetMetadata();\n * console.log(fungibleAssets);\n * }\n * runExample().catch(console.error);\n * ```\n * @group FungibleAsset\n */\n async getFungibleAssetMetadata(args?: {\n minimumLedgerVersion?: AnyNumber;\n options?: PaginationArgs & WhereArg<FungibleAssetMetadataBoolExp>;\n }): Promise<GetFungibleAssetMetadataResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args?.minimumLedgerVersion,\n processorType: ProcessorType.FUNGIBLE_ASSET_PROCESSOR,\n });\n return getFungibleAssetMetadata({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries the fungible asset metadata for a specific asset type.\n * This function helps retrieve detailed information about a fungible asset based on its type.\n *\n * @param args - The parameters for the query.\n * @param args.assetType - The asset type of the fungible asset, e.g., \"0x1::aptos_coin::AptosCoin\" for Aptos Coin.\n * @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.\n *\n * @returns A fungible asset metadata item.\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 fungible asset metadata by asset type\n * const fungibleAsset = await aptos.getFungibleAssetMetadataByAssetType({\n * assetType: \"0x1::aptos_coin::AptosCoin\" // replace with your asset type\n * });\n *\n * console.log(fungibleAsset);\n * }\n * runExample().catch(console.error);\n * ```\n * @group FungibleAsset\n */\n async getFungibleAssetMetadataByAssetType(args: {\n assetType: string;\n minimumLedgerVersion?: AnyNumber;\n }): Promise<GetFungibleAssetMetadataResponse[0]> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args?.minimumLedgerVersion,\n processorType: ProcessorType.FUNGIBLE_ASSET_PROCESSOR,\n });\n const data = await getFungibleAssetMetadata({\n aptosConfig: this.config,\n options: {\n where: {\n asset_type: { _eq: args.assetType },\n },\n },\n });\n\n return data[0];\n }\n\n /**\n * Retrieves fungible asset metadata based on the creator address.\n *\n * This function allows you to query metadata for a specific fungible asset created by a given address.\n *\n * @param args - The parameters for the query.\n * @param args.creatorAddress - The creator address of the fungible asset.\n * @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.\n *\n * @returns A fungible asset metadata item.\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 fungible asset metadata by creator address\n * const fungibleAsset = await aptos.getFungibleAssetMetadataByCreatorAddress({\n * creatorAddress: \"0x123\", // replace with a real creator address\n * });\n *\n * console.log(fungibleAsset);\n * }\n * runExample().catch(console.error);\n * ```\n * @group FungibleAsset\n */\n async getFungibleAssetMetadataByCreatorAddress(args: {\n creatorAddress: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n }): Promise<GetFungibleAssetMetadataResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args?.minimumLedgerVersion,\n processorType: ProcessorType.FUNGIBLE_ASSET_PROCESSOR,\n });\n const data = await getFungibleAssetMetadata({\n aptosConfig: this.config,\n options: {\n where: {\n creator_address: { _eq: AccountAddress.from(args.creatorAddress).toStringLong() },\n },\n },\n });\n\n return data;\n }\n\n /**\n * Queries all fungible asset activities and returns a list of their metadata.\n *\n * @param args Optional parameters for the query.\n * @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying.\n * @param args.options Optional configuration for pagination and filtering.\n * @returns A list of fungible asset metadata.\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 fungible asset activities\n * const fungibleAssetActivities = await aptos.getFungibleAssetActivities();\n * console.log(fungibleAssetActivities);\n * }\n * runExample().catch(console.error);\n * ```\n * @group FungibleAsset\n */\n async getFungibleAssetActivities(args?: {\n minimumLedgerVersion?: AnyNumber;\n options?: PaginationArgs & WhereArg<FungibleAssetActivitiesBoolExp>;\n }): Promise<GetFungibleAssetActivitiesResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args?.minimumLedgerVersion,\n processorType: ProcessorType.FUNGIBLE_ASSET_PROCESSOR,\n });\n return getFungibleAssetActivities({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries all fungible asset balances.\n *\n * @param args Optional parameters for the query.\n * @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying.\n * @param args.options Optional configuration for pagination and filtering.\n *\n * @returns A list of fungible asset metadata.\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 current fungible asset balances\n * const fungibleAssetBalances = await aptos.getCurrentFungibleAssetBalances();\n *\n * console.log(fungibleAssetBalances);\n * }\n * runExample().catch(console.error);\n * ```\n * @group FungibleAsset\n */\n async getCurrentFungibleAssetBalances(args?: {\n minimumLedgerVersion?: AnyNumber;\n options?: PaginationArgs & WhereArg<CurrentFungibleAssetBalancesBoolExp>;\n }): Promise<GetCurrentFungibleAssetBalancesResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args?.minimumLedgerVersion,\n processorType: ProcessorType.FUNGIBLE_ASSET_PROCESSOR,\n });\n return getCurrentFungibleAssetBalances({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Transfer a specified amount of fungible asset from the sender's primary store to the recipient's primary store.\n * This method allows you to transfer any fungible asset, including fungible tokens.\n *\n * @param args - The arguments for the transfer operation.\n * @param args.sender - The sender account.\n * @param args.fungibleAssetMetadataAddress - The fungible asset account address. For example, if you're transferring USDT,\n * this would be the USDT address.\n * @param args.recipient - The recipient account address.\n * @param args.amount - The number of assets to transfer.\n * @param args.options - Optional parameters for generating the transaction.\n *\n * @returns A SimpleTransaction that can be simulated or submitted to the chain.\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 * // Transfer fungible asset from sender to recipient\n * const transaction = await aptos.transferFungibleAsset({\n * sender: Account.generate(), // replace with a real sender account\n * fungibleAssetMetadataAddress: \"0x123\", // replace with a real fungible asset address\n * recipient: \"0x456\", // replace with a real recipient account\n * amount: 5\n * });\n *\n * console.log(transaction);\n * }\n * runExample().catch(console.error);\n * ```\n * @group FungibleAsset\n */\n async transferFungibleAsset(args: {\n sender: Account;\n fungibleAssetMetadataAddress: AccountAddressInput;\n recipient: AccountAddressInput;\n amount: AnyNumber;\n options?: InputGenerateTransactionOptions;\n }): Promise<SimpleTransaction> {\n return transferFungibleAsset({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Transfer a specified amount of fungible asset from the sender's any (primary or secondary) fungible store to any (primary or secondary) fungible store.\n * This method allows you to transfer any fungible asset, including fungible tokens.\n *\n * @param args - The arguments for the transfer operation.\n * @param args.sender - The sender account initiating the transfer.\n * @param args.fromStore - The fungible store address initiating the transfer.\n * @param args.toStore - The fungible store address receiving the asset.\n * @param args.amount - The number of assets to transfer. Must be a positive number.\n * @param args.options - Optional parameters for generating the transaction.\n *\n * @returns A SimpleTransaction that can be simulated or submitted to the chain.\n *\n * @throws Error if:\n * - The sender account is invalid\n * - The store addresses are invalid\n * - The amount is negative or zero\n * - The transaction fails to generate\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network, Account } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function transferAssets() {\n * // Transfer 100 units of the asset from senderStore to recipientStore\n * const transaction = await aptos.transferFungibleAssetBetweenStores({\n * sender: Account.generate(), // replace with a real sender account\n * fromStore: \"0x123\", // replace with a real fungible store address\n * toStore: \"0x456\", // replace with a real fungible store address\n * amount: 100\n * });\n *\n * console.log(transaction);\n * }\n *\n * transferAssets().catch(console.error);\n * ```\n * @group FungibleAsset\n */\n async transferFungibleAssetBetweenStores(args: {\n sender: Account;\n fromStore: AccountAddressInput;\n toStore: AccountAddressInput;\n amount: AnyNumber;\n options?: InputGenerateTransactionOptions;\n }): Promise<SimpleTransaction> {\n return transferFungibleAssetBetweenStores({ aptosConfig: this.config, ...args });\n }\n}\n"],"mappings":"AAWA,OACE,mCAAAA,EACA,8BAAAC,EACA,4BAAAC,EACA,yBAAAC,EACA,sCAAAC,MACK,4BAMP,OAAS,iBAAAC,MAAqB,iBAE9B,OAAS,2BAAAC,MAA+B,UAExC,OAAS,kBAAAC,MAA2C,UAQ7C,MAAMC,CAAc,CAwBzB,YAAqBC,EAAqB,CAArB,YAAAA,CAAsB,CA2B3C,MAAM,yBAAyBC,EAGe,CAC5C,aAAMJ,EAAwB,CAC5B,OAAQ,KAAK,OACb,qBAAsBI,GAAM,qBAC5B,cAAeL,EAAc,wBAC/B,CAAC,EACMH,EAAyB,CAAE,YAAa,KAAK,OAAQ,GAAGQ,CAAK,CAAC,CACvE,CA+BA,MAAM,oCAAoCA,EAGO,CAC/C,aAAMJ,EAAwB,CAC5B,OAAQ,KAAK,OACb,qBAAsBI,GAAM,qBAC5B,cAAeL,EAAc,wBAC/B,CAAC,GACY,MAAMH,EAAyB,CAC1C,YAAa,KAAK,OAClB,QAAS,CACP,MAAO,CACL,WAAY,CAAE,IAAKQ,EAAK,SAAU,CACpC,CACF,CACF,CAAC,GAEW,CAAC,CACf,CAgCA,MAAM,yCAAyCA,EAGD,CAC5C,aAAMJ,EAAwB,CAC5B,OAAQ,KAAK,OACb,qBAAsBI,GAAM,qBAC5B,cAAeL,EAAc,wBAC/B,CAAC,EACY,MAAMH,EAAyB,CAC1C,YAAa,KAAK,OAClB,QAAS,CACP,MAAO,CACL,gBAAiB,CAAE,IAAKK,EAAe,KAAKG,EAAK,cAAc,EAAE,aAAa,CAAE,CAClF,CACF,CACF,CAAC,CAGH,CA0BA,MAAM,2BAA2BA,EAGe,CAC9C,aAAMJ,EAAwB,CAC5B,OAAQ,KAAK,OACb,qBAAsBI,GAAM,qBAC5B,cAAeL,EAAc,wBAC/B,CAAC,EACMJ,EAA2B,CAAE,YAAa,KAAK,OAAQ,GAAGS,CAAK,CAAC,CACzE,CA4BA,MAAM,gCAAgCA,EAGe,CACnD,aAAMJ,EAAwB,CAC5B,OAAQ,KAAK,OACb,qBAAsBI,GAAM,qBAC5B,cAAeL,EAAc,wBAC/B,CAAC,EACML,EAAgC,CAAE,YAAa,KAAK,OAAQ,GAAGU,CAAK,CAAC,CAC9E,CAsCA,MAAM,sBAAsBA,EAMG,CAC7B,OAAOP,EAAsB,CAAE,YAAa,KAAK,OAAQ,GAAGO,CAAK,CAAC,CACpE,CA4CA,MAAM,mCAAmCA,EAMV,CAC7B,OAAON,EAAmC,CAAE,YAAa,KAAK,OAAQ,GAAGM,CAAK,CAAC,CACjF,CACF","names":["getCurrentFungibleAssetBalances","getFungibleAssetActivities","getFungibleAssetMetadata","transferFungibleAsset","transferFungibleAssetBetweenStores","ProcessorType","waitForIndexerOnVersion","AccountAddress","FungibleAsset","config","args"]}
@@ -1,4 +1,4 @@
1
- import { A as AptosConfig, dm as LedgerInfo, bN as AnyNumber, dn as Block, dc as MoveValue, b5 as InputViewFunctionData, c6 as LedgerVersionArg, b6 as InputViewFunctionJsonData } from '../account-ClxOwjdh.mjs';
1
+ import { A as AptosConfig, dm as LedgerInfo, bN as AnyNumber, dn as Block, dc as MoveValue, b5 as InputViewFunctionData, c6 as LedgerVersionArg, b6 as InputViewFunctionJsonData } from '../account-BortO8g2.mjs';
2
2
  import { GetChainTopUserTransactionsResponse, GraphqlQuery, GetProcessorStatusResponse } from '../types/indexer.mjs';
3
3
  import { ProcessorType } from '../utils/const.mjs';
4
4
  import '../utils/apiEndpoints.mjs';
@@ -1,2 +1,2 @@
1
- import{Dd as a}from"../chunk-DIGP2ALY.mjs";import"../chunk-5HXLZHDW.mjs";import"../chunk-GOXRBEIJ.mjs";import"../chunk-ROT6S6BM.mjs";import"../chunk-XJJVJOX5.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-G3MHXDYA.mjs";import"../chunk-HNBKTJPN.mjs";import"../chunk-V74WPKSY.mjs";import"../chunk-UYVPNUH3.mjs";import"../chunk-A5L76YP7.mjs";import"../chunk-XKUIMGKU.mjs";import"../chunk-N6YTF76Q.mjs";import"../chunk-ZP4DWSQA.mjs";import"../chunk-QREVMGQZ.mjs";import"../chunk-FGFLPH5K.mjs";import"../chunk-V3MBJJTL.mjs";import"../chunk-ES2KP6BS.mjs";import"../chunk-EM52Z7T7.mjs";import"../chunk-TGRLDWXV.mjs";import"../chunk-N3O3ULF7.mjs";import"../chunk-YOZBVVKL.mjs";import"../chunk-GMQCQDW4.mjs";import"../chunk-UL777LTI.mjs";import"../chunk-7ECCT6PK.mjs";import"../chunk-DNRUDMMV.mjs";import"../chunk-GFFKEZ56.mjs";import"../chunk-LWL57YFU.mjs";import"../chunk-HGLO5LDS.mjs";import"../chunk-CW35YAMN.mjs";import"../chunk-6WDVDEQZ.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-7DQDJ2SA.mjs";import"../chunk-HNBVYE3N.mjs";import"../chunk-RGKRCZ36.mjs";import"../chunk-FD6FGKYY.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-IJE2LVZG.mjs";import"../chunk-EBMEXURY.mjs";import"../chunk-STY74NUA.mjs";import"../chunk-IF4UU2MT.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-RCSJFTST.mjs";import"../chunk-4RXKALLC.mjs";import"../chunk-OLILO7VD.mjs";import"../chunk-5FI4545P.mjs";import"../chunk-KDMSOCZY.mjs";export{a as General};
1
+ import{getChainTopUserTransactions as e,getIndexerLastSuccessVersion as n,getLedgerInfo as s,getProcessorStatus as r,queryIndexer as t}from"../internal/general";import{getBlockByHeight as i,getBlockByVersion as a}from"../internal/transaction";import{view as c,viewJson as g}from"../internal/view";class v{constructor(o){this.config=o}async getLedgerInfo(){return s({aptosConfig:this.config})}async getChainId(){return(await this.getLedgerInfo()).chain_id}async getBlockByVersion(o){return a({aptosConfig:this.config,...o})}async getBlockByHeight(o){return i({aptosConfig:this.config,...o})}async view(o){return c({aptosConfig:this.config,...o})}async viewJson(o){return g({aptosConfig:this.config,...o})}async getChainTopUserTransactions(o){return e({aptosConfig:this.config,...o})}async queryIndexer(o){return t({aptosConfig:this.config,...o})}async getIndexerLastSuccessVersion(){return n({aptosConfig:this.config})}async getProcessorStatus(o){return r({aptosConfig:this.config,processorType:o})}}export{v as General};
2
2
  //# sourceMappingURL=general.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"sources":["../../../src/api/general.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { AptosConfig } from \"./aptosConfig\";\nimport {\n getChainTopUserTransactions,\n getIndexerLastSuccessVersion,\n getLedgerInfo,\n getProcessorStatus,\n queryIndexer,\n} from \"../internal/general\";\nimport { getBlockByHeight, getBlockByVersion } from \"../internal/transaction\";\nimport { view, viewJson } from \"../internal/view\";\nimport {\n AnyNumber,\n Block,\n GetChainTopUserTransactionsResponse,\n GetProcessorStatusResponse,\n GraphqlQuery,\n LedgerInfo,\n LedgerVersionArg,\n MoveValue,\n} from \"../types\";\nimport { ProcessorType } from \"../utils/const\";\nimport { InputViewFunctionData, InputViewFunctionJsonData } from \"../transactions\";\n\n/**\n * A class to query various Aptos-related information and perform operations on the Aptos blockchain.\n * @group General\n */\nexport class General {\n readonly config: AptosConfig;\n\n /**\n * Initializes a new instance of the Aptos client with the specified configuration.\n * This allows users to interact with the Aptos blockchain using the provided settings.\n *\n * @param config - The configuration settings for the Aptos client.\n * @param config.network - The network to connect to (e.g., TESTNET, MAINNET).\n * @param config.nodeUrl - The URL of the Aptos node to connect to.\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 the Aptos client\n * const config = new AptosConfig({\n * network: Network.TESTNET, // specify the network\n * nodeUrl: \"https://testnet.aptos.dev\" // specify the node URL\n * });\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 General\n */\n constructor(config: AptosConfig) {\n this.config = config;\n }\n\n /**\n * Queries for the Aptos ledger information.\n *\n * @returns The Aptos Ledger Info, which includes details such as chain ID, epoch, and ledger version.\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 the ledger information\n * const ledgerInfo = await aptos.getLedgerInfo();\n *\n * console.log(ledgerInfo);\n * }\n * runExample().catch(console.error);\n * ```\n * @group General\n */\n async getLedgerInfo(): Promise<LedgerInfo> {\n return getLedgerInfo({ aptosConfig: this.config });\n }\n\n /**\n * Retrieves the chain ID of the Aptos blockchain.\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 the chain ID\n * const chainId = await aptos.getChainId();\n * console.log(\"Chain ID:\", chainId);\n * }\n * runExample().catch(console.error);\n *\n * @returns The chain ID of the Aptos blockchain.\n * ```\n * @group General\n */\n async getChainId(): Promise<number> {\n const result = await this.getLedgerInfo();\n return result.chain_id;\n }\n\n /**\n * Retrieves block information by the specified ledger version.\n *\n * @param args - The arguments for retrieving the block.\n * @param args.ledgerVersion - The ledger version to lookup block information for.\n * @param args.options - Optional parameters for the request.\n * @param args.options.withTransactions - If set to true, include all transactions in the block.\n *\n * @returns Block information with optional 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 * // Retrieve block information for a specific ledger version\n * const block = await aptos.getBlockByVersion({ ledgerVersion: 5 });\n * console.log(block);\n * }\n * runExample().catch(console.error);\n * ```\n * @group General\n */\n async getBlockByVersion(args: {\n ledgerVersion: AnyNumber;\n options?: { withTransactions?: boolean };\n }): Promise<Block> {\n return getBlockByVersion({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Retrieve a block by its height, allowing for the inclusion of transactions if specified.\n *\n * @param args - The parameters for the block retrieval.\n * @param args.blockHeight - The block height to look up, starting at 0.\n * @param args.options - Optional settings for the retrieval.\n * @param args.options.withTransactions - If set to true, includes all transactions in the block.\n *\n * @returns The block with optional transactions included.\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 block at height 5, including transactions\n * const block = await aptos.getBlockByHeight({ blockHeight: 5, options: { withTransactions: true } });\n * console.log(block);\n * }\n * runExample().catch(console.error);\n * ```\n * @group General\n */\n async getBlockByHeight(args: { blockHeight: AnyNumber; options?: { withTransactions?: boolean } }): Promise<Block> {\n return getBlockByHeight({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries for a Move view function\n * @param args.payload Payload for the view function\n * @param args.options.ledgerVersion The ledger version to query, if not provided it will get the latest version\n *\n * @example\n * const data = await aptos.view({\n * payload: {\n * function: \"0x1::coin::balance\",\n * typeArguments: [\"0x1::aptos_coin::AptosCoin\"],\n * functionArguments: [accountAddress],\n * }\n * })\n *\n * @returns an array of Move values\n * @group General\n */\n async view<T extends Array<MoveValue>>(args: {\n payload: InputViewFunctionData;\n options?: LedgerVersionArg;\n }): Promise<T> {\n return view<T>({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries for a Move view function with JSON, this provides compatability with the old `aptos` package\n * @param args.payload Payload for the view function\n * @param args.options.ledgerVersion The ledger version to query, if not provided it will get the latest version\n *\n * @example\n * const data = await aptos.view({\n * payload: {\n * function: \"0x1::coin::balance\",\n * typeArguments: [\"0x1::aptos_coin::AptosCoin\"],\n * functionArguments: [accountAddress.toString()],\n * }\n * })\n *\n * @returns an array of Move values\n * @group General\n */\n async viewJson<T extends Array<MoveValue>>(args: {\n payload: InputViewFunctionJsonData;\n options?: LedgerVersionArg;\n }): Promise<T> {\n return viewJson<T>({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries the top user transactions based on the specified limit.\n *\n * @param args - The arguments for querying top user transactions.\n * @param args.limit - The number of transactions to return.\n * @returns GetChainTopUserTransactionsResponse\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 the top user transactions with a limit of 5\n * const topUserTransactions = await aptos.getChainTopUserTransactions({ limit: 5 });\n *\n * console.log(topUserTransactions);\n * }\n * runExample().catch(console.error);\n * ```\n * @group General\n */\n async getChainTopUserTransactions(args: { limit: number }): Promise<GetChainTopUserTransactionsResponse> {\n return getChainTopUserTransactions({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Retrieves data from the Aptos Indexer using a GraphQL query.\n * This function allows you to execute complex queries to fetch specific data from the Aptos blockchain.\n *\n * @param args.query.query - A GraphQL query string.\n * @param args.query.variables - The variables for the query (optional).\n *\n * @return The provided T 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 * // Querying the Aptos Indexer for ledger information\n * const topUserTransactions = await aptos.queryIndexer({\n * query: { query: `query MyQuery {\n * ledger_infos {\n * chain_id\n * }\n * }`}\n * });\n *\n * console.log(topUserTransactions);\n * }\n * runExample().catch(console.error);\n * ```\n * @group General\n */\n async queryIndexer<T extends {}>(args: { query: GraphqlQuery }): Promise<T> {\n return queryIndexer<T>({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Queries for the last successful indexer version, providing insight into the ledger version the indexer is updated to, which\n * may lag behind the full nodes.\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 last successful indexer version\n * const version = await aptos.getIndexerLastSuccessVersion();\n * console.log(`Last successful indexer version: ${version}`);\n * }\n * runExample().catch(console.error);\n * ```\n * @group General\n */\n async getIndexerLastSuccessVersion(): Promise<bigint> {\n return getIndexerLastSuccessVersion({ aptosConfig: this.config });\n }\n\n /**\n * Query the processor status for a specific processor type.\n *\n * @param processorType The processor type to query.\n * @returns The status of the specified processor 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 processor status for the account transactions processor\n * const status = await aptos.getProcessorStatus(\"account_transactions_processor\");\n * console.log(status);\n * }\n * runExample().catch(console.error);\n * ```\n * @group General\n */\n async getProcessorStatus(processorType: ProcessorType): Promise<GetProcessorStatusResponse[0]> {\n return getProcessorStatus({ aptosConfig: this.config, processorType });\n }\n}\n"],"mappings":"AAIA,OACE,+BAAAA,EACA,gCAAAC,EACA,iBAAAC,EACA,sBAAAC,EACA,gBAAAC,MACK,sBACP,OAAS,oBAAAC,EAAkB,qBAAAC,MAAyB,0BACpD,OAAS,QAAAC,EAAM,YAAAC,MAAgB,mBAkBxB,MAAMC,CAAQ,CA+BnB,YAAYC,EAAqB,CAC/B,KAAK,OAASA,CAChB,CAwBA,MAAM,eAAqC,CACzC,OAAOR,EAAc,CAAE,YAAa,KAAK,MAAO,CAAC,CACnD,CAuBA,MAAM,YAA8B,CAElC,OADe,MAAM,KAAK,cAAc,GAC1B,QAChB,CA4BA,MAAM,kBAAkBS,EAGL,CACjB,OAAOL,EAAkB,CACvB,YAAa,KAAK,OAClB,GAAGK,CACL,CAAC,CACH,CA4BA,MAAM,iBAAiBA,EAA4F,CACjH,OAAON,EAAiB,CAAE,YAAa,KAAK,OAAQ,GAAGM,CAAK,CAAC,CAC/D,CAmBA,MAAM,KAAiCA,EAGxB,CACb,OAAOJ,EAAQ,CAAE,YAAa,KAAK,OAAQ,GAAGI,CAAK,CAAC,CACtD,CAmBA,MAAM,SAAqCA,EAG5B,CACb,OAAOH,EAAY,CAAE,YAAa,KAAK,OAAQ,GAAGG,CAAK,CAAC,CAC1D,CA0BA,MAAM,4BAA4BA,EAAuE,CACvG,OAAOX,EAA4B,CACjC,YAAa,KAAK,OAClB,GAAGW,CACL,CAAC,CACH,CAkCA,MAAM,aAA2BA,EAA2C,CAC1E,OAAOP,EAAgB,CACrB,YAAa,KAAK,OAClB,GAAGO,CACL,CAAC,CACH,CAsBA,MAAM,8BAAgD,CACpD,OAAOV,EAA6B,CAAE,YAAa,KAAK,MAAO,CAAC,CAClE,CAwBA,MAAM,mBAAmBW,EAAsE,CAC7F,OAAOT,EAAmB,CAAE,YAAa,KAAK,OAAQ,cAAAS,CAAc,CAAC,CACvE,CACF","names":["getChainTopUserTransactions","getIndexerLastSuccessVersion","getLedgerInfo","getProcessorStatus","queryIndexer","getBlockByHeight","getBlockByVersion","view","viewJson","General","config","args","processorType"]}
@@ -1,10 +1,10 @@
1
1
  export { Aptos } from './aptos.mjs';
2
- export { A as AptosConfig } from '../account-ClxOwjdh.mjs';
2
+ export { A as AptosConfig } from '../account-BortO8g2.mjs';
3
3
  import './account.mjs';
4
4
  import '../types/indexer.mjs';
5
5
  import '../types/generated/operations.mjs';
6
6
  import '../types/generated/types.mjs';
7
- import '../Ed25519Account-8ETkcAk_.mjs';
7
+ import '../Ed25519Account-CPwej6wB.mjs';
8
8
  import '../core/crypto/types.mjs';
9
9
  import '../utils/apiEndpoints.mjs';
10
10
  import '../utils/const.mjs';
@@ -33,7 +33,7 @@ import '../transactions/management/accountSequenceNumber.mjs';
33
33
  import '../transactions/management/asyncQueue.mjs';
34
34
  import './table.mjs';
35
35
  import './keyless.mjs';
36
- import '../federatedKeyless-CUPEnP-W.mjs';
36
+ import '../federatedKeyless-CTzDAQTu.mjs';
37
37
  import '../core/crypto/ephemeral.mjs';
38
38
  import '../core/crypto/proof.mjs';
39
39
  import '../types/keyless.mjs';
@@ -1,2 +1,2 @@
1
- import{se as b}from"../chunk-DIGP2ALY.mjs";import"../chunk-5HXLZHDW.mjs";import"../chunk-GOXRBEIJ.mjs";import"../chunk-ROT6S6BM.mjs";import"../chunk-XJJVJOX5.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-G3MHXDYA.mjs";import"../chunk-HNBKTJPN.mjs";import"../chunk-V74WPKSY.mjs";import"../chunk-UYVPNUH3.mjs";import"../chunk-A5L76YP7.mjs";import"../chunk-XKUIMGKU.mjs";import"../chunk-N6YTF76Q.mjs";import"../chunk-ZP4DWSQA.mjs";import"../chunk-QREVMGQZ.mjs";import"../chunk-FGFLPH5K.mjs";import"../chunk-V3MBJJTL.mjs";import"../chunk-ES2KP6BS.mjs";import"../chunk-EM52Z7T7.mjs";import"../chunk-TGRLDWXV.mjs";import"../chunk-N3O3ULF7.mjs";import"../chunk-YOZBVVKL.mjs";import"../chunk-GMQCQDW4.mjs";import"../chunk-UL777LTI.mjs";import"../chunk-7ECCT6PK.mjs";import"../chunk-DNRUDMMV.mjs";import"../chunk-GFFKEZ56.mjs";import"../chunk-LWL57YFU.mjs";import"../chunk-HGLO5LDS.mjs";import"../chunk-CW35YAMN.mjs";import"../chunk-6WDVDEQZ.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-7DQDJ2SA.mjs";import"../chunk-HNBVYE3N.mjs";import"../chunk-RGKRCZ36.mjs";import"../chunk-FD6FGKYY.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-IJE2LVZG.mjs";import"../chunk-EBMEXURY.mjs";import"../chunk-STY74NUA.mjs";import"../chunk-IF4UU2MT.mjs";import"../chunk-56CNRT2K.mjs";import{a}from"../chunk-RCSJFTST.mjs";import"../chunk-4RXKALLC.mjs";import"../chunk-OLILO7VD.mjs";import"../chunk-5FI4545P.mjs";import"../chunk-KDMSOCZY.mjs";export{b as Aptos,a as AptosConfig};
1
+ export*from"./aptos";export*from"./aptosConfig";
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"sources":["../../../src/api/index.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nexport * from \"./aptos\";\nexport * from \"./aptosConfig\";\n"],"mappings":"AAGA,WAAc,UACd,WAAc","names":[]}
@@ -1,6 +1,6 @@
1
- import { A as AptosConfig, bp as HexInput, m as AccountAddressInput, aT as InputGenerateTransactionOptions, at as SimpleTransaction } from '../account-ClxOwjdh.mjs';
2
- import { l as ZeroKnowledgeSig } from '../federatedKeyless-CUPEnP-W.mjs';
3
- import { A as Account } from '../Ed25519Account-8ETkcAk_.mjs';
1
+ import { A as AptosConfig, bp as HexInput, m as AccountAddressInput, aT as InputGenerateTransactionOptions, at as SimpleTransaction } from '../account-BortO8g2.mjs';
2
+ import { l as ZeroKnowledgeSig } from '../federatedKeyless-CTzDAQTu.mjs';
3
+ import { A as Account } from '../Ed25519Account-CPwej6wB.mjs';
4
4
  import { EphemeralKeyPair } from '../account/EphemeralKeyPair.mjs';
5
5
  import { KeylessAccount } from '../account/KeylessAccount.mjs';
6
6
  import { ProofFetchCallback } from '../account/AbstractKeylessAccount.mjs';
@@ -1,2 +1,2 @@
1
- import{oe as a}from"../chunk-DIGP2ALY.mjs";import"../chunk-5HXLZHDW.mjs";import"../chunk-GOXRBEIJ.mjs";import"../chunk-ROT6S6BM.mjs";import"../chunk-XJJVJOX5.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-G3MHXDYA.mjs";import"../chunk-HNBKTJPN.mjs";import"../chunk-V74WPKSY.mjs";import"../chunk-UYVPNUH3.mjs";import"../chunk-A5L76YP7.mjs";import"../chunk-XKUIMGKU.mjs";import"../chunk-N6YTF76Q.mjs";import"../chunk-ZP4DWSQA.mjs";import"../chunk-QREVMGQZ.mjs";import"../chunk-FGFLPH5K.mjs";import"../chunk-V3MBJJTL.mjs";import"../chunk-ES2KP6BS.mjs";import"../chunk-EM52Z7T7.mjs";import"../chunk-TGRLDWXV.mjs";import"../chunk-N3O3ULF7.mjs";import"../chunk-YOZBVVKL.mjs";import"../chunk-GMQCQDW4.mjs";import"../chunk-UL777LTI.mjs";import"../chunk-7ECCT6PK.mjs";import"../chunk-DNRUDMMV.mjs";import"../chunk-GFFKEZ56.mjs";import"../chunk-LWL57YFU.mjs";import"../chunk-HGLO5LDS.mjs";import"../chunk-CW35YAMN.mjs";import"../chunk-6WDVDEQZ.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-7DQDJ2SA.mjs";import"../chunk-HNBVYE3N.mjs";import"../chunk-RGKRCZ36.mjs";import"../chunk-FD6FGKYY.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-IJE2LVZG.mjs";import"../chunk-EBMEXURY.mjs";import"../chunk-STY74NUA.mjs";import"../chunk-IF4UU2MT.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-RCSJFTST.mjs";import"../chunk-4RXKALLC.mjs";import"../chunk-OLILO7VD.mjs";import"../chunk-5FI4545P.mjs";import"../chunk-KDMSOCZY.mjs";export{a as Keyless};
1
+ import{deriveKeylessAccount as r,getPepper as t,getProof as o,updateFederatedKeylessJwkSetTransaction as s}from"../internal/keyless";class F{constructor(e){this.config=e}async getPepper(e){return t({aptosConfig:this.config,...e})}async getProof(e){return o({aptosConfig:this.config,...e})}async deriveKeylessAccount(e){return r({aptosConfig:this.config,...e})}async updateFederatedKeylessJwkSetTransaction(e){return s({aptosConfig:this.config,...e})}}export{F as Keyless};
2
2
  //# sourceMappingURL=keyless.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"sources":["../../../src/api/keyless.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Account, EphemeralKeyPair, KeylessAccount, ProofFetchCallback } from \"../account\";\nimport { FederatedKeylessAccount } from \"../account/FederatedKeylessAccount\";\nimport { AccountAddressInput, ZeroKnowledgeSig } from \"../core\";\nimport {\n deriveKeylessAccount,\n getPepper,\n getProof,\n updateFederatedKeylessJwkSetTransaction,\n} from \"../internal/keyless\";\nimport { InputGenerateTransactionOptions, SimpleTransaction } from \"../transactions\";\nimport { HexInput } from \"../types\";\nimport { AptosConfig } from \"./aptosConfig\";\n\n/**\n * A class to query all `Keyless` related queries on Aptos.\n *\n * More documentation on how to integrate Keyless Accounts see the below\n * [Aptos Keyless Integration Guide](https://aptos.dev/guides/keyless-accounts/#aptos-keyless-integration-guide).\n * @group Keyless\n */\nexport class Keyless {\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 connecting to the Aptos network.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * async function runExample() {\n * // Create a new configuration for the Aptos client\n * const config = new AptosConfig({ network: Network.TESTNET }); // Specify your desired network\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 Keyless\n */\n constructor(readonly config: AptosConfig) {}\n\n /**\n * Fetches the pepper from the Aptos pepper service API.\n *\n * @param args - The arguments for fetching the pepper.\n * @param args.jwt - JWT token.\n * @param args.ephemeralKeyPair - The EphemeralKeyPair used to generate the nonce in the JWT token.\n * @param args.derivationPath - A derivation path used for creating multiple accounts per user via the BIP-44 standard. Defaults\n * to \"m/44'/637'/0'/0'/0\".\n * @returns The pepper which is a Uint8Array of length 31.\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 * const ephemeralKeyPair = new EphemeralKeyPair(); // create a new ephemeral key pair\n * const jwt = \"your_jwt_token\"; // replace with a real JWT token\n *\n * // Fetching the pepper using the provided JWT and ephemeral key pair\n * const pepper = await aptos.getPepper({\n * jwt,\n * ephemeralKeyPair,\n * // derivationPath: \"m/44'/637'/0'/0'/0\" // specify your own if needed\n * });\n *\n * console.log(\"Fetched pepper:\", pepper);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Keyless\n */\n async getPepper(args: {\n jwt: string;\n ephemeralKeyPair: EphemeralKeyPair;\n derivationPath?: string;\n }): Promise<Uint8Array> {\n return getPepper({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Fetches a proof from the Aptos prover service API.\n *\n * @param args - The arguments for fetching the proof.\n * @param args.jwt - JWT token.\n * @param args.ephemeralKeyPair - The EphemeralKeyPair used to generate the nonce in the JWT token.\n * @param args.pepper - The pepper used for the account. If not provided, it will be fetched from the Aptos pepper service.\n * @param args.uidKey - A key in the JWT token to use to set the uidVal in the IdCommitment.\n *\n * @returns The proof which is represented by a ZeroKnowledgeSig.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network, EphemeralKeyPair, getPepper } 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 * const jwt = \"your_jwt_token\"; // replace with a real JWT token\n * const ephemeralKeyPair = new EphemeralKeyPair(); // create a new ephemeral key pair\n *\n * // Fetch the proof using the getProof function\n * const proof = await aptos.getProof({\n * jwt,\n * ephemeralKeyPair,\n * pepper: await getPepper({}), // fetch the pepper if not provided\n * uidKey: \"sub\", // specify the uid key\n * });\n *\n * console.log(\"Fetched proof:\", proof);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Keyless\n */\n async getProof(args: {\n jwt: string;\n ephemeralKeyPair: EphemeralKeyPair;\n pepper?: HexInput;\n uidKey?: string;\n }): Promise<ZeroKnowledgeSig> {\n return getProof({ aptosConfig: this.config, ...args });\n }\n\n async deriveKeylessAccount(args: {\n jwt: string;\n ephemeralKeyPair: EphemeralKeyPair;\n uidKey?: string;\n pepper?: HexInput;\n proofFetchCallback?: ProofFetchCallback;\n }): Promise<KeylessAccount>;\n\n async deriveKeylessAccount(args: {\n jwt: string;\n ephemeralKeyPair: EphemeralKeyPair;\n jwkAddress: AccountAddressInput;\n uidKey?: string;\n pepper?: HexInput;\n proofFetchCallback?: ProofFetchCallback;\n }): Promise<FederatedKeylessAccount>;\n\n /**\n * Derives a Keyless Account from the provided JWT token and corresponding EphemeralKeyPair. This function computes the proof\n * via the proving service and can fetch the pepper from the pepper service if not explicitly provided.\n *\n * @param args - The arguments required to derive the Keyless Account.\n * @param args.jwt - The JWT token used for deriving the account.\n * @param args.ephemeralKeyPair - The EphemeralKeyPair used to generate the nonce in the JWT token.\n * @param args.jwkAddress - The address the where the JWKs used to verify signatures are found. Setting the value derives a\n * FederatedKeylessAccount.\n * @param args.uidKey - An optional key in the JWT token to set the uidVal in the IdCommitment.\n * @param args.pepper - An optional pepper value.\n * @param args.proofFetchCallback - An optional callback function for fetching the proof in the background, allowing for a more\n * responsive user experience.\n *\n * @returns A KeylessAccount that can be used to sign transactions.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network, deriveKeylessAccount } 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 * const jwt = \"your_jwt_token\"; // replace with a real JWT token\n * const ephemeralKeyPair = new EphemeralKeyPair(); // create a new ephemeral key pair\n *\n * // Deriving the Keyless Account\n * const keylessAccount = await deriveKeylessAccount({\n * jwt,\n * ephemeralKeyPair,\n * uidKey: \"your_uid_key\", // optional\n * pepper: \"your_pepper\", // optional\n * });\n *\n * console.log(\"Keyless Account derived:\", keylessAccount);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Keyless\n */\n async deriveKeylessAccount(args: {\n jwt: string;\n ephemeralKeyPair: EphemeralKeyPair;\n jwkAddress?: AccountAddressInput;\n uidKey?: string;\n pepper?: HexInput;\n proofFetchCallback?: ProofFetchCallback;\n }): Promise<KeylessAccount | FederatedKeylessAccount> {\n return deriveKeylessAccount({ aptosConfig: this.config, ...args });\n }\n\n /**\n * This installs a set of FederatedJWKs at an address for a given iss.\n *\n * It will fetch the JSON Web Keyset (JWK) set from the well-known endpoint and update the FederatedJWKs at the sender's address\n * to reflect it.\n *\n * @param args.sender The account that will install the JWKs\n * @param args.iss the iss claim of the federated OIDC provider.\n * @param args.jwksUrl the URL to find the corresponding JWKs. For supported IDP providers this parameter in not necessary.\n *\n * @returns The pending transaction that results from submission.\n * @group Keyless\n */\n async updateFederatedKeylessJwkSetTransaction(args: {\n sender: Account;\n iss: string;\n jwksUrl?: string;\n options?: InputGenerateTransactionOptions;\n }): Promise<SimpleTransaction> {\n return updateFederatedKeylessJwkSetTransaction({ aptosConfig: this.config, ...args });\n }\n}\n"],"mappings":"AAMA,OACE,wBAAAA,EACA,aAAAC,EACA,YAAAC,EACA,2CAAAC,MACK,sBAYA,MAAMC,CAAQ,CAwBnB,YAAqBC,EAAqB,CAArB,YAAAA,CAAsB,CAoC3C,MAAM,UAAUC,EAIQ,CACtB,OAAOL,EAAU,CAAE,YAAa,KAAK,OAAQ,GAAGK,CAAK,CAAC,CACxD,CAsCA,MAAM,SAASA,EAKe,CAC5B,OAAOJ,EAAS,CAAE,YAAa,KAAK,OAAQ,GAAGI,CAAK,CAAC,CACvD,CA4DA,MAAM,qBAAqBA,EAO2B,CACpD,OAAON,EAAqB,CAAE,YAAa,KAAK,OAAQ,GAAGM,CAAK,CAAC,CACnE,CAeA,MAAM,wCAAwCA,EAKf,CAC7B,OAAOH,EAAwC,CAAE,YAAa,KAAK,OAAQ,GAAGG,CAAK,CAAC,CACtF,CACF","names":["deriveKeylessAccount","getPepper","getProof","updateFederatedKeylessJwkSetTransaction","Keyless","config","args"]}
@@ -1,5 +1,5 @@
1
1
  import { GetObjectDataQueryResponse } from '../types/indexer.mjs';
2
- import { A as AptosConfig, m as AccountAddressInput, bN as AnyNumber, bP as PaginationArgs, bS as OrderByArg } from '../account-ClxOwjdh.mjs';
2
+ import { A as AptosConfig, m as AccountAddressInput, bN as AnyNumber, bP as PaginationArgs, bS as OrderByArg } from '../account-BortO8g2.mjs';
3
3
  import '../types/generated/operations.mjs';
4
4
  import '../types/generated/types.mjs';
5
5
  import '../utils/apiEndpoints.mjs';
@@ -1,2 +1,2 @@
1
- import{re as a}from"../chunk-DIGP2ALY.mjs";import"../chunk-5HXLZHDW.mjs";import"../chunk-GOXRBEIJ.mjs";import"../chunk-ROT6S6BM.mjs";import"../chunk-XJJVJOX5.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-G3MHXDYA.mjs";import"../chunk-HNBKTJPN.mjs";import"../chunk-V74WPKSY.mjs";import"../chunk-UYVPNUH3.mjs";import"../chunk-A5L76YP7.mjs";import"../chunk-XKUIMGKU.mjs";import"../chunk-N6YTF76Q.mjs";import"../chunk-ZP4DWSQA.mjs";import"../chunk-QREVMGQZ.mjs";import"../chunk-FGFLPH5K.mjs";import"../chunk-V3MBJJTL.mjs";import"../chunk-ES2KP6BS.mjs";import"../chunk-EM52Z7T7.mjs";import"../chunk-TGRLDWXV.mjs";import"../chunk-N3O3ULF7.mjs";import"../chunk-YOZBVVKL.mjs";import"../chunk-GMQCQDW4.mjs";import"../chunk-UL777LTI.mjs";import"../chunk-7ECCT6PK.mjs";import"../chunk-DNRUDMMV.mjs";import"../chunk-GFFKEZ56.mjs";import"../chunk-LWL57YFU.mjs";import"../chunk-HGLO5LDS.mjs";import"../chunk-CW35YAMN.mjs";import"../chunk-6WDVDEQZ.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-7DQDJ2SA.mjs";import"../chunk-HNBVYE3N.mjs";import"../chunk-RGKRCZ36.mjs";import"../chunk-FD6FGKYY.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-IJE2LVZG.mjs";import"../chunk-EBMEXURY.mjs";import"../chunk-STY74NUA.mjs";import"../chunk-IF4UU2MT.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-RCSJFTST.mjs";import"../chunk-4RXKALLC.mjs";import"../chunk-OLILO7VD.mjs";import"../chunk-5FI4545P.mjs";import"../chunk-KDMSOCZY.mjs";export{a as AptosObject};
1
+ import{ProcessorType as r}from"../utils";import{waitForIndexerOnVersion as o}from"./utils";import{getObjectDataByObjectAddress as t}from"../internal/object";class y{constructor(e){this.config=e}async getObjectDataByObjectAddress(e){return await o({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:r.OBJECT_PROCESSOR}),t({aptosConfig:this.config,...e})}}export{y as AptosObject};
2
2
  //# sourceMappingURL=object.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"sources":["../../../src/api/object.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { AnyNumber, GetObjectDataQueryResponse, OrderByArg, PaginationArgs } from \"../types\";\nimport { AccountAddressInput } from \"../core\";\nimport { AptosConfig } from \"./aptosConfig\";\nimport { ProcessorType } from \"../utils\";\nimport { waitForIndexerOnVersion } from \"./utils\";\nimport { getObjectDataByObjectAddress } from \"../internal/object\";\n\n/**\n * A class to query all `Object` related queries on Aptos.\n * @group Object\n */\nexport class AptosObject {\n /**\n * Creates an instance of the Aptos client with the provided configuration.\n * This allows interaction with the Aptos blockchain using the specified 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 for funding accounts (optional).\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 the Aptos client\n * const config = new AptosConfig({\n * network: Network.TESTNET, // Specify the desired network\n * nodeUrl: \"https://testnet.aptos.dev\", // Replace with your node URL\n * });\n *\n * // Create an instance of the Aptos client\n * const aptos = new Aptos(config);\n *\n * console.log(\"Aptos client created successfully\", aptos);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Object\n */\n constructor(readonly config: AptosConfig) {}\n\n /**\n * Fetches the object data based on the specified object address.\n *\n * @param args.objectAddress - The object address to retrieve data for.\n * @param args.minimumLedgerVersion - Optional minimum ledger version to wait for.\n * @param args.options - Optional configuration options for pagination and ordering.\n *\n * @returns The object data corresponding to the provided 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 object data by object address\n * const objectData = await aptos.getObjectDataByObjectAddress({\n * objectAddress: \"0x1\", // replace with a real object address\n * });\n *\n * console.log(objectData);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Object\n */\n async getObjectDataByObjectAddress(args: {\n objectAddress: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n options?: PaginationArgs & OrderByArg<GetObjectDataQueryResponse[0]>;\n }): Promise<GetObjectDataQueryResponse[0]> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.OBJECT_PROCESSOR,\n });\n return getObjectDataByObjectAddress({\n aptosConfig: this.config,\n ...args,\n });\n }\n}\n"],"mappings":"AAMA,OAAS,iBAAAA,MAAqB,WAC9B,OAAS,2BAAAC,MAA+B,UACxC,OAAS,gCAAAC,MAAoC,qBAMtC,MAAMC,CAAY,CA8BvB,YAAqBC,EAAqB,CAArB,YAAAA,CAAsB,CA8B3C,MAAM,6BAA6BC,EAIQ,CACzC,aAAMJ,EAAwB,CAC5B,OAAQ,KAAK,OACb,qBAAsBI,EAAK,qBAC3B,cAAeL,EAAc,gBAC/B,CAAC,EACME,EAA6B,CAClC,YAAa,KAAK,OAClB,GAAGG,CACL,CAAC,CACH,CACF","names":["ProcessorType","waitForIndexerOnVersion","getObjectDataByObjectAddress","AptosObject","config","args"]}
@@ -1,5 +1,5 @@
1
1
  import { GetNumberOfDelegatorsResponse, GetDelegatedStakingActivitiesResponse } from '../types/indexer.mjs';
2
- import { A as AptosConfig, m as AccountAddressInput, bN as AnyNumber, bS as OrderByArg } from '../account-ClxOwjdh.mjs';
2
+ import { A as AptosConfig, m as AccountAddressInput, bN as AnyNumber, bS as OrderByArg } from '../account-BortO8g2.mjs';
3
3
  import '../types/generated/operations.mjs';
4
4
  import '../types/generated/types.mjs';
5
5
  import '../utils/apiEndpoints.mjs';
@@ -1,2 +1,2 @@
1
- import{ae as a}from"../chunk-DIGP2ALY.mjs";import"../chunk-5HXLZHDW.mjs";import"../chunk-GOXRBEIJ.mjs";import"../chunk-ROT6S6BM.mjs";import"../chunk-XJJVJOX5.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-G3MHXDYA.mjs";import"../chunk-HNBKTJPN.mjs";import"../chunk-V74WPKSY.mjs";import"../chunk-UYVPNUH3.mjs";import"../chunk-A5L76YP7.mjs";import"../chunk-XKUIMGKU.mjs";import"../chunk-N6YTF76Q.mjs";import"../chunk-ZP4DWSQA.mjs";import"../chunk-QREVMGQZ.mjs";import"../chunk-FGFLPH5K.mjs";import"../chunk-V3MBJJTL.mjs";import"../chunk-ES2KP6BS.mjs";import"../chunk-EM52Z7T7.mjs";import"../chunk-TGRLDWXV.mjs";import"../chunk-N3O3ULF7.mjs";import"../chunk-YOZBVVKL.mjs";import"../chunk-GMQCQDW4.mjs";import"../chunk-UL777LTI.mjs";import"../chunk-7ECCT6PK.mjs";import"../chunk-DNRUDMMV.mjs";import"../chunk-GFFKEZ56.mjs";import"../chunk-LWL57YFU.mjs";import"../chunk-HGLO5LDS.mjs";import"../chunk-CW35YAMN.mjs";import"../chunk-6WDVDEQZ.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-7DQDJ2SA.mjs";import"../chunk-HNBVYE3N.mjs";import"../chunk-RGKRCZ36.mjs";import"../chunk-FD6FGKYY.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-IJE2LVZG.mjs";import"../chunk-EBMEXURY.mjs";import"../chunk-STY74NUA.mjs";import"../chunk-IF4UU2MT.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-RCSJFTST.mjs";import"../chunk-4RXKALLC.mjs";import"../chunk-OLILO7VD.mjs";import"../chunk-5FI4545P.mjs";import"../chunk-KDMSOCZY.mjs";export{a as Staking};
1
+ import{getDelegatedStakingActivities as i,getNumberOfDelegators as s,getNumberOfDelegatorsForAllPools as t}from"../internal/staking";import{ProcessorType as o}from"../utils/const";import{waitForIndexerOnVersion as r}from"./utils";class S{constructor(e){this.config=e}async getNumberOfDelegators(e){return await r({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:o.STAKE_PROCESSOR}),s({aptosConfig:this.config,...e})}async getNumberOfDelegatorsForAllPools(e){return await r({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:o.STAKE_PROCESSOR}),t({aptosConfig:this.config,...e})}async getDelegatedStakingActivities(e){return await r({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:o.STAKE_PROCESSOR}),i({aptosConfig:this.config,...e})}}export{S as Staking};
2
2
  //# sourceMappingURL=staking.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"sources":["../../../src/api/staking.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n getDelegatedStakingActivities,\n getNumberOfDelegators,\n getNumberOfDelegatorsForAllPools,\n} from \"../internal/staking\";\nimport { AnyNumber, GetDelegatedStakingActivitiesResponse, GetNumberOfDelegatorsResponse, OrderByArg } from \"../types\";\nimport { AccountAddressInput } from \"../core\";\nimport { ProcessorType } from \"../utils/const\";\nimport { AptosConfig } from \"./aptosConfig\";\nimport { waitForIndexerOnVersion } from \"./utils\";\n\n/**\n * A class to query all `Staking` related queries on Aptos.\n * @group Staking\n */\nexport class Staking {\n /**\n * Creates an instance of the Aptos client with the specified configuration.\n * This allows you to interact with the Aptos blockchain using the provided settings.\n *\n * @param config - The configuration settings for the Aptos client.\n * @param config.network - The network to connect to (e.g., TESTNET, MAINNET).\n * @param config.nodeUrl - The URL of the Aptos node to connect to.\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 the Aptos client\n * const config = new AptosConfig({ network: Network.TESTNET }); // Specify your network\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 Staking\n */\n constructor(readonly config: AptosConfig) {}\n\n /**\n * Queries the current number of delegators in a specified pool. Throws an error if the pool is not found.\n *\n * @param args - The parameters for the query.\n * @param args.poolAddress - The address of the pool to query.\n * @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.\n * @returns The number of delegators for the given pool.\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 number of delegators for a specific pool\n * const delegators = await aptos.getNumberOfDelegators({ poolAddress: \"0x1\" }); // replace with a real pool address\n * console.log(`Number of delegators: ${delegators}`);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Staking\n */\n async getNumberOfDelegators(args: {\n poolAddress: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n }): Promise<number> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args?.minimumLedgerVersion,\n processorType: ProcessorType.STAKE_PROCESSOR,\n });\n return getNumberOfDelegators({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Retrieves the current number of delegators across all pools.\n *\n * @param args Optional parameters for the query.\n * @param args.minimumLedgerVersion Optional ledger version to sync up to before querying.\n * @param args.options Optional ordering options for the response.\n * @returns GetNumberOfDelegatorsForAllPoolsResponse response type containing the number of delegators per pool.\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 number of delegators for all pools\n * const delegators = await aptos.getNumberOfDelegatorsForAllPools();\n * console.log(delegators);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Staking\n */\n async getNumberOfDelegatorsForAllPools(args?: {\n minimumLedgerVersion?: AnyNumber;\n options?: OrderByArg<GetNumberOfDelegatorsResponse[0]>;\n }): Promise<GetNumberOfDelegatorsResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args?.minimumLedgerVersion,\n processorType: ProcessorType.STAKE_PROCESSOR,\n });\n return getNumberOfDelegatorsForAllPools({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries delegated staking activities for a specific delegator and pool.\n *\n * @param args - The arguments for querying delegated staking activities.\n * @param args.delegatorAddress - The address of the delegator.\n * @param args.poolAddress - The address of the staking pool.\n * @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.\n * @returns The response containing delegated staking activities.\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 delegated staking activities for a specific delegator and pool\n * const activities = await aptos.getDelegatedStakingActivities({\n * delegatorAddress: \"0x1\", // replace with a real delegator address\n * poolAddress: \"0x2\", // replace with a real pool address\n * minimumLedgerVersion: 1, // specify your own if needed\n * });\n *\n * console.log(activities);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Staking\n */\n async getDelegatedStakingActivities(args: {\n delegatorAddress: AccountAddressInput;\n poolAddress: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n }): Promise<GetDelegatedStakingActivitiesResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args?.minimumLedgerVersion,\n processorType: ProcessorType.STAKE_PROCESSOR,\n });\n return getDelegatedStakingActivities({ aptosConfig: this.config, ...args });\n }\n}\n"],"mappings":"AAGA,OACE,iCAAAA,EACA,yBAAAC,EACA,oCAAAC,MACK,sBAGP,OAAS,iBAAAC,MAAqB,iBAE9B,OAAS,2BAAAC,MAA+B,UAMjC,MAAMC,CAAQ,CA0BnB,YAAqBC,EAAqB,CAArB,YAAAA,CAAsB,CA0B3C,MAAM,sBAAsBC,EAGR,CAClB,aAAMH,EAAwB,CAC5B,OAAQ,KAAK,OACb,qBAAsBG,GAAM,qBAC5B,cAAeJ,EAAc,eAC/B,CAAC,EACMF,EAAsB,CAAE,YAAa,KAAK,OAAQ,GAAGM,CAAK,CAAC,CACpE,CA0BA,MAAM,iCAAiCA,EAGI,CACzC,aAAMH,EAAwB,CAC5B,OAAQ,KAAK,OACb,qBAAsBG,GAAM,qBAC5B,cAAeJ,EAAc,eAC/B,CAAC,EACMD,EAAiC,CAAE,YAAa,KAAK,OAAQ,GAAGK,CAAK,CAAC,CAC/E,CAgCA,MAAM,8BAA8BA,EAIe,CACjD,aAAMH,EAAwB,CAC5B,OAAQ,KAAK,OACb,qBAAsBG,GAAM,qBAC5B,cAAeJ,EAAc,eAC/B,CAAC,EACMH,EAA8B,CAAE,YAAa,KAAK,OAAQ,GAAGO,CAAK,CAAC,CAC5E,CACF","names":["getDelegatedStakingActivities","getNumberOfDelegators","getNumberOfDelegatorsForAllPools","ProcessorType","waitForIndexerOnVersion","Staking","config","args"]}
@@ -1,5 +1,5 @@
1
1
  import { GetTableItemsDataResponse, GetTableItemsMetadataResponse } from '../types/indexer.mjs';
2
- import { A as AptosConfig, dp as TableItemRequest, c6 as LedgerVersionArg, bN as AnyNumber, bP as PaginationArgs, bT as WhereArg, bS as OrderByArg } from '../account-ClxOwjdh.mjs';
2
+ import { A as AptosConfig, dp as TableItemRequest, c6 as LedgerVersionArg, bN as AnyNumber, bP as PaginationArgs, bT as WhereArg, bS as OrderByArg } from '../account-BortO8g2.mjs';
3
3
  import { TableItemsBoolExp, TableMetadatasBoolExp } from '../types/generated/types.mjs';
4
4
  import '../types/generated/operations.mjs';
5
5
  import '../utils/apiEndpoints.mjs';
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-ES2KP6BS.mjs";import"../chunk-EM52Z7T7.mjs";import"../chunk-TGRLDWXV.mjs";import"../chunk-N3O3ULF7.mjs";import"../chunk-YOZBVVKL.mjs";import"../chunk-GMQCQDW4.mjs";import"../chunk-UL777LTI.mjs";import"../chunk-7ECCT6PK.mjs";import"../chunk-DNRUDMMV.mjs";import"../chunk-GFFKEZ56.mjs";import"../chunk-LWL57YFU.mjs";import"../chunk-HGLO5LDS.mjs";import"../chunk-CW35YAMN.mjs";import"../chunk-6WDVDEQZ.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-7DQDJ2SA.mjs";import"../chunk-HNBVYE3N.mjs";import"../chunk-RGKRCZ36.mjs";import"../chunk-FD6FGKYY.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-IJE2LVZG.mjs";import"../chunk-EBMEXURY.mjs";import"../chunk-STY74NUA.mjs";import"../chunk-IF4UU2MT.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-4RXKALLC.mjs";import"../chunk-OLILO7VD.mjs";import"../chunk-5FI4545P.mjs";import"../chunk-KDMSOCZY.mjs";export{a as Table};
1
+ import{getTableItem as r,getTableItemsData as a,getTableItemsMetadata as s}from"../internal/table";import{ProcessorType as t}from"../utils";import{waitForIndexerOnVersion as o}from"./utils";class R{constructor(e){this.config=e}async getTableItem(e){return r({aptosConfig:this.config,...e})}async getTableItemsData(e){return await o({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:t.DEFAULT}),a({aptosConfig:this.config,...e})}async getTableItemsMetadata(e){return await o({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:t.DEFAULT}),s({aptosConfig:this.config,...e})}}export{R as Table};
2
2
  //# sourceMappingURL=table.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"sources":["../../../src/api/table.ts"],"sourcesContent":["import { getTableItem, getTableItemsData, getTableItemsMetadata } from \"../internal/table\";\nimport {\n TableItemRequest,\n LedgerVersionArg,\n AnyNumber,\n PaginationArgs,\n WhereArg,\n OrderByArg,\n GetTableItemsDataResponse,\n GetTableItemsMetadataResponse,\n} from \"../types\";\nimport { TableItemsBoolExp, TableMetadatasBoolExp } from \"../types/generated/types\";\nimport { ProcessorType } from \"../utils\";\nimport { AptosConfig } from \"./aptosConfig\";\nimport { waitForIndexerOnVersion } from \"./utils\";\n\n/**\n * A class to query all `Table` Aptos related queries.\n * @group Table\n */\nexport class Table {\n readonly config: AptosConfig;\n\n /**\n * Initializes a new instance of the Aptos client with the specified configuration.\n * This allows you to interact with the Aptos blockchain using the provided settings.\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 * // Create a new Aptos client with testnet configuration\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * console.log(\"Aptos client initialized:\", aptos);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Table\n */\n constructor(config: AptosConfig) {\n this.config = config;\n }\n\n /**\n * Queries for a specific item in a table identified by the handle and the key for the item.\n * This function allows you to retrieve structured data from a table in the Aptos blockchain.\n *\n * @param args.handle A pointer to where that table is stored.\n * @param args.data Object that describes the table item, including key and value types.\n * @param args.data.key_type The Move type of the table key.\n * @param args.data.value_type The Move type of the table value.\n * @param args.data.key The value of the table key.\n * @param args.options.ledgerVersion The ledger version to query; if not provided, it will get the latest version.\n *\n * @returns Table item value rendered in JSON.\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 a table item from the Aptos blockchain\n * const tableItem = await aptos.getTableItem({\n * handle: \"0x1b854694ae746cdbd8d44186ca4929b2b337df21d1c74633be19b2710552fdca\",\n * data: {\n * key_type: \"address\", // Move type of table key\n * value_type: \"u128\", // Move type of table value\n * key: \"0x619dc29a0aac8fa146714058e8dd6d2d0f3bdf5f6331907bf91f3acd81e6935\" // Value of table key\n * },\n * });\n *\n * console.log(tableItem);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Table\n */\n async getTableItem<T>(args: { handle: string; data: TableItemRequest; options?: LedgerVersionArg }): Promise<T> {\n return getTableItem<T>({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries for table items data with optional filtering and pagination.\n * This function allows you to retrieve specific data from a table based on provided criteria.\n *\n * @param args - The arguments for querying table items data.\n * @param args.minimumLedgerVersion - Optional minimum ledger version to wait for before querying.\n * @param args.options - Optional parameters for pagination and filtering.\n * @param args.options.where - Conditions to filter the response.\n * @param args.options.offset - The number of items to skip before starting to collect the result set.\n * @param args.options.limit - The maximum number of items to return.\n * @param args.options.orderBy - The criteria to order the results.\n *\n * Note: This query calls the indexer server.\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 table items data with specific filtering options\n * const data = await aptos.getTableItemsData({\n * minimumLedgerVersion: 1, // specify your own minimum ledger version if needed\n * options: {\n * where: {\n * table_handle: { _eq: \"0x1b854694ae746cdbd8d44186ca4929b2b337df21d1c74633be19b2710552fdca\" },\n * transaction_version: { _eq: \"0\" }\n * },\n * limit: 10, // specify your own limit if needed\n * },\n * });\n *\n * console.log(data);\n * }\n * runExample().catch(console.error);\n * ```\n *\n * @returns GetTableItemsDataResponse\n * @group Table\n */\n async getTableItemsData(args: {\n minimumLedgerVersion?: AnyNumber;\n options?: PaginationArgs & WhereArg<TableItemsBoolExp> & OrderByArg<GetTableItemsDataResponse[0]>;\n }): Promise<GetTableItemsDataResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.DEFAULT,\n });\n return getTableItemsData({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries for the metadata of table items, allowing for filtering and pagination.\n *\n * @param args - The parameters for the query.\n * @param args.minimumLedgerVersion - Optional minimum ledger version to wait for before querying.\n * @param args.options - Optional parameters for pagination and filtering.\n * @param args.options.where - Conditions to filter the response.\n * @param args.options.offset - The offset for pagination.\n * @param args.options.limit - The maximum number of items to return.\n * @param args.options.orderBy - The order in which to return the items.\n *\n * Note that this query calls the indexer server.\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 table items metadata with a filter condition\n * const data = await aptos.getTableItemsMetadata({\n * minimumLedgerVersion: 1, // specify your own minimum ledger version if needed\n * options: {\n * where: { handle: { _eq: \"0x1b854694ae746cdbd8d44186ca4929b2b337df21d1c74633be19b2710552fdca\" } },\n * limit: 10, // specify your own limit if needed\n * },\n * });\n *\n * console.log(data);\n * }\n * runExample().catch(console.error);\n * ```\n *\n * @returns GetTableItemsMetadataResponse\n * @group Table\n */\n async getTableItemsMetadata(args: {\n minimumLedgerVersion?: AnyNumber;\n options?: PaginationArgs & WhereArg<TableMetadatasBoolExp> & OrderByArg<GetTableItemsMetadataResponse[0]>;\n }): Promise<GetTableItemsMetadataResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.DEFAULT,\n });\n return getTableItemsMetadata({ aptosConfig: this.config, ...args });\n }\n}\n"],"mappings":"AAAA,OAAS,gBAAAA,EAAc,qBAAAC,EAAmB,yBAAAC,MAA6B,oBAYvE,OAAS,iBAAAC,MAAqB,WAE9B,OAAS,2BAAAC,MAA+B,UAMjC,MAAMC,CAAM,CAwBjB,YAAYC,EAAqB,CAC/B,KAAK,OAASA,CAChB,CAuCA,MAAM,aAAgBC,EAA0F,CAC9G,OAAOP,EAAgB,CAAE,YAAa,KAAK,OAAQ,GAAGO,CAAK,CAAC,CAC9D,CA4CA,MAAM,kBAAkBA,EAGe,CACrC,aAAMH,EAAwB,CAC5B,OAAQ,KAAK,OACb,qBAAsBG,EAAK,qBAC3B,cAAeJ,EAAc,OAC/B,CAAC,EACMF,EAAkB,CAAE,YAAa,KAAK,OAAQ,GAAGM,CAAK,CAAC,CAChE,CAwCA,MAAM,sBAAsBA,EAGe,CACzC,aAAMH,EAAwB,CAC5B,OAAQ,KAAK,OACb,qBAAsBG,EAAK,qBAC3B,cAAeJ,EAAc,OAC/B,CAAC,EACMD,EAAsB,CAAE,YAAa,KAAK,OAAQ,GAAGK,CAAK,CAAC,CACpE,CACF","names":["getTableItem","getTableItemsData","getTableItemsMetadata","ProcessorType","waitForIndexerOnVersion","Table","config","args"]}
@@ -1,6 +1,6 @@
1
- import { A as AptosConfig, bP as PaginationArgs, cc as TransactionResponse, bN as AnyNumber, bp as HexInput, du as WaitForTransactionOptions, cd as CommittedTransactionResponse, c7 as GasEstimation, bg as AnyRawTransaction, m as AccountAddressInput, aT as InputGenerateTransactionOptions, at as SimpleTransaction, r as Ed25519PrivateKey, G as AccountPublicKey, W as AccountAuthenticator, aX as InputGenerateTransactionPayloadData, bm as InputTransactionPluginData, cl as PendingTransactionResponse } from '../account-ClxOwjdh.mjs';
1
+ import { A as AptosConfig, bP as PaginationArgs, cc as TransactionResponse, bN as AnyNumber, bp as HexInput, du as WaitForTransactionOptions, cd as CommittedTransactionResponse, c7 as GasEstimation, bg as AnyRawTransaction, m as AccountAddressInput, aT as InputGenerateTransactionOptions, at as SimpleTransaction, r as Ed25519PrivateKey, G as AccountPublicKey, W as AccountAuthenticator, aX as InputGenerateTransactionPayloadData, bm as InputTransactionPluginData, cl as PendingTransactionResponse } from '../account-BortO8g2.mjs';
2
2
  import { FeePayerOrFeePayerAuthenticatorOrNeither } from '../internal/transactionSubmission.mjs';
3
- import { A as Account, b as Ed25519Account } from '../Ed25519Account-8ETkcAk_.mjs';
3
+ import { A as Account, b as Ed25519Account } from '../Ed25519Account-CPwej6wB.mjs';
4
4
  import { MultiEd25519Account } from '../account/MultiEd25519Account.mjs';
5
5
  import { Build } from './transactionSubmission/build.mjs';
6
6
  import { Simulate } from './transactionSubmission/simulate.mjs';
@@ -1,2 +1,2 @@
1
- import{je as a}from"../chunk-DIGP2ALY.mjs";import"../chunk-5HXLZHDW.mjs";import"../chunk-GOXRBEIJ.mjs";import"../chunk-ROT6S6BM.mjs";import"../chunk-XJJVJOX5.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-G3MHXDYA.mjs";import"../chunk-HNBKTJPN.mjs";import"../chunk-V74WPKSY.mjs";import"../chunk-UYVPNUH3.mjs";import"../chunk-A5L76YP7.mjs";import"../chunk-XKUIMGKU.mjs";import"../chunk-N6YTF76Q.mjs";import"../chunk-ZP4DWSQA.mjs";import"../chunk-QREVMGQZ.mjs";import"../chunk-FGFLPH5K.mjs";import"../chunk-V3MBJJTL.mjs";import"../chunk-ES2KP6BS.mjs";import"../chunk-EM52Z7T7.mjs";import"../chunk-TGRLDWXV.mjs";import"../chunk-N3O3ULF7.mjs";import"../chunk-YOZBVVKL.mjs";import"../chunk-GMQCQDW4.mjs";import"../chunk-UL777LTI.mjs";import"../chunk-7ECCT6PK.mjs";import"../chunk-DNRUDMMV.mjs";import"../chunk-GFFKEZ56.mjs";import"../chunk-LWL57YFU.mjs";import"../chunk-HGLO5LDS.mjs";import"../chunk-CW35YAMN.mjs";import"../chunk-6WDVDEQZ.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-7DQDJ2SA.mjs";import"../chunk-HNBVYE3N.mjs";import"../chunk-RGKRCZ36.mjs";import"../chunk-FD6FGKYY.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-IJE2LVZG.mjs";import"../chunk-EBMEXURY.mjs";import"../chunk-STY74NUA.mjs";import"../chunk-IF4UU2MT.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-RCSJFTST.mjs";import"../chunk-4RXKALLC.mjs";import"../chunk-OLILO7VD.mjs";import"../chunk-5FI4545P.mjs";import"../chunk-KDMSOCZY.mjs";export{a as Transaction};
1
+ import{getGasPriceEstimation as i,getTransactionByHash as e,getTransactionByVersion as r,getTransactions as s,isTransactionPending as c,waitForTransaction as u}from"../internal/transaction";import{getSigningMessage as g,publicPackageTransaction as p,signAndSubmitAsFeePayer as m,signAndSubmitTransaction as A,signAsFeePayer as y,signTransaction as f}from"../internal/transactionSubmission";import{Build as T}from"./transactionSubmission/build";import{Simulate as h}from"./transactionSubmission/simulate";import{Submit as d}from"./transactionSubmission/submit";import{TransactionManagement as P}from"./transactionSubmission/management";import{rotateAuthKey as l,rotateAuthKeyUnverified as b}from"../internal/account";class rn{constructor(n){this.config=n,this.build=new T(this.config),this.simulate=new h(this.config),this.submit=new d(this.config),this.batch=new P(this.config)}async getTransactions(n){return s({aptosConfig:this.config,...n})}async getTransactionByVersion(n){return r({aptosConfig:this.config,...n})}async getTransactionByHash(n){return e({aptosConfig:this.config,...n})}async isPendingTransaction(n){return c({aptosConfig:this.config,...n})}async waitForTransaction(n){return u({aptosConfig:this.config,...n})}async getGasPriceEstimation(){return i({aptosConfig:this.config})}getSigningMessage(n){return g(n)}async publishPackageTransaction(n){return p({aptosConfig:this.config,...n})}async rotateAuthKey(n){return l({aptosConfig:this.config,...n})}async rotateAuthKeyUnverified(n){return b({aptosConfig:this.config,...n})}sign(n){return f({...n})}signAsFeePayer(n){return y({...n})}async batchTransactionsForSingleAccount(n){try{const{sender:t,data:o,options:a}=n;this.batch.forSingleAccount({sender:t,data:o,options:a})}catch(t){throw new Error(`failed to submit transactions with error: ${t}`)}}async signAndSubmitTransaction(n){return A({aptosConfig:this.config,...n})}async signAndSubmitAsFeePayer(n){return m({aptosConfig:this.config,...n})}}export{rn as Transaction};
2
2
  //# sourceMappingURL=transaction.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"sources":["../../../src/api/transaction.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { AptosConfig } from \"./aptosConfig\";\nimport {\n getGasPriceEstimation,\n getTransactionByHash,\n getTransactionByVersion,\n getTransactions,\n isTransactionPending,\n waitForTransaction,\n} from \"../internal/transaction\";\nimport {\n AnyNumber,\n CommittedTransactionResponse,\n GasEstimation,\n HexInput,\n PaginationArgs,\n PendingTransactionResponse,\n TransactionResponse,\n WaitForTransactionOptions,\n} from \"../types\";\nimport {\n FeePayerOrFeePayerAuthenticatorOrNeither,\n getSigningMessage,\n publicPackageTransaction,\n signAndSubmitAsFeePayer,\n signAndSubmitTransaction,\n signAsFeePayer,\n signTransaction,\n} from \"../internal/transactionSubmission\";\nimport {\n AccountAuthenticator,\n AnyRawTransaction,\n InputGenerateTransactionOptions,\n InputGenerateTransactionPayloadData,\n InputTransactionPluginData,\n} from \"../transactions\";\nimport { AccountAddressInput, AccountPublicKey, AuthenticationKey, Ed25519PrivateKey } from \"../core\";\nimport { Account, Ed25519Account, MultiEd25519Account } from \"../account\";\nimport { Build } from \"./transactionSubmission/build\";\nimport { Simulate } from \"./transactionSubmission/simulate\";\nimport { Submit } from \"./transactionSubmission/submit\";\nimport { TransactionManagement } from \"./transactionSubmission/management\";\nimport { SimpleTransaction } from \"../transactions/instances/simpleTransaction\";\nimport { rotateAuthKey, rotateAuthKeyUnverified } from \"../internal/account\";\n\n/**\n * Represents a transaction in the Aptos blockchain,\n * providing methods to build, simulate, submit, and manage transactions.\n * This class encapsulates functionalities for querying transaction details,\n * estimating gas prices, signing transactions, and handling transaction states.\n *\n * This class is used as part of the Aptos object, so should be called like so:\n * @example\n * ```typescript\n * import { Account, Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const APTOS_COIN = \"0x1::aptos_coin::AptosCoin\";\n * const COIN_STORE = `0x1::coin::CoinStore<${APTOS_COIN}>`;\n * const ALICE_INITIAL_BALANCE = 100_000_000;\n * const TRANSFER_AMOUNT = 100;\n *\n * async function example() {\n * console.log(\n * \"This example will create two accounts (Alice and Bob), fund them, and transfer between them.\",\n * );\n *\n * // Set up the client\n * const config = new AptosConfig({ network: Network.DEVNET });\n * const aptos = new Aptos(config);\n *\n * // Generate two account credentials\n * // Each account has a private key, a public key, and an address\n * const alice = Account.generate();\n * const bob = Account.generate();\n *\n * console.log(\"=== Addresses ===\\n\");\n * console.log(`Alice's address is: ${alice.accountAddress}`);\n * console.log(`Bob's address is: ${bob.accountAddress}`);\n *\n * // Fund the accounts using a faucet\n * console.log(\"\\n=== Funding accounts ===\\n\");\n *\n * await aptos.fundAccount({\n * accountAddress: alice.accountAddress,\n * amount: ALICE_INITIAL_BALANCE,\n * });\n *\n * // Send a transaction from Alice's account to Bob's account\n * const txn = await aptos.transaction.build.simple({\n * sender: alice.accountAddress,\n * data: {\n * // All transactions on Aptos are implemented via smart contracts.\n * function: \"0x1::aptos_account::transfer\",\n * functionArguments: [bob.accountAddress, 100],\n * },\n * });\n *\n * console.log(\"\\n=== Transfer transaction ===\\n\");\n * // Both signs and submits\n * const committedTxn = await aptos.signAndSubmitTransaction({\n * signer: alice,\n * transaction: txn,\n * });\n * // Waits for Aptos to verify and execute the transaction\n * const executedTransaction = await aptos.waitForTransaction({\n * transactionHash: committedTxn.hash,\n * });\n * console.log(\"Transaction hash:\", executedTransaction.hash);\n *\n * console.log(\"\\n=== Balances after transfer ===\\n\");\n * const newAliceAccountBalance = await aptos.getAccountResource({\n * accountAddress: alice.accountAddress,\n * resourceType: COIN_STORE,\n * });\n * const newAliceBalance = Number(newAliceAccountBalance.coin.value);\n * console.log(`Alice's balance is: ${newAliceBalance}`);\n *\n * const newBobAccountBalance = await aptos.getAccountResource({\n * accountAddress: bob.accountAddress,\n * resourceType: COIN_STORE,\n * });\n * const newBobBalance = Number(newBobAccountBalance.coin.value);\n * console.log(`Bob's balance is: ${newBobBalance}`);\n * }\n *\n * example();\n * ```\n * @group Transaction\n */\nexport class Transaction {\n readonly config: AptosConfig;\n\n readonly build: Build;\n\n readonly simulate: Simulate;\n\n readonly submit: Submit;\n\n readonly batch: TransactionManagement;\n\n /**\n * Creates an instance of the Aptos client with the specified configuration.\n * This allows you to interact with the Aptos blockchain using the provided settings.\n *\n * @param config - The configuration settings for the Aptos client.\n * @param config.network - The network to connect to (e.g., Testnet, Mainnet).\n * @param config.nodeUrl - The URL of the Aptos node to connect to.\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 instance\n * const config = new AptosConfig({ network: Network.TESTNET }); // Specify the network\n * const aptos = new Aptos(config);\n *\n * console.log(\"Aptos client created successfully:\", aptos);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Transaction\n */\n constructor(config: AptosConfig) {\n this.config = config;\n this.build = new Build(this.config);\n this.simulate = new Simulate(this.config);\n this.submit = new Submit(this.config);\n this.batch = new TransactionManagement(this.config);\n }\n\n /**\n * Queries on-chain transactions, excluding pending transactions.\n * Use this function to retrieve historical transactions from the blockchain.\n *\n * @param args Optional parameters for pagination.\n * @param args.options Optional pagination options.\n * @param args.options.offset The number of the transaction to start with.\n * @param args.options.limit The number of results to return.\n *\n * @returns An array of on-chain 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 with pagination\n * const transactions = await aptos.getTransactions({\n * options: {\n * offset: 0, // Start from the first transaction\n * limit: 10, // Limit to 10 results\n * },\n * });\n *\n * console.log(transactions);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Transaction\n */\n async getTransactions(args?: { options?: PaginationArgs }): Promise<TransactionResponse[]> {\n return getTransactions({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Queries on-chain transaction by version. This function will not return pending transactions.\n *\n * @param args - The arguments for querying the transaction.\n * @param args.ledgerVersion - Transaction version is an unsigned 64-bit number.\n * @returns On-chain transaction. Only on-chain transactions have versions, so this\n * function cannot be used to query pending transactions.\n *\n * @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 transaction by its version\n * const transaction = await aptos.getTransactionByVersion({ ledgerVersion: 1 }); // replace 1 with a real version\n * console.log(transaction);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Transaction\n */\n async getTransactionByVersion(args: { ledgerVersion: AnyNumber }): Promise<TransactionResponse> {\n return getTransactionByVersion({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Queries on-chain transactions by their transaction hash, returning both pending and committed transactions.\n *\n * @param args - The arguments for querying the transaction.\n * @param args.transactionHash - The transaction hash should be a hex-encoded bytes string with a 0x prefix.\n * @returns The transaction from the mempool (pending) or the on-chain (committed) transaction.\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 a transaction by its hash\n * const transaction = await aptos.getTransactionByHash({ transactionHash: \"0x123\" }); // replace with a real transaction hash\n *\n * console.log(transaction);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Transaction\n */\n async getTransactionByHash(args: { transactionHash: HexInput }): Promise<TransactionResponse> {\n return getTransactionByHash({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Defines if the specified transaction is currently in a pending state.\n * This function helps you determine the status of a transaction using its hash.\n *\n * @param args - The arguments for the function.\n * @param args.transactionHash - A hash of the transaction in hexadecimal format.\n * @returns `true` if the transaction is in a pending state and `false` 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 * // Check if the transaction is pending using its hash\n * const isPendingTransaction = await aptos.isPendingTransaction({ transactionHash: \"0x123\" }); // replace with a real transaction hash\n * console.log(\"Is the transaction pending?\", isPendingTransaction);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Transaction\n */\n async isPendingTransaction(args: { transactionHash: HexInput }): Promise<boolean> {\n return isTransactionPending({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Waits for a transaction to move past the pending state and provides the transaction response.\n * There are 4 cases.\n * 1. Transaction is successfully processed and committed to the chain.\n * - The function will resolve with the transaction response from the API.\n * 2. Transaction is rejected for some reason, and is therefore not committed to the blockchain.\n * - The function will throw an AptosApiError with an HTTP status code indicating some problem with the request.\n * 3. Transaction is committed but execution failed, meaning no changes were\n * written to the blockchain state.\n * - If `checkSuccess` is true, the function will throw a FailedTransactionError\n * If `checkSuccess` is false, the function will resolve with the transaction response where the `success` field is false.\n * 4. Transaction does not move past the pending state within `args.options.timeoutSecs` seconds.\n * - The function will throw a WaitForTransactionError\n *\n * @param args.transactionHash - The hash of a transaction previously submitted to the blockchain.\n * @param args.options - Optional parameters for waiting behavior.\n * @param args.options.timeoutSecs - Timeout in seconds. Defaults to 20 seconds.\n * @param args.options.checkSuccess - A boolean which controls whether the function will error if the transaction failed.\n * Defaults to true.\n * @returns The transaction on-chain response.\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 * // Wait for a transaction to complete using its hash\n * const transactionHash = \"0x123\"; // replace with a real transaction hash\n * const transactionResponse = await aptos.waitForTransaction({\n * transactionHash,\n * options: {\n * timeoutSecs: 30, // specify your own timeout if needed\n * checkSuccess: true,\n * },\n * });\n *\n * console.log(transactionResponse);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Transaction\n */\n async waitForTransaction(args: {\n transactionHash: HexInput;\n options?: WaitForTransactionOptions;\n }): Promise<CommittedTransactionResponse> {\n return waitForTransaction({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Estimates the gas unit price required to process a transaction on the Aptos blockchain in a timely manner.\n * This helps users to understand the cost associated with their transactions.\n * {@link https://api.mainnet.aptoslabs.com/v1/spec#/operations/estimate_gas_price}\n *\n * @returns An object containing the estimated gas price.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET }); // Specify your network\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Getting the gas price estimation\n * const gasPriceEstimation = await aptos.getGasPriceEstimation();\n *\n * console.log(\"Estimated Gas Price:\", gasPriceEstimation);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Transaction\n */\n async getGasPriceEstimation(): Promise<GasEstimation> {\n return getGasPriceEstimation({\n aptosConfig: this.config,\n });\n }\n\n /**\n * Returns a signing message for a transaction, allowing a user to sign it using their preferred method before submission to the network.\n *\n * @param args - The arguments for obtaining the signing message.\n * @param args.transaction - A raw transaction for signing elsewhere.\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 * const transaction = await aptos.transaction.build.simple({\n * sender: \"0x1\", // replace with a real sender address\n * data: {\n * function: \"0x1::aptos_account::transfer\",\n * functionArguments: [\"0x2\", 100], // replace with a real destination address\n * },\n * });\n *\n * const message = await aptos.getSigningMessage({ transaction });\n * console.log(message);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Transaction\n */\n // eslint-disable-next-line class-methods-use-this\n getSigningMessage(args: { transaction: AnyRawTransaction }): Uint8Array {\n return getSigningMessage(args);\n }\n\n /**\n * Generates a transaction to publish a Move package to the blockchain.\n * This function helps you create a transaction that can be simulated or submitted to the chain for publishing a package.\n *\n * To get the `metadataBytes` and `byteCode`, can compile using Aptos CLI with command\n * `aptos move compile --save-metadata ...`,\n *\n * {@link https://aptos.dev/tutorials/your-first-dapp/#step-4-publish-a-move-module}\n *\n * @param args The arguments for publishing the package.\n * @param args.account The publisher account.\n * @param args.metadataBytes The package metadata bytes.\n * @param args.moduleBytecode An array of the bytecode of each module in the package in compiler output order.\n * @param args.options Optional settings for generating the transaction.\n *\n * @returns A SimpleTransaction that can be simulated or submitted to the chain.\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 * // Replace with a real account address\n * const account = \"0x1\";\n * const metadataBytes = \"0x...\"; // replace with real metadata bytes\n * const byteCode = \"0x...\"; // replace with real module bytecode\n *\n * const transaction = await aptos.publishPackageTransaction({\n * account,\n * metadataBytes,\n * moduleBytecode: [byteCode],\n * });\n *\n * console.log(transaction);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Transaction\n */\n async publishPackageTransaction(args: {\n account: AccountAddressInput;\n metadataBytes: HexInput;\n moduleBytecode: Array<HexInput>;\n options?: InputGenerateTransactionOptions;\n }): Promise<SimpleTransaction> {\n return publicPackageTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Rotates the authentication key for a given account. Once an account is rotated, only the new private key\n * or keyless signing scheme can be used to sign transactions for the account.\n *\n * @param args - The arguments for rotating the authentication key.\n * @param args.fromAccount - The account from which the authentication key will be rotated.\n * @param args.toAccount - (Optional) The target account to rotate to. Required if not using toNewPrivateKey.\n * @param args.toNewPrivateKey - (Optional) The new private key to rotate to. Required if not using toAccount.\n *\n * @remarks\n * This function supports three modes of rotation:\n * 1. Using a target Account object (toAccount)\n * 2. Using a new private key (toNewPrivateKey)\n *\n * For Ed25519 accounts, the function will use a challenge-based rotation that requires signatures from both the old and new keys.\n * For multi-key accounts like MultiEd25519Account, the function will use a challenge-based rotation that requires signatures from both keys.\n * For other account types, the function will use an unverified rotation that only requires the new public key.\n *\n * @returns SimpleTransaction that can be submitted to rotate the auth key\n *\n * @example\n * ```typescript\n * // Create and submit transaction to rotate the auth key\n * const transaction = await aptos.rotateAuthKey({\n * fromAccount,\n * toAccount: toAccount,\n * });\n *\n * // Sign and submit the transaction\n * const pendingTransaction = await aptos.signAndSubmitTransaction({\n * signer: fromAccount,\n * transaction,\n * });\n * ```\n * @group Transaction\n */\n async rotateAuthKey(\n args: {\n fromAccount: Account;\n options?: InputGenerateTransactionOptions;\n } & ({ toAccount: Ed25519Account | MultiEd25519Account } | { toNewPrivateKey: Ed25519PrivateKey }),\n ): Promise<SimpleTransaction> {\n return rotateAuthKey({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Rotates the authentication key for a given account without verifying the new key.\n *\n * Accounts with their auth key rotated via this function will be derivable via the `getAccountsForPublicKey` and\n * `deriveOwnedAccountsFromSigner` functions however the public key will be unverified (no proof of ownership). Thus\n * includeUnverified must be set to true to derive the account until the public key is verified via signing a transaction.\n *\n * @param args - The arguments for rotating the authentication key.\n * @param args.fromAccount - The account from which the authentication key will be rotated.\n * @param args.toNewPublicKey - The new public key to rotate to.\n *\n * @returns A simple transaction object that can be submitted to the network.\n *\n * @example\n * ```typescript\n * // Create and submit transaction to rotate the auth key\n * const transaction = await aptos.rotateAuthKeyUnverified({\n * fromAccount,\n * toNewPublicKey,\n * });\n *\n * // Sign and submit the transaction\n * const pendingTransaction = await aptos.signAndSubmitTransaction({\n * signer: fromAccount,\n * transaction,\n * });\n * ```\n * @group Transaction\n */\n async rotateAuthKeyUnverified(args: {\n fromAccount: Account;\n options?: InputGenerateTransactionOptions;\n toNewPublicKey: AccountPublicKey;\n }): Promise<SimpleTransaction> {\n return rotateAuthKeyUnverified({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Sign a transaction that can later be submitted to the chain.\n * This function is essential for ensuring the authenticity of the transaction by using the provided account's signing capabilities.\n *\n * @param args - The arguments for signing the transaction.\n * @param args.signer - The account that will sign the transaction.\n * @param args.transaction - A raw transaction to sign.\n *\n * @returns AccountAuthenticator - The authenticator for the signed transaction.\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 * const sender = Account.generate(); // Generate a new account for signing\n * const transaction = await aptos.transaction.build.simple({\n * sender: sender.accountAddress,\n * data: {\n * function: \"0x1::aptos_account::transfer\",\n * functionArguments: [ \"0x1\", 100 ], // replace with a real account address and amount\n * },\n * });\n *\n * const signedTransaction = await aptos.transaction.sign({\n * signer: sender,\n * transaction,\n * }); // Sign the transaction\n *\n * console.log(\"Signed Transaction:\", signedTransaction);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Transaction\n */\n // eslint-disable-next-line class-methods-use-this\n sign(args: { signer: Account; transaction: AnyRawTransaction }): AccountAuthenticator {\n return signTransaction({\n ...args,\n });\n }\n\n /**\n * Sign a transaction as a fee payer that can later be submitted to the chain.\n * This function ensures that the transaction is marked with the fee payer's address, allowing it to be processed correctly.\n *\n * @param args - The arguments for signing the transaction.\n * @param args.signer - The fee payer signer account.\n * @param args.transaction - A raw transaction to sign on. This transaction must include a `feePayerAddress` property.\n *\n * @returns AccountAuthenticator - The authenticator for the signed transaction.\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 * const sender = Account.generate(); // Generate a new account for the fee payer\n * const transaction = await aptos.transaction.build.simple({\n * // All transactions on Aptos are implemented via smart contracts.\n * function: \"0x1::aptos_account::transfer\",\n * functionArguments: [sender.accountAddress, 100],\n * feePayerAddress: sender.accountAddress, // Set the fee payer address\n * });\n *\n * const signedTransaction = await aptos.transaction.signAsFeePayer({\n * signer: sender,\n * transaction,\n * });\n *\n * console.log(\"Signed transaction as fee payer:\", signedTransaction);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Transaction\n */\n // eslint-disable-next-line class-methods-use-this\n signAsFeePayer(args: { signer: Account; transaction: AnyRawTransaction }): AccountAuthenticator {\n return signAsFeePayer({\n ...args,\n });\n }\n\n // TRANSACTION SUBMISSION //\n\n /**\n * @deprecated Prefer to use `aptos.transaction.batch.forSingleAccount()`\n *\n * Batch transactions for a single account by submitting multiple transaction payloads.\n * This function is useful for efficiently processing and submitting transactions that do not depend on each other, such as\n * batch funding or batch token minting.\n *\n * @param args - The arguments for batching transactions.\n * @param args.sender - The sender account to sign and submit the transactions.\n * @param args.data - An array of transaction payloads to be processed.\n * @param args.options - Optional. Transaction generation configurations (excluding accountSequenceNumber).\n *\n * @throws Error if any worker failure occurs during submission.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network, Account } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n * const sender = Account.generate(); // Generate a new account for sending transactions\n *\n * async function runExample() {\n * const transactions = [\n * { }, // Build your first transaction payload\n * { }, // Build your second transaction payload\n * ];\n *\n * // Batch transactions for the single account\n * await aptos.batchTransactionsForSingleAccount({\n * sender,\n * data: transactions,\n * });\n *\n * console.log(\"Batch transactions submitted successfully.\");\n * }\n * runExample().catch(console.error);\n * ```\n * @group Transaction\n */\n async batchTransactionsForSingleAccount(args: {\n sender: Account;\n data: InputGenerateTransactionPayloadData[];\n options?: Omit<InputGenerateTransactionOptions, \"accountSequenceNumber\">;\n }): Promise<void> {\n try {\n const { sender, data, options } = args;\n this.batch.forSingleAccount({ sender, data, options });\n } catch (error: any) {\n throw new Error(`failed to submit transactions with error: ${error}`);\n }\n }\n\n /**\n * Sign and submit a single signer transaction to the blockchain.\n * This function allows you to execute a transaction after signing it with the specified account.\n *\n * @param args The arguments for signing and submitting the transaction.\n * @param args.signer The signer account to sign the transaction.\n * @param args.transaction An instance of a RawTransaction, plus optional secondary/fee payer addresses.\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 * const sender = Account.generate(); // Generate a new account for sending the transaction\n * const transaction = await aptos.transaction.build.simple({\n * sender: sender.accountAddress,\n * data: {\n * function: \"0x1::aptos_account::transfer\",\n * functionArguments: [ \"0x1\", 100 ], // replace with a real account address\n * },\n * });\n *\n * // Sign and submit the transaction\n * const pendingTransaction = await aptos.signAndSubmitTransaction({\n * signer: sender,\n * transaction,\n * });\n *\n * console.log(pendingTransaction);\n * }\n * runExample().catch(console.error);\n * ```\n * @return PendingTransactionResponse\n * @group Transaction\n */\n async signAndSubmitTransaction(\n args: FeePayerOrFeePayerAuthenticatorOrNeither & {\n signer: Account;\n transaction: AnyRawTransaction;\n } & InputTransactionPluginData,\n ): Promise<PendingTransactionResponse> {\n return signAndSubmitTransaction({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Sign and submit a single signer transaction as the fee payer to chain given an authenticator by the sender of the transaction.\n *\n * @param args.feePayer The fee payer account to sign the transaction\n * @param args.senderAuthenticator The AccountAuthenticator signed by the sender of the transaction\n * @param args.transaction An instance of a RawTransaction, plus optional secondary/fee payer addresses\n *\n * @example\n * const transaction = await aptos.transaction.build.simple({sender: alice.accountAddress, feePayer: true ...})\n * const senderAuthenticator = alice.signTransactionWithAuthenticator(transaction)\n * const pendingTransaction = await aptos.signAndSubmitAsFeePayer({\n * senderAuthenticator,\n * feePayer: bob,\n * transaction,\n * })\n *\n * @return PendingTransactionResponse\n * @group Transaction\n */\n async signAndSubmitAsFeePayer(\n args: {\n feePayer: Account;\n senderAuthenticator: AccountAuthenticator;\n transaction: AnyRawTransaction;\n } & InputTransactionPluginData,\n ): Promise<PendingTransactionResponse> {\n return signAndSubmitAsFeePayer({\n aptosConfig: this.config,\n ...args,\n });\n }\n}\n"],"mappings":"AAIA,OACE,yBAAAA,EACA,wBAAAC,EACA,2BAAAC,EACA,mBAAAC,EACA,wBAAAC,EACA,sBAAAC,MACK,0BAWP,OAEE,qBAAAC,EACA,4BAAAC,EACA,2BAAAC,EACA,4BAAAC,EACA,kBAAAC,EACA,mBAAAC,MACK,oCAUP,OAAS,SAAAC,MAAa,gCACtB,OAAS,YAAAC,MAAgB,mCACzB,OAAS,UAAAC,MAAc,iCACvB,OAAS,yBAAAC,MAA6B,qCAEtC,OAAS,iBAAAC,EAAe,2BAAAC,MAA+B,sBAsFhD,MAAMC,EAAY,CAkCvB,YAAYC,EAAqB,CAC/B,KAAK,OAASA,EACd,KAAK,MAAQ,IAAIP,EAAM,KAAK,MAAM,EAClC,KAAK,SAAW,IAAIC,EAAS,KAAK,MAAM,EACxC,KAAK,OAAS,IAAIC,EAAO,KAAK,MAAM,EACpC,KAAK,MAAQ,IAAIC,EAAsB,KAAK,MAAM,CACpD,CAmCA,MAAM,gBAAgBK,EAAqE,CACzF,OAAOjB,EAAgB,CACrB,YAAa,KAAK,OAClB,GAAGiB,CACL,CAAC,CACH,CA0BA,MAAM,wBAAwBA,EAAkE,CAC9F,OAAOlB,EAAwB,CAC7B,YAAa,KAAK,OAClB,GAAGkB,CACL,CAAC,CACH,CA0BA,MAAM,qBAAqBA,EAAmE,CAC5F,OAAOnB,EAAqB,CAC1B,YAAa,KAAK,OAClB,GAAGmB,CACL,CAAC,CACH,CA0BA,MAAM,qBAAqBA,EAAuD,CAChF,OAAOhB,EAAqB,CAC1B,YAAa,KAAK,OAClB,GAAGgB,CACL,CAAC,CACH,CA+CA,MAAM,mBAAmBA,EAGiB,CACxC,OAAOf,EAAmB,CACxB,YAAa,KAAK,OAClB,GAAGe,CACL,CAAC,CACH,CA0BA,MAAM,uBAAgD,CACpD,OAAOpB,EAAsB,CAC3B,YAAa,KAAK,MACpB,CAAC,CACH,CAgCA,kBAAkBoB,EAAsD,CACtE,OAAOd,EAAkBc,CAAI,CAC/B,CA4CA,MAAM,0BAA0BA,EAKD,CAC7B,OAAOb,EAAyB,CAAE,YAAa,KAAK,OAAQ,GAAGa,CAAK,CAAC,CACvE,CAsCA,MAAM,cACJA,EAI4B,CAC5B,OAAOJ,EAAc,CAAE,YAAa,KAAK,OAAQ,GAAGI,CAAK,CAAC,CAC5D,CA+BA,MAAM,wBAAwBA,EAIC,CAC7B,OAAOH,EAAwB,CAAE,YAAa,KAAK,OAAQ,GAAGG,CAAK,CAAC,CACtE,CAyCA,KAAKA,EAAiF,CACpF,OAAOT,EAAgB,CACrB,GAAGS,CACL,CAAC,CACH,CAwCA,eAAeA,EAAiF,CAC9F,OAAOV,EAAe,CACpB,GAAGU,CACL,CAAC,CACH,CA4CA,MAAM,kCAAkCA,EAItB,CAChB,GAAI,CACF,KAAM,CAAE,OAAAC,EAAQ,KAAAC,EAAM,QAAAC,CAAQ,EAAIH,EAClC,KAAK,MAAM,iBAAiB,CAAE,OAAAC,EAAQ,KAAAC,EAAM,QAAAC,CAAQ,CAAC,CACvD,OAASC,EAAY,CACnB,MAAM,IAAI,MAAM,6CAA6CA,CAAK,EAAE,CACtE,CACF,CAwCA,MAAM,yBACJJ,EAIqC,CACrC,OAAOX,EAAyB,CAC9B,YAAa,KAAK,OAClB,GAAGW,CACL,CAAC,CACH,CAqBA,MAAM,wBACJA,EAKqC,CACrC,OAAOZ,EAAwB,CAC7B,YAAa,KAAK,OAClB,GAAGY,CACL,CAAC,CACH,CACF","names":["getGasPriceEstimation","getTransactionByHash","getTransactionByVersion","getTransactions","isTransactionPending","waitForTransaction","getSigningMessage","publicPackageTransaction","signAndSubmitAsFeePayer","signAndSubmitTransaction","signAsFeePayer","signTransaction","Build","Simulate","Submit","TransactionManagement","rotateAuthKey","rotateAuthKeyUnverified","Transaction","config","args","sender","data","options","error"]}
@@ -1,4 +1,4 @@
1
- import { A as AptosConfig, m as AccountAddressInput, aX as InputGenerateTransactionPayloadData, aT as InputGenerateTransactionOptions, at as SimpleTransaction, au as MultiAgentTransaction } from '../../account-ClxOwjdh.mjs';
1
+ import { A as AptosConfig, m as AccountAddressInput, aX as InputGenerateTransactionPayloadData, aT as InputGenerateTransactionOptions, at as SimpleTransaction, au as MultiAgentTransaction } from '../../account-BortO8g2.mjs';
2
2
  import '../../types/indexer.mjs';
3
3
  import '../../types/generated/operations.mjs';
4
4
  import '../../types/generated/types.mjs';
@@ -1,2 +1,2 @@
1
- import{be as a}from"../../chunk-DIGP2ALY.mjs";import"../../chunk-5HXLZHDW.mjs";import"../../chunk-GOXRBEIJ.mjs";import"../../chunk-ROT6S6BM.mjs";import"../../chunk-XJJVJOX5.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-G3MHXDYA.mjs";import"../../chunk-HNBKTJPN.mjs";import"../../chunk-V74WPKSY.mjs";import"../../chunk-UYVPNUH3.mjs";import"../../chunk-A5L76YP7.mjs";import"../../chunk-XKUIMGKU.mjs";import"../../chunk-N6YTF76Q.mjs";import"../../chunk-ZP4DWSQA.mjs";import"../../chunk-QREVMGQZ.mjs";import"../../chunk-FGFLPH5K.mjs";import"../../chunk-V3MBJJTL.mjs";import"../../chunk-ES2KP6BS.mjs";import"../../chunk-EM52Z7T7.mjs";import"../../chunk-TGRLDWXV.mjs";import"../../chunk-N3O3ULF7.mjs";import"../../chunk-YOZBVVKL.mjs";import"../../chunk-GMQCQDW4.mjs";import"../../chunk-UL777LTI.mjs";import"../../chunk-7ECCT6PK.mjs";import"../../chunk-DNRUDMMV.mjs";import"../../chunk-GFFKEZ56.mjs";import"../../chunk-LWL57YFU.mjs";import"../../chunk-HGLO5LDS.mjs";import"../../chunk-CW35YAMN.mjs";import"../../chunk-6WDVDEQZ.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-7DQDJ2SA.mjs";import"../../chunk-HNBVYE3N.mjs";import"../../chunk-RGKRCZ36.mjs";import"../../chunk-FD6FGKYY.mjs";import"../../chunk-4WPQQPUF.mjs";import"../../chunk-IJE2LVZG.mjs";import"../../chunk-EBMEXURY.mjs";import"../../chunk-STY74NUA.mjs";import"../../chunk-IF4UU2MT.mjs";import"../../chunk-56CNRT2K.mjs";import"../../chunk-RCSJFTST.mjs";import"../../chunk-4RXKALLC.mjs";import"../../chunk-OLILO7VD.mjs";import"../../chunk-5FI4545P.mjs";import"../../chunk-KDMSOCZY.mjs";export{a as Build};
1
+ import{generateTransaction as t}from"../../internal/transactionSubmission";class g{constructor(n){this.config=n}async simple(n){return t({aptosConfig:this.config,...n})}async multiAgent(n){return t({aptosConfig:this.config,...n})}}export{g as Build};
2
2
  //# sourceMappingURL=build.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"sources":["../../../../src/api/transactionSubmission/build.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { AccountAddressInput } from \"../../core\";\nimport { generateTransaction } from \"../../internal/transactionSubmission\";\nimport {\n InputGenerateTransactionPayloadData,\n InputGenerateTransactionOptions,\n InputGenerateOrderlessTransactionOptions,\n} from \"../../transactions\";\nimport { MultiAgentTransaction } from \"../../transactions/instances/multiAgentTransaction\";\nimport { SimpleTransaction } from \"../../transactions/instances/simpleTransaction\";\nimport { AptosConfig } from \"../aptosConfig\";\n\n/**\n * A class to handle all `Build` transaction operations.\n * @group Implementation\n */\nexport class Build {\n readonly config: AptosConfig;\n\n /**\n * Initializes a new instance of the Aptos client with the specified configuration.\n * This allows you to interact with the Aptos blockchain using the provided settings.\n *\n * @param config - The configuration settings for the Aptos client.\n * @param config.network - The network to connect to (e.g., TESTNET, MAINNET).\n * @param config.nodeUrl - The URL of the Aptos node to connect to.\n * @param config.account - The account details for authentication.\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 the Aptos client\n * const config = new AptosConfig({\n * network: Network.TESTNET, // specify the network\n * nodeUrl: \"https://testnet.aptos.dev\", // specify the node URL\n * });\n *\n * // Initialize the Aptos client\n * const aptos = new Aptos(config);\n *\n * console.log(\"Aptos client initialized:\", aptos);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Implementation\n */\n constructor(config: AptosConfig) {\n this.config = config;\n }\n\n /**\n * Build a simple transaction.\n *\n * This function allows you to create a transaction with specified sender and data.\n *\n * @param args.sender - The sender account address.\n * @param args.data - The transaction data.\n * @param args.options - Optional transaction configurations.\n * @param args.withFeePayer - Whether there is a fee payer for 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 * // Build a simple transaction\n * const transaction = await aptos.transaction.simple({\n * sender: \"0x1\", // replace with a real sender account address\n * data: {\n * function: \"0x1::aptos_account::transfer\",\n * functionArguments: [\"0x2\", 100], // replace with a real destination account address\n * },\n * options: {\n * gasUnitPrice: 100, // specify your own gas unit price if needed\n * maxGasAmount: 1000, // specify your own max gas amount if needed\n * },\n * });\n *\n * console.log(transaction);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Implementation\n */\n async simple(args: {\n sender: AccountAddressInput;\n data: InputGenerateTransactionPayloadData;\n options?: InputGenerateTransactionOptions;\n withFeePayer?: boolean;\n }): Promise<SimpleTransaction> {\n return generateTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Build a multi-agent transaction that allows multiple signers to authorize a transaction.\n *\n * @param args - The parameters for creating the multi-agent transaction.\n * @param args.sender - The sender account address.\n * @param args.data - The transaction data.\n * @param args.secondarySignerAddresses - An array of the secondary signers' account addresses.\n * @param args.options - Optional transaction configurations.\n * @param args.withFeePayer - Whether there is a fee payer for the transaction.\n *\n * @returns MultiAgentTransaction\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 * // Build a multi-agent transaction\n * const transaction = await aptos.multiAgent({\n * sender: \"0x1\", // replace with a real sender account address\n * data: {\n * // Transaction data structure\n * function: \"0x1::aptos_account::transfer\",\n * functionArguments: [\"0x2\", 100], // replace with a real destination account address and amount\n * },\n * secondarySignerAddresses: [\"0x3\", \"0x4\"], // replace with real secondary signer addresses\n * options: {\n * // Optional transaction configurations\n * maxGasAmount: \"1000\",\n * gasUnitPrice: \"1\",\n * },\n * });\n *\n * console.log(transaction);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Implementation\n */\n async multiAgent(args: {\n sender: AccountAddressInput;\n data: InputGenerateTransactionPayloadData;\n secondarySignerAddresses: AccountAddressInput[];\n options?: InputGenerateTransactionOptions;\n withFeePayer?: boolean;\n }): Promise<MultiAgentTransaction> {\n return generateTransaction({ aptosConfig: this.config, ...args });\n }\n}\n"],"mappings":"AAIA,OAAS,uBAAAA,MAA2B,uCAc7B,MAAMC,CAAM,CAgCjB,YAAYC,EAAqB,CAC/B,KAAK,OAASA,CAChB,CAyCA,MAAM,OAAOC,EAKkB,CAC7B,OAAOH,EAAoB,CAAE,YAAa,KAAK,OAAQ,GAAGG,CAAK,CAAC,CAClE,CA4CA,MAAM,WAAWA,EAMkB,CACjC,OAAOH,EAAoB,CAAE,YAAa,KAAK,OAAQ,GAAGG,CAAK,CAAC,CAClE,CACF","names":["generateTransaction","Build","config","args"]}
@@ -1,4 +1,4 @@
1
- import { A as AptosConfig, bg as AnyRawTransaction, W as AccountAuthenticator, bm as InputTransactionPluginData } from '../../account-ClxOwjdh.mjs';
1
+ import { A as AptosConfig, bg as AnyRawTransaction, W as AccountAuthenticator, bm as InputTransactionPluginData } from '../../account-BortO8g2.mjs';
2
2
  import '../../types/indexer.mjs';
3
3
  import '../../types/generated/operations.mjs';
4
4
  import '../../types/generated/types.mjs';
@@ -1,2 +1,2 @@
1
- import{a,b}from"../../chunk-QREVMGQZ.mjs";import"../../chunk-KDMSOCZY.mjs";export{b as ValidateFeePayerDataOnSimulation,a as validateFeePayerDataOnSubmission};
1
+ function y(a,t){if(!(a.getTransactionSubmitter()!==void 0||t.transactionSubmitter!==void 0)&&t.transaction.feePayerAddress&&!t.feePayerAuthenticator)throw new Error("You are submitting a Fee Payer transaction but missing the feePayerAuthenticator")}function A(a,t,n){const e=n.value;return n.value=async function(...r){return e.apply(this,r)},n}export{A as ValidateFeePayerDataOnSimulation,y as validateFeePayerDataOnSubmission};
2
2
  //# sourceMappingURL=helpers.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"sources":["../../../../src/api/transactionSubmission/helpers.ts"],"sourcesContent":["import { AccountAuthenticator, AnyRawTransaction, InputTransactionPluginData } from \"../../transactions\";\nimport { AptosConfig } from \"../aptosConfig\";\n\n/**\n * Validates the fee payer data when submitting a transaction to ensure that the fee\n * payer authenticator is provided if a fee payer address is specified. This helps\n * prevent errors in transaction submission related to fee payer authentication.\n *\n * The validation is skipped if a custom transaction submitter is defined.\n *\n * @param config - The Aptos configuration that may contain a transaction submitter.\n * @param args - The method arguments containing transaction data and optional transaction submitter.\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 * class TransactionHandler {\n * async submitTransaction(methodArgs: { transaction: { feePayerAddress: string }, feePayerAuthenticator?: string }) {\n * validateFeePayerDataOnSubmission(this.config, methodArgs);\n * // Logic to submit the transaction\n * }\n * }\n *\n * async function runExample() {\n * const handler = new TransactionHandler();\n *\n * // Attempt to submit a transaction without a fee payer authenticator\n * try {\n * await handler.submitTransaction({\n * transaction: { feePayerAddress: \"0x1\" }, // replace with a real fee payer address\n * });\n * } catch (error) {\n * console.error(error.message); // Should log the error message\n * }\n *\n * // Submit a transaction with a fee payer authenticator\n * await handler.submitTransaction({\n * transaction: { feePayerAddress: \"0x1\" }, // replace with a real fee payer address\n * feePayerAuthenticator: \"authenticatorValue\", // replace with a real authenticator\n * });\n *\n * console.log(\"Transaction submitted successfully.\");\n * }\n * runExample().catch(console.error);\n * ```\n * @group Implementation\n */\nexport function validateFeePayerDataOnSubmission(\n config: AptosConfig,\n args: {\n transaction: AnyRawTransaction;\n senderAuthenticator: AccountAuthenticator;\n feePayerAuthenticator?: AccountAuthenticator;\n } & InputTransactionPluginData,\n): void {\n // Skip validation if a transaction submitter is defined.\n if (config.getTransactionSubmitter() !== undefined || args.transactionSubmitter !== undefined) {\n return;\n }\n\n if (args.transaction.feePayerAddress && !args.feePayerAuthenticator) {\n throw new Error(\"You are submitting a Fee Payer transaction but missing the feePayerAuthenticator\");\n }\n}\n\n/**\n * Validates that the fee payer public key is provided when simulating a Fee Payer transaction.\n * This ensures that all necessary data is present for the simulation to proceed correctly.\n *\n * @param target - The target object where the method is defined.\n * @param propertyKey - The name of the method being decorated.\n * @param descriptor - The property descriptor for the method.\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 * const methodArgs = {\n * transaction: {\n * feePayerAddress: \"0x1\", // replace with a real fee payer address\n * },\n * feePayerPublicKey: undefined, // missing fee payer public key\n * };\n *\n * try {\n * // This will throw an error due to missing feePayerPublicKey\n * await aptos.someMethod(methodArgs);\n * } catch (error) {\n * console.error(error.message); // Output the error message\n * }\n * }\n * runExample().catch(console.error);\n * ```\n * @group Implementation\n */\nexport function ValidateFeePayerDataOnSimulation(target: unknown, propertyKey: string, descriptor: PropertyDescriptor) {\n const originalMethod = descriptor.value;\n /* eslint-disable-next-line func-names, no-param-reassign */\n descriptor.value = async function (...args: any[]) {\n return originalMethod.apply(this, args);\n };\n\n return descriptor;\n}\n"],"mappings":"AAmDO,SAASA,EACdC,EACAC,EAKM,CAEN,GAAI,EAAAD,EAAO,wBAAwB,IAAM,QAAaC,EAAK,uBAAyB,SAIhFA,EAAK,YAAY,iBAAmB,CAACA,EAAK,sBAC5C,MAAM,IAAI,MAAM,kFAAkF,CAEtG,CAoCO,SAASC,EAAiCC,EAAiBC,EAAqBC,EAAgC,CACrH,MAAMC,EAAiBD,EAAW,MAElC,OAAAA,EAAW,MAAQ,kBAAmBJ,EAAa,CACjD,OAAOK,EAAe,MAAM,KAAML,CAAI,CACxC,EAEOI,CACT","names":["validateFeePayerDataOnSubmission","config","args","ValidateFeePayerDataOnSimulation","target","propertyKey","descriptor","originalMethod"]}
@@ -1,6 +1,6 @@
1
1
  import EventEmitter from 'eventemitter3';
2
- import { A as AptosConfig, aX as InputGenerateTransactionPayloadData, aT as InputGenerateTransactionOptions } from '../../account-ClxOwjdh.mjs';
3
- import { A as Account } from '../../Ed25519Account-8ETkcAk_.mjs';
2
+ import { A as AptosConfig, aX as InputGenerateTransactionPayloadData, aT as InputGenerateTransactionOptions } from '../../account-BortO8g2.mjs';
3
+ import { A as Account } from '../../Ed25519Account-CPwej6wB.mjs';
4
4
  import { TransactionWorkerEvents, TransactionWorker } from '../../transactions/management/transactionWorker.mjs';
5
5
  import '../../types/indexer.mjs';
6
6
  import '../../types/generated/operations.mjs';
@@ -1,2 +1,2 @@
1
- import{ie as a}from"../../chunk-DIGP2ALY.mjs";import"../../chunk-5HXLZHDW.mjs";import"../../chunk-GOXRBEIJ.mjs";import"../../chunk-ROT6S6BM.mjs";import"../../chunk-XJJVJOX5.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-G3MHXDYA.mjs";import"../../chunk-HNBKTJPN.mjs";import"../../chunk-V74WPKSY.mjs";import"../../chunk-UYVPNUH3.mjs";import"../../chunk-A5L76YP7.mjs";import"../../chunk-XKUIMGKU.mjs";import"../../chunk-N6YTF76Q.mjs";import"../../chunk-ZP4DWSQA.mjs";import"../../chunk-QREVMGQZ.mjs";import"../../chunk-FGFLPH5K.mjs";import"../../chunk-V3MBJJTL.mjs";import"../../chunk-ES2KP6BS.mjs";import"../../chunk-EM52Z7T7.mjs";import"../../chunk-TGRLDWXV.mjs";import"../../chunk-N3O3ULF7.mjs";import"../../chunk-YOZBVVKL.mjs";import"../../chunk-GMQCQDW4.mjs";import"../../chunk-UL777LTI.mjs";import"../../chunk-7ECCT6PK.mjs";import"../../chunk-DNRUDMMV.mjs";import"../../chunk-GFFKEZ56.mjs";import"../../chunk-LWL57YFU.mjs";import"../../chunk-HGLO5LDS.mjs";import"../../chunk-CW35YAMN.mjs";import"../../chunk-6WDVDEQZ.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-7DQDJ2SA.mjs";import"../../chunk-HNBVYE3N.mjs";import"../../chunk-RGKRCZ36.mjs";import"../../chunk-FD6FGKYY.mjs";import"../../chunk-4WPQQPUF.mjs";import"../../chunk-IJE2LVZG.mjs";import"../../chunk-EBMEXURY.mjs";import"../../chunk-STY74NUA.mjs";import"../../chunk-IF4UU2MT.mjs";import"../../chunk-56CNRT2K.mjs";import"../../chunk-RCSJFTST.mjs";import"../../chunk-4RXKALLC.mjs";import"../../chunk-OLILO7VD.mjs";import"../../chunk-5FI4545P.mjs";import"../../chunk-KDMSOCZY.mjs";export{a as TransactionManagement};
1
+ import i from"eventemitter3";import{TransactionWorker as e,TransactionWorkerEventsEnum as n}from"../../transactions/management";class W extends i{constructor(t){super(),this.config=t}start(t){const{sender:o}=t;this.account=o,this.transactionWorker=new e(this.config,o),this.transactionWorker.start(),this.registerToEvents()}push(t){const{data:o,options:a}=t;for(const r of o)this.transactionWorker.push(r,a)}registerToEvents(){this.transactionWorker.on(n.TransactionSent,async t=>{this.emit(n.TransactionSent,t)}),this.transactionWorker.on(n.TransactionSendFailed,async t=>{this.emit(n.TransactionSendFailed,t)}),this.transactionWorker.on(n.TransactionExecuted,async t=>{this.emit(n.TransactionExecuted,t)}),this.transactionWorker.on(n.TransactionExecutionFailed,async t=>{this.emit(n.TransactionExecutionFailed,t)}),this.transactionWorker.on(n.ExecutionFinish,async t=>{this.emit(n.ExecutionFinish,t)})}forSingleAccount(t){try{const{sender:o,data:a,options:r}=t;this.start({sender:o}),this.push({data:a,options:r})}catch(o){throw new Error(`failed to submit transactions with error: ${o}`)}}}export{W as TransactionManagement};
2
2
  //# sourceMappingURL=management.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"sources":["../../../../src/api/transactionSubmission/management.ts"],"sourcesContent":["import EventEmitter from \"eventemitter3\";\nimport { TransactionWorkerEvents, TransactionWorker, TransactionWorkerEventsEnum } from \"../../transactions/management\";\nimport { InputGenerateTransactionPayloadData, InputGenerateTransactionOptions } from \"../../transactions\";\nimport { AptosConfig } from \"../aptosConfig\";\nimport { Account } from \"../../account\";\n\nexport class TransactionManagement extends EventEmitter<TransactionWorkerEvents> {\n account!: Account;\n\n transactionWorker!: TransactionWorker;\n\n readonly config: AptosConfig;\n\n /**\n * Initializes a new instance of the Aptos client with the provided configuration settings.\n * This allows you to interact with the Aptos blockchain using the specified network and options.\n *\n * @param config - The configuration settings for the Aptos client.\n * @param config.network - The network to connect to (e.g., TESTNET, MAINNET).\n * @param config.nodeUrl - The URL of the Aptos node to connect to.\n * @param config.account - Optional account settings for authentication.\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 the Aptos client\n * const config = new AptosConfig({\n * network: Network.TESTNET, // specify the network to use\n * nodeUrl: \"https://testnet.aptos.dev\" // replace with your node URL\n * });\n *\n * // Initialize the Aptos client with the configuration\n * const aptos = new Aptos(config);\n *\n * console.log(\"Aptos client initialized successfully.\");\n * }\n * runExample().catch(console.error);\n * ```\n * @group Implementation\n */\n constructor(config: AptosConfig) {\n super();\n this.config = config;\n }\n\n /**\n * Initializes the transaction worker using the provided sender account and begins listening for events.\n * This function is essential for setting up the transaction processing environment.\n *\n * @param args - The arguments for starting the transaction worker.\n * @param args.sender - The sender account to sign and submit the transaction.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network, Account } 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 * const sender = Account.generate(); // Generate a new account for sending transactions\n *\n * // Start the transaction worker with the sender account\n * aptos.start({ sender });\n *\n * console.log(\"Transaction worker started with sender:\", sender.accountAddress);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Implementation\n */\n private start(args: { sender: Account }): void {\n const { sender } = args;\n this.account = sender;\n this.transactionWorker = new TransactionWorker(this.config, sender);\n\n this.transactionWorker.start();\n this.registerToEvents();\n }\n\n /**\n * Pushes transaction data to the transaction worker for processing.\n *\n * @param args.data An array of transaction payloads to be processed.\n * @param args.options Optional. Transaction generation configurations (excluding accountSequenceNumber).\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 * // Prepare transaction payloads\n * const payloads = [\n * {}, // Build your first transaction payload\n * {}, // Build your second transaction payload\n * ];\n *\n * // Push transaction data to the worker\n * aptos.push({\n * data: payloads,\n * {}, // Specify options as needed\n * });\n *\n * console.log(\"Transaction data pushed successfully.\");\n * }\n * runExample().catch(console.error);\n * ```\n * @group Implementation\n */\n private push(args: {\n data: InputGenerateTransactionPayloadData[];\n options?: Omit<InputGenerateTransactionOptions, \"accountSequenceNumber\">;\n }): void {\n const { data, options } = args;\n\n for (const d of data) {\n this.transactionWorker.push(d, options);\n }\n }\n\n /**\n * Starts listening to transaction worker events, allowing the application to respond to transaction status changes.\n * This function enables the application to handle events such as transaction sent, execution success, or failure.\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 * // Register to listen for transaction events\n * aptos.registerToEvents();\n *\n * // You can send a transaction here to see the events in action\n * const sender = Account.generate(); // replace with a real account\n * const destination = Account.generate(); // replace with a real account\n *\n * const transaction = await aptos.transaction.build.simple({\n * sender: sender.accountAddress,\n * data: {\n * function: \"0x1::aptos_account::transfer\",\n * functionArguments: [destination.accountAddress, 100],\n * },\n * });\n *\n * await aptos.transaction.send(transaction);\n *\n * console.log(\"Transaction sent and events registered.\");\n * }\n * runExample().catch(console.error);\n * ```\n * @group Implementation\n */\n private registerToEvents() {\n // TODO - Should we ask events to listen to this as an input?\n this.transactionWorker.on(TransactionWorkerEventsEnum.TransactionSent, async (data) => {\n this.emit(TransactionWorkerEventsEnum.TransactionSent, data);\n });\n this.transactionWorker.on(TransactionWorkerEventsEnum.TransactionSendFailed, async (data) => {\n this.emit(TransactionWorkerEventsEnum.TransactionSendFailed, data);\n });\n this.transactionWorker.on(TransactionWorkerEventsEnum.TransactionExecuted, async (data) => {\n this.emit(TransactionWorkerEventsEnum.TransactionExecuted, data);\n });\n this.transactionWorker.on(TransactionWorkerEventsEnum.TransactionExecutionFailed, async (data) => {\n this.emit(TransactionWorkerEventsEnum.TransactionExecutionFailed, data);\n });\n this.transactionWorker.on(TransactionWorkerEventsEnum.ExecutionFinish, async (data) => {\n this.emit(TransactionWorkerEventsEnum.ExecutionFinish, data);\n });\n }\n\n /**\n * Send batch transactions for a single account.\n *\n * This function uses a transaction worker that receives payloads to be processed\n * and submitted to chain.\n * Note that this process is best for submitting multiple transactions that\n * don't rely on each other, i.e. batch funds, batch token mints, etc.\n *\n * If any worker failure, the functions throws an error.\n *\n * @param args.sender The sender account to sign and submit the transaction\n * @param args.data An array of transaction payloads\n * @param args.options optional. Transaction generation configurations (excluding accountSequenceNumber)\n *\n * @return void. Throws if any error\n * @group Implementation\n */\n forSingleAccount(args: {\n sender: Account;\n data: InputGenerateTransactionPayloadData[];\n options?: Omit<InputGenerateTransactionOptions, \"accountSequenceNumber\">;\n }): void {\n try {\n const { sender, data, options } = args;\n this.start({ sender });\n\n this.push({ data, options });\n } catch (error: any) {\n throw new Error(`failed to submit transactions with error: ${error}`);\n }\n }\n}\n"],"mappings":"AAAA,OAAOA,MAAkB,gBACzB,OAAkC,qBAAAC,EAAmB,+BAAAC,MAAmC,gCAKjF,MAAMC,UAA8BH,CAAsC,CAoC/E,YAAYI,EAAqB,CAC/B,MAAM,EACN,KAAK,OAASA,CAChB,CA4BQ,MAAMC,EAAiC,CAC7C,KAAM,CAAE,OAAAC,CAAO,EAAID,EACnB,KAAK,QAAUC,EACf,KAAK,kBAAoB,IAAIL,EAAkB,KAAK,OAAQK,CAAM,EAElE,KAAK,kBAAkB,MAAM,EAC7B,KAAK,iBAAiB,CACxB,CAkCQ,KAAKD,EAGJ,CACP,KAAM,CAAE,KAAAE,EAAM,QAAAC,CAAQ,EAAIH,EAE1B,UAAWI,KAAKF,EACd,KAAK,kBAAkB,KAAKE,EAAGD,CAAO,CAE1C,CAqCQ,kBAAmB,CAEzB,KAAK,kBAAkB,GAAGN,EAA4B,gBAAiB,MAAOK,GAAS,CACrF,KAAK,KAAKL,EAA4B,gBAAiBK,CAAI,CAC7D,CAAC,EACD,KAAK,kBAAkB,GAAGL,EAA4B,sBAAuB,MAAOK,GAAS,CAC3F,KAAK,KAAKL,EAA4B,sBAAuBK,CAAI,CACnE,CAAC,EACD,KAAK,kBAAkB,GAAGL,EAA4B,oBAAqB,MAAOK,GAAS,CACzF,KAAK,KAAKL,EAA4B,oBAAqBK,CAAI,CACjE,CAAC,EACD,KAAK,kBAAkB,GAAGL,EAA4B,2BAA4B,MAAOK,GAAS,CAChG,KAAK,KAAKL,EAA4B,2BAA4BK,CAAI,CACxE,CAAC,EACD,KAAK,kBAAkB,GAAGL,EAA4B,gBAAiB,MAAOK,GAAS,CACrF,KAAK,KAAKL,EAA4B,gBAAiBK,CAAI,CAC7D,CAAC,CACH,CAmBA,iBAAiBF,EAIR,CACP,GAAI,CACF,KAAM,CAAE,OAAAC,EAAQ,KAAAC,EAAM,QAAAC,CAAQ,EAAIH,EAClC,KAAK,MAAM,CAAE,OAAAC,CAAO,CAAC,EAErB,KAAK,KAAK,CAAE,KAAAC,EAAM,QAAAC,CAAQ,CAAC,CAC7B,OAASE,EAAY,CACnB,MAAM,IAAI,MAAM,6CAA6CA,CAAK,EAAE,CACtE,CACF,CACF","names":["EventEmitter","TransactionWorker","TransactionWorkerEventsEnum","TransactionManagement","config","args","sender","data","options","d","error"]}
@@ -1,5 +1,5 @@
1
- import { A as AptosConfig, bg as AnyRawTransaction, W as AccountAuthenticator } from '../../account-ClxOwjdh.mjs';
2
- import { A as Account } from '../../Ed25519Account-8ETkcAk_.mjs';
1
+ import { A as AptosConfig, bg as AnyRawTransaction, W as AccountAuthenticator } from '../../account-BortO8g2.mjs';
2
+ import { A as Account } from '../../Ed25519Account-CPwej6wB.mjs';
3
3
  import '../../types/indexer.mjs';
4
4
  import '../../types/generated/operations.mjs';
5
5
  import '../../types/generated/types.mjs';