@aptos-labs/ts-sdk 4.0.0 → 5.1.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 (331) hide show
  1. package/dist/common/{account-CmEgDBH6.d.ts → account-BW99GTa5.d.ts} +35 -4
  2. package/dist/common/chunk-A2XB7TVI.js +4 -0
  3. package/dist/common/chunk-A2XB7TVI.js.map +1 -0
  4. package/dist/common/cli/index.d.ts +1 -1
  5. package/dist/common/cli/index.js +1 -1
  6. package/dist/common/cli/index.js.map +1 -1
  7. package/dist/common/index.d.ts +381 -47
  8. package/dist/common/index.js +34 -36
  9. package/dist/common/index.js.map +1 -1
  10. package/dist/esm/{Ed25519Account-ndmdpFe9.d.mts → Ed25519Account-CPwej6wB.d.mts} +1 -1
  11. package/dist/esm/account/AbstractKeylessAccount.d.mts +3 -3
  12. package/dist/esm/account/AbstractKeylessAccount.mjs +1 -1
  13. package/dist/esm/account/AbstractedAccount.d.mts +3 -2
  14. package/dist/esm/account/AbstractedAccount.mjs +1 -1
  15. package/dist/esm/account/Account.d.mts +2 -2
  16. package/dist/esm/account/Account.mjs +1 -1
  17. package/dist/esm/account/AccountUtils.d.mts +3 -3
  18. package/dist/esm/account/AccountUtils.mjs +1 -1
  19. package/dist/esm/account/DerivableAbstractedAccount.d.mts +2 -2
  20. package/dist/esm/account/DerivableAbstractedAccount.mjs +1 -1
  21. package/dist/esm/account/Ed25519Account.d.mts +2 -2
  22. package/dist/esm/account/Ed25519Account.mjs +1 -1
  23. package/dist/esm/account/EphemeralKeyPair.d.mts +1 -1
  24. package/dist/esm/account/EphemeralKeyPair.mjs +1 -1
  25. package/dist/esm/account/FederatedKeylessAccount.d.mts +3 -3
  26. package/dist/esm/account/FederatedKeylessAccount.mjs +1 -1
  27. package/dist/esm/account/KeylessAccount.d.mts +3 -3
  28. package/dist/esm/account/KeylessAccount.mjs +1 -1
  29. package/dist/esm/account/MultiEd25519Account.d.mts +2 -2
  30. package/dist/esm/account/MultiEd25519Account.mjs +1 -1
  31. package/dist/esm/account/MultiKeyAccount.d.mts +3 -3
  32. package/dist/esm/account/MultiKeyAccount.mjs +1 -1
  33. package/dist/esm/account/SingleKeyAccount.d.mts +2 -2
  34. package/dist/esm/account/SingleKeyAccount.mjs +1 -1
  35. package/dist/esm/account/index.d.mts +3 -3
  36. package/dist/esm/account/index.mjs +1 -1
  37. package/dist/esm/account/utils.d.mts +1 -1
  38. package/dist/esm/account/utils.mjs +1 -1
  39. package/dist/esm/{account--Q9z_xMN.d.mts → account-BortO8g2.d.mts} +34 -4
  40. package/dist/esm/api/account/abstraction.d.mts +1 -1
  41. package/dist/esm/api/account/abstraction.mjs +1 -1
  42. package/dist/esm/api/account.d.mts +31 -13
  43. package/dist/esm/api/account.mjs +1 -1
  44. package/dist/esm/api/ans.d.mts +2 -2
  45. package/dist/esm/api/ans.mjs +1 -1
  46. package/dist/esm/api/aptos.d.mts +4 -3
  47. package/dist/esm/api/aptos.mjs +1 -1
  48. package/dist/esm/api/aptosConfig.d.mts +1 -1
  49. package/dist/esm/api/aptosConfig.mjs +1 -1
  50. package/dist/esm/api/coin.d.mts +1 -1
  51. package/dist/esm/api/coin.mjs +1 -1
  52. package/dist/esm/api/digitalAsset.d.mts +2 -2
  53. package/dist/esm/api/digitalAsset.mjs +1 -1
  54. package/dist/esm/api/faucet.d.mts +1 -1
  55. package/dist/esm/api/faucet.mjs +1 -1
  56. package/dist/esm/api/fungibleAsset.d.mts +2 -2
  57. package/dist/esm/api/fungibleAsset.mjs +1 -1
  58. package/dist/esm/api/general.d.mts +1 -1
  59. package/dist/esm/api/general.mjs +1 -1
  60. package/dist/esm/api/index.d.mts +4 -3
  61. package/dist/esm/api/index.mjs +1 -1
  62. package/dist/esm/api/keyless.d.mts +3 -3
  63. package/dist/esm/api/keyless.mjs +1 -1
  64. package/dist/esm/api/object.d.mts +1 -1
  65. package/dist/esm/api/object.mjs +1 -1
  66. package/dist/esm/api/staking.d.mts +1 -1
  67. package/dist/esm/api/staking.mjs +1 -1
  68. package/dist/esm/api/table.d.mts +1 -1
  69. package/dist/esm/api/table.mjs +1 -1
  70. package/dist/esm/api/transaction.d.mts +56 -36
  71. package/dist/esm/api/transaction.mjs +1 -1
  72. package/dist/esm/api/transactionSubmission/build.d.mts +1 -1
  73. package/dist/esm/api/transactionSubmission/build.mjs +1 -1
  74. package/dist/esm/api/transactionSubmission/helpers.d.mts +1 -1
  75. package/dist/esm/api/transactionSubmission/management.d.mts +2 -2
  76. package/dist/esm/api/transactionSubmission/management.mjs +1 -1
  77. package/dist/esm/api/transactionSubmission/sign.d.mts +2 -2
  78. package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
  79. package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -1
  80. package/dist/esm/api/transactionSubmission/simulate.d.mts +1 -1
  81. package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
  82. package/dist/esm/api/transactionSubmission/submit.d.mts +1 -1
  83. package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
  84. package/dist/esm/api/utils.d.mts +1 -1
  85. package/dist/esm/api/utils.mjs +1 -1
  86. package/dist/esm/bcs/consts.d.mts +1 -1
  87. package/dist/esm/bcs/deserializer.d.mts +1 -1
  88. package/dist/esm/bcs/index.d.mts +1 -1
  89. package/dist/esm/bcs/index.mjs +1 -1
  90. package/dist/esm/bcs/serializable/entryFunctionBytes.d.mts +1 -1
  91. package/dist/esm/bcs/serializable/fixedBytes.d.mts +1 -1
  92. package/dist/esm/bcs/serializable/movePrimitives.d.mts +1 -1
  93. package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
  94. package/dist/esm/bcs/serializable/moveStructs.d.mts +1 -1
  95. package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
  96. package/dist/esm/bcs/serializer.d.mts +1 -1
  97. package/dist/esm/chunk-2PASUPUO.mjs +2 -0
  98. package/dist/esm/chunk-2PASUPUO.mjs.map +1 -0
  99. package/dist/esm/{chunk-6JYQ5P36.mjs → chunk-4AI7KQQ7.mjs} +2 -2
  100. package/dist/esm/{chunk-V6C6NWFU.mjs → chunk-6OWBKU7N.mjs} +2 -2
  101. package/dist/esm/{chunk-BPWSOC2Y.mjs → chunk-7EER7GWV.mjs} +2 -2
  102. package/dist/esm/{chunk-PLI53ZU6.mjs → chunk-AMXZQPUQ.mjs} +2 -2
  103. package/dist/esm/chunk-CIJA7ONS.mjs +2 -0
  104. package/dist/esm/{chunk-6SLY7UV2.mjs.map → chunk-CIJA7ONS.mjs.map} +1 -1
  105. package/dist/esm/chunk-I7XT6L7S.mjs +2 -0
  106. package/dist/esm/chunk-I7XT6L7S.mjs.map +1 -0
  107. package/dist/esm/{chunk-UQZTHVWC.mjs → chunk-JABP65XD.mjs} +2 -2
  108. package/dist/esm/chunk-L72TIN7T.mjs +4 -0
  109. package/dist/esm/chunk-L72TIN7T.mjs.map +1 -0
  110. package/dist/esm/{chunk-3BMZKCLH.mjs → chunk-M3AO73ZL.mjs} +2 -2
  111. package/dist/esm/chunk-MCFQE4GC.mjs +2 -0
  112. package/dist/esm/chunk-MCFQE4GC.mjs.map +1 -0
  113. package/dist/esm/chunk-OLILO7VD.mjs +2 -0
  114. package/dist/esm/{chunk-JCFTAG5Z.mjs.map → chunk-OLILO7VD.mjs.map} +1 -1
  115. package/dist/esm/{chunk-NF73V673.mjs → chunk-QP2BY4PK.mjs} +2 -2
  116. package/dist/esm/{chunk-Y7ZQTLH4.mjs → chunk-RCSJFTST.mjs} +2 -2
  117. package/dist/esm/{chunk-XYXBAU4J.mjs → chunk-SJDCGNWU.mjs} +2 -2
  118. package/dist/esm/{chunk-HZVN4JSO.mjs → chunk-WHSTLR3F.mjs} +2 -2
  119. package/dist/esm/chunk-ZP4DWSQA.mjs +2 -0
  120. package/dist/esm/chunk-ZP4DWSQA.mjs.map +1 -0
  121. package/dist/esm/cli/index.d.mts +1 -1
  122. package/dist/esm/cli/index.mjs +1 -1
  123. package/dist/esm/cli/localNode.mjs +1 -1
  124. package/dist/esm/cli/move.d.mts +1 -1
  125. package/dist/esm/client/core.d.mts +1 -1
  126. package/dist/esm/client/core.mjs +1 -1
  127. package/dist/esm/client/get.d.mts +1 -1
  128. package/dist/esm/client/get.mjs +1 -1
  129. package/dist/esm/client/index.d.mts +1 -1
  130. package/dist/esm/client/index.mjs +1 -1
  131. package/dist/esm/client/post.d.mts +1 -1
  132. package/dist/esm/client/post.mjs +1 -1
  133. package/dist/esm/core/account/index.d.mts +1 -1
  134. package/dist/esm/core/account/index.mjs +1 -1
  135. package/dist/esm/core/account/utils/address.d.mts +1 -1
  136. package/dist/esm/core/account/utils/address.mjs +1 -1
  137. package/dist/esm/core/account/utils/index.d.mts +1 -1
  138. package/dist/esm/core/account/utils/index.mjs +1 -1
  139. package/dist/esm/core/accountAddress.d.mts +1 -1
  140. package/dist/esm/core/accountAddress.mjs +1 -1
  141. package/dist/esm/core/authenticationKey.d.mts +1 -1
  142. package/dist/esm/core/authenticationKey.mjs +1 -1
  143. package/dist/esm/core/crypto/abstraction.d.mts +1 -1
  144. package/dist/esm/core/crypto/abstraction.mjs +1 -1
  145. package/dist/esm/core/crypto/deserializationUtils.d.mts +1 -1
  146. package/dist/esm/core/crypto/deserializationUtils.mjs +1 -1
  147. package/dist/esm/core/crypto/ed25519.d.mts +1 -1
  148. package/dist/esm/core/crypto/ed25519.mjs +1 -1
  149. package/dist/esm/core/crypto/ephemeral.d.mts +1 -1
  150. package/dist/esm/core/crypto/ephemeral.mjs +1 -1
  151. package/dist/esm/core/crypto/federatedKeyless.d.mts +2 -2
  152. package/dist/esm/core/crypto/federatedKeyless.mjs +1 -1
  153. package/dist/esm/core/crypto/index.d.mts +3 -2
  154. package/dist/esm/core/crypto/index.mjs +1 -1
  155. package/dist/esm/core/crypto/keyless.d.mts +2 -2
  156. package/dist/esm/core/crypto/keyless.mjs +1 -1
  157. package/dist/esm/core/crypto/multiEd25519.d.mts +1 -1
  158. package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
  159. package/dist/esm/core/crypto/multiKey.d.mts +1 -1
  160. package/dist/esm/core/crypto/multiKey.mjs +1 -1
  161. package/dist/esm/core/crypto/privateKey.d.mts +1 -1
  162. package/dist/esm/core/crypto/privateKey.mjs +1 -1
  163. package/dist/esm/core/crypto/proof.d.mts +1 -1
  164. package/dist/esm/core/crypto/proof.mjs +1 -1
  165. package/dist/esm/core/crypto/publicKey.d.mts +1 -1
  166. package/dist/esm/core/crypto/publicKey.mjs +1 -1
  167. package/dist/esm/core/crypto/secp256k1.d.mts +1 -1
  168. package/dist/esm/core/crypto/secp256k1.mjs +1 -1
  169. package/dist/esm/core/crypto/secp256r1.d.mts +306 -0
  170. package/dist/esm/core/crypto/secp256r1.mjs +2 -0
  171. package/dist/esm/core/crypto/secp256r1.mjs.map +1 -0
  172. package/dist/esm/core/crypto/signature.d.mts +1 -1
  173. package/dist/esm/core/crypto/signature.mjs +1 -1
  174. package/dist/esm/core/crypto/singleKey.d.mts +1 -1
  175. package/dist/esm/core/crypto/singleKey.mjs +1 -1
  176. package/dist/esm/core/crypto/types.d.mts +1 -1
  177. package/dist/esm/core/crypto/utils.d.mts +5 -2
  178. package/dist/esm/core/crypto/utils.mjs +1 -1
  179. package/dist/esm/core/hex.d.mts +1 -1
  180. package/dist/esm/core/index.d.mts +3 -2
  181. package/dist/esm/core/index.mjs +1 -1
  182. package/dist/esm/errors/index.d.mts +1 -1
  183. package/dist/esm/errors/index.mjs +1 -1
  184. package/dist/esm/{federatedKeyless-CiyplsOB.d.mts → federatedKeyless-CTzDAQTu.d.mts} +1 -1
  185. package/dist/esm/index.d.mts +5 -4
  186. package/dist/esm/index.mjs +1 -1
  187. package/dist/esm/internal/abstraction.d.mts +1 -1
  188. package/dist/esm/internal/abstraction.mjs +1 -1
  189. package/dist/esm/internal/account.d.mts +45 -21
  190. package/dist/esm/internal/account.mjs +1 -1
  191. package/dist/esm/internal/ans.d.mts +2 -2
  192. package/dist/esm/internal/ans.mjs +1 -1
  193. package/dist/esm/internal/coin.d.mts +1 -1
  194. package/dist/esm/internal/coin.mjs +1 -1
  195. package/dist/esm/internal/digitalAsset.d.mts +2 -2
  196. package/dist/esm/internal/digitalAsset.mjs +1 -1
  197. package/dist/esm/internal/faucet.d.mts +1 -1
  198. package/dist/esm/internal/faucet.mjs +1 -1
  199. package/dist/esm/internal/fungibleAsset.d.mts +2 -2
  200. package/dist/esm/internal/fungibleAsset.mjs +1 -1
  201. package/dist/esm/internal/general.d.mts +1 -1
  202. package/dist/esm/internal/general.mjs +1 -1
  203. package/dist/esm/internal/keyless.d.mts +3 -3
  204. package/dist/esm/internal/keyless.mjs +1 -1
  205. package/dist/esm/internal/object.d.mts +1 -1
  206. package/dist/esm/internal/object.mjs +1 -1
  207. package/dist/esm/internal/staking.d.mts +1 -1
  208. package/dist/esm/internal/staking.mjs +1 -1
  209. package/dist/esm/internal/table.d.mts +1 -1
  210. package/dist/esm/internal/table.mjs +1 -1
  211. package/dist/esm/internal/transaction.d.mts +1 -1
  212. package/dist/esm/internal/transaction.mjs +1 -1
  213. package/dist/esm/internal/transactionSubmission.d.mts +2 -2
  214. package/dist/esm/internal/transactionSubmission.mjs +1 -1
  215. package/dist/esm/internal/utils/index.d.mts +1 -1
  216. package/dist/esm/internal/utils/index.mjs +1 -1
  217. package/dist/esm/internal/utils/utils.d.mts +1 -1
  218. package/dist/esm/internal/utils/utils.mjs +1 -1
  219. package/dist/esm/internal/view.d.mts +1 -1
  220. package/dist/esm/internal/view.mjs +1 -1
  221. package/dist/esm/transactions/authenticator/account.d.mts +1 -1
  222. package/dist/esm/transactions/authenticator/account.mjs +1 -1
  223. package/dist/esm/transactions/authenticator/index.d.mts +1 -1
  224. package/dist/esm/transactions/authenticator/index.mjs +1 -1
  225. package/dist/esm/transactions/authenticator/transaction.d.mts +1 -1
  226. package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
  227. package/dist/esm/transactions/index.d.mts +1 -1
  228. package/dist/esm/transactions/index.mjs +1 -1
  229. package/dist/esm/transactions/instances/chainId.d.mts +1 -1
  230. package/dist/esm/transactions/instances/identifier.d.mts +1 -1
  231. package/dist/esm/transactions/instances/index.d.mts +1 -1
  232. package/dist/esm/transactions/instances/index.mjs +1 -1
  233. package/dist/esm/transactions/instances/moduleId.d.mts +1 -1
  234. package/dist/esm/transactions/instances/moduleId.mjs +1 -1
  235. package/dist/esm/transactions/instances/multiAgentTransaction.d.mts +1 -1
  236. package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
  237. package/dist/esm/transactions/instances/rawTransaction.d.mts +1 -1
  238. package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
  239. package/dist/esm/transactions/instances/rotationProofChallenge.d.mts +1 -1
  240. package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
  241. package/dist/esm/transactions/instances/signedTransaction.d.mts +1 -1
  242. package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
  243. package/dist/esm/transactions/instances/simpleTransaction.d.mts +1 -1
  244. package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
  245. package/dist/esm/transactions/instances/transactionArgument.d.mts +1 -1
  246. package/dist/esm/transactions/instances/transactionPayload.d.mts +1 -1
  247. package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
  248. package/dist/esm/transactions/management/accountSequenceNumber.d.mts +2 -2
  249. package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
  250. package/dist/esm/transactions/management/index.d.mts +2 -2
  251. package/dist/esm/transactions/management/index.mjs +1 -1
  252. package/dist/esm/transactions/management/transactionWorker.d.mts +2 -2
  253. package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
  254. package/dist/esm/transactions/transactionBuilder/helpers.d.mts +1 -1
  255. package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
  256. package/dist/esm/transactions/transactionBuilder/index.d.mts +1 -1
  257. package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
  258. package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +1 -1
  259. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
  260. package/dist/esm/transactions/transactionBuilder/signingMessage.d.mts +1 -1
  261. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
  262. package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +2 -2
  263. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
  264. package/dist/esm/transactions/typeTag/index.d.mts +1 -1
  265. package/dist/esm/transactions/typeTag/index.mjs +1 -1
  266. package/dist/esm/transactions/typeTag/parser.d.mts +1 -1
  267. package/dist/esm/transactions/typeTag/parser.mjs +1 -1
  268. package/dist/esm/transactions/types.d.mts +1 -1
  269. package/dist/esm/types/abstraction.d.mts +9 -3
  270. package/dist/esm/types/abstraction.mjs +1 -1
  271. package/dist/esm/types/index.d.mts +1 -1
  272. package/dist/esm/types/index.mjs +1 -1
  273. package/dist/esm/types/types.d.mts +1 -1
  274. package/dist/esm/types/types.mjs +1 -1
  275. package/dist/esm/utils/const.d.mts +2 -1
  276. package/dist/esm/utils/const.mjs +1 -1
  277. package/dist/esm/utils/helpers.d.mts +1 -1
  278. package/dist/esm/utils/helpers.mjs +1 -1
  279. package/dist/esm/utils/index.d.mts +2 -2
  280. package/dist/esm/utils/index.mjs +1 -1
  281. package/dist/esm/utils/normalizeBundle.d.mts +1 -1
  282. package/dist/esm/utils/normalizeBundle.mjs +1 -1
  283. package/dist/esm/version.d.mts +1 -1
  284. package/dist/esm/version.mjs +1 -1
  285. package/package.json +27 -28
  286. package/src/account/AbstractedAccount.ts +16 -3
  287. package/src/account/DerivableAbstractedAccount.ts +3 -1
  288. package/src/api/account.ts +36 -23
  289. package/src/api/transaction.ts +59 -36
  290. package/src/core/crypto/index.ts +1 -0
  291. package/src/core/crypto/privateKey.ts +1 -0
  292. package/src/core/crypto/secp256k1.ts +9 -1
  293. package/src/core/crypto/secp256r1.ts +495 -0
  294. package/src/core/crypto/singleKey.ts +11 -0
  295. package/src/core/crypto/utils.ts +38 -1
  296. package/src/internal/account.ts +69 -83
  297. package/src/transactions/authenticator/account.ts +71 -17
  298. package/src/types/abstraction.ts +9 -2
  299. package/src/types/types.ts +5 -0
  300. package/src/utils/const.ts +2 -0
  301. package/src/version.ts +1 -1
  302. package/dist/common/chunk-6MMUUJHX.js +0 -4
  303. package/dist/common/chunk-6MMUUJHX.js.map +0 -1
  304. package/dist/esm/chunk-4JT5AESZ.mjs +0 -2
  305. package/dist/esm/chunk-4JT5AESZ.mjs.map +0 -1
  306. package/dist/esm/chunk-55Q7BSZT.mjs +0 -6
  307. package/dist/esm/chunk-55Q7BSZT.mjs.map +0 -1
  308. package/dist/esm/chunk-6SLY7UV2.mjs +0 -2
  309. package/dist/esm/chunk-DPW6ELCQ.mjs +0 -2
  310. package/dist/esm/chunk-DPW6ELCQ.mjs.map +0 -1
  311. package/dist/esm/chunk-IJE2LVZG.mjs +0 -2
  312. package/dist/esm/chunk-IJE2LVZG.mjs.map +0 -1
  313. package/dist/esm/chunk-JCFTAG5Z.mjs +0 -2
  314. package/dist/esm/chunk-K43K3YG7.mjs +0 -2
  315. package/dist/esm/chunk-K43K3YG7.mjs.map +0 -1
  316. package/dist/esm/chunk-KJH4KKG6.mjs +0 -2
  317. package/dist/esm/chunk-KJH4KKG6.mjs.map +0 -1
  318. package/dist/esm/chunk-MSMFHPDT.mjs +0 -2
  319. package/dist/esm/chunk-MSMFHPDT.mjs.map +0 -1
  320. package/dist/esm/chunk-ROT6S6BM.mjs +0 -2
  321. package/dist/esm/chunk-ROT6S6BM.mjs.map +0 -1
  322. /package/dist/esm/{chunk-6JYQ5P36.mjs.map → chunk-4AI7KQQ7.mjs.map} +0 -0
  323. /package/dist/esm/{chunk-V6C6NWFU.mjs.map → chunk-6OWBKU7N.mjs.map} +0 -0
  324. /package/dist/esm/{chunk-BPWSOC2Y.mjs.map → chunk-7EER7GWV.mjs.map} +0 -0
  325. /package/dist/esm/{chunk-PLI53ZU6.mjs.map → chunk-AMXZQPUQ.mjs.map} +0 -0
  326. /package/dist/esm/{chunk-UQZTHVWC.mjs.map → chunk-JABP65XD.mjs.map} +0 -0
  327. /package/dist/esm/{chunk-3BMZKCLH.mjs.map → chunk-M3AO73ZL.mjs.map} +0 -0
  328. /package/dist/esm/{chunk-NF73V673.mjs.map → chunk-QP2BY4PK.mjs.map} +0 -0
  329. /package/dist/esm/{chunk-Y7ZQTLH4.mjs.map → chunk-RCSJFTST.mjs.map} +0 -0
  330. /package/dist/esm/{chunk-XYXBAU4J.mjs.map → chunk-SJDCGNWU.mjs.map} +0 -0
  331. /package/dist/esm/{chunk-HZVN4JSO.mjs.map → chunk-WHSTLR3F.mjs.map} +0 -0
@@ -3,6 +3,6 @@
3
3
  *
4
4
  * hardcoded for now, we would want to have it injected dynamically
5
5
  */
6
- declare const VERSION = "4.0.0";
6
+ declare const VERSION = "5.1.0";
7
7
 
8
8
  export { VERSION };
@@ -1,2 +1,2 @@
1
- import{a}from"./chunk-6SLY7UV2.mjs";import"./chunk-KDMSOCZY.mjs";export{a as VERSION};
1
+ import{a}from"./chunk-CIJA7ONS.mjs";import"./chunk-KDMSOCZY.mjs";export{a as VERSION};
2
2
  //# sourceMappingURL=version.mjs.map
package/package.json CHANGED
@@ -52,50 +52,49 @@
52
52
  "dependencies": {
53
53
  "@aptos-labs/aptos-cli": "^1.0.2",
54
54
  "@aptos-labs/aptos-client": "^2.0.0",
55
- "@noble/curves": "^1.6.0",
55
+ "@noble/curves": "^1.9.0",
56
56
  "@noble/hashes": "^1.5.0",
57
57
  "@scure/bip32": "^1.4.0",
58
58
  "@scure/bip39": "^1.3.0",
59
59
  "eventemitter3": "^5.0.1",
60
- "form-data": "^4.0.0",
60
+ "form-data": "^4.0.4",
61
61
  "js-base64": "^3.7.7",
62
62
  "jwt-decode": "^4.0.0",
63
63
  "poseidon-lite": "^0.2.0"
64
64
  },
65
65
  "devDependencies": {
66
- "@babel/traverse": "^7.26.10",
67
- "@cucumber/cucumber": "^11.2.0",
66
+ "@babel/traverse": "^7.28.4",
67
+ "@cucumber/cucumber": "^12.2.0",
68
68
  "@eslint/eslintrc": "^3.3.1",
69
- "@graphql-codegen/cli": "^5.0.5",
70
- "@graphql-codegen/import-types-preset": "^3.0.0",
71
- "@graphql-codegen/typescript": "^4.1.5",
72
- "@graphql-codegen/typescript-graphql-request": "^6.2.0",
73
- "@graphql-codegen/typescript-operations": "^4.5.1",
69
+ "@graphql-codegen/cli": "^6.0.0",
70
+ "@graphql-codegen/import-types-preset": "^3.0.1",
71
+ "@graphql-codegen/typescript": "^5.0.0",
72
+ "@graphql-codegen/typescript-graphql-request": "^6.3.0",
73
+ "@graphql-codegen/typescript-operations": "^5.0.0",
74
74
  "@types/base-64": "^1.0.2",
75
75
  "@types/jest": "^29.5.14",
76
- "@types/jsonwebtoken": "^9.0.9",
77
- "@types/node": "^20.17.25",
78
- "@typescript-eslint/eslint-plugin": "^8.27.0",
79
- "@typescript-eslint/parser": "^8.27.0",
76
+ "@types/jsonwebtoken": "^9.0.10",
77
+ "@types/node": "^24.3.1",
78
+ "@typescript-eslint/eslint-plugin": "^8.43.0",
79
+ "@typescript-eslint/parser": "^8.43.0",
80
80
  "dotenv": "^16.4.7",
81
- "eslint": "^9.23.0",
81
+ "eslint": "^9.35.0",
82
82
  "eslint-config-airbnb-base": "^15.0.0",
83
- "eslint-config-prettier": "^10.1.1",
84
- "eslint-plugin-import": "^2.31.0",
85
- "graphql": "^16.10.0",
86
- "globals": "^16.0.0",
87
- "graphql-request": "^7.1.2",
83
+ "eslint-config-prettier": "^10.1.8",
84
+ "eslint-plugin-import": "^2.32.0",
85
+ "graphql": "^16.11.0",
86
+ "globals": "^16.4.0",
87
+ "graphql-request": "^7.2.0",
88
88
  "jest": "^29.7.0",
89
89
  "jsonwebtoken": "^9.0.2",
90
- "prettier": "^3.5.3",
90
+ "prettier": "^3.6.2",
91
91
  "tree-kill": "^1.2.2",
92
- "ts-jest": "^29.2.5",
93
- "ts-loader": "^9.5.2",
94
- "ts-node": "^10.9.2",
95
- "tsup": "^8.4.0",
96
- "typedoc": "^0.28.1",
97
- "typedoc-plugin-missing-exports": "^4.0.0",
98
- "typescript": "^5.8.2"
92
+ "ts-jest": "^29.4.1",
93
+ "ts-loader": "^9.5.4",
94
+ "tsup": "^8.5.0",
95
+ "typedoc": "^0.28.12",
96
+ "typedoc-plugin-missing-exports": "^4.1.0",
97
+ "typescript": "^5.8.3"
99
98
  },
100
- "version": "4.0.0"
99
+ "version": "5.1.0"
101
100
  }
@@ -4,11 +4,15 @@ import { AbstractPublicKey, AbstractSignature } from "../core/crypto/abstraction
4
4
  import { SigningScheme, HexInput } from "../types";
5
5
  import { Account } from "./Account";
6
6
  import { AnyRawTransaction } from "../transactions/types";
7
- import { generateSigningMessageForTransaction } from "../transactions/transactionBuilder/signingMessage";
8
- import { AccountAuthenticatorAbstraction } from "../transactions/authenticator/account";
7
+ import {
8
+ generateSigningMessage,
9
+ generateSigningMessageForTransaction,
10
+ } from "../transactions/transactionBuilder/signingMessage";
11
+ import { AccountAbstractionMessage, AccountAuthenticatorAbstraction } from "../transactions/authenticator/account";
9
12
  import { Ed25519Account } from "./Ed25519Account";
10
13
  import { Serializer } from "../bcs/serializer";
11
14
  import { isValidFunctionInfo } from "../utils/helpers";
15
+ import { ACCOUNT_ABSTRACTION_SIGNING_DATA_SALT } from "../utils/const";
12
16
 
13
17
  type AbstractedAccountConstructorArgs = {
14
18
  /**
@@ -81,6 +85,11 @@ export class AbstractedAccount extends Account {
81
85
  });
82
86
  }
83
87
 
88
+ public static generateAccountAbstractionMessage(message: HexInput, functionInfo: string): HexInput {
89
+ const accountAbstractionMessage = new AccountAbstractionMessage(message, functionInfo);
90
+ return generateSigningMessage(accountAbstractionMessage.bcsToBytes(), ACCOUNT_ABSTRACTION_SIGNING_DATA_SALT);
91
+ }
92
+
84
93
  signWithAuthenticator(message: HexInput): AccountAuthenticatorAbstraction {
85
94
  return new AccountAuthenticatorAbstraction(
86
95
  this.authenticationFunction,
@@ -90,7 +99,11 @@ export class AbstractedAccount extends Account {
90
99
  }
91
100
 
92
101
  signTransactionWithAuthenticator(transaction: AnyRawTransaction): AccountAuthenticatorAbstraction {
93
- return this.signWithAuthenticator(generateSigningMessageForTransaction(transaction));
102
+ const message = AbstractedAccount.generateAccountAbstractionMessage(
103
+ generateSigningMessageForTransaction(transaction),
104
+ this.authenticationFunction,
105
+ );
106
+ return this.signWithAuthenticator(message);
94
107
  }
95
108
 
96
109
  sign: (message: HexInput) => AbstractSignature;
@@ -1,10 +1,12 @@
1
1
  import { sha3_256 } from "@noble/hashes/sha3";
2
2
  import { Serializer } from "../bcs/serializer";
3
3
  import { AccountAddress } from "../core/accountAddress";
4
- import { AccountAuthenticatorAbstraction } from "../transactions/authenticator/account";
4
+ import { AccountAbstractionMessage, AccountAuthenticatorAbstraction } from "../transactions/authenticator/account";
5
5
  import { HexInput } from "../types";
6
6
  import { isValidFunctionInfo } from "../utils/helpers";
7
7
  import { AbstractedAccount } from "./AbstractedAccount";
8
+ import { generateSigningMessage } from "../transactions/transactionBuilder/signingMessage";
9
+ import { ACCOUNT_ABSTRACTION_SIGNING_DATA_SALT } from "../utils/const";
8
10
 
9
11
  type DerivableAbstractedAccountArgs = {
10
12
  /**
@@ -40,6 +40,7 @@ import {
40
40
  getAccountsForPublicKey,
41
41
  getAccountTokensCount,
42
42
  getAccountTransactionsCount,
43
+ getBalance,
43
44
  getInfo,
44
45
  getModule,
45
46
  getModules,
@@ -780,15 +781,15 @@ export class Account {
780
781
  /**
781
782
  * Queries the current amount of a specified coin held by an account.
782
783
  *
784
+ * @deprecated Use `getBalance({ accountAddress, asset })` instead.
785
+ * This method is slated for removal in a future release.
786
+ *
783
787
  * @param args The parameters for querying the account's coin amount.
784
788
  * @param args.accountAddress The account address to query for the coin amount.
785
789
  * @param args.coinType The coin type to query. Note: If not provided, it may be automatically populated if `faMetadataAddress`
786
790
  * is specified.
787
791
  * @param args.faMetadataAddress The fungible asset metadata address to query. Note: If not provided, it may be automatically
788
792
  * populated if `coinType` is specified.
789
- * @param args.minimumLedgerVersion Not used anymore, here for backward compatibility
790
- * see https://github.com/aptos-labs/aptos-ts-sdk/pull/519, will be removed in the near future.
791
- * Optional ledger version to sync up to before querying.
792
793
  * @returns The current amount of the specified coin held by the account.
793
794
  *
794
795
  * @example
@@ -799,13 +800,9 @@ export class Account {
799
800
  * const aptos = new Aptos(config);
800
801
  *
801
802
  * async function runExample() {
802
- * // Query the account's coin amount for a specific coin type
803
- * const accountCoinAmount = await aptos.getAccountCoinAmount({
804
- * accountAddress: "0x1", // replace with a real account address
805
- * coinType: "0x1::aptos_coin::AptosCoin" // specify the coin type
806
- * });
807
- *
808
- * console.log(`Account coin amount: ${accountCoinAmount}`);
803
+ * // Prefer the new API
804
+ * const amount = await aptos.getBalance({ accountAddress: "0x1", asset: "0x1::aptos_coin::AptosCoin" });
805
+ * console.log(`Balance: ${amount}`);
809
806
  * }
810
807
  * runExample().catch(console.error);
811
808
  * ```
@@ -815,18 +812,9 @@ export class Account {
815
812
  accountAddress: AccountAddressInput;
816
813
  coinType?: MoveStructId;
817
814
  faMetadataAddress?: AccountAddressInput;
818
- minimumLedgerVersion?: AnyNumber;
819
815
  }): Promise<number> {
820
- const { accountAddress, coinType, faMetadataAddress, minimumLedgerVersion } = args;
816
+ const { accountAddress, coinType, faMetadataAddress } = args;
821
817
 
822
- if (minimumLedgerVersion) {
823
- // eslint-disable-next-line no-console
824
- console.warn(
825
- `minimumLedgerVersion is not used anymore, here for backward
826
- compatibility see https://github.com/aptos-labs/aptos-ts-sdk/pull/519,
827
- will be removed in the near future`,
828
- );
829
- }
830
818
  // Attempt to populate the CoinType field if the FA address is provided.
831
819
  // We cannot do this internally due to dependency cycles issue.
832
820
  let coinAssetType: MoveStructId | undefined = coinType;
@@ -835,15 +823,15 @@ export class Account {
835
823
  async () => {
836
824
  try {
837
825
  const pairedCoinTypeStruct = (
838
- await view({
826
+ await view<[{ vec: [MoveStructId] }]>({
839
827
  aptosConfig: this.config,
840
828
  payload: { function: "0x1::coin::paired_coin", functionArguments: [faMetadataAddress] },
841
829
  })
842
- ).at(0) as { vec: MoveValue[] };
830
+ )[0];
843
831
 
844
832
  // Check if the Option has a value, and if so, parse the struct
845
833
  if (pairedCoinTypeStruct.vec.length > 0 && isEncodedStruct(pairedCoinTypeStruct.vec[0])) {
846
- return parseEncodedStruct(pairedCoinTypeStruct.vec[0]) as MoveStructId;
834
+ return parseEncodedStruct(pairedCoinTypeStruct.vec[0]);
847
835
  }
848
836
  } catch (error) {
849
837
  /* No paired coin type found */
@@ -902,6 +890,31 @@ export class Account {
902
890
  return parseInt(balanceStr, 10);
903
891
  }
904
892
 
893
+ /**
894
+ * Retrieves the balance for an account and asset.
895
+ *
896
+ * @param args The parameters for the balance query.
897
+ * @param args.accountAddress The account address to query.
898
+ * @param args.asset The asset to query: Move struct ID (e.g., `0x1::aptos_coin::AptosCoin`) or FA metadata address.
899
+ * @returns The balance as a number.
900
+ *
901
+ * @example
902
+ * ```ts
903
+ * const aptos = new Aptos(new AptosConfig());
904
+ * // APT coin by type
905
+ * const apt = await aptos.getBalance({ accountAddress: "0x1", asset: "0x1::aptos_coin::AptosCoin" });
906
+ * // Some FA by metadata address
907
+ * const fa = await aptos.getBalance({ accountAddress: "0x1", asset: "0xa" });
908
+ * ```
909
+ * @group Account
910
+ */
911
+ async getBalance(args: {
912
+ accountAddress: AccountAddressInput;
913
+ asset: MoveStructId | AccountAddressInput;
914
+ }): Promise<number> {
915
+ return getBalance({ aptosConfig: this.config, ...args });
916
+ }
917
+
905
918
  /**
906
919
  * Queries an account's owned objects.
907
920
  *
@@ -36,14 +36,14 @@ import {
36
36
  InputGenerateTransactionPayloadData,
37
37
  InputTransactionPluginData,
38
38
  } from "../transactions";
39
- import { AccountAddressInput, AuthenticationKey, Ed25519PrivateKey } from "../core";
40
- import { Account } from "../account";
39
+ import { AccountAddressInput, AccountPublicKey, AuthenticationKey, Ed25519PrivateKey } from "../core";
40
+ import { Account, Ed25519Account, MultiEd25519Account } from "../account";
41
41
  import { Build } from "./transactionSubmission/build";
42
42
  import { Simulate } from "./transactionSubmission/simulate";
43
43
  import { Submit } from "./transactionSubmission/submit";
44
44
  import { TransactionManagement } from "./transactionSubmission/management";
45
45
  import { SimpleTransaction } from "../transactions/instances/simpleTransaction";
46
- import { rotateAuthKey } from "../internal/account";
46
+ import { rotateAuthKey, rotateAuthKeyUnverified } from "../internal/account";
47
47
 
48
48
  /**
49
49
  * Represents a transaction in the Aptos blockchain,
@@ -480,43 +480,33 @@ export class Transaction {
480
480
  *
481
481
  * @param args - The arguments for rotating the authentication key.
482
482
  * @param args.fromAccount - The account from which the authentication key will be rotated.
483
- * @param args.toAccount - (Optional) The target account to rotate to. Required if not using toNewPrivateKey or toAuthKey.
484
- * @param args.toNewPrivateKey - (Optional) The new private key to rotate to. Required if not using toAccount or toAuthKey.
485
- * @param args.toAuthKey - (Optional) The new authentication key to rotate to. Can only be used with dangerouslySkipVerification=true.
486
- * @param args.dangerouslySkipVerification - (Optional) If true, skips verification steps after rotation. Required when using toAuthKey.
483
+ * @param args.toAccount - (Optional) The target account to rotate to. Required if not using toNewPrivateKey.
484
+ * @param args.toNewPrivateKey - (Optional) The new private key to rotate to. Required if not using toAccount.
487
485
  *
488
486
  * @remarks
489
487
  * This function supports three modes of rotation:
490
488
  * 1. Using a target Account object (toAccount)
491
489
  * 2. Using a new private key (toNewPrivateKey)
492
- * 3. Using a raw authentication key (toAuthKey) - requires dangerouslySkipVerification=true
493
490
  *
494
- * When not using dangerouslySkipVerification, the function performs additional safety checks and account setup.
491
+ * For Ed25519 accounts, the function will use a challenge-based rotation that requires signatures from both the old and new keys.
492
+ * For multi-key accounts like MultiEd25519Account, the function will use a challenge-based rotation that requires signatures from both keys.
493
+ * For other account types, the function will use an unverified rotation that only requires the new public key.
495
494
  *
496
- * If the new key is a multi key, skipping verification is dangerous because verification will publish the public key onchain and
497
- * prevent users from being locked out of the account from loss of knowledge of one of the public keys.
498
- *
499
- * @returns PendingTransactionResponse
495
+ * @returns SimpleTransaction that can be submitted to rotate the auth key
500
496
  *
501
497
  * @example
502
498
  * ```typescript
503
- * import { Aptos, AptosConfig, Network, Account, PrivateKey } from "@aptos-labs/ts-sdk";
504
- *
505
- * const config = new AptosConfig({ network: Network.TESTNET });
506
- * const aptos = new Aptos(config);
507
- *
508
- * async function runExample() {
509
- * // Rotate the authentication key for an account
510
- * const response = await aptos.rotateAuthKey({
511
- * // replace with a real account
512
- * fromAccount: Account.generate(),
513
- * // replace with a real private key
514
- * toNewPrivateKey: new PrivateKey("0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"),
515
- * });
516
- *
517
- * console.log(response);
518
- * }
519
- * runExample().catch(console.error);
499
+ * // Create and submit transaction to rotate the auth key
500
+ * const transaction = await aptos.rotateAuthKey({
501
+ * fromAccount,
502
+ * toAccount: toAccount,
503
+ * });
504
+ *
505
+ * // Sign and submit the transaction
506
+ * const pendingTransaction = await aptos.signAndSubmitTransaction({
507
+ * signer: fromAccount,
508
+ * transaction,
509
+ * });
520
510
  * ```
521
511
  * @group Transaction
522
512
  */
@@ -524,15 +514,48 @@ export class Transaction {
524
514
  args: {
525
515
  fromAccount: Account;
526
516
  options?: InputGenerateTransactionOptions;
527
- } & (
528
- | { toAccount: Account; dangerouslySkipVerification?: never }
529
- | { toNewPrivateKey: Ed25519PrivateKey; dangerouslySkipVerification?: never }
530
- | { toAuthKey: AuthenticationKey; dangerouslySkipVerification: true }
531
- ),
532
- ): Promise<PendingTransactionResponse> {
517
+ } & ({ toAccount: Ed25519Account | MultiEd25519Account } | { toNewPrivateKey: Ed25519PrivateKey }),
518
+ ): Promise<SimpleTransaction> {
533
519
  return rotateAuthKey({ aptosConfig: this.config, ...args });
534
520
  }
535
521
 
522
+ /**
523
+ * Rotates the authentication key for a given account without verifying the new key.
524
+ *
525
+ * Accounts with their auth key rotated via this function will be derivable via the `getAccountsForPublicKey` and
526
+ * `deriveOwnedAccountsFromSigner` functions however the public key will be unverified (no proof of ownership). Thus
527
+ * includeUnverified must be set to true to derive the account until the public key is verified via signing a transaction.
528
+ *
529
+ * @param args - The arguments for rotating the authentication key.
530
+ * @param args.fromAccount - The account from which the authentication key will be rotated.
531
+ * @param args.toNewPublicKey - The new public key to rotate to.
532
+ *
533
+ * @returns A simple transaction object that can be submitted to the network.
534
+ *
535
+ * @example
536
+ * ```typescript
537
+ * // Create and submit transaction to rotate the auth key
538
+ * const transaction = await aptos.rotateAuthKeyUnverified({
539
+ * fromAccount,
540
+ * toNewPublicKey,
541
+ * });
542
+ *
543
+ * // Sign and submit the transaction
544
+ * const pendingTransaction = await aptos.signAndSubmitTransaction({
545
+ * signer: fromAccount,
546
+ * transaction,
547
+ * });
548
+ * ```
549
+ * @group Transaction
550
+ */
551
+ async rotateAuthKeyUnverified(args: {
552
+ fromAccount: Account;
553
+ options?: InputGenerateTransactionOptions;
554
+ toNewPublicKey: AccountPublicKey;
555
+ }): Promise<SimpleTransaction> {
556
+ return rotateAuthKeyUnverified({ aptosConfig: this.config, ...args });
557
+ }
558
+
536
559
  /**
537
560
  * Sign a transaction that can later be submitted to the chain.
538
561
  * This function is essential for ensuring the authenticity of the transaction by using the provided account's signing capabilities.
@@ -13,6 +13,7 @@ export * from "./poseidon";
13
13
  export * from "./privateKey";
14
14
  export * from "./publicKey";
15
15
  export * from "./secp256k1";
16
+ export * from "./secp256r1";
16
17
  export * from "./signature";
17
18
  export * from "./singleKey";
18
19
  export * from "./types";
@@ -45,6 +45,7 @@ export class PrivateKey {
45
45
  public static readonly AIP80_PREFIXES = {
46
46
  [PrivateKeyVariants.Ed25519]: "ed25519-priv-",
47
47
  [PrivateKeyVariants.Secp256k1]: "secp256k1-priv-",
48
+ [PrivateKeyVariants.Secp256r1]: "secp256r1-priv-",
48
49
  };
49
50
 
50
51
  /**
@@ -32,6 +32,9 @@ export class Secp256k1PublicKey extends PublicKey {
32
32
  // Hex value of the public key
33
33
  private readonly key: Hex;
34
34
 
35
+ // Identifier to distinguish from Secp256k1PublicKey
36
+ public readonly keyType: string = "secp256k1";
37
+
35
38
  /**
36
39
  * Create a new PublicKey instance from a HexInput, which can be a string or Uint8Array.
37
40
  * This constructor validates the length of the provided signature data.
@@ -171,7 +174,12 @@ export class Secp256k1PublicKey extends PublicKey {
171
174
  * @category Serialization
172
175
  */
173
176
  static isInstance(publicKey: PublicKey): publicKey is Secp256k1PublicKey {
174
- return "key" in publicKey && (publicKey.key as any)?.data?.length === Secp256k1PublicKey.LENGTH;
177
+ return (
178
+ "key" in publicKey &&
179
+ (publicKey.key as any)?.data?.length === Secp256k1PublicKey.LENGTH &&
180
+ "keyType" in publicKey &&
181
+ (publicKey as any).keyType === "secp256k1"
182
+ );
175
183
  }
176
184
  }
177
185