@aptos-labs/ts-sdk 5.2.1 → 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.
- package/dist/common/{account-Dxsj5MIn.d.ts → account-CSOaJ0SC.d.ts} +188 -20
- package/dist/common/chunk-3NBJLJ2Y.js +4 -0
- package/dist/common/chunk-3NBJLJ2Y.js.map +1 -0
- package/dist/common/cli/index.d.ts +1 -1
- package/dist/common/cli/index.js +1 -1
- package/dist/common/cli/index.js.map +1 -1
- package/dist/common/index.d.ts +264 -31
- package/dist/common/index.js +38 -44
- package/dist/common/index.js.map +1 -1
- package/dist/esm/{Ed25519Account-DIIE2Drw.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-CMR8C31P.d.mts → account-Dg0ejXHy.d.mts} +173 -9
- 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 +92 -26
- package/dist/esm/api/ans.mjs +1 -1
- package/dist/esm/api/aptos.d.mts +4 -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 +4 -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-32J7VMLV.mjs +2 -0
- package/dist/esm/chunk-32J7VMLV.mjs.map +1 -0
- package/dist/esm/chunk-3FDSKP56.mjs +2 -0
- package/dist/esm/chunk-3FDSKP56.mjs.map +1 -0
- package/dist/esm/{chunk-QITAALVJ.mjs → chunk-3Q3J4DTI.mjs} +2 -2
- package/dist/esm/chunk-7FG7RJDS.mjs +2 -0
- package/dist/esm/chunk-7FG7RJDS.mjs.map +1 -0
- package/dist/esm/chunk-BHVMFSAD.mjs +2 -0
- package/dist/esm/chunk-BHVMFSAD.mjs.map +1 -0
- package/dist/esm/chunk-CWI5B5KE.mjs +2 -0
- package/dist/esm/{chunk-QDJDZ3ON.mjs → chunk-DE4YVX3L.mjs} +2 -2
- package/dist/esm/chunk-DE5K76I2.mjs +1 -0
- package/dist/esm/chunk-DECWO3X5.mjs +2 -0
- package/dist/esm/chunk-DECWO3X5.mjs.map +1 -0
- package/dist/esm/{chunk-3GNYDMRA.mjs → chunk-DRGODFFX.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-UL777LTI.mjs → chunk-G5OONGWS.mjs} +24 -30
- package/dist/esm/chunk-G5OONGWS.mjs.map +1 -0
- package/dist/esm/chunk-GP3CDQFI.mjs +2 -0
- package/dist/esm/chunk-GP3CDQFI.mjs.map +1 -0
- package/dist/esm/chunk-GWM3VCT4.mjs +4 -0
- package/dist/esm/chunk-GWM3VCT4.mjs.map +1 -0
- package/dist/esm/{chunk-C5UZZHA4.mjs → chunk-HHAUJ5E4.mjs} +2 -2
- package/dist/esm/chunk-ITZN23GU.mjs +2 -0
- package/dist/esm/{chunk-G3HAIETV.mjs → chunk-KLDERTLN.mjs} +2 -2
- package/dist/esm/chunk-KLDERTLN.mjs.map +1 -0
- package/dist/esm/chunk-M65PXVDO.mjs +2 -0
- package/dist/esm/chunk-M65PXVDO.mjs.map +1 -0
- package/dist/esm/chunk-NP2IAUME.mjs +2 -0
- package/dist/esm/chunk-NP2IAUME.mjs.map +1 -0
- package/dist/esm/chunk-ODNZJSOC.mjs +2 -0
- package/dist/esm/chunk-ODNZJSOC.mjs.map +1 -0
- package/dist/esm/{chunk-TBOR2W2F.mjs → chunk-PDNDARQY.mjs} +2 -2
- package/dist/esm/{chunk-RYOICF37.mjs → chunk-POKQD2RK.mjs} +2 -2
- package/dist/esm/chunk-Q5ESW36C.mjs +2 -0
- package/dist/esm/chunk-Q5ESW36C.mjs.map +1 -0
- package/dist/esm/chunk-QRD5NGNC.mjs +2 -0
- package/dist/esm/{chunk-K3Q5EONX.mjs.map → chunk-QRD5NGNC.mjs.map} +1 -1
- package/dist/esm/{chunk-43LWUUXS.mjs → chunk-QV37KEZY.mjs} +2 -2
- package/dist/esm/{chunk-KY4GDJA6.mjs → chunk-QYC3HOQX.mjs} +2 -2
- package/dist/esm/{chunk-DLD62OFZ.mjs → chunk-RGXAFBFA.mjs} +2 -2
- package/dist/esm/{chunk-3P474TWM.mjs → chunk-RSUFVB4P.mjs} +2 -2
- package/dist/esm/chunk-SZBXWUBS.mjs +2 -0
- package/dist/esm/chunk-SZBXWUBS.mjs.map +1 -0
- package/dist/esm/{chunk-EIQBQ62N.mjs → chunk-TIMTVXFU.mjs} +2 -2
- package/dist/esm/chunk-TIMTVXFU.mjs.map +1 -0
- package/dist/esm/{chunk-QREVMGQZ.mjs → chunk-U5HTF4OK.mjs} +1 -1
- package/dist/esm/{chunk-QREVMGQZ.mjs.map → chunk-U5HTF4OK.mjs.map} +1 -1
- package/dist/esm/{chunk-6IWGTO2J.mjs → chunk-UNA3V4UB.mjs} +2 -2
- package/dist/esm/chunk-US6KOOYS.mjs +2 -0
- package/dist/esm/chunk-US6KOOYS.mjs.map +1 -0
- package/dist/esm/chunk-UXDYADZV.mjs +2 -0
- package/dist/esm/chunk-UXDYADZV.mjs.map +1 -0
- package/dist/esm/{chunk-5FNZUL2Y.mjs → chunk-UZMJ4DAO.mjs} +2 -2
- package/dist/esm/chunk-V5K2RRFT.mjs +2 -0
- package/dist/esm/chunk-V5K2RRFT.mjs.map +1 -0
- package/dist/esm/{chunk-35DKMW7Q.mjs → chunk-VW3Y5EOJ.mjs} +1 -1
- package/dist/esm/{chunk-35DKMW7Q.mjs.map → chunk-VW3Y5EOJ.mjs.map} +1 -1
- package/dist/esm/{chunk-MEG27LEV.mjs → chunk-VWLK43JM.mjs} +3 -3
- package/dist/esm/chunk-VWLK43JM.mjs.map +1 -0
- package/dist/esm/{chunk-DIFSO4N6.mjs → chunk-VWXVSRRQ.mjs} +2 -2
- package/dist/esm/{chunk-WBG25H7H.mjs → chunk-WRV7BWXE.mjs} +2 -2
- package/dist/esm/{chunk-56IXVVXX.mjs → chunk-YMZF4KMT.mjs} +2 -2
- package/dist/esm/chunk-YNNDFGVQ.mjs +2 -0
- package/dist/esm/{chunk-VS5NYRHW.mjs.map → chunk-YNNDFGVQ.mjs.map} +1 -1
- package/dist/esm/{chunk-GRF3NBRO.mjs → chunk-YOT47DDX.mjs} +2 -2
- package/dist/esm/chunk-YOT47DDX.mjs.map +1 -0
- package/dist/esm/cli/index.d.mts +1 -1
- package/dist/esm/cli/index.mjs +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-DE7i_6s_.d.mts → federatedKeyless-BYLu31Sa.d.mts} +13 -2
- package/dist/esm/index.d.mts +6 -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 +85 -33
- 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/ans.d.mts +109 -0
- package/dist/esm/types/ans.mjs +2 -0
- package/dist/esm/types/ans.mjs.map +1 -0
- package/dist/esm/types/generated/operations.d.mts +5 -11
- package/dist/esm/types/generated/queries.d.mts +28 -28
- package/dist/esm/types/generated/queries.mjs +1 -1
- package/dist/esm/types/generated/types.d.mts +191 -7
- package/dist/esm/types/generated/types.mjs +1 -1
- package/dist/esm/types/generated/types.mjs.map +1 -1
- package/dist/esm/types/index.d.mts +2 -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 +11 -1
- 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 +39 -46
- package/src/account/AbstractKeylessAccount.ts +2 -3
- package/src/account/DerivableAbstractedAccount.ts +1 -3
- package/src/account/EphemeralKeyPair.ts +53 -1
- 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 +70 -26
- package/src/api/aptos.ts +3 -2
- package/src/api/aptosConfig.ts +13 -0
- package/src/api/transaction.ts +4 -4
- package/src/api/transactionSubmission/build.ts +1 -5
- package/src/api/transactionSubmission/helpers.ts +1 -1
- package/src/api/transactionSubmission/sign.ts +2 -2
- package/src/bcs/deserializer.ts +64 -17
- package/src/bcs/serializable/movePrimitives.ts +16 -28
- package/src/bcs/serializable/moveStructs.ts +4 -6
- package/src/bcs/serializer.ts +151 -12
- package/src/cli/localNode.ts +2 -3
- package/src/cli/move.ts +5 -5
- package/src/client/get.ts +8 -10
- package/src/core/accountAddress.ts +2 -3
- package/src/core/crypto/abstraction.ts +3 -3
- package/src/core/crypto/ed25519.ts +66 -1
- package/src/core/crypto/federatedKeyless.ts +1 -1
- package/src/core/crypto/keyless.ts +65 -13
- 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 -4
- package/src/core/crypto/secp256k1.ts +68 -3
- package/src/core/crypto/secp256r1.ts +1 -1
- package/src/core/crypto/singleKey.ts +4 -0
- package/src/core/crypto/utils.ts +6 -3
- package/src/errors/index.ts +4 -5
- package/src/internal/account.ts +20 -29
- package/src/internal/ans.ts +280 -111
- package/src/internal/general.ts +24 -6
- package/src/internal/queries/getCollectionData.graphql +0 -11
- package/src/internal/queries/getNames.graphql +5 -0
- package/src/internal/transaction.ts +3 -5
- package/src/internal/transactionSubmission.ts +23 -0
- package/src/transactions/authenticator/account.ts +0 -3
- 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 +7 -6
- package/src/transactions/management/accountSequenceNumber.ts +0 -2
- package/src/transactions/management/transactionWorker.ts +40 -10
- package/src/transactions/transactionBuilder/remoteAbi.ts +21 -6
- package/src/transactions/transactionBuilder/transactionBuilder.ts +17 -13
- package/src/transactions/typeTag/index.ts +1 -1
- package/src/transactions/typeTag/parser.ts +1 -2
- package/src/transactions/types.ts +1 -1
- package/src/types/ans.ts +110 -0
- package/src/types/generated/operations.ts +1 -11
- package/src/types/generated/queries.ts +163 -87
- package/src/types/generated/types.ts +216 -6
- package/src/types/index.ts +1 -0
- package/src/types/types.ts +26 -0
- package/src/utils/const.ts +11 -0
- package/src/utils/helpers.ts +45 -5
- package/src/utils/memoize.ts +177 -11
- package/src/version.ts +1 -1
- package/dist/common/chunk-3KK6QRXD.js +0 -4
- package/dist/common/chunk-3KK6QRXD.js.map +0 -1
- package/dist/esm/chunk-2PASUPUO.mjs +0 -2
- package/dist/esm/chunk-2PASUPUO.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-C622NWP7.mjs +0 -2
- package/dist/esm/chunk-C622NWP7.mjs.map +0 -1
- package/dist/esm/chunk-EIQBQ62N.mjs.map +0 -1
- package/dist/esm/chunk-FD6FGKYY.mjs +0 -1
- package/dist/esm/chunk-G3HAIETV.mjs.map +0 -1
- package/dist/esm/chunk-GOXRBEIJ.mjs.map +0 -1
- package/dist/esm/chunk-GRF3NBRO.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-K3Q5EONX.mjs +0 -2
- package/dist/esm/chunk-KUF4DKN5.mjs +0 -2
- package/dist/esm/chunk-LD3I4CYO.mjs +0 -2
- 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-UL777LTI.mjs.map +0 -1
- package/dist/esm/chunk-VO3JD6U6.mjs +0 -2
- package/dist/esm/chunk-VO3JD6U6.mjs.map +0 -1
- package/dist/esm/chunk-VS5NYRHW.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-Z6PXP6MJ.mjs +0 -2
- package/dist/esm/chunk-Z6PXP6MJ.mjs.map +0 -1
- package/dist/esm/chunk-ZSO5R7FV.mjs +0 -4
- package/dist/esm/chunk-ZSO5R7FV.mjs.map +0 -1
- /package/dist/esm/{chunk-QITAALVJ.mjs.map → chunk-3Q3J4DTI.mjs.map} +0 -0
- /package/dist/esm/{chunk-KUF4DKN5.mjs.map → chunk-CWI5B5KE.mjs.map} +0 -0
- /package/dist/esm/{chunk-QDJDZ3ON.mjs.map → chunk-DE4YVX3L.mjs.map} +0 -0
- /package/dist/esm/{chunk-FD6FGKYY.mjs.map → chunk-DE5K76I2.mjs.map} +0 -0
- /package/dist/esm/{chunk-3GNYDMRA.mjs.map → chunk-DRGODFFX.mjs.map} +0 -0
- /package/dist/esm/{chunk-C5UZZHA4.mjs.map → chunk-HHAUJ5E4.mjs.map} +0 -0
- /package/dist/esm/{chunk-LD3I4CYO.mjs.map → chunk-ITZN23GU.mjs.map} +0 -0
- /package/dist/esm/{chunk-TBOR2W2F.mjs.map → chunk-PDNDARQY.mjs.map} +0 -0
- /package/dist/esm/{chunk-RYOICF37.mjs.map → chunk-POKQD2RK.mjs.map} +0 -0
- /package/dist/esm/{chunk-43LWUUXS.mjs.map → chunk-QV37KEZY.mjs.map} +0 -0
- /package/dist/esm/{chunk-KY4GDJA6.mjs.map → chunk-QYC3HOQX.mjs.map} +0 -0
- /package/dist/esm/{chunk-DLD62OFZ.mjs.map → chunk-RGXAFBFA.mjs.map} +0 -0
- /package/dist/esm/{chunk-3P474TWM.mjs.map → chunk-RSUFVB4P.mjs.map} +0 -0
- /package/dist/esm/{chunk-6IWGTO2J.mjs.map → chunk-UNA3V4UB.mjs.map} +0 -0
- /package/dist/esm/{chunk-5FNZUL2Y.mjs.map → chunk-UZMJ4DAO.mjs.map} +0 -0
- /package/dist/esm/{chunk-DIFSO4N6.mjs.map → chunk-VWXVSRRQ.mjs.map} +0 -0
- /package/dist/esm/{chunk-WBG25H7H.mjs.map → chunk-WRV7BWXE.mjs.map} +0 -0
- /package/dist/esm/{chunk-56IXVVXX.mjs.map → chunk-YMZF4KMT.mjs.map} +0 -0
package/src/internal/general.ts
CHANGED
|
@@ -15,9 +15,19 @@ import { GetChainTopUserTransactionsResponse, GetProcessorStatusResponse, Graphq
|
|
|
15
15
|
import { GetChainTopUserTransactionsQuery, GetProcessorStatusQuery } from "../types/generated/operations";
|
|
16
16
|
import { GetChainTopUserTransactions, GetProcessorStatus } from "../types/generated/queries";
|
|
17
17
|
import { ProcessorType } from "../utils/const";
|
|
18
|
+
import { memoizeAsync } from "../utils/memoize";
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Cache TTL for ledger info in milliseconds (10 seconds).
|
|
22
|
+
* Ledger info changes frequently but we can cache briefly to reduce redundant calls
|
|
23
|
+
* when building multiple transactions in quick succession.
|
|
24
|
+
*/
|
|
25
|
+
const LEDGER_INFO_CACHE_TTL_MS = 10 * 1000;
|
|
18
26
|
|
|
19
27
|
/**
|
|
20
28
|
* Retrieves information about the current ledger.
|
|
29
|
+
* Results are cached for 10 seconds to reduce redundant network calls during
|
|
30
|
+
* rapid transaction building.
|
|
21
31
|
*
|
|
22
32
|
* @param args - The arguments for retrieving ledger information.
|
|
23
33
|
* @param args.aptosConfig - The configuration object for connecting to the Aptos network.
|
|
@@ -25,12 +35,20 @@ import { ProcessorType } from "../utils/const";
|
|
|
25
35
|
*/
|
|
26
36
|
export async function getLedgerInfo(args: { aptosConfig: AptosConfig }): Promise<LedgerInfo> {
|
|
27
37
|
const { aptosConfig } = args;
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
38
|
+
const cacheKey = `ledger-info-${aptosConfig.network}`;
|
|
39
|
+
|
|
40
|
+
return memoizeAsync(
|
|
41
|
+
async () => {
|
|
42
|
+
const { data } = await getAptosFullNode<{}, LedgerInfo>({
|
|
43
|
+
aptosConfig,
|
|
44
|
+
originMethod: "getLedgerInfo",
|
|
45
|
+
path: "",
|
|
46
|
+
});
|
|
47
|
+
return data;
|
|
48
|
+
},
|
|
49
|
+
cacheKey,
|
|
50
|
+
LEDGER_INFO_CACHE_TTL_MS,
|
|
51
|
+
)();
|
|
34
52
|
}
|
|
35
53
|
|
|
36
54
|
/**
|
|
@@ -14,16 +14,5 @@ query getCollectionData($where_condition: current_collections_v2_bool_exp!) {
|
|
|
14
14
|
description
|
|
15
15
|
last_transaction_timestamp
|
|
16
16
|
last_transaction_version
|
|
17
|
-
cdn_asset_uris {
|
|
18
|
-
cdn_image_uri
|
|
19
|
-
asset_uri
|
|
20
|
-
animation_optimizer_retry_count
|
|
21
|
-
cdn_animation_uri
|
|
22
|
-
cdn_json_uri
|
|
23
|
-
image_optimizer_retry_count
|
|
24
|
-
json_parser_retry_count
|
|
25
|
-
raw_animation_uri
|
|
26
|
-
raw_image_uri
|
|
27
|
-
}
|
|
28
17
|
}
|
|
29
18
|
}
|
|
@@ -246,7 +246,6 @@ export async function waitForTransaction(args: {
|
|
|
246
246
|
break;
|
|
247
247
|
}
|
|
248
248
|
try {
|
|
249
|
-
// eslint-disable-next-line no-await-in-loop
|
|
250
249
|
lastTxn = await getTransactionByHash({ aptosConfig, transactionHash });
|
|
251
250
|
|
|
252
251
|
isPending = lastTxn.type === TransactionResponseType.Pending;
|
|
@@ -257,7 +256,7 @@ export async function waitForTransaction(args: {
|
|
|
257
256
|
} catch (e) {
|
|
258
257
|
handleAPIError(e);
|
|
259
258
|
}
|
|
260
|
-
|
|
259
|
+
|
|
261
260
|
await sleep(backoffIntervalMs);
|
|
262
261
|
timeElapsed += backoffIntervalMs / 1000; // Convert to seconds
|
|
263
262
|
backoffIntervalMs *= backoffMultiplier;
|
|
@@ -322,11 +321,11 @@ export async function waitForIndexer(args: {
|
|
|
322
321
|
|
|
323
322
|
if (processorType === undefined) {
|
|
324
323
|
// Get the last success version from all processor
|
|
325
|
-
|
|
324
|
+
|
|
326
325
|
indexerVersion = await getIndexerLastSuccessVersion({ aptosConfig });
|
|
327
326
|
} else {
|
|
328
327
|
// Get the last success version from the specific processor
|
|
329
|
-
|
|
328
|
+
|
|
330
329
|
const processor = await getProcessorStatus({ aptosConfig, processorType });
|
|
331
330
|
indexerVersion = processor.last_success_version;
|
|
332
331
|
}
|
|
@@ -336,7 +335,6 @@ export async function waitForIndexer(args: {
|
|
|
336
335
|
break;
|
|
337
336
|
}
|
|
338
337
|
|
|
339
|
-
// eslint-disable-next-line no-await-in-loop
|
|
340
338
|
await sleep(200);
|
|
341
339
|
}
|
|
342
340
|
}
|
|
@@ -300,6 +300,29 @@ export async function simulateTransaction(
|
|
|
300
300
|
originMethod: "simulateTransaction",
|
|
301
301
|
contentType: MimeType.BCS_SIGNED_TRANSACTION,
|
|
302
302
|
});
|
|
303
|
+
|
|
304
|
+
// If the server's gas estimation produced a value below the network minimum,
|
|
305
|
+
// retry without estimation so the transaction's original max_gas_amount is used.
|
|
306
|
+
if (
|
|
307
|
+
args.options?.estimateMaxGasAmount &&
|
|
308
|
+
data.length > 0 &&
|
|
309
|
+
data[0].vm_status === "MAX_GAS_UNITS_BELOW_MIN_TRANSACTION_GAS_UNITS"
|
|
310
|
+
) {
|
|
311
|
+
const { data: retryData } = await postAptosFullNode<Uint8Array, Array<UserTransactionResponse>>({
|
|
312
|
+
aptosConfig,
|
|
313
|
+
body: signedTransaction,
|
|
314
|
+
path: "transactions/simulate",
|
|
315
|
+
params: {
|
|
316
|
+
estimate_gas_unit_price: args.options?.estimateGasUnitPrice ?? false,
|
|
317
|
+
estimate_max_gas_amount: false,
|
|
318
|
+
estimate_prioritized_gas_unit_price: args.options?.estimatePrioritizedGasUnitPrice ?? false,
|
|
319
|
+
},
|
|
320
|
+
originMethod: "simulateTransaction",
|
|
321
|
+
contentType: MimeType.BCS_SIGNED_TRANSACTION,
|
|
322
|
+
});
|
|
323
|
+
return retryData;
|
|
324
|
+
}
|
|
325
|
+
|
|
303
326
|
return data;
|
|
304
327
|
}
|
|
305
328
|
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
// Copyright © Aptos Foundation
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
-
/* eslint-disable @typescript-eslint/naming-convention */
|
|
5
|
-
|
|
6
4
|
import { Serializer, Deserializer, Serializable } from "../../bcs";
|
|
7
5
|
import { AnyPublicKey, AnySignature } from "../../core/crypto";
|
|
8
6
|
import { Ed25519PublicKey, Ed25519Signature } from "../../core/crypto/ed25519";
|
|
@@ -258,7 +256,6 @@ export class AccountAuthenticatorMultiKey extends AccountAuthenticator {
|
|
|
258
256
|
* It allows skipping the public/auth key check during the simulation.
|
|
259
257
|
*/
|
|
260
258
|
export class AccountAuthenticatorNoAccountAuthenticator extends AccountAuthenticator {
|
|
261
|
-
// eslint-disable-next-line class-methods-use-this
|
|
262
259
|
serialize(serializer: Serializer): void {
|
|
263
260
|
serializer.serializeU32AsUleb128(AccountAuthenticatorVariant.NoAccountAuthenticator);
|
|
264
261
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
// Copyright © Aptos Foundation
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
-
/* eslint-disable @typescript-eslint/naming-convention */
|
|
5
|
-
|
|
6
4
|
import { AccountAuthenticator } from "./account";
|
|
7
5
|
import { Deserializer, Serializable, Serializer } from "../../bcs";
|
|
8
6
|
import { AccountAddress } from "../../core";
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
// Copyright © Aptos Foundation
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
-
/* eslint-disable @typescript-eslint/naming-convention */
|
|
5
|
-
|
|
6
4
|
import { Deserializer } from "../../bcs/deserializer";
|
|
7
5
|
import { Serializable, Serializer } from "../../bcs/serializer";
|
|
8
6
|
import { AccountAddress } from "../../core";
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
// Copyright © Aptos Foundation
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
-
/* eslint-disable @typescript-eslint/naming-convention */
|
|
5
|
-
|
|
6
4
|
import { Deserializer } from "../../bcs/deserializer";
|
|
7
5
|
import { Serializable, Serializer } from "../../bcs/serializer";
|
|
8
6
|
import { ChainId } from "./chainId";
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
// Copyright © Aptos Foundation
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
-
/* eslint-disable @typescript-eslint/naming-convention */
|
|
5
|
-
|
|
6
4
|
import { TransactionAuthenticator } from "../authenticator/transaction";
|
|
7
5
|
import { Deserializer } from "../../bcs/deserializer";
|
|
8
6
|
import { Serializable, Serializer } from "../../bcs/serializer";
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
// Copyright © Aptos Foundation
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
-
/* eslint-disable @typescript-eslint/naming-convention */
|
|
5
|
-
|
|
6
4
|
import { Deserializer } from "../../bcs/deserializer";
|
|
7
5
|
import { Serializable, Serializer } from "../../bcs/serializer";
|
|
8
6
|
import { AccountAddress } from "../../core";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright © Aptos Foundation
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
-
/* eslint-disable
|
|
4
|
+
/* eslint-disable max-classes-per-file */
|
|
5
5
|
|
|
6
6
|
import { Deserializer } from "../../bcs/deserializer";
|
|
7
7
|
import { Serializable, Serializer } from "../../bcs/serializer";
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
I256,
|
|
23
23
|
} from "../../bcs/serializable/movePrimitives";
|
|
24
24
|
import { MoveVector, Serialized } from "../../bcs/serializable/moveStructs";
|
|
25
|
-
import { AccountAddress
|
|
25
|
+
import { AccountAddress } from "../../core";
|
|
26
26
|
import { Identifier } from "./identifier";
|
|
27
27
|
import { ModuleId } from "./moduleId";
|
|
28
28
|
import type { EntryFunctionArgument, ScriptFunctionArgument, TransactionArgument } from "./transactionArgument";
|
|
@@ -588,8 +588,8 @@ export class TransactionInnerPayloadV1 extends TransactionInnerPayload {
|
|
|
588
588
|
}
|
|
589
589
|
|
|
590
590
|
static load(deserializer: Deserializer): TransactionInnerPayloadV1 {
|
|
591
|
-
|
|
592
|
-
|
|
591
|
+
const executable = TransactionExecutable.deserialize(deserializer);
|
|
592
|
+
const extra_config = TransactionExtraConfig.deserialize(deserializer);
|
|
593
593
|
return new TransactionInnerPayloadV1(executable, extra_config);
|
|
594
594
|
}
|
|
595
595
|
}
|
|
@@ -627,7 +627,7 @@ export class TransactionExecutableScript extends TransactionExecutable {
|
|
|
627
627
|
}
|
|
628
628
|
|
|
629
629
|
static load(deserializer: Deserializer): TransactionExecutableScript {
|
|
630
|
-
|
|
630
|
+
const script = Script.deserialize(deserializer);
|
|
631
631
|
return new TransactionExecutableScript(script);
|
|
632
632
|
}
|
|
633
633
|
}
|
|
@@ -646,7 +646,7 @@ export class TransactionExecutableEntryFunction extends TransactionExecutable {
|
|
|
646
646
|
}
|
|
647
647
|
|
|
648
648
|
static load(deserializer: Deserializer): TransactionExecutableEntryFunction {
|
|
649
|
-
|
|
649
|
+
const entryFunction = EntryFunction.deserialize(deserializer);
|
|
650
650
|
return new TransactionExecutableEntryFunction(entryFunction);
|
|
651
651
|
}
|
|
652
652
|
}
|
|
@@ -656,6 +656,7 @@ export class TransactionExecutableEmpty extends TransactionExecutable {
|
|
|
656
656
|
serializer.serializeU32AsUleb128(TransactionExecutableVariants.Empty);
|
|
657
657
|
}
|
|
658
658
|
|
|
659
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
659
660
|
static load(_: Deserializer): TransactionExecutableEmpty {
|
|
660
661
|
return new TransactionExecutableEmpty();
|
|
661
662
|
}
|
|
@@ -111,7 +111,6 @@ export class AccountSequenceNumber {
|
|
|
111
111
|
* @category Transactions
|
|
112
112
|
*/
|
|
113
113
|
async nextSequenceNumber(): Promise<bigint | null> {
|
|
114
|
-
/* eslint-disable no-await-in-loop */
|
|
115
114
|
while (this.lock) {
|
|
116
115
|
await sleep(this.sleepTime);
|
|
117
116
|
}
|
|
@@ -195,7 +194,6 @@ export class AccountSequenceNumber {
|
|
|
195
194
|
async synchronize(): Promise<void> {
|
|
196
195
|
if (this.lastUncommintedNumber === this.currentNumber) return;
|
|
197
196
|
|
|
198
|
-
/* eslint-disable no-await-in-loop */
|
|
199
197
|
while (this.lock) {
|
|
200
198
|
await sleep(this.sleepTime);
|
|
201
199
|
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/* eslint-disable no-await-in-loop */
|
|
2
|
-
|
|
3
1
|
import EventEmitter from "eventemitter3";
|
|
4
2
|
import { AptosConfig } from "../../api/aptosConfig";
|
|
5
3
|
import { Account } from "../../account";
|
|
@@ -11,6 +9,12 @@ import { AccountSequenceNumber } from "./accountSequenceNumber";
|
|
|
11
9
|
import { AsyncQueue, AsyncQueueCancelledError } from "./asyncQueue";
|
|
12
10
|
import { SimpleTransaction } from "../instances/simpleTransaction";
|
|
13
11
|
|
|
12
|
+
/**
|
|
13
|
+
* Maximum number of transactions to keep in the history arrays to prevent unbounded memory growth.
|
|
14
|
+
* When this limit is exceeded, the oldest entries are removed.
|
|
15
|
+
*/
|
|
16
|
+
const MAX_TRANSACTION_HISTORY_SIZE = 10000;
|
|
17
|
+
|
|
14
18
|
/**
|
|
15
19
|
* @group Implementation
|
|
16
20
|
* @category Transactions
|
|
@@ -124,19 +128,35 @@ export class TransactionWorker extends EventEmitter<TransactionWorkerEvents> {
|
|
|
124
128
|
outstandingTransactions = new AsyncQueue<[Promise<PendingTransactionResponse>, bigint]>();
|
|
125
129
|
|
|
126
130
|
/**
|
|
127
|
-
* transactions that have been submitted to chain
|
|
131
|
+
* transactions that have been submitted to chain.
|
|
132
|
+
* Limited to MAX_TRANSACTION_HISTORY_SIZE entries to prevent unbounded memory growth.
|
|
128
133
|
* @group Implementation
|
|
129
134
|
* @category Transactions
|
|
130
135
|
*/
|
|
131
136
|
sentTransactions: Array<[string, bigint, any]> = [];
|
|
132
137
|
|
|
133
138
|
/**
|
|
134
|
-
* transactions that have been committed to chain
|
|
139
|
+
* transactions that have been committed to chain.
|
|
140
|
+
* Limited to MAX_TRANSACTION_HISTORY_SIZE entries to prevent unbounded memory growth.
|
|
135
141
|
* @group Implementation
|
|
136
142
|
* @category Transactions
|
|
137
143
|
*/
|
|
138
144
|
executedTransactions: Array<[string, bigint, any]> = [];
|
|
139
145
|
|
|
146
|
+
/**
|
|
147
|
+
* Adds a transaction to the history array while enforcing the maximum size limit.
|
|
148
|
+
* Removes the oldest entries when the limit is exceeded.
|
|
149
|
+
* @private
|
|
150
|
+
*/
|
|
151
|
+
private addToTransactionHistory(history: Array<[string, bigint, any]>, entry: [string, bigint, any]): void {
|
|
152
|
+
history.push(entry);
|
|
153
|
+
// Remove oldest entries if we exceed the limit (remove ~10% when triggered)
|
|
154
|
+
if (history.length > MAX_TRANSACTION_HISTORY_SIZE) {
|
|
155
|
+
const removeCount = Math.ceil(MAX_TRANSACTION_HISTORY_SIZE * 0.1);
|
|
156
|
+
history.splice(0, removeCount);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
140
160
|
/**
|
|
141
161
|
* Initializes a new instance of the class, providing a framework for receiving payloads to be processed.
|
|
142
162
|
*
|
|
@@ -181,7 +201,6 @@ export class TransactionWorker extends EventEmitter<TransactionWorkerEvents> {
|
|
|
181
201
|
*/
|
|
182
202
|
async submitNextTransaction() {
|
|
183
203
|
try {
|
|
184
|
-
/* eslint-disable no-constant-condition */
|
|
185
204
|
while (true) {
|
|
186
205
|
const sequenceNumber = await this.accountSequnceNumber.nextSequenceNumber();
|
|
187
206
|
if (sequenceNumber === null) return;
|
|
@@ -217,7 +236,6 @@ export class TransactionWorker extends EventEmitter<TransactionWorkerEvents> {
|
|
|
217
236
|
*/
|
|
218
237
|
async processTransactions() {
|
|
219
238
|
try {
|
|
220
|
-
/* eslint-disable no-constant-condition */
|
|
221
239
|
while (true) {
|
|
222
240
|
const awaitingTransactions = [];
|
|
223
241
|
const sequenceNumbers = [];
|
|
@@ -240,7 +258,7 @@ export class TransactionWorker extends EventEmitter<TransactionWorkerEvents> {
|
|
|
240
258
|
sequenceNumber = sequenceNumbers[i];
|
|
241
259
|
if (sentTransaction.status === promiseFulfilledStatus) {
|
|
242
260
|
// transaction sent to chain
|
|
243
|
-
this.sentTransactions
|
|
261
|
+
this.addToTransactionHistory(this.sentTransactions, [sentTransaction.value.hash, sequenceNumber, null]);
|
|
244
262
|
// check sent transaction execution
|
|
245
263
|
this.emit(TransactionWorkerEventsEnum.TransactionSent, {
|
|
246
264
|
message: `transaction hash ${sentTransaction.value.hash} has been committed to chain`,
|
|
@@ -249,7 +267,11 @@ export class TransactionWorker extends EventEmitter<TransactionWorkerEvents> {
|
|
|
249
267
|
await this.checkTransaction(sentTransaction, sequenceNumber);
|
|
250
268
|
} else {
|
|
251
269
|
// send transaction failed
|
|
252
|
-
this.
|
|
270
|
+
this.addToTransactionHistory(this.sentTransactions, [
|
|
271
|
+
sentTransaction.status,
|
|
272
|
+
sequenceNumber,
|
|
273
|
+
sentTransaction.reason,
|
|
274
|
+
]);
|
|
253
275
|
this.emit(TransactionWorkerEventsEnum.TransactionSendFailed, {
|
|
254
276
|
message: `failed to commit transaction ${this.sentTransactions.length} with error ${sentTransaction.reason}`,
|
|
255
277
|
error: sentTransaction.reason,
|
|
@@ -285,14 +307,22 @@ export class TransactionWorker extends EventEmitter<TransactionWorkerEvents> {
|
|
|
285
307
|
const executedTransaction = sentTransactions[i];
|
|
286
308
|
if (executedTransaction.status === promiseFulfilledStatus) {
|
|
287
309
|
// transaction executed to chain
|
|
288
|
-
this.
|
|
310
|
+
this.addToTransactionHistory(this.executedTransactions, [
|
|
311
|
+
executedTransaction.value.hash,
|
|
312
|
+
sequenceNumber,
|
|
313
|
+
null,
|
|
314
|
+
]);
|
|
289
315
|
this.emit(TransactionWorkerEventsEnum.TransactionExecuted, {
|
|
290
316
|
message: `transaction hash ${executedTransaction.value.hash} has been executed on chain`,
|
|
291
317
|
transactionHash: sentTransaction.value.hash,
|
|
292
318
|
});
|
|
293
319
|
} else {
|
|
294
320
|
// transaction execution failed
|
|
295
|
-
this.
|
|
321
|
+
this.addToTransactionHistory(this.executedTransactions, [
|
|
322
|
+
executedTransaction.status,
|
|
323
|
+
sequenceNumber,
|
|
324
|
+
executedTransaction.reason,
|
|
325
|
+
]);
|
|
296
326
|
this.emit(TransactionWorkerEventsEnum.TransactionExecutionFailed, {
|
|
297
327
|
message: `failed to execute transaction ${this.executedTransactions.length} with error ${executedTransaction.reason}`,
|
|
298
328
|
error: executedTransaction.reason,
|
|
@@ -76,6 +76,8 @@ import {
|
|
|
76
76
|
isBcsI256,
|
|
77
77
|
} from "./helpers";
|
|
78
78
|
import { MoveFunction, MoveModule } from "../../types";
|
|
79
|
+
import { warnIfDevelopment } from "../../utils/helpers";
|
|
80
|
+
import { memoizeAsync } from "../../utils/memoize";
|
|
79
81
|
|
|
80
82
|
const TEXT_ENCODER = new TextEncoder();
|
|
81
83
|
|
|
@@ -99,8 +101,15 @@ export function standardizeTypeTags(typeArguments?: Array<TypeArgument>): Array<
|
|
|
99
101
|
);
|
|
100
102
|
}
|
|
101
103
|
|
|
104
|
+
/**
|
|
105
|
+
* Cache TTL for module ABIs in milliseconds (5 minutes).
|
|
106
|
+
* ABIs rarely change, so a longer cache is acceptable.
|
|
107
|
+
*/
|
|
108
|
+
const MODULE_ABI_CACHE_TTL_MS = 5 * 60 * 1000;
|
|
109
|
+
|
|
102
110
|
/**
|
|
103
111
|
* Fetches the ABI of a specified module from the on-chain module ABI.
|
|
112
|
+
* Results are cached for 5 minutes to reduce redundant network calls.
|
|
104
113
|
*
|
|
105
114
|
* @param moduleAddress - The address of the module from which to fetch the ABI.
|
|
106
115
|
* @param moduleName - The name of the module containing the ABI.
|
|
@@ -113,8 +122,16 @@ export async function fetchModuleAbi(
|
|
|
113
122
|
moduleName: string,
|
|
114
123
|
aptosConfig: AptosConfig,
|
|
115
124
|
): Promise<MoveModule | undefined> {
|
|
116
|
-
const
|
|
117
|
-
|
|
125
|
+
const cacheKey = `module-abi-${aptosConfig.network}-${moduleAddress}-${moduleName}`;
|
|
126
|
+
|
|
127
|
+
return memoizeAsync(
|
|
128
|
+
async () => {
|
|
129
|
+
const moduleBytecode = await getModule({ aptosConfig, accountAddress: moduleAddress, moduleName });
|
|
130
|
+
return moduleBytecode.abi;
|
|
131
|
+
},
|
|
132
|
+
cacheKey,
|
|
133
|
+
MODULE_ABI_CACHE_TTL_MS,
|
|
134
|
+
)();
|
|
118
135
|
}
|
|
119
136
|
|
|
120
137
|
/**
|
|
@@ -628,10 +645,8 @@ function parseArg(
|
|
|
628
645
|
}
|
|
629
646
|
|
|
630
647
|
if (arg instanceof Uint8Array && options?.allowUnknownStructs) {
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
// eslint-disable-next-line max-len
|
|
634
|
-
`Unsupported struct input type for argument ${position}. Continuing since 'allowUnknownStructs' is enabled.`,
|
|
648
|
+
warnIfDevelopment(
|
|
649
|
+
`[Aptos SDK] Unsupported struct input type for argument ${position}. Continuing since 'allowUnknownStructs' is enabled.`,
|
|
635
650
|
);
|
|
636
651
|
return new FixedBytes(arg);
|
|
637
652
|
}
|
|
@@ -24,6 +24,7 @@ import { getInfo } from "../../internal/utils";
|
|
|
24
24
|
import { getLedgerInfo } from "../../internal/general";
|
|
25
25
|
import { getGasPriceEstimation } from "../../internal/transaction";
|
|
26
26
|
import { NetworkToChainId } from "../../utils/apiEndpoints";
|
|
27
|
+
import { MIN_MAX_GAS_AMOUNT } from "../../utils/const";
|
|
27
28
|
import { normalizeBundle } from "../../utils/normalizeBundle";
|
|
28
29
|
import {
|
|
29
30
|
AccountAuthenticator,
|
|
@@ -201,7 +202,7 @@ export function generateTransactionPayloadWithABI(
|
|
|
201
202
|
}
|
|
202
203
|
|
|
203
204
|
// Check all BCS types, and convert any non-BCS types
|
|
204
|
-
const functionArguments: Array<EntryFunctionArgumentTypes> = args.functionArguments
|
|
205
|
+
const functionArguments: Array<EntryFunctionArgumentTypes> | undefined = args.functionArguments?.map((arg, i) =>
|
|
205
206
|
/**
|
|
206
207
|
* Converts the argument for a specified function using its ABI and type arguments.
|
|
207
208
|
* This function helps ensure that the correct number of arguments is provided for the function call.
|
|
@@ -220,10 +221,9 @@ export function generateTransactionPayloadWithABI(
|
|
|
220
221
|
);
|
|
221
222
|
|
|
222
223
|
// Check that all arguments are accounted for
|
|
223
|
-
if (functionArguments
|
|
224
|
+
if ((functionArguments?.length ?? 0) !== functionAbi.parameters.length) {
|
|
224
225
|
throw new Error(
|
|
225
|
-
|
|
226
|
-
`Too few arguments for '${moduleAddress}::${moduleName}::${functionName}', expected ${functionAbi.parameters.length} but got ${functionArguments.length}`,
|
|
226
|
+
`Too few arguments for '${moduleAddress}::${moduleName}::${functionName}', expected ${functionAbi.parameters.length} but got ${functionArguments?.length ?? 0}`,
|
|
227
227
|
);
|
|
228
228
|
}
|
|
229
229
|
|
|
@@ -232,7 +232,7 @@ export function generateTransactionPayloadWithABI(
|
|
|
232
232
|
`${moduleAddress}::${moduleName}`,
|
|
233
233
|
functionName,
|
|
234
234
|
typeArguments,
|
|
235
|
-
functionArguments,
|
|
235
|
+
functionArguments ?? [],
|
|
236
236
|
);
|
|
237
237
|
|
|
238
238
|
// Send it as multi sig if it's a multisig payload
|
|
@@ -314,7 +314,6 @@ export function generateViewFunctionPayloadWithABI(args: InputViewFunctionDataWi
|
|
|
314
314
|
// Check that all arguments are accounted for
|
|
315
315
|
if (functionArguments.length !== functionAbi.parameters.length) {
|
|
316
316
|
throw new Error(
|
|
317
|
-
// eslint-disable-next-line max-len
|
|
318
317
|
`Too few arguments for '${moduleAddress}::${moduleName}::${functionName}', expected ${functionAbi.parameters.length} but got ${functionArguments.length}`,
|
|
319
318
|
);
|
|
320
319
|
}
|
|
@@ -392,7 +391,8 @@ export async function generateRawTransaction(args: {
|
|
|
392
391
|
const getSequenceNumber = async () => {
|
|
393
392
|
if (options?.accountSequenceNumber !== undefined) {
|
|
394
393
|
return options.accountSequenceNumber;
|
|
395
|
-
}
|
|
394
|
+
}
|
|
395
|
+
if (options?.replayProtectionNonce !== undefined) {
|
|
396
396
|
// If replay nonce is provided, use it as the sequence number
|
|
397
397
|
// This is an unused value, so it's specifically to show that the sequence number is not used
|
|
398
398
|
return 0xdeadbeefn;
|
|
@@ -413,7 +413,7 @@ export async function generateRawTransaction(args: {
|
|
|
413
413
|
try {
|
|
414
414
|
// Check if main signer has been created on chain, if not assign sequence number 0
|
|
415
415
|
return await getSequenceNumber();
|
|
416
|
-
} catch
|
|
416
|
+
} catch {
|
|
417
417
|
return 0;
|
|
418
418
|
}
|
|
419
419
|
} else {
|
|
@@ -426,8 +426,11 @@ export async function generateRawTransaction(args: {
|
|
|
426
426
|
getSequenceNumberForAny(),
|
|
427
427
|
]);
|
|
428
428
|
|
|
429
|
+
const userMaxGas = options?.maxGasAmount
|
|
430
|
+
? BigInt(options.maxGasAmount)
|
|
431
|
+
: BigInt(aptosConfig.getDefaultMaxGasAmount());
|
|
429
432
|
const { maxGasAmount, gasUnitPrice, expireTimestamp, replayProtectionNonce } = {
|
|
430
|
-
maxGasAmount:
|
|
433
|
+
maxGasAmount: userMaxGas < BigInt(MIN_MAX_GAS_AMOUNT) ? BigInt(MIN_MAX_GAS_AMOUNT) : userMaxGas,
|
|
431
434
|
gasUnitPrice: options?.gasUnitPrice ?? BigInt(gasEstimate),
|
|
432
435
|
expireTimestamp:
|
|
433
436
|
options?.expireTimestamp ?? BigInt(Math.floor(Date.now() / 1000) + aptosConfig.getDefaultTxnExpirySecFromNow()),
|
|
@@ -460,12 +463,14 @@ export function convertPayloadToInnerPayload(
|
|
|
460
463
|
new TransactionExecutableScript(payload.script),
|
|
461
464
|
new TransactionExtraConfigV1(undefined, replayProtectionNonce),
|
|
462
465
|
);
|
|
463
|
-
}
|
|
466
|
+
}
|
|
467
|
+
if (payload instanceof TransactionPayloadEntryFunction) {
|
|
464
468
|
return new TransactionInnerPayloadV1(
|
|
465
469
|
new TransactionExecutableEntryFunction(payload.entryFunction),
|
|
466
470
|
new TransactionExtraConfigV1(undefined, replayProtectionNonce),
|
|
467
471
|
);
|
|
468
|
-
}
|
|
472
|
+
}
|
|
473
|
+
if (payload instanceof TransactionPayloadMultiSig) {
|
|
469
474
|
const innerPayload = payload.multiSig.transaction_payload;
|
|
470
475
|
let executable: TransactionExecutable;
|
|
471
476
|
if (innerPayload === undefined || innerPayload?.transaction_payload === undefined) {
|
|
@@ -481,9 +486,8 @@ export function convertPayloadToInnerPayload(
|
|
|
481
486
|
executable,
|
|
482
487
|
new TransactionExtraConfigV1(payload.multiSig.multisig_address, replayProtectionNonce),
|
|
483
488
|
);
|
|
484
|
-
} else {
|
|
485
|
-
throw new Error(`Unsupported payload type: ${payload}`);
|
|
486
489
|
}
|
|
490
|
+
throw new Error(`Unsupported payload type: ${payload}`);
|
|
487
491
|
}
|
|
488
492
|
|
|
489
493
|
/**
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
4
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
5
|
-
|
|
5
|
+
|
|
6
6
|
/* eslint-disable max-classes-per-file */
|
|
7
7
|
import { Deserializer } from "../../bcs/deserializer";
|
|
8
8
|
import { Serializable, Serializer } from "../../bcs/serializer";
|
|
@@ -299,7 +299,6 @@ export function parseTypeTag(typeStr: string, options?: { allowGenerics?: boolea
|
|
|
299
299
|
throw new TypeTagParserError(typeStr, TypeTagParserErrorType.UnexpectedWhitespaceCharacter);
|
|
300
300
|
}
|
|
301
301
|
|
|
302
|
-
// eslint-disable-next-line no-continue
|
|
303
302
|
continue;
|
|
304
303
|
} else {
|
|
305
304
|
// Any other characters just append to the current string
|
|
@@ -415,7 +414,7 @@ function parseTypeTagInner(str: string, types: Array<TypeTag>, allowGenerics: bo
|
|
|
415
414
|
let address: AccountAddress;
|
|
416
415
|
try {
|
|
417
416
|
address = AccountAddress.fromString(structParts[0]);
|
|
418
|
-
} catch
|
|
417
|
+
} catch {
|
|
419
418
|
throw new TypeTagParserError(str, TypeTagParserErrorType.InvalidAddress);
|
|
420
419
|
}
|
|
421
420
|
|
|
@@ -204,7 +204,7 @@ export type InputGenerateTransactionPayloadDataWithRemoteABI =
|
|
|
204
204
|
export type InputEntryFunctionData = {
|
|
205
205
|
function: MoveFunctionId;
|
|
206
206
|
typeArguments?: Array<TypeArgument>;
|
|
207
|
-
functionArguments
|
|
207
|
+
functionArguments?: Array<EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes>;
|
|
208
208
|
abi?: EntryFunctionABI;
|
|
209
209
|
};
|
|
210
210
|
|