@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/src/internal/keyless.ts
CHANGED
|
@@ -178,6 +178,16 @@ export async function deriveKeylessAccount(args: {
|
|
|
178
178
|
proofFetchCallback?: ProofFetchCallback;
|
|
179
179
|
}): Promise<FederatedKeylessAccount>;
|
|
180
180
|
|
|
181
|
+
export async function deriveKeylessAccount(args: {
|
|
182
|
+
aptosConfig: AptosConfig;
|
|
183
|
+
jwt: string;
|
|
184
|
+
ephemeralKeyPair: EphemeralKeyPair;
|
|
185
|
+
jwkAddress?: AccountAddressInput;
|
|
186
|
+
uidKey?: string;
|
|
187
|
+
pepper?: HexInput;
|
|
188
|
+
proofFetchCallback?: ProofFetchCallback;
|
|
189
|
+
}): Promise<KeylessAccount | FederatedKeylessAccount>;
|
|
190
|
+
|
|
181
191
|
export async function deriveKeylessAccount(args: {
|
|
182
192
|
aptosConfig: AptosConfig;
|
|
183
193
|
jwt: string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
query getAccountAddressesForAuthKey($where_condition: auth_key_account_addresses_bool_exp, $order_by: [auth_key_account_addresses_order_by!]) {
|
|
2
|
+
auth_key_account_addresses(where: $where_condition, order_by: $order_by) {
|
|
3
|
+
auth_key
|
|
4
|
+
account_address
|
|
5
|
+
last_transaction_version
|
|
6
|
+
is_auth_key_used
|
|
7
|
+
}
|
|
8
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
query getAuthKeysForPublicKey($where_condition: public_key_auth_keys_bool_exp, $order_by: [public_key_auth_keys_order_by!]) {
|
|
2
|
+
public_key_auth_keys(where: $where_condition, order_by: $order_by) {
|
|
3
|
+
public_key
|
|
4
|
+
public_key_type
|
|
5
|
+
auth_key
|
|
6
|
+
account_public_key
|
|
7
|
+
last_transaction_version
|
|
8
|
+
is_public_key_used
|
|
9
|
+
signature_type
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -30,6 +30,7 @@ import {
|
|
|
30
30
|
InputGenerateSingleSignerRawTransactionData,
|
|
31
31
|
AnyTransactionPayloadInstance,
|
|
32
32
|
EntryFunctionABI,
|
|
33
|
+
InputTransactionPluginData,
|
|
33
34
|
} from "../transactions/types";
|
|
34
35
|
import { UserTransactionResponse, PendingTransactionResponse, MimeType, HexInput } from "../types";
|
|
35
36
|
import { SignedTransaction, TypeTagVector, generateSigningMessageForTransaction } from "../transactions";
|
|
@@ -319,7 +320,12 @@ export async function submitTransaction(
|
|
|
319
320
|
aptosConfig: AptosConfig;
|
|
320
321
|
} & InputSubmitTransactionData,
|
|
321
322
|
): Promise<PendingTransactionResponse> {
|
|
322
|
-
const { aptosConfig } = args;
|
|
323
|
+
const { aptosConfig, transactionSubmitter } = args;
|
|
324
|
+
const maybeTransactionSubmitter =
|
|
325
|
+
transactionSubmitter === undefined ? aptosConfig.getTransactionSubmitter() : transactionSubmitter;
|
|
326
|
+
if (maybeTransactionSubmitter) {
|
|
327
|
+
return maybeTransactionSubmitter.submitTransaction(args);
|
|
328
|
+
}
|
|
323
329
|
const signedTransaction = generateSignedTransaction({ ...args });
|
|
324
330
|
try {
|
|
325
331
|
const { data } = await postAptosFullNode<Uint8Array, PendingTransactionResponse>({
|
|
@@ -358,9 +364,9 @@ export async function signAndSubmitTransaction(
|
|
|
358
364
|
aptosConfig: AptosConfig;
|
|
359
365
|
signer: Account;
|
|
360
366
|
transaction: AnyRawTransaction;
|
|
361
|
-
},
|
|
367
|
+
} & InputTransactionPluginData,
|
|
362
368
|
): Promise<PendingTransactionResponse> {
|
|
363
|
-
const { aptosConfig, signer, feePayer, transaction } = args;
|
|
369
|
+
const { aptosConfig, signer, feePayer, transaction, ...rest } = args;
|
|
364
370
|
// If the signer contains a KeylessAccount, await proof fetching in case the proof
|
|
365
371
|
// was fetched asynchronously.
|
|
366
372
|
if (isKeylessSigner(signer)) {
|
|
@@ -378,16 +384,19 @@ export async function signAndSubmitTransaction(
|
|
|
378
384
|
transaction,
|
|
379
385
|
senderAuthenticator,
|
|
380
386
|
feePayerAuthenticator,
|
|
387
|
+
...rest,
|
|
381
388
|
});
|
|
382
389
|
}
|
|
383
390
|
|
|
384
|
-
export async function signAndSubmitAsFeePayer(
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
+
export async function signAndSubmitAsFeePayer(
|
|
392
|
+
args: {
|
|
393
|
+
aptosConfig: AptosConfig;
|
|
394
|
+
feePayer: Account;
|
|
395
|
+
senderAuthenticator: AccountAuthenticator;
|
|
396
|
+
transaction: AnyRawTransaction;
|
|
397
|
+
} & InputTransactionPluginData,
|
|
398
|
+
): Promise<PendingTransactionResponse> {
|
|
399
|
+
const { aptosConfig, senderAuthenticator, feePayer, transaction, ...rest } = args;
|
|
391
400
|
|
|
392
401
|
if (isKeylessSigner(feePayer)) {
|
|
393
402
|
await feePayer.checkKeylessAccountValidity(aptosConfig);
|
|
@@ -400,6 +409,7 @@ export async function signAndSubmitAsFeePayer(args: {
|
|
|
400
409
|
transaction,
|
|
401
410
|
senderAuthenticator,
|
|
402
411
|
feePayerAuthenticator,
|
|
412
|
+
...rest,
|
|
403
413
|
});
|
|
404
414
|
}
|
|
405
415
|
|
|
@@ -8,11 +8,19 @@ import { Serializable, Serializer } from "../../bcs/serializer";
|
|
|
8
8
|
import { EntryFunctionBytes } from "../../bcs/serializable/entryFunctionBytes";
|
|
9
9
|
import { Bool, U128, U16, U256, U32, U64, U8 } from "../../bcs/serializable/movePrimitives";
|
|
10
10
|
import { MoveVector, Serialized } from "../../bcs/serializable/moveStructs";
|
|
11
|
-
import { AccountAddress } from "../../core";
|
|
11
|
+
import { AccountAddress, Hex } from "../../core";
|
|
12
12
|
import { Identifier } from "./identifier";
|
|
13
13
|
import { ModuleId } from "./moduleId";
|
|
14
14
|
import type { EntryFunctionArgument, ScriptFunctionArgument, TransactionArgument } from "./transactionArgument";
|
|
15
|
-
import {
|
|
15
|
+
import {
|
|
16
|
+
AnyNumber,
|
|
17
|
+
MoveModuleId,
|
|
18
|
+
ScriptTransactionArgumentVariants,
|
|
19
|
+
TransactionExecutableVariants,
|
|
20
|
+
TransactionExtraConfigVariants,
|
|
21
|
+
TransactionInnerPayloadVariants,
|
|
22
|
+
TransactionPayloadVariants,
|
|
23
|
+
} from "../../types";
|
|
16
24
|
import { TypeTag } from "../typeTag";
|
|
17
25
|
|
|
18
26
|
/**
|
|
@@ -95,6 +103,8 @@ export abstract class TransactionPayload extends Serializable {
|
|
|
95
103
|
return TransactionPayloadEntryFunction.load(deserializer);
|
|
96
104
|
case TransactionPayloadVariants.Multisig:
|
|
97
105
|
return TransactionPayloadMultiSig.load(deserializer);
|
|
106
|
+
case TransactionPayloadVariants.Payload:
|
|
107
|
+
return TransactionInnerPayload.deserialize(deserializer);
|
|
98
108
|
default:
|
|
99
109
|
throw new Error(`Unknown variant index for TransactionPayload: ${index}`);
|
|
100
110
|
}
|
|
@@ -511,3 +521,156 @@ export class MultiSigTransactionPayload extends Serializable {
|
|
|
511
521
|
return new MultiSigTransactionPayload(EntryFunction.deserialize(deserializer));
|
|
512
522
|
}
|
|
513
523
|
}
|
|
524
|
+
|
|
525
|
+
/**
|
|
526
|
+
* Represents any transaction payload that can be submitted to the Aptos chain for execution.
|
|
527
|
+
*
|
|
528
|
+
* This is specifically required for orderless transactions, but can be used for any transaction payload.
|
|
529
|
+
*/
|
|
530
|
+
export abstract class TransactionInnerPayload extends TransactionPayload {
|
|
531
|
+
abstract serialize(serializer: Serializer): void;
|
|
532
|
+
|
|
533
|
+
static deserialize(deserializer: Deserializer): TransactionInnerPayload {
|
|
534
|
+
// index enum variant
|
|
535
|
+
const index = deserializer.deserializeUleb128AsU32();
|
|
536
|
+
switch (index) {
|
|
537
|
+
case TransactionInnerPayloadVariants.V1:
|
|
538
|
+
return TransactionInnerPayloadV1.load(deserializer);
|
|
539
|
+
default:
|
|
540
|
+
throw new Error(`Unknown variant index for TransactionInnerPayload: ${index}`);
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
export class TransactionInnerPayloadV1 extends TransactionInnerPayload {
|
|
546
|
+
executable: TransactionExecutable;
|
|
547
|
+
extra_config: TransactionExtraConfig;
|
|
548
|
+
|
|
549
|
+
constructor(executable: TransactionExecutable, extra_config: TransactionExtraConfig) {
|
|
550
|
+
super();
|
|
551
|
+
this.executable = executable;
|
|
552
|
+
this.extra_config = extra_config;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
serialize(serializer: Serializer): void {
|
|
556
|
+
// This payload must be serialized as a top level TransactionPayload, so we add that here
|
|
557
|
+
serializer.serializeU32AsUleb128(TransactionPayloadVariants.Payload);
|
|
558
|
+
// V1 is serialized as 0
|
|
559
|
+
serializer.serializeU32AsUleb128(TransactionInnerPayloadVariants.V1);
|
|
560
|
+
this.executable.serialize(serializer);
|
|
561
|
+
this.extra_config.serialize(serializer);
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
static load(deserializer: Deserializer): TransactionInnerPayloadV1 {
|
|
565
|
+
let executable = TransactionExecutable.deserialize(deserializer);
|
|
566
|
+
let extra_config = TransactionExtraConfig.deserialize(deserializer);
|
|
567
|
+
return new TransactionInnerPayloadV1(executable, extra_config);
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
export abstract class TransactionExecutable {
|
|
572
|
+
abstract serialize(serializer: Serializer): void;
|
|
573
|
+
|
|
574
|
+
static deserialize(deserializer: Deserializer): TransactionExecutable {
|
|
575
|
+
// index enum variant
|
|
576
|
+
const index = deserializer.deserializeUleb128AsU32();
|
|
577
|
+
switch (index) {
|
|
578
|
+
case TransactionExecutableVariants.Script:
|
|
579
|
+
return TransactionExecutableScript.load(deserializer);
|
|
580
|
+
case TransactionExecutableVariants.EntryFunction:
|
|
581
|
+
return TransactionExecutableEntryFunction.load(deserializer);
|
|
582
|
+
case TransactionExecutableVariants.Empty:
|
|
583
|
+
return TransactionExecutableEmpty.load(deserializer);
|
|
584
|
+
default:
|
|
585
|
+
throw new Error(`Unknown variant index for TransactionExecutable: ${index}`);
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
export class TransactionExecutableScript extends TransactionExecutable {
|
|
591
|
+
script: Script;
|
|
592
|
+
|
|
593
|
+
constructor(script: Script) {
|
|
594
|
+
super();
|
|
595
|
+
this.script = script;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
serialize(serializer: Serializer): void {
|
|
599
|
+
serializer.serializeU32AsUleb128(TransactionExecutableVariants.Script);
|
|
600
|
+
this.script.serialize(serializer);
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
static load(deserializer: Deserializer): TransactionExecutableScript {
|
|
604
|
+
let script = Script.deserialize(deserializer);
|
|
605
|
+
return new TransactionExecutableScript(script);
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
export class TransactionExecutableEntryFunction extends TransactionExecutable {
|
|
610
|
+
entryFunction: EntryFunction;
|
|
611
|
+
|
|
612
|
+
constructor(entryFunction: EntryFunction) {
|
|
613
|
+
super();
|
|
614
|
+
this.entryFunction = entryFunction;
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
serialize(serializer: Serializer): void {
|
|
618
|
+
serializer.serializeU32AsUleb128(TransactionExecutableVariants.EntryFunction);
|
|
619
|
+
this.entryFunction.serialize(serializer);
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
static load(deserializer: Deserializer): TransactionExecutableEntryFunction {
|
|
623
|
+
let entryFunction = EntryFunction.deserialize(deserializer);
|
|
624
|
+
return new TransactionExecutableEntryFunction(entryFunction);
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
export class TransactionExecutableEmpty extends TransactionExecutable {
|
|
629
|
+
serialize(serializer: Serializer): void {
|
|
630
|
+
serializer.serializeU32AsUleb128(TransactionExecutableVariants.Empty);
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
static load(_: Deserializer): TransactionExecutableEmpty {
|
|
634
|
+
return new TransactionExecutableEmpty();
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
export abstract class TransactionExtraConfig {
|
|
639
|
+
abstract serialize(serializer: Serializer): void;
|
|
640
|
+
|
|
641
|
+
static deserialize(deserializer: Deserializer): TransactionExtraConfig {
|
|
642
|
+
// index enum variant
|
|
643
|
+
const index = deserializer.deserializeUleb128AsU32();
|
|
644
|
+
switch (index) {
|
|
645
|
+
case TransactionExtraConfigVariants.V1:
|
|
646
|
+
return TransactionExtraConfigV1.load(deserializer);
|
|
647
|
+
default:
|
|
648
|
+
throw new Error(`Unknown variant index for TransactionExtraConfig: ${index}`);
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
export class TransactionExtraConfigV1 extends TransactionExtraConfig {
|
|
654
|
+
multisigAddress?: AccountAddress;
|
|
655
|
+
replayProtectionNonce?: bigint;
|
|
656
|
+
|
|
657
|
+
constructor(multisigAddress?: AccountAddress, replayProtectionNonce?: AnyNumber) {
|
|
658
|
+
super();
|
|
659
|
+
this.multisigAddress = multisigAddress;
|
|
660
|
+
this.replayProtectionNonce = replayProtectionNonce !== undefined ? BigInt(replayProtectionNonce) : undefined;
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
serialize(serializer: Serializer): void {
|
|
664
|
+
serializer.serializeU32AsUleb128(TransactionExtraConfigVariants.V1);
|
|
665
|
+
serializer.serializeOption<AccountAddress>(this.multisigAddress);
|
|
666
|
+
serializer.serializeOption<U64>(
|
|
667
|
+
this.replayProtectionNonce !== undefined ? new U64(this.replayProtectionNonce) : undefined,
|
|
668
|
+
);
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
static load(deserializer: Deserializer): TransactionExtraConfigV1 {
|
|
672
|
+
const multisigAddress = deserializer.deserializeOption(AccountAddress);
|
|
673
|
+
const replayProtectionNonce = deserializer.deserializeOption(U64);
|
|
674
|
+
return new TransactionExtraConfigV1(multisigAddress, replayProtectionNonce?.value);
|
|
675
|
+
}
|
|
676
|
+
}
|
|
@@ -340,7 +340,7 @@ export class TransactionWorker extends EventEmitter<TransactionWorkerEvents> {
|
|
|
340
340
|
aptosConfig: this.aptosConfig,
|
|
341
341
|
sender: account.accountAddress,
|
|
342
342
|
data: transactionData,
|
|
343
|
-
options: { ...options, accountSequenceNumber: sequenceNumber },
|
|
343
|
+
options: { ...options, accountSequenceNumber: sequenceNumber, replayProtectionNonce: undefined },
|
|
344
344
|
});
|
|
345
345
|
}
|
|
346
346
|
|
|
@@ -24,7 +24,6 @@ import { getInfo } from "../../internal/utils";
|
|
|
24
24
|
import { getLedgerInfo } from "../../internal/general";
|
|
25
25
|
import { getGasPriceEstimation } from "../../internal/transaction";
|
|
26
26
|
import { NetworkToChainId } from "../../utils/apiEndpoints";
|
|
27
|
-
import { DEFAULT_MAX_GAS_AMOUNT, DEFAULT_TXN_EXP_SEC_FROM_NOW } from "../../utils/const";
|
|
28
27
|
import { normalizeBundle } from "../../utils/normalizeBundle";
|
|
29
28
|
import {
|
|
30
29
|
AccountAuthenticator,
|
|
@@ -51,6 +50,7 @@ import {
|
|
|
51
50
|
MultiSigTransactionPayload,
|
|
52
51
|
RawTransaction,
|
|
53
52
|
Script,
|
|
53
|
+
TransactionInnerPayload,
|
|
54
54
|
TransactionPayloadEntryFunction,
|
|
55
55
|
TransactionPayloadMultiSig,
|
|
56
56
|
TransactionPayloadScript,
|
|
@@ -83,6 +83,14 @@ import { isScriptDataInput } from "./helpers";
|
|
|
83
83
|
import { SimpleTransaction } from "../instances/simpleTransaction";
|
|
84
84
|
import { MultiAgentTransaction } from "../instances/multiAgentTransaction";
|
|
85
85
|
import { getFunctionParts } from "../../utils/helpers";
|
|
86
|
+
import {
|
|
87
|
+
TransactionExecutable,
|
|
88
|
+
TransactionExecutableEmpty,
|
|
89
|
+
TransactionExecutableEntryFunction,
|
|
90
|
+
TransactionExecutableScript,
|
|
91
|
+
TransactionExtraConfigV1,
|
|
92
|
+
TransactionInnerPayloadV1,
|
|
93
|
+
} from "../instances/transactionPayload";
|
|
86
94
|
|
|
87
95
|
/**
|
|
88
96
|
* Builds a transaction payload based on the provided arguments and returns a transaction payload.
|
|
@@ -360,6 +368,10 @@ export async function generateRawTransaction(args: {
|
|
|
360
368
|
}): Promise<RawTransaction> {
|
|
361
369
|
const { aptosConfig, sender, payload, options, feePayerAddress } = args;
|
|
362
370
|
|
|
371
|
+
if (options?.replayProtectionNonce !== undefined && options?.accountSequenceNumber !== undefined) {
|
|
372
|
+
throw new Error("Cannot specify both replayProtectionNonce and accountSequenceNumber in options.");
|
|
373
|
+
}
|
|
374
|
+
|
|
363
375
|
const getChainId = async () => {
|
|
364
376
|
if (NetworkToChainId[aptosConfig.network]) {
|
|
365
377
|
return { chainId: NetworkToChainId[aptosConfig.network] };
|
|
@@ -380,6 +392,10 @@ export async function generateRawTransaction(args: {
|
|
|
380
392
|
const getSequenceNumber = async () => {
|
|
381
393
|
if (options?.accountSequenceNumber !== undefined) {
|
|
382
394
|
return options.accountSequenceNumber;
|
|
395
|
+
} else if (options?.replayProtectionNonce !== undefined) {
|
|
396
|
+
// If replay nonce is provided, use it as the sequence number
|
|
397
|
+
// This is an unused value, so it's specifically to show that the sequence number is not used
|
|
398
|
+
return 0xdeadbeefn;
|
|
383
399
|
}
|
|
384
400
|
|
|
385
401
|
return (await getInfo({ aptosConfig, accountAddress: sender })).sequence_number;
|
|
@@ -410,16 +426,24 @@ export async function generateRawTransaction(args: {
|
|
|
410
426
|
getSequenceNumberForAny(),
|
|
411
427
|
]);
|
|
412
428
|
|
|
413
|
-
const { maxGasAmount, gasUnitPrice, expireTimestamp } = {
|
|
414
|
-
maxGasAmount: options?.maxGasAmount ? BigInt(options.maxGasAmount) : BigInt(
|
|
429
|
+
const { maxGasAmount, gasUnitPrice, expireTimestamp, replayProtectionNonce } = {
|
|
430
|
+
maxGasAmount: options?.maxGasAmount ? BigInt(options.maxGasAmount) : BigInt(aptosConfig.getDefaultMaxGasAmount()),
|
|
415
431
|
gasUnitPrice: options?.gasUnitPrice ?? BigInt(gasEstimate),
|
|
416
|
-
expireTimestamp:
|
|
432
|
+
expireTimestamp:
|
|
433
|
+
options?.expireTimestamp ?? BigInt(Math.floor(Date.now() / 1000) + aptosConfig.getDefaultTxnExpirySecFromNow()),
|
|
434
|
+
replayProtectionNonce: options?.replayProtectionNonce ? BigInt(options.replayProtectionNonce) : undefined,
|
|
417
435
|
};
|
|
418
436
|
|
|
437
|
+
// If we're using replay nonce, we must convert the original payload
|
|
438
|
+
let txnPayload = payload;
|
|
439
|
+
if (replayProtectionNonce !== undefined) {
|
|
440
|
+
txnPayload = convertPayloadToInnerPayload(payload, replayProtectionNonce);
|
|
441
|
+
}
|
|
442
|
+
|
|
419
443
|
return new RawTransaction(
|
|
420
444
|
AccountAddress.from(sender),
|
|
421
445
|
BigInt(sequenceNumber),
|
|
422
|
-
|
|
446
|
+
txnPayload,
|
|
423
447
|
BigInt(maxGasAmount),
|
|
424
448
|
BigInt(gasUnitPrice),
|
|
425
449
|
BigInt(expireTimestamp),
|
|
@@ -427,6 +451,41 @@ export async function generateRawTransaction(args: {
|
|
|
427
451
|
);
|
|
428
452
|
}
|
|
429
453
|
|
|
454
|
+
export function convertPayloadToInnerPayload(
|
|
455
|
+
payload: AnyTransactionPayloadInstance,
|
|
456
|
+
replayProtectionNonce?: bigint,
|
|
457
|
+
): TransactionInnerPayload {
|
|
458
|
+
if (payload instanceof TransactionPayloadScript) {
|
|
459
|
+
return new TransactionInnerPayloadV1(
|
|
460
|
+
new TransactionExecutableScript(payload.script),
|
|
461
|
+
new TransactionExtraConfigV1(undefined, replayProtectionNonce),
|
|
462
|
+
);
|
|
463
|
+
} else if (payload instanceof TransactionPayloadEntryFunction) {
|
|
464
|
+
return new TransactionInnerPayloadV1(
|
|
465
|
+
new TransactionExecutableEntryFunction(payload.entryFunction),
|
|
466
|
+
new TransactionExtraConfigV1(undefined, replayProtectionNonce),
|
|
467
|
+
);
|
|
468
|
+
} else if (payload instanceof TransactionPayloadMultiSig) {
|
|
469
|
+
const innerPayload = payload.multiSig.transaction_payload;
|
|
470
|
+
let executable: TransactionExecutable;
|
|
471
|
+
if (innerPayload === undefined || innerPayload?.transaction_payload === undefined) {
|
|
472
|
+
executable = new TransactionExecutableEmpty();
|
|
473
|
+
} else if (innerPayload.transaction_payload instanceof EntryFunction) {
|
|
474
|
+
executable = new TransactionExecutableEntryFunction(innerPayload.transaction_payload);
|
|
475
|
+
} else {
|
|
476
|
+
// TODO For now, scripts are not supported in multi-sig transactions, so it's always entry function
|
|
477
|
+
throw new Error("Scripts are not supported in multi-sig transactions.");
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
return new TransactionInnerPayloadV1(
|
|
481
|
+
executable,
|
|
482
|
+
new TransactionExtraConfigV1(payload.multiSig.multisig_address, replayProtectionNonce),
|
|
483
|
+
);
|
|
484
|
+
} else {
|
|
485
|
+
throw new Error(`Unsupported payload type: ${payload}`);
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
|
|
430
489
|
/**
|
|
431
490
|
* Generates a transaction based on the provided arguments.
|
|
432
491
|
* This function can create both simple and multi-agent transactions, allowing for flexible transaction handling.
|
|
@@ -14,8 +14,17 @@ import {
|
|
|
14
14
|
TransactionPayloadEntryFunction,
|
|
15
15
|
TransactionPayloadMultiSig,
|
|
16
16
|
TransactionPayloadScript,
|
|
17
|
+
TransactionInnerPayload,
|
|
17
18
|
} from "./instances";
|
|
18
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
AnyNumber,
|
|
21
|
+
HexInput,
|
|
22
|
+
MoveFunctionGenericTypeParam,
|
|
23
|
+
MoveFunctionId,
|
|
24
|
+
MoveStructId,
|
|
25
|
+
MoveValue,
|
|
26
|
+
TransactionSubmitter,
|
|
27
|
+
} from "../types";
|
|
19
28
|
import { TypeTag } from "./typeTag";
|
|
20
29
|
import { AccountAuthenticator } from "./authenticator/account";
|
|
21
30
|
import { SimpleTransaction } from "./instances/simpleTransaction";
|
|
@@ -113,11 +122,30 @@ export type AnyRawTransactionInstance = RawTransaction | MultiAgentRawTransactio
|
|
|
113
122
|
* @group Implementation
|
|
114
123
|
* @category Transactions
|
|
115
124
|
*/
|
|
116
|
-
export type InputGenerateTransactionOptions =
|
|
125
|
+
export type InputGenerateTransactionOptions =
|
|
126
|
+
| InputGenerateSequenceNumberTransactionOptions
|
|
127
|
+
| InputGenerateOrderlessTransactionOptions;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Input options for generating a transaction that requires an account sequence number, which is the default method.
|
|
131
|
+
*/
|
|
132
|
+
export type InputGenerateSequenceNumberTransactionOptions = {
|
|
117
133
|
maxGasAmount?: number;
|
|
118
134
|
gasUnitPrice?: number;
|
|
119
135
|
expireTimestamp?: number;
|
|
120
136
|
accountSequenceNumber?: AnyNumber;
|
|
137
|
+
replayProtectionNonce?: undefined;
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Input options for generating a transaction using the orderless method, which does not require an account sequence number.
|
|
142
|
+
*/
|
|
143
|
+
export type InputGenerateOrderlessTransactionOptions = {
|
|
144
|
+
maxGasAmount?: number;
|
|
145
|
+
gasUnitPrice?: number;
|
|
146
|
+
expireTimestamp?: number;
|
|
147
|
+
accountSequenceNumber?: undefined;
|
|
148
|
+
replayProtectionNonce: AnyNumber;
|
|
121
149
|
};
|
|
122
150
|
|
|
123
151
|
/**
|
|
@@ -129,7 +157,8 @@ export type InputGenerateTransactionOptions = {
|
|
|
129
157
|
export type AnyTransactionPayloadInstance =
|
|
130
158
|
| TransactionPayloadEntryFunction
|
|
131
159
|
| TransactionPayloadScript
|
|
132
|
-
| TransactionPayloadMultiSig
|
|
160
|
+
| TransactionPayloadMultiSig
|
|
161
|
+
| TransactionInnerPayload;
|
|
133
162
|
|
|
134
163
|
/**
|
|
135
164
|
* The data needed to generate a transaction payload for Entry Function, Script, or Multi Sig types.
|
|
@@ -449,19 +478,41 @@ export type InputGenerateTransactionData =
|
|
|
449
478
|
| InputGenerateSingleSignerRawTransactionData
|
|
450
479
|
| InputGenerateMultiAgentRawTransactionData;
|
|
451
480
|
|
|
481
|
+
interface InputSubmitTransactionDataInner {
|
|
482
|
+
transaction: AnyRawTransaction;
|
|
483
|
+
senderAuthenticator: AccountAuthenticator;
|
|
484
|
+
feePayerAuthenticator?: AccountAuthenticator;
|
|
485
|
+
additionalSignersAuthenticators?: Array<AccountAuthenticator>;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
export interface InputTransactionPluginData {
|
|
489
|
+
/**
|
|
490
|
+
* Additional parameters that will be passed to the transaction submitter plugin if
|
|
491
|
+
* configured.
|
|
492
|
+
*/
|
|
493
|
+
pluginParams?: Record<string, any>;
|
|
494
|
+
|
|
495
|
+
/**
|
|
496
|
+
* You can set this to override the configured transaction submitter (if any).
|
|
497
|
+
* Conversely you can set this to null to ignore any configured transaction submitter.
|
|
498
|
+
*/
|
|
499
|
+
transactionSubmitter?: TransactionSubmitter | null;
|
|
500
|
+
}
|
|
501
|
+
|
|
452
502
|
/**
|
|
453
503
|
* Holds user data input for submitting a transaction.
|
|
454
504
|
*
|
|
455
505
|
* @param transaction - The raw transaction data.
|
|
456
506
|
* @param senderAuthenticator - The authenticator for the sender's account.
|
|
457
507
|
* @param feePayerAuthenticator - Optional authenticator for the fee payer's account.
|
|
458
|
-
* @param additionalSignersAuthenticators - Optional array of authenticators for
|
|
508
|
+
* @param additionalSignersAuthenticators - Optional array of authenticators for
|
|
509
|
+
* additional signers.
|
|
510
|
+
* @param pluginParams - Additional parameters that will be passed to the transaction
|
|
511
|
+
* submitter plugin if configured.
|
|
512
|
+
* @param transactionSubmitter - You can set this to override the configured transaction
|
|
513
|
+
* submitter (if any). Conversely you can set this to null to ignore any configured
|
|
514
|
+
* transaction submitter.
|
|
459
515
|
* @group Implementation
|
|
460
516
|
* @category Transactions
|
|
461
517
|
*/
|
|
462
|
-
export
|
|
463
|
-
transaction: AnyRawTransaction;
|
|
464
|
-
senderAuthenticator: AccountAuthenticator;
|
|
465
|
-
feePayerAuthenticator?: AccountAuthenticator;
|
|
466
|
-
additionalSignersAuthenticators?: Array<AccountAuthenticator>;
|
|
467
|
-
}
|
|
518
|
+
export type InputSubmitTransactionData = InputSubmitTransactionDataInner & InputTransactionPluginData;
|
package/src/types/codegen.yaml
CHANGED
|
@@ -77,6 +77,20 @@ export type CurrentTokenOwnershipFieldsFragment = {
|
|
|
77
77
|
} | null;
|
|
78
78
|
};
|
|
79
79
|
|
|
80
|
+
export type GetAccountAddressesForAuthKeyQueryVariables = Types.Exact<{
|
|
81
|
+
where_condition?: Types.InputMaybe<Types.AuthKeyAccountAddressesBoolExp>;
|
|
82
|
+
order_by?: Types.InputMaybe<Array<Types.AuthKeyAccountAddressesOrderBy> | Types.AuthKeyAccountAddressesOrderBy>;
|
|
83
|
+
}>;
|
|
84
|
+
|
|
85
|
+
export type GetAccountAddressesForAuthKeyQuery = {
|
|
86
|
+
auth_key_account_addresses: Array<{
|
|
87
|
+
auth_key: string;
|
|
88
|
+
account_address: string;
|
|
89
|
+
last_transaction_version: any;
|
|
90
|
+
is_auth_key_used: boolean;
|
|
91
|
+
}>;
|
|
92
|
+
};
|
|
93
|
+
|
|
80
94
|
export type GetAccountCoinsCountQueryVariables = Types.Exact<{
|
|
81
95
|
address?: Types.InputMaybe<Types.Scalars["String"]["input"]>;
|
|
82
96
|
}>;
|
|
@@ -96,15 +110,15 @@ export type GetAccountCoinsDataQueryVariables = Types.Exact<{
|
|
|
96
110
|
|
|
97
111
|
export type GetAccountCoinsDataQuery = {
|
|
98
112
|
current_fungible_asset_balances: Array<{
|
|
99
|
-
amount
|
|
100
|
-
asset_type
|
|
113
|
+
amount: any;
|
|
114
|
+
asset_type: string;
|
|
101
115
|
is_frozen: boolean;
|
|
102
|
-
is_primary
|
|
116
|
+
is_primary: boolean;
|
|
103
117
|
last_transaction_timestamp?: any | null;
|
|
104
118
|
last_transaction_version?: any | null;
|
|
105
119
|
owner_address: string;
|
|
106
120
|
storage_id: string;
|
|
107
|
-
token_standard
|
|
121
|
+
token_standard: string;
|
|
108
122
|
metadata?: {
|
|
109
123
|
token_standard: string;
|
|
110
124
|
symbol: string;
|
|
@@ -346,6 +360,23 @@ export type GetAccountTransactionsCountQuery = {
|
|
|
346
360
|
account_transactions_aggregate: { aggregate?: { count: number } | null };
|
|
347
361
|
};
|
|
348
362
|
|
|
363
|
+
export type GetAuthKeysForPublicKeyQueryVariables = Types.Exact<{
|
|
364
|
+
where_condition?: Types.InputMaybe<Types.PublicKeyAuthKeysBoolExp>;
|
|
365
|
+
order_by?: Types.InputMaybe<Array<Types.PublicKeyAuthKeysOrderBy> | Types.PublicKeyAuthKeysOrderBy>;
|
|
366
|
+
}>;
|
|
367
|
+
|
|
368
|
+
export type GetAuthKeysForPublicKeyQuery = {
|
|
369
|
+
public_key_auth_keys: Array<{
|
|
370
|
+
public_key: string;
|
|
371
|
+
public_key_type: string;
|
|
372
|
+
auth_key: string;
|
|
373
|
+
account_public_key?: string | null;
|
|
374
|
+
last_transaction_version: any;
|
|
375
|
+
is_public_key_used: boolean;
|
|
376
|
+
signature_type: string;
|
|
377
|
+
}>;
|
|
378
|
+
};
|
|
379
|
+
|
|
349
380
|
export type GetChainTopUserTransactionsQueryVariables = Types.Exact<{
|
|
350
381
|
limit?: Types.InputMaybe<Types.Scalars["Int"]["input"]>;
|
|
351
382
|
}>;
|
|
@@ -394,15 +425,15 @@ export type GetCurrentFungibleAssetBalancesQueryVariables = Types.Exact<{
|
|
|
394
425
|
|
|
395
426
|
export type GetCurrentFungibleAssetBalancesQuery = {
|
|
396
427
|
current_fungible_asset_balances: Array<{
|
|
397
|
-
amount
|
|
398
|
-
asset_type
|
|
428
|
+
amount: any;
|
|
429
|
+
asset_type: string;
|
|
399
430
|
is_frozen: boolean;
|
|
400
|
-
is_primary
|
|
431
|
+
is_primary: boolean;
|
|
401
432
|
last_transaction_timestamp?: any | null;
|
|
402
433
|
last_transaction_version?: any | null;
|
|
403
434
|
owner_address: string;
|
|
404
435
|
storage_id: string;
|
|
405
|
-
token_standard
|
|
436
|
+
token_standard: string;
|
|
406
437
|
}>;
|
|
407
438
|
};
|
|
408
439
|
|