@aptos-labs/ts-sdk 0.0.6 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -5
- package/dist/browser/index.d.ts +1097 -519
- package/dist/browser/index.global.js +49 -28
- package/dist/browser/index.global.js.map +1 -1
- package/dist/common/index.d.ts +1097 -519
- package/dist/common/index.js +48 -27
- package/dist/common/index.js.map +1 -1
- package/dist/esm/api/account.d.mts +72 -47
- package/dist/esm/api/account.mjs +1 -1
- package/dist/esm/api/ans.d.mts +214 -18
- package/dist/esm/api/ans.mjs +1 -1
- package/dist/esm/api/aptos.d.mts +9 -0
- package/dist/esm/api/aptos.mjs +1 -1
- package/dist/esm/api/aptosConfig.d.mts +2 -2
- package/dist/esm/api/aptosConfig.mjs +1 -1
- package/dist/esm/api/coin.d.mts +6 -5
- package/dist/esm/api/coin.mjs +1 -1
- package/dist/esm/api/digitalAsset.d.mts +24 -21
- package/dist/esm/api/digitalAsset.mjs +1 -1
- package/dist/esm/api/event.d.mts +12 -14
- package/dist/esm/api/event.mjs +1 -1
- package/dist/esm/api/faucet.d.mts +4 -4
- package/dist/esm/api/faucet.mjs +1 -1
- package/dist/esm/api/fungibleAsset.d.mts +71 -30
- package/dist/esm/api/fungibleAsset.mjs +1 -1
- package/dist/esm/api/general.d.mts +12 -5
- package/dist/esm/api/general.mjs +1 -1
- package/dist/esm/api/index.d.mts +5 -0
- package/dist/esm/api/index.mjs +1 -1
- package/dist/esm/api/staking.d.mts +13 -9
- package/dist/esm/api/staking.mjs +1 -1
- package/dist/esm/api/transaction.d.mts +36 -2
- package/dist/esm/api/transaction.mjs +1 -1
- package/dist/esm/api/transactionSubmission/build.d.mts +54 -0
- package/dist/esm/api/transactionSubmission/build.mjs +2 -0
- package/dist/esm/api/transactionSubmission/sign.d.mts +51 -0
- package/dist/esm/api/transactionSubmission/sign.mjs +2 -0
- package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -0
- package/dist/esm/api/transactionSubmission/simulate.d.mts +54 -0
- package/dist/esm/api/transactionSubmission/simulate.mjs +2 -0
- package/dist/esm/api/transactionSubmission/simulate.mjs.map +1 -0
- package/dist/esm/api/transactionSubmission/submit.d.mts +52 -0
- package/dist/esm/api/transactionSubmission/submit.mjs +2 -0
- package/dist/esm/api/transactionSubmission/submit.mjs.map +1 -0
- package/dist/esm/api/transactionSubmission.d.mts +25 -54
- package/dist/esm/api/transactionSubmission.mjs +1 -1
- package/dist/esm/api/utils.d.mts +21 -0
- package/dist/esm/api/utils.mjs +2 -0
- package/dist/esm/api/utils.mjs.map +1 -0
- package/dist/esm/bcs/deserializer.d.mts +4 -4
- package/dist/esm/bcs/deserializer.mjs +1 -1
- package/dist/esm/bcs/index.mjs +1 -1
- package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -1
- package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -1
- package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
- package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
- package/dist/esm/bcs/serializer.d.mts +4 -4
- package/dist/esm/bcs/serializer.mjs +1 -1
- package/dist/esm/{chunk-UAAI3NCA.mjs → chunk-2SAKPC5Q.mjs} +2 -2
- package/dist/esm/chunk-2YQXX64E.mjs +2 -0
- package/dist/esm/chunk-2YQXX64E.mjs.map +1 -0
- package/dist/esm/chunk-3F5WV6US.mjs +2 -0
- package/dist/esm/chunk-3F5WV6US.mjs.map +1 -0
- package/dist/esm/{chunk-ARVSIDVB.mjs → chunk-3RMXGSHK.mjs} +2 -2
- package/dist/esm/chunk-3RMXGSHK.mjs.map +1 -0
- package/dist/esm/{chunk-4ADA5BE7.mjs → chunk-53DS6NBQ.mjs} +2 -2
- package/dist/esm/chunk-5CUNY7X2.mjs +2 -0
- package/dist/esm/chunk-5CUNY7X2.mjs.map +1 -0
- package/dist/esm/{chunk-QWVR4RCV.mjs → chunk-5OPOJ43H.mjs} +2 -2
- package/dist/esm/{chunk-V45RFKH7.mjs → chunk-5UY5OKXR.mjs} +2 -2
- package/dist/esm/chunk-5UY5OKXR.mjs.map +1 -0
- package/dist/esm/chunk-5ZVCSKFX.mjs +2 -0
- package/dist/esm/chunk-5ZVCSKFX.mjs.map +1 -0
- package/dist/esm/{chunk-HVADSXTB.mjs → chunk-73VWOS4Z.mjs} +2 -2
- package/dist/esm/chunk-ALFESCPU.mjs +2 -0
- package/dist/esm/chunk-ALFESCPU.mjs.map +1 -0
- package/dist/esm/chunk-APSQ4M23.mjs +2 -0
- package/dist/esm/chunk-APSQ4M23.mjs.map +1 -0
- package/dist/esm/{chunk-U25N2VWA.mjs → chunk-AZUWHKN5.mjs} +2 -2
- package/dist/esm/{chunk-WX43AJTD.mjs → chunk-BQSE5HHW.mjs} +45 -24
- package/dist/esm/chunk-BQSE5HHW.mjs.map +1 -0
- package/dist/esm/chunk-CCXMVVXD.mjs +2 -0
- package/dist/esm/chunk-CCXMVVXD.mjs.map +1 -0
- package/dist/esm/{chunk-JZNLZMUC.mjs → chunk-CJPCOS4R.mjs} +2 -2
- package/dist/esm/{chunk-S36IYY6K.mjs → chunk-CL5B2QNS.mjs} +2 -2
- package/dist/esm/chunk-CLJLQXFQ.mjs +2 -0
- package/dist/esm/chunk-CLJLQXFQ.mjs.map +1 -0
- package/dist/esm/{chunk-EWTHPMEE.mjs → chunk-CU2DINU4.mjs} +2 -2
- package/dist/esm/chunk-EFRFDFS4.mjs +2 -0
- package/dist/esm/chunk-EFRFDFS4.mjs.map +1 -0
- package/dist/esm/chunk-EOC4UI5B.mjs +2 -0
- package/dist/esm/{chunk-KC64ESLO.mjs.map → chunk-EOC4UI5B.mjs.map} +1 -1
- package/dist/esm/{chunk-HA6JD5R6.mjs → chunk-F6K26WV5.mjs} +2 -2
- package/dist/esm/{chunk-HA6JD5R6.mjs.map → chunk-F6K26WV5.mjs.map} +1 -1
- package/dist/esm/chunk-F7EWDYTE.mjs +2 -0
- package/dist/esm/chunk-F7EWDYTE.mjs.map +1 -0
- package/dist/esm/{chunk-44MGBJ73.mjs → chunk-FZ56IS3E.mjs} +2 -2
- package/dist/esm/chunk-G36AY4R7.mjs +2 -0
- package/dist/esm/chunk-G36AY4R7.mjs.map +1 -0
- package/dist/esm/chunk-GEZSEAL5.mjs +2 -0
- package/dist/esm/chunk-GEZSEAL5.mjs.map +1 -0
- package/dist/esm/chunk-GIZLK7M7.mjs +2 -0
- package/dist/esm/chunk-GIZLK7M7.mjs.map +1 -0
- package/dist/esm/chunk-GMG4VR3K.mjs +2 -0
- package/dist/esm/chunk-GMG4VR3K.mjs.map +1 -0
- package/dist/esm/{chunk-U6SZNNVL.mjs → chunk-GXPGRCSW.mjs} +2 -2
- package/dist/esm/{chunk-U6SZNNVL.mjs.map → chunk-GXPGRCSW.mjs.map} +1 -1
- package/dist/esm/{chunk-GEFQFRL3.mjs → chunk-HC5VMNXA.mjs} +2 -2
- package/dist/esm/chunk-HTI5LEST.mjs +2 -0
- package/dist/esm/chunk-HTI5LEST.mjs.map +1 -0
- package/dist/esm/chunk-IELTCGLP.mjs +2 -0
- package/dist/esm/chunk-IELTCGLP.mjs.map +1 -0
- package/dist/esm/chunk-IHYTP2EW.mjs +1 -0
- package/dist/esm/chunk-IHYTP2EW.mjs.map +1 -0
- package/dist/esm/chunk-JI2BBZ2W.mjs +2 -0
- package/dist/esm/{chunk-3JVGSFHP.mjs.map → chunk-JI2BBZ2W.mjs.map} +1 -1
- package/dist/esm/chunk-KKER5KL4.mjs +2 -0
- package/dist/esm/chunk-KKER5KL4.mjs.map +1 -0
- package/dist/esm/chunk-KNMWDGP4.mjs +2 -0
- package/dist/esm/chunk-KNMWDGP4.mjs.map +1 -0
- package/dist/esm/{chunk-YYRDFZE6.mjs → chunk-KZSJ5MFF.mjs} +2 -2
- package/dist/esm/{chunk-YYRDFZE6.mjs.map → chunk-KZSJ5MFF.mjs.map} +1 -1
- package/dist/esm/chunk-MWAMLQ25.mjs +2 -0
- package/dist/esm/chunk-MWAMLQ25.mjs.map +1 -0
- package/dist/esm/chunk-NL72WE3E.mjs +2 -0
- package/dist/esm/{chunk-TIH6ARYP.mjs.map → chunk-NL72WE3E.mjs.map} +1 -1
- package/dist/esm/chunk-NZSGGL25.mjs +2 -0
- package/dist/esm/chunk-NZSGGL25.mjs.map +1 -0
- package/dist/esm/chunk-OBOOY2QD.mjs +2 -0
- package/dist/esm/chunk-OBOOY2QD.mjs.map +1 -0
- package/dist/esm/chunk-OT2UDMUU.mjs +2 -0
- package/dist/esm/chunk-OT2UDMUU.mjs.map +1 -0
- package/dist/esm/chunk-OZZDXS26.mjs +2 -0
- package/dist/esm/chunk-OZZDXS26.mjs.map +1 -0
- package/dist/esm/chunk-P5747ZYC.mjs +2 -0
- package/dist/esm/chunk-P5747ZYC.mjs.map +1 -0
- package/dist/esm/{chunk-BPYLPPEQ.mjs → chunk-PL2VA73L.mjs} +2 -2
- package/dist/esm/chunk-PXTMLJKO.mjs +2 -0
- package/dist/esm/{chunk-JDS7K2WI.mjs → chunk-QCBIJCU4.mjs} +2 -2
- package/dist/esm/chunk-QEXAMHPU.mjs +2 -0
- package/dist/esm/chunk-QEXAMHPU.mjs.map +1 -0
- package/dist/esm/{chunk-KQXRH5FK.mjs → chunk-QNTV5NMH.mjs} +2 -2
- package/dist/esm/{chunk-EQ5BEDJ7.mjs → chunk-RCM3K5JL.mjs} +2 -2
- package/dist/esm/chunk-RLG3WOTH.mjs +2 -0
- package/dist/esm/chunk-RLG3WOTH.mjs.map +1 -0
- package/dist/esm/chunk-SDPICQ5B.mjs +2 -0
- package/dist/esm/{chunk-FYIFBLHU.mjs.map → chunk-SDPICQ5B.mjs.map} +1 -1
- package/dist/esm/chunk-SGTFMSOG.mjs +2 -0
- package/dist/esm/chunk-SGTFMSOG.mjs.map +1 -0
- package/dist/esm/chunk-SO6EE5DX.mjs +2 -0
- package/dist/esm/chunk-SO6EE5DX.mjs.map +1 -0
- package/dist/esm/chunk-SRGPSANH.mjs +2 -0
- package/dist/esm/chunk-SRGPSANH.mjs.map +1 -0
- package/dist/esm/{chunk-UPLWWSB4.mjs → chunk-SSJQOXEP.mjs} +2 -2
- package/dist/esm/chunk-TZ623H2V.mjs +2 -0
- package/dist/esm/chunk-TZ623H2V.mjs.map +1 -0
- package/dist/esm/chunk-U6Z4FNB7.mjs +2 -0
- package/dist/esm/chunk-U6Z4FNB7.mjs.map +1 -0
- package/dist/esm/{chunk-GTC7WHMV.mjs → chunk-UDMADMVO.mjs} +1 -1
- package/dist/esm/{chunk-GTC7WHMV.mjs.map → chunk-UDMADMVO.mjs.map} +1 -1
- package/dist/esm/chunk-UIVJXLRM.mjs +1 -0
- package/dist/esm/chunk-UIVJXLRM.mjs.map +1 -0
- package/dist/esm/chunk-UKSA4H2O.mjs +2 -0
- package/dist/esm/chunk-UKSA4H2O.mjs.map +1 -0
- package/dist/esm/chunk-UW6HQ643.mjs +2 -0
- package/dist/esm/chunk-UW6HQ643.mjs.map +1 -0
- package/dist/esm/chunk-UWXDXOFK.mjs +2 -0
- package/dist/esm/chunk-UWXDXOFK.mjs.map +1 -0
- package/dist/esm/chunk-VQ7LYNMD.mjs +2 -0
- package/dist/esm/chunk-VQ7LYNMD.mjs.map +1 -0
- package/dist/esm/{chunk-U3LO2FSJ.mjs → chunk-WTGGCH34.mjs} +2 -2
- package/dist/esm/{chunk-X32O46IB.mjs → chunk-XITLXPBK.mjs} +2 -2
- package/dist/esm/chunk-XMUUI6HG.mjs +2 -0
- package/dist/esm/{chunk-R3KWVOFG.mjs.map → chunk-XMUUI6HG.mjs.map} +1 -1
- package/dist/esm/chunk-XX2Z26FH.mjs +2 -0
- package/dist/esm/chunk-XX2Z26FH.mjs.map +1 -0
- package/dist/esm/chunk-Y6PVFMBS.mjs +2 -0
- package/dist/esm/chunk-Y6PVFMBS.mjs.map +1 -0
- package/dist/esm/{chunk-VWVEDCBM.mjs → chunk-YN6UIVFB.mjs} +2 -2
- package/dist/esm/chunk-ZFK7QD3B.mjs +2 -0
- package/dist/esm/chunk-ZFK7QD3B.mjs.map +1 -0
- package/dist/esm/chunk-ZJUDDSWN.mjs +2 -0
- package/dist/esm/chunk-ZJUDDSWN.mjs.map +1 -0
- package/dist/esm/client/core.mjs +1 -1
- package/dist/esm/client/get.d.mts +1 -1
- package/dist/esm/client/get.mjs +1 -1
- package/dist/esm/client/index.mjs +1 -1
- package/dist/esm/client/post.mjs +1 -1
- package/dist/esm/core/account.mjs +1 -1
- package/dist/esm/core/accountAddress.d.mts +9 -9
- package/dist/esm/core/accountAddress.mjs +1 -1
- package/dist/esm/core/authenticationKey.mjs +1 -1
- package/dist/esm/core/crypto/anyPublicKey.d.mts +5 -0
- package/dist/esm/core/crypto/anyPublicKey.mjs +1 -1
- package/dist/esm/core/crypto/anySignature.mjs +1 -1
- package/dist/esm/core/crypto/asymmetricCrypto.mjs +1 -1
- package/dist/esm/core/crypto/ed25519.d.mts +3 -0
- package/dist/esm/core/crypto/ed25519.mjs +1 -1
- package/dist/esm/core/crypto/index.d.mts +2 -2
- package/dist/esm/core/crypto/index.mjs +1 -1
- package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
- package/dist/esm/core/crypto/multiKey.d.mts +2 -0
- package/dist/esm/core/crypto/multiKey.mjs +1 -1
- package/dist/esm/core/crypto/secp256k1.d.mts +3 -0
- package/dist/esm/core/crypto/secp256k1.mjs +1 -1
- package/dist/esm/core/hex.mjs +1 -1
- package/dist/esm/core/index.d.mts +2 -2
- package/dist/esm/core/index.mjs +1 -1
- package/dist/esm/index.d.mts +17 -10
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/internal/account.d.mts +20 -33
- package/dist/esm/internal/account.mjs +1 -1
- package/dist/esm/internal/ans.d.mts +78 -14
- package/dist/esm/internal/ans.mjs +1 -1
- package/dist/esm/internal/coin.d.mts +6 -5
- package/dist/esm/internal/coin.mjs +1 -1
- package/dist/esm/internal/digitalAsset.d.mts +12 -21
- package/dist/esm/internal/digitalAsset.mjs +1 -1
- package/dist/esm/internal/event.d.mts +5 -12
- package/dist/esm/internal/event.mjs +1 -1
- package/dist/esm/internal/faucet.d.mts +2 -2
- package/dist/esm/internal/faucet.mjs +1 -1
- package/dist/esm/internal/fungibleAsset.d.mts +40 -22
- package/dist/esm/internal/fungibleAsset.mjs +1 -1
- package/dist/esm/internal/general.d.mts +9 -5
- package/dist/esm/internal/general.mjs +1 -1
- package/dist/esm/internal/staking.d.mts +4 -6
- package/dist/esm/internal/staking.mjs +1 -1
- package/dist/esm/internal/transaction.d.mts +12 -4
- package/dist/esm/internal/transaction.mjs +1 -1
- package/dist/esm/internal/transactionSubmission.d.mts +29 -41
- package/dist/esm/internal/transactionSubmission.mjs +1 -1
- package/dist/esm/transactions/authenticator/account.d.mts +5 -0
- package/dist/esm/transactions/authenticator/account.mjs +1 -1
- package/dist/esm/transactions/authenticator/index.d.mts +1 -0
- package/dist/esm/transactions/authenticator/index.mjs +1 -1
- package/dist/esm/transactions/authenticator/transaction.d.mts +1 -0
- package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
- package/dist/esm/transactions/index.d.mts +5 -4
- package/dist/esm/transactions/index.mjs +1 -1
- package/dist/esm/transactions/instances/chainId.mjs +1 -1
- package/dist/esm/transactions/instances/identifier.mjs +1 -1
- package/dist/esm/transactions/instances/index.d.mts +1 -0
- package/dist/esm/transactions/instances/index.mjs +1 -1
- package/dist/esm/transactions/instances/moduleId.mjs +1 -1
- package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
- package/dist/esm/transactions/instances/signedTransaction.d.mts +1 -0
- package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
- package/dist/esm/transactions/management/accountSequenceNumber.d.mts +89 -0
- package/dist/esm/transactions/management/accountSequenceNumber.mjs +2 -0
- package/dist/esm/transactions/management/accountSequenceNumber.mjs.map +1 -0
- package/dist/esm/transactions/management/asyncQueue.d.mts +58 -0
- package/dist/esm/transactions/management/asyncQueue.mjs +2 -0
- package/dist/esm/transactions/management/asyncQueue.mjs.map +1 -0
- package/dist/esm/transactions/management/index.d.mts +36 -0
- package/dist/esm/transactions/management/index.mjs +2 -0
- package/dist/esm/transactions/management/index.mjs.map +1 -0
- package/dist/esm/transactions/management/transactionWorker.d.mts +135 -0
- package/dist/esm/transactions/management/transactionWorker.mjs +2 -0
- package/dist/esm/transactions/management/transactionWorker.mjs.map +1 -0
- package/dist/esm/transactions/transactionBuilder/helpers.d.mts +3 -1
- package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/index.d.mts +4 -3
- package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +3 -1
- package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +6 -8
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
- package/dist/esm/transactions/typeTag/index.mjs +1 -1
- package/dist/esm/transactions/typeTag/parser.mjs +1 -1
- package/dist/esm/transactions/types.d.mts +18 -43
- package/dist/esm/types/generated/operations.d.mts +30 -4
- package/dist/esm/types/generated/queries.d.mts +8 -5
- package/dist/esm/types/generated/queries.mjs +1 -1
- package/dist/esm/types/index.d.mts +27 -9
- package/dist/esm/types/index.mjs +1 -1
- package/dist/esm/types/indexer.d.mts +3 -2
- package/dist/esm/utils/const.d.mts +18 -1
- package/dist/esm/utils/const.mjs +1 -1
- package/dist/esm/utils/index.d.mts +1 -1
- package/dist/esm/utils/index.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/api/account.ts +150 -53
- package/src/api/ans.ts +252 -16
- package/src/api/aptos.ts +20 -0
- package/src/api/aptosConfig.ts +2 -2
- package/src/api/coin.ts +4 -8
- package/src/api/digitalAsset.ts +75 -25
- package/src/api/event.ts +28 -17
- package/src/api/faucet.ts +12 -9
- package/src/api/fungibleAsset.ts +76 -35
- package/src/api/general.ts +19 -3
- package/src/api/staking.ts +30 -11
- package/src/api/transaction.ts +16 -1
- package/src/api/transactionSubmission/build.ts +42 -0
- package/src/api/transactionSubmission/sign.ts +44 -0
- package/src/api/transactionSubmission/simulate.ts +56 -0
- package/src/api/transactionSubmission/submit.ts +53 -0
- package/src/api/transactionSubmission.ts +31 -128
- package/src/api/utils.ts +37 -0
- package/src/bcs/deserializer.ts +4 -4
- package/src/bcs/serializer.ts +4 -4
- package/src/client/core.ts +6 -4
- package/src/client/get.ts +7 -6
- package/src/core/accountAddress.ts +20 -22
- package/src/core/crypto/anyPublicKey.ts +12 -0
- package/src/core/crypto/ed25519.ts +13 -0
- package/src/core/crypto/index.ts +2 -0
- package/src/core/crypto/secp256k1.ts +12 -0
- package/src/core/hex.ts +5 -7
- package/src/index.ts +1 -0
- package/src/internal/account.ts +56 -50
- package/src/internal/ans.ts +423 -24
- package/src/internal/coin.ts +6 -8
- package/src/internal/digitalAsset.ts +15 -25
- package/src/internal/event.ts +7 -14
- package/src/internal/faucet.ts +10 -6
- package/src/internal/fungibleAsset.ts +36 -18
- package/src/internal/general.ts +30 -3
- package/src/internal/queries/ansTokenFragment.graphql +9 -0
- package/src/internal/queries/getNames.graphql +11 -0
- package/src/internal/queries/getNumberOfDelegatorsQuery.graphql +5 -5
- package/src/internal/queries/getProcessorStatus.graphql +2 -2
- package/src/internal/staking.ts +12 -14
- package/src/internal/transaction.ts +23 -26
- package/src/internal/transactionSubmission.ts +63 -25
- package/src/transactions/authenticator/account.ts +16 -0
- package/src/transactions/instances/moduleId.ts +1 -1
- package/src/transactions/management/accountSequenceNumber.ts +186 -0
- package/src/transactions/management/asyncQueue.ts +107 -0
- package/src/transactions/management/index.ts +2 -0
- package/src/transactions/management/transactionWorker.ts +275 -0
- package/src/transactions/transactionBuilder/helpers.ts +28 -1
- package/src/transactions/transactionBuilder/remoteAbi.ts +35 -28
- package/src/transactions/transactionBuilder/transactionBuilder.ts +46 -67
- package/src/transactions/typeTag/parser.ts +1 -1
- package/src/transactions/types.ts +16 -47
- package/src/types/generated/operations.ts +33 -2
- package/src/types/generated/queries.ts +38 -4
- package/src/types/index.ts +67 -11
- package/src/types/indexer.ts +3 -0
- package/src/utils/const.ts +18 -0
- package/src/version.ts +1 -1
- package/dist/esm/chunk-2W744GUN.mjs +0 -2
- package/dist/esm/chunk-2W744GUN.mjs.map +0 -1
- package/dist/esm/chunk-3JVGSFHP.mjs +0 -2
- package/dist/esm/chunk-4RVIA63I.mjs +0 -2
- package/dist/esm/chunk-4RVIA63I.mjs.map +0 -1
- package/dist/esm/chunk-62SCW5NH.mjs +0 -2
- package/dist/esm/chunk-62SCW5NH.mjs.map +0 -1
- package/dist/esm/chunk-7MNEEVXY.mjs +0 -2
- package/dist/esm/chunk-7MNEEVXY.mjs.map +0 -1
- package/dist/esm/chunk-AAIBCWZY.mjs +0 -2
- package/dist/esm/chunk-AAIBCWZY.mjs.map +0 -1
- package/dist/esm/chunk-ARVSIDVB.mjs.map +0 -1
- package/dist/esm/chunk-BFSEVKNA.mjs +0 -2
- package/dist/esm/chunk-BFSEVKNA.mjs.map +0 -1
- package/dist/esm/chunk-BP5ZO7NK.mjs +0 -2
- package/dist/esm/chunk-BP5ZO7NK.mjs.map +0 -1
- package/dist/esm/chunk-BV4OOU5Y.mjs +0 -2
- package/dist/esm/chunk-BV4OOU5Y.mjs.map +0 -1
- package/dist/esm/chunk-BWMNPUTK.mjs +0 -2
- package/dist/esm/chunk-BWMNPUTK.mjs.map +0 -1
- package/dist/esm/chunk-EFIYW4WK.mjs +0 -2
- package/dist/esm/chunk-EGOYLZBU.mjs +0 -2
- package/dist/esm/chunk-EGOYLZBU.mjs.map +0 -1
- package/dist/esm/chunk-EYXHVA6W.mjs +0 -2
- package/dist/esm/chunk-EYXHVA6W.mjs.map +0 -1
- package/dist/esm/chunk-FYIFBLHU.mjs +0 -2
- package/dist/esm/chunk-IG5CHHSI.mjs +0 -2
- package/dist/esm/chunk-IG5CHHSI.mjs.map +0 -1
- package/dist/esm/chunk-IXMB2GOK.mjs +0 -2
- package/dist/esm/chunk-IXMB2GOK.mjs.map +0 -1
- package/dist/esm/chunk-J5ZFOJN2.mjs +0 -2
- package/dist/esm/chunk-J5ZFOJN2.mjs.map +0 -1
- package/dist/esm/chunk-KC64ESLO.mjs +0 -2
- package/dist/esm/chunk-NGCFPQ22.mjs +0 -2
- package/dist/esm/chunk-NGCFPQ22.mjs.map +0 -1
- package/dist/esm/chunk-NTD3H2S4.mjs +0 -2
- package/dist/esm/chunk-NTD3H2S4.mjs.map +0 -1
- package/dist/esm/chunk-NYFVEKF6.mjs +0 -2
- package/dist/esm/chunk-NYFVEKF6.mjs.map +0 -1
- package/dist/esm/chunk-NZIJV4O2.mjs +0 -2
- package/dist/esm/chunk-NZIJV4O2.mjs.map +0 -1
- package/dist/esm/chunk-P32MY5YF.mjs +0 -2
- package/dist/esm/chunk-P32MY5YF.mjs.map +0 -1
- package/dist/esm/chunk-Q6N6QACD.mjs +0 -2
- package/dist/esm/chunk-Q6N6QACD.mjs.map +0 -1
- package/dist/esm/chunk-R26XML3D.mjs +0 -2
- package/dist/esm/chunk-R26XML3D.mjs.map +0 -1
- package/dist/esm/chunk-R3KWVOFG.mjs +0 -2
- package/dist/esm/chunk-RYETO74W.mjs +0 -2
- package/dist/esm/chunk-RYETO74W.mjs.map +0 -1
- package/dist/esm/chunk-TCTZCPQ6.mjs +0 -1
- package/dist/esm/chunk-TIH6ARYP.mjs +0 -2
- package/dist/esm/chunk-TQD4IGUM.mjs +0 -2
- package/dist/esm/chunk-TQD4IGUM.mjs.map +0 -1
- package/dist/esm/chunk-UNQNACJT.mjs +0 -2
- package/dist/esm/chunk-UNQNACJT.mjs.map +0 -1
- package/dist/esm/chunk-V45RFKH7.mjs.map +0 -1
- package/dist/esm/chunk-VMQWW5UT.mjs +0 -2
- package/dist/esm/chunk-VMQWW5UT.mjs.map +0 -1
- package/dist/esm/chunk-VOYW2TZW.mjs +0 -2
- package/dist/esm/chunk-VOYW2TZW.mjs.map +0 -1
- package/dist/esm/chunk-VYAVLUPJ.mjs +0 -2
- package/dist/esm/chunk-VYAVLUPJ.mjs.map +0 -1
- package/dist/esm/chunk-WKY5ENCK.mjs +0 -2
- package/dist/esm/chunk-WKY5ENCK.mjs.map +0 -1
- package/dist/esm/chunk-WX43AJTD.mjs.map +0 -1
- package/dist/esm/chunk-Y5DJPHJT.mjs +0 -2
- package/dist/esm/chunk-Y5DJPHJT.mjs.map +0 -1
- package/dist/esm/chunk-Y7VR7X5W.mjs +0 -2
- package/dist/esm/chunk-Y7VR7X5W.mjs.map +0 -1
- package/dist/esm/chunk-Z2UDRTHA.mjs +0 -2
- package/dist/esm/chunk-Z2UDRTHA.mjs.map +0 -1
- /package/dist/esm/{chunk-TCTZCPQ6.mjs.map → api/transactionSubmission/build.mjs.map} +0 -0
- /package/dist/esm/{chunk-UAAI3NCA.mjs.map → chunk-2SAKPC5Q.mjs.map} +0 -0
- /package/dist/esm/{chunk-4ADA5BE7.mjs.map → chunk-53DS6NBQ.mjs.map} +0 -0
- /package/dist/esm/{chunk-QWVR4RCV.mjs.map → chunk-5OPOJ43H.mjs.map} +0 -0
- /package/dist/esm/{chunk-HVADSXTB.mjs.map → chunk-73VWOS4Z.mjs.map} +0 -0
- /package/dist/esm/{chunk-U25N2VWA.mjs.map → chunk-AZUWHKN5.mjs.map} +0 -0
- /package/dist/esm/{chunk-JZNLZMUC.mjs.map → chunk-CJPCOS4R.mjs.map} +0 -0
- /package/dist/esm/{chunk-S36IYY6K.mjs.map → chunk-CL5B2QNS.mjs.map} +0 -0
- /package/dist/esm/{chunk-EWTHPMEE.mjs.map → chunk-CU2DINU4.mjs.map} +0 -0
- /package/dist/esm/{chunk-44MGBJ73.mjs.map → chunk-FZ56IS3E.mjs.map} +0 -0
- /package/dist/esm/{chunk-GEFQFRL3.mjs.map → chunk-HC5VMNXA.mjs.map} +0 -0
- /package/dist/esm/{chunk-BPYLPPEQ.mjs.map → chunk-PL2VA73L.mjs.map} +0 -0
- /package/dist/esm/{chunk-EFIYW4WK.mjs.map → chunk-PXTMLJKO.mjs.map} +0 -0
- /package/dist/esm/{chunk-JDS7K2WI.mjs.map → chunk-QCBIJCU4.mjs.map} +0 -0
- /package/dist/esm/{chunk-KQXRH5FK.mjs.map → chunk-QNTV5NMH.mjs.map} +0 -0
- /package/dist/esm/{chunk-EQ5BEDJ7.mjs.map → chunk-RCM3K5JL.mjs.map} +0 -0
- /package/dist/esm/{chunk-UPLWWSB4.mjs.map → chunk-SSJQOXEP.mjs.map} +0 -0
- /package/dist/esm/{chunk-U3LO2FSJ.mjs.map → chunk-WTGGCH34.mjs.map} +0 -0
- /package/dist/esm/{chunk-X32O46IB.mjs.map → chunk-XITLXPBK.mjs.map} +0 -0
- /package/dist/esm/{chunk-VWVEDCBM.mjs.map → chunk-YN6UIVFB.mjs.map} +0 -0
package/dist/common/index.d.ts
CHANGED
|
@@ -1,3 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This error is used to explain why parsing failed.
|
|
3
|
+
*/
|
|
4
|
+
declare class ParsingError<T> extends Error {
|
|
5
|
+
/**
|
|
6
|
+
* This provides a programmatic way to access why parsing failed. Downstream devs
|
|
7
|
+
* might want to use this to build their own error messages if the default error
|
|
8
|
+
* messages are not suitable for their use case. This should be an enum.
|
|
9
|
+
*/
|
|
10
|
+
invalidReason: T;
|
|
11
|
+
constructor(message: string, invalidReason: T);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Whereas ParsingError is thrown when parsing fails, e.g. in a fromString function,
|
|
15
|
+
* this type is returned from "defensive" functions like isValid.
|
|
16
|
+
*/
|
|
17
|
+
type ParsingResult<T> = {
|
|
18
|
+
/**
|
|
19
|
+
* True if valid, false otherwise.
|
|
20
|
+
*/
|
|
21
|
+
valid: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* If valid is false, this will be a code explaining why parsing failed.
|
|
24
|
+
*/
|
|
25
|
+
invalidReason?: T;
|
|
26
|
+
/**
|
|
27
|
+
* If valid is false, this will be a string explaining why parsing failed.
|
|
28
|
+
*/
|
|
29
|
+
invalidReasonMessage?: string;
|
|
30
|
+
};
|
|
31
|
+
|
|
1
32
|
declare const NetworkToIndexerAPI: Record<string, string>;
|
|
2
33
|
declare const NetworkToNodeAPI: Record<string, string>;
|
|
3
34
|
declare const NetworkToFaucetAPI: Record<string, string>;
|
|
@@ -521,6 +552,17 @@ type GetFungibleAssetMetadataQuery = {
|
|
|
521
552
|
token_standard: string;
|
|
522
553
|
}>;
|
|
523
554
|
};
|
|
555
|
+
type GetNamesQuery = {
|
|
556
|
+
current_aptos_names: Array<{
|
|
557
|
+
domain?: string | null;
|
|
558
|
+
expiration_timestamp?: any | null;
|
|
559
|
+
registered_address?: string | null;
|
|
560
|
+
subdomain?: string | null;
|
|
561
|
+
token_standard?: string | null;
|
|
562
|
+
is_primary?: boolean | null;
|
|
563
|
+
owner_address?: string | null;
|
|
564
|
+
}>;
|
|
565
|
+
};
|
|
524
566
|
type GetNumberOfDelegatorsQuery = {
|
|
525
567
|
num_active_delegator_per_pool: Array<{
|
|
526
568
|
num_active_delegator?: any | null;
|
|
@@ -672,6 +714,7 @@ type GetCurrentFungibleAssetBalancesResponse = GetCurrentFungibleAssetBalancesQu
|
|
|
672
714
|
type GetTokenActivityResponse = GetTokenActivityQuery["token_activities_v2"];
|
|
673
715
|
type GetCurrentTokenOwnershipResponse = GetCurrentTokenOwnershipQuery["current_token_ownerships_v2"][0];
|
|
674
716
|
type GetOwnedTokensResponse = GetCurrentTokenOwnershipQuery["current_token_ownerships_v2"];
|
|
717
|
+
type GetANSNameResponse = GetNamesQuery["current_aptos_names"];
|
|
675
718
|
/**
|
|
676
719
|
* A generic type that being passed by each function and holds an
|
|
677
720
|
* array of properties we can sort the query by
|
|
@@ -823,6 +866,15 @@ interface PaginationArgs {
|
|
|
823
866
|
offset?: AnyNumber;
|
|
824
867
|
limit?: number;
|
|
825
868
|
}
|
|
869
|
+
interface TokenStandardArg {
|
|
870
|
+
tokenStandard?: TokenStandard;
|
|
871
|
+
}
|
|
872
|
+
interface OrderByArg<T extends {}> {
|
|
873
|
+
orderBy?: OrderBy<T>;
|
|
874
|
+
}
|
|
875
|
+
interface WhereArg<T extends {}> {
|
|
876
|
+
where?: T;
|
|
877
|
+
}
|
|
826
878
|
/**
|
|
827
879
|
* QUERY TYPES
|
|
828
880
|
*/
|
|
@@ -888,7 +940,7 @@ type AptosRequest = {
|
|
|
888
940
|
/**
|
|
889
941
|
* Specifies ledger version of transactions. By default latest version will be used
|
|
890
942
|
*/
|
|
891
|
-
type
|
|
943
|
+
type LedgerVersionArg = {
|
|
892
944
|
ledgerVersion?: AnyNumber;
|
|
893
945
|
};
|
|
894
946
|
/**
|
|
@@ -933,7 +985,13 @@ declare enum TransactionResponseType {
|
|
|
933
985
|
BlockMetadata = "block_metadata_transaction",
|
|
934
986
|
StateCheckpoint = "state_checkpoint_transaction"
|
|
935
987
|
}
|
|
936
|
-
type TransactionResponse = PendingTransactionResponse |
|
|
988
|
+
type TransactionResponse = PendingTransactionResponse | CommittedTransactionResponse;
|
|
989
|
+
type CommittedTransactionResponse = UserTransactionResponse | GenesisTransactionResponse | BlockMetadataTransactionResponse | StateCheckpointTransactionResponse;
|
|
990
|
+
declare function isPendingTransactionResponse(response: TransactionResponse): response is PendingTransactionResponse;
|
|
991
|
+
declare function isUserTransactionResponse(response: TransactionResponse): response is UserTransactionResponse;
|
|
992
|
+
declare function isGenesisTransactionResponse(response: TransactionResponse): response is GenesisTransactionResponse;
|
|
993
|
+
declare function isBlockMetadataTransactionResponse(response: TransactionResponse): response is BlockMetadataTransactionResponse;
|
|
994
|
+
declare function isStateCheckpointTransactionResponse(response: TransactionResponse): response is StateCheckpointTransactionResponse;
|
|
937
995
|
type PendingTransactionResponse = {
|
|
938
996
|
type: TransactionResponseType.Pending;
|
|
939
997
|
hash: string;
|
|
@@ -1190,6 +1248,11 @@ type MoveScriptBytecode = {
|
|
|
1190
1248
|
* These are the JSON representations of transaction signatures returned from the node API.
|
|
1191
1249
|
*/
|
|
1192
1250
|
type TransactionSignature = TransactionEd25519Signature | TransactionSecp256k1Signature | TransactionMultiEd25519Signature | TransactionMultiAgentSignature | TransactionFeePayerSignature;
|
|
1251
|
+
declare function isEd25519Signature(signature: TransactionSignature): signature is TransactionFeePayerSignature;
|
|
1252
|
+
declare function isSecp256k1Signature(signature: TransactionSignature): signature is TransactionFeePayerSignature;
|
|
1253
|
+
declare function isMultiAgentSignature(signature: TransactionSignature): signature is TransactionMultiAgentSignature;
|
|
1254
|
+
declare function isFeePayerSignature(signature: TransactionSignature): signature is TransactionFeePayerSignature;
|
|
1255
|
+
declare function isMultiEd25519Signature(signature: TransactionSignature): signature is TransactionMultiEd25519Signature;
|
|
1193
1256
|
type TransactionEd25519Signature = {
|
|
1194
1257
|
type: string;
|
|
1195
1258
|
public_key: string;
|
|
@@ -1245,10 +1308,7 @@ type TransactionFeePayerSignature = {
|
|
|
1245
1308
|
/**
|
|
1246
1309
|
* The union of all single account signatures.
|
|
1247
1310
|
*/
|
|
1248
|
-
type AccountSignature =
|
|
1249
|
-
type AccountEd25519Signature = TransactionEd25519Signature;
|
|
1250
|
-
type AccountSecp256k1Signature = TransactionSecp256k1Signature;
|
|
1251
|
-
type AccountMultiEd25519Signature = TransactionMultiEd25519Signature;
|
|
1311
|
+
type AccountSignature = TransactionEd25519Signature | TransactionSecp256k1Signature | TransactionMultiEd25519Signature;
|
|
1252
1312
|
type WriteSet = ScriptWriteSet | DirectWriteSet;
|
|
1253
1313
|
type ScriptWriteSet = {
|
|
1254
1314
|
type: string;
|
|
@@ -1552,7 +1612,7 @@ declare enum DeriveScheme {
|
|
|
1552
1612
|
type WaitForTransactionOptions = {
|
|
1553
1613
|
timeoutSecs?: number;
|
|
1554
1614
|
checkSuccess?: boolean;
|
|
1555
|
-
|
|
1615
|
+
waitForIndexer?: boolean;
|
|
1556
1616
|
};
|
|
1557
1617
|
/**
|
|
1558
1618
|
* Input type to generate an account using Single Signer
|
|
@@ -1572,121 +1632,6 @@ type GenerateAccountWithSingleSignerSecp256k1Key = {
|
|
|
1572
1632
|
};
|
|
1573
1633
|
type GenerateAccount = GenerateAccountWithEd25519 | GenerateAccountWithSingleSignerSecp256k1Key;
|
|
1574
1634
|
|
|
1575
|
-
/**
|
|
1576
|
-
* Type of API endpoint for request routing
|
|
1577
|
-
*/
|
|
1578
|
-
declare enum AptosApiType {
|
|
1579
|
-
FULLNODE = 0,
|
|
1580
|
-
INDEXER = 1,
|
|
1581
|
-
FAUCET = 2
|
|
1582
|
-
}
|
|
1583
|
-
declare const DEFAULT_NETWORK = Network.DEVNET;
|
|
1584
|
-
/**
|
|
1585
|
-
* The default max gas amount when none is given.
|
|
1586
|
-
*
|
|
1587
|
-
* This is the maximum number of gas units that will be used by a transaction before being rejected.
|
|
1588
|
-
*
|
|
1589
|
-
* Note that max gas amount varies based on the transaction. A larger transaction will go over this
|
|
1590
|
-
* default gas amount, and the value will need to be changed for the specific transaction.
|
|
1591
|
-
*/
|
|
1592
|
-
declare const DEFAULT_MAX_GAS_AMOUNT = 200000;
|
|
1593
|
-
/**
|
|
1594
|
-
* The default transaction expiration seconds from now.
|
|
1595
|
-
*
|
|
1596
|
-
* This time is how long until the blockchain nodes will reject the transaction.
|
|
1597
|
-
*
|
|
1598
|
-
* Note that the transaction expiration time varies based on network connection and network load. It may need to be
|
|
1599
|
-
* increased for the transaction to be processed.
|
|
1600
|
-
*/
|
|
1601
|
-
declare const DEFAULT_TXN_EXP_SEC_FROM_NOW = 20;
|
|
1602
|
-
/**
|
|
1603
|
-
* The default number of seconds to wait for a transaction to be processed.
|
|
1604
|
-
*
|
|
1605
|
-
* This time is the amount of time that the SDK will wait for a transaction to be processed when waiting for
|
|
1606
|
-
* the results of the transaction. It may take longer based on network connection and network load.
|
|
1607
|
-
*/
|
|
1608
|
-
declare const DEFAULT_TXN_TIMEOUT_SEC = 20;
|
|
1609
|
-
/**
|
|
1610
|
-
* The default gas currency for the network.
|
|
1611
|
-
*/
|
|
1612
|
-
declare const APTOS_COIN = "0x1::aptos_coin::AptosCoin";
|
|
1613
|
-
declare const RAW_TRANSACTION_SALT = "APTOS::RawTransaction";
|
|
1614
|
-
declare const RAW_TRANSACTION_WITH_DATA_SALT = "APTOS::RawTransactionWithData";
|
|
1615
|
-
|
|
1616
|
-
/**
|
|
1617
|
-
* This class holds the config information for the SDK client instance.
|
|
1618
|
-
*/
|
|
1619
|
-
declare class AptosConfig {
|
|
1620
|
-
/** The Network that this SDK is associated with. */
|
|
1621
|
-
readonly network: Network;
|
|
1622
|
-
/**
|
|
1623
|
-
* The client instance the SDK uses
|
|
1624
|
-
*/
|
|
1625
|
-
readonly client: Client;
|
|
1626
|
-
/**
|
|
1627
|
-
* The optional hardcoded fullnode URL to send requests to instead of using the network
|
|
1628
|
-
*/
|
|
1629
|
-
readonly fullnode?: string;
|
|
1630
|
-
/**
|
|
1631
|
-
* The optional hardcoded faucet URL to send requests to instead of using the network
|
|
1632
|
-
*/
|
|
1633
|
-
readonly faucet?: string;
|
|
1634
|
-
/**
|
|
1635
|
-
* The optional hardcoded indexer URL to send requests to instead of using the network
|
|
1636
|
-
*/
|
|
1637
|
-
readonly indexer?: string;
|
|
1638
|
-
readonly clientConfig?: ClientConfig;
|
|
1639
|
-
constructor(settings?: AptosSettings);
|
|
1640
|
-
/**
|
|
1641
|
-
* Returns the URL endpoint to send the request to.
|
|
1642
|
-
* If a custom URL was provided in the config, that URL is returned.
|
|
1643
|
-
* If a custom URL was provided but not URL endpoints, an error is thrown.
|
|
1644
|
-
* Otherwise, the URL endpoint is derived from the network.
|
|
1645
|
-
*
|
|
1646
|
-
* @param apiType - The type of Aptos API to get the URL for.
|
|
1647
|
-
*
|
|
1648
|
-
* @internal
|
|
1649
|
-
*/
|
|
1650
|
-
getRequestUrl(apiType: AptosApiType): string;
|
|
1651
|
-
/**
|
|
1652
|
-
* Checks if the URL is a known indexer endpoint
|
|
1653
|
-
*
|
|
1654
|
-
* @internal
|
|
1655
|
-
* */
|
|
1656
|
-
isIndexerRequest(url: string): boolean;
|
|
1657
|
-
}
|
|
1658
|
-
|
|
1659
|
-
/**
|
|
1660
|
-
* This error is used to explain why parsing failed.
|
|
1661
|
-
*/
|
|
1662
|
-
declare class ParsingError<T> extends Error {
|
|
1663
|
-
/**
|
|
1664
|
-
* This provides a programmatic way to access why parsing failed. Downstream devs
|
|
1665
|
-
* might want to use this to build their own error messages if the default error
|
|
1666
|
-
* messages are not suitable for their use case. This should be an enum.
|
|
1667
|
-
*/
|
|
1668
|
-
invalidReason: T;
|
|
1669
|
-
constructor(message: string, invalidReason: T);
|
|
1670
|
-
}
|
|
1671
|
-
/**
|
|
1672
|
-
* Whereas ParsingError is thrown when parsing fails, e.g. in a fromString function,
|
|
1673
|
-
* this type is returned from "defensive" functions like isValid.
|
|
1674
|
-
*/
|
|
1675
|
-
type ParsingResult<T> = {
|
|
1676
|
-
/**
|
|
1677
|
-
* True if valid, false otherwise.
|
|
1678
|
-
*/
|
|
1679
|
-
valid: boolean;
|
|
1680
|
-
/**
|
|
1681
|
-
* If valid is false, this will be a code explaining why parsing failed.
|
|
1682
|
-
*/
|
|
1683
|
-
invalidReason?: T;
|
|
1684
|
-
/**
|
|
1685
|
-
* If valid is false, this will be a string explaining why parsing failed.
|
|
1686
|
-
*/
|
|
1687
|
-
invalidReasonMessage?: string;
|
|
1688
|
-
};
|
|
1689
|
-
|
|
1690
1635
|
/**
|
|
1691
1636
|
* This enum is used to explain why parsing might have failed.
|
|
1692
1637
|
*/
|
|
@@ -1949,10 +1894,10 @@ declare class Serializer {
|
|
|
1949
1894
|
* @param values The array of BCS Serializable values
|
|
1950
1895
|
* @example
|
|
1951
1896
|
* const addresses = new Array<AccountAddress>(
|
|
1952
|
-
* AccountAddress.
|
|
1953
|
-
* AccountAddress.
|
|
1954
|
-
* AccountAddress.
|
|
1955
|
-
* AccountAddress.
|
|
1897
|
+
* AccountAddress.from("0x1"),
|
|
1898
|
+
* AccountAddress.from("0x2"),
|
|
1899
|
+
* AccountAddress.from("0xa"),
|
|
1900
|
+
* AccountAddress.from("0xb"),
|
|
1956
1901
|
* );
|
|
1957
1902
|
* const serializer = new Serializer();
|
|
1958
1903
|
* serializer.serializeVector(addresses);
|
|
@@ -2092,10 +2037,10 @@ declare class Deserializer {
|
|
|
2092
2037
|
* @example
|
|
2093
2038
|
* // serialize a vector of addresses
|
|
2094
2039
|
* const addresses = new Array<AccountAddress>(
|
|
2095
|
-
* AccountAddress.
|
|
2096
|
-
* AccountAddress.
|
|
2097
|
-
* AccountAddress.
|
|
2098
|
-
* AccountAddress.
|
|
2040
|
+
* AccountAddress.from("0x1"),
|
|
2041
|
+
* AccountAddress.from("0x2"),
|
|
2042
|
+
* AccountAddress.from("0xa"),
|
|
2043
|
+
* AccountAddress.from("0xb"),
|
|
2099
2044
|
* );
|
|
2100
2045
|
* const serializer = new Serializer();
|
|
2101
2046
|
* serializer.serializeVector(addresses);
|
|
@@ -2283,7 +2228,7 @@ declare class AccountAddress extends Serializable implements TransactionArgument
|
|
|
2283
2228
|
static deserialize(deserializer: Deserializer): AccountAddress;
|
|
2284
2229
|
/**
|
|
2285
2230
|
* NOTE: This function has strict parsing behavior. For relaxed behavior, please use
|
|
2286
|
-
* the `
|
|
2231
|
+
* the `fromString` function.
|
|
2287
2232
|
*
|
|
2288
2233
|
* Creates an instance of AccountAddress from a hex string.
|
|
2289
2234
|
*
|
|
@@ -2308,11 +2253,11 @@ declare class AccountAddress extends Serializable implements TransactionArgument
|
|
|
2308
2253
|
*
|
|
2309
2254
|
* @returns An instance of AccountAddress.
|
|
2310
2255
|
*/
|
|
2311
|
-
static
|
|
2256
|
+
static fromStringStrict(input: string): AccountAddress;
|
|
2312
2257
|
/**
|
|
2313
2258
|
* NOTE: This function has relaxed parsing behavior. For strict behavior, please use
|
|
2314
|
-
* the `
|
|
2315
|
-
* function, `
|
|
2259
|
+
* the `fromStringStrict` function. Where possible use `fromStringStrict` rather than this
|
|
2260
|
+
* function, `fromString` is only provided for backwards compatibility.
|
|
2316
2261
|
*
|
|
2317
2262
|
* Creates an instance of AccountAddress from a hex string.
|
|
2318
2263
|
*
|
|
@@ -2334,33 +2279,33 @@ declare class AccountAddress extends Serializable implements TransactionArgument
|
|
|
2334
2279
|
*
|
|
2335
2280
|
* @returns An instance of AccountAddress.
|
|
2336
2281
|
*/
|
|
2337
|
-
static
|
|
2282
|
+
static fromString(input: string): AccountAddress;
|
|
2338
2283
|
/**
|
|
2339
2284
|
* Convenience method for creating an AccountAddress from all known inputs.
|
|
2340
2285
|
*
|
|
2341
2286
|
* This handles, Uint8array, string, and AccountAddress itself
|
|
2342
2287
|
* @param input
|
|
2343
2288
|
*/
|
|
2344
|
-
static
|
|
2289
|
+
static from(input: AccountAddressInput): AccountAddress;
|
|
2345
2290
|
/**
|
|
2346
2291
|
* Convenience method for creating an AccountAddress from all known inputs.
|
|
2347
2292
|
*
|
|
2348
2293
|
* This handles, Uint8array, string, and AccountAddress itself
|
|
2349
2294
|
* @param input
|
|
2350
2295
|
*/
|
|
2351
|
-
static
|
|
2296
|
+
static fromStrict(input: AccountAddressInput): AccountAddress;
|
|
2352
2297
|
/**
|
|
2353
2298
|
* Check if the string is a valid AccountAddress.
|
|
2354
2299
|
*
|
|
2355
2300
|
* @param args.input A hex string representing an account address.
|
|
2356
|
-
* @param args.
|
|
2301
|
+
* @param args.strict If true, use strict parsing behavior. If false, use relaxed parsing behavior.
|
|
2357
2302
|
*
|
|
2358
2303
|
* @returns valid = true if the string is valid, valid = false if not. If the string
|
|
2359
2304
|
* is not valid, invalidReason will be set explaining why it is invalid.
|
|
2360
2305
|
*/
|
|
2361
2306
|
static isValid(args: {
|
|
2362
2307
|
input: AccountAddressInput;
|
|
2363
|
-
|
|
2308
|
+
strict?: boolean;
|
|
2364
2309
|
}): ParsingResult<AddressInvalidReason>;
|
|
2365
2310
|
/**
|
|
2366
2311
|
* Return whether AccountAddresses are equal. AccountAddresses are considered equal
|
|
@@ -3109,6 +3054,7 @@ declare class Ed25519PublicKey extends PublicKey {
|
|
|
3109
3054
|
serialize(serializer: Serializer): void;
|
|
3110
3055
|
static deserialize(deserializer: Deserializer): Ed25519PublicKey;
|
|
3111
3056
|
static load(deserializer: Deserializer): Ed25519PublicKey;
|
|
3057
|
+
static isPublicKey(publicKey: PublicKey): publicKey is Ed25519PublicKey;
|
|
3112
3058
|
}
|
|
3113
3059
|
/**
|
|
3114
3060
|
* Represents the private key of an Ed25519 key pair.
|
|
@@ -3189,6 +3135,7 @@ declare class Ed25519PrivateKey extends PrivateKey {
|
|
|
3189
3135
|
* @returns
|
|
3190
3136
|
*/
|
|
3191
3137
|
private static fromDerivationPathInner;
|
|
3138
|
+
static isPrivateKey(privateKey: PrivateKey): privateKey is Ed25519PrivateKey;
|
|
3192
3139
|
}
|
|
3193
3140
|
/**
|
|
3194
3141
|
* A signature of a message signed using an Ed25519 private key
|
|
@@ -3219,6 +3166,7 @@ declare class Ed25519Signature extends Signature {
|
|
|
3219
3166
|
serialize(serializer: Serializer): void;
|
|
3220
3167
|
static deserialize(deserializer: Deserializer): Ed25519Signature;
|
|
3221
3168
|
static load(deserializer: Deserializer): Ed25519Signature;
|
|
3169
|
+
static isSignature(signature: Signature): signature is Ed25519Signature;
|
|
3222
3170
|
}
|
|
3223
3171
|
|
|
3224
3172
|
/**
|
|
@@ -3374,6 +3322,7 @@ declare class Secp256k1PublicKey extends PublicKey {
|
|
|
3374
3322
|
serialize(serializer: Serializer): void;
|
|
3375
3323
|
static deserialize(deserializer: Deserializer): Secp256k1PublicKey;
|
|
3376
3324
|
static load(deserializer: Deserializer): Secp256k1PublicKey;
|
|
3325
|
+
static isPublicKey(publicKey: PublicKey): publicKey is Secp256k1PublicKey;
|
|
3377
3326
|
}
|
|
3378
3327
|
/**
|
|
3379
3328
|
* A Secp256k1 ecdsa private key
|
|
@@ -3446,6 +3395,7 @@ declare class Secp256k1PrivateKey extends PrivateKey {
|
|
|
3446
3395
|
* @returns The generated key
|
|
3447
3396
|
*/
|
|
3448
3397
|
private static fromDerivationPathInner;
|
|
3398
|
+
static isPrivateKey(privateKey: PrivateKey): privateKey is Secp256k1PrivateKey;
|
|
3449
3399
|
}
|
|
3450
3400
|
/**
|
|
3451
3401
|
* A signature of a message signed using an Secp256k1 ecdsa private key
|
|
@@ -3481,6 +3431,7 @@ declare class Secp256k1Signature extends Signature {
|
|
|
3481
3431
|
serialize(serializer: Serializer): void;
|
|
3482
3432
|
static deserialize(deserializer: Deserializer): Secp256k1Signature;
|
|
3483
3433
|
static load(deserializer: Deserializer): Secp256k1Signature;
|
|
3434
|
+
static isSignature(signature: Signature): signature is Secp256k1Signature;
|
|
3484
3435
|
}
|
|
3485
3436
|
|
|
3486
3437
|
declare class AnySignature extends Signature {
|
|
@@ -3541,6 +3492,9 @@ declare class AnyPublicKey extends PublicKey {
|
|
|
3541
3492
|
}): boolean;
|
|
3542
3493
|
serialize(serializer: Serializer): void;
|
|
3543
3494
|
static deserialize(deserializer: Deserializer): AnyPublicKey;
|
|
3495
|
+
static isPublicKey(publicKey: PublicKey): publicKey is AnyPublicKey;
|
|
3496
|
+
isEd25519(): this is Ed25519PublicKey;
|
|
3497
|
+
isSecp256k1PublicKey(): this is Secp256k1PublicKey;
|
|
3544
3498
|
}
|
|
3545
3499
|
|
|
3546
3500
|
declare class MultiKey extends PublicKey {
|
|
@@ -3645,6 +3599,107 @@ declare const splitPath: (path: string) => Array<string>;
|
|
|
3645
3599
|
*/
|
|
3646
3600
|
declare const mnemonicToSeed: (mnemonic: string) => Uint8Array;
|
|
3647
3601
|
|
|
3602
|
+
/**
|
|
3603
|
+
* Type of API endpoint for request routing
|
|
3604
|
+
*/
|
|
3605
|
+
declare enum AptosApiType {
|
|
3606
|
+
FULLNODE = 0,
|
|
3607
|
+
INDEXER = 1,
|
|
3608
|
+
FAUCET = 2
|
|
3609
|
+
}
|
|
3610
|
+
declare const DEFAULT_NETWORK = Network.DEVNET;
|
|
3611
|
+
/**
|
|
3612
|
+
* The default max gas amount when none is given.
|
|
3613
|
+
*
|
|
3614
|
+
* This is the maximum number of gas units that will be used by a transaction before being rejected.
|
|
3615
|
+
*
|
|
3616
|
+
* Note that max gas amount varies based on the transaction. A larger transaction will go over this
|
|
3617
|
+
* default gas amount, and the value will need to be changed for the specific transaction.
|
|
3618
|
+
*/
|
|
3619
|
+
declare const DEFAULT_MAX_GAS_AMOUNT = 200000;
|
|
3620
|
+
/**
|
|
3621
|
+
* The default transaction expiration seconds from now.
|
|
3622
|
+
*
|
|
3623
|
+
* This time is how long until the blockchain nodes will reject the transaction.
|
|
3624
|
+
*
|
|
3625
|
+
* Note that the transaction expiration time varies based on network connection and network load. It may need to be
|
|
3626
|
+
* increased for the transaction to be processed.
|
|
3627
|
+
*/
|
|
3628
|
+
declare const DEFAULT_TXN_EXP_SEC_FROM_NOW = 20;
|
|
3629
|
+
/**
|
|
3630
|
+
* The default number of seconds to wait for a transaction to be processed.
|
|
3631
|
+
*
|
|
3632
|
+
* This time is the amount of time that the SDK will wait for a transaction to be processed when waiting for
|
|
3633
|
+
* the results of the transaction. It may take longer based on network connection and network load.
|
|
3634
|
+
*/
|
|
3635
|
+
declare const DEFAULT_TXN_TIMEOUT_SEC = 20;
|
|
3636
|
+
/**
|
|
3637
|
+
* The default gas currency for the network.
|
|
3638
|
+
*/
|
|
3639
|
+
declare const APTOS_COIN = "0x1::aptos_coin::AptosCoin";
|
|
3640
|
+
declare const RAW_TRANSACTION_SALT = "APTOS::RawTransaction";
|
|
3641
|
+
declare const RAW_TRANSACTION_WITH_DATA_SALT = "APTOS::RawTransactionWithData";
|
|
3642
|
+
/**
|
|
3643
|
+
* The list of supported Processor types for our indexer api.
|
|
3644
|
+
*
|
|
3645
|
+
* These can be found from the processor_status table in the indexer database.
|
|
3646
|
+
* {@link https://cloud.hasura.io/public/graphiql?endpoint=https://indexer.mainnet.aptoslabs.com/v1/graphql}
|
|
3647
|
+
*/
|
|
3648
|
+
declare enum ProcessorType {
|
|
3649
|
+
ACCOUNT_TRANSACTION_PROCESSOR = "account_transactions_processor",
|
|
3650
|
+
COIN_PROCESSOR = "coin_processor",
|
|
3651
|
+
DEFAULT = "default_processor",
|
|
3652
|
+
EVENTS_PROCESSOR = "events_processor",
|
|
3653
|
+
FUNGIBLE_ASSET_PROCESSOR = "fungible_asset_processor",
|
|
3654
|
+
STAKE_PROCESSOR = "stake_processor",
|
|
3655
|
+
TOKEN_PROCESSOR = "token_processor",
|
|
3656
|
+
TOKEN_V2_PROCESSOR = "token_v2_processor",
|
|
3657
|
+
USER_TRANSACTION_PROCESSOR = "user_transaction_processor"
|
|
3658
|
+
}
|
|
3659
|
+
|
|
3660
|
+
/**
|
|
3661
|
+
* This class holds the config information for the SDK client instance.
|
|
3662
|
+
*/
|
|
3663
|
+
declare class AptosConfig {
|
|
3664
|
+
/** The Network that this SDK is associated with. Defaults to DEVNET */
|
|
3665
|
+
readonly network: Network;
|
|
3666
|
+
/**
|
|
3667
|
+
* The client instance the SDK uses. Defaults to `@aptos-labs/aptos-client
|
|
3668
|
+
*/
|
|
3669
|
+
readonly client: Client;
|
|
3670
|
+
/**
|
|
3671
|
+
* The optional hardcoded fullnode URL to send requests to instead of using the network
|
|
3672
|
+
*/
|
|
3673
|
+
readonly fullnode?: string;
|
|
3674
|
+
/**
|
|
3675
|
+
* The optional hardcoded faucet URL to send requests to instead of using the network
|
|
3676
|
+
*/
|
|
3677
|
+
readonly faucet?: string;
|
|
3678
|
+
/**
|
|
3679
|
+
* The optional hardcoded indexer URL to send requests to instead of using the network
|
|
3680
|
+
*/
|
|
3681
|
+
readonly indexer?: string;
|
|
3682
|
+
readonly clientConfig?: ClientConfig;
|
|
3683
|
+
constructor(settings?: AptosSettings);
|
|
3684
|
+
/**
|
|
3685
|
+
* Returns the URL endpoint to send the request to.
|
|
3686
|
+
* If a custom URL was provided in the config, that URL is returned.
|
|
3687
|
+
* If a custom URL was provided but not URL endpoints, an error is thrown.
|
|
3688
|
+
* Otherwise, the URL endpoint is derived from the network.
|
|
3689
|
+
*
|
|
3690
|
+
* @param apiType - The type of Aptos API to get the URL for.
|
|
3691
|
+
*
|
|
3692
|
+
* @internal
|
|
3693
|
+
*/
|
|
3694
|
+
getRequestUrl(apiType: AptosApiType): string;
|
|
3695
|
+
/**
|
|
3696
|
+
* Checks if the URL is a known indexer endpoint
|
|
3697
|
+
*
|
|
3698
|
+
* @internal
|
|
3699
|
+
* */
|
|
3700
|
+
isIndexerRequest(url: string): boolean;
|
|
3701
|
+
}
|
|
3702
|
+
|
|
3648
3703
|
/**
|
|
3649
3704
|
* A class to query all `Account` related queries on Aptos.
|
|
3650
3705
|
*/
|
|
@@ -3684,7 +3739,7 @@ declare class Account {
|
|
|
3684
3739
|
*/
|
|
3685
3740
|
getAccountModules(args: {
|
|
3686
3741
|
accountAddress: AccountAddressInput;
|
|
3687
|
-
options?: PaginationArgs &
|
|
3742
|
+
options?: PaginationArgs & LedgerVersionArg;
|
|
3688
3743
|
}): Promise<MoveModuleBytecode[]>;
|
|
3689
3744
|
/**
|
|
3690
3745
|
* Queries for a specific account module given account address and module name
|
|
@@ -3706,7 +3761,7 @@ declare class Account {
|
|
|
3706
3761
|
getAccountModule(args: {
|
|
3707
3762
|
accountAddress: AccountAddressInput;
|
|
3708
3763
|
moduleName: string;
|
|
3709
|
-
options?:
|
|
3764
|
+
options?: LedgerVersionArg;
|
|
3710
3765
|
}): Promise<MoveModuleBytecode>;
|
|
3711
3766
|
/**
|
|
3712
3767
|
* Queries account transactions given an account address
|
|
@@ -3738,7 +3793,7 @@ declare class Account {
|
|
|
3738
3793
|
*/
|
|
3739
3794
|
getAccountResources(args: {
|
|
3740
3795
|
accountAddress: AccountAddressInput;
|
|
3741
|
-
options?: PaginationArgs &
|
|
3796
|
+
options?: PaginationArgs & LedgerVersionArg;
|
|
3742
3797
|
}): Promise<MoveResource[]>;
|
|
3743
3798
|
/**
|
|
3744
3799
|
* Queries a specific account resource given account address and resource type. Note that the default is `any` in order
|
|
@@ -3754,14 +3809,14 @@ declare class Account {
|
|
|
3754
3809
|
* @example An example of an account resource
|
|
3755
3810
|
* ```
|
|
3756
3811
|
* {
|
|
3757
|
-
*
|
|
3812
|
+
* value: 6
|
|
3758
3813
|
* }
|
|
3759
3814
|
* ```
|
|
3760
3815
|
*/
|
|
3761
3816
|
getAccountResource<T extends {} = any>(args: {
|
|
3762
3817
|
accountAddress: AccountAddressInput;
|
|
3763
3818
|
resourceType: MoveStructId;
|
|
3764
|
-
options?:
|
|
3819
|
+
options?: LedgerVersionArg;
|
|
3765
3820
|
}): Promise<T>;
|
|
3766
3821
|
/**
|
|
3767
3822
|
* Looks up the account address for a given authentication key
|
|
@@ -3769,21 +3824,25 @@ declare class Account {
|
|
|
3769
3824
|
* This handles both if the account's authentication key has been rotated or not.
|
|
3770
3825
|
*
|
|
3771
3826
|
* @param args.authenticationKey The authentication key
|
|
3827
|
+
* @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying
|
|
3772
3828
|
* @param args.options.ledgerVersion The ledger version to query, if not provided it will get the latest version
|
|
3773
3829
|
* @returns Promise<AccountAddress> The accountAddress associated with the authentication key
|
|
3774
3830
|
*/
|
|
3775
3831
|
lookupOriginalAccountAddress(args: {
|
|
3776
3832
|
authenticationKey: AccountAddressInput;
|
|
3777
|
-
|
|
3833
|
+
minimumLedgerVersion?: AnyNumber;
|
|
3834
|
+
options?: LedgerVersionArg;
|
|
3778
3835
|
}): Promise<AccountAddress>;
|
|
3779
3836
|
/**
|
|
3780
3837
|
* Queries the current count of tokens owned by an account
|
|
3781
3838
|
*
|
|
3782
3839
|
* @param args.accountAddress The account address
|
|
3840
|
+
* @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying
|
|
3783
3841
|
* @returns Current count of tokens owned by the account
|
|
3784
3842
|
*/
|
|
3785
3843
|
getAccountTokensCount(args: {
|
|
3786
3844
|
accountAddress: AccountAddressInput;
|
|
3845
|
+
minimumLedgerVersion?: AnyNumber;
|
|
3787
3846
|
}): Promise<number>;
|
|
3788
3847
|
/**
|
|
3789
3848
|
* Queries the account's current owned tokens.
|
|
@@ -3792,19 +3851,17 @@ declare class Account {
|
|
|
3792
3851
|
* If you want to get only the token from a specific standard, you can pass an optional tokenStandard param
|
|
3793
3852
|
*
|
|
3794
3853
|
* @param args.accountAddress The account address we want to get the tokens for
|
|
3854
|
+
* @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying
|
|
3795
3855
|
* @param args.options.tokenStandard The NFT standard to query for
|
|
3796
|
-
* @param args.options.
|
|
3797
|
-
* @param args.options.
|
|
3856
|
+
* @param args.options.offset The number token to start returning results from
|
|
3857
|
+
* @param args.options.limit The number of results to return
|
|
3798
3858
|
* @param args.options.orderBy The order to sort the tokens by
|
|
3799
3859
|
* @returns Tokens array with the token data
|
|
3800
3860
|
*/
|
|
3801
3861
|
getAccountOwnedTokens(args: {
|
|
3802
3862
|
accountAddress: AccountAddressInput;
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
pagination?: PaginationArgs;
|
|
3806
|
-
orderBy?: OrderBy<GetAccountOwnedTokensQueryResponse[0]>;
|
|
3807
|
-
};
|
|
3863
|
+
minimumLedgerVersion?: AnyNumber;
|
|
3864
|
+
options?: TokenStandardArg & PaginationArgs & OrderByArg<GetAccountOwnedTokensQueryResponse[0]>;
|
|
3808
3865
|
}): Promise<GetAccountOwnedTokensQueryResponse>;
|
|
3809
3866
|
/**
|
|
3810
3867
|
* Queries all current tokens of a specific collection that an account owns by the collection address
|
|
@@ -3814,20 +3871,18 @@ declare class Account {
|
|
|
3814
3871
|
*
|
|
3815
3872
|
* @param args.accountAddress The account address we want to get the tokens for
|
|
3816
3873
|
* @param args.collectionAddress The address of the collection being queried
|
|
3874
|
+
* @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying
|
|
3817
3875
|
* @param args.options.tokenStandard The NFT standard to query for
|
|
3818
|
-
* @param args.options.
|
|
3819
|
-
* @param args.options.
|
|
3876
|
+
* @param args.options.offset The number token to start returning results from
|
|
3877
|
+
* @param args.options.limit The number of results to return
|
|
3820
3878
|
* @param args.options.orderBy The order to sort the tokens by
|
|
3821
3879
|
* @returns Tokens array with the token data
|
|
3822
3880
|
*/
|
|
3823
3881
|
getAccountOwnedTokensFromCollectionAddress(args: {
|
|
3824
3882
|
accountAddress: AccountAddressInput;
|
|
3825
3883
|
collectionAddress: AccountAddressInput;
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
pagination?: PaginationArgs;
|
|
3829
|
-
orderBy?: OrderBy<GetAccountOwnedTokensFromCollectionResponse[0]>;
|
|
3830
|
-
};
|
|
3884
|
+
minimumLedgerVersion?: AnyNumber;
|
|
3885
|
+
options?: TokenStandardArg & PaginationArgs & OrderByArg<GetAccountOwnedTokensFromCollectionResponse[0]>;
|
|
3831
3886
|
}): Promise<GetAccountOwnedTokensFromCollectionResponse>;
|
|
3832
3887
|
/**
|
|
3833
3888
|
* Queries for all collections that an account currently has tokens for.
|
|
@@ -3836,69 +3891,94 @@ declare class Account {
|
|
|
3836
3891
|
* If you want to get only the token from a specific standard, you can pass an optional tokenStandard param
|
|
3837
3892
|
*
|
|
3838
3893
|
* @param args.accountAddress The account address we want to get the collections for
|
|
3894
|
+
* @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying
|
|
3839
3895
|
* @param args.options.tokenStandard The NFT standard to query for
|
|
3840
|
-
* @param args.options.
|
|
3841
|
-
* @param args.options.
|
|
3896
|
+
* @param args.options.offset The number collection to start returning results from
|
|
3897
|
+
* @param args.options.limit The number of results to return
|
|
3842
3898
|
* @param args.options.orderBy The order to sort the tokens by
|
|
3843
3899
|
* @returns Collections array with the collections data
|
|
3844
3900
|
*/
|
|
3845
3901
|
getAccountCollectionsWithOwnedTokens(args: {
|
|
3846
3902
|
accountAddress: AccountAddressInput;
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
pagination?: PaginationArgs;
|
|
3850
|
-
orderBy?: OrderBy<GetAccountCollectionsWithOwnedTokenResponse[0]>;
|
|
3851
|
-
};
|
|
3903
|
+
minimumLedgerVersion?: AnyNumber;
|
|
3904
|
+
options?: TokenStandardArg & PaginationArgs & OrderByArg<GetAccountCollectionsWithOwnedTokenResponse[0]>;
|
|
3852
3905
|
}): Promise<GetAccountCollectionsWithOwnedTokenResponse>;
|
|
3853
3906
|
/**
|
|
3854
3907
|
* Queries the current count of transactions submitted by an account
|
|
3855
3908
|
*
|
|
3856
3909
|
* @param args.accountAddress The account address we want to get the total count for
|
|
3910
|
+
* @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying
|
|
3857
3911
|
* @returns Current count of transactions made by an account
|
|
3858
3912
|
*/
|
|
3859
3913
|
getAccountTransactionsCount(args: {
|
|
3860
3914
|
accountAddress: AccountAddressInput;
|
|
3915
|
+
minimumLedgerVersion?: AnyNumber;
|
|
3861
3916
|
}): Promise<number>;
|
|
3862
3917
|
/**
|
|
3863
3918
|
* Queries an account's coins data
|
|
3864
3919
|
*
|
|
3865
3920
|
* @param args.accountAddress The account address we want to get the coins data for
|
|
3866
|
-
* @param args.
|
|
3867
|
-
* @param args.options.
|
|
3868
|
-
* @param args.options.
|
|
3921
|
+
* @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying
|
|
3922
|
+
* @param args.options.offset optional. The number coin to start returning results from
|
|
3923
|
+
* @param args.options.limit optional. The number of results to return
|
|
3924
|
+
* @param args.options.orderBy optional. The order to sort the coins by
|
|
3925
|
+
* @param args.options.where optional. Filter the results by
|
|
3869
3926
|
* @returns Array with the coins data
|
|
3870
3927
|
*/
|
|
3871
3928
|
getAccountCoinsData(args: {
|
|
3872
3929
|
accountAddress: AccountAddressInput;
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
orderBy?: OrderBy<GetAccountCoinsDataResponse[0]>;
|
|
3876
|
-
};
|
|
3930
|
+
minimumLedgerVersion?: AnyNumber;
|
|
3931
|
+
options?: PaginationArgs & OrderByArg<GetAccountCoinsDataResponse[0]> & WhereArg<CurrentFungibleAssetBalancesBoolExp>;
|
|
3877
3932
|
}): Promise<GetAccountCoinsDataResponse>;
|
|
3878
3933
|
/**
|
|
3879
3934
|
* Queries the current count of an account's coins aggregated
|
|
3880
3935
|
*
|
|
3881
3936
|
* @param args.accountAddress The account address we want to get the total count for
|
|
3937
|
+
* @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying
|
|
3882
3938
|
* @returns Current count of the aggregated count of all account's coins
|
|
3883
3939
|
*/
|
|
3884
3940
|
getAccountCoinsCount(args: {
|
|
3885
3941
|
accountAddress: AccountAddressInput;
|
|
3942
|
+
minimumLedgerVersion?: AnyNumber;
|
|
3886
3943
|
}): Promise<number>;
|
|
3887
3944
|
/**
|
|
3888
|
-
* Queries
|
|
3945
|
+
* Queries the account's APT amount
|
|
3889
3946
|
*
|
|
3890
|
-
* @param args.accountAddress The account address we want to get the
|
|
3891
|
-
* @param args.
|
|
3892
|
-
* @
|
|
3893
|
-
* @param args.options.orderBy The order to sort the coins by
|
|
3894
|
-
* @returns Objects array with the object data
|
|
3947
|
+
* @param args.accountAddress The account address we want to get the total count for
|
|
3948
|
+
* @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying
|
|
3949
|
+
* @returns Current amount of account's APT
|
|
3895
3950
|
*/
|
|
3896
|
-
|
|
3951
|
+
getAccountAPTAmount(args: {
|
|
3897
3952
|
accountAddress: AccountAddressInput;
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3953
|
+
minimumLedgerVersion?: AnyNumber;
|
|
3954
|
+
}): Promise<number>;
|
|
3955
|
+
/**
|
|
3956
|
+
* Queries the account's coin amount by the coin type
|
|
3957
|
+
*
|
|
3958
|
+
* @param args.accountAddress The account address we want to get the total count for
|
|
3959
|
+
* @param args.coinType The coin type to query
|
|
3960
|
+
* @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying
|
|
3961
|
+
* @returns Current amount of account's coin
|
|
3962
|
+
*/
|
|
3963
|
+
getAccountCoinAmount(args: {
|
|
3964
|
+
accountAddress: AccountAddressInput;
|
|
3965
|
+
coinType: MoveStructId;
|
|
3966
|
+
minimumLedgerVersion?: AnyNumber;
|
|
3967
|
+
}): Promise<number>;
|
|
3968
|
+
/**
|
|
3969
|
+
* Queries an account's owned objects
|
|
3970
|
+
*
|
|
3971
|
+
* @param args.accountAddress The account address we want to get the objects for
|
|
3972
|
+
* @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying
|
|
3973
|
+
* @param args.options.offset The starting position to start returning results from
|
|
3974
|
+
* @param args.options.limit The number of results to return
|
|
3975
|
+
* @param args.options.orderBy The order to sort the objects by
|
|
3976
|
+
* @returns Objects array with the object data
|
|
3977
|
+
*/
|
|
3978
|
+
getAccountOwnedObjects(args: {
|
|
3979
|
+
accountAddress: AccountAddressInput;
|
|
3980
|
+
minimumLedgerVersion?: AnyNumber;
|
|
3981
|
+
options?: PaginationArgs & OrderByArg<GetAccountOwnedObjectsResponse[0]>;
|
|
3902
3982
|
}): Promise<GetAccountOwnedObjectsResponse>;
|
|
3903
3983
|
/**
|
|
3904
3984
|
* Derives an account by providing a private key.
|
|
@@ -4376,6 +4456,10 @@ declare class RotationProofChallenge extends Serializable {
|
|
|
4376
4456
|
declare abstract class AccountAuthenticator extends Serializable {
|
|
4377
4457
|
abstract serialize(serializer: Serializer): void;
|
|
4378
4458
|
static deserialize(deserializer: Deserializer): AccountAuthenticator;
|
|
4459
|
+
isEd25519(): this is AccountAuthenticatorEd25519;
|
|
4460
|
+
isMultiEd25519(): this is AccountAuthenticatorMultiEd25519;
|
|
4461
|
+
isSingleKey(): this is AccountAuthenticatorSingleKey;
|
|
4462
|
+
isMultiKey(): this is AccountAuthenticatorMultiKey;
|
|
4379
4463
|
}
|
|
4380
4464
|
/**
|
|
4381
4465
|
* Transaction authenticator Ed25519 for a multi signer transaction
|
|
@@ -4542,7 +4626,7 @@ declare class SignedTransaction extends Serializable {
|
|
|
4542
4626
|
/**
|
|
4543
4627
|
* Entry function arguments to be used when building a raw transaction using remote ABI
|
|
4544
4628
|
*/
|
|
4545
|
-
type SimpleEntryFunctionArgumentTypes = boolean | number | bigint | string | null | undefined | Uint8Array | Array<SimpleEntryFunctionArgumentTypes>;
|
|
4629
|
+
type SimpleEntryFunctionArgumentTypes = boolean | number | bigint | string | null | undefined | Uint8Array | Array<SimpleEntryFunctionArgumentTypes | EntryFunctionArgumentTypes>;
|
|
4546
4630
|
/**
|
|
4547
4631
|
* Entry function arguments to be used when building a raw transaction using BCS serialized arguments
|
|
4548
4632
|
*/
|
|
@@ -4589,7 +4673,7 @@ type InputEntryFunctionDataWithRemoteABI = InputEntryFunctionData & {
|
|
|
4589
4673
|
* The data needed to generate a Multi Sig payload
|
|
4590
4674
|
*/
|
|
4591
4675
|
type InputMultiSigData = {
|
|
4592
|
-
multisigAddress:
|
|
4676
|
+
multisigAddress: AccountAddressInput;
|
|
4593
4677
|
} & InputEntryFunctionData;
|
|
4594
4678
|
/**
|
|
4595
4679
|
* The data needed to generate a Multi Sig payload
|
|
@@ -4623,18 +4707,7 @@ interface InputGenerateSingleSignerRawTransactionArgs {
|
|
|
4623
4707
|
sender: AccountAddressInput;
|
|
4624
4708
|
payload: AnyTransactionPayloadInstance;
|
|
4625
4709
|
options?: InputGenerateTransactionOptions;
|
|
4626
|
-
|
|
4627
|
-
/**
|
|
4628
|
-
* Interface of the arguments to generate a fee payer transaction.
|
|
4629
|
-
* Used to provide to `generateTransaction()` method in the transaction builder flow
|
|
4630
|
-
*/
|
|
4631
|
-
interface InputGenerateFeePayerRawTransactionArgs {
|
|
4632
|
-
aptosConfig: AptosConfig;
|
|
4633
|
-
sender: AccountAddressInput;
|
|
4634
|
-
payload: AnyTransactionPayloadInstance;
|
|
4635
|
-
feePayerAddress: AccountAddressInput;
|
|
4636
|
-
secondarySignerAddresses?: AccountAddressInput[];
|
|
4637
|
-
options?: InputGenerateTransactionOptions;
|
|
4710
|
+
feePayerAddress?: AccountAddressInput;
|
|
4638
4711
|
}
|
|
4639
4712
|
/**
|
|
4640
4713
|
* Interface of the arguments to generate a multi-agent transaction.
|
|
@@ -4646,30 +4719,21 @@ interface InputGenerateMultiAgentRawTransactionArgs {
|
|
|
4646
4719
|
payload: AnyTransactionPayloadInstance;
|
|
4647
4720
|
secondarySignerAddresses: AccountAddressInput[];
|
|
4648
4721
|
options?: InputGenerateTransactionOptions;
|
|
4722
|
+
feePayerAddress?: AccountAddressInput;
|
|
4649
4723
|
}
|
|
4650
4724
|
/**
|
|
4651
4725
|
* Unified type that holds all the interfaces to generate different transaction types
|
|
4652
4726
|
*/
|
|
4653
|
-
type InputGenerateRawTransactionArgs = InputGenerateSingleSignerRawTransactionArgs |
|
|
4727
|
+
type InputGenerateRawTransactionArgs = InputGenerateSingleSignerRawTransactionArgs | InputGenerateMultiAgentRawTransactionArgs;
|
|
4654
4728
|
/**
|
|
4655
4729
|
* Interface that holds the return data when generating a single signer transaction
|
|
4656
4730
|
*
|
|
4657
4731
|
* @param rawTransaction a bcs serialized raw transaction
|
|
4658
4732
|
*/
|
|
4659
|
-
interface
|
|
4660
|
-
rawTransaction: RawTransaction;
|
|
4661
|
-
}
|
|
4662
|
-
/**
|
|
4663
|
-
* Interface that holds the return data when generating a fee payer transaction
|
|
4664
|
-
*
|
|
4665
|
-
* @param rawTransaction a bcs serialized raw transaction
|
|
4666
|
-
* @param secondarySignerAddresses optional. secondary signer addresses for multi-agent transaction
|
|
4667
|
-
* @param feePayerAddress fee payer address for a fee payer transaction (aka Sponsored Transaction)
|
|
4668
|
-
*/
|
|
4669
|
-
interface InputFeePayerTransaction {
|
|
4733
|
+
interface SingleSignerTransaction {
|
|
4670
4734
|
rawTransaction: RawTransaction;
|
|
4671
|
-
feePayerAddress
|
|
4672
|
-
secondarySignerAddresses?:
|
|
4735
|
+
feePayerAddress?: AccountAddress;
|
|
4736
|
+
secondarySignerAddresses?: undefined;
|
|
4673
4737
|
}
|
|
4674
4738
|
/**
|
|
4675
4739
|
* Interface that holds the return data when generating a multi-agent transaction.
|
|
@@ -4677,14 +4741,15 @@ interface InputFeePayerTransaction {
|
|
|
4677
4741
|
* @param rawTransaction a bcs serialized raw transaction
|
|
4678
4742
|
* @param secondarySignerAddresses secondary signer addresses for multi-agent transaction
|
|
4679
4743
|
*/
|
|
4680
|
-
interface
|
|
4744
|
+
interface MultiAgentTransaction {
|
|
4681
4745
|
rawTransaction: RawTransaction;
|
|
4682
4746
|
secondarySignerAddresses: AccountAddress[];
|
|
4747
|
+
feePayerAddress?: AccountAddress;
|
|
4683
4748
|
}
|
|
4684
4749
|
/**
|
|
4685
4750
|
* Unified type that holds all the return interfaces when generating different transaction types
|
|
4686
4751
|
*/
|
|
4687
|
-
type AnyRawTransaction =
|
|
4752
|
+
type AnyRawTransaction = SingleSignerTransaction | MultiAgentTransaction;
|
|
4688
4753
|
type InputSimulateTransactionData = {
|
|
4689
4754
|
/**
|
|
4690
4755
|
* The transaction to simulate, probably generated by `generateTransaction()`
|
|
@@ -4714,32 +4779,25 @@ type InputSimulateTransactionOptions = {
|
|
|
4714
4779
|
*/
|
|
4715
4780
|
interface InputGenerateSingleSignerRawTransactionData {
|
|
4716
4781
|
sender: AccountAddressInput;
|
|
4717
|
-
options?: InputGenerateTransactionOptions;
|
|
4718
4782
|
data: InputGenerateTransactionPayloadData;
|
|
4719
|
-
}
|
|
4720
|
-
/**
|
|
4721
|
-
* Interface that holds the user data input when generating a fee payer transaction
|
|
4722
|
-
*/
|
|
4723
|
-
interface InputGenerateFeePayerRawTransactionData {
|
|
4724
|
-
sender: AccountAddressInput;
|
|
4725
|
-
hasFeePayer: true;
|
|
4726
|
-
secondarySignerAddresses?: AccountAddressInput[];
|
|
4727
4783
|
options?: InputGenerateTransactionOptions;
|
|
4728
|
-
|
|
4784
|
+
withFeePayer?: boolean;
|
|
4785
|
+
secondarySignerAddresses?: undefined;
|
|
4729
4786
|
}
|
|
4730
4787
|
/**
|
|
4731
4788
|
* Interface that holds the user data input when generating a multi-agent transaction
|
|
4732
4789
|
*/
|
|
4733
4790
|
interface InputGenerateMultiAgentRawTransactionData {
|
|
4734
4791
|
sender: AccountAddressInput;
|
|
4792
|
+
data: InputGenerateTransactionPayloadData;
|
|
4735
4793
|
secondarySignerAddresses: AccountAddressInput[];
|
|
4736
4794
|
options?: InputGenerateTransactionOptions;
|
|
4737
|
-
|
|
4795
|
+
withFeePayer?: boolean;
|
|
4738
4796
|
}
|
|
4739
4797
|
/**
|
|
4740
4798
|
* Unified type that holds all the user data input interfaces when generating different transaction types
|
|
4741
4799
|
*/
|
|
4742
|
-
type InputGenerateTransactionData =
|
|
4800
|
+
type InputGenerateTransactionData = InputGenerateSingleSignerRawTransactionData | InputGenerateMultiAgentRawTransactionData;
|
|
4743
4801
|
/**
|
|
4744
4802
|
* Interface that holds the user data input when submitting a transaction
|
|
4745
4803
|
*/
|
|
@@ -4772,7 +4830,7 @@ declare class Coin {
|
|
|
4772
4830
|
amount: AnyNumber;
|
|
4773
4831
|
coinType?: MoveStructId;
|
|
4774
4832
|
options?: InputGenerateTransactionOptions;
|
|
4775
|
-
}): Promise<
|
|
4833
|
+
}): Promise<SingleSignerTransaction>;
|
|
4776
4834
|
}
|
|
4777
4835
|
|
|
4778
4836
|
/**
|
|
@@ -4834,7 +4892,7 @@ declare class DigitalAsset {
|
|
|
4834
4892
|
name: string;
|
|
4835
4893
|
uri: string;
|
|
4836
4894
|
options?: InputGenerateTransactionOptions;
|
|
4837
|
-
} & CreateCollectionOptions): Promise<
|
|
4895
|
+
} & CreateCollectionOptions): Promise<SingleSignerTransaction>;
|
|
4838
4896
|
/**
|
|
4839
4897
|
* Queries data of a specific collection by the collection creator address and the collection name.
|
|
4840
4898
|
*
|
|
@@ -4843,15 +4901,15 @@ declare class DigitalAsset {
|
|
|
4843
4901
|
*
|
|
4844
4902
|
* @param args.creatorAddress the address of the collection's creator
|
|
4845
4903
|
* @param args.collectionName the name of the collection
|
|
4904
|
+
* @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying
|
|
4846
4905
|
* @param args.options.tokenStandard the token standard to query
|
|
4847
4906
|
* @returns GetCollectionDataResponse response type
|
|
4848
4907
|
*/
|
|
4849
4908
|
getCollectionData(args: {
|
|
4850
4909
|
creatorAddress: AccountAddressInput;
|
|
4851
4910
|
collectionName: string;
|
|
4852
|
-
|
|
4853
|
-
|
|
4854
|
-
};
|
|
4911
|
+
minimumLedgerVersion?: AnyNumber;
|
|
4912
|
+
options?: TokenStandardArg;
|
|
4855
4913
|
}): Promise<GetCollectionDataResponse>;
|
|
4856
4914
|
/**
|
|
4857
4915
|
* Queries a collection's ID.
|
|
@@ -4861,15 +4919,15 @@ declare class DigitalAsset {
|
|
|
4861
4919
|
*
|
|
4862
4920
|
* @param args.creatorAddress the address of the collection's creator
|
|
4863
4921
|
* @param args.collectionName the name of the collection
|
|
4922
|
+
* @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying
|
|
4864
4923
|
* @param args.options.tokenStandard the token standard to query
|
|
4865
4924
|
* @returns the collection id
|
|
4866
4925
|
*/
|
|
4867
4926
|
getCollectionId(args: {
|
|
4868
4927
|
creatorAddress: AccountAddressInput;
|
|
4869
4928
|
collectionName: string;
|
|
4870
|
-
|
|
4871
|
-
|
|
4872
|
-
};
|
|
4929
|
+
minimumLedgerVersion?: AnyNumber;
|
|
4930
|
+
options?: TokenStandardArg;
|
|
4873
4931
|
}): Promise<string>;
|
|
4874
4932
|
/**
|
|
4875
4933
|
* Create a transaction to mint a token into the creators account within an existing collection.
|
|
@@ -4889,50 +4947,52 @@ declare class DigitalAsset {
|
|
|
4889
4947
|
name: string;
|
|
4890
4948
|
uri: string;
|
|
4891
4949
|
options?: InputGenerateTransactionOptions;
|
|
4892
|
-
}): Promise<
|
|
4950
|
+
}): Promise<SingleSignerTransaction>;
|
|
4893
4951
|
/**
|
|
4894
4952
|
* Gets token data given the address of a token.
|
|
4895
4953
|
*
|
|
4896
4954
|
* @param args.tokenAddress The address of the token
|
|
4955
|
+
* @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying
|
|
4897
4956
|
* @returns GetTokenDataResponse containing relevant data to the token.
|
|
4898
4957
|
*/
|
|
4899
4958
|
getTokenData(args: {
|
|
4900
4959
|
tokenAddress: AccountAddressInput;
|
|
4960
|
+
minimumLedgerVersion?: AnyNumber;
|
|
4901
4961
|
}): Promise<GetTokenDataResponse>;
|
|
4902
4962
|
/**
|
|
4903
4963
|
* Gets token ownership data given the address of a token.
|
|
4904
4964
|
*
|
|
4905
4965
|
* @param args.tokenAddress The address of the token
|
|
4966
|
+
* @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying
|
|
4906
4967
|
* @returns GetCurrentTokenOwnershipResponse containing relevant ownership data of the token.
|
|
4907
4968
|
*/
|
|
4908
4969
|
getCurrentTokenOwnership(args: {
|
|
4909
4970
|
tokenAddress: AccountAddressInput;
|
|
4971
|
+
minimumLedgerVersion?: AnyNumber;
|
|
4910
4972
|
}): Promise<GetCurrentTokenOwnershipResponse>;
|
|
4911
4973
|
/**
|
|
4912
4974
|
* Gets the tokens that the given address owns.
|
|
4913
4975
|
*
|
|
4914
4976
|
* @param args.ownerAddress The address of the owner
|
|
4977
|
+
* @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying
|
|
4915
4978
|
* @returns GetOwnedTokensResponse containing ownership data of the tokens belonging to the ownerAddresss.
|
|
4916
4979
|
*/
|
|
4917
4980
|
getOwnedTokens(args: {
|
|
4918
4981
|
ownerAddress: AccountAddressInput;
|
|
4919
|
-
|
|
4920
|
-
|
|
4921
|
-
orderBy?: OrderBy<GetOwnedTokensResponse[0]>;
|
|
4922
|
-
};
|
|
4982
|
+
minimumLedgerVersion?: AnyNumber;
|
|
4983
|
+
options?: PaginationArgs & OrderByArg<GetOwnedTokensResponse[0]>;
|
|
4923
4984
|
}): Promise<GetOwnedTokensResponse>;
|
|
4924
4985
|
/**
|
|
4925
4986
|
* Gets the activity data given the address of a token.
|
|
4926
4987
|
*
|
|
4927
4988
|
* @param args.tokenAddress The address of the token
|
|
4989
|
+
* @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying
|
|
4928
4990
|
* @returns GetTokenActivityResponse containing relevant activity data to the token.
|
|
4929
4991
|
*/
|
|
4930
4992
|
getTokenActivity(args: {
|
|
4931
4993
|
tokenAddress: AccountAddressInput;
|
|
4932
|
-
|
|
4933
|
-
|
|
4934
|
-
orderBy?: OrderBy<GetTokenActivityResponse[0]>;
|
|
4935
|
-
};
|
|
4994
|
+
minimumLedgerVersion?: AnyNumber;
|
|
4995
|
+
options?: PaginationArgs & OrderByArg<GetTokenActivityResponse[0]>;
|
|
4936
4996
|
}): Promise<GetTokenActivityResponse>;
|
|
4937
4997
|
}
|
|
4938
4998
|
|
|
@@ -4947,34 +5007,35 @@ declare class Event {
|
|
|
4947
5007
|
*
|
|
4948
5008
|
* @param args.accountAddress - The account address
|
|
4949
5009
|
* @param args.creationNumber - The event creation number
|
|
5010
|
+
* @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying
|
|
4950
5011
|
*
|
|
4951
5012
|
* @returns Promise<GetEventsResponse>
|
|
4952
5013
|
*/
|
|
4953
5014
|
getAccountEventsByCreationNumber(args: {
|
|
4954
5015
|
accountAddress: AccountAddressInput;
|
|
4955
5016
|
creationNumber: AnyNumber;
|
|
5017
|
+
minimumLedgerVersion?: AnyNumber;
|
|
4956
5018
|
}): Promise<GetEventsResponse>;
|
|
4957
5019
|
/**
|
|
4958
5020
|
* Get events by event type and an account address
|
|
4959
5021
|
*
|
|
4960
5022
|
* @param args.accountAddress - The account address
|
|
4961
5023
|
* @param args.eventType - The event type
|
|
5024
|
+
* @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying
|
|
4962
5025
|
*
|
|
4963
5026
|
* @returns Promise<GetEventsResponse>
|
|
4964
5027
|
*/
|
|
4965
5028
|
getAccountEventsByEventType(args: {
|
|
4966
5029
|
accountAddress: AccountAddressInput;
|
|
4967
5030
|
eventType: MoveStructId;
|
|
4968
|
-
|
|
4969
|
-
|
|
4970
|
-
orderBy?: OrderBy<GetEventsResponse[0]>;
|
|
4971
|
-
};
|
|
5031
|
+
minimumLedgerVersion?: AnyNumber;
|
|
5032
|
+
options?: PaginationArgs & OrderByArg<GetEventsResponse[0]>;
|
|
4972
5033
|
}): Promise<GetEventsResponse>;
|
|
4973
5034
|
/**
|
|
4974
5035
|
* Get all events
|
|
4975
5036
|
*
|
|
4976
5037
|
* An optional `where` can be passed in to filter out the response.
|
|
4977
|
-
|
|
5038
|
+
*@param args.minimumLedgerVersion Optional ledger version to sync up to, before querying
|
|
4978
5039
|
* @example
|
|
4979
5040
|
* ```
|
|
4980
5041
|
* { where:
|
|
@@ -4987,11 +5048,8 @@ declare class Event {
|
|
|
4987
5048
|
* @returns GetEventsQuery response type
|
|
4988
5049
|
*/
|
|
4989
5050
|
getEvents(args?: {
|
|
4990
|
-
|
|
4991
|
-
|
|
4992
|
-
pagination?: PaginationArgs;
|
|
4993
|
-
orderBy?: OrderBy<GetEventsResponse[0]>;
|
|
4994
|
-
};
|
|
5051
|
+
minimumLedgerVersion?: AnyNumber;
|
|
5052
|
+
options?: PaginationArgs & OrderByArg<GetEventsResponse[0]> & WhereArg<EventsBoolExp>;
|
|
4995
5053
|
}): Promise<GetEventsResponse>;
|
|
4996
5054
|
}
|
|
4997
5055
|
|
|
@@ -5014,8 +5072,185 @@ declare class Faucet {
|
|
|
5014
5072
|
accountAddress: AccountAddressInput;
|
|
5015
5073
|
amount: number;
|
|
5016
5074
|
options?: WaitForTransactionOptions;
|
|
5017
|
-
}): Promise<
|
|
5075
|
+
}): Promise<UserTransactionResponse>;
|
|
5076
|
+
}
|
|
5077
|
+
|
|
5078
|
+
declare function isBool(arg: SimpleEntryFunctionArgumentTypes): arg is boolean;
|
|
5079
|
+
declare function isString(arg: any): arg is string;
|
|
5080
|
+
declare function isNumber(arg: SimpleEntryFunctionArgumentTypes): arg is number;
|
|
5081
|
+
declare function isLargeNumber(arg: SimpleEntryFunctionArgumentTypes): arg is number | bigint | string;
|
|
5082
|
+
declare function isNull(arg: SimpleEntryFunctionArgumentTypes): arg is null | undefined;
|
|
5083
|
+
declare function isEncodedEntryFunctionArgument(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes): arg is EntryFunctionArgumentTypes;
|
|
5084
|
+
declare function isBcsBool(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes): arg is Bool;
|
|
5085
|
+
declare function isBcsAddress(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes): arg is AccountAddress;
|
|
5086
|
+
declare function isBcsString(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes): arg is MoveString;
|
|
5087
|
+
declare function isBcsFixedBytes(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes): arg is FixedBytes;
|
|
5088
|
+
declare function isBcsU8(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes): arg is U8;
|
|
5089
|
+
declare function isBcsU16(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes): arg is U16;
|
|
5090
|
+
declare function isBcsU32(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes): arg is U32;
|
|
5091
|
+
declare function isBcsU64(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes): arg is U64;
|
|
5092
|
+
declare function isBcsU128(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes): arg is U128;
|
|
5093
|
+
declare function isBcsU256(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes): arg is U256;
|
|
5094
|
+
declare function isScriptDataInput(arg: InputGenerateTransactionPayloadDataWithRemoteABI | InputGenerateTransactionPayloadData): arg is InputScriptData;
|
|
5095
|
+
declare function throwTypeMismatch(expectedType: string, position: number): void;
|
|
5096
|
+
/**
|
|
5097
|
+
* Finds first non-signer arg.
|
|
5098
|
+
*
|
|
5099
|
+
* A function is often defined with a `signer` or `&signer` arguments at the start, which are filled in
|
|
5100
|
+
* by signatures, and not by the caller.
|
|
5101
|
+
* @param functionAbi
|
|
5102
|
+
*/
|
|
5103
|
+
declare function findFirstNonSignerArg(functionAbi: MoveFunction): number;
|
|
5104
|
+
declare function getFunctionParts(functionArg: MoveFunctionId): {
|
|
5105
|
+
moduleAddress: string;
|
|
5106
|
+
moduleName: string;
|
|
5107
|
+
functionName: string;
|
|
5108
|
+
};
|
|
5109
|
+
|
|
5110
|
+
/**
|
|
5111
|
+
* We are defining function signatures, each with its specific input and output.
|
|
5112
|
+
* These are the possible function signature for our `generateTransactionPayload` function.
|
|
5113
|
+
* When we call our `generateTransactionPayload` function with the relevant type properties,
|
|
5114
|
+
* Typescript can infer the return type based on the appropriate function overload.
|
|
5115
|
+
*/
|
|
5116
|
+
declare function generateTransactionPayload(args: InputScriptData): Promise<TransactionPayloadScript>;
|
|
5117
|
+
declare function generateTransactionPayload(args: InputEntryFunctionDataWithRemoteABI): Promise<TransactionPayloadEntryFunction>;
|
|
5118
|
+
declare function generateTransactionPayload(args: InputMultiSigDataWithRemoteABI): Promise<TransactionPayloadMultisig>;
|
|
5119
|
+
declare function generateTransactionPayloadWithABI(args: InputEntryFunctionData, functionAbi: EntryFunctionABI): TransactionPayloadEntryFunction;
|
|
5120
|
+
declare function generateTransactionPayloadWithABI(args: InputMultiSigData, functionAbi: EntryFunctionABI): TransactionPayloadMultisig;
|
|
5121
|
+
/**
|
|
5122
|
+
* Generates a raw transaction
|
|
5123
|
+
*
|
|
5124
|
+
* @param args.aptosConfig AptosConfig
|
|
5125
|
+
* @param args.sender The transaction's sender account address as a hex input
|
|
5126
|
+
* @param args.payload The transaction payload - can create by using generateTransactionPayload()
|
|
5127
|
+
*
|
|
5128
|
+
* @returns RawTransaction
|
|
5129
|
+
*/
|
|
5130
|
+
declare function generateRawTransaction(args: {
|
|
5131
|
+
aptosConfig: AptosConfig;
|
|
5132
|
+
sender: AccountAddressInput;
|
|
5133
|
+
payload: AnyTransactionPayloadInstance;
|
|
5134
|
+
options?: InputGenerateTransactionOptions;
|
|
5135
|
+
}): Promise<RawTransaction>;
|
|
5136
|
+
/**
|
|
5137
|
+
* We are defining function signatures, each with its specific input and output.
|
|
5138
|
+
* These are the possible function signature for our `generateTransaction` function.
|
|
5139
|
+
* When we call our `generateTransaction` function with the relevant type properties,
|
|
5140
|
+
* Typescript can infer the return type based on the appropriate function overload.
|
|
5141
|
+
*/
|
|
5142
|
+
declare function buildTransaction(args: InputGenerateSingleSignerRawTransactionArgs): Promise<SingleSignerTransaction>;
|
|
5143
|
+
declare function buildTransaction(args: InputGenerateMultiAgentRawTransactionArgs): Promise<MultiAgentTransaction>;
|
|
5144
|
+
/**
|
|
5145
|
+
* Simulate a transaction before signing and submit to chain
|
|
5146
|
+
*
|
|
5147
|
+
* @param args.transaction A aptos transaction type to sign
|
|
5148
|
+
* @param args.signerPublicKey The signer public key
|
|
5149
|
+
* @param args.secondarySignersPublicKeys optional. The secondary signers public keys if multi signers transaction
|
|
5150
|
+
* @param args.feePayerPublicKey optional. The fee payer public key is a fee payer (aka sponsored) transaction
|
|
5151
|
+
* @param args.options optional. SimulateTransactionOptions
|
|
5152
|
+
*
|
|
5153
|
+
* @returns A signed serialized transaction that can be simulated
|
|
5154
|
+
*/
|
|
5155
|
+
declare function generateSignedTransactionForSimulation(args: InputSimulateTransactionData): Uint8Array;
|
|
5156
|
+
declare function getAuthenticatorForSimulation(publicKey: PublicKey): AccountAuthenticatorEd25519 | AccountAuthenticatorSingleKey;
|
|
5157
|
+
/**
|
|
5158
|
+
* Sign a transaction that can later be submitted to chain
|
|
5159
|
+
*
|
|
5160
|
+
* @param args.signer The signer account to sign the transaction
|
|
5161
|
+
* @param args.transaction A aptos transaction type to sign
|
|
5162
|
+
*
|
|
5163
|
+
* @return The signer AccountAuthenticator
|
|
5164
|
+
*/
|
|
5165
|
+
declare function sign(args: {
|
|
5166
|
+
signer: Account$1;
|
|
5167
|
+
transaction: AnyRawTransaction;
|
|
5168
|
+
}): AccountAuthenticator;
|
|
5169
|
+
/**
|
|
5170
|
+
* Prepare a transaction to be submitted to chain
|
|
5171
|
+
*
|
|
5172
|
+
* @param args.transaction A aptos transaction type
|
|
5173
|
+
* @param args.senderAuthenticator The account authenticator of the transaction sender
|
|
5174
|
+
* @param args.secondarySignerAuthenticators optional. For when the transaction is a multi signers transaction
|
|
5175
|
+
*
|
|
5176
|
+
* @returns A SignedTransaction
|
|
5177
|
+
*/
|
|
5178
|
+
declare function generateSignedTransaction(args: InputSubmitTransactionData): Uint8Array;
|
|
5179
|
+
/**
|
|
5180
|
+
* Derive the raw transaction type - FeePayerRawTransaction or MultiAgentRawTransaction or RawTransaction
|
|
5181
|
+
*
|
|
5182
|
+
* @param transaction A aptos transaction type
|
|
5183
|
+
*
|
|
5184
|
+
* @returns FeePayerRawTransaction | MultiAgentRawTransaction | RawTransaction
|
|
5185
|
+
*/
|
|
5186
|
+
declare function deriveTransactionType(transaction: AnyRawTransaction): AnyRawTransactionInstance;
|
|
5187
|
+
/**
|
|
5188
|
+
* Generate a multi signers signed transaction that can be submitted to chain
|
|
5189
|
+
*
|
|
5190
|
+
* @param transaction MultiAgentRawTransaction | FeePayerRawTransaction
|
|
5191
|
+
* @param senderAuthenticator The account authenticator of the transaction sender
|
|
5192
|
+
* @param secondarySignerAuthenticators The extra signers account Authenticators
|
|
5193
|
+
*
|
|
5194
|
+
* @returns A SignedTransaction
|
|
5195
|
+
*/
|
|
5196
|
+
declare function generateMultiSignersSignedTransaction(transaction: MultiAgentRawTransaction | FeePayerRawTransaction, senderAuthenticator: AccountAuthenticator, feePayerAuthenticator?: AccountAuthenticator, additionalSignersAuthenticators?: Array<AccountAuthenticator>): Uint8Array;
|
|
5197
|
+
declare function generateSigningMessage(transaction: AnyRawTransaction): Uint8Array;
|
|
5198
|
+
|
|
5199
|
+
/**
|
|
5200
|
+
* Convert type arguments to only type tags, allowing for string representations of type tags
|
|
5201
|
+
*/
|
|
5202
|
+
declare function standardizeTypeTags(typeArguments?: Array<TypeTag | string>): Array<TypeTag>;
|
|
5203
|
+
/**
|
|
5204
|
+
* Fetches the ABI for an entry function from the module
|
|
5205
|
+
*
|
|
5206
|
+
* @param moduleAddress
|
|
5207
|
+
* @param moduleName
|
|
5208
|
+
* @param functionName
|
|
5209
|
+
* @param aptosConfig
|
|
5210
|
+
*/
|
|
5211
|
+
declare function fetchEntryFunctionAbi(moduleAddress: string, moduleName: string, functionName: string, aptosConfig: AptosConfig): Promise<EntryFunctionABI>;
|
|
5212
|
+
/**
|
|
5213
|
+
* Converts a non-BCS encoded argument into BCS encoded, if necessary
|
|
5214
|
+
* @param functionName
|
|
5215
|
+
* @param functionAbi
|
|
5216
|
+
* @param arg
|
|
5217
|
+
* @param position
|
|
5218
|
+
*/
|
|
5219
|
+
declare function convertArgument(functionName: string, functionAbi: EntryFunctionABI, arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes, position: number, genericTypeParams: Array<TypeTag>): EntryFunctionArgumentTypes;
|
|
5220
|
+
declare function checkOrConvertArgument(arg: SimpleEntryFunctionArgumentTypes | EntryFunctionArgumentTypes, param: TypeTag, position: number, genericTypeParams: Array<TypeTag>): EntryFunctionArgumentTypes;
|
|
5221
|
+
|
|
5222
|
+
declare enum TypeTagParserErrorType {
|
|
5223
|
+
InvalidTypeTag = "unknown type",
|
|
5224
|
+
UnexpectedGenericType = "unexpected generic type",
|
|
5225
|
+
UnexpectedTypeArgumentClose = "unexpected '>'",
|
|
5226
|
+
UnexpectedWhitespaceCharacter = "unexpected whitespace character",
|
|
5227
|
+
UnexpectedComma = "unexpected ','",
|
|
5228
|
+
TypeArgumentCountMismatch = "type argument count doesn't match expected amount",
|
|
5229
|
+
MissingTypeArgumentClose = "no matching '>' for '<'",
|
|
5230
|
+
UnexpectedPrimitiveTypeArguments = "primitive types not expected to have type arguments",
|
|
5231
|
+
UnexpectedVectorTypeArgumentCount = "vector type expected to have exactly one type argument",
|
|
5232
|
+
UnexpectedStructFormat = "unexpected struct format, must be of the form 0xaddress::module_name::struct_name",
|
|
5233
|
+
InvalidModuleNameCharacter = "module name must only contain alphanumeric or '_' characters",
|
|
5234
|
+
InvalidStructNameCharacter = "struct name must only contain alphanumeric or '_' characters"
|
|
5018
5235
|
}
|
|
5236
|
+
declare class TypeTagParserError extends Error {
|
|
5237
|
+
constructor(typeTagStr: string, invalidReason: TypeTagParserErrorType);
|
|
5238
|
+
}
|
|
5239
|
+
/**
|
|
5240
|
+
* All types are made of a few parts they're either:
|
|
5241
|
+
* 1. A simple type e.g. u8
|
|
5242
|
+
* 2. A standalone struct e.g. 0x1::account::Account
|
|
5243
|
+
* 3. A nested struct e.g. 0x1::coin::Coin<0x1234::coin::MyCoin>
|
|
5244
|
+
*
|
|
5245
|
+
* There are a few more special cases that need to be handled, however.
|
|
5246
|
+
* 1. Multiple generics e.g 0x1::pair::Pair<u8, u16>
|
|
5247
|
+
* 2. Spacing in the generics e.g. 0x1::pair::Pair< u8 , u16>
|
|
5248
|
+
* 3. Nested generics of different depths e.g. 0x1::pair::Pair<0x1::coin::Coin<0x1234::coin::MyCoin>, u8>
|
|
5249
|
+
* 4. Generics for types in ABIs are filled in with placeholders e.g T1, T2, T3
|
|
5250
|
+
*/
|
|
5251
|
+
declare function parseTypeTag(typeStr: string, options?: {
|
|
5252
|
+
allowGenerics?: boolean;
|
|
5253
|
+
}): TypeTag;
|
|
5019
5254
|
|
|
5020
5255
|
/**
|
|
5021
5256
|
* A class to query all `FungibleAsset` related queries on Aptos.
|
|
@@ -5024,60 +5259,75 @@ declare class FungibleAsset {
|
|
|
5024
5259
|
readonly config: AptosConfig;
|
|
5025
5260
|
constructor(config: AptosConfig);
|
|
5026
5261
|
/**
|
|
5027
|
-
* Queries
|
|
5262
|
+
* Queries all fungible asset metadata.
|
|
5028
5263
|
*
|
|
5029
|
-
*
|
|
5030
|
-
* It can be filtered by creator address and asset type.
|
|
5264
|
+
* @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying
|
|
5031
5265
|
*
|
|
5032
|
-
* @returns
|
|
5266
|
+
* @returns A list of fungible asset metadata
|
|
5033
5267
|
*/
|
|
5034
5268
|
getFungibleAssetMetadata(args?: {
|
|
5035
|
-
|
|
5036
|
-
|
|
5037
|
-
where?: FungibleAssetMetadataBoolExp;
|
|
5038
|
-
};
|
|
5269
|
+
minimumLedgerVersion?: AnyNumber;
|
|
5270
|
+
options?: PaginationArgs & WhereArg<FungibleAssetMetadataBoolExp>;
|
|
5039
5271
|
}): Promise<GetFungibleAssetMetadataResponse>;
|
|
5040
5272
|
/**
|
|
5041
|
-
* Queries
|
|
5273
|
+
* Queries a fungible asset metadata
|
|
5042
5274
|
*
|
|
5043
5275
|
* This query returns the fungible asset metadata for a specific fungible asset.
|
|
5044
5276
|
*
|
|
5045
|
-
* @param
|
|
5277
|
+
* @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying
|
|
5278
|
+
* @param args.assetType The asset type of the fungible asset.
|
|
5046
5279
|
* e.g
|
|
5047
5280
|
* "0x1::aptos_coin::AptosCoin" for Aptos Coin
|
|
5048
5281
|
* "0xc2948283c2ce03aafbb294821de7ee684b06116bb378ab614fa2de07a99355a8" - address format if this is fungible asset
|
|
5049
5282
|
*
|
|
5050
|
-
* @returns
|
|
5283
|
+
* @returns A fungible asset metadata item
|
|
5051
5284
|
*/
|
|
5052
|
-
getFungibleAssetMetadataByAssetType(
|
|
5285
|
+
getFungibleAssetMetadataByAssetType(args: {
|
|
5286
|
+
assetType: string;
|
|
5287
|
+
minimumLedgerVersion?: AnyNumber;
|
|
5288
|
+
}): Promise<GetFungibleAssetMetadataResponse[0]>;
|
|
5053
5289
|
/**
|
|
5054
|
-
* Queries
|
|
5290
|
+
* Queries all fungible asset activities
|
|
5055
5291
|
*
|
|
5056
|
-
*
|
|
5057
|
-
* It can be filtered by owner address, asset type, and type.
|
|
5292
|
+
* @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying
|
|
5058
5293
|
*
|
|
5059
|
-
* @returns
|
|
5294
|
+
* @returns A list of fungible asset metadata
|
|
5060
5295
|
*/
|
|
5061
5296
|
getFungibleAssetActivities(args?: {
|
|
5062
|
-
|
|
5063
|
-
|
|
5064
|
-
where?: FungibleAssetActivitiesBoolExp;
|
|
5065
|
-
};
|
|
5297
|
+
minimumLedgerVersion?: AnyNumber;
|
|
5298
|
+
options?: PaginationArgs & WhereArg<FungibleAssetActivitiesBoolExp>;
|
|
5066
5299
|
}): Promise<GetFungibleAssetActivitiesResponse>;
|
|
5067
5300
|
/**
|
|
5068
|
-
* Queries
|
|
5301
|
+
* Queries all fungible asset balances
|
|
5069
5302
|
*
|
|
5070
|
-
*
|
|
5071
|
-
* It can be filtered by owner address, and asset type
|
|
5303
|
+
* @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying
|
|
5072
5304
|
*
|
|
5073
|
-
* @returns
|
|
5305
|
+
* @returns A list of fungible asset metadata
|
|
5074
5306
|
*/
|
|
5075
5307
|
getCurrentFungibleAssetBalances(args?: {
|
|
5076
|
-
|
|
5077
|
-
|
|
5078
|
-
where?: CurrentFungibleAssetBalancesBoolExp;
|
|
5079
|
-
};
|
|
5308
|
+
minimumLedgerVersion?: AnyNumber;
|
|
5309
|
+
options?: PaginationArgs & WhereArg<CurrentFungibleAssetBalancesBoolExp>;
|
|
5080
5310
|
}): Promise<GetCurrentFungibleAssetBalancesResponse>;
|
|
5311
|
+
/**
|
|
5312
|
+
* Transfer `amount` of fungible asset from sender's primary store to recipient's primary store.
|
|
5313
|
+
*
|
|
5314
|
+
* Use this method to transfer any fungible asset including fungible token.
|
|
5315
|
+
*
|
|
5316
|
+
* @param sender The sender account
|
|
5317
|
+
* @param fungibleAssetMetadataAddress The fungible asset account address.
|
|
5318
|
+
* For example if you’re transferring USDT this would be the USDT address
|
|
5319
|
+
* @param recipient The recipient account address
|
|
5320
|
+
* @param amount Number of assets to transfer
|
|
5321
|
+
*
|
|
5322
|
+
* @returns A SingleSignerTransaction that can be simulated or submitted to chain.
|
|
5323
|
+
*/
|
|
5324
|
+
transferFungibleAsset(args: {
|
|
5325
|
+
sender: Account$1;
|
|
5326
|
+
fungibleAssetMetadataAddress: AccountAddress;
|
|
5327
|
+
recipient: AccountAddress;
|
|
5328
|
+
amount: AnyNumber;
|
|
5329
|
+
options?: InputGenerateTransactionOptions;
|
|
5330
|
+
}): Promise<SingleSignerTransaction>;
|
|
5081
5331
|
}
|
|
5082
5332
|
|
|
5083
5333
|
/**
|
|
@@ -5160,7 +5410,7 @@ declare class General {
|
|
|
5160
5410
|
getTableItem<T>(args: {
|
|
5161
5411
|
handle: string;
|
|
5162
5412
|
data: TableItemRequest;
|
|
5163
|
-
options?:
|
|
5413
|
+
options?: LedgerVersionArg;
|
|
5164
5414
|
}): Promise<T>;
|
|
5165
5415
|
/**
|
|
5166
5416
|
* Queries for a Move view function
|
|
@@ -5179,7 +5429,7 @@ declare class General {
|
|
|
5179
5429
|
*/
|
|
5180
5430
|
view<T extends Array<MoveValue>>(args: {
|
|
5181
5431
|
payload: InputViewRequestData;
|
|
5182
|
-
options?:
|
|
5432
|
+
options?: LedgerVersionArg;
|
|
5183
5433
|
}): Promise<T>;
|
|
5184
5434
|
/**
|
|
5185
5435
|
* Queries top user transactions
|
|
@@ -5219,6 +5469,13 @@ declare class General {
|
|
|
5219
5469
|
* This is useful to tell what ledger version the indexer is updated to, as it can be behind the full nodes.
|
|
5220
5470
|
*/
|
|
5221
5471
|
getIndexerLastSuccessVersion(): Promise<number>;
|
|
5472
|
+
/**
|
|
5473
|
+
* Query the processor status for a specific processor type.
|
|
5474
|
+
*
|
|
5475
|
+
* @param processorType The processor type to query
|
|
5476
|
+
* @returns
|
|
5477
|
+
*/
|
|
5478
|
+
getProcessorStatus(processorType: ProcessorType): Promise<GetProcessorStatusResponse[0]>;
|
|
5222
5479
|
}
|
|
5223
5480
|
|
|
5224
5481
|
/**
|
|
@@ -5234,18 +5491,33 @@ interface RegisterNameParameters {
|
|
|
5234
5491
|
name: string;
|
|
5235
5492
|
expiration: {
|
|
5236
5493
|
policy: "domain";
|
|
5237
|
-
years
|
|
5494
|
+
years?: 1;
|
|
5238
5495
|
} | {
|
|
5239
5496
|
policy: "subdomain:follow-domain";
|
|
5240
5497
|
} | {
|
|
5241
5498
|
policy: "subdomain:independent";
|
|
5242
|
-
expirationDate:
|
|
5499
|
+
expirationDate: number;
|
|
5243
5500
|
};
|
|
5244
5501
|
transferable?: boolean;
|
|
5245
|
-
toAddress?:
|
|
5246
|
-
targetAddress?:
|
|
5502
|
+
toAddress?: AccountAddressInput;
|
|
5503
|
+
targetAddress?: AccountAddressInput;
|
|
5247
5504
|
options?: InputGenerateTransactionOptions;
|
|
5248
5505
|
}
|
|
5506
|
+
interface QueryNamesOptions {
|
|
5507
|
+
options?: PaginationArgs & OrderByArg<GetANSNameResponse[0]> & WhereArg<CurrentAptosNamesBoolExp>;
|
|
5508
|
+
}
|
|
5509
|
+
interface GetAccountNamesArgs extends QueryNamesOptions {
|
|
5510
|
+
accountAddress: AccountAddressInput;
|
|
5511
|
+
}
|
|
5512
|
+
interface GetAccountDomainsArgs extends QueryNamesOptions {
|
|
5513
|
+
accountAddress: AccountAddressInput;
|
|
5514
|
+
}
|
|
5515
|
+
interface GetAccountSubdomainsArgs extends QueryNamesOptions {
|
|
5516
|
+
accountAddress: AccountAddressInput;
|
|
5517
|
+
}
|
|
5518
|
+
interface GetDomainSubdomainsArgs extends QueryNamesOptions {
|
|
5519
|
+
domain: string;
|
|
5520
|
+
}
|
|
5249
5521
|
|
|
5250
5522
|
/**
|
|
5251
5523
|
* A class to handle all `ANS` operations
|
|
@@ -5254,11 +5526,12 @@ declare class ANS {
|
|
|
5254
5526
|
readonly config: AptosConfig;
|
|
5255
5527
|
constructor(config: AptosConfig);
|
|
5256
5528
|
/**
|
|
5257
|
-
* Retrieve the owner address of a domain name or subdomain name.
|
|
5529
|
+
* Retrieve the owner address of a domain name or subdomain name from the contract.
|
|
5258
5530
|
*
|
|
5259
5531
|
* ```ts
|
|
5260
|
-
* getOwnerAddress({name: "test.aptos"})
|
|
5261
5532
|
* // Will return the owner address of "test.aptos.apt" or undefined
|
|
5533
|
+
* const owner = await aptos.getOwnerAddress({name: "test.aptos"})
|
|
5534
|
+
* // owner = 0x123...
|
|
5262
5535
|
* ```
|
|
5263
5536
|
*
|
|
5264
5537
|
* @param args.name - A string of the name to retrieve
|
|
@@ -5269,26 +5542,220 @@ declare class ANS {
|
|
|
5269
5542
|
name: string;
|
|
5270
5543
|
}): Promise<MoveAddressType | undefined>;
|
|
5271
5544
|
/**
|
|
5272
|
-
*
|
|
5545
|
+
* Retrieve the expiration time of a domain name or subdomain name from the contract.
|
|
5273
5546
|
*
|
|
5274
|
-
*
|
|
5275
|
-
*
|
|
5276
|
-
*
|
|
5277
|
-
*
|
|
5278
|
-
*
|
|
5279
|
-
*
|
|
5280
|
-
*
|
|
5281
|
-
*
|
|
5282
|
-
*
|
|
5283
|
-
|
|
5547
|
+
* ```ts
|
|
5548
|
+
* // Will return the expiration of "test.aptos.apt" or undefined
|
|
5549
|
+
* const exp = await aptos.getExpiration({name: "test.aptos"})
|
|
5550
|
+
* // new Date(exp) would give you the date in question: 2021-01-01T00:00:00.000Z
|
|
5551
|
+
* ```
|
|
5552
|
+
*
|
|
5553
|
+
* @param args.name - A string of the name to retrieve
|
|
5554
|
+
*
|
|
5555
|
+
* @returns number as a unix timestamp in milliseconds.
|
|
5556
|
+
*/
|
|
5557
|
+
getExpiration(args: {
|
|
5558
|
+
name: string;
|
|
5559
|
+
}): Promise<number | undefined>;
|
|
5560
|
+
/**
|
|
5561
|
+
* Retrieve the target address of a domain or subdomain name. This is the
|
|
5562
|
+
* address the name points to for use on chain. Note, the target address can
|
|
5563
|
+
* point to addresses that are not the owner of the name
|
|
5564
|
+
*
|
|
5565
|
+
* ```ts
|
|
5566
|
+
* const targetAddr = await aptos.getTargetAddress({name: "test.aptos"})
|
|
5567
|
+
* // targetAddr = 0x123...
|
|
5568
|
+
* ```
|
|
5569
|
+
*
|
|
5570
|
+
* @param args.name - A string of the name: primary, primary.apt, secondary.primary, secondary.primary.apt, etc.
|
|
5571
|
+
*
|
|
5572
|
+
* @returns MoveAddressType if the name has a target, undefined otherwise
|
|
5573
|
+
*/
|
|
5574
|
+
getTargetAddress(args: {
|
|
5575
|
+
name: string;
|
|
5576
|
+
}): Promise<MoveAddressType | undefined>;
|
|
5577
|
+
/**
|
|
5578
|
+
* Sets the target address of a domain or subdomain name. This is the
|
|
5579
|
+
* address the name points to for use on chain. Note, the target address can
|
|
5580
|
+
* point to addresses that are not the owner of the name
|
|
5581
|
+
*
|
|
5582
|
+
* ```ts
|
|
5583
|
+
* await aptos.setTargetAddress({sender: alice, name: "test.aptos", address: bob.accountAddress})
|
|
5584
|
+
* const address = await aptos.getTargetAddress({name: "test.aptos"})
|
|
5585
|
+
* // address = bob.accountAddress
|
|
5586
|
+
* ```
|
|
5587
|
+
*
|
|
5588
|
+
* @param args.name - A string of the name: test.aptos.apt, test.apt, test, test.aptos, etc.
|
|
5589
|
+
* @param args.address - A AccountAddressInput of the address to set the domain or subdomain to
|
|
5590
|
+
*
|
|
5591
|
+
* @returns SingleSignerTransaction
|
|
5592
|
+
*/
|
|
5593
|
+
setTargetAddress(args: {
|
|
5594
|
+
sender: Account$1;
|
|
5595
|
+
name: string;
|
|
5596
|
+
address: AccountAddressInput;
|
|
5597
|
+
options?: InputGenerateTransactionOptions;
|
|
5598
|
+
}): Promise<SingleSignerTransaction>;
|
|
5599
|
+
/**
|
|
5600
|
+
* Retrieve the primary name for an account. An account can have
|
|
5601
|
+
* multiple names that target it, but only a single name that is primary. An
|
|
5602
|
+
* account also may not have a primary name.
|
|
5603
|
+
*
|
|
5604
|
+
* ```ts
|
|
5605
|
+
* const name = await aptos.getPrimaryName({address: alice.accountAddress})
|
|
5606
|
+
* // name = test.aptos
|
|
5607
|
+
* ```
|
|
5608
|
+
*
|
|
5609
|
+
* @param args.address - A AccountAddressInput (address) of the account
|
|
5610
|
+
*
|
|
5611
|
+
* @returns a string if the account has a primary name, undefined otherwise
|
|
5612
|
+
*/
|
|
5613
|
+
getPrimaryName(args: {
|
|
5614
|
+
address: AccountAddressInput;
|
|
5615
|
+
}): Promise<string | undefined>;
|
|
5616
|
+
/**
|
|
5617
|
+
* Sets the primary name for the sender. An account can have
|
|
5618
|
+
* multiple names that target it, but only a single name that is primary. An
|
|
5619
|
+
* account also may not have a primary name.
|
|
5620
|
+
*
|
|
5621
|
+
* ```ts
|
|
5622
|
+
* await aptos.setPrimaryName({sender: alice, name: "test.aptos"})
|
|
5623
|
+
* const primaryName = await aptos.getPrimaryName({address: alice.accountAddress})
|
|
5624
|
+
* // primaryName = test.aptos
|
|
5625
|
+
* ```
|
|
5626
|
+
*
|
|
5627
|
+
* @param args.sender - The sender account
|
|
5628
|
+
* @param args.name - A string of the name: test, test.apt, test.aptos, test.aptos.apt, etc.
|
|
5629
|
+
*
|
|
5630
|
+
* @returns SingleSignerTransaction
|
|
5631
|
+
*/
|
|
5632
|
+
setPrimaryName(args: {
|
|
5633
|
+
sender: Account$1;
|
|
5634
|
+
name?: string;
|
|
5635
|
+
options?: InputGenerateTransactionOptions;
|
|
5636
|
+
}): Promise<SingleSignerTransaction>;
|
|
5637
|
+
/**
|
|
5638
|
+
* Registers a new name
|
|
5639
|
+
*
|
|
5640
|
+
* ```ts
|
|
5641
|
+
* // An example of registering a subdomain name assuming def.apt is already registered
|
|
5642
|
+
* // and belongs to the sender alice.
|
|
5643
|
+
* const txn = aptos.registerName({
|
|
5644
|
+
* sender: alice,
|
|
5645
|
+
* name: "test.aptos.apt",
|
|
5646
|
+
* expiration: {
|
|
5647
|
+
* policy: "subdomain:independent",
|
|
5648
|
+
* expirationDate: Date.now() + 30 * 24 * 60 * 60 * 1000,
|
|
5649
|
+
* },
|
|
5650
|
+
* });
|
|
5651
|
+
* ```
|
|
5652
|
+
*
|
|
5653
|
+
* @param args.sender - The sender account
|
|
5654
|
+
* @param args.name - A string of the name to register. This can be inclusive or exclusive of the .apt suffix.
|
|
5655
|
+
* Examples include: "test", "test.apt", "test.aptos.apt", etc.
|
|
5656
|
+
* @param args.expiration - An object with the expiration policy of the name.
|
|
5657
|
+
* @param args.expiration.policy - 'domain' | 'subdomain:follow-domain' | 'subdomain:independent'
|
|
5658
|
+
* - domain: Years is required and the name will expire after the given number of years.
|
|
5659
|
+
* - subdomain:follow-domain: The name will expire at the same time as the domain name.
|
|
5660
|
+
* - subdomain:independent: The name will expire at the given date.
|
|
5661
|
+
* @param args.expiration.expirationDate - An epoch number in milliseconds of
|
|
5662
|
+
* the date when the subdomain will expire. Only applicable when the policy is
|
|
5663
|
+
* set to 'subdomain:independent'.
|
|
5664
|
+
* @param args.transferable - Determines if the subdomain being minted is soul-bound. Applicable only to subdomains.
|
|
5284
5665
|
* @param args.targetAddress optional - The address the domain name will resolve to. If not provided,
|
|
5285
5666
|
* the sender's address will be used.
|
|
5286
5667
|
* @param args.toAddress optional - The address to send the domain name to. If not provided,
|
|
5287
5668
|
* the transaction will be sent to the router.
|
|
5288
5669
|
*
|
|
5289
|
-
* @returns
|
|
5670
|
+
* @returns SingleSignerTransaction
|
|
5671
|
+
*/
|
|
5672
|
+
registerName(args: Omit<RegisterNameParameters, "aptosConfig">): Promise<SingleSignerTransaction>;
|
|
5673
|
+
/**
|
|
5674
|
+
* Renews a domain name
|
|
5675
|
+
*
|
|
5676
|
+
* Note: If a domain name was minted with V1 of the contract, it will automatically be upgraded to V2 via this transaction.
|
|
5677
|
+
*
|
|
5678
|
+
* ```ts
|
|
5679
|
+
* await aptos.renewDomain({sender: alice, name: "test"})
|
|
5680
|
+
* // test.apt will be renewed for one year
|
|
5681
|
+
* ```
|
|
5682
|
+
*
|
|
5683
|
+
* @param args.sender - The sender account
|
|
5684
|
+
* @param args.name - A string of the domain the subdomain will be under. The signer must be the domain owner.
|
|
5685
|
+
* Subdomains cannot be renewed.
|
|
5686
|
+
* @param args.years - The number of years to renew the name. Currently only one year is permitted.
|
|
5687
|
+
*
|
|
5688
|
+
* @returns SingleSignerTransaction
|
|
5689
|
+
*/
|
|
5690
|
+
renewDomain(args: {
|
|
5691
|
+
sender: Account$1;
|
|
5692
|
+
name: string;
|
|
5693
|
+
years?: 1;
|
|
5694
|
+
options?: InputGenerateTransactionOptions;
|
|
5695
|
+
}): Promise<SingleSignerTransaction>;
|
|
5696
|
+
/**
|
|
5697
|
+
* Fetches a single name from the indexer
|
|
5698
|
+
* @param args.name - A string of the name to retrieve, e.g. "test.aptos.apt"
|
|
5699
|
+
* or "test.apt" or "test". Can be inclusive or exclusive of the .apt suffix.
|
|
5700
|
+
* Can be a subdomain.
|
|
5701
|
+
*
|
|
5702
|
+
* @returns A promise of an ANSName or undefined
|
|
5703
|
+
*/
|
|
5704
|
+
getName(args: {
|
|
5705
|
+
name: string;
|
|
5706
|
+
}): Promise<GetANSNameResponse[0] | undefined>;
|
|
5707
|
+
/**
|
|
5708
|
+
* Fetches all names for an account (both top level domains and subdomains)
|
|
5709
|
+
*
|
|
5710
|
+
* @param args
|
|
5711
|
+
* @param args.accountAddress - A AccountAddressInput of the address to retrieve names for.
|
|
5712
|
+
* @param args.options.offset - Optional, the offset to start from when fetching names
|
|
5713
|
+
* @param args.options.limit - Optional, A number of the names to fetch per request
|
|
5714
|
+
* @param args.options.orderBy - The order to sort the names by
|
|
5715
|
+
* @param args.options.where - Additional filters to apply to the query
|
|
5716
|
+
*
|
|
5717
|
+
* @returns a promise of an array of ANSName
|
|
5718
|
+
*/
|
|
5719
|
+
getAccountNames(args: GetAccountNamesArgs): Promise<GetANSNameResponse>;
|
|
5720
|
+
/**
|
|
5721
|
+
* Fetches all top level domain names for an account
|
|
5722
|
+
*
|
|
5723
|
+
* @param args
|
|
5724
|
+
* @param args.accountAddress - A AccountAddressInput of the address to retrieve domain names for.
|
|
5725
|
+
* @param args.options.offset - Optional, the offset to start from when fetching names
|
|
5726
|
+
* @param args.options.limit - Optional, A number of the names to fetch per request
|
|
5727
|
+
* @param args.options.orderBy - The order to sort the names by
|
|
5728
|
+
* @param args.options.where - Additional filters to apply to the query
|
|
5729
|
+
*
|
|
5730
|
+
* @returns a promise of an array of ANSName
|
|
5731
|
+
*/
|
|
5732
|
+
getAccountDomains(args: GetAccountDomainsArgs): Promise<GetANSNameResponse>;
|
|
5733
|
+
/**
|
|
5734
|
+
* Fetches all subdomains names for an account
|
|
5735
|
+
*
|
|
5736
|
+
* @param args
|
|
5737
|
+
* @param args.accountAddress - A AccountAddressInput of the address to retrieve subdomains names for.
|
|
5738
|
+
* @param args.options.offset - Optional, the offset to start from when fetching names
|
|
5739
|
+
* @param args.options.limit - Optional, A number of the names to fetch per request
|
|
5740
|
+
* @param args.options.orderBy - The order to sort the names by
|
|
5741
|
+
* @param args.options.where - Additional filters to apply to the query
|
|
5742
|
+
*
|
|
5743
|
+
* @returns a promise of an array of ANSName
|
|
5744
|
+
*/
|
|
5745
|
+
getAccountSubdomains(args: GetAccountSubdomainsArgs): Promise<GetANSNameResponse>;
|
|
5746
|
+
/**
|
|
5747
|
+
* Fetches all subdomains names for a given domain. Note, this will not return the domain itself.
|
|
5748
|
+
*
|
|
5749
|
+
* @param args
|
|
5750
|
+
* @param args.domain - A string of the domain name: eg. "test.apt" or "test" (without the suffix of .apt)
|
|
5751
|
+
* @param args.options.offset - Optional, the offset to start from when fetching names
|
|
5752
|
+
* @param args.options.limit - Optional, A number of the names to fetch per request
|
|
5753
|
+
* @param args.options.orderBy - The order to sort the names by
|
|
5754
|
+
* @param args.options.where - Additional filters to apply to the query
|
|
5755
|
+
*
|
|
5756
|
+
* @returns a promise of an array of ANSName
|
|
5290
5757
|
*/
|
|
5291
|
-
|
|
5758
|
+
getDomainSubdomains(args: GetDomainSubdomainsArgs): Promise<GetANSNameResponse>;
|
|
5292
5759
|
}
|
|
5293
5760
|
|
|
5294
5761
|
/**
|
|
@@ -5301,31 +5768,35 @@ declare class Staking {
|
|
|
5301
5768
|
* Queries current number of delegators in a pool. Throws an error if the pool is not found.
|
|
5302
5769
|
*
|
|
5303
5770
|
* @param args.poolAddress Pool address
|
|
5771
|
+
* @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying
|
|
5304
5772
|
* @returns The number of delegators for the given pool
|
|
5305
5773
|
*/
|
|
5306
5774
|
getNumberOfDelegators(args: {
|
|
5307
5775
|
poolAddress: AccountAddressInput;
|
|
5776
|
+
minimumLedgerVersion?: AnyNumber;
|
|
5308
5777
|
}): Promise<number>;
|
|
5309
5778
|
/**
|
|
5310
5779
|
* Queries current number of delegators in a pool. Throws an error if the pool is not found.
|
|
5311
5780
|
*
|
|
5781
|
+
* @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying
|
|
5312
5782
|
* @returns GetNumberOfDelegatorsForAllPoolsResponse response type
|
|
5313
5783
|
*/
|
|
5314
5784
|
getNumberOfDelegatorsForAllPools(args?: {
|
|
5315
|
-
|
|
5316
|
-
|
|
5317
|
-
};
|
|
5785
|
+
minimumLedgerVersion?: AnyNumber;
|
|
5786
|
+
options?: OrderByArg<GetNumberOfDelegatorsResponse[0]>;
|
|
5318
5787
|
}): Promise<GetNumberOfDelegatorsResponse>;
|
|
5319
5788
|
/**
|
|
5320
5789
|
* Queries delegated staking activities
|
|
5321
5790
|
*
|
|
5322
5791
|
* @param args.delegatorAddress Delegator address
|
|
5323
5792
|
* @param args.poolAddress Pool address
|
|
5793
|
+
* @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying
|
|
5324
5794
|
* @returns GetDelegatedStakingActivitiesResponse response type
|
|
5325
5795
|
*/
|
|
5326
5796
|
getDelegatedStakingActivities(args: {
|
|
5327
5797
|
delegatorAddress: AccountAddressInput;
|
|
5328
5798
|
poolAddress: AccountAddressInput;
|
|
5799
|
+
minimumLedgerVersion?: AnyNumber;
|
|
5329
5800
|
}): Promise<GetDelegatedStakingActivitiesResponse>;
|
|
5330
5801
|
}
|
|
5331
5802
|
|
|
@@ -5402,7 +5873,7 @@ declare class Transaction {
|
|
|
5402
5873
|
waitForTransaction(args: {
|
|
5403
5874
|
transactionHash: HexInput;
|
|
5404
5875
|
options?: WaitForTransactionOptions;
|
|
5405
|
-
}): Promise<
|
|
5876
|
+
}): Promise<CommittedTransactionResponse>;
|
|
5406
5877
|
/**
|
|
5407
5878
|
* Gives an estimate of the gas unit price required to get a
|
|
5408
5879
|
* transaction on chain in a reasonable amount of time.
|
|
@@ -5419,62 +5890,42 @@ declare class Transaction {
|
|
|
5419
5890
|
* ```
|
|
5420
5891
|
*/
|
|
5421
5892
|
getGasPriceEstimation(): Promise<GasEstimation>;
|
|
5893
|
+
/**
|
|
5894
|
+
* Returns a signing message for a transaction.
|
|
5895
|
+
*
|
|
5896
|
+
* This allows a user to sign a transaction using their own preferred signing method, and
|
|
5897
|
+
* then submit it to the network.
|
|
5898
|
+
* @param args.transaction A raw transaction for signing elsewhere
|
|
5899
|
+
*/
|
|
5900
|
+
getSigningMessage(args: {
|
|
5901
|
+
transaction: AnyRawTransaction;
|
|
5902
|
+
}): Uint8Array;
|
|
5422
5903
|
}
|
|
5423
5904
|
|
|
5424
5905
|
declare class TransactionSubmission {
|
|
5425
5906
|
readonly config: AptosConfig;
|
|
5426
5907
|
constructor(config: AptosConfig);
|
|
5427
5908
|
/**
|
|
5428
|
-
*
|
|
5429
|
-
* These are the possible function signature for `generateTransaction` function.
|
|
5430
|
-
* When we call `generateTransaction` function with the relevant type properties,
|
|
5431
|
-
* Typescript can infer the return type based on the appropriate function overload.
|
|
5432
|
-
*/
|
|
5433
|
-
generateTransaction(args: InputGenerateSingleSignerRawTransactionData): Promise<InputSingleSignerTransaction>;
|
|
5434
|
-
generateTransaction(args: InputGenerateFeePayerRawTransactionData): Promise<InputFeePayerTransaction>;
|
|
5435
|
-
generateTransaction(args: InputGenerateMultiAgentRawTransactionData): Promise<InputMultiAgentTransaction>;
|
|
5436
|
-
generateTransaction(args: InputGenerateTransactionData): Promise<AnyRawTransaction>;
|
|
5437
|
-
/**
|
|
5438
|
-
* Sign a transaction that can later be submitted to chain
|
|
5439
|
-
*
|
|
5440
|
-
* @param args.signer The signer account to sign the transaction
|
|
5441
|
-
* @param args.transaction An instance of a RawTransaction, plus optional secondary/fee payer addresses
|
|
5442
|
-
* @param args.asFeePayer optional. If the signer is also the fee payer
|
|
5443
|
-
* ```
|
|
5444
|
-
* {
|
|
5445
|
-
* rawTransaction: RawTransaction,
|
|
5446
|
-
* secondarySignerAddresses?: Array<AccountAddress>,
|
|
5447
|
-
* feePayerAddress?: AccountAddress
|
|
5448
|
-
* }
|
|
5449
|
-
* ```
|
|
5909
|
+
* Batch transactions for a single account.
|
|
5450
5910
|
*
|
|
5451
|
-
*
|
|
5452
|
-
|
|
5453
|
-
|
|
5454
|
-
|
|
5455
|
-
transaction: AnyRawTransaction;
|
|
5456
|
-
asFeePayer?: boolean;
|
|
5457
|
-
}): AccountAuthenticator;
|
|
5458
|
-
/**
|
|
5459
|
-
* Simulates a transaction before singing it.
|
|
5911
|
+
* This function uses a transaction worker that receives payloads to be processed
|
|
5912
|
+
* and submitted to chain.
|
|
5913
|
+
* Note that this process is best for submitting multiple transactions that
|
|
5914
|
+
* dont rely on each other, i.e batch funds, batch token mints, etc.
|
|
5460
5915
|
*
|
|
5461
|
-
*
|
|
5462
|
-
* @param args.transaction The raw transaction to simulate
|
|
5463
|
-
* @param args.secondarySignersPublicKeys optional. For when the transaction is a multi signers transaction
|
|
5464
|
-
* @param args.feePayerPublicKey optional. For when the transaction is a fee payer (aka sponsored) transaction
|
|
5465
|
-
* @param args.options optional. A config to simulate the transaction with
|
|
5466
|
-
*/
|
|
5467
|
-
simulateTransaction(args: InputSimulateTransactionData): Promise<Array<UserTransactionResponse>>;
|
|
5468
|
-
/**
|
|
5469
|
-
* Submit transaction to chain
|
|
5916
|
+
* If any worker failure, the functions throws an error.
|
|
5470
5917
|
*
|
|
5471
|
-
* @param args.
|
|
5472
|
-
* @param args.
|
|
5473
|
-
* @param args.
|
|
5918
|
+
* @param args.sender The sender account to sign and submit the transaction
|
|
5919
|
+
* @param args.data An array of transaction payloads
|
|
5920
|
+
* @param args.options optional. Transaction generation configurations (excluding accountSequenceNumber)
|
|
5474
5921
|
*
|
|
5475
|
-
* @return
|
|
5922
|
+
* @return void. Throws if any error
|
|
5476
5923
|
*/
|
|
5477
|
-
|
|
5924
|
+
batchTransactionsForSingleAccount(args: {
|
|
5925
|
+
sender: Account$1;
|
|
5926
|
+
data: InputGenerateTransactionPayloadData[];
|
|
5927
|
+
options?: Omit<InputGenerateTransactionOptions, "accountSequenceNumber">;
|
|
5928
|
+
}): Promise<void>;
|
|
5478
5929
|
/**
|
|
5479
5930
|
* Sign and submit a single signer transaction to chain
|
|
5480
5931
|
*
|
|
@@ -5512,7 +5963,7 @@ declare class TransactionSubmission {
|
|
|
5512
5963
|
metadataBytes: HexInput;
|
|
5513
5964
|
moduleBytecode: Array<HexInput>;
|
|
5514
5965
|
options?: InputGenerateTransactionOptions;
|
|
5515
|
-
}): Promise<
|
|
5966
|
+
}): Promise<SingleSignerTransaction>;
|
|
5516
5967
|
/**
|
|
5517
5968
|
* Rotate an account's auth key. After rotation, only the new private key can be used to sign txns for
|
|
5518
5969
|
* the account.
|
|
@@ -5529,6 +5980,83 @@ declare class TransactionSubmission {
|
|
|
5529
5980
|
}): Promise<TransactionResponse>;
|
|
5530
5981
|
}
|
|
5531
5982
|
|
|
5983
|
+
/**
|
|
5984
|
+
* A class to handle all `Build` transaction operations
|
|
5985
|
+
*/
|
|
5986
|
+
declare class Build {
|
|
5987
|
+
readonly config: AptosConfig;
|
|
5988
|
+
constructor(config: AptosConfig);
|
|
5989
|
+
transaction(args: {
|
|
5990
|
+
sender: AccountAddressInput;
|
|
5991
|
+
data: InputGenerateTransactionPayloadData;
|
|
5992
|
+
options?: InputGenerateTransactionOptions;
|
|
5993
|
+
withFeePayer?: boolean;
|
|
5994
|
+
}): Promise<SingleSignerTransaction>;
|
|
5995
|
+
multiAgentTransaction(args: {
|
|
5996
|
+
sender: AccountAddressInput;
|
|
5997
|
+
data: InputGenerateTransactionPayloadData;
|
|
5998
|
+
secondarySignerAddresses: AccountAddressInput[];
|
|
5999
|
+
options?: InputGenerateTransactionOptions;
|
|
6000
|
+
withFeePayer?: boolean;
|
|
6001
|
+
}): Promise<MultiAgentTransaction>;
|
|
6002
|
+
}
|
|
6003
|
+
|
|
6004
|
+
/**
|
|
6005
|
+
* A class to handle all `Sign` transaction operations
|
|
6006
|
+
*/
|
|
6007
|
+
declare class Sign {
|
|
6008
|
+
readonly config: AptosConfig;
|
|
6009
|
+
constructor(config: AptosConfig);
|
|
6010
|
+
transaction(args: {
|
|
6011
|
+
signer: Account$1;
|
|
6012
|
+
transaction: AnyRawTransaction;
|
|
6013
|
+
}): AccountAuthenticator;
|
|
6014
|
+
transactionAsFeePayer(args: {
|
|
6015
|
+
signer: Account$1;
|
|
6016
|
+
transaction: AnyRawTransaction;
|
|
6017
|
+
}): AccountAuthenticator;
|
|
6018
|
+
}
|
|
6019
|
+
|
|
6020
|
+
/**
|
|
6021
|
+
* A class to handle all `Simulate` transaction operations
|
|
6022
|
+
*/
|
|
6023
|
+
declare class Simulate {
|
|
6024
|
+
readonly config: AptosConfig;
|
|
6025
|
+
constructor(config: AptosConfig);
|
|
6026
|
+
transaction(args: {
|
|
6027
|
+
signerPublicKey: PublicKey;
|
|
6028
|
+
transaction: AnyRawTransaction;
|
|
6029
|
+
feePayerPublicKey?: PublicKey;
|
|
6030
|
+
options?: InputSimulateTransactionOptions;
|
|
6031
|
+
}): Promise<Array<UserTransactionResponse>>;
|
|
6032
|
+
multiAgentTransaction(args: {
|
|
6033
|
+
signerPublicKey: PublicKey;
|
|
6034
|
+
transaction: AnyRawTransaction;
|
|
6035
|
+
secondarySignersPublicKeys: Array<PublicKey>;
|
|
6036
|
+
feePayerPublicKey?: PublicKey;
|
|
6037
|
+
options?: InputSimulateTransactionOptions;
|
|
6038
|
+
}): Promise<Array<UserTransactionResponse>>;
|
|
6039
|
+
}
|
|
6040
|
+
|
|
6041
|
+
/**
|
|
6042
|
+
* A class to handle all `Submit` transaction operations
|
|
6043
|
+
*/
|
|
6044
|
+
declare class Submit {
|
|
6045
|
+
readonly config: AptosConfig;
|
|
6046
|
+
constructor(config: AptosConfig);
|
|
6047
|
+
transaction(args: {
|
|
6048
|
+
transaction: AnyRawTransaction;
|
|
6049
|
+
senderAuthenticator: AccountAuthenticator;
|
|
6050
|
+
feePayerAuthenticator?: AccountAuthenticator;
|
|
6051
|
+
}): Promise<PendingTransactionResponse>;
|
|
6052
|
+
multiAgentTransaction(args: {
|
|
6053
|
+
transaction: AnyRawTransaction;
|
|
6054
|
+
senderAuthenticator: AccountAuthenticator;
|
|
6055
|
+
additionalSignersAuthenticators: Array<AccountAuthenticator>;
|
|
6056
|
+
feePayerAuthenticator?: AccountAuthenticator;
|
|
6057
|
+
}): Promise<PendingTransactionResponse>;
|
|
6058
|
+
}
|
|
6059
|
+
|
|
5532
6060
|
/**
|
|
5533
6061
|
* This class is the main entry point into Aptos's
|
|
5534
6062
|
* APIs and separates functionality into different namespaces.
|
|
@@ -5549,6 +6077,10 @@ declare class Aptos {
|
|
|
5549
6077
|
readonly staking: Staking;
|
|
5550
6078
|
readonly transaction: Transaction;
|
|
5551
6079
|
readonly transactionSubmission: TransactionSubmission;
|
|
6080
|
+
readonly build: Build;
|
|
6081
|
+
readonly sign: Sign;
|
|
6082
|
+
readonly simulate: Simulate;
|
|
6083
|
+
readonly submit: Submit;
|
|
5552
6084
|
constructor(settings?: AptosConfig);
|
|
5553
6085
|
}
|
|
5554
6086
|
interface Aptos extends Account, Coin, DigitalAsset, Event, Faucet, FungibleAsset, General, Staking, Transaction, ANS, TransactionSubmission {
|
|
@@ -5650,7 +6182,7 @@ type GetAptosRequestOptions = Omit<GetRequestOptions, "type">;
|
|
|
5650
6182
|
*/
|
|
5651
6183
|
declare function get<Req extends {}, Res extends {}>(options: GetRequestOptions): Promise<AptosResponse<Req, Res>>;
|
|
5652
6184
|
declare function getAptosFullNode<Req extends {}, Res extends {}>(options: GetAptosRequestOptions): Promise<AptosResponse<Req, Res>>;
|
|
5653
|
-
declare function paginateWithCursor<Req extends Record<string, any>, Res extends
|
|
6185
|
+
declare function paginateWithCursor<Req extends Record<string, any>, Res extends Array<{}>>(options: GetAptosRequestOptions): Promise<Res>;
|
|
5654
6186
|
|
|
5655
6187
|
type PostRequestOptions = {
|
|
5656
6188
|
/**
|
|
@@ -5702,182 +6234,228 @@ declare function postAptosFullNode<Req extends {}, Res extends {}>(options: Post
|
|
|
5702
6234
|
declare function postAptosIndexer<Req extends {}, Res extends {}>(options: PostAptosRequestOptions): Promise<AptosResponse<Req, Res>>;
|
|
5703
6235
|
declare function postAptosFaucet<Req extends {}, Res extends {}>(options: PostAptosRequestOptions): Promise<AptosResponse<Req, Res>>;
|
|
5704
6236
|
|
|
5705
|
-
declare function isBool(arg: SimpleEntryFunctionArgumentTypes): arg is boolean;
|
|
5706
|
-
declare function isString(arg: any): arg is string;
|
|
5707
|
-
declare function isNumber(arg: SimpleEntryFunctionArgumentTypes): arg is number;
|
|
5708
|
-
declare function isLargeNumber(arg: SimpleEntryFunctionArgumentTypes): arg is number | bigint | string;
|
|
5709
|
-
declare function isNull(arg: SimpleEntryFunctionArgumentTypes): arg is null | undefined;
|
|
5710
|
-
declare function isBcsBool(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes): arg is Bool;
|
|
5711
|
-
declare function isBcsAddress(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes): arg is AccountAddress;
|
|
5712
|
-
declare function isBcsString(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes): arg is MoveString;
|
|
5713
|
-
declare function isBcsFixedBytes(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes): arg is FixedBytes;
|
|
5714
|
-
declare function isBcsU8(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes): arg is U8;
|
|
5715
|
-
declare function isBcsU16(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes): arg is U16;
|
|
5716
|
-
declare function isBcsU32(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes): arg is U32;
|
|
5717
|
-
declare function isBcsU64(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes): arg is U64;
|
|
5718
|
-
declare function isBcsU128(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes): arg is U128;
|
|
5719
|
-
declare function isBcsU256(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes): arg is U256;
|
|
5720
|
-
declare function isScriptDataInput(arg: InputGenerateTransactionPayloadDataWithRemoteABI | InputGenerateTransactionPayloadData): arg is InputScriptData;
|
|
5721
|
-
declare function throwTypeMismatch(expectedType: string, position: number): void;
|
|
5722
|
-
/**
|
|
5723
|
-
* Finds first non-signer arg.
|
|
5724
|
-
*
|
|
5725
|
-
* A function is often defined with a `signer` or `&signer` arguments at the start, which are filled in
|
|
5726
|
-
* by signatures, and not by the caller.
|
|
5727
|
-
* @param functionAbi
|
|
5728
|
-
*/
|
|
5729
|
-
declare function findFirstNonSignerArg(functionAbi: MoveFunction): number;
|
|
5730
|
-
declare function getFunctionParts(functionArg: MoveFunctionId): {
|
|
5731
|
-
moduleAddress: string;
|
|
5732
|
-
moduleName: string;
|
|
5733
|
-
functionName: string;
|
|
5734
|
-
};
|
|
5735
|
-
|
|
5736
|
-
/**
|
|
5737
|
-
* We are defining function signatures, each with its specific input and output.
|
|
5738
|
-
* These are the possible function signature for our `generateTransactionPayload` function.
|
|
5739
|
-
* When we call our `generateTransactionPayload` function with the relevant type properties,
|
|
5740
|
-
* Typescript can infer the return type based on the appropriate function overload.
|
|
5741
|
-
*/
|
|
5742
|
-
declare function generateTransactionPayload(args: InputScriptData): Promise<TransactionPayloadScript>;
|
|
5743
|
-
declare function generateTransactionPayload(args: InputEntryFunctionDataWithRemoteABI): Promise<TransactionPayloadEntryFunction>;
|
|
5744
|
-
declare function generateTransactionPayload(args: InputMultiSigDataWithRemoteABI): Promise<TransactionPayloadMultisig>;
|
|
5745
|
-
declare function generateTransactionPayload(args: InputGenerateTransactionPayloadDataWithRemoteABI): Promise<AnyTransactionPayloadInstance>;
|
|
5746
|
-
declare function generateTransactionPayloadWithABI(args: InputEntryFunctionData, functionAbi: EntryFunctionABI): TransactionPayloadEntryFunction;
|
|
5747
|
-
declare function generateTransactionPayloadWithABI(args: InputMultiSigData, functionAbi: EntryFunctionABI): TransactionPayloadMultisig;
|
|
5748
|
-
/**
|
|
5749
|
-
* Generates a raw transaction
|
|
5750
|
-
*
|
|
5751
|
-
* @param args.aptosConfig AptosConfig
|
|
5752
|
-
* @param args.sender The transaction's sender account address as a hex input
|
|
5753
|
-
* @param args.payload The transaction payload - can create by using generateTransactionPayload()
|
|
5754
|
-
*
|
|
5755
|
-
* @returns RawTransaction
|
|
5756
|
-
*/
|
|
5757
|
-
declare function generateRawTransaction(args: {
|
|
5758
|
-
aptosConfig: AptosConfig;
|
|
5759
|
-
sender: AccountAddressInput;
|
|
5760
|
-
payload: AnyTransactionPayloadInstance;
|
|
5761
|
-
options?: InputGenerateTransactionOptions;
|
|
5762
|
-
}): Promise<RawTransaction>;
|
|
5763
|
-
/**
|
|
5764
|
-
* We are defining function signatures, each with its specific input and output.
|
|
5765
|
-
* These are the possible function signature for our `generateTransaction` function.
|
|
5766
|
-
* When we call our `generateTransaction` function with the relevant type properties,
|
|
5767
|
-
* Typescript can infer the return type based on the appropriate function overload.
|
|
5768
|
-
*/
|
|
5769
|
-
declare function buildTransaction(args: InputGenerateSingleSignerRawTransactionArgs): Promise<InputSingleSignerTransaction>;
|
|
5770
|
-
declare function buildTransaction(args: InputGenerateFeePayerRawTransactionArgs): Promise<InputFeePayerTransaction>;
|
|
5771
|
-
declare function buildTransaction(args: InputGenerateMultiAgentRawTransactionArgs): Promise<InputMultiAgentTransaction>;
|
|
5772
|
-
declare function buildTransaction(args: InputGenerateRawTransactionArgs): Promise<AnyRawTransaction>;
|
|
5773
|
-
/**
|
|
5774
|
-
* Simulate a transaction before signing and submit to chain
|
|
5775
|
-
*
|
|
5776
|
-
* @param args.transaction A aptos transaction type to sign
|
|
5777
|
-
* @param args.signerPublicKey The signer public key
|
|
5778
|
-
* @param args.secondarySignersPublicKeys optional. The secondary signers public keys if multi signers transaction
|
|
5779
|
-
* @param args.feePayerPublicKey optional. The fee payer public key is a fee payer (aka sponsored) transaction
|
|
5780
|
-
* @param args.options optional. SimulateTransactionOptions
|
|
5781
|
-
*
|
|
5782
|
-
* @returns A signed serialized transaction that can be simulated
|
|
5783
|
-
*/
|
|
5784
|
-
declare function generateSignedTransactionForSimulation(args: InputSimulateTransactionData): Uint8Array;
|
|
5785
|
-
declare function getAuthenticatorForSimulation(publicKey: PublicKey): AccountAuthenticatorEd25519 | AccountAuthenticatorSingleKey;
|
|
5786
|
-
/**
|
|
5787
|
-
* Sign a transaction that can later be submitted to chain
|
|
5788
|
-
*
|
|
5789
|
-
* @param args.signer The signer account to sign the transaction
|
|
5790
|
-
* @param args.transaction A aptos transaction type to sign
|
|
5791
|
-
*
|
|
5792
|
-
* @return The signer AccountAuthenticator
|
|
5793
|
-
*/
|
|
5794
|
-
declare function sign(args: {
|
|
5795
|
-
signer: Account$1;
|
|
5796
|
-
transaction: AnyRawTransaction;
|
|
5797
|
-
}): AccountAuthenticator;
|
|
5798
|
-
/**
|
|
5799
|
-
* Prepare a transaction to be submitted to chain
|
|
5800
|
-
*
|
|
5801
|
-
* @param args.transaction A aptos transaction type
|
|
5802
|
-
* @param args.senderAuthenticator The account authenticator of the transaction sender
|
|
5803
|
-
* @param args.secondarySignerAuthenticators optional. For when the transaction is a multi signers transaction
|
|
5804
|
-
*
|
|
5805
|
-
* @returns A SignedTransaction
|
|
5806
|
-
*/
|
|
5807
|
-
declare function generateSignedTransaction(args: InputSubmitTransactionData): Uint8Array;
|
|
5808
6237
|
/**
|
|
5809
|
-
*
|
|
5810
|
-
*
|
|
5811
|
-
* @param transaction A aptos transaction type
|
|
6238
|
+
* A wrapper that handles and manages an account sequence number.
|
|
5812
6239
|
*
|
|
5813
|
-
*
|
|
5814
|
-
|
|
5815
|
-
|
|
5816
|
-
|
|
5817
|
-
*
|
|
6240
|
+
* Submit up to `maximumInFlight` transactions per account in parallel with a timeout of `sleepTime`
|
|
6241
|
+
* If local assumes `maximumInFlight` are in flight, determine the actual committed state from the network
|
|
6242
|
+
* If there are less than `maximumInFlight` due to some being committed, adjust the window
|
|
6243
|
+
* If `maximumInFlight` are in flight, wait `sleepTime` seconds before re-evaluating
|
|
6244
|
+
* If ever waiting more than `maxWaitTime` restart the sequence number to the current on-chain state
|
|
5818
6245
|
*
|
|
5819
|
-
*
|
|
5820
|
-
*
|
|
5821
|
-
*
|
|
6246
|
+
* Assumptions:
|
|
6247
|
+
* Accounts are expected to be managed by a single AccountSequenceNumber and not used otherwise.
|
|
6248
|
+
* They are initialized to the current on-chain state, so if there are already transactions in
|
|
6249
|
+
* flight, they may take some time to reset.
|
|
6250
|
+
* Accounts are automatically initialized if not explicitly
|
|
5822
6251
|
*
|
|
5823
|
-
*
|
|
6252
|
+
* Notes:
|
|
6253
|
+
* This is co-routine safe, that is many async tasks can be reading from this concurrently.
|
|
6254
|
+
* The state of an account cannot be used across multiple AccountSequenceNumber services.
|
|
6255
|
+
* The synchronize method will create a barrier that prevents additional nextSequenceNumber
|
|
6256
|
+
* calls until it is complete.
|
|
6257
|
+
* This only manages the distribution of sequence numbers it does not help handle transaction
|
|
6258
|
+
* failures.
|
|
6259
|
+
* If a transaction fails, you should call synchronize and wait for timeouts.
|
|
5824
6260
|
*/
|
|
5825
|
-
|
|
5826
|
-
declare
|
|
6261
|
+
|
|
6262
|
+
declare class AccountSequenceNumber {
|
|
6263
|
+
readonly aptosConfig: AptosConfig;
|
|
6264
|
+
readonly account: Account$1;
|
|
6265
|
+
lastUncommintedNumber: bigint | null;
|
|
6266
|
+
currentNumber: bigint | null;
|
|
6267
|
+
/**
|
|
6268
|
+
* We want to guarantee that we preserve ordering of workers to requests.
|
|
6269
|
+
*
|
|
6270
|
+
* `lock` is used to try to prevent multiple coroutines from accessing a shared resource at the same time,
|
|
6271
|
+
* which can result in race conditions and data inconsistency.
|
|
6272
|
+
* This code actually doesn't do it though, since we aren't giving out a slot, it is still somewhat a race condition.
|
|
6273
|
+
*
|
|
6274
|
+
* The ideal solution is likely that each thread grabs the next number from a incremental integer.
|
|
6275
|
+
* When they complete, they increment that number and that entity is able to enter the `lock`.
|
|
6276
|
+
* That would guarantee ordering.
|
|
6277
|
+
*/
|
|
6278
|
+
lock: boolean;
|
|
6279
|
+
maxWaitTime: number;
|
|
6280
|
+
maximumInFlight: number;
|
|
6281
|
+
sleepTime: number;
|
|
6282
|
+
constructor(aptosConfig: AptosConfig, account: Account$1, maxWaitTime: number, maximumInFlight: number, sleepTime: number);
|
|
6283
|
+
/**
|
|
6284
|
+
* Returns the next available sequence number for this account
|
|
6285
|
+
*
|
|
6286
|
+
* @returns next available sequence number
|
|
6287
|
+
*/
|
|
6288
|
+
nextSequenceNumber(): Promise<bigint | null>;
|
|
6289
|
+
/**
|
|
6290
|
+
* Initializes this account with the sequence number on chain
|
|
6291
|
+
*/
|
|
6292
|
+
initialize(): Promise<void>;
|
|
6293
|
+
/**
|
|
6294
|
+
* Updates this account sequence number with the one on-chain
|
|
6295
|
+
*
|
|
6296
|
+
* @returns on-chain sequence number for this account
|
|
6297
|
+
*/
|
|
6298
|
+
update(): Promise<bigint>;
|
|
6299
|
+
/**
|
|
6300
|
+
* Synchronizes local sequence number with the seqeunce number on chain for this account.
|
|
6301
|
+
*
|
|
6302
|
+
* Poll the network until all submitted transactions have either been committed or until
|
|
6303
|
+
* the maximum wait time has elapsed
|
|
6304
|
+
*/
|
|
6305
|
+
synchronize(): Promise<void>;
|
|
6306
|
+
}
|
|
5827
6307
|
|
|
5828
6308
|
/**
|
|
5829
|
-
*
|
|
6309
|
+
* The AsyncQueue class is an async-aware data structure that provides a queue-like
|
|
6310
|
+
* behavior for managing asynchronous tasks or operations.
|
|
6311
|
+
* It allows to enqueue items and dequeue them asynchronously.
|
|
6312
|
+
* This is not thread-safe but it is async concurrency safe and
|
|
6313
|
+
* it does not guarantee ordering for those that call into and await on enqueue.
|
|
5830
6314
|
*/
|
|
5831
|
-
declare
|
|
6315
|
+
declare class AsyncQueue<T> {
|
|
6316
|
+
readonly queue: T[];
|
|
6317
|
+
private pendingDequeue;
|
|
6318
|
+
private cancelled;
|
|
6319
|
+
/**
|
|
6320
|
+
* The enqueue method adds an item to the queue. If there are pending dequeued promises,
|
|
6321
|
+
* in the pendingDequeue, it resolves the oldest promise with the enqueued item immediately.
|
|
6322
|
+
* Otherwise, it adds the item to the queue.
|
|
6323
|
+
*
|
|
6324
|
+
* @param item T
|
|
6325
|
+
*/
|
|
6326
|
+
enqueue(item: T): void;
|
|
6327
|
+
/**
|
|
6328
|
+
* The dequeue method returns a promise that resolves to the next item in the queue.
|
|
6329
|
+
* If the queue is not empty, it resolves the promise immediately with the next item.
|
|
6330
|
+
* Otherwise, it creates a new promise. The promise's resolve function is stored
|
|
6331
|
+
* in the pendingDequeue with a unique counter value as the key.
|
|
6332
|
+
* The newly created promise is then returned, and it will be resolved later when an item is enqueued.
|
|
6333
|
+
*
|
|
6334
|
+
* @returns Promise<T>
|
|
6335
|
+
*/
|
|
6336
|
+
dequeue(): Promise<T>;
|
|
6337
|
+
/**
|
|
6338
|
+
* The isEmpty method returns whether the queue is empty or not.
|
|
6339
|
+
*
|
|
6340
|
+
* @returns boolean
|
|
6341
|
+
*/
|
|
6342
|
+
isEmpty(): boolean;
|
|
6343
|
+
/**
|
|
6344
|
+
* The cancel method cancels all pending promises in the queue.
|
|
6345
|
+
* It rejects the promises with a AsyncQueueCancelledError error,
|
|
6346
|
+
* ensuring that any awaiting code can handle the cancellation appropriately.
|
|
6347
|
+
*/
|
|
6348
|
+
cancel(): void;
|
|
6349
|
+
/**
|
|
6350
|
+
* The isCancelled method returns whether the queue is cancelled or not.
|
|
6351
|
+
*
|
|
6352
|
+
* @returns boolean
|
|
6353
|
+
*/
|
|
6354
|
+
isCancelled(): boolean;
|
|
6355
|
+
/**
|
|
6356
|
+
* The pendingDequeueLength method returns the length of the pendingDequeue.
|
|
6357
|
+
*
|
|
6358
|
+
* @returns number
|
|
6359
|
+
*/
|
|
6360
|
+
pendingDequeueLength(): number;
|
|
6361
|
+
}
|
|
6362
|
+
|
|
5832
6363
|
/**
|
|
5833
|
-
*
|
|
6364
|
+
* TransactionWorker provides a simple framework for receiving payloads to be processed.
|
|
5834
6365
|
*
|
|
5835
|
-
*
|
|
5836
|
-
*
|
|
5837
|
-
*
|
|
5838
|
-
*
|
|
6366
|
+
* Once one `start()` the process and pushes a new transaction, the worker acquires
|
|
6367
|
+
* the current account's next sequence number (by using the AccountSequenceNumber class),
|
|
6368
|
+
* generates a signed transaction and pushes an async submission process into the `outstandingTransactions` queue.
|
|
6369
|
+
* At the same time, the worker processes transactions by reading the `outstandingTransactions` queue
|
|
6370
|
+
* and submits the next transaction to chain, it
|
|
6371
|
+
* 1) waits for resolution of the submission process or get pre-execution validation error
|
|
6372
|
+
* and 2) waits for the resolution of the execution process or get an execution error.
|
|
6373
|
+
* The worker fires events for any submission and/or execution success and/or failure.
|
|
5839
6374
|
*/
|
|
5840
|
-
declare function fetchEntryFunctionAbi(moduleAddress: string, moduleName: string, functionName: string, aptosConfig: AptosConfig): Promise<EntryFunctionABI>;
|
|
5841
|
-
/**
|
|
5842
|
-
* Converts a non-BCS encoded argument into BCS encoded, if necessary
|
|
5843
|
-
* @param functionName
|
|
5844
|
-
* @param functionAbi
|
|
5845
|
-
* @param arg
|
|
5846
|
-
* @param position
|
|
5847
|
-
*/
|
|
5848
|
-
declare function convertArgument(functionName: string, functionAbi: EntryFunctionABI, arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes, position: number, genericTypeParams: Array<TypeTag>): EntryFunctionArgumentTypes;
|
|
5849
6375
|
|
|
5850
|
-
declare
|
|
5851
|
-
|
|
5852
|
-
|
|
5853
|
-
|
|
5854
|
-
|
|
5855
|
-
|
|
5856
|
-
|
|
5857
|
-
|
|
5858
|
-
|
|
5859
|
-
|
|
5860
|
-
|
|
5861
|
-
|
|
5862
|
-
|
|
5863
|
-
|
|
5864
|
-
|
|
5865
|
-
|
|
6376
|
+
declare class TransactionWorker {
|
|
6377
|
+
readonly aptosConfig: AptosConfig;
|
|
6378
|
+
readonly account: Account$1;
|
|
6379
|
+
readonly accountSequnceNumber: AccountSequenceNumber;
|
|
6380
|
+
readonly taskQueue: AsyncQueue<() => Promise<void>>;
|
|
6381
|
+
started: boolean;
|
|
6382
|
+
/**
|
|
6383
|
+
* transactions payloads waiting to be generated and signed
|
|
6384
|
+
*
|
|
6385
|
+
* TODO support entry function payload from ABI builder
|
|
6386
|
+
*/
|
|
6387
|
+
transactionsQueue: AsyncQueue<[InputGenerateTransactionPayloadData, InputGenerateTransactionOptions | undefined]>;
|
|
6388
|
+
/**
|
|
6389
|
+
* signed transactions waiting to be submitted
|
|
6390
|
+
*/
|
|
6391
|
+
outstandingTransactions: AsyncQueue<[Promise<PendingTransactionResponse>, bigint]>;
|
|
6392
|
+
/**
|
|
6393
|
+
* transactions that have been submitted to chain
|
|
6394
|
+
*/
|
|
6395
|
+
sentTransactions: Array<[string, bigint, any]>;
|
|
6396
|
+
/**
|
|
6397
|
+
* transactions that have been committed to chain
|
|
6398
|
+
*/
|
|
6399
|
+
executedTransactions: Array<[string, bigint, any]>;
|
|
6400
|
+
/**
|
|
6401
|
+
* Provides a simple framework for receiving payloads to be processed.
|
|
6402
|
+
*
|
|
6403
|
+
* @param aptosConfig - a config object
|
|
6404
|
+
* @param sender - a sender as Account
|
|
6405
|
+
* @param maxWaitTime - the max wait time to wait before resyncing the sequence number
|
|
6406
|
+
* to the current on-chain state, default to 30
|
|
6407
|
+
* @param maximumInFlight - submit up to `maximumInFlight` transactions per account.
|
|
6408
|
+
* Mempool limits the number of transactions per account to 100, hence why we default to 100.
|
|
6409
|
+
* @param sleepTime - If `maximumInFlight` are in flight, wait `sleepTime` seconds before re-evaluating, default to 10
|
|
6410
|
+
*/
|
|
6411
|
+
constructor(aptosConfig: AptosConfig, account: Account$1, maxWaitTime?: number, maximumInFlight?: number, sleepTime?: number);
|
|
6412
|
+
/**
|
|
6413
|
+
* Gets the current account sequence number,
|
|
6414
|
+
* generates the transaction with the account sequence number,
|
|
6415
|
+
* adds the transaction to the outstanding transaction queue
|
|
6416
|
+
* to be processed later.
|
|
6417
|
+
*/
|
|
6418
|
+
submitNextTransaction(): Promise<void>;
|
|
6419
|
+
/**
|
|
6420
|
+
* Reads the outstanding transaction queue and submits the transaction to chain.
|
|
6421
|
+
*
|
|
6422
|
+
* If the transaction has fulfilled, it pushes the transaction to the processed
|
|
6423
|
+
* transactions queue and fires a transactionsFulfilled event.
|
|
6424
|
+
*
|
|
6425
|
+
* If the transaction has failed, it pushes the transaction to the processed
|
|
6426
|
+
* transactions queue with the failure reason and fires a transactionsFailed event.
|
|
6427
|
+
*/
|
|
6428
|
+
processTransactions(): Promise<void>;
|
|
6429
|
+
/**
|
|
6430
|
+
* Once transaction has been sent to chain, we check for its execution status.
|
|
6431
|
+
* @param sentTransaction transactions that were sent to chain and are now waiting to be executed
|
|
6432
|
+
* @param sequenceNumber the account's sequence number that was sent with the transaction
|
|
6433
|
+
*/
|
|
6434
|
+
checkTransaction(sentTransaction: PromiseFulfilledResult<PendingTransactionResponse>, sequenceNumber: bigint): Promise<void>;
|
|
6435
|
+
/**
|
|
6436
|
+
* Push transaction to the transactions queue
|
|
6437
|
+
* @param payload Transaction payload
|
|
6438
|
+
*/
|
|
6439
|
+
push(transactionData: InputGenerateTransactionPayloadData, options?: InputGenerateTransactionOptions): Promise<void>;
|
|
6440
|
+
/**
|
|
6441
|
+
* Generates a signed transaction that can be submitted to chain
|
|
6442
|
+
* @param account an Aptos account
|
|
6443
|
+
* @param sequenceNumber a sequence number the transaction will be generated with
|
|
6444
|
+
* @returns
|
|
6445
|
+
*/
|
|
6446
|
+
generateNextTransaction(account: Account$1, sequenceNumber: bigint): Promise<SingleSignerTransaction | undefined>;
|
|
6447
|
+
/**
|
|
6448
|
+
* Starts transaction submission and transaction processing.
|
|
6449
|
+
*/
|
|
6450
|
+
run(): Promise<void>;
|
|
6451
|
+
/**
|
|
6452
|
+
* Starts the transaction management process.
|
|
6453
|
+
*/
|
|
6454
|
+
start(): void;
|
|
6455
|
+
/**
|
|
6456
|
+
* Stops the the transaction management process.
|
|
6457
|
+
*/
|
|
6458
|
+
stop(): void;
|
|
5866
6459
|
}
|
|
5867
|
-
/**
|
|
5868
|
-
* All types are made of a few parts they're either:
|
|
5869
|
-
* 1. A simple type e.g. u8
|
|
5870
|
-
* 2. A standalone struct e.g. 0x1::account::Account
|
|
5871
|
-
* 3. A nested struct e.g. 0x1::coin::Coin<0x1234::coin::MyCoin>
|
|
5872
|
-
*
|
|
5873
|
-
* There are a few more special cases that need to be handled, however.
|
|
5874
|
-
* 1. Multiple generics e.g 0x1::pair::Pair<u8, u16>
|
|
5875
|
-
* 2. Spacing in the generics e.g. 0x1::pair::Pair< u8 , u16>
|
|
5876
|
-
* 3. Nested generics of different depths e.g. 0x1::pair::Pair<0x1::coin::Coin<0x1234::coin::MyCoin>, u8>
|
|
5877
|
-
* 4. Generics for types in ABIs are filled in with placeholders e.g T1, T2, T3
|
|
5878
|
-
*/
|
|
5879
|
-
declare function parseTypeTag(typeStr: string, options?: {
|
|
5880
|
-
allowGenerics?: boolean;
|
|
5881
|
-
}): TypeTag;
|
|
5882
6460
|
|
|
5883
|
-
export { APTOS_BIP44_REGEX, APTOS_COIN, APTOS_HARDENED_REGEX, Account$1 as Account, AccountAddress, AccountAddressInput, AccountAuthenticator, AccountAuthenticatorEd25519, AccountAuthenticatorMultiEd25519, AccountAuthenticatorMultiKey, AccountAuthenticatorSingleKey, AccountAuthenticatorVariant, AccountData,
|
|
6461
|
+
export { APTOS_BIP44_REGEX, APTOS_COIN, APTOS_HARDENED_REGEX, Account$1 as Account, AccountAddress, AccountAddressInput, AccountAuthenticator, AccountAuthenticatorEd25519, AccountAuthenticatorMultiEd25519, AccountAuthenticatorMultiKey, AccountAuthenticatorSingleKey, AccountAuthenticatorVariant, AccountData, AccountSequenceNumber, AccountSignature, AddressInvalidReason, AnyNumber, AnyPublicKey, AnyPublicKeyVariant, AnyRawTransaction, AnyRawTransactionInstance, AnySignature, AnySignatureVariant, AnyTransactionPayloadInstance, Aptos, AptosApiError, AptosApiType, AptosConfig, AptosRequest, AptosResponse, AptosSettings, AuthenticationKey, AuthenticationKeyScheme, Block, BlockMetadataTransactionResponse, Bool, CKDPriv, ChainId, Client, ClientConfig, ClientRequest, ClientResponse, CommittedTransactionResponse, DEFAULT_MAX_GAS_AMOUNT, DEFAULT_NETWORK, DEFAULT_TXN_EXP_SEC_FROM_NOW, DEFAULT_TXN_TIMEOUT_SEC, DecodedTableData, DeletedTableData, DeriveScheme, DerivedKeys, Deserializable, Deserializer, DirectWriteSet, Ed25519PrivateKey, Ed25519PublicKey, Ed25519Signature, EntryFunction, EntryFunctionABI, EntryFunctionArgument, EntryFunctionArgumentTypes, EntryFunctionBytes, EntryFunctionPayloadResponse, Event$1 as Event, EventGuid, FeePayerRawTransaction, FixedBytes, GasEstimation, GenerateAccount, GenerateAccountWithEd25519, GenerateAccountWithSingleSignerSecp256k1Key, GenesisPayload, GenesisTransactionResponse, GetANSNameResponse, GetAccountCoinsDataResponse, GetAccountCollectionsWithOwnedTokenResponse, GetAccountOwnedObjectsResponse, GetAccountOwnedTokensFromCollectionResponse, GetAccountOwnedTokensQueryResponse, GetAptosRequestOptions, GetChainTopUserTransactionsResponse, GetCollectionDataResponse, GetCurrentFungibleAssetBalancesResponse, GetCurrentTokenOwnershipResponse, GetDelegatedStakingActivitiesResponse, GetEventsResponse, GetFungibleAssetActivitiesResponse, GetFungibleAssetMetadataResponse, GetNumberOfDelegatorsResponse, GetOwnedTokensResponse, GetProcessorStatusResponse, GetRequestOptions, GetTokenActivityResponse, GetTokenDataResponse, GraphqlQuery, HARDENED_OFFSET, Hex, HexInput, HexInvalidReason, Identifier, InputEntryFunctionData, InputEntryFunctionDataWithRemoteABI, InputGenerateMultiAgentRawTransactionArgs, InputGenerateMultiAgentRawTransactionData, InputGenerateRawTransactionArgs, InputGenerateSingleSignerRawTransactionArgs, InputGenerateSingleSignerRawTransactionData, InputGenerateTransactionData, InputGenerateTransactionOptions, InputGenerateTransactionPayloadData, InputGenerateTransactionPayloadDataWithRemoteABI, InputMultiSigData, InputMultiSigDataWithRemoteABI, InputScriptData, InputSimulateTransactionData, InputSimulateTransactionOptions, InputSubmitTransactionData, InputViewRequestData, KeyType, LedgerInfo, LedgerVersionArg, MimeType, ModuleId, MoveAbility, MoveAddressType, MoveFunction, MoveFunctionGenericTypeParam, MoveFunctionId, MoveFunctionVisibility, MoveModule, MoveModuleBytecode, MoveModuleId, MoveObjectType, MoveOption, MoveOptionType, MoveResource, MoveScriptBytecode, MoveString, MoveStruct, MoveStructField, MoveStructId, MoveStructType, MoveType, MoveUint128Type, MoveUint16Type, MoveUint256Type, MoveUint32Type, MoveUint64Type, MoveUint8Type, MoveValue, MoveVector, MultiAgentRawTransaction, MultiAgentTransaction, MultiEd25519PublicKey, MultiEd25519Signature, MultiKey, MultiSig, MultisigPayloadResponse, MultisigTransactionPayload, Network, NetworkToChainId, NetworkToFaucetAPI, NetworkToIndexerAPI, NetworkToNetworkName, NetworkToNodeAPI, OrderBy, OrderByArg, OrderByValue, PaginationArgs, ParsingError, ParsingResult, PendingTransactionResponse, PostAptosRequestOptions, PostRequestOptions, PrivateKey, ProcessorType, PublicKey, RAW_TRANSACTION_SALT, RAW_TRANSACTION_WITH_DATA_SALT, RawTransaction, RawTransactionWithData, RoleType, RotationProofChallenge, Script, ScriptFunctionArgument, ScriptFunctionArgumentTypes, ScriptPayloadResponse, ScriptTransactionArgumentVariants, ScriptWriteSet, Secp256k1PrivateKey, Secp256k1PublicKey, Secp256k1Signature, Serializable, Serializer, Signature, SignedTransaction, SigningScheme, SigningSchemeInput, SimpleEntryFunctionArgumentTypes, SingleSignerTransaction, StateCheckpointTransactionResponse, StructTag, TableItemRequest, TokenStandard, TokenStandardArg, TransactionArgument, TransactionAuthenticator, TransactionAuthenticatorEd25519, TransactionAuthenticatorFeePayer, TransactionAuthenticatorMultiAgent, TransactionAuthenticatorMultiEd25519, TransactionAuthenticatorSingleSender, TransactionAuthenticatorVariant, TransactionEd25519Signature, TransactionFeePayerSignature, TransactionMultiAgentSignature, TransactionMultiEd25519Signature, TransactionPayload, TransactionPayloadEntryFunction, TransactionPayloadMultisig, TransactionPayloadResponse, TransactionPayloadScript, TransactionPayloadVariants, TransactionResponse, TransactionResponseType, TransactionSecp256k1Signature, TransactionSignature, TransactionVariants, TransactionWorker, TypeTag, TypeTagAddress, TypeTagBool, TypeTagGeneric, TypeTagParserError, TypeTagParserErrorType, TypeTagReference, TypeTagSigner, TypeTagStruct, TypeTagU128, TypeTagU16, TypeTagU256, TypeTagU32, TypeTagU64, TypeTagU8, TypeTagVariants, TypeTagVector, U128, U16, U256, U32, U64, U8, Uint128, Uint16, Uint256, Uint32, Uint64, Uint8, UserTransactionResponse, ViewRequest, WaitForTransactionOptions, WhereArg, WriteSet, WriteSetChange, WriteSetChangeDeleteModule, WriteSetChangeDeleteResource, WriteSetChangeDeleteTableItem, WriteSetChangeWriteModule, WriteSetChangeWriteResource, WriteSetChangeWriteTableItem, aptosCoinStructTag, aptosRequest, buildTransaction, checkOrConvertArgument, convertArgument, deriveKey, deriveTransactionType, deserializeFromScriptArgument, ensureBoolean, fetchEntryFunctionAbi, findFirstNonSignerArg, generateMultiSignersSignedTransaction, generateRawTransaction, generateSignedTransaction, generateSignedTransactionForSimulation, generateSigningMessage, generateTransactionPayload, generateTransactionPayloadWithABI, get, getAptosFullNode, getAuthenticatorForSimulation, getFunctionParts, isBcsAddress, isBcsBool, isBcsFixedBytes, isBcsString, isBcsU128, isBcsU16, isBcsU256, isBcsU32, isBcsU64, isBcsU8, isBlockMetadataTransactionResponse, isBool, isEd25519Signature, isEncodedEntryFunctionArgument, isFeePayerSignature, isGenesisTransactionResponse, isLargeNumber, isMultiAgentSignature, isMultiEd25519Signature, isNull, isNumber, isPendingTransactionResponse, isScriptDataInput, isSecp256k1Signature, isStateCheckpointTransactionResponse, isString, isUserTransactionResponse, isValidBIP44Path, isValidHardenedPath, mnemonicToSeed, objectStructTag, optionStructTag, outOfRangeErrorMessage, paginateWithCursor, parseTypeTag, post, postAptosFaucet, postAptosFullNode, postAptosIndexer, request, sign, splitPath, standardizeTypeTags, stringStructTag, throwTypeMismatch, validateNumberInRange };
|