@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.
- package/README.md +9 -13
- package/dist/common/{account-Dpz_N9h-.d.ts → account-DGpxrkAn.d.ts} +187 -20
- package/dist/common/chunk-2VR6ONNW.js +4 -0
- package/dist/common/chunk-2VR6ONNW.js.map +1 -0
- package/dist/common/cli/index.d.ts +2 -2
- package/dist/common/cli/index.js +1 -1
- package/dist/common/cli/index.js.map +1 -1
- package/dist/common/index.d.ts +69 -6
- package/dist/common/index.js +34 -45
- package/dist/common/index.js.map +1 -1
- package/dist/esm/{Ed25519Account-BW_kXHC2.d.mts → Ed25519Account-BCt2cu_M.d.mts} +2 -2
- package/dist/esm/account/AbstractKeylessAccount.d.mts +3 -3
- package/dist/esm/account/AbstractKeylessAccount.mjs +1 -1
- package/dist/esm/account/AbstractedAccount.d.mts +2 -2
- package/dist/esm/account/AbstractedAccount.mjs +1 -1
- package/dist/esm/account/Account.d.mts +2 -2
- package/dist/esm/account/Account.mjs +1 -1
- package/dist/esm/account/AccountUtils.d.mts +3 -3
- package/dist/esm/account/AccountUtils.mjs +1 -1
- package/dist/esm/account/DerivableAbstractedAccount.d.mts +2 -2
- package/dist/esm/account/DerivableAbstractedAccount.mjs +1 -1
- package/dist/esm/account/Ed25519Account.d.mts +2 -2
- package/dist/esm/account/Ed25519Account.mjs +1 -1
- package/dist/esm/account/EphemeralKeyPair.d.mts +26 -2
- package/dist/esm/account/EphemeralKeyPair.mjs +1 -1
- package/dist/esm/account/FederatedKeylessAccount.d.mts +3 -3
- package/dist/esm/account/FederatedKeylessAccount.mjs +1 -1
- package/dist/esm/account/KeylessAccount.d.mts +3 -3
- package/dist/esm/account/KeylessAccount.mjs +1 -1
- package/dist/esm/account/MultiEd25519Account.d.mts +2 -2
- package/dist/esm/account/MultiEd25519Account.mjs +1 -1
- package/dist/esm/account/MultiKeyAccount.d.mts +3 -3
- package/dist/esm/account/MultiKeyAccount.mjs +1 -1
- package/dist/esm/account/SingleKeyAccount.d.mts +2 -2
- package/dist/esm/account/SingleKeyAccount.mjs +1 -1
- package/dist/esm/account/index.d.mts +3 -3
- package/dist/esm/account/index.mjs +1 -1
- package/dist/esm/account/utils.d.mts +1 -1
- package/dist/esm/account/utils.mjs +1 -1
- package/dist/esm/{account-CcxnCdYZ.d.mts → account-Dg0ejXHy.d.mts} +172 -8
- package/dist/esm/api/account/abstraction.d.mts +1 -1
- package/dist/esm/api/account/abstraction.mjs +1 -1
- package/dist/esm/api/account.d.mts +2 -2
- package/dist/esm/api/account.mjs +1 -1
- package/dist/esm/api/ans.d.mts +1 -1
- package/dist/esm/api/ans.mjs +1 -1
- package/dist/esm/api/aptos.d.mts +3 -3
- package/dist/esm/api/aptos.mjs +1 -1
- package/dist/esm/api/aptosConfig.d.mts +1 -1
- package/dist/esm/api/aptosConfig.mjs +1 -1
- package/dist/esm/api/coin.d.mts +1 -1
- package/dist/esm/api/coin.mjs +1 -1
- package/dist/esm/api/digitalAsset.d.mts +2 -2
- package/dist/esm/api/digitalAsset.mjs +1 -1
- package/dist/esm/api/faucet.d.mts +1 -1
- package/dist/esm/api/faucet.mjs +1 -1
- package/dist/esm/api/fungibleAsset.d.mts +2 -2
- package/dist/esm/api/fungibleAsset.mjs +1 -1
- package/dist/esm/api/general.d.mts +1 -1
- package/dist/esm/api/general.mjs +1 -1
- package/dist/esm/api/index.d.mts +3 -3
- package/dist/esm/api/index.mjs +1 -1
- package/dist/esm/api/keyless.d.mts +3 -3
- package/dist/esm/api/keyless.mjs +1 -1
- package/dist/esm/api/object.d.mts +1 -1
- package/dist/esm/api/object.mjs +1 -1
- package/dist/esm/api/staking.d.mts +1 -1
- package/dist/esm/api/staking.mjs +1 -1
- package/dist/esm/api/table.d.mts +1 -1
- package/dist/esm/api/table.mjs +1 -1
- package/dist/esm/api/transaction.d.mts +2 -2
- package/dist/esm/api/transaction.mjs +1 -1
- package/dist/esm/api/transactionSubmission/build.d.mts +1 -1
- package/dist/esm/api/transactionSubmission/build.mjs +1 -1
- package/dist/esm/api/transactionSubmission/helpers.d.mts +1 -1
- package/dist/esm/api/transactionSubmission/helpers.mjs +1 -1
- package/dist/esm/api/transactionSubmission/management.d.mts +2 -2
- package/dist/esm/api/transactionSubmission/management.mjs +1 -1
- package/dist/esm/api/transactionSubmission/sign.d.mts +2 -2
- package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
- package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -1
- package/dist/esm/api/transactionSubmission/simulate.d.mts +1 -1
- package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
- package/dist/esm/api/transactionSubmission/submit.d.mts +1 -1
- package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
- package/dist/esm/api/utils.d.mts +1 -1
- package/dist/esm/api/utils.mjs +1 -1
- package/dist/esm/bcs/consts.d.mts +1 -1
- package/dist/esm/bcs/deserializer.d.mts +1 -1
- package/dist/esm/bcs/deserializer.mjs +1 -1
- package/dist/esm/bcs/index.d.mts +1 -1
- package/dist/esm/bcs/index.mjs +1 -1
- package/dist/esm/bcs/serializable/entryFunctionBytes.d.mts +1 -1
- package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -1
- package/dist/esm/bcs/serializable/fixedBytes.d.mts +1 -1
- package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -1
- package/dist/esm/bcs/serializable/movePrimitives.d.mts +1 -1
- package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
- package/dist/esm/bcs/serializable/moveStructs.d.mts +1 -1
- package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
- package/dist/esm/bcs/serializer.d.mts +1 -1
- package/dist/esm/bcs/serializer.mjs +1 -1
- package/dist/esm/{chunk-5FNZUL2Y.mjs → chunk-2VBY2V4Z.mjs} +2 -2
- package/dist/esm/chunk-2VHA77EO.mjs +2 -0
- package/dist/esm/chunk-2VHA77EO.mjs.map +1 -0
- package/dist/esm/{chunk-35DKMW7Q.mjs → chunk-44MMFX5F.mjs} +1 -1
- package/dist/esm/chunk-44MMFX5F.mjs.map +1 -0
- package/dist/esm/chunk-5HHC2YG4.mjs +2 -0
- package/dist/esm/chunk-5LMLIRGK.mjs +2 -0
- package/dist/esm/chunk-5LMLIRGK.mjs.map +1 -0
- package/dist/esm/chunk-66F7RP7K.mjs +2 -0
- package/dist/esm/chunk-66F7RP7K.mjs.map +1 -0
- package/dist/esm/chunk-6CD6PDFJ.mjs +4 -0
- package/dist/esm/chunk-6CD6PDFJ.mjs.map +1 -0
- package/dist/esm/{chunk-FW6UHAQV.mjs → chunk-A7SQEK23.mjs} +2 -2
- package/dist/esm/chunk-A7SQEK23.mjs.map +1 -0
- package/dist/esm/{chunk-G3HAIETV.mjs → chunk-ASFFADWS.mjs} +2 -2
- package/dist/esm/chunk-ASFFADWS.mjs.map +1 -0
- package/dist/esm/chunk-AUGTNOKZ.mjs +2 -0
- package/dist/esm/{chunk-RQN6LA7E.mjs.map → chunk-AUGTNOKZ.mjs.map} +1 -1
- package/dist/esm/chunk-BT742BFQ.mjs +2 -0
- package/dist/esm/chunk-BT742BFQ.mjs.map +1 -0
- package/dist/esm/chunk-C2KVLMPH.mjs +2 -0
- package/dist/esm/chunk-C2KVLMPH.mjs.map +1 -0
- package/dist/esm/{chunk-DIFSO4N6.mjs → chunk-CD3EZCI5.mjs} +2 -2
- package/dist/esm/{chunk-43LWUUXS.mjs → chunk-E3DHFXN4.mjs} +2 -2
- package/dist/esm/{chunk-QDJDZ3ON.mjs → chunk-EIWPAECI.mjs} +2 -2
- package/dist/esm/{chunk-GOXRBEIJ.mjs → chunk-F45HI7LU.mjs} +1 -1
- package/dist/esm/chunk-F45HI7LU.mjs.map +1 -0
- package/dist/esm/chunk-F4LHBGG2.mjs +2 -0
- package/dist/esm/chunk-F4LHBGG2.mjs.map +1 -0
- package/dist/esm/{chunk-MEG27LEV.mjs → chunk-FDHHQUS3.mjs} +3 -3
- package/dist/esm/chunk-FDHHQUS3.mjs.map +1 -0
- package/dist/esm/{chunk-LS2HRAVW.mjs → chunk-G5OONGWS.mjs} +1 -12
- package/dist/esm/chunk-G5OONGWS.mjs.map +1 -0
- package/dist/esm/{chunk-F3NI6N7R.mjs → chunk-H2T2SU5O.mjs} +2 -2
- package/dist/esm/chunk-H2T2SU5O.mjs.map +1 -0
- package/dist/esm/chunk-ITZN23GU.mjs +2 -0
- package/dist/esm/{chunk-X674XJNJ.mjs → chunk-KOVWYU53.mjs} +2 -2
- package/dist/esm/{chunk-PXJEKGEG.mjs → chunk-LDK76MDN.mjs} +2 -2
- package/dist/esm/chunk-M65PXVDO.mjs +2 -0
- package/dist/esm/chunk-M65PXVDO.mjs.map +1 -0
- package/dist/esm/{chunk-WZ6FL7CH.mjs → chunk-NWP2VEMB.mjs} +2 -2
- package/dist/esm/chunk-ODNZJSOC.mjs +2 -0
- package/dist/esm/chunk-ODNZJSOC.mjs.map +1 -0
- package/dist/esm/{chunk-6IWGTO2J.mjs → chunk-POQ4FT4E.mjs} +2 -2
- package/dist/esm/{chunk-76SVQZDX.mjs → chunk-Q4KYBAYN.mjs} +2 -2
- package/dist/esm/chunk-Q5ESW36C.mjs +2 -0
- package/dist/esm/chunk-Q5ESW36C.mjs.map +1 -0
- package/dist/esm/{chunk-52PWWLJJ.mjs → chunk-QRW7MQDA.mjs} +2 -2
- package/dist/esm/chunk-QRW7MQDA.mjs.map +1 -0
- package/dist/esm/{chunk-3P474TWM.mjs → chunk-R7PCBRRT.mjs} +2 -2
- package/dist/esm/chunk-T32P4APJ.mjs +2 -0
- package/dist/esm/chunk-T32P4APJ.mjs.map +1 -0
- package/dist/esm/chunk-TAHLOBRG.mjs +2 -0
- package/dist/esm/chunk-TAHLOBRG.mjs.map +1 -0
- package/dist/esm/{chunk-RYOICF37.mjs → chunk-TSPG5VED.mjs} +2 -2
- package/dist/esm/{chunk-56IXVVXX.mjs → chunk-UPHD2B4I.mjs} +2 -2
- package/dist/esm/{chunk-QREVMGQZ.mjs → chunk-UVJW4DPP.mjs} +1 -1
- package/dist/esm/{chunk-QREVMGQZ.mjs.map → chunk-UVJW4DPP.mjs.map} +1 -1
- package/dist/esm/chunk-UYG4XVVO.mjs +2 -0
- package/dist/esm/chunk-UYG4XVVO.mjs.map +1 -0
- package/dist/esm/chunk-WFZFTRRS.mjs +2 -0
- package/dist/esm/chunk-WFZFTRRS.mjs.map +1 -0
- package/dist/esm/{chunk-CUXCVNES.mjs → chunk-X4IR6WX6.mjs} +2 -2
- package/dist/esm/chunk-YJVBGKWM.mjs +2 -0
- package/dist/esm/chunk-YJVBGKWM.mjs.map +1 -0
- package/dist/esm/{chunk-NTLOKAPD.mjs → chunk-YTFJ5W7U.mjs} +2 -2
- package/dist/esm/cli/index.d.mts +2 -2
- package/dist/esm/cli/index.mjs +1 -1
- package/dist/esm/cli/localNode.d.mts +1 -1
- package/dist/esm/cli/localNode.mjs +1 -1
- package/dist/esm/cli/move.d.mts +1 -1
- package/dist/esm/cli/move.mjs +1 -1
- package/dist/esm/client/core.d.mts +1 -1
- package/dist/esm/client/core.mjs +1 -1
- package/dist/esm/client/get.d.mts +1 -1
- package/dist/esm/client/get.mjs +1 -1
- package/dist/esm/client/index.d.mts +1 -1
- package/dist/esm/client/index.mjs +1 -1
- package/dist/esm/client/post.d.mts +1 -1
- package/dist/esm/client/post.mjs +1 -1
- package/dist/esm/core/account/index.d.mts +1 -1
- package/dist/esm/core/account/index.mjs +1 -1
- package/dist/esm/core/account/utils/address.d.mts +1 -1
- package/dist/esm/core/account/utils/address.mjs +1 -1
- package/dist/esm/core/account/utils/index.d.mts +1 -1
- package/dist/esm/core/account/utils/index.mjs +1 -1
- package/dist/esm/core/accountAddress.d.mts +1 -1
- package/dist/esm/core/accountAddress.mjs +1 -1
- package/dist/esm/core/authenticationKey.d.mts +1 -1
- package/dist/esm/core/authenticationKey.mjs +1 -1
- package/dist/esm/core/crypto/abstraction.d.mts +1 -1
- package/dist/esm/core/crypto/abstraction.mjs +1 -1
- package/dist/esm/core/crypto/deserializationUtils.d.mts +1 -1
- package/dist/esm/core/crypto/deserializationUtils.mjs +1 -1
- package/dist/esm/core/crypto/ed25519.d.mts +1 -1
- package/dist/esm/core/crypto/ed25519.mjs +1 -1
- package/dist/esm/core/crypto/ephemeral.d.mts +1 -1
- package/dist/esm/core/crypto/ephemeral.mjs +1 -1
- package/dist/esm/core/crypto/federatedKeyless.d.mts +2 -2
- package/dist/esm/core/crypto/federatedKeyless.mjs +1 -1
- package/dist/esm/core/crypto/index.d.mts +2 -2
- package/dist/esm/core/crypto/index.mjs +1 -1
- package/dist/esm/core/crypto/keyless.d.mts +2 -2
- package/dist/esm/core/crypto/keyless.mjs +1 -1
- package/dist/esm/core/crypto/multiEd25519.d.mts +1 -1
- package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
- package/dist/esm/core/crypto/multiKey.d.mts +1 -1
- package/dist/esm/core/crypto/multiKey.mjs +1 -1
- package/dist/esm/core/crypto/poseidon.mjs +1 -1
- package/dist/esm/core/crypto/privateKey.d.mts +1 -1
- package/dist/esm/core/crypto/privateKey.mjs +1 -1
- package/dist/esm/core/crypto/proof.d.mts +1 -1
- package/dist/esm/core/crypto/proof.mjs +1 -1
- package/dist/esm/core/crypto/publicKey.d.mts +1 -1
- package/dist/esm/core/crypto/publicKey.mjs +1 -1
- package/dist/esm/core/crypto/secp256k1.d.mts +1 -1
- package/dist/esm/core/crypto/secp256k1.mjs +1 -1
- package/dist/esm/core/crypto/secp256r1.d.mts +1 -1
- package/dist/esm/core/crypto/secp256r1.mjs +1 -1
- package/dist/esm/core/crypto/signature.d.mts +1 -1
- package/dist/esm/core/crypto/signature.mjs +1 -1
- package/dist/esm/core/crypto/singleKey.d.mts +1 -1
- package/dist/esm/core/crypto/singleKey.mjs +1 -1
- package/dist/esm/core/crypto/types.d.mts +1 -1
- package/dist/esm/core/crypto/utils.d.mts +1 -1
- package/dist/esm/core/crypto/utils.mjs +1 -1
- package/dist/esm/core/hex.d.mts +1 -1
- package/dist/esm/core/index.d.mts +2 -2
- package/dist/esm/core/index.mjs +1 -1
- package/dist/esm/errors/index.d.mts +1 -1
- package/dist/esm/errors/index.mjs +1 -1
- package/dist/esm/{federatedKeyless-BzaYmP03.d.mts → federatedKeyless-BYLu31Sa.d.mts} +13 -2
- package/dist/esm/index.d.mts +5 -5
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/internal/abstraction.d.mts +1 -1
- package/dist/esm/internal/abstraction.mjs +1 -1
- package/dist/esm/internal/account.d.mts +3 -3
- package/dist/esm/internal/account.mjs +1 -1
- package/dist/esm/internal/ans.d.mts +2 -2
- package/dist/esm/internal/ans.mjs +1 -1
- package/dist/esm/internal/coin.d.mts +1 -1
- package/dist/esm/internal/coin.mjs +1 -1
- package/dist/esm/internal/digitalAsset.d.mts +3 -3
- package/dist/esm/internal/digitalAsset.mjs +1 -1
- package/dist/esm/internal/faucet.d.mts +1 -1
- package/dist/esm/internal/faucet.mjs +1 -1
- package/dist/esm/internal/fungibleAsset.d.mts +4 -4
- package/dist/esm/internal/fungibleAsset.mjs +1 -1
- package/dist/esm/internal/general.d.mts +4 -2
- package/dist/esm/internal/general.mjs +1 -1
- package/dist/esm/internal/keyless.d.mts +3 -3
- package/dist/esm/internal/keyless.mjs +1 -1
- package/dist/esm/internal/object.d.mts +1 -1
- package/dist/esm/internal/object.mjs +1 -1
- package/dist/esm/internal/staking.d.mts +2 -2
- package/dist/esm/internal/staking.mjs +1 -1
- package/dist/esm/internal/table.d.mts +1 -1
- package/dist/esm/internal/table.mjs +1 -1
- package/dist/esm/internal/transaction.d.mts +1 -1
- package/dist/esm/internal/transaction.mjs +1 -1
- package/dist/esm/internal/transactionSubmission.d.mts +2 -2
- package/dist/esm/internal/transactionSubmission.mjs +1 -1
- package/dist/esm/internal/utils/index.d.mts +1 -1
- package/dist/esm/internal/utils/index.mjs +1 -1
- package/dist/esm/internal/utils/utils.d.mts +1 -1
- package/dist/esm/internal/utils/utils.mjs +1 -1
- package/dist/esm/internal/view.d.mts +1 -1
- package/dist/esm/internal/view.mjs +1 -1
- package/dist/esm/transactions/authenticator/account.d.mts +1 -1
- package/dist/esm/transactions/authenticator/account.mjs +1 -1
- package/dist/esm/transactions/authenticator/index.d.mts +1 -1
- package/dist/esm/transactions/authenticator/index.mjs +1 -1
- package/dist/esm/transactions/authenticator/transaction.d.mts +1 -1
- package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
- package/dist/esm/transactions/index.d.mts +1 -1
- package/dist/esm/transactions/index.mjs +1 -1
- package/dist/esm/transactions/instances/chainId.d.mts +1 -1
- package/dist/esm/transactions/instances/chainId.mjs +1 -1
- package/dist/esm/transactions/instances/identifier.d.mts +1 -1
- package/dist/esm/transactions/instances/identifier.mjs +1 -1
- package/dist/esm/transactions/instances/index.d.mts +1 -1
- package/dist/esm/transactions/instances/index.mjs +1 -1
- package/dist/esm/transactions/instances/moduleId.d.mts +1 -1
- package/dist/esm/transactions/instances/moduleId.mjs +1 -1
- package/dist/esm/transactions/instances/multiAgentTransaction.d.mts +1 -1
- package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/rawTransaction.d.mts +1 -1
- package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/rotationProofChallenge.d.mts +1 -1
- package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
- package/dist/esm/transactions/instances/signedTransaction.d.mts +1 -1
- package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/simpleTransaction.d.mts +1 -1
- package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/transactionArgument.d.mts +1 -1
- package/dist/esm/transactions/instances/transactionPayload.d.mts +1 -1
- package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
- package/dist/esm/transactions/management/accountSequenceNumber.d.mts +2 -2
- package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
- package/dist/esm/transactions/management/index.d.mts +2 -2
- package/dist/esm/transactions/management/index.mjs +1 -1
- package/dist/esm/transactions/management/transactionWorker.d.mts +12 -4
- package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/helpers.d.mts +1 -1
- package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/index.d.mts +1 -1
- package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +2 -1
- package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/signingMessage.d.mts +1 -1
- package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +1 -1
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
- package/dist/esm/transactions/typeTag/index.d.mts +1 -1
- package/dist/esm/transactions/typeTag/index.mjs +1 -1
- package/dist/esm/transactions/typeTag/parser.d.mts +1 -1
- package/dist/esm/transactions/typeTag/parser.mjs +1 -1
- package/dist/esm/transactions/types.d.mts +1 -1
- package/dist/esm/types/generated/operations.d.mts +0 -11
- package/dist/esm/types/generated/queries.d.mts +1 -1
- package/dist/esm/types/generated/queries.mjs +1 -1
- package/dist/esm/types/index.d.mts +1 -1
- package/dist/esm/types/index.mjs +1 -1
- package/dist/esm/types/indexer.d.mts +1 -1
- package/dist/esm/types/types.d.mts +1 -1
- package/dist/esm/types/types.mjs +1 -1
- package/dist/esm/utils/const.d.mts +16 -2
- package/dist/esm/utils/const.mjs +1 -1
- package/dist/esm/utils/helpers.d.mts +21 -2
- package/dist/esm/utils/helpers.mjs +1 -1
- package/dist/esm/utils/index.d.mts +3 -3
- package/dist/esm/utils/index.mjs +1 -1
- package/dist/esm/utils/memoize.d.mts +23 -1
- package/dist/esm/utils/memoize.mjs +1 -1
- package/dist/esm/utils/normalizeBundle.d.mts +1 -1
- package/dist/esm/utils/normalizeBundle.mjs +1 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +36 -50
- package/src/account/AbstractKeylessAccount.ts +2 -3
- package/src/account/DerivableAbstractedAccount.ts +1 -3
- package/src/account/EphemeralKeyPair.ts +53 -2
- package/src/account/MultiEd25519Account.ts +0 -2
- package/src/account/MultiKeyAccount.ts +0 -2
- package/src/account/SingleKeyAccount.ts +0 -1
- package/src/api/account.ts +1 -2
- package/src/api/ans.ts +0 -1
- package/src/api/aptos.ts +1 -1
- package/src/api/aptosConfig.ts +12 -1
- package/src/api/transaction.ts +4 -4
- package/src/api/transactionSubmission/build.ts +1 -5
- package/src/api/transactionSubmission/helpers.ts +0 -1
- package/src/api/transactionSubmission/sign.ts +2 -2
- package/src/bcs/deserializer.ts +64 -17
- package/src/bcs/serializable/movePrimitives.ts +15 -28
- package/src/bcs/serializable/moveStructs.ts +4 -6
- package/src/bcs/serializer.ts +147 -12
- package/src/cli/localNode.ts +4 -7
- package/src/cli/move.ts +7 -7
- package/src/client/get.ts +8 -10
- package/src/core/account/utils/address.ts +3 -3
- package/src/core/accountAddress.ts +2 -3
- package/src/core/crypto/abstraction.ts +0 -3
- package/src/core/crypto/ed25519.ts +66 -1
- package/src/core/crypto/federatedKeyless.ts +1 -1
- package/src/core/crypto/keyless.ts +65 -14
- package/src/core/crypto/multiEd25519.ts +1 -3
- package/src/core/crypto/multiKey.ts +4 -7
- package/src/core/crypto/poseidon.ts +0 -1
- package/src/core/crypto/privateKey.ts +2 -5
- package/src/core/crypto/secp256k1.ts +68 -3
- package/src/core/crypto/secp256r1.ts +1 -1
- package/src/core/crypto/singleKey.ts +4 -1
- package/src/core/crypto/utils.ts +6 -3
- package/src/errors/index.ts +4 -5
- package/src/internal/account.ts +21 -30
- package/src/internal/ans.ts +5 -6
- package/src/internal/general.ts +24 -6
- package/src/internal/keyless.ts +1 -1
- package/src/internal/queries/getAccountAddressesForAuthKey.graphql +4 -1
- package/src/internal/queries/getAuthKeysForPublicKey.graphql +4 -1
- package/src/internal/queries/getCollectionData.graphql +0 -11
- package/src/internal/queries/getTableItemsData.graphql +1 -1
- package/src/internal/queries/getTableItemsMetadata.graphql +2 -2
- package/src/internal/transaction.ts +5 -7
- package/src/internal/transactionSubmission.ts +23 -0
- package/src/transactions/authenticator/account.ts +0 -4
- package/src/transactions/authenticator/transaction.ts +0 -2
- package/src/transactions/instances/multiAgentTransaction.ts +0 -2
- package/src/transactions/instances/rawTransaction.ts +0 -2
- package/src/transactions/instances/signedTransaction.ts +0 -2
- package/src/transactions/instances/simpleTransaction.ts +0 -2
- package/src/transactions/instances/transactionPayload.ts +5 -7
- package/src/transactions/management/accountSequenceNumber.ts +0 -4
- package/src/transactions/management/transactionWorker.ts +40 -10
- package/src/transactions/transactionBuilder/remoteAbi.ts +22 -8
- package/src/transactions/transactionBuilder/transactionBuilder.ts +14 -12
- package/src/transactions/typeTag/index.ts +0 -3
- package/src/transactions/typeTag/parser.ts +3 -5
- package/src/types/generated/operations.ts +0 -11
- package/src/types/generated/queries.ts +0 -11
- package/src/types/types.ts +26 -0
- package/src/utils/const.ts +17 -1
- package/src/utils/helpers.ts +47 -8
- package/src/utils/memoize.ts +177 -11
- package/src/version.ts +1 -1
- package/dist/common/chunk-4RHBBU7C.js +0 -4
- package/dist/common/chunk-4RHBBU7C.js.map +0 -1
- package/dist/esm/chunk-2DPQMXUG.mjs +0 -4
- package/dist/esm/chunk-2DPQMXUG.mjs.map +0 -1
- package/dist/esm/chunk-2LCPW76G.mjs +0 -2
- package/dist/esm/chunk-2LCPW76G.mjs.map +0 -1
- package/dist/esm/chunk-2PASUPUO.mjs +0 -2
- package/dist/esm/chunk-2PASUPUO.mjs.map +0 -1
- package/dist/esm/chunk-35DKMW7Q.mjs.map +0 -1
- package/dist/esm/chunk-52PWWLJJ.mjs.map +0 -1
- package/dist/esm/chunk-54C2P534.mjs +0 -2
- package/dist/esm/chunk-54C2P534.mjs.map +0 -1
- package/dist/esm/chunk-BGZDJ5SM.mjs +0 -2
- package/dist/esm/chunk-BGZDJ5SM.mjs.map +0 -1
- package/dist/esm/chunk-C5UZZHA4.mjs +0 -2
- package/dist/esm/chunk-C5UZZHA4.mjs.map +0 -1
- package/dist/esm/chunk-F3NI6N7R.mjs.map +0 -1
- package/dist/esm/chunk-FW6UHAQV.mjs.map +0 -1
- package/dist/esm/chunk-G3HAIETV.mjs.map +0 -1
- package/dist/esm/chunk-GOXRBEIJ.mjs.map +0 -1
- package/dist/esm/chunk-I42Z32Q2.mjs +0 -2
- package/dist/esm/chunk-I42Z32Q2.mjs.map +0 -1
- package/dist/esm/chunk-JN65XG2P.mjs +0 -2
- package/dist/esm/chunk-JN65XG2P.mjs.map +0 -1
- package/dist/esm/chunk-KUF4DKN5.mjs +0 -2
- package/dist/esm/chunk-LD3I4CYO.mjs +0 -2
- package/dist/esm/chunk-LS2HRAVW.mjs.map +0 -1
- package/dist/esm/chunk-MEG27LEV.mjs.map +0 -1
- package/dist/esm/chunk-NCKJ7X57.mjs +0 -2
- package/dist/esm/chunk-NCKJ7X57.mjs.map +0 -1
- package/dist/esm/chunk-NK3Y3PV3.mjs +0 -2
- package/dist/esm/chunk-NK3Y3PV3.mjs.map +0 -1
- package/dist/esm/chunk-OLILO7VD.mjs +0 -2
- package/dist/esm/chunk-OLILO7VD.mjs.map +0 -1
- package/dist/esm/chunk-PYVKCTUN.mjs +0 -2
- package/dist/esm/chunk-PYVKCTUN.mjs.map +0 -1
- package/dist/esm/chunk-QEHKRR3I.mjs +0 -2
- package/dist/esm/chunk-QEHKRR3I.mjs.map +0 -1
- package/dist/esm/chunk-RQN6LA7E.mjs +0 -2
- package/dist/esm/chunk-Y426VCPM.mjs +0 -2
- package/dist/esm/chunk-Y426VCPM.mjs.map +0 -1
- package/dist/esm/chunk-YOZBVVKL.mjs +0 -2
- package/dist/esm/chunk-YOZBVVKL.mjs.map +0 -1
- /package/dist/esm/{chunk-5FNZUL2Y.mjs.map → chunk-2VBY2V4Z.mjs.map} +0 -0
- /package/dist/esm/{chunk-KUF4DKN5.mjs.map → chunk-5HHC2YG4.mjs.map} +0 -0
- /package/dist/esm/{chunk-DIFSO4N6.mjs.map → chunk-CD3EZCI5.mjs.map} +0 -0
- /package/dist/esm/{chunk-43LWUUXS.mjs.map → chunk-E3DHFXN4.mjs.map} +0 -0
- /package/dist/esm/{chunk-QDJDZ3ON.mjs.map → chunk-EIWPAECI.mjs.map} +0 -0
- /package/dist/esm/{chunk-LD3I4CYO.mjs.map → chunk-ITZN23GU.mjs.map} +0 -0
- /package/dist/esm/{chunk-X674XJNJ.mjs.map → chunk-KOVWYU53.mjs.map} +0 -0
- /package/dist/esm/{chunk-PXJEKGEG.mjs.map → chunk-LDK76MDN.mjs.map} +0 -0
- /package/dist/esm/{chunk-WZ6FL7CH.mjs.map → chunk-NWP2VEMB.mjs.map} +0 -0
- /package/dist/esm/{chunk-6IWGTO2J.mjs.map → chunk-POQ4FT4E.mjs.map} +0 -0
- /package/dist/esm/{chunk-76SVQZDX.mjs.map → chunk-Q4KYBAYN.mjs.map} +0 -0
- /package/dist/esm/{chunk-3P474TWM.mjs.map → chunk-R7PCBRRT.mjs.map} +0 -0
- /package/dist/esm/{chunk-RYOICF37.mjs.map → chunk-TSPG5VED.mjs.map} +0 -0
- /package/dist/esm/{chunk-56IXVVXX.mjs.map → chunk-UPHD2B4I.mjs.map} +0 -0
- /package/dist/esm/{chunk-CUXCVNES.mjs.map → chunk-X4IR6WX6.mjs.map} +0 -0
- /package/dist/esm/{chunk-NTLOKAPD.mjs.map → chunk-YTFJ5W7U.mjs.map} +0 -0
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// Copyright © Aptos Foundation
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
|
|
4
3
|
import {
|
|
5
4
|
MAX_U128_BIG_INT,
|
|
6
5
|
MAX_U16_NUMBER,
|
|
@@ -77,14 +76,14 @@ export class Bool extends Serializable implements TransactionArgument {
|
|
|
77
76
|
/**
|
|
78
77
|
* Serializes the current instance for use in an entry function by converting it to a byte sequence.
|
|
79
78
|
* This allows the instance to be properly formatted for serialization in transactions.
|
|
79
|
+
* Uses the optimized serializeAsBytes method to reduce allocations.
|
|
80
80
|
*
|
|
81
81
|
* @param serializer - The serializer instance used to serialize the byte sequence.
|
|
82
82
|
* @group Implementation
|
|
83
83
|
* @category BCS
|
|
84
84
|
*/
|
|
85
85
|
serializeForEntryFunction(serializer: Serializer): void {
|
|
86
|
-
|
|
87
|
-
serializer.serializeBytes(bcsBytes);
|
|
86
|
+
serializer.serializeAsBytes(this);
|
|
88
87
|
}
|
|
89
88
|
|
|
90
89
|
/**
|
|
@@ -107,7 +106,7 @@ export class Bool extends Serializable implements TransactionArgument {
|
|
|
107
106
|
* @group Implementation
|
|
108
107
|
* @category BCS
|
|
109
108
|
*/
|
|
110
|
-
|
|
109
|
+
|
|
111
110
|
deserialize(deserializer: Deserializer) {
|
|
112
111
|
return new U256(deserializer.deserializeU256());
|
|
113
112
|
}
|
|
@@ -139,8 +138,7 @@ export class U8 extends Serializable implements TransactionArgument {
|
|
|
139
138
|
}
|
|
140
139
|
|
|
141
140
|
serializeForEntryFunction(serializer: Serializer): void {
|
|
142
|
-
|
|
143
|
-
serializer.serializeBytes(bcsBytes);
|
|
141
|
+
serializer.serializeAsBytes(this);
|
|
144
142
|
}
|
|
145
143
|
|
|
146
144
|
serializeForScriptFunction(serializer: Serializer): void {
|
|
@@ -176,8 +174,7 @@ export class U16 extends Serializable implements TransactionArgument {
|
|
|
176
174
|
}
|
|
177
175
|
|
|
178
176
|
serializeForEntryFunction(serializer: Serializer): void {
|
|
179
|
-
|
|
180
|
-
serializer.serializeBytes(bcsBytes);
|
|
177
|
+
serializer.serializeAsBytes(this);
|
|
181
178
|
}
|
|
182
179
|
|
|
183
180
|
serializeForScriptFunction(serializer: Serializer): void {
|
|
@@ -212,8 +209,7 @@ export class U32 extends Serializable implements TransactionArgument {
|
|
|
212
209
|
}
|
|
213
210
|
|
|
214
211
|
serializeForEntryFunction(serializer: Serializer): void {
|
|
215
|
-
|
|
216
|
-
serializer.serializeBytes(bcsBytes);
|
|
212
|
+
serializer.serializeAsBytes(this);
|
|
217
213
|
}
|
|
218
214
|
|
|
219
215
|
serializeForScriptFunction(serializer: Serializer): void {
|
|
@@ -251,8 +247,7 @@ export class U64 extends Serializable implements TransactionArgument {
|
|
|
251
247
|
}
|
|
252
248
|
|
|
253
249
|
serializeForEntryFunction(serializer: Serializer): void {
|
|
254
|
-
|
|
255
|
-
serializer.serializeBytes(bcsBytes);
|
|
250
|
+
serializer.serializeAsBytes(this);
|
|
256
251
|
}
|
|
257
252
|
|
|
258
253
|
serializeForScriptFunction(serializer: Serializer): void {
|
|
@@ -288,8 +283,7 @@ export class U128 extends Serializable implements TransactionArgument {
|
|
|
288
283
|
}
|
|
289
284
|
|
|
290
285
|
serializeForEntryFunction(serializer: Serializer): void {
|
|
291
|
-
|
|
292
|
-
serializer.serializeBytes(bcsBytes);
|
|
286
|
+
serializer.serializeAsBytes(this);
|
|
293
287
|
}
|
|
294
288
|
|
|
295
289
|
serializeForScriptFunction(serializer: Serializer): void {
|
|
@@ -325,8 +319,7 @@ export class U256 extends Serializable implements TransactionArgument {
|
|
|
325
319
|
}
|
|
326
320
|
|
|
327
321
|
serializeForEntryFunction(serializer: Serializer): void {
|
|
328
|
-
|
|
329
|
-
serializer.serializeBytes(bcsBytes);
|
|
322
|
+
serializer.serializeAsBytes(this);
|
|
330
323
|
}
|
|
331
324
|
|
|
332
325
|
serializeForScriptFunction(serializer: Serializer): void {
|
|
@@ -361,8 +354,7 @@ export class I8 extends Serializable implements TransactionArgument {
|
|
|
361
354
|
}
|
|
362
355
|
|
|
363
356
|
serializeForEntryFunction(serializer: Serializer): void {
|
|
364
|
-
|
|
365
|
-
serializer.serializeBytes(bcsBytes);
|
|
357
|
+
serializer.serializeAsBytes(this);
|
|
366
358
|
}
|
|
367
359
|
|
|
368
360
|
serializeForScriptFunction(serializer: Serializer): void {
|
|
@@ -398,8 +390,7 @@ export class I16 extends Serializable implements TransactionArgument {
|
|
|
398
390
|
}
|
|
399
391
|
|
|
400
392
|
serializeForEntryFunction(serializer: Serializer): void {
|
|
401
|
-
|
|
402
|
-
serializer.serializeBytes(bcsBytes);
|
|
393
|
+
serializer.serializeAsBytes(this);
|
|
403
394
|
}
|
|
404
395
|
|
|
405
396
|
serializeForScriptFunction(serializer: Serializer): void {
|
|
@@ -434,8 +425,7 @@ export class I32 extends Serializable implements TransactionArgument {
|
|
|
434
425
|
}
|
|
435
426
|
|
|
436
427
|
serializeForEntryFunction(serializer: Serializer): void {
|
|
437
|
-
|
|
438
|
-
serializer.serializeBytes(bcsBytes);
|
|
428
|
+
serializer.serializeAsBytes(this);
|
|
439
429
|
}
|
|
440
430
|
|
|
441
431
|
serializeForScriptFunction(serializer: Serializer): void {
|
|
@@ -473,8 +463,7 @@ export class I64 extends Serializable implements TransactionArgument {
|
|
|
473
463
|
}
|
|
474
464
|
|
|
475
465
|
serializeForEntryFunction(serializer: Serializer): void {
|
|
476
|
-
|
|
477
|
-
serializer.serializeBytes(bcsBytes);
|
|
466
|
+
serializer.serializeAsBytes(this);
|
|
478
467
|
}
|
|
479
468
|
|
|
480
469
|
serializeForScriptFunction(serializer: Serializer): void {
|
|
@@ -510,8 +499,7 @@ export class I128 extends Serializable implements TransactionArgument {
|
|
|
510
499
|
}
|
|
511
500
|
|
|
512
501
|
serializeForEntryFunction(serializer: Serializer): void {
|
|
513
|
-
|
|
514
|
-
serializer.serializeBytes(bcsBytes);
|
|
502
|
+
serializer.serializeAsBytes(this);
|
|
515
503
|
}
|
|
516
504
|
|
|
517
505
|
serializeForScriptFunction(serializer: Serializer): void {
|
|
@@ -547,8 +535,7 @@ export class I256 extends Serializable implements TransactionArgument {
|
|
|
547
535
|
}
|
|
548
536
|
|
|
549
537
|
serializeForEntryFunction(serializer: Serializer): void {
|
|
550
|
-
|
|
551
|
-
serializer.serializeBytes(bcsBytes);
|
|
538
|
+
serializer.serializeAsBytes(this);
|
|
552
539
|
}
|
|
553
540
|
|
|
554
541
|
serializeForScriptFunction(serializer: Serializer): void {
|
|
@@ -69,14 +69,14 @@ export class MoveVector<T extends Serializable & EntryFunctionArgument>
|
|
|
69
69
|
/**
|
|
70
70
|
* Serializes the current instance into a byte sequence suitable for entry functions.
|
|
71
71
|
* This allows the data to be properly formatted for transmission or storage.
|
|
72
|
+
* Uses the optimized serializeAsBytes method to reduce allocations.
|
|
72
73
|
*
|
|
73
74
|
* @param serializer - The serializer instance used to serialize the byte sequence.
|
|
74
75
|
* @group Implementation
|
|
75
76
|
* @category BCS
|
|
76
77
|
*/
|
|
77
78
|
serializeForEntryFunction(serializer: Serializer): void {
|
|
78
|
-
|
|
79
|
-
serializer.serializeBytes(bcsBytes);
|
|
79
|
+
serializer.serializeAsBytes(this);
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
/**
|
|
@@ -493,8 +493,7 @@ export class MoveString extends Serializable implements TransactionArgument {
|
|
|
493
493
|
}
|
|
494
494
|
|
|
495
495
|
serializeForEntryFunction(serializer: Serializer): void {
|
|
496
|
-
|
|
497
|
-
serializer.serializeBytes(bcsBytes);
|
|
496
|
+
serializer.serializeAsBytes(this);
|
|
498
497
|
}
|
|
499
498
|
|
|
500
499
|
serializeForScriptFunction(serializer: Serializer): void {
|
|
@@ -531,8 +530,7 @@ export class MoveOption<T extends Serializable & EntryFunctionArgument>
|
|
|
531
530
|
}
|
|
532
531
|
|
|
533
532
|
serializeForEntryFunction(serializer: Serializer): void {
|
|
534
|
-
|
|
535
|
-
serializer.serializeBytes(bcsBytes);
|
|
533
|
+
serializer.serializeAsBytes(this);
|
|
536
534
|
}
|
|
537
535
|
|
|
538
536
|
/**
|
package/src/bcs/serializer.ts
CHANGED
|
@@ -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,
|
|
@@ -24,6 +23,7 @@ import {
|
|
|
24
23
|
} from "./consts";
|
|
25
24
|
import { Hex } from "../core/hex";
|
|
26
25
|
import { AnyNumber, Uint16, Uint32, Uint8 } from "../types";
|
|
26
|
+
import { TEXT_ENCODER } from "../utils/const";
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* This class serves as a base class for all serializable types. It facilitates
|
|
@@ -77,6 +77,41 @@ export abstract class Serializable {
|
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
+
/**
|
|
81
|
+
* Minimum buffer growth increment to avoid too many small reallocations.
|
|
82
|
+
*/
|
|
83
|
+
const MIN_BUFFER_GROWTH = 256;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Pool of reusable Serializer instances for temporary serialization operations.
|
|
87
|
+
* This reduces allocations when using serializeAsBytes() repeatedly.
|
|
88
|
+
*/
|
|
89
|
+
const serializerPool: Serializer[] = [];
|
|
90
|
+
const MAX_POOL_SIZE = 8;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Acquires a Serializer from the pool or creates a new one.
|
|
94
|
+
* @internal
|
|
95
|
+
*/
|
|
96
|
+
function acquireSerializer(): Serializer {
|
|
97
|
+
const serializer = serializerPool.pop();
|
|
98
|
+
if (serializer) {
|
|
99
|
+
serializer.reset();
|
|
100
|
+
return serializer;
|
|
101
|
+
}
|
|
102
|
+
return new Serializer();
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Returns a Serializer to the pool for reuse.
|
|
107
|
+
* @internal
|
|
108
|
+
*/
|
|
109
|
+
function releaseSerializer(serializer: Serializer): void {
|
|
110
|
+
if (serializerPool.length < MAX_POOL_SIZE) {
|
|
111
|
+
serializerPool.push(serializer);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
80
115
|
/**
|
|
81
116
|
* A class for serializing various data types into a binary format.
|
|
82
117
|
* It provides methods to serialize strings, bytes, numbers, and other serializable objects
|
|
@@ -90,6 +125,12 @@ export class Serializer {
|
|
|
90
125
|
|
|
91
126
|
private offset: number;
|
|
92
127
|
|
|
128
|
+
/**
|
|
129
|
+
* Reusable DataView instance to reduce allocations during serialization.
|
|
130
|
+
* Recreated when buffer is resized.
|
|
131
|
+
*/
|
|
132
|
+
private dataView: DataView;
|
|
133
|
+
|
|
93
134
|
/**
|
|
94
135
|
* Constructs a serializer with a buffer of size `length` bytes, 64 bytes by default.
|
|
95
136
|
* The `length` must be greater than 0.
|
|
@@ -103,23 +144,33 @@ export class Serializer {
|
|
|
103
144
|
throw new Error("Length needs to be greater than 0");
|
|
104
145
|
}
|
|
105
146
|
this.buffer = new ArrayBuffer(length);
|
|
147
|
+
this.dataView = new DataView(this.buffer);
|
|
106
148
|
this.offset = 0;
|
|
107
149
|
}
|
|
108
150
|
|
|
109
151
|
/**
|
|
110
152
|
* Ensures that the internal buffer can accommodate the specified number of bytes.
|
|
111
|
-
* This function dynamically resizes the buffer
|
|
153
|
+
* This function dynamically resizes the buffer using a growth factor of 1.5x with
|
|
154
|
+
* a minimum growth increment to balance memory usage and reallocation frequency.
|
|
112
155
|
*
|
|
113
156
|
* @param bytes - The number of bytes to ensure the buffer can handle.
|
|
114
157
|
* @group Implementation
|
|
115
158
|
* @category BCS
|
|
116
159
|
*/
|
|
117
160
|
private ensureBufferWillHandleSize(bytes: number) {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
this.buffer = newBuffer;
|
|
161
|
+
const requiredSize = this.offset + bytes;
|
|
162
|
+
if (this.buffer.byteLength >= requiredSize) {
|
|
163
|
+
return;
|
|
122
164
|
}
|
|
165
|
+
|
|
166
|
+
// Calculate new size: max of (1.5x current size) or (current + required + MIN_GROWTH)
|
|
167
|
+
// Using 1.5x instead of 2x provides better memory efficiency
|
|
168
|
+
const growthSize = Math.max(Math.floor(this.buffer.byteLength * 1.5), requiredSize + MIN_BUFFER_GROWTH);
|
|
169
|
+
|
|
170
|
+
const newBuffer = new ArrayBuffer(growthSize);
|
|
171
|
+
new Uint8Array(newBuffer).set(new Uint8Array(this.buffer, 0, this.offset));
|
|
172
|
+
this.buffer = newBuffer;
|
|
173
|
+
this.dataView = new DataView(this.buffer);
|
|
123
174
|
}
|
|
124
175
|
|
|
125
176
|
/**
|
|
@@ -137,6 +188,7 @@ export class Serializer {
|
|
|
137
188
|
|
|
138
189
|
/**
|
|
139
190
|
* Serializes a value into the buffer using the provided function, ensuring the buffer can accommodate the size.
|
|
191
|
+
* Uses the cached DataView instance for better performance.
|
|
140
192
|
*
|
|
141
193
|
* @param fn - The function to serialize the value, which takes a byte offset, the value to serialize, and an optional little-endian flag.
|
|
142
194
|
* @param fn.byteOffset - The byte offset at which to write the value.
|
|
@@ -152,8 +204,7 @@ export class Serializer {
|
|
|
152
204
|
value: number,
|
|
153
205
|
) {
|
|
154
206
|
this.ensureBufferWillHandleSize(bytesLength);
|
|
155
|
-
|
|
156
|
-
fn.apply(dv, [0, value, true]);
|
|
207
|
+
fn.apply(this.dataView, [this.offset, value, true]);
|
|
157
208
|
this.offset += bytesLength;
|
|
158
209
|
}
|
|
159
210
|
|
|
@@ -177,8 +228,7 @@ export class Serializer {
|
|
|
177
228
|
* @category BCS
|
|
178
229
|
*/
|
|
179
230
|
serializeStr(value: string) {
|
|
180
|
-
|
|
181
|
-
this.serializeBytes(textEncoder.encode(value));
|
|
231
|
+
this.serializeBytes(TEXT_ENCODER.encode(value));
|
|
182
232
|
}
|
|
183
233
|
|
|
184
234
|
/**
|
|
@@ -473,13 +523,57 @@ export class Serializer {
|
|
|
473
523
|
* Returns the buffered bytes as a Uint8Array.
|
|
474
524
|
*
|
|
475
525
|
* This function allows you to retrieve the byte representation of the buffer up to the current offset.
|
|
526
|
+
* For better performance, returns a view when the buffer is exactly the right size, or copies
|
|
527
|
+
* only the used portion otherwise.
|
|
476
528
|
*
|
|
477
529
|
* @returns Uint8Array - The byte array representation of the buffer.
|
|
478
530
|
* @group Implementation
|
|
479
531
|
* @category BCS
|
|
480
532
|
*/
|
|
481
533
|
toUint8Array(): Uint8Array {
|
|
482
|
-
|
|
534
|
+
// Return a copy of only the used portion of the buffer
|
|
535
|
+
// Using subarray + slice pattern for efficiency
|
|
536
|
+
return new Uint8Array(this.buffer, 0, this.offset).slice();
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
/**
|
|
540
|
+
* Resets the serializer to its initial state, allowing the buffer to be reused.
|
|
541
|
+
* This clears the buffer contents to prevent data leakage between uses.
|
|
542
|
+
*
|
|
543
|
+
* @group Implementation
|
|
544
|
+
* @category BCS
|
|
545
|
+
*/
|
|
546
|
+
reset(): void {
|
|
547
|
+
// Clear buffer contents to prevent data leakage when reusing pooled serializers
|
|
548
|
+
// Only clear the portion that was used (up to offset) for efficiency
|
|
549
|
+
if (this.offset > 0) {
|
|
550
|
+
new Uint8Array(this.buffer, 0, this.offset).fill(0);
|
|
551
|
+
}
|
|
552
|
+
this.offset = 0;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
/**
|
|
556
|
+
* Returns the current number of bytes written to the serializer.
|
|
557
|
+
*
|
|
558
|
+
* @returns The number of bytes written.
|
|
559
|
+
* @group Implementation
|
|
560
|
+
* @category BCS
|
|
561
|
+
*/
|
|
562
|
+
getOffset(): number {
|
|
563
|
+
return this.offset;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
/**
|
|
567
|
+
* Returns a view of the serialized bytes without copying.
|
|
568
|
+
* WARNING: The returned view is only valid until the next write operation.
|
|
569
|
+
* Use toUint8Array() if you need a persistent copy.
|
|
570
|
+
*
|
|
571
|
+
* @returns A Uint8Array view of the buffer (not a copy).
|
|
572
|
+
* @group Implementation
|
|
573
|
+
* @category BCS
|
|
574
|
+
*/
|
|
575
|
+
toUint8ArrayView(): Uint8Array {
|
|
576
|
+
return new Uint8Array(this.buffer, 0, this.offset);
|
|
483
577
|
}
|
|
484
578
|
|
|
485
579
|
/**
|
|
@@ -497,6 +591,47 @@ export class Serializer {
|
|
|
497
591
|
value.serialize(this);
|
|
498
592
|
}
|
|
499
593
|
|
|
594
|
+
/**
|
|
595
|
+
* Serializes a Serializable value as a byte array with a length prefix.
|
|
596
|
+
* This is the optimized pattern for entry function argument serialization.
|
|
597
|
+
*
|
|
598
|
+
* Instead of:
|
|
599
|
+
* ```typescript
|
|
600
|
+
* const bcsBytes = value.bcsToBytes(); // Creates new Serializer, copies bytes
|
|
601
|
+
* serializer.serializeBytes(bcsBytes);
|
|
602
|
+
* ```
|
|
603
|
+
*
|
|
604
|
+
* Use:
|
|
605
|
+
* ```typescript
|
|
606
|
+
* serializer.serializeAsBytes(value); // Uses pooled Serializer, avoids extra copy
|
|
607
|
+
* ```
|
|
608
|
+
*
|
|
609
|
+
* This method uses a pooled Serializer instance to reduce allocations and
|
|
610
|
+
* directly appends the serialized bytes with a length prefix.
|
|
611
|
+
*
|
|
612
|
+
* @param value - The Serializable value to serialize as bytes.
|
|
613
|
+
* @group Implementation
|
|
614
|
+
* @category BCS
|
|
615
|
+
*/
|
|
616
|
+
serializeAsBytes<T extends Serializable>(value: T): void {
|
|
617
|
+
// Acquire a pooled serializer for temporary use
|
|
618
|
+
const tempSerializer = acquireSerializer();
|
|
619
|
+
|
|
620
|
+
try {
|
|
621
|
+
// Serialize the value to the temporary serializer
|
|
622
|
+
value.serialize(tempSerializer);
|
|
623
|
+
|
|
624
|
+
// Get the serialized bytes (as a view to avoid copying)
|
|
625
|
+
const bytes = tempSerializer.toUint8ArrayView();
|
|
626
|
+
|
|
627
|
+
// Serialize with length prefix to this serializer
|
|
628
|
+
this.serializeBytes(bytes);
|
|
629
|
+
} finally {
|
|
630
|
+
// Return the serializer to the pool for reuse
|
|
631
|
+
releaseSerializer(tempSerializer);
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
|
|
500
635
|
/**
|
|
501
636
|
* Serializes an array of BCS Serializable values to a serializer instance.
|
|
502
637
|
* The bytes are added to the serializer instance's byte buffer.
|
|
@@ -630,7 +765,7 @@ export function validateNumberInRange<T extends AnyNumber>(value: T, minValue: T
|
|
|
630
765
|
function checkNumberRange<T extends AnyNumber>(minValue: T, maxValue: T) {
|
|
631
766
|
return (target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => {
|
|
632
767
|
const childFunction = descriptor.value;
|
|
633
|
-
|
|
768
|
+
|
|
634
769
|
descriptor.value = function deco(value: AnyNumber) {
|
|
635
770
|
validateNumberInRange(value, minValue, maxValue);
|
|
636
771
|
return childFunction.apply(this, [value]);
|
package/src/cli/localNode.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { ChildProcessWithoutNullStreams, spawn } from "child_process";
|
|
1
|
+
import { ChildProcessWithoutNullStreams, spawn } from "node:child_process";
|
|
4
2
|
import kill from "tree-kill";
|
|
5
|
-
import { platform } from "os";
|
|
3
|
+
import { platform } from "node:os";
|
|
6
4
|
|
|
7
5
|
import { sleep } from "../utils/helpers";
|
|
8
6
|
|
|
@@ -130,9 +128,8 @@ export class LocalNode {
|
|
|
130
128
|
let last = start;
|
|
131
129
|
|
|
132
130
|
while (!operational && start + this.MAXIMUM_WAIT_TIME_SEC > last) {
|
|
133
|
-
// eslint-disable-next-line no-await-in-loop
|
|
134
131
|
await sleep(1000);
|
|
135
|
-
|
|
132
|
+
|
|
136
133
|
operational = await this.checkIfProcessIsUp();
|
|
137
134
|
last = Date.now() / 1000;
|
|
138
135
|
}
|
|
@@ -161,7 +158,7 @@ export class LocalNode {
|
|
|
161
158
|
return true;
|
|
162
159
|
}
|
|
163
160
|
return false;
|
|
164
|
-
} catch
|
|
161
|
+
} catch {
|
|
165
162
|
return false;
|
|
166
163
|
}
|
|
167
164
|
}
|
package/src/cli/move.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { spawn } from "child_process";
|
|
2
|
-
import { platform } from "os";
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { platform } from "node:os";
|
|
3
3
|
|
|
4
4
|
import { AccountAddress } from "../core";
|
|
5
5
|
import { Network } from "../utils";
|
|
@@ -353,7 +353,7 @@ export class Move {
|
|
|
353
353
|
* @group Implementation
|
|
354
354
|
* @category CLI
|
|
355
355
|
*/
|
|
356
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { sha3_256 } from "@noble/hashes/sha3";
|
|
2
2
|
import { AccountAddress } from "../../accountAddress";
|
|
3
3
|
import { DeriveScheme } from "../../../types";
|
|
4
|
+
import { TEXT_ENCODER } from "../../../utils/const";
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Creates an object address from creator address and seed
|
|
@@ -14,8 +15,7 @@ import { DeriveScheme } from "../../../types";
|
|
|
14
15
|
*/
|
|
15
16
|
export const createObjectAddress = (creatorAddress: AccountAddress, seed: Uint8Array | string): AccountAddress => {
|
|
16
17
|
const creatorBytes = creatorAddress.bcsToBytes();
|
|
17
|
-
|
|
18
|
-
const seedBytes = typeof seed === "string" ? Buffer.from(seed, "utf8") : seed;
|
|
18
|
+
const seedBytes = typeof seed === "string" ? TEXT_ENCODER.encode(seed) : seed;
|
|
19
19
|
|
|
20
20
|
const bytes = new Uint8Array([...creatorBytes, ...seedBytes, DeriveScheme.DeriveObjectAddressFromSeed]);
|
|
21
21
|
|
|
@@ -35,7 +35,7 @@ export const createObjectAddress = (creatorAddress: AccountAddress, seed: Uint8A
|
|
|
35
35
|
export const createResourceAddress = (creatorAddress: AccountAddress, seed: Uint8Array | string): AccountAddress => {
|
|
36
36
|
const creatorBytes = creatorAddress.bcsToBytes();
|
|
37
37
|
|
|
38
|
-
const seedBytes = typeof seed === "string" ?
|
|
38
|
+
const seedBytes = typeof seed === "string" ? TEXT_ENCODER.encode(seed) : seed;
|
|
39
39
|
|
|
40
40
|
const bytes = new Uint8Array([...creatorBytes, ...seedBytes, DeriveScheme.DeriveResourceAccountAddress]);
|
|
41
41
|
|
|
@@ -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
|
-
|
|
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,14 @@ 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
|
|
39
38
|
verifySignature(args: VerifySignatureArgs): boolean {
|
|
40
39
|
throw new Error("This function is not implemented for AbstractPublicKey.");
|
|
41
40
|
}
|
|
42
41
|
|
|
43
|
-
// eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars
|
|
44
42
|
async verifySignatureAsync(args: VerifySignatureAsyncArgs): Promise<boolean> {
|
|
45
43
|
throw new Error("This function is not implemented for AbstractPublicKey.");
|
|
46
44
|
}
|
|
47
45
|
|
|
48
|
-
// eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars
|
|
49
46
|
serialize(serializer: Serializer): void {
|
|
50
47
|
throw new Error("This function is not implemented for AbstractPublicKey.");
|
|
51
48
|
}
|