@aptos-labs/ts-sdk 6.0.0 → 6.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 (455) hide show
  1. package/dist/common/{account-Dpz_N9h-.d.ts → account-CSOaJ0SC.d.ts} +182 -19
  2. package/dist/common/chunk-3NBJLJ2Y.js +4 -0
  3. package/dist/common/chunk-3NBJLJ2Y.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 +69 -6
  8. package/dist/common/index.js +33 -44
  9. package/dist/common/index.js.map +1 -1
  10. package/dist/esm/{Ed25519Account-BW_kXHC2.d.mts → Ed25519Account-BCt2cu_M.d.mts} +2 -2
  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 +2 -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 +26 -2
  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-CcxnCdYZ.d.mts → account-Dg0ejXHy.d.mts} +172 -8
  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 +2 -2
  43. package/dist/esm/api/account.mjs +1 -1
  44. package/dist/esm/api/ans.d.mts +1 -1
  45. package/dist/esm/api/ans.mjs +1 -1
  46. package/dist/esm/api/aptos.d.mts +3 -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 +3 -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 +2 -2
  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/helpers.mjs +1 -1
  76. package/dist/esm/api/transactionSubmission/management.d.mts +2 -2
  77. package/dist/esm/api/transactionSubmission/management.mjs +1 -1
  78. package/dist/esm/api/transactionSubmission/sign.d.mts +2 -2
  79. package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
  80. package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -1
  81. package/dist/esm/api/transactionSubmission/simulate.d.mts +1 -1
  82. package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
  83. package/dist/esm/api/transactionSubmission/submit.d.mts +1 -1
  84. package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
  85. package/dist/esm/api/utils.d.mts +1 -1
  86. package/dist/esm/api/utils.mjs +1 -1
  87. package/dist/esm/bcs/consts.d.mts +1 -1
  88. package/dist/esm/bcs/deserializer.d.mts +1 -1
  89. package/dist/esm/bcs/deserializer.mjs +1 -1
  90. package/dist/esm/bcs/index.d.mts +1 -1
  91. package/dist/esm/bcs/index.mjs +1 -1
  92. package/dist/esm/bcs/serializable/entryFunctionBytes.d.mts +1 -1
  93. package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -1
  94. package/dist/esm/bcs/serializable/fixedBytes.d.mts +1 -1
  95. package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -1
  96. package/dist/esm/bcs/serializable/movePrimitives.d.mts +1 -1
  97. package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
  98. package/dist/esm/bcs/serializable/moveStructs.d.mts +1 -1
  99. package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
  100. package/dist/esm/bcs/serializer.d.mts +1 -1
  101. package/dist/esm/bcs/serializer.mjs +1 -1
  102. package/dist/esm/chunk-32J7VMLV.mjs +2 -0
  103. package/dist/esm/chunk-32J7VMLV.mjs.map +1 -0
  104. package/dist/esm/chunk-3FDSKP56.mjs +2 -0
  105. package/dist/esm/chunk-3FDSKP56.mjs.map +1 -0
  106. package/dist/esm/{chunk-X674XJNJ.mjs → chunk-3Q3J4DTI.mjs} +2 -2
  107. package/dist/esm/chunk-7FG7RJDS.mjs +2 -0
  108. package/dist/esm/chunk-7FG7RJDS.mjs.map +1 -0
  109. package/dist/esm/chunk-BHVMFSAD.mjs +2 -0
  110. package/dist/esm/chunk-BHVMFSAD.mjs.map +1 -0
  111. package/dist/esm/chunk-CWI5B5KE.mjs +2 -0
  112. package/dist/esm/{chunk-QDJDZ3ON.mjs → chunk-DE4YVX3L.mjs} +2 -2
  113. package/dist/esm/chunk-DECWO3X5.mjs +2 -0
  114. package/dist/esm/chunk-DECWO3X5.mjs.map +1 -0
  115. package/dist/esm/{chunk-76SVQZDX.mjs → chunk-DRGODFFX.mjs} +2 -2
  116. package/dist/esm/{chunk-GOXRBEIJ.mjs → chunk-F45HI7LU.mjs} +1 -1
  117. package/dist/esm/chunk-F45HI7LU.mjs.map +1 -0
  118. package/dist/esm/{chunk-LS2HRAVW.mjs → chunk-G5OONGWS.mjs} +1 -12
  119. package/dist/esm/chunk-G5OONGWS.mjs.map +1 -0
  120. package/dist/esm/chunk-GP3CDQFI.mjs +2 -0
  121. package/dist/esm/chunk-GP3CDQFI.mjs.map +1 -0
  122. package/dist/esm/chunk-GWM3VCT4.mjs +4 -0
  123. package/dist/esm/chunk-GWM3VCT4.mjs.map +1 -0
  124. package/dist/esm/{chunk-C5UZZHA4.mjs → chunk-HHAUJ5E4.mjs} +2 -2
  125. package/dist/esm/chunk-ITZN23GU.mjs +2 -0
  126. package/dist/esm/{chunk-G3HAIETV.mjs → chunk-KLDERTLN.mjs} +2 -2
  127. package/dist/esm/chunk-KLDERTLN.mjs.map +1 -0
  128. package/dist/esm/chunk-M65PXVDO.mjs +2 -0
  129. package/dist/esm/chunk-M65PXVDO.mjs.map +1 -0
  130. package/dist/esm/chunk-ODNZJSOC.mjs +2 -0
  131. package/dist/esm/chunk-ODNZJSOC.mjs.map +1 -0
  132. package/dist/esm/{chunk-NTLOKAPD.mjs → chunk-PDNDARQY.mjs} +2 -2
  133. package/dist/esm/{chunk-RYOICF37.mjs → chunk-POKQD2RK.mjs} +2 -2
  134. package/dist/esm/chunk-Q5ESW36C.mjs +2 -0
  135. package/dist/esm/chunk-Q5ESW36C.mjs.map +1 -0
  136. package/dist/esm/chunk-QRD5NGNC.mjs +2 -0
  137. package/dist/esm/{chunk-RQN6LA7E.mjs.map → chunk-QRD5NGNC.mjs.map} +1 -1
  138. package/dist/esm/{chunk-43LWUUXS.mjs → chunk-QV37KEZY.mjs} +2 -2
  139. package/dist/esm/{chunk-PXJEKGEG.mjs → chunk-QYC3HOQX.mjs} +2 -2
  140. package/dist/esm/{chunk-CUXCVNES.mjs → chunk-RGXAFBFA.mjs} +2 -2
  141. package/dist/esm/{chunk-3P474TWM.mjs → chunk-RSUFVB4P.mjs} +2 -2
  142. package/dist/esm/chunk-SZBXWUBS.mjs +2 -0
  143. package/dist/esm/chunk-SZBXWUBS.mjs.map +1 -0
  144. package/dist/esm/{chunk-F3NI6N7R.mjs → chunk-TIMTVXFU.mjs} +2 -2
  145. package/dist/esm/chunk-TIMTVXFU.mjs.map +1 -0
  146. package/dist/esm/{chunk-QREVMGQZ.mjs → chunk-U5HTF4OK.mjs} +1 -1
  147. package/dist/esm/{chunk-QREVMGQZ.mjs.map → chunk-U5HTF4OK.mjs.map} +1 -1
  148. package/dist/esm/{chunk-6IWGTO2J.mjs → chunk-UNA3V4UB.mjs} +2 -2
  149. package/dist/esm/chunk-US6KOOYS.mjs +2 -0
  150. package/dist/esm/chunk-US6KOOYS.mjs.map +1 -0
  151. package/dist/esm/chunk-UXDYADZV.mjs +2 -0
  152. package/dist/esm/chunk-UXDYADZV.mjs.map +1 -0
  153. package/dist/esm/{chunk-5FNZUL2Y.mjs → chunk-UZMJ4DAO.mjs} +2 -2
  154. package/dist/esm/chunk-V5K2RRFT.mjs +2 -0
  155. package/dist/esm/chunk-V5K2RRFT.mjs.map +1 -0
  156. package/dist/esm/{chunk-35DKMW7Q.mjs → chunk-VW3Y5EOJ.mjs} +1 -1
  157. package/dist/esm/{chunk-35DKMW7Q.mjs.map → chunk-VW3Y5EOJ.mjs.map} +1 -1
  158. package/dist/esm/{chunk-MEG27LEV.mjs → chunk-VWLK43JM.mjs} +3 -3
  159. package/dist/esm/chunk-VWLK43JM.mjs.map +1 -0
  160. package/dist/esm/{chunk-DIFSO4N6.mjs → chunk-VWXVSRRQ.mjs} +2 -2
  161. package/dist/esm/{chunk-WZ6FL7CH.mjs → chunk-WRV7BWXE.mjs} +2 -2
  162. package/dist/esm/{chunk-56IXVVXX.mjs → chunk-YMZF4KMT.mjs} +2 -2
  163. package/dist/esm/{chunk-FW6UHAQV.mjs → chunk-YNNDFGVQ.mjs} +2 -2
  164. package/dist/esm/{chunk-FW6UHAQV.mjs.map → chunk-YNNDFGVQ.mjs.map} +1 -1
  165. package/dist/esm/{chunk-52PWWLJJ.mjs → chunk-YOT47DDX.mjs} +2 -2
  166. package/dist/esm/chunk-YOT47DDX.mjs.map +1 -0
  167. package/dist/esm/cli/index.d.mts +1 -1
  168. package/dist/esm/cli/index.mjs +1 -1
  169. package/dist/esm/cli/localNode.mjs +1 -1
  170. package/dist/esm/cli/move.d.mts +1 -1
  171. package/dist/esm/cli/move.mjs +1 -1
  172. package/dist/esm/client/core.d.mts +1 -1
  173. package/dist/esm/client/core.mjs +1 -1
  174. package/dist/esm/client/get.d.mts +1 -1
  175. package/dist/esm/client/get.mjs +1 -1
  176. package/dist/esm/client/index.d.mts +1 -1
  177. package/dist/esm/client/index.mjs +1 -1
  178. package/dist/esm/client/post.d.mts +1 -1
  179. package/dist/esm/client/post.mjs +1 -1
  180. package/dist/esm/core/account/index.d.mts +1 -1
  181. package/dist/esm/core/account/index.mjs +1 -1
  182. package/dist/esm/core/account/utils/address.d.mts +1 -1
  183. package/dist/esm/core/account/utils/address.mjs +1 -1
  184. package/dist/esm/core/account/utils/index.d.mts +1 -1
  185. package/dist/esm/core/account/utils/index.mjs +1 -1
  186. package/dist/esm/core/accountAddress.d.mts +1 -1
  187. package/dist/esm/core/accountAddress.mjs +1 -1
  188. package/dist/esm/core/authenticationKey.d.mts +1 -1
  189. package/dist/esm/core/authenticationKey.mjs +1 -1
  190. package/dist/esm/core/crypto/abstraction.d.mts +1 -1
  191. package/dist/esm/core/crypto/abstraction.mjs +1 -1
  192. package/dist/esm/core/crypto/deserializationUtils.d.mts +1 -1
  193. package/dist/esm/core/crypto/deserializationUtils.mjs +1 -1
  194. package/dist/esm/core/crypto/ed25519.d.mts +1 -1
  195. package/dist/esm/core/crypto/ed25519.mjs +1 -1
  196. package/dist/esm/core/crypto/ephemeral.d.mts +1 -1
  197. package/dist/esm/core/crypto/ephemeral.mjs +1 -1
  198. package/dist/esm/core/crypto/federatedKeyless.d.mts +2 -2
  199. package/dist/esm/core/crypto/federatedKeyless.mjs +1 -1
  200. package/dist/esm/core/crypto/index.d.mts +2 -2
  201. package/dist/esm/core/crypto/index.mjs +1 -1
  202. package/dist/esm/core/crypto/keyless.d.mts +2 -2
  203. package/dist/esm/core/crypto/keyless.mjs +1 -1
  204. package/dist/esm/core/crypto/multiEd25519.d.mts +1 -1
  205. package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
  206. package/dist/esm/core/crypto/multiKey.d.mts +1 -1
  207. package/dist/esm/core/crypto/multiKey.mjs +1 -1
  208. package/dist/esm/core/crypto/poseidon.mjs +1 -1
  209. package/dist/esm/core/crypto/privateKey.d.mts +1 -1
  210. package/dist/esm/core/crypto/privateKey.mjs +1 -1
  211. package/dist/esm/core/crypto/proof.d.mts +1 -1
  212. package/dist/esm/core/crypto/proof.mjs +1 -1
  213. package/dist/esm/core/crypto/publicKey.d.mts +1 -1
  214. package/dist/esm/core/crypto/publicKey.mjs +1 -1
  215. package/dist/esm/core/crypto/secp256k1.d.mts +1 -1
  216. package/dist/esm/core/crypto/secp256k1.mjs +1 -1
  217. package/dist/esm/core/crypto/secp256r1.d.mts +1 -1
  218. package/dist/esm/core/crypto/secp256r1.mjs +1 -1
  219. package/dist/esm/core/crypto/signature.d.mts +1 -1
  220. package/dist/esm/core/crypto/signature.mjs +1 -1
  221. package/dist/esm/core/crypto/singleKey.d.mts +1 -1
  222. package/dist/esm/core/crypto/singleKey.mjs +1 -1
  223. package/dist/esm/core/crypto/types.d.mts +1 -1
  224. package/dist/esm/core/crypto/utils.d.mts +1 -1
  225. package/dist/esm/core/crypto/utils.mjs +1 -1
  226. package/dist/esm/core/hex.d.mts +1 -1
  227. package/dist/esm/core/index.d.mts +2 -2
  228. package/dist/esm/core/index.mjs +1 -1
  229. package/dist/esm/errors/index.d.mts +1 -1
  230. package/dist/esm/errors/index.mjs +1 -1
  231. package/dist/esm/{federatedKeyless-BzaYmP03.d.mts → federatedKeyless-BYLu31Sa.d.mts} +13 -2
  232. package/dist/esm/index.d.mts +5 -5
  233. package/dist/esm/index.mjs +1 -1
  234. package/dist/esm/internal/abstraction.d.mts +1 -1
  235. package/dist/esm/internal/abstraction.mjs +1 -1
  236. package/dist/esm/internal/account.d.mts +3 -3
  237. package/dist/esm/internal/account.mjs +1 -1
  238. package/dist/esm/internal/ans.d.mts +2 -2
  239. package/dist/esm/internal/ans.mjs +1 -1
  240. package/dist/esm/internal/coin.d.mts +1 -1
  241. package/dist/esm/internal/coin.mjs +1 -1
  242. package/dist/esm/internal/digitalAsset.d.mts +3 -3
  243. package/dist/esm/internal/digitalAsset.mjs +1 -1
  244. package/dist/esm/internal/faucet.d.mts +1 -1
  245. package/dist/esm/internal/faucet.mjs +1 -1
  246. package/dist/esm/internal/fungibleAsset.d.mts +4 -4
  247. package/dist/esm/internal/fungibleAsset.mjs +1 -1
  248. package/dist/esm/internal/general.d.mts +4 -2
  249. package/dist/esm/internal/general.mjs +1 -1
  250. package/dist/esm/internal/keyless.d.mts +3 -3
  251. package/dist/esm/internal/keyless.mjs +1 -1
  252. package/dist/esm/internal/object.d.mts +1 -1
  253. package/dist/esm/internal/object.mjs +1 -1
  254. package/dist/esm/internal/staking.d.mts +2 -2
  255. package/dist/esm/internal/staking.mjs +1 -1
  256. package/dist/esm/internal/table.d.mts +1 -1
  257. package/dist/esm/internal/table.mjs +1 -1
  258. package/dist/esm/internal/transaction.d.mts +1 -1
  259. package/dist/esm/internal/transaction.mjs +1 -1
  260. package/dist/esm/internal/transactionSubmission.d.mts +2 -2
  261. package/dist/esm/internal/transactionSubmission.mjs +1 -1
  262. package/dist/esm/internal/utils/index.d.mts +1 -1
  263. package/dist/esm/internal/utils/index.mjs +1 -1
  264. package/dist/esm/internal/utils/utils.d.mts +1 -1
  265. package/dist/esm/internal/utils/utils.mjs +1 -1
  266. package/dist/esm/internal/view.d.mts +1 -1
  267. package/dist/esm/internal/view.mjs +1 -1
  268. package/dist/esm/transactions/authenticator/account.d.mts +1 -1
  269. package/dist/esm/transactions/authenticator/account.mjs +1 -1
  270. package/dist/esm/transactions/authenticator/index.d.mts +1 -1
  271. package/dist/esm/transactions/authenticator/index.mjs +1 -1
  272. package/dist/esm/transactions/authenticator/transaction.d.mts +1 -1
  273. package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
  274. package/dist/esm/transactions/index.d.mts +1 -1
  275. package/dist/esm/transactions/index.mjs +1 -1
  276. package/dist/esm/transactions/instances/chainId.d.mts +1 -1
  277. package/dist/esm/transactions/instances/chainId.mjs +1 -1
  278. package/dist/esm/transactions/instances/identifier.d.mts +1 -1
  279. package/dist/esm/transactions/instances/identifier.mjs +1 -1
  280. package/dist/esm/transactions/instances/index.d.mts +1 -1
  281. package/dist/esm/transactions/instances/index.mjs +1 -1
  282. package/dist/esm/transactions/instances/moduleId.d.mts +1 -1
  283. package/dist/esm/transactions/instances/moduleId.mjs +1 -1
  284. package/dist/esm/transactions/instances/multiAgentTransaction.d.mts +1 -1
  285. package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
  286. package/dist/esm/transactions/instances/rawTransaction.d.mts +1 -1
  287. package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
  288. package/dist/esm/transactions/instances/rotationProofChallenge.d.mts +1 -1
  289. package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
  290. package/dist/esm/transactions/instances/signedTransaction.d.mts +1 -1
  291. package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
  292. package/dist/esm/transactions/instances/simpleTransaction.d.mts +1 -1
  293. package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
  294. package/dist/esm/transactions/instances/transactionArgument.d.mts +1 -1
  295. package/dist/esm/transactions/instances/transactionPayload.d.mts +1 -1
  296. package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
  297. package/dist/esm/transactions/management/accountSequenceNumber.d.mts +2 -2
  298. package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
  299. package/dist/esm/transactions/management/index.d.mts +2 -2
  300. package/dist/esm/transactions/management/index.mjs +1 -1
  301. package/dist/esm/transactions/management/transactionWorker.d.mts +12 -4
  302. package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
  303. package/dist/esm/transactions/transactionBuilder/helpers.d.mts +1 -1
  304. package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
  305. package/dist/esm/transactions/transactionBuilder/index.d.mts +1 -1
  306. package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
  307. package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +2 -1
  308. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
  309. package/dist/esm/transactions/transactionBuilder/signingMessage.d.mts +1 -1
  310. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
  311. package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +1 -1
  312. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
  313. package/dist/esm/transactions/typeTag/index.d.mts +1 -1
  314. package/dist/esm/transactions/typeTag/index.mjs +1 -1
  315. package/dist/esm/transactions/typeTag/parser.d.mts +1 -1
  316. package/dist/esm/transactions/typeTag/parser.mjs +1 -1
  317. package/dist/esm/transactions/types.d.mts +1 -1
  318. package/dist/esm/types/generated/operations.d.mts +0 -11
  319. package/dist/esm/types/generated/queries.d.mts +1 -1
  320. package/dist/esm/types/generated/queries.mjs +1 -1
  321. package/dist/esm/types/index.d.mts +1 -1
  322. package/dist/esm/types/index.mjs +1 -1
  323. package/dist/esm/types/indexer.d.mts +1 -1
  324. package/dist/esm/types/types.d.mts +1 -1
  325. package/dist/esm/types/types.mjs +1 -1
  326. package/dist/esm/utils/const.d.mts +11 -1
  327. package/dist/esm/utils/const.mjs +1 -1
  328. package/dist/esm/utils/helpers.d.mts +21 -2
  329. package/dist/esm/utils/helpers.mjs +1 -1
  330. package/dist/esm/utils/index.d.mts +3 -3
  331. package/dist/esm/utils/index.mjs +1 -1
  332. package/dist/esm/utils/memoize.d.mts +23 -1
  333. package/dist/esm/utils/memoize.mjs +1 -1
  334. package/dist/esm/utils/normalizeBundle.d.mts +1 -1
  335. package/dist/esm/utils/normalizeBundle.mjs +1 -1
  336. package/dist/esm/version.d.mts +1 -1
  337. package/dist/esm/version.mjs +1 -1
  338. package/package.json +38 -45
  339. package/src/account/AbstractKeylessAccount.ts +2 -3
  340. package/src/account/DerivableAbstractedAccount.ts +1 -3
  341. package/src/account/EphemeralKeyPair.ts +53 -1
  342. package/src/account/MultiEd25519Account.ts +0 -2
  343. package/src/account/MultiKeyAccount.ts +0 -2
  344. package/src/account/SingleKeyAccount.ts +0 -1
  345. package/src/api/account.ts +1 -2
  346. package/src/api/ans.ts +0 -1
  347. package/src/api/aptos.ts +3 -2
  348. package/src/api/aptosConfig.ts +13 -0
  349. package/src/api/transaction.ts +4 -4
  350. package/src/api/transactionSubmission/build.ts +1 -5
  351. package/src/api/transactionSubmission/helpers.ts +1 -1
  352. package/src/api/transactionSubmission/sign.ts +2 -2
  353. package/src/bcs/deserializer.ts +64 -17
  354. package/src/bcs/serializable/movePrimitives.ts +16 -28
  355. package/src/bcs/serializable/moveStructs.ts +4 -6
  356. package/src/bcs/serializer.ts +151 -12
  357. package/src/cli/localNode.ts +2 -3
  358. package/src/cli/move.ts +5 -5
  359. package/src/client/get.ts +8 -10
  360. package/src/core/accountAddress.ts +2 -3
  361. package/src/core/crypto/abstraction.ts +3 -3
  362. package/src/core/crypto/ed25519.ts +66 -1
  363. package/src/core/crypto/federatedKeyless.ts +1 -1
  364. package/src/core/crypto/keyless.ts +65 -13
  365. package/src/core/crypto/multiEd25519.ts +1 -3
  366. package/src/core/crypto/multiKey.ts +4 -7
  367. package/src/core/crypto/poseidon.ts +0 -1
  368. package/src/core/crypto/privateKey.ts +2 -4
  369. package/src/core/crypto/secp256k1.ts +68 -3
  370. package/src/core/crypto/secp256r1.ts +1 -1
  371. package/src/core/crypto/singleKey.ts +4 -0
  372. package/src/core/crypto/utils.ts +6 -3
  373. package/src/errors/index.ts +4 -5
  374. package/src/internal/account.ts +20 -29
  375. package/src/internal/ans.ts +5 -6
  376. package/src/internal/general.ts +24 -6
  377. package/src/internal/queries/getCollectionData.graphql +0 -11
  378. package/src/internal/transaction.ts +3 -5
  379. package/src/internal/transactionSubmission.ts +23 -0
  380. package/src/transactions/authenticator/account.ts +0 -3
  381. package/src/transactions/authenticator/transaction.ts +0 -2
  382. package/src/transactions/instances/multiAgentTransaction.ts +0 -2
  383. package/src/transactions/instances/rawTransaction.ts +0 -2
  384. package/src/transactions/instances/signedTransaction.ts +0 -2
  385. package/src/transactions/instances/simpleTransaction.ts +0 -2
  386. package/src/transactions/instances/transactionPayload.ts +7 -6
  387. package/src/transactions/management/accountSequenceNumber.ts +0 -2
  388. package/src/transactions/management/transactionWorker.ts +40 -10
  389. package/src/transactions/transactionBuilder/remoteAbi.ts +21 -6
  390. package/src/transactions/transactionBuilder/transactionBuilder.ts +13 -9
  391. package/src/transactions/typeTag/index.ts +1 -1
  392. package/src/transactions/typeTag/parser.ts +1 -2
  393. package/src/types/generated/operations.ts +0 -11
  394. package/src/types/generated/queries.ts +0 -11
  395. package/src/types/types.ts +26 -0
  396. package/src/utils/const.ts +11 -0
  397. package/src/utils/helpers.ts +45 -5
  398. package/src/utils/memoize.ts +177 -11
  399. package/src/version.ts +1 -1
  400. package/dist/common/chunk-4RHBBU7C.js +0 -4
  401. package/dist/common/chunk-4RHBBU7C.js.map +0 -1
  402. package/dist/esm/chunk-2DPQMXUG.mjs +0 -4
  403. package/dist/esm/chunk-2DPQMXUG.mjs.map +0 -1
  404. package/dist/esm/chunk-2LCPW76G.mjs +0 -2
  405. package/dist/esm/chunk-2LCPW76G.mjs.map +0 -1
  406. package/dist/esm/chunk-2PASUPUO.mjs +0 -2
  407. package/dist/esm/chunk-2PASUPUO.mjs.map +0 -1
  408. package/dist/esm/chunk-52PWWLJJ.mjs.map +0 -1
  409. package/dist/esm/chunk-54C2P534.mjs +0 -2
  410. package/dist/esm/chunk-54C2P534.mjs.map +0 -1
  411. package/dist/esm/chunk-BGZDJ5SM.mjs +0 -2
  412. package/dist/esm/chunk-BGZDJ5SM.mjs.map +0 -1
  413. package/dist/esm/chunk-F3NI6N7R.mjs.map +0 -1
  414. package/dist/esm/chunk-G3HAIETV.mjs.map +0 -1
  415. package/dist/esm/chunk-GOXRBEIJ.mjs.map +0 -1
  416. package/dist/esm/chunk-I42Z32Q2.mjs +0 -2
  417. package/dist/esm/chunk-I42Z32Q2.mjs.map +0 -1
  418. package/dist/esm/chunk-JN65XG2P.mjs +0 -2
  419. package/dist/esm/chunk-JN65XG2P.mjs.map +0 -1
  420. package/dist/esm/chunk-KUF4DKN5.mjs +0 -2
  421. package/dist/esm/chunk-LD3I4CYO.mjs +0 -2
  422. package/dist/esm/chunk-LS2HRAVW.mjs.map +0 -1
  423. package/dist/esm/chunk-MEG27LEV.mjs.map +0 -1
  424. package/dist/esm/chunk-NCKJ7X57.mjs +0 -2
  425. package/dist/esm/chunk-NCKJ7X57.mjs.map +0 -1
  426. package/dist/esm/chunk-NK3Y3PV3.mjs +0 -2
  427. package/dist/esm/chunk-NK3Y3PV3.mjs.map +0 -1
  428. package/dist/esm/chunk-OLILO7VD.mjs +0 -2
  429. package/dist/esm/chunk-OLILO7VD.mjs.map +0 -1
  430. package/dist/esm/chunk-PYVKCTUN.mjs +0 -2
  431. package/dist/esm/chunk-PYVKCTUN.mjs.map +0 -1
  432. package/dist/esm/chunk-QEHKRR3I.mjs +0 -2
  433. package/dist/esm/chunk-QEHKRR3I.mjs.map +0 -1
  434. package/dist/esm/chunk-RQN6LA7E.mjs +0 -2
  435. package/dist/esm/chunk-Y426VCPM.mjs +0 -2
  436. package/dist/esm/chunk-Y426VCPM.mjs.map +0 -1
  437. package/dist/esm/chunk-YOZBVVKL.mjs +0 -2
  438. package/dist/esm/chunk-YOZBVVKL.mjs.map +0 -1
  439. /package/dist/esm/{chunk-X674XJNJ.mjs.map → chunk-3Q3J4DTI.mjs.map} +0 -0
  440. /package/dist/esm/{chunk-KUF4DKN5.mjs.map → chunk-CWI5B5KE.mjs.map} +0 -0
  441. /package/dist/esm/{chunk-QDJDZ3ON.mjs.map → chunk-DE4YVX3L.mjs.map} +0 -0
  442. /package/dist/esm/{chunk-76SVQZDX.mjs.map → chunk-DRGODFFX.mjs.map} +0 -0
  443. /package/dist/esm/{chunk-C5UZZHA4.mjs.map → chunk-HHAUJ5E4.mjs.map} +0 -0
  444. /package/dist/esm/{chunk-LD3I4CYO.mjs.map → chunk-ITZN23GU.mjs.map} +0 -0
  445. /package/dist/esm/{chunk-NTLOKAPD.mjs.map → chunk-PDNDARQY.mjs.map} +0 -0
  446. /package/dist/esm/{chunk-RYOICF37.mjs.map → chunk-POKQD2RK.mjs.map} +0 -0
  447. /package/dist/esm/{chunk-43LWUUXS.mjs.map → chunk-QV37KEZY.mjs.map} +0 -0
  448. /package/dist/esm/{chunk-PXJEKGEG.mjs.map → chunk-QYC3HOQX.mjs.map} +0 -0
  449. /package/dist/esm/{chunk-CUXCVNES.mjs.map → chunk-RGXAFBFA.mjs.map} +0 -0
  450. /package/dist/esm/{chunk-3P474TWM.mjs.map → chunk-RSUFVB4P.mjs.map} +0 -0
  451. /package/dist/esm/{chunk-6IWGTO2J.mjs.map → chunk-UNA3V4UB.mjs.map} +0 -0
  452. /package/dist/esm/{chunk-5FNZUL2Y.mjs.map → chunk-UZMJ4DAO.mjs.map} +0 -0
  453. /package/dist/esm/{chunk-DIFSO4N6.mjs.map → chunk-VWXVSRRQ.mjs.map} +0 -0
  454. /package/dist/esm/{chunk-WZ6FL7CH.mjs.map → chunk-WRV7BWXE.mjs.map} +0 -0
  455. /package/dist/esm/{chunk-56IXVVXX.mjs.map → chunk-YMZF4KMT.mjs.map} +0 -0
@@ -1,7 +1,6 @@
1
1
  // Copyright © Aptos Foundation
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- /* eslint-disable no-bitwise */
5
4
  import {
6
5
  MAX_U128_BIG_INT,
7
6
  MAX_U16_NUMBER,
@@ -77,6 +76,46 @@ export abstract class Serializable {
77
76
  }
78
77
  }
79
78
 
79
+ /**
80
+ * Minimum buffer growth increment to avoid too many small reallocations.
81
+ */
82
+ const MIN_BUFFER_GROWTH = 256;
83
+
84
+ /**
85
+ * Shared TextEncoder instance for string serialization to avoid repeated instantiation.
86
+ */
87
+ const TEXT_ENCODER = new TextEncoder();
88
+
89
+ /**
90
+ * Pool of reusable Serializer instances for temporary serialization operations.
91
+ * This reduces allocations when using serializeAsBytes() repeatedly.
92
+ */
93
+ const serializerPool: Serializer[] = [];
94
+ const MAX_POOL_SIZE = 8;
95
+
96
+ /**
97
+ * Acquires a Serializer from the pool or creates a new one.
98
+ * @internal
99
+ */
100
+ function acquireSerializer(): Serializer {
101
+ const serializer = serializerPool.pop();
102
+ if (serializer) {
103
+ serializer.reset();
104
+ return serializer;
105
+ }
106
+ return new Serializer();
107
+ }
108
+
109
+ /**
110
+ * Returns a Serializer to the pool for reuse.
111
+ * @internal
112
+ */
113
+ function releaseSerializer(serializer: Serializer): void {
114
+ if (serializerPool.length < MAX_POOL_SIZE) {
115
+ serializerPool.push(serializer);
116
+ }
117
+ }
118
+
80
119
  /**
81
120
  * A class for serializing various data types into a binary format.
82
121
  * It provides methods to serialize strings, bytes, numbers, and other serializable objects
@@ -90,6 +129,12 @@ export class Serializer {
90
129
 
91
130
  private offset: number;
92
131
 
132
+ /**
133
+ * Reusable DataView instance to reduce allocations during serialization.
134
+ * Recreated when buffer is resized.
135
+ */
136
+ private dataView: DataView;
137
+
93
138
  /**
94
139
  * Constructs a serializer with a buffer of size `length` bytes, 64 bytes by default.
95
140
  * The `length` must be greater than 0.
@@ -103,23 +148,33 @@ export class Serializer {
103
148
  throw new Error("Length needs to be greater than 0");
104
149
  }
105
150
  this.buffer = new ArrayBuffer(length);
151
+ this.dataView = new DataView(this.buffer);
106
152
  this.offset = 0;
107
153
  }
108
154
 
109
155
  /**
110
156
  * Ensures that the internal buffer can accommodate the specified number of bytes.
111
- * This function dynamically resizes the buffer if the current size is insufficient.
157
+ * This function dynamically resizes the buffer using a growth factor of 1.5x with
158
+ * a minimum growth increment to balance memory usage and reallocation frequency.
112
159
  *
113
160
  * @param bytes - The number of bytes to ensure the buffer can handle.
114
161
  * @group Implementation
115
162
  * @category BCS
116
163
  */
117
164
  private ensureBufferWillHandleSize(bytes: number) {
118
- while (this.buffer.byteLength < this.offset + bytes) {
119
- const newBuffer = new ArrayBuffer(this.buffer.byteLength * 2);
120
- new Uint8Array(newBuffer).set(new Uint8Array(this.buffer));
121
- this.buffer = newBuffer;
165
+ const requiredSize = this.offset + bytes;
166
+ if (this.buffer.byteLength >= requiredSize) {
167
+ return;
122
168
  }
169
+
170
+ // Calculate new size: max of (1.5x current size) or (current + required + MIN_GROWTH)
171
+ // Using 1.5x instead of 2x provides better memory efficiency
172
+ const growthSize = Math.max(Math.floor(this.buffer.byteLength * 1.5), requiredSize + MIN_BUFFER_GROWTH);
173
+
174
+ const newBuffer = new ArrayBuffer(growthSize);
175
+ new Uint8Array(newBuffer).set(new Uint8Array(this.buffer, 0, this.offset));
176
+ this.buffer = newBuffer;
177
+ this.dataView = new DataView(this.buffer);
123
178
  }
124
179
 
125
180
  /**
@@ -137,6 +192,7 @@ export class Serializer {
137
192
 
138
193
  /**
139
194
  * Serializes a value into the buffer using the provided function, ensuring the buffer can accommodate the size.
195
+ * Uses the cached DataView instance for better performance.
140
196
  *
141
197
  * @param fn - The function to serialize the value, which takes a byte offset, the value to serialize, and an optional little-endian flag.
142
198
  * @param fn.byteOffset - The byte offset at which to write the value.
@@ -152,8 +208,7 @@ export class Serializer {
152
208
  value: number,
153
209
  ) {
154
210
  this.ensureBufferWillHandleSize(bytesLength);
155
- const dv = new DataView(this.buffer, this.offset);
156
- fn.apply(dv, [0, value, true]);
211
+ fn.apply(this.dataView, [this.offset, value, true]);
157
212
  this.offset += bytesLength;
158
213
  }
159
214
 
@@ -177,8 +232,7 @@ export class Serializer {
177
232
  * @category BCS
178
233
  */
179
234
  serializeStr(value: string) {
180
- const textEncoder = new TextEncoder();
181
- this.serializeBytes(textEncoder.encode(value));
235
+ this.serializeBytes(TEXT_ENCODER.encode(value));
182
236
  }
183
237
 
184
238
  /**
@@ -473,13 +527,57 @@ export class Serializer {
473
527
  * Returns the buffered bytes as a Uint8Array.
474
528
  *
475
529
  * This function allows you to retrieve the byte representation of the buffer up to the current offset.
530
+ * For better performance, returns a view when the buffer is exactly the right size, or copies
531
+ * only the used portion otherwise.
476
532
  *
477
533
  * @returns Uint8Array - The byte array representation of the buffer.
478
534
  * @group Implementation
479
535
  * @category BCS
480
536
  */
481
537
  toUint8Array(): Uint8Array {
482
- return new Uint8Array(this.buffer).slice(0, this.offset);
538
+ // Return a copy of only the used portion of the buffer
539
+ // Using subarray + slice pattern for efficiency
540
+ return new Uint8Array(this.buffer, 0, this.offset).slice();
541
+ }
542
+
543
+ /**
544
+ * Resets the serializer to its initial state, allowing the buffer to be reused.
545
+ * This clears the buffer contents to prevent data leakage between uses.
546
+ *
547
+ * @group Implementation
548
+ * @category BCS
549
+ */
550
+ reset(): void {
551
+ // Clear buffer contents to prevent data leakage when reusing pooled serializers
552
+ // Only clear the portion that was used (up to offset) for efficiency
553
+ if (this.offset > 0) {
554
+ new Uint8Array(this.buffer, 0, this.offset).fill(0);
555
+ }
556
+ this.offset = 0;
557
+ }
558
+
559
+ /**
560
+ * Returns the current number of bytes written to the serializer.
561
+ *
562
+ * @returns The number of bytes written.
563
+ * @group Implementation
564
+ * @category BCS
565
+ */
566
+ getOffset(): number {
567
+ return this.offset;
568
+ }
569
+
570
+ /**
571
+ * Returns a view of the serialized bytes without copying.
572
+ * WARNING: The returned view is only valid until the next write operation.
573
+ * Use toUint8Array() if you need a persistent copy.
574
+ *
575
+ * @returns A Uint8Array view of the buffer (not a copy).
576
+ * @group Implementation
577
+ * @category BCS
578
+ */
579
+ toUint8ArrayView(): Uint8Array {
580
+ return new Uint8Array(this.buffer, 0, this.offset);
483
581
  }
484
582
 
485
583
  /**
@@ -497,6 +595,47 @@ export class Serializer {
497
595
  value.serialize(this);
498
596
  }
499
597
 
598
+ /**
599
+ * Serializes a Serializable value as a byte array with a length prefix.
600
+ * This is the optimized pattern for entry function argument serialization.
601
+ *
602
+ * Instead of:
603
+ * ```typescript
604
+ * const bcsBytes = value.bcsToBytes(); // Creates new Serializer, copies bytes
605
+ * serializer.serializeBytes(bcsBytes);
606
+ * ```
607
+ *
608
+ * Use:
609
+ * ```typescript
610
+ * serializer.serializeAsBytes(value); // Uses pooled Serializer, avoids extra copy
611
+ * ```
612
+ *
613
+ * This method uses a pooled Serializer instance to reduce allocations and
614
+ * directly appends the serialized bytes with a length prefix.
615
+ *
616
+ * @param value - The Serializable value to serialize as bytes.
617
+ * @group Implementation
618
+ * @category BCS
619
+ */
620
+ serializeAsBytes<T extends Serializable>(value: T): void {
621
+ // Acquire a pooled serializer for temporary use
622
+ const tempSerializer = acquireSerializer();
623
+
624
+ try {
625
+ // Serialize the value to the temporary serializer
626
+ value.serialize(tempSerializer);
627
+
628
+ // Get the serialized bytes (as a view to avoid copying)
629
+ const bytes = tempSerializer.toUint8ArrayView();
630
+
631
+ // Serialize with length prefix to this serializer
632
+ this.serializeBytes(bytes);
633
+ } finally {
634
+ // Return the serializer to the pool for reuse
635
+ releaseSerializer(tempSerializer);
636
+ }
637
+ }
638
+
500
639
  /**
501
640
  * Serializes an array of BCS Serializable values to a serializer instance.
502
641
  * The bytes are added to the serializer instance's byte buffer.
@@ -630,7 +769,7 @@ export function validateNumberInRange<T extends AnyNumber>(value: T, minValue: T
630
769
  function checkNumberRange<T extends AnyNumber>(minValue: T, maxValue: T) {
631
770
  return (target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => {
632
771
  const childFunction = descriptor.value;
633
- // eslint-disable-next-line no-param-reassign
772
+
634
773
  descriptor.value = function deco(value: AnyNumber) {
635
774
  validateNumberInRange(value, minValue, maxValue);
636
775
  return childFunction.apply(this, [value]);
@@ -130,9 +130,8 @@ export class LocalNode {
130
130
  let last = start;
131
131
 
132
132
  while (!operational && start + this.MAXIMUM_WAIT_TIME_SEC > last) {
133
- // eslint-disable-next-line no-await-in-loop
134
133
  await sleep(1000);
135
- // eslint-disable-next-line no-await-in-loop
134
+
136
135
  operational = await this.checkIfProcessIsUp();
137
136
  last = Date.now() / 1000;
138
137
  }
@@ -161,7 +160,7 @@ export class LocalNode {
161
160
  return true;
162
161
  }
163
162
  return false;
164
- } catch (err: any) {
163
+ } catch {
165
164
  return false;
166
165
  }
167
166
  }
package/src/cli/move.ts CHANGED
@@ -353,7 +353,7 @@ export class Move {
353
353
  * @group Implementation
354
354
  * @category CLI
355
355
  */
356
- // eslint-disable-next-line class-methods-use-this
356
+
357
357
  private async runCommand(args: Array<string>, showStdout: boolean = true): Promise<{ result?: any; output: string }> {
358
358
  return new Promise((resolve, reject) => {
359
359
  const currentPlatform = platform();
@@ -391,7 +391,7 @@ export class Move {
391
391
  } else if (parsed.Result) {
392
392
  resolve({ result: parsed.Result, output: stdout }); // Resolve if the "Result" key exists
393
393
  }
394
- } catch (error: any) {
394
+ } catch {
395
395
  // resolve the stdout as it might be just a stdout
396
396
  resolve({ output: stdout });
397
397
  }
@@ -411,7 +411,7 @@ export class Move {
411
411
  * @group Implementation
412
412
  * @category CLI
413
413
  */
414
- // eslint-disable-next-line class-methods-use-this
414
+
415
415
  private prepareNamedAddresses(namedAddresses: Map<string, AccountAddress>): Array<string> {
416
416
  const totalNames = namedAddresses.size;
417
417
  const newArgs: Array<string> = [];
@@ -442,7 +442,7 @@ export class Move {
442
442
  * @group Implementation
443
443
  * @category CLI
444
444
  */
445
- // eslint-disable-next-line class-methods-use-this
445
+
446
446
  private parseNamedAddresses(namedAddresses: Record<string, AccountAddress>): Map<string, AccountAddress> {
447
447
  const addressesMap = new Map();
448
448
 
@@ -463,7 +463,7 @@ export class Move {
463
463
  * @group Implementation
464
464
  * @category CLI
465
465
  */
466
- // eslint-disable-next-line class-methods-use-this
466
+
467
467
  private extractAddressFromOutput(output: string): string {
468
468
  const match = output.match("Code was successfully deployed to object address (0x[0-9a-fA-F]+)");
469
469
  if (match) {
package/src/client/get.ts CHANGED
@@ -162,11 +162,10 @@ export async function getAptosPepperService<Req extends {}, Res extends {}>(
162
162
  export async function paginateWithCursor<Req extends Record<string, any>, Res extends Array<{}>>(
163
163
  options: GetAptosRequestOptions,
164
164
  ): Promise<Res> {
165
- const out: Res = new Array(0) as Res;
165
+ let out: Res = [] as unknown as Res;
166
166
  let cursor: string | undefined;
167
167
  const requestParams = options.params as { start?: string; limit?: number };
168
168
  do {
169
- // eslint-disable-next-line no-await-in-loop
170
169
  const response = await get<Req, Res>({
171
170
  type: AptosApiType.FULLNODE,
172
171
  aptosConfig: options.aptosConfig,
@@ -186,7 +185,8 @@ export async function paginateWithCursor<Req extends Record<string, any>, Res ex
186
185
  // Now that we have the cursor (if any), we remove the headers before
187
186
  // adding these to the output of this function.
188
187
  delete response.headers;
189
- out.push(...response.data);
188
+ // Use concat instead of push(...) for better performance with large arrays
189
+ out = out.concat(response.data) as Res;
190
190
  requestParams.start = cursor;
191
191
  } while (cursor !== null && cursor !== undefined);
192
192
  return out;
@@ -196,12 +196,11 @@ export async function paginateWithCursor<Req extends Record<string, any>, Res ex
196
196
  export async function paginateWithObfuscatedCursor<Req extends Record<string, any>, Res extends Array<{}>>(
197
197
  options: GetAptosRequestOptions,
198
198
  ): Promise<Res> {
199
- const out: Res = new Array(0) as Res;
199
+ let out: Res = [] as unknown as Res;
200
200
  let cursor: string | undefined;
201
201
  const requestParams = options.params as { start?: string; limit?: number };
202
202
  const totalLimit = requestParams.limit;
203
203
  do {
204
- // eslint-disable-next-line no-await-in-loop
205
204
  const { response, cursor: newCursor } = await getPageWithObfuscatedCursor<Req, Res>({ ...options });
206
205
 
207
206
  /**
@@ -210,7 +209,8 @@ export async function paginateWithObfuscatedCursor<Req extends Record<string, an
210
209
  * to query the next chunk of data.
211
210
  */
212
211
  cursor = newCursor;
213
- out.push(...response.data);
212
+ // Use concat instead of push(...) for better performance with large arrays
213
+ out = out.concat(response.data) as Res;
214
214
  if (options?.params) {
215
215
  options.params.start = cursor;
216
216
  }
@@ -230,8 +230,7 @@ export async function paginateWithObfuscatedCursor<Req extends Record<string, an
230
230
  export async function getPageWithObfuscatedCursor<Req extends Record<string, any>, Res extends Array<{}>>(
231
231
  options: GetAptosRequestOptions,
232
232
  ): Promise<{ response: AptosResponse<Req, Res>; cursor: string | undefined }> {
233
- let cursor: string | undefined;
234
- let requestParams: { start?: string; limit?: number } = {};
233
+ const requestParams: { start?: string; limit?: number } = {};
235
234
 
236
235
  // Drop any other values
237
236
  // TODO: Throw error if cursor is not a string
@@ -242,7 +241,6 @@ export async function getPageWithObfuscatedCursor<Req extends Record<string, any
242
241
  requestParams.limit = options.params.limit;
243
242
  }
244
243
 
245
- // eslint-disable-next-line no-await-in-loop
246
244
  const response = await get<Req, Res>({
247
245
  type: AptosApiType.FULLNODE,
248
246
  aptosConfig: options.aptosConfig,
@@ -257,6 +255,6 @@ export async function getPageWithObfuscatedCursor<Req extends Record<string, any
257
255
  * should not need to "care" what it represents but just use it
258
256
  * to query the next chunk of data.
259
257
  */
260
- cursor = response.headers["x-aptos-cursor"];
258
+ const cursor = response.headers["x-aptos-cursor"] ?? undefined;
261
259
  return { response, cursor };
262
260
  }
@@ -240,14 +240,14 @@ export class AccountAddress extends Serializable implements TransactionArgument
240
240
  /**
241
241
  * Serializes the current instance into a byte sequence suitable for entry functions.
242
242
  * This allows for the proper encoding of data when interacting with entry functions in the blockchain.
243
+ * Uses the optimized serializeAsBytes method to reduce allocations.
243
244
  *
244
245
  * @param serializer - The serializer instance used to convert the data into bytes.
245
246
  * @group Implementation
246
247
  * @category Serialization
247
248
  */
248
249
  serializeForEntryFunction(serializer: Serializer): void {
249
- const bcsBytes = this.bcsToBytes();
250
- serializer.serializeBytes(bcsBytes);
250
+ serializer.serializeAsBytes(this);
251
251
  }
252
252
 
253
253
  /**
@@ -339,7 +339,6 @@ export class AccountAddress extends Serializable implements TransactionArgument
339
339
  } else if (input.length !== 3) {
340
340
  // 0x + one hex char is the only valid SHORT form for special addresses.
341
341
  throw new ParsingError(
342
- // eslint-disable-next-line max-len
343
342
  `The given hex string ${input} is a special address not in LONG form, it must be 0x0 to 0xf without padding zeroes.`,
344
343
  AddressInvalidReason.INVALID_PADDING_ZEROES,
345
344
  );
@@ -35,17 +35,17 @@ export class AbstractPublicKey extends AccountPublicKey {
35
35
  return new AuthenticationKey({ data: this.accountAddress.toUint8Array() });
36
36
  }
37
37
 
38
- // eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars
38
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
39
39
  verifySignature(args: VerifySignatureArgs): boolean {
40
40
  throw new Error("This function is not implemented for AbstractPublicKey.");
41
41
  }
42
42
 
43
- // eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars
43
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
44
44
  async verifySignatureAsync(args: VerifySignatureAsyncArgs): Promise<boolean> {
45
45
  throw new Error("This function is not implemented for AbstractPublicKey.");
46
46
  }
47
47
 
48
- // eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars
48
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
49
49
  serialize(serializer: Serializer): void {
50
50
  throw new Error("This function is not implemented for AbstractPublicKey.");
51
51
  }
@@ -250,7 +250,13 @@ export class Ed25519PrivateKey extends Serializable implements PrivateKey {
250
250
  * @group Implementation
251
251
  * @category Serialization
252
252
  */
253
- private readonly signingKey: Hex;
253
+ private signingKey: Hex;
254
+
255
+ /**
256
+ * Whether the key has been cleared from memory
257
+ * @private
258
+ */
259
+ private cleared: boolean = false;
254
260
 
255
261
  // region Constructors
256
262
 
@@ -336,14 +342,63 @@ export class Ed25519PrivateKey extends Serializable implements PrivateKey {
336
342
 
337
343
  // region PrivateKey
338
344
 
345
+ /**
346
+ * Checks if the key has been cleared and throws an error if so.
347
+ * @private
348
+ */
349
+ private ensureNotCleared(): void {
350
+ if (this.cleared) {
351
+ throw new Error("Private key has been cleared from memory and can no longer be used");
352
+ }
353
+ }
354
+
355
+ /**
356
+ * Clears the private key from memory by overwriting it with random bytes.
357
+ * After calling this method, the private key can no longer be used for signing or deriving public keys.
358
+ *
359
+ * Note: Due to JavaScript's memory management, this cannot guarantee complete removal of
360
+ * sensitive data from memory, but it significantly reduces the window of exposure.
361
+ *
362
+ * @group Implementation
363
+ * @category Serialization
364
+ */
365
+ clear(): void {
366
+ if (!this.cleared) {
367
+ const keyBytes = this.signingKey.toUint8Array();
368
+ // Multiple overwrite passes for better security
369
+ // Pass 1: Random data
370
+ crypto.getRandomValues(keyBytes);
371
+ // Pass 2: Ones pattern (0xFF)
372
+ keyBytes.fill(0xff);
373
+ // Pass 3: Random data again
374
+ crypto.getRandomValues(keyBytes);
375
+ // Pass 4: Zeros pattern (final state)
376
+ keyBytes.fill(0);
377
+ this.cleared = true;
378
+ }
379
+ }
380
+
381
+ /**
382
+ * Returns whether the private key has been cleared from memory.
383
+ *
384
+ * @returns true if the key has been cleared, false otherwise
385
+ * @group Implementation
386
+ * @category Serialization
387
+ */
388
+ isCleared(): boolean {
389
+ return this.cleared;
390
+ }
391
+
339
392
  /**
340
393
  * Derive the Ed25519PublicKey for this private key.
341
394
  *
342
395
  * @returns Ed25519PublicKey - The derived public key corresponding to the private key.
396
+ * @throws Error if the private key has been cleared from memory.
343
397
  * @group Implementation
344
398
  * @category Serialization
345
399
  */
346
400
  publicKey(): Ed25519PublicKey {
401
+ this.ensureNotCleared();
347
402
  const bytes = ed25519.getPublicKey(this.signingKey.toUint8Array());
348
403
  return new Ed25519PublicKey(bytes);
349
404
  }
@@ -354,10 +409,12 @@ export class Ed25519PrivateKey extends Serializable implements PrivateKey {
354
409
  *
355
410
  * @param message - A message as a string or Uint8Array in HexInput format.
356
411
  * @returns A digital signature for the provided message.
412
+ * @throws Error if the private key has been cleared from memory.
357
413
  * @group Implementation
358
414
  * @category Serialization
359
415
  */
360
416
  sign(message: HexInput): Ed25519Signature {
417
+ this.ensureNotCleared();
361
418
  const messageToSign = convertSigningMessage(message);
362
419
  const messageBytes = Hex.fromHexInput(messageToSign).toUint8Array();
363
420
  const signatureBytes = ed25519.sign(messageBytes, this.signingKey.toUint8Array());
@@ -368,10 +425,12 @@ export class Ed25519PrivateKey extends Serializable implements PrivateKey {
368
425
  * Get the private key in bytes (Uint8Array).
369
426
  *
370
427
  * @returns Uint8Array representation of the private key
428
+ * @throws Error if the private key has been cleared from memory.
371
429
  * @group Implementation
372
430
  * @category Serialization
373
431
  */
374
432
  toUint8Array(): Uint8Array {
433
+ this.ensureNotCleared();
375
434
  return this.signingKey.toUint8Array();
376
435
  }
377
436
 
@@ -379,10 +438,12 @@ export class Ed25519PrivateKey extends Serializable implements PrivateKey {
379
438
  * Get the private key as a hex string with the 0x prefix.
380
439
  *
381
440
  * @returns string representation of the private key.
441
+ * @throws Error if the private key has been cleared from memory.
382
442
  * @group Implementation
383
443
  * @category Serialization
384
444
  */
385
445
  toString(): string {
446
+ this.ensureNotCleared();
386
447
  return this.toAIP80String();
387
448
  }
388
449
 
@@ -390,8 +451,10 @@ export class Ed25519PrivateKey extends Serializable implements PrivateKey {
390
451
  * Get the private key as a hex string with the 0x prefix.
391
452
  *
392
453
  * @returns string representation of the private key.
454
+ * @throws Error if the private key has been cleared from memory.
393
455
  */
394
456
  toHexString(): string {
457
+ this.ensureNotCleared();
395
458
  return this.signingKey.toString();
396
459
  }
397
460
 
@@ -401,8 +464,10 @@ export class Ed25519PrivateKey extends Serializable implements PrivateKey {
401
464
  * [Read about AIP-80](https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-80.md)
402
465
  *
403
466
  * @returns AIP-80 compliant string representation of the private key.
467
+ * @throws Error if the private key has been cleared from memory.
404
468
  */
405
469
  toAIP80String(): string {
470
+ this.ensureNotCleared();
406
471
  return PrivateKey.formatPrivateKey(this.signingKey.toString(), PrivateKeyVariants.Ed25519);
407
472
  }
408
473
 
@@ -84,7 +84,7 @@ export class FederatedKeylessPublicKey extends AccountPublicKey {
84
84
  try {
85
85
  verifyKeylessSignatureWithJwkAndConfig({ ...args, publicKey: this });
86
86
  return true;
87
- } catch (error) {
87
+ } catch {
88
88
  return false;
89
89
  }
90
90
  }