@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
|
@@ -178,17 +178,6 @@ type GetCollectionDataQuery = {
|
|
|
178
178
|
description: string;
|
|
179
179
|
last_transaction_timestamp: any;
|
|
180
180
|
last_transaction_version: any;
|
|
181
|
-
cdn_asset_uris?: {
|
|
182
|
-
cdn_image_uri?: string | null;
|
|
183
|
-
asset_uri: string;
|
|
184
|
-
animation_optimizer_retry_count: number;
|
|
185
|
-
cdn_animation_uri?: string | null;
|
|
186
|
-
cdn_json_uri?: string | null;
|
|
187
|
-
image_optimizer_retry_count: number;
|
|
188
|
-
json_parser_retry_count: number;
|
|
189
|
-
raw_animation_uri?: string | null;
|
|
190
|
-
raw_image_uri?: string | null;
|
|
191
|
-
} | null;
|
|
192
181
|
}>;
|
|
193
182
|
};
|
|
194
183
|
type GetCurrentFungibleAssetBalancesQuery = {
|
|
@@ -277,6 +266,11 @@ type GetNamesQuery = {
|
|
|
277
266
|
subdomain_expiration_policy?: any | null;
|
|
278
267
|
domain_expiration_timestamp?: any | null;
|
|
279
268
|
}>;
|
|
269
|
+
current_aptos_names_aggregate: {
|
|
270
|
+
aggregate?: {
|
|
271
|
+
count: number;
|
|
272
|
+
} | null;
|
|
273
|
+
};
|
|
280
274
|
};
|
|
281
275
|
type GetNumberOfDelegatorsQuery = {
|
|
282
276
|
num_active_delegator_per_pool: Array<{
|
|
@@ -853,6 +847,11 @@ declare abstract class Serializable {
|
|
|
853
847
|
declare class Serializer {
|
|
854
848
|
private buffer;
|
|
855
849
|
private offset;
|
|
850
|
+
/**
|
|
851
|
+
* Reusable DataView instance to reduce allocations during serialization.
|
|
852
|
+
* Recreated when buffer is resized.
|
|
853
|
+
*/
|
|
854
|
+
private dataView;
|
|
856
855
|
/**
|
|
857
856
|
* Constructs a serializer with a buffer of size `length` bytes, 64 bytes by default.
|
|
858
857
|
* The `length` must be greater than 0.
|
|
@@ -864,7 +863,8 @@ declare class Serializer {
|
|
|
864
863
|
constructor(length?: number);
|
|
865
864
|
/**
|
|
866
865
|
* Ensures that the internal buffer can accommodate the specified number of bytes.
|
|
867
|
-
* This function dynamically resizes the buffer
|
|
866
|
+
* This function dynamically resizes the buffer using a growth factor of 1.5x with
|
|
867
|
+
* a minimum growth increment to balance memory usage and reallocation frequency.
|
|
868
868
|
*
|
|
869
869
|
* @param bytes - The number of bytes to ensure the buffer can handle.
|
|
870
870
|
* @group Implementation
|
|
@@ -881,6 +881,7 @@ declare class Serializer {
|
|
|
881
881
|
protected appendToBuffer(values: Uint8Array): void;
|
|
882
882
|
/**
|
|
883
883
|
* Serializes a value into the buffer using the provided function, ensuring the buffer can accommodate the size.
|
|
884
|
+
* Uses the cached DataView instance for better performance.
|
|
884
885
|
*
|
|
885
886
|
* @param fn - The function to serialize the value, which takes a byte offset, the value to serialize, and an optional little-endian flag.
|
|
886
887
|
* @param fn.byteOffset - The byte offset at which to write the value.
|
|
@@ -1082,12 +1083,40 @@ declare class Serializer {
|
|
|
1082
1083
|
* Returns the buffered bytes as a Uint8Array.
|
|
1083
1084
|
*
|
|
1084
1085
|
* This function allows you to retrieve the byte representation of the buffer up to the current offset.
|
|
1086
|
+
* For better performance, returns a view when the buffer is exactly the right size, or copies
|
|
1087
|
+
* only the used portion otherwise.
|
|
1085
1088
|
*
|
|
1086
1089
|
* @returns Uint8Array - The byte array representation of the buffer.
|
|
1087
1090
|
* @group Implementation
|
|
1088
1091
|
* @category BCS
|
|
1089
1092
|
*/
|
|
1090
1093
|
toUint8Array(): Uint8Array;
|
|
1094
|
+
/**
|
|
1095
|
+
* Resets the serializer to its initial state, allowing the buffer to be reused.
|
|
1096
|
+
* This clears the buffer contents to prevent data leakage between uses.
|
|
1097
|
+
*
|
|
1098
|
+
* @group Implementation
|
|
1099
|
+
* @category BCS
|
|
1100
|
+
*/
|
|
1101
|
+
reset(): void;
|
|
1102
|
+
/**
|
|
1103
|
+
* Returns the current number of bytes written to the serializer.
|
|
1104
|
+
*
|
|
1105
|
+
* @returns The number of bytes written.
|
|
1106
|
+
* @group Implementation
|
|
1107
|
+
* @category BCS
|
|
1108
|
+
*/
|
|
1109
|
+
getOffset(): number;
|
|
1110
|
+
/**
|
|
1111
|
+
* Returns a view of the serialized bytes without copying.
|
|
1112
|
+
* WARNING: The returned view is only valid until the next write operation.
|
|
1113
|
+
* Use toUint8Array() if you need a persistent copy.
|
|
1114
|
+
*
|
|
1115
|
+
* @returns A Uint8Array view of the buffer (not a copy).
|
|
1116
|
+
* @group Implementation
|
|
1117
|
+
* @category BCS
|
|
1118
|
+
*/
|
|
1119
|
+
toUint8ArrayView(): Uint8Array;
|
|
1091
1120
|
/**
|
|
1092
1121
|
* Serializes a `Serializable` value, facilitating composable serialization.
|
|
1093
1122
|
*
|
|
@@ -1098,6 +1127,29 @@ declare class Serializer {
|
|
|
1098
1127
|
* @category BCS
|
|
1099
1128
|
*/
|
|
1100
1129
|
serialize<T extends Serializable>(value: T): void;
|
|
1130
|
+
/**
|
|
1131
|
+
* Serializes a Serializable value as a byte array with a length prefix.
|
|
1132
|
+
* This is the optimized pattern for entry function argument serialization.
|
|
1133
|
+
*
|
|
1134
|
+
* Instead of:
|
|
1135
|
+
* ```typescript
|
|
1136
|
+
* const bcsBytes = value.bcsToBytes(); // Creates new Serializer, copies bytes
|
|
1137
|
+
* serializer.serializeBytes(bcsBytes);
|
|
1138
|
+
* ```
|
|
1139
|
+
*
|
|
1140
|
+
* Use:
|
|
1141
|
+
* ```typescript
|
|
1142
|
+
* serializer.serializeAsBytes(value); // Uses pooled Serializer, avoids extra copy
|
|
1143
|
+
* ```
|
|
1144
|
+
*
|
|
1145
|
+
* This method uses a pooled Serializer instance to reduce allocations and
|
|
1146
|
+
* directly appends the serialized bytes with a length prefix.
|
|
1147
|
+
*
|
|
1148
|
+
* @param value - The Serializable value to serialize as bytes.
|
|
1149
|
+
* @group Implementation
|
|
1150
|
+
* @category BCS
|
|
1151
|
+
*/
|
|
1152
|
+
serializeAsBytes<T extends Serializable>(value: T): void;
|
|
1101
1153
|
/**
|
|
1102
1154
|
* Serializes an array of BCS Serializable values to a serializer instance.
|
|
1103
1155
|
* The bytes are added to the serializer instance's byte buffer.
|
|
@@ -1420,6 +1472,7 @@ declare class AccountAddress extends Serializable implements TransactionArgument
|
|
|
1420
1472
|
/**
|
|
1421
1473
|
* Serializes the current instance into a byte sequence suitable for entry functions.
|
|
1422
1474
|
* This allows for the proper encoding of data when interacting with entry functions in the blockchain.
|
|
1475
|
+
* Uses the optimized serializeAsBytes method to reduce allocations.
|
|
1423
1476
|
*
|
|
1424
1477
|
* @param serializer - The serializer instance used to convert the data into bytes.
|
|
1425
1478
|
* @group Implementation
|
|
@@ -1894,7 +1947,12 @@ declare class Ed25519PrivateKey extends Serializable implements PrivateKey {
|
|
|
1894
1947
|
* @group Implementation
|
|
1895
1948
|
* @category Serialization
|
|
1896
1949
|
*/
|
|
1897
|
-
private
|
|
1950
|
+
private signingKey;
|
|
1951
|
+
/**
|
|
1952
|
+
* Whether the key has been cleared from memory
|
|
1953
|
+
* @private
|
|
1954
|
+
*/
|
|
1955
|
+
private cleared;
|
|
1898
1956
|
/**
|
|
1899
1957
|
* Create a new PrivateKey instance from a Uint8Array or String.
|
|
1900
1958
|
*
|
|
@@ -1940,10 +1998,35 @@ declare class Ed25519PrivateKey extends Serializable implements PrivateKey {
|
|
|
1940
1998
|
* @category Serialization
|
|
1941
1999
|
*/
|
|
1942
2000
|
private static fromDerivationPathInner;
|
|
2001
|
+
/**
|
|
2002
|
+
* Checks if the key has been cleared and throws an error if so.
|
|
2003
|
+
* @private
|
|
2004
|
+
*/
|
|
2005
|
+
private ensureNotCleared;
|
|
2006
|
+
/**
|
|
2007
|
+
* Clears the private key from memory by overwriting it with random bytes.
|
|
2008
|
+
* After calling this method, the private key can no longer be used for signing or deriving public keys.
|
|
2009
|
+
*
|
|
2010
|
+
* Note: Due to JavaScript's memory management, this cannot guarantee complete removal of
|
|
2011
|
+
* sensitive data from memory, but it significantly reduces the window of exposure.
|
|
2012
|
+
*
|
|
2013
|
+
* @group Implementation
|
|
2014
|
+
* @category Serialization
|
|
2015
|
+
*/
|
|
2016
|
+
clear(): void;
|
|
2017
|
+
/**
|
|
2018
|
+
* Returns whether the private key has been cleared from memory.
|
|
2019
|
+
*
|
|
2020
|
+
* @returns true if the key has been cleared, false otherwise
|
|
2021
|
+
* @group Implementation
|
|
2022
|
+
* @category Serialization
|
|
2023
|
+
*/
|
|
2024
|
+
isCleared(): boolean;
|
|
1943
2025
|
/**
|
|
1944
2026
|
* Derive the Ed25519PublicKey for this private key.
|
|
1945
2027
|
*
|
|
1946
2028
|
* @returns Ed25519PublicKey - The derived public key corresponding to the private key.
|
|
2029
|
+
* @throws Error if the private key has been cleared from memory.
|
|
1947
2030
|
* @group Implementation
|
|
1948
2031
|
* @category Serialization
|
|
1949
2032
|
*/
|
|
@@ -1954,6 +2037,7 @@ declare class Ed25519PrivateKey extends Serializable implements PrivateKey {
|
|
|
1954
2037
|
*
|
|
1955
2038
|
* @param message - A message as a string or Uint8Array in HexInput format.
|
|
1956
2039
|
* @returns A digital signature for the provided message.
|
|
2040
|
+
* @throws Error if the private key has been cleared from memory.
|
|
1957
2041
|
* @group Implementation
|
|
1958
2042
|
* @category Serialization
|
|
1959
2043
|
*/
|
|
@@ -1962,6 +2046,7 @@ declare class Ed25519PrivateKey extends Serializable implements PrivateKey {
|
|
|
1962
2046
|
* Get the private key in bytes (Uint8Array).
|
|
1963
2047
|
*
|
|
1964
2048
|
* @returns Uint8Array representation of the private key
|
|
2049
|
+
* @throws Error if the private key has been cleared from memory.
|
|
1965
2050
|
* @group Implementation
|
|
1966
2051
|
* @category Serialization
|
|
1967
2052
|
*/
|
|
@@ -1970,6 +2055,7 @@ declare class Ed25519PrivateKey extends Serializable implements PrivateKey {
|
|
|
1970
2055
|
* Get the private key as a hex string with the 0x prefix.
|
|
1971
2056
|
*
|
|
1972
2057
|
* @returns string representation of the private key.
|
|
2058
|
+
* @throws Error if the private key has been cleared from memory.
|
|
1973
2059
|
* @group Implementation
|
|
1974
2060
|
* @category Serialization
|
|
1975
2061
|
*/
|
|
@@ -1978,6 +2064,7 @@ declare class Ed25519PrivateKey extends Serializable implements PrivateKey {
|
|
|
1978
2064
|
* Get the private key as a hex string with the 0x prefix.
|
|
1979
2065
|
*
|
|
1980
2066
|
* @returns string representation of the private key.
|
|
2067
|
+
* @throws Error if the private key has been cleared from memory.
|
|
1981
2068
|
*/
|
|
1982
2069
|
toHexString(): string;
|
|
1983
2070
|
/**
|
|
@@ -1986,6 +2073,7 @@ declare class Ed25519PrivateKey extends Serializable implements PrivateKey {
|
|
|
1986
2073
|
* [Read about AIP-80](https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-80.md)
|
|
1987
2074
|
*
|
|
1988
2075
|
* @returns AIP-80 compliant string representation of the private key.
|
|
2076
|
+
* @throws Error if the private key has been cleared from memory.
|
|
1989
2077
|
*/
|
|
1990
2078
|
toAIP80String(): string;
|
|
1991
2079
|
serialize(serializer: Serializer): void;
|
|
@@ -2100,6 +2188,16 @@ declare enum AptosApiType {
|
|
|
2100
2188
|
* @category Utils
|
|
2101
2189
|
*/
|
|
2102
2190
|
declare const DEFAULT_MAX_GAS_AMOUNT = 200000;
|
|
2191
|
+
/**
|
|
2192
|
+
* The minimum max gas amount that the SDK will allow for a transaction.
|
|
2193
|
+
*
|
|
2194
|
+
* This value acts as a floor to prevent transactions from being built with a max gas amount
|
|
2195
|
+
* below the network's minimum transaction gas units, which would cause
|
|
2196
|
+
* MAX_GAS_UNITS_BELOW_MIN_TRANSACTION_GAS_UNITS errors.
|
|
2197
|
+
* @group Implementation
|
|
2198
|
+
* @category Utils
|
|
2199
|
+
*/
|
|
2200
|
+
declare const MIN_MAX_GAS_AMOUNT = 2000;
|
|
2103
2201
|
/**
|
|
2104
2202
|
* The default transaction expiration seconds from now.
|
|
2105
2203
|
*
|
|
@@ -2501,7 +2599,12 @@ declare class Secp256k1PrivateKey extends Serializable implements PrivateKey {
|
|
|
2501
2599
|
* @group Implementation
|
|
2502
2600
|
* @category Serialization
|
|
2503
2601
|
*/
|
|
2504
|
-
private
|
|
2602
|
+
private key;
|
|
2603
|
+
/**
|
|
2604
|
+
* Whether the key has been cleared from memory
|
|
2605
|
+
* @private
|
|
2606
|
+
*/
|
|
2607
|
+
private cleared;
|
|
2505
2608
|
/**
|
|
2506
2609
|
* Create a new PrivateKey instance from a Uint8Array or String.
|
|
2507
2610
|
*
|
|
@@ -2546,12 +2649,37 @@ declare class Secp256k1PrivateKey extends Serializable implements PrivateKey {
|
|
|
2546
2649
|
* @category Serialization
|
|
2547
2650
|
*/
|
|
2548
2651
|
private static fromDerivationPathInner;
|
|
2652
|
+
/**
|
|
2653
|
+
* Checks if the key has been cleared and throws an error if so.
|
|
2654
|
+
* @private
|
|
2655
|
+
*/
|
|
2656
|
+
private ensureNotCleared;
|
|
2657
|
+
/**
|
|
2658
|
+
* Clears the private key from memory by overwriting it with random bytes.
|
|
2659
|
+
* After calling this method, the private key can no longer be used for signing or deriving public keys.
|
|
2660
|
+
*
|
|
2661
|
+
* Note: Due to JavaScript's memory management, this cannot guarantee complete removal of
|
|
2662
|
+
* sensitive data from memory, but it significantly reduces the window of exposure.
|
|
2663
|
+
*
|
|
2664
|
+
* @group Implementation
|
|
2665
|
+
* @category Serialization
|
|
2666
|
+
*/
|
|
2667
|
+
clear(): void;
|
|
2668
|
+
/**
|
|
2669
|
+
* Returns whether the private key has been cleared from memory.
|
|
2670
|
+
*
|
|
2671
|
+
* @returns true if the key has been cleared, false otherwise
|
|
2672
|
+
* @group Implementation
|
|
2673
|
+
* @category Serialization
|
|
2674
|
+
*/
|
|
2675
|
+
isCleared(): boolean;
|
|
2549
2676
|
/**
|
|
2550
2677
|
* Sign the given message with the private key.
|
|
2551
2678
|
* This function generates a cryptographic signature for the provided message, ensuring the signature is canonical and non-malleable.
|
|
2552
2679
|
*
|
|
2553
2680
|
* @param message - A message in HexInput format to be signed.
|
|
2554
2681
|
* @returns Signature - The generated signature for the provided message.
|
|
2682
|
+
* @throws Error if the private key has been cleared from memory.
|
|
2555
2683
|
* @group Implementation
|
|
2556
2684
|
* @category Serialization
|
|
2557
2685
|
*/
|
|
@@ -2560,6 +2688,7 @@ declare class Secp256k1PrivateKey extends Serializable implements PrivateKey {
|
|
|
2560
2688
|
* Derive the Secp256k1PublicKey from this private key.
|
|
2561
2689
|
*
|
|
2562
2690
|
* @returns Secp256k1PublicKey The derived public key.
|
|
2691
|
+
* @throws Error if the private key has been cleared from memory.
|
|
2563
2692
|
* @group Implementation
|
|
2564
2693
|
* @category Serialization
|
|
2565
2694
|
*/
|
|
@@ -2567,7 +2696,8 @@ declare class Secp256k1PrivateKey extends Serializable implements PrivateKey {
|
|
|
2567
2696
|
/**
|
|
2568
2697
|
* Get the private key in bytes (Uint8Array).
|
|
2569
2698
|
*
|
|
2570
|
-
* @returns
|
|
2699
|
+
* @returns Uint8Array representation of the private key
|
|
2700
|
+
* @throws Error if the private key has been cleared from memory.
|
|
2571
2701
|
* @group Implementation
|
|
2572
2702
|
* @category Serialization
|
|
2573
2703
|
*/
|
|
@@ -2576,6 +2706,7 @@ declare class Secp256k1PrivateKey extends Serializable implements PrivateKey {
|
|
|
2576
2706
|
* Get the private key as a string representation.
|
|
2577
2707
|
*
|
|
2578
2708
|
* @returns string representation of the private key
|
|
2709
|
+
* @throws Error if the private key has been cleared from memory.
|
|
2579
2710
|
* @group Implementation
|
|
2580
2711
|
* @category Serialization
|
|
2581
2712
|
*/
|
|
@@ -2584,6 +2715,7 @@ declare class Secp256k1PrivateKey extends Serializable implements PrivateKey {
|
|
|
2584
2715
|
* Get the private key as a hex string with the 0x prefix.
|
|
2585
2716
|
*
|
|
2586
2717
|
* @returns string representation of the private key.
|
|
2718
|
+
* @throws Error if the private key has been cleared from memory.
|
|
2587
2719
|
*/
|
|
2588
2720
|
toHexString(): string;
|
|
2589
2721
|
/**
|
|
@@ -2592,6 +2724,7 @@ declare class Secp256k1PrivateKey extends Serializable implements PrivateKey {
|
|
|
2592
2724
|
* [Read about AIP-80](https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-80.md)
|
|
2593
2725
|
*
|
|
2594
2726
|
* @returns AIP-80 compliant string representation of the private key.
|
|
2727
|
+
* @throws Error if the private key has been cleared from memory.
|
|
2595
2728
|
*/
|
|
2596
2729
|
toAIP80String(): string;
|
|
2597
2730
|
serialize(serializer: Serializer): void;
|
|
@@ -4643,6 +4776,7 @@ declare class Bool extends Serializable implements TransactionArgument {
|
|
|
4643
4776
|
/**
|
|
4644
4777
|
* Serializes the current instance for use in an entry function by converting it to a byte sequence.
|
|
4645
4778
|
* This allows the instance to be properly formatted for serialization in transactions.
|
|
4779
|
+
* Uses the optimized serializeAsBytes method to reduce allocations.
|
|
4646
4780
|
*
|
|
4647
4781
|
* @param serializer - The serializer instance used to serialize the byte sequence.
|
|
4648
4782
|
* @group Implementation
|
|
@@ -4926,6 +5060,7 @@ declare class MoveVector<T extends Serializable & EntryFunctionArgument> extends
|
|
|
4926
5060
|
/**
|
|
4927
5061
|
* Serializes the current instance into a byte sequence suitable for entry functions.
|
|
4928
5062
|
* This allows the data to be properly formatted for transmission or storage.
|
|
5063
|
+
* Uses the optimized serializeAsBytes method to reduce allocations.
|
|
4929
5064
|
*
|
|
4930
5065
|
* @param serializer - The serializer instance used to serialize the byte sequence.
|
|
4931
5066
|
* @group Implementation
|
|
@@ -5651,7 +5786,7 @@ type InputGenerateTransactionPayloadDataWithRemoteABI = InputScriptData | InputE
|
|
|
5651
5786
|
type InputEntryFunctionData = {
|
|
5652
5787
|
function: MoveFunctionId;
|
|
5653
5788
|
typeArguments?: Array<TypeArgument>;
|
|
5654
|
-
functionArguments
|
|
5789
|
+
functionArguments?: Array<EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes>;
|
|
5655
5790
|
abi?: EntryFunctionABI;
|
|
5656
5791
|
};
|
|
5657
5792
|
/**
|
|
@@ -6105,7 +6240,12 @@ declare enum AnyPublicKeyVariant {
|
|
|
6105
6240
|
Secp256k1 = 1,
|
|
6106
6241
|
Secp256r1 = 2,
|
|
6107
6242
|
Keyless = 3,
|
|
6108
|
-
FederatedKeyless = 4
|
|
6243
|
+
FederatedKeyless = 4,
|
|
6244
|
+
/**
|
|
6245
|
+
* Post-quantum signature scheme (SLH-DSA-SHA2-128s).
|
|
6246
|
+
* Note: Full implementation not yet available in this SDK.
|
|
6247
|
+
*/
|
|
6248
|
+
SlhDsaSha2_128s = 5
|
|
6109
6249
|
}
|
|
6110
6250
|
declare function anyPublicKeyVariantToString(variant: AnyPublicKeyVariant): string;
|
|
6111
6251
|
/**
|
|
@@ -6115,7 +6255,12 @@ declare enum AnySignatureVariant {
|
|
|
6115
6255
|
Ed25519 = 0,
|
|
6116
6256
|
Secp256k1 = 1,
|
|
6117
6257
|
WebAuthn = 2,
|
|
6118
|
-
Keyless = 3
|
|
6258
|
+
Keyless = 3,
|
|
6259
|
+
/**
|
|
6260
|
+
* Post-quantum signature scheme (SLH-DSA-SHA2-128s).
|
|
6261
|
+
* Note: Full implementation not yet available in this SDK.
|
|
6262
|
+
*/
|
|
6263
|
+
SlhDsaSha2_128s = 4
|
|
6119
6264
|
}
|
|
6120
6265
|
/**
|
|
6121
6266
|
* Variants of ephemeral public keys used in cryptographic operations.
|
|
@@ -6248,6 +6393,20 @@ interface WhereArg<T extends {}> {
|
|
|
6248
6393
|
*/
|
|
6249
6394
|
/**
|
|
6250
6395
|
* A configuration object for requests to the server, including API key, extra headers, and cookie handling options.
|
|
6396
|
+
*
|
|
6397
|
+
* Security Note: Consider implementing client-side rate limiting in your application to prevent
|
|
6398
|
+
* accidental API abuse. You can use libraries like 'bottleneck' or 'p-queue' to limit request rates.
|
|
6399
|
+
*
|
|
6400
|
+
* @example
|
|
6401
|
+
* ```typescript
|
|
6402
|
+
* import Bottleneck from 'bottleneck';
|
|
6403
|
+
*
|
|
6404
|
+
* // Create a limiter that allows 10 requests per second
|
|
6405
|
+
* const limiter = new Bottleneck({ minTime: 100, maxConcurrent: 5 });
|
|
6406
|
+
*
|
|
6407
|
+
* // Wrap your Aptos calls with the limiter
|
|
6408
|
+
* const result = await limiter.schedule(() => aptos.getAccountInfo({ accountAddress }));
|
|
6409
|
+
* ```
|
|
6251
6410
|
*/
|
|
6252
6411
|
type ClientConfig = ClientHeadersType & {
|
|
6253
6412
|
WITH_CREDENTIALS?: boolean;
|
|
@@ -7491,6 +7650,12 @@ declare class Deserializer {
|
|
|
7491
7650
|
static fromHex(hex: HexInput): Deserializer;
|
|
7492
7651
|
/**
|
|
7493
7652
|
* Reads a specified number of bytes from the buffer and advances the offset.
|
|
7653
|
+
* Returns a view into the buffer rather than copying for better performance.
|
|
7654
|
+
*
|
|
7655
|
+
* SECURITY NOTE: This returns a view, not a copy. Callers that expose the result
|
|
7656
|
+
* externally MUST call .slice() to create a copy. Internal numeric deserializers
|
|
7657
|
+
* (deserializeU8, deserializeU16, etc.) only read values and don't expose the view.
|
|
7658
|
+
* deserializeBytes() and deserializeFixedBytes() call .slice() before returning.
|
|
7494
7659
|
*
|
|
7495
7660
|
* @param length - The number of bytes to read from the buffer.
|
|
7496
7661
|
* @throws Throws an error if the read operation exceeds the buffer's length.
|
|
@@ -7594,7 +7759,8 @@ declare class Deserializer {
|
|
|
7594
7759
|
* The BCS layout for "bytes" consists of a bytes_length followed by the bytes themselves, where bytes_length is a u32 integer
|
|
7595
7760
|
* encoded as a uleb128 integer, indicating the length of the bytes array.
|
|
7596
7761
|
*
|
|
7597
|
-
* @returns {Uint8Array} The deserialized array of bytes.
|
|
7762
|
+
* @returns {Uint8Array} The deserialized array of bytes (a copy, safe to modify).
|
|
7763
|
+
* @throws {Error} If the length exceeds the maximum allowed (10MB) to prevent memory exhaustion.
|
|
7598
7764
|
* @group Implementation
|
|
7599
7765
|
* @category BCS
|
|
7600
7766
|
*/
|
|
@@ -7603,6 +7769,7 @@ declare class Deserializer {
|
|
|
7603
7769
|
* Deserializes an array of bytes of a specified length.
|
|
7604
7770
|
*
|
|
7605
7771
|
* @param len - The number of bytes to read from the source.
|
|
7772
|
+
* @returns {Uint8Array} The deserialized array of bytes (a copy, safe to modify).
|
|
7606
7773
|
* @group Implementation
|
|
7607
7774
|
* @category BCS
|
|
7608
7775
|
*/
|
|
@@ -7747,6 +7914,7 @@ declare class Deserializer {
|
|
|
7747
7914
|
* This function is used for interpreting lengths of variable-length sequences and tags of enum values in BCS encoding.
|
|
7748
7915
|
*
|
|
7749
7916
|
* @throws {Error} Throws an error if the parsed value exceeds the maximum uint32 number.
|
|
7917
|
+
* @throws {Error} Throws an error if the uleb128 encoding is malformed (too many bytes).
|
|
7750
7918
|
* @returns {number} The deserialized uint32 value.
|
|
7751
7919
|
* @group Implementation
|
|
7752
7920
|
* @category BCS
|
|
@@ -7981,4 +8149,4 @@ declare class AccountAbstractionMessage extends Serializable {
|
|
|
7981
8149
|
static deserialize(deserializer: Deserializer): AccountAbstractionMessage;
|
|
7982
8150
|
}
|
|
7983
8151
|
|
|
7984
|
-
export { type InputMultiSigDataWithRemoteABI as $, AccountAddress as A, Bool as B, I16 as C, Deserializer as D, EphemeralPublicKeyVariant as E, FixedBytes as F, I32 as G, type HexInput as H, I8 as I, I64 as J, I128 as K, type LedgerVersionArg as L, MultiKey as M, I256 as N, type InputGenerateTransactionPayloadDataWithRemoteABI as O, PublicKey as P, type InputGenerateTransactionPayloadData as Q, RawTransaction as R, Serializer as S, type InputScriptData as T, U8 as U, type VerifySignatureArgs as V, type MoveFunction as W, TransactionPayloadScript as X, type InputEntryFunctionDataWithRemoteABI as Y, ZkpVariant as Z, TransactionPayloadEntryFunction as _, AccountPublicKey as a, type GetNumberOfDelegatorsResponse as a$, TransactionPayloadMultiSig as a0, type InputEntryFunctionDataWithABI as a1, type InputMultiSigDataWithABI as a2, type InputViewFunctionDataWithRemoteABI as a3, EntryFunction as a4, type InputViewFunctionDataWithABI as a5, type AnyTransactionPayloadInstance as a6, type InputGenerateTransactionOptions as a7, TransactionInnerPayload as a8, type InputGenerateSingleSignerRawTransactionArgs as a9, type GetAccountOwnedTokensQueryResponse as aA, type GetAccountOwnedTokensFromCollectionResponse as aB, type GetAccountCollectionsWithOwnedTokenResponse as aC, type GetAccountCoinsDataResponse as aD, type WhereArg as aE, type GetObjectDataQueryResponse as aF, type PrivateKeyInput as aG, type GetCollectionDataResponse as aH, type GetTokenDataResponse as aI, type GetCurrentTokenOwnershipResponse as aJ, type GetOwnedTokensResponse as aK, type GetTokenActivityResponse as aL, type WaitForTransactionOptions as aM, type UserTransactionResponse as aN, type GetFungibleAssetMetadataResponse as aO, type GetFungibleAssetActivitiesResponse as aP, type GetCurrentFungibleAssetBalancesResponse as aQ, type LedgerInfo as aR, type Block as aS, type MoveValue as aT, type InputViewFunctionData as aU, type InputViewFunctionJsonData as aV, type GetChainTopUserTransactionsResponse as aW, type GraphqlQuery as aX, ProcessorType as aY, type GetProcessorStatusResponse as aZ, type GetANSNameResponse as a_, SimpleTransaction as aa, type InputGenerateMultiAgentRawTransactionArgs as ab, MultiAgentTransaction as ac, type InputSimulateTransactionData as ad, AccountAuthenticatorNoAccountAuthenticator as ae, AccountAuthenticatorEd25519 as af, AccountAuthenticatorSingleKey as ag, AccountAuthenticatorMultiKey as ah, type InputSubmitTransactionData as ai, type TypeArgument as aj, TypeTag as ak, type MoveModule as al, type FunctionABI as am, type EntryFunctionABI as an, type ViewFunctionABI as ao, type AnyRawTransaction as ap, type AnyRawTransactionInstance as aq, type AccountData as ar, type MoveModuleBytecode as as, type CursorPaginationArgs as at, type PaginationArgs as au, type TransactionResponse as av, type MoveResource as aw, type MoveStructId as ax, type TokenStandardArg as ay, type OrderByArg as az, AuthenticationKey as b, TypeTagBool as b$, type GetDelegatedStakingActivitiesResponse as b0, type InputSimulateTransactionOptions as b1, type InputTransactionPluginData as b2, type PendingTransactionResponse as b3, type CommittedTransactionResponse as b4, type GasEstimation as b5, Ed25519PrivateKey as b6, type TableItemRequest as b7, type GetTableItemsDataResponse as b8, type GetTableItemsMetadataResponse as b9, AbstractMultiKey as bA, Secp256k1PublicKey as bB, Secp256k1PrivateKey as bC, Secp256k1Signature as bD, HexInvalidReason as bE, hexToAsciiString as bF, AccountAbstractionMessage as bG, ChainId as bH, Identifier as bI, ModuleId as bJ, RawTransactionWithData as bK, MultiAgentRawTransaction as bL, FeePayerRawTransaction as bM, type TransactionArgument as bN, type ScriptFunctionArgument as bO, deserializeFromScriptArgument as bP, TransactionPayload as bQ, Script as bR, MultiSig as bS, MultiSigTransactionPayload as bT, TransactionInnerPayloadV1 as bU, TransactionExecutable as bV, TransactionExecutableScript as bW, TransactionExecutableEntryFunction as bX, TransactionExecutableEmpty as bY, TransactionExtraConfig as bZ, TransactionExtraConfigV1 as b_, SigningScheme as ba, SigningSchemeInput as bb, AnySignature as bc, type EntryFunctionArgument as bd, MultiKeySignature as be, AccountAuthenticatorMultiEd25519 as bf, AccountAuthenticatorAbstraction as bg, type MoveFunctionId as bh, type ClientRequest as bi, type Client as bj, type ClientResponse as bk, type AptosRequest as bl, AptosApiType as bm, type AptosResponse as bn, MimeType as bo, type ClientConfig as bp, type Deserializable as bq, ensureBoolean as br, outOfRangeErrorMessage as bs, validateNumberInRange as bt, Serialized as bu, MoveOption as bv, AddressInvalidReason as bw, ParsingError as bx, type ParsingResult as by, isCanonicalEd25519Signature as bz, type VerifySignatureAsyncArgs as c, type Int128 as c$, TypeTagU8 as c0, TypeTagI8 as c1, TypeTagU16 as c2, TypeTagI16 as c3, TypeTagU32 as c4, TypeTagI32 as c5, TypeTagU64 as c6, TypeTagI64 as c7, TypeTagU128 as c8, TypeTagI128 as c9, type OrderBy as cA, type OrderByValue as cB, type TokenStandard as cC, TypeTagVariants as cD, ScriptTransactionArgumentVariants as cE, TransactionPayloadVariants as cF, TransactionInnerPayloadVariants as cG, TransactionExecutableVariants as cH, TransactionExtraConfigVariants as cI, TransactionVariants as cJ, TransactionAuthenticatorVariant as cK, AccountAuthenticatorVariant as cL, PrivateKeyVariants as cM, AnyPublicKeyVariant as cN, anyPublicKeyVariantToString as cO, AnySignatureVariant as cP, EphemeralSignatureVariant as cQ, type Uint8 as cR, type Uint16 as cS, type Uint32 as cT, type Uint64 as cU, type Uint128 as cV, type Uint256 as cW, type Int8 as cX, type Int16 as cY, type Int32 as cZ, type Int64 as c_, TypeTagU256 as ca, TypeTagI256 as cb, TypeTagAddress as cc, TypeTagSigner as cd, TypeTagReference as ce, TypeTagGeneric as cf, TypeTagVector as cg, TypeTagStruct as ch, StructTag as ci, aptosCoinStructTag as cj, stringStructTag as ck, optionStructTag as cl, objectStructTag as cm, type ScriptFunctionArgumentTypes as cn, type InputGenerateSequenceNumberTransactionOptions as co, type InputGenerateOrderlessTransactionOptions as cp, type InputEntryFunctionData as cq, type InputGenerateTransactionPayloadDataWithABI as cr, type InputMultiSigData as cs, type ViewFunctionJsonPayload as ct, type InputGenerateRawTransactionArgs as cu, type InputGenerateSingleSignerRawTransactionData as cv, type InputGenerateMultiAgentRawTransactionData as cw, type InputGenerateTransactionData as cx, type GetAccountAddressesForAuthKeyResponse as cy, type GetEventsResponse as cz, Signature as d, type MoveUint128Type as d$, type Int256 as d0, type AptosSettings as d1, type FullNodeConfig as d2, type IndexerConfig as d3, type FaucetConfig as d4, type TransactionGenerationConfig as d5, type ClientHeadersType as d6, type PluginConfig as d7, type PluginSettings as d8, type TransactionSubmitter as d9, type ScriptPayloadResponse as dA, type MultisigPayloadResponse as dB, type GenesisPayload as dC, type MoveScriptBytecode as dD, type TransactionSignature as dE, isEd25519Signature as dF, isSecp256k1Signature as dG, isMultiAgentSignature as dH, isFeePayerSignature as dI, isMultiEd25519Signature as dJ, isSingleSenderSignature as dK, type TransactionEd25519Signature as dL, type TransactionSecp256k1Signature as dM, type TransactionSingleSenderSignature as dN, type TransactionMultiEd25519Signature as dO, type TransactionMultiAgentSignature as dP, type TransactionFeePayerSignature as dQ, type AccountSignature as dR, type WriteSet as dS, type ScriptWriteSet as dT, type DirectWriteSet as dU, type EventGuid as dV, type Event as dW, type MoveUint8Type as dX, type MoveUint16Type as dY, type MoveUint32Type as dZ, type MoveUint64Type as d_, TransactionResponseType as da, isPendingTransactionResponse as db, isUserTransactionResponse as dc, isGenesisTransactionResponse as dd, isBlockMetadataTransactionResponse as de, isStateCheckpointTransactionResponse as df, isValidatorTransactionResponse as dg, isBlockEpilogueTransactionResponse as dh, type GenesisTransactionResponse as di, type BlockMetadataTransactionResponse as dj, type StateCheckpointTransactionResponse as dk, type ValidatorTransactionResponse as dl, type BlockEndInfo as dm, type BlockEpilogueTransactionResponse as dn, type WriteSetChange as dp, type WriteSetChangeDeleteModule as dq, type WriteSetChangeDeleteResource as dr, type WriteSetChangeDeleteTableItem as ds, type WriteSetChangeWriteModule as dt, type WriteSetChangeWriteResource as du, type WriteSetChangeWriteTableItem as dv, type DecodedTableData as dw, type DeletedTableData as dx, type TransactionPayloadResponse as dy, type EntryFunctionPayloadResponse as dz, AptosConfig as e, type MoveUint256Type as e0, type MoveInt8Type as e1, type MoveInt16Type as e2, type MoveInt32Type as e3, type MoveInt64Type as e4, type MoveInt128Type as e5, type MoveInt256Type as e6, type MoveAddressType as e7, type MoveObjectType as e8, type MoveOptionType as e9, APTOS_FA as eA, RAW_TRANSACTION_SALT as eB, RAW_TRANSACTION_WITH_DATA_SALT as eC, ACCOUNT_ABSTRACTION_SIGNING_DATA_SALT as eD, FIREBASE_AUTH_ISS_PATTERN as eE, type MoveStructType as ea, type MoveType as eb, type MoveModuleId as ec, MoveFunctionVisibility as ed, MoveAbility as ee, type MoveFunctionGenericTypeParam as ef, type MoveStructField as eg, type MoveStruct as eh, RoleType as ei, type AuthenticationKeyScheme as ej, DeriveScheme as ek, type GenerateAccountWithEd25519 as el, type GenerateAccountWithSingleSignerSecp256k1Key as em, type GenerateAccount as en, NetworkToIndexerAPI as eo, NetworkToNodeAPI as ep, NetworkToFaucetAPI as eq, NetworkToPepperAPI as er, NetworkToProverAPI as es, Network as et, NetworkToChainId as eu, NetworkToNetworkName as ev, DEFAULT_MAX_GAS_AMOUNT as ew, DEFAULT_TXN_EXP_SEC_FROM_NOW as ex, DEFAULT_TXN_TIMEOUT_SEC as ey, APTOS_COIN as ez, Serializable as f, EphemeralCertificateVariant as g, type AccountAddressInput as h, PrivateKey as i, Hex as j, Ed25519PublicKey as k, AnyPublicKey as l, MultiEd25519PublicKey as m, Ed25519Signature as n, MultiEd25519Signature as o, AccountAuthenticator as p, MoveString as q, MoveVector as r, U64 as s, type AnyNumber as t, type SimpleEntryFunctionArgumentTypes as u, type EntryFunctionArgumentTypes as v, U16 as w, U32 as x, U128 as y, U256 as z };
|
|
8152
|
+
export { MultiAgentTransaction as $, AccountAddress as A, Bool as B, I64 as C, Deserializer as D, EphemeralPublicKeyVariant as E, FixedBytes as F, I8 as G, type HexInput as H, I128 as I, U128 as J, U16 as K, type LedgerVersionArg as L, MultiKey as M, U256 as N, U32 as O, PublicKey as P, type InputGenerateTransactionPayloadDataWithRemoteABI as Q, RawTransaction as R, Serializer as S, type InputGenerateTransactionPayloadData as T, U8 as U, type VerifySignatureArgs as V, type InputScriptData as W, type InputGenerateSingleSignerRawTransactionArgs as X, SimpleTransaction as Y, ZkpVariant as Z, type InputGenerateMultiAgentRawTransactionArgs as _, AccountPublicKey as a, type GetNumberOfDelegatorsResponse as a$, type AnyTransactionPayloadInstance as a0, TransactionInnerPayload as a1, type InputGenerateTransactionOptions as a2, type InputSubmitTransactionData as a3, type InputSimulateTransactionData as a4, TransactionPayloadScript as a5, type InputEntryFunctionDataWithRemoteABI as a6, TransactionPayloadEntryFunction as a7, type InputMultiSigDataWithRemoteABI as a8, TransactionPayloadMultiSig as a9, type GetAccountOwnedTokensQueryResponse as aA, type GetAccountOwnedTokensFromCollectionResponse as aB, type GetAccountCollectionsWithOwnedTokenResponse as aC, type GetAccountCoinsDataResponse as aD, type WhereArg as aE, type GetObjectDataQueryResponse as aF, type PrivateKeyInput as aG, type GetCollectionDataResponse as aH, type GetTokenDataResponse as aI, type GetCurrentTokenOwnershipResponse as aJ, type GetOwnedTokensResponse as aK, type GetTokenActivityResponse as aL, type WaitForTransactionOptions as aM, type UserTransactionResponse as aN, type GetFungibleAssetMetadataResponse as aO, type GetFungibleAssetActivitiesResponse as aP, type GetCurrentFungibleAssetBalancesResponse as aQ, type LedgerInfo as aR, type Block as aS, type MoveValue as aT, type InputViewFunctionData as aU, type InputViewFunctionJsonData as aV, type GetChainTopUserTransactionsResponse as aW, type GraphqlQuery as aX, ProcessorType as aY, type GetProcessorStatusResponse as aZ, type InputEntryFunctionData as a_, type InputEntryFunctionDataWithABI as aa, type InputMultiSigDataWithABI as ab, type InputViewFunctionDataWithRemoteABI as ac, EntryFunction as ad, type InputViewFunctionDataWithABI as ae, AccountAuthenticatorNoAccountAuthenticator as af, AccountAuthenticatorEd25519 as ag, AccountAuthenticatorSingleKey as ah, AccountAuthenticatorMultiKey as ai, TypeTag as aj, type MoveModule as ak, type FunctionABI as al, type EntryFunctionABI as am, type ViewFunctionABI as an, type TypeArgument as ao, type AnyRawTransaction as ap, type AnyRawTransactionInstance as aq, type AccountData as ar, type MoveModuleBytecode as as, type CursorPaginationArgs as at, type PaginationArgs as au, type TransactionResponse as av, type MoveResource as aw, type MoveStructId as ax, type TokenStandardArg as ay, type OrderByArg as az, AuthenticationKey as b, type GenesisPayload as b$, type GetDelegatedStakingActivitiesResponse as b0, type InputSimulateTransactionOptions as b1, type InputTransactionPluginData as b2, type PendingTransactionResponse as b3, type CommittedTransactionResponse as b4, type GasEstimation as b5, Ed25519PrivateKey as b6, type TableItemRequest as b7, type GetTableItemsDataResponse as b8, type GetTableItemsMetadataResponse as b9, AnySignatureVariant as bA, type AptosSettings as bB, type AuthenticationKeyScheme as bC, type BlockEndInfo as bD, type BlockEpilogueTransactionResponse as bE, type BlockMetadataTransactionResponse as bF, ChainId as bG, type ClientHeadersType as bH, DEFAULT_MAX_GAS_AMOUNT as bI, DEFAULT_TXN_EXP_SEC_FROM_NOW as bJ, DEFAULT_TXN_TIMEOUT_SEC as bK, type DecodedTableData as bL, type DeletedTableData as bM, DeriveScheme as bN, type Deserializable as bO, type DirectWriteSet as bP, type EntryFunctionPayloadResponse as bQ, EphemeralSignatureVariant as bR, type Event as bS, type EventGuid as bT, FIREBASE_AUTH_ISS_PATTERN as bU, type FaucetConfig as bV, FeePayerRawTransaction as bW, type FullNodeConfig as bX, type GenerateAccount as bY, type GenerateAccountWithEd25519 as bZ, type GenerateAccountWithSingleSignerSecp256k1Key as b_, SigningScheme as ba, SigningSchemeInput as bb, AnySignature as bc, type GetANSNameResponse as bd, type EntryFunctionArgument as be, MultiKeySignature as bf, AccountAuthenticatorMultiEd25519 as bg, AccountAuthenticatorAbstraction as bh, type MoveFunctionId as bi, type AptosRequest as bj, AptosApiType as bk, type AptosResponse as bl, type ClientRequest as bm, type Client as bn, type ClientResponse as bo, MimeType as bp, type ClientConfig as bq, ACCOUNT_ABSTRACTION_SIGNING_DATA_SALT as br, APTOS_COIN as bs, APTOS_FA as bt, AbstractMultiKey as bu, AccountAbstractionMessage as bv, AccountAuthenticatorVariant as bw, type AccountSignature as bx, AddressInvalidReason as by, AnyPublicKeyVariant as bz, type VerifySignatureAsyncArgs as c, type PluginConfig as c$, type GenesisTransactionResponse as c0, type GetAccountAddressesForAuthKeyResponse as c1, type GetEventsResponse as c2, HexInvalidReason as c3, Identifier as c4, type IndexerConfig as c5, type InputGenerateMultiAgentRawTransactionData as c6, type InputGenerateOrderlessTransactionOptions as c7, type InputGenerateRawTransactionArgs as c8, type InputGenerateSequenceNumberTransactionOptions as c9, type MoveScriptBytecode as cA, type MoveStruct as cB, type MoveStructField as cC, type MoveStructType as cD, type MoveType as cE, type MoveUint128Type as cF, type MoveUint16Type as cG, type MoveUint256Type as cH, type MoveUint32Type as cI, type MoveUint64Type as cJ, type MoveUint8Type as cK, MultiAgentRawTransaction as cL, MultiSig as cM, MultiSigTransactionPayload as cN, type MultisigPayloadResponse as cO, Network as cP, NetworkToChainId as cQ, NetworkToFaucetAPI as cR, NetworkToIndexerAPI as cS, NetworkToNetworkName as cT, NetworkToNodeAPI as cU, NetworkToPepperAPI as cV, NetworkToProverAPI as cW, type OrderBy as cX, type OrderByValue as cY, ParsingError as cZ, type ParsingResult as c_, type InputGenerateSingleSignerRawTransactionData as ca, type InputGenerateTransactionData as cb, type InputGenerateTransactionPayloadDataWithABI as cc, type InputMultiSigData as cd, type Int128 as ce, type Int16 as cf, type Int256 as cg, type Int32 as ch, type Int64 as ci, type Int8 as cj, MIN_MAX_GAS_AMOUNT as ck, ModuleId as cl, MoveAbility as cm, type MoveAddressType as cn, type MoveFunctionGenericTypeParam as co, MoveFunctionVisibility as cp, type MoveInt128Type as cq, type MoveInt16Type as cr, type MoveInt256Type as cs, type MoveInt32Type as ct, type MoveInt64Type as cu, type MoveInt8Type as cv, type MoveModuleId as cw, type MoveObjectType as cx, MoveOption as cy, type MoveOptionType as cz, Signature as d, TypeTagU8 as d$, type PluginSettings as d0, PrivateKeyVariants as d1, RAW_TRANSACTION_SALT as d2, RAW_TRANSACTION_WITH_DATA_SALT as d3, RawTransactionWithData as d4, RoleType as d5, Script as d6, type ScriptFunctionArgument as d7, type ScriptFunctionArgumentTypes as d8, type ScriptPayloadResponse as d9, type TransactionMultiEd25519Signature as dA, TransactionPayload as dB, type TransactionPayloadResponse as dC, TransactionPayloadVariants as dD, TransactionResponseType as dE, type TransactionSecp256k1Signature as dF, type TransactionSignature as dG, type TransactionSingleSenderSignature as dH, type TransactionSubmitter as dI, TransactionVariants as dJ, TypeTagAddress as dK, TypeTagBool as dL, TypeTagGeneric as dM, TypeTagI128 as dN, TypeTagI16 as dO, TypeTagI256 as dP, TypeTagI32 as dQ, TypeTagI64 as dR, TypeTagI8 as dS, TypeTagReference as dT, TypeTagSigner as dU, TypeTagStruct as dV, TypeTagU128 as dW, TypeTagU16 as dX, TypeTagU256 as dY, TypeTagU32 as dZ, TypeTagU64 as d_, ScriptTransactionArgumentVariants as da, type ScriptWriteSet as db, Secp256k1PrivateKey as dc, Secp256k1PublicKey as dd, Secp256k1Signature as de, Serialized as df, type StateCheckpointTransactionResponse as dg, StructTag as dh, type TokenStandard as di, type TransactionArgument as dj, TransactionAuthenticatorVariant as dk, type TransactionEd25519Signature as dl, TransactionExecutable as dm, TransactionExecutableEmpty as dn, TransactionExecutableEntryFunction as dp, TransactionExecutableScript as dq, TransactionExecutableVariants as dr, TransactionExtraConfig as ds, TransactionExtraConfigV1 as dt, TransactionExtraConfigVariants as du, type TransactionFeePayerSignature as dv, type TransactionGenerationConfig as dw, TransactionInnerPayloadV1 as dx, TransactionInnerPayloadVariants as dy, type TransactionMultiAgentSignature as dz, AptosConfig as e, TypeTagVariants as e0, TypeTagVector as e1, type Uint128 as e2, type Uint16 as e3, type Uint256 as e4, type Uint32 as e5, type Uint64 as e6, type Uint8 as e7, type ValidatorTransactionResponse as e8, type ViewFunctionJsonPayload as e9, isValidatorTransactionResponse as eA, objectStructTag as eB, optionStructTag as eC, outOfRangeErrorMessage as eD, stringStructTag as eE, validateNumberInRange as eF, type WriteSet as ea, type WriteSetChange as eb, type WriteSetChangeDeleteModule as ec, type WriteSetChangeDeleteResource as ed, type WriteSetChangeDeleteTableItem as ee, type WriteSetChangeWriteModule as ef, type WriteSetChangeWriteResource as eg, type WriteSetChangeWriteTableItem as eh, anyPublicKeyVariantToString as ei, aptosCoinStructTag as ej, deserializeFromScriptArgument as ek, ensureBoolean as el, hexToAsciiString as em, isBlockEpilogueTransactionResponse as en, isBlockMetadataTransactionResponse as eo, isCanonicalEd25519Signature as ep, isEd25519Signature as eq, isFeePayerSignature as er, isGenesisTransactionResponse as es, isMultiAgentSignature as et, isMultiEd25519Signature as eu, isPendingTransactionResponse as ev, isSecp256k1Signature as ew, isSingleSenderSignature as ex, isStateCheckpointTransactionResponse as ey, isUserTransactionResponse as ez, Serializable as f, EphemeralCertificateVariant as g, type AccountAddressInput as h, PrivateKey as i, Hex as j, Ed25519PublicKey as k, AnyPublicKey as l, MultiEd25519PublicKey as m, Ed25519Signature as n, MultiEd25519Signature as o, AccountAuthenticator as p, MoveString as q, MoveVector as r, U64 as s, type AnyNumber as t, type SimpleEntryFunctionArgumentTypes as u, type MoveFunction as v, type EntryFunctionArgumentTypes as w, I16 as x, I256 as y, I32 as z };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var $=Object.defineProperty;var X=Object.getOwnPropertyDescriptor;var g=(r,e,t,n)=>{for(var s=n>1?void 0:n?X(e,t):e,o=r.length-1,a;o>=0;o--)(a=r[o])&&(s=(n?a(e,t,s):a(s))||s);return n&&s&&$(e,t,s),s};var d=class extends Error{constructor(e,t){super(e),this.invalidReason=t}};var _utils = require('@noble/hashes/utils');var K=(n=>(n.TOO_SHORT="too_short",n.INVALID_LENGTH="invalid_length",n.INVALID_HEX_CHARS="invalid_hex_chars",n))(K||{}),f= exports.v =class r{constructor(e){this.data=e}toUint8Array(){return this.data}toStringWithoutPrefix(){return _utils.bytesToHex.call(void 0, this.data)}toString(){return`0x${this.toStringWithoutPrefix()}`}static fromHexString(e){let t=e;if(t.startsWith("0x")&&(t=t.slice(2)),t.length===0)throw new d("Hex string is too short, must be at least 1 char long, excluding the optional leading 0x.","too_short");if(t.length%2!==0)throw new d("Hex string must be an even number of hex characters.","invalid_length");try{return new r(_utils.hexToBytes.call(void 0, t))}catch(n){throw new d(`Hex string contains invalid hex characters: ${_optionalChain([n, 'optionalAccess', _2 => _2.message])}`,"invalid_hex_chars")}}static fromHexInput(e){return e instanceof Uint8Array?new r(e):r.fromHexString(e)}static hexInputToUint8Array(e){return e instanceof Uint8Array?e:r.fromHexString(e).toUint8Array()}static hexInputToString(e){return r.fromHexInput(e).toString()}static hexInputToStringWithoutPrefix(e){return r.fromHexInput(e).toStringWithoutPrefix()}static isValid(e){try{return r.fromHexString(e),{valid:!0}}catch(t){return{valid:!1,invalidReason:_optionalChain([t, 'optionalAccess', _3 => _3.invalidReason]),invalidReasonMessage:_optionalChain([t, 'optionalAccess', _4 => _4.message])}}}equals(e){return this.data.length!==e.data.length?!1:this.data.every((t,n)=>t===e.data[n])}},De= exports.w =r=>new TextDecoder().decode(f.fromHexInput(r).toUint8Array());var M=255,U= exports.c =65535,x= exports.d =4294967295,m= exports.e =18446744073709551615n,I= exports.f =340282366920938463463374607431768211455n,T= exports.g =115792089237316195423570985008687907853269984665640564039457584007913129639935n,N= exports.h =-128,B= exports.i =127,E= exports.j =-32768,w= exports.k =32767,k= exports.l =-2147483648,C= exports.m =2147483647,O= exports.n =-9223372036854775808n,z= exports.o =9223372036854775807n,D= exports.p =-170141183460469231731687303715884105728n,G= exports.q =170141183460469231731687303715884105727n,F= exports.r =-57896044618658097711785492504343953926634992332820282019728792003956564819968n,H= exports.s =57896044618658097711785492504343953926634992332820282019728792003956564819967n;var b=class{bcsToBytes(){let e=new c;return this.serialize(e),e.toUint8Array()}bcsToHex(){let e=this.bcsToBytes();return f.fromHexInput(e)}toStringWithoutPrefix(){return this.bcsToHex().toStringWithoutPrefix()}toString(){return`0x${this.toStringWithoutPrefix()}`}},Y=256,Z=new TextEncoder,A=[],Q=8;function J(){let r=A.pop();return r?(r.reset(),r):new c}function V(r){A.length<Q&&A.push(r)}var c=class{constructor(e=64){if(e<=0)throw new Error("Length needs to be greater than 0");this.buffer=new ArrayBuffer(e),this.dataView=new DataView(this.buffer),this.offset=0}ensureBufferWillHandleSize(e){let t=this.offset+e;if(this.buffer.byteLength>=t)return;let n=Math.max(Math.floor(this.buffer.byteLength*1.5),t+Y),s=new ArrayBuffer(n);new Uint8Array(s).set(new Uint8Array(this.buffer,0,this.offset)),this.buffer=s,this.dataView=new DataView(this.buffer)}appendToBuffer(e){this.ensureBufferWillHandleSize(e.length),new Uint8Array(this.buffer,this.offset).set(e),this.offset+=e.length}serializeWithFunction(e,t,n){this.ensureBufferWillHandleSize(t),e.apply(this.dataView,[this.offset,n,!0]),this.offset+=t}serializeStr(e){this.serializeBytes(Z.encode(e))}serializeBytes(e){this.serializeU32AsUleb128(e.length),this.appendToBuffer(e)}serializeFixedBytes(e){this.appendToBuffer(e)}serializeBool(e){ee(e);let t=e?1:0;this.appendToBuffer(new Uint8Array([t]))}serializeU8(e){this.appendToBuffer(new Uint8Array([e]))}serializeU16(e){this.serializeWithFunction(DataView.prototype.setUint16,2,e)}serializeU32(e){this.serializeWithFunction(DataView.prototype.setUint32,4,e)}serializeU64(e){let t=BigInt(e)&BigInt(x),n=BigInt(e)>>BigInt(32);this.serializeU32(Number(t)),this.serializeU32(Number(n))}serializeU128(e){let t=BigInt(e)&m,n=BigInt(e)>>BigInt(64);this.serializeU64(t),this.serializeU64(n)}serializeU256(e){let t=BigInt(e)&I,n=BigInt(e)>>BigInt(128);this.serializeU128(t),this.serializeU128(n)}serializeI8(e){this.serializeWithFunction(DataView.prototype.setInt8,1,e)}serializeI16(e){this.serializeWithFunction(DataView.prototype.setInt16,2,e)}serializeI32(e){this.serializeWithFunction(DataView.prototype.setInt32,4,e)}serializeI64(e){let t=BigInt(e),n=t<0?(BigInt(1)<<BigInt(64))+t:t,s=n&BigInt(x),o=n>>BigInt(32);this.serializeU32(Number(s)),this.serializeU32(Number(o))}serializeI128(e){let t=BigInt(e),n=t<0?(BigInt(1)<<BigInt(128))+t:t,s=n&m,o=n>>BigInt(64);this.serializeU64(s),this.serializeU64(o)}serializeI256(e){let t=BigInt(e),n=t<0?(BigInt(1)<<BigInt(256))+t:t,s=n&I,o=n>>BigInt(128);this.serializeU128(s),this.serializeU128(o)}serializeU32AsUleb128(e){let t=e,n=[];for(;t>>>7;)n.push(t&127|128),t>>>=7;n.push(t),this.appendToBuffer(new Uint8Array(n))}toUint8Array(){return new Uint8Array(this.buffer,0,this.offset).slice()}reset(){this.offset>0&&new Uint8Array(this.buffer,0,this.offset).fill(0),this.offset=0}getOffset(){return this.offset}toUint8ArrayView(){return new Uint8Array(this.buffer,0,this.offset)}serialize(e){e.serialize(this)}serializeAsBytes(e){let t=J();try{e.serialize(t);let n=t.toUint8ArrayView();this.serializeBytes(n)}finally{V(t)}}serializeVector(e){this.serializeU32AsUleb128(e.length),e.forEach(t=>{t.serialize(this)})}serializeOption(e,t){let n=e!==void 0;this.serializeBool(n),n&&(typeof e=="string"?this.serializeStr(e):e instanceof Uint8Array?t!==void 0?this.serializeFixedBytes(e):this.serializeBytes(e):e.serialize(this))}serializeOptionStr(e){e===void 0?this.serializeU32AsUleb128(0):(this.serializeU32AsUleb128(1),this.serializeStr(e))}};g([l(0,M)],c.prototype,"serializeU8",1),g([l(0,U)],c.prototype,"serializeU16",1),g([l(0,x)],c.prototype,"serializeU32",1),g([l(BigInt(0),m)],c.prototype,"serializeU64",1),g([l(BigInt(0),I)],c.prototype,"serializeU128",1),g([l(BigInt(0),T)],c.prototype,"serializeU256",1),g([l(N,B)],c.prototype,"serializeI8",1),g([l(E,w)],c.prototype,"serializeI16",1),g([l(k,C)],c.prototype,"serializeI32",1),g([l(O,z)],c.prototype,"serializeI64",1),g([l(D,G)],c.prototype,"serializeI128",1),g([l(F,H)],c.prototype,"serializeI256",1),g([l(0,x)],c.prototype,"serializeU32AsUleb128",1);function ee(r){if(typeof r!="boolean")throw new Error(`${r} is not a boolean value`)}var te=(r,e,t)=>`${r} is out of range: [${e}, ${t}]`;function re(r,e,t){let n=BigInt(r);if(n>BigInt(t)||n<BigInt(e))throw new Error(te(r,e,t))}function l(r,e){return(t,n,s)=>{let o=s.value;return s.value=function(_){return re(_,r,e),o.apply(this,[_])},s}}var ne=(s=>(s.JSON="application/json",s.BCS="application/x-bcs",s.BCS_SIGNED_TRANSACTION="application/x.aptos.signed_transaction+bcs",s.BCS_VIEW_FUNCTION="application/x.aptos.view_function+bcs",s))(ne||{}),se= exports.D =(i=>(i[i.Bool=0]="Bool",i[i.U8=1]="U8",i[i.U64=2]="U64",i[i.U128=3]="U128",i[i.Address=4]="Address",i[i.Signer=5]="Signer",i[i.Vector=6]="Vector",i[i.Struct=7]="Struct",i[i.U16=8]="U16",i[i.U32=9]="U32",i[i.U256=10]="U256",i[i.I8=11]="I8",i[i.I16=12]="I16",i[i.I32=13]="I32",i[i.I64=14]="I64",i[i.I128=15]="I128",i[i.I256=16]="I256",i[i.Reference=254]="Reference",i[i.Generic=255]="Generic",i))(se||{}),W= exports.E =(p=>(p[p.U8=0]="U8",p[p.U64=1]="U64",p[p.U128=2]="U128",p[p.Address=3]="Address",p[p.U8Vector=4]="U8Vector",p[p.Bool=5]="Bool",p[p.U16=6]="U16",p[p.U32=7]="U32",p[p.U256=8]="U256",p[p.Serialized=9]="Serialized",p[p.I8=10]="I8",p[p.I16=11]="I16",p[p.I32=12]="I32",p[p.I64=13]="I64",p[p.I128=14]="I128",p[p.I256=15]="I256",p))(W||{}),oe= exports.F =(s=>(s[s.Script=0]="Script",s[s.EntryFunction=2]="EntryFunction",s[s.Multisig=3]="Multisig",s[s.Payload=4]="Payload",s))(oe||{}),ie= exports.G =(e=>(e[e.V1=0]="V1",e))(ie||{}),ae= exports.H =(n=>(n[n.Script=0]="Script",n[n.EntryFunction=1]="EntryFunction",n[n.Empty=2]="Empty",n))(ae||{}),pe= exports.I =(e=>(e[e.V1=0]="V1",e))(pe||{}),ue= exports.J =(t=>(t[t.MultiAgentTransaction=0]="MultiAgentTransaction",t[t.FeePayerTransaction=1]="FeePayerTransaction",t))(ue||{}),ce= exports.K =(o=>(o[o.Ed25519=0]="Ed25519",o[o.MultiEd25519=1]="MultiEd25519",o[o.MultiAgent=2]="MultiAgent",o[o.FeePayer=3]="FeePayer",o[o.SingleSender=4]="SingleSender",o))(ce||{}),de= exports.L =(a=>(a[a.Ed25519=0]="Ed25519",a[a.MultiEd25519=1]="MultiEd25519",a[a.SingleKey=2]="SingleKey",a[a.MultiKey=3]="MultiKey",a[a.NoAccountAuthenticator=4]="NoAccountAuthenticator",a[a.Abstraction=5]="Abstraction",a))(de||{}),ge= exports.M =(n=>(n.Ed25519="ed25519",n.Secp256k1="secp256k1",n.Secp256r1="secp256r1",n))(ge||{}),le= exports.N =(a=>(a[a.Ed25519=0]="Ed25519",a[a.Secp256k1=1]="Secp256k1",a[a.Secp256r1=2]="Secp256r1",a[a.Keyless=3]="Keyless",a[a.FederatedKeyless=4]="FederatedKeyless",a[a.SlhDsaSha2_128s=5]="SlhDsaSha2_128s",a))(le||{});function $e(r){switch(r){case 0:return"ed25519";case 1:return"secp256k1";case 2:return"secp256r1";case 3:return"keyless";case 4:return"federated_keyless";case 5:return"slh_dsa_sha2_128s";default:throw new Error("Unknown public key variant")}}var ye=(o=>(o[o.Ed25519=0]="Ed25519",o[o.Secp256k1=1]="Secp256k1",o[o.WebAuthn=2]="WebAuthn",o[o.Keyless=3]="Keyless",o[o.SlhDsaSha2_128s=4]="SlhDsaSha2_128s",o))(ye||{}),_e= exports.Q =(e=>(e[e.Ed25519=0]="Ed25519",e))(_e||{}),he= exports.R =(e=>(e[e.Ed25519=0]="Ed25519",e))(he||{}),fe= exports.S =(e=>(e[e.ZkProof=0]="ZkProof",e))(fe||{}),xe= exports.T =(e=>(e[e.Groth16=0]="Groth16",e))(xe||{}),me= exports.U =(_=>(_.Pending="pending_transaction",_.User="user_transaction",_.Genesis="genesis_transaction",_.BlockMetadata="block_metadata_transaction",_.StateCheckpoint="state_checkpoint_transaction",_.Validator="validator_transaction",_.BlockEpilogue="block_epilogue_transaction",_))(me||{});function Xe(r){return r.type==="pending_transaction"}function qe(r){return r.type==="user_transaction"}function je(r){return r.type==="genesis_transaction"}function Ke(r){return r.type==="block_metadata_transaction"}function Ye(r){return r.type==="state_checkpoint_transaction"}function Ze(r){return r.type==="validator_transaction"}function Qe(r){return r.type==="block_epilogue_transaction"}function Je(r){return"signature"in r&&r.type==="ed25519_signature"}function Ve(r){return"signature"in r&&r.signature==="secp256k1_ecdsa_signature"}function et(r){return r.type==="multi_agent_signature"}function tt(r){return r.type==="fee_payer_signature"}function rt(r){return r.type==="multi_ed25519_signature"}function nt(r){return r.type==="single_sender"}var Ie=(n=>(n.PRIVATE="private",n.PUBLIC="public",n.FRIEND="friend",n))(Ie||{}),be= exports.ha =(s=>(s.STORE="store",s.DROP="drop",s.KEY="key",s.COPY="copy",s))(be||{}),Ae= exports.ia =(t=>(t.VALIDATOR="validator",t.FULL_NODE="full_node",t))(Ae||{}),Se= exports.ja =(s=>(s[s.Ed25519=0]="Ed25519",s[s.MultiEd25519=1]="MultiEd25519",s[s.SingleKey=2]="SingleKey",s[s.MultiKey=3]="MultiKey",s))(Se||{}),ve= exports.ka =(t=>(t[t.Ed25519=0]="Ed25519",t[t.Secp256k1Ecdsa=2]="Secp256k1Ecdsa",t))(ve||{}),P= exports.la =(o=>(o[o.DeriveAuid=251]="DeriveAuid",o[o.DeriveObjectAddressFromObject=252]="DeriveObjectAddressFromObject",o[o.DeriveObjectAddressFromGuid=253]="DeriveObjectAddressFromGuid",o[o.DeriveObjectAddressFromSeed=254]="DeriveObjectAddressFromSeed",o[o.DeriveResourceAccountAddress=255]="DeriveResourceAccountAddress",o))(P||{});var Re=(t=>(t[t.Independent=0]="Independent",t[t.FollowsDomain=1]="FollowsDomain",t))(Re||{}),Me= exports.na =(n=>(n.Expired="expired",n.InGracePeriod="in_grace_period",n.Active="active",n))(Me||{});var Te=(h=>(h.INCORRECT_NUMBER_OF_BYTES="incorrect_number_of_bytes",h.INVALID_HEX_CHARS="invalid_hex_chars",h.TOO_SHORT="too_short",h.TOO_LONG="too_long",h.LEADING_ZERO_X_REQUIRED="leading_zero_x_required",h.LONG_FORM_REQUIRED_UNLESS_SPECIAL="long_form_required_unless_special",h.INVALID_PADDING_ZEROES="INVALID_PADDING_ZEROES",h.INVALID_PADDING_STRICTNESS="INVALID_PADDING_STRICTNESS",h))(Te||{}),u=class u extends b{constructor(e){if(super(),e.length!==u.LENGTH)throw new d("AccountAddress data should be exactly 32 bytes long","incorrect_number_of_bytes");this.data=e}isSpecial(){return this.data.slice(0,this.data.length-1).every(e=>e===0)&&this.data[this.data.length-1]<16}toString(){return`0x${this.toStringWithoutPrefix()}`}toStringWithoutPrefix(){let e=_utils.bytesToHex.call(void 0, this.data);return this.isSpecial()&&(e=e[e.length-1]),e}toStringLong(){return`0x${this.toStringLongWithoutPrefix()}`}toStringLongWithoutPrefix(){return _utils.bytesToHex.call(void 0, this.data)}toStringShort(){return`0x${this.toStringShortWithoutPrefix()}`}toStringShortWithoutPrefix(){let e=_utils.bytesToHex.call(void 0, this.data).replace(/^0+/,"");return e===""?"0":e}toUint8Array(){return this.data}serialize(e){e.serializeFixedBytes(this.data)}serializeForEntryFunction(e){e.serializeAsBytes(this)}serializeForScriptFunction(e){e.serializeU32AsUleb128(3),e.serialize(this)}static deserialize(e){let t=e.deserializeFixedBytes(u.LENGTH);return new u(t)}static fromStringStrict(e){if(!e.startsWith("0x"))throw new d("Hex string must start with a leading 0x.","leading_zero_x_required");let t=u.fromString(e);if(e.length!==u.LONG_STRING_LENGTH+2)if(t.isSpecial()){if(e.length!==3)throw new d(`The given hex string ${e} is a special address not in LONG form, it must be 0x0 to 0xf without padding zeroes.`,"INVALID_PADDING_ZEROES")}else throw new d(`The given hex string ${e} is not a special address, it must be represented as 0x + 64 chars.`,"long_form_required_unless_special");return t}static fromString(e,{maxMissingChars:t=4}={}){let n=e;if(e.startsWith("0x")&&(n=e.slice(2)),n.length===0)throw new d("Hex string is too short, must be 1 to 64 chars long, excluding the leading 0x.","too_short");if(n.length>64)throw new d("Hex string is too long, must be 1 to 64 chars long, excluding the leading 0x.","too_long");if(t>63||t<0)throw new d(`maxMissingChars must be between or equal to 0 and 63. Received ${t}`,"INVALID_PADDING_STRICTNESS");let s;try{s=_utils.hexToBytes.call(void 0, n.padStart(64,"0"))}catch(a){throw new d(`Hex characters are invalid: ${_optionalChain([a, 'optionalAccess', _5 => _5.message])}`,"invalid_hex_chars")}let o=new u(s);if(n.length<64-t&&!o.isSpecial())throw new d(`Hex string is too short, must be ${64-t} to 64 chars long, excluding the leading 0x. You may need to fix
|
|
2
|
+
the addresss by padding it with 0s before passing it to \`fromString\` (e.g. <addressString>.padStart(64, '0')).
|
|
3
|
+
Received ${e}`,"too_short");return o}static from(e,{maxMissingChars:t=4}={}){return typeof e=="string"?u.fromString(e,{maxMissingChars:t}):e instanceof Uint8Array?new u(e):e}static fromStrict(e){return typeof e=="string"?u.fromStringStrict(e):e instanceof Uint8Array?new u(e):e}static isValid(e){try{return e.strict?u.fromStrict(e.input):u.from(e.input),{valid:!0}}catch(t){return{valid:!1,invalidReason:_optionalChain([t, 'optionalAccess', _6 => _6.invalidReason]),invalidReasonMessage:_optionalChain([t, 'optionalAccess', _7 => _7.message])}}}equals(e){return this.data.length!==e.data.length?!1:this.data.every((t,n)=>t===e.data[n])}};u.LENGTH=32,u.LONG_STRING_LENGTH=64,u.ZERO=u.from("0x0"),u.ONE=u.from("0x1"),u.TWO=u.from("0x2"),u.THREE=u.from("0x3"),u.FOUR=u.from("0x4"),u.A=u.from("0xA");var y=u;var _sha3 = require('@noble/hashes/sha3');var R=(r,e)=>{let t=r.bcsToBytes(),n=typeof e=="string"?Buffer.from(e,"utf8"):e,s=new Uint8Array([...t,...n,254]);return new y(_sha3.sha3_256.call(void 0, s))},bt= exports.ra =(r,e)=>{let t=r.bcsToBytes(),n=typeof e=="string"?Buffer.from(e,"utf8"):e,s=new Uint8Array([...t,...n,255]);return new y(_sha3.sha3_256.call(void 0, s))},At= exports.sa =(r,e)=>{let t=r.bcsToBytes(),n=e.bcsToBytes(),s=new Uint8Array([...t,...n,252]);return new y(_sha3.sha3_256.call(void 0, s))},St= exports.ta =(r,e,t)=>{let n=`${e}::${t}`;return R(r,n)};var _jsbase64 = require('js-base64');function Tt(){try{return typeof globalThis<"u"&&"Bun"in globalThis}catch (e2){return!1}}function Nt(r){typeof process<"u"&&process.env&&(process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test"||process.env.APTOS_SDK_WARNINGS==="true")&&console.warn(r)}async function Bt(r){return new Promise(e=>{setTimeout(e,r)})}function Et(r){return r instanceof Error?r.message:String(r)}var wt=()=>Math.floor(Date.now()/1e3);function kt(r){let e=new Date(r*1e3);return e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0),Math.floor(e.getTime()/1e3)}function Ct(r){let e=r.replace(/-/g,"+").replace(/_/g,"/"),t=e+"==".substring(0,(3-e.length%3)%3);return _jsbase64.decode.call(void 0, t)}function Ot(r){let e=r.replace(/-/g,"+").replace(/_/g,"/");for(;e.length%4!==0;)e+="=";return new Uint8Array(Buffer.from(e,"base64"))}var zt=(r,e)=>r*10**e,Dt= exports.Da =(r,e)=>r/10**e,L=r=>{let e="";for(let t=2;t<r.length;t+=2)e+=String.fromCharCode(parseInt(r.substring(t,t+2),16));return e},Gt= exports.Ea =r=>{let{account_address:e,module_name:t,struct_name:n}=r,s=L(t),o=L(n);return`${e}::${s}::${o}`},Ft= exports.Fa =r=>typeof r=="object"&&!Array.isArray(r)&&r!==null&&"account_address"in r&&"module_name"in r&&"struct_name"in r&&typeof r.account_address=="string"&&typeof r.module_name=="string"&&typeof r.struct_name=="string";function Ht(r){let e=r.split("::");if(e.length!==3)throw new Error(`Invalid function ${r}`);let t=e[0],n=e[1],s=e[2];return{moduleAddress:t,moduleName:n,functionName:s}}function Wt(r){let e=r.split("::");return e.length===3&&y.isValid({input:e[0]}).valid}function Pt(r,e=6,t=5){return`${r.slice(0,e)}...${r.slice(-t)}`}var Be="0x1::aptos_coin::AptosCoin";function Ee(r){let e=/0x[0-9a-fA-F]+/g;return r.replace(e,t=>y.from(t,{maxMissingChars:63}).toStringShort())}function Lt(r){let e=Ee(r);return e===Be?y.A:R(y.A,e)}exports.a = g; exports.b = M; exports.c = U; exports.d = x; exports.e = m; exports.f = I; exports.g = T; exports.h = N; exports.i = B; exports.j = E; exports.k = w; exports.l = k; exports.m = C; exports.n = O; exports.o = z; exports.p = D; exports.q = G; exports.r = F; exports.s = H; exports.t = d; exports.u = K; exports.v = f; exports.w = De; exports.x = b; exports.y = c; exports.z = ee; exports.A = te; exports.B = re; exports.C = ne; exports.D = se; exports.E = W; exports.F = oe; exports.G = ie; exports.H = ae; exports.I = pe; exports.J = ue; exports.K = ce; exports.L = de; exports.M = ge; exports.N = le; exports.O = $e; exports.P = ye; exports.Q = _e; exports.R = he; exports.S = fe; exports.T = xe; exports.U = me; exports.V = Xe; exports.W = qe; exports.X = je; exports.Y = Ke; exports.Z = Ye; exports._ = Ze; exports.$ = Qe; exports.aa = Je; exports.ba = Ve; exports.ca = et; exports.da = tt; exports.ea = rt; exports.fa = nt; exports.ga = Ie; exports.ha = be; exports.ia = Ae; exports.ja = Se; exports.ka = ve; exports.la = P; exports.ma = Re; exports.na = Me; exports.oa = Te; exports.pa = y; exports.qa = R; exports.ra = bt; exports.sa = At; exports.ta = St; exports.ua = Tt; exports.va = Nt; exports.wa = Bt; exports.xa = Et; exports.ya = wt; exports.za = kt; exports.Aa = Ct; exports.Ba = Ot; exports.Ca = zt; exports.Da = Dt; exports.Ea = Gt; exports.Fa = Ft; exports.Ga = Ht; exports.Ha = Wt; exports.Ia = Pt; exports.Ja = Lt;
|
|
4
|
+
//# sourceMappingURL=chunk-3NBJLJ2Y.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/Users/greg/git/aptos-ts-sdk/dist/common/chunk-3NBJLJ2Y.js","../../src/core/common.ts","../../src/core/hex.ts","../../src/core/accountAddress.ts"],"names":["ParsingError","message","invalidReason","HexInvalidReason","Hex","_Hex","data","bytesToHex"],"mappings":"AAAA,ilBAAI,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CCQhM,IAAMA,CAAAA,CAAN,MAAA,QAA8B,KAAM,CAkBzC,WAAA,CAAYC,CAAAA,CAAiBC,CAAAA,CAAkB,CAC7C,KAAA,CAAMD,CAAO,CAAA,CACb,IAAA,CAAK,aAAA,CAAgBC,CACvB,CACF,CAAA,CC3BA,4CAAuC,IAS3BC,CAAAA,CAAAA,CAAAA,CAAAA,EAAAA,CACVA,CAAAA,CAAA,SAAA,CAAY,WAAA,CACZA,CAAAA,CAAA,cAAA,CAAiB,gBAAA,CACjBA,CAAAA,CAAA,iBAAA,CAAoB,mBAAA,CAHVA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,EAAA,CAAA,CAAA,CAAA,CAgCCC,CAAAA,aAAN,MAAMC,CAAI,CAUf,WAAA,CAAYC,CAAAA,CAAkB,CAC5B,IAAA,CAAK,IAAA,CAAOA,CACd,CAaA,YAAA,CAAA,CAA2B,CACzB,OAAO,IAAA,CAAK,IACd,CASA,qBAAA,CAAA,CAAgC,CAC9B,OAAOC,+BAAAA,IAAW,CAAK,IAAI,CAC7B,CASA,QAAA,CAAA,CAAmB,CACjB,MAAO,CAAA,EAAA,EAAK,IAAA,CAAK,qBAAA,CAAsB,CAAC,CAAA,CAAA;ACiVsB;AAlWV,SAAA","file":"/Users/greg/git/aptos-ts-sdk/dist/common/chunk-3NBJLJ2Y.js","sourcesContent":[null,"// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * This error is used to explain why parsing failed.\n * @group Implementation\n * @category Serialization\n */\nexport class ParsingError<T> extends Error {\n /**\n * This provides a programmatic way to access why parsing failed. Downstream devs\n * might want to use this to build their own error messages if the default error\n * messages are not suitable for their use case. This should be an enum.\n * @group Implementation\n * @category Serialization\n */\n public invalidReason: T;\n\n /**\n * Creates an instance of the error with a specified message and invalid reason.\n *\n * @param message The error message that describes the issue.\n * @param invalidReason The reason why the input is considered invalid.\n * @group Implementation\n * @category Serialization\n */\n constructor(message: string, invalidReason: T) {\n super(message);\n this.invalidReason = invalidReason;\n }\n}\n\n/**\n * Whereas ParsingError is thrown when parsing fails, e.g. in a fromString function,\n * this type is returned from \"defensive\" functions like isValid.\n * @group Implementation\n * @category Serialization\n */\nexport type ParsingResult<T> = {\n /**\n * True if valid, false otherwise.\n * @group Implementation\n * @category Serialization\n */\n valid: boolean;\n\n /**\n * If valid is false, this will be a code explaining why parsing failed.\n * @group Implementation\n * @category Serialization\n */\n invalidReason?: T;\n\n /**\n * If valid is false, this will be a string explaining why parsing failed.\n * @group Implementation\n * @category Serialization\n */\n invalidReasonMessage?: string;\n};\n","// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { bytesToHex, hexToBytes } from \"@noble/hashes/utils\";\nimport { ParsingError, ParsingResult } from \"./common\";\nimport { HexInput } from \"../types\";\n\n/**\n * Provides reasons for parsing failures related to hexadecimal values.\n * @group Implementation\n * @category Serialization\n */\nexport enum HexInvalidReason {\n TOO_SHORT = \"too_short\",\n INVALID_LENGTH = \"invalid_length\",\n INVALID_HEX_CHARS = \"invalid_hex_chars\",\n}\n\n/**\n * NOTE: Do not use this class when working with account addresses; use AccountAddress instead.\n * When accepting hex data as input to a function, prefer to accept HexInput and\n *\n * A helper class for working with hex data. Hex data, when represented as a string,\n * generally looks like this, for example: 0xaabbcc, 45cd32, etc.\n *\n * then use the static helper methods of this class to convert it into the desired\n * format. This enables the greatest flexibility for the developer.\n *\n * Example usage:\n * ```typescript\n * getTransactionByHash(txnHash: HexInput): Promise<Transaction> {\n * const txnHashString = Hex.fromHexInput(txnHash).toString();\n * return await getTransactionByHashInner(txnHashString);\n * }\n * ```\n * This call to `Hex.fromHexInput().toString()` converts the HexInput to a hex string\n * with a leading 0x prefix, regardless of what the input format was.\n *\n * Other ways to chain the functions together:\n * - `Hex.fromHexString({ hexInput: \"0x1f\" }).toUint8Array()`\n * - `new Hex([1, 3]).toStringWithoutPrefix()`\n * @group Implementation\n * @category Serialization\n */\nexport class Hex {\n private readonly data: Uint8Array;\n\n /**\n * Create a new Hex instance from a Uint8Array.\n *\n * @param data - The Uint8Array containing the data to initialize the Hex instance.\n * @group Implementation\n * @category Serialization\n */\n constructor(data: Uint8Array) {\n this.data = data;\n }\n\n // ===\n // Methods for representing an instance of Hex as other types.\n // ===\n\n /**\n * Get the inner hex data as a Uint8Array. The inner data is already a Uint8Array, so no conversion takes place.\n *\n * @returns Hex data as Uint8Array\n * @group Implementation\n * @category Serialization\n */\n toUint8Array(): Uint8Array {\n return this.data;\n }\n\n /**\n * Get the hex data as a string without the 0x prefix.\n *\n * @returns Hex string without 0x prefix\n * @group Implementation\n * @category Serialization\n */\n toStringWithoutPrefix(): string {\n return bytesToHex(this.data);\n }\n\n /**\n * Get the hex data as a string with the 0x prefix.\n *\n * @returns Hex string with 0x prefix\n * @group Implementation\n * @category Serialization\n */\n toString(): string {\n return `0x${this.toStringWithoutPrefix()}`;\n }\n\n // ===\n // Methods for creating an instance of Hex from other types.\n // ===\n\n /**\n * Converts a hex string into a Hex instance, allowing for both prefixed and non-prefixed formats.\n *\n * @param str - A hex string, with or without the 0x prefix.\n *\n * @throws ParsingError - If the hex string is too short, has an odd number of characters, or contains invalid hex characters.\n *\n * @returns Hex - The resulting Hex instance created from the provided string.\n * @group Implementation\n * @category Serialization\n */\n static fromHexString(str: string): Hex {\n let input = str;\n\n if (input.startsWith(\"0x\")) {\n input = input.slice(2);\n }\n\n if (input.length === 0) {\n throw new ParsingError(\n \"Hex string is too short, must be at least 1 char long, excluding the optional leading 0x.\",\n HexInvalidReason.TOO_SHORT,\n );\n }\n\n if (input.length % 2 !== 0) {\n throw new ParsingError(\"Hex string must be an even number of hex characters.\", HexInvalidReason.INVALID_LENGTH);\n }\n\n try {\n return new Hex(hexToBytes(input));\n } catch (error: any) {\n throw new ParsingError(\n `Hex string contains invalid hex characters: ${error?.message}`,\n HexInvalidReason.INVALID_HEX_CHARS,\n );\n }\n }\n\n /**\n * Converts an instance of HexInput, which can be a string or a Uint8Array, into a Hex instance.\n * This function is useful for transforming hexadecimal representations into a structured Hex object for further manipulation.\n *\n * @param hexInput - A HexInput which can be a string or Uint8Array.\n * @returns A Hex instance created from the provided hexInput.\n * @group Implementation\n * @category Serialization\n */\n static fromHexInput(hexInput: HexInput): Hex {\n if (hexInput instanceof Uint8Array) return new Hex(hexInput);\n return Hex.fromHexString(hexInput);\n }\n\n /**\n * Converts an instance of HexInput, which can be a string or a Uint8Array, into a Uint8Array.\n *\n * @param hexInput - A HexInput which can be a string or Uint8Array.\n * @returns A Uint8Array created from the provided hexInput.\n */\n static hexInputToUint8Array(hexInput: HexInput): Uint8Array {\n if (hexInput instanceof Uint8Array) return hexInput;\n return Hex.fromHexString(hexInput).toUint8Array();\n }\n\n /**\n * Converts a HexInput (string or Uint8Array) to a hex string with '0x' prefix.\n *\n * @param hexInput - The input to convert, either a hex string (with/without '0x' prefix) or Uint8Array\n * @returns A hex string with '0x' prefix (e.g., \"0x1234\")\n *\n * @example\n * ```typescript\n * Hex.hexInputToString(\"1234\") // returns \"0x1234\"\n * Hex.hexInputToString(\"0x1234\") // returns \"0x1234\"\n * Hex.hexInputToString(new Uint8Array([0x12, 0x34])) // returns \"0x1234\"\n * ```\n */\n static hexInputToString(hexInput: HexInput): string {\n return Hex.fromHexInput(hexInput).toString();\n }\n\n /**\n * Converts a HexInput (string or Uint8Array) to a hex string without '0x' prefix.\n *\n * @param hexInput - The input to convert, either a hex string (with/without '0x' prefix) or Uint8Array\n * @returns A hex string without '0x' prefix (e.g., \"1234\")\n *\n * @example\n * ```typescript\n * Hex.hexInputToStringWithoutPrefix(\"1234\") // returns \"1234\"\n * Hex.hexInputToStringWithoutPrefix(\"0x1234\") // returns \"1234\"\n * Hex.hexInputToStringWithoutPrefix(new Uint8Array([0x12, 0x34])) // returns \"1234\"\n * ```\n */\n static hexInputToStringWithoutPrefix(hexInput: HexInput): string {\n return Hex.fromHexInput(hexInput).toStringWithoutPrefix();\n }\n\n // ===\n // Methods for checking validity.\n // ===\n\n /**\n * Check if the provided string is a valid hexadecimal representation.\n *\n * @param str - A hex string representing byte data.\n *\n * @returns An object containing:\n * - valid: A boolean indicating whether the string is valid.\n * - invalidReason: The reason for invalidity if the string is not valid.\n * - invalidReasonMessage: A message explaining why the string is invalid.\n * @group Implementation\n * @category Serialization\n */\n static isValid(str: string): ParsingResult<HexInvalidReason> {\n try {\n Hex.fromHexString(str);\n return { valid: true };\n } catch (error: any) {\n return {\n valid: false,\n invalidReason: error?.invalidReason,\n invalidReasonMessage: error?.message,\n };\n }\n }\n\n /**\n * Determine if two Hex instances are equal by comparing their underlying byte data.\n *\n * @param other The Hex instance to compare to.\n * @returns true if the Hex instances are equal, false if not.\n * @group Implementation\n * @category Serialization\n */\n equals(other: Hex): boolean {\n if (this.data.length !== other.data.length) return false;\n return this.data.every((value, index) => value === other.data[index]);\n }\n}\n\nexport const hexToAsciiString = (hex: string) => new TextDecoder().decode(Hex.fromHexInput(hex).toUint8Array());\n","// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { bytesToHex, hexToBytes } from \"@noble/hashes/utils\";\nimport { Serializable, Serializer } from \"../bcs/serializer\";\nimport { Deserializer } from \"../bcs/deserializer\";\nimport { ParsingError, ParsingResult } from \"./common\";\nimport { TransactionArgument } from \"../transactions/instances/transactionArgument\";\nimport { HexInput, ScriptTransactionArgumentVariants } from \"../types\";\n\n/**\n * Provides reasons for an address was invalid.\n * @group Implementation\n * @category Serialization\n */\nexport enum AddressInvalidReason {\n INCORRECT_NUMBER_OF_BYTES = \"incorrect_number_of_bytes\",\n INVALID_HEX_CHARS = \"invalid_hex_chars\",\n TOO_SHORT = \"too_short\",\n TOO_LONG = \"too_long\",\n LEADING_ZERO_X_REQUIRED = \"leading_zero_x_required\",\n LONG_FORM_REQUIRED_UNLESS_SPECIAL = \"long_form_required_unless_special\",\n INVALID_PADDING_ZEROES = \"INVALID_PADDING_ZEROES\",\n INVALID_PADDING_STRICTNESS = \"INVALID_PADDING_STRICTNESS\",\n}\n\n/**\n * The input for an account address, which can be either a hexadecimal string or a standard account address.\n * @group Implementation\n * @category Serialization\n */\nexport type AccountAddressInput = HexInput | AccountAddress;\n\n/**\n * NOTE: Only use this class for account addresses. For other hex data, e.g. transaction\n * hashes, use the Hex class.\n *\n * AccountAddress is used for working with account addresses. Account addresses, when\n * represented as a string, generally look like these examples:\n * - 0x1\n * - 0xaa86fe99004361f747f91342ca13c426ca0cccb0c1217677180c9493bad6ef0c\n *\n * Proper formatting and parsing of account addresses is defined by AIP-40.\n * To learn more about the standard, read the AIP here:\n * https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.\n *\n * The comments in this class make frequent reference to the LONG and SHORT formats,\n * as well as \"special\" addresses. To learn what these refer to see AIP-40.\n * @group Implementation\n * @category Serialization\n */\nexport class AccountAddress extends Serializable implements TransactionArgument {\n /**\n * This is the internal representation of an account address.\n * @group Implementation\n * @category Serialization\n */\n readonly data: Uint8Array;\n\n /**\n * The number of bytes that make up an account address.\n * @group Implementation\n * @category Serialization\n */\n static readonly LENGTH: number = 32;\n\n /**\n * The length of an address string in LONG form without a leading 0x.\n * @group Implementation\n * @category Serialization\n */\n static readonly LONG_STRING_LENGTH: number = 64;\n\n static ZERO: AccountAddress = AccountAddress.from(\"0x0\");\n\n static ONE: AccountAddress = AccountAddress.from(\"0x1\");\n\n static TWO: AccountAddress = AccountAddress.from(\"0x2\");\n\n static THREE: AccountAddress = AccountAddress.from(\"0x3\");\n\n static FOUR: AccountAddress = AccountAddress.from(\"0x4\");\n\n static A: AccountAddress = AccountAddress.from(\"0xA\");\n\n /**\n * Creates an instance of AccountAddress from a Uint8Array.\n *\n * This function ensures that the input data is exactly 32 bytes long, which is required for a valid account address.\n *\n * @param input A Uint8Array representing an account address.\n * @throws ParsingError if the input length is not equal to 32 bytes.\n * @group Implementation\n * @category Serialization\n */\n constructor(input: Uint8Array) {\n super();\n if (input.length !== AccountAddress.LENGTH) {\n throw new ParsingError(\n \"AccountAddress data should be exactly 32 bytes long\",\n AddressInvalidReason.INCORRECT_NUMBER_OF_BYTES,\n );\n }\n this.data = input;\n }\n\n /**\n * Determines if the address is classified as special, which is defined as 0x0 to 0xf inclusive.\n * In other words, the last byte of the address must be < 0b10000 (16)\n * and every other byte must be zero.\n *\n * For more information on how special addresses are defined, see AIP-40:\n * https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.\n *\n * @returns true if the address is special, false otherwise.\n * @group Implementation\n * @category Serialization\n */\n isSpecial(): boolean {\n return (\n this.data.slice(0, this.data.length - 1).every((byte) => byte === 0) && this.data[this.data.length - 1] < 0b10000\n );\n }\n // ===\n // Methods for representing an instance of AccountAddress as other types.\n // ===\n\n /**\n * Return the AccountAddress as a string as per AIP-40.\n * https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.\n * This representation returns special addresses in SHORT form (0xf)\n * and other addresses in LONG form (0x + 64 characters).\n *\n * @returns AccountAddress as a string conforming to AIP-40.\n * @group Implementation\n * @category Serialization\n */\n toString(): `0x${string}` {\n return `0x${this.toStringWithoutPrefix()}`;\n }\n\n /**\n * Return the AccountAddress as a string conforming to AIP-40 but without the leading 0x.\n *\n * NOTE: Prefer to use `toString` where possible.\n *\n * @returns AccountAddress as a string without the leading 0x.\n * @group Implementation\n * @category Serialization\n */\n toStringWithoutPrefix(): string {\n let hex = bytesToHex(this.data);\n if (this.isSpecial()) {\n hex = hex[hex.length - 1];\n }\n return hex;\n }\n\n /**\n * Convert the account address to a string in LONG format, which is always 0x followed by 64 hex characters.\n *\n * NOTE: Prefer to use `toString` where possible, as it formats special addresses using the SHORT form (no leading 0s).\n *\n * @returns AccountAddress as a string in LONG form.\n * @group Implementation\n * @category Serialization\n */\n toStringLong(): `0x${string}` {\n return `0x${this.toStringLongWithoutPrefix()}`;\n }\n\n /**\n * Returns the account address as a string in LONG form without a leading 0x.\n * This function will include leading zeroes and will produce a string of 64 hex characters.\n *\n * NOTE: Prefer to use `toString` where possible, as it formats special addresses using the SHORT form (no leading 0s).\n *\n * @returns {string} The account address in LONG form.\n * @group Implementation\n * @category Serialization\n */\n toStringLongWithoutPrefix(): string {\n return bytesToHex(this.data);\n }\n\n /**\n * Convert the account address to a string in SHORT format, which is 0x followed by the shortest\n * possible representation (no leading zeros).\n *\n * @returns AccountAddress as a string in SHORT form.\n * @group Implementation\n * @category Serialization\n */\n toStringShort(): `0x${string}` {\n return `0x${this.toStringShortWithoutPrefix()}`;\n }\n\n /**\n * Returns a lossless short string representation of the address by trimming leading zeros.\n * If the address consists of all zeros, returns \"0\".\n *\n * @returns A string representation of the address without leading zeros\n * @group Implementation\n * @category Serialization\n */\n toStringShortWithoutPrefix(): string {\n const hex = bytesToHex(this.data).replace(/^0+/, \"\");\n return hex === \"\" ? \"0\" : hex;\n }\n\n /**\n * Get the inner data as a Uint8Array.\n * The inner data is already a Uint8Array, so no conversion takes place.\n *\n * @returns Hex data as Uint8Array\n * @group Implementation\n * @category Serialization\n */\n toUint8Array(): Uint8Array {\n return this.data;\n }\n\n /**\n * Serialize the AccountAddress to a Serializer instance's data buffer.\n * @param serializer The serializer to serialize the AccountAddress to.\n * @returns void\n * @example\n * const serializer = new Serializer();\n * const address = AccountAddress.fromString(\"0x1\");\n * address.serialize(serializer);\n * const bytes = serializer.toUint8Array();\n * // `bytes` is now the BCS-serialized address.\n * @group Implementation\n * @category Serialization\n */\n serialize(serializer: Serializer): void {\n serializer.serializeFixedBytes(this.data);\n }\n\n /**\n * Serializes the current instance into a byte sequence suitable for entry functions.\n * This allows for the proper encoding of data when interacting with entry functions in the blockchain.\n * Uses the optimized serializeAsBytes method to reduce allocations.\n *\n * @param serializer - The serializer instance used to convert the data into bytes.\n * @group Implementation\n * @category Serialization\n */\n serializeForEntryFunction(serializer: Serializer): void {\n serializer.serializeAsBytes(this);\n }\n\n /**\n * Serializes the current instance for use in a script function by encoding it into a byte sequence.\n * This process involves serializing the variant index and the instance data, making it suitable for transmission.\n *\n * @param serializer - The serializer instance used to perform the serialization.\n * @group Implementation\n * @category Serialization\n */\n serializeForScriptFunction(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(ScriptTransactionArgumentVariants.Address);\n serializer.serialize(this);\n }\n\n /**\n * Deserialize an AccountAddress from the byte buffer in a Deserializer instance.\n * This function allows you to convert a byte representation of an AccountAddress into an instance of AccountAddress.\n * @param deserializer The deserializer to deserialize the AccountAddress from.\n * @returns An instance of AccountAddress.\n * @example\n * const bytes = hexToBytes(\"0x0102030405060708091011121314151617181920212223242526272829303132\");\n * const deserializer = new Deserializer(bytes);\n * const address = AccountAddress.deserialize(deserializer);\n * // `address` is now an instance of AccountAddress.\n * @group Implementation\n * @category Serialization\n */\n static deserialize(deserializer: Deserializer): AccountAddress {\n const bytes = deserializer.deserializeFixedBytes(AccountAddress.LENGTH);\n return new AccountAddress(bytes);\n }\n\n // ===\n // Methods for creating an instance of AccountAddress from other types.\n // ===\n\n /**\n * NOTE: This function has strict parsing behavior. For relaxed behavior, please use\n * the `fromString` function.\n *\n * Creates an instance of AccountAddress from a hex string.\n *\n * This function allows only the strictest formats defined by AIP-40. In short this\n * means only the following formats are accepted:\n *\n * - LONG\n * - SHORT for special addresses\n *\n * Where:\n * - LONG is defined as 0x + 64 hex characters.\n * - SHORT for special addresses is 0x0 to 0xf inclusive without padding zeroes.\n *\n * This means the following are not accepted:\n * - SHORT for non-special addresses.\n * - Any address without a leading 0x.\n *\n * @param input - A hex string representing an account address.\n *\n * @throws {ParsingError} If the hex string does not start with 0x or is not in a valid format.\n *\n * @remarks\n *\n * This function has strict parsing behavior. For relaxed behavior, please use the `fromString` function.\n *\n * @see AIP-40 documentation for more details on address formats:\n * https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.\n *\n * @returns An instance of AccountAddress.\n * @group Implementation\n * @category Serialization\n */\n static fromStringStrict(input: string): AccountAddress {\n // Assert the string starts with 0x.\n if (!input.startsWith(\"0x\")) {\n throw new ParsingError(\"Hex string must start with a leading 0x.\", AddressInvalidReason.LEADING_ZERO_X_REQUIRED);\n }\n\n const address = AccountAddress.fromString(input);\n\n // Check if the address is in LONG form. If it is not, this is only allowed for\n // special addresses, in which case we check it is in proper SHORT form.\n if (input.length !== AccountAddress.LONG_STRING_LENGTH + 2) {\n if (!address.isSpecial()) {\n throw new ParsingError(\n `The given hex string ${input} is not a special address, it must be represented as 0x + 64 chars.`,\n AddressInvalidReason.LONG_FORM_REQUIRED_UNLESS_SPECIAL,\n );\n } else if (input.length !== 3) {\n // 0x + one hex char is the only valid SHORT form for special addresses.\n throw new ParsingError(\n `The given hex string ${input} is a special address not in LONG form, it must be 0x0 to 0xf without padding zeroes.`,\n AddressInvalidReason.INVALID_PADDING_ZEROES,\n );\n }\n }\n\n return address;\n }\n\n /**\n * NOTE: This function has relaxed parsing behavior. For strict behavior, please use\n * the `fromStringStrict` function. Where possible use `fromStringStrict` rather than this\n * function, `fromString`.\n *\n * Creates an instance of AccountAddress from a hex string.\n *\n * This function allows all formats defined by AIP-40. In short this means the\n * following formats are accepted:\n *\n * - LONG, with or without leading 0x\n * - SHORT*, with or without leading 0x\n *\n * Where:\n * - LONG is 64 hex characters.\n * - SHORT* is 1 to 63 hex characters inclusive. The address can have missing values up to `maxMissingChars` before it is padded.\n * - Padding zeroes are allowed, e.g. 0x0123 is valid.\n *\n * Learn more about the different address formats by reading AIP-40:\n * https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.\n *\n * @param input A hex string representing an account address.\n * @param args.maxMissingChars The number of characters that can be missing in a padded address before it is invalid.\n *\n * @returns An instance of AccountAddress.\n *\n * @throws ParsingError if the hex string is too short, too long, or contains invalid characters.\n * @group Implementation\n * @category Serialization\n */\n static fromString(input: string, { maxMissingChars = 4 }: { maxMissingChars?: number } = {}): AccountAddress {\n let parsedInput = input;\n // Remove leading 0x for parsing.\n if (input.startsWith(\"0x\")) {\n parsedInput = input.slice(2);\n }\n\n // Ensure the address string is at least 1 character long.\n if (parsedInput.length === 0) {\n throw new ParsingError(\n \"Hex string is too short, must be 1 to 64 chars long, excluding the leading 0x.\",\n AddressInvalidReason.TOO_SHORT,\n );\n }\n\n // Ensure the address string is not longer than 64 characters.\n if (parsedInput.length > 64) {\n throw new ParsingError(\n \"Hex string is too long, must be 1 to 64 chars long, excluding the leading 0x.\",\n AddressInvalidReason.TOO_LONG,\n );\n }\n\n // Ensure that the maxMissingChars is between or equal to 0 and 63.\n if (maxMissingChars > 63 || maxMissingChars < 0) {\n throw new ParsingError(\n `maxMissingChars must be between or equal to 0 and 63. Received ${maxMissingChars}`,\n AddressInvalidReason.INVALID_PADDING_STRICTNESS,\n );\n }\n\n let addressBytes: Uint8Array;\n try {\n // Pad the address with leading zeroes, so it is 64 chars long and then convert\n // the hex string to bytes. Every two characters in a hex string constitutes a\n // single byte. So a 64 length hex string becomes a 32 byte array.\n addressBytes = hexToBytes(parsedInput.padStart(64, \"0\"));\n } catch (error: any) {\n // At this point the only way this can fail is if the hex string contains\n // invalid characters.\n throw new ParsingError(`Hex characters are invalid: ${error?.message}`, AddressInvalidReason.INVALID_HEX_CHARS);\n }\n\n const address = new AccountAddress(addressBytes);\n\n // Cannot pad the address if it has more than maxMissingChars missing.\n if (parsedInput.length < 64 - maxMissingChars) {\n if (!address.isSpecial()) {\n throw new ParsingError(\n `Hex string is too short, must be ${64 - maxMissingChars} to 64 chars long, excluding the leading 0x. You may need to fix \nthe addresss by padding it with 0s before passing it to \\`fromString\\` (e.g. <addressString>.padStart(64, '0')). \nReceived ${input}`,\n AddressInvalidReason.TOO_SHORT,\n );\n }\n }\n\n return address;\n }\n\n /**\n * Convenience method for creating an AccountAddress from various input types.\n * This function accepts a string, Uint8Array, or an existing AccountAddress instance and returns the corresponding\n * AccountAddress.\n *\n * @param input - The input to convert into an AccountAddress. This can be a string representation of an address, a Uint8Array,\n * or an existing AccountAddress.\n * @param args.maxMissingChars The number of characters that can be missing in a padded address before it is invalid.\n * @group Implementation\n * @category Serialization\n */\n static from(input: AccountAddressInput, { maxMissingChars = 4 }: { maxMissingChars?: number } = {}): AccountAddress {\n if (typeof input === \"string\") {\n return AccountAddress.fromString(input, { maxMissingChars });\n }\n if (input instanceof Uint8Array) {\n return new AccountAddress(input);\n }\n return input;\n }\n\n /**\n * Create an AccountAddress from various input types, including strings, Uint8Array, and AccountAddress instances.\n *\n * @param input - The input to convert into an AccountAddress, which can be a string, a Uint8Array, or an AccountAddress.\n * @group Implementation\n * @category Serialization\n */\n static fromStrict(input: AccountAddressInput): AccountAddress {\n if (typeof input === \"string\") {\n return AccountAddress.fromStringStrict(input);\n }\n if (input instanceof Uint8Array) {\n return new AccountAddress(input);\n }\n return input;\n }\n // ===\n // Methods for checking validity.\n // ===\n\n /**\n * Check if the provided input is a valid AccountAddress.\n *\n * @param args - The arguments for validation.\n * @param args.input - A hex string representing an account address.\n * @param args.strict - If true, use strict parsing behavior; if false, use relaxed parsing behavior.\n *\n * @returns An object indicating whether the address is valid. If valid, valid = true; if not, valid = false with additional details.\n * If the address is invalid, invalidReason will explain why it is invalid, and invalidReasonMessage will provide the error message.\n * @group Implementation\n * @category Serialization\n */\n static isValid(args: { input: AccountAddressInput; strict?: boolean }): ParsingResult<AddressInvalidReason> {\n try {\n if (args.strict) {\n AccountAddress.fromStrict(args.input);\n } else {\n AccountAddress.from(args.input);\n }\n return { valid: true };\n } catch (error: any) {\n return {\n valid: false,\n invalidReason: error?.invalidReason,\n invalidReasonMessage: error?.message,\n };\n }\n }\n\n /**\n * Determine if two AccountAddresses are equal based on their underlying byte data.\n *\n * @param other - The AccountAddress to compare to.\n * @returns true if the AccountAddresses are equal, false if not.\n * @group Implementation\n * @category Serialization\n */\n equals(other: AccountAddress): boolean {\n if (this.data.length !== other.data.length) return false;\n return this.data.every((value, index) => value === other.data[index]);\n }\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChildProcessWithoutNullStreams } from 'child_process';
|
|
2
|
-
import {
|
|
2
|
+
import { cP as Network, A as AccountAddress } from '../account-CSOaJ0SC.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Represents a local node for running a localnet environment.
|