@aptos-labs/ts-sdk 6.0.0 → 6.2.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 (467) hide show
  1. package/README.md +9 -13
  2. package/dist/common/{account-Dpz_N9h-.d.ts → account-DGpxrkAn.d.ts} +187 -20
  3. package/dist/common/chunk-2VR6ONNW.js +4 -0
  4. package/dist/common/chunk-2VR6ONNW.js.map +1 -0
  5. package/dist/common/cli/index.d.ts +2 -2
  6. package/dist/common/cli/index.js +1 -1
  7. package/dist/common/cli/index.js.map +1 -1
  8. package/dist/common/index.d.ts +69 -6
  9. package/dist/common/index.js +34 -45
  10. package/dist/common/index.js.map +1 -1
  11. package/dist/esm/{Ed25519Account-BW_kXHC2.d.mts → Ed25519Account-BCt2cu_M.d.mts} +2 -2
  12. package/dist/esm/account/AbstractKeylessAccount.d.mts +3 -3
  13. package/dist/esm/account/AbstractKeylessAccount.mjs +1 -1
  14. package/dist/esm/account/AbstractedAccount.d.mts +2 -2
  15. package/dist/esm/account/AbstractedAccount.mjs +1 -1
  16. package/dist/esm/account/Account.d.mts +2 -2
  17. package/dist/esm/account/Account.mjs +1 -1
  18. package/dist/esm/account/AccountUtils.d.mts +3 -3
  19. package/dist/esm/account/AccountUtils.mjs +1 -1
  20. package/dist/esm/account/DerivableAbstractedAccount.d.mts +2 -2
  21. package/dist/esm/account/DerivableAbstractedAccount.mjs +1 -1
  22. package/dist/esm/account/Ed25519Account.d.mts +2 -2
  23. package/dist/esm/account/Ed25519Account.mjs +1 -1
  24. package/dist/esm/account/EphemeralKeyPair.d.mts +26 -2
  25. package/dist/esm/account/EphemeralKeyPair.mjs +1 -1
  26. package/dist/esm/account/FederatedKeylessAccount.d.mts +3 -3
  27. package/dist/esm/account/FederatedKeylessAccount.mjs +1 -1
  28. package/dist/esm/account/KeylessAccount.d.mts +3 -3
  29. package/dist/esm/account/KeylessAccount.mjs +1 -1
  30. package/dist/esm/account/MultiEd25519Account.d.mts +2 -2
  31. package/dist/esm/account/MultiEd25519Account.mjs +1 -1
  32. package/dist/esm/account/MultiKeyAccount.d.mts +3 -3
  33. package/dist/esm/account/MultiKeyAccount.mjs +1 -1
  34. package/dist/esm/account/SingleKeyAccount.d.mts +2 -2
  35. package/dist/esm/account/SingleKeyAccount.mjs +1 -1
  36. package/dist/esm/account/index.d.mts +3 -3
  37. package/dist/esm/account/index.mjs +1 -1
  38. package/dist/esm/account/utils.d.mts +1 -1
  39. package/dist/esm/account/utils.mjs +1 -1
  40. package/dist/esm/{account-CcxnCdYZ.d.mts → account-Dg0ejXHy.d.mts} +172 -8
  41. package/dist/esm/api/account/abstraction.d.mts +1 -1
  42. package/dist/esm/api/account/abstraction.mjs +1 -1
  43. package/dist/esm/api/account.d.mts +2 -2
  44. package/dist/esm/api/account.mjs +1 -1
  45. package/dist/esm/api/ans.d.mts +1 -1
  46. package/dist/esm/api/ans.mjs +1 -1
  47. package/dist/esm/api/aptos.d.mts +3 -3
  48. package/dist/esm/api/aptos.mjs +1 -1
  49. package/dist/esm/api/aptosConfig.d.mts +1 -1
  50. package/dist/esm/api/aptosConfig.mjs +1 -1
  51. package/dist/esm/api/coin.d.mts +1 -1
  52. package/dist/esm/api/coin.mjs +1 -1
  53. package/dist/esm/api/digitalAsset.d.mts +2 -2
  54. package/dist/esm/api/digitalAsset.mjs +1 -1
  55. package/dist/esm/api/faucet.d.mts +1 -1
  56. package/dist/esm/api/faucet.mjs +1 -1
  57. package/dist/esm/api/fungibleAsset.d.mts +2 -2
  58. package/dist/esm/api/fungibleAsset.mjs +1 -1
  59. package/dist/esm/api/general.d.mts +1 -1
  60. package/dist/esm/api/general.mjs +1 -1
  61. package/dist/esm/api/index.d.mts +3 -3
  62. package/dist/esm/api/index.mjs +1 -1
  63. package/dist/esm/api/keyless.d.mts +3 -3
  64. package/dist/esm/api/keyless.mjs +1 -1
  65. package/dist/esm/api/object.d.mts +1 -1
  66. package/dist/esm/api/object.mjs +1 -1
  67. package/dist/esm/api/staking.d.mts +1 -1
  68. package/dist/esm/api/staking.mjs +1 -1
  69. package/dist/esm/api/table.d.mts +1 -1
  70. package/dist/esm/api/table.mjs +1 -1
  71. package/dist/esm/api/transaction.d.mts +2 -2
  72. package/dist/esm/api/transaction.mjs +1 -1
  73. package/dist/esm/api/transactionSubmission/build.d.mts +1 -1
  74. package/dist/esm/api/transactionSubmission/build.mjs +1 -1
  75. package/dist/esm/api/transactionSubmission/helpers.d.mts +1 -1
  76. package/dist/esm/api/transactionSubmission/helpers.mjs +1 -1
  77. package/dist/esm/api/transactionSubmission/management.d.mts +2 -2
  78. package/dist/esm/api/transactionSubmission/management.mjs +1 -1
  79. package/dist/esm/api/transactionSubmission/sign.d.mts +2 -2
  80. package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
  81. package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -1
  82. package/dist/esm/api/transactionSubmission/simulate.d.mts +1 -1
  83. package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
  84. package/dist/esm/api/transactionSubmission/submit.d.mts +1 -1
  85. package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
  86. package/dist/esm/api/utils.d.mts +1 -1
  87. package/dist/esm/api/utils.mjs +1 -1
  88. package/dist/esm/bcs/consts.d.mts +1 -1
  89. package/dist/esm/bcs/deserializer.d.mts +1 -1
  90. package/dist/esm/bcs/deserializer.mjs +1 -1
  91. package/dist/esm/bcs/index.d.mts +1 -1
  92. package/dist/esm/bcs/index.mjs +1 -1
  93. package/dist/esm/bcs/serializable/entryFunctionBytes.d.mts +1 -1
  94. package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -1
  95. package/dist/esm/bcs/serializable/fixedBytes.d.mts +1 -1
  96. package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -1
  97. package/dist/esm/bcs/serializable/movePrimitives.d.mts +1 -1
  98. package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
  99. package/dist/esm/bcs/serializable/moveStructs.d.mts +1 -1
  100. package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
  101. package/dist/esm/bcs/serializer.d.mts +1 -1
  102. package/dist/esm/bcs/serializer.mjs +1 -1
  103. package/dist/esm/{chunk-5FNZUL2Y.mjs → chunk-2VBY2V4Z.mjs} +2 -2
  104. package/dist/esm/chunk-2VHA77EO.mjs +2 -0
  105. package/dist/esm/chunk-2VHA77EO.mjs.map +1 -0
  106. package/dist/esm/{chunk-35DKMW7Q.mjs → chunk-44MMFX5F.mjs} +1 -1
  107. package/dist/esm/chunk-44MMFX5F.mjs.map +1 -0
  108. package/dist/esm/chunk-5HHC2YG4.mjs +2 -0
  109. package/dist/esm/chunk-5LMLIRGK.mjs +2 -0
  110. package/dist/esm/chunk-5LMLIRGK.mjs.map +1 -0
  111. package/dist/esm/chunk-66F7RP7K.mjs +2 -0
  112. package/dist/esm/chunk-66F7RP7K.mjs.map +1 -0
  113. package/dist/esm/chunk-6CD6PDFJ.mjs +4 -0
  114. package/dist/esm/chunk-6CD6PDFJ.mjs.map +1 -0
  115. package/dist/esm/{chunk-FW6UHAQV.mjs → chunk-A7SQEK23.mjs} +2 -2
  116. package/dist/esm/chunk-A7SQEK23.mjs.map +1 -0
  117. package/dist/esm/{chunk-G3HAIETV.mjs → chunk-ASFFADWS.mjs} +2 -2
  118. package/dist/esm/chunk-ASFFADWS.mjs.map +1 -0
  119. package/dist/esm/chunk-AUGTNOKZ.mjs +2 -0
  120. package/dist/esm/{chunk-RQN6LA7E.mjs.map → chunk-AUGTNOKZ.mjs.map} +1 -1
  121. package/dist/esm/chunk-BT742BFQ.mjs +2 -0
  122. package/dist/esm/chunk-BT742BFQ.mjs.map +1 -0
  123. package/dist/esm/chunk-C2KVLMPH.mjs +2 -0
  124. package/dist/esm/chunk-C2KVLMPH.mjs.map +1 -0
  125. package/dist/esm/{chunk-DIFSO4N6.mjs → chunk-CD3EZCI5.mjs} +2 -2
  126. package/dist/esm/{chunk-43LWUUXS.mjs → chunk-E3DHFXN4.mjs} +2 -2
  127. package/dist/esm/{chunk-QDJDZ3ON.mjs → chunk-EIWPAECI.mjs} +2 -2
  128. package/dist/esm/{chunk-GOXRBEIJ.mjs → chunk-F45HI7LU.mjs} +1 -1
  129. package/dist/esm/chunk-F45HI7LU.mjs.map +1 -0
  130. package/dist/esm/chunk-F4LHBGG2.mjs +2 -0
  131. package/dist/esm/chunk-F4LHBGG2.mjs.map +1 -0
  132. package/dist/esm/{chunk-MEG27LEV.mjs → chunk-FDHHQUS3.mjs} +3 -3
  133. package/dist/esm/chunk-FDHHQUS3.mjs.map +1 -0
  134. package/dist/esm/{chunk-LS2HRAVW.mjs → chunk-G5OONGWS.mjs} +1 -12
  135. package/dist/esm/chunk-G5OONGWS.mjs.map +1 -0
  136. package/dist/esm/{chunk-F3NI6N7R.mjs → chunk-H2T2SU5O.mjs} +2 -2
  137. package/dist/esm/chunk-H2T2SU5O.mjs.map +1 -0
  138. package/dist/esm/chunk-ITZN23GU.mjs +2 -0
  139. package/dist/esm/{chunk-X674XJNJ.mjs → chunk-KOVWYU53.mjs} +2 -2
  140. package/dist/esm/{chunk-PXJEKGEG.mjs → chunk-LDK76MDN.mjs} +2 -2
  141. package/dist/esm/chunk-M65PXVDO.mjs +2 -0
  142. package/dist/esm/chunk-M65PXVDO.mjs.map +1 -0
  143. package/dist/esm/{chunk-WZ6FL7CH.mjs → chunk-NWP2VEMB.mjs} +2 -2
  144. package/dist/esm/chunk-ODNZJSOC.mjs +2 -0
  145. package/dist/esm/chunk-ODNZJSOC.mjs.map +1 -0
  146. package/dist/esm/{chunk-6IWGTO2J.mjs → chunk-POQ4FT4E.mjs} +2 -2
  147. package/dist/esm/{chunk-76SVQZDX.mjs → chunk-Q4KYBAYN.mjs} +2 -2
  148. package/dist/esm/chunk-Q5ESW36C.mjs +2 -0
  149. package/dist/esm/chunk-Q5ESW36C.mjs.map +1 -0
  150. package/dist/esm/{chunk-52PWWLJJ.mjs → chunk-QRW7MQDA.mjs} +2 -2
  151. package/dist/esm/chunk-QRW7MQDA.mjs.map +1 -0
  152. package/dist/esm/{chunk-3P474TWM.mjs → chunk-R7PCBRRT.mjs} +2 -2
  153. package/dist/esm/chunk-T32P4APJ.mjs +2 -0
  154. package/dist/esm/chunk-T32P4APJ.mjs.map +1 -0
  155. package/dist/esm/chunk-TAHLOBRG.mjs +2 -0
  156. package/dist/esm/chunk-TAHLOBRG.mjs.map +1 -0
  157. package/dist/esm/{chunk-RYOICF37.mjs → chunk-TSPG5VED.mjs} +2 -2
  158. package/dist/esm/{chunk-56IXVVXX.mjs → chunk-UPHD2B4I.mjs} +2 -2
  159. package/dist/esm/{chunk-QREVMGQZ.mjs → chunk-UVJW4DPP.mjs} +1 -1
  160. package/dist/esm/{chunk-QREVMGQZ.mjs.map → chunk-UVJW4DPP.mjs.map} +1 -1
  161. package/dist/esm/chunk-UYG4XVVO.mjs +2 -0
  162. package/dist/esm/chunk-UYG4XVVO.mjs.map +1 -0
  163. package/dist/esm/chunk-WFZFTRRS.mjs +2 -0
  164. package/dist/esm/chunk-WFZFTRRS.mjs.map +1 -0
  165. package/dist/esm/{chunk-CUXCVNES.mjs → chunk-X4IR6WX6.mjs} +2 -2
  166. package/dist/esm/chunk-YJVBGKWM.mjs +2 -0
  167. package/dist/esm/chunk-YJVBGKWM.mjs.map +1 -0
  168. package/dist/esm/{chunk-NTLOKAPD.mjs → chunk-YTFJ5W7U.mjs} +2 -2
  169. package/dist/esm/cli/index.d.mts +2 -2
  170. package/dist/esm/cli/index.mjs +1 -1
  171. package/dist/esm/cli/localNode.d.mts +1 -1
  172. package/dist/esm/cli/localNode.mjs +1 -1
  173. package/dist/esm/cli/move.d.mts +1 -1
  174. package/dist/esm/cli/move.mjs +1 -1
  175. package/dist/esm/client/core.d.mts +1 -1
  176. package/dist/esm/client/core.mjs +1 -1
  177. package/dist/esm/client/get.d.mts +1 -1
  178. package/dist/esm/client/get.mjs +1 -1
  179. package/dist/esm/client/index.d.mts +1 -1
  180. package/dist/esm/client/index.mjs +1 -1
  181. package/dist/esm/client/post.d.mts +1 -1
  182. package/dist/esm/client/post.mjs +1 -1
  183. package/dist/esm/core/account/index.d.mts +1 -1
  184. package/dist/esm/core/account/index.mjs +1 -1
  185. package/dist/esm/core/account/utils/address.d.mts +1 -1
  186. package/dist/esm/core/account/utils/address.mjs +1 -1
  187. package/dist/esm/core/account/utils/index.d.mts +1 -1
  188. package/dist/esm/core/account/utils/index.mjs +1 -1
  189. package/dist/esm/core/accountAddress.d.mts +1 -1
  190. package/dist/esm/core/accountAddress.mjs +1 -1
  191. package/dist/esm/core/authenticationKey.d.mts +1 -1
  192. package/dist/esm/core/authenticationKey.mjs +1 -1
  193. package/dist/esm/core/crypto/abstraction.d.mts +1 -1
  194. package/dist/esm/core/crypto/abstraction.mjs +1 -1
  195. package/dist/esm/core/crypto/deserializationUtils.d.mts +1 -1
  196. package/dist/esm/core/crypto/deserializationUtils.mjs +1 -1
  197. package/dist/esm/core/crypto/ed25519.d.mts +1 -1
  198. package/dist/esm/core/crypto/ed25519.mjs +1 -1
  199. package/dist/esm/core/crypto/ephemeral.d.mts +1 -1
  200. package/dist/esm/core/crypto/ephemeral.mjs +1 -1
  201. package/dist/esm/core/crypto/federatedKeyless.d.mts +2 -2
  202. package/dist/esm/core/crypto/federatedKeyless.mjs +1 -1
  203. package/dist/esm/core/crypto/index.d.mts +2 -2
  204. package/dist/esm/core/crypto/index.mjs +1 -1
  205. package/dist/esm/core/crypto/keyless.d.mts +2 -2
  206. package/dist/esm/core/crypto/keyless.mjs +1 -1
  207. package/dist/esm/core/crypto/multiEd25519.d.mts +1 -1
  208. package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
  209. package/dist/esm/core/crypto/multiKey.d.mts +1 -1
  210. package/dist/esm/core/crypto/multiKey.mjs +1 -1
  211. package/dist/esm/core/crypto/poseidon.mjs +1 -1
  212. package/dist/esm/core/crypto/privateKey.d.mts +1 -1
  213. package/dist/esm/core/crypto/privateKey.mjs +1 -1
  214. package/dist/esm/core/crypto/proof.d.mts +1 -1
  215. package/dist/esm/core/crypto/proof.mjs +1 -1
  216. package/dist/esm/core/crypto/publicKey.d.mts +1 -1
  217. package/dist/esm/core/crypto/publicKey.mjs +1 -1
  218. package/dist/esm/core/crypto/secp256k1.d.mts +1 -1
  219. package/dist/esm/core/crypto/secp256k1.mjs +1 -1
  220. package/dist/esm/core/crypto/secp256r1.d.mts +1 -1
  221. package/dist/esm/core/crypto/secp256r1.mjs +1 -1
  222. package/dist/esm/core/crypto/signature.d.mts +1 -1
  223. package/dist/esm/core/crypto/signature.mjs +1 -1
  224. package/dist/esm/core/crypto/singleKey.d.mts +1 -1
  225. package/dist/esm/core/crypto/singleKey.mjs +1 -1
  226. package/dist/esm/core/crypto/types.d.mts +1 -1
  227. package/dist/esm/core/crypto/utils.d.mts +1 -1
  228. package/dist/esm/core/crypto/utils.mjs +1 -1
  229. package/dist/esm/core/hex.d.mts +1 -1
  230. package/dist/esm/core/index.d.mts +2 -2
  231. package/dist/esm/core/index.mjs +1 -1
  232. package/dist/esm/errors/index.d.mts +1 -1
  233. package/dist/esm/errors/index.mjs +1 -1
  234. package/dist/esm/{federatedKeyless-BzaYmP03.d.mts → federatedKeyless-BYLu31Sa.d.mts} +13 -2
  235. package/dist/esm/index.d.mts +5 -5
  236. package/dist/esm/index.mjs +1 -1
  237. package/dist/esm/internal/abstraction.d.mts +1 -1
  238. package/dist/esm/internal/abstraction.mjs +1 -1
  239. package/dist/esm/internal/account.d.mts +3 -3
  240. package/dist/esm/internal/account.mjs +1 -1
  241. package/dist/esm/internal/ans.d.mts +2 -2
  242. package/dist/esm/internal/ans.mjs +1 -1
  243. package/dist/esm/internal/coin.d.mts +1 -1
  244. package/dist/esm/internal/coin.mjs +1 -1
  245. package/dist/esm/internal/digitalAsset.d.mts +3 -3
  246. package/dist/esm/internal/digitalAsset.mjs +1 -1
  247. package/dist/esm/internal/faucet.d.mts +1 -1
  248. package/dist/esm/internal/faucet.mjs +1 -1
  249. package/dist/esm/internal/fungibleAsset.d.mts +4 -4
  250. package/dist/esm/internal/fungibleAsset.mjs +1 -1
  251. package/dist/esm/internal/general.d.mts +4 -2
  252. package/dist/esm/internal/general.mjs +1 -1
  253. package/dist/esm/internal/keyless.d.mts +3 -3
  254. package/dist/esm/internal/keyless.mjs +1 -1
  255. package/dist/esm/internal/object.d.mts +1 -1
  256. package/dist/esm/internal/object.mjs +1 -1
  257. package/dist/esm/internal/staking.d.mts +2 -2
  258. package/dist/esm/internal/staking.mjs +1 -1
  259. package/dist/esm/internal/table.d.mts +1 -1
  260. package/dist/esm/internal/table.mjs +1 -1
  261. package/dist/esm/internal/transaction.d.mts +1 -1
  262. package/dist/esm/internal/transaction.mjs +1 -1
  263. package/dist/esm/internal/transactionSubmission.d.mts +2 -2
  264. package/dist/esm/internal/transactionSubmission.mjs +1 -1
  265. package/dist/esm/internal/utils/index.d.mts +1 -1
  266. package/dist/esm/internal/utils/index.mjs +1 -1
  267. package/dist/esm/internal/utils/utils.d.mts +1 -1
  268. package/dist/esm/internal/utils/utils.mjs +1 -1
  269. package/dist/esm/internal/view.d.mts +1 -1
  270. package/dist/esm/internal/view.mjs +1 -1
  271. package/dist/esm/transactions/authenticator/account.d.mts +1 -1
  272. package/dist/esm/transactions/authenticator/account.mjs +1 -1
  273. package/dist/esm/transactions/authenticator/index.d.mts +1 -1
  274. package/dist/esm/transactions/authenticator/index.mjs +1 -1
  275. package/dist/esm/transactions/authenticator/transaction.d.mts +1 -1
  276. package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
  277. package/dist/esm/transactions/index.d.mts +1 -1
  278. package/dist/esm/transactions/index.mjs +1 -1
  279. package/dist/esm/transactions/instances/chainId.d.mts +1 -1
  280. package/dist/esm/transactions/instances/chainId.mjs +1 -1
  281. package/dist/esm/transactions/instances/identifier.d.mts +1 -1
  282. package/dist/esm/transactions/instances/identifier.mjs +1 -1
  283. package/dist/esm/transactions/instances/index.d.mts +1 -1
  284. package/dist/esm/transactions/instances/index.mjs +1 -1
  285. package/dist/esm/transactions/instances/moduleId.d.mts +1 -1
  286. package/dist/esm/transactions/instances/moduleId.mjs +1 -1
  287. package/dist/esm/transactions/instances/multiAgentTransaction.d.mts +1 -1
  288. package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
  289. package/dist/esm/transactions/instances/rawTransaction.d.mts +1 -1
  290. package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
  291. package/dist/esm/transactions/instances/rotationProofChallenge.d.mts +1 -1
  292. package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
  293. package/dist/esm/transactions/instances/signedTransaction.d.mts +1 -1
  294. package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
  295. package/dist/esm/transactions/instances/simpleTransaction.d.mts +1 -1
  296. package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
  297. package/dist/esm/transactions/instances/transactionArgument.d.mts +1 -1
  298. package/dist/esm/transactions/instances/transactionPayload.d.mts +1 -1
  299. package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
  300. package/dist/esm/transactions/management/accountSequenceNumber.d.mts +2 -2
  301. package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
  302. package/dist/esm/transactions/management/index.d.mts +2 -2
  303. package/dist/esm/transactions/management/index.mjs +1 -1
  304. package/dist/esm/transactions/management/transactionWorker.d.mts +12 -4
  305. package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
  306. package/dist/esm/transactions/transactionBuilder/helpers.d.mts +1 -1
  307. package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
  308. package/dist/esm/transactions/transactionBuilder/index.d.mts +1 -1
  309. package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
  310. package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +2 -1
  311. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
  312. package/dist/esm/transactions/transactionBuilder/signingMessage.d.mts +1 -1
  313. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
  314. package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +1 -1
  315. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
  316. package/dist/esm/transactions/typeTag/index.d.mts +1 -1
  317. package/dist/esm/transactions/typeTag/index.mjs +1 -1
  318. package/dist/esm/transactions/typeTag/parser.d.mts +1 -1
  319. package/dist/esm/transactions/typeTag/parser.mjs +1 -1
  320. package/dist/esm/transactions/types.d.mts +1 -1
  321. package/dist/esm/types/generated/operations.d.mts +0 -11
  322. package/dist/esm/types/generated/queries.d.mts +1 -1
  323. package/dist/esm/types/generated/queries.mjs +1 -1
  324. package/dist/esm/types/index.d.mts +1 -1
  325. package/dist/esm/types/index.mjs +1 -1
  326. package/dist/esm/types/indexer.d.mts +1 -1
  327. package/dist/esm/types/types.d.mts +1 -1
  328. package/dist/esm/types/types.mjs +1 -1
  329. package/dist/esm/utils/const.d.mts +16 -2
  330. package/dist/esm/utils/const.mjs +1 -1
  331. package/dist/esm/utils/helpers.d.mts +21 -2
  332. package/dist/esm/utils/helpers.mjs +1 -1
  333. package/dist/esm/utils/index.d.mts +3 -3
  334. package/dist/esm/utils/index.mjs +1 -1
  335. package/dist/esm/utils/memoize.d.mts +23 -1
  336. package/dist/esm/utils/memoize.mjs +1 -1
  337. package/dist/esm/utils/normalizeBundle.d.mts +1 -1
  338. package/dist/esm/utils/normalizeBundle.mjs +1 -1
  339. package/dist/esm/version.d.mts +1 -1
  340. package/dist/esm/version.mjs +1 -1
  341. package/package.json +36 -50
  342. package/src/account/AbstractKeylessAccount.ts +2 -3
  343. package/src/account/DerivableAbstractedAccount.ts +1 -3
  344. package/src/account/EphemeralKeyPair.ts +53 -2
  345. package/src/account/MultiEd25519Account.ts +0 -2
  346. package/src/account/MultiKeyAccount.ts +0 -2
  347. package/src/account/SingleKeyAccount.ts +0 -1
  348. package/src/api/account.ts +1 -2
  349. package/src/api/ans.ts +0 -1
  350. package/src/api/aptos.ts +1 -1
  351. package/src/api/aptosConfig.ts +12 -1
  352. package/src/api/transaction.ts +4 -4
  353. package/src/api/transactionSubmission/build.ts +1 -5
  354. package/src/api/transactionSubmission/helpers.ts +0 -1
  355. package/src/api/transactionSubmission/sign.ts +2 -2
  356. package/src/bcs/deserializer.ts +64 -17
  357. package/src/bcs/serializable/movePrimitives.ts +15 -28
  358. package/src/bcs/serializable/moveStructs.ts +4 -6
  359. package/src/bcs/serializer.ts +147 -12
  360. package/src/cli/localNode.ts +4 -7
  361. package/src/cli/move.ts +7 -7
  362. package/src/client/get.ts +8 -10
  363. package/src/core/account/utils/address.ts +3 -3
  364. package/src/core/accountAddress.ts +2 -3
  365. package/src/core/crypto/abstraction.ts +0 -3
  366. package/src/core/crypto/ed25519.ts +66 -1
  367. package/src/core/crypto/federatedKeyless.ts +1 -1
  368. package/src/core/crypto/keyless.ts +65 -14
  369. package/src/core/crypto/multiEd25519.ts +1 -3
  370. package/src/core/crypto/multiKey.ts +4 -7
  371. package/src/core/crypto/poseidon.ts +0 -1
  372. package/src/core/crypto/privateKey.ts +2 -5
  373. package/src/core/crypto/secp256k1.ts +68 -3
  374. package/src/core/crypto/secp256r1.ts +1 -1
  375. package/src/core/crypto/singleKey.ts +4 -1
  376. package/src/core/crypto/utils.ts +6 -3
  377. package/src/errors/index.ts +4 -5
  378. package/src/internal/account.ts +21 -30
  379. package/src/internal/ans.ts +5 -6
  380. package/src/internal/general.ts +24 -6
  381. package/src/internal/keyless.ts +1 -1
  382. package/src/internal/queries/getAccountAddressesForAuthKey.graphql +4 -1
  383. package/src/internal/queries/getAuthKeysForPublicKey.graphql +4 -1
  384. package/src/internal/queries/getCollectionData.graphql +0 -11
  385. package/src/internal/queries/getTableItemsData.graphql +1 -1
  386. package/src/internal/queries/getTableItemsMetadata.graphql +2 -2
  387. package/src/internal/transaction.ts +5 -7
  388. package/src/internal/transactionSubmission.ts +23 -0
  389. package/src/transactions/authenticator/account.ts +0 -4
  390. package/src/transactions/authenticator/transaction.ts +0 -2
  391. package/src/transactions/instances/multiAgentTransaction.ts +0 -2
  392. package/src/transactions/instances/rawTransaction.ts +0 -2
  393. package/src/transactions/instances/signedTransaction.ts +0 -2
  394. package/src/transactions/instances/simpleTransaction.ts +0 -2
  395. package/src/transactions/instances/transactionPayload.ts +5 -7
  396. package/src/transactions/management/accountSequenceNumber.ts +0 -4
  397. package/src/transactions/management/transactionWorker.ts +40 -10
  398. package/src/transactions/transactionBuilder/remoteAbi.ts +22 -8
  399. package/src/transactions/transactionBuilder/transactionBuilder.ts +14 -12
  400. package/src/transactions/typeTag/index.ts +0 -3
  401. package/src/transactions/typeTag/parser.ts +3 -5
  402. package/src/types/generated/operations.ts +0 -11
  403. package/src/types/generated/queries.ts +0 -11
  404. package/src/types/types.ts +26 -0
  405. package/src/utils/const.ts +17 -1
  406. package/src/utils/helpers.ts +47 -8
  407. package/src/utils/memoize.ts +177 -11
  408. package/src/version.ts +1 -1
  409. package/dist/common/chunk-4RHBBU7C.js +0 -4
  410. package/dist/common/chunk-4RHBBU7C.js.map +0 -1
  411. package/dist/esm/chunk-2DPQMXUG.mjs +0 -4
  412. package/dist/esm/chunk-2DPQMXUG.mjs.map +0 -1
  413. package/dist/esm/chunk-2LCPW76G.mjs +0 -2
  414. package/dist/esm/chunk-2LCPW76G.mjs.map +0 -1
  415. package/dist/esm/chunk-2PASUPUO.mjs +0 -2
  416. package/dist/esm/chunk-2PASUPUO.mjs.map +0 -1
  417. package/dist/esm/chunk-35DKMW7Q.mjs.map +0 -1
  418. package/dist/esm/chunk-52PWWLJJ.mjs.map +0 -1
  419. package/dist/esm/chunk-54C2P534.mjs +0 -2
  420. package/dist/esm/chunk-54C2P534.mjs.map +0 -1
  421. package/dist/esm/chunk-BGZDJ5SM.mjs +0 -2
  422. package/dist/esm/chunk-BGZDJ5SM.mjs.map +0 -1
  423. package/dist/esm/chunk-C5UZZHA4.mjs +0 -2
  424. package/dist/esm/chunk-C5UZZHA4.mjs.map +0 -1
  425. package/dist/esm/chunk-F3NI6N7R.mjs.map +0 -1
  426. package/dist/esm/chunk-FW6UHAQV.mjs.map +0 -1
  427. package/dist/esm/chunk-G3HAIETV.mjs.map +0 -1
  428. package/dist/esm/chunk-GOXRBEIJ.mjs.map +0 -1
  429. package/dist/esm/chunk-I42Z32Q2.mjs +0 -2
  430. package/dist/esm/chunk-I42Z32Q2.mjs.map +0 -1
  431. package/dist/esm/chunk-JN65XG2P.mjs +0 -2
  432. package/dist/esm/chunk-JN65XG2P.mjs.map +0 -1
  433. package/dist/esm/chunk-KUF4DKN5.mjs +0 -2
  434. package/dist/esm/chunk-LD3I4CYO.mjs +0 -2
  435. package/dist/esm/chunk-LS2HRAVW.mjs.map +0 -1
  436. package/dist/esm/chunk-MEG27LEV.mjs.map +0 -1
  437. package/dist/esm/chunk-NCKJ7X57.mjs +0 -2
  438. package/dist/esm/chunk-NCKJ7X57.mjs.map +0 -1
  439. package/dist/esm/chunk-NK3Y3PV3.mjs +0 -2
  440. package/dist/esm/chunk-NK3Y3PV3.mjs.map +0 -1
  441. package/dist/esm/chunk-OLILO7VD.mjs +0 -2
  442. package/dist/esm/chunk-OLILO7VD.mjs.map +0 -1
  443. package/dist/esm/chunk-PYVKCTUN.mjs +0 -2
  444. package/dist/esm/chunk-PYVKCTUN.mjs.map +0 -1
  445. package/dist/esm/chunk-QEHKRR3I.mjs +0 -2
  446. package/dist/esm/chunk-QEHKRR3I.mjs.map +0 -1
  447. package/dist/esm/chunk-RQN6LA7E.mjs +0 -2
  448. package/dist/esm/chunk-Y426VCPM.mjs +0 -2
  449. package/dist/esm/chunk-Y426VCPM.mjs.map +0 -1
  450. package/dist/esm/chunk-YOZBVVKL.mjs +0 -2
  451. package/dist/esm/chunk-YOZBVVKL.mjs.map +0 -1
  452. /package/dist/esm/{chunk-5FNZUL2Y.mjs.map → chunk-2VBY2V4Z.mjs.map} +0 -0
  453. /package/dist/esm/{chunk-KUF4DKN5.mjs.map → chunk-5HHC2YG4.mjs.map} +0 -0
  454. /package/dist/esm/{chunk-DIFSO4N6.mjs.map → chunk-CD3EZCI5.mjs.map} +0 -0
  455. /package/dist/esm/{chunk-43LWUUXS.mjs.map → chunk-E3DHFXN4.mjs.map} +0 -0
  456. /package/dist/esm/{chunk-QDJDZ3ON.mjs.map → chunk-EIWPAECI.mjs.map} +0 -0
  457. /package/dist/esm/{chunk-LD3I4CYO.mjs.map → chunk-ITZN23GU.mjs.map} +0 -0
  458. /package/dist/esm/{chunk-X674XJNJ.mjs.map → chunk-KOVWYU53.mjs.map} +0 -0
  459. /package/dist/esm/{chunk-PXJEKGEG.mjs.map → chunk-LDK76MDN.mjs.map} +0 -0
  460. /package/dist/esm/{chunk-WZ6FL7CH.mjs.map → chunk-NWP2VEMB.mjs.map} +0 -0
  461. /package/dist/esm/{chunk-6IWGTO2J.mjs.map → chunk-POQ4FT4E.mjs.map} +0 -0
  462. /package/dist/esm/{chunk-76SVQZDX.mjs.map → chunk-Q4KYBAYN.mjs.map} +0 -0
  463. /package/dist/esm/{chunk-3P474TWM.mjs.map → chunk-R7PCBRRT.mjs.map} +0 -0
  464. /package/dist/esm/{chunk-RYOICF37.mjs.map → chunk-TSPG5VED.mjs.map} +0 -0
  465. /package/dist/esm/{chunk-56IXVVXX.mjs.map → chunk-UPHD2B4I.mjs.map} +0 -0
  466. /package/dist/esm/{chunk-CUXCVNES.mjs.map → chunk-X4IR6WX6.mjs.map} +0 -0
  467. /package/dist/esm/{chunk-NTLOKAPD.mjs.map → chunk-YTFJ5W7U.mjs.map} +0 -0
package/package.json CHANGED
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "name": "@aptos-labs/ts-sdk",
3
3
  "description": "Aptos TypeScript SDK",
4
- "packageManager": "pnpm@8.15.1",
5
4
  "license": "Apache-2.0",
6
5
  "engines": {
7
6
  "node": ">=20.0.0"
@@ -32,68 +31,55 @@
32
31
  "dist",
33
32
  "src"
34
33
  ],
35
- "scripts": {
36
- "build:clean": "rm -rf dist",
37
- "build": "pnpm build:clean && tsup",
38
- "prepublishOnly": "pnpm run build",
39
- "_fmt": "prettier 'src/**/*.ts' 'tests/**/*.ts' 'examples/**/*.js' 'examples/**/*.ts' 'confidential-assets/**/*.ts' 'eslint.config.cjs'",
40
- "fmt": "pnpm _fmt --write",
41
- "lint": "eslint '**/*.{cts,mts,ts}'",
42
- "test": "pnpm jest",
43
- "unit-test": "pnpm jest tests/unit",
44
- "e2e-test": "pnpm jest tests/e2e",
45
- "indexer-codegen": "graphql-codegen --config ./src/types/codegen.yaml && pnpm fmt",
46
- "doc": "scripts/generateDocs.sh",
47
- "check-version": "scripts/checkVersion.sh",
48
- "update-version": "scripts/updateVersion.sh && pnpm doc",
49
- "spec": "pnpm build && pnpm _spec",
50
- "_spec": "cucumber-js -p default"
51
- },
52
34
  "dependencies": {
53
- "@aptos-labs/aptos-cli": "^1.0.2",
35
+ "@aptos-labs/aptos-cli": "^1.1.1",
54
36
  "@aptos-labs/aptos-client": "^2.1.0",
55
37
  "@noble/curves": "^1.9.0",
56
38
  "@noble/hashes": "^1.5.0",
57
39
  "@scure/bip32": "^1.4.0",
58
40
  "@scure/bip39": "^1.3.0",
59
- "eventemitter3": "^5.0.1",
41
+ "eventemitter3": "^5.0.4",
60
42
  "js-base64": "^3.7.7",
61
43
  "jwt-decode": "^4.0.0",
62
44
  "poseidon-lite": "^0.2.0"
63
45
  },
64
46
  "devDependencies": {
65
- "@babel/traverse": "^7.28.4",
66
- "@cucumber/cucumber": "^12.2.0",
67
- "@eslint/eslintrc": "^3.3.1",
68
- "@graphql-codegen/cli": "^6.0.0",
47
+ "@babel/traverse": "^7.28.6",
48
+ "@biomejs/biome": "^2.4.6",
49
+ "@cucumber/cucumber": "^12.6.0",
50
+ "@graphql-codegen/cli": "^6.1.2",
69
51
  "@graphql-codegen/import-types-preset": "^3.0.1",
70
- "@graphql-codegen/typescript": "^5.0.0",
71
- "@graphql-codegen/typescript-graphql-request": "^6.3.0",
72
- "@graphql-codegen/typescript-operations": "^5.0.0",
73
- "@types/base-64": "^1.0.2",
74
- "@types/jest": "^29.5.14",
75
- "@types/jsonwebtoken": "^9.0.10",
52
+ "@graphql-codegen/typescript": "^5.0.8",
53
+ "@graphql-codegen/typescript-graphql-request": "^6.4.0",
54
+ "@graphql-codegen/typescript-operations": "^5.0.8",
76
55
  "@types/node": "^24.3.1",
77
- "@typescript-eslint/eslint-plugin": "^8.43.0",
78
- "@typescript-eslint/parser": "^8.43.0",
79
- "dotenv": "^16.4.7",
80
- "eslint": "^9.35.0",
81
- "eslint-config-airbnb-base": "^15.0.0",
82
- "eslint-config-prettier": "^10.1.8",
83
- "eslint-plugin-import": "^2.32.0",
84
- "graphql": "^16.11.0",
85
- "globals": "^16.4.0",
86
- "graphql-request": "^7.2.0",
87
- "jest": "^29.7.0",
88
- "jsonwebtoken": "^9.0.2",
89
- "prettier": "^3.6.2",
56
+ "@vitest/coverage-v8": "^4.0.18",
57
+ "dotenv": "^16.6.1",
58
+ "graphql": "^16.12.0",
59
+ "graphql-request": "^7.4.0",
90
60
  "tree-kill": "^1.2.2",
91
- "ts-jest": "^29.4.1",
92
- "ts-loader": "^9.5.4",
93
- "tsup": "^8.5.0",
94
- "typedoc": "^0.28.12",
95
- "typedoc-plugin-missing-exports": "^4.1.0",
96
- "typescript": "^5.8.3"
61
+ "tsup": "^8.5.1",
62
+ "typedoc": "^0.28.16",
63
+ "typedoc-plugin-missing-exports": "^4.1.2",
64
+ "typescript": "^5.9.3",
65
+ "vitest": "^4.0.18"
97
66
  },
98
- "version": "6.0.0"
67
+ "version": "6.2.0",
68
+ "scripts": {
69
+ "build:clean": "rm -rf dist",
70
+ "build": "pnpm build:clean && tsup",
71
+ "_fmt": "biome format 'src/' 'tests/'",
72
+ "fmt": "biome format --write 'src/' 'tests/'",
73
+ "lint": "biome lint 'src/' 'tests/'",
74
+ "check": "biome check 'src/' 'tests/'",
75
+ "test": "vitest run",
76
+ "unit-test": "vitest run tests/unit",
77
+ "e2e-test": "vitest run tests/e2e",
78
+ "indexer-codegen": "graphql-codegen --config ./src/types/codegen.yaml && pnpm fmt",
79
+ "doc": "scripts/generateDocs.sh",
80
+ "check-version": "scripts/checkVersion.sh",
81
+ "update-version": "scripts/updateVersion.sh && pnpm doc",
82
+ "spec": "pnpm build && pnpm _spec",
83
+ "_spec": "cucumber-js -p default"
84
+ }
99
85
  }
@@ -25,7 +25,7 @@ import { AccountAuthenticatorSingleKey } from "../transactions/authenticator/acc
25
25
  import { Deserializer, Serializable, Serializer } from "../bcs";
26
26
  import { deriveTransactionType, generateSigningMessage } from "../transactions/transactionBuilder/signingMessage";
27
27
  import { AnyRawTransaction, AnyRawTransactionInstance } from "../transactions/types";
28
- import { base64UrlDecode } from "../utils/helpers";
28
+ import { base64UrlDecode, warnIfDevelopment } from "../utils/helpers";
29
29
  import { FederatedKeylessPublicKey } from "../core/crypto/federatedKeyless";
30
30
  import { Account } from "./Account";
31
31
  import { AptosConfig } from "../api/aptosConfig";
@@ -368,8 +368,7 @@ export abstract class AbstractKeylessAccount extends Serializable implements Key
368
368
  });
369
369
  }
370
370
  } else {
371
- // eslint-disable-next-line no-console
372
- console.warn(
371
+ warnIfDevelopment(
373
372
  "[Aptos SDK] The verification key hash was not set. Proof may be invalid if the verification key has rotated.",
374
373
  );
375
374
  }
@@ -1,12 +1,10 @@
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 { AccountAbstractionMessage, AccountAuthenticatorAbstraction } from "../transactions/authenticator/account";
4
+ import { 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";
10
8
 
11
9
  type DerivableAbstractedAccountArgs = {
12
10
  /**
@@ -70,6 +70,12 @@ export class EphemeralKeyPair extends Serializable {
70
70
  */
71
71
  private publicKey: EphemeralPublicKey;
72
72
 
73
+ /**
74
+ * Whether the ephemeral key pair has been cleared from memory.
75
+ * @private
76
+ */
77
+ private cleared: boolean = false;
78
+
73
79
  /**
74
80
  * Creates an instance of the class with a specified private key, optional expiry date, and optional blinder.
75
81
  * This constructor initializes the public key, sets the expiry date to a default value if not provided,
@@ -120,6 +126,49 @@ export class EphemeralKeyPair extends Serializable {
120
126
  return currentTimeSecs > this.expiryDateSecs;
121
127
  }
122
128
 
129
+ /**
130
+ * Clears the ephemeral private key from memory by overwriting it with random bytes.
131
+ * After calling this method, the ephemeral key pair can no longer be used for signing.
132
+ *
133
+ * Note: Due to JavaScript's memory management, this cannot guarantee complete removal of
134
+ * sensitive data from memory, but it significantly reduces the window of exposure.
135
+ *
136
+ * @group Implementation
137
+ * @category Account (On-Chain Model)
138
+ */
139
+ clear(): void {
140
+ if (!this.cleared) {
141
+ // Clear the underlying private key if it has a clear method
142
+ if ("clear" in this.privateKey && typeof this.privateKey.clear === "function") {
143
+ this.privateKey.clear();
144
+ } else {
145
+ // Fallback: multiple overwrite passes for better security
146
+ const keyBytes = this.privateKey.toUint8Array();
147
+ crypto.getRandomValues(keyBytes);
148
+ keyBytes.fill(0xff);
149
+ crypto.getRandomValues(keyBytes);
150
+ keyBytes.fill(0);
151
+ }
152
+ // Also clear the blinder with multiple passes as it's used in nonce calculation
153
+ crypto.getRandomValues(this.blinder);
154
+ this.blinder.fill(0xff);
155
+ crypto.getRandomValues(this.blinder);
156
+ this.blinder.fill(0);
157
+ this.cleared = true;
158
+ }
159
+ }
160
+
161
+ /**
162
+ * Returns whether the ephemeral key pair has been cleared from memory.
163
+ *
164
+ * @returns true if the key pair has been cleared, false otherwise
165
+ * @group Implementation
166
+ * @category Account (On-Chain Model)
167
+ */
168
+ isCleared(): boolean {
169
+ return this.cleared;
170
+ }
171
+
123
172
  /**
124
173
  * Serializes the object's properties into a format suitable for transmission or storage.
125
174
  * This function is essential for preparing the object data for serialization processes.
@@ -185,7 +234,6 @@ export class EphemeralKeyPair extends Serializable {
185
234
  let privateKey: PrivateKey;
186
235
 
187
236
  switch (args?.scheme) {
188
- case EphemeralPublicKeyVariant.Ed25519:
189
237
  default:
190
238
  privateKey = Ed25519PrivateKey.generate();
191
239
  }
@@ -199,11 +247,14 @@ export class EphemeralKeyPair extends Serializable {
199
247
  *
200
248
  * @param data - The data to be signed, provided in HexInput format.
201
249
  * @returns EphemeralSignature - The resulting ephemeral signature.
202
- * @throws Error - Throws an error if the EphemeralKeyPair has expired.
250
+ * @throws Error - Throws an error if the EphemeralKeyPair has expired or been cleared from memory.
203
251
  * @group Implementation
204
252
  * @category Account (On-Chain Model)
205
253
  */
206
254
  sign(data: HexInput): EphemeralSignature {
255
+ if (this.cleared) {
256
+ throw new Error("EphemeralKeyPair has been cleared from memory and can no longer be used");
257
+ }
207
258
  if (this.isExpired()) {
208
259
  throw new Error("EphemeralKeyPair has expired");
209
260
  }
@@ -60,12 +60,10 @@ export class MultiEd25519Account implements Account {
60
60
 
61
61
  if (publicKey.threshold > signers.length) {
62
62
  throw new Error(
63
- // eslint-disable-next-line max-len
64
63
  `Not enough signers provided to satisfy the required signatures. Need ${publicKey.threshold} signers, but only ${signers.length} provided`,
65
64
  );
66
65
  } else if (publicKey.threshold < signers.length) {
67
66
  throw new Error(
68
- // eslint-disable-next-line max-len
69
67
  `More signers provided than required. Need ${publicKey.threshold} signers, but ${signers.length} provided`,
70
68
  );
71
69
  }
@@ -99,12 +99,10 @@ export class MultiKeyAccount implements Account, KeylessSigner {
99
99
 
100
100
  if (multiKey.signaturesRequired > signers.length) {
101
101
  throw new Error(
102
- // eslint-disable-next-line max-len
103
102
  `Not enough signers provided to satisfy the required signatures. Need ${multiKey.signaturesRequired} signers, but only ${signers.length} provided`,
104
103
  );
105
104
  } else if (multiKey.signaturesRequired < signers.length) {
106
105
  throw new Error(
107
- // eslint-disable-next-line max-len
108
106
  `More signers provided than required. Need ${multiKey.signaturesRequired} signers, but ${signers.length} provided`,
109
107
  );
110
108
  }
@@ -5,7 +5,6 @@ import {
5
5
  AnyPublicKey,
6
6
  AnySignature,
7
7
  Ed25519PrivateKey,
8
- KeylessSignature,
9
8
  PrivateKeyInput,
10
9
  Secp256k1PrivateKey,
11
10
  Signature,
@@ -22,7 +22,6 @@ import {
22
22
  MoveModuleBytecode,
23
23
  MoveResource,
24
24
  MoveStructId,
25
- MoveValue,
26
25
  OrderByArg,
27
26
  PaginationArgs,
28
27
  TokenStandardArg,
@@ -833,7 +832,7 @@ export class Account {
833
832
  if (pairedCoinTypeStruct.vec.length > 0 && isEncodedStruct(pairedCoinTypeStruct.vec[0])) {
834
833
  return parseEncodedStruct(pairedCoinTypeStruct.vec[0]);
835
834
  }
836
- } catch (error) {
835
+ } catch {
837
836
  /* No paired coin type found */
838
837
  }
839
838
  return undefined;
package/src/api/ans.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  // Copyright © Aptos Foundation
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import { Account } from "../account";
5
4
  import { AccountAddress, AccountAddressInput } from "../core";
6
5
  import {
7
6
  RegisterNameParameters,
package/src/api/aptos.ts CHANGED
@@ -144,7 +144,7 @@ function applyMixin(targetClass: any, baseClass: any, baseClassProp: string) {
144
144
 
145
145
  // Define new method that calls through baseClassProp
146
146
  Object.defineProperty(targetClass.prototype, propertyName, {
147
- value: function (...args: any[]) {
147
+ value(...args: any[]) {
148
148
  return (this as any)[baseClassProp][propertyName](...args);
149
149
  },
150
150
  writable: propertyDescriptor.writable,
@@ -22,6 +22,7 @@ import {
22
22
  NetworkToProverAPI,
23
23
  } from "../utils/apiEndpoints";
24
24
  import { AptosApiType, DEFAULT_MAX_GAS_AMOUNT, DEFAULT_TXN_EXP_SEC_FROM_NOW } from "../utils/const";
25
+ import { isBun } from "../utils/helpers";
25
26
 
26
27
  /**
27
28
  * Represents the configuration settings for an Aptos SDK client instance.
@@ -165,6 +166,16 @@ export class AptosConfig {
165
166
  }
166
167
  }
167
168
 
169
+ // Warn Bun users about HTTP/2 compatibility issues.
170
+ // Bun's HTTP/2 support is not fully mature yet, so we recommend disabling it.
171
+ if (isBun() && settings?.clientConfig?.http2 !== false) {
172
+ console.warn(
173
+ "[Aptos SDK] Bun does not fully support HTTP/2, which is enabled by default in this SDK. " +
174
+ "It is recommended to disable HTTP/2 by setting `clientConfig: { http2: false }` in your AptosConfig. " +
175
+ "For example: new AptosConfig({ network: Network.TESTNET, clientConfig: { http2: false } })",
176
+ );
177
+ }
178
+
168
179
  this.network = settings?.network ?? Network.DEVNET;
169
180
  this.fullnode = settings?.fullnode;
170
181
  this.faucet = settings?.faucet;
@@ -238,7 +249,7 @@ export class AptosConfig {
238
249
  if (this.network === Network.CUSTOM) throw new Error("Please provide a custom prover service url");
239
250
  return NetworkToProverAPI[this.network];
240
251
  default:
241
- throw Error(`apiType ${apiType} is not supported`);
252
+ throw new Error(`apiType ${apiType} is not supported`);
242
253
  }
243
254
  }
244
255
 
@@ -36,7 +36,7 @@ import {
36
36
  InputGenerateTransactionPayloadData,
37
37
  InputTransactionPluginData,
38
38
  } from "../transactions";
39
- import { AccountAddressInput, AccountPublicKey, AuthenticationKey, Ed25519PrivateKey } from "../core";
39
+ import { AccountAddressInput, AccountPublicKey, Ed25519PrivateKey } from "../core";
40
40
  import { Account, Ed25519Account, MultiEd25519Account } from "../account";
41
41
  import { Build } from "./transactionSubmission/build";
42
42
  import { Simulate } from "./transactionSubmission/simulate";
@@ -418,7 +418,7 @@ export class Transaction {
418
418
  * ```
419
419
  * @group Transaction
420
420
  */
421
- // eslint-disable-next-line class-methods-use-this
421
+
422
422
  getSigningMessage(args: { transaction: AnyRawTransaction }): Uint8Array {
423
423
  return getSigningMessage(args);
424
424
  }
@@ -594,7 +594,7 @@ export class Transaction {
594
594
  * ```
595
595
  * @group Transaction
596
596
  */
597
- // eslint-disable-next-line class-methods-use-this
597
+
598
598
  sign(args: { signer: Account; transaction: AnyRawTransaction }): AccountAuthenticator {
599
599
  return signTransaction({
600
600
  ...args,
@@ -638,7 +638,7 @@ export class Transaction {
638
638
  * ```
639
639
  * @group Transaction
640
640
  */
641
- // eslint-disable-next-line class-methods-use-this
641
+
642
642
  signAsFeePayer(args: { signer: Account; transaction: AnyRawTransaction }): AccountAuthenticator {
643
643
  return signAsFeePayer({
644
644
  ...args,
@@ -3,11 +3,7 @@
3
3
 
4
4
  import { AccountAddressInput } from "../../core";
5
5
  import { generateTransaction } from "../../internal/transactionSubmission";
6
- import {
7
- InputGenerateTransactionPayloadData,
8
- InputGenerateTransactionOptions,
9
- InputGenerateOrderlessTransactionOptions,
10
- } from "../../transactions";
6
+ import { InputGenerateTransactionPayloadData, InputGenerateTransactionOptions } from "../../transactions";
11
7
  import { MultiAgentTransaction } from "../../transactions/instances/multiAgentTransaction";
12
8
  import { SimpleTransaction } from "../../transactions/instances/simpleTransaction";
13
9
  import { AptosConfig } from "../aptosConfig";
@@ -103,7 +103,6 @@ export function validateFeePayerDataOnSubmission(
103
103
  */
104
104
  export function ValidateFeePayerDataOnSimulation(target: unknown, propertyKey: string, descriptor: PropertyDescriptor) {
105
105
  const originalMethod = descriptor.value;
106
- /* eslint-disable-next-line func-names, no-param-reassign */
107
106
  descriptor.value = async function (...args: any[]) {
108
107
  return originalMethod.apply(this, args);
109
108
  };
@@ -76,7 +76,7 @@ export class Sign {
76
76
  * ```
77
77
  * @group Implementation
78
78
  */
79
- // eslint-disable-next-line class-methods-use-this
79
+
80
80
  transaction(args: { signer: Account; transaction: AnyRawTransaction }): AccountAuthenticator {
81
81
  return signTransaction({
82
82
  ...args,
@@ -121,7 +121,7 @@ export class Sign {
121
121
  * ```
122
122
  * @group Implementation
123
123
  */
124
- // eslint-disable-next-line class-methods-use-this
124
+
125
125
  transactionAsFeePayer(args: { signer: Account; transaction: AnyRawTransaction }): AccountAuthenticator {
126
126
  const { signer, transaction } = args;
127
127
 
@@ -1,11 +1,22 @@
1
1
  // Copyright © Aptos Foundation
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- /* eslint-disable no-bitwise */
5
4
  import { MAX_U32_NUMBER } from "./consts";
6
5
  import { Uint8, Uint16, Uint32, Uint64, Uint128, Uint256, HexInput } from "../types";
7
6
  import { Hex } from "../core/hex";
8
7
 
8
+ /**
9
+ * Shared TextDecoder instance for string deserialization to avoid repeated instantiation.
10
+ */
11
+ const TEXT_DECODER = new TextDecoder();
12
+
13
+ /**
14
+ * Maximum allowed length for deserialized byte arrays and strings.
15
+ * This prevents memory exhaustion attacks from malformed BCS data.
16
+ * Set to 10MB which should be sufficient for any legitimate use case.
17
+ */
18
+ const MAX_DESERIALIZE_BYTES_LENGTH = 10 * 1024 * 1024; // 10MB
19
+
9
20
  /**
10
21
  * This interface exists to define Deserializable<T> inputs for functions that
11
22
  * deserialize a byte buffer into a type T.
@@ -70,18 +81,27 @@ export class Deserializer {
70
81
 
71
82
  /**
72
83
  * Reads a specified number of bytes from the buffer and advances the offset.
84
+ * Returns a view into the buffer rather than copying for better performance.
85
+ *
86
+ * SECURITY NOTE: This returns a view, not a copy. Callers that expose the result
87
+ * externally MUST call .slice() to create a copy. Internal numeric deserializers
88
+ * (deserializeU8, deserializeU16, etc.) only read values and don't expose the view.
89
+ * deserializeBytes() and deserializeFixedBytes() call .slice() before returning.
73
90
  *
74
91
  * @param length - The number of bytes to read from the buffer.
75
92
  * @throws Throws an error if the read operation exceeds the buffer's length.
76
93
  * @group Implementation
77
94
  * @category BCS
78
95
  */
79
- private read(length: number): ArrayBuffer {
96
+ private read(length: number): Uint8Array {
80
97
  if (this.offset + length > this.buffer.byteLength) {
81
98
  throw new Error("Reached to the end of buffer");
82
99
  }
83
100
 
84
- const bytes = this.buffer.slice(this.offset, this.offset + length);
101
+ // Use subarray to return a view instead of slice which copies
102
+ // SECURITY: View is safe because numeric deserializers only read values,
103
+ // and byte deserializers call .slice() before returning to caller
104
+ const bytes = new Uint8Array(this.buffer, this.offset, length);
85
105
  this.offset += length;
86
106
  return bytes;
87
107
  }
@@ -129,8 +149,7 @@ export class Deserializer {
129
149
  */
130
150
  deserializeStr(): string {
131
151
  const value = this.deserializeBytes();
132
- const textDecoder = new TextDecoder();
133
- return textDecoder.decode(value);
152
+ return TEXT_DECODER.decode(value);
134
153
  }
135
154
 
136
155
  /**
@@ -221,24 +240,34 @@ export class Deserializer {
221
240
  * The BCS layout for "bytes" consists of a bytes_length followed by the bytes themselves, where bytes_length is a u32 integer
222
241
  * encoded as a uleb128 integer, indicating the length of the bytes array.
223
242
  *
224
- * @returns {Uint8Array} The deserialized array of bytes.
243
+ * @returns {Uint8Array} The deserialized array of bytes (a copy, safe to modify).
244
+ * @throws {Error} If the length exceeds the maximum allowed (10MB) to prevent memory exhaustion.
225
245
  * @group Implementation
226
246
  * @category BCS
227
247
  */
228
248
  deserializeBytes(): Uint8Array {
229
249
  const len = this.deserializeUleb128AsU32();
230
- return new Uint8Array(this.read(len));
250
+ // Security: Prevent memory exhaustion from malformed data
251
+ if (len > MAX_DESERIALIZE_BYTES_LENGTH) {
252
+ throw new Error(
253
+ `Deserialization error: byte array length ${len} exceeds maximum allowed ${MAX_DESERIALIZE_BYTES_LENGTH}`,
254
+ );
255
+ }
256
+ // Return a copy so caller can safely modify without affecting buffer
257
+ return this.read(len).slice();
231
258
  }
232
259
 
233
260
  /**
234
261
  * Deserializes an array of bytes of a specified length.
235
262
  *
236
263
  * @param len - The number of bytes to read from the source.
264
+ * @returns {Uint8Array} The deserialized array of bytes (a copy, safe to modify).
237
265
  * @group Implementation
238
266
  * @category BCS
239
267
  */
240
268
  deserializeFixedBytes(len: number): Uint8Array {
241
- return new Uint8Array(this.read(len));
269
+ // Return a copy so caller can safely modify without affecting buffer
270
+ return this.read(len).slice();
242
271
  }
243
272
 
244
273
  /**
@@ -253,7 +282,7 @@ export class Deserializer {
253
282
  * @category BCS
254
283
  */
255
284
  deserializeBool(): boolean {
256
- const bool = new Uint8Array(this.read(1))[0];
285
+ const bool = this.read(1)[0];
257
286
  if (bool !== 1 && bool !== 0) {
258
287
  throw new Error("Invalid boolean value");
259
288
  }
@@ -270,7 +299,7 @@ export class Deserializer {
270
299
  * @category BCS
271
300
  */
272
301
  deserializeU8(): Uint8 {
273
- return new DataView(this.read(1)).getUint8(0);
302
+ return this.read(1)[0];
274
303
  }
275
304
 
276
305
  /**
@@ -286,7 +315,8 @@ export class Deserializer {
286
315
  * @category BCS
287
316
  */
288
317
  deserializeU16(): Uint16 {
289
- return new DataView(this.read(2)).getUint16(0, true);
318
+ const bytes = this.read(2);
319
+ return new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength).getUint16(0, true);
290
320
  }
291
321
 
292
322
  /**
@@ -302,7 +332,8 @@ export class Deserializer {
302
332
  * @category BCS
303
333
  */
304
334
  deserializeU32(): Uint32 {
305
- return new DataView(this.read(4)).getUint32(0, true);
335
+ const bytes = this.read(4);
336
+ return new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength).getUint32(0, true);
306
337
  }
307
338
 
308
339
  /**
@@ -367,7 +398,8 @@ export class Deserializer {
367
398
  * @category BCS
368
399
  */
369
400
  deserializeI8(): number {
370
- return new DataView(this.read(1)).getInt8(0);
401
+ const bytes = this.read(1);
402
+ return new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength).getInt8(0);
371
403
  }
372
404
 
373
405
  /**
@@ -379,7 +411,8 @@ export class Deserializer {
379
411
  * @category BCS
380
412
  */
381
413
  deserializeI16(): number {
382
- return new DataView(this.read(2)).getInt16(0, true);
414
+ const bytes = this.read(2);
415
+ return new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength).getInt16(0, true);
383
416
  }
384
417
 
385
418
  /**
@@ -391,7 +424,8 @@ export class Deserializer {
391
424
  * @category BCS
392
425
  */
393
426
  deserializeI32(): number {
394
- return new DataView(this.read(4)).getInt32(0, true);
427
+ const bytes = this.read(4);
428
+ return new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength).getInt32(0, true);
395
429
  }
396
430
 
397
431
  /**
@@ -469,6 +503,7 @@ export class Deserializer {
469
503
  * This function is used for interpreting lengths of variable-length sequences and tags of enum values in BCS encoding.
470
504
  *
471
505
  * @throws {Error} Throws an error if the parsed value exceeds the maximum uint32 number.
506
+ * @throws {Error} Throws an error if the uleb128 encoding is malformed (too many bytes).
472
507
  * @returns {number} The deserialized uint32 value.
473
508
  * @group Implementation
474
509
  * @category BCS
@@ -476,18 +511,30 @@ export class Deserializer {
476
511
  deserializeUleb128AsU32(): Uint32 {
477
512
  let value: bigint = BigInt(0);
478
513
  let shift = 0;
514
+ // Maximum 5 bytes for uleb128-encoded u32 (7 bits per byte, 5*7=35 bits > 32 bits needed)
515
+ const MAX_ULEB128_BYTES = 5;
516
+ let bytesRead = 0;
479
517
 
480
- while (value < MAX_U32_NUMBER) {
518
+ while (bytesRead < MAX_ULEB128_BYTES) {
481
519
  const byte = this.deserializeU8();
520
+ bytesRead += 1;
521
+
482
522
  value |= BigInt(byte & 0x7f) << BigInt(shift);
483
523
 
524
+ // Early overflow check before continuing
525
+ if (value > MAX_U32_NUMBER) {
526
+ throw new Error("Overflow while parsing uleb128-encoded uint32 value");
527
+ }
528
+
484
529
  if ((byte & 0x80) === 0) {
485
530
  break;
486
531
  }
532
+
487
533
  shift += 7;
488
534
  }
489
535
 
490
- if (value > MAX_U32_NUMBER) {
536
+ // If we read MAX_ULEB128_BYTES and the last byte had continuation bit set, it's malformed
537
+ if (bytesRead === MAX_ULEB128_BYTES && value > MAX_U32_NUMBER) {
491
538
  throw new Error("Overflow while parsing uleb128-encoded uint32 value");
492
539
  }
493
540