@aptos-labs/ts-sdk 6.3.0 → 7.0.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 (1405) hide show
  1. package/README.md +125 -24
  2. package/dist/account/AbstractKeylessAccount.d.ts +326 -0
  3. package/dist/account/AbstractKeylessAccount.d.ts.map +1 -0
  4. package/dist/account/AbstractKeylessAccount.js +440 -0
  5. package/dist/account/AbstractKeylessAccount.js.map +1 -0
  6. package/dist/account/AbstractedAccount.d.ts +61 -0
  7. package/dist/account/AbstractedAccount.d.ts.map +1 -0
  8. package/dist/account/AbstractedAccount.js +71 -0
  9. package/dist/account/AbstractedAccount.js.map +1 -0
  10. package/dist/account/Account.d.ts +302 -0
  11. package/dist/account/Account.d.ts.map +1 -0
  12. package/dist/account/Account.js +104 -0
  13. package/dist/account/Account.js.map +1 -0
  14. package/dist/account/AccountUtils.d.ts +25 -0
  15. package/dist/account/AccountUtils.d.ts.map +1 -0
  16. package/dist/account/AccountUtils.js +202 -0
  17. package/dist/account/AccountUtils.js.map +1 -0
  18. package/dist/account/DerivableAbstractedAccount.d.ts +51 -0
  19. package/dist/account/DerivableAbstractedAccount.d.ts.map +1 -0
  20. package/dist/account/DerivableAbstractedAccount.js +61 -0
  21. package/dist/account/DerivableAbstractedAccount.js.map +1 -0
  22. package/dist/account/Ed25519Account.d.ts +161 -0
  23. package/dist/account/Ed25519Account.d.ts.map +1 -0
  24. package/dist/account/Ed25519Account.js +149 -0
  25. package/dist/account/Ed25519Account.js.map +1 -0
  26. package/dist/account/EphemeralKeyPair.d.ts +159 -0
  27. package/dist/account/EphemeralKeyPair.d.ts.map +1 -0
  28. package/dist/account/EphemeralKeyPair.js +246 -0
  29. package/dist/account/EphemeralKeyPair.js.map +1 -0
  30. package/dist/account/FederatedKeylessAccount.d.ts +107 -0
  31. package/dist/account/FederatedKeylessAccount.d.ts.map +1 -0
  32. package/dist/account/FederatedKeylessAccount.js +129 -0
  33. package/dist/account/FederatedKeylessAccount.js.map +1 -0
  34. package/dist/account/KeylessAccount.d.ts +112 -0
  35. package/dist/account/KeylessAccount.d.ts.map +1 -0
  36. package/dist/account/KeylessAccount.js +133 -0
  37. package/dist/account/KeylessAccount.js.map +1 -0
  38. package/dist/account/MultiEd25519Account.d.ts +100 -0
  39. package/dist/account/MultiEd25519Account.d.ts.map +1 -0
  40. package/dist/account/MultiEd25519Account.js +134 -0
  41. package/dist/account/MultiEd25519Account.js.map +1 -0
  42. package/dist/account/MultiKeyAccount.d.ts +197 -0
  43. package/dist/account/MultiKeyAccount.d.ts.map +1 -0
  44. package/dist/account/MultiKeyAccount.js +233 -0
  45. package/dist/account/MultiKeyAccount.js.map +1 -0
  46. package/dist/account/SingleKeyAccount.d.ts +189 -0
  47. package/dist/account/SingleKeyAccount.d.ts.map +1 -0
  48. package/dist/account/SingleKeyAccount.js +182 -0
  49. package/dist/account/SingleKeyAccount.js.map +1 -0
  50. package/dist/account/index.d.ts +9 -0
  51. package/dist/account/index.d.ts.map +1 -0
  52. package/dist/account/index.js +17 -0
  53. package/dist/account/index.js.map +1 -0
  54. package/dist/account/keylessSigner.d.ts +22 -0
  55. package/dist/account/keylessSigner.d.ts.map +1 -0
  56. package/dist/account/keylessSigner.js +9 -0
  57. package/dist/account/keylessSigner.js.map +1 -0
  58. package/dist/account/utils.d.ts +8 -0
  59. package/dist/account/utils.d.ts.map +1 -0
  60. package/dist/account/utils.js +12 -0
  61. package/dist/account/utils.js.map +1 -0
  62. package/dist/api/account/abstraction.d.ts +176 -0
  63. package/dist/api/account/abstraction.d.ts.map +1 -0
  64. package/dist/api/account/abstraction.js +203 -0
  65. package/dist/api/account/abstraction.js.map +1 -0
  66. package/dist/api/account.d.ts +845 -0
  67. package/dist/api/account.d.ts.map +1 -0
  68. package/dist/api/account.js +965 -0
  69. package/dist/api/account.js.map +1 -0
  70. package/dist/api/ans.d.ts +565 -0
  71. package/dist/api/ans.d.ts.map +1 -0
  72. package/dist/api/ans.js +537 -0
  73. package/dist/api/ans.js.map +1 -0
  74. package/dist/api/aptos.d.ts +73 -0
  75. package/dist/api/aptos.d.ts.map +1 -0
  76. package/dist/api/aptos.js +162 -0
  77. package/dist/api/aptos.js.map +1 -0
  78. package/dist/api/aptosConfig.d.ts +215 -0
  79. package/dist/api/aptosConfig.d.ts.map +1 -0
  80. package/dist/api/aptosConfig.js +316 -0
  81. package/dist/api/aptosConfig.js.map +1 -0
  82. package/dist/api/coin.d.ts +77 -0
  83. package/dist/api/coin.d.ts.map +1 -0
  84. package/dist/api/coin.js +73 -0
  85. package/dist/api/coin.js.map +1 -0
  86. package/dist/api/digitalAsset.d.ts +1026 -0
  87. package/dist/api/digitalAsset.d.ts.map +1 -0
  88. package/dist/api/digitalAsset.js +987 -0
  89. package/dist/api/digitalAsset.js.map +1 -0
  90. package/dist/api/faucet.d.ts +74 -0
  91. package/dist/api/faucet.d.ts.map +1 -0
  92. package/dist/api/faucet.js +86 -0
  93. package/dist/api/faucet.js.map +1 -0
  94. package/dist/api/fungibleAsset.d.ts +285 -0
  95. package/dist/api/fungibleAsset.d.ts.map +1 -0
  96. package/dist/api/fungibleAsset.js +314 -0
  97. package/dist/api/fungibleAsset.js.map +1 -0
  98. package/dist/api/general.d.ts +298 -0
  99. package/dist/api/general.d.ts.map +1 -0
  100. package/dist/api/general.js +311 -0
  101. package/dist/api/general.js.map +1 -0
  102. package/dist/api/index.d.ts +3 -0
  103. package/dist/api/index.d.ts.map +1 -0
  104. package/dist/api/index.js +5 -0
  105. package/dist/api/index.js.map +1 -0
  106. package/dist/api/keyless.d.ts +160 -0
  107. package/dist/api/keyless.d.ts.map +1 -0
  108. package/dist/api/keyless.js +176 -0
  109. package/dist/api/keyless.js.map +1 -0
  110. package/dist/api/object.d.ts +74 -0
  111. package/dist/api/object.d.ts.map +1 -0
  112. package/dist/api/object.js +84 -0
  113. package/dist/api/object.js.map +1 -0
  114. package/dist/api/staking.d.ts +128 -0
  115. package/dist/api/staking.d.ts.map +1 -0
  116. package/dist/api/staking.js +143 -0
  117. package/dist/api/staking.js.map +1 -0
  118. package/dist/api/table.d.ts +163 -0
  119. package/dist/api/table.d.ts.map +1 -0
  120. package/dist/api/table.js +171 -0
  121. package/dist/api/table.js.map +1 -0
  122. package/dist/api/transaction.d.ts +672 -0
  123. package/dist/api/transaction.d.ts.map +1 -0
  124. package/dist/api/transaction.js +694 -0
  125. package/dist/api/transaction.js.map +1 -0
  126. package/dist/api/transactionSubmission/build.d.ts +137 -0
  127. package/dist/api/transactionSubmission/build.d.ts.map +1 -0
  128. package/dist/api/transactionSubmission/build.js +130 -0
  129. package/dist/api/transactionSubmission/build.js.map +1 -0
  130. package/dist/api/transactionSubmission/helpers.d.ts +91 -0
  131. package/dist/api/transactionSubmission/helpers.d.ts.map +1 -0
  132. package/dist/api/transactionSubmission/helpers.js +99 -0
  133. package/dist/api/transactionSubmission/helpers.js.map +1 -0
  134. package/dist/api/transactionSubmission/management.d.ts +159 -0
  135. package/dist/api/transactionSubmission/management.d.ts.map +1 -0
  136. package/dist/api/transactionSubmission/management.js +192 -0
  137. package/dist/api/transactionSubmission/management.js.map +1 -0
  138. package/dist/api/transactionSubmission/sign.d.ts +117 -0
  139. package/dist/api/transactionSubmission/sign.d.ts.map +1 -0
  140. package/dist/api/transactionSubmission/sign.js +130 -0
  141. package/dist/api/transactionSubmission/sign.js.map +1 -0
  142. package/dist/api/transactionSubmission/simulate.d.ts +176 -0
  143. package/dist/api/transactionSubmission/simulate.d.ts.map +1 -0
  144. package/dist/api/transactionSubmission/simulate.js +183 -0
  145. package/dist/api/transactionSubmission/simulate.js.map +1 -0
  146. package/dist/api/transactionSubmission/submit.d.ts +136 -0
  147. package/dist/api/transactionSubmission/submit.d.ts.map +1 -0
  148. package/dist/api/transactionSubmission/submit.js +136 -0
  149. package/dist/api/transactionSubmission/submit.js.map +1 -0
  150. package/dist/api/utils.d.ts +39 -0
  151. package/dist/api/utils.d.ts.map +1 -0
  152. package/dist/api/utils.js +41 -0
  153. package/dist/api/utils.js.map +1 -0
  154. package/dist/bcs/consts.d.ts +20 -0
  155. package/dist/bcs/consts.d.ts.map +1 -0
  156. package/dist/bcs/consts.js +24 -0
  157. package/dist/bcs/consts.js.map +1 -0
  158. package/dist/bcs/deserializer.d.ts +365 -0
  159. package/dist/bcs/deserializer.d.ts.map +1 -0
  160. package/dist/bcs/deserializer.js +470 -0
  161. package/dist/bcs/deserializer.js.map +1 -0
  162. package/dist/bcs/index.d.ts +7 -0
  163. package/dist/bcs/index.d.ts.map +1 -0
  164. package/dist/bcs/index.js +9 -0
  165. package/dist/bcs/index.js.map +1 -0
  166. package/dist/bcs/serializable/entryFunctionBytes.d.ts +60 -0
  167. package/dist/bcs/serializable/entryFunctionBytes.d.ts.map +1 -0
  168. package/dist/bcs/serializable/entryFunctionBytes.js +82 -0
  169. package/dist/bcs/serializable/entryFunctionBytes.js.map +1 -0
  170. package/dist/bcs/serializable/fixedBytes.d.ts +86 -0
  171. package/dist/bcs/serializable/fixedBytes.d.ts.map +1 -0
  172. package/dist/bcs/serializable/fixedBytes.js +98 -0
  173. package/dist/bcs/serializable/fixedBytes.js.map +1 -0
  174. package/dist/bcs/serializable/movePrimitives.d.ts +267 -0
  175. package/dist/bcs/serializable/movePrimitives.d.ts.map +1 -0
  176. package/dist/bcs/serializable/movePrimitives.js +448 -0
  177. package/dist/bcs/serializable/movePrimitives.js.map +1 -0
  178. package/dist/bcs/serializable/moveStructs.d.ts +596 -0
  179. package/dist/bcs/serializable/moveStructs.d.ts.map +1 -0
  180. package/dist/bcs/serializable/moveStructs.js +748 -0
  181. package/dist/bcs/serializable/moveStructs.js.map +1 -0
  182. package/dist/bcs/serializer.d.ts +442 -0
  183. package/dist/bcs/serializer.d.ts.map +1 -0
  184. package/dist/bcs/serializer.js +747 -0
  185. package/dist/bcs/serializer.js.map +1 -0
  186. package/dist/cli/index.d.ts +3 -0
  187. package/dist/cli/index.d.ts.map +1 -0
  188. package/dist/cli/index.js +3 -0
  189. package/dist/cli/index.js.map +1 -0
  190. package/dist/cli/localNode.d.ts +65 -0
  191. package/dist/cli/localNode.d.ts.map +1 -0
  192. package/dist/cli/localNode.js +149 -0
  193. package/dist/cli/localNode.js.map +1 -0
  194. package/dist/cli/move.d.ts +250 -0
  195. package/dist/cli/move.d.ts.map +1 -0
  196. package/dist/cli/move.js +364 -0
  197. package/dist/cli/move.js.map +1 -0
  198. package/dist/client/core.d.ts +37 -0
  199. package/dist/client/core.d.ts.map +1 -0
  200. package/dist/client/core.js +116 -0
  201. package/dist/client/core.js.map +1 -0
  202. package/dist/client/get.d.ts +119 -0
  203. package/dist/client/get.d.ts.map +1 -0
  204. package/dist/client/get.js +165 -0
  205. package/dist/client/get.js.map +1 -0
  206. package/dist/client/index.d.ts +4 -0
  207. package/dist/client/index.d.ts.map +1 -0
  208. package/dist/client/index.js +6 -0
  209. package/dist/client/index.js.map +1 -0
  210. package/dist/client/post.d.ts +155 -0
  211. package/dist/client/post.d.ts.map +1 -0
  212. package/dist/client/post.js +151 -0
  213. package/dist/client/post.js.map +1 -0
  214. package/dist/core/account/index.d.ts +2 -0
  215. package/dist/core/account/index.d.ts.map +1 -0
  216. package/dist/core/account/index.js +2 -0
  217. package/dist/core/account/index.js.map +1 -0
  218. package/dist/core/account/utils/address.d.ts +47 -0
  219. package/dist/core/account/utils/address.d.ts.map +1 -0
  220. package/dist/core/account/utils/address.js +68 -0
  221. package/dist/core/account/utils/address.js.map +1 -0
  222. package/dist/core/account/utils/index.d.ts +2 -0
  223. package/dist/core/account/utils/index.d.ts.map +1 -0
  224. package/dist/core/account/utils/index.js +2 -0
  225. package/dist/core/account/utils/index.js.map +1 -0
  226. package/dist/core/accountAddress.d.ts +327 -0
  227. package/dist/core/accountAddress.d.ts.map +1 -0
  228. package/dist/core/accountAddress.js +457 -0
  229. package/dist/core/accountAddress.js.map +1 -0
  230. package/dist/core/authenticationKey.d.ts +129 -0
  231. package/dist/core/authenticationKey.d.ts.map +1 -0
  232. package/dist/core/authenticationKey.js +155 -0
  233. package/dist/core/authenticationKey.js.map +1 -0
  234. package/dist/core/common.d.ts +51 -0
  235. package/dist/core/common.d.ts.map +1 -0
  236. package/dist/core/common.js +30 -0
  237. package/dist/core/common.js.map +1 -0
  238. package/dist/core/crypto/abstraction.d.ts +21 -0
  239. package/dist/core/crypto/abstraction.d.ts.map +1 -0
  240. package/dist/core/crypto/abstraction.js +37 -0
  241. package/dist/core/crypto/abstraction.js.map +1 -0
  242. package/dist/core/crypto/anyKeyRegistry.d.ts +45 -0
  243. package/dist/core/crypto/anyKeyRegistry.d.ts.map +1 -0
  244. package/dist/core/crypto/anyKeyRegistry.js +59 -0
  245. package/dist/core/crypto/anyKeyRegistry.js.map +1 -0
  246. package/dist/core/crypto/deserializationUtils.d.ts +22 -0
  247. package/dist/core/crypto/deserializationUtils.d.ts.map +1 -0
  248. package/dist/core/crypto/deserializationUtils.js +89 -0
  249. package/dist/core/crypto/deserializationUtils.js.map +1 -0
  250. package/dist/core/crypto/ed25519.d.ts +330 -0
  251. package/dist/core/crypto/ed25519.d.ts.map +1 -0
  252. package/dist/core/crypto/ed25519.js +502 -0
  253. package/dist/core/crypto/ed25519.js.map +1 -0
  254. package/dist/core/crypto/encryption/ciphertext.d.ts +49 -0
  255. package/dist/core/crypto/encryption/ciphertext.d.ts.map +1 -0
  256. package/dist/core/crypto/encryption/ciphertext.js +166 -0
  257. package/dist/core/crypto/encryption/ciphertext.js.map +1 -0
  258. package/dist/core/crypto/encryption/curveSerialization.d.ts +17 -0
  259. package/dist/core/crypto/encryption/curveSerialization.d.ts.map +1 -0
  260. package/dist/core/crypto/encryption/curveSerialization.js +38 -0
  261. package/dist/core/crypto/encryption/curveSerialization.js.map +1 -0
  262. package/dist/core/crypto/encryption/fieldSerialization.d.ts +12 -0
  263. package/dist/core/crypto/encryption/fieldSerialization.d.ts.map +1 -0
  264. package/dist/core/crypto/encryption/fieldSerialization.js +70 -0
  265. package/dist/core/crypto/encryption/fieldSerialization.js.map +1 -0
  266. package/dist/core/crypto/encryption/index.d.ts +11 -0
  267. package/dist/core/crypto/encryption/index.d.ts.map +1 -0
  268. package/dist/core/crypto/encryption/index.js +13 -0
  269. package/dist/core/crypto/encryption/index.js.map +1 -0
  270. package/dist/core/crypto/encryption/symmetric.d.ts +38 -0
  271. package/dist/core/crypto/encryption/symmetric.d.ts.map +1 -0
  272. package/dist/core/crypto/encryption/symmetric.js +124 -0
  273. package/dist/core/crypto/encryption/symmetric.js.map +1 -0
  274. package/dist/core/crypto/ephemeral.d.ts +112 -0
  275. package/dist/core/crypto/ephemeral.d.ts.map +1 -0
  276. package/dist/core/crypto/ephemeral.js +170 -0
  277. package/dist/core/crypto/ephemeral.js.map +1 -0
  278. package/dist/core/crypto/federatedKeyless.d.ts +106 -0
  279. package/dist/core/crypto/federatedKeyless.d.ts.map +1 -0
  280. package/dist/core/crypto/federatedKeyless.js +125 -0
  281. package/dist/core/crypto/federatedKeyless.js.map +1 -0
  282. package/dist/core/crypto/hdKey.d.ts +90 -0
  283. package/dist/core/crypto/hdKey.d.ts.map +1 -0
  284. package/dist/core/crypto/hdKey.js +118 -0
  285. package/dist/core/crypto/hdKey.js.map +1 -0
  286. package/dist/core/crypto/index.d.ts +13 -0
  287. package/dist/core/crypto/index.d.ts.map +1 -0
  288. package/dist/core/crypto/index.js +26 -0
  289. package/dist/core/crypto/index.js.map +1 -0
  290. package/dist/core/crypto/keyless.d.ts +788 -0
  291. package/dist/core/crypto/keyless.d.ts.map +1 -0
  292. package/dist/core/crypto/keyless.js +1482 -0
  293. package/dist/core/crypto/keyless.js.map +1 -0
  294. package/dist/core/crypto/keylessRegistration.d.ts +2 -0
  295. package/dist/core/crypto/keylessRegistration.d.ts.map +1 -0
  296. package/dist/core/crypto/keylessRegistration.js +16 -0
  297. package/dist/core/crypto/keylessRegistration.js.map +1 -0
  298. package/dist/core/crypto/multiEd25519.d.ts +228 -0
  299. package/dist/core/crypto/multiEd25519.d.ts.map +1 -0
  300. package/dist/core/crypto/multiEd25519.js +361 -0
  301. package/dist/core/crypto/multiEd25519.js.map +1 -0
  302. package/dist/core/crypto/multiKey.d.ts +248 -0
  303. package/dist/core/crypto/multiKey.d.ts.map +1 -0
  304. package/dist/core/crypto/multiKey.js +417 -0
  305. package/dist/core/crypto/multiKey.js.map +1 -0
  306. package/dist/core/crypto/poseidon.d.ts +58 -0
  307. package/dist/core/crypto/poseidon.d.ts.map +1 -0
  308. package/dist/core/crypto/poseidon.js +196 -0
  309. package/dist/core/crypto/poseidon.js.map +1 -0
  310. package/dist/core/crypto/privateKey.d.ts +64 -0
  311. package/dist/core/crypto/privateKey.d.ts.map +1 -0
  312. package/dist/core/crypto/privateKey.js +74 -0
  313. package/dist/core/crypto/privateKey.js.map +1 -0
  314. package/dist/core/crypto/proof.d.ts +10 -0
  315. package/dist/core/crypto/proof.d.ts.map +1 -0
  316. package/dist/core/crypto/proof.js +10 -0
  317. package/dist/core/crypto/proof.js.map +1 -0
  318. package/dist/core/crypto/publicKey.d.ts +92 -0
  319. package/dist/core/crypto/publicKey.d.ts.map +1 -0
  320. package/dist/core/crypto/publicKey.js +54 -0
  321. package/dist/core/crypto/publicKey.js.map +1 -0
  322. package/dist/core/crypto/secp256k1.d.ts +303 -0
  323. package/dist/core/crypto/secp256k1.d.ts.map +1 -0
  324. package/dist/core/crypto/secp256k1.js +455 -0
  325. package/dist/core/crypto/secp256k1.js.map +1 -0
  326. package/dist/core/crypto/secp256r1.d.ts +304 -0
  327. package/dist/core/crypto/secp256r1.d.ts.map +1 -0
  328. package/dist/core/crypto/secp256r1.js +444 -0
  329. package/dist/core/crypto/secp256r1.js.map +1 -0
  330. package/dist/core/crypto/signature.d.ts +35 -0
  331. package/dist/core/crypto/signature.d.ts.map +1 -0
  332. package/dist/core/crypto/signature.js +55 -0
  333. package/dist/core/crypto/signature.js.map +1 -0
  334. package/dist/core/crypto/singleKey.d.ts +175 -0
  335. package/dist/core/crypto/singleKey.d.ts.map +1 -0
  336. package/dist/core/crypto/singleKey.js +324 -0
  337. package/dist/core/crypto/singleKey.js.map +1 -0
  338. package/dist/core/crypto/types.d.ts +6 -0
  339. package/dist/core/crypto/types.d.ts.map +1 -0
  340. package/dist/core/crypto/types.js +2 -0
  341. package/dist/core/crypto/types.js.map +1 -0
  342. package/dist/core/crypto/utils.d.ts +16 -0
  343. package/dist/core/crypto/utils.d.ts.map +1 -0
  344. package/dist/core/crypto/utils.js +64 -0
  345. package/dist/core/crypto/utils.js.map +1 -0
  346. package/dist/core/hex.d.ts +154 -0
  347. package/dist/core/hex.d.ts.map +1 -0
  348. package/dist/core/hex.js +219 -0
  349. package/dist/core/hex.js.map +1 -0
  350. package/dist/core/index.d.ts +7 -0
  351. package/dist/core/index.d.ts.map +1 -0
  352. package/dist/core/index.js +9 -0
  353. package/dist/core/index.js.map +1 -0
  354. package/dist/errors/index.d.ts +125 -0
  355. package/dist/errors/index.d.ts.map +1 -0
  356. package/dist/errors/index.js +367 -0
  357. package/dist/errors/index.js.map +1 -0
  358. package/dist/functions/abstraction.d.ts +4 -0
  359. package/dist/functions/abstraction.d.ts.map +1 -0
  360. package/dist/functions/abstraction.js +6 -0
  361. package/dist/functions/abstraction.js.map +1 -0
  362. package/dist/functions/account.d.ts +8 -0
  363. package/dist/functions/account.d.ts.map +1 -0
  364. package/dist/functions/account.js +10 -0
  365. package/dist/functions/account.js.map +1 -0
  366. package/dist/functions/ans.d.ts +4 -0
  367. package/dist/functions/ans.d.ts.map +1 -0
  368. package/dist/functions/ans.js +6 -0
  369. package/dist/functions/ans.js.map +1 -0
  370. package/dist/functions/coin.d.ts +4 -0
  371. package/dist/functions/coin.d.ts.map +1 -0
  372. package/dist/functions/coin.js +6 -0
  373. package/dist/functions/coin.js.map +1 -0
  374. package/dist/functions/digitalAsset.d.ts +4 -0
  375. package/dist/functions/digitalAsset.d.ts.map +1 -0
  376. package/dist/functions/digitalAsset.js +6 -0
  377. package/dist/functions/digitalAsset.js.map +1 -0
  378. package/dist/functions/faucet.d.ts +4 -0
  379. package/dist/functions/faucet.d.ts.map +1 -0
  380. package/dist/functions/faucet.js +6 -0
  381. package/dist/functions/faucet.js.map +1 -0
  382. package/dist/functions/fungibleAsset.d.ts +4 -0
  383. package/dist/functions/fungibleAsset.d.ts.map +1 -0
  384. package/dist/functions/fungibleAsset.js +6 -0
  385. package/dist/functions/fungibleAsset.js.map +1 -0
  386. package/dist/functions/general.d.ts +4 -0
  387. package/dist/functions/general.d.ts.map +1 -0
  388. package/dist/functions/general.js +6 -0
  389. package/dist/functions/general.js.map +1 -0
  390. package/dist/functions/index.d.ts +18 -0
  391. package/dist/functions/index.d.ts.map +1 -0
  392. package/dist/functions/index.js +20 -0
  393. package/dist/functions/index.js.map +1 -0
  394. package/dist/functions/keyless.d.ts +16 -0
  395. package/dist/functions/keyless.d.ts.map +1 -0
  396. package/dist/functions/keyless.js +23 -0
  397. package/dist/functions/keyless.js.map +1 -0
  398. package/dist/functions/object.d.ts +4 -0
  399. package/dist/functions/object.d.ts.map +1 -0
  400. package/dist/functions/object.js +6 -0
  401. package/dist/functions/object.js.map +1 -0
  402. package/dist/functions/staking.d.ts +4 -0
  403. package/dist/functions/staking.d.ts.map +1 -0
  404. package/dist/functions/staking.js +6 -0
  405. package/dist/functions/staking.js.map +1 -0
  406. package/dist/functions/table.d.ts +4 -0
  407. package/dist/functions/table.d.ts.map +1 -0
  408. package/dist/functions/table.js +6 -0
  409. package/dist/functions/table.js.map +1 -0
  410. package/dist/functions/transaction.d.ts +5 -0
  411. package/dist/functions/transaction.d.ts.map +1 -0
  412. package/dist/functions/transaction.js +7 -0
  413. package/dist/functions/transaction.js.map +1 -0
  414. package/dist/functions/view.d.ts +3 -0
  415. package/dist/functions/view.d.ts.map +1 -0
  416. package/dist/functions/view.js +5 -0
  417. package/dist/functions/view.js.map +1 -0
  418. package/dist/index.d.ts +12 -0
  419. package/dist/index.d.ts.map +1 -0
  420. package/dist/index.js +29 -0
  421. package/dist/index.js.map +1 -0
  422. package/dist/internal/abstraction.d.ts +22 -0
  423. package/dist/internal/abstraction.d.ts.map +1 -0
  424. package/dist/internal/abstraction.js +54 -0
  425. package/dist/internal/abstraction.js.map +1 -0
  426. package/dist/internal/account.d.ts +457 -0
  427. package/dist/internal/account.d.ts.map +1 -0
  428. package/dist/internal/account.js +1164 -0
  429. package/dist/internal/account.js.map +1 -0
  430. package/dist/internal/ans.d.ts +414 -0
  431. package/dist/internal/ans.d.ts.map +1 -0
  432. package/dist/internal/ans.js +769 -0
  433. package/dist/internal/ans.js.map +1 -0
  434. package/dist/internal/coin.d.ts +27 -0
  435. package/dist/internal/coin.d.ts.map +1 -0
  436. package/dist/internal/coin.js +36 -0
  437. package/dist/internal/coin.js.map +1 -0
  438. package/dist/internal/digitalAsset.d.ts +577 -0
  439. package/dist/internal/digitalAsset.d.ts.map +1 -0
  440. package/dist/internal/digitalAsset.js +900 -0
  441. package/dist/internal/digitalAsset.js.map +1 -0
  442. package/dist/internal/encryptionKey.d.ts +20 -0
  443. package/dist/internal/encryptionKey.d.ts.map +1 -0
  444. package/dist/internal/encryptionKey.js +33 -0
  445. package/dist/internal/encryptionKey.js.map +1 -0
  446. package/dist/internal/faucet.d.ts +35 -0
  447. package/dist/internal/faucet.d.ts.map +1 -0
  448. package/dist/internal/faucet.js +53 -0
  449. package/dist/internal/faucet.js.map +1 -0
  450. package/dist/internal/fungibleAsset.d.ts +108 -0
  451. package/dist/internal/fungibleAsset.d.ts.map +1 -0
  452. package/dist/internal/fungibleAsset.js +155 -0
  453. package/dist/internal/fungibleAsset.js.map +1 -0
  454. package/dist/internal/general.d.ts +87 -0
  455. package/dist/internal/general.d.ts.map +1 -0
  456. package/dist/internal/general.js +136 -0
  457. package/dist/internal/general.js.map +1 -0
  458. package/dist/internal/keyless.d.ts +101 -0
  459. package/dist/internal/keyless.d.ts.map +1 -0
  460. package/dist/internal/keyless.js +191 -0
  461. package/dist/internal/keyless.js.map +1 -0
  462. package/dist/internal/object.d.ts +37 -0
  463. package/dist/internal/object.d.ts.map +1 -0
  464. package/dist/internal/object.js +53 -0
  465. package/dist/internal/object.js.map +1 -0
  466. package/dist/internal/staking.d.ts +53 -0
  467. package/dist/internal/staking.d.ts.map +1 -0
  468. package/dist/internal/staking.js +71 -0
  469. package/dist/internal/staking.js.map +1 -0
  470. package/dist/internal/table.d.ts +60 -0
  471. package/dist/internal/table.d.ts.map +1 -0
  472. package/dist/internal/table.js +86 -0
  473. package/dist/internal/table.js.map +1 -0
  474. package/dist/internal/transaction.d.ts +192 -0
  475. package/dist/internal/transaction.d.ts.map +1 -0
  476. package/dist/internal/transaction.js +399 -0
  477. package/dist/internal/transaction.js.map +1 -0
  478. package/dist/internal/transactionSubmission.d.ts +177 -0
  479. package/dist/internal/transactionSubmission.d.ts.map +1 -0
  480. package/dist/internal/transactionSubmission.js +411 -0
  481. package/dist/internal/transactionSubmission.js.map +1 -0
  482. package/dist/internal/utils/index.d.ts +2 -0
  483. package/dist/internal/utils/index.d.ts.map +1 -0
  484. package/dist/internal/utils/index.js +4 -0
  485. package/dist/internal/utils/index.js.map +1 -0
  486. package/dist/internal/utils/utils.d.ts +35 -0
  487. package/dist/internal/utils/utils.d.ts.map +1 -0
  488. package/dist/internal/utils/utils.js +63 -0
  489. package/dist/internal/utils/utils.js.map +1 -0
  490. package/dist/internal/view.d.ts +14 -0
  491. package/dist/internal/view.d.ts.map +1 -0
  492. package/dist/internal/view.js +41 -0
  493. package/dist/internal/view.js.map +1 -0
  494. package/dist/transactions/authenticator/account.d.ts +193 -0
  495. package/dist/transactions/authenticator/account.d.ts.map +1 -0
  496. package/dist/transactions/authenticator/account.js +346 -0
  497. package/dist/transactions/authenticator/account.js.map +1 -0
  498. package/dist/transactions/authenticator/index.d.ts +3 -0
  499. package/dist/transactions/authenticator/index.d.ts.map +1 -0
  500. package/dist/transactions/authenticator/index.js +5 -0
  501. package/dist/transactions/authenticator/index.js.map +1 -0
  502. package/dist/transactions/authenticator/transaction.d.ts +148 -0
  503. package/dist/transactions/authenticator/transaction.d.ts.map +1 -0
  504. package/dist/transactions/authenticator/transaction.js +239 -0
  505. package/dist/transactions/authenticator/transaction.js.map +1 -0
  506. package/dist/transactions/index.d.ts +7 -0
  507. package/dist/transactions/index.d.ts.map +1 -0
  508. package/dist/transactions/index.js +9 -0
  509. package/dist/transactions/index.js.map +1 -0
  510. package/dist/transactions/instances/chainId.d.ts +39 -0
  511. package/dist/transactions/instances/chainId.d.ts.map +1 -0
  512. package/dist/transactions/instances/chainId.js +48 -0
  513. package/dist/transactions/instances/chainId.js.map +1 -0
  514. package/dist/transactions/instances/encryptedPayload.d.ts +65 -0
  515. package/dist/transactions/instances/encryptedPayload.d.ts.map +1 -0
  516. package/dist/transactions/instances/encryptedPayload.js +122 -0
  517. package/dist/transactions/instances/encryptedPayload.js.map +1 -0
  518. package/dist/transactions/instances/identifier.d.ts +40 -0
  519. package/dist/transactions/instances/identifier.d.ts.map +1 -0
  520. package/dist/transactions/instances/identifier.js +49 -0
  521. package/dist/transactions/instances/identifier.js.map +1 -0
  522. package/dist/transactions/instances/index.d.ts +12 -0
  523. package/dist/transactions/instances/index.d.ts.map +1 -0
  524. package/dist/transactions/instances/index.js +14 -0
  525. package/dist/transactions/instances/index.js.map +1 -0
  526. package/dist/transactions/instances/moduleId.d.ts +52 -0
  527. package/dist/transactions/instances/moduleId.d.ts.map +1 -0
  528. package/dist/transactions/instances/moduleId.js +69 -0
  529. package/dist/transactions/instances/moduleId.js.map +1 -0
  530. package/dist/transactions/instances/multiAgentTransaction.d.ts +50 -0
  531. package/dist/transactions/instances/multiAgentTransaction.d.ts.map +1 -0
  532. package/dist/transactions/instances/multiAgentTransaction.js +75 -0
  533. package/dist/transactions/instances/multiAgentTransaction.js.map +1 -0
  534. package/dist/transactions/instances/rawTransaction.d.ts +142 -0
  535. package/dist/transactions/instances/rawTransaction.d.ts.map +1 -0
  536. package/dist/transactions/instances/rawTransaction.js +202 -0
  537. package/dist/transactions/instances/rawTransaction.js.map +1 -0
  538. package/dist/transactions/instances/rotationProofChallenge.d.ts +54 -0
  539. package/dist/transactions/instances/rotationProofChallenge.d.ts.map +1 -0
  540. package/dist/transactions/instances/rotationProofChallenge.js +70 -0
  541. package/dist/transactions/instances/rotationProofChallenge.js.map +1 -0
  542. package/dist/transactions/instances/signedTransaction.d.ts +53 -0
  543. package/dist/transactions/instances/signedTransaction.d.ts.map +1 -0
  544. package/dist/transactions/instances/signedTransaction.js +65 -0
  545. package/dist/transactions/instances/signedTransaction.js.map +1 -0
  546. package/dist/transactions/instances/simpleTransaction.d.ts +49 -0
  547. package/dist/transactions/instances/simpleTransaction.d.ts.map +1 -0
  548. package/dist/transactions/instances/simpleTransaction.js +73 -0
  549. package/dist/transactions/instances/simpleTransaction.js.map +1 -0
  550. package/dist/transactions/instances/transactionArgument.d.ts +71 -0
  551. package/dist/transactions/instances/transactionArgument.d.ts.map +1 -0
  552. package/dist/transactions/instances/transactionArgument.js +4 -0
  553. package/dist/transactions/instances/transactionArgument.js.map +1 -0
  554. package/dist/transactions/instances/transactionPayload.d.ts +369 -0
  555. package/dist/transactions/instances/transactionPayload.d.ts.map +1 -0
  556. package/dist/transactions/instances/transactionPayload.js +668 -0
  557. package/dist/transactions/instances/transactionPayload.js.map +1 -0
  558. package/dist/transactions/management/accountSequenceNumber.d.ts +114 -0
  559. package/dist/transactions/management/accountSequenceNumber.d.ts.map +1 -0
  560. package/dist/transactions/management/accountSequenceNumber.js +197 -0
  561. package/dist/transactions/management/accountSequenceNumber.js.map +1 -0
  562. package/dist/transactions/management/asyncQueue.d.ts +76 -0
  563. package/dist/transactions/management/asyncQueue.d.ts.map +1 -0
  564. package/dist/transactions/management/asyncQueue.js +105 -0
  565. package/dist/transactions/management/asyncQueue.js.map +1 -0
  566. package/dist/transactions/management/index.d.ts +3 -0
  567. package/dist/transactions/management/index.d.ts.map +1 -0
  568. package/dist/transactions/management/index.js +3 -0
  569. package/dist/transactions/management/index.js.map +1 -0
  570. package/dist/transactions/management/transactionWorker.d.ts +213 -0
  571. package/dist/transactions/management/transactionWorker.d.ts.map +1 -0
  572. package/dist/transactions/management/transactionWorker.js +347 -0
  573. package/dist/transactions/management/transactionWorker.js.map +1 -0
  574. package/dist/transactions/transactionBuilder/encryptPayload.d.ts +21 -0
  575. package/dist/transactions/transactionBuilder/encryptPayload.d.ts.map +1 -0
  576. package/dist/transactions/transactionBuilder/encryptPayload.js +157 -0
  577. package/dist/transactions/transactionBuilder/encryptPayload.js.map +1 -0
  578. package/dist/transactions/transactionBuilder/helpers.d.ts +184 -0
  579. package/dist/transactions/transactionBuilder/helpers.d.ts.map +1 -0
  580. package/dist/transactions/transactionBuilder/helpers.js +344 -0
  581. package/dist/transactions/transactionBuilder/helpers.js.map +1 -0
  582. package/dist/transactions/transactionBuilder/index.d.ts +6 -0
  583. package/dist/transactions/transactionBuilder/index.d.ts.map +1 -0
  584. package/dist/transactions/transactionBuilder/index.js +8 -0
  585. package/dist/transactions/transactionBuilder/index.js.map +1 -0
  586. package/dist/transactions/transactionBuilder/remoteAbi.d.ts +167 -0
  587. package/dist/transactions/transactionBuilder/remoteAbi.d.ts.map +1 -0
  588. package/dist/transactions/transactionBuilder/remoteAbi.js +1088 -0
  589. package/dist/transactions/transactionBuilder/remoteAbi.js.map +1 -0
  590. package/dist/transactions/transactionBuilder/signingMessage.d.ts +55 -0
  591. package/dist/transactions/transactionBuilder/signingMessage.d.ts.map +1 -0
  592. package/dist/transactions/transactionBuilder/signingMessage.js +94 -0
  593. package/dist/transactions/transactionBuilder/signingMessage.js.map +1 -0
  594. package/dist/transactions/transactionBuilder/structEnumParser.d.ts +225 -0
  595. package/dist/transactions/transactionBuilder/structEnumParser.d.ts.map +1 -0
  596. package/dist/transactions/transactionBuilder/structEnumParser.js +690 -0
  597. package/dist/transactions/transactionBuilder/structEnumParser.js.map +1 -0
  598. package/dist/transactions/transactionBuilder/transactionBuilder.d.ts +198 -0
  599. package/dist/transactions/transactionBuilder/transactionBuilder.d.ts.map +1 -0
  600. package/dist/transactions/transactionBuilder/transactionBuilder.js +586 -0
  601. package/dist/transactions/transactionBuilder/transactionBuilder.js.map +1 -0
  602. package/dist/transactions/typeTag/index.d.ts +544 -0
  603. package/dist/transactions/typeTag/index.d.ts.map +1 -0
  604. package/dist/transactions/typeTag/index.js +826 -0
  605. package/dist/transactions/typeTag/index.js.map +1 -0
  606. package/dist/transactions/typeTag/parser.d.ts +73 -0
  607. package/dist/transactions/typeTag/parser.d.ts.map +1 -0
  608. package/dist/transactions/typeTag/parser.js +368 -0
  609. package/dist/transactions/typeTag/parser.js.map +1 -0
  610. package/dist/transactions/types.d.ts +477 -0
  611. package/dist/transactions/types.d.ts.map +1 -0
  612. package/dist/transactions/types.js +4 -0
  613. package/dist/transactions/types.js.map +1 -0
  614. package/dist/types/abstraction.d.ts +14 -0
  615. package/dist/types/abstraction.d.ts.map +1 -0
  616. package/dist/types/abstraction.js +16 -0
  617. package/dist/types/abstraction.js.map +1 -0
  618. package/dist/types/ans.d.ts +113 -0
  619. package/dist/types/ans.d.ts.map +1 -0
  620. package/dist/types/ans.js +36 -0
  621. package/dist/types/ans.js.map +1 -0
  622. package/dist/types/generated/operations.d.ts +702 -0
  623. package/dist/types/generated/operations.d.ts.map +1 -0
  624. package/dist/types/generated/operations.js +2 -0
  625. package/dist/types/generated/operations.js.map +1 -0
  626. package/dist/types/generated/queries.d.ts +64 -0
  627. package/dist/types/generated/queries.d.ts.map +1 -0
  628. package/dist/types/generated/queries.js +729 -0
  629. package/dist/types/generated/queries.js.map +1 -0
  630. package/dist/types/generated/types.d.ts +9678 -0
  631. package/dist/types/generated/types.d.ts.map +1 -0
  632. package/dist/types/generated/types.js +1265 -0
  633. package/dist/types/generated/types.js.map +1 -0
  634. package/dist/types/index.d.ts +4 -0
  635. package/dist/types/index.d.ts.map +1 -0
  636. package/dist/types/index.js +4 -0
  637. package/dist/types/index.js.map +1 -0
  638. package/dist/types/indexer.d.ts +182 -0
  639. package/dist/types/indexer.d.ts.map +1 -0
  640. package/dist/types/indexer.js +4 -0
  641. package/dist/types/indexer.js.map +1 -0
  642. package/dist/types/keyless.d.ts +101 -0
  643. package/dist/types/keyless.d.ts.map +1 -0
  644. package/dist/types/keyless.js +2 -0
  645. package/dist/types/keyless.js.map +1 -0
  646. package/dist/types/types.d.ts +1572 -0
  647. package/dist/types/types.d.ts.map +1 -0
  648. package/dist/types/types.js +464 -0
  649. package/dist/types/types.js.map +1 -0
  650. package/dist/utils/apiEndpoints.d.ts +50 -0
  651. package/dist/utils/apiEndpoints.d.ts.map +1 -0
  652. package/dist/utils/apiEndpoints.js +100 -0
  653. package/dist/utils/apiEndpoints.js.map +1 -0
  654. package/dist/utils/const.d.ts +117 -0
  655. package/dist/utils/const.d.ts.map +1 -0
  656. package/dist/utils/const.js +121 -0
  657. package/dist/utils/const.js.map +1 -0
  658. package/dist/utils/helpers.d.ts +203 -0
  659. package/dist/utils/helpers.d.ts.map +1 -0
  660. package/dist/utils/helpers.js +330 -0
  661. package/dist/utils/helpers.js.map +1 -0
  662. package/dist/utils/index.d.ts +5 -0
  663. package/dist/utils/index.d.ts.map +1 -0
  664. package/dist/utils/index.js +5 -0
  665. package/dist/utils/index.js.map +1 -0
  666. package/dist/utils/memoize.d.ts +47 -0
  667. package/dist/utils/memoize.d.ts.map +1 -0
  668. package/dist/utils/memoize.js +195 -0
  669. package/dist/utils/memoize.js.map +1 -0
  670. package/dist/utils/normalizeBundle.d.ts +27 -0
  671. package/dist/utils/normalizeBundle.d.ts.map +1 -0
  672. package/dist/utils/normalizeBundle.js +18 -0
  673. package/dist/utils/normalizeBundle.js.map +1 -0
  674. package/dist/utils/runtime.d.ts +44 -0
  675. package/dist/utils/runtime.d.ts.map +1 -0
  676. package/dist/utils/runtime.js +71 -0
  677. package/dist/utils/runtime.js.map +1 -0
  678. package/dist/version.d.ts +7 -0
  679. package/dist/version.d.ts.map +1 -0
  680. package/dist/version.js +9 -0
  681. package/dist/version.js.map +1 -0
  682. package/package.json +107 -47
  683. package/src/account/AbstractKeylessAccount.ts +24 -30
  684. package/src/account/AbstractedAccount.ts +18 -16
  685. package/src/account/Account.ts +12 -9
  686. package/src/account/AccountUtils.ts +17 -20
  687. package/src/account/DerivableAbstractedAccount.ts +12 -10
  688. package/src/account/Ed25519Account.ts +8 -8
  689. package/src/account/EphemeralKeyPair.ts +9 -14
  690. package/src/account/FederatedKeylessAccount.ts +7 -7
  691. package/src/account/KeylessAccount.ts +12 -7
  692. package/src/account/MultiEd25519Account.ts +9 -9
  693. package/src/account/MultiKeyAccount.ts +15 -16
  694. package/src/account/SingleKeyAccount.ts +10 -13
  695. package/src/account/index.ts +17 -12
  696. package/src/account/keylessSigner.ts +34 -0
  697. package/src/account/utils.ts +3 -3
  698. package/src/api/account/abstraction.ts +12 -12
  699. package/src/api/account.ts +12 -12
  700. package/src/api/ans.ts +6 -6
  701. package/src/api/aptos.ts +115 -88
  702. package/src/api/aptosConfig.ts +6 -4
  703. package/src/api/coin.ts +6 -6
  704. package/src/api/digitalAsset.ts +9 -9
  705. package/src/api/faucet.ts +6 -6
  706. package/src/api/fungibleAsset.ts +10 -10
  707. package/src/api/general.ts +7 -7
  708. package/src/api/index.ts +2 -2
  709. package/src/api/keyless.ts +11 -7
  710. package/src/api/object.ts +6 -6
  711. package/src/api/staking.ts +11 -6
  712. package/src/api/table.ts +6 -6
  713. package/src/api/transaction.ts +13 -13
  714. package/src/api/transactionSubmission/build.ts +6 -6
  715. package/src/api/transactionSubmission/helpers.ts +2 -2
  716. package/src/api/transactionSubmission/management.ts +9 -5
  717. package/src/api/transactionSubmission/sign.ts +4 -4
  718. package/src/api/transactionSubmission/simulate.ts +6 -6
  719. package/src/api/transactionSubmission/submit.ts +5 -5
  720. package/src/api/utils.ts +4 -4
  721. package/src/bcs/consts.ts +14 -1
  722. package/src/bcs/deserializer.ts +3 -3
  723. package/src/bcs/index.ts +6 -6
  724. package/src/bcs/serializable/entryFunctionBytes.ts +5 -5
  725. package/src/bcs/serializable/fixedBytes.ts +5 -5
  726. package/src/bcs/serializable/movePrimitives.ts +34 -19
  727. package/src/bcs/serializable/moveStructs.ts +12 -12
  728. package/src/bcs/serializer.ts +24 -5
  729. package/src/cli/index.ts +2 -2
  730. package/src/cli/localNode.ts +1 -1
  731. package/src/cli/move.ts +6 -10
  732. package/src/client/core.ts +30 -15
  733. package/src/client/get.ts +6 -8
  734. package/src/client/index.ts +3 -3
  735. package/src/client/post.ts +4 -4
  736. package/src/core/account/index.ts +1 -1
  737. package/src/core/account/utils/address.ts +4 -4
  738. package/src/core/account/utils/index.ts +1 -1
  739. package/src/core/accountAddress.ts +8 -8
  740. package/src/core/authenticationKey.ts +22 -10
  741. package/src/core/crypto/abstraction.ts +7 -7
  742. package/src/core/crypto/anyKeyRegistry.ts +90 -0
  743. package/src/core/crypto/deserializationUtils.ts +11 -19
  744. package/src/core/crypto/ed25519.ts +22 -13
  745. package/src/core/crypto/encryption/ciphertext.ts +210 -0
  746. package/src/core/crypto/encryption/curveSerialization.ts +46 -0
  747. package/src/core/crypto/encryption/fieldSerialization.ts +82 -0
  748. package/src/core/crypto/encryption/index.ts +14 -0
  749. package/src/core/crypto/encryption/symmetric.ts +148 -0
  750. package/src/core/crypto/ephemeral.ts +7 -7
  751. package/src/core/crypto/federatedKeyless.ts +8 -8
  752. package/src/core/crypto/hdKey.ts +7 -3
  753. package/src/core/crypto/index.ts +24 -17
  754. package/src/core/crypto/keyless.ts +33 -33
  755. package/src/core/crypto/keylessRegistration.ts +34 -0
  756. package/src/core/crypto/multiEd25519.ts +7 -7
  757. package/src/core/crypto/multiKey.ts +8 -8
  758. package/src/core/crypto/poseidon.ts +2 -2
  759. package/src/core/crypto/privateKey.ts +5 -5
  760. package/src/core/crypto/proof.ts +1 -1
  761. package/src/core/crypto/publicKey.ts +6 -6
  762. package/src/core/crypto/secp256k1.ts +26 -19
  763. package/src/core/crypto/secp256r1.ts +26 -19
  764. package/src/core/crypto/signature.ts +2 -2
  765. package/src/core/crypto/singleKey.ts +58 -39
  766. package/src/core/crypto/types.ts +4 -4
  767. package/src/core/crypto/utils.ts +16 -12
  768. package/src/core/hex.ts +3 -3
  769. package/src/core/index.ts +6 -6
  770. package/src/errors/index.ts +3 -3
  771. package/src/functions/abstraction.ts +11 -0
  772. package/src/functions/account.ts +38 -0
  773. package/src/functions/ans.ts +26 -0
  774. package/src/functions/coin.ts +7 -0
  775. package/src/functions/digitalAsset.ts +32 -0
  776. package/src/functions/faucet.ts +7 -0
  777. package/src/functions/fungibleAsset.ts +13 -0
  778. package/src/functions/general.ts +14 -0
  779. package/src/functions/index.ts +21 -0
  780. package/src/functions/keyless.ts +42 -0
  781. package/src/functions/object.ts +10 -0
  782. package/src/functions/staking.ts +11 -0
  783. package/src/functions/table.ts +11 -0
  784. package/src/functions/transaction.ts +32 -0
  785. package/src/functions/view.ts +6 -0
  786. package/src/index.ts +36 -10
  787. package/src/internal/abstraction.ts +10 -10
  788. package/src/internal/account.ts +79 -51
  789. package/src/internal/ans.ts +31 -24
  790. package/src/internal/coin.ts +8 -8
  791. package/src/internal/digitalAsset.ts +14 -15
  792. package/src/internal/encryptionKey.ts +53 -0
  793. package/src/internal/faucet.ts +6 -6
  794. package/src/internal/fungibleAsset.ts +11 -11
  795. package/src/internal/general.ts +12 -7
  796. package/src/internal/keyless.ts +21 -18
  797. package/src/internal/object.ts +7 -7
  798. package/src/internal/staking.ts +6 -6
  799. package/src/internal/table.ts +7 -7
  800. package/src/internal/transaction.ts +11 -10
  801. package/src/internal/transactionSubmission.ts +92 -32
  802. package/src/internal/utils/index.ts +1 -1
  803. package/src/internal/utils/utils.ts +5 -5
  804. package/src/internal/view.ts +5 -5
  805. package/src/transactions/authenticator/account.ts +12 -12
  806. package/src/transactions/authenticator/index.ts +2 -2
  807. package/src/transactions/authenticator/transaction.ts +6 -6
  808. package/src/transactions/index.ts +6 -6
  809. package/src/transactions/instances/chainId.ts +2 -2
  810. package/src/transactions/instances/encryptedPayload.ts +149 -0
  811. package/src/transactions/instances/identifier.ts +2 -2
  812. package/src/transactions/instances/index.ts +11 -10
  813. package/src/transactions/instances/moduleId.ts +5 -5
  814. package/src/transactions/instances/multiAgentTransaction.ts +4 -4
  815. package/src/transactions/instances/rawTransaction.ts +6 -6
  816. package/src/transactions/instances/rotationProofChallenge.ts +5 -5
  817. package/src/transactions/instances/signedTransaction.ts +4 -4
  818. package/src/transactions/instances/simpleTransaction.ts +4 -4
  819. package/src/transactions/instances/transactionArgument.ts +2 -2
  820. package/src/transactions/instances/transactionPayload.ts +127 -28
  821. package/src/transactions/management/accountSequenceNumber.ts +13 -14
  822. package/src/transactions/management/index.ts +2 -2
  823. package/src/transactions/management/transactionWorker.ts +10 -10
  824. package/src/transactions/transactionBuilder/encryptPayload.ts +235 -0
  825. package/src/transactions/transactionBuilder/helpers.ts +8 -5
  826. package/src/transactions/transactionBuilder/index.ts +5 -4
  827. package/src/transactions/transactionBuilder/remoteAbi.ts +664 -25
  828. package/src/transactions/transactionBuilder/signingMessage.ts +6 -6
  829. package/src/transactions/transactionBuilder/structEnumParser.ts +848 -0
  830. package/src/transactions/transactionBuilder/transactionBuilder.ts +130 -72
  831. package/src/transactions/typeTag/index.ts +5 -5
  832. package/src/transactions/typeTag/parser.ts +3 -3
  833. package/src/transactions/types.ts +103 -19
  834. package/src/types/ans.ts +13 -5
  835. package/src/types/generated/operations.ts +4 -3
  836. package/src/types/generated/queries.ts +1 -1
  837. package/src/types/index.ts +3 -3
  838. package/src/types/indexer.ts +1 -1
  839. package/src/types/types.ts +74 -6
  840. package/src/utils/const.ts +14 -1
  841. package/src/utils/helpers.ts +58 -18
  842. package/src/utils/index.ts +4 -4
  843. package/src/utils/normalizeBundle.ts +1 -1
  844. package/src/utils/runtime.ts +86 -0
  845. package/src/version.ts +1 -1
  846. package/dist/common/account-DGpxrkAn.d.ts +0 -8156
  847. package/dist/common/chunk-2VR6ONNW.js +0 -4
  848. package/dist/common/chunk-2VR6ONNW.js.map +0 -1
  849. package/dist/common/cli/index.d.ts +0 -316
  850. package/dist/common/cli/index.js +0 -2
  851. package/dist/common/cli/index.js.map +0 -1
  852. package/dist/common/index.d.ts +0 -10912
  853. package/dist/common/index.js +0 -476
  854. package/dist/common/index.js.map +0 -1
  855. package/dist/esm/Ed25519Account-BCt2cu_M.d.mts +0 -628
  856. package/dist/esm/account/AbstractKeylessAccount.d.mts +0 -336
  857. package/dist/esm/account/AbstractKeylessAccount.mjs +0 -2
  858. package/dist/esm/account/AbstractKeylessAccount.mjs.map +0 -1
  859. package/dist/esm/account/AbstractedAccount.d.mts +0 -64
  860. package/dist/esm/account/AbstractedAccount.mjs +0 -2
  861. package/dist/esm/account/AbstractedAccount.mjs.map +0 -1
  862. package/dist/esm/account/Account.d.mts +0 -8
  863. package/dist/esm/account/Account.mjs +0 -2
  864. package/dist/esm/account/Account.mjs.map +0 -1
  865. package/dist/esm/account/AccountUtils.d.mts +0 -38
  866. package/dist/esm/account/AccountUtils.mjs +0 -2
  867. package/dist/esm/account/AccountUtils.mjs.map +0 -1
  868. package/dist/esm/account/DerivableAbstractedAccount.d.mts +0 -59
  869. package/dist/esm/account/DerivableAbstractedAccount.mjs +0 -2
  870. package/dist/esm/account/DerivableAbstractedAccount.mjs.map +0 -1
  871. package/dist/esm/account/Ed25519Account.d.mts +0 -8
  872. package/dist/esm/account/Ed25519Account.mjs +0 -2
  873. package/dist/esm/account/Ed25519Account.mjs.map +0 -1
  874. package/dist/esm/account/EphemeralKeyPair.d.mts +0 -165
  875. package/dist/esm/account/EphemeralKeyPair.mjs +0 -2
  876. package/dist/esm/account/EphemeralKeyPair.mjs.map +0 -1
  877. package/dist/esm/account/FederatedKeylessAccount.d.mts +0 -118
  878. package/dist/esm/account/FederatedKeylessAccount.mjs +0 -2
  879. package/dist/esm/account/FederatedKeylessAccount.mjs.map +0 -1
  880. package/dist/esm/account/KeylessAccount.d.mts +0 -124
  881. package/dist/esm/account/KeylessAccount.mjs +0 -2
  882. package/dist/esm/account/KeylessAccount.mjs.map +0 -1
  883. package/dist/esm/account/MultiEd25519Account.d.mts +0 -102
  884. package/dist/esm/account/MultiEd25519Account.mjs +0 -2
  885. package/dist/esm/account/MultiEd25519Account.mjs.map +0 -1
  886. package/dist/esm/account/MultiKeyAccount.d.mts +0 -206
  887. package/dist/esm/account/MultiKeyAccount.mjs +0 -2
  888. package/dist/esm/account/MultiKeyAccount.mjs.map +0 -1
  889. package/dist/esm/account/SingleKeyAccount.d.mts +0 -8
  890. package/dist/esm/account/SingleKeyAccount.mjs +0 -2
  891. package/dist/esm/account/SingleKeyAccount.mjs.map +0 -1
  892. package/dist/esm/account/index.d.mts +0 -24
  893. package/dist/esm/account/index.mjs +0 -2
  894. package/dist/esm/account/index.mjs.map +0 -1
  895. package/dist/esm/account/utils.d.mts +0 -14
  896. package/dist/esm/account/utils.mjs +0 -2
  897. package/dist/esm/account/utils.mjs.map +0 -1
  898. package/dist/esm/account-Dg0ejXHy.d.mts +0 -7358
  899. package/dist/esm/api/account/abstraction.d.mts +0 -181
  900. package/dist/esm/api/account/abstraction.mjs +0 -2
  901. package/dist/esm/api/account/abstraction.mjs.map +0 -1
  902. package/dist/esm/api/account.d.mts +0 -852
  903. package/dist/esm/api/account.mjs +0 -2
  904. package/dist/esm/api/account.mjs.map +0 -1
  905. package/dist/esm/api/ans.d.mts +0 -570
  906. package/dist/esm/api/ans.mjs +0 -2
  907. package/dist/esm/api/ans.mjs.map +0 -1
  908. package/dist/esm/api/aptos.d.mts +0 -114
  909. package/dist/esm/api/aptos.mjs +0 -2
  910. package/dist/esm/api/aptos.mjs.map +0 -1
  911. package/dist/esm/api/aptosConfig.d.mts +0 -7
  912. package/dist/esm/api/aptosConfig.mjs +0 -2
  913. package/dist/esm/api/aptosConfig.mjs.map +0 -1
  914. package/dist/esm/api/coin.d.mts +0 -81
  915. package/dist/esm/api/coin.mjs +0 -2
  916. package/dist/esm/api/coin.mjs.map +0 -1
  917. package/dist/esm/api/digitalAsset.d.mts +0 -1030
  918. package/dist/esm/api/digitalAsset.mjs +0 -2
  919. package/dist/esm/api/digitalAsset.mjs.map +0 -1
  920. package/dist/esm/api/faucet.d.mts +0 -80
  921. package/dist/esm/api/faucet.mjs +0 -2
  922. package/dist/esm/api/faucet.mjs.map +0 -1
  923. package/dist/esm/api/fungibleAsset.d.mts +0 -288
  924. package/dist/esm/api/fungibleAsset.mjs +0 -2
  925. package/dist/esm/api/fungibleAsset.mjs.map +0 -1
  926. package/dist/esm/api/general.d.mts +0 -303
  927. package/dist/esm/api/general.mjs +0 -2
  928. package/dist/esm/api/general.mjs.map +0 -1
  929. package/dist/esm/api/index.d.mts +0 -47
  930. package/dist/esm/api/index.mjs +0 -2
  931. package/dist/esm/api/index.mjs.map +0 -1
  932. package/dist/esm/api/keyless.d.mts +0 -170
  933. package/dist/esm/api/keyless.mjs +0 -2
  934. package/dist/esm/api/keyless.mjs.map +0 -1
  935. package/dist/esm/api/object.d.mts +0 -80
  936. package/dist/esm/api/object.mjs +0 -2
  937. package/dist/esm/api/object.mjs.map +0 -1
  938. package/dist/esm/api/staking.d.mts +0 -134
  939. package/dist/esm/api/staking.mjs +0 -2
  940. package/dist/esm/api/staking.mjs.map +0 -1
  941. package/dist/esm/api/table.d.mts +0 -169
  942. package/dist/esm/api/table.mjs +0 -2
  943. package/dist/esm/api/table.mjs.map +0 -1
  944. package/dist/esm/api/transaction.d.mts +0 -681
  945. package/dist/esm/api/transaction.mjs +0 -2
  946. package/dist/esm/api/transaction.mjs.map +0 -1
  947. package/dist/esm/api/transactionSubmission/build.d.mts +0 -141
  948. package/dist/esm/api/transactionSubmission/build.mjs +0 -2
  949. package/dist/esm/api/transactionSubmission/build.mjs.map +0 -1
  950. package/dist/esm/api/transactionSubmission/helpers.d.mts +0 -98
  951. package/dist/esm/api/transactionSubmission/helpers.mjs +0 -2
  952. package/dist/esm/api/transactionSubmission/helpers.mjs.map +0 -1
  953. package/dist/esm/api/transactionSubmission/management.d.mts +0 -168
  954. package/dist/esm/api/transactionSubmission/management.mjs +0 -2
  955. package/dist/esm/api/transactionSubmission/management.mjs.map +0 -1
  956. package/dist/esm/api/transactionSubmission/sign.d.mts +0 -124
  957. package/dist/esm/api/transactionSubmission/sign.mjs +0 -2
  958. package/dist/esm/api/transactionSubmission/sign.mjs.map +0 -1
  959. package/dist/esm/api/transactionSubmission/simulate.d.mts +0 -181
  960. package/dist/esm/api/transactionSubmission/simulate.mjs +0 -2
  961. package/dist/esm/api/transactionSubmission/simulate.mjs.map +0 -1
  962. package/dist/esm/api/transactionSubmission/submit.d.mts +0 -142
  963. package/dist/esm/api/transactionSubmission/submit.mjs +0 -2
  964. package/dist/esm/api/transactionSubmission/submit.mjs.map +0 -1
  965. package/dist/esm/api/utils.d.mts +0 -45
  966. package/dist/esm/api/utils.mjs +0 -2
  967. package/dist/esm/api/utils.mjs.map +0 -1
  968. package/dist/esm/bcs/consts.d.mts +0 -28
  969. package/dist/esm/bcs/consts.mjs +0 -2
  970. package/dist/esm/bcs/consts.mjs.map +0 -1
  971. package/dist/esm/bcs/deserializer.d.mts +0 -7
  972. package/dist/esm/bcs/deserializer.mjs +0 -2
  973. package/dist/esm/bcs/deserializer.mjs.map +0 -1
  974. package/dist/esm/bcs/index.d.mts +0 -8
  975. package/dist/esm/bcs/index.mjs +0 -2
  976. package/dist/esm/bcs/index.mjs.map +0 -1
  977. package/dist/esm/bcs/serializable/entryFunctionBytes.d.mts +0 -65
  978. package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +0 -2
  979. package/dist/esm/bcs/serializable/entryFunctionBytes.mjs.map +0 -1
  980. package/dist/esm/bcs/serializable/fixedBytes.d.mts +0 -7
  981. package/dist/esm/bcs/serializable/fixedBytes.mjs +0 -2
  982. package/dist/esm/bcs/serializable/fixedBytes.mjs.map +0 -1
  983. package/dist/esm/bcs/serializable/movePrimitives.d.mts +0 -7
  984. package/dist/esm/bcs/serializable/movePrimitives.mjs +0 -2
  985. package/dist/esm/bcs/serializable/movePrimitives.mjs.map +0 -1
  986. package/dist/esm/bcs/serializable/moveStructs.d.mts +0 -7
  987. package/dist/esm/bcs/serializable/moveStructs.mjs +0 -2
  988. package/dist/esm/bcs/serializable/moveStructs.mjs.map +0 -1
  989. package/dist/esm/bcs/serializer.d.mts +0 -7
  990. package/dist/esm/bcs/serializer.mjs +0 -2
  991. package/dist/esm/bcs/serializer.mjs.map +0 -1
  992. package/dist/esm/chunk-2CH5QB7U.mjs +0 -4
  993. package/dist/esm/chunk-2CH5QB7U.mjs.map +0 -1
  994. package/dist/esm/chunk-2VBY2V4Z.mjs +0 -2
  995. package/dist/esm/chunk-2VBY2V4Z.mjs.map +0 -1
  996. package/dist/esm/chunk-44MMFX5F.mjs +0 -2
  997. package/dist/esm/chunk-44MMFX5F.mjs.map +0 -1
  998. package/dist/esm/chunk-4QMXOWHP.mjs +0 -1
  999. package/dist/esm/chunk-4QMXOWHP.mjs.map +0 -1
  1000. package/dist/esm/chunk-4WPQQPUF.mjs +0 -1
  1001. package/dist/esm/chunk-4WPQQPUF.mjs.map +0 -1
  1002. package/dist/esm/chunk-5HHC2YG4.mjs +0 -2
  1003. package/dist/esm/chunk-5HHC2YG4.mjs.map +0 -1
  1004. package/dist/esm/chunk-5HXLZHDW.mjs +0 -1
  1005. package/dist/esm/chunk-5HXLZHDW.mjs.map +0 -1
  1006. package/dist/esm/chunk-5LMLIRGK.mjs +0 -2
  1007. package/dist/esm/chunk-5LMLIRGK.mjs.map +0 -1
  1008. package/dist/esm/chunk-66F7RP7K.mjs +0 -2
  1009. package/dist/esm/chunk-66F7RP7K.mjs.map +0 -1
  1010. package/dist/esm/chunk-7ECCT6PK.mjs +0 -1
  1011. package/dist/esm/chunk-7ECCT6PK.mjs.map +0 -1
  1012. package/dist/esm/chunk-A5L76YP7.mjs +0 -2
  1013. package/dist/esm/chunk-A5L76YP7.mjs.map +0 -1
  1014. package/dist/esm/chunk-A7SQEK23.mjs +0 -2
  1015. package/dist/esm/chunk-A7SQEK23.mjs.map +0 -1
  1016. package/dist/esm/chunk-ASFFADWS.mjs +0 -7
  1017. package/dist/esm/chunk-ASFFADWS.mjs.map +0 -1
  1018. package/dist/esm/chunk-BT742BFQ.mjs +0 -2
  1019. package/dist/esm/chunk-BT742BFQ.mjs.map +0 -1
  1020. package/dist/esm/chunk-C2KVLMPH.mjs +0 -2
  1021. package/dist/esm/chunk-C2KVLMPH.mjs.map +0 -1
  1022. package/dist/esm/chunk-C3Q23D22.mjs +0 -2
  1023. package/dist/esm/chunk-C3Q23D22.mjs.map +0 -1
  1024. package/dist/esm/chunk-CD3EZCI5.mjs +0 -2
  1025. package/dist/esm/chunk-CD3EZCI5.mjs.map +0 -1
  1026. package/dist/esm/chunk-DE5K76I2.mjs +0 -1
  1027. package/dist/esm/chunk-DE5K76I2.mjs.map +0 -1
  1028. package/dist/esm/chunk-E3DHFXN4.mjs +0 -2
  1029. package/dist/esm/chunk-E3DHFXN4.mjs.map +0 -1
  1030. package/dist/esm/chunk-EIWPAECI.mjs +0 -2
  1031. package/dist/esm/chunk-EIWPAECI.mjs.map +0 -1
  1032. package/dist/esm/chunk-F45HI7LU.mjs +0 -2
  1033. package/dist/esm/chunk-F45HI7LU.mjs.map +0 -1
  1034. package/dist/esm/chunk-F4LHBGG2.mjs +0 -2
  1035. package/dist/esm/chunk-F4LHBGG2.mjs.map +0 -1
  1036. package/dist/esm/chunk-F5KAWYF5.mjs +0 -2
  1037. package/dist/esm/chunk-F5KAWYF5.mjs.map +0 -1
  1038. package/dist/esm/chunk-FDHHQUS3.mjs +0 -4
  1039. package/dist/esm/chunk-FDHHQUS3.mjs.map +0 -1
  1040. package/dist/esm/chunk-FZY4PMEE.mjs +0 -1
  1041. package/dist/esm/chunk-FZY4PMEE.mjs.map +0 -1
  1042. package/dist/esm/chunk-G3MHXDYA.mjs +0 -1
  1043. package/dist/esm/chunk-G3MHXDYA.mjs.map +0 -1
  1044. package/dist/esm/chunk-G5OONGWS.mjs +0 -488
  1045. package/dist/esm/chunk-G5OONGWS.mjs.map +0 -1
  1046. package/dist/esm/chunk-HGLO5LDS.mjs +0 -1
  1047. package/dist/esm/chunk-HGLO5LDS.mjs.map +0 -1
  1048. package/dist/esm/chunk-IF4UU2MT.mjs +0 -2
  1049. package/dist/esm/chunk-IF4UU2MT.mjs.map +0 -1
  1050. package/dist/esm/chunk-ITZN23GU.mjs +0 -2
  1051. package/dist/esm/chunk-ITZN23GU.mjs.map +0 -1
  1052. package/dist/esm/chunk-J73MMLF7.mjs +0 -2
  1053. package/dist/esm/chunk-J73MMLF7.mjs.map +0 -1
  1054. package/dist/esm/chunk-KDMSOCZY.mjs +0 -2
  1055. package/dist/esm/chunk-KDMSOCZY.mjs.map +0 -1
  1056. package/dist/esm/chunk-LTZRUAGD.mjs +0 -2
  1057. package/dist/esm/chunk-LTZRUAGD.mjs.map +0 -1
  1058. package/dist/esm/chunk-M65PXVDO.mjs +0 -2
  1059. package/dist/esm/chunk-M65PXVDO.mjs.map +0 -1
  1060. package/dist/esm/chunk-NECL5FCQ.mjs +0 -1
  1061. package/dist/esm/chunk-NECL5FCQ.mjs.map +0 -1
  1062. package/dist/esm/chunk-NP2IAUME.mjs +0 -2
  1063. package/dist/esm/chunk-NP2IAUME.mjs.map +0 -1
  1064. package/dist/esm/chunk-NTREJSOS.mjs +0 -2
  1065. package/dist/esm/chunk-NTREJSOS.mjs.map +0 -1
  1066. package/dist/esm/chunk-OAK2V35A.mjs +0 -2
  1067. package/dist/esm/chunk-OAK2V35A.mjs.map +0 -1
  1068. package/dist/esm/chunk-ODNZJSOC.mjs +0 -2
  1069. package/dist/esm/chunk-ODNZJSOC.mjs.map +0 -1
  1070. package/dist/esm/chunk-P5HCJN3A.mjs +0 -2
  1071. package/dist/esm/chunk-P5HCJN3A.mjs.map +0 -1
  1072. package/dist/esm/chunk-POQ4FT4E.mjs +0 -2
  1073. package/dist/esm/chunk-POQ4FT4E.mjs.map +0 -1
  1074. package/dist/esm/chunk-Q5ESW36C.mjs +0 -2
  1075. package/dist/esm/chunk-Q5ESW36C.mjs.map +0 -1
  1076. package/dist/esm/chunk-QFUXOL34.mjs +0 -2
  1077. package/dist/esm/chunk-QFUXOL34.mjs.map +0 -1
  1078. package/dist/esm/chunk-QRW7MQDA.mjs +0 -2
  1079. package/dist/esm/chunk-QRW7MQDA.mjs.map +0 -1
  1080. package/dist/esm/chunk-R7PCBRRT.mjs +0 -2
  1081. package/dist/esm/chunk-R7PCBRRT.mjs.map +0 -1
  1082. package/dist/esm/chunk-STY74NUA.mjs +0 -2
  1083. package/dist/esm/chunk-STY74NUA.mjs.map +0 -1
  1084. package/dist/esm/chunk-TAHLOBRG.mjs +0 -2
  1085. package/dist/esm/chunk-TAHLOBRG.mjs.map +0 -1
  1086. package/dist/esm/chunk-TEI33TO7.mjs +0 -2
  1087. package/dist/esm/chunk-TEI33TO7.mjs.map +0 -1
  1088. package/dist/esm/chunk-TSPG5VED.mjs +0 -2
  1089. package/dist/esm/chunk-TSPG5VED.mjs.map +0 -1
  1090. package/dist/esm/chunk-UBPX6GOS.mjs +0 -2
  1091. package/dist/esm/chunk-UBPX6GOS.mjs.map +0 -1
  1092. package/dist/esm/chunk-UPHD2B4I.mjs +0 -2
  1093. package/dist/esm/chunk-UPHD2B4I.mjs.map +0 -1
  1094. package/dist/esm/chunk-UVJW4DPP.mjs +0 -2
  1095. package/dist/esm/chunk-UVJW4DPP.mjs.map +0 -1
  1096. package/dist/esm/chunk-UYG4XVVO.mjs +0 -2
  1097. package/dist/esm/chunk-UYG4XVVO.mjs.map +0 -1
  1098. package/dist/esm/chunk-UYVPNUH3.mjs +0 -1
  1099. package/dist/esm/chunk-UYVPNUH3.mjs.map +0 -1
  1100. package/dist/esm/chunk-V3MBJJTL.mjs +0 -1
  1101. package/dist/esm/chunk-V3MBJJTL.mjs.map +0 -1
  1102. package/dist/esm/chunk-WD3SPNH7.mjs +0 -2
  1103. package/dist/esm/chunk-WD3SPNH7.mjs.map +0 -1
  1104. package/dist/esm/chunk-WFZFTRRS.mjs +0 -2
  1105. package/dist/esm/chunk-WFZFTRRS.mjs.map +0 -1
  1106. package/dist/esm/chunk-WVKZFOPV.mjs +0 -2
  1107. package/dist/esm/chunk-WVKZFOPV.mjs.map +0 -1
  1108. package/dist/esm/chunk-X2TPNKLV.mjs +0 -2
  1109. package/dist/esm/chunk-X2TPNKLV.mjs.map +0 -1
  1110. package/dist/esm/chunk-YJVBGKWM.mjs +0 -2
  1111. package/dist/esm/chunk-YJVBGKWM.mjs.map +0 -1
  1112. package/dist/esm/chunk-ZP4DWSQA.mjs +0 -2
  1113. package/dist/esm/chunk-ZP4DWSQA.mjs.map +0 -1
  1114. package/dist/esm/cli/index.d.mts +0 -10
  1115. package/dist/esm/cli/index.mjs +0 -2
  1116. package/dist/esm/cli/index.mjs.map +0 -1
  1117. package/dist/esm/cli/localNode.d.mts +0 -67
  1118. package/dist/esm/cli/localNode.mjs +0 -2
  1119. package/dist/esm/cli/localNode.mjs.map +0 -1
  1120. package/dist/esm/cli/move.d.mts +0 -257
  1121. package/dist/esm/cli/move.mjs +0 -2
  1122. package/dist/esm/cli/move.mjs.map +0 -1
  1123. package/dist/esm/client/core.d.mts +0 -43
  1124. package/dist/esm/client/core.mjs +0 -2
  1125. package/dist/esm/client/core.mjs.map +0 -1
  1126. package/dist/esm/client/get.d.mts +0 -125
  1127. package/dist/esm/client/get.mjs +0 -2
  1128. package/dist/esm/client/get.mjs.map +0 -1
  1129. package/dist/esm/client/index.d.mts +0 -10
  1130. package/dist/esm/client/index.mjs +0 -2
  1131. package/dist/esm/client/index.mjs.map +0 -1
  1132. package/dist/esm/client/post.d.mts +0 -161
  1133. package/dist/esm/client/post.mjs +0 -2
  1134. package/dist/esm/client/post.mjs.map +0 -1
  1135. package/dist/esm/core/account/index.d.mts +0 -8
  1136. package/dist/esm/core/account/index.mjs +0 -2
  1137. package/dist/esm/core/account/index.mjs.map +0 -1
  1138. package/dist/esm/core/account/utils/address.d.mts +0 -55
  1139. package/dist/esm/core/account/utils/address.mjs +0 -2
  1140. package/dist/esm/core/account/utils/address.mjs.map +0 -1
  1141. package/dist/esm/core/account/utils/index.d.mts +0 -8
  1142. package/dist/esm/core/account/utils/index.mjs +0 -2
  1143. package/dist/esm/core/account/utils/index.mjs.map +0 -1
  1144. package/dist/esm/core/accountAddress.d.mts +0 -7
  1145. package/dist/esm/core/accountAddress.mjs +0 -2
  1146. package/dist/esm/core/accountAddress.mjs.map +0 -1
  1147. package/dist/esm/core/authenticationKey.d.mts +0 -7
  1148. package/dist/esm/core/authenticationKey.mjs +0 -2
  1149. package/dist/esm/core/authenticationKey.mjs.map +0 -1
  1150. package/dist/esm/core/common.d.mts +0 -52
  1151. package/dist/esm/core/common.mjs +0 -2
  1152. package/dist/esm/core/common.mjs.map +0 -1
  1153. package/dist/esm/core/crypto/abstraction.d.mts +0 -24
  1154. package/dist/esm/core/crypto/abstraction.mjs +0 -2
  1155. package/dist/esm/core/crypto/abstraction.mjs.map +0 -1
  1156. package/dist/esm/core/crypto/deserializationUtils.d.mts +0 -28
  1157. package/dist/esm/core/crypto/deserializationUtils.mjs +0 -2
  1158. package/dist/esm/core/crypto/deserializationUtils.mjs.map +0 -1
  1159. package/dist/esm/core/crypto/ed25519.d.mts +0 -7
  1160. package/dist/esm/core/crypto/ed25519.mjs +0 -2
  1161. package/dist/esm/core/crypto/ed25519.mjs.map +0 -1
  1162. package/dist/esm/core/crypto/ephemeral.d.mts +0 -116
  1163. package/dist/esm/core/crypto/ephemeral.mjs +0 -2
  1164. package/dist/esm/core/crypto/ephemeral.mjs.map +0 -1
  1165. package/dist/esm/core/crypto/federatedKeyless.d.mts +0 -13
  1166. package/dist/esm/core/crypto/federatedKeyless.mjs +0 -2
  1167. package/dist/esm/core/crypto/federatedKeyless.mjs.map +0 -1
  1168. package/dist/esm/core/crypto/hdKey.d.mts +0 -95
  1169. package/dist/esm/core/crypto/hdKey.mjs +0 -2
  1170. package/dist/esm/core/crypto/hdKey.mjs.map +0 -1
  1171. package/dist/esm/core/crypto/index.d.mts +0 -19
  1172. package/dist/esm/core/crypto/index.mjs +0 -2
  1173. package/dist/esm/core/crypto/index.mjs.map +0 -1
  1174. package/dist/esm/core/crypto/keyless.d.mts +0 -13
  1175. package/dist/esm/core/crypto/keyless.mjs +0 -2
  1176. package/dist/esm/core/crypto/keyless.mjs.map +0 -1
  1177. package/dist/esm/core/crypto/multiEd25519.d.mts +0 -7
  1178. package/dist/esm/core/crypto/multiEd25519.mjs +0 -2
  1179. package/dist/esm/core/crypto/multiEd25519.mjs.map +0 -1
  1180. package/dist/esm/core/crypto/multiKey.d.mts +0 -7
  1181. package/dist/esm/core/crypto/multiKey.mjs +0 -2
  1182. package/dist/esm/core/crypto/multiKey.mjs.map +0 -1
  1183. package/dist/esm/core/crypto/poseidon.d.mts +0 -59
  1184. package/dist/esm/core/crypto/poseidon.mjs +0 -2
  1185. package/dist/esm/core/crypto/poseidon.mjs.map +0 -1
  1186. package/dist/esm/core/crypto/privateKey.d.mts +0 -7
  1187. package/dist/esm/core/crypto/privateKey.mjs +0 -2
  1188. package/dist/esm/core/crypto/privateKey.mjs.map +0 -1
  1189. package/dist/esm/core/crypto/proof.d.mts +0 -18
  1190. package/dist/esm/core/crypto/proof.mjs +0 -2
  1191. package/dist/esm/core/crypto/proof.mjs.map +0 -1
  1192. package/dist/esm/core/crypto/publicKey.d.mts +0 -7
  1193. package/dist/esm/core/crypto/publicKey.mjs +0 -2
  1194. package/dist/esm/core/crypto/publicKey.mjs.map +0 -1
  1195. package/dist/esm/core/crypto/secp256k1.d.mts +0 -7
  1196. package/dist/esm/core/crypto/secp256k1.mjs +0 -2
  1197. package/dist/esm/core/crypto/secp256k1.mjs.map +0 -1
  1198. package/dist/esm/core/crypto/secp256r1.d.mts +0 -306
  1199. package/dist/esm/core/crypto/secp256r1.mjs +0 -2
  1200. package/dist/esm/core/crypto/secp256r1.mjs.map +0 -1
  1201. package/dist/esm/core/crypto/signature.d.mts +0 -7
  1202. package/dist/esm/core/crypto/signature.mjs +0 -2
  1203. package/dist/esm/core/crypto/signature.mjs.map +0 -1
  1204. package/dist/esm/core/crypto/singleKey.d.mts +0 -7
  1205. package/dist/esm/core/crypto/singleKey.mjs +0 -2
  1206. package/dist/esm/core/crypto/singleKey.mjs.map +0 -1
  1207. package/dist/esm/core/crypto/types.d.mts +0 -11
  1208. package/dist/esm/core/crypto/types.mjs +0 -2
  1209. package/dist/esm/core/crypto/types.mjs.map +0 -1
  1210. package/dist/esm/core/crypto/utils.d.mts +0 -23
  1211. package/dist/esm/core/crypto/utils.mjs +0 -2
  1212. package/dist/esm/core/crypto/utils.mjs.map +0 -1
  1213. package/dist/esm/core/hex.d.mts +0 -7
  1214. package/dist/esm/core/hex.mjs +0 -2
  1215. package/dist/esm/core/hex.mjs.map +0 -1
  1216. package/dist/esm/core/index.d.mts +0 -20
  1217. package/dist/esm/core/index.mjs +0 -2
  1218. package/dist/esm/core/index.mjs.map +0 -1
  1219. package/dist/esm/errors/index.d.mts +0 -131
  1220. package/dist/esm/errors/index.mjs +0 -2
  1221. package/dist/esm/errors/index.mjs.map +0 -1
  1222. package/dist/esm/federatedKeyless-BYLu31Sa.d.mts +0 -880
  1223. package/dist/esm/index.d.mts +0 -72
  1224. package/dist/esm/index.mjs +0 -2
  1225. package/dist/esm/index.mjs.map +0 -1
  1226. package/dist/esm/internal/abstraction.d.mts +0 -27
  1227. package/dist/esm/internal/abstraction.mjs +0 -2
  1228. package/dist/esm/internal/abstraction.mjs.map +0 -1
  1229. package/dist/esm/internal/account.d.mts +0 -453
  1230. package/dist/esm/internal/account.mjs +0 -2
  1231. package/dist/esm/internal/account.mjs.map +0 -1
  1232. package/dist/esm/internal/ans.d.mts +0 -417
  1233. package/dist/esm/internal/ans.mjs +0 -2
  1234. package/dist/esm/internal/ans.mjs.map +0 -1
  1235. package/dist/esm/internal/coin.d.mts +0 -31
  1236. package/dist/esm/internal/coin.mjs +0 -2
  1237. package/dist/esm/internal/coin.mjs.map +0 -1
  1238. package/dist/esm/internal/digitalAsset.d.mts +0 -580
  1239. package/dist/esm/internal/digitalAsset.mjs +0 -2
  1240. package/dist/esm/internal/digitalAsset.mjs.map +0 -1
  1241. package/dist/esm/internal/faucet.d.mts +0 -42
  1242. package/dist/esm/internal/faucet.mjs +0 -2
  1243. package/dist/esm/internal/faucet.mjs.map +0 -1
  1244. package/dist/esm/internal/fungibleAsset.d.mts +0 -112
  1245. package/dist/esm/internal/fungibleAsset.mjs +0 -2
  1246. package/dist/esm/internal/fungibleAsset.mjs.map +0 -1
  1247. package/dist/esm/internal/general.d.mts +0 -94
  1248. package/dist/esm/internal/general.mjs +0 -2
  1249. package/dist/esm/internal/general.mjs.map +0 -1
  1250. package/dist/esm/internal/keyless.d.mts +0 -111
  1251. package/dist/esm/internal/keyless.mjs +0 -2
  1252. package/dist/esm/internal/keyless.mjs.map +0 -1
  1253. package/dist/esm/internal/object.d.mts +0 -42
  1254. package/dist/esm/internal/object.mjs +0 -2
  1255. package/dist/esm/internal/object.mjs.map +0 -1
  1256. package/dist/esm/internal/staking.d.mts +0 -60
  1257. package/dist/esm/internal/staking.mjs +0 -2
  1258. package/dist/esm/internal/staking.mjs.map +0 -1
  1259. package/dist/esm/internal/table.d.mts +0 -66
  1260. package/dist/esm/internal/table.mjs +0 -2
  1261. package/dist/esm/internal/table.mjs.map +0 -1
  1262. package/dist/esm/internal/transaction.d.mts +0 -199
  1263. package/dist/esm/internal/transaction.mjs +0 -2
  1264. package/dist/esm/internal/transaction.mjs.map +0 -1
  1265. package/dist/esm/internal/transactionSubmission.d.mts +0 -165
  1266. package/dist/esm/internal/transactionSubmission.mjs +0 -2
  1267. package/dist/esm/internal/transactionSubmission.mjs.map +0 -1
  1268. package/dist/esm/internal/utils/index.d.mts +0 -8
  1269. package/dist/esm/internal/utils/index.mjs +0 -2
  1270. package/dist/esm/internal/utils/index.mjs.map +0 -1
  1271. package/dist/esm/internal/utils/utils.d.mts +0 -41
  1272. package/dist/esm/internal/utils/utils.mjs +0 -2
  1273. package/dist/esm/internal/utils/utils.mjs.map +0 -1
  1274. package/dist/esm/internal/view.d.mts +0 -20
  1275. package/dist/esm/internal/view.mjs +0 -2
  1276. package/dist/esm/internal/view.mjs.map +0 -1
  1277. package/dist/esm/transactions/authenticator/account.d.mts +0 -7
  1278. package/dist/esm/transactions/authenticator/account.mjs +0 -2
  1279. package/dist/esm/transactions/authenticator/account.mjs.map +0 -1
  1280. package/dist/esm/transactions/authenticator/index.d.mts +0 -8
  1281. package/dist/esm/transactions/authenticator/index.mjs +0 -2
  1282. package/dist/esm/transactions/authenticator/index.mjs.map +0 -1
  1283. package/dist/esm/transactions/authenticator/transaction.d.mts +0 -152
  1284. package/dist/esm/transactions/authenticator/transaction.mjs +0 -2
  1285. package/dist/esm/transactions/authenticator/transaction.mjs.map +0 -1
  1286. package/dist/esm/transactions/index.d.mts +0 -15
  1287. package/dist/esm/transactions/index.mjs +0 -2
  1288. package/dist/esm/transactions/index.mjs.map +0 -1
  1289. package/dist/esm/transactions/instances/chainId.d.mts +0 -7
  1290. package/dist/esm/transactions/instances/chainId.mjs +0 -2
  1291. package/dist/esm/transactions/instances/chainId.mjs.map +0 -1
  1292. package/dist/esm/transactions/instances/identifier.d.mts +0 -7
  1293. package/dist/esm/transactions/instances/identifier.mjs +0 -2
  1294. package/dist/esm/transactions/instances/identifier.mjs.map +0 -1
  1295. package/dist/esm/transactions/instances/index.d.mts +0 -10
  1296. package/dist/esm/transactions/instances/index.mjs +0 -2
  1297. package/dist/esm/transactions/instances/index.mjs.map +0 -1
  1298. package/dist/esm/transactions/instances/moduleId.d.mts +0 -7
  1299. package/dist/esm/transactions/instances/moduleId.mjs +0 -2
  1300. package/dist/esm/transactions/instances/moduleId.mjs.map +0 -1
  1301. package/dist/esm/transactions/instances/multiAgentTransaction.d.mts +0 -7
  1302. package/dist/esm/transactions/instances/multiAgentTransaction.mjs +0 -2
  1303. package/dist/esm/transactions/instances/multiAgentTransaction.mjs.map +0 -1
  1304. package/dist/esm/transactions/instances/rawTransaction.d.mts +0 -7
  1305. package/dist/esm/transactions/instances/rawTransaction.mjs +0 -2
  1306. package/dist/esm/transactions/instances/rawTransaction.mjs.map +0 -1
  1307. package/dist/esm/transactions/instances/rotationProofChallenge.d.mts +0 -58
  1308. package/dist/esm/transactions/instances/rotationProofChallenge.mjs +0 -2
  1309. package/dist/esm/transactions/instances/rotationProofChallenge.mjs.map +0 -1
  1310. package/dist/esm/transactions/instances/signedTransaction.d.mts +0 -59
  1311. package/dist/esm/transactions/instances/signedTransaction.mjs +0 -2
  1312. package/dist/esm/transactions/instances/signedTransaction.mjs.map +0 -1
  1313. package/dist/esm/transactions/instances/simpleTransaction.d.mts +0 -7
  1314. package/dist/esm/transactions/instances/simpleTransaction.mjs +0 -2
  1315. package/dist/esm/transactions/instances/simpleTransaction.mjs.map +0 -1
  1316. package/dist/esm/transactions/instances/transactionArgument.d.mts +0 -7
  1317. package/dist/esm/transactions/instances/transactionArgument.mjs +0 -2
  1318. package/dist/esm/transactions/instances/transactionArgument.mjs.map +0 -1
  1319. package/dist/esm/transactions/instances/transactionPayload.d.mts +0 -7
  1320. package/dist/esm/transactions/instances/transactionPayload.mjs +0 -2
  1321. package/dist/esm/transactions/instances/transactionPayload.mjs.map +0 -1
  1322. package/dist/esm/transactions/management/accountSequenceNumber.d.mts +0 -123
  1323. package/dist/esm/transactions/management/accountSequenceNumber.mjs +0 -2
  1324. package/dist/esm/transactions/management/accountSequenceNumber.mjs.map +0 -1
  1325. package/dist/esm/transactions/management/asyncQueue.d.mts +0 -77
  1326. package/dist/esm/transactions/management/asyncQueue.mjs +0 -2
  1327. package/dist/esm/transactions/management/asyncQueue.mjs.map +0 -1
  1328. package/dist/esm/transactions/management/index.d.mts +0 -12
  1329. package/dist/esm/transactions/management/index.mjs +0 -2
  1330. package/dist/esm/transactions/management/index.mjs.map +0 -1
  1331. package/dist/esm/transactions/management/transactionWorker.d.mts +0 -218
  1332. package/dist/esm/transactions/management/transactionWorker.mjs +0 -2
  1333. package/dist/esm/transactions/management/transactionWorker.mjs.map +0 -1
  1334. package/dist/esm/transactions/transactionBuilder/helpers.d.mts +0 -189
  1335. package/dist/esm/transactions/transactionBuilder/helpers.mjs +0 -2
  1336. package/dist/esm/transactions/transactionBuilder/helpers.mjs.map +0 -1
  1337. package/dist/esm/transactions/transactionBuilder/index.d.mts +0 -11
  1338. package/dist/esm/transactions/transactionBuilder/index.mjs +0 -2
  1339. package/dist/esm/transactions/transactionBuilder/index.mjs.map +0 -1
  1340. package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +0 -105
  1341. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +0 -2
  1342. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs.map +0 -1
  1343. package/dist/esm/transactions/transactionBuilder/signingMessage.d.mts +0 -62
  1344. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +0 -2
  1345. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs.map +0 -1
  1346. package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +0 -192
  1347. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +0 -2
  1348. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs.map +0 -1
  1349. package/dist/esm/transactions/typeTag/index.d.mts +0 -7
  1350. package/dist/esm/transactions/typeTag/index.mjs +0 -2
  1351. package/dist/esm/transactions/typeTag/index.mjs.map +0 -1
  1352. package/dist/esm/transactions/typeTag/parser.d.mts +0 -81
  1353. package/dist/esm/transactions/typeTag/parser.mjs +0 -2
  1354. package/dist/esm/transactions/typeTag/parser.mjs.map +0 -1
  1355. package/dist/esm/transactions/types.d.mts +0 -7
  1356. package/dist/esm/transactions/types.mjs +0 -2
  1357. package/dist/esm/transactions/types.mjs.map +0 -1
  1358. package/dist/esm/types/abstraction.d.mts +0 -15
  1359. package/dist/esm/types/abstraction.mjs +0 -2
  1360. package/dist/esm/types/abstraction.mjs.map +0 -1
  1361. package/dist/esm/types/ans.d.mts +0 -109
  1362. package/dist/esm/types/ans.mjs +0 -2
  1363. package/dist/esm/types/ans.mjs.map +0 -1
  1364. package/dist/esm/types/generated/operations.d.mts +0 -703
  1365. package/dist/esm/types/generated/operations.mjs +0 -1
  1366. package/dist/esm/types/generated/operations.mjs.map +0 -1
  1367. package/dist/esm/types/generated/queries.d.mts +0 -66
  1368. package/dist/esm/types/generated/queries.mjs +0 -2
  1369. package/dist/esm/types/generated/queries.mjs.map +0 -1
  1370. package/dist/esm/types/generated/types.d.mts +0 -9679
  1371. package/dist/esm/types/generated/types.mjs +0 -2
  1372. package/dist/esm/types/generated/types.mjs.map +0 -1
  1373. package/dist/esm/types/index.d.mts +0 -8
  1374. package/dist/esm/types/index.mjs +0 -2
  1375. package/dist/esm/types/index.mjs.map +0 -1
  1376. package/dist/esm/types/indexer.d.mts +0 -186
  1377. package/dist/esm/types/indexer.mjs +0 -2
  1378. package/dist/esm/types/indexer.mjs.map +0 -1
  1379. package/dist/esm/types/keyless.d.mts +0 -102
  1380. package/dist/esm/types/keyless.mjs +0 -1
  1381. package/dist/esm/types/keyless.mjs.map +0 -1
  1382. package/dist/esm/types/types.d.mts +0 -7
  1383. package/dist/esm/types/types.mjs +0 -2
  1384. package/dist/esm/types/types.mjs.map +0 -1
  1385. package/dist/esm/utils/apiEndpoints.d.mts +0 -51
  1386. package/dist/esm/utils/apiEndpoints.mjs +0 -2
  1387. package/dist/esm/utils/apiEndpoints.mjs.map +0 -1
  1388. package/dist/esm/utils/const.d.mts +0 -104
  1389. package/dist/esm/utils/const.mjs +0 -2
  1390. package/dist/esm/utils/const.mjs.map +0 -1
  1391. package/dist/esm/utils/helpers.d.mts +0 -193
  1392. package/dist/esm/utils/helpers.mjs +0 -2
  1393. package/dist/esm/utils/helpers.mjs.map +0 -1
  1394. package/dist/esm/utils/index.d.mts +0 -9
  1395. package/dist/esm/utils/index.mjs +0 -2
  1396. package/dist/esm/utils/index.mjs.map +0 -1
  1397. package/dist/esm/utils/memoize.d.mts +0 -48
  1398. package/dist/esm/utils/memoize.mjs +0 -2
  1399. package/dist/esm/utils/memoize.mjs.map +0 -1
  1400. package/dist/esm/utils/normalizeBundle.d.mts +0 -35
  1401. package/dist/esm/utils/normalizeBundle.mjs +0 -2
  1402. package/dist/esm/utils/normalizeBundle.mjs.map +0 -1
  1403. package/dist/esm/version.d.mts +0 -8
  1404. package/dist/esm/version.mjs +0 -2
  1405. package/dist/esm/version.mjs.map +0 -1
@@ -0,0 +1,1164 @@
1
+ // Copyright © Aptos Foundation
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import { getAptosFullNode, getPageWithObfuscatedCursor, paginateWithCursor, paginateWithObfuscatedCursor, } from "../client/index.js";
4
+ import { anyPublicKeyVariantToString, } from "../types/index.js";
5
+ import { AccountAddress } from "../core/accountAddress.js";
6
+ import { Account, Ed25519Account, MultiEd25519Account, MultiKeyAccount, SingleKeyAccount } from "../account/index.js";
7
+ import { isKeylessSigner } from "../account/keylessSigner.js";
8
+ import { AnyPublicKey } from "../core/crypto/singleKey.js";
9
+ import { Ed25519PublicKey } from "../core/crypto/ed25519.js";
10
+ import { MultiEd25519PublicKey } from "../core/crypto/multiEd25519.js";
11
+ import { AbstractMultiKey, MultiKey } from "../core/crypto/multiKey.js";
12
+ import { queryIndexer } from "./general.js";
13
+ import { getModule as getModuleUtil, getInfo as getInfoUtil } from "./utils/index.js";
14
+ import { GetAccountCoinsCount, GetAccountCoinsData, GetAccountCollectionsWithOwnedTokens, GetObjectData, GetAccountOwnedTokens, GetAccountOwnedTokensFromCollection, GetAccountTokensCount, GetAccountTransactionsCount, GetAuthKeysForPublicKey, GetAccountAddressesForAuthKey, } from "../types/generated/queries.js";
15
+ import { Secp256k1PrivateKey } from "../core/crypto/secp256k1.js";
16
+ import { Ed25519PrivateKey } from "../core/crypto/ed25519.js";
17
+ import { AuthenticationKey } from "../core/authenticationKey.js";
18
+ import { createObjectAddress } from "../core/account/utils/address.js";
19
+ import { Hex } from "../core/hex.js";
20
+ import { getTableItem } from "./table.js";
21
+ import { APTOS_COIN } from "../utils/index.js";
22
+ import { AptosApiError } from "../errors/index.js";
23
+ import { Deserializer, U8, MoveVector } from "../bcs/index.js";
24
+ import { generateTransaction } from "./transactionSubmission.js";
25
+ import { RotationProofChallenge, TypeTagU8, TypeTagVector, } from "../transactions/index.js";
26
+ import { accountPublicKeyToBaseAccountPublicKey, accountPublicKeyToSigningScheme } from "../core/crypto/utils.js";
27
+ /**
28
+ * Retrieves account information for a specified account address.
29
+ *
30
+ * @param args - The arguments for retrieving account information.
31
+ * @param args.aptosConfig - The configuration object for Aptos.
32
+ * @param args.accountAddress - The address of the account to retrieve information for.
33
+ * @group Implementation
34
+ */
35
+ export async function getInfo(args) {
36
+ return getInfoUtil(args);
37
+ }
38
+ /**
39
+ * Retrieves the modules associated with a specified account address.
40
+ *
41
+ * @param args - The arguments for retrieving modules.
42
+ * @param args.aptosConfig - The configuration for connecting to the Aptos blockchain.
43
+ * @param args.accountAddress - The address of the account whose modules are to be retrieved.
44
+ * @param args.options - Optional parameters for pagination and ledger version.
45
+ * @param args.options.limit - The maximum number of modules to retrieve (default is 1000).
46
+ * @param args.options.offset - The starting point for pagination. Note, this is obfuscated and is not an index.
47
+ * @param args.options.ledgerVersion - The specific ledger version to query.
48
+ * @group Implementation
49
+ */
50
+ export async function getModules(args) {
51
+ const { aptosConfig, accountAddress, options } = args;
52
+ return paginateWithObfuscatedCursor({
53
+ aptosConfig,
54
+ originMethod: "getModules",
55
+ path: `accounts/${AccountAddress.from(accountAddress).toString()}/modules`,
56
+ params: {
57
+ ledger_version: options?.ledgerVersion,
58
+ limit: options?.limit ?? 1000,
59
+ },
60
+ });
61
+ }
62
+ /**
63
+ * Retrieves the modules associated with a specified account address.
64
+ *
65
+ * @param args - The arguments for retrieving modules.
66
+ * @param args.aptosConfig - The configuration for connecting to the Aptos blockchain.
67
+ * @param args.accountAddress - The address of the account whose modules are to be retrieved.
68
+ * @param args.options - Optional parameters for pagination and ledger version.
69
+ * @param args.options.cursor - The starting point for pagination. Note, this is obfuscated and is not an index.
70
+ * @param args.options.limit - The maximum number of modules to retrieve (default is 100).
71
+ * @param args.options.ledgerVersion - The specific ledger version to query.
72
+ * @group Implementation
73
+ */
74
+ export async function getModulesPage(args) {
75
+ const { aptosConfig, accountAddress, options } = args;
76
+ const { response, cursor } = await getPageWithObfuscatedCursor({
77
+ aptosConfig,
78
+ originMethod: "getModulesPage",
79
+ path: `accounts/${AccountAddress.from(accountAddress).toString()}/modules`,
80
+ params: {
81
+ ledger_version: options?.ledgerVersion,
82
+ cursor: options?.cursor,
83
+ limit: options?.limit ?? 100,
84
+ },
85
+ });
86
+ return { modules: response.data, cursor };
87
+ }
88
+ /**
89
+ * Queries for a move module given an account address and module name.
90
+ * This function can help you retrieve the module's ABI and other relevant information.
91
+ *
92
+ * @param args - The arguments for retrieving the module.
93
+ * @param args.aptosConfig - The configuration for the Aptos client.
94
+ * @param args.accountAddress - The account address in hex-encoded 32 byte format.
95
+ * @param args.moduleName - The name of the module to retrieve.
96
+ * @param args.options - Optional parameters for the request.
97
+ * @param args.options.ledgerVersion - Specifies the ledger version of transactions. By default, the latest version will be used.
98
+ * @returns The move module.
99
+ * @group Implementation
100
+ */
101
+ export async function getModule(args) {
102
+ return getModuleUtil(args);
103
+ }
104
+ /**
105
+ * Retrieves a list of transactions associated with a specific account address.
106
+ * This function allows you to paginate through the transactions for better performance and usability.
107
+ *
108
+ * @param args - The arguments for retrieving transactions.
109
+ * @param args.aptosConfig - The configuration settings for Aptos.
110
+ * @param args.accountAddress - The account address for which to retrieve transactions.
111
+ * @param args.options - Optional pagination parameters.
112
+ * @param args.options.offset - The starting point for pagination.
113
+ * @param args.options.limit - The maximum number of transactions to retrieve.
114
+ * @group Implementation
115
+ */
116
+ export async function getTransactions(args) {
117
+ const { aptosConfig, accountAddress, options } = args;
118
+ return paginateWithCursor({
119
+ aptosConfig,
120
+ originMethod: "getTransactions",
121
+ path: `accounts/${AccountAddress.from(accountAddress).toString()}/transactions`,
122
+ params: { start: options?.offset, limit: options?.limit },
123
+ });
124
+ }
125
+ /**
126
+ * Retrieves a list of resources associated with a specific account address.
127
+ *
128
+ * @param args - The arguments for retrieving resources.
129
+ * @param args.aptosConfig - The configuration settings for Aptos.
130
+ * @param args.accountAddress - The address of the account to fetch resources for.
131
+ * @param args.options - Optional pagination and ledger version parameters.
132
+ * @param args.options.limit - The maximum number of resources to retrieve (default is 999).
133
+ * @param args.options.ledgerVersion - The specific ledger version to query.
134
+ * @group Implementation
135
+ */
136
+ export async function getResources(args) {
137
+ const { aptosConfig, accountAddress, options } = args;
138
+ return paginateWithObfuscatedCursor({
139
+ aptosConfig,
140
+ originMethod: "getResources",
141
+ path: `accounts/${AccountAddress.from(accountAddress).toString()}/resources`,
142
+ params: {
143
+ ledger_version: options?.ledgerVersion,
144
+ limit: options?.limit ?? 999,
145
+ },
146
+ });
147
+ }
148
+ /**
149
+ * Retrieves a page of resources associated with a specific account address.
150
+ *
151
+ * @param args - The arguments for retrieving resources.
152
+ * @param args.aptosConfig - The configuration settings for Aptos.
153
+ * @param args.accountAddress - The address of the account to fetch resources for.
154
+ * @param args.options - Optional pagination and ledger version parameters.
155
+ * @param args.options.cursor - The starting point for pagination. Note, this is obfuscated and is not an index.
156
+ * @param args.options.limit - The maximum number of resources to retrieve (default is 100).
157
+ * @param args.options.ledgerVersion - The specific ledger version to query.
158
+ * @group Implementation
159
+ */
160
+ export async function getResourcesPage(args) {
161
+ const { aptosConfig, accountAddress, options } = args;
162
+ const { response, cursor } = await getPageWithObfuscatedCursor({
163
+ aptosConfig,
164
+ originMethod: "getResourcesPage",
165
+ path: `accounts/${AccountAddress.from(accountAddress).toString()}/resources`,
166
+ params: {
167
+ ledger_version: options?.ledgerVersion,
168
+ cursor: options?.cursor,
169
+ limit: options?.limit ?? 100,
170
+ },
171
+ });
172
+ return { resources: response.data, cursor };
173
+ }
174
+ /**
175
+ * Retrieves a specific resource of a given type for the specified account address.
176
+ *
177
+ * @param args - The arguments for retrieving the resource.
178
+ * @param args.aptosConfig - The configuration settings for Aptos.
179
+ * @param args.accountAddress - The address of the account from which to retrieve the resource.
180
+ * @param args.resourceType - The type of the resource to retrieve, specified as a MoveStructId.
181
+ * @param args.options - Optional parameters for specifying the ledger version.
182
+ * @group Implementation
183
+ */
184
+ export async function getResource(args) {
185
+ const { aptosConfig, accountAddress, resourceType, options } = args;
186
+ const { data } = await getAptosFullNode({
187
+ aptosConfig,
188
+ originMethod: "getResource",
189
+ path: `accounts/${AccountAddress.from(accountAddress).toString()}/resource/${resourceType}`,
190
+ params: { ledger_version: options?.ledgerVersion },
191
+ });
192
+ // TODO: Fix type checking, so cast is unnecessary
193
+ return data.data;
194
+ }
195
+ export async function getResourceFallible(args) {
196
+ try {
197
+ return await getResource(args);
198
+ }
199
+ catch (error) {
200
+ // explicitly return null if there is no resource
201
+ if (error?.status === 404 && error?.data?.error_code === "resource_not_found") {
202
+ return null;
203
+ }
204
+ throw error;
205
+ }
206
+ }
207
+ /**
208
+ * Retrieves the original account address associated with a given authentication key, which is useful for handling key rotations.
209
+ *
210
+ * @param args - The arguments for the lookup.
211
+ * @param args.aptosConfig - The configuration for the Aptos client.
212
+ * @param args.authenticationKey - The authentication key for which to look up the original address.
213
+ * @param args.options - Optional parameters for specifying the ledger version.
214
+ * @returns The original account address or the provided authentication key address if not found.
215
+ * @throws Throws an error if the lookup fails for reasons other than the address not being found.
216
+ * @group Implementation
217
+ */
218
+ export async function lookupOriginalAccountAddress(args) {
219
+ const { aptosConfig, authenticationKey, options } = args;
220
+ const resource = await getResource({
221
+ aptosConfig,
222
+ accountAddress: "0x1",
223
+ resourceType: "0x1::account::OriginatingAddress",
224
+ options,
225
+ });
226
+ const { address_map: { handle }, } = resource;
227
+ const authKeyAddress = AccountAddress.from(authenticationKey);
228
+ // If the address is not found in the address map, which means its not rotated
229
+ // then return the address as is
230
+ try {
231
+ const originalAddress = await getTableItem({
232
+ aptosConfig,
233
+ handle,
234
+ data: {
235
+ key: authKeyAddress.toString(),
236
+ key_type: "address",
237
+ value_type: "address",
238
+ },
239
+ options,
240
+ });
241
+ return AccountAddress.from(originalAddress);
242
+ }
243
+ catch (err) {
244
+ if (err instanceof AptosApiError && err.data.error_code === "table_item_not_found") {
245
+ return authKeyAddress;
246
+ }
247
+ throw err;
248
+ }
249
+ }
250
+ /**
251
+ * Retrieves the count of tokens owned by a specific account address.
252
+ *
253
+ * @param args - The arguments for retrieving the account tokens count.
254
+ * @param args.aptosConfig - The configuration settings for the Aptos network.
255
+ * @param args.accountAddress - The address of the account for which to count the tokens.
256
+ * @returns The count of tokens owned by the specified account.
257
+ * @group Implementation
258
+ */
259
+ export async function getAccountTokensCount(args) {
260
+ const { aptosConfig, accountAddress } = args;
261
+ const address = AccountAddress.from(accountAddress).toStringLong();
262
+ const whereCondition = {
263
+ owner_address: { _eq: address },
264
+ amount: { _gt: 0 },
265
+ };
266
+ const graphqlQuery = {
267
+ query: GetAccountTokensCount,
268
+ variables: { where_condition: whereCondition },
269
+ };
270
+ const data = await queryIndexer({
271
+ aptosConfig,
272
+ query: graphqlQuery,
273
+ originMethod: "getAccountTokensCount",
274
+ });
275
+ // commonjs (aka cjs) doesn't handle Nullish Coalescing for some reason
276
+ // might be because of how ts infer the graphql generated scheme type
277
+ return data.current_token_ownerships_v2_aggregate.aggregate
278
+ ? data.current_token_ownerships_v2_aggregate.aggregate.count
279
+ : 0;
280
+ }
281
+ /**
282
+ * Retrieves the tokens owned by a specified account address.
283
+ *
284
+ * @param args - The arguments for retrieving the account's tokens.
285
+ * @param args.aptosConfig - The configuration for the Aptos client.
286
+ * @param args.accountAddress - The address of the account whose tokens are being queried.
287
+ * @param args.options - Optional parameters for filtering and pagination.
288
+ * @param args.options.tokenStandard - The specific token standard to filter the results.
289
+ * @param args.options.offset - The number of records to skip before starting to collect the result set.
290
+ * @param args.options.limit - The maximum number of records to return.
291
+ * @param args.options.orderBy - The criteria for ordering the results.
292
+ * @returns A promise that resolves to the current token ownerships of the specified account.
293
+ * @group Implementation
294
+ */
295
+ export async function getAccountOwnedTokens(args) {
296
+ const { aptosConfig, accountAddress, options } = args;
297
+ const address = AccountAddress.from(accountAddress).toStringLong();
298
+ const whereCondition = {
299
+ owner_address: { _eq: address },
300
+ amount: { _gt: 0 },
301
+ };
302
+ if (options?.tokenStandard) {
303
+ whereCondition.token_standard = { _eq: options?.tokenStandard };
304
+ }
305
+ const graphqlQuery = {
306
+ query: GetAccountOwnedTokens,
307
+ variables: {
308
+ where_condition: whereCondition,
309
+ offset: options?.offset,
310
+ limit: options?.limit,
311
+ order_by: options?.orderBy,
312
+ },
313
+ };
314
+ const data = await queryIndexer({
315
+ aptosConfig,
316
+ query: graphqlQuery,
317
+ originMethod: "getAccountOwnedTokens",
318
+ });
319
+ return data.current_token_ownerships_v2;
320
+ }
321
+ /**
322
+ * Retrieves the tokens owned by a specific account from a particular collection address.
323
+ *
324
+ * @param args - The parameters required to fetch the owned tokens.
325
+ * @param args.aptosConfig - The Aptos configuration object.
326
+ * @param args.accountAddress - The address of the account whose tokens are being queried.
327
+ * @param args.collectionAddress - The address of the collection from which tokens are being retrieved.
328
+ * @param args.options - Optional parameters for filtering and pagination, including token standard, pagination arguments, and
329
+ * order by options.
330
+ * @group Implementation
331
+ */
332
+ export async function getAccountOwnedTokensFromCollectionAddress(args) {
333
+ const { aptosConfig, accountAddress, collectionAddress, options } = args;
334
+ const ownerAddress = AccountAddress.from(accountAddress).toStringLong();
335
+ const collAddress = AccountAddress.from(collectionAddress).toStringLong();
336
+ const whereCondition = {
337
+ owner_address: { _eq: ownerAddress },
338
+ current_token_data: { collection_id: { _eq: collAddress } },
339
+ amount: { _gt: 0 },
340
+ };
341
+ if (options?.tokenStandard) {
342
+ whereCondition.token_standard = { _eq: options?.tokenStandard };
343
+ }
344
+ const graphqlQuery = {
345
+ query: GetAccountOwnedTokensFromCollection,
346
+ variables: {
347
+ where_condition: whereCondition,
348
+ offset: options?.offset,
349
+ limit: options?.limit,
350
+ order_by: options?.orderBy,
351
+ },
352
+ };
353
+ const data = await queryIndexer({
354
+ aptosConfig,
355
+ query: graphqlQuery,
356
+ originMethod: "getAccountOwnedTokensFromCollectionAddress",
357
+ });
358
+ return data.current_token_ownerships_v2;
359
+ }
360
+ /**
361
+ * Retrieves the collections owned by a specified account along with the tokens in those collections.
362
+ *
363
+ * @param args - The arguments for the function.
364
+ * @param args.aptosConfig - The configuration for the Aptos client.
365
+ * @param args.accountAddress - The address of the account whose collections are being queried.
366
+ * @param args.options - Optional parameters for filtering and pagination.
367
+ * @param args.options.tokenStandard - An optional token standard to filter the collections.
368
+ * @param args.options.offset - An optional offset for pagination.
369
+ * @param args.options.limit - An optional limit for the number of results returned.
370
+ * @param args.options.orderBy - An optional parameter to specify the order of the results.
371
+ * @group Implementation
372
+ */
373
+ export async function getAccountCollectionsWithOwnedTokens(args) {
374
+ const { aptosConfig, accountAddress, options } = args;
375
+ const address = AccountAddress.from(accountAddress).toStringLong();
376
+ const whereCondition = {
377
+ owner_address: { _eq: address },
378
+ };
379
+ if (options?.tokenStandard) {
380
+ whereCondition.current_collection = {
381
+ token_standard: { _eq: options?.tokenStandard },
382
+ };
383
+ }
384
+ const graphqlQuery = {
385
+ query: GetAccountCollectionsWithOwnedTokens,
386
+ variables: {
387
+ where_condition: whereCondition,
388
+ offset: options?.offset,
389
+ limit: options?.limit,
390
+ order_by: options?.orderBy,
391
+ },
392
+ };
393
+ const data = await queryIndexer({
394
+ aptosConfig,
395
+ query: graphqlQuery,
396
+ originMethod: "getAccountCollectionsWithOwnedTokens",
397
+ });
398
+ return data.current_collection_ownership_v2_view;
399
+ }
400
+ /**
401
+ * Retrieves the count of transactions associated with a specified account.
402
+ *
403
+ * @param args - The arguments for the function.
404
+ * @param args.aptosConfig - The configuration settings for Aptos.
405
+ * @param args.accountAddress - The address of the account for which to retrieve the transaction count.
406
+ * @returns The number of transactions associated with the specified account.
407
+ * @group Implementation
408
+ */
409
+ export async function getAccountTransactionsCount(args) {
410
+ const { aptosConfig, accountAddress } = args;
411
+ const address = AccountAddress.from(accountAddress).toStringLong();
412
+ const graphqlQuery = {
413
+ query: GetAccountTransactionsCount,
414
+ variables: { address },
415
+ };
416
+ const data = await queryIndexer({
417
+ aptosConfig,
418
+ query: graphqlQuery,
419
+ originMethod: "getAccountTransactionsCount",
420
+ });
421
+ // commonjs (aka cjs) doesn't handle Nullish Coalescing for some reason
422
+ // might be because of how ts infer the graphql generated scheme type
423
+ return data.account_transactions_aggregate.aggregate ? data.account_transactions_aggregate.aggregate.count : 0;
424
+ }
425
+ /**
426
+ * Retrieves the amount of a specific coin held by an account.
427
+ *
428
+ * @param args - The parameters for the request.
429
+ * @param args.aptosConfig - The Aptos configuration object.
430
+ * @param args.accountAddress - The address of the account to query.
431
+ * @param args.coinType - Optional; the type of coin to check the amount for.
432
+ * @param args.faMetadataAddress - Optional; the address of the fungible asset metadata.
433
+ * @returns The amount of the specified coin held by the account, or 0 if none is found.
434
+ * @throws Error if neither coinType nor faMetadataAddress is provided.
435
+ * @group Implementation
436
+ */
437
+ export async function getAccountCoinAmount(args) {
438
+ const { aptosConfig, accountAddress, coinType, faMetadataAddress } = args;
439
+ let coinAssetType = coinType;
440
+ let faAddress;
441
+ if (coinType !== undefined && faMetadataAddress !== undefined) {
442
+ faAddress = AccountAddress.from(faMetadataAddress).toStringLong();
443
+ }
444
+ else if (coinType !== undefined && faMetadataAddress === undefined) {
445
+ // TODO Move to a separate function as defined in the AIP for coin migration
446
+ if (coinType === APTOS_COIN) {
447
+ faAddress = AccountAddress.A.toStringLong();
448
+ }
449
+ else {
450
+ faAddress = createObjectAddress(AccountAddress.A, coinType).toStringLong();
451
+ }
452
+ }
453
+ else if (coinType === undefined && faMetadataAddress !== undefined) {
454
+ const addr = AccountAddress.from(faMetadataAddress);
455
+ faAddress = addr.toStringLong();
456
+ if (addr === AccountAddress.A) {
457
+ coinAssetType = APTOS_COIN;
458
+ }
459
+ // The paired CoinType should be populated outside of this function in another
460
+ // async call. We cannot do this internally due to dependency cycles issue.
461
+ }
462
+ else {
463
+ throw new Error("Either coinType, fungibleAssetAddress, or both must be provided");
464
+ }
465
+ const address = AccountAddress.from(accountAddress).toStringLong();
466
+ // Search by fungible asset address, unless it has a coin it migrated from
467
+ let where = { asset_type: { _eq: faAddress } };
468
+ if (coinAssetType !== undefined) {
469
+ where = { asset_type: { _in: [coinAssetType, faAddress] } };
470
+ }
471
+ const data = await getAccountCoinsData({
472
+ aptosConfig,
473
+ accountAddress: address,
474
+ options: {
475
+ where,
476
+ },
477
+ });
478
+ // commonjs (aka cjs) doesn't handle Nullish Coalescing for some reason
479
+ // might be because of how ts infer the graphql generated scheme type
480
+ return data[0] ? data[0].amount : 0;
481
+ }
482
+ /**
483
+ * Retrieves the current fungible asset balances for a specified account.
484
+ *
485
+ * @param args - The arguments for retrieving account coins data.
486
+ * @param args.aptosConfig - The configuration for connecting to the Aptos network.
487
+ * @param args.accountAddress - The address of the account for which to retrieve coin data.
488
+ * @param args.options - Optional parameters for pagination and filtering the results.
489
+ * @param args.options.offset - The number of items to skip before starting to collect the result set.
490
+ * @param args.options.limit - The maximum number of items to return.
491
+ * @param args.options.orderBy - The criteria for ordering the results.
492
+ * @param args.options.where - Conditions to filter the results based on the current fungible asset balances.
493
+ * @group Implementation
494
+ */
495
+ export async function getAccountCoinsData(args) {
496
+ const { aptosConfig, accountAddress, options } = args;
497
+ const address = AccountAddress.from(accountAddress).toStringLong();
498
+ const whereCondition = {
499
+ ...options?.where,
500
+ owner_address: { _eq: address },
501
+ };
502
+ const graphqlQuery = {
503
+ query: GetAccountCoinsData,
504
+ variables: {
505
+ where_condition: whereCondition,
506
+ offset: options?.offset,
507
+ limit: options?.limit,
508
+ order_by: options?.orderBy,
509
+ },
510
+ };
511
+ const data = await queryIndexer({
512
+ aptosConfig,
513
+ query: graphqlQuery,
514
+ originMethod: "getAccountCoinsData",
515
+ });
516
+ return data.current_fungible_asset_balances;
517
+ }
518
+ /**
519
+ * Retrieves the count of fungible asset coins held by a specified account.
520
+ *
521
+ * @param args - The arguments for the function.
522
+ * @param args.aptosConfig - The configuration settings for the Aptos network.
523
+ * @param args.accountAddress - The address of the account for which to retrieve the coin count.
524
+ * @throws Error if the count of account coins cannot be retrieved.
525
+ * @group Implementation
526
+ */
527
+ export async function getAccountCoinsCount(args) {
528
+ const { aptosConfig, accountAddress } = args;
529
+ const address = AccountAddress.from(accountAddress).toStringLong();
530
+ const graphqlQuery = {
531
+ query: GetAccountCoinsCount,
532
+ variables: { address },
533
+ };
534
+ const data = await queryIndexer({
535
+ aptosConfig,
536
+ query: graphqlQuery,
537
+ originMethod: "getAccountCoinsCount",
538
+ });
539
+ if (!data.current_fungible_asset_balances_aggregate.aggregate) {
540
+ throw new Error("Failed to get the count of account coins");
541
+ }
542
+ return data.current_fungible_asset_balances_aggregate.aggregate.count;
543
+ }
544
+ /**
545
+ * Retrieves an account's balance for the given asset via the fullnode REST API.
546
+ *
547
+ * - `asset` may be a coin type (Move struct ID, e.g. `0x1::aptos_coin::AptosCoin`) or an FA metadata address.
548
+ * - Calls: `GET /accounts/{accountAddress}/balance/{asset}` and returns the numeric balance.
549
+ *
550
+ * @param args - The parameters for the request.
551
+ * @param args.aptosConfig - The Aptos configuration object.
552
+ * @param args.accountAddress - The account address to query.
553
+ * @param args.asset - The asset identifier (coin type or FA metadata address).
554
+ * @returns The balance as a number.
555
+ * @group Implementation
556
+ */
557
+ export async function getBalance(args) {
558
+ const { aptosConfig, accountAddress, asset } = args;
559
+ const response = await getAptosFullNode({
560
+ aptosConfig,
561
+ originMethod: "getBalance",
562
+ path: `accounts/${accountAddress}/balance/${asset}`,
563
+ params: {
564
+ accountAddress: accountAddress.toString(),
565
+ asset: asset instanceof Uint8Array ? AccountAddress.from(asset).toString() : asset.toString(),
566
+ },
567
+ });
568
+ return parseInt(response.data.toString(), 10);
569
+ }
570
+ /**
571
+ * Retrieves the objects owned by a specified account.
572
+ *
573
+ * @param args - The parameters for the request.
574
+ * @param args.aptosConfig - The configuration for the Aptos client.
575
+ * @param args.accountAddress - The address of the account whose owned objects are to be retrieved.
576
+ * @param args.options - Optional parameters for pagination and ordering of the results.
577
+ * @param args.options.offset - The number of items to skip before starting to collect the result set.
578
+ * @param args.options.limit - The maximum number of items to return.
579
+ * @param args.options.orderBy - The criteria to order the results by.
580
+ * @returns A promise that resolves to the current objects owned by the specified account.
581
+ * @group Implementation
582
+ */
583
+ export async function getAccountOwnedObjects(args) {
584
+ const { aptosConfig, accountAddress, options } = args;
585
+ const address = AccountAddress.from(accountAddress).toStringLong();
586
+ const whereCondition = {
587
+ owner_address: { _eq: address },
588
+ };
589
+ const graphqlQuery = {
590
+ query: GetObjectData,
591
+ variables: {
592
+ where_condition: whereCondition,
593
+ offset: options?.offset,
594
+ limit: options?.limit,
595
+ order_by: options?.orderBy,
596
+ },
597
+ };
598
+ const data = await queryIndexer({
599
+ aptosConfig,
600
+ query: graphqlQuery,
601
+ originMethod: "getAccountOwnedObjects",
602
+ });
603
+ return data.current_objects;
604
+ }
605
+ /**
606
+ * Derives an account from the provided private key and Aptos configuration.
607
+ *
608
+ * This function queries all owned accounts for the provided private key and returns the most
609
+ * recently used account. If no account is found, it will throw an error unless `throwIfNoAccountFound` is set to false.
610
+ *
611
+ * If `throwIfNoAccountFound` is set to false, the function will return the default account for the private key via `Account.fromPrivateKey`.
612
+ *
613
+ * NOTE: There is a potential issue once the unified single signer scheme is adopted by the community.
614
+ * Because one could create two accounts with the same private key with this new authenticator type,
615
+ * we'll need to determine the order in which we look up the accounts: first unified scheme and then legacy scheme,
616
+ * or first legacy scheme and then unified scheme.
617
+ *
618
+ * @param args - The arguments for deriving the account.
619
+ * @param args.aptosConfig - The Aptos configuration used for account lookup.
620
+ * @param args.privateKey - The private key used to derive the account.
621
+ * @param args.options.throwIfNoAccountFound - If true, throw an error if no existing account is found on chain. Default is false.
622
+ * @throws Error if the account cannot be derived from the private key.
623
+ * @group Implementation
624
+ * @deprecated Note that more inspection is needed by the user to determine which account exists on-chain
625
+ */
626
+ export async function deriveAccountFromPrivateKey(args) {
627
+ const { aptosConfig, privateKey, options } = args;
628
+ const throwIfNoAccountFound = options?.throwIfNoAccountFound ?? false;
629
+ const accounts = await deriveOwnedAccountsFromPrivateKey({ aptosConfig, privateKey });
630
+ if (accounts.length === 0) {
631
+ if (throwIfNoAccountFound) {
632
+ throw new Error(`No existing account found for private key.`);
633
+ }
634
+ // If no account is found, return the default account. This is a legacy account for Ed25519 private keys.
635
+ return Account.fromPrivateKey({ privateKey });
636
+ }
637
+ return accounts[0];
638
+ }
639
+ /**
640
+ * Checks if an account exists by verifying its information against the Aptos blockchain.
641
+ *
642
+ * @param args - The arguments for the function.
643
+ * @param args.aptosConfig - The configuration for connecting to the Aptos blockchain.
644
+ * @param args.authKey - The authentication key used to derive the account address.
645
+ * @returns A promise that resolves to a boolean indicating whether the account exists.
646
+ *
647
+ * @throws Throws an Error if there is an issue while looking for account information.
648
+ * @group Implementation
649
+ */
650
+ export async function isAccountExist(args) {
651
+ const { aptosConfig, authKey } = args;
652
+ const accountAddress = await lookupOriginalAccountAddress({
653
+ aptosConfig,
654
+ authenticationKey: authKey.derivedAddress(),
655
+ });
656
+ return doesAccountExistAtAddress({ aptosConfig, accountAddress });
657
+ }
658
+ /**
659
+ * Checks if an account exists at a given address.
660
+ *
661
+ * @param args - The arguments for checking account existence.
662
+ * @param args.aptosConfig - The configuration for the Aptos client.
663
+ * @param args.accountAddress - The address of the account to check.
664
+ * @param args.options.withAuthKey - An optional authentication key which will also be checked against if provided.
665
+ * @returns A promise that resolves to a boolean indicating whether the account exists.
666
+ * @group Implementation
667
+ */
668
+ async function doesAccountExistAtAddress(args) {
669
+ const { aptosConfig, accountAddress, options } = args;
670
+ try {
671
+ // Get the account resources and the balance of the account. We need to check both because
672
+ // an account resource can exist with 0 balance and a balance can exist without an account resource (light accounts).
673
+ const [accountResource, ownedObjects] = await Promise.all([
674
+ getResourceFallible({
675
+ aptosConfig,
676
+ accountAddress,
677
+ resourceType: "0x1::account::Account",
678
+ }),
679
+ getAccountOwnedObjects({
680
+ aptosConfig,
681
+ accountAddress,
682
+ options: {
683
+ limit: 1,
684
+ },
685
+ }),
686
+ ]);
687
+ // If the account resource is not found and the balance is 0, then the account does not exist.
688
+ if (!accountResource && ownedObjects.length === 0) {
689
+ return false;
690
+ }
691
+ // If no auth key is provided as an argument, return true.
692
+ if (!options?.withAuthKey) {
693
+ return true;
694
+ }
695
+ // Get the auth key from the account resource if it exists. If the account resource does not exist,
696
+ // then the auth key is the account address by default.
697
+ let authKey;
698
+ if (accountResource) {
699
+ authKey = accountResource.authentication_key;
700
+ }
701
+ else {
702
+ authKey = accountAddress.toStringLong();
703
+ }
704
+ if (authKey !== options.withAuthKey.toString()) {
705
+ return false;
706
+ }
707
+ // Else the account exists and the auth key matches.
708
+ return true;
709
+ }
710
+ catch (error) {
711
+ throw new Error(`Error while checking if account exists at ${accountAddress.toString()}: ${error}`);
712
+ }
713
+ }
714
+ const rotateAuthKeyAbi = {
715
+ typeParameters: [],
716
+ parameters: [
717
+ new TypeTagU8(),
718
+ TypeTagVector.u8(),
719
+ new TypeTagU8(),
720
+ TypeTagVector.u8(),
721
+ TypeTagVector.u8(),
722
+ TypeTagVector.u8(),
723
+ ],
724
+ };
725
+ /**
726
+ * Rotates the authentication key for a given account.
727
+ *
728
+ * @param args - The arguments for rotating the authentication key.
729
+ * @param args.aptosConfig - The configuration settings for the Aptos network.
730
+ * @param args.fromAccount - The account from which the authentication key will be rotated.
731
+ * @param args.toAccount - (Optional) The target account to rotate to. Required if not using toNewPrivateKey.
732
+ * @param args.toNewPrivateKey - (Optional) The new private key to rotate to. Required if not using toAccount.
733
+ *
734
+ * @remarks
735
+ * This function supports three modes of rotation:
736
+ * 1. Using a target Account object (toAccount)
737
+ * 2. Using a new private key (toNewPrivateKey)
738
+ *
739
+ * @returns A simple transaction object that can be submitted to the network.
740
+ * @throws Error if the rotation fails or verification fails.
741
+ *
742
+ * @group Implementation
743
+ */
744
+ export async function rotateAuthKey(args) {
745
+ const { aptosConfig, fromAccount, options } = args;
746
+ if ("toNewPrivateKey" in args) {
747
+ return rotateAuthKeyWithChallenge({
748
+ aptosConfig,
749
+ fromAccount,
750
+ toNewPrivateKey: args.toNewPrivateKey,
751
+ options,
752
+ });
753
+ }
754
+ if ("toAccount" in args) {
755
+ if (args.toAccount instanceof Ed25519Account) {
756
+ return rotateAuthKeyWithChallenge({
757
+ aptosConfig,
758
+ fromAccount,
759
+ toNewPrivateKey: args.toAccount.privateKey,
760
+ options,
761
+ });
762
+ }
763
+ return rotateAuthKeyWithChallenge({ aptosConfig, fromAccount, toAccount: args.toAccount, options });
764
+ }
765
+ throw new Error("Invalid arguments");
766
+ }
767
+ async function rotateAuthKeyWithChallenge(args) {
768
+ const { aptosConfig, fromAccount, options } = args;
769
+ const accountInfo = await getInfo({
770
+ aptosConfig,
771
+ accountAddress: fromAccount.accountAddress,
772
+ });
773
+ let newAccount;
774
+ if ("toNewPrivateKey" in args) {
775
+ newAccount = Account.fromPrivateKey({ privateKey: args.toNewPrivateKey, legacy: true });
776
+ }
777
+ else {
778
+ newAccount = args.toAccount;
779
+ }
780
+ const challenge = new RotationProofChallenge({
781
+ sequenceNumber: BigInt(accountInfo.sequence_number),
782
+ originator: fromAccount.accountAddress,
783
+ currentAuthKey: AccountAddress.from(accountInfo.authentication_key),
784
+ newPublicKey: newAccount.publicKey,
785
+ });
786
+ // Sign the challenge
787
+ const challengeHex = challenge.bcsToBytes();
788
+ const proofSignedByCurrentKey = fromAccount.sign(challengeHex);
789
+ const proofSignedByNewKey = newAccount.sign(challengeHex);
790
+ // Generate transaction
791
+ return generateTransaction({
792
+ aptosConfig,
793
+ sender: fromAccount.accountAddress,
794
+ data: {
795
+ function: "0x1::account::rotate_authentication_key",
796
+ functionArguments: [
797
+ new U8(fromAccount.signingScheme), // from scheme
798
+ MoveVector.U8(fromAccount.publicKey.toUint8Array()),
799
+ new U8(newAccount.signingScheme), // to scheme
800
+ MoveVector.U8(newAccount.publicKey.toUint8Array()),
801
+ MoveVector.U8(proofSignedByCurrentKey.toUint8Array()),
802
+ MoveVector.U8(proofSignedByNewKey.toUint8Array()),
803
+ ],
804
+ abi: rotateAuthKeyAbi,
805
+ },
806
+ options,
807
+ });
808
+ }
809
+ const rotateAuthKeyUnverifiedAbi = {
810
+ typeParameters: [],
811
+ parameters: [new TypeTagU8(), TypeTagVector.u8()],
812
+ };
813
+ /**
814
+ * Rotates the authentication key for a given account without verifying the new key.
815
+ *
816
+ * @param args - The arguments for rotating the authentication key.
817
+ * @param args.aptosConfig - The configuration settings for the Aptos network.
818
+ * @param args.fromAccount - The account from which the authentication key will be rotated.
819
+ * @param args.toNewPublicKey - The new public key to rotate to.
820
+ * @returns A simple transaction object that can be submitted to the network.
821
+ * @throws Error if the rotation fails or verification fails.
822
+ *
823
+ * @group Implementation
824
+ */
825
+ export async function rotateAuthKeyUnverified(args) {
826
+ const { aptosConfig, fromAccount, toNewPublicKey, options } = args;
827
+ return generateTransaction({
828
+ aptosConfig,
829
+ sender: fromAccount.accountAddress,
830
+ data: {
831
+ function: "0x1::account::rotate_authentication_key_from_public_key",
832
+ functionArguments: [
833
+ new U8(accountPublicKeyToSigningScheme(toNewPublicKey)), // to scheme
834
+ MoveVector.U8(accountPublicKeyToBaseAccountPublicKey(toNewPublicKey).toUint8Array()),
835
+ ],
836
+ abi: rotateAuthKeyUnverifiedAbi,
837
+ },
838
+ options,
839
+ });
840
+ }
841
+ export async function getAccountsForPublicKey(args) {
842
+ const { aptosConfig, publicKey, options } = args;
843
+ const noMultiKey = options?.noMultiKey ?? false;
844
+ if (noMultiKey && publicKey instanceof AbstractMultiKey) {
845
+ throw new Error("Multi-key accounts are not supported when noMultiKey is true.");
846
+ }
847
+ const allPublicKeys = [publicKey];
848
+ // For Ed25519, we add the both the legacy Ed25519PublicKey and the new AnyPublicKey form.
849
+ if (publicKey instanceof AnyPublicKey && publicKey.publicKey instanceof Ed25519PublicKey) {
850
+ allPublicKeys.push(publicKey.publicKey);
851
+ }
852
+ else if (publicKey instanceof Ed25519PublicKey) {
853
+ allPublicKeys.push(new AnyPublicKey(publicKey));
854
+ }
855
+ // Run both operations in parallel
856
+ const [defaultAccountData, multiPublicKeys] = await Promise.all([
857
+ // Check the provided public key for the default account. In the case of Ed25519, this will check both the legacy Ed25519PublicKey
858
+ // and the AnyPublicKey form and may an existing account for each.
859
+ Promise.all(allPublicKeys.map(async (publicKey) => {
860
+ const addressAndLastTxnVersion = await getDefaultAccountInfoForPublicKey({ aptosConfig, publicKey });
861
+ if (addressAndLastTxnVersion) {
862
+ return { ...addressAndLastTxnVersion, publicKey };
863
+ }
864
+ return undefined;
865
+ })),
866
+ // Get multi-keys for the provided public key if not already a multi-key.
867
+ !(publicKey instanceof AbstractMultiKey) && !noMultiKey
868
+ ? getMultiKeysForPublicKey({ aptosConfig, publicKey, options })
869
+ : Promise.resolve([]),
870
+ ]);
871
+ const result = [];
872
+ // Add any default accounts that exist to the result.
873
+ for (const data of defaultAccountData) {
874
+ if (data) {
875
+ result.push(data);
876
+ }
877
+ }
878
+ // Add any multi-keys to allPublicKeys
879
+ allPublicKeys.push(...multiPublicKeys);
880
+ // Get a map of the auth key to the public key for all public keys.
881
+ const authKeyToPublicKey = new Map(allPublicKeys.map((key) => [key.authKey().toString(), key]));
882
+ // Get the account addresses for the auth keys.
883
+ const authKeyAccountAddressPairs = await getAccountAddressesForAuthKeys({
884
+ aptosConfig,
885
+ authKeys: allPublicKeys.map((key) => key.authKey()),
886
+ options,
887
+ });
888
+ for (const authKeyAccountAddressPair of authKeyAccountAddressPairs) {
889
+ // Skip if the account address is already in the result.
890
+ // This can happen in the rare edge case where the default account has been rotated but has been rotated back to the original auth key.
891
+ if (result.find((r) => r.accountAddress === authKeyAccountAddressPair.accountAddress)) {
892
+ continue;
893
+ }
894
+ // Get the public key for the auth key using the map we created earlier.
895
+ const publicKey = authKeyToPublicKey.get(authKeyAccountAddressPair.authKey.toString());
896
+ if (!publicKey) {
897
+ throw new Error(`No publicKey found for authentication key ${authKeyAccountAddressPair.authKey}. This should never happen.`);
898
+ }
899
+ result.push({
900
+ accountAddress: authKeyAccountAddressPair.accountAddress,
901
+ publicKey,
902
+ lastTransactionVersion: authKeyAccountAddressPair.lastTransactionVersion,
903
+ });
904
+ }
905
+ // Sort the result by the last transaction version in descending order (most recent first).
906
+ return result.sort((a, b) => b.lastTransactionVersion - a.lastTransactionVersion);
907
+ }
908
+ export async function deriveOwnedAccountsFromSigner(args) {
909
+ const { aptosConfig, signer, options } = args;
910
+ if (signer instanceof Ed25519PrivateKey || signer instanceof Secp256k1PrivateKey) {
911
+ return deriveOwnedAccountsFromPrivateKey({ aptosConfig, privateKey: signer, options });
912
+ }
913
+ if (signer instanceof Ed25519Account || signer instanceof SingleKeyAccount) {
914
+ return deriveOwnedAccountsFromPrivateKey({ aptosConfig, privateKey: signer.privateKey, options });
915
+ }
916
+ if (isKeylessSigner(signer)) {
917
+ return deriveOwnedAccountsFromKeylessSigner({
918
+ aptosConfig,
919
+ keylessAccount: signer,
920
+ options,
921
+ });
922
+ }
923
+ if (signer instanceof MultiKeyAccount) {
924
+ if (signer.signers.length === 1) {
925
+ return deriveOwnedAccountsFromSigner({ aptosConfig, signer: signer.signers[0], options });
926
+ }
927
+ }
928
+ if (signer instanceof MultiEd25519Account) {
929
+ if (signer.signers.length === 1) {
930
+ return deriveOwnedAccountsFromPrivateKey({ aptosConfig, privateKey: signer.signers[0], options });
931
+ }
932
+ }
933
+ throw new Error("Unknown signer type");
934
+ }
935
+ async function deriveOwnedAccountsFromKeylessSigner(args) {
936
+ const { aptosConfig, keylessAccount, options } = args;
937
+ const addressesAndPublicKeys = await getAccountsForPublicKey({
938
+ aptosConfig,
939
+ publicKey: keylessAccount.getAnyPublicKey(),
940
+ options,
941
+ });
942
+ const keylessAccountParams = {
943
+ proof: keylessAccount.proofOrPromise,
944
+ jwt: keylessAccount.jwt,
945
+ ephemeralKeyPair: keylessAccount.ephemeralKeyPair,
946
+ pepper: keylessAccount.pepper,
947
+ verificationKeyHash: keylessAccount.verificationKeyHash,
948
+ };
949
+ // Structural discriminator: `FederatedKeylessPublicKey` has a `jwkAddress`
950
+ // field; plain `KeylessPublicKey` does not. Avoids pulling the concrete
951
+ // keyless account classes (and poseidon-lite) into the static import graph.
952
+ const isFederated = "jwkAddress" in keylessAccount.publicKey;
953
+ const accounts = [];
954
+ for (const { accountAddress, publicKey } of addressesAndPublicKeys) {
955
+ if (publicKey instanceof AbstractMultiKey) {
956
+ if (publicKey.getSignaturesRequired() > 1) {
957
+ continue;
958
+ }
959
+ if (publicKey instanceof MultiEd25519PublicKey) {
960
+ throw new Error("Keyless authentication cannot be used for multi-ed25519 accounts. This should never happen.");
961
+ }
962
+ else if (publicKey instanceof MultiKey) {
963
+ accounts.push(new MultiKeyAccount({ multiKey: publicKey, signers: [keylessAccount], address: accountAddress }));
964
+ }
965
+ }
966
+ else if (isFederated) {
967
+ // Dynamic import to avoid pulling poseidon-lite into the `/account` sub-path bundle.
968
+ const { FederatedKeylessAccount } = await import("../account/FederatedKeylessAccount.js");
969
+ accounts.push(FederatedKeylessAccount.create({
970
+ ...keylessAccountParams,
971
+ address: accountAddress,
972
+ jwkAddress: keylessAccount.publicKey.jwkAddress,
973
+ }));
974
+ }
975
+ else {
976
+ // Dynamic import to avoid pulling poseidon-lite into the `/account` sub-path bundle.
977
+ const { KeylessAccount } = await import("../account/KeylessAccount.js");
978
+ accounts.push(KeylessAccount.create({
979
+ ...keylessAccountParams,
980
+ address: accountAddress,
981
+ }));
982
+ }
983
+ }
984
+ return accounts;
985
+ }
986
+ async function deriveOwnedAccountsFromPrivateKey(args) {
987
+ const { aptosConfig, privateKey, options } = args;
988
+ const singleKeyAccount = Account.fromPrivateKey({ privateKey, legacy: false });
989
+ const addressesAndPublicKeys = await getAccountsForPublicKey({
990
+ aptosConfig,
991
+ publicKey: new AnyPublicKey(privateKey.publicKey()),
992
+ options,
993
+ });
994
+ const accounts = [];
995
+ // Iterate through the addressesAndPublicKeys and construct the accounts.
996
+ for (const { accountAddress, publicKey } of addressesAndPublicKeys) {
997
+ if (publicKey instanceof AbstractMultiKey) {
998
+ // Skip multi-key accounts with more than 1 signature required as the user does not have full ownership with just 1 private key.
999
+ if (publicKey.getSignaturesRequired() > 1) {
1000
+ continue;
1001
+ }
1002
+ // Construct the appropriate multi-key type.
1003
+ if (publicKey instanceof MultiEd25519PublicKey) {
1004
+ if (!(privateKey instanceof Ed25519PrivateKey)) {
1005
+ throw new Error("Private key not Ed25519 for MultiEd25519 signature");
1006
+ }
1007
+ accounts.push(new MultiEd25519Account({ publicKey, signers: [privateKey], address: accountAddress }));
1008
+ }
1009
+ else if (publicKey instanceof MultiKey) {
1010
+ accounts.push(new MultiKeyAccount({ multiKey: publicKey, signers: [singleKeyAccount], address: accountAddress }));
1011
+ }
1012
+ }
1013
+ else {
1014
+ // Check if the public key is a legacy Ed25519PublicKey, if so, we need to use the legacy account constructor.
1015
+ const isLegacy = publicKey instanceof Ed25519PublicKey;
1016
+ accounts.push(Account.fromPrivateKey({ privateKey, address: accountAddress, legacy: isLegacy }));
1017
+ }
1018
+ }
1019
+ return accounts;
1020
+ }
1021
+ /**
1022
+ * Gets the multi-keys for a given public key.
1023
+ *
1024
+ * This function retrieves the multi-keys that contain the provided public key.
1025
+ * It performs the following steps:
1026
+ * 1. Constructs a where condition for the public key where the public key matches the provided public key.
1027
+ * 2. Queries the indexer for the multi-keys.
1028
+ * 3. Returns the multi-keys.
1029
+ *
1030
+ * @param args.aptosConfig - The configuration settings for the Aptos network.
1031
+ * @param args.publicKey - The public key to get the multi-keys for. This public key cannot itself be a multi-key.
1032
+ * @returns The multi-keys (MultiKey or MultiEd25519PublicKey) that contain the given public key.
1033
+ */
1034
+ async function getMultiKeysForPublicKey(args) {
1035
+ const { aptosConfig, publicKey, options } = args;
1036
+ if (publicKey instanceof AbstractMultiKey) {
1037
+ throw new Error("Public key is a multi-key.");
1038
+ }
1039
+ const includeUnverified = options?.includeUnverified ?? false;
1040
+ const anyPublicKey = publicKey instanceof AnyPublicKey ? publicKey : new AnyPublicKey(publicKey);
1041
+ const baseKey = anyPublicKey.publicKey;
1042
+ const variant = anyPublicKeyVariantToString(anyPublicKey.variant);
1043
+ const whereCondition = {
1044
+ public_key: { _eq: baseKey.toString() },
1045
+ public_key_type: { _eq: variant },
1046
+ account_public_key: { _is_null: false },
1047
+ ...(includeUnverified ? {} : { is_public_key_used: { _eq: true } }),
1048
+ };
1049
+ const graphqlQuery = {
1050
+ query: GetAuthKeysForPublicKey,
1051
+ variables: {
1052
+ where_condition: whereCondition,
1053
+ },
1054
+ };
1055
+ const { public_key_auth_keys: data } = await queryIndexer({
1056
+ aptosConfig,
1057
+ query: graphqlQuery,
1058
+ originMethod: "getMultiKeysForPublicKey",
1059
+ });
1060
+ const authKeys = data
1061
+ .filter((entry) => entry.account_public_key !== null)
1062
+ .map((entry) => {
1063
+ switch (entry.signature_type) {
1064
+ case "multi_ed25519_signature":
1065
+ return MultiEd25519PublicKey.deserializeWithoutLength(Deserializer.fromHex(entry.account_public_key));
1066
+ case "multi_key_signature":
1067
+ return MultiKey.deserialize(Deserializer.fromHex(entry.account_public_key));
1068
+ default:
1069
+ throw new Error(`Unknown multi-signature type: ${entry.signature_type}`);
1070
+ }
1071
+ });
1072
+ return authKeys;
1073
+ }
1074
+ /**
1075
+ * Gets the account addresses for the given authentication keys.
1076
+ *
1077
+ * This function retrieves the account addresses that are associated with the provided authentication keys.
1078
+ * It performs the following steps:
1079
+ * 1. Constructs a where condition for the authentication keys where auth key matches any of the provided auth keys.
1080
+ * 2. Queries the indexer for the account addresses and gets the results ordered by the last transaction version (most recent first).
1081
+ * 3. Returns the account addresses.
1082
+ *
1083
+ * @param args.aptosConfig - The configuration settings for the Aptos network.
1084
+ * @param args.authKeys - The authentication keys to get the account addresses for.
1085
+ * @param args.options.includeUnverified - Whether to include unverified accounts in the results. Unverified accounts
1086
+ * are accounts that can be authenticated with the signer, but there is no history of the signer using the account.
1087
+ * Default is false.
1088
+ * @returns The account addresses associated with the given authentication keys.
1089
+ */
1090
+ async function getAccountAddressesForAuthKeys(args) {
1091
+ const { aptosConfig, authKeys, options } = args;
1092
+ const includeUnverified = options?.includeUnverified ?? false;
1093
+ if (authKeys.length === 0) {
1094
+ throw new Error("No authentication keys provided");
1095
+ }
1096
+ const whereCondition = {
1097
+ auth_key: { _in: authKeys.map((authKey) => authKey.toString()) },
1098
+ ...(includeUnverified ? {} : { is_auth_key_used: { _eq: true } }),
1099
+ };
1100
+ const graphqlQuery = {
1101
+ query: GetAccountAddressesForAuthKey,
1102
+ variables: {
1103
+ where_condition: whereCondition,
1104
+ order_by: [{ last_transaction_version: "desc" }],
1105
+ },
1106
+ };
1107
+ const { auth_key_account_addresses: data } = await queryIndexer({
1108
+ aptosConfig,
1109
+ query: graphqlQuery,
1110
+ originMethod: "getAccountAddressesForAuthKeys",
1111
+ });
1112
+ return data.map((entry) => ({
1113
+ authKey: new AuthenticationKey({ data: entry.auth_key }),
1114
+ accountAddress: new AccountAddress(Hex.hexInputToUint8Array(entry.account_address)),
1115
+ lastTransactionVersion: Number(entry.last_transaction_version),
1116
+ }));
1117
+ }
1118
+ /**
1119
+ * Returns the last transaction version that was signed by an account.
1120
+ *
1121
+ * If an account was created but has not signed any transactions, the last transaction version will be 0.
1122
+ *
1123
+ * @param args.aptosConfig - The configuration settings for the Aptos network.
1124
+ * @param args.accountAddress - The account address to get the latest transaction version for.
1125
+ * @returns The last transaction version that was signed by the account.
1126
+ */
1127
+ async function getLatestTransactionVersionForAddress(args) {
1128
+ const { aptosConfig, accountAddress } = args;
1129
+ const transactions = await getTransactions({ aptosConfig, accountAddress, options: { limit: 1 } });
1130
+ if (transactions.length === 0) {
1131
+ return 0;
1132
+ }
1133
+ return Number(transactions[0].version);
1134
+ }
1135
+ /**
1136
+ * Gets the default account info for a given public key. 'Default account' means the account
1137
+ * is address is the same as the auth key derived from the public key and the account auth key has
1138
+ * not been rotated.
1139
+ *
1140
+ * @param args - The arguments for getting the default account info for a given public key.
1141
+ * @param args.aptosConfig - The configuration settings for the Aptos network.
1142
+ * @param args.publicKey - The public key to use to derive the address.
1143
+ * @returns An object containing the account address and the last transaction version, or undefined if the account does not exist.
1144
+ */
1145
+ async function getDefaultAccountInfoForPublicKey(args) {
1146
+ const { aptosConfig, publicKey } = args;
1147
+ const derivedAddress = publicKey.authKey().derivedAddress();
1148
+ const [lastTransactionVersion, exists] = await Promise.all([
1149
+ getLatestTransactionVersionForAddress({
1150
+ aptosConfig,
1151
+ accountAddress: derivedAddress,
1152
+ }),
1153
+ doesAccountExistAtAddress({
1154
+ aptosConfig,
1155
+ accountAddress: derivedAddress,
1156
+ options: { withAuthKey: publicKey.authKey() },
1157
+ }),
1158
+ ]);
1159
+ if (exists) {
1160
+ return { accountAddress: derivedAddress, lastTransactionVersion };
1161
+ }
1162
+ return undefined;
1163
+ }
1164
+ //# sourceMappingURL=account.js.map