@aptos-labs/ts-sdk 2.0.1 → 3.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-Bb5REyaT.d.ts +7412 -0
- package/dist/common/chunk-6MMUUJHX.js +4 -0
- package/dist/common/{chunk-ZMDE3DNL.js.map → chunk-6MMUUJHX.js.map} +1 -1
- package/dist/common/cli/index.d.ts +1 -1
- package/dist/common/cli/index.js +1 -1
- package/dist/common/index.d.ts +5876 -9769
- package/dist/common/index.js +55 -32
- package/dist/common/index.js.map +1 -1
- package/dist/esm/{Ed25519Account-D9XrCLfE.d.mts → Ed25519Account-ndmdpFe9.d.mts} +1 -9
- package/dist/esm/account/AbstractKeylessAccount.d.mts +4 -31
- package/dist/esm/account/AbstractKeylessAccount.mjs +1 -1
- package/dist/esm/account/AbstractedAccount.d.mts +5 -32
- package/dist/esm/account/AbstractedAccount.mjs +1 -1
- package/dist/esm/account/Account.d.mts +3 -30
- package/dist/esm/account/Account.mjs +1 -1
- package/dist/esm/account/AccountUtils.d.mts +4 -31
- package/dist/esm/account/AccountUtils.mjs +1 -1
- package/dist/esm/account/DerivableAbstractedAccount.d.mts +5 -32
- package/dist/esm/account/DerivableAbstractedAccount.mjs +1 -1
- package/dist/esm/account/Ed25519Account.d.mts +3 -30
- package/dist/esm/account/Ed25519Account.mjs +1 -1
- package/dist/esm/account/EphemeralKeyPair.d.mts +2 -11
- package/dist/esm/account/EphemeralKeyPair.mjs +1 -1
- package/dist/esm/account/FederatedKeylessAccount.d.mts +5 -31
- package/dist/esm/account/FederatedKeylessAccount.mjs +1 -1
- package/dist/esm/account/KeylessAccount.d.mts +5 -31
- package/dist/esm/account/KeylessAccount.mjs +1 -1
- package/dist/esm/account/MultiEd25519Account.d.mts +3 -30
- package/dist/esm/account/MultiEd25519Account.mjs +1 -1
- package/dist/esm/account/MultiKeyAccount.d.mts +5 -32
- package/dist/esm/account/MultiKeyAccount.mjs +1 -1
- package/dist/esm/account/SingleKeyAccount.d.mts +3 -30
- package/dist/esm/account/SingleKeyAccount.mjs +1 -1
- package/dist/esm/account/index.d.mts +4 -31
- package/dist/esm/account/index.mjs +1 -1
- package/dist/esm/account/utils.d.mts +2 -6
- package/dist/esm/account/utils.mjs +1 -1
- package/dist/esm/account--Q9z_xMN.d.mts +6625 -0
- package/dist/esm/api/account/abstraction.d.mts +2 -29
- package/dist/esm/api/account/abstraction.mjs +1 -1
- package/dist/esm/api/account.d.mts +95 -31
- package/dist/esm/api/account.mjs +1 -1
- package/dist/esm/api/ans.d.mts +3 -30
- package/dist/esm/api/ans.mjs +1 -1
- package/dist/esm/api/aptos.d.mts +8 -32
- package/dist/esm/api/aptos.mjs +1 -1
- package/dist/esm/api/aptosConfig.d.mts +4 -187
- package/dist/esm/api/aptosConfig.mjs +1 -1
- package/dist/esm/api/coin.d.mts +2 -29
- package/dist/esm/api/coin.mjs +1 -1
- package/dist/esm/api/digitalAsset.d.mts +3 -30
- package/dist/esm/api/digitalAsset.mjs +1 -1
- package/dist/esm/api/event.d.mts +2 -8
- package/dist/esm/api/event.mjs +1 -1
- package/dist/esm/api/faucet.d.mts +2 -8
- package/dist/esm/api/faucet.mjs +1 -1
- package/dist/esm/api/fungibleAsset.d.mts +2 -29
- package/dist/esm/api/fungibleAsset.mjs +1 -1
- package/dist/esm/api/general.d.mts +2 -29
- package/dist/esm/api/general.mjs +1 -1
- package/dist/esm/api/index.d.mts +6 -31
- package/dist/esm/api/index.mjs +1 -1
- package/dist/esm/api/keyless.d.mts +4 -31
- package/dist/esm/api/keyless.mjs +1 -1
- package/dist/esm/api/object.d.mts +2 -8
- package/dist/esm/api/object.mjs +1 -1
- package/dist/esm/api/staking.d.mts +2 -8
- package/dist/esm/api/staking.mjs +1 -1
- package/dist/esm/api/table.d.mts +2 -2
- package/dist/esm/api/table.mjs +1 -1
- package/dist/esm/api/transaction.d.mts +7 -33
- package/dist/esm/api/transaction.mjs +1 -1
- package/dist/esm/api/transactionSubmission/build.d.mts +2 -29
- package/dist/esm/api/transactionSubmission/build.mjs +1 -1
- package/dist/esm/api/transactionSubmission/management.d.mts +2 -29
- package/dist/esm/api/transactionSubmission/management.mjs +1 -1
- package/dist/esm/api/transactionSubmission/sign.d.mts +3 -30
- 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 +2 -29
- package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
- package/dist/esm/api/transactionSubmission/submit.d.mts +4 -31
- package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
- package/dist/esm/api/utils.d.mts +2 -2
- package/dist/esm/api/utils.mjs +1 -1
- package/dist/esm/bcs/consts.d.mts +3 -1
- package/dist/esm/bcs/deserializer.d.mts +3 -304
- package/dist/esm/bcs/index.d.mts +2 -8
- package/dist/esm/bcs/index.mjs +1 -1
- package/dist/esm/bcs/serializable/entryFunctionBytes.d.mts +3 -7
- package/dist/esm/bcs/serializable/fixedBytes.d.mts +3 -90
- package/dist/esm/bcs/serializable/movePrimitives.d.mts +2 -167
- package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
- package/dist/esm/bcs/serializable/moveStructs.d.mts +2 -430
- package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
- package/dist/esm/bcs/serializer.d.mts +3 -325
- package/dist/esm/{chunk-Q4W3WJ2U.mjs → chunk-2BOHKN33.mjs} +2 -2
- package/dist/esm/{chunk-AMAPBD4D.mjs → chunk-4COLMDT3.mjs} +2 -2
- package/dist/esm/chunk-5HXLZHDW.mjs +1 -0
- package/dist/esm/chunk-5HXLZHDW.mjs.map +1 -0
- package/dist/esm/{chunk-UOP7GBXB.mjs → chunk-5URUYE6H.mjs} +2 -2
- package/dist/esm/chunk-ACNHLCQQ.mjs +6 -0
- package/dist/esm/chunk-ACNHLCQQ.mjs.map +1 -0
- package/dist/esm/{chunk-V74WPKSY.mjs → chunk-FYYEPFML.mjs} +2 -2
- package/dist/esm/chunk-HUWKPKPQ.mjs +2 -0
- package/dist/esm/{chunk-VEGW6HP5.mjs.map → chunk-HUWKPKPQ.mjs.map} +1 -1
- package/dist/esm/chunk-IJE2LVZG.mjs +2 -0
- package/dist/esm/chunk-IJE2LVZG.mjs.map +1 -0
- package/dist/esm/chunk-JCFTAG5Z.mjs +2 -0
- package/dist/esm/{chunk-RJ7F4JDV.mjs.map → chunk-JCFTAG5Z.mjs.map} +1 -1
- package/dist/esm/{chunk-CZYH3G7E.mjs → chunk-MML57K5H.mjs} +2 -2
- package/dist/esm/{chunk-57J5YBMT.mjs → chunk-MNDTFHDB.mjs} +2 -2
- package/dist/esm/{chunk-U7HD6PQV.mjs → chunk-SLWIGOQL.mjs} +2 -2
- package/dist/esm/{chunk-V2QSMVJ5.mjs → chunk-TYYVB2A6.mjs} +2 -2
- package/dist/esm/{chunk-HETYL3WN.mjs → chunk-U3GMNXO4.mjs} +2 -2
- package/dist/esm/{chunk-VHNX2NUR.mjs → chunk-UL777LTI.mjs} +47 -26
- package/dist/esm/chunk-UL777LTI.mjs.map +1 -0
- package/dist/esm/{chunk-GBNAG7KK.mjs → chunk-XZ75T7Q7.mjs} +2 -2
- package/dist/esm/chunk-Y7ZQTLH4.mjs +2 -0
- package/dist/esm/chunk-Y7ZQTLH4.mjs.map +1 -0
- package/dist/esm/{chunk-KRBZ54CY.mjs → chunk-Z5URUE4U.mjs} +2 -2
- package/dist/esm/cli/index.d.mts +3 -7
- package/dist/esm/cli/index.mjs +1 -1
- package/dist/esm/cli/localNode.mjs +1 -1
- package/dist/esm/cli/move.d.mts +3 -7
- package/dist/esm/client/core.d.mts +3 -3
- package/dist/esm/client/core.mjs +1 -1
- package/dist/esm/client/get.d.mts +3 -3
- package/dist/esm/client/get.mjs +1 -1
- package/dist/esm/client/index.d.mts +2 -2
- package/dist/esm/client/index.mjs +1 -1
- package/dist/esm/client/post.d.mts +3 -3
- package/dist/esm/client/post.mjs +1 -1
- package/dist/esm/core/account/index.d.mts +3 -7
- package/dist/esm/core/account/index.mjs +1 -1
- package/dist/esm/core/account/utils/address.d.mts +3 -7
- package/dist/esm/core/account/utils/address.mjs +1 -1
- package/dist/esm/core/account/utils/index.d.mts +3 -7
- package/dist/esm/core/account/utils/index.mjs +1 -1
- package/dist/esm/core/accountAddress.d.mts +3 -329
- package/dist/esm/core/accountAddress.mjs +1 -1
- package/dist/esm/core/authenticationKey.d.mts +2 -10
- package/dist/esm/core/authenticationKey.mjs +1 -1
- package/dist/esm/core/crypto/abstraction.d.mts +2 -10
- package/dist/esm/core/crypto/abstraction.mjs +1 -1
- package/dist/esm/core/crypto/deserializationUtils.d.mts +2 -10
- package/dist/esm/core/crypto/deserializationUtils.mjs +1 -1
- package/dist/esm/core/crypto/ed25519.d.mts +2 -301
- package/dist/esm/core/crypto/ed25519.mjs +1 -1
- package/dist/esm/core/crypto/ephemeral.d.mts +2 -10
- package/dist/esm/core/crypto/ephemeral.mjs +1 -1
- package/dist/esm/core/crypto/federatedKeyless.d.mts +4 -12
- package/dist/esm/core/crypto/federatedKeyless.mjs +1 -1
- package/dist/esm/core/crypto/index.d.mts +4 -17
- package/dist/esm/core/crypto/index.mjs +1 -1
- package/dist/esm/core/crypto/keyless.d.mts +3 -11
- package/dist/esm/core/crypto/keyless.mjs +1 -1
- package/dist/esm/core/crypto/multiEd25519.d.mts +2 -228
- package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
- package/dist/esm/core/crypto/multiKey.d.mts +2 -254
- package/dist/esm/core/crypto/multiKey.mjs +1 -1
- package/dist/esm/core/crypto/privateKey.d.mts +2 -71
- package/dist/esm/core/crypto/privateKey.mjs +1 -1
- package/dist/esm/core/crypto/proof.d.mts +3 -4
- package/dist/esm/core/crypto/proof.mjs +1 -1
- package/dist/esm/core/crypto/publicKey.d.mts +2 -10
- package/dist/esm/core/crypto/publicKey.mjs +1 -1
- package/dist/esm/core/crypto/secp256k1.d.mts +2 -274
- package/dist/esm/core/crypto/secp256k1.mjs +1 -1
- package/dist/esm/core/crypto/signature.d.mts +3 -31
- package/dist/esm/core/crypto/signature.mjs +1 -1
- package/dist/esm/core/crypto/singleKey.d.mts +2 -182
- package/dist/esm/core/crypto/singleKey.mjs +1 -1
- package/dist/esm/core/crypto/types.d.mts +11 -0
- package/dist/esm/core/crypto/types.mjs +2 -0
- package/dist/esm/core/crypto/types.mjs.map +1 -0
- package/dist/esm/core/crypto/utils.d.mts +3 -1
- package/dist/esm/core/hex.d.mts +3 -156
- package/dist/esm/core/index.d.mts +3 -16
- package/dist/esm/core/index.mjs +1 -1
- package/dist/esm/errors/index.d.mts +2 -1
- package/dist/esm/errors/index.mjs +1 -1
- package/dist/esm/{federatedKeyless-DAYXjY2Y.d.mts → federatedKeyless-CiyplsOB.d.mts} +1 -7
- package/dist/esm/index.d.mts +7 -32
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/internal/abstraction.d.mts +2 -29
- package/dist/esm/internal/abstraction.mjs +1 -1
- package/dist/esm/internal/account.d.mts +39 -36
- package/dist/esm/internal/account.mjs +1 -1
- package/dist/esm/internal/ans.d.mts +3 -30
- package/dist/esm/internal/ans.mjs +1 -1
- package/dist/esm/internal/coin.d.mts +3 -30
- package/dist/esm/internal/coin.mjs +1 -1
- package/dist/esm/internal/digitalAsset.d.mts +3 -30
- package/dist/esm/internal/digitalAsset.mjs +1 -1
- package/dist/esm/internal/event.d.mts +2 -8
- package/dist/esm/internal/event.mjs +1 -1
- package/dist/esm/internal/faucet.d.mts +3 -9
- package/dist/esm/internal/faucet.mjs +1 -1
- package/dist/esm/internal/fungibleAsset.d.mts +3 -30
- package/dist/esm/internal/fungibleAsset.mjs +1 -1
- package/dist/esm/internal/general.d.mts +2 -2
- package/dist/esm/internal/general.mjs +1 -1
- package/dist/esm/internal/keyless.d.mts +14 -32
- package/dist/esm/internal/keyless.mjs +1 -1
- package/dist/esm/internal/object.d.mts +2 -8
- package/dist/esm/internal/object.mjs +1 -1
- package/dist/esm/internal/staking.d.mts +2 -8
- package/dist/esm/internal/staking.mjs +1 -1
- package/dist/esm/internal/table.d.mts +2 -2
- package/dist/esm/internal/table.mjs +1 -1
- package/dist/esm/internal/transaction.d.mts +3 -3
- package/dist/esm/internal/transaction.mjs +1 -1
- package/dist/esm/internal/transactionSubmission.d.mts +6 -33
- package/dist/esm/internal/transactionSubmission.mjs +1 -1
- package/dist/esm/internal/utils/index.d.mts +2 -8
- package/dist/esm/internal/utils/index.mjs +1 -1
- package/dist/esm/internal/utils/utils.d.mts +2 -8
- package/dist/esm/internal/utils/utils.mjs +1 -1
- package/dist/esm/internal/view.d.mts +1 -28
- package/dist/esm/internal/view.mjs +1 -1
- package/dist/esm/transactions/authenticator/account.d.mts +2 -179
- package/dist/esm/transactions/authenticator/account.mjs +1 -1
- package/dist/esm/transactions/authenticator/index.d.mts +2 -17
- package/dist/esm/transactions/authenticator/index.mjs +1 -1
- package/dist/esm/transactions/authenticator/transaction.d.mts +2 -17
- package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
- package/dist/esm/transactions/index.d.mts +3 -30
- package/dist/esm/transactions/index.mjs +1 -1
- package/dist/esm/transactions/instances/chainId.d.mts +3 -44
- package/dist/esm/transactions/instances/identifier.d.mts +2 -44
- package/dist/esm/transactions/instances/index.d.mts +2 -27
- package/dist/esm/transactions/instances/index.mjs +1 -1
- package/dist/esm/transactions/instances/moduleId.d.mts +3 -57
- package/dist/esm/transactions/instances/moduleId.mjs +1 -1
- package/dist/esm/transactions/instances/multiAgentTransaction.d.mts +2 -60
- package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/rawTransaction.d.mts +2 -150
- package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/rotationProofChallenge.d.mts +2 -12
- package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
- package/dist/esm/transactions/instances/signedTransaction.d.mts +2 -23
- package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/simpleTransaction.d.mts +2 -59
- package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/transactionArgument.d.mts +2 -74
- package/dist/esm/transactions/instances/transactionPayload.d.mts +2 -300
- package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
- package/dist/esm/transactions/management/accountSequenceNumber.d.mts +2 -29
- package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
- package/dist/esm/transactions/management/index.d.mts +2 -29
- package/dist/esm/transactions/management/index.mjs +1 -1
- package/dist/esm/transactions/management/transactionWorker.d.mts +2 -29
- package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/helpers.d.mts +3 -30
- package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/index.d.mts +2 -29
- package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +2 -29
- package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/signingMessage.d.mts +1 -28
- package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +3 -29
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
- package/dist/esm/transactions/typeTag/index.d.mts +2 -462
- package/dist/esm/transactions/typeTag/index.mjs +1 -1
- package/dist/esm/transactions/typeTag/parser.d.mts +2 -8
- package/dist/esm/transactions/typeTag/parser.mjs +1 -1
- package/dist/esm/transactions/types.d.mts +3 -399
- package/dist/esm/types/generated/operations.d.mts +37 -10
- package/dist/esm/types/generated/queries.d.mts +6 -2
- package/dist/esm/types/generated/queries.mjs +1 -1
- package/dist/esm/types/generated/types.d.mts +584 -1172
- 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 +4 -2
- package/dist/esm/types/index.mjs +1 -1
- package/dist/esm/types/indexer.d.mts +8 -2
- package/dist/esm/types/types.d.mts +5 -1298
- package/dist/esm/types/types.mjs +1 -1
- package/dist/esm/utils/const.d.mts +1 -0
- package/dist/esm/utils/const.mjs +1 -1
- package/dist/esm/utils/helpers.d.mts +2 -6
- package/dist/esm/utils/helpers.mjs +1 -1
- package/dist/esm/utils/index.d.mts +1 -6
- package/dist/esm/utils/index.mjs +1 -1
- package/dist/esm/utils/normalizeBundle.d.mts +2 -4
- 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 +1 -1
- package/src/account/FederatedKeylessAccount.ts +7 -1
- package/src/account/KeylessAccount.ts +17 -2
- package/src/api/account.ts +135 -2
- package/src/api/aptos.ts +6 -2
- package/src/api/aptosConfig.ts +73 -2
- package/src/api/transaction.ts +10 -6
- package/src/api/transactionSubmission/build.ts +5 -1
- package/src/api/transactionSubmission/submit.ts +16 -12
- package/src/core/crypto/index.ts +1 -0
- package/src/core/crypto/multiEd25519.ts +26 -0
- package/src/core/crypto/multiKey.ts +20 -1
- package/src/core/crypto/types.ts +9 -0
- package/src/internal/account.ts +526 -59
- package/src/internal/keyless.ts +10 -0
- package/src/internal/queries/getAccountAddressesForAuthKey.graphql +8 -0
- package/src/internal/queries/getAuthKeysForPublicKey.graphql +11 -0
- package/src/internal/transactionSubmission.ts +20 -10
- package/src/transactions/instances/transactionPayload.ts +165 -2
- package/src/transactions/management/transactionWorker.ts +1 -1
- package/src/transactions/transactionBuilder/transactionBuilder.ts +64 -5
- package/src/transactions/types.ts +61 -10
- package/src/types/codegen.yaml +1 -1
- package/src/types/generated/operations.ts +39 -8
- package/src/types/generated/queries.ts +53 -0
- package/src/types/generated/types.ts +620 -1239
- package/src/types/indexer.ts +8 -0
- package/src/types/types.ts +151 -3
- package/src/utils/const.ts +1 -0
- package/src/version.ts +1 -1
- package/dist/common/accountAddress-AL8HRxQC.d.ts +0 -3148
- package/dist/common/chunk-ZMDE3DNL.js +0 -4
- package/dist/esm/chunk-BK56GLTP.mjs +0 -4
- package/dist/esm/chunk-BK56GLTP.mjs.map +0 -1
- package/dist/esm/chunk-ODAAZLPK.mjs +0 -2
- package/dist/esm/chunk-ODAAZLPK.mjs.map +0 -1
- package/dist/esm/chunk-RJ7F4JDV.mjs +0 -2
- package/dist/esm/chunk-VEGW6HP5.mjs +0 -2
- package/dist/esm/chunk-VHNX2NUR.mjs.map +0 -1
- package/dist/esm/chunk-XTMUMN74.mjs +0 -2
- package/dist/esm/chunk-XTMUMN74.mjs.map +0 -1
- package/dist/esm/publicKey-CJOcUwJK.d.mts +0 -213
- /package/dist/esm/{chunk-Q4W3WJ2U.mjs.map → chunk-2BOHKN33.mjs.map} +0 -0
- /package/dist/esm/{chunk-AMAPBD4D.mjs.map → chunk-4COLMDT3.mjs.map} +0 -0
- /package/dist/esm/{chunk-UOP7GBXB.mjs.map → chunk-5URUYE6H.mjs.map} +0 -0
- /package/dist/esm/{chunk-V74WPKSY.mjs.map → chunk-FYYEPFML.mjs.map} +0 -0
- /package/dist/esm/{chunk-CZYH3G7E.mjs.map → chunk-MML57K5H.mjs.map} +0 -0
- /package/dist/esm/{chunk-57J5YBMT.mjs.map → chunk-MNDTFHDB.mjs.map} +0 -0
- /package/dist/esm/{chunk-U7HD6PQV.mjs.map → chunk-SLWIGOQL.mjs.map} +0 -0
- /package/dist/esm/{chunk-V2QSMVJ5.mjs.map → chunk-TYYVB2A6.mjs.map} +0 -0
- /package/dist/esm/{chunk-HETYL3WN.mjs.map → chunk-U3GMNXO4.mjs.map} +0 -0
- /package/dist/esm/{chunk-GBNAG7KK.mjs.map → chunk-XZ75T7Q7.mjs.map} +0 -0
- /package/dist/esm/{chunk-KRBZ54CY.mjs.map → chunk-Z5URUE4U.mjs.map} +0 -0
package/dist/esm/types/types.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{A,B,C,D,E,F,G,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"../chunk-
|
|
1
|
+
import{A,B,C,D,E,F,G,H,I,J,K,L,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"../chunk-IJE2LVZG.mjs";import"../chunk-KDMSOCZY.mjs";export{j as AccountAuthenticatorVariant,l as AnyPublicKeyVariant,n as AnySignatureVariant,L as DeriveScheme,q as EphemeralCertificateVariant,o as EphemeralPublicKeyVariant,p as EphemeralSignatureVariant,a as MimeType,H as MoveAbility,G as MoveFunctionVisibility,k as PrivateKeyVariants,I as RoleType,c as ScriptTransactionArgumentVariants,J as SigningScheme,K as SigningSchemeInput,i as TransactionAuthenticatorVariant,f as TransactionExecutableVariants,g as TransactionExtraConfigVariants,e as TransactionInnerPayloadVariants,d as TransactionPayloadVariants,s as TransactionResponseType,h as TransactionVariants,b as TypeTagVariants,r as ZkpVariant,m as anyPublicKeyVariantToString,z as isBlockEpilogueTransactionResponse,w as isBlockMetadataTransactionResponse,A as isEd25519Signature,D as isFeePayerSignature,v as isGenesisTransactionResponse,C as isMultiAgentSignature,E as isMultiEd25519Signature,t as isPendingTransactionResponse,B as isSecp256k1Signature,F as isSingleSenderSignature,x as isStateCheckpointTransactionResponse,u as isUserTransactionResponse,y as isValidatorTransactionResponse};
|
|
2
2
|
//# sourceMappingURL=types.mjs.map
|
|
@@ -69,6 +69,7 @@ declare const RAW_TRANSACTION_WITH_DATA_SALT = "APTOS::RawTransactionWithData";
|
|
|
69
69
|
* @category Utils
|
|
70
70
|
*/
|
|
71
71
|
declare enum ProcessorType {
|
|
72
|
+
ACCOUNT_RESTORATION_PROCESSOR = "account_restoration_processor",
|
|
72
73
|
ACCOUNT_TRANSACTION_PROCESSOR = "account_transactions_processor",
|
|
73
74
|
DEFAULT = "default_processor",
|
|
74
75
|
EVENTS_PROCESSOR = "events_processor",
|
package/dist/esm/utils/const.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i,j}from"../chunk-
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j}from"../chunk-JCFTAG5Z.mjs";import"../chunk-KDMSOCZY.mjs";export{e as APTOS_COIN,f as APTOS_FA,a as AptosApiType,b as DEFAULT_MAX_GAS_AMOUNT,c as DEFAULT_TXN_EXP_SEC_FROM_NOW,d as DEFAULT_TXN_TIMEOUT_SEC,j as FIREBASE_AUTH_ISS_PATTERN,i as ProcessorType,g as RAW_TRANSACTION_SALT,h as RAW_TRANSACTION_WITH_DATA_SALT};
|
|
2
2
|
//# sourceMappingURL=const.mjs.map
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
import { MoveStructId, MoveFunctionId } from '../
|
|
2
|
-
import { AccountAddress } from '../core/accountAddress.mjs';
|
|
1
|
+
import { d7 as MoveStructId, d8 as MoveFunctionId, n as AccountAddress } from '../account--Q9z_xMN.mjs';
|
|
3
2
|
import '../types/indexer.mjs';
|
|
4
3
|
import '../types/generated/operations.mjs';
|
|
5
4
|
import '../types/generated/types.mjs';
|
|
6
5
|
import './apiEndpoints.mjs';
|
|
7
|
-
import '
|
|
8
|
-
import '../core/hex.mjs';
|
|
6
|
+
import './const.mjs';
|
|
9
7
|
import '../core/common.mjs';
|
|
10
|
-
import '../bcs/deserializer.mjs';
|
|
11
|
-
import '../transactions/instances/transactionArgument.mjs';
|
|
12
8
|
|
|
13
9
|
/**
|
|
14
10
|
* Sleep for the specified amount of time in milliseconds.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n}from"../chunk-7DQDJ2SA.mjs";import"../chunk-HNBVYE3N.mjs";import"../chunk-RGKRCZ36.mjs";import"../chunk-FD6FGKYY.mjs";import"../chunk-
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n}from"../chunk-7DQDJ2SA.mjs";import"../chunk-HNBVYE3N.mjs";import"../chunk-RGKRCZ36.mjs";import"../chunk-FD6FGKYY.mjs";import"../chunk-IJE2LVZG.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-EBMEXURY.mjs";import"../chunk-STY74NUA.mjs";import"../chunk-IF4UU2MT.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-KDMSOCZY.mjs";export{e as base64UrlDecode,f as base64UrlToBytes,g as convertAmountFromHumanReadableToOnChain,h as convertAmountFromOnChainToHumanReadable,d as floorToWholeHour,b as getErrorMessage,k as getFunctionParts,j as isEncodedStruct,l as isValidFunctionInfo,c as nowInSeconds,n as pairedFaMetadataAddress,i as parseEncodedStruct,a as sleep,m as truncateAddress};
|
|
2
2
|
//# sourceMappingURL=helpers.mjs.map
|
|
@@ -2,13 +2,8 @@ export { Network, NetworkToChainId, NetworkToFaucetAPI, NetworkToIndexerAPI, Net
|
|
|
2
2
|
export { APTOS_COIN, APTOS_FA, AptosApiType, DEFAULT_MAX_GAS_AMOUNT, DEFAULT_TXN_EXP_SEC_FROM_NOW, DEFAULT_TXN_TIMEOUT_SEC, FIREBASE_AUTH_ISS_PATTERN, ProcessorType, RAW_TRANSACTION_SALT, RAW_TRANSACTION_WITH_DATA_SALT } from './const.mjs';
|
|
3
3
|
export { DeserializableClass, normalizeBundle } from './normalizeBundle.mjs';
|
|
4
4
|
export { base64UrlDecode, base64UrlToBytes, convertAmountFromHumanReadableToOnChain, convertAmountFromOnChainToHumanReadable, floorToWholeHour, getErrorMessage, getFunctionParts, isEncodedStruct, isValidFunctionInfo, nowInSeconds, pairedFaMetadataAddress, parseEncodedStruct, sleep, truncateAddress } from './helpers.mjs';
|
|
5
|
-
import '../
|
|
6
|
-
import '../types/types.mjs';
|
|
5
|
+
import '../account--Q9z_xMN.mjs';
|
|
7
6
|
import '../types/indexer.mjs';
|
|
8
7
|
import '../types/generated/operations.mjs';
|
|
9
8
|
import '../types/generated/types.mjs';
|
|
10
|
-
import '../bcs/serializer.mjs';
|
|
11
|
-
import '../core/hex.mjs';
|
|
12
9
|
import '../core/common.mjs';
|
|
13
|
-
import '../core/accountAddress.mjs';
|
|
14
|
-
import '../transactions/instances/transactionArgument.mjs';
|
package/dist/esm/utils/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-HGLO5LDS.mjs";import{a as s}from"../chunk-CW35YAMN.mjs";import{a
|
|
1
|
+
import"../chunk-HGLO5LDS.mjs";import{a as s}from"../chunk-CW35YAMN.mjs";import{a as t,b as u,c as v,d as w,e as x,f as y,g as z,h as A,i as B,j as C,k as D,l as E,m as F,n as G}from"../chunk-7DQDJ2SA.mjs";import"../chunk-HNBVYE3N.mjs";import"../chunk-RGKRCZ36.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-2BOHKN33.mjs";import"../chunk-ORMOQWWH.mjs";import"../chunk-TOBQ5UE6.mjs";import"../chunk-MT2RJ7H3.mjs";import"../chunk-FD6FGKYY.mjs";import"../chunk-IJE2LVZG.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-EBMEXURY.mjs";import"../chunk-FLZPUYXQ.mjs";import"../chunk-STY74NUA.mjs";import"../chunk-IF4UU2MT.mjs";import"../chunk-56CNRT2K.mjs";import{a,b,c,d,e,f,g,h}from"../chunk-4RXKALLC.mjs";import{a as i,b as j,c as k,d as l,e as m,f as n,g as o,h as p,i as q,j as r}from"../chunk-JCFTAG5Z.mjs";import"../chunk-KDMSOCZY.mjs";export{m as APTOS_COIN,n as APTOS_FA,i as AptosApiType,j as DEFAULT_MAX_GAS_AMOUNT,k as DEFAULT_TXN_EXP_SEC_FROM_NOW,l as DEFAULT_TXN_TIMEOUT_SEC,r as FIREBASE_AUTH_ISS_PATTERN,f as Network,g as NetworkToChainId,c as NetworkToFaucetAPI,a as NetworkToIndexerAPI,h as NetworkToNetworkName,b as NetworkToNodeAPI,d as NetworkToPepperAPI,e as NetworkToProverAPI,q as ProcessorType,o as RAW_TRANSACTION_SALT,p as RAW_TRANSACTION_WITH_DATA_SALT,x as base64UrlDecode,y as base64UrlToBytes,z as convertAmountFromHumanReadableToOnChain,A as convertAmountFromOnChainToHumanReadable,w as floorToWholeHour,u as getErrorMessage,D as getFunctionParts,C as isEncodedStruct,E as isValidFunctionInfo,s as normalizeBundle,v as nowInSeconds,G as pairedFaMetadataAddress,B as parseEncodedStruct,t as sleep,F as truncateAddress};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { Deserializer } from '../
|
|
2
|
-
import { Serializable } from '../bcs/serializer.mjs';
|
|
3
|
-
import '../types/types.mjs';
|
|
1
|
+
import { S as Serializable, a as Deserializer } from '../account--Q9z_xMN.mjs';
|
|
4
2
|
import '../types/indexer.mjs';
|
|
5
3
|
import '../types/generated/operations.mjs';
|
|
6
4
|
import '../types/generated/types.mjs';
|
|
7
5
|
import './apiEndpoints.mjs';
|
|
8
|
-
import '
|
|
6
|
+
import './const.mjs';
|
|
9
7
|
import '../core/common.mjs';
|
|
10
8
|
|
|
11
9
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-CW35YAMN.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-
|
|
1
|
+
import{a}from"../chunk-CW35YAMN.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-2BOHKN33.mjs";import"../chunk-ORMOQWWH.mjs";import"../chunk-TOBQ5UE6.mjs";import"../chunk-MT2RJ7H3.mjs";import"../chunk-FD6FGKYY.mjs";import"../chunk-IJE2LVZG.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-EBMEXURY.mjs";import"../chunk-FLZPUYXQ.mjs";import"../chunk-STY74NUA.mjs";import"../chunk-IF4UU2MT.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-KDMSOCZY.mjs";export{a as normalizeBundle};
|
|
2
2
|
//# sourceMappingURL=normalizeBundle.mjs.map
|
package/dist/esm/version.d.mts
CHANGED
package/dist/esm/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-HUWKPKPQ.mjs";import"./chunk-KDMSOCZY.mjs";export{a as VERSION};
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|
package/package.json
CHANGED
|
@@ -140,6 +140,7 @@ export class FederatedKeylessAccount extends AbstractKeylessAccount {
|
|
|
140
140
|
uidKey?: string;
|
|
141
141
|
proofFetchCallback?: ProofFetchCallback;
|
|
142
142
|
verificationKey?: Groth16VerificationKey;
|
|
143
|
+
verificationKeyHash?: Uint8Array;
|
|
143
144
|
}): FederatedKeylessAccount {
|
|
144
145
|
const {
|
|
145
146
|
address,
|
|
@@ -151,8 +152,13 @@ export class FederatedKeylessAccount extends AbstractKeylessAccount {
|
|
|
151
152
|
uidKey = "sub",
|
|
152
153
|
proofFetchCallback,
|
|
153
154
|
verificationKey,
|
|
155
|
+
verificationKeyHash,
|
|
154
156
|
} = args;
|
|
155
157
|
|
|
158
|
+
if (verificationKeyHash && verificationKey) {
|
|
159
|
+
throw new Error("Cannot provide both verificationKey and verificationKeyHash");
|
|
160
|
+
}
|
|
161
|
+
|
|
156
162
|
const { iss, aud, uidVal } = getIssAudAndUidVal({ jwt, uidKey });
|
|
157
163
|
return new FederatedKeylessAccount({
|
|
158
164
|
address,
|
|
@@ -166,7 +172,7 @@ export class FederatedKeylessAccount extends AbstractKeylessAccount {
|
|
|
166
172
|
jwkAddress: AccountAddress.from(jwkAddress),
|
|
167
173
|
jwt,
|
|
168
174
|
proofFetchCallback,
|
|
169
|
-
verificationKeyHash: verificationKey ? verificationKey.hash() : undefined,
|
|
175
|
+
verificationKeyHash: verificationKeyHash ?? (verificationKey ? verificationKey.hash() : undefined),
|
|
170
176
|
});
|
|
171
177
|
}
|
|
172
178
|
}
|
|
@@ -143,8 +143,23 @@ export class KeylessAccount extends AbstractKeylessAccount {
|
|
|
143
143
|
uidKey?: string;
|
|
144
144
|
proofFetchCallback?: ProofFetchCallback;
|
|
145
145
|
verificationKey?: Groth16VerificationKey;
|
|
146
|
+
verificationKeyHash?: Uint8Array;
|
|
146
147
|
}): KeylessAccount {
|
|
147
|
-
const {
|
|
148
|
+
const {
|
|
149
|
+
address,
|
|
150
|
+
proof,
|
|
151
|
+
jwt,
|
|
152
|
+
ephemeralKeyPair,
|
|
153
|
+
pepper,
|
|
154
|
+
uidKey = "sub",
|
|
155
|
+
proofFetchCallback,
|
|
156
|
+
verificationKey,
|
|
157
|
+
verificationKeyHash,
|
|
158
|
+
} = args;
|
|
159
|
+
|
|
160
|
+
if (verificationKeyHash && verificationKey) {
|
|
161
|
+
throw new Error("Cannot provide both verificationKey and verificationKeyHash");
|
|
162
|
+
}
|
|
148
163
|
|
|
149
164
|
const { iss, aud, uidVal } = getIssAudAndUidVal({ jwt, uidKey });
|
|
150
165
|
return new KeylessAccount({
|
|
@@ -158,7 +173,7 @@ export class KeylessAccount extends AbstractKeylessAccount {
|
|
|
158
173
|
pepper,
|
|
159
174
|
jwt,
|
|
160
175
|
proofFetchCallback,
|
|
161
|
-
verificationKeyHash: verificationKey ? verificationKey.hash() : undefined,
|
|
176
|
+
verificationKeyHash: verificationKeyHash ?? (verificationKey ? verificationKey.hash() : undefined),
|
|
162
177
|
});
|
|
163
178
|
}
|
|
164
179
|
}
|
package/src/api/account.ts
CHANGED
|
@@ -2,7 +2,13 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
4
|
import { Account as AccountModule } from "../account";
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
AccountAddress,
|
|
7
|
+
AccountAddressInput,
|
|
8
|
+
createObjectAddress,
|
|
9
|
+
BaseAccountPublicKey,
|
|
10
|
+
PrivateKeyInput,
|
|
11
|
+
} from "../core";
|
|
6
12
|
import {
|
|
7
13
|
AccountData,
|
|
8
14
|
AnyNumber,
|
|
@@ -31,6 +37,7 @@ import {
|
|
|
31
37
|
getAccountOwnedObjects,
|
|
32
38
|
getAccountOwnedTokens,
|
|
33
39
|
getAccountOwnedTokensFromCollectionAddress,
|
|
40
|
+
getAccountsForPublicKey,
|
|
34
41
|
getAccountTokensCount,
|
|
35
42
|
getAccountTransactionsCount,
|
|
36
43
|
getInfo,
|
|
@@ -42,6 +49,8 @@ import {
|
|
|
42
49
|
getResourcesPage,
|
|
43
50
|
getTransactions,
|
|
44
51
|
lookupOriginalAccountAddress,
|
|
52
|
+
deriveOwnedAccountsFromSigner,
|
|
53
|
+
AccountInfo,
|
|
45
54
|
} from "../internal/account";
|
|
46
55
|
import { APTOS_COIN, APTOS_FA, ProcessorType } from "../utils/const";
|
|
47
56
|
import { AptosConfig } from "./aptosConfig";
|
|
@@ -977,7 +986,131 @@ export class Account {
|
|
|
977
986
|
* @group Account
|
|
978
987
|
* @deprecated Note that more inspection is needed by the user to determine which account exists on-chain
|
|
979
988
|
*/
|
|
980
|
-
async deriveAccountFromPrivateKey(args: {
|
|
989
|
+
async deriveAccountFromPrivateKey(args: {
|
|
990
|
+
privateKey: PrivateKeyInput;
|
|
991
|
+
minimumLedgerVersion?: AnyNumber;
|
|
992
|
+
options?: {
|
|
993
|
+
throwIfNoAccountFound?: boolean;
|
|
994
|
+
};
|
|
995
|
+
}): Promise<AccountModule> {
|
|
996
|
+
await waitForIndexerOnVersion({
|
|
997
|
+
config: this.config,
|
|
998
|
+
minimumLedgerVersion: args.minimumLedgerVersion,
|
|
999
|
+
processorType: ProcessorType.ACCOUNT_RESTORATION_PROCESSOR,
|
|
1000
|
+
});
|
|
1001
|
+
await waitForIndexerOnVersion({
|
|
1002
|
+
config: this.config,
|
|
1003
|
+
minimumLedgerVersion: args.minimumLedgerVersion,
|
|
1004
|
+
processorType: ProcessorType.OBJECT_PROCESSOR,
|
|
1005
|
+
});
|
|
981
1006
|
return deriveAccountFromPrivateKey({ aptosConfig: this.config, ...args });
|
|
982
1007
|
}
|
|
1008
|
+
|
|
1009
|
+
/**
|
|
1010
|
+
* Derives all accounts owned by a signer. This function takes a signer (either an Account or PrivateKey)
|
|
1011
|
+
* and returns all accounts that can be derived from it, ordered by the most recently used account first.
|
|
1012
|
+
*
|
|
1013
|
+
* Note, this function will not return accounts that require more than one signer to be used.
|
|
1014
|
+
*
|
|
1015
|
+
* @param args - The arguments for deriving owned accounts
|
|
1016
|
+
* @param args.signer - The signer to derive accounts from (Account or PrivateKey)
|
|
1017
|
+
* @param args.minimumLedgerVersion - The minimum ledger version to wait for before querying
|
|
1018
|
+
* @param args.options.includeUnverified - Whether to include unverified accounts in the results. Unverified accounts
|
|
1019
|
+
* are accounts that can be authenticated with the signer, but there is no history of the signer using the account.
|
|
1020
|
+
* Default is false.
|
|
1021
|
+
* @param args.options.noMultiKey - If true, do not include multi-key accounts in the results. Default is false.
|
|
1022
|
+
* @returns Promise resolving to an array of derived Account objects
|
|
1023
|
+
*
|
|
1024
|
+
* @example
|
|
1025
|
+
* ```typescript
|
|
1026
|
+
* import { Aptos, AptosConfig, Network, Ed25519Account } from "@aptos-labs/ts-sdk";
|
|
1027
|
+
*
|
|
1028
|
+
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
1029
|
+
* const aptos = new Aptos(config);
|
|
1030
|
+
*
|
|
1031
|
+
* async function getOwnedAccounts() {
|
|
1032
|
+
* const signer = Ed25519Account.generate();
|
|
1033
|
+
* const accounts = await aptos.deriveOwnedAccountsFromSigner({
|
|
1034
|
+
* signer
|
|
1035
|
+
* });
|
|
1036
|
+
* const account = accounts[0];
|
|
1037
|
+
* console.log(account);
|
|
1038
|
+
* }
|
|
1039
|
+
* ```
|
|
1040
|
+
* @group Account
|
|
1041
|
+
*/
|
|
1042
|
+
async deriveOwnedAccountsFromSigner(args: {
|
|
1043
|
+
signer: AccountModule | PrivateKeyInput;
|
|
1044
|
+
minimumLedgerVersion?: AnyNumber;
|
|
1045
|
+
options?: { includeUnverified?: boolean; noMultiKey?: boolean };
|
|
1046
|
+
}): Promise<AccountModule[]> {
|
|
1047
|
+
await waitForIndexerOnVersion({
|
|
1048
|
+
config: this.config,
|
|
1049
|
+
minimumLedgerVersion: args.minimumLedgerVersion,
|
|
1050
|
+
processorType: ProcessorType.ACCOUNT_RESTORATION_PROCESSOR,
|
|
1051
|
+
});
|
|
1052
|
+
await waitForIndexerOnVersion({
|
|
1053
|
+
config: this.config,
|
|
1054
|
+
minimumLedgerVersion: args.minimumLedgerVersion,
|
|
1055
|
+
processorType: ProcessorType.OBJECT_PROCESSOR,
|
|
1056
|
+
});
|
|
1057
|
+
return deriveOwnedAccountsFromSigner({ aptosConfig: this.config, ...args });
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
/**
|
|
1061
|
+
* Gets all account info (address, account public key, last transaction version) that have are associated with a public key and **related public keys**
|
|
1062
|
+
*
|
|
1063
|
+
* For a given public key, it will query all multikeys that the public key is part of. Then for the provided public key and
|
|
1064
|
+
* any multikeys found in the previous step, it will query for any accounts that have an auth key that matches any of the
|
|
1065
|
+
* public keys.
|
|
1066
|
+
*
|
|
1067
|
+
* Note: If an Ed25519PublicKey or an AnyPublicKey that wraps Ed25519PublicKey is passed in, it will query for both legacy and single singer cases.
|
|
1068
|
+
*
|
|
1069
|
+
* @param args - The arguments for getting accounts for a public key
|
|
1070
|
+
* @param args.publicKey - The public key to look up accounts for
|
|
1071
|
+
* @param args.minimumLedgerVersion - The minimum ledger version to wait for before querying
|
|
1072
|
+
* @param args.options.includeUnverified - Whether to include unverified accounts in the results. Unverified accounts
|
|
1073
|
+
* are accounts that can be authenticated with the signer, but there is no history of the signer using the account. Default
|
|
1074
|
+
* is false.
|
|
1075
|
+
* @param args.options.noMultiKey - Whether to exclude multi-key accounts in the results. Default is false.
|
|
1076
|
+
* @returns Promise resolving to an array of account addresses and their associated public keys
|
|
1077
|
+
*
|
|
1078
|
+
* @example
|
|
1079
|
+
* ```typescript
|
|
1080
|
+
* import { Aptos, AptosConfig, Network, Ed25519PrivateKey } from "@aptos-labs/ts-sdk";
|
|
1081
|
+
*
|
|
1082
|
+
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
1083
|
+
* const aptos = new Aptos(config);
|
|
1084
|
+
*
|
|
1085
|
+
* async function getAccounts() {
|
|
1086
|
+
* const privateKey = Ed25519PrivateKey.generate();
|
|
1087
|
+
* const publicKey = privateKey.publicKey();
|
|
1088
|
+
* const accounts = await aptos.getAccountsForPublicKey({
|
|
1089
|
+
* publicKey
|
|
1090
|
+
* });
|
|
1091
|
+
* console.log(accounts);
|
|
1092
|
+
* }
|
|
1093
|
+
* ```
|
|
1094
|
+
* @group Account
|
|
1095
|
+
*/
|
|
1096
|
+
async getAccountsForPublicKey(args: {
|
|
1097
|
+
publicKey: BaseAccountPublicKey;
|
|
1098
|
+
minimumLedgerVersion?: AnyNumber;
|
|
1099
|
+
options?: { includeUnverified?: boolean; noMultiKey?: boolean };
|
|
1100
|
+
}): Promise<AccountInfo[]> {
|
|
1101
|
+
await waitForIndexerOnVersion({
|
|
1102
|
+
config: this.config,
|
|
1103
|
+
minimumLedgerVersion: args.minimumLedgerVersion,
|
|
1104
|
+
processorType: ProcessorType.ACCOUNT_RESTORATION_PROCESSOR,
|
|
1105
|
+
});
|
|
1106
|
+
await waitForIndexerOnVersion({
|
|
1107
|
+
config: this.config,
|
|
1108
|
+
minimumLedgerVersion: args.minimumLedgerVersion,
|
|
1109
|
+
processorType: ProcessorType.OBJECT_PROCESSOR,
|
|
1110
|
+
});
|
|
1111
|
+
return getAccountsForPublicKey({
|
|
1112
|
+
aptosConfig: this.config,
|
|
1113
|
+
...args,
|
|
1114
|
+
});
|
|
1115
|
+
}
|
|
983
1116
|
}
|
package/src/api/aptos.ts
CHANGED
|
@@ -92,8 +92,8 @@ export class Aptos {
|
|
|
92
92
|
* ```
|
|
93
93
|
* @group Client
|
|
94
94
|
*/
|
|
95
|
-
constructor(
|
|
96
|
-
this.config = new AptosConfig(
|
|
95
|
+
constructor(config?: AptosConfig) {
|
|
96
|
+
this.config = config ?? new AptosConfig();
|
|
97
97
|
this.account = new Account(this.config);
|
|
98
98
|
this.abstraction = new AccountAbstraction(this.config);
|
|
99
99
|
this.ans = new ANS(this.config);
|
|
@@ -109,6 +109,10 @@ export class Aptos {
|
|
|
109
109
|
this.keyless = new Keyless(this.config);
|
|
110
110
|
this.object = new AptosObject(this.config);
|
|
111
111
|
}
|
|
112
|
+
|
|
113
|
+
setIgnoreTransactionSubmitter(ignore: boolean) {
|
|
114
|
+
this.config.setIgnoreTransactionSubmitter(ignore);
|
|
115
|
+
}
|
|
112
116
|
}
|
|
113
117
|
|
|
114
118
|
// extends Aptos interface so all the methods and properties
|
package/src/api/aptosConfig.ts
CHANGED
|
@@ -2,7 +2,17 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
4
|
import aptosClient from "@aptos-labs/aptos-client";
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
AptosSettings,
|
|
7
|
+
ClientConfig,
|
|
8
|
+
Client,
|
|
9
|
+
FullNodeConfig,
|
|
10
|
+
IndexerConfig,
|
|
11
|
+
FaucetConfig,
|
|
12
|
+
TransactionGenerationConfig,
|
|
13
|
+
PluginConfig,
|
|
14
|
+
TransactionSubmitter,
|
|
15
|
+
} from "../types";
|
|
6
16
|
import {
|
|
7
17
|
NetworkToNodeAPI,
|
|
8
18
|
NetworkToFaucetAPI,
|
|
@@ -11,7 +21,7 @@ import {
|
|
|
11
21
|
NetworkToPepperAPI,
|
|
12
22
|
NetworkToProverAPI,
|
|
13
23
|
} from "../utils/apiEndpoints";
|
|
14
|
-
import { AptosApiType } from "../utils/const";
|
|
24
|
+
import { AptosApiType, DEFAULT_MAX_GAS_AMOUNT, DEFAULT_TXN_EXP_SEC_FROM_NOW } from "../utils/const";
|
|
15
25
|
|
|
16
26
|
/**
|
|
17
27
|
* Represents the configuration settings for an Aptos SDK client instance.
|
|
@@ -101,6 +111,18 @@ export class AptosConfig {
|
|
|
101
111
|
*/
|
|
102
112
|
readonly faucetConfig?: FaucetConfig;
|
|
103
113
|
|
|
114
|
+
/**
|
|
115
|
+
* Optional specific Transaction Generation configurations
|
|
116
|
+
* @group Client
|
|
117
|
+
*/
|
|
118
|
+
readonly transactionGenerationConfig?: TransactionGenerationConfig;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Optional plugin config to override client behavior.
|
|
122
|
+
* @group Client
|
|
123
|
+
*/
|
|
124
|
+
private pluginConfig?: PluginConfig;
|
|
125
|
+
|
|
104
126
|
/**
|
|
105
127
|
* Initializes an instance of the Aptos client with the specified settings.
|
|
106
128
|
* This allows users to configure various aspects of the client, such as network and endpoints.
|
|
@@ -154,6 +176,13 @@ export class AptosConfig {
|
|
|
154
176
|
this.fullnodeConfig = settings?.fullnodeConfig ?? {};
|
|
155
177
|
this.indexerConfig = settings?.indexerConfig ?? {};
|
|
156
178
|
this.faucetConfig = settings?.faucetConfig ?? {};
|
|
179
|
+
this.transactionGenerationConfig = settings?.transactionGenerationConfig ?? {};
|
|
180
|
+
this.pluginConfig = settings?.pluginSettings
|
|
181
|
+
? {
|
|
182
|
+
...settings.pluginSettings,
|
|
183
|
+
IGNORE_TRANSACTION_SUBMITTER: false,
|
|
184
|
+
}
|
|
185
|
+
: undefined;
|
|
157
186
|
}
|
|
158
187
|
|
|
159
188
|
/**
|
|
@@ -265,4 +294,46 @@ export class AptosConfig {
|
|
|
265
294
|
isProverServiceRequest(url: string): boolean {
|
|
266
295
|
return NetworkToProverAPI[this.network] === url;
|
|
267
296
|
}
|
|
297
|
+
|
|
298
|
+
getDefaultMaxGasAmount(): number {
|
|
299
|
+
return this.transactionGenerationConfig?.defaultMaxGasAmount ?? DEFAULT_MAX_GAS_AMOUNT;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
getDefaultTxnExpirySecFromNow(): number {
|
|
303
|
+
return this.transactionGenerationConfig?.defaultTxnExpirySecFromNow ?? DEFAULT_TXN_EXP_SEC_FROM_NOW;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* If you have set a custom transaction submitter, you can use this to determine
|
|
308
|
+
* whether to use it or not. For example, to stop using the transaction submitter:
|
|
309
|
+
*
|
|
310
|
+
* @example
|
|
311
|
+
* ```
|
|
312
|
+
* aptos.config.setIgnoreTransactionSubmitter(true);
|
|
313
|
+
* ```
|
|
314
|
+
*
|
|
315
|
+
* @group Client
|
|
316
|
+
*/
|
|
317
|
+
setIgnoreTransactionSubmitter(ignore: boolean) {
|
|
318
|
+
if (this.pluginConfig) {
|
|
319
|
+
this.pluginConfig.IGNORE_TRANSACTION_SUBMITTER = ignore;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* If a custom transaction submitter has been specified in the PluginConfig and
|
|
325
|
+
* IGNORE_TRANSACTION_SUBMITTER is false, this will return a transaction submitter
|
|
326
|
+
* that should be used instead of the default transaction submission behavior.
|
|
327
|
+
*/
|
|
328
|
+
getTransactionSubmitter(): TransactionSubmitter | undefined {
|
|
329
|
+
if (this.pluginConfig === undefined) {
|
|
330
|
+
return undefined;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
if (this.pluginConfig.IGNORE_TRANSACTION_SUBMITTER === true) {
|
|
334
|
+
return undefined;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
return this.pluginConfig.TRANSACTION_SUBMITTER;
|
|
338
|
+
}
|
|
268
339
|
}
|
package/src/api/transaction.ts
CHANGED
|
@@ -34,6 +34,7 @@ import {
|
|
|
34
34
|
AnyRawTransaction,
|
|
35
35
|
InputGenerateTransactionOptions,
|
|
36
36
|
InputGenerateTransactionPayloadData,
|
|
37
|
+
InputTransactionPluginData,
|
|
37
38
|
} from "../transactions";
|
|
38
39
|
import { AccountAddressInput, AuthenticationKey, Ed25519PrivateKey } from "../core";
|
|
39
40
|
import { Account } from "../account";
|
|
@@ -522,6 +523,7 @@ export class Transaction {
|
|
|
522
523
|
async rotateAuthKey(
|
|
523
524
|
args: {
|
|
524
525
|
fromAccount: Account;
|
|
526
|
+
options?: InputGenerateTransactionOptions;
|
|
525
527
|
} & (
|
|
526
528
|
| { toAccount: Account; dangerouslySkipVerification?: never }
|
|
527
529
|
| { toNewPrivateKey: Ed25519PrivateKey; dangerouslySkipVerification?: never }
|
|
@@ -717,7 +719,7 @@ export class Transaction {
|
|
|
717
719
|
args: FeePayerOrFeePayerAuthenticatorOrNeither & {
|
|
718
720
|
signer: Account;
|
|
719
721
|
transaction: AnyRawTransaction;
|
|
720
|
-
},
|
|
722
|
+
} & InputTransactionPluginData,
|
|
721
723
|
): Promise<PendingTransactionResponse> {
|
|
722
724
|
return signAndSubmitTransaction({
|
|
723
725
|
aptosConfig: this.config,
|
|
@@ -744,11 +746,13 @@ export class Transaction {
|
|
|
744
746
|
* @return PendingTransactionResponse
|
|
745
747
|
* @group Transaction
|
|
746
748
|
*/
|
|
747
|
-
async signAndSubmitAsFeePayer(
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
749
|
+
async signAndSubmitAsFeePayer(
|
|
750
|
+
args: {
|
|
751
|
+
feePayer: Account;
|
|
752
|
+
senderAuthenticator: AccountAuthenticator;
|
|
753
|
+
transaction: AnyRawTransaction;
|
|
754
|
+
} & InputTransactionPluginData,
|
|
755
|
+
): Promise<PendingTransactionResponse> {
|
|
752
756
|
return signAndSubmitAsFeePayer({
|
|
753
757
|
aptosConfig: this.config,
|
|
754
758
|
...args,
|
|
@@ -3,7 +3,11 @@
|
|
|
3
3
|
|
|
4
4
|
import { AccountAddressInput } from "../../core";
|
|
5
5
|
import { generateTransaction } from "../../internal/transactionSubmission";
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
InputGenerateTransactionPayloadData,
|
|
8
|
+
InputGenerateTransactionOptions,
|
|
9
|
+
InputGenerateOrderlessTransactionOptions,
|
|
10
|
+
} from "../../transactions";
|
|
7
11
|
import { MultiAgentTransaction } from "../../transactions/instances/multiAgentTransaction";
|
|
8
12
|
import { SimpleTransaction } from "../../transactions/instances/simpleTransaction";
|
|
9
13
|
import { AptosConfig } from "../aptosConfig";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
4
|
import { submitTransaction } from "../../internal/transactionSubmission";
|
|
5
|
-
import { AccountAuthenticator, AnyRawTransaction } from "../../transactions";
|
|
5
|
+
import { AccountAuthenticator, AnyRawTransaction, InputTransactionPluginData } from "../../transactions";
|
|
6
6
|
import { PendingTransactionResponse } from "../../types";
|
|
7
7
|
import { AptosConfig } from "../aptosConfig";
|
|
8
8
|
import { ValidateFeePayerDataOnSubmission } from "./helpers";
|
|
@@ -87,11 +87,13 @@ export class Submit {
|
|
|
87
87
|
* @group Implementation
|
|
88
88
|
*/
|
|
89
89
|
@ValidateFeePayerDataOnSubmission
|
|
90
|
-
async simple(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
90
|
+
async simple(
|
|
91
|
+
args: {
|
|
92
|
+
transaction: AnyRawTransaction;
|
|
93
|
+
senderAuthenticator: AccountAuthenticator;
|
|
94
|
+
feePayerAuthenticator?: AccountAuthenticator;
|
|
95
|
+
} & InputTransactionPluginData,
|
|
96
|
+
): Promise<PendingTransactionResponse> {
|
|
95
97
|
return submitTransaction({ aptosConfig: this.config, ...args });
|
|
96
98
|
}
|
|
97
99
|
|
|
@@ -141,12 +143,14 @@ export class Submit {
|
|
|
141
143
|
* @group Implementation
|
|
142
144
|
*/
|
|
143
145
|
@ValidateFeePayerDataOnSubmission
|
|
144
|
-
async multiAgent(
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
146
|
+
async multiAgent(
|
|
147
|
+
args: {
|
|
148
|
+
transaction: AnyRawTransaction;
|
|
149
|
+
senderAuthenticator: AccountAuthenticator;
|
|
150
|
+
additionalSignersAuthenticators: Array<AccountAuthenticator>;
|
|
151
|
+
feePayerAuthenticator?: AccountAuthenticator;
|
|
152
|
+
} & InputTransactionPluginData,
|
|
153
|
+
): Promise<PendingTransactionResponse> {
|
|
150
154
|
return submitTransaction({ aptosConfig: this.config, ...args });
|
|
151
155
|
}
|
|
152
156
|
}
|
package/src/core/crypto/index.ts
CHANGED
|
@@ -92,6 +92,10 @@ export class MultiEd25519PublicKey extends AbstractMultiKey {
|
|
|
92
92
|
this.threshold = threshold;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
+
getSignaturesRequired(): number {
|
|
96
|
+
return this.threshold;
|
|
97
|
+
}
|
|
98
|
+
|
|
95
99
|
// region AccountPublicKey
|
|
96
100
|
|
|
97
101
|
/**
|
|
@@ -217,6 +221,28 @@ export class MultiEd25519PublicKey extends AbstractMultiKey {
|
|
|
217
221
|
return new MultiEd25519PublicKey({ publicKeys: keys, threshold });
|
|
218
222
|
}
|
|
219
223
|
|
|
224
|
+
/**
|
|
225
|
+
* Deserializes a MultiEd25519Signature from the provided deserializer.
|
|
226
|
+
* This function helps in reconstructing a MultiEd25519Signature object from its serialized byte representation.
|
|
227
|
+
*
|
|
228
|
+
* @param deserializer - The deserializer instance used to read the serialized data.
|
|
229
|
+
* @group Implementation
|
|
230
|
+
* @category Serialization
|
|
231
|
+
*/
|
|
232
|
+
static deserializeWithoutLength(deserializer: Deserializer): MultiEd25519PublicKey {
|
|
233
|
+
const length = deserializer.remaining();
|
|
234
|
+
const bytes = deserializer.deserializeFixedBytes(length);
|
|
235
|
+
const threshold = bytes[bytes.length - 1];
|
|
236
|
+
|
|
237
|
+
const keys: Ed25519PublicKey[] = [];
|
|
238
|
+
|
|
239
|
+
for (let i = 0; i < bytes.length - 1; i += Ed25519PublicKey.LENGTH) {
|
|
240
|
+
const begin = i;
|
|
241
|
+
keys.push(new Ed25519PublicKey(bytes.subarray(begin, begin + Ed25519PublicKey.LENGTH)));
|
|
242
|
+
}
|
|
243
|
+
return new MultiEd25519PublicKey({ publicKeys: keys, threshold });
|
|
244
|
+
}
|
|
245
|
+
|
|
220
246
|
// endregion
|
|
221
247
|
|
|
222
248
|
/**
|