@aptos-labs/ts-sdk 1.33.2-sc.0 → 1.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/{accountAddress-Cf1amU98.d.ts → accountAddress-CDtCLtJA.d.ts} +3 -2
- package/dist/common/chunk-ZYPBABLQ.js +4 -0
- package/dist/common/chunk-ZYPBABLQ.js.map +1 -0
- package/dist/common/cli/index.d.ts +1 -1
- package/dist/common/cli/index.js +1 -1
- package/dist/common/cli/index.js.map +1 -1
- package/dist/common/index.d.ts +2489 -2235
- package/dist/common/index.js +33 -35
- package/dist/common/index.js.map +1 -1
- package/dist/esm/account/AbstractKeylessAccount.mjs +1 -1
- package/dist/esm/account/AbstractedAccount.d.mts +91 -0
- package/dist/esm/account/AbstractedAccount.mjs +2 -0
- package/dist/esm/account/Account.mjs +1 -1
- package/dist/esm/account/AccountUtils.d.mts +16 -16
- package/dist/esm/account/AccountUtils.mjs +1 -1
- package/dist/esm/account/Ed25519Account.mjs +1 -1
- package/dist/esm/account/EphemeralKeyPair.mjs +1 -1
- package/dist/esm/account/FederatedKeylessAccount.mjs +1 -1
- package/dist/esm/account/KeylessAccount.mjs +1 -1
- package/dist/esm/account/MultiKeyAccount.mjs +1 -1
- package/dist/esm/account/SingleKeyAccount.mjs +1 -1
- package/dist/esm/account/index.d.mts +2 -0
- package/dist/esm/account/index.mjs +1 -1
- package/dist/esm/account/utils.mjs +1 -1
- package/dist/esm/api/account/abstraction.d.mts +209 -0
- package/dist/esm/api/account/abstraction.mjs +2 -0
- package/dist/esm/api/account/abstraction.mjs.map +1 -0
- package/dist/esm/api/account.d.mts +2 -0
- package/dist/esm/api/account.mjs +1 -1
- package/dist/esm/api/ans.mjs +1 -1
- package/dist/esm/api/aptos.d.mts +1 -0
- package/dist/esm/api/aptos.mjs +1 -1
- package/dist/esm/api/coin.mjs +1 -1
- package/dist/esm/api/digitalAsset.mjs +1 -1
- package/dist/esm/api/event.mjs +1 -1
- package/dist/esm/api/faucet.mjs +1 -1
- package/dist/esm/api/fungibleAsset.mjs +1 -1
- package/dist/esm/api/general.mjs +1 -1
- package/dist/esm/api/index.d.mts +1 -0
- package/dist/esm/api/index.mjs +1 -1
- package/dist/esm/api/keyless.d.mts +1 -1
- package/dist/esm/api/keyless.mjs +1 -1
- package/dist/esm/api/object.mjs +1 -1
- package/dist/esm/api/staking.mjs +1 -1
- package/dist/esm/api/table.mjs +1 -1
- package/dist/esm/api/transaction.mjs +1 -1
- package/dist/esm/api/transactionSubmission/build.mjs +1 -1
- package/dist/esm/api/transactionSubmission/management.mjs +1 -1
- package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
- package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -1
- package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
- package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
- package/dist/esm/api/utils.mjs +1 -1
- package/dist/esm/bcs/index.mjs +1 -1
- package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
- package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
- package/dist/esm/{chunk-CYMVZJHC.mjs → chunk-2FNFUTFJ.mjs} +2 -2
- package/dist/esm/{chunk-4UYVRG5Z.mjs → chunk-2GIPNLDO.mjs} +2 -2
- package/dist/esm/{chunk-UQ7D5CSM.mjs → chunk-33CBJFX2.mjs} +2 -2
- package/dist/esm/{chunk-P54RNN4V.mjs → chunk-3EY7MT2M.mjs} +2 -2
- package/dist/esm/{chunk-KPLWOVKG.mjs → chunk-3HFZN7L5.mjs} +2 -2
- package/dist/esm/chunk-42T3UGSW.mjs +2 -0
- package/dist/esm/chunk-42T3UGSW.mjs.map +1 -0
- package/dist/esm/chunk-4776UXL6.mjs +2 -0
- package/dist/esm/chunk-4776UXL6.mjs.map +1 -0
- package/dist/esm/{chunk-FC2IYWI7.mjs → chunk-4T75XRI2.mjs} +2 -2
- package/dist/esm/{chunk-EBS4BKER.mjs → chunk-4UK4MUSD.mjs} +2 -2
- package/dist/esm/{chunk-GL4OJVYH.mjs → chunk-5BSMF22B.mjs} +2 -2
- package/dist/esm/chunk-66HHRRIX.mjs +2 -0
- package/dist/esm/chunk-66HHRRIX.mjs.map +1 -0
- package/dist/esm/{chunk-CDYLZDD2.mjs → chunk-6JTNS5O6.mjs} +2 -2
- package/dist/esm/{chunk-UF6SI2QE.mjs → chunk-6LGXFXXR.mjs} +2 -2
- package/dist/esm/{chunk-T6NQDM7D.mjs → chunk-6PBMD2BQ.mjs} +2 -2
- package/dist/esm/chunk-7C2RDOWS.mjs +1 -0
- package/dist/esm/chunk-7C2RDOWS.mjs.map +1 -0
- package/dist/esm/{chunk-ECZYQTNN.mjs → chunk-7CYCKCVU.mjs} +2 -2
- package/dist/esm/chunk-7DPHPPMG.mjs +2 -0
- package/dist/esm/chunk-7DPHPPMG.mjs.map +1 -0
- package/dist/esm/chunk-ABXES4FS.mjs +2 -0
- package/dist/esm/chunk-ABXES4FS.mjs.map +1 -0
- package/dist/esm/{chunk-A3NEASNH.mjs → chunk-AC3BISWL.mjs} +2 -2
- package/dist/esm/chunk-BBUN4IO4.mjs +2 -0
- package/dist/esm/chunk-BBUN4IO4.mjs.map +1 -0
- package/dist/esm/{chunk-QHEKBHNU.mjs → chunk-BUTMGMSD.mjs} +2 -2
- package/dist/esm/{chunk-P4VF7BN4.mjs → chunk-BYHCW7MI.mjs} +2 -2
- package/dist/esm/{chunk-AD3A7DTH.mjs → chunk-CRFLR3ZY.mjs} +2 -2
- package/dist/esm/{chunk-CWRANLXZ.mjs → chunk-CSG67JHZ.mjs} +2 -2
- package/dist/esm/chunk-CSG67JHZ.mjs.map +1 -0
- package/dist/esm/{chunk-BFIXIXHO.mjs → chunk-CXNF73OX.mjs} +2 -2
- package/dist/esm/{chunk-32WLD3F3.mjs → chunk-D6T3NYOA.mjs} +2 -2
- package/dist/esm/chunk-DBIZE7G6.mjs +2 -0
- package/dist/esm/chunk-DBIZE7G6.mjs.map +1 -0
- package/dist/esm/{chunk-CGTHWGSJ.mjs → chunk-DLLDRANJ.mjs} +2 -2
- package/dist/esm/{chunk-KFGXOZ77.mjs → chunk-DMS7K76O.mjs} +2 -2
- package/dist/esm/{chunk-KNTAED2Z.mjs → chunk-DNJQWGB7.mjs} +2 -2
- package/dist/esm/{chunk-NW2WUKWV.mjs → chunk-DNWFDS7F.mjs} +2 -2
- package/dist/esm/{chunk-XIFIACCB.mjs → chunk-DWJ3PGWE.mjs} +2 -2
- package/dist/esm/chunk-EGZI6EJ2.mjs +2 -0
- package/dist/esm/chunk-EGZI6EJ2.mjs.map +1 -0
- package/dist/esm/chunk-EY2JUXEC.mjs +2 -0
- package/dist/esm/{chunk-AIABPCUF.mjs.map → chunk-EY2JUXEC.mjs.map} +1 -1
- package/dist/esm/{chunk-KG23XFU2.mjs → chunk-G6RLN6ET.mjs} +2 -2
- package/dist/esm/{chunk-G5ZWH5T3.mjs → chunk-GQX5KMF7.mjs} +2 -2
- package/dist/esm/{chunk-X3SO2LDX.mjs → chunk-H4GZWYIG.mjs} +2 -2
- package/dist/esm/chunk-HEAWDTLG.mjs +2 -0
- package/dist/esm/{chunk-XHPWHA6B.mjs.map → chunk-HEAWDTLG.mjs.map} +1 -1
- package/dist/esm/{chunk-SQR3AIY7.mjs → chunk-HFCWJ6QL.mjs} +2 -2
- package/dist/esm/{chunk-FQECACH3.mjs → chunk-HL2O3T57.mjs} +2 -2
- package/dist/esm/chunk-HLJE5XGE.mjs +2 -0
- package/dist/esm/chunk-HLJE5XGE.mjs.map +1 -0
- package/dist/esm/{chunk-PTS3BTOU.mjs → chunk-HT2WC3QV.mjs} +2 -2
- package/dist/esm/{chunk-ODEDSSQL.mjs → chunk-I7YHK6ZF.mjs} +2 -2
- package/dist/esm/{chunk-N4VVDQA5.mjs → chunk-IDTLNF4M.mjs} +2 -2
- package/dist/esm/chunk-IMTC3J2M.mjs +2 -0
- package/dist/esm/chunk-IMTC3J2M.mjs.map +1 -0
- package/dist/esm/{chunk-67ZANQ3R.mjs → chunk-J7HRQ2IH.mjs} +2 -2
- package/dist/esm/{chunk-H3XZ3FZY.mjs → chunk-JF66JS2R.mjs} +2 -2
- package/dist/esm/{chunk-I7JGKVOC.mjs → chunk-KEJAUCQF.mjs} +2 -2
- package/dist/esm/{chunk-Y6QTKAQO.mjs → chunk-L2AQG3G3.mjs} +2 -2
- package/dist/esm/{chunk-7HLNV3QL.mjs → chunk-L6FONDPA.mjs} +2 -2
- package/dist/esm/{chunk-ZJNPBHEI.mjs → chunk-N7C6LQPZ.mjs} +2 -2
- package/dist/esm/{chunk-VZELORLW.mjs → chunk-O37BZP2G.mjs} +2 -2
- package/dist/esm/{chunk-SOLQ5VON.mjs → chunk-OURSLL3I.mjs} +2 -2
- package/dist/esm/{chunk-PHJRCZQ3.mjs → chunk-P7SE5LQE.mjs} +2 -2
- package/dist/esm/{chunk-3XH3NNSR.mjs → chunk-PNSF3E67.mjs} +2 -2
- package/dist/esm/{chunk-UONSJQUV.mjs → chunk-PR3W2QEH.mjs} +2 -2
- package/dist/esm/{chunk-KFCLSJC3.mjs → chunk-PWYJWTEM.mjs} +2 -2
- package/dist/esm/{chunk-VCIJX6R4.mjs → chunk-Q7RG7KQS.mjs} +2 -2
- package/dist/esm/{chunk-6IIAGMDR.mjs → chunk-QBFGY74I.mjs} +2 -2
- package/dist/esm/{chunk-XLFX2YQA.mjs → chunk-S47HA7O7.mjs} +2 -2
- package/dist/esm/{chunk-6IPM5P4L.mjs → chunk-SCBYJU6K.mjs} +2 -2
- package/dist/esm/chunk-TDGUMBON.mjs +4 -0
- package/dist/esm/chunk-TDGUMBON.mjs.map +1 -0
- package/dist/esm/{chunk-XGF7UNEW.mjs → chunk-TM6IKHMX.mjs} +2 -2
- package/dist/esm/{chunk-FNXO3URE.mjs → chunk-U2SJIG2T.mjs} +2 -2
- package/dist/esm/{chunk-SZRZ3HIL.mjs → chunk-ULHOJ2BE.mjs} +2 -2
- package/dist/esm/{chunk-4ZJJINCW.mjs → chunk-UTXEW2FT.mjs} +2 -2
- package/dist/esm/{chunk-K2CSACQY.mjs → chunk-V2EXS6TM.mjs} +2 -2
- package/dist/esm/{chunk-FKJ3GCBI.mjs → chunk-V7G2EDNR.mjs} +2 -2
- package/dist/esm/{chunk-R7QOPBWA.mjs → chunk-VKDTI6NX.mjs} +2 -2
- package/dist/esm/{chunk-PNDCGNVH.mjs → chunk-VOCI2675.mjs} +2 -2
- package/dist/esm/{chunk-VVAKGJDN.mjs → chunk-WXDA4CCR.mjs} +2 -2
- package/dist/esm/{chunk-66AQ2MJ6.mjs → chunk-X24PSWCX.mjs} +2 -2
- package/dist/esm/chunk-X2CPDUOS.mjs +2 -0
- package/dist/esm/chunk-X2CPDUOS.mjs.map +1 -0
- package/dist/esm/{chunk-67BUAZ6O.mjs → chunk-X6IHNXWY.mjs} +2 -2
- package/dist/esm/{chunk-JJM6ELMS.mjs → chunk-XAPQNCTN.mjs} +2 -2
- package/dist/esm/{chunk-DW3ETAZB.mjs → chunk-XDIX7NIP.mjs} +2 -2
- package/dist/esm/{chunk-6XHBRRS6.mjs → chunk-XH3BEKII.mjs} +2 -2
- package/dist/esm/{chunk-PUNTBVRJ.mjs → chunk-XXHZQFYW.mjs} +2 -2
- package/dist/esm/{chunk-YPGI5HAA.mjs → chunk-Y3Y4DVCK.mjs} +2 -2
- package/dist/esm/{chunk-CNCRJ56P.mjs → chunk-YIF242TF.mjs} +2 -2
- package/dist/esm/{chunk-CWKNJZB6.mjs → chunk-ZCEBDPBJ.mjs} +2 -2
- package/dist/esm/{chunk-Q3VS6AEN.mjs → chunk-ZP5EBIBE.mjs} +2 -2
- package/dist/esm/cli/index.mjs +1 -1
- package/dist/esm/cli/localNode.mjs +1 -1
- package/dist/esm/client/core.mjs +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/index.mjs +1 -1
- package/dist/esm/core/account/utils/address.mjs +1 -1
- package/dist/esm/core/account/utils/index.mjs +1 -1
- package/dist/esm/core/accountAddress.mjs +1 -1
- package/dist/esm/core/authenticationKey.mjs +1 -1
- package/dist/esm/core/crypto/abstraction.d.mts +30 -0
- package/dist/esm/core/crypto/abstraction.mjs +2 -0
- package/dist/esm/core/crypto/abstraction.mjs.map +1 -0
- package/dist/esm/core/crypto/ed25519.mjs +1 -1
- package/dist/esm/core/crypto/ephemeral.mjs +1 -1
- package/dist/esm/core/crypto/federatedKeyless.mjs +1 -1
- package/dist/esm/core/crypto/index.mjs +1 -1
- package/dist/esm/core/crypto/keyless.mjs +1 -1
- package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
- package/dist/esm/core/crypto/multiKey.mjs +1 -1
- package/dist/esm/core/crypto/privateKey.mjs +1 -1
- package/dist/esm/core/crypto/proof.mjs +1 -1
- package/dist/esm/core/crypto/publicKey.mjs +1 -1
- package/dist/esm/core/crypto/secp256k1.mjs +1 -1
- package/dist/esm/core/crypto/signature.mjs +1 -1
- package/dist/esm/core/crypto/singleKey.mjs +1 -1
- package/dist/esm/core/index.mjs +1 -1
- package/dist/esm/errors/index.mjs +1 -1
- package/dist/esm/index.d.mts +6 -3
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/internal/abstraction.d.mts +55 -0
- package/dist/esm/internal/abstraction.mjs +2 -0
- package/dist/esm/internal/abstraction.mjs.map +1 -0
- package/dist/esm/internal/account.mjs +1 -1
- package/dist/esm/internal/ans.mjs +1 -1
- package/dist/esm/internal/coin.mjs +1 -1
- package/dist/esm/internal/digitalAsset.mjs +1 -1
- package/dist/esm/internal/event.mjs +1 -1
- package/dist/esm/internal/faucet.mjs +1 -1
- package/dist/esm/internal/fungibleAsset.mjs +1 -1
- package/dist/esm/internal/general.mjs +1 -1
- package/dist/esm/internal/keyless.mjs +1 -1
- package/dist/esm/internal/object.mjs +1 -1
- package/dist/esm/internal/staking.mjs +1 -1
- package/dist/esm/internal/table.mjs +1 -1
- package/dist/esm/internal/transaction.mjs +1 -1
- package/dist/esm/internal/transactionSubmission.mjs +1 -1
- package/dist/esm/internal/view.mjs +1 -1
- package/dist/esm/transactions/authenticator/account.d.mts +11 -3
- package/dist/esm/transactions/authenticator/account.mjs +1 -1
- package/dist/esm/transactions/authenticator/index.d.mts +1 -1
- package/dist/esm/transactions/authenticator/index.mjs +1 -1
- package/dist/esm/transactions/authenticator/transaction.d.mts +2 -2
- package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
- package/dist/esm/transactions/index.d.mts +2 -2
- package/dist/esm/transactions/index.mjs +1 -1
- package/dist/esm/transactions/instances/index.mjs +1 -1
- package/dist/esm/transactions/instances/moduleId.mjs +1 -1
- package/dist/esm/transactions/instances/multiAgentTransaction.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 +4 -4
- package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
- package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
- package/dist/esm/transactions/management/index.mjs +1 -1
- package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
- package/dist/esm/transactions/scriptComposer/index.d.mts +6 -0
- package/dist/esm/transactions/scriptComposer/index.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/helpers.d.mts +2 -17
- package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/index.d.mts +1 -1
- package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +2 -2
- 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/types/abstraction.d.mts +8 -0
- package/dist/esm/types/abstraction.mjs +2 -0
- package/dist/esm/types/abstraction.mjs.map +1 -0
- package/dist/esm/types/index.mjs +1 -1
- package/dist/esm/types/types.d.mts +2 -1
- package/dist/esm/types/types.mjs +1 -1
- package/dist/esm/utils/helpers.d.mts +18 -2
- package/dist/esm/utils/helpers.mjs +1 -1
- package/dist/esm/utils/index.d.mts +1 -1
- package/dist/esm/utils/index.mjs +1 -1
- package/dist/esm/utils/normalizeBundle.mjs +1 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/src/account/AbstractedAccount.ts +111 -0
- package/src/account/index.ts +1 -0
- package/src/api/account/abstraction.ts +239 -0
- package/src/api/account.ts +6 -1
- package/src/api/aptos.ts +3 -0
- package/src/core/crypto/abstraction.ts +47 -0
- package/src/internal/abstraction.ts +79 -0
- package/src/transactions/authenticator/account.ts +52 -1
- package/src/transactions/scriptComposer/index.ts +8 -7
- package/src/transactions/transactionBuilder/helpers.ts +1 -22
- package/src/transactions/transactionBuilder/remoteAbi.ts +7 -0
- package/src/transactions/transactionBuilder/transactionBuilder.ts +2 -1
- package/src/types/abstraction.ts +6 -0
- package/src/types/types.ts +1 -0
- package/src/utils/helpers.ts +28 -1
- package/src/version.ts +1 -1
- package/dist/common/chunk-IHUCZKG2.js +0 -2
- package/dist/common/chunk-IHUCZKG2.js.map +0 -1
- package/dist/esm/chunk-AIABPCUF.mjs +0 -2
- package/dist/esm/chunk-CWRANLXZ.mjs.map +0 -1
- package/dist/esm/chunk-DAFSKSZ5.mjs +0 -2
- package/dist/esm/chunk-DAFSKSZ5.mjs.map +0 -1
- package/dist/esm/chunk-FQXEX2HN.mjs +0 -2
- package/dist/esm/chunk-FQXEX2HN.mjs.map +0 -1
- package/dist/esm/chunk-GP4TLDVZ.mjs +0 -1
- package/dist/esm/chunk-IJ2QKE4W.mjs +0 -2
- package/dist/esm/chunk-IJ2QKE4W.mjs.map +0 -1
- package/dist/esm/chunk-NDUIXMIA.mjs +0 -2
- package/dist/esm/chunk-NDUIXMIA.mjs.map +0 -1
- package/dist/esm/chunk-Q2C6ZY5N.mjs +0 -4
- package/dist/esm/chunk-Q2C6ZY5N.mjs.map +0 -1
- package/dist/esm/chunk-U2PRGW4O.mjs +0 -2
- package/dist/esm/chunk-U2PRGW4O.mjs.map +0 -1
- package/dist/esm/chunk-UYONA6PP.mjs +0 -2
- package/dist/esm/chunk-UYONA6PP.mjs.map +0 -1
- package/dist/esm/chunk-XHPWHA6B.mjs +0 -2
- /package/dist/esm/{chunk-GP4TLDVZ.mjs.map → account/AbstractedAccount.mjs.map} +0 -0
- /package/dist/esm/{chunk-CYMVZJHC.mjs.map → chunk-2FNFUTFJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-4UYVRG5Z.mjs.map → chunk-2GIPNLDO.mjs.map} +0 -0
- /package/dist/esm/{chunk-UQ7D5CSM.mjs.map → chunk-33CBJFX2.mjs.map} +0 -0
- /package/dist/esm/{chunk-P54RNN4V.mjs.map → chunk-3EY7MT2M.mjs.map} +0 -0
- /package/dist/esm/{chunk-KPLWOVKG.mjs.map → chunk-3HFZN7L5.mjs.map} +0 -0
- /package/dist/esm/{chunk-FC2IYWI7.mjs.map → chunk-4T75XRI2.mjs.map} +0 -0
- /package/dist/esm/{chunk-EBS4BKER.mjs.map → chunk-4UK4MUSD.mjs.map} +0 -0
- /package/dist/esm/{chunk-GL4OJVYH.mjs.map → chunk-5BSMF22B.mjs.map} +0 -0
- /package/dist/esm/{chunk-CDYLZDD2.mjs.map → chunk-6JTNS5O6.mjs.map} +0 -0
- /package/dist/esm/{chunk-UF6SI2QE.mjs.map → chunk-6LGXFXXR.mjs.map} +0 -0
- /package/dist/esm/{chunk-T6NQDM7D.mjs.map → chunk-6PBMD2BQ.mjs.map} +0 -0
- /package/dist/esm/{chunk-ECZYQTNN.mjs.map → chunk-7CYCKCVU.mjs.map} +0 -0
- /package/dist/esm/{chunk-A3NEASNH.mjs.map → chunk-AC3BISWL.mjs.map} +0 -0
- /package/dist/esm/{chunk-QHEKBHNU.mjs.map → chunk-BUTMGMSD.mjs.map} +0 -0
- /package/dist/esm/{chunk-P4VF7BN4.mjs.map → chunk-BYHCW7MI.mjs.map} +0 -0
- /package/dist/esm/{chunk-AD3A7DTH.mjs.map → chunk-CRFLR3ZY.mjs.map} +0 -0
- /package/dist/esm/{chunk-BFIXIXHO.mjs.map → chunk-CXNF73OX.mjs.map} +0 -0
- /package/dist/esm/{chunk-32WLD3F3.mjs.map → chunk-D6T3NYOA.mjs.map} +0 -0
- /package/dist/esm/{chunk-CGTHWGSJ.mjs.map → chunk-DLLDRANJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-KFGXOZ77.mjs.map → chunk-DMS7K76O.mjs.map} +0 -0
- /package/dist/esm/{chunk-KNTAED2Z.mjs.map → chunk-DNJQWGB7.mjs.map} +0 -0
- /package/dist/esm/{chunk-NW2WUKWV.mjs.map → chunk-DNWFDS7F.mjs.map} +0 -0
- /package/dist/esm/{chunk-XIFIACCB.mjs.map → chunk-DWJ3PGWE.mjs.map} +0 -0
- /package/dist/esm/{chunk-KG23XFU2.mjs.map → chunk-G6RLN6ET.mjs.map} +0 -0
- /package/dist/esm/{chunk-G5ZWH5T3.mjs.map → chunk-GQX5KMF7.mjs.map} +0 -0
- /package/dist/esm/{chunk-X3SO2LDX.mjs.map → chunk-H4GZWYIG.mjs.map} +0 -0
- /package/dist/esm/{chunk-SQR3AIY7.mjs.map → chunk-HFCWJ6QL.mjs.map} +0 -0
- /package/dist/esm/{chunk-FQECACH3.mjs.map → chunk-HL2O3T57.mjs.map} +0 -0
- /package/dist/esm/{chunk-PTS3BTOU.mjs.map → chunk-HT2WC3QV.mjs.map} +0 -0
- /package/dist/esm/{chunk-ODEDSSQL.mjs.map → chunk-I7YHK6ZF.mjs.map} +0 -0
- /package/dist/esm/{chunk-N4VVDQA5.mjs.map → chunk-IDTLNF4M.mjs.map} +0 -0
- /package/dist/esm/{chunk-67ZANQ3R.mjs.map → chunk-J7HRQ2IH.mjs.map} +0 -0
- /package/dist/esm/{chunk-H3XZ3FZY.mjs.map → chunk-JF66JS2R.mjs.map} +0 -0
- /package/dist/esm/{chunk-I7JGKVOC.mjs.map → chunk-KEJAUCQF.mjs.map} +0 -0
- /package/dist/esm/{chunk-Y6QTKAQO.mjs.map → chunk-L2AQG3G3.mjs.map} +0 -0
- /package/dist/esm/{chunk-7HLNV3QL.mjs.map → chunk-L6FONDPA.mjs.map} +0 -0
- /package/dist/esm/{chunk-ZJNPBHEI.mjs.map → chunk-N7C6LQPZ.mjs.map} +0 -0
- /package/dist/esm/{chunk-VZELORLW.mjs.map → chunk-O37BZP2G.mjs.map} +0 -0
- /package/dist/esm/{chunk-SOLQ5VON.mjs.map → chunk-OURSLL3I.mjs.map} +0 -0
- /package/dist/esm/{chunk-PHJRCZQ3.mjs.map → chunk-P7SE5LQE.mjs.map} +0 -0
- /package/dist/esm/{chunk-3XH3NNSR.mjs.map → chunk-PNSF3E67.mjs.map} +0 -0
- /package/dist/esm/{chunk-UONSJQUV.mjs.map → chunk-PR3W2QEH.mjs.map} +0 -0
- /package/dist/esm/{chunk-KFCLSJC3.mjs.map → chunk-PWYJWTEM.mjs.map} +0 -0
- /package/dist/esm/{chunk-VCIJX6R4.mjs.map → chunk-Q7RG7KQS.mjs.map} +0 -0
- /package/dist/esm/{chunk-6IIAGMDR.mjs.map → chunk-QBFGY74I.mjs.map} +0 -0
- /package/dist/esm/{chunk-XLFX2YQA.mjs.map → chunk-S47HA7O7.mjs.map} +0 -0
- /package/dist/esm/{chunk-6IPM5P4L.mjs.map → chunk-SCBYJU6K.mjs.map} +0 -0
- /package/dist/esm/{chunk-XGF7UNEW.mjs.map → chunk-TM6IKHMX.mjs.map} +0 -0
- /package/dist/esm/{chunk-FNXO3URE.mjs.map → chunk-U2SJIG2T.mjs.map} +0 -0
- /package/dist/esm/{chunk-SZRZ3HIL.mjs.map → chunk-ULHOJ2BE.mjs.map} +0 -0
- /package/dist/esm/{chunk-4ZJJINCW.mjs.map → chunk-UTXEW2FT.mjs.map} +0 -0
- /package/dist/esm/{chunk-K2CSACQY.mjs.map → chunk-V2EXS6TM.mjs.map} +0 -0
- /package/dist/esm/{chunk-FKJ3GCBI.mjs.map → chunk-V7G2EDNR.mjs.map} +0 -0
- /package/dist/esm/{chunk-R7QOPBWA.mjs.map → chunk-VKDTI6NX.mjs.map} +0 -0
- /package/dist/esm/{chunk-PNDCGNVH.mjs.map → chunk-VOCI2675.mjs.map} +0 -0
- /package/dist/esm/{chunk-VVAKGJDN.mjs.map → chunk-WXDA4CCR.mjs.map} +0 -0
- /package/dist/esm/{chunk-66AQ2MJ6.mjs.map → chunk-X24PSWCX.mjs.map} +0 -0
- /package/dist/esm/{chunk-67BUAZ6O.mjs.map → chunk-X6IHNXWY.mjs.map} +0 -0
- /package/dist/esm/{chunk-JJM6ELMS.mjs.map → chunk-XAPQNCTN.mjs.map} +0 -0
- /package/dist/esm/{chunk-DW3ETAZB.mjs.map → chunk-XDIX7NIP.mjs.map} +0 -0
- /package/dist/esm/{chunk-6XHBRRS6.mjs.map → chunk-XH3BEKII.mjs.map} +0 -0
- /package/dist/esm/{chunk-PUNTBVRJ.mjs.map → chunk-XXHZQFYW.mjs.map} +0 -0
- /package/dist/esm/{chunk-YPGI5HAA.mjs.map → chunk-Y3Y4DVCK.mjs.map} +0 -0
- /package/dist/esm/{chunk-CNCRJ56P.mjs.map → chunk-YIF242TF.mjs.map} +0 -0
- /package/dist/esm/{chunk-CWKNJZB6.mjs.map → chunk-ZCEBDPBJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-Q3VS6AEN.mjs.map → chunk-ZP5EBIBE.mjs.map} +0 -0
package/dist/common/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as Serializable, T as TransactionArgument, H as HexInput, a as Serializer, D as Deserializer, E as EntryFunctionArgument, U as Uint8, b as Uint16, c as Uint32, A as AnyNumber, d as Deserializable, e as Hex, f as AuthenticationKeyScheme, g as AccountAddress, P as PrivateKeyVariants, h as AnyPublicKeyVariant, i as EphemeralPublicKeyVariant, N as Network, C as Client, j as ClientConfig, F as FullNodeConfig, I as IndexerConfig, k as FaucetConfig, l as AptosSettings, m as EphemeralCertificateVariant, Z as ZkpVariant, L as LedgerVersionArg, n as AccountAddressInput, M as MoveModuleId, o as ScriptFunctionArgument, p as MoveFunctionId, q as MoveStructId, r as MoveValue, s as MoveFunctionGenericTypeParam, t as SigningSchemeInput, u as SigningScheme, v as
|
|
2
|
-
export { aG as AccountAuthenticatorVariant, bp as AccountSignature, at as AddressInvalidReason, aH as AnySignatureVariant, aZ as BlockEndInfo, a_ as BlockEpilogueTransactionResponse, aW as BlockMetadataTransactionResponse, aM as ClientHeadersType, b6 as DecodedTableData, b7 as DeletedTableData, bM as DeriveScheme, bs as DirectWriteSet, b9 as EntryFunctionPayloadResponse, aI as EphemeralSignatureVariant, bu as Event, bt as EventGuid, bP as GenerateAccount, bN as GenerateAccountWithEd25519, bO as GenerateAccountWithSingleSignerSecp256k1Key, bc as GenesisPayload, aV as GenesisTransactionResponse, aw as HexInvalidReason, bH as MoveAbility, bB as MoveAddressType, bG as MoveFunctionVisibility, bJ as MoveModule, bC as MoveObjectType, bD as MoveOptionType, bd as MoveScriptBytecode, bK as MoveStruct, bI as MoveStructField, bE as MoveStructType, bF as MoveType, bz as MoveUint128Type, bw as MoveUint16Type, bA as MoveUint256Type, bx as MoveUint32Type, by as MoveUint64Type, bv as MoveUint8Type, bb as MultisigPayloadResponse, bV as NetworkToChainId, bS as NetworkToFaucetAPI, bQ as NetworkToIndexerAPI, bW as NetworkToNetworkName, bR as NetworkToNodeAPI, bT as NetworkToPepperAPI, bU as NetworkToProverAPI, ay as OrderBy, az as OrderByValue, au as ParsingError, av as ParsingResult, bL as RoleType, ba as ScriptPayloadResponse, aC as ScriptTransactionArgumentVariants, br as ScriptWriteSet, aX as StateCheckpointTransactionResponse, aA as TokenStandard, aF as TransactionAuthenticatorVariant, bk as TransactionEd25519Signature, bo as TransactionFeePayerSignature, bn as TransactionMultiAgentSignature, bm as TransactionMultiEd25519Signature, b8 as TransactionPayloadResponse, aD as TransactionPayloadVariants, aN as TransactionResponseType, bl as TransactionSecp256k1Signature, be as TransactionSignature, aE as TransactionVariants, aB as TypeTagVariants, aK as Uint128, aL as Uint256, aJ as Uint64, aY as ValidatorTransactionResponse, bq as WriteSet, a$ as WriteSetChange, b0 as WriteSetChangeDeleteModule, b1 as WriteSetChangeDeleteResource, b2 as WriteSetChangeDeleteTableItem, b3 as WriteSetChangeWriteModule, b4 as WriteSetChangeWriteResource, b5 as WriteSetChangeWriteTableItem, aq as ensureBoolean, ax as hexToAsciiString, aU as isBlockEpilogueTransactionResponse, aR as isBlockMetadataTransactionResponse, bf as isEd25519Signature, bi as isFeePayerSignature, aQ as isGenesisTransactionResponse, bh as isMultiAgentSignature, bj as isMultiEd25519Signature, aO as isPendingTransactionResponse, bg as isSecp256k1Signature, aS as isStateCheckpointTransactionResponse, aP as isUserTransactionResponse, aT as isValidatorTransactionResponse, ar as outOfRangeErrorMessage, as as validateNumberInRange } from './accountAddress-
|
|
1
|
+
import { S as Serializable, T as TransactionArgument, H as HexInput, a as Serializer, D as Deserializer, E as EntryFunctionArgument, U as Uint8, b as Uint16, c as Uint32, A as AnyNumber, d as Deserializable, e as Hex, f as AuthenticationKeyScheme, g as AccountAddress, P as PrivateKeyVariants, h as AnyPublicKeyVariant, i as EphemeralPublicKeyVariant, N as Network, C as Client, j as ClientConfig, F as FullNodeConfig, I as IndexerConfig, k as FaucetConfig, l as AptosSettings, m as EphemeralCertificateVariant, Z as ZkpVariant, L as LedgerVersionArg, n as AccountAddressInput, M as MoveModuleId, o as ScriptFunctionArgument, p as MoveFunctionId, q as MoveStructId, r as MoveValue, s as MoveFunctionGenericTypeParam, t as SigningSchemeInput, u as SigningScheme, v as MoveFunction, w as AccountData, x as PaginationArgs, y as MoveModuleBytecode, z as TransactionResponse, B as MoveResource, G as TokenStandardArg, O as OrderByArg, J as GetAccountOwnedTokensQueryResponse, K as GetAccountOwnedTokensFromCollectionResponse, Q as GetAccountCollectionsWithOwnedTokenResponse, R as GetAccountCoinsDataResponse, W as WhereArg, V as GetObjectDataQueryResponse, X as GetCollectionDataResponse, Y as GetTokenDataResponse, _ as GetCurrentTokenOwnershipResponse, $ as GetOwnedTokensResponse, a0 as GetTokenActivityResponse, a1 as GetEventsResponse, a2 as WaitForTransactionOptions, a3 as UserTransactionResponse, a4 as GetFungibleAssetMetadataResponse, a5 as GetFungibleAssetActivitiesResponse, a6 as GetCurrentFungibleAssetBalancesResponse, a7 as LedgerInfo, a8 as Block, a9 as GetChainTopUserTransactionsResponse, aa as GraphqlQuery, ab as GetProcessorStatusResponse, ac as GetANSNameResponse, ad as GetNumberOfDelegatorsResponse, ae as GetDelegatedStakingActivitiesResponse, af as PendingTransactionResponse, ag as CommittedTransactionResponse, ah as GasEstimation, ai as TableItemRequest, aj as GetTableItemsDataResponse, ak as GetTableItemsMetadataResponse, al as ClientRequest, am as ClientResponse, an as AptosRequest, ao as AptosResponse, ap as MimeType } from './accountAddress-CDtCLtJA.js';
|
|
2
|
+
export { aG as AccountAuthenticatorVariant, bp as AccountSignature, at as AddressInvalidReason, aH as AnySignatureVariant, aZ as BlockEndInfo, a_ as BlockEpilogueTransactionResponse, aW as BlockMetadataTransactionResponse, aM as ClientHeadersType, b6 as DecodedTableData, b7 as DeletedTableData, bM as DeriveScheme, bs as DirectWriteSet, b9 as EntryFunctionPayloadResponse, aI as EphemeralSignatureVariant, bu as Event, bt as EventGuid, bP as GenerateAccount, bN as GenerateAccountWithEd25519, bO as GenerateAccountWithSingleSignerSecp256k1Key, bc as GenesisPayload, aV as GenesisTransactionResponse, aw as HexInvalidReason, bH as MoveAbility, bB as MoveAddressType, bG as MoveFunctionVisibility, bJ as MoveModule, bC as MoveObjectType, bD as MoveOptionType, bd as MoveScriptBytecode, bK as MoveStruct, bI as MoveStructField, bE as MoveStructType, bF as MoveType, bz as MoveUint128Type, bw as MoveUint16Type, bA as MoveUint256Type, bx as MoveUint32Type, by as MoveUint64Type, bv as MoveUint8Type, bb as MultisigPayloadResponse, bV as NetworkToChainId, bS as NetworkToFaucetAPI, bQ as NetworkToIndexerAPI, bW as NetworkToNetworkName, bR as NetworkToNodeAPI, bT as NetworkToPepperAPI, bU as NetworkToProverAPI, ay as OrderBy, az as OrderByValue, au as ParsingError, av as ParsingResult, bL as RoleType, ba as ScriptPayloadResponse, aC as ScriptTransactionArgumentVariants, br as ScriptWriteSet, aX as StateCheckpointTransactionResponse, aA as TokenStandard, aF as TransactionAuthenticatorVariant, bk as TransactionEd25519Signature, bo as TransactionFeePayerSignature, bn as TransactionMultiAgentSignature, bm as TransactionMultiEd25519Signature, b8 as TransactionPayloadResponse, aD as TransactionPayloadVariants, aN as TransactionResponseType, bl as TransactionSecp256k1Signature, be as TransactionSignature, aE as TransactionVariants, aB as TypeTagVariants, aK as Uint128, aL as Uint256, aJ as Uint64, aY as ValidatorTransactionResponse, bq as WriteSet, a$ as WriteSetChange, b0 as WriteSetChangeDeleteModule, b1 as WriteSetChangeDeleteResource, b2 as WriteSetChangeDeleteTableItem, b3 as WriteSetChangeWriteModule, b4 as WriteSetChangeWriteResource, b5 as WriteSetChangeWriteTableItem, aq as ensureBoolean, ax as hexToAsciiString, aU as isBlockEpilogueTransactionResponse, aR as isBlockMetadataTransactionResponse, bf as isEd25519Signature, bi as isFeePayerSignature, aQ as isGenesisTransactionResponse, bh as isMultiAgentSignature, bj as isMultiEd25519Signature, aO as isPendingTransactionResponse, bg as isSecp256k1Signature, aS as isStateCheckpointTransactionResponse, aP as isUserTransactionResponse, aT as isValidatorTransactionResponse, ar as outOfRangeErrorMessage, as as validateNumberInRange } from './accountAddress-CDtCLtJA.js';
|
|
3
3
|
import { CallArgument } from '@aptos-labs/script-composer-pack';
|
|
4
4
|
export { CallArgument } from '@aptos-labs/script-composer-pack';
|
|
5
5
|
import EventEmitter from 'eventemitter3';
|
|
@@ -3565,6 +3565,41 @@ declare function bigIntToBytesLE(value: bigint | number, length: number): Uint8A
|
|
|
3565
3565
|
*/
|
|
3566
3566
|
declare function poseidonHash(inputs: (number | bigint | string)[]): bigint;
|
|
3567
3567
|
|
|
3568
|
+
/**
|
|
3569
|
+
* Creates an object address from creator address and seed
|
|
3570
|
+
*
|
|
3571
|
+
* @param creatorAddress The object creator account address
|
|
3572
|
+
* @param seed The seed in either Uint8Array | string type
|
|
3573
|
+
*
|
|
3574
|
+
* @returns The object account address
|
|
3575
|
+
* @group Implementation
|
|
3576
|
+
* @category Account (On-Chain Model)
|
|
3577
|
+
*/
|
|
3578
|
+
declare const createObjectAddress: (creatorAddress: AccountAddress, seed: Uint8Array | string) => AccountAddress;
|
|
3579
|
+
/**
|
|
3580
|
+
* Creates a resource address from creator address and seed
|
|
3581
|
+
*
|
|
3582
|
+
* @param creatorAddress The creator account address
|
|
3583
|
+
* @param seed The seed in either Uint8Array | string type
|
|
3584
|
+
*
|
|
3585
|
+
* @returns The resource account address
|
|
3586
|
+
* @group Implementation
|
|
3587
|
+
* @category Account (On-Chain Model)
|
|
3588
|
+
*/
|
|
3589
|
+
declare const createResourceAddress: (creatorAddress: AccountAddress, seed: Uint8Array | string) => AccountAddress;
|
|
3590
|
+
/**
|
|
3591
|
+
* Creates a token object address from creator address, collection name and token name
|
|
3592
|
+
*
|
|
3593
|
+
* @param creatorAddress The token creator account address
|
|
3594
|
+
* @param collectionName The collection name
|
|
3595
|
+
* @param tokenName The token name
|
|
3596
|
+
*
|
|
3597
|
+
* @returns The token account address
|
|
3598
|
+
* @group Implementation
|
|
3599
|
+
* @category Account (On-Chain Model)
|
|
3600
|
+
*/
|
|
3601
|
+
declare const createTokenAddress: (creatorAddress: AccountAddress, collectionName: string, tokenName: string) => AccountAddress;
|
|
3602
|
+
|
|
3568
3603
|
/**
|
|
3569
3604
|
* Represents an account authenticator that can handle multiple authentication variants.
|
|
3570
3605
|
* This class serves as a base for different types of account authenticators, allowing for serialization
|
|
@@ -3713,41 +3748,14 @@ declare class AccountAuthenticatorNoAccountAuthenticator extends AccountAuthenti
|
|
|
3713
3748
|
serialize(serializer: Serializer): void;
|
|
3714
3749
|
static load(deserializer: Deserializer): AccountAuthenticatorNoAccountAuthenticator;
|
|
3715
3750
|
}
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
* @group Implementation
|
|
3725
|
-
* @category Account (On-Chain Model)
|
|
3726
|
-
*/
|
|
3727
|
-
declare const createObjectAddress: (creatorAddress: AccountAddress, seed: Uint8Array | string) => AccountAddress;
|
|
3728
|
-
/**
|
|
3729
|
-
* Creates a resource address from creator address and seed
|
|
3730
|
-
*
|
|
3731
|
-
* @param creatorAddress The creator account address
|
|
3732
|
-
* @param seed The seed in either Uint8Array | string type
|
|
3733
|
-
*
|
|
3734
|
-
* @returns The resource account address
|
|
3735
|
-
* @group Implementation
|
|
3736
|
-
* @category Account (On-Chain Model)
|
|
3737
|
-
*/
|
|
3738
|
-
declare const createResourceAddress: (creatorAddress: AccountAddress, seed: Uint8Array | string) => AccountAddress;
|
|
3739
|
-
/**
|
|
3740
|
-
* Creates a token object address from creator address, collection name and token name
|
|
3741
|
-
*
|
|
3742
|
-
* @param creatorAddress The token creator account address
|
|
3743
|
-
* @param collectionName The collection name
|
|
3744
|
-
* @param tokenName The token name
|
|
3745
|
-
*
|
|
3746
|
-
* @returns The token account address
|
|
3747
|
-
* @group Implementation
|
|
3748
|
-
* @category Account (On-Chain Model)
|
|
3749
|
-
*/
|
|
3750
|
-
declare const createTokenAddress: (creatorAddress: AccountAddress, collectionName: string, tokenName: string) => AccountAddress;
|
|
3751
|
+
declare class AccountAuthenticatorAbstraction extends AccountAuthenticator {
|
|
3752
|
+
readonly functionInfo: string;
|
|
3753
|
+
readonly signingMessageDigest: Hex;
|
|
3754
|
+
readonly authenticator: Hex;
|
|
3755
|
+
constructor(functionInfo: string, signingMessageDigest: HexInput, authenticator: HexInput);
|
|
3756
|
+
serialize(serializer: Serializer): void;
|
|
3757
|
+
static load(deserializer: Deserializer): AccountAuthenticatorAbstraction;
|
|
3758
|
+
}
|
|
3751
3759
|
|
|
3752
3760
|
/**
|
|
3753
3761
|
* Represents a ChainId that can be serialized and deserialized.
|
|
@@ -6837,2066 +6845,70 @@ declare namespace AccountUtils {
|
|
|
6837
6845
|
function fromBytes(bytes: Uint8Array): Account$1;
|
|
6838
6846
|
}
|
|
6839
6847
|
|
|
6840
|
-
|
|
6841
|
-
|
|
6842
|
-
|
|
6843
|
-
|
|
6844
|
-
|
|
6845
|
-
|
|
6848
|
+
declare class AbstractSignature extends Signature {
|
|
6849
|
+
readonly value: Hex;
|
|
6850
|
+
constructor(value: HexInput);
|
|
6851
|
+
serialize(serializer: Serializer): void;
|
|
6852
|
+
static deserialize(deserializer: Deserializer): AbstractSignature;
|
|
6853
|
+
}
|
|
6854
|
+
declare class AbstractPublicKey extends AccountPublicKey {
|
|
6855
|
+
readonly accountAddress: AccountAddress;
|
|
6856
|
+
constructor(accountAddress: AccountAddress);
|
|
6857
|
+
authKey(): AuthenticationKey;
|
|
6858
|
+
verifySignature(args: VerifySignatureArgs): boolean;
|
|
6859
|
+
serialize(serializer: Serializer): void;
|
|
6860
|
+
}
|
|
6861
|
+
|
|
6862
|
+
type AbstractedAccountConstructorArgs = {
|
|
6846
6863
|
/**
|
|
6847
|
-
*
|
|
6848
|
-
*
|
|
6849
|
-
* @param config - The configuration settings for the Aptos client.
|
|
6850
|
-
*
|
|
6851
|
-
* @example
|
|
6852
|
-
* ```typescript
|
|
6853
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
6854
|
-
*
|
|
6855
|
-
* async function runExample() {
|
|
6856
|
-
* // Initialize the Aptos client with testnet configuration
|
|
6857
|
-
* const config = new AptosConfig({ network: Network.TESTNET }); // specify your own network if needed
|
|
6858
|
-
* const aptos = new Aptos(config);
|
|
6859
|
-
*
|
|
6860
|
-
* console.log("Aptos client initialized:", aptos);
|
|
6861
|
-
* }
|
|
6862
|
-
* runExample().catch(console.error);
|
|
6863
|
-
* ```
|
|
6864
|
-
* @group Account
|
|
6864
|
+
* The account address of the account.
|
|
6865
6865
|
*/
|
|
6866
|
-
|
|
6866
|
+
accountAddress: AccountAddress;
|
|
6867
6867
|
/**
|
|
6868
|
-
*
|
|
6869
|
-
*
|
|
6870
|
-
* @param args - The arguments for retrieving account information.
|
|
6871
|
-
* @param args.accountAddress - The Aptos account address to query.
|
|
6872
|
-
* @returns The account data.
|
|
6873
|
-
*
|
|
6874
|
-
* @example
|
|
6875
|
-
* ```typescript
|
|
6876
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
6877
|
-
*
|
|
6878
|
-
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
6879
|
-
* const aptos = new Aptos(config);
|
|
6868
|
+
* The signer function signs transactions and returns the `authenticator` bytes in the `AbstractionAuthData`.
|
|
6880
6869
|
*
|
|
6881
|
-
*
|
|
6882
|
-
*
|
|
6883
|
-
* const accountInfo = await aptos.getAccountInfo({ accountAddress: "0x1" }); // replace with a real account address
|
|
6884
|
-
* console.log(accountInfo);
|
|
6885
|
-
* }
|
|
6886
|
-
* runExample().catch(console.error);
|
|
6887
|
-
* ```
|
|
6888
|
-
* @group Account
|
|
6870
|
+
* @param digest - The SHA256 hash of the transaction signing message
|
|
6871
|
+
* @returns The `authenticator` bytes that can be used to verify the signature.
|
|
6889
6872
|
*/
|
|
6890
|
-
|
|
6891
|
-
accountAddress: AccountAddressInput;
|
|
6892
|
-
}): Promise<AccountData>;
|
|
6873
|
+
signer: (digest: HexInput) => HexInput;
|
|
6893
6874
|
/**
|
|
6894
|
-
*
|
|
6895
|
-
* This function may call the API multiple times to auto paginate through results.
|
|
6896
|
-
*
|
|
6897
|
-
* @param args.accountAddress - The Aptos account address to query modules for.
|
|
6898
|
-
* @param args.options.offset - The cursor to start returning results from. Note, this is obfuscated and is not an index.
|
|
6899
|
-
* @param args.options.limit - The maximum number of results to return.
|
|
6900
|
-
* @param args.options.ledgerVersion - The ledger version to query; if not provided, it retrieves the latest version.
|
|
6901
|
-
*
|
|
6902
|
-
* @returns - The account modules associated with the specified address.
|
|
6875
|
+
* The authentication function that will be used to verify the signature.
|
|
6903
6876
|
*
|
|
6904
6877
|
* @example
|
|
6905
|
-
* ```
|
|
6906
|
-
*
|
|
6907
|
-
*
|
|
6908
|
-
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
6909
|
-
* const aptos = new Aptos(config);
|
|
6910
|
-
*
|
|
6911
|
-
* async function runExample() {
|
|
6912
|
-
* // Fetching account modules for a specific account
|
|
6913
|
-
* const accountModules = await aptos.getAccountModules({
|
|
6914
|
-
* accountAddress: "0x1", // replace with a real account address
|
|
6915
|
-
* options: {
|
|
6916
|
-
* offset: 0, // starting from the first module
|
|
6917
|
-
* limit: 10, // limiting to 10 modules
|
|
6918
|
-
* },
|
|
6919
|
-
* });
|
|
6920
|
-
*
|
|
6921
|
-
* console.log(accountModules);
|
|
6922
|
-
* }
|
|
6923
|
-
* runExample().catch(console.error);
|
|
6878
|
+
* ```ts
|
|
6879
|
+
* const authenticationFunction = `${accountAddress}::permissioned_delegation::authenticate`;
|
|
6924
6880
|
* ```
|
|
6925
|
-
* @group Account
|
|
6926
6881
|
*/
|
|
6927
|
-
|
|
6928
|
-
|
|
6929
|
-
|
|
6930
|
-
|
|
6882
|
+
authenticationFunction: string;
|
|
6883
|
+
};
|
|
6884
|
+
declare class AbstractedAccount extends Account$1 {
|
|
6885
|
+
readonly publicKey: AbstractPublicKey;
|
|
6886
|
+
readonly accountAddress: AccountAddress;
|
|
6887
|
+
readonly authenticationFunction: string;
|
|
6888
|
+
readonly signingScheme = SigningScheme.SingleKey;
|
|
6889
|
+
constructor({ signer, accountAddress, authenticationFunction }: AbstractedAccountConstructorArgs);
|
|
6931
6890
|
/**
|
|
6932
|
-
*
|
|
6933
|
-
*
|
|
6934
|
-
* @param args.accountAddress - The Aptos account address.
|
|
6935
|
-
* @param args.moduleName - The name of the module.
|
|
6936
|
-
* @param args.options.ledgerVersion - The ledger version to query; if not provided, it will get the latest version.
|
|
6937
|
-
*
|
|
6938
|
-
* @returns The account module associated with the specified account address and module name.
|
|
6939
|
-
*
|
|
6940
|
-
* @example
|
|
6941
|
-
* ```typescript
|
|
6942
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
6891
|
+
* Creates an `AbstractedAccount` from an `Ed25519Account` that has a permissioned signer function and
|
|
6892
|
+
* using the `0x1::permissioned_delegation::authenticate` function to verify the signature.
|
|
6943
6893
|
*
|
|
6944
|
-
*
|
|
6945
|
-
*
|
|
6946
|
-
*
|
|
6947
|
-
* async function runExample() {
|
|
6948
|
-
* // Get the account module for a specific account address and module name
|
|
6949
|
-
* const module = await aptos.getAccountModule({
|
|
6950
|
-
* accountAddress: "0x1", // replace with a real account address
|
|
6951
|
-
* moduleName: "MyModule" // specify the module name
|
|
6952
|
-
* });
|
|
6953
|
-
*
|
|
6954
|
-
* console.log(module);
|
|
6955
|
-
* }
|
|
6956
|
-
* runExample().catch(console.error);
|
|
6957
|
-
* ```
|
|
6958
|
-
* @group Account
|
|
6894
|
+
* @param signer - The `Ed25519Account` that can be used to sign permissioned transactions.
|
|
6895
|
+
* @returns The `AbstractedAccount`
|
|
6959
6896
|
*/
|
|
6960
|
-
|
|
6961
|
-
|
|
6962
|
-
|
|
6963
|
-
|
|
6964
|
-
|
|
6897
|
+
static fromPermissionedSigner({ signer, accountAddress, }: {
|
|
6898
|
+
signer: Ed25519Account;
|
|
6899
|
+
accountAddress?: AccountAddress;
|
|
6900
|
+
}): AbstractedAccount;
|
|
6901
|
+
signWithAuthenticator(message: HexInput): AccountAuthenticatorAbstraction;
|
|
6902
|
+
signTransactionWithAuthenticator(transaction: AnyRawTransaction): AccountAuthenticatorAbstraction;
|
|
6903
|
+
sign: (message: HexInput) => AbstractSignature;
|
|
6904
|
+
signTransaction(transaction: AnyRawTransaction): AbstractSignature;
|
|
6965
6905
|
/**
|
|
6966
|
-
*
|
|
6967
|
-
*
|
|
6968
|
-
*
|
|
6969
|
-
* @param args.accountAddress - The Aptos account address to query transactions for.
|
|
6970
|
-
* @param args.options - Optional pagination arguments.
|
|
6971
|
-
* @param args.options.offset - The number of transactions to start returning results from.
|
|
6972
|
-
* @param args.options.limit - The maximum number of results to return.
|
|
6973
|
-
*
|
|
6974
|
-
* @returns The account transactions.
|
|
6975
|
-
*
|
|
6976
|
-
* @example
|
|
6977
|
-
* ```typescript
|
|
6978
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
6979
|
-
*
|
|
6980
|
-
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
6981
|
-
* const aptos = new Aptos(config);
|
|
6982
|
-
*
|
|
6983
|
-
* async function runExample() {
|
|
6984
|
-
* // Fetch transactions for a specific account
|
|
6985
|
-
* const transactions = await aptos.getAccountTransactions({
|
|
6986
|
-
* accountAddress: "0x1", // replace with a real account address
|
|
6987
|
-
* options: {
|
|
6988
|
-
* offset: 0, // starting from the first transaction
|
|
6989
|
-
* limit: 10, // limiting to 10 transactions
|
|
6990
|
-
* },
|
|
6991
|
-
* });
|
|
6906
|
+
* Update the signer function for the account. This can be done after asynchronous operations are complete
|
|
6907
|
+
* to update the context of the signer function.
|
|
6992
6908
|
*
|
|
6993
|
-
*
|
|
6994
|
-
* }
|
|
6995
|
-
* runExample().catch(console.error);
|
|
6996
|
-
* ```
|
|
6997
|
-
* @group Account
|
|
6909
|
+
* @param signer - The new signer function to use for the account.
|
|
6998
6910
|
*/
|
|
6999
|
-
|
|
7000
|
-
accountAddress: AccountAddressInput;
|
|
7001
|
-
options?: PaginationArgs;
|
|
7002
|
-
}): Promise<TransactionResponse[]>;
|
|
7003
|
-
/**
|
|
7004
|
-
* Queries all account resources given an account address.
|
|
7005
|
-
* This function may call the API multiple times to auto paginate through results.
|
|
7006
|
-
*
|
|
7007
|
-
* @param args.accountAddress - The Aptos account address to query resources for.
|
|
7008
|
-
* @param args.options.offset - The cursor to start returning results from. Note, this is obfuscated and is not an index.
|
|
7009
|
-
* @param args.options.limit - The maximum number of results to return.
|
|
7010
|
-
* @param args.options.ledgerVersion - The ledger version to query; if not provided, it will get the latest version.
|
|
7011
|
-
* @returns Account resources.
|
|
7012
|
-
*
|
|
7013
|
-
* @example
|
|
7014
|
-
* ```typescript
|
|
7015
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
7016
|
-
*
|
|
7017
|
-
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
7018
|
-
* const aptos = new Aptos(config);
|
|
7019
|
-
*
|
|
7020
|
-
* async function runExample() {
|
|
7021
|
-
* // Fetching account resources for a specific account address
|
|
7022
|
-
* const resources = await aptos.getAccountResources({ accountAddress: "0x1" }); // replace with a real account address
|
|
7023
|
-
* console.log(resources);
|
|
7024
|
-
* }
|
|
7025
|
-
* runExample().catch(console.error);
|
|
7026
|
-
* ```
|
|
7027
|
-
* @group Account
|
|
7028
|
-
*/
|
|
7029
|
-
getAccountResources(args: {
|
|
7030
|
-
accountAddress: AccountAddressInput;
|
|
7031
|
-
options?: PaginationArgs & LedgerVersionArg;
|
|
7032
|
-
}): Promise<MoveResource[]>;
|
|
7033
|
-
/**
|
|
7034
|
-
* Queries a specific account resource given an account address and resource type.
|
|
7035
|
-
*
|
|
7036
|
-
* @template T - The typed output of the resource.
|
|
7037
|
-
* @param args.accountAddress - The Aptos account address to query.
|
|
7038
|
-
* @param args.resourceType - The string representation of an on-chain Move struct type, e.g., "0x1::aptos_coin::AptosCoin".
|
|
7039
|
-
* @param args.options.ledgerVersion - The ledger version to query; if not provided, it will get the latest version.
|
|
7040
|
-
* @returns The account resource of the specified type.
|
|
7041
|
-
*
|
|
7042
|
-
* @example
|
|
7043
|
-
* ```typescript
|
|
7044
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
7045
|
-
*
|
|
7046
|
-
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
7047
|
-
* const aptos = new Aptos(config);
|
|
7048
|
-
*
|
|
7049
|
-
* async function runExample() {
|
|
7050
|
-
* // Get the account resource for a specific account address and resource type
|
|
7051
|
-
* const resource = await aptos.getAccountResource({
|
|
7052
|
-
* accountAddress: "0x1", // replace with a real account address
|
|
7053
|
-
* resourceType: "0x1::aptos_coin::AptosCoin"
|
|
7054
|
-
* });
|
|
7055
|
-
*
|
|
7056
|
-
* console.log(resource);
|
|
7057
|
-
* }
|
|
7058
|
-
* runExample().catch(console.error);
|
|
7059
|
-
* ```
|
|
7060
|
-
* @group Account
|
|
7061
|
-
*/
|
|
7062
|
-
getAccountResource<T extends {} = any>(args: {
|
|
7063
|
-
accountAddress: AccountAddressInput;
|
|
7064
|
-
resourceType: MoveStructId;
|
|
7065
|
-
options?: LedgerVersionArg;
|
|
7066
|
-
}): Promise<T>;
|
|
7067
|
-
/**
|
|
7068
|
-
* Looks up the account address for a given authentication key, handling both rotated and non-rotated keys.
|
|
7069
|
-
*
|
|
7070
|
-
* @param args.authenticationKey - The authentication key for which to look up the account address.
|
|
7071
|
-
* @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.
|
|
7072
|
-
* @param args.options.ledgerVersion - The ledger version to query; if not provided, it will get the latest version.
|
|
7073
|
-
* @returns Promise<AccountAddress> - The account address associated with the authentication key.
|
|
7074
|
-
*
|
|
7075
|
-
* @example
|
|
7076
|
-
* ```typescript
|
|
7077
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
7078
|
-
*
|
|
7079
|
-
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
7080
|
-
* const aptos = new Aptos(config);
|
|
7081
|
-
*
|
|
7082
|
-
* async function runExample() {
|
|
7083
|
-
* // Look up the original account address for a given authentication key
|
|
7084
|
-
* const accountAddress = await aptos.lookupOriginalAccountAddress({
|
|
7085
|
-
* authenticationKey: "0x1", // replace with a real authentication key
|
|
7086
|
-
* });
|
|
7087
|
-
*
|
|
7088
|
-
* console.log("Original Account Address:", accountAddress);
|
|
7089
|
-
* }
|
|
7090
|
-
* runExample().catch(console.error);
|
|
7091
|
-
* ```
|
|
7092
|
-
* @group Account
|
|
7093
|
-
*/
|
|
7094
|
-
lookupOriginalAccountAddress(args: {
|
|
7095
|
-
authenticationKey: AccountAddressInput;
|
|
7096
|
-
minimumLedgerVersion?: AnyNumber;
|
|
7097
|
-
options?: LedgerVersionArg;
|
|
7098
|
-
}): Promise<AccountAddress>;
|
|
7099
|
-
/**
|
|
7100
|
-
* Queries the current count of tokens owned by a specified account.
|
|
7101
|
-
*
|
|
7102
|
-
* @param args - The parameters for the query.
|
|
7103
|
-
* @param args.accountAddress - The account address to query the token count for.
|
|
7104
|
-
* @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.
|
|
7105
|
-
* @returns The current count of tokens owned by the account.
|
|
7106
|
-
*
|
|
7107
|
-
* @example
|
|
7108
|
-
* ```typescript
|
|
7109
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
7110
|
-
*
|
|
7111
|
-
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
7112
|
-
* const aptos = new Aptos(config);
|
|
7113
|
-
*
|
|
7114
|
-
* async function runExample() {
|
|
7115
|
-
* // Get the count of tokens owned by the account
|
|
7116
|
-
* const tokensCount = await aptos.getAccountTokensCount({ accountAddress: "0x1" }); // replace with a real account address
|
|
7117
|
-
* console.log(`Tokens Count: ${tokensCount}`);
|
|
7118
|
-
* }
|
|
7119
|
-
* runExample().catch(console.error);
|
|
7120
|
-
* ```
|
|
7121
|
-
* @group Account
|
|
7122
|
-
*/
|
|
7123
|
-
getAccountTokensCount(args: {
|
|
7124
|
-
accountAddress: AccountAddressInput;
|
|
7125
|
-
minimumLedgerVersion?: AnyNumber;
|
|
7126
|
-
}): Promise<number>;
|
|
7127
|
-
/**
|
|
7128
|
-
* Queries the tokens currently owned by a specified account, including NFTs and fungible tokens.
|
|
7129
|
-
* If desired, you can filter the results by a specific token standard.
|
|
7130
|
-
*
|
|
7131
|
-
* @param args.accountAddress The account address for which to retrieve owned tokens.
|
|
7132
|
-
* @param args.minimumLedgerVersion Optional ledger version to sync up to before querying.
|
|
7133
|
-
* @param args.options.tokenStandard Optional filter for the NFT standard to query for.
|
|
7134
|
-
* @param args.options.offset Optional number to start returning results from.
|
|
7135
|
-
* @param args.options.limit Optional number of results to return.
|
|
7136
|
-
* @param args.options.orderBy Optional order to sort the tokens by.
|
|
7137
|
-
* @returns An array of tokens with their respective data.
|
|
7138
|
-
*
|
|
7139
|
-
* @example
|
|
7140
|
-
* ```typescript
|
|
7141
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
7142
|
-
*
|
|
7143
|
-
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
7144
|
-
* const aptos = new Aptos(config);
|
|
7145
|
-
*
|
|
7146
|
-
* async function runExample() {
|
|
7147
|
-
* // Get the tokens owned by a specific account
|
|
7148
|
-
* const accountOwnedTokens = await aptos.getAccountOwnedTokens({
|
|
7149
|
-
* accountAddress: "0x1", // replace with a real account address
|
|
7150
|
-
* options: {
|
|
7151
|
-
* limit: 10, // specify how many tokens to return
|
|
7152
|
-
* orderBy: "created_at", // specify the order of the results
|
|
7153
|
-
* },
|
|
7154
|
-
* });
|
|
7155
|
-
*
|
|
7156
|
-
* console.log(accountOwnedTokens);
|
|
7157
|
-
* }
|
|
7158
|
-
* runExample().catch(console.error);
|
|
7159
|
-
* ```
|
|
7160
|
-
* @group Account
|
|
7161
|
-
*/
|
|
7162
|
-
getAccountOwnedTokens(args: {
|
|
7163
|
-
accountAddress: AccountAddressInput;
|
|
7164
|
-
minimumLedgerVersion?: AnyNumber;
|
|
7165
|
-
options?: TokenStandardArg & PaginationArgs & OrderByArg<GetAccountOwnedTokensQueryResponse[0]>;
|
|
7166
|
-
}): Promise<GetAccountOwnedTokensQueryResponse>;
|
|
7167
|
-
/**
|
|
7168
|
-
* Queries all current tokens of a specific collection that an account owns by the collection address.
|
|
7169
|
-
* This query returns all tokens (v1 and v2 standards) an account owns, including NFTs, fungible, soulbound, etc.
|
|
7170
|
-
* If you want to get only the token from a specific standard, you can pass an optional tokenStandard parameter.
|
|
7171
|
-
*
|
|
7172
|
-
* @param args.accountAddress - The account address we want to get the tokens for.
|
|
7173
|
-
* @param args.collectionAddress - The address of the collection being queried.
|
|
7174
|
-
* @param args.minimumLedgerVersion - Optional ledger version to sync up to, before querying.
|
|
7175
|
-
* @param args.options.tokenStandard - The NFT standard to query for.
|
|
7176
|
-
* @param args.options.offset - The number token to start returning results from.
|
|
7177
|
-
* @param args.options.limit - The number of results to return.
|
|
7178
|
-
* @param args.options.orderBy - The order to sort the tokens by.
|
|
7179
|
-
* @returns Tokens array with the token data.
|
|
7180
|
-
*
|
|
7181
|
-
* @example
|
|
7182
|
-
* ```typescript
|
|
7183
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
7184
|
-
*
|
|
7185
|
-
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
7186
|
-
* const aptos = new Aptos(config);
|
|
7187
|
-
*
|
|
7188
|
-
* async function runExample() {
|
|
7189
|
-
* // Get tokens owned by a specific account in a specific collection
|
|
7190
|
-
* const accountOwnedTokens = await aptos.getAccountOwnedTokensFromCollectionAddress({
|
|
7191
|
-
* accountAddress: "0x1", // replace with a real account address
|
|
7192
|
-
* collectionAddress: "0x2", // replace with a real collection address
|
|
7193
|
-
* });
|
|
7194
|
-
*
|
|
7195
|
-
* console.log(accountOwnedTokens);
|
|
7196
|
-
* }
|
|
7197
|
-
* runExample().catch(console.error);
|
|
7198
|
-
* ```
|
|
7199
|
-
* @group Account
|
|
7200
|
-
*/
|
|
7201
|
-
getAccountOwnedTokensFromCollectionAddress(args: {
|
|
7202
|
-
accountAddress: AccountAddressInput;
|
|
7203
|
-
collectionAddress: AccountAddressInput;
|
|
7204
|
-
minimumLedgerVersion?: AnyNumber;
|
|
7205
|
-
options?: TokenStandardArg & PaginationArgs & OrderByArg<GetAccountOwnedTokensFromCollectionResponse[0]>;
|
|
7206
|
-
}): Promise<GetAccountOwnedTokensFromCollectionResponse>;
|
|
7207
|
-
/**
|
|
7208
|
-
* Queries for all collections that an account currently has tokens for, including NFTs, fungible tokens, and soulbound tokens.
|
|
7209
|
-
* If you want to filter by a specific token standard, you can pass an optional tokenStandard parameter.
|
|
7210
|
-
*
|
|
7211
|
-
* @param args.accountAddress - The account address we want to get the collections for.
|
|
7212
|
-
* @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.
|
|
7213
|
-
* @param args.options.tokenStandard - The NFT standard to query for.
|
|
7214
|
-
* @param args.options.offset - The number of the collection to start returning results from.
|
|
7215
|
-
* @param args.options.limit - The number of results to return.
|
|
7216
|
-
* @param args.options.orderBy - The order to sort the tokens by.
|
|
7217
|
-
* @returns Collections array with the collections data.
|
|
7218
|
-
*
|
|
7219
|
-
* @example
|
|
7220
|
-
* ```typescript
|
|
7221
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
7222
|
-
*
|
|
7223
|
-
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
7224
|
-
* const aptos = new Aptos(config);
|
|
7225
|
-
*
|
|
7226
|
-
* async function runExample() {
|
|
7227
|
-
* // Get account collections with owned tokens for a specific account
|
|
7228
|
-
* const accountCollectionsWithOwnedTokens = await aptos.getAccountCollectionsWithOwnedTokens({
|
|
7229
|
-
* accountAddress: "0x1", // replace with a real account address
|
|
7230
|
-
* options: {
|
|
7231
|
-
* tokenStandard: "NFT", // specify the token standard if needed
|
|
7232
|
-
* limit: 10, // specify the number of results to return
|
|
7233
|
-
* },
|
|
7234
|
-
* });
|
|
7235
|
-
*
|
|
7236
|
-
* console.log(accountCollectionsWithOwnedTokens);
|
|
7237
|
-
* }
|
|
7238
|
-
* runExample().catch(console.error);
|
|
7239
|
-
* ```
|
|
7240
|
-
* @group Account
|
|
7241
|
-
*/
|
|
7242
|
-
getAccountCollectionsWithOwnedTokens(args: {
|
|
7243
|
-
accountAddress: AccountAddressInput;
|
|
7244
|
-
minimumLedgerVersion?: AnyNumber;
|
|
7245
|
-
options?: TokenStandardArg & PaginationArgs & OrderByArg<GetAccountCollectionsWithOwnedTokenResponse[0]>;
|
|
7246
|
-
}): Promise<GetAccountCollectionsWithOwnedTokenResponse>;
|
|
7247
|
-
/**
|
|
7248
|
-
* Queries the current count of transactions submitted by an account.
|
|
7249
|
-
*
|
|
7250
|
-
* @param args - The parameters for the query.
|
|
7251
|
-
* @param args.accountAddress - The account address we want to get the total count for.
|
|
7252
|
-
* @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.
|
|
7253
|
-
* @returns Current count of transactions made by an account.
|
|
7254
|
-
*
|
|
7255
|
-
* @example
|
|
7256
|
-
* ```typescript
|
|
7257
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
7258
|
-
*
|
|
7259
|
-
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
7260
|
-
* const aptos = new Aptos(config);
|
|
7261
|
-
*
|
|
7262
|
-
* async function runExample() {
|
|
7263
|
-
* // Get the count of transactions for a specific account
|
|
7264
|
-
* const accountTransactionsCount = await aptos.getAccountTransactionsCount({
|
|
7265
|
-
* accountAddress: "0x1", // replace with a real account address
|
|
7266
|
-
* minimumLedgerVersion: 1, // specify your own minimum ledger version if needed
|
|
7267
|
-
* });
|
|
7268
|
-
*
|
|
7269
|
-
* console.log(accountTransactionsCount);
|
|
7270
|
-
* }
|
|
7271
|
-
* runExample().catch(console.error);
|
|
7272
|
-
* ```
|
|
7273
|
-
* @group Account
|
|
7274
|
-
*/
|
|
7275
|
-
getAccountTransactionsCount(args: {
|
|
7276
|
-
accountAddress: AccountAddressInput;
|
|
7277
|
-
minimumLedgerVersion?: AnyNumber;
|
|
7278
|
-
}): Promise<number>;
|
|
7279
|
-
/**
|
|
7280
|
-
* Retrieves the coins data for a specified account.
|
|
7281
|
-
*
|
|
7282
|
-
* @param args.accountAddress - The account address for which to retrieve the coin's data.
|
|
7283
|
-
* @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.
|
|
7284
|
-
* @param args.options.offset - Optional. The number of coins to start returning results from.
|
|
7285
|
-
* @param args.options.limit - Optional. The number of results to return.
|
|
7286
|
-
* @param args.options.orderBy - Optional. The order to sort the coins by.
|
|
7287
|
-
* @param args.options.where - Optional. Filter the results by specific criteria.
|
|
7288
|
-
* @returns An array containing the coins data for the specified account.
|
|
7289
|
-
*
|
|
7290
|
-
* @example
|
|
7291
|
-
* ```typescript
|
|
7292
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
7293
|
-
*
|
|
7294
|
-
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
7295
|
-
* const aptos = new Aptos(config);
|
|
7296
|
-
*
|
|
7297
|
-
* async function runExample() {
|
|
7298
|
-
* // Fetching coins data for a specific account
|
|
7299
|
-
* const accountCoinsData = await aptos.getAccountCoinsData({
|
|
7300
|
-
* accountAddress: "0x1", // replace with a real account address
|
|
7301
|
-
* options: {
|
|
7302
|
-
* limit: 10, // specify the number of results to return
|
|
7303
|
-
* orderBy: { asset_type: "asc" }, // specify the order of results
|
|
7304
|
-
* },
|
|
7305
|
-
* });
|
|
7306
|
-
*
|
|
7307
|
-
* console.log(accountCoinsData);
|
|
7308
|
-
* }
|
|
7309
|
-
* runExample().catch(console.error);
|
|
7310
|
-
* ```
|
|
7311
|
-
* @group Account
|
|
7312
|
-
*/
|
|
7313
|
-
getAccountCoinsData(args: {
|
|
7314
|
-
accountAddress: AccountAddressInput;
|
|
7315
|
-
minimumLedgerVersion?: AnyNumber;
|
|
7316
|
-
options?: PaginationArgs & OrderByArg<GetAccountCoinsDataResponse[0]> & WhereArg<CurrentFungibleAssetBalancesBoolExp>;
|
|
7317
|
-
}): Promise<GetAccountCoinsDataResponse>;
|
|
7318
|
-
/**
|
|
7319
|
-
* Retrieves the current count of an account's coins aggregated across all types.
|
|
7320
|
-
*
|
|
7321
|
-
* @param args The parameters for the account coins count query.
|
|
7322
|
-
* @param args.accountAddress The account address we want to get the total count for.
|
|
7323
|
-
* @param args.minimumLedgerVersion Optional ledger version to sync up to before querying.
|
|
7324
|
-
* @returns The current count of the aggregated coins for the specified account.
|
|
7325
|
-
*
|
|
7326
|
-
* @example
|
|
7327
|
-
* ```typescript
|
|
7328
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
7329
|
-
*
|
|
7330
|
-
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
7331
|
-
* const aptos = new Aptos(config);
|
|
7332
|
-
*
|
|
7333
|
-
* async function runExample() {
|
|
7334
|
-
* // Getting the account coins count for a specific account
|
|
7335
|
-
* const accountCoinsCount = await aptos.getAccountCoinsCount({ accountAddress: "0x1" }); // replace with a real account address
|
|
7336
|
-
* console.log("Account Coins Count:", accountCoinsCount);
|
|
7337
|
-
* }
|
|
7338
|
-
* runExample().catch(console.error);
|
|
7339
|
-
* ```
|
|
7340
|
-
* @group Account
|
|
7341
|
-
*/
|
|
7342
|
-
getAccountCoinsCount(args: {
|
|
7343
|
-
accountAddress: AccountAddressInput;
|
|
7344
|
-
minimumLedgerVersion?: AnyNumber;
|
|
7345
|
-
}): Promise<number>;
|
|
7346
|
-
/**
|
|
7347
|
-
* Retrieves the current amount of APT for a specified account.
|
|
7348
|
-
*
|
|
7349
|
-
* @param args The arguments for the account query.
|
|
7350
|
-
* @param args.accountAddress The account address for which to retrieve the APT amount.
|
|
7351
|
-
* @param args.minimumLedgerVersion Optional ledger version to sync up to before querying.
|
|
7352
|
-
* @returns The current amount of APT for the specified account.
|
|
7353
|
-
*
|
|
7354
|
-
* @example
|
|
7355
|
-
* ```typescript
|
|
7356
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
7357
|
-
*
|
|
7358
|
-
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
7359
|
-
* const aptos = new Aptos(config);
|
|
7360
|
-
*
|
|
7361
|
-
* async function runExample() {
|
|
7362
|
-
* // Get the APT amount for a specific account
|
|
7363
|
-
* const accountAPTAmount = await aptos.getAccountAPTAmount({ accountAddress: "0x1" }); // replace with a real account address
|
|
7364
|
-
* console.log("Account APT Amount:", accountAPTAmount);
|
|
7365
|
-
* }
|
|
7366
|
-
* runExample().catch(console.error);
|
|
7367
|
-
* ```
|
|
7368
|
-
* @group Account
|
|
7369
|
-
*/
|
|
7370
|
-
getAccountAPTAmount(args: {
|
|
7371
|
-
accountAddress: AccountAddressInput;
|
|
7372
|
-
minimumLedgerVersion?: AnyNumber;
|
|
7373
|
-
}): Promise<number>;
|
|
7374
|
-
/**
|
|
7375
|
-
* Queries the current amount of a specified coin held by an account.
|
|
7376
|
-
*
|
|
7377
|
-
* @param args The parameters for querying the account's coin amount.
|
|
7378
|
-
* @param args.accountAddress The account address to query for the coin amount.
|
|
7379
|
-
* @param args.coinType The coin type to query. Note: If not provided, it may be automatically populated if `faMetadataAddress`
|
|
7380
|
-
* is specified.
|
|
7381
|
-
* @param args.faMetadataAddress The fungible asset metadata address to query. Note: If not provided, it may be automatically
|
|
7382
|
-
* populated if `coinType` is specified.
|
|
7383
|
-
* @param args.minimumLedgerVersion Not used anymore, here for backward compatibility
|
|
7384
|
-
* see https://github.com/aptos-labs/aptos-ts-sdk/pull/519, will be removed in the near future.
|
|
7385
|
-
* Optional ledger version to sync up to before querying.
|
|
7386
|
-
* @returns The current amount of the specified coin held by the account.
|
|
7387
|
-
*
|
|
7388
|
-
* @example
|
|
7389
|
-
* ```typescript
|
|
7390
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
7391
|
-
*
|
|
7392
|
-
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
7393
|
-
* const aptos = new Aptos(config);
|
|
7394
|
-
*
|
|
7395
|
-
* async function runExample() {
|
|
7396
|
-
* // Query the account's coin amount for a specific coin type
|
|
7397
|
-
* const accountCoinAmount = await aptos.getAccountCoinAmount({
|
|
7398
|
-
* accountAddress: "0x1", // replace with a real account address
|
|
7399
|
-
* coinType: "0x1::aptos_coin::AptosCoin" // specify the coin type
|
|
7400
|
-
* });
|
|
7401
|
-
*
|
|
7402
|
-
* console.log(`Account coin amount: ${accountCoinAmount}`);
|
|
7403
|
-
* }
|
|
7404
|
-
* runExample().catch(console.error);
|
|
7405
|
-
* ```
|
|
7406
|
-
* @group Account
|
|
7407
|
-
*/
|
|
7408
|
-
getAccountCoinAmount(args: {
|
|
7409
|
-
accountAddress: AccountAddressInput;
|
|
7410
|
-
coinType?: MoveStructId;
|
|
7411
|
-
faMetadataAddress?: AccountAddressInput;
|
|
7412
|
-
minimumLedgerVersion?: AnyNumber;
|
|
7413
|
-
}): Promise<number>;
|
|
7414
|
-
/**
|
|
7415
|
-
* Queries an account's owned objects.
|
|
7416
|
-
*
|
|
7417
|
-
* @param args.accountAddress The account address we want to get the objects for.
|
|
7418
|
-
* @param args.minimumLedgerVersion Optional ledger version to sync up to before querying.
|
|
7419
|
-
* @param args.options.offset The starting position to start returning results from.
|
|
7420
|
-
* @param args.options.limit The number of results to return.
|
|
7421
|
-
* @param args.options.orderBy The order to sort the objects by.
|
|
7422
|
-
* @returns Objects array with the object data.
|
|
7423
|
-
*
|
|
7424
|
-
* @example
|
|
7425
|
-
* ```typescript
|
|
7426
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
7427
|
-
*
|
|
7428
|
-
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
7429
|
-
* const aptos = new Aptos(config);
|
|
7430
|
-
*
|
|
7431
|
-
* async function runExample() {
|
|
7432
|
-
* // Get the objects owned by the specified account
|
|
7433
|
-
* const accountOwnedObjects = await aptos.getAccountOwnedObjects({
|
|
7434
|
-
* accountAddress: "0x1", // replace with a real account address
|
|
7435
|
-
* minimumLedgerVersion: 1, // optional, specify if needed
|
|
7436
|
-
* options: {
|
|
7437
|
-
* offset: 0, // optional, specify if needed
|
|
7438
|
-
* limit: 10, // optional, specify if needed
|
|
7439
|
-
* orderBy: "created_at", // optional, specify if needed
|
|
7440
|
-
* },
|
|
7441
|
-
* });
|
|
7442
|
-
*
|
|
7443
|
-
* console.log(accountOwnedObjects);
|
|
7444
|
-
* }
|
|
7445
|
-
* runExample().catch(console.error);
|
|
7446
|
-
* ```
|
|
7447
|
-
* @group Account
|
|
7448
|
-
*/
|
|
7449
|
-
getAccountOwnedObjects(args: {
|
|
7450
|
-
accountAddress: AccountAddressInput;
|
|
7451
|
-
minimumLedgerVersion?: AnyNumber;
|
|
7452
|
-
options?: PaginationArgs & OrderByArg<GetObjectDataQueryResponse[0]>;
|
|
7453
|
-
}): Promise<GetObjectDataQueryResponse>;
|
|
7454
|
-
/**
|
|
7455
|
-
* Derives an account by providing a private key. This function resolves the provided private key type and derives the public
|
|
7456
|
-
* key from it.
|
|
7457
|
-
*
|
|
7458
|
-
* If the privateKey is a Secp256k1 type, it derives the account using the derived public key and auth key using the SingleKey
|
|
7459
|
-
* scheme locally.
|
|
7460
|
-
* If the privateKey is an ED25519 type, it looks up the authentication key on chain to determine whether it is a Legacy ED25519
|
|
7461
|
-
* key or a Unified ED25519 key, and then derives the account based on that.
|
|
7462
|
-
*
|
|
7463
|
-
* @param args - The arguments for deriving the account.
|
|
7464
|
-
* @param args.privateKey - An account private key.
|
|
7465
|
-
* @returns The derived Account type.
|
|
7466
|
-
*
|
|
7467
|
-
* @example
|
|
7468
|
-
* ```typescript
|
|
7469
|
-
* import { Aptos, AptosConfig, Network, Ed25519PrivateKey } from "@aptos-labs/ts-sdk";
|
|
7470
|
-
*
|
|
7471
|
-
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
7472
|
-
* const aptos = new Aptos(config);
|
|
7473
|
-
*
|
|
7474
|
-
* async function runExample() {
|
|
7475
|
-
* // Deriving an account from a private key
|
|
7476
|
-
* const account = await aptos.deriveAccountFromPrivateKey({
|
|
7477
|
-
* privateKey: new Ed25519PrivateKey("0x123") // replace with a real private key
|
|
7478
|
-
* });
|
|
7479
|
-
*
|
|
7480
|
-
* console.log(account);
|
|
7481
|
-
* }
|
|
7482
|
-
* runExample().catch(console.error);
|
|
7483
|
-
* ```
|
|
7484
|
-
* @group Account
|
|
7485
|
-
*/
|
|
7486
|
-
deriveAccountFromPrivateKey(args: {
|
|
7487
|
-
privateKey: PrivateKey;
|
|
7488
|
-
}): Promise<Account$1>;
|
|
7489
|
-
}
|
|
7490
|
-
|
|
7491
|
-
/**
|
|
7492
|
-
* A class to handle all `Coin` operations.
|
|
7493
|
-
* @group Coin
|
|
7494
|
-
*/
|
|
7495
|
-
declare class Coin {
|
|
7496
|
-
readonly config: AptosConfig;
|
|
7497
|
-
/**
|
|
7498
|
-
* Initializes a new instance of the Aptos client with the specified configuration.
|
|
7499
|
-
* This allows you to interact with the Aptos blockchain using the provided settings.
|
|
7500
|
-
*
|
|
7501
|
-
* @param config - The configuration settings for the Aptos client.
|
|
7502
|
-
*
|
|
7503
|
-
* @example
|
|
7504
|
-
* ```typescript
|
|
7505
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
7506
|
-
*
|
|
7507
|
-
* async function runExample() {
|
|
7508
|
-
* // Create a new Aptos client with testnet configuration
|
|
7509
|
-
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
7510
|
-
* const aptos = new Aptos(config);
|
|
7511
|
-
*
|
|
7512
|
-
* console.log("Aptos client initialized:", aptos);
|
|
7513
|
-
* }
|
|
7514
|
-
* runExample().catch(console.error);
|
|
7515
|
-
* ```
|
|
7516
|
-
* @group Coin
|
|
7517
|
-
*/
|
|
7518
|
-
constructor(config: AptosConfig);
|
|
7519
|
-
/**
|
|
7520
|
-
* Generate a transfer coin transaction that can be simulated, signed, and submitted.
|
|
7521
|
-
* This function helps you create a transaction to transfer a specified amount of coins
|
|
7522
|
-
* from one account to another within the Aptos network.
|
|
7523
|
-
*
|
|
7524
|
-
* @param args The arguments for the transfer transaction.
|
|
7525
|
-
* @param args.sender The sender account address.
|
|
7526
|
-
* @param args.recipient The recipient account address.
|
|
7527
|
-
* @param args.amount The amount of coins to transfer.
|
|
7528
|
-
* @param args.coinType Optional. The coin struct type to transfer. Defaults to 0x1::aptos_coin::AptosCoin.
|
|
7529
|
-
* @param args.options Optional. Additional options for generating the transaction.
|
|
7530
|
-
*
|
|
7531
|
-
* @returns SimpleTransaction
|
|
7532
|
-
*
|
|
7533
|
-
* @example
|
|
7534
|
-
* ```typescript
|
|
7535
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
7536
|
-
*
|
|
7537
|
-
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
7538
|
-
* const aptos = new Aptos(config);
|
|
7539
|
-
*
|
|
7540
|
-
* async function runExample() {
|
|
7541
|
-
* // Generate a transfer coin transaction
|
|
7542
|
-
* const transaction = await aptos.transferCoinTransaction({
|
|
7543
|
-
* sender: "0x1", // replace with a real sender account address
|
|
7544
|
-
* recipient: "0x2", // replace with a real recipient account address
|
|
7545
|
-
* amount: 10,
|
|
7546
|
-
* });
|
|
7547
|
-
*
|
|
7548
|
-
* console.log(transaction);
|
|
7549
|
-
* }
|
|
7550
|
-
* runExample().catch(console.error);
|
|
7551
|
-
* ```
|
|
7552
|
-
* @group Coin
|
|
7553
|
-
*/
|
|
7554
|
-
transferCoinTransaction(args: {
|
|
7555
|
-
sender: AccountAddressInput;
|
|
7556
|
-
recipient: AccountAddressInput;
|
|
7557
|
-
amount: AnyNumber;
|
|
7558
|
-
coinType?: MoveStructId;
|
|
7559
|
-
options?: InputGenerateTransactionOptions;
|
|
7560
|
-
}): Promise<SimpleTransaction>;
|
|
7561
|
-
}
|
|
7562
|
-
|
|
7563
|
-
/**
|
|
7564
|
-
* This file contains the underlying implementations for exposed API surface in
|
|
7565
|
-
* the {@link api/digitalAsset}. By moving the methods out into a separate file,
|
|
7566
|
-
* other namespaces and processes can access these methods without depending on the entire
|
|
7567
|
-
* digitalAsset namespace and without having a dependency cycle error.
|
|
7568
|
-
* @group Implementation
|
|
7569
|
-
*/
|
|
7570
|
-
|
|
7571
|
-
declare const PropertyTypeMap: {
|
|
7572
|
-
BOOLEAN: string;
|
|
7573
|
-
U8: string;
|
|
7574
|
-
U16: string;
|
|
7575
|
-
U32: string;
|
|
7576
|
-
U64: string;
|
|
7577
|
-
U128: string;
|
|
7578
|
-
U256: string;
|
|
7579
|
-
ADDRESS: string;
|
|
7580
|
-
STRING: string;
|
|
7581
|
-
ARRAY: string;
|
|
7582
|
-
};
|
|
7583
|
-
/**
|
|
7584
|
-
* The keys of the PropertyTypeMap, representing different property types.
|
|
7585
|
-
* @group Implementation
|
|
7586
|
-
*/
|
|
7587
|
-
type PropertyType = keyof typeof PropertyTypeMap;
|
|
7588
|
-
/**
|
|
7589
|
-
* Accepted property value types for user input, including boolean, number, bigint, string, AccountAddress, and Uint8Array.
|
|
7590
|
-
* To pass in an Array, use Uint8Array type
|
|
7591
|
-
* for example `new MoveVector([new MoveString("hello"), new MoveString("world")]).bcsToBytes()`
|
|
7592
|
-
* @group Implementation
|
|
7593
|
-
*/
|
|
7594
|
-
type PropertyValue = boolean | number | bigint | string | AccountAddress | Uint8Array;
|
|
7595
|
-
/**
|
|
7596
|
-
* Options for creating a collection, allowing customization of various attributes such as supply limits, mutability of metadata,
|
|
7597
|
-
* and royalty settings.
|
|
7598
|
-
*
|
|
7599
|
-
* @param maxSupply - Maximum number of tokens that can be minted in the collection.
|
|
7600
|
-
* @param mutableDescription - Indicates if the collection description can be changed after creation.
|
|
7601
|
-
* @param mutableRoyalty - Indicates if the royalty settings can be modified after creation.
|
|
7602
|
-
* @param mutableURI - Indicates if the collection URI can be updated.
|
|
7603
|
-
* @param mutableTokenDescription - Indicates if individual token descriptions can be modified.
|
|
7604
|
-
* @param mutableTokenName - Indicates if individual token names can be changed.
|
|
7605
|
-
* @param mutableTokenProperties - Indicates if individual token properties can be altered.
|
|
7606
|
-
* @param mutableTokenURI - Indicates if individual token URIs can be updated.
|
|
7607
|
-
* @param tokensBurnableByCreator - Indicates if the creator can burn tokens from the collection.
|
|
7608
|
-
* @param tokensFreezableByCreator - Indicates if the creator can freeze tokens in the collection.
|
|
7609
|
-
* @param royaltyNumerator - The numerator for calculating royalties.
|
|
7610
|
-
* @param royaltyDenominator - The denominator for calculating royalties.
|
|
7611
|
-
* @group Implementation
|
|
7612
|
-
*/
|
|
7613
|
-
interface CreateCollectionOptions {
|
|
7614
|
-
maxSupply?: AnyNumber;
|
|
7615
|
-
mutableDescription?: boolean;
|
|
7616
|
-
mutableRoyalty?: boolean;
|
|
7617
|
-
mutableURI?: boolean;
|
|
7618
|
-
mutableTokenDescription?: boolean;
|
|
7619
|
-
mutableTokenName?: boolean;
|
|
7620
|
-
mutableTokenProperties?: boolean;
|
|
7621
|
-
mutableTokenURI?: boolean;
|
|
7622
|
-
tokensBurnableByCreator?: boolean;
|
|
7623
|
-
tokensFreezableByCreator?: boolean;
|
|
7624
|
-
royaltyNumerator?: number;
|
|
7625
|
-
royaltyDenominator?: number;
|
|
7626
|
-
}
|
|
7627
|
-
|
|
7628
|
-
/**
|
|
7629
|
-
* A class to query all `DigitalAsset` related queries on Aptos.
|
|
7630
|
-
* @group DigitalAsset
|
|
7631
|
-
*/
|
|
7632
|
-
declare class DigitalAsset {
|
|
7633
|
-
readonly config: AptosConfig;
|
|
7634
|
-
/**
|
|
7635
|
-
* Initializes a new instance of the Aptos client with the specified configuration.
|
|
7636
|
-
* This allows you to interact with the Aptos blockchain using the provided settings.
|
|
7637
|
-
*
|
|
7638
|
-
* @param config - The configuration settings for the Aptos client.
|
|
7639
|
-
*
|
|
7640
|
-
* @example
|
|
7641
|
-
* ```typescript
|
|
7642
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
7643
|
-
*
|
|
7644
|
-
* async function runExample() {
|
|
7645
|
-
* // Create a configuration for the Aptos client
|
|
7646
|
-
* const config = new AptosConfig({ network: Network.TESTNET }); // Specify your desired network
|
|
7647
|
-
*
|
|
7648
|
-
* // Initialize the Aptos client with the configuration
|
|
7649
|
-
* const aptos = new Aptos(config);
|
|
7650
|
-
*
|
|
7651
|
-
* console.log("Aptos client initialized:", aptos);
|
|
7652
|
-
* }
|
|
7653
|
-
* runExample().catch(console.error);
|
|
7654
|
-
* ```
|
|
7655
|
-
* @group DigitalAsset
|
|
7656
|
-
*/
|
|
7657
|
-
constructor(config: AptosConfig);
|
|
7658
|
-
/**
|
|
7659
|
-
* Queries data of a specific collection by the collection creator address and the collection name.
|
|
7660
|
-
* This function is deprecated; use `getCollectionDataByCreatorAddressAndCollectionName` instead.
|
|
7661
|
-
*
|
|
7662
|
-
* If a creator account has two collections with the same name in v1 and v2, you can pass an optional `tokenStandard` parameter
|
|
7663
|
-
* to query a specific standard.
|
|
7664
|
-
*
|
|
7665
|
-
* @param args - The arguments for querying the collection data.
|
|
7666
|
-
* @param args.creatorAddress - The address of the collection's creator.
|
|
7667
|
-
* @param args.collectionName - The name of the collection.
|
|
7668
|
-
* @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.
|
|
7669
|
-
* @param args.options - Optional parameters for the query.
|
|
7670
|
-
* @param args.options.tokenStandard - The token standard to query.
|
|
7671
|
-
* @returns GetCollectionDataResponse - The response type containing the collection data.
|
|
7672
|
-
*
|
|
7673
|
-
* @example
|
|
7674
|
-
* ```typescript
|
|
7675
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
7676
|
-
*
|
|
7677
|
-
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
7678
|
-
* const aptos = new Aptos(config);
|
|
7679
|
-
*
|
|
7680
|
-
* async function runExample() {
|
|
7681
|
-
* // Querying collection data by creator address and collection name
|
|
7682
|
-
* const collection = await aptos.getCollectionData({
|
|
7683
|
-
* creatorAddress: "0x1", // replace with a real creator address
|
|
7684
|
-
* collectionName: "myCollection", // specify your collection name
|
|
7685
|
-
* });
|
|
7686
|
-
*
|
|
7687
|
-
* console.log(collection);
|
|
7688
|
-
* }
|
|
7689
|
-
* runExample().catch(console.error);
|
|
7690
|
-
* ```
|
|
7691
|
-
* @group DigitalAsset
|
|
7692
|
-
*/
|
|
7693
|
-
getCollectionData(args: {
|
|
7694
|
-
creatorAddress: AccountAddressInput;
|
|
7695
|
-
collectionName: string;
|
|
7696
|
-
minimumLedgerVersion?: AnyNumber;
|
|
7697
|
-
options?: TokenStandardArg;
|
|
7698
|
-
}): Promise<GetCollectionDataResponse>;
|
|
7699
|
-
/**
|
|
7700
|
-
* Queries data of a specific collection by the collection creator address and the collection name.
|
|
7701
|
-
* If a creator account has multiple collections with the same name across different versions,
|
|
7702
|
-
* specify the `tokenStandard` parameter to query a specific standard.
|
|
7703
|
-
*
|
|
7704
|
-
* @param args.creatorAddress - The address of the collection's creator.
|
|
7705
|
-
* @param args.collectionName - The name of the collection.
|
|
7706
|
-
* @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.
|
|
7707
|
-
* @param args.options.tokenStandard - Optional token standard to query.
|
|
7708
|
-
* @returns GetCollectionDataResponse - The response type containing collection data.
|
|
7709
|
-
*
|
|
7710
|
-
* @example
|
|
7711
|
-
* ```typescript
|
|
7712
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
7713
|
-
*
|
|
7714
|
-
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
7715
|
-
* const aptos = new Aptos(config);
|
|
7716
|
-
*
|
|
7717
|
-
* async function runExample() {
|
|
7718
|
-
* // Fetching collection data by creator address and collection name
|
|
7719
|
-
* const collection = await aptos.getCollectionDataByCreatorAddressAndCollectionName({
|
|
7720
|
-
* creatorAddress: "0x1", // replace with a real creator address
|
|
7721
|
-
* collectionName: "myCollection",
|
|
7722
|
-
* minimumLedgerVersion: 1, // optional, specify if needed
|
|
7723
|
-
* options: { tokenStandard: "v2" } // optional, specify if needed
|
|
7724
|
-
* });
|
|
7725
|
-
*
|
|
7726
|
-
* console.log(collection);
|
|
7727
|
-
* }
|
|
7728
|
-
* runExample().catch(console.error);
|
|
7729
|
-
* ```
|
|
7730
|
-
* @group DigitalAsset
|
|
7731
|
-
*/
|
|
7732
|
-
getCollectionDataByCreatorAddressAndCollectionName(args: {
|
|
7733
|
-
creatorAddress: AccountAddressInput;
|
|
7734
|
-
collectionName: string;
|
|
7735
|
-
minimumLedgerVersion?: AnyNumber;
|
|
7736
|
-
options?: TokenStandardArg & PaginationArgs;
|
|
7737
|
-
}): Promise<GetCollectionDataResponse>;
|
|
7738
|
-
/**
|
|
7739
|
-
* Retrieves data for a specific collection created by a given creator address.
|
|
7740
|
-
* This function allows you to query collection data while optionally specifying a minimum ledger version and pagination options.
|
|
7741
|
-
*
|
|
7742
|
-
* @param args.creatorAddress - The address of the collection's creator.
|
|
7743
|
-
* @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.
|
|
7744
|
-
* @param args.options.tokenStandard - Optional token standard to query.
|
|
7745
|
-
* @param args.options.pagination - Optional pagination arguments.
|
|
7746
|
-
* @returns GetCollectionDataResponse - The response type containing collection data.
|
|
7747
|
-
*
|
|
7748
|
-
* @example
|
|
7749
|
-
* ```typescript
|
|
7750
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
7751
|
-
*
|
|
7752
|
-
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
7753
|
-
* const aptos = new Aptos(config);
|
|
7754
|
-
*
|
|
7755
|
-
* async function runExample() {
|
|
7756
|
-
* // Retrieve collection data by creator address
|
|
7757
|
-
* const collectionData = await aptos.getCollectionDataByCreatorAddress({
|
|
7758
|
-
* creatorAddress: "0x1", // replace with a real creator address
|
|
7759
|
-
* minimumLedgerVersion: 1, // specify the minimum ledger version if needed
|
|
7760
|
-
* options: {
|
|
7761
|
-
* tokenStandard: "v2", // specify the token standard if needed
|
|
7762
|
-
* pagination: { limit: 10, offset: 0 } // specify pagination options if needed
|
|
7763
|
-
* }
|
|
7764
|
-
* });
|
|
7765
|
-
*
|
|
7766
|
-
* console.log(collectionData);
|
|
7767
|
-
* }
|
|
7768
|
-
* runExample().catch(console.error);
|
|
7769
|
-
* ```
|
|
7770
|
-
* @group DigitalAsset
|
|
7771
|
-
*/
|
|
7772
|
-
getCollectionDataByCreatorAddress(args: {
|
|
7773
|
-
creatorAddress: AccountAddressInput;
|
|
7774
|
-
minimumLedgerVersion?: AnyNumber;
|
|
7775
|
-
options?: TokenStandardArg & PaginationArgs;
|
|
7776
|
-
}): Promise<GetCollectionDataResponse>;
|
|
7777
|
-
/**
|
|
7778
|
-
* Queries data of a specific collection by the collection ID.
|
|
7779
|
-
*
|
|
7780
|
-
* @param args.collectionId - The ID of the collection, which is the same as the address of the collection object.
|
|
7781
|
-
* @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.
|
|
7782
|
-
* @param args.options - Optional parameters for token standard and pagination.
|
|
7783
|
-
* @returns GetCollectionDataResponse - The response type containing the collection data.
|
|
7784
|
-
*
|
|
7785
|
-
* @example
|
|
7786
|
-
* ```typescript
|
|
7787
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
7788
|
-
*
|
|
7789
|
-
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
7790
|
-
* const aptos = new Aptos(config);
|
|
7791
|
-
*
|
|
7792
|
-
* async function runExample() {
|
|
7793
|
-
* // Fetching collection data by collection ID
|
|
7794
|
-
* const collection = await aptos.getCollectionDataByCollectionId({
|
|
7795
|
-
* collectionId: "0x123", // replace with a real collection ID
|
|
7796
|
-
* });
|
|
7797
|
-
*
|
|
7798
|
-
* console.log(collection);
|
|
7799
|
-
* }
|
|
7800
|
-
* runExample().catch(console.error);
|
|
7801
|
-
* ```
|
|
7802
|
-
* @group DigitalAsset
|
|
7803
|
-
*/
|
|
7804
|
-
getCollectionDataByCollectionId(args: {
|
|
7805
|
-
collectionId: AccountAddressInput;
|
|
7806
|
-
minimumLedgerVersion?: AnyNumber;
|
|
7807
|
-
options?: TokenStandardArg & PaginationArgs;
|
|
7808
|
-
}): Promise<GetCollectionDataResponse>;
|
|
7809
|
-
/**
|
|
7810
|
-
* Queries the ID of a specified collection.
|
|
7811
|
-
* This ID corresponds to the collection's object address in V2, while V1 does not utilize objects and lacks an address.
|
|
7812
|
-
*
|
|
7813
|
-
* @param args.creatorAddress - The address of the collection's creator.
|
|
7814
|
-
* @param args.collectionName - The name of the collection.
|
|
7815
|
-
* @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.
|
|
7816
|
-
* @param args.options.tokenStandard - The token standard to query.
|
|
7817
|
-
* @returns The collection ID.
|
|
7818
|
-
*
|
|
7819
|
-
* @example
|
|
7820
|
-
* ```typescript
|
|
7821
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
7822
|
-
*
|
|
7823
|
-
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
7824
|
-
* const aptos = new Aptos(config);
|
|
7825
|
-
*
|
|
7826
|
-
* async function runExample() {
|
|
7827
|
-
* // Fetching the collection ID for a specific creator and collection name
|
|
7828
|
-
* const collectionId = await aptos.getCollectionId({
|
|
7829
|
-
* creatorAddress: "0x1", // replace with a real creator address
|
|
7830
|
-
* collectionName: "myCollection"
|
|
7831
|
-
* });
|
|
7832
|
-
*
|
|
7833
|
-
* console.log("Collection ID:", collectionId);
|
|
7834
|
-
* }
|
|
7835
|
-
* runExample().catch(console.error);
|
|
7836
|
-
* ```
|
|
7837
|
-
* @group DigitalAsset
|
|
7838
|
-
*/
|
|
7839
|
-
getCollectionId(args: {
|
|
7840
|
-
creatorAddress: AccountAddressInput;
|
|
7841
|
-
collectionName: string;
|
|
7842
|
-
minimumLedgerVersion?: AnyNumber;
|
|
7843
|
-
options?: TokenStandardArg;
|
|
7844
|
-
}): Promise<string>;
|
|
7845
|
-
/**
|
|
7846
|
-
* Retrieves digital asset data using the address of a digital asset.
|
|
7847
|
-
*
|
|
7848
|
-
* @param args - The parameters for the request.
|
|
7849
|
-
* @param args.digitalAssetAddress - The address of the digital asset.
|
|
7850
|
-
* @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.
|
|
7851
|
-
* @returns GetTokenDataResponse containing relevant data for the digital asset.
|
|
7852
|
-
*
|
|
7853
|
-
* @example
|
|
7854
|
-
* ```typescript
|
|
7855
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
7856
|
-
*
|
|
7857
|
-
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
7858
|
-
* const aptos = new Aptos(config);
|
|
7859
|
-
*
|
|
7860
|
-
* async function runExample() {
|
|
7861
|
-
* // Fetching digital asset data for a specific address
|
|
7862
|
-
* const digitalAsset = await aptos.getDigitalAssetData({
|
|
7863
|
-
* digitalAssetAddress: "0x123", // replace with a real digital asset address
|
|
7864
|
-
* });
|
|
7865
|
-
*
|
|
7866
|
-
* console.log(digitalAsset);
|
|
7867
|
-
* }
|
|
7868
|
-
* runExample().catch(console.error);
|
|
7869
|
-
* ```
|
|
7870
|
-
* @group DigitalAsset
|
|
7871
|
-
*/
|
|
7872
|
-
getDigitalAssetData(args: {
|
|
7873
|
-
digitalAssetAddress: AccountAddressInput;
|
|
7874
|
-
minimumLedgerVersion?: AnyNumber;
|
|
7875
|
-
}): Promise<GetTokenDataResponse>;
|
|
7876
|
-
/**
|
|
7877
|
-
* Retrieves the current ownership data of a specified digital asset using its address.
|
|
7878
|
-
*
|
|
7879
|
-
* @param args The parameters for the request.
|
|
7880
|
-
* @param args.digitalAssetAddress The address of the digital asset.
|
|
7881
|
-
* @param args.minimumLedgerVersion Optional ledger version to sync up to before querying.
|
|
7882
|
-
*
|
|
7883
|
-
* @returns GetCurrentTokenOwnershipResponse containing relevant ownership data of the digital asset.
|
|
7884
|
-
*
|
|
7885
|
-
* @example
|
|
7886
|
-
* ```typescript
|
|
7887
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
7888
|
-
*
|
|
7889
|
-
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
7890
|
-
* const aptos = new Aptos(config);
|
|
7891
|
-
*
|
|
7892
|
-
* async function runExample() {
|
|
7893
|
-
* // Getting the current ownership of a digital asset
|
|
7894
|
-
* const digitalAssetOwner = await aptos.getCurrentDigitalAssetOwnership({
|
|
7895
|
-
* digitalAssetAddress: "0x123", // replace with a real digital asset address
|
|
7896
|
-
* });
|
|
7897
|
-
*
|
|
7898
|
-
* console.log(digitalAssetOwner);
|
|
7899
|
-
* }
|
|
7900
|
-
* runExample().catch(console.error);
|
|
7901
|
-
* ```
|
|
7902
|
-
* @group DigitalAsset
|
|
7903
|
-
*/
|
|
7904
|
-
getCurrentDigitalAssetOwnership(args: {
|
|
7905
|
-
digitalAssetAddress: AccountAddressInput;
|
|
7906
|
-
minimumLedgerVersion?: AnyNumber;
|
|
7907
|
-
}): Promise<GetCurrentTokenOwnershipResponse>;
|
|
7908
|
-
/**
|
|
7909
|
-
* Retrieves the digital assets owned by a specified address.
|
|
7910
|
-
*
|
|
7911
|
-
* @param args.ownerAddress The address of the owner.
|
|
7912
|
-
* @param args.minimumLedgerVersion Optional ledger version to sync up to before querying.
|
|
7913
|
-
* @param args.options Optional pagination and ordering parameters for the response.
|
|
7914
|
-
*
|
|
7915
|
-
* @returns GetOwnedTokensResponse containing ownership data of the digital assets belonging to the ownerAddress.
|
|
7916
|
-
*
|
|
7917
|
-
* @example
|
|
7918
|
-
* ```typescript
|
|
7919
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
7920
|
-
*
|
|
7921
|
-
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
7922
|
-
* const aptos = new Aptos(config);
|
|
7923
|
-
*
|
|
7924
|
-
* async function runExample() {
|
|
7925
|
-
* // Fetching the digital assets owned by the specified address
|
|
7926
|
-
* const digitalAssets = await aptos.getOwnedDigitalAssets({
|
|
7927
|
-
* ownerAddress: "0x1", // replace with a real account address
|
|
7928
|
-
* });
|
|
7929
|
-
*
|
|
7930
|
-
* console.log(digitalAssets);
|
|
7931
|
-
* }
|
|
7932
|
-
* runExample().catch(console.error);
|
|
7933
|
-
* ```
|
|
7934
|
-
* @group DigitalAsset
|
|
7935
|
-
*/
|
|
7936
|
-
getOwnedDigitalAssets(args: {
|
|
7937
|
-
ownerAddress: AccountAddressInput;
|
|
7938
|
-
minimumLedgerVersion?: AnyNumber;
|
|
7939
|
-
options?: PaginationArgs & OrderByArg<GetOwnedTokensResponse[0]>;
|
|
7940
|
-
}): Promise<GetOwnedTokensResponse>;
|
|
7941
|
-
/**
|
|
7942
|
-
* Retrieves the activity data for a specified digital asset using its address.
|
|
7943
|
-
*
|
|
7944
|
-
* @param args - The parameters for the request.
|
|
7945
|
-
* @param args.digitalAssetAddress - The address of the digital asset.
|
|
7946
|
-
* @param args.minimumLedgerVersion - Optional minimum ledger version to sync up to before querying.
|
|
7947
|
-
* @param args.options - Optional pagination and ordering parameters.
|
|
7948
|
-
*
|
|
7949
|
-
* @returns A promise that resolves to the activity data related to the digital asset.
|
|
7950
|
-
*
|
|
7951
|
-
* @example
|
|
7952
|
-
* ```typescript
|
|
7953
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
7954
|
-
*
|
|
7955
|
-
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
7956
|
-
* const aptos = new Aptos(config);
|
|
7957
|
-
*
|
|
7958
|
-
* async function runExample() {
|
|
7959
|
-
* // Get the activity data for a digital asset
|
|
7960
|
-
* const digitalAssetActivity = await aptos.getDigitalAssetActivity({
|
|
7961
|
-
* digitalAssetAddress: "0x123", // replace with a real digital asset address
|
|
7962
|
-
* });
|
|
7963
|
-
*
|
|
7964
|
-
* console.log(digitalAssetActivity);
|
|
7965
|
-
* }
|
|
7966
|
-
* runExample().catch(console.error);
|
|
7967
|
-
* ```
|
|
7968
|
-
* @group DigitalAsset
|
|
7969
|
-
*/
|
|
7970
|
-
getDigitalAssetActivity(args: {
|
|
7971
|
-
digitalAssetAddress: AccountAddressInput;
|
|
7972
|
-
minimumLedgerVersion?: AnyNumber;
|
|
7973
|
-
options?: PaginationArgs & OrderByArg<GetTokenActivityResponse[0]>;
|
|
7974
|
-
}): Promise<GetTokenActivityResponse>;
|
|
7975
|
-
/**
|
|
7976
|
-
* Creates a new collection within the specified account.
|
|
7977
|
-
*
|
|
7978
|
-
* @param args.creator - The account of the collection's creator.
|
|
7979
|
-
* @param args.description - The description of the collection.
|
|
7980
|
-
* @param args.name - The name of the collection.
|
|
7981
|
-
* @param args.uri - The URI to additional info about the collection.
|
|
7982
|
-
* @param args.options - Optional parameters for generating the transaction.
|
|
7983
|
-
*
|
|
7984
|
-
* The parameters below are optional:
|
|
7985
|
-
* @param args.maxSupply - Controls the max supply of the digital assets. Defaults to MAX_U64_BIG_INT.
|
|
7986
|
-
* @param args.mutableDescription - Controls mutability of the collection's description. Defaults to true.
|
|
7987
|
-
* @param args.mutableRoyalty - Controls mutability of the collection's royalty. Defaults to true.
|
|
7988
|
-
* @param args.mutableUri - Controls mutability of the collection's URI. Defaults to true.
|
|
7989
|
-
* @param args.mutableTokenDescription - Controls mutability of the digital asset's description. Defaults to true.
|
|
7990
|
-
* @param args.mutableTokenName - Controls mutability of the digital asset's name. Defaults to true.
|
|
7991
|
-
* @param args.mutableTokenProperties - Controls mutability of digital asset's properties. Defaults to true.
|
|
7992
|
-
* @param args.mutableTokenUri - Controls mutability of the digital asset's URI. Defaults to true.
|
|
7993
|
-
* @param args.tokensBurnableByCreator - Controls whether digital assets can be burnable by the creator. Defaults to true.
|
|
7994
|
-
* @param args.tokensFreezableByCreator - Controls whether digital assets can be frozen by the creator. Defaults to true.
|
|
7995
|
-
* @param args.royaltyNumerator - The numerator of the royalty to be paid to the creator when a digital asset is transferred.
|
|
7996
|
-
* Defaults to 0.
|
|
7997
|
-
* @param args.royaltyDenominator - The denominator of the royalty to be paid to the creator when a digital asset is
|
|
7998
|
-
* transferred. Defaults to 1.
|
|
7999
|
-
*
|
|
8000
|
-
* @returns A SimpleTransaction that when submitted will create the collection.
|
|
8001
|
-
*
|
|
8002
|
-
* @example
|
|
8003
|
-
* ```typescript
|
|
8004
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
8005
|
-
*
|
|
8006
|
-
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
8007
|
-
* const aptos = new Aptos(config);
|
|
8008
|
-
*
|
|
8009
|
-
* async function runExample() {
|
|
8010
|
-
* // Creating a new collection transaction
|
|
8011
|
-
* const transaction = await aptos.createCollectionTransaction({
|
|
8012
|
-
* creator: Account.generate(), // Replace with a real account
|
|
8013
|
-
* description: "A unique collection of digital assets.",
|
|
8014
|
-
* name: "My Digital Collection",
|
|
8015
|
-
* uri: "https://mycollection.com",
|
|
8016
|
-
* });
|
|
8017
|
-
*
|
|
8018
|
-
* console.log("Transaction created:", transaction);
|
|
8019
|
-
* }
|
|
8020
|
-
* runExample().catch(console.error);
|
|
8021
|
-
* ```
|
|
8022
|
-
* @group DigitalAsset
|
|
8023
|
-
*/
|
|
8024
|
-
createCollectionTransaction(args: {
|
|
8025
|
-
creator: Account$1;
|
|
8026
|
-
description: string;
|
|
8027
|
-
name: string;
|
|
8028
|
-
uri: string;
|
|
8029
|
-
options?: InputGenerateTransactionOptions;
|
|
8030
|
-
} & CreateCollectionOptions): Promise<SimpleTransaction>;
|
|
8031
|
-
/**
|
|
8032
|
-
* Create a transaction to mint a digital asset into the creator's account within an existing collection.
|
|
8033
|
-
* This function helps you generate a transaction that can be simulated or submitted to the blockchain for minting a digital asset.
|
|
8034
|
-
*
|
|
8035
|
-
* @param args.creator - The creator of the collection.
|
|
8036
|
-
* @param args.collection - The name of the collection the digital asset belongs to.
|
|
8037
|
-
* @param args.description - The description of the digital asset.
|
|
8038
|
-
* @param args.name - The name of the digital asset.
|
|
8039
|
-
* @param args.uri - The URI to additional info about the digital asset.
|
|
8040
|
-
* @param args.propertyKeys - Optional array of property keys for the digital asset.
|
|
8041
|
-
* @param args.propertyTypes - Optional array of property types for the digital asset.
|
|
8042
|
-
* @param args.propertyValues - Optional array of property values for the digital asset.
|
|
8043
|
-
* @param args.options - Optional transaction generation options.
|
|
8044
|
-
*
|
|
8045
|
-
* @returns A SimpleTransaction that can be simulated or submitted to the chain.
|
|
8046
|
-
*
|
|
8047
|
-
* @example
|
|
8048
|
-
* ```typescript
|
|
8049
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
8050
|
-
*
|
|
8051
|
-
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
8052
|
-
* const aptos = new Aptos(config);
|
|
8053
|
-
*
|
|
8054
|
-
* async function runExample() {
|
|
8055
|
-
* // Creating a transaction to mint a digital asset
|
|
8056
|
-
* const transaction = await aptos.mintDigitalAssetTransaction({
|
|
8057
|
-
* creator: Account.generate(), // replace with a real account
|
|
8058
|
-
* collection: "MyCollection",
|
|
8059
|
-
* description: "This is a digital asset.",
|
|
8060
|
-
* name: "MyDigitalAsset",
|
|
8061
|
-
* uri: "https://example.com/my-digital-asset",
|
|
8062
|
-
* });
|
|
8063
|
-
*
|
|
8064
|
-
* console.log(transaction);
|
|
8065
|
-
* }
|
|
8066
|
-
* runExample().catch(console.error);
|
|
8067
|
-
* ```
|
|
8068
|
-
* @group DigitalAsset
|
|
8069
|
-
*/
|
|
8070
|
-
mintDigitalAssetTransaction(args: {
|
|
8071
|
-
creator: Account$1;
|
|
8072
|
-
collection: string;
|
|
8073
|
-
description: string;
|
|
8074
|
-
name: string;
|
|
8075
|
-
uri: string;
|
|
8076
|
-
propertyKeys?: Array<string>;
|
|
8077
|
-
propertyTypes?: Array<PropertyType>;
|
|
8078
|
-
propertyValues?: Array<PropertyValue>;
|
|
8079
|
-
options?: InputGenerateTransactionOptions;
|
|
8080
|
-
}): Promise<SimpleTransaction>;
|
|
8081
|
-
/**
|
|
8082
|
-
* Transfer ownership of a non-fungible digital asset.
|
|
8083
|
-
* This function allows you to transfer a digital asset only if it is not frozen, meaning the ownership transfer is not disabled.
|
|
8084
|
-
*
|
|
8085
|
-
* @param args The arguments for transferring the digital asset.
|
|
8086
|
-
* @param args.sender The sender account of the current digital asset owner.
|
|
8087
|
-
* @param args.digitalAssetAddress The address of the digital asset being transferred.
|
|
8088
|
-
* @param args.recipient The account address of the recipient.
|
|
8089
|
-
* @param args.digitalAssetType Optional. The type of the digital asset, defaults to "0x4::token::Token".
|
|
8090
|
-
* @param args.options Optional. Additional options for generating the transaction.
|
|
8091
|
-
*
|
|
8092
|
-
* @returns A SimpleTransaction that can be simulated or submitted to the chain.
|
|
8093
|
-
*
|
|
8094
|
-
* @example
|
|
8095
|
-
* ```typescript
|
|
8096
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
8097
|
-
*
|
|
8098
|
-
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
8099
|
-
* const aptos = new Aptos(config);
|
|
8100
|
-
*
|
|
8101
|
-
* async function runExample() {
|
|
8102
|
-
* // Transfer a digital asset
|
|
8103
|
-
* const transaction = await aptos.transferDigitalAssetTransaction({
|
|
8104
|
-
* sender: Account.generate(), // replace with a real sender account
|
|
8105
|
-
* digitalAssetAddress: "0x123", // replace with a real digital asset address
|
|
8106
|
-
* recipient: "0x456", // replace with a real recipient account address
|
|
8107
|
-
* });
|
|
8108
|
-
*
|
|
8109
|
-
* console.log(transaction);
|
|
8110
|
-
* }
|
|
8111
|
-
* runExample().catch(console.error);
|
|
8112
|
-
* ```
|
|
8113
|
-
* @group DigitalAsset
|
|
8114
|
-
*/
|
|
8115
|
-
transferDigitalAssetTransaction(args: {
|
|
8116
|
-
sender: Account$1;
|
|
8117
|
-
digitalAssetAddress: AccountAddressInput;
|
|
8118
|
-
recipient: AccountAddress;
|
|
8119
|
-
digitalAssetType?: MoveStructId;
|
|
8120
|
-
options?: InputGenerateTransactionOptions;
|
|
8121
|
-
}): Promise<SimpleTransaction>;
|
|
8122
|
-
/**
|
|
8123
|
-
* Mint a soul bound digital asset into a recipient's account.
|
|
8124
|
-
* This function allows you to create a unique digital asset that is bound to a specific account.
|
|
8125
|
-
*
|
|
8126
|
-
* @param args - The arguments for minting the soul bound transaction.
|
|
8127
|
-
* @param args.account - The account that mints the digital asset.
|
|
8128
|
-
* @param args.collection - The collection name that the digital asset belongs to.
|
|
8129
|
-
* @param args.description - The digital asset description.
|
|
8130
|
-
* @param args.name - The digital asset name.
|
|
8131
|
-
* @param args.uri - The digital asset URL.
|
|
8132
|
-
* @param args.recipient - The account address where the digital asset will be created.
|
|
8133
|
-
* @param args.propertyKeys - The property keys for storing on-chain properties.
|
|
8134
|
-
* @param args.propertyTypes - The type of property values.
|
|
8135
|
-
* @param args.propertyValues - The property values to be stored on-chain.
|
|
8136
|
-
* @param args.options - Additional options for generating the transaction.
|
|
8137
|
-
*
|
|
8138
|
-
* @returns A SimpleTransaction that can be simulated or submitted to the chain.
|
|
8139
|
-
*
|
|
8140
|
-
* @example
|
|
8141
|
-
* ```typescript
|
|
8142
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
8143
|
-
*
|
|
8144
|
-
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
8145
|
-
* const aptos = new Aptos(config);
|
|
8146
|
-
*
|
|
8147
|
-
* async function runExample() {
|
|
8148
|
-
* // Mint a soul bound digital asset
|
|
8149
|
-
* const transaction = await aptos.mintSoulBoundTransaction({
|
|
8150
|
-
* account: Account.generate(), // Replace with a real account
|
|
8151
|
-
* collection: "collectionName",
|
|
8152
|
-
* description: "collectionDescription",
|
|
8153
|
-
* name: "digitalAssetName",
|
|
8154
|
-
* uri: "digital-asset-uri.com",
|
|
8155
|
-
* recipient: "0x123" // Replace with a real recipient account address
|
|
8156
|
-
* });
|
|
8157
|
-
*
|
|
8158
|
-
* console.log(transaction);
|
|
8159
|
-
* }
|
|
8160
|
-
* runExample().catch(console.error);
|
|
8161
|
-
* ```
|
|
8162
|
-
* @group DigitalAsset
|
|
8163
|
-
*/
|
|
8164
|
-
mintSoulBoundTransaction(args: {
|
|
8165
|
-
account: Account$1;
|
|
8166
|
-
collection: string;
|
|
8167
|
-
description: string;
|
|
8168
|
-
name: string;
|
|
8169
|
-
uri: string;
|
|
8170
|
-
recipient: AccountAddressInput;
|
|
8171
|
-
propertyKeys?: Array<string>;
|
|
8172
|
-
propertyTypes?: Array<PropertyType>;
|
|
8173
|
-
propertyValues?: Array<PropertyValue>;
|
|
8174
|
-
options?: InputGenerateTransactionOptions;
|
|
8175
|
-
}): Promise<SimpleTransaction>;
|
|
8176
|
-
/**
|
|
8177
|
-
* Burn a digital asset by its creator, allowing for the removal of a specified digital asset from the blockchain.
|
|
8178
|
-
*
|
|
8179
|
-
* @param args The arguments for burning the digital asset.
|
|
8180
|
-
* @param args.creator The creator account that is burning the digital asset.
|
|
8181
|
-
* @param args.digitalAssetAddress The address of the digital asset to be burned.
|
|
8182
|
-
* @param args.digitalAssetType Optional. The type of the digital asset being burned.
|
|
8183
|
-
* @param args.options Optional. Additional options for generating the transaction.
|
|
8184
|
-
*
|
|
8185
|
-
* @returns A SimpleTransaction that can be simulated or submitted to the chain.
|
|
8186
|
-
*
|
|
8187
|
-
* @example
|
|
8188
|
-
* ```typescript
|
|
8189
|
-
* import { Aptos, AptosConfig, Network, Account } from "@aptos-labs/ts-sdk";
|
|
8190
|
-
*
|
|
8191
|
-
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
8192
|
-
* const aptos = new Aptos(config);
|
|
8193
|
-
*
|
|
8194
|
-
* async function runExample() {
|
|
8195
|
-
* const creator = Account.generate(); // Replace with a real creator account
|
|
8196
|
-
* const transaction = await aptos.burnDigitalAssetTransaction({
|
|
8197
|
-
* creator: creator,
|
|
8198
|
-
* digitalAssetAddress: "0x123", // Replace with a real digital asset address
|
|
8199
|
-
* });
|
|
8200
|
-
*
|
|
8201
|
-
* console.log(transaction);
|
|
8202
|
-
* }
|
|
8203
|
-
* runExample().catch(console.error);
|
|
8204
|
-
* ```
|
|
8205
|
-
* @group DigitalAsset
|
|
8206
|
-
*/
|
|
8207
|
-
burnDigitalAssetTransaction(args: {
|
|
8208
|
-
creator: Account$1;
|
|
8209
|
-
digitalAssetAddress: AccountAddressInput;
|
|
8210
|
-
digitalAssetType?: MoveStructId;
|
|
8211
|
-
options?: InputGenerateTransactionOptions;
|
|
8212
|
-
}): Promise<SimpleTransaction>;
|
|
8213
|
-
/**
|
|
8214
|
-
* Freeze the ability to transfer a specified digital asset.
|
|
8215
|
-
* This function allows the creator to restrict the transfer capability of a digital asset.
|
|
8216
|
-
*
|
|
8217
|
-
* @param args The arguments for freezing the digital asset transfer.
|
|
8218
|
-
* @param args.creator The creator account initiating the freeze.
|
|
8219
|
-
* @param args.digitalAssetAddress The address of the digital asset to be frozen.
|
|
8220
|
-
* @param args.digitalAssetType Optional. The type of the digital asset being frozen.
|
|
8221
|
-
* @param args.options Optional. Additional options for generating the transaction.
|
|
8222
|
-
*
|
|
8223
|
-
* @returns A SimpleTransaction that can be simulated or submitted to the chain.
|
|
8224
|
-
*
|
|
8225
|
-
* @example
|
|
8226
|
-
* ```typescript
|
|
8227
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
8228
|
-
*
|
|
8229
|
-
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
8230
|
-
* const aptos = new Aptos(config);
|
|
8231
|
-
*
|
|
8232
|
-
* async function runExample() {
|
|
8233
|
-
* // Freeze the digital asset transfer
|
|
8234
|
-
* const transaction = await aptos.freezeDigitalAssetTransaferTransaction({
|
|
8235
|
-
* creator: Account.generate(), // Replace with a real account if needed
|
|
8236
|
-
* digitalAssetAddress: "0x123", // Replace with a real digital asset address
|
|
8237
|
-
* });
|
|
8238
|
-
*
|
|
8239
|
-
* console.log(transaction);
|
|
8240
|
-
* }
|
|
8241
|
-
* runExample().catch(console.error);
|
|
8242
|
-
* ```
|
|
8243
|
-
* @group DigitalAsset
|
|
8244
|
-
*/
|
|
8245
|
-
freezeDigitalAssetTransaferTransaction(args: {
|
|
8246
|
-
creator: Account$1;
|
|
8247
|
-
digitalAssetAddress: AccountAddressInput;
|
|
8248
|
-
digitalAssetType?: MoveStructId;
|
|
8249
|
-
options?: InputGenerateTransactionOptions;
|
|
8250
|
-
}): Promise<SimpleTransaction>;
|
|
8251
|
-
/**
|
|
8252
|
-
* Unfreeze the ability to transfer a digital asset.
|
|
8253
|
-
* This function allows the specified creator account to unfreeze the transfer of a digital asset identified by its address.
|
|
8254
|
-
*
|
|
8255
|
-
* @param args The parameters for unfreezing the digital asset transfer.
|
|
8256
|
-
* @param args.creator The creator account that is unfreezing the digital asset transfer.
|
|
8257
|
-
* @param args.digitalAssetAddress The address of the digital asset to unfreeze.
|
|
8258
|
-
* @param args.digitalAssetType Optional. The type of the digital asset being unfrozen.
|
|
8259
|
-
* @param args.options Optional. Additional options for generating the transaction.
|
|
8260
|
-
*
|
|
8261
|
-
* @returns A SimpleTransaction that can be simulated or submitted to the chain.
|
|
8262
|
-
*
|
|
8263
|
-
* @example
|
|
8264
|
-
* ```typescript
|
|
8265
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
8266
|
-
*
|
|
8267
|
-
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
8268
|
-
* const aptos = new Aptos(config);
|
|
8269
|
-
*
|
|
8270
|
-
* async function runExample() {
|
|
8271
|
-
* // Unfreeze the ability to transfer a digital asset
|
|
8272
|
-
* const transaction = await aptos.unfreezeDigitalAssetTransaferTransaction({
|
|
8273
|
-
* creator: Account.generate(), // replace with a real creator account
|
|
8274
|
-
* digitalAssetAddress: "0x123", // replace with a real digital asset address
|
|
8275
|
-
* });
|
|
8276
|
-
*
|
|
8277
|
-
* console.log(transaction);
|
|
8278
|
-
* }
|
|
8279
|
-
* runExample().catch(console.error);
|
|
8280
|
-
* ```
|
|
8281
|
-
* @group DigitalAsset
|
|
8282
|
-
*/
|
|
8283
|
-
unfreezeDigitalAssetTransaferTransaction(args: {
|
|
8284
|
-
creator: Account$1;
|
|
8285
|
-
digitalAssetAddress: AccountAddressInput;
|
|
8286
|
-
digitalAssetType?: MoveStructId;
|
|
8287
|
-
options?: InputGenerateTransactionOptions;
|
|
8288
|
-
}): Promise<SimpleTransaction>;
|
|
8289
|
-
/**
|
|
8290
|
-
* Set the digital asset description to provide additional context or information about the asset.
|
|
8291
|
-
*
|
|
8292
|
-
* @param args The parameters for setting the digital asset description.
|
|
8293
|
-
* @param args.creator The creator account responsible for the digital asset.
|
|
8294
|
-
* @param args.description The digital asset description to be set.
|
|
8295
|
-
* @param args.digitalAssetAddress The address of the digital asset.
|
|
8296
|
-
* @param args.digitalAssetType Optional. The type of the digital asset.
|
|
8297
|
-
* @param args.options Optional. Additional options for generating the transaction.
|
|
8298
|
-
*
|
|
8299
|
-
* @returns A SimpleTransaction that can be simulated or submitted to the chain.
|
|
8300
|
-
*
|
|
8301
|
-
* @example
|
|
8302
|
-
* ```typescript
|
|
8303
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
8304
|
-
*
|
|
8305
|
-
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
8306
|
-
* const aptos = new Aptos(config);
|
|
8307
|
-
*
|
|
8308
|
-
* async function runExample() {
|
|
8309
|
-
* // Set the digital asset description
|
|
8310
|
-
* const transaction = await aptos.setDigitalAssetDescriptionTransaction({
|
|
8311
|
-
* creator: Account.generate(), // replace with a real account
|
|
8312
|
-
* description: "This is a digital asset description.",
|
|
8313
|
-
* digitalAssetAddress: "0x123", // replace with a real digital asset address
|
|
8314
|
-
* });
|
|
8315
|
-
*
|
|
8316
|
-
* console.log(transaction);
|
|
8317
|
-
* }
|
|
8318
|
-
* runExample().catch(console.error);
|
|
8319
|
-
* ```
|
|
8320
|
-
* @group DigitalAsset
|
|
8321
|
-
*/
|
|
8322
|
-
setDigitalAssetDescriptionTransaction(args: {
|
|
8323
|
-
creator: Account$1;
|
|
8324
|
-
description: string;
|
|
8325
|
-
digitalAssetAddress: AccountAddressInput;
|
|
8326
|
-
digitalAssetType?: MoveStructId;
|
|
8327
|
-
options?: InputGenerateTransactionOptions;
|
|
8328
|
-
}): Promise<SimpleTransaction>;
|
|
8329
|
-
/**
|
|
8330
|
-
* Set the digital asset name, allowing you to define a name for a specific digital asset on the blockchain.
|
|
8331
|
-
*
|
|
8332
|
-
* @param args The parameters for setting the digital asset name.
|
|
8333
|
-
* @param args.creator The creator account responsible for the transaction.
|
|
8334
|
-
* @param args.name The desired name for the digital asset.
|
|
8335
|
-
* @param args.digitalAssetAddress The address of the digital asset.
|
|
8336
|
-
* @param args.digitalAssetType Optional. The type of the digital asset, represented as a Move struct ID.
|
|
8337
|
-
* @param args.options Optional. Additional options for generating the transaction.
|
|
8338
|
-
*
|
|
8339
|
-
* @returns A SimpleTransaction that can be simulated or submitted to the blockchain.
|
|
8340
|
-
*
|
|
8341
|
-
* @example
|
|
8342
|
-
* ```typescript
|
|
8343
|
-
* import { Aptos, AptosConfig, Network, Account } from "@aptos-labs/ts-sdk";
|
|
8344
|
-
*
|
|
8345
|
-
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
8346
|
-
* const aptos = new Aptos(config);
|
|
8347
|
-
*
|
|
8348
|
-
* async function runExample() {
|
|
8349
|
-
* const creator = Account.generate(); // Generate a new account for the creator
|
|
8350
|
-
* const digitalAssetAddress = "0x123"; // replace with a real digital asset address
|
|
8351
|
-
*
|
|
8352
|
-
* // Set the digital asset name
|
|
8353
|
-
* const transaction = await aptos.setDigitalAssetNameTransaction({
|
|
8354
|
-
* creator: creator,
|
|
8355
|
-
* name: "digitalAssetName",
|
|
8356
|
-
* digitalAssetAddress: digitalAssetAddress,
|
|
8357
|
-
* });
|
|
8358
|
-
*
|
|
8359
|
-
* console.log(transaction);
|
|
8360
|
-
* }
|
|
8361
|
-
* runExample().catch(console.error);
|
|
8362
|
-
* ```
|
|
8363
|
-
* @group DigitalAsset
|
|
8364
|
-
*/
|
|
8365
|
-
setDigitalAssetNameTransaction(args: {
|
|
8366
|
-
creator: Account$1;
|
|
8367
|
-
name: string;
|
|
8368
|
-
digitalAssetAddress: AccountAddressInput;
|
|
8369
|
-
digitalAssetType?: MoveStructId;
|
|
8370
|
-
options?: InputGenerateTransactionOptions;
|
|
8371
|
-
}): Promise<SimpleTransaction>;
|
|
8372
|
-
/**
|
|
8373
|
-
* Set the URI for a digital asset, allowing you to associate a unique identifier with the asset.
|
|
8374
|
-
*
|
|
8375
|
-
* @param args The parameters for the transaction.
|
|
8376
|
-
* @param args.creator The creator account initiating the transaction.
|
|
8377
|
-
* @param args.uri The digital asset URI to be set.
|
|
8378
|
-
* @param args.digitalAssetAddress The address of the digital asset.
|
|
8379
|
-
* @param args.digitalAssetType Optional. The type of the digital asset.
|
|
8380
|
-
* @param args.options Optional. Additional options for generating the transaction.
|
|
8381
|
-
* @returns A SimpleTransaction that can be simulated or submitted to the chain.
|
|
8382
|
-
*
|
|
8383
|
-
* @example
|
|
8384
|
-
* ```typescript
|
|
8385
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
8386
|
-
*
|
|
8387
|
-
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
8388
|
-
* const aptos = new Aptos(config);
|
|
8389
|
-
*
|
|
8390
|
-
* async function runExample() {
|
|
8391
|
-
* // Set the URI for a digital asset
|
|
8392
|
-
* const transaction = await aptos.setDigitalAssetURITransaction({
|
|
8393
|
-
* creator: Account.generate(), // Replace with a real creator account
|
|
8394
|
-
* uri: "digital-asset-uri.com",
|
|
8395
|
-
* digitalAssetAddress: "0x123", // Replace with a real digital asset address
|
|
8396
|
-
* });
|
|
8397
|
-
*
|
|
8398
|
-
* console.log(transaction);
|
|
8399
|
-
* }
|
|
8400
|
-
* runExample().catch(console.error);
|
|
8401
|
-
* ```
|
|
8402
|
-
* @group DigitalAsset
|
|
8403
|
-
*/
|
|
8404
|
-
setDigitalAssetURITransaction(args: {
|
|
8405
|
-
creator: Account$1;
|
|
8406
|
-
uri: string;
|
|
8407
|
-
digitalAssetAddress: AccountAddressInput;
|
|
8408
|
-
digitalAssetType?: MoveStructId;
|
|
8409
|
-
options?: InputGenerateTransactionOptions;
|
|
8410
|
-
}): Promise<SimpleTransaction>;
|
|
8411
|
-
/**
|
|
8412
|
-
* Add a digital asset property to the blockchain.
|
|
8413
|
-
* This function allows you to specify a new property for a digital asset, including its key, type, and value.
|
|
8414
|
-
*
|
|
8415
|
-
* @param args - The arguments for adding a digital asset property.
|
|
8416
|
-
* @param args.creator - The account that mints the digital asset.
|
|
8417
|
-
* @param args.propertyKey - The property key for storing on-chain properties.
|
|
8418
|
-
* @param args.propertyType - The type of property value.
|
|
8419
|
-
* @param args.propertyValue - The property value to be stored on-chain.
|
|
8420
|
-
* @param args.digitalAssetAddress - The digital asset address.
|
|
8421
|
-
* @param args.digitalAssetType - (Optional) The type of the digital asset.
|
|
8422
|
-
* @param args.options - (Optional) Options for generating the transaction.
|
|
8423
|
-
* @returns A SimpleTransaction that can be simulated or submitted to the chain.
|
|
8424
|
-
*
|
|
8425
|
-
* @example
|
|
8426
|
-
* ```typescript
|
|
8427
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
8428
|
-
*
|
|
8429
|
-
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
8430
|
-
* const aptos = new Aptos(config);
|
|
8431
|
-
*
|
|
8432
|
-
* async function runExample() {
|
|
8433
|
-
* // Add a digital asset property
|
|
8434
|
-
* const transaction = await aptos.addDigitalAssetPropertyTransaction({
|
|
8435
|
-
* creator: Account.generate(), // Replace with a real account
|
|
8436
|
-
* propertyKey: "newKey",
|
|
8437
|
-
* propertyType: "BOOLEAN",
|
|
8438
|
-
* propertyValue: true,
|
|
8439
|
-
* digitalAssetAddress: "0x123", // Replace with a real digital asset address
|
|
8440
|
-
* });
|
|
8441
|
-
*
|
|
8442
|
-
* console.log(transaction);
|
|
8443
|
-
* }
|
|
8444
|
-
* runExample().catch(console.error);
|
|
8445
|
-
* ```
|
|
8446
|
-
* @group DigitalAsset
|
|
8447
|
-
*/
|
|
8448
|
-
addDigitalAssetPropertyTransaction(args: {
|
|
8449
|
-
creator: Account$1;
|
|
8450
|
-
propertyKey: string;
|
|
8451
|
-
propertyType: PropertyType;
|
|
8452
|
-
propertyValue: PropertyValue;
|
|
8453
|
-
digitalAssetAddress: AccountAddressInput;
|
|
8454
|
-
digitalAssetType?: MoveStructId;
|
|
8455
|
-
options?: InputGenerateTransactionOptions;
|
|
8456
|
-
}): Promise<SimpleTransaction>;
|
|
8457
|
-
/**
|
|
8458
|
-
* Remove a digital asset property from the blockchain.
|
|
8459
|
-
* This function allows you to delete an existing property associated with a digital asset.
|
|
8460
|
-
*
|
|
8461
|
-
* @param args The parameters required to remove the digital asset property.
|
|
8462
|
-
* @param args.creator The account that mints the digital asset.
|
|
8463
|
-
* @param args.propertyKey The property key for storing on-chain properties.
|
|
8464
|
-
* @param args.propertyType The type of property value.
|
|
8465
|
-
* @param args.propertyValue The property value to be stored on-chain.
|
|
8466
|
-
* @param args.digitalAssetAddress The digital asset address.
|
|
8467
|
-
* @param args.digitalAssetType Optional. The type of the digital asset.
|
|
8468
|
-
* @param args.options Optional. Additional options for generating the transaction.
|
|
8469
|
-
*
|
|
8470
|
-
* @returns A SimpleTransaction that can be simulated or submitted to the chain.
|
|
8471
|
-
*
|
|
8472
|
-
* @example
|
|
8473
|
-
* ```typescript
|
|
8474
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
8475
|
-
*
|
|
8476
|
-
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
8477
|
-
* const aptos = new Aptos(config);
|
|
8478
|
-
*
|
|
8479
|
-
* async function runExample() {
|
|
8480
|
-
* // Remove a digital asset property
|
|
8481
|
-
* const transaction = await aptos.removeDigitalAssetPropertyTransaction({
|
|
8482
|
-
* creator: Account.generate(), // replace with a real account
|
|
8483
|
-
* propertyKey: "newKey",
|
|
8484
|
-
* propertyType: "BOOLEAN",
|
|
8485
|
-
* propertyValue: true,
|
|
8486
|
-
* digitalAssetAddress: "0x123", // replace with a real digital asset address
|
|
8487
|
-
* });
|
|
8488
|
-
*
|
|
8489
|
-
* console.log(transaction);
|
|
8490
|
-
* }
|
|
8491
|
-
* runExample().catch(console.error);
|
|
8492
|
-
* ```
|
|
8493
|
-
* @group DigitalAsset
|
|
8494
|
-
*/
|
|
8495
|
-
removeDigitalAssetPropertyTransaction(args: {
|
|
8496
|
-
creator: Account$1;
|
|
8497
|
-
propertyKey: string;
|
|
8498
|
-
propertyType: PropertyType;
|
|
8499
|
-
propertyValue: PropertyValue;
|
|
8500
|
-
digitalAssetAddress: AccountAddressInput;
|
|
8501
|
-
digitalAssetType?: MoveStructId;
|
|
8502
|
-
options?: InputGenerateTransactionOptions;
|
|
8503
|
-
}): Promise<SimpleTransaction>;
|
|
8504
|
-
/**
|
|
8505
|
-
* Update a digital asset property on-chain.
|
|
8506
|
-
*
|
|
8507
|
-
* @param args The parameters for updating the digital asset property.
|
|
8508
|
-
* @param args.creator The account that mints the digital asset.
|
|
8509
|
-
* @param args.digitalAssetAddress The address of the digital asset.
|
|
8510
|
-
* @param args.propertyKey The property key for storing on-chain properties.
|
|
8511
|
-
* @param args.propertyType The type of property value.
|
|
8512
|
-
* @param args.propertyValue The property value to be stored on-chain.
|
|
8513
|
-
* @param args.digitalAssetType Optional. The type of the digital asset.
|
|
8514
|
-
* @param args.options Optional. Additional options for generating the transaction.
|
|
8515
|
-
*
|
|
8516
|
-
* @returns A SimpleTransaction that can be simulated or submitted to the chain.
|
|
8517
|
-
*
|
|
8518
|
-
* @example
|
|
8519
|
-
* ```typescript
|
|
8520
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
8521
|
-
*
|
|
8522
|
-
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
8523
|
-
* const aptos = new Aptos(config);
|
|
8524
|
-
*
|
|
8525
|
-
* async function runExample() {
|
|
8526
|
-
* // Update a digital asset property
|
|
8527
|
-
* const transaction = await aptos.updateDigitalAssetPropertyTransaction({
|
|
8528
|
-
* creator: Account.generate(), // replace with a real account
|
|
8529
|
-
* propertyKey: "newKey",
|
|
8530
|
-
* propertyType: "BOOLEAN",
|
|
8531
|
-
* propertyValue: false,
|
|
8532
|
-
* digitalAssetAddress: "0x123", // replace with a real digital asset address
|
|
8533
|
-
* });
|
|
8534
|
-
*
|
|
8535
|
-
* console.log(transaction);
|
|
8536
|
-
* }
|
|
8537
|
-
* runExample().catch(console.error);
|
|
8538
|
-
* ```
|
|
8539
|
-
* @group DigitalAsset
|
|
8540
|
-
*/
|
|
8541
|
-
updateDigitalAssetPropertyTransaction(args: {
|
|
8542
|
-
creator: Account$1;
|
|
8543
|
-
propertyKey: string;
|
|
8544
|
-
propertyType: PropertyType;
|
|
8545
|
-
propertyValue: PropertyValue;
|
|
8546
|
-
digitalAssetAddress: AccountAddressInput;
|
|
8547
|
-
digitalAssetType?: MoveStructId;
|
|
8548
|
-
options?: InputGenerateTransactionOptions;
|
|
8549
|
-
}): Promise<SimpleTransaction>;
|
|
8550
|
-
/**
|
|
8551
|
-
* Add a typed digital asset property to the blockchain.
|
|
8552
|
-
* This function allows you to define and store a specific property for a digital asset, enabling better categorization and
|
|
8553
|
-
* management of digital assets.
|
|
8554
|
-
*
|
|
8555
|
-
* @param args - The parameters for adding the typed property.
|
|
8556
|
-
* @param args.creator - The account that mints the digital asset.
|
|
8557
|
-
* @param args.propertyKey - The property key for storing on-chain properties.
|
|
8558
|
-
* @param args.propertyType - The type of property value.
|
|
8559
|
-
* @param args.propertyValue - The property value to be stored on-chain.
|
|
8560
|
-
* @param args.digitalAssetAddress - The digital asset address.
|
|
8561
|
-
* @param args.digitalAssetType - The optional type of the digital asset.
|
|
8562
|
-
* @param args.options - Optional transaction generation options.
|
|
8563
|
-
*
|
|
8564
|
-
* @returns A SimpleTransaction that can be simulated or submitted to the chain.
|
|
8565
|
-
*
|
|
8566
|
-
* @example
|
|
8567
|
-
* ```typescript
|
|
8568
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
8569
|
-
*
|
|
8570
|
-
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
8571
|
-
* const aptos = new Aptos(config);
|
|
8572
|
-
*
|
|
8573
|
-
* async function runExample() {
|
|
8574
|
-
* // Adding a typed digital asset property
|
|
8575
|
-
* const transaction = await aptos.addDigitalAssetTypedPropertyTransaction({
|
|
8576
|
-
* creator: Account.generate(), // replace with a real account
|
|
8577
|
-
* propertyKey: "typedKey",
|
|
8578
|
-
* propertyType: "STRING",
|
|
8579
|
-
* propertyValue: "hello",
|
|
8580
|
-
* digitalAssetAddress: "0x123", // replace with a real digital asset address
|
|
8581
|
-
* });
|
|
8582
|
-
*
|
|
8583
|
-
* console.log(transaction);
|
|
8584
|
-
* }
|
|
8585
|
-
* runExample().catch(console.error);
|
|
8586
|
-
* ```
|
|
8587
|
-
* @group DigitalAsset
|
|
8588
|
-
*/
|
|
8589
|
-
addDigitalAssetTypedPropertyTransaction(args: {
|
|
8590
|
-
creator: Account$1;
|
|
8591
|
-
propertyKey: string;
|
|
8592
|
-
propertyType: PropertyType;
|
|
8593
|
-
propertyValue: PropertyValue;
|
|
8594
|
-
digitalAssetAddress: AccountAddressInput;
|
|
8595
|
-
digitalAssetType?: MoveStructId;
|
|
8596
|
-
options?: InputGenerateTransactionOptions;
|
|
8597
|
-
}): Promise<SimpleTransaction>;
|
|
8598
|
-
/**
|
|
8599
|
-
* Update a typed digital asset property on-chain.
|
|
8600
|
-
* This function allows you to modify the properties of a digital asset, enabling dynamic updates to its attributes.
|
|
8601
|
-
*
|
|
8602
|
-
* @param args - The arguments for updating the digital asset property.
|
|
8603
|
-
* @param args.creator - The account that mints the digital asset.
|
|
8604
|
-
* @param args.propertyKey - The property key for storing on-chain properties.
|
|
8605
|
-
* @param args.propertyType - The type of property value.
|
|
8606
|
-
* @param args.propertyValue - The property value to be stored on-chain.
|
|
8607
|
-
* @param args.digitalAssetAddress - The digital asset address.
|
|
8608
|
-
* @param args.digitalAssetType - (Optional) The type of the digital asset.
|
|
8609
|
-
* @param args.options - (Optional) Additional options for generating the transaction.
|
|
8610
|
-
*
|
|
8611
|
-
* @returns A SimpleTransaction that can be simulated or submitted to the chain.
|
|
8612
|
-
*
|
|
8613
|
-
* @example
|
|
8614
|
-
* ```typescript
|
|
8615
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
8616
|
-
*
|
|
8617
|
-
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
8618
|
-
* const aptos = new Aptos(config);
|
|
8619
|
-
*
|
|
8620
|
-
* async function runExample() {
|
|
8621
|
-
* // Update a typed digital asset property
|
|
8622
|
-
* const transaction = await aptos.updateDigitalAssetTypedPropertyTransaction({
|
|
8623
|
-
* creator: Account.generate(), // replace with a real account
|
|
8624
|
-
* propertyKey: "typedKey",
|
|
8625
|
-
* propertyType: "U8",
|
|
8626
|
-
* propertyValue: 2,
|
|
8627
|
-
* digitalAssetAddress: "0x123", // replace with a real digital asset address
|
|
8628
|
-
* });
|
|
8629
|
-
*
|
|
8630
|
-
* console.log(transaction);
|
|
8631
|
-
* }
|
|
8632
|
-
* runExample().catch(console.error);
|
|
8633
|
-
* ```
|
|
8634
|
-
* @group DigitalAsset
|
|
8635
|
-
*/
|
|
8636
|
-
updateDigitalAssetTypedPropertyTransaction(args: {
|
|
8637
|
-
creator: Account$1;
|
|
8638
|
-
propertyKey: string;
|
|
8639
|
-
propertyType: PropertyType;
|
|
8640
|
-
propertyValue: PropertyValue;
|
|
8641
|
-
digitalAssetAddress: AccountAddressInput;
|
|
8642
|
-
digitalAssetType?: MoveStructId;
|
|
8643
|
-
options?: InputGenerateTransactionOptions;
|
|
8644
|
-
}): Promise<SimpleTransaction>;
|
|
8645
|
-
}
|
|
8646
|
-
|
|
8647
|
-
/**
|
|
8648
|
-
* A class to query all `Event` Aptos related queries.
|
|
8649
|
-
* @group Event
|
|
8650
|
-
*/
|
|
8651
|
-
declare class Event {
|
|
8652
|
-
readonly config: AptosConfig;
|
|
8653
|
-
/**
|
|
8654
|
-
* Initializes a new instance of the Aptos client with the provided configuration.
|
|
8655
|
-
*
|
|
8656
|
-
* @param config - The configuration settings for the Aptos client.
|
|
8657
|
-
* @param config.network - The network to connect to (e.g., Testnet, Mainnet).
|
|
8658
|
-
* @param config.nodeUrl - The URL of the Aptos node to connect to.
|
|
8659
|
-
* @param config.faucetUrl - The URL of the faucet to use for funding accounts.
|
|
8660
|
-
*
|
|
8661
|
-
* @example
|
|
8662
|
-
* ```typescript
|
|
8663
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
8664
|
-
*
|
|
8665
|
-
* async function runExample() {
|
|
8666
|
-
* // Create a new Aptos client with Testnet configuration
|
|
8667
|
-
* const config = new AptosConfig({ network: Network.TESTNET }); // Specify your own network if needed
|
|
8668
|
-
* const aptos = new Aptos(config);
|
|
8669
|
-
*
|
|
8670
|
-
* console.log("Aptos client initialized:", aptos);
|
|
8671
|
-
* }
|
|
8672
|
-
* runExample().catch(console.error);
|
|
8673
|
-
* ```
|
|
8674
|
-
* @group Event
|
|
8675
|
-
*/
|
|
8676
|
-
constructor(config: AptosConfig);
|
|
8677
|
-
/**
|
|
8678
|
-
* Retrieve module events based on a specified event type.
|
|
8679
|
-
* This function allows you to query for events that are associated with a particular module event type in the Aptos blockchain.
|
|
8680
|
-
*
|
|
8681
|
-
* @param args - The arguments for retrieving module events.
|
|
8682
|
-
* @param args.eventType - The event type to filter the results.
|
|
8683
|
-
* @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.
|
|
8684
|
-
* @param args.options - Optional pagination and ordering parameters for the event results.
|
|
8685
|
-
*
|
|
8686
|
-
* @returns Promise<GetEventsResponse> - A promise that resolves to the retrieved events.
|
|
8687
|
-
*
|
|
8688
|
-
* @example
|
|
8689
|
-
* ```typescript
|
|
8690
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
8691
|
-
*
|
|
8692
|
-
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
8693
|
-
* const aptos = new Aptos(config);
|
|
8694
|
-
*
|
|
8695
|
-
* async function runExample() {
|
|
8696
|
-
* // Retrieve module events for a specific event type
|
|
8697
|
-
* const events = await aptos.getModuleEventsByEventType({
|
|
8698
|
-
* eventType: "0x1::transaction_fee::FeeStatement", // specify the event type
|
|
8699
|
-
* minimumLedgerVersion: 1, // optional: specify minimum ledger version if needed
|
|
8700
|
-
* });
|
|
8701
|
-
*
|
|
8702
|
-
* console.log(events); // log the retrieved events
|
|
8703
|
-
* }
|
|
8704
|
-
* runExample().catch(console.error);
|
|
8705
|
-
* ```
|
|
8706
|
-
* @group Event
|
|
8707
|
-
*/
|
|
8708
|
-
getModuleEventsByEventType(args: {
|
|
8709
|
-
eventType: MoveStructId;
|
|
8710
|
-
minimumLedgerVersion?: AnyNumber;
|
|
8711
|
-
options?: PaginationArgs & OrderByArg<GetEventsResponse[0]>;
|
|
8712
|
-
}): Promise<GetEventsResponse>;
|
|
8713
|
-
/**
|
|
8714
|
-
* Retrieve events associated with a specific account address and creation number.
|
|
8715
|
-
*
|
|
8716
|
-
* @param args - The parameters for retrieving account events.
|
|
8717
|
-
* @param args.accountAddress - The account address to query events for.
|
|
8718
|
-
* @param args.creationNumber - The event creation number to filter the events.
|
|
8719
|
-
* @param args.minimumLedgerVersion - Optional minimum ledger version to sync up to before querying.
|
|
8720
|
-
*
|
|
8721
|
-
* @returns Promise<GetEventsResponse>
|
|
8722
|
-
*
|
|
8723
|
-
* @example
|
|
8724
|
-
* ```typescript
|
|
8725
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
8726
|
-
*
|
|
8727
|
-
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
8728
|
-
* const aptos = new Aptos(config);
|
|
8729
|
-
*
|
|
8730
|
-
* async function runExample() {
|
|
8731
|
-
* // Get events for the account at creation number 0
|
|
8732
|
-
* const events = await aptos.getAccountEventsByCreationNumber({
|
|
8733
|
-
* accountAddress: "0x1", // replace with a real account address
|
|
8734
|
-
* creationNumber: 0,
|
|
8735
|
-
* });
|
|
8736
|
-
*
|
|
8737
|
-
* console.log(events);
|
|
8738
|
-
* }
|
|
8739
|
-
* runExample().catch(console.error);
|
|
8740
|
-
* ```
|
|
8741
|
-
* @group Event
|
|
8742
|
-
*/
|
|
8743
|
-
getAccountEventsByCreationNumber(args: {
|
|
8744
|
-
accountAddress: AccountAddressInput;
|
|
8745
|
-
creationNumber: AnyNumber;
|
|
8746
|
-
minimumLedgerVersion?: AnyNumber;
|
|
8747
|
-
}): Promise<GetEventsResponse>;
|
|
8748
|
-
/**
|
|
8749
|
-
* Retrieve events associated with a specific account address and event type.
|
|
8750
|
-
*
|
|
8751
|
-
* @param args.accountAddress - The account address to query events for.
|
|
8752
|
-
* @param args.eventType - The type of event to filter by.
|
|
8753
|
-
* @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.
|
|
8754
|
-
* @param args.options - Optional pagination and ordering parameters for the event query.
|
|
8755
|
-
*
|
|
8756
|
-
* @returns Promise<GetEventsResponse>
|
|
8757
|
-
*
|
|
8758
|
-
* @example
|
|
8759
|
-
* ```typescript
|
|
8760
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
8761
|
-
*
|
|
8762
|
-
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
8763
|
-
* const aptos = new Aptos(config);
|
|
8764
|
-
*
|
|
8765
|
-
* async function runExample() {
|
|
8766
|
-
* // Get events for a specific account and event type
|
|
8767
|
-
* const events = await aptos.getAccountEventsByEventType({
|
|
8768
|
-
* accountAddress: "0x1", // replace with a real account address
|
|
8769
|
-
* eventType: "0x1::transaction_fee::FeeStatement", // replace with a real event type
|
|
8770
|
-
* minimumLedgerVersion: 1, // optional, specify if needed
|
|
8771
|
-
* });
|
|
8772
|
-
*
|
|
8773
|
-
* console.log(events);
|
|
8774
|
-
* }
|
|
8775
|
-
* runExample().catch(console.error);
|
|
8776
|
-
* ```
|
|
8777
|
-
* @group Event
|
|
8778
|
-
*/
|
|
8779
|
-
getAccountEventsByEventType(args: {
|
|
8780
|
-
accountAddress: AccountAddressInput;
|
|
8781
|
-
eventType: MoveStructId;
|
|
8782
|
-
minimumLedgerVersion?: AnyNumber;
|
|
8783
|
-
options?: PaginationArgs & OrderByArg<GetEventsResponse[0]>;
|
|
8784
|
-
}): Promise<GetEventsResponse>;
|
|
8785
|
-
/**
|
|
8786
|
-
* Retrieve all events from the Aptos blockchain.
|
|
8787
|
-
* An optional `where` clause can be provided to filter the results based on specific criteria.
|
|
8788
|
-
*
|
|
8789
|
-
* @param args Optional parameters for the query.
|
|
8790
|
-
* @param args.minimumLedgerVersion Optional ledger version to sync up to before querying.
|
|
8791
|
-
* @param args.options Optional pagination and filtering options.
|
|
8792
|
-
* @param args.options.where Optional condition to filter events.
|
|
8793
|
-
* @param args.options.offset Optional pagination offset.
|
|
8794
|
-
* @param args.options.limit Optional maximum number of events to return.
|
|
8795
|
-
* @param args.options.orderBy Optional ordering of the results.
|
|
8796
|
-
*
|
|
8797
|
-
* @returns GetEventsQuery response type containing the events.
|
|
8798
|
-
*
|
|
8799
|
-
* @example
|
|
8800
|
-
* ```typescript
|
|
8801
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
8802
|
-
*
|
|
8803
|
-
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
8804
|
-
* const aptos = new Aptos(config);
|
|
8805
|
-
*
|
|
8806
|
-
* async function runExample() {
|
|
8807
|
-
* // Retrieve all events
|
|
8808
|
-
* const events = await aptos.getEvents();
|
|
8809
|
-
*
|
|
8810
|
-
* // Retrieve events with filtering by account address
|
|
8811
|
-
* const whereCondition = {
|
|
8812
|
-
* account_address: { _eq: "0x123" }, // replace with a real account address
|
|
8813
|
-
* };
|
|
8814
|
-
* const filteredEvents = await aptos.getEvents({
|
|
8815
|
-
* options: { where: whereCondition },
|
|
8816
|
-
* });
|
|
8817
|
-
*
|
|
8818
|
-
* console.log(events);
|
|
8819
|
-
* console.log(filteredEvents);
|
|
8820
|
-
* }
|
|
8821
|
-
* runExample().catch(console.error);
|
|
8822
|
-
* ```
|
|
8823
|
-
* @group Event
|
|
8824
|
-
*/
|
|
8825
|
-
getEvents(args?: {
|
|
8826
|
-
minimumLedgerVersion?: AnyNumber;
|
|
8827
|
-
options?: PaginationArgs & OrderByArg<GetEventsResponse[0]> & WhereArg<EventsBoolExp>;
|
|
8828
|
-
}): Promise<GetEventsResponse>;
|
|
8829
|
-
}
|
|
8830
|
-
|
|
8831
|
-
/**
|
|
8832
|
-
* A class to query all `Faucet` related queries on Aptos.
|
|
8833
|
-
* @group Faucet
|
|
8834
|
-
*/
|
|
8835
|
-
declare class Faucet {
|
|
8836
|
-
readonly config: AptosConfig;
|
|
8837
|
-
/**
|
|
8838
|
-
* Initializes a new instance of the Aptos client with the specified configuration.
|
|
8839
|
-
*
|
|
8840
|
-
* Note that only devnet has a publicly accessible faucet. For testnet, you must use
|
|
8841
|
-
* the minting page at https://aptos.dev/network/faucet.
|
|
8842
|
-
*
|
|
8843
|
-
* @param config - The configuration settings for the Aptos client.
|
|
8844
|
-
*
|
|
8845
|
-
* @example
|
|
8846
|
-
* ```typescript
|
|
8847
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
8848
|
-
*
|
|
8849
|
-
* async function runExample() {
|
|
8850
|
-
* // Create a configuration for the Aptos client
|
|
8851
|
-
* const config = new AptosConfig({ network: Network.DEVNET }); // specify your own network if needed
|
|
8852
|
-
*
|
|
8853
|
-
* // Initialize the Aptos client with the configuration
|
|
8854
|
-
* const aptos = new Aptos(config);
|
|
8855
|
-
*
|
|
8856
|
-
* console.log("Aptos client initialized:", aptos);
|
|
8857
|
-
* }
|
|
8858
|
-
* runExample().catch(console.error);
|
|
8859
|
-
* ```
|
|
8860
|
-
* @group Faucet
|
|
8861
|
-
*/
|
|
8862
|
-
constructor(config: AptosConfig);
|
|
8863
|
-
/**
|
|
8864
|
-
* This function creates an account if it does not exist and mints the specified amount of coins into that account.
|
|
8865
|
-
*
|
|
8866
|
-
* Note that only devnet has a publicly accessible faucet. For testnet, you must use
|
|
8867
|
-
* the minting page at https://aptos.dev/network/faucet.
|
|
8868
|
-
*
|
|
8869
|
-
* @param args - The arguments for funding the account.
|
|
8870
|
-
* @param args.accountAddress - The address of the account to fund.
|
|
8871
|
-
* @param args.amount - The amount of tokens to fund the account with.
|
|
8872
|
-
* @param args.options - Configuration options for waiting for the transaction.
|
|
8873
|
-
* @returns Transaction hash of the transaction that funded the account.
|
|
8874
|
-
*
|
|
8875
|
-
* @example
|
|
8876
|
-
* ```typescript
|
|
8877
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
8878
|
-
*
|
|
8879
|
-
* const config = new AptosConfig({ network: Network.DEVNET });
|
|
8880
|
-
* const aptos = new Aptos(config);
|
|
8881
|
-
*
|
|
8882
|
-
* async function runExample() {
|
|
8883
|
-
* // Fund an account with a specified amount of tokens
|
|
8884
|
-
* const transaction = await aptos.fundAccount({
|
|
8885
|
-
* accountAddress: "0x1", // replace with your account address
|
|
8886
|
-
* amount: 100,
|
|
8887
|
-
* });
|
|
8888
|
-
*
|
|
8889
|
-
* console.log("Transaction hash:", transaction.hash);
|
|
8890
|
-
* }
|
|
8891
|
-
* runExample().catch(console.error);
|
|
8892
|
-
* ```
|
|
8893
|
-
* @group Faucet
|
|
8894
|
-
*/
|
|
8895
|
-
fundAccount(args: {
|
|
8896
|
-
accountAddress: AccountAddressInput;
|
|
8897
|
-
amount: number;
|
|
8898
|
-
options?: WaitForTransactionOptions;
|
|
8899
|
-
}): Promise<UserTransactionResponse>;
|
|
6911
|
+
setSigner(signer: (digest: HexInput) => HexInput): void;
|
|
8900
6912
|
}
|
|
8901
6913
|
|
|
8902
6914
|
/**
|
|
@@ -9048,21 +7060,6 @@ declare function throwTypeMismatch(expectedType: string, position: number): void
|
|
|
9048
7060
|
* @category Transactions
|
|
9049
7061
|
*/
|
|
9050
7062
|
declare function findFirstNonSignerArg(functionAbi: MoveFunction): number;
|
|
9051
|
-
/**
|
|
9052
|
-
* Splits a function identifier into its constituent parts: module address, module name, and function name.
|
|
9053
|
-
* This function helps in validating and extracting details from a function identifier string.
|
|
9054
|
-
*
|
|
9055
|
-
* @param functionArg - The function identifier string in the format "moduleAddress::moduleName::functionName".
|
|
9056
|
-
* @returns An object containing the module address, module name, and function name.
|
|
9057
|
-
* @throws Error if the function identifier does not contain exactly three parts.
|
|
9058
|
-
* @group Implementation
|
|
9059
|
-
* @category Transactions
|
|
9060
|
-
*/
|
|
9061
|
-
declare function getFunctionParts(functionArg: MoveFunctionId): {
|
|
9062
|
-
moduleAddress: string;
|
|
9063
|
-
moduleName: string;
|
|
9064
|
-
functionName: string;
|
|
9065
|
-
};
|
|
9066
7063
|
|
|
9067
7064
|
/**
|
|
9068
7065
|
* Builds a transaction payload based on the provided arguments and returns a transaction payload.
|
|
@@ -9302,178 +7299,2419 @@ declare function fetchEntryFunctionAbi(moduleAddress: string, moduleName: string
|
|
|
9302
7299
|
* @group Implementation
|
|
9303
7300
|
* @category Transactions
|
|
9304
7301
|
*/
|
|
9305
|
-
declare function fetchViewFunctionAbi(moduleAddress: string, moduleName: string, functionName: string, aptosConfig: AptosConfig): Promise<ViewFunctionABI>;
|
|
7302
|
+
declare function fetchViewFunctionAbi(moduleAddress: string, moduleName: string, functionName: string, aptosConfig: AptosConfig): Promise<ViewFunctionABI>;
|
|
7303
|
+
/**
|
|
7304
|
+
* Converts a entry function argument into CallArgument, if necessary.
|
|
7305
|
+
* This function checks the provided argument against the expected parameter type and converts it accordingly.
|
|
7306
|
+
*
|
|
7307
|
+
* @param functionName - The name of the function for which the argument is being converted.
|
|
7308
|
+
* @param functionAbi - The ABI (Application Binary Interface) of the function, which defines its parameters.
|
|
7309
|
+
* @param argument - The argument to be converted, which can be of various types. If the argument is already
|
|
7310
|
+
* CallArgument returned from TransactionComposer it would be returned immediately.
|
|
7311
|
+
* @param position - The index of the argument in the function's parameter list.
|
|
7312
|
+
* @param genericTypeParams - An array of type tags for any generic type parameters.
|
|
7313
|
+
*/
|
|
7314
|
+
declare function convertCallArgument(argument: CallArgument | EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes, functionName: string, functionAbi: FunctionABI, position: number, genericTypeParams: Array<TypeTag>): CallArgument;
|
|
7315
|
+
/**
|
|
7316
|
+
* Converts a non-BCS encoded argument into BCS encoded, if necessary.
|
|
7317
|
+
* This function checks the provided argument against the expected parameter type and converts it accordingly.
|
|
7318
|
+
*
|
|
7319
|
+
* @param functionName - The name of the function for which the argument is being converted.
|
|
7320
|
+
* @param functionAbi - The ABI (Application Binary Interface) of the function, which defines its parameters.
|
|
7321
|
+
* @param arg - The argument to be converted, which can be of various types.
|
|
7322
|
+
* @param position - The index of the argument in the function's parameter list.
|
|
7323
|
+
* @param genericTypeParams - An array of type tags for any generic type parameters.
|
|
7324
|
+
* @group Implementation
|
|
7325
|
+
* @category Transactions
|
|
7326
|
+
*/
|
|
7327
|
+
declare function convertArgument(functionName: string, functionAbi: FunctionABI, arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes, position: number, genericTypeParams: Array<TypeTag>): EntryFunctionArgumentTypes;
|
|
7328
|
+
/**
|
|
7329
|
+
* Checks if the provided argument is BCS encoded and converts it if necessary, ensuring type compatibility with the ABI.
|
|
7330
|
+
* This function helps in validating and converting arguments for entry functions based on their expected types.
|
|
7331
|
+
*
|
|
7332
|
+
* @param arg - The argument to check or convert, which can be either a simple or entry function argument type.
|
|
7333
|
+
* @param param - The expected type tag for the argument.
|
|
7334
|
+
* @param position - The position of the argument in the function call.
|
|
7335
|
+
* @param genericTypeParams - An array of generic type parameters that may be used for conversion.
|
|
7336
|
+
* @group Implementation
|
|
7337
|
+
* @category Transactions
|
|
7338
|
+
*/
|
|
7339
|
+
declare function checkOrConvertArgument(arg: SimpleEntryFunctionArgumentTypes | EntryFunctionArgumentTypes, param: TypeTag, position: number, genericTypeParams: Array<TypeTag>): EntryFunctionArgumentTypes;
|
|
7340
|
+
|
|
7341
|
+
/**
|
|
7342
|
+
* Derives the appropriate raw transaction type based on the provided transaction details.
|
|
7343
|
+
* This function helps in identifying whether the transaction is a FeePayerRawTransaction,
|
|
7344
|
+
* MultiAgentRawTransaction, or a standard RawTransaction.
|
|
7345
|
+
*
|
|
7346
|
+
* @param transaction - An object representing an Aptos transaction, which may include:
|
|
7347
|
+
* - feePayerAddress - The address of the fee payer (optional).
|
|
7348
|
+
* - secondarySignerAddresses - An array of secondary signer addresses (optional).
|
|
7349
|
+
* - rawTransaction - The raw transaction data.
|
|
7350
|
+
*
|
|
7351
|
+
* @returns FeePayerRawTransaction | MultiAgentRawTransaction | RawTransaction
|
|
7352
|
+
* @group Implementation
|
|
7353
|
+
* @category Transactions
|
|
7354
|
+
*/
|
|
7355
|
+
declare function deriveTransactionType(transaction: AnyRawTransaction): AnyRawTransactionInstance;
|
|
7356
|
+
/**
|
|
7357
|
+
* Generates the 'signing message' form of a message to be signed.
|
|
7358
|
+
* This function combines a domain separator with the byte representation of the message to create a signing message.
|
|
7359
|
+
*
|
|
7360
|
+
* @param bytes - The byte representation of the message to be signed and sent to the chain.
|
|
7361
|
+
* @param domainSeparator - A domain separator that starts with 'APTOS::'.
|
|
7362
|
+
*
|
|
7363
|
+
* @returns The Uint8Array of the signing message.
|
|
7364
|
+
* @group Implementation
|
|
7365
|
+
* @category Transactions
|
|
7366
|
+
*/
|
|
7367
|
+
declare function generateSigningMessage(bytes: Uint8Array, domainSeparator: string): Uint8Array;
|
|
7368
|
+
/**
|
|
7369
|
+
* @deprecated
|
|
7370
|
+
* Use CryptoHashable instead by having your class implement it and call hash() to get the signing message.
|
|
7371
|
+
*
|
|
7372
|
+
* Generates the 'signing message' form of a serializable value by serializing it and using the constructor name as the domain
|
|
7373
|
+
* separator.
|
|
7374
|
+
*
|
|
7375
|
+
* @param serializable - An object that has a BCS serialized form.
|
|
7376
|
+
*
|
|
7377
|
+
* @returns The Uint8Array of the signing message.
|
|
7378
|
+
* @group Implementation
|
|
7379
|
+
* @category Transactions
|
|
7380
|
+
*/
|
|
7381
|
+
declare function generateSigningMessageForSerializable(serializable: Serializable): Uint8Array;
|
|
7382
|
+
/**
|
|
7383
|
+
* Generates the 'signing message' form of a transaction by deriving the type of transaction and applying the appropriate domain
|
|
7384
|
+
* separator based on the presence of a fee payer or secondary signers.
|
|
7385
|
+
*
|
|
7386
|
+
* @param transaction - A transaction that is to be signed, which can include a fee payer address or secondary signer addresses.
|
|
7387
|
+
*
|
|
7388
|
+
* @returns The Uint8Array of the signing message.
|
|
7389
|
+
* @group Implementation
|
|
7390
|
+
* @category Transactions
|
|
7391
|
+
*/
|
|
7392
|
+
declare function generateSigningMessageForTransaction(transaction: AnyRawTransaction): Uint8Array;
|
|
7393
|
+
|
|
7394
|
+
/**
|
|
7395
|
+
* Error types related to parsing type tags, indicating various issues encountered during the parsing process.
|
|
7396
|
+
* @group Implementation
|
|
7397
|
+
* @category Transactions
|
|
7398
|
+
*/
|
|
7399
|
+
declare enum TypeTagParserErrorType {
|
|
7400
|
+
InvalidTypeTag = "unknown type",
|
|
7401
|
+
UnexpectedGenericType = "unexpected generic type",
|
|
7402
|
+
UnexpectedTypeArgumentClose = "unexpected '>'",
|
|
7403
|
+
UnexpectedWhitespaceCharacter = "unexpected whitespace character",
|
|
7404
|
+
UnexpectedComma = "unexpected ','",
|
|
7405
|
+
TypeArgumentCountMismatch = "type argument count doesn't match expected amount",
|
|
7406
|
+
MissingTypeArgumentClose = "no matching '>' for '<'",
|
|
7407
|
+
MissingTypeArgument = "no type argument before ','",
|
|
7408
|
+
UnexpectedPrimitiveTypeArguments = "primitive types not expected to have type arguments",
|
|
7409
|
+
UnexpectedVectorTypeArgumentCount = "vector type expected to have exactly one type argument",
|
|
7410
|
+
UnexpectedStructFormat = "unexpected struct format, must be of the form 0xaddress::module_name::struct_name",
|
|
7411
|
+
InvalidModuleNameCharacter = "module name must only contain alphanumeric or '_' characters",
|
|
7412
|
+
InvalidStructNameCharacter = "struct name must only contain alphanumeric or '_' characters",
|
|
7413
|
+
InvalidAddress = "struct address must be valid"
|
|
7414
|
+
}
|
|
7415
|
+
/**
|
|
7416
|
+
* Represents an error that occurs during the parsing of a type tag.
|
|
7417
|
+
* This error extends the built-in Error class and provides additional context
|
|
7418
|
+
* regarding the specific type tag that failed to parse and the reason for the failure.
|
|
7419
|
+
*
|
|
7420
|
+
* @param typeTagStr - The type tag string that failed to be parsed.
|
|
7421
|
+
* @param invalidReason - The reason why the type tag string is considered invalid.
|
|
7422
|
+
* @group Implementation
|
|
7423
|
+
* @category Transactions
|
|
7424
|
+
*/
|
|
7425
|
+
declare class TypeTagParserError extends Error {
|
|
7426
|
+
/**
|
|
7427
|
+
* Constructs an error indicating a failure to parse a type tag.
|
|
7428
|
+
* This error provides details about the specific type tag that could not be parsed and the reason for the failure.
|
|
7429
|
+
*
|
|
7430
|
+
* @param typeTagStr - The string representation of the type tag that failed to parse.
|
|
7431
|
+
* @param invalidReason - The reason why the type tag is considered invalid.
|
|
7432
|
+
* @group Implementation
|
|
7433
|
+
* @category Transactions
|
|
7434
|
+
*/
|
|
7435
|
+
constructor(typeTagStr: string, invalidReason: TypeTagParserErrorType);
|
|
7436
|
+
}
|
|
9306
7437
|
/**
|
|
9307
|
-
*
|
|
9308
|
-
*
|
|
7438
|
+
* Parses a type string into a structured representation of type tags, accommodating various formats including generics and
|
|
7439
|
+
* nested types.
|
|
9309
7440
|
*
|
|
9310
|
-
*
|
|
9311
|
-
*
|
|
9312
|
-
*
|
|
9313
|
-
*
|
|
9314
|
-
*
|
|
9315
|
-
*
|
|
9316
|
-
|
|
9317
|
-
declare function convertCallArgument(argument: CallArgument | EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes, functionName: string, functionAbi: FunctionABI, position: number, genericTypeParams: Array<TypeTag>): CallArgument;
|
|
9318
|
-
/**
|
|
9319
|
-
* Converts a non-BCS encoded argument into BCS encoded, if necessary.
|
|
9320
|
-
* This function checks the provided argument against the expected parameter type and converts it accordingly.
|
|
7441
|
+
* This function can help you accurately interpret type strings, which can include simple types, standalone structs, and complex
|
|
7442
|
+
* nested generics.
|
|
7443
|
+
* It supports multiple generics, spacing within generics, and nested generics of varying depths.
|
|
7444
|
+
* All types are made of a few parts they're either:
|
|
7445
|
+
* 1. A simple type e.g. u8
|
|
7446
|
+
* 2. A standalone struct e.g. 0x1::account::Account
|
|
7447
|
+
* 3. A nested struct e.g. 0x1::coin::Coin<0x1234::coin::MyCoin>
|
|
9321
7448
|
*
|
|
9322
|
-
*
|
|
9323
|
-
*
|
|
9324
|
-
*
|
|
9325
|
-
*
|
|
9326
|
-
*
|
|
7449
|
+
* There are a few more special cases that need to be handled, however.
|
|
7450
|
+
* 1. Multiple generics e.g. 0x1::pair::Pair<u8, u16>
|
|
7451
|
+
* 2. Spacing in the generics e.g. 0x1::pair::Pair< u8 , u16>
|
|
7452
|
+
* 3. Nested generics of different depths e.g. 0x1::pair::Pair<0x1::coin::Coin<0x1234::coin::MyCoin>, u8>
|
|
7453
|
+
* 4. Generics for types in ABIs are filled in with placeholders e.g. T1, T2, T3
|
|
7454
|
+
* @param typeStr - The string representation of the type to be parsed.
|
|
7455
|
+
* @param options - Optional settings for parsing behavior.
|
|
7456
|
+
* @param options.allowGenerics - A flag indicating whether to allow generics in the parsing process.
|
|
7457
|
+
* @returns The parsed type tag representation.
|
|
7458
|
+
* @throws TypeTagParserError if the type string is malformed or does not conform to expected formats.
|
|
9327
7459
|
* @group Implementation
|
|
9328
7460
|
* @category Transactions
|
|
9329
7461
|
*/
|
|
9330
|
-
declare function
|
|
7462
|
+
declare function parseTypeTag(typeStr: string, options?: {
|
|
7463
|
+
allowGenerics?: boolean;
|
|
7464
|
+
}): TypeTag;
|
|
7465
|
+
|
|
7466
|
+
/**
|
|
7467
|
+
* A wrapper class around TransactionComposer, which is a WASM library compiled
|
|
7468
|
+
* from aptos-core/aptos-move/script-composer.
|
|
7469
|
+
* This class allows the SDK caller to build a transaction that invokes multiple Move functions
|
|
7470
|
+
* and allow for arguments to be passed around.
|
|
7471
|
+
* */
|
|
7472
|
+
declare class AptosScriptComposer {
|
|
7473
|
+
private config;
|
|
7474
|
+
private builder?;
|
|
7475
|
+
private static transactionComposer?;
|
|
7476
|
+
constructor(aptosConfig: AptosConfig);
|
|
7477
|
+
init(): Promise<void>;
|
|
7478
|
+
addBatchedCalls(input: InputBatchedFunctionData): Promise<CallArgument[]>;
|
|
7479
|
+
build(): Uint8Array;
|
|
7480
|
+
}
|
|
7481
|
+
|
|
7482
|
+
declare class AccountAbstraction {
|
|
7483
|
+
readonly config: AptosConfig;
|
|
7484
|
+
constructor(config: AptosConfig);
|
|
7485
|
+
/**
|
|
7486
|
+
* Adds a dispatchable authentication function to the account.
|
|
7487
|
+
*
|
|
7488
|
+
* @example
|
|
7489
|
+
* ```ts
|
|
7490
|
+
* const txn = await aptos.abstraction.addAuthenticationFunctionTransaction({
|
|
7491
|
+
* accountAddress: alice.accountAddress,
|
|
7492
|
+
* authenticationFunction: `${alice.accountAddress}::any_authenticator::authenticate`,
|
|
7493
|
+
* });
|
|
7494
|
+
*
|
|
7495
|
+
* const txn = await aptos.signAndSubmitTransaction({ signer: alice, transaction});
|
|
7496
|
+
* await aptos.waitForTransaction({ transactionHash: txn.hash });
|
|
7497
|
+
* ```
|
|
7498
|
+
*
|
|
7499
|
+
* @param args.accountAddress - The account to add the authentication function to.
|
|
7500
|
+
* @param args.authenticationFunction - The authentication function info to add.
|
|
7501
|
+
* @param args.options - The options for the transaction.
|
|
7502
|
+
* @returns A transaction to add the authentication function to the account.
|
|
7503
|
+
*/
|
|
7504
|
+
addAuthenticationFunctionTransaction(args: {
|
|
7505
|
+
accountAddress: AccountAddressInput;
|
|
7506
|
+
authenticationFunction: string;
|
|
7507
|
+
options?: InputGenerateTransactionOptions;
|
|
7508
|
+
}): Promise<SimpleTransaction>;
|
|
7509
|
+
/**
|
|
7510
|
+
* Removes a dispatchable authentication function from the account.
|
|
7511
|
+
*
|
|
7512
|
+
* @example
|
|
7513
|
+
* ```ts
|
|
7514
|
+
* const txn = await aptos.abstraction.removeAuthenticationFunctionTransaction({
|
|
7515
|
+
* accountAddress: alice.accountAddress,
|
|
7516
|
+
* authenticationFunction: `${alice.accountAddress}::any_authenticator::authenticate`,
|
|
7517
|
+
* });
|
|
7518
|
+
*
|
|
7519
|
+
* const txn = await aptos.signAndSubmitTransaction({ signer: alice, transaction: txn });
|
|
7520
|
+
* await aptos.waitForTransaction({ transactionHash: txn.hash });
|
|
7521
|
+
* ```
|
|
7522
|
+
*
|
|
7523
|
+
* @param args.accountAddress - The account to remove the authentication function from.
|
|
7524
|
+
* @param args.authenticationFunction - The authentication function info to remove.
|
|
7525
|
+
* @param args.options - The options for the transaction.
|
|
7526
|
+
* @returns A transaction to remove the authentication function from the account.
|
|
7527
|
+
*/
|
|
7528
|
+
removeAuthenticationFunctionTransaction(args: {
|
|
7529
|
+
accountAddress: AccountAddressInput;
|
|
7530
|
+
authenticationFunction: string;
|
|
7531
|
+
options?: InputGenerateTransactionOptions;
|
|
7532
|
+
}): Promise<SimpleTransaction>;
|
|
7533
|
+
/**
|
|
7534
|
+
* Removes a dispatchable authenticator from the account.
|
|
7535
|
+
*
|
|
7536
|
+
* @example
|
|
7537
|
+
* ```ts
|
|
7538
|
+
* const txn = await aptos.abstraction.removeDispatchableAuthenticatorTransaction({
|
|
7539
|
+
* accountAddress: alice.accountAddress,
|
|
7540
|
+
* });
|
|
7541
|
+
*
|
|
7542
|
+
* const txn = await aptos.signAndSubmitTransaction({ signer: alice, transaction: txn });
|
|
7543
|
+
* await aptos.waitForTransaction({ transactionHash: txn.hash });
|
|
7544
|
+
* ```
|
|
7545
|
+
*
|
|
7546
|
+
* @param args.accountAddress - The account to remove the authenticator from.
|
|
7547
|
+
* @param args.options - The options for the transaction.
|
|
7548
|
+
* @returns A transaction to remove the authenticator from the account.
|
|
7549
|
+
*/
|
|
7550
|
+
removeDispatchableAuthenticatorTransaction(args: {
|
|
7551
|
+
accountAddress: AccountAddressInput;
|
|
7552
|
+
options?: InputGenerateTransactionOptions;
|
|
7553
|
+
}): Promise<SimpleTransaction>;
|
|
7554
|
+
/**
|
|
7555
|
+
* Gets the dispatchable authentication function for the account.
|
|
7556
|
+
*
|
|
7557
|
+
* @example
|
|
7558
|
+
* ```ts
|
|
7559
|
+
* const functionInfos = await aptos.abstraction.getAuthenticationFunction({
|
|
7560
|
+
* accountAddress: alice.accountAddress,
|
|
7561
|
+
* });
|
|
7562
|
+
*
|
|
7563
|
+
* if (functionInfos) {
|
|
7564
|
+
* console.log(`Account ${alice.accountAddress.toString()} is using account abstraction!`);
|
|
7565
|
+
* } else {
|
|
7566
|
+
* console.log(`Account ${alice.accountAddress.toString()} is not using account abstraction.`);
|
|
7567
|
+
* }
|
|
7568
|
+
* ```
|
|
7569
|
+
*
|
|
7570
|
+
* @param args.accountAddress - The account to get the dispatchable authentication function for.
|
|
7571
|
+
* @returns The dispatchable authentication function for the account.
|
|
7572
|
+
*/
|
|
7573
|
+
getAuthenticationFunction(args: {
|
|
7574
|
+
accountAddress: AccountAddressInput;
|
|
7575
|
+
}): Promise<{
|
|
7576
|
+
moduleAddress: AccountAddress;
|
|
7577
|
+
moduleName: string;
|
|
7578
|
+
functionName: string;
|
|
7579
|
+
}[] | undefined>;
|
|
7580
|
+
/**
|
|
7581
|
+
* Will return true if the account is abstracted, otherwise false.
|
|
7582
|
+
*
|
|
7583
|
+
* @example
|
|
7584
|
+
* ```ts
|
|
7585
|
+
* const isAccountAbstractionEnabled = await aptos.abstraction.isAccountAbstractionEnabled({
|
|
7586
|
+
* accountAddress: alice.accountAddress,
|
|
7587
|
+
* authenticationFunction: `${alice.accountAddress}::any_authenticator::authenticate`,
|
|
7588
|
+
* });
|
|
7589
|
+
* if (isAccountAbstractionEnabled) {
|
|
7590
|
+
* console.log(`Account ${alice.accountAddress.toString()} is using account abstraction!`);
|
|
7591
|
+
* } else {
|
|
7592
|
+
* console.log(`Account ${alice.accountAddress.toString()} is not using account abstraction.`);
|
|
7593
|
+
* }
|
|
7594
|
+
* ```
|
|
7595
|
+
*
|
|
7596
|
+
* @param args.accountAddress - The account to check.
|
|
7597
|
+
* @returns Whether the account is abstracted.
|
|
7598
|
+
*/
|
|
7599
|
+
isAccountAbstractionEnabled: (args: {
|
|
7600
|
+
accountAddress: AccountAddressInput;
|
|
7601
|
+
authenticationFunction: string;
|
|
7602
|
+
}) => Promise<boolean>;
|
|
7603
|
+
/**
|
|
7604
|
+
* Creates a transaction to enable account abstraction with the given authentication function.
|
|
7605
|
+
*
|
|
7606
|
+
* @example
|
|
7607
|
+
* ```ts
|
|
7608
|
+
* const txn = await aptos.abstraction.enableAccountAbstractionTransaction({
|
|
7609
|
+
* accountAddress: alice.accountAddress,
|
|
7610
|
+
* authenticationFunction: `{alice.accountAddress}::any_authenticator::authenticate`,
|
|
7611
|
+
* });
|
|
7612
|
+
*
|
|
7613
|
+
* const txn = await aptos.signAndSubmitTransaction({ signer: alice, transaction: txn });
|
|
7614
|
+
* await aptos.waitForTransaction({ transactionHash: txn.hash });
|
|
7615
|
+
* ```
|
|
7616
|
+
*
|
|
7617
|
+
* @param args.accountAddress - The account to enable account abstraction for.
|
|
7618
|
+
* @param args.authenticationFunction - The authentication function info to use.
|
|
7619
|
+
* @param args.options - The options for the transaction.
|
|
7620
|
+
* @returns A transaction to enable account abstraction for the account.
|
|
7621
|
+
*/
|
|
7622
|
+
enableAccountAbstractionTransaction: (args: {
|
|
7623
|
+
accountAddress: AccountAddressInput;
|
|
7624
|
+
authenticationFunction: string;
|
|
7625
|
+
options?: InputGenerateTransactionOptions;
|
|
7626
|
+
}) => Promise<SimpleTransaction>;
|
|
7627
|
+
/**
|
|
7628
|
+
* Creates a transaction to disable account abstraction. If an authentication function is provided, it will specify to
|
|
7629
|
+
* remove the authentication function.
|
|
7630
|
+
*
|
|
7631
|
+
* @example
|
|
7632
|
+
* ```ts
|
|
7633
|
+
* const txn = await aptos.abstraction.disableAccountAbstractionTransaction({
|
|
7634
|
+
* accountAddress: alice.accountAddress,
|
|
7635
|
+
* authenticationFunction: `${alice.accountAddress}::any_authenticator::authenticate`,
|
|
7636
|
+
* });
|
|
7637
|
+
*
|
|
7638
|
+
* const txn = await aptos.signAndSubmitTransaction({ signer: alice, transaction: txn });
|
|
7639
|
+
* await aptos.waitForTransaction({ transactionHash: txn.hash });
|
|
7640
|
+
* ```
|
|
7641
|
+
*
|
|
7642
|
+
* @param args.accountAddress - The account to disable account abstraction for.
|
|
7643
|
+
* @param args.authenticationFunction - The authentication function info to remove.
|
|
7644
|
+
* @param args.options - The options for the transaction.
|
|
7645
|
+
* @returns A transaction to disable account abstraction for the account.
|
|
7646
|
+
*/
|
|
7647
|
+
disableAccountAbstractionTransaction: (args: {
|
|
7648
|
+
accountAddress: AccountAddressInput;
|
|
7649
|
+
authenticationFunction?: string;
|
|
7650
|
+
options?: InputGenerateTransactionOptions;
|
|
7651
|
+
}) => Promise<SimpleTransaction>;
|
|
7652
|
+
}
|
|
7653
|
+
|
|
7654
|
+
/**
|
|
7655
|
+
* A class to query all `Account` related queries on Aptos.
|
|
7656
|
+
* @group Account
|
|
7657
|
+
*/
|
|
7658
|
+
declare class Account {
|
|
7659
|
+
readonly config: AptosConfig;
|
|
7660
|
+
abstraction: AccountAbstraction;
|
|
7661
|
+
/**
|
|
7662
|
+
* Creates an instance of the Aptos client with the provided configuration.
|
|
7663
|
+
*
|
|
7664
|
+
* @param config - The configuration settings for the Aptos client.
|
|
7665
|
+
*
|
|
7666
|
+
* @example
|
|
7667
|
+
* ```typescript
|
|
7668
|
+
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
7669
|
+
*
|
|
7670
|
+
* async function runExample() {
|
|
7671
|
+
* // Initialize the Aptos client with testnet configuration
|
|
7672
|
+
* const config = new AptosConfig({ network: Network.TESTNET }); // specify your own network if needed
|
|
7673
|
+
* const aptos = new Aptos(config);
|
|
7674
|
+
*
|
|
7675
|
+
* console.log("Aptos client initialized:", aptos);
|
|
7676
|
+
* }
|
|
7677
|
+
* runExample().catch(console.error);
|
|
7678
|
+
* ```
|
|
7679
|
+
* @group Account
|
|
7680
|
+
*/
|
|
7681
|
+
constructor(config: AptosConfig);
|
|
7682
|
+
/**
|
|
7683
|
+
* Queries the current state for an Aptos account given its account address.
|
|
7684
|
+
*
|
|
7685
|
+
* @param args - The arguments for retrieving account information.
|
|
7686
|
+
* @param args.accountAddress - The Aptos account address to query.
|
|
7687
|
+
* @returns The account data.
|
|
7688
|
+
*
|
|
7689
|
+
* @example
|
|
7690
|
+
* ```typescript
|
|
7691
|
+
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
7692
|
+
*
|
|
7693
|
+
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
7694
|
+
* const aptos = new Aptos(config);
|
|
7695
|
+
*
|
|
7696
|
+
* async function runExample() {
|
|
7697
|
+
* // Retrieve account information for a specific address
|
|
7698
|
+
* const accountInfo = await aptos.getAccountInfo({ accountAddress: "0x1" }); // replace with a real account address
|
|
7699
|
+
* console.log(accountInfo);
|
|
7700
|
+
* }
|
|
7701
|
+
* runExample().catch(console.error);
|
|
7702
|
+
* ```
|
|
7703
|
+
* @group Account
|
|
7704
|
+
*/
|
|
7705
|
+
getAccountInfo(args: {
|
|
7706
|
+
accountAddress: AccountAddressInput;
|
|
7707
|
+
}): Promise<AccountData>;
|
|
7708
|
+
/**
|
|
7709
|
+
* Queries for all modules in an account given an account address.
|
|
7710
|
+
* This function may call the API multiple times to auto paginate through results.
|
|
7711
|
+
*
|
|
7712
|
+
* @param args.accountAddress - The Aptos account address to query modules for.
|
|
7713
|
+
* @param args.options.offset - The cursor to start returning results from. Note, this is obfuscated and is not an index.
|
|
7714
|
+
* @param args.options.limit - The maximum number of results to return.
|
|
7715
|
+
* @param args.options.ledgerVersion - The ledger version to query; if not provided, it retrieves the latest version.
|
|
7716
|
+
*
|
|
7717
|
+
* @returns - The account modules associated with the specified address.
|
|
7718
|
+
*
|
|
7719
|
+
* @example
|
|
7720
|
+
* ```typescript
|
|
7721
|
+
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
7722
|
+
*
|
|
7723
|
+
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
7724
|
+
* const aptos = new Aptos(config);
|
|
7725
|
+
*
|
|
7726
|
+
* async function runExample() {
|
|
7727
|
+
* // Fetching account modules for a specific account
|
|
7728
|
+
* const accountModules = await aptos.getAccountModules({
|
|
7729
|
+
* accountAddress: "0x1", // replace with a real account address
|
|
7730
|
+
* options: {
|
|
7731
|
+
* offset: 0, // starting from the first module
|
|
7732
|
+
* limit: 10, // limiting to 10 modules
|
|
7733
|
+
* },
|
|
7734
|
+
* });
|
|
7735
|
+
*
|
|
7736
|
+
* console.log(accountModules);
|
|
7737
|
+
* }
|
|
7738
|
+
* runExample().catch(console.error);
|
|
7739
|
+
* ```
|
|
7740
|
+
* @group Account
|
|
7741
|
+
*/
|
|
7742
|
+
getAccountModules(args: {
|
|
7743
|
+
accountAddress: AccountAddressInput;
|
|
7744
|
+
options?: PaginationArgs & LedgerVersionArg;
|
|
7745
|
+
}): Promise<MoveModuleBytecode[]>;
|
|
7746
|
+
/**
|
|
7747
|
+
* Queries for a specific account module given an account address and module name.
|
|
7748
|
+
*
|
|
7749
|
+
* @param args.accountAddress - The Aptos account address.
|
|
7750
|
+
* @param args.moduleName - The name of the module.
|
|
7751
|
+
* @param args.options.ledgerVersion - The ledger version to query; if not provided, it will get the latest version.
|
|
7752
|
+
*
|
|
7753
|
+
* @returns The account module associated with the specified account address and module name.
|
|
7754
|
+
*
|
|
7755
|
+
* @example
|
|
7756
|
+
* ```typescript
|
|
7757
|
+
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
7758
|
+
*
|
|
7759
|
+
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
7760
|
+
* const aptos = new Aptos(config);
|
|
7761
|
+
*
|
|
7762
|
+
* async function runExample() {
|
|
7763
|
+
* // Get the account module for a specific account address and module name
|
|
7764
|
+
* const module = await aptos.getAccountModule({
|
|
7765
|
+
* accountAddress: "0x1", // replace with a real account address
|
|
7766
|
+
* moduleName: "MyModule" // specify the module name
|
|
7767
|
+
* });
|
|
7768
|
+
*
|
|
7769
|
+
* console.log(module);
|
|
7770
|
+
* }
|
|
7771
|
+
* runExample().catch(console.error);
|
|
7772
|
+
* ```
|
|
7773
|
+
* @group Account
|
|
7774
|
+
*/
|
|
7775
|
+
getAccountModule(args: {
|
|
7776
|
+
accountAddress: AccountAddressInput;
|
|
7777
|
+
moduleName: string;
|
|
7778
|
+
options?: LedgerVersionArg;
|
|
7779
|
+
}): Promise<MoveModuleBytecode>;
|
|
7780
|
+
/**
|
|
7781
|
+
* Queries account transactions given an account address.
|
|
7782
|
+
* This function may call the API multiple times to auto paginate and retrieve all account transactions.
|
|
7783
|
+
*
|
|
7784
|
+
* @param args.accountAddress - The Aptos account address to query transactions for.
|
|
7785
|
+
* @param args.options - Optional pagination arguments.
|
|
7786
|
+
* @param args.options.offset - The number of transactions to start returning results from.
|
|
7787
|
+
* @param args.options.limit - The maximum number of results to return.
|
|
7788
|
+
*
|
|
7789
|
+
* @returns The account transactions.
|
|
7790
|
+
*
|
|
7791
|
+
* @example
|
|
7792
|
+
* ```typescript
|
|
7793
|
+
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
7794
|
+
*
|
|
7795
|
+
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
7796
|
+
* const aptos = new Aptos(config);
|
|
7797
|
+
*
|
|
7798
|
+
* async function runExample() {
|
|
7799
|
+
* // Fetch transactions for a specific account
|
|
7800
|
+
* const transactions = await aptos.getAccountTransactions({
|
|
7801
|
+
* accountAddress: "0x1", // replace with a real account address
|
|
7802
|
+
* options: {
|
|
7803
|
+
* offset: 0, // starting from the first transaction
|
|
7804
|
+
* limit: 10, // limiting to 10 transactions
|
|
7805
|
+
* },
|
|
7806
|
+
* });
|
|
7807
|
+
*
|
|
7808
|
+
* console.log(transactions);
|
|
7809
|
+
* }
|
|
7810
|
+
* runExample().catch(console.error);
|
|
7811
|
+
* ```
|
|
7812
|
+
* @group Account
|
|
7813
|
+
*/
|
|
7814
|
+
getAccountTransactions(args: {
|
|
7815
|
+
accountAddress: AccountAddressInput;
|
|
7816
|
+
options?: PaginationArgs;
|
|
7817
|
+
}): Promise<TransactionResponse[]>;
|
|
7818
|
+
/**
|
|
7819
|
+
* Queries all account resources given an account address.
|
|
7820
|
+
* This function may call the API multiple times to auto paginate through results.
|
|
7821
|
+
*
|
|
7822
|
+
* @param args.accountAddress - The Aptos account address to query resources for.
|
|
7823
|
+
* @param args.options.offset - The cursor to start returning results from. Note, this is obfuscated and is not an index.
|
|
7824
|
+
* @param args.options.limit - The maximum number of results to return.
|
|
7825
|
+
* @param args.options.ledgerVersion - The ledger version to query; if not provided, it will get the latest version.
|
|
7826
|
+
* @returns Account resources.
|
|
7827
|
+
*
|
|
7828
|
+
* @example
|
|
7829
|
+
* ```typescript
|
|
7830
|
+
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
7831
|
+
*
|
|
7832
|
+
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
7833
|
+
* const aptos = new Aptos(config);
|
|
7834
|
+
*
|
|
7835
|
+
* async function runExample() {
|
|
7836
|
+
* // Fetching account resources for a specific account address
|
|
7837
|
+
* const resources = await aptos.getAccountResources({ accountAddress: "0x1" }); // replace with a real account address
|
|
7838
|
+
* console.log(resources);
|
|
7839
|
+
* }
|
|
7840
|
+
* runExample().catch(console.error);
|
|
7841
|
+
* ```
|
|
7842
|
+
* @group Account
|
|
7843
|
+
*/
|
|
7844
|
+
getAccountResources(args: {
|
|
7845
|
+
accountAddress: AccountAddressInput;
|
|
7846
|
+
options?: PaginationArgs & LedgerVersionArg;
|
|
7847
|
+
}): Promise<MoveResource[]>;
|
|
7848
|
+
/**
|
|
7849
|
+
* Queries a specific account resource given an account address and resource type.
|
|
7850
|
+
*
|
|
7851
|
+
* @template T - The typed output of the resource.
|
|
7852
|
+
* @param args.accountAddress - The Aptos account address to query.
|
|
7853
|
+
* @param args.resourceType - The string representation of an on-chain Move struct type, e.g., "0x1::aptos_coin::AptosCoin".
|
|
7854
|
+
* @param args.options.ledgerVersion - The ledger version to query; if not provided, it will get the latest version.
|
|
7855
|
+
* @returns The account resource of the specified type.
|
|
7856
|
+
*
|
|
7857
|
+
* @example
|
|
7858
|
+
* ```typescript
|
|
7859
|
+
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
7860
|
+
*
|
|
7861
|
+
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
7862
|
+
* const aptos = new Aptos(config);
|
|
7863
|
+
*
|
|
7864
|
+
* async function runExample() {
|
|
7865
|
+
* // Get the account resource for a specific account address and resource type
|
|
7866
|
+
* const resource = await aptos.getAccountResource({
|
|
7867
|
+
* accountAddress: "0x1", // replace with a real account address
|
|
7868
|
+
* resourceType: "0x1::aptos_coin::AptosCoin"
|
|
7869
|
+
* });
|
|
7870
|
+
*
|
|
7871
|
+
* console.log(resource);
|
|
7872
|
+
* }
|
|
7873
|
+
* runExample().catch(console.error);
|
|
7874
|
+
* ```
|
|
7875
|
+
* @group Account
|
|
7876
|
+
*/
|
|
7877
|
+
getAccountResource<T extends {} = any>(args: {
|
|
7878
|
+
accountAddress: AccountAddressInput;
|
|
7879
|
+
resourceType: MoveStructId;
|
|
7880
|
+
options?: LedgerVersionArg;
|
|
7881
|
+
}): Promise<T>;
|
|
7882
|
+
/**
|
|
7883
|
+
* Looks up the account address for a given authentication key, handling both rotated and non-rotated keys.
|
|
7884
|
+
*
|
|
7885
|
+
* @param args.authenticationKey - The authentication key for which to look up the account address.
|
|
7886
|
+
* @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.
|
|
7887
|
+
* @param args.options.ledgerVersion - The ledger version to query; if not provided, it will get the latest version.
|
|
7888
|
+
* @returns Promise<AccountAddress> - The account address associated with the authentication key.
|
|
7889
|
+
*
|
|
7890
|
+
* @example
|
|
7891
|
+
* ```typescript
|
|
7892
|
+
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
7893
|
+
*
|
|
7894
|
+
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
7895
|
+
* const aptos = new Aptos(config);
|
|
7896
|
+
*
|
|
7897
|
+
* async function runExample() {
|
|
7898
|
+
* // Look up the original account address for a given authentication key
|
|
7899
|
+
* const accountAddress = await aptos.lookupOriginalAccountAddress({
|
|
7900
|
+
* authenticationKey: "0x1", // replace with a real authentication key
|
|
7901
|
+
* });
|
|
7902
|
+
*
|
|
7903
|
+
* console.log("Original Account Address:", accountAddress);
|
|
7904
|
+
* }
|
|
7905
|
+
* runExample().catch(console.error);
|
|
7906
|
+
* ```
|
|
7907
|
+
* @group Account
|
|
7908
|
+
*/
|
|
7909
|
+
lookupOriginalAccountAddress(args: {
|
|
7910
|
+
authenticationKey: AccountAddressInput;
|
|
7911
|
+
minimumLedgerVersion?: AnyNumber;
|
|
7912
|
+
options?: LedgerVersionArg;
|
|
7913
|
+
}): Promise<AccountAddress>;
|
|
7914
|
+
/**
|
|
7915
|
+
* Queries the current count of tokens owned by a specified account.
|
|
7916
|
+
*
|
|
7917
|
+
* @param args - The parameters for the query.
|
|
7918
|
+
* @param args.accountAddress - The account address to query the token count for.
|
|
7919
|
+
* @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.
|
|
7920
|
+
* @returns The current count of tokens owned by the account.
|
|
7921
|
+
*
|
|
7922
|
+
* @example
|
|
7923
|
+
* ```typescript
|
|
7924
|
+
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
7925
|
+
*
|
|
7926
|
+
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
7927
|
+
* const aptos = new Aptos(config);
|
|
7928
|
+
*
|
|
7929
|
+
* async function runExample() {
|
|
7930
|
+
* // Get the count of tokens owned by the account
|
|
7931
|
+
* const tokensCount = await aptos.getAccountTokensCount({ accountAddress: "0x1" }); // replace with a real account address
|
|
7932
|
+
* console.log(`Tokens Count: ${tokensCount}`);
|
|
7933
|
+
* }
|
|
7934
|
+
* runExample().catch(console.error);
|
|
7935
|
+
* ```
|
|
7936
|
+
* @group Account
|
|
7937
|
+
*/
|
|
7938
|
+
getAccountTokensCount(args: {
|
|
7939
|
+
accountAddress: AccountAddressInput;
|
|
7940
|
+
minimumLedgerVersion?: AnyNumber;
|
|
7941
|
+
}): Promise<number>;
|
|
7942
|
+
/**
|
|
7943
|
+
* Queries the tokens currently owned by a specified account, including NFTs and fungible tokens.
|
|
7944
|
+
* If desired, you can filter the results by a specific token standard.
|
|
7945
|
+
*
|
|
7946
|
+
* @param args.accountAddress The account address for which to retrieve owned tokens.
|
|
7947
|
+
* @param args.minimumLedgerVersion Optional ledger version to sync up to before querying.
|
|
7948
|
+
* @param args.options.tokenStandard Optional filter for the NFT standard to query for.
|
|
7949
|
+
* @param args.options.offset Optional number to start returning results from.
|
|
7950
|
+
* @param args.options.limit Optional number of results to return.
|
|
7951
|
+
* @param args.options.orderBy Optional order to sort the tokens by.
|
|
7952
|
+
* @returns An array of tokens with their respective data.
|
|
7953
|
+
*
|
|
7954
|
+
* @example
|
|
7955
|
+
* ```typescript
|
|
7956
|
+
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
7957
|
+
*
|
|
7958
|
+
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
7959
|
+
* const aptos = new Aptos(config);
|
|
7960
|
+
*
|
|
7961
|
+
* async function runExample() {
|
|
7962
|
+
* // Get the tokens owned by a specific account
|
|
7963
|
+
* const accountOwnedTokens = await aptos.getAccountOwnedTokens({
|
|
7964
|
+
* accountAddress: "0x1", // replace with a real account address
|
|
7965
|
+
* options: {
|
|
7966
|
+
* limit: 10, // specify how many tokens to return
|
|
7967
|
+
* orderBy: "created_at", // specify the order of the results
|
|
7968
|
+
* },
|
|
7969
|
+
* });
|
|
7970
|
+
*
|
|
7971
|
+
* console.log(accountOwnedTokens);
|
|
7972
|
+
* }
|
|
7973
|
+
* runExample().catch(console.error);
|
|
7974
|
+
* ```
|
|
7975
|
+
* @group Account
|
|
7976
|
+
*/
|
|
7977
|
+
getAccountOwnedTokens(args: {
|
|
7978
|
+
accountAddress: AccountAddressInput;
|
|
7979
|
+
minimumLedgerVersion?: AnyNumber;
|
|
7980
|
+
options?: TokenStandardArg & PaginationArgs & OrderByArg<GetAccountOwnedTokensQueryResponse[0]>;
|
|
7981
|
+
}): Promise<GetAccountOwnedTokensQueryResponse>;
|
|
7982
|
+
/**
|
|
7983
|
+
* Queries all current tokens of a specific collection that an account owns by the collection address.
|
|
7984
|
+
* This query returns all tokens (v1 and v2 standards) an account owns, including NFTs, fungible, soulbound, etc.
|
|
7985
|
+
* If you want to get only the token from a specific standard, you can pass an optional tokenStandard parameter.
|
|
7986
|
+
*
|
|
7987
|
+
* @param args.accountAddress - The account address we want to get the tokens for.
|
|
7988
|
+
* @param args.collectionAddress - The address of the collection being queried.
|
|
7989
|
+
* @param args.minimumLedgerVersion - Optional ledger version to sync up to, before querying.
|
|
7990
|
+
* @param args.options.tokenStandard - The NFT standard to query for.
|
|
7991
|
+
* @param args.options.offset - The number token to start returning results from.
|
|
7992
|
+
* @param args.options.limit - The number of results to return.
|
|
7993
|
+
* @param args.options.orderBy - The order to sort the tokens by.
|
|
7994
|
+
* @returns Tokens array with the token data.
|
|
7995
|
+
*
|
|
7996
|
+
* @example
|
|
7997
|
+
* ```typescript
|
|
7998
|
+
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
7999
|
+
*
|
|
8000
|
+
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
8001
|
+
* const aptos = new Aptos(config);
|
|
8002
|
+
*
|
|
8003
|
+
* async function runExample() {
|
|
8004
|
+
* // Get tokens owned by a specific account in a specific collection
|
|
8005
|
+
* const accountOwnedTokens = await aptos.getAccountOwnedTokensFromCollectionAddress({
|
|
8006
|
+
* accountAddress: "0x1", // replace with a real account address
|
|
8007
|
+
* collectionAddress: "0x2", // replace with a real collection address
|
|
8008
|
+
* });
|
|
8009
|
+
*
|
|
8010
|
+
* console.log(accountOwnedTokens);
|
|
8011
|
+
* }
|
|
8012
|
+
* runExample().catch(console.error);
|
|
8013
|
+
* ```
|
|
8014
|
+
* @group Account
|
|
8015
|
+
*/
|
|
8016
|
+
getAccountOwnedTokensFromCollectionAddress(args: {
|
|
8017
|
+
accountAddress: AccountAddressInput;
|
|
8018
|
+
collectionAddress: AccountAddressInput;
|
|
8019
|
+
minimumLedgerVersion?: AnyNumber;
|
|
8020
|
+
options?: TokenStandardArg & PaginationArgs & OrderByArg<GetAccountOwnedTokensFromCollectionResponse[0]>;
|
|
8021
|
+
}): Promise<GetAccountOwnedTokensFromCollectionResponse>;
|
|
8022
|
+
/**
|
|
8023
|
+
* Queries for all collections that an account currently has tokens for, including NFTs, fungible tokens, and soulbound tokens.
|
|
8024
|
+
* If you want to filter by a specific token standard, you can pass an optional tokenStandard parameter.
|
|
8025
|
+
*
|
|
8026
|
+
* @param args.accountAddress - The account address we want to get the collections for.
|
|
8027
|
+
* @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.
|
|
8028
|
+
* @param args.options.tokenStandard - The NFT standard to query for.
|
|
8029
|
+
* @param args.options.offset - The number of the collection to start returning results from.
|
|
8030
|
+
* @param args.options.limit - The number of results to return.
|
|
8031
|
+
* @param args.options.orderBy - The order to sort the tokens by.
|
|
8032
|
+
* @returns Collections array with the collections data.
|
|
8033
|
+
*
|
|
8034
|
+
* @example
|
|
8035
|
+
* ```typescript
|
|
8036
|
+
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
8037
|
+
*
|
|
8038
|
+
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
8039
|
+
* const aptos = new Aptos(config);
|
|
8040
|
+
*
|
|
8041
|
+
* async function runExample() {
|
|
8042
|
+
* // Get account collections with owned tokens for a specific account
|
|
8043
|
+
* const accountCollectionsWithOwnedTokens = await aptos.getAccountCollectionsWithOwnedTokens({
|
|
8044
|
+
* accountAddress: "0x1", // replace with a real account address
|
|
8045
|
+
* options: {
|
|
8046
|
+
* tokenStandard: "NFT", // specify the token standard if needed
|
|
8047
|
+
* limit: 10, // specify the number of results to return
|
|
8048
|
+
* },
|
|
8049
|
+
* });
|
|
8050
|
+
*
|
|
8051
|
+
* console.log(accountCollectionsWithOwnedTokens);
|
|
8052
|
+
* }
|
|
8053
|
+
* runExample().catch(console.error);
|
|
8054
|
+
* ```
|
|
8055
|
+
* @group Account
|
|
8056
|
+
*/
|
|
8057
|
+
getAccountCollectionsWithOwnedTokens(args: {
|
|
8058
|
+
accountAddress: AccountAddressInput;
|
|
8059
|
+
minimumLedgerVersion?: AnyNumber;
|
|
8060
|
+
options?: TokenStandardArg & PaginationArgs & OrderByArg<GetAccountCollectionsWithOwnedTokenResponse[0]>;
|
|
8061
|
+
}): Promise<GetAccountCollectionsWithOwnedTokenResponse>;
|
|
8062
|
+
/**
|
|
8063
|
+
* Queries the current count of transactions submitted by an account.
|
|
8064
|
+
*
|
|
8065
|
+
* @param args - The parameters for the query.
|
|
8066
|
+
* @param args.accountAddress - The account address we want to get the total count for.
|
|
8067
|
+
* @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.
|
|
8068
|
+
* @returns Current count of transactions made by an account.
|
|
8069
|
+
*
|
|
8070
|
+
* @example
|
|
8071
|
+
* ```typescript
|
|
8072
|
+
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
8073
|
+
*
|
|
8074
|
+
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
8075
|
+
* const aptos = new Aptos(config);
|
|
8076
|
+
*
|
|
8077
|
+
* async function runExample() {
|
|
8078
|
+
* // Get the count of transactions for a specific account
|
|
8079
|
+
* const accountTransactionsCount = await aptos.getAccountTransactionsCount({
|
|
8080
|
+
* accountAddress: "0x1", // replace with a real account address
|
|
8081
|
+
* minimumLedgerVersion: 1, // specify your own minimum ledger version if needed
|
|
8082
|
+
* });
|
|
8083
|
+
*
|
|
8084
|
+
* console.log(accountTransactionsCount);
|
|
8085
|
+
* }
|
|
8086
|
+
* runExample().catch(console.error);
|
|
8087
|
+
* ```
|
|
8088
|
+
* @group Account
|
|
8089
|
+
*/
|
|
8090
|
+
getAccountTransactionsCount(args: {
|
|
8091
|
+
accountAddress: AccountAddressInput;
|
|
8092
|
+
minimumLedgerVersion?: AnyNumber;
|
|
8093
|
+
}): Promise<number>;
|
|
8094
|
+
/**
|
|
8095
|
+
* Retrieves the coins data for a specified account.
|
|
8096
|
+
*
|
|
8097
|
+
* @param args.accountAddress - The account address for which to retrieve the coin's data.
|
|
8098
|
+
* @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.
|
|
8099
|
+
* @param args.options.offset - Optional. The number of coins to start returning results from.
|
|
8100
|
+
* @param args.options.limit - Optional. The number of results to return.
|
|
8101
|
+
* @param args.options.orderBy - Optional. The order to sort the coins by.
|
|
8102
|
+
* @param args.options.where - Optional. Filter the results by specific criteria.
|
|
8103
|
+
* @returns An array containing the coins data for the specified account.
|
|
8104
|
+
*
|
|
8105
|
+
* @example
|
|
8106
|
+
* ```typescript
|
|
8107
|
+
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
8108
|
+
*
|
|
8109
|
+
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
8110
|
+
* const aptos = new Aptos(config);
|
|
8111
|
+
*
|
|
8112
|
+
* async function runExample() {
|
|
8113
|
+
* // Fetching coins data for a specific account
|
|
8114
|
+
* const accountCoinsData = await aptos.getAccountCoinsData({
|
|
8115
|
+
* accountAddress: "0x1", // replace with a real account address
|
|
8116
|
+
* options: {
|
|
8117
|
+
* limit: 10, // specify the number of results to return
|
|
8118
|
+
* orderBy: { asset_type: "asc" }, // specify the order of results
|
|
8119
|
+
* },
|
|
8120
|
+
* });
|
|
8121
|
+
*
|
|
8122
|
+
* console.log(accountCoinsData);
|
|
8123
|
+
* }
|
|
8124
|
+
* runExample().catch(console.error);
|
|
8125
|
+
* ```
|
|
8126
|
+
* @group Account
|
|
8127
|
+
*/
|
|
8128
|
+
getAccountCoinsData(args: {
|
|
8129
|
+
accountAddress: AccountAddressInput;
|
|
8130
|
+
minimumLedgerVersion?: AnyNumber;
|
|
8131
|
+
options?: PaginationArgs & OrderByArg<GetAccountCoinsDataResponse[0]> & WhereArg<CurrentFungibleAssetBalancesBoolExp>;
|
|
8132
|
+
}): Promise<GetAccountCoinsDataResponse>;
|
|
8133
|
+
/**
|
|
8134
|
+
* Retrieves the current count of an account's coins aggregated across all types.
|
|
8135
|
+
*
|
|
8136
|
+
* @param args The parameters for the account coins count query.
|
|
8137
|
+
* @param args.accountAddress The account address we want to get the total count for.
|
|
8138
|
+
* @param args.minimumLedgerVersion Optional ledger version to sync up to before querying.
|
|
8139
|
+
* @returns The current count of the aggregated coins for the specified account.
|
|
8140
|
+
*
|
|
8141
|
+
* @example
|
|
8142
|
+
* ```typescript
|
|
8143
|
+
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
8144
|
+
*
|
|
8145
|
+
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
8146
|
+
* const aptos = new Aptos(config);
|
|
8147
|
+
*
|
|
8148
|
+
* async function runExample() {
|
|
8149
|
+
* // Getting the account coins count for a specific account
|
|
8150
|
+
* const accountCoinsCount = await aptos.getAccountCoinsCount({ accountAddress: "0x1" }); // replace with a real account address
|
|
8151
|
+
* console.log("Account Coins Count:", accountCoinsCount);
|
|
8152
|
+
* }
|
|
8153
|
+
* runExample().catch(console.error);
|
|
8154
|
+
* ```
|
|
8155
|
+
* @group Account
|
|
8156
|
+
*/
|
|
8157
|
+
getAccountCoinsCount(args: {
|
|
8158
|
+
accountAddress: AccountAddressInput;
|
|
8159
|
+
minimumLedgerVersion?: AnyNumber;
|
|
8160
|
+
}): Promise<number>;
|
|
8161
|
+
/**
|
|
8162
|
+
* Retrieves the current amount of APT for a specified account.
|
|
8163
|
+
*
|
|
8164
|
+
* @param args The arguments for the account query.
|
|
8165
|
+
* @param args.accountAddress The account address for which to retrieve the APT amount.
|
|
8166
|
+
* @param args.minimumLedgerVersion Optional ledger version to sync up to before querying.
|
|
8167
|
+
* @returns The current amount of APT for the specified account.
|
|
8168
|
+
*
|
|
8169
|
+
* @example
|
|
8170
|
+
* ```typescript
|
|
8171
|
+
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
8172
|
+
*
|
|
8173
|
+
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
8174
|
+
* const aptos = new Aptos(config);
|
|
8175
|
+
*
|
|
8176
|
+
* async function runExample() {
|
|
8177
|
+
* // Get the APT amount for a specific account
|
|
8178
|
+
* const accountAPTAmount = await aptos.getAccountAPTAmount({ accountAddress: "0x1" }); // replace with a real account address
|
|
8179
|
+
* console.log("Account APT Amount:", accountAPTAmount);
|
|
8180
|
+
* }
|
|
8181
|
+
* runExample().catch(console.error);
|
|
8182
|
+
* ```
|
|
8183
|
+
* @group Account
|
|
8184
|
+
*/
|
|
8185
|
+
getAccountAPTAmount(args: {
|
|
8186
|
+
accountAddress: AccountAddressInput;
|
|
8187
|
+
minimumLedgerVersion?: AnyNumber;
|
|
8188
|
+
}): Promise<number>;
|
|
8189
|
+
/**
|
|
8190
|
+
* Queries the current amount of a specified coin held by an account.
|
|
8191
|
+
*
|
|
8192
|
+
* @param args The parameters for querying the account's coin amount.
|
|
8193
|
+
* @param args.accountAddress The account address to query for the coin amount.
|
|
8194
|
+
* @param args.coinType The coin type to query. Note: If not provided, it may be automatically populated if `faMetadataAddress`
|
|
8195
|
+
* is specified.
|
|
8196
|
+
* @param args.faMetadataAddress The fungible asset metadata address to query. Note: If not provided, it may be automatically
|
|
8197
|
+
* populated if `coinType` is specified.
|
|
8198
|
+
* @param args.minimumLedgerVersion Not used anymore, here for backward compatibility
|
|
8199
|
+
* see https://github.com/aptos-labs/aptos-ts-sdk/pull/519, will be removed in the near future.
|
|
8200
|
+
* Optional ledger version to sync up to before querying.
|
|
8201
|
+
* @returns The current amount of the specified coin held by the account.
|
|
8202
|
+
*
|
|
8203
|
+
* @example
|
|
8204
|
+
* ```typescript
|
|
8205
|
+
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
8206
|
+
*
|
|
8207
|
+
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
8208
|
+
* const aptos = new Aptos(config);
|
|
8209
|
+
*
|
|
8210
|
+
* async function runExample() {
|
|
8211
|
+
* // Query the account's coin amount for a specific coin type
|
|
8212
|
+
* const accountCoinAmount = await aptos.getAccountCoinAmount({
|
|
8213
|
+
* accountAddress: "0x1", // replace with a real account address
|
|
8214
|
+
* coinType: "0x1::aptos_coin::AptosCoin" // specify the coin type
|
|
8215
|
+
* });
|
|
8216
|
+
*
|
|
8217
|
+
* console.log(`Account coin amount: ${accountCoinAmount}`);
|
|
8218
|
+
* }
|
|
8219
|
+
* runExample().catch(console.error);
|
|
8220
|
+
* ```
|
|
8221
|
+
* @group Account
|
|
8222
|
+
*/
|
|
8223
|
+
getAccountCoinAmount(args: {
|
|
8224
|
+
accountAddress: AccountAddressInput;
|
|
8225
|
+
coinType?: MoveStructId;
|
|
8226
|
+
faMetadataAddress?: AccountAddressInput;
|
|
8227
|
+
minimumLedgerVersion?: AnyNumber;
|
|
8228
|
+
}): Promise<number>;
|
|
8229
|
+
/**
|
|
8230
|
+
* Queries an account's owned objects.
|
|
8231
|
+
*
|
|
8232
|
+
* @param args.accountAddress The account address we want to get the objects for.
|
|
8233
|
+
* @param args.minimumLedgerVersion Optional ledger version to sync up to before querying.
|
|
8234
|
+
* @param args.options.offset The starting position to start returning results from.
|
|
8235
|
+
* @param args.options.limit The number of results to return.
|
|
8236
|
+
* @param args.options.orderBy The order to sort the objects by.
|
|
8237
|
+
* @returns Objects array with the object data.
|
|
8238
|
+
*
|
|
8239
|
+
* @example
|
|
8240
|
+
* ```typescript
|
|
8241
|
+
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
8242
|
+
*
|
|
8243
|
+
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
8244
|
+
* const aptos = new Aptos(config);
|
|
8245
|
+
*
|
|
8246
|
+
* async function runExample() {
|
|
8247
|
+
* // Get the objects owned by the specified account
|
|
8248
|
+
* const accountOwnedObjects = await aptos.getAccountOwnedObjects({
|
|
8249
|
+
* accountAddress: "0x1", // replace with a real account address
|
|
8250
|
+
* minimumLedgerVersion: 1, // optional, specify if needed
|
|
8251
|
+
* options: {
|
|
8252
|
+
* offset: 0, // optional, specify if needed
|
|
8253
|
+
* limit: 10, // optional, specify if needed
|
|
8254
|
+
* orderBy: "created_at", // optional, specify if needed
|
|
8255
|
+
* },
|
|
8256
|
+
* });
|
|
8257
|
+
*
|
|
8258
|
+
* console.log(accountOwnedObjects);
|
|
8259
|
+
* }
|
|
8260
|
+
* runExample().catch(console.error);
|
|
8261
|
+
* ```
|
|
8262
|
+
* @group Account
|
|
8263
|
+
*/
|
|
8264
|
+
getAccountOwnedObjects(args: {
|
|
8265
|
+
accountAddress: AccountAddressInput;
|
|
8266
|
+
minimumLedgerVersion?: AnyNumber;
|
|
8267
|
+
options?: PaginationArgs & OrderByArg<GetObjectDataQueryResponse[0]>;
|
|
8268
|
+
}): Promise<GetObjectDataQueryResponse>;
|
|
8269
|
+
/**
|
|
8270
|
+
* Derives an account by providing a private key. This function resolves the provided private key type and derives the public
|
|
8271
|
+
* key from it.
|
|
8272
|
+
*
|
|
8273
|
+
* If the privateKey is a Secp256k1 type, it derives the account using the derived public key and auth key using the SingleKey
|
|
8274
|
+
* scheme locally.
|
|
8275
|
+
* If the privateKey is an ED25519 type, it looks up the authentication key on chain to determine whether it is a Legacy ED25519
|
|
8276
|
+
* key or a Unified ED25519 key, and then derives the account based on that.
|
|
8277
|
+
*
|
|
8278
|
+
* @param args - The arguments for deriving the account.
|
|
8279
|
+
* @param args.privateKey - An account private key.
|
|
8280
|
+
* @returns The derived Account type.
|
|
8281
|
+
*
|
|
8282
|
+
* @example
|
|
8283
|
+
* ```typescript
|
|
8284
|
+
* import { Aptos, AptosConfig, Network, Ed25519PrivateKey } from "@aptos-labs/ts-sdk";
|
|
8285
|
+
*
|
|
8286
|
+
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
8287
|
+
* const aptos = new Aptos(config);
|
|
8288
|
+
*
|
|
8289
|
+
* async function runExample() {
|
|
8290
|
+
* // Deriving an account from a private key
|
|
8291
|
+
* const account = await aptos.deriveAccountFromPrivateKey({
|
|
8292
|
+
* privateKey: new Ed25519PrivateKey("0x123") // replace with a real private key
|
|
8293
|
+
* });
|
|
8294
|
+
*
|
|
8295
|
+
* console.log(account);
|
|
8296
|
+
* }
|
|
8297
|
+
* runExample().catch(console.error);
|
|
8298
|
+
* ```
|
|
8299
|
+
* @group Account
|
|
8300
|
+
*/
|
|
8301
|
+
deriveAccountFromPrivateKey(args: {
|
|
8302
|
+
privateKey: PrivateKey;
|
|
8303
|
+
}): Promise<Account$1>;
|
|
8304
|
+
}
|
|
8305
|
+
|
|
9331
8306
|
/**
|
|
9332
|
-
*
|
|
9333
|
-
*
|
|
9334
|
-
*
|
|
9335
|
-
* @param arg - The argument to check or convert, which can be either a simple or entry function argument type.
|
|
9336
|
-
* @param param - The expected type tag for the argument.
|
|
9337
|
-
* @param position - The position of the argument in the function call.
|
|
9338
|
-
* @param genericTypeParams - An array of generic type parameters that may be used for conversion.
|
|
9339
|
-
* @group Implementation
|
|
9340
|
-
* @category Transactions
|
|
8307
|
+
* A class to handle all `Coin` operations.
|
|
8308
|
+
* @group Coin
|
|
9341
8309
|
*/
|
|
9342
|
-
declare
|
|
8310
|
+
declare class Coin {
|
|
8311
|
+
readonly config: AptosConfig;
|
|
8312
|
+
/**
|
|
8313
|
+
* Initializes a new instance of the Aptos client with the specified configuration.
|
|
8314
|
+
* This allows you to interact with the Aptos blockchain using the provided settings.
|
|
8315
|
+
*
|
|
8316
|
+
* @param config - The configuration settings for the Aptos client.
|
|
8317
|
+
*
|
|
8318
|
+
* @example
|
|
8319
|
+
* ```typescript
|
|
8320
|
+
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
8321
|
+
*
|
|
8322
|
+
* async function runExample() {
|
|
8323
|
+
* // Create a new Aptos client with testnet configuration
|
|
8324
|
+
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
8325
|
+
* const aptos = new Aptos(config);
|
|
8326
|
+
*
|
|
8327
|
+
* console.log("Aptos client initialized:", aptos);
|
|
8328
|
+
* }
|
|
8329
|
+
* runExample().catch(console.error);
|
|
8330
|
+
* ```
|
|
8331
|
+
* @group Coin
|
|
8332
|
+
*/
|
|
8333
|
+
constructor(config: AptosConfig);
|
|
8334
|
+
/**
|
|
8335
|
+
* Generate a transfer coin transaction that can be simulated, signed, and submitted.
|
|
8336
|
+
* This function helps you create a transaction to transfer a specified amount of coins
|
|
8337
|
+
* from one account to another within the Aptos network.
|
|
8338
|
+
*
|
|
8339
|
+
* @param args The arguments for the transfer transaction.
|
|
8340
|
+
* @param args.sender The sender account address.
|
|
8341
|
+
* @param args.recipient The recipient account address.
|
|
8342
|
+
* @param args.amount The amount of coins to transfer.
|
|
8343
|
+
* @param args.coinType Optional. The coin struct type to transfer. Defaults to 0x1::aptos_coin::AptosCoin.
|
|
8344
|
+
* @param args.options Optional. Additional options for generating the transaction.
|
|
8345
|
+
*
|
|
8346
|
+
* @returns SimpleTransaction
|
|
8347
|
+
*
|
|
8348
|
+
* @example
|
|
8349
|
+
* ```typescript
|
|
8350
|
+
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
8351
|
+
*
|
|
8352
|
+
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
8353
|
+
* const aptos = new Aptos(config);
|
|
8354
|
+
*
|
|
8355
|
+
* async function runExample() {
|
|
8356
|
+
* // Generate a transfer coin transaction
|
|
8357
|
+
* const transaction = await aptos.transferCoinTransaction({
|
|
8358
|
+
* sender: "0x1", // replace with a real sender account address
|
|
8359
|
+
* recipient: "0x2", // replace with a real recipient account address
|
|
8360
|
+
* amount: 10,
|
|
8361
|
+
* });
|
|
8362
|
+
*
|
|
8363
|
+
* console.log(transaction);
|
|
8364
|
+
* }
|
|
8365
|
+
* runExample().catch(console.error);
|
|
8366
|
+
* ```
|
|
8367
|
+
* @group Coin
|
|
8368
|
+
*/
|
|
8369
|
+
transferCoinTransaction(args: {
|
|
8370
|
+
sender: AccountAddressInput;
|
|
8371
|
+
recipient: AccountAddressInput;
|
|
8372
|
+
amount: AnyNumber;
|
|
8373
|
+
coinType?: MoveStructId;
|
|
8374
|
+
options?: InputGenerateTransactionOptions;
|
|
8375
|
+
}): Promise<SimpleTransaction>;
|
|
8376
|
+
}
|
|
9343
8377
|
|
|
9344
8378
|
/**
|
|
9345
|
-
*
|
|
9346
|
-
*
|
|
9347
|
-
*
|
|
9348
|
-
*
|
|
9349
|
-
* @param transaction - An object representing an Aptos transaction, which may include:
|
|
9350
|
-
* - feePayerAddress - The address of the fee payer (optional).
|
|
9351
|
-
* - secondarySignerAddresses - An array of secondary signer addresses (optional).
|
|
9352
|
-
* - rawTransaction - The raw transaction data.
|
|
9353
|
-
*
|
|
9354
|
-
* @returns FeePayerRawTransaction | MultiAgentRawTransaction | RawTransaction
|
|
8379
|
+
* This file contains the underlying implementations for exposed API surface in
|
|
8380
|
+
* the {@link api/digitalAsset}. By moving the methods out into a separate file,
|
|
8381
|
+
* other namespaces and processes can access these methods without depending on the entire
|
|
8382
|
+
* digitalAsset namespace and without having a dependency cycle error.
|
|
9355
8383
|
* @group Implementation
|
|
9356
|
-
* @category Transactions
|
|
9357
8384
|
*/
|
|
9358
|
-
|
|
8385
|
+
|
|
8386
|
+
declare const PropertyTypeMap: {
|
|
8387
|
+
BOOLEAN: string;
|
|
8388
|
+
U8: string;
|
|
8389
|
+
U16: string;
|
|
8390
|
+
U32: string;
|
|
8391
|
+
U64: string;
|
|
8392
|
+
U128: string;
|
|
8393
|
+
U256: string;
|
|
8394
|
+
ADDRESS: string;
|
|
8395
|
+
STRING: string;
|
|
8396
|
+
ARRAY: string;
|
|
8397
|
+
};
|
|
9359
8398
|
/**
|
|
9360
|
-
*
|
|
9361
|
-
* This function combines a domain separator with the byte representation of the message to create a signing message.
|
|
9362
|
-
*
|
|
9363
|
-
* @param bytes - The byte representation of the message to be signed and sent to the chain.
|
|
9364
|
-
* @param domainSeparator - A domain separator that starts with 'APTOS::'.
|
|
9365
|
-
*
|
|
9366
|
-
* @returns The Uint8Array of the signing message.
|
|
8399
|
+
* The keys of the PropertyTypeMap, representing different property types.
|
|
9367
8400
|
* @group Implementation
|
|
9368
|
-
* @category Transactions
|
|
9369
8401
|
*/
|
|
9370
|
-
|
|
8402
|
+
type PropertyType = keyof typeof PropertyTypeMap;
|
|
9371
8403
|
/**
|
|
9372
|
-
*
|
|
9373
|
-
*
|
|
9374
|
-
*
|
|
9375
|
-
* Generates the 'signing message' form of a serializable value by serializing it and using the constructor name as the domain
|
|
9376
|
-
* separator.
|
|
9377
|
-
*
|
|
9378
|
-
* @param serializable - An object that has a BCS serialized form.
|
|
9379
|
-
*
|
|
9380
|
-
* @returns The Uint8Array of the signing message.
|
|
8404
|
+
* Accepted property value types for user input, including boolean, number, bigint, string, AccountAddress, and Uint8Array.
|
|
8405
|
+
* To pass in an Array, use Uint8Array type
|
|
8406
|
+
* for example `new MoveVector([new MoveString("hello"), new MoveString("world")]).bcsToBytes()`
|
|
9381
8407
|
* @group Implementation
|
|
9382
|
-
* @category Transactions
|
|
9383
8408
|
*/
|
|
9384
|
-
|
|
8409
|
+
type PropertyValue = boolean | number | bigint | string | AccountAddress | Uint8Array;
|
|
9385
8410
|
/**
|
|
9386
|
-
*
|
|
9387
|
-
*
|
|
9388
|
-
*
|
|
9389
|
-
* @param transaction - A transaction that is to be signed, which can include a fee payer address or secondary signer addresses.
|
|
8411
|
+
* Options for creating a collection, allowing customization of various attributes such as supply limits, mutability of metadata,
|
|
8412
|
+
* and royalty settings.
|
|
9390
8413
|
*
|
|
9391
|
-
* @
|
|
8414
|
+
* @param maxSupply - Maximum number of tokens that can be minted in the collection.
|
|
8415
|
+
* @param mutableDescription - Indicates if the collection description can be changed after creation.
|
|
8416
|
+
* @param mutableRoyalty - Indicates if the royalty settings can be modified after creation.
|
|
8417
|
+
* @param mutableURI - Indicates if the collection URI can be updated.
|
|
8418
|
+
* @param mutableTokenDescription - Indicates if individual token descriptions can be modified.
|
|
8419
|
+
* @param mutableTokenName - Indicates if individual token names can be changed.
|
|
8420
|
+
* @param mutableTokenProperties - Indicates if individual token properties can be altered.
|
|
8421
|
+
* @param mutableTokenURI - Indicates if individual token URIs can be updated.
|
|
8422
|
+
* @param tokensBurnableByCreator - Indicates if the creator can burn tokens from the collection.
|
|
8423
|
+
* @param tokensFreezableByCreator - Indicates if the creator can freeze tokens in the collection.
|
|
8424
|
+
* @param royaltyNumerator - The numerator for calculating royalties.
|
|
8425
|
+
* @param royaltyDenominator - The denominator for calculating royalties.
|
|
9392
8426
|
* @group Implementation
|
|
9393
|
-
* @category Transactions
|
|
9394
8427
|
*/
|
|
9395
|
-
|
|
8428
|
+
interface CreateCollectionOptions {
|
|
8429
|
+
maxSupply?: AnyNumber;
|
|
8430
|
+
mutableDescription?: boolean;
|
|
8431
|
+
mutableRoyalty?: boolean;
|
|
8432
|
+
mutableURI?: boolean;
|
|
8433
|
+
mutableTokenDescription?: boolean;
|
|
8434
|
+
mutableTokenName?: boolean;
|
|
8435
|
+
mutableTokenProperties?: boolean;
|
|
8436
|
+
mutableTokenURI?: boolean;
|
|
8437
|
+
tokensBurnableByCreator?: boolean;
|
|
8438
|
+
tokensFreezableByCreator?: boolean;
|
|
8439
|
+
royaltyNumerator?: number;
|
|
8440
|
+
royaltyDenominator?: number;
|
|
8441
|
+
}
|
|
9396
8442
|
|
|
9397
8443
|
/**
|
|
9398
|
-
*
|
|
9399
|
-
* @group
|
|
9400
|
-
* @category Transactions
|
|
8444
|
+
* A class to query all `DigitalAsset` related queries on Aptos.
|
|
8445
|
+
* @group DigitalAsset
|
|
9401
8446
|
*/
|
|
9402
|
-
declare
|
|
9403
|
-
|
|
9404
|
-
|
|
9405
|
-
|
|
9406
|
-
|
|
9407
|
-
|
|
9408
|
-
|
|
9409
|
-
|
|
9410
|
-
|
|
9411
|
-
|
|
9412
|
-
|
|
9413
|
-
|
|
9414
|
-
|
|
9415
|
-
|
|
9416
|
-
|
|
8447
|
+
declare class DigitalAsset {
|
|
8448
|
+
readonly config: AptosConfig;
|
|
8449
|
+
/**
|
|
8450
|
+
* Initializes a new instance of the Aptos client with the specified configuration.
|
|
8451
|
+
* This allows you to interact with the Aptos blockchain using the provided settings.
|
|
8452
|
+
*
|
|
8453
|
+
* @param config - The configuration settings for the Aptos client.
|
|
8454
|
+
*
|
|
8455
|
+
* @example
|
|
8456
|
+
* ```typescript
|
|
8457
|
+
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
8458
|
+
*
|
|
8459
|
+
* async function runExample() {
|
|
8460
|
+
* // Create a configuration for the Aptos client
|
|
8461
|
+
* const config = new AptosConfig({ network: Network.TESTNET }); // Specify your desired network
|
|
8462
|
+
*
|
|
8463
|
+
* // Initialize the Aptos client with the configuration
|
|
8464
|
+
* const aptos = new Aptos(config);
|
|
8465
|
+
*
|
|
8466
|
+
* console.log("Aptos client initialized:", aptos);
|
|
8467
|
+
* }
|
|
8468
|
+
* runExample().catch(console.error);
|
|
8469
|
+
* ```
|
|
8470
|
+
* @group DigitalAsset
|
|
8471
|
+
*/
|
|
8472
|
+
constructor(config: AptosConfig);
|
|
8473
|
+
/**
|
|
8474
|
+
* Queries data of a specific collection by the collection creator address and the collection name.
|
|
8475
|
+
* This function is deprecated; use `getCollectionDataByCreatorAddressAndCollectionName` instead.
|
|
8476
|
+
*
|
|
8477
|
+
* If a creator account has two collections with the same name in v1 and v2, you can pass an optional `tokenStandard` parameter
|
|
8478
|
+
* to query a specific standard.
|
|
8479
|
+
*
|
|
8480
|
+
* @param args - The arguments for querying the collection data.
|
|
8481
|
+
* @param args.creatorAddress - The address of the collection's creator.
|
|
8482
|
+
* @param args.collectionName - The name of the collection.
|
|
8483
|
+
* @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.
|
|
8484
|
+
* @param args.options - Optional parameters for the query.
|
|
8485
|
+
* @param args.options.tokenStandard - The token standard to query.
|
|
8486
|
+
* @returns GetCollectionDataResponse - The response type containing the collection data.
|
|
8487
|
+
*
|
|
8488
|
+
* @example
|
|
8489
|
+
* ```typescript
|
|
8490
|
+
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
8491
|
+
*
|
|
8492
|
+
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
8493
|
+
* const aptos = new Aptos(config);
|
|
8494
|
+
*
|
|
8495
|
+
* async function runExample() {
|
|
8496
|
+
* // Querying collection data by creator address and collection name
|
|
8497
|
+
* const collection = await aptos.getCollectionData({
|
|
8498
|
+
* creatorAddress: "0x1", // replace with a real creator address
|
|
8499
|
+
* collectionName: "myCollection", // specify your collection name
|
|
8500
|
+
* });
|
|
8501
|
+
*
|
|
8502
|
+
* console.log(collection);
|
|
8503
|
+
* }
|
|
8504
|
+
* runExample().catch(console.error);
|
|
8505
|
+
* ```
|
|
8506
|
+
* @group DigitalAsset
|
|
8507
|
+
*/
|
|
8508
|
+
getCollectionData(args: {
|
|
8509
|
+
creatorAddress: AccountAddressInput;
|
|
8510
|
+
collectionName: string;
|
|
8511
|
+
minimumLedgerVersion?: AnyNumber;
|
|
8512
|
+
options?: TokenStandardArg;
|
|
8513
|
+
}): Promise<GetCollectionDataResponse>;
|
|
8514
|
+
/**
|
|
8515
|
+
* Queries data of a specific collection by the collection creator address and the collection name.
|
|
8516
|
+
* If a creator account has multiple collections with the same name across different versions,
|
|
8517
|
+
* specify the `tokenStandard` parameter to query a specific standard.
|
|
8518
|
+
*
|
|
8519
|
+
* @param args.creatorAddress - The address of the collection's creator.
|
|
8520
|
+
* @param args.collectionName - The name of the collection.
|
|
8521
|
+
* @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.
|
|
8522
|
+
* @param args.options.tokenStandard - Optional token standard to query.
|
|
8523
|
+
* @returns GetCollectionDataResponse - The response type containing collection data.
|
|
8524
|
+
*
|
|
8525
|
+
* @example
|
|
8526
|
+
* ```typescript
|
|
8527
|
+
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
8528
|
+
*
|
|
8529
|
+
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
8530
|
+
* const aptos = new Aptos(config);
|
|
8531
|
+
*
|
|
8532
|
+
* async function runExample() {
|
|
8533
|
+
* // Fetching collection data by creator address and collection name
|
|
8534
|
+
* const collection = await aptos.getCollectionDataByCreatorAddressAndCollectionName({
|
|
8535
|
+
* creatorAddress: "0x1", // replace with a real creator address
|
|
8536
|
+
* collectionName: "myCollection",
|
|
8537
|
+
* minimumLedgerVersion: 1, // optional, specify if needed
|
|
8538
|
+
* options: { tokenStandard: "v2" } // optional, specify if needed
|
|
8539
|
+
* });
|
|
8540
|
+
*
|
|
8541
|
+
* console.log(collection);
|
|
8542
|
+
* }
|
|
8543
|
+
* runExample().catch(console.error);
|
|
8544
|
+
* ```
|
|
8545
|
+
* @group DigitalAsset
|
|
8546
|
+
*/
|
|
8547
|
+
getCollectionDataByCreatorAddressAndCollectionName(args: {
|
|
8548
|
+
creatorAddress: AccountAddressInput;
|
|
8549
|
+
collectionName: string;
|
|
8550
|
+
minimumLedgerVersion?: AnyNumber;
|
|
8551
|
+
options?: TokenStandardArg & PaginationArgs;
|
|
8552
|
+
}): Promise<GetCollectionDataResponse>;
|
|
8553
|
+
/**
|
|
8554
|
+
* Retrieves data for a specific collection created by a given creator address.
|
|
8555
|
+
* This function allows you to query collection data while optionally specifying a minimum ledger version and pagination options.
|
|
8556
|
+
*
|
|
8557
|
+
* @param args.creatorAddress - The address of the collection's creator.
|
|
8558
|
+
* @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.
|
|
8559
|
+
* @param args.options.tokenStandard - Optional token standard to query.
|
|
8560
|
+
* @param args.options.pagination - Optional pagination arguments.
|
|
8561
|
+
* @returns GetCollectionDataResponse - The response type containing collection data.
|
|
8562
|
+
*
|
|
8563
|
+
* @example
|
|
8564
|
+
* ```typescript
|
|
8565
|
+
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
8566
|
+
*
|
|
8567
|
+
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
8568
|
+
* const aptos = new Aptos(config);
|
|
8569
|
+
*
|
|
8570
|
+
* async function runExample() {
|
|
8571
|
+
* // Retrieve collection data by creator address
|
|
8572
|
+
* const collectionData = await aptos.getCollectionDataByCreatorAddress({
|
|
8573
|
+
* creatorAddress: "0x1", // replace with a real creator address
|
|
8574
|
+
* minimumLedgerVersion: 1, // specify the minimum ledger version if needed
|
|
8575
|
+
* options: {
|
|
8576
|
+
* tokenStandard: "v2", // specify the token standard if needed
|
|
8577
|
+
* pagination: { limit: 10, offset: 0 } // specify pagination options if needed
|
|
8578
|
+
* }
|
|
8579
|
+
* });
|
|
8580
|
+
*
|
|
8581
|
+
* console.log(collectionData);
|
|
8582
|
+
* }
|
|
8583
|
+
* runExample().catch(console.error);
|
|
8584
|
+
* ```
|
|
8585
|
+
* @group DigitalAsset
|
|
8586
|
+
*/
|
|
8587
|
+
getCollectionDataByCreatorAddress(args: {
|
|
8588
|
+
creatorAddress: AccountAddressInput;
|
|
8589
|
+
minimumLedgerVersion?: AnyNumber;
|
|
8590
|
+
options?: TokenStandardArg & PaginationArgs;
|
|
8591
|
+
}): Promise<GetCollectionDataResponse>;
|
|
8592
|
+
/**
|
|
8593
|
+
* Queries data of a specific collection by the collection ID.
|
|
8594
|
+
*
|
|
8595
|
+
* @param args.collectionId - The ID of the collection, which is the same as the address of the collection object.
|
|
8596
|
+
* @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.
|
|
8597
|
+
* @param args.options - Optional parameters for token standard and pagination.
|
|
8598
|
+
* @returns GetCollectionDataResponse - The response type containing the collection data.
|
|
8599
|
+
*
|
|
8600
|
+
* @example
|
|
8601
|
+
* ```typescript
|
|
8602
|
+
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
8603
|
+
*
|
|
8604
|
+
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
8605
|
+
* const aptos = new Aptos(config);
|
|
8606
|
+
*
|
|
8607
|
+
* async function runExample() {
|
|
8608
|
+
* // Fetching collection data by collection ID
|
|
8609
|
+
* const collection = await aptos.getCollectionDataByCollectionId({
|
|
8610
|
+
* collectionId: "0x123", // replace with a real collection ID
|
|
8611
|
+
* });
|
|
8612
|
+
*
|
|
8613
|
+
* console.log(collection);
|
|
8614
|
+
* }
|
|
8615
|
+
* runExample().catch(console.error);
|
|
8616
|
+
* ```
|
|
8617
|
+
* @group DigitalAsset
|
|
8618
|
+
*/
|
|
8619
|
+
getCollectionDataByCollectionId(args: {
|
|
8620
|
+
collectionId: AccountAddressInput;
|
|
8621
|
+
minimumLedgerVersion?: AnyNumber;
|
|
8622
|
+
options?: TokenStandardArg & PaginationArgs;
|
|
8623
|
+
}): Promise<GetCollectionDataResponse>;
|
|
8624
|
+
/**
|
|
8625
|
+
* Queries the ID of a specified collection.
|
|
8626
|
+
* This ID corresponds to the collection's object address in V2, while V1 does not utilize objects and lacks an address.
|
|
8627
|
+
*
|
|
8628
|
+
* @param args.creatorAddress - The address of the collection's creator.
|
|
8629
|
+
* @param args.collectionName - The name of the collection.
|
|
8630
|
+
* @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.
|
|
8631
|
+
* @param args.options.tokenStandard - The token standard to query.
|
|
8632
|
+
* @returns The collection ID.
|
|
8633
|
+
*
|
|
8634
|
+
* @example
|
|
8635
|
+
* ```typescript
|
|
8636
|
+
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
8637
|
+
*
|
|
8638
|
+
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
8639
|
+
* const aptos = new Aptos(config);
|
|
8640
|
+
*
|
|
8641
|
+
* async function runExample() {
|
|
8642
|
+
* // Fetching the collection ID for a specific creator and collection name
|
|
8643
|
+
* const collectionId = await aptos.getCollectionId({
|
|
8644
|
+
* creatorAddress: "0x1", // replace with a real creator address
|
|
8645
|
+
* collectionName: "myCollection"
|
|
8646
|
+
* });
|
|
8647
|
+
*
|
|
8648
|
+
* console.log("Collection ID:", collectionId);
|
|
8649
|
+
* }
|
|
8650
|
+
* runExample().catch(console.error);
|
|
8651
|
+
* ```
|
|
8652
|
+
* @group DigitalAsset
|
|
8653
|
+
*/
|
|
8654
|
+
getCollectionId(args: {
|
|
8655
|
+
creatorAddress: AccountAddressInput;
|
|
8656
|
+
collectionName: string;
|
|
8657
|
+
minimumLedgerVersion?: AnyNumber;
|
|
8658
|
+
options?: TokenStandardArg;
|
|
8659
|
+
}): Promise<string>;
|
|
8660
|
+
/**
|
|
8661
|
+
* Retrieves digital asset data using the address of a digital asset.
|
|
8662
|
+
*
|
|
8663
|
+
* @param args - The parameters for the request.
|
|
8664
|
+
* @param args.digitalAssetAddress - The address of the digital asset.
|
|
8665
|
+
* @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.
|
|
8666
|
+
* @returns GetTokenDataResponse containing relevant data for the digital asset.
|
|
8667
|
+
*
|
|
8668
|
+
* @example
|
|
8669
|
+
* ```typescript
|
|
8670
|
+
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
8671
|
+
*
|
|
8672
|
+
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
8673
|
+
* const aptos = new Aptos(config);
|
|
8674
|
+
*
|
|
8675
|
+
* async function runExample() {
|
|
8676
|
+
* // Fetching digital asset data for a specific address
|
|
8677
|
+
* const digitalAsset = await aptos.getDigitalAssetData({
|
|
8678
|
+
* digitalAssetAddress: "0x123", // replace with a real digital asset address
|
|
8679
|
+
* });
|
|
8680
|
+
*
|
|
8681
|
+
* console.log(digitalAsset);
|
|
8682
|
+
* }
|
|
8683
|
+
* runExample().catch(console.error);
|
|
8684
|
+
* ```
|
|
8685
|
+
* @group DigitalAsset
|
|
8686
|
+
*/
|
|
8687
|
+
getDigitalAssetData(args: {
|
|
8688
|
+
digitalAssetAddress: AccountAddressInput;
|
|
8689
|
+
minimumLedgerVersion?: AnyNumber;
|
|
8690
|
+
}): Promise<GetTokenDataResponse>;
|
|
8691
|
+
/**
|
|
8692
|
+
* Retrieves the current ownership data of a specified digital asset using its address.
|
|
8693
|
+
*
|
|
8694
|
+
* @param args The parameters for the request.
|
|
8695
|
+
* @param args.digitalAssetAddress The address of the digital asset.
|
|
8696
|
+
* @param args.minimumLedgerVersion Optional ledger version to sync up to before querying.
|
|
8697
|
+
*
|
|
8698
|
+
* @returns GetCurrentTokenOwnershipResponse containing relevant ownership data of the digital asset.
|
|
8699
|
+
*
|
|
8700
|
+
* @example
|
|
8701
|
+
* ```typescript
|
|
8702
|
+
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
8703
|
+
*
|
|
8704
|
+
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
8705
|
+
* const aptos = new Aptos(config);
|
|
8706
|
+
*
|
|
8707
|
+
* async function runExample() {
|
|
8708
|
+
* // Getting the current ownership of a digital asset
|
|
8709
|
+
* const digitalAssetOwner = await aptos.getCurrentDigitalAssetOwnership({
|
|
8710
|
+
* digitalAssetAddress: "0x123", // replace with a real digital asset address
|
|
8711
|
+
* });
|
|
8712
|
+
*
|
|
8713
|
+
* console.log(digitalAssetOwner);
|
|
8714
|
+
* }
|
|
8715
|
+
* runExample().catch(console.error);
|
|
8716
|
+
* ```
|
|
8717
|
+
* @group DigitalAsset
|
|
8718
|
+
*/
|
|
8719
|
+
getCurrentDigitalAssetOwnership(args: {
|
|
8720
|
+
digitalAssetAddress: AccountAddressInput;
|
|
8721
|
+
minimumLedgerVersion?: AnyNumber;
|
|
8722
|
+
}): Promise<GetCurrentTokenOwnershipResponse>;
|
|
8723
|
+
/**
|
|
8724
|
+
* Retrieves the digital assets owned by a specified address.
|
|
8725
|
+
*
|
|
8726
|
+
* @param args.ownerAddress The address of the owner.
|
|
8727
|
+
* @param args.minimumLedgerVersion Optional ledger version to sync up to before querying.
|
|
8728
|
+
* @param args.options Optional pagination and ordering parameters for the response.
|
|
8729
|
+
*
|
|
8730
|
+
* @returns GetOwnedTokensResponse containing ownership data of the digital assets belonging to the ownerAddress.
|
|
8731
|
+
*
|
|
8732
|
+
* @example
|
|
8733
|
+
* ```typescript
|
|
8734
|
+
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
8735
|
+
*
|
|
8736
|
+
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
8737
|
+
* const aptos = new Aptos(config);
|
|
8738
|
+
*
|
|
8739
|
+
* async function runExample() {
|
|
8740
|
+
* // Fetching the digital assets owned by the specified address
|
|
8741
|
+
* const digitalAssets = await aptos.getOwnedDigitalAssets({
|
|
8742
|
+
* ownerAddress: "0x1", // replace with a real account address
|
|
8743
|
+
* });
|
|
8744
|
+
*
|
|
8745
|
+
* console.log(digitalAssets);
|
|
8746
|
+
* }
|
|
8747
|
+
* runExample().catch(console.error);
|
|
8748
|
+
* ```
|
|
8749
|
+
* @group DigitalAsset
|
|
8750
|
+
*/
|
|
8751
|
+
getOwnedDigitalAssets(args: {
|
|
8752
|
+
ownerAddress: AccountAddressInput;
|
|
8753
|
+
minimumLedgerVersion?: AnyNumber;
|
|
8754
|
+
options?: PaginationArgs & OrderByArg<GetOwnedTokensResponse[0]>;
|
|
8755
|
+
}): Promise<GetOwnedTokensResponse>;
|
|
8756
|
+
/**
|
|
8757
|
+
* Retrieves the activity data for a specified digital asset using its address.
|
|
8758
|
+
*
|
|
8759
|
+
* @param args - The parameters for the request.
|
|
8760
|
+
* @param args.digitalAssetAddress - The address of the digital asset.
|
|
8761
|
+
* @param args.minimumLedgerVersion - Optional minimum ledger version to sync up to before querying.
|
|
8762
|
+
* @param args.options - Optional pagination and ordering parameters.
|
|
8763
|
+
*
|
|
8764
|
+
* @returns A promise that resolves to the activity data related to the digital asset.
|
|
8765
|
+
*
|
|
8766
|
+
* @example
|
|
8767
|
+
* ```typescript
|
|
8768
|
+
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
8769
|
+
*
|
|
8770
|
+
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
8771
|
+
* const aptos = new Aptos(config);
|
|
8772
|
+
*
|
|
8773
|
+
* async function runExample() {
|
|
8774
|
+
* // Get the activity data for a digital asset
|
|
8775
|
+
* const digitalAssetActivity = await aptos.getDigitalAssetActivity({
|
|
8776
|
+
* digitalAssetAddress: "0x123", // replace with a real digital asset address
|
|
8777
|
+
* });
|
|
8778
|
+
*
|
|
8779
|
+
* console.log(digitalAssetActivity);
|
|
8780
|
+
* }
|
|
8781
|
+
* runExample().catch(console.error);
|
|
8782
|
+
* ```
|
|
8783
|
+
* @group DigitalAsset
|
|
8784
|
+
*/
|
|
8785
|
+
getDigitalAssetActivity(args: {
|
|
8786
|
+
digitalAssetAddress: AccountAddressInput;
|
|
8787
|
+
minimumLedgerVersion?: AnyNumber;
|
|
8788
|
+
options?: PaginationArgs & OrderByArg<GetTokenActivityResponse[0]>;
|
|
8789
|
+
}): Promise<GetTokenActivityResponse>;
|
|
8790
|
+
/**
|
|
8791
|
+
* Creates a new collection within the specified account.
|
|
8792
|
+
*
|
|
8793
|
+
* @param args.creator - The account of the collection's creator.
|
|
8794
|
+
* @param args.description - The description of the collection.
|
|
8795
|
+
* @param args.name - The name of the collection.
|
|
8796
|
+
* @param args.uri - The URI to additional info about the collection.
|
|
8797
|
+
* @param args.options - Optional parameters for generating the transaction.
|
|
8798
|
+
*
|
|
8799
|
+
* The parameters below are optional:
|
|
8800
|
+
* @param args.maxSupply - Controls the max supply of the digital assets. Defaults to MAX_U64_BIG_INT.
|
|
8801
|
+
* @param args.mutableDescription - Controls mutability of the collection's description. Defaults to true.
|
|
8802
|
+
* @param args.mutableRoyalty - Controls mutability of the collection's royalty. Defaults to true.
|
|
8803
|
+
* @param args.mutableUri - Controls mutability of the collection's URI. Defaults to true.
|
|
8804
|
+
* @param args.mutableTokenDescription - Controls mutability of the digital asset's description. Defaults to true.
|
|
8805
|
+
* @param args.mutableTokenName - Controls mutability of the digital asset's name. Defaults to true.
|
|
8806
|
+
* @param args.mutableTokenProperties - Controls mutability of digital asset's properties. Defaults to true.
|
|
8807
|
+
* @param args.mutableTokenUri - Controls mutability of the digital asset's URI. Defaults to true.
|
|
8808
|
+
* @param args.tokensBurnableByCreator - Controls whether digital assets can be burnable by the creator. Defaults to true.
|
|
8809
|
+
* @param args.tokensFreezableByCreator - Controls whether digital assets can be frozen by the creator. Defaults to true.
|
|
8810
|
+
* @param args.royaltyNumerator - The numerator of the royalty to be paid to the creator when a digital asset is transferred.
|
|
8811
|
+
* Defaults to 0.
|
|
8812
|
+
* @param args.royaltyDenominator - The denominator of the royalty to be paid to the creator when a digital asset is
|
|
8813
|
+
* transferred. Defaults to 1.
|
|
8814
|
+
*
|
|
8815
|
+
* @returns A SimpleTransaction that when submitted will create the collection.
|
|
8816
|
+
*
|
|
8817
|
+
* @example
|
|
8818
|
+
* ```typescript
|
|
8819
|
+
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
8820
|
+
*
|
|
8821
|
+
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
8822
|
+
* const aptos = new Aptos(config);
|
|
8823
|
+
*
|
|
8824
|
+
* async function runExample() {
|
|
8825
|
+
* // Creating a new collection transaction
|
|
8826
|
+
* const transaction = await aptos.createCollectionTransaction({
|
|
8827
|
+
* creator: Account.generate(), // Replace with a real account
|
|
8828
|
+
* description: "A unique collection of digital assets.",
|
|
8829
|
+
* name: "My Digital Collection",
|
|
8830
|
+
* uri: "https://mycollection.com",
|
|
8831
|
+
* });
|
|
8832
|
+
*
|
|
8833
|
+
* console.log("Transaction created:", transaction);
|
|
8834
|
+
* }
|
|
8835
|
+
* runExample().catch(console.error);
|
|
8836
|
+
* ```
|
|
8837
|
+
* @group DigitalAsset
|
|
8838
|
+
*/
|
|
8839
|
+
createCollectionTransaction(args: {
|
|
8840
|
+
creator: Account$1;
|
|
8841
|
+
description: string;
|
|
8842
|
+
name: string;
|
|
8843
|
+
uri: string;
|
|
8844
|
+
options?: InputGenerateTransactionOptions;
|
|
8845
|
+
} & CreateCollectionOptions): Promise<SimpleTransaction>;
|
|
8846
|
+
/**
|
|
8847
|
+
* Create a transaction to mint a digital asset into the creator's account within an existing collection.
|
|
8848
|
+
* This function helps you generate a transaction that can be simulated or submitted to the blockchain for minting a digital asset.
|
|
8849
|
+
*
|
|
8850
|
+
* @param args.creator - The creator of the collection.
|
|
8851
|
+
* @param args.collection - The name of the collection the digital asset belongs to.
|
|
8852
|
+
* @param args.description - The description of the digital asset.
|
|
8853
|
+
* @param args.name - The name of the digital asset.
|
|
8854
|
+
* @param args.uri - The URI to additional info about the digital asset.
|
|
8855
|
+
* @param args.propertyKeys - Optional array of property keys for the digital asset.
|
|
8856
|
+
* @param args.propertyTypes - Optional array of property types for the digital asset.
|
|
8857
|
+
* @param args.propertyValues - Optional array of property values for the digital asset.
|
|
8858
|
+
* @param args.options - Optional transaction generation options.
|
|
8859
|
+
*
|
|
8860
|
+
* @returns A SimpleTransaction that can be simulated or submitted to the chain.
|
|
8861
|
+
*
|
|
8862
|
+
* @example
|
|
8863
|
+
* ```typescript
|
|
8864
|
+
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
8865
|
+
*
|
|
8866
|
+
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
8867
|
+
* const aptos = new Aptos(config);
|
|
8868
|
+
*
|
|
8869
|
+
* async function runExample() {
|
|
8870
|
+
* // Creating a transaction to mint a digital asset
|
|
8871
|
+
* const transaction = await aptos.mintDigitalAssetTransaction({
|
|
8872
|
+
* creator: Account.generate(), // replace with a real account
|
|
8873
|
+
* collection: "MyCollection",
|
|
8874
|
+
* description: "This is a digital asset.",
|
|
8875
|
+
* name: "MyDigitalAsset",
|
|
8876
|
+
* uri: "https://example.com/my-digital-asset",
|
|
8877
|
+
* });
|
|
8878
|
+
*
|
|
8879
|
+
* console.log(transaction);
|
|
8880
|
+
* }
|
|
8881
|
+
* runExample().catch(console.error);
|
|
8882
|
+
* ```
|
|
8883
|
+
* @group DigitalAsset
|
|
8884
|
+
*/
|
|
8885
|
+
mintDigitalAssetTransaction(args: {
|
|
8886
|
+
creator: Account$1;
|
|
8887
|
+
collection: string;
|
|
8888
|
+
description: string;
|
|
8889
|
+
name: string;
|
|
8890
|
+
uri: string;
|
|
8891
|
+
propertyKeys?: Array<string>;
|
|
8892
|
+
propertyTypes?: Array<PropertyType>;
|
|
8893
|
+
propertyValues?: Array<PropertyValue>;
|
|
8894
|
+
options?: InputGenerateTransactionOptions;
|
|
8895
|
+
}): Promise<SimpleTransaction>;
|
|
8896
|
+
/**
|
|
8897
|
+
* Transfer ownership of a non-fungible digital asset.
|
|
8898
|
+
* This function allows you to transfer a digital asset only if it is not frozen, meaning the ownership transfer is not disabled.
|
|
8899
|
+
*
|
|
8900
|
+
* @param args The arguments for transferring the digital asset.
|
|
8901
|
+
* @param args.sender The sender account of the current digital asset owner.
|
|
8902
|
+
* @param args.digitalAssetAddress The address of the digital asset being transferred.
|
|
8903
|
+
* @param args.recipient The account address of the recipient.
|
|
8904
|
+
* @param args.digitalAssetType Optional. The type of the digital asset, defaults to "0x4::token::Token".
|
|
8905
|
+
* @param args.options Optional. Additional options for generating the transaction.
|
|
8906
|
+
*
|
|
8907
|
+
* @returns A SimpleTransaction that can be simulated or submitted to the chain.
|
|
8908
|
+
*
|
|
8909
|
+
* @example
|
|
8910
|
+
* ```typescript
|
|
8911
|
+
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
8912
|
+
*
|
|
8913
|
+
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
8914
|
+
* const aptos = new Aptos(config);
|
|
8915
|
+
*
|
|
8916
|
+
* async function runExample() {
|
|
8917
|
+
* // Transfer a digital asset
|
|
8918
|
+
* const transaction = await aptos.transferDigitalAssetTransaction({
|
|
8919
|
+
* sender: Account.generate(), // replace with a real sender account
|
|
8920
|
+
* digitalAssetAddress: "0x123", // replace with a real digital asset address
|
|
8921
|
+
* recipient: "0x456", // replace with a real recipient account address
|
|
8922
|
+
* });
|
|
8923
|
+
*
|
|
8924
|
+
* console.log(transaction);
|
|
8925
|
+
* }
|
|
8926
|
+
* runExample().catch(console.error);
|
|
8927
|
+
* ```
|
|
8928
|
+
* @group DigitalAsset
|
|
8929
|
+
*/
|
|
8930
|
+
transferDigitalAssetTransaction(args: {
|
|
8931
|
+
sender: Account$1;
|
|
8932
|
+
digitalAssetAddress: AccountAddressInput;
|
|
8933
|
+
recipient: AccountAddress;
|
|
8934
|
+
digitalAssetType?: MoveStructId;
|
|
8935
|
+
options?: InputGenerateTransactionOptions;
|
|
8936
|
+
}): Promise<SimpleTransaction>;
|
|
8937
|
+
/**
|
|
8938
|
+
* Mint a soul bound digital asset into a recipient's account.
|
|
8939
|
+
* This function allows you to create a unique digital asset that is bound to a specific account.
|
|
8940
|
+
*
|
|
8941
|
+
* @param args - The arguments for minting the soul bound transaction.
|
|
8942
|
+
* @param args.account - The account that mints the digital asset.
|
|
8943
|
+
* @param args.collection - The collection name that the digital asset belongs to.
|
|
8944
|
+
* @param args.description - The digital asset description.
|
|
8945
|
+
* @param args.name - The digital asset name.
|
|
8946
|
+
* @param args.uri - The digital asset URL.
|
|
8947
|
+
* @param args.recipient - The account address where the digital asset will be created.
|
|
8948
|
+
* @param args.propertyKeys - The property keys for storing on-chain properties.
|
|
8949
|
+
* @param args.propertyTypes - The type of property values.
|
|
8950
|
+
* @param args.propertyValues - The property values to be stored on-chain.
|
|
8951
|
+
* @param args.options - Additional options for generating the transaction.
|
|
8952
|
+
*
|
|
8953
|
+
* @returns A SimpleTransaction that can be simulated or submitted to the chain.
|
|
8954
|
+
*
|
|
8955
|
+
* @example
|
|
8956
|
+
* ```typescript
|
|
8957
|
+
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
8958
|
+
*
|
|
8959
|
+
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
8960
|
+
* const aptos = new Aptos(config);
|
|
8961
|
+
*
|
|
8962
|
+
* async function runExample() {
|
|
8963
|
+
* // Mint a soul bound digital asset
|
|
8964
|
+
* const transaction = await aptos.mintSoulBoundTransaction({
|
|
8965
|
+
* account: Account.generate(), // Replace with a real account
|
|
8966
|
+
* collection: "collectionName",
|
|
8967
|
+
* description: "collectionDescription",
|
|
8968
|
+
* name: "digitalAssetName",
|
|
8969
|
+
* uri: "digital-asset-uri.com",
|
|
8970
|
+
* recipient: "0x123" // Replace with a real recipient account address
|
|
8971
|
+
* });
|
|
8972
|
+
*
|
|
8973
|
+
* console.log(transaction);
|
|
8974
|
+
* }
|
|
8975
|
+
* runExample().catch(console.error);
|
|
8976
|
+
* ```
|
|
8977
|
+
* @group DigitalAsset
|
|
8978
|
+
*/
|
|
8979
|
+
mintSoulBoundTransaction(args: {
|
|
8980
|
+
account: Account$1;
|
|
8981
|
+
collection: string;
|
|
8982
|
+
description: string;
|
|
8983
|
+
name: string;
|
|
8984
|
+
uri: string;
|
|
8985
|
+
recipient: AccountAddressInput;
|
|
8986
|
+
propertyKeys?: Array<string>;
|
|
8987
|
+
propertyTypes?: Array<PropertyType>;
|
|
8988
|
+
propertyValues?: Array<PropertyValue>;
|
|
8989
|
+
options?: InputGenerateTransactionOptions;
|
|
8990
|
+
}): Promise<SimpleTransaction>;
|
|
8991
|
+
/**
|
|
8992
|
+
* Burn a digital asset by its creator, allowing for the removal of a specified digital asset from the blockchain.
|
|
8993
|
+
*
|
|
8994
|
+
* @param args The arguments for burning the digital asset.
|
|
8995
|
+
* @param args.creator The creator account that is burning the digital asset.
|
|
8996
|
+
* @param args.digitalAssetAddress The address of the digital asset to be burned.
|
|
8997
|
+
* @param args.digitalAssetType Optional. The type of the digital asset being burned.
|
|
8998
|
+
* @param args.options Optional. Additional options for generating the transaction.
|
|
8999
|
+
*
|
|
9000
|
+
* @returns A SimpleTransaction that can be simulated or submitted to the chain.
|
|
9001
|
+
*
|
|
9002
|
+
* @example
|
|
9003
|
+
* ```typescript
|
|
9004
|
+
* import { Aptos, AptosConfig, Network, Account } from "@aptos-labs/ts-sdk";
|
|
9005
|
+
*
|
|
9006
|
+
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
9007
|
+
* const aptos = new Aptos(config);
|
|
9008
|
+
*
|
|
9009
|
+
* async function runExample() {
|
|
9010
|
+
* const creator = Account.generate(); // Replace with a real creator account
|
|
9011
|
+
* const transaction = await aptos.burnDigitalAssetTransaction({
|
|
9012
|
+
* creator: creator,
|
|
9013
|
+
* digitalAssetAddress: "0x123", // Replace with a real digital asset address
|
|
9014
|
+
* });
|
|
9015
|
+
*
|
|
9016
|
+
* console.log(transaction);
|
|
9017
|
+
* }
|
|
9018
|
+
* runExample().catch(console.error);
|
|
9019
|
+
* ```
|
|
9020
|
+
* @group DigitalAsset
|
|
9021
|
+
*/
|
|
9022
|
+
burnDigitalAssetTransaction(args: {
|
|
9023
|
+
creator: Account$1;
|
|
9024
|
+
digitalAssetAddress: AccountAddressInput;
|
|
9025
|
+
digitalAssetType?: MoveStructId;
|
|
9026
|
+
options?: InputGenerateTransactionOptions;
|
|
9027
|
+
}): Promise<SimpleTransaction>;
|
|
9028
|
+
/**
|
|
9029
|
+
* Freeze the ability to transfer a specified digital asset.
|
|
9030
|
+
* This function allows the creator to restrict the transfer capability of a digital asset.
|
|
9031
|
+
*
|
|
9032
|
+
* @param args The arguments for freezing the digital asset transfer.
|
|
9033
|
+
* @param args.creator The creator account initiating the freeze.
|
|
9034
|
+
* @param args.digitalAssetAddress The address of the digital asset to be frozen.
|
|
9035
|
+
* @param args.digitalAssetType Optional. The type of the digital asset being frozen.
|
|
9036
|
+
* @param args.options Optional. Additional options for generating the transaction.
|
|
9037
|
+
*
|
|
9038
|
+
* @returns A SimpleTransaction that can be simulated or submitted to the chain.
|
|
9039
|
+
*
|
|
9040
|
+
* @example
|
|
9041
|
+
* ```typescript
|
|
9042
|
+
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
9043
|
+
*
|
|
9044
|
+
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
9045
|
+
* const aptos = new Aptos(config);
|
|
9046
|
+
*
|
|
9047
|
+
* async function runExample() {
|
|
9048
|
+
* // Freeze the digital asset transfer
|
|
9049
|
+
* const transaction = await aptos.freezeDigitalAssetTransaferTransaction({
|
|
9050
|
+
* creator: Account.generate(), // Replace with a real account if needed
|
|
9051
|
+
* digitalAssetAddress: "0x123", // Replace with a real digital asset address
|
|
9052
|
+
* });
|
|
9053
|
+
*
|
|
9054
|
+
* console.log(transaction);
|
|
9055
|
+
* }
|
|
9056
|
+
* runExample().catch(console.error);
|
|
9057
|
+
* ```
|
|
9058
|
+
* @group DigitalAsset
|
|
9059
|
+
*/
|
|
9060
|
+
freezeDigitalAssetTransaferTransaction(args: {
|
|
9061
|
+
creator: Account$1;
|
|
9062
|
+
digitalAssetAddress: AccountAddressInput;
|
|
9063
|
+
digitalAssetType?: MoveStructId;
|
|
9064
|
+
options?: InputGenerateTransactionOptions;
|
|
9065
|
+
}): Promise<SimpleTransaction>;
|
|
9066
|
+
/**
|
|
9067
|
+
* Unfreeze the ability to transfer a digital asset.
|
|
9068
|
+
* This function allows the specified creator account to unfreeze the transfer of a digital asset identified by its address.
|
|
9069
|
+
*
|
|
9070
|
+
* @param args The parameters for unfreezing the digital asset transfer.
|
|
9071
|
+
* @param args.creator The creator account that is unfreezing the digital asset transfer.
|
|
9072
|
+
* @param args.digitalAssetAddress The address of the digital asset to unfreeze.
|
|
9073
|
+
* @param args.digitalAssetType Optional. The type of the digital asset being unfrozen.
|
|
9074
|
+
* @param args.options Optional. Additional options for generating the transaction.
|
|
9075
|
+
*
|
|
9076
|
+
* @returns A SimpleTransaction that can be simulated or submitted to the chain.
|
|
9077
|
+
*
|
|
9078
|
+
* @example
|
|
9079
|
+
* ```typescript
|
|
9080
|
+
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
9081
|
+
*
|
|
9082
|
+
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
9083
|
+
* const aptos = new Aptos(config);
|
|
9084
|
+
*
|
|
9085
|
+
* async function runExample() {
|
|
9086
|
+
* // Unfreeze the ability to transfer a digital asset
|
|
9087
|
+
* const transaction = await aptos.unfreezeDigitalAssetTransaferTransaction({
|
|
9088
|
+
* creator: Account.generate(), // replace with a real creator account
|
|
9089
|
+
* digitalAssetAddress: "0x123", // replace with a real digital asset address
|
|
9090
|
+
* });
|
|
9091
|
+
*
|
|
9092
|
+
* console.log(transaction);
|
|
9093
|
+
* }
|
|
9094
|
+
* runExample().catch(console.error);
|
|
9095
|
+
* ```
|
|
9096
|
+
* @group DigitalAsset
|
|
9097
|
+
*/
|
|
9098
|
+
unfreezeDigitalAssetTransaferTransaction(args: {
|
|
9099
|
+
creator: Account$1;
|
|
9100
|
+
digitalAssetAddress: AccountAddressInput;
|
|
9101
|
+
digitalAssetType?: MoveStructId;
|
|
9102
|
+
options?: InputGenerateTransactionOptions;
|
|
9103
|
+
}): Promise<SimpleTransaction>;
|
|
9104
|
+
/**
|
|
9105
|
+
* Set the digital asset description to provide additional context or information about the asset.
|
|
9106
|
+
*
|
|
9107
|
+
* @param args The parameters for setting the digital asset description.
|
|
9108
|
+
* @param args.creator The creator account responsible for the digital asset.
|
|
9109
|
+
* @param args.description The digital asset description to be set.
|
|
9110
|
+
* @param args.digitalAssetAddress The address of the digital asset.
|
|
9111
|
+
* @param args.digitalAssetType Optional. The type of the digital asset.
|
|
9112
|
+
* @param args.options Optional. Additional options for generating the transaction.
|
|
9113
|
+
*
|
|
9114
|
+
* @returns A SimpleTransaction that can be simulated or submitted to the chain.
|
|
9115
|
+
*
|
|
9116
|
+
* @example
|
|
9117
|
+
* ```typescript
|
|
9118
|
+
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
9119
|
+
*
|
|
9120
|
+
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
9121
|
+
* const aptos = new Aptos(config);
|
|
9122
|
+
*
|
|
9123
|
+
* async function runExample() {
|
|
9124
|
+
* // Set the digital asset description
|
|
9125
|
+
* const transaction = await aptos.setDigitalAssetDescriptionTransaction({
|
|
9126
|
+
* creator: Account.generate(), // replace with a real account
|
|
9127
|
+
* description: "This is a digital asset description.",
|
|
9128
|
+
* digitalAssetAddress: "0x123", // replace with a real digital asset address
|
|
9129
|
+
* });
|
|
9130
|
+
*
|
|
9131
|
+
* console.log(transaction);
|
|
9132
|
+
* }
|
|
9133
|
+
* runExample().catch(console.error);
|
|
9134
|
+
* ```
|
|
9135
|
+
* @group DigitalAsset
|
|
9136
|
+
*/
|
|
9137
|
+
setDigitalAssetDescriptionTransaction(args: {
|
|
9138
|
+
creator: Account$1;
|
|
9139
|
+
description: string;
|
|
9140
|
+
digitalAssetAddress: AccountAddressInput;
|
|
9141
|
+
digitalAssetType?: MoveStructId;
|
|
9142
|
+
options?: InputGenerateTransactionOptions;
|
|
9143
|
+
}): Promise<SimpleTransaction>;
|
|
9144
|
+
/**
|
|
9145
|
+
* Set the digital asset name, allowing you to define a name for a specific digital asset on the blockchain.
|
|
9146
|
+
*
|
|
9147
|
+
* @param args The parameters for setting the digital asset name.
|
|
9148
|
+
* @param args.creator The creator account responsible for the transaction.
|
|
9149
|
+
* @param args.name The desired name for the digital asset.
|
|
9150
|
+
* @param args.digitalAssetAddress The address of the digital asset.
|
|
9151
|
+
* @param args.digitalAssetType Optional. The type of the digital asset, represented as a Move struct ID.
|
|
9152
|
+
* @param args.options Optional. Additional options for generating the transaction.
|
|
9153
|
+
*
|
|
9154
|
+
* @returns A SimpleTransaction that can be simulated or submitted to the blockchain.
|
|
9155
|
+
*
|
|
9156
|
+
* @example
|
|
9157
|
+
* ```typescript
|
|
9158
|
+
* import { Aptos, AptosConfig, Network, Account } from "@aptos-labs/ts-sdk";
|
|
9159
|
+
*
|
|
9160
|
+
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
9161
|
+
* const aptos = new Aptos(config);
|
|
9162
|
+
*
|
|
9163
|
+
* async function runExample() {
|
|
9164
|
+
* const creator = Account.generate(); // Generate a new account for the creator
|
|
9165
|
+
* const digitalAssetAddress = "0x123"; // replace with a real digital asset address
|
|
9166
|
+
*
|
|
9167
|
+
* // Set the digital asset name
|
|
9168
|
+
* const transaction = await aptos.setDigitalAssetNameTransaction({
|
|
9169
|
+
* creator: creator,
|
|
9170
|
+
* name: "digitalAssetName",
|
|
9171
|
+
* digitalAssetAddress: digitalAssetAddress,
|
|
9172
|
+
* });
|
|
9173
|
+
*
|
|
9174
|
+
* console.log(transaction);
|
|
9175
|
+
* }
|
|
9176
|
+
* runExample().catch(console.error);
|
|
9177
|
+
* ```
|
|
9178
|
+
* @group DigitalAsset
|
|
9179
|
+
*/
|
|
9180
|
+
setDigitalAssetNameTransaction(args: {
|
|
9181
|
+
creator: Account$1;
|
|
9182
|
+
name: string;
|
|
9183
|
+
digitalAssetAddress: AccountAddressInput;
|
|
9184
|
+
digitalAssetType?: MoveStructId;
|
|
9185
|
+
options?: InputGenerateTransactionOptions;
|
|
9186
|
+
}): Promise<SimpleTransaction>;
|
|
9187
|
+
/**
|
|
9188
|
+
* Set the URI for a digital asset, allowing you to associate a unique identifier with the asset.
|
|
9189
|
+
*
|
|
9190
|
+
* @param args The parameters for the transaction.
|
|
9191
|
+
* @param args.creator The creator account initiating the transaction.
|
|
9192
|
+
* @param args.uri The digital asset URI to be set.
|
|
9193
|
+
* @param args.digitalAssetAddress The address of the digital asset.
|
|
9194
|
+
* @param args.digitalAssetType Optional. The type of the digital asset.
|
|
9195
|
+
* @param args.options Optional. Additional options for generating the transaction.
|
|
9196
|
+
* @returns A SimpleTransaction that can be simulated or submitted to the chain.
|
|
9197
|
+
*
|
|
9198
|
+
* @example
|
|
9199
|
+
* ```typescript
|
|
9200
|
+
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
9201
|
+
*
|
|
9202
|
+
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
9203
|
+
* const aptos = new Aptos(config);
|
|
9204
|
+
*
|
|
9205
|
+
* async function runExample() {
|
|
9206
|
+
* // Set the URI for a digital asset
|
|
9207
|
+
* const transaction = await aptos.setDigitalAssetURITransaction({
|
|
9208
|
+
* creator: Account.generate(), // Replace with a real creator account
|
|
9209
|
+
* uri: "digital-asset-uri.com",
|
|
9210
|
+
* digitalAssetAddress: "0x123", // Replace with a real digital asset address
|
|
9211
|
+
* });
|
|
9212
|
+
*
|
|
9213
|
+
* console.log(transaction);
|
|
9214
|
+
* }
|
|
9215
|
+
* runExample().catch(console.error);
|
|
9216
|
+
* ```
|
|
9217
|
+
* @group DigitalAsset
|
|
9218
|
+
*/
|
|
9219
|
+
setDigitalAssetURITransaction(args: {
|
|
9220
|
+
creator: Account$1;
|
|
9221
|
+
uri: string;
|
|
9222
|
+
digitalAssetAddress: AccountAddressInput;
|
|
9223
|
+
digitalAssetType?: MoveStructId;
|
|
9224
|
+
options?: InputGenerateTransactionOptions;
|
|
9225
|
+
}): Promise<SimpleTransaction>;
|
|
9226
|
+
/**
|
|
9227
|
+
* Add a digital asset property to the blockchain.
|
|
9228
|
+
* This function allows you to specify a new property for a digital asset, including its key, type, and value.
|
|
9229
|
+
*
|
|
9230
|
+
* @param args - The arguments for adding a digital asset property.
|
|
9231
|
+
* @param args.creator - The account that mints the digital asset.
|
|
9232
|
+
* @param args.propertyKey - The property key for storing on-chain properties.
|
|
9233
|
+
* @param args.propertyType - The type of property value.
|
|
9234
|
+
* @param args.propertyValue - The property value to be stored on-chain.
|
|
9235
|
+
* @param args.digitalAssetAddress - The digital asset address.
|
|
9236
|
+
* @param args.digitalAssetType - (Optional) The type of the digital asset.
|
|
9237
|
+
* @param args.options - (Optional) Options for generating the transaction.
|
|
9238
|
+
* @returns A SimpleTransaction that can be simulated or submitted to the chain.
|
|
9239
|
+
*
|
|
9240
|
+
* @example
|
|
9241
|
+
* ```typescript
|
|
9242
|
+
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
9243
|
+
*
|
|
9244
|
+
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
9245
|
+
* const aptos = new Aptos(config);
|
|
9246
|
+
*
|
|
9247
|
+
* async function runExample() {
|
|
9248
|
+
* // Add a digital asset property
|
|
9249
|
+
* const transaction = await aptos.addDigitalAssetPropertyTransaction({
|
|
9250
|
+
* creator: Account.generate(), // Replace with a real account
|
|
9251
|
+
* propertyKey: "newKey",
|
|
9252
|
+
* propertyType: "BOOLEAN",
|
|
9253
|
+
* propertyValue: true,
|
|
9254
|
+
* digitalAssetAddress: "0x123", // Replace with a real digital asset address
|
|
9255
|
+
* });
|
|
9256
|
+
*
|
|
9257
|
+
* console.log(transaction);
|
|
9258
|
+
* }
|
|
9259
|
+
* runExample().catch(console.error);
|
|
9260
|
+
* ```
|
|
9261
|
+
* @group DigitalAsset
|
|
9262
|
+
*/
|
|
9263
|
+
addDigitalAssetPropertyTransaction(args: {
|
|
9264
|
+
creator: Account$1;
|
|
9265
|
+
propertyKey: string;
|
|
9266
|
+
propertyType: PropertyType;
|
|
9267
|
+
propertyValue: PropertyValue;
|
|
9268
|
+
digitalAssetAddress: AccountAddressInput;
|
|
9269
|
+
digitalAssetType?: MoveStructId;
|
|
9270
|
+
options?: InputGenerateTransactionOptions;
|
|
9271
|
+
}): Promise<SimpleTransaction>;
|
|
9272
|
+
/**
|
|
9273
|
+
* Remove a digital asset property from the blockchain.
|
|
9274
|
+
* This function allows you to delete an existing property associated with a digital asset.
|
|
9275
|
+
*
|
|
9276
|
+
* @param args The parameters required to remove the digital asset property.
|
|
9277
|
+
* @param args.creator The account that mints the digital asset.
|
|
9278
|
+
* @param args.propertyKey The property key for storing on-chain properties.
|
|
9279
|
+
* @param args.propertyType The type of property value.
|
|
9280
|
+
* @param args.propertyValue The property value to be stored on-chain.
|
|
9281
|
+
* @param args.digitalAssetAddress The digital asset address.
|
|
9282
|
+
* @param args.digitalAssetType Optional. The type of the digital asset.
|
|
9283
|
+
* @param args.options Optional. Additional options for generating the transaction.
|
|
9284
|
+
*
|
|
9285
|
+
* @returns A SimpleTransaction that can be simulated or submitted to the chain.
|
|
9286
|
+
*
|
|
9287
|
+
* @example
|
|
9288
|
+
* ```typescript
|
|
9289
|
+
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
9290
|
+
*
|
|
9291
|
+
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
9292
|
+
* const aptos = new Aptos(config);
|
|
9293
|
+
*
|
|
9294
|
+
* async function runExample() {
|
|
9295
|
+
* // Remove a digital asset property
|
|
9296
|
+
* const transaction = await aptos.removeDigitalAssetPropertyTransaction({
|
|
9297
|
+
* creator: Account.generate(), // replace with a real account
|
|
9298
|
+
* propertyKey: "newKey",
|
|
9299
|
+
* propertyType: "BOOLEAN",
|
|
9300
|
+
* propertyValue: true,
|
|
9301
|
+
* digitalAssetAddress: "0x123", // replace with a real digital asset address
|
|
9302
|
+
* });
|
|
9303
|
+
*
|
|
9304
|
+
* console.log(transaction);
|
|
9305
|
+
* }
|
|
9306
|
+
* runExample().catch(console.error);
|
|
9307
|
+
* ```
|
|
9308
|
+
* @group DigitalAsset
|
|
9309
|
+
*/
|
|
9310
|
+
removeDigitalAssetPropertyTransaction(args: {
|
|
9311
|
+
creator: Account$1;
|
|
9312
|
+
propertyKey: string;
|
|
9313
|
+
propertyType: PropertyType;
|
|
9314
|
+
propertyValue: PropertyValue;
|
|
9315
|
+
digitalAssetAddress: AccountAddressInput;
|
|
9316
|
+
digitalAssetType?: MoveStructId;
|
|
9317
|
+
options?: InputGenerateTransactionOptions;
|
|
9318
|
+
}): Promise<SimpleTransaction>;
|
|
9319
|
+
/**
|
|
9320
|
+
* Update a digital asset property on-chain.
|
|
9321
|
+
*
|
|
9322
|
+
* @param args The parameters for updating the digital asset property.
|
|
9323
|
+
* @param args.creator The account that mints the digital asset.
|
|
9324
|
+
* @param args.digitalAssetAddress The address of the digital asset.
|
|
9325
|
+
* @param args.propertyKey The property key for storing on-chain properties.
|
|
9326
|
+
* @param args.propertyType The type of property value.
|
|
9327
|
+
* @param args.propertyValue The property value to be stored on-chain.
|
|
9328
|
+
* @param args.digitalAssetType Optional. The type of the digital asset.
|
|
9329
|
+
* @param args.options Optional. Additional options for generating the transaction.
|
|
9330
|
+
*
|
|
9331
|
+
* @returns A SimpleTransaction that can be simulated or submitted to the chain.
|
|
9332
|
+
*
|
|
9333
|
+
* @example
|
|
9334
|
+
* ```typescript
|
|
9335
|
+
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
9336
|
+
*
|
|
9337
|
+
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
9338
|
+
* const aptos = new Aptos(config);
|
|
9339
|
+
*
|
|
9340
|
+
* async function runExample() {
|
|
9341
|
+
* // Update a digital asset property
|
|
9342
|
+
* const transaction = await aptos.updateDigitalAssetPropertyTransaction({
|
|
9343
|
+
* creator: Account.generate(), // replace with a real account
|
|
9344
|
+
* propertyKey: "newKey",
|
|
9345
|
+
* propertyType: "BOOLEAN",
|
|
9346
|
+
* propertyValue: false,
|
|
9347
|
+
* digitalAssetAddress: "0x123", // replace with a real digital asset address
|
|
9348
|
+
* });
|
|
9349
|
+
*
|
|
9350
|
+
* console.log(transaction);
|
|
9351
|
+
* }
|
|
9352
|
+
* runExample().catch(console.error);
|
|
9353
|
+
* ```
|
|
9354
|
+
* @group DigitalAsset
|
|
9355
|
+
*/
|
|
9356
|
+
updateDigitalAssetPropertyTransaction(args: {
|
|
9357
|
+
creator: Account$1;
|
|
9358
|
+
propertyKey: string;
|
|
9359
|
+
propertyType: PropertyType;
|
|
9360
|
+
propertyValue: PropertyValue;
|
|
9361
|
+
digitalAssetAddress: AccountAddressInput;
|
|
9362
|
+
digitalAssetType?: MoveStructId;
|
|
9363
|
+
options?: InputGenerateTransactionOptions;
|
|
9364
|
+
}): Promise<SimpleTransaction>;
|
|
9365
|
+
/**
|
|
9366
|
+
* Add a typed digital asset property to the blockchain.
|
|
9367
|
+
* This function allows you to define and store a specific property for a digital asset, enabling better categorization and
|
|
9368
|
+
* management of digital assets.
|
|
9369
|
+
*
|
|
9370
|
+
* @param args - The parameters for adding the typed property.
|
|
9371
|
+
* @param args.creator - The account that mints the digital asset.
|
|
9372
|
+
* @param args.propertyKey - The property key for storing on-chain properties.
|
|
9373
|
+
* @param args.propertyType - The type of property value.
|
|
9374
|
+
* @param args.propertyValue - The property value to be stored on-chain.
|
|
9375
|
+
* @param args.digitalAssetAddress - The digital asset address.
|
|
9376
|
+
* @param args.digitalAssetType - The optional type of the digital asset.
|
|
9377
|
+
* @param args.options - Optional transaction generation options.
|
|
9378
|
+
*
|
|
9379
|
+
* @returns A SimpleTransaction that can be simulated or submitted to the chain.
|
|
9380
|
+
*
|
|
9381
|
+
* @example
|
|
9382
|
+
* ```typescript
|
|
9383
|
+
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
9384
|
+
*
|
|
9385
|
+
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
9386
|
+
* const aptos = new Aptos(config);
|
|
9387
|
+
*
|
|
9388
|
+
* async function runExample() {
|
|
9389
|
+
* // Adding a typed digital asset property
|
|
9390
|
+
* const transaction = await aptos.addDigitalAssetTypedPropertyTransaction({
|
|
9391
|
+
* creator: Account.generate(), // replace with a real account
|
|
9392
|
+
* propertyKey: "typedKey",
|
|
9393
|
+
* propertyType: "STRING",
|
|
9394
|
+
* propertyValue: "hello",
|
|
9395
|
+
* digitalAssetAddress: "0x123", // replace with a real digital asset address
|
|
9396
|
+
* });
|
|
9397
|
+
*
|
|
9398
|
+
* console.log(transaction);
|
|
9399
|
+
* }
|
|
9400
|
+
* runExample().catch(console.error);
|
|
9401
|
+
* ```
|
|
9402
|
+
* @group DigitalAsset
|
|
9403
|
+
*/
|
|
9404
|
+
addDigitalAssetTypedPropertyTransaction(args: {
|
|
9405
|
+
creator: Account$1;
|
|
9406
|
+
propertyKey: string;
|
|
9407
|
+
propertyType: PropertyType;
|
|
9408
|
+
propertyValue: PropertyValue;
|
|
9409
|
+
digitalAssetAddress: AccountAddressInput;
|
|
9410
|
+
digitalAssetType?: MoveStructId;
|
|
9411
|
+
options?: InputGenerateTransactionOptions;
|
|
9412
|
+
}): Promise<SimpleTransaction>;
|
|
9413
|
+
/**
|
|
9414
|
+
* Update a typed digital asset property on-chain.
|
|
9415
|
+
* This function allows you to modify the properties of a digital asset, enabling dynamic updates to its attributes.
|
|
9416
|
+
*
|
|
9417
|
+
* @param args - The arguments for updating the digital asset property.
|
|
9418
|
+
* @param args.creator - The account that mints the digital asset.
|
|
9419
|
+
* @param args.propertyKey - The property key for storing on-chain properties.
|
|
9420
|
+
* @param args.propertyType - The type of property value.
|
|
9421
|
+
* @param args.propertyValue - The property value to be stored on-chain.
|
|
9422
|
+
* @param args.digitalAssetAddress - The digital asset address.
|
|
9423
|
+
* @param args.digitalAssetType - (Optional) The type of the digital asset.
|
|
9424
|
+
* @param args.options - (Optional) Additional options for generating the transaction.
|
|
9425
|
+
*
|
|
9426
|
+
* @returns A SimpleTransaction that can be simulated or submitted to the chain.
|
|
9427
|
+
*
|
|
9428
|
+
* @example
|
|
9429
|
+
* ```typescript
|
|
9430
|
+
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
9431
|
+
*
|
|
9432
|
+
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
9433
|
+
* const aptos = new Aptos(config);
|
|
9434
|
+
*
|
|
9435
|
+
* async function runExample() {
|
|
9436
|
+
* // Update a typed digital asset property
|
|
9437
|
+
* const transaction = await aptos.updateDigitalAssetTypedPropertyTransaction({
|
|
9438
|
+
* creator: Account.generate(), // replace with a real account
|
|
9439
|
+
* propertyKey: "typedKey",
|
|
9440
|
+
* propertyType: "U8",
|
|
9441
|
+
* propertyValue: 2,
|
|
9442
|
+
* digitalAssetAddress: "0x123", // replace with a real digital asset address
|
|
9443
|
+
* });
|
|
9444
|
+
*
|
|
9445
|
+
* console.log(transaction);
|
|
9446
|
+
* }
|
|
9447
|
+
* runExample().catch(console.error);
|
|
9448
|
+
* ```
|
|
9449
|
+
* @group DigitalAsset
|
|
9450
|
+
*/
|
|
9451
|
+
updateDigitalAssetTypedPropertyTransaction(args: {
|
|
9452
|
+
creator: Account$1;
|
|
9453
|
+
propertyKey: string;
|
|
9454
|
+
propertyType: PropertyType;
|
|
9455
|
+
propertyValue: PropertyValue;
|
|
9456
|
+
digitalAssetAddress: AccountAddressInput;
|
|
9457
|
+
digitalAssetType?: MoveStructId;
|
|
9458
|
+
options?: InputGenerateTransactionOptions;
|
|
9459
|
+
}): Promise<SimpleTransaction>;
|
|
9417
9460
|
}
|
|
9461
|
+
|
|
9418
9462
|
/**
|
|
9419
|
-
*
|
|
9420
|
-
*
|
|
9421
|
-
* regarding the specific type tag that failed to parse and the reason for the failure.
|
|
9422
|
-
*
|
|
9423
|
-
* @param typeTagStr - The type tag string that failed to be parsed.
|
|
9424
|
-
* @param invalidReason - The reason why the type tag string is considered invalid.
|
|
9425
|
-
* @group Implementation
|
|
9426
|
-
* @category Transactions
|
|
9463
|
+
* A class to query all `Event` Aptos related queries.
|
|
9464
|
+
* @group Event
|
|
9427
9465
|
*/
|
|
9428
|
-
declare class
|
|
9466
|
+
declare class Event {
|
|
9467
|
+
readonly config: AptosConfig;
|
|
9468
|
+
/**
|
|
9469
|
+
* Initializes a new instance of the Aptos client with the provided configuration.
|
|
9470
|
+
*
|
|
9471
|
+
* @param config - The configuration settings for the Aptos client.
|
|
9472
|
+
* @param config.network - The network to connect to (e.g., Testnet, Mainnet).
|
|
9473
|
+
* @param config.nodeUrl - The URL of the Aptos node to connect to.
|
|
9474
|
+
* @param config.faucetUrl - The URL of the faucet to use for funding accounts.
|
|
9475
|
+
*
|
|
9476
|
+
* @example
|
|
9477
|
+
* ```typescript
|
|
9478
|
+
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
9479
|
+
*
|
|
9480
|
+
* async function runExample() {
|
|
9481
|
+
* // Create a new Aptos client with Testnet configuration
|
|
9482
|
+
* const config = new AptosConfig({ network: Network.TESTNET }); // Specify your own network if needed
|
|
9483
|
+
* const aptos = new Aptos(config);
|
|
9484
|
+
*
|
|
9485
|
+
* console.log("Aptos client initialized:", aptos);
|
|
9486
|
+
* }
|
|
9487
|
+
* runExample().catch(console.error);
|
|
9488
|
+
* ```
|
|
9489
|
+
* @group Event
|
|
9490
|
+
*/
|
|
9491
|
+
constructor(config: AptosConfig);
|
|
9492
|
+
/**
|
|
9493
|
+
* Retrieve module events based on a specified event type.
|
|
9494
|
+
* This function allows you to query for events that are associated with a particular module event type in the Aptos blockchain.
|
|
9495
|
+
*
|
|
9496
|
+
* @param args - The arguments for retrieving module events.
|
|
9497
|
+
* @param args.eventType - The event type to filter the results.
|
|
9498
|
+
* @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.
|
|
9499
|
+
* @param args.options - Optional pagination and ordering parameters for the event results.
|
|
9500
|
+
*
|
|
9501
|
+
* @returns Promise<GetEventsResponse> - A promise that resolves to the retrieved events.
|
|
9502
|
+
*
|
|
9503
|
+
* @example
|
|
9504
|
+
* ```typescript
|
|
9505
|
+
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
9506
|
+
*
|
|
9507
|
+
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
9508
|
+
* const aptos = new Aptos(config);
|
|
9509
|
+
*
|
|
9510
|
+
* async function runExample() {
|
|
9511
|
+
* // Retrieve module events for a specific event type
|
|
9512
|
+
* const events = await aptos.getModuleEventsByEventType({
|
|
9513
|
+
* eventType: "0x1::transaction_fee::FeeStatement", // specify the event type
|
|
9514
|
+
* minimumLedgerVersion: 1, // optional: specify minimum ledger version if needed
|
|
9515
|
+
* });
|
|
9516
|
+
*
|
|
9517
|
+
* console.log(events); // log the retrieved events
|
|
9518
|
+
* }
|
|
9519
|
+
* runExample().catch(console.error);
|
|
9520
|
+
* ```
|
|
9521
|
+
* @group Event
|
|
9522
|
+
*/
|
|
9523
|
+
getModuleEventsByEventType(args: {
|
|
9524
|
+
eventType: MoveStructId;
|
|
9525
|
+
minimumLedgerVersion?: AnyNumber;
|
|
9526
|
+
options?: PaginationArgs & OrderByArg<GetEventsResponse[0]>;
|
|
9527
|
+
}): Promise<GetEventsResponse>;
|
|
9429
9528
|
/**
|
|
9430
|
-
*
|
|
9431
|
-
* This error provides details about the specific type tag that could not be parsed and the reason for the failure.
|
|
9529
|
+
* Retrieve events associated with a specific account address and creation number.
|
|
9432
9530
|
*
|
|
9433
|
-
* @param
|
|
9434
|
-
* @param
|
|
9435
|
-
* @
|
|
9436
|
-
* @
|
|
9531
|
+
* @param args - The parameters for retrieving account events.
|
|
9532
|
+
* @param args.accountAddress - The account address to query events for.
|
|
9533
|
+
* @param args.creationNumber - The event creation number to filter the events.
|
|
9534
|
+
* @param args.minimumLedgerVersion - Optional minimum ledger version to sync up to before querying.
|
|
9535
|
+
*
|
|
9536
|
+
* @returns Promise<GetEventsResponse>
|
|
9537
|
+
*
|
|
9538
|
+
* @example
|
|
9539
|
+
* ```typescript
|
|
9540
|
+
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
9541
|
+
*
|
|
9542
|
+
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
9543
|
+
* const aptos = new Aptos(config);
|
|
9544
|
+
*
|
|
9545
|
+
* async function runExample() {
|
|
9546
|
+
* // Get events for the account at creation number 0
|
|
9547
|
+
* const events = await aptos.getAccountEventsByCreationNumber({
|
|
9548
|
+
* accountAddress: "0x1", // replace with a real account address
|
|
9549
|
+
* creationNumber: 0,
|
|
9550
|
+
* });
|
|
9551
|
+
*
|
|
9552
|
+
* console.log(events);
|
|
9553
|
+
* }
|
|
9554
|
+
* runExample().catch(console.error);
|
|
9555
|
+
* ```
|
|
9556
|
+
* @group Event
|
|
9437
9557
|
*/
|
|
9438
|
-
|
|
9558
|
+
getAccountEventsByCreationNumber(args: {
|
|
9559
|
+
accountAddress: AccountAddressInput;
|
|
9560
|
+
creationNumber: AnyNumber;
|
|
9561
|
+
minimumLedgerVersion?: AnyNumber;
|
|
9562
|
+
}): Promise<GetEventsResponse>;
|
|
9563
|
+
/**
|
|
9564
|
+
* Retrieve events associated with a specific account address and event type.
|
|
9565
|
+
*
|
|
9566
|
+
* @param args.accountAddress - The account address to query events for.
|
|
9567
|
+
* @param args.eventType - The type of event to filter by.
|
|
9568
|
+
* @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.
|
|
9569
|
+
* @param args.options - Optional pagination and ordering parameters for the event query.
|
|
9570
|
+
*
|
|
9571
|
+
* @returns Promise<GetEventsResponse>
|
|
9572
|
+
*
|
|
9573
|
+
* @example
|
|
9574
|
+
* ```typescript
|
|
9575
|
+
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
9576
|
+
*
|
|
9577
|
+
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
9578
|
+
* const aptos = new Aptos(config);
|
|
9579
|
+
*
|
|
9580
|
+
* async function runExample() {
|
|
9581
|
+
* // Get events for a specific account and event type
|
|
9582
|
+
* const events = await aptos.getAccountEventsByEventType({
|
|
9583
|
+
* accountAddress: "0x1", // replace with a real account address
|
|
9584
|
+
* eventType: "0x1::transaction_fee::FeeStatement", // replace with a real event type
|
|
9585
|
+
* minimumLedgerVersion: 1, // optional, specify if needed
|
|
9586
|
+
* });
|
|
9587
|
+
*
|
|
9588
|
+
* console.log(events);
|
|
9589
|
+
* }
|
|
9590
|
+
* runExample().catch(console.error);
|
|
9591
|
+
* ```
|
|
9592
|
+
* @group Event
|
|
9593
|
+
*/
|
|
9594
|
+
getAccountEventsByEventType(args: {
|
|
9595
|
+
accountAddress: AccountAddressInput;
|
|
9596
|
+
eventType: MoveStructId;
|
|
9597
|
+
minimumLedgerVersion?: AnyNumber;
|
|
9598
|
+
options?: PaginationArgs & OrderByArg<GetEventsResponse[0]>;
|
|
9599
|
+
}): Promise<GetEventsResponse>;
|
|
9600
|
+
/**
|
|
9601
|
+
* Retrieve all events from the Aptos blockchain.
|
|
9602
|
+
* An optional `where` clause can be provided to filter the results based on specific criteria.
|
|
9603
|
+
*
|
|
9604
|
+
* @param args Optional parameters for the query.
|
|
9605
|
+
* @param args.minimumLedgerVersion Optional ledger version to sync up to before querying.
|
|
9606
|
+
* @param args.options Optional pagination and filtering options.
|
|
9607
|
+
* @param args.options.where Optional condition to filter events.
|
|
9608
|
+
* @param args.options.offset Optional pagination offset.
|
|
9609
|
+
* @param args.options.limit Optional maximum number of events to return.
|
|
9610
|
+
* @param args.options.orderBy Optional ordering of the results.
|
|
9611
|
+
*
|
|
9612
|
+
* @returns GetEventsQuery response type containing the events.
|
|
9613
|
+
*
|
|
9614
|
+
* @example
|
|
9615
|
+
* ```typescript
|
|
9616
|
+
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
9617
|
+
*
|
|
9618
|
+
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
9619
|
+
* const aptos = new Aptos(config);
|
|
9620
|
+
*
|
|
9621
|
+
* async function runExample() {
|
|
9622
|
+
* // Retrieve all events
|
|
9623
|
+
* const events = await aptos.getEvents();
|
|
9624
|
+
*
|
|
9625
|
+
* // Retrieve events with filtering by account address
|
|
9626
|
+
* const whereCondition = {
|
|
9627
|
+
* account_address: { _eq: "0x123" }, // replace with a real account address
|
|
9628
|
+
* };
|
|
9629
|
+
* const filteredEvents = await aptos.getEvents({
|
|
9630
|
+
* options: { where: whereCondition },
|
|
9631
|
+
* });
|
|
9632
|
+
*
|
|
9633
|
+
* console.log(events);
|
|
9634
|
+
* console.log(filteredEvents);
|
|
9635
|
+
* }
|
|
9636
|
+
* runExample().catch(console.error);
|
|
9637
|
+
* ```
|
|
9638
|
+
* @group Event
|
|
9639
|
+
*/
|
|
9640
|
+
getEvents(args?: {
|
|
9641
|
+
minimumLedgerVersion?: AnyNumber;
|
|
9642
|
+
options?: PaginationArgs & OrderByArg<GetEventsResponse[0]> & WhereArg<EventsBoolExp>;
|
|
9643
|
+
}): Promise<GetEventsResponse>;
|
|
9439
9644
|
}
|
|
9645
|
+
|
|
9440
9646
|
/**
|
|
9441
|
-
*
|
|
9442
|
-
*
|
|
9443
|
-
*
|
|
9444
|
-
* This function can help you accurately interpret type strings, which can include simple types, standalone structs, and complex
|
|
9445
|
-
* nested generics.
|
|
9446
|
-
* It supports multiple generics, spacing within generics, and nested generics of varying depths.
|
|
9447
|
-
* All types are made of a few parts they're either:
|
|
9448
|
-
* 1. A simple type e.g. u8
|
|
9449
|
-
* 2. A standalone struct e.g. 0x1::account::Account
|
|
9450
|
-
* 3. A nested struct e.g. 0x1::coin::Coin<0x1234::coin::MyCoin>
|
|
9451
|
-
*
|
|
9452
|
-
* There are a few more special cases that need to be handled, however.
|
|
9453
|
-
* 1. Multiple generics e.g. 0x1::pair::Pair<u8, u16>
|
|
9454
|
-
* 2. Spacing in the generics e.g. 0x1::pair::Pair< u8 , u16>
|
|
9455
|
-
* 3. Nested generics of different depths e.g. 0x1::pair::Pair<0x1::coin::Coin<0x1234::coin::MyCoin>, u8>
|
|
9456
|
-
* 4. Generics for types in ABIs are filled in with placeholders e.g. T1, T2, T3
|
|
9457
|
-
* @param typeStr - The string representation of the type to be parsed.
|
|
9458
|
-
* @param options - Optional settings for parsing behavior.
|
|
9459
|
-
* @param options.allowGenerics - A flag indicating whether to allow generics in the parsing process.
|
|
9460
|
-
* @returns The parsed type tag representation.
|
|
9461
|
-
* @throws TypeTagParserError if the type string is malformed or does not conform to expected formats.
|
|
9462
|
-
* @group Implementation
|
|
9463
|
-
* @category Transactions
|
|
9647
|
+
* A class to query all `Faucet` related queries on Aptos.
|
|
9648
|
+
* @group Faucet
|
|
9464
9649
|
*/
|
|
9465
|
-
declare
|
|
9466
|
-
|
|
9467
|
-
|
|
9468
|
-
|
|
9469
|
-
|
|
9470
|
-
|
|
9471
|
-
|
|
9472
|
-
|
|
9473
|
-
|
|
9474
|
-
|
|
9475
|
-
|
|
9476
|
-
|
|
9650
|
+
declare class Faucet {
|
|
9651
|
+
readonly config: AptosConfig;
|
|
9652
|
+
/**
|
|
9653
|
+
* Initializes a new instance of the Aptos client with the specified configuration.
|
|
9654
|
+
*
|
|
9655
|
+
* Note that only devnet has a publicly accessible faucet. For testnet, you must use
|
|
9656
|
+
* the minting page at https://aptos.dev/network/faucet.
|
|
9657
|
+
*
|
|
9658
|
+
* @param config - The configuration settings for the Aptos client.
|
|
9659
|
+
*
|
|
9660
|
+
* @example
|
|
9661
|
+
* ```typescript
|
|
9662
|
+
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
9663
|
+
*
|
|
9664
|
+
* async function runExample() {
|
|
9665
|
+
* // Create a configuration for the Aptos client
|
|
9666
|
+
* const config = new AptosConfig({ network: Network.DEVNET }); // specify your own network if needed
|
|
9667
|
+
*
|
|
9668
|
+
* // Initialize the Aptos client with the configuration
|
|
9669
|
+
* const aptos = new Aptos(config);
|
|
9670
|
+
*
|
|
9671
|
+
* console.log("Aptos client initialized:", aptos);
|
|
9672
|
+
* }
|
|
9673
|
+
* runExample().catch(console.error);
|
|
9674
|
+
* ```
|
|
9675
|
+
* @group Faucet
|
|
9676
|
+
*/
|
|
9677
|
+
constructor(config: AptosConfig);
|
|
9678
|
+
/**
|
|
9679
|
+
* This function creates an account if it does not exist and mints the specified amount of coins into that account.
|
|
9680
|
+
*
|
|
9681
|
+
* Note that only devnet has a publicly accessible faucet. For testnet, you must use
|
|
9682
|
+
* the minting page at https://aptos.dev/network/faucet.
|
|
9683
|
+
*
|
|
9684
|
+
* @param args - The arguments for funding the account.
|
|
9685
|
+
* @param args.accountAddress - The address of the account to fund.
|
|
9686
|
+
* @param args.amount - The amount of tokens to fund the account with.
|
|
9687
|
+
* @param args.options - Configuration options for waiting for the transaction.
|
|
9688
|
+
* @returns Transaction hash of the transaction that funded the account.
|
|
9689
|
+
*
|
|
9690
|
+
* @example
|
|
9691
|
+
* ```typescript
|
|
9692
|
+
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
9693
|
+
*
|
|
9694
|
+
* const config = new AptosConfig({ network: Network.DEVNET });
|
|
9695
|
+
* const aptos = new Aptos(config);
|
|
9696
|
+
*
|
|
9697
|
+
* async function runExample() {
|
|
9698
|
+
* // Fund an account with a specified amount of tokens
|
|
9699
|
+
* const transaction = await aptos.fundAccount({
|
|
9700
|
+
* accountAddress: "0x1", // replace with your account address
|
|
9701
|
+
* amount: 100,
|
|
9702
|
+
* });
|
|
9703
|
+
*
|
|
9704
|
+
* console.log("Transaction hash:", transaction.hash);
|
|
9705
|
+
* }
|
|
9706
|
+
* runExample().catch(console.error);
|
|
9707
|
+
* ```
|
|
9708
|
+
* @group Faucet
|
|
9709
|
+
*/
|
|
9710
|
+
fundAccount(args: {
|
|
9711
|
+
accountAddress: AccountAddressInput;
|
|
9712
|
+
amount: number;
|
|
9713
|
+
options?: WaitForTransactionOptions;
|
|
9714
|
+
}): Promise<UserTransactionResponse>;
|
|
9477
9715
|
}
|
|
9478
9716
|
|
|
9479
9717
|
/**
|
|
@@ -12947,6 +13185,22 @@ declare const isEncodedStruct: (structObj: any) => structObj is {
|
|
|
12947
13185
|
module_name: string;
|
|
12948
13186
|
struct_name: string;
|
|
12949
13187
|
};
|
|
13188
|
+
/**
|
|
13189
|
+
* Splits a function identifier into its constituent parts: module address, module name, and function name.
|
|
13190
|
+
* This function helps in validating and extracting details from a function identifier string.
|
|
13191
|
+
*
|
|
13192
|
+
* @param functionArg - The function identifier string in the format "moduleAddress::moduleName::functionName".
|
|
13193
|
+
* @returns An object containing the module address, module name, and function name.
|
|
13194
|
+
* @throws Error if the function identifier does not contain exactly three parts.
|
|
13195
|
+
* @group Implementation
|
|
13196
|
+
* @category Transactions
|
|
13197
|
+
*/
|
|
13198
|
+
declare function getFunctionParts(functionArg: MoveFunctionId): {
|
|
13199
|
+
moduleAddress: string;
|
|
13200
|
+
moduleName: string;
|
|
13201
|
+
functionName: string;
|
|
13202
|
+
};
|
|
13203
|
+
declare function isValidFunctionInfo(functionInfo: string): boolean;
|
|
12950
13204
|
|
|
12951
13205
|
/**
|
|
12952
13206
|
* Sends a request using the specified options and returns the response.
|
|
@@ -13359,4 +13613,4 @@ declare class AptosApiError extends Error {
|
|
|
13359
13613
|
constructor({ apiType, aptosRequest, aptosResponse }: AptosApiErrorOpts);
|
|
13360
13614
|
}
|
|
13361
13615
|
|
|
13362
|
-
export { APTOS_BIP44_REGEX, APTOS_COIN, APTOS_FA, APTOS_HARDENED_REGEX, AbstractKeylessAccount, Account$1 as Account, AccountAddress, AccountAddressInput, AccountAuthenticator, AccountAuthenticatorEd25519, AccountAuthenticatorMultiEd25519, AccountAuthenticatorMultiKey, AccountAuthenticatorNoAccountAuthenticator, AccountAuthenticatorSingleKey, AccountData, AccountPublicKey, AccountSequenceNumber, AccountUtils, AnyNumber, AnyPublicKey, AnyPublicKeyVariant, type AnyRawTransaction, type AnyRawTransactionInstance, AnySignature, type AnyTransactionPayloadInstance, Aptos, AptosApiError, AptosApiType, AptosConfig, AptosRequest, AptosResponse, AptosScriptComposer, AptosSettings, AuthenticationKey, AuthenticationKeyScheme, Block, Bool, CKDPriv, ChainId, Client, ClientConfig, ClientRequest, ClientResponse, CommittedTransactionResponse, type CreateAccountFromPrivateKeyArgs, type CreateEd25519AccountFromPrivateKeyArgs, type CreateEd25519SingleKeyAccountFromPrivateKeyArgs, type CreateSingleKeyAccountFromPrivateKeyArgs, DEFAULT_MAX_GAS_AMOUNT, DEFAULT_TXN_EXP_SEC_FROM_NOW, DEFAULT_TXN_TIMEOUT_SEC, type DerivedKeys, Deserializable, type DeserializableClass, Deserializer, EPK_HORIZON_SECS, Ed25519Account, Ed25519PrivateKey, Ed25519PublicKey, Ed25519Signature, type Ed25519SignerConstructorArgs, type Ed25519SignerFromDerivationPathArgs, EntryFunction, type EntryFunctionABI, EntryFunctionArgument, type EntryFunctionArgumentTypes, EntryFunctionBytes, EphemeralCertificate, EphemeralCertificateVariant, EphemeralKeyPair, EphemeralPublicKey, EphemeralPublicKeyVariant, EphemeralSignature, type ExecutionFinishEventData, FIREBASE_AUTH_ISS_PATTERN, type FailureEventData, FaucetConfig, FederatedKeylessAccount, FederatedKeylessPublicKey, FeePayerRawTransaction, FixedBytes, FullNodeConfig, type FunctionABI, GasEstimation, type GenerateAccountArgs, type GenerateEd25519AccountArgs, type GenerateEd25519SingleKeyAccountArgs, type GenerateSingleKeyAccountArgs, GetANSNameResponse, GetAccountCoinsDataResponse, GetAccountCollectionsWithOwnedTokenResponse, GetAccountOwnedTokensFromCollectionResponse, GetAccountOwnedTokensQueryResponse, type GetAptosRequestOptions, GetChainTopUserTransactionsResponse, GetCollectionDataResponse, GetCurrentFungibleAssetBalancesResponse, GetCurrentTokenOwnershipResponse, GetDelegatedStakingActivitiesResponse, GetEventsResponse, GetFungibleAssetActivitiesResponse, GetFungibleAssetMetadataResponse, GetNumberOfDelegatorsResponse, GetObjectDataQueryResponse, GetOwnedTokensResponse, GetProcessorStatusResponse, type GetRequestOptions, GetTableItemsDataResponse, GetTableItemsMetadataResponse, GetTokenActivityResponse, GetTokenDataResponse, GraphqlQuery, Groth16VerificationKey, Groth16Zkp, HARDENED_OFFSET, Hex, HexInput, Identifier, IndexerConfig, type InputBatchedFunctionData, type InputEntryFunctionData, type InputEntryFunctionDataWithABI, type InputEntryFunctionDataWithRemoteABI, type InputGenerateMultiAgentRawTransactionArgs, type InputGenerateMultiAgentRawTransactionData, type InputGenerateRawTransactionArgs, type InputGenerateSingleSignerRawTransactionArgs, type InputGenerateSingleSignerRawTransactionData, type InputGenerateTransactionData, type InputGenerateTransactionOptions, type InputGenerateTransactionPayloadData, type InputGenerateTransactionPayloadDataWithABI, type InputGenerateTransactionPayloadDataWithRemoteABI, type InputMultiSigData, type InputMultiSigDataWithABI, type InputMultiSigDataWithRemoteABI, type InputScriptData, type InputSimulateTransactionData, type InputSimulateTransactionOptions, type InputSubmitTransactionData, type InputViewFunctionData, type InputViewFunctionDataWithABI, type InputViewFunctionDataWithRemoteABI, type InputViewFunctionJsonData, KeyType, KeylessAccount, KeylessConfiguration, KeylessError, KeylessErrorCategory, KeylessErrorResolutionTip, KeylessErrorType, KeylessPublicKey, KeylessSignature, type KeylessSigner, LedgerInfo, LedgerVersionArg, MAX_AUD_VAL_BYTES, MAX_COMMITED_EPK_BYTES, MAX_EXTRA_FIELD_BYTES, MAX_ISS_VAL_BYTES, MAX_JWT_HEADER_B64_BYTES, MAX_UID_KEY_BYTES, MAX_UID_VAL_BYTES, MimeType, ModuleId, MoveFunction, MoveFunctionGenericTypeParam, MoveFunctionId, MoveJWK, MoveModuleBytecode, MoveModuleId, MoveOption, MoveResource, MoveString, MoveStructId, MoveValue, MoveVector, MultiAgentRawTransaction, MultiAgentTransaction, MultiEd25519PublicKey, MultiEd25519Signature, MultiKey, MultiKeyAccount, MultiKeySignature, MultiSig, MultiSigTransactionPayload, Network, OrderByArg, PaginationArgs, PendingTransactionResponse, type PostAptosRequestOptions, type PostRequestOptions, PrivateKey, type PrivateKeyFromDerivationPathArgs, type PrivateKeyInput, PrivateKeyVariants, ProcessorType, type ProofFetchCallback, type ProofFetchEvents, type ProofFetchFailure, type ProofFetchStatus, type ProofFetchSuccess, PublicKey, RAW_TRANSACTION_SALT, RAW_TRANSACTION_WITH_DATA_SALT, RawTransaction, RawTransactionWithData, RotationProofChallenge, Script, ScriptFunctionArgument, type ScriptFunctionArgumentTypes, Secp256k1PrivateKey, Secp256k1PublicKey, Secp256k1Signature, Serializable, Serialized, Serializer, Signature, SignedTransaction, SigningScheme, SigningSchemeInput, type SimpleEntryFunctionArgumentTypes, SimpleTransaction, SingleKeyAccount, type SingleKeySigner, type SingleKeySignerConstructorArgs, type SingleKeySignerFromDerivationPathArgs, type SingleKeySignerGenerateArgs, type SingleKeySignerOrLegacyEd25519Account, StructTag, type SuccessEventData, TableItemRequest, TokenStandardArg, TransactionAndProof, TransactionArgument, TransactionAuthenticator, TransactionAuthenticatorEd25519, TransactionAuthenticatorFeePayer, TransactionAuthenticatorMultiAgent, TransactionAuthenticatorMultiEd25519, TransactionAuthenticatorSingleSender, TransactionPayload, TransactionPayloadEntryFunction, TransactionPayloadMultiSig, TransactionPayloadScript, TransactionResponse, TransactionWorker, type TransactionWorkerEvents, TransactionWorkerEventsEnum, type TypeArgument, TypeTag, TypeTagAddress, TypeTagBool, TypeTagGeneric, TypeTagParserError, TypeTagParserErrorType, TypeTagReference, TypeTagSigner, TypeTagStruct, TypeTagU128, TypeTagU16, TypeTagU256, TypeTagU32, TypeTagU64, TypeTagU8, TypeTagVector, U128, U16, U256, U32, U64, U8, Uint16, Uint32, Uint8, UserTransactionResponse, type VerifyEd25519SignatureArgs, type VerifyMultiKeySignatureArgs, type VerifySignatureArgs, type VerifySingleKeySignatureArgs, type ViewFunctionABI, type ViewFunctionJsonPayload, WaitForTransactionOptions, WhereArg, ZeroKnowledgeSig, ZkProof, ZkpVariant, aptosCoinStructTag, aptosRequest, base64UrlDecode, bigIntToBytesLE, buildTransaction, bytesToBigIntLE, checkOrConvertArgument, convertAmountFromHumanReadableToOnChain, convertAmountFromOnChainToHumanReadable, convertArgument, convertCallArgument, convertNumber, createObjectAddress, createResourceAddress, createTokenAddress, deriveKey, deriveTransactionType, deserializeFromScriptArgument, fetchEntryFunctionAbi, fetchFunctionAbi, fetchMoveFunctionAbi, fetchViewFunctionAbi, findFirstNonSignerArg, floorToWholeHour, generateRawTransaction, generateSignedTransaction, generateSignedTransactionForSimulation, generateSigningMessage, generateSigningMessageForSerializable, generateSigningMessageForTransaction, generateTransactionPayload, generateTransactionPayloadWithABI, generateUserTransactionHash, generateViewFunctionPayload, generateViewFunctionPayloadWithABI, get, getAptosFullNode, getAptosPepperService, getAuthenticatorForSimulation, getErrorMessage, getFunctionParts, getIssAudAndUidVal, getKeylessConfig, getKeylessJWKs, hashStrToField, hashValues, isBcsAddress, isBcsBool, isBcsFixedBytes, isBcsString, isBcsU128, isBcsU16, isBcsU256, isBcsU32, isBcsU64, isBcsU8, isBool, isCanonicalEd25519Signature, isEmptyOption, isEncodedEntryFunctionArgument, isEncodedStruct, isKeylessSigner, isLargeNumber, isNumber, isScriptDataInput, isSingleKeySigner, isString, isValidBIP44Path, isValidHardenedPath, mnemonicToSeed, normalizeBundle, nowInSeconds, objectStructTag, optionStructTag, padAndPackBytesWithLen, paginateWithCursor, paginateWithObfuscatedCursor, parseEncodedStruct, parseJwtHeader, parseTypeTag, poseidonHash, post, postAptosFaucet, postAptosFullNode, postAptosIndexer, postAptosPepperService, postAptosProvingService, promiseFulfilledStatus, request, sleep, splitPath, standardizeTypeTags, stringStructTag, throwTypeMismatch };
|
|
13616
|
+
export { APTOS_BIP44_REGEX, APTOS_COIN, APTOS_FA, APTOS_HARDENED_REGEX, AbstractKeylessAccount, AbstractedAccount, Account$1 as Account, AccountAddress, AccountAddressInput, AccountAuthenticator, AccountAuthenticatorAbstraction, AccountAuthenticatorEd25519, AccountAuthenticatorMultiEd25519, AccountAuthenticatorMultiKey, AccountAuthenticatorNoAccountAuthenticator, AccountAuthenticatorSingleKey, AccountData, AccountPublicKey, AccountSequenceNumber, AccountUtils, AnyNumber, AnyPublicKey, AnyPublicKeyVariant, type AnyRawTransaction, type AnyRawTransactionInstance, AnySignature, type AnyTransactionPayloadInstance, Aptos, AptosApiError, AptosApiType, AptosConfig, AptosRequest, AptosResponse, AptosScriptComposer, AptosSettings, AuthenticationKey, AuthenticationKeyScheme, Block, Bool, CKDPriv, ChainId, Client, ClientConfig, ClientRequest, ClientResponse, CommittedTransactionResponse, type CreateAccountFromPrivateKeyArgs, type CreateEd25519AccountFromPrivateKeyArgs, type CreateEd25519SingleKeyAccountFromPrivateKeyArgs, type CreateSingleKeyAccountFromPrivateKeyArgs, DEFAULT_MAX_GAS_AMOUNT, DEFAULT_TXN_EXP_SEC_FROM_NOW, DEFAULT_TXN_TIMEOUT_SEC, type DerivedKeys, Deserializable, type DeserializableClass, Deserializer, EPK_HORIZON_SECS, Ed25519Account, Ed25519PrivateKey, Ed25519PublicKey, Ed25519Signature, type Ed25519SignerConstructorArgs, type Ed25519SignerFromDerivationPathArgs, EntryFunction, type EntryFunctionABI, EntryFunctionArgument, type EntryFunctionArgumentTypes, EntryFunctionBytes, EphemeralCertificate, EphemeralCertificateVariant, EphemeralKeyPair, EphemeralPublicKey, EphemeralPublicKeyVariant, EphemeralSignature, type ExecutionFinishEventData, FIREBASE_AUTH_ISS_PATTERN, type FailureEventData, FaucetConfig, FederatedKeylessAccount, FederatedKeylessPublicKey, FeePayerRawTransaction, FixedBytes, FullNodeConfig, type FunctionABI, GasEstimation, type GenerateAccountArgs, type GenerateEd25519AccountArgs, type GenerateEd25519SingleKeyAccountArgs, type GenerateSingleKeyAccountArgs, GetANSNameResponse, GetAccountCoinsDataResponse, GetAccountCollectionsWithOwnedTokenResponse, GetAccountOwnedTokensFromCollectionResponse, GetAccountOwnedTokensQueryResponse, type GetAptosRequestOptions, GetChainTopUserTransactionsResponse, GetCollectionDataResponse, GetCurrentFungibleAssetBalancesResponse, GetCurrentTokenOwnershipResponse, GetDelegatedStakingActivitiesResponse, GetEventsResponse, GetFungibleAssetActivitiesResponse, GetFungibleAssetMetadataResponse, GetNumberOfDelegatorsResponse, GetObjectDataQueryResponse, GetOwnedTokensResponse, GetProcessorStatusResponse, type GetRequestOptions, GetTableItemsDataResponse, GetTableItemsMetadataResponse, GetTokenActivityResponse, GetTokenDataResponse, GraphqlQuery, Groth16VerificationKey, Groth16Zkp, HARDENED_OFFSET, Hex, HexInput, Identifier, IndexerConfig, type InputBatchedFunctionData, type InputEntryFunctionData, type InputEntryFunctionDataWithABI, type InputEntryFunctionDataWithRemoteABI, type InputGenerateMultiAgentRawTransactionArgs, type InputGenerateMultiAgentRawTransactionData, type InputGenerateRawTransactionArgs, type InputGenerateSingleSignerRawTransactionArgs, type InputGenerateSingleSignerRawTransactionData, type InputGenerateTransactionData, type InputGenerateTransactionOptions, type InputGenerateTransactionPayloadData, type InputGenerateTransactionPayloadDataWithABI, type InputGenerateTransactionPayloadDataWithRemoteABI, type InputMultiSigData, type InputMultiSigDataWithABI, type InputMultiSigDataWithRemoteABI, type InputScriptData, type InputSimulateTransactionData, type InputSimulateTransactionOptions, type InputSubmitTransactionData, type InputViewFunctionData, type InputViewFunctionDataWithABI, type InputViewFunctionDataWithRemoteABI, type InputViewFunctionJsonData, KeyType, KeylessAccount, KeylessConfiguration, KeylessError, KeylessErrorCategory, KeylessErrorResolutionTip, KeylessErrorType, KeylessPublicKey, KeylessSignature, type KeylessSigner, LedgerInfo, LedgerVersionArg, MAX_AUD_VAL_BYTES, MAX_COMMITED_EPK_BYTES, MAX_EXTRA_FIELD_BYTES, MAX_ISS_VAL_BYTES, MAX_JWT_HEADER_B64_BYTES, MAX_UID_KEY_BYTES, MAX_UID_VAL_BYTES, MimeType, ModuleId, MoveFunction, MoveFunctionGenericTypeParam, MoveFunctionId, MoveJWK, MoveModuleBytecode, MoveModuleId, MoveOption, MoveResource, MoveString, MoveStructId, MoveValue, MoveVector, MultiAgentRawTransaction, MultiAgentTransaction, MultiEd25519PublicKey, MultiEd25519Signature, MultiKey, MultiKeyAccount, MultiKeySignature, MultiSig, MultiSigTransactionPayload, Network, OrderByArg, PaginationArgs, PendingTransactionResponse, type PostAptosRequestOptions, type PostRequestOptions, PrivateKey, type PrivateKeyFromDerivationPathArgs, type PrivateKeyInput, PrivateKeyVariants, ProcessorType, type ProofFetchCallback, type ProofFetchEvents, type ProofFetchFailure, type ProofFetchStatus, type ProofFetchSuccess, PublicKey, RAW_TRANSACTION_SALT, RAW_TRANSACTION_WITH_DATA_SALT, RawTransaction, RawTransactionWithData, RotationProofChallenge, Script, ScriptFunctionArgument, type ScriptFunctionArgumentTypes, Secp256k1PrivateKey, Secp256k1PublicKey, Secp256k1Signature, Serializable, Serialized, Serializer, Signature, SignedTransaction, SigningScheme, SigningSchemeInput, type SimpleEntryFunctionArgumentTypes, SimpleTransaction, SingleKeyAccount, type SingleKeySigner, type SingleKeySignerConstructorArgs, type SingleKeySignerFromDerivationPathArgs, type SingleKeySignerGenerateArgs, type SingleKeySignerOrLegacyEd25519Account, StructTag, type SuccessEventData, TableItemRequest, TokenStandardArg, TransactionAndProof, TransactionArgument, TransactionAuthenticator, TransactionAuthenticatorEd25519, TransactionAuthenticatorFeePayer, TransactionAuthenticatorMultiAgent, TransactionAuthenticatorMultiEd25519, TransactionAuthenticatorSingleSender, TransactionPayload, TransactionPayloadEntryFunction, TransactionPayloadMultiSig, TransactionPayloadScript, TransactionResponse, TransactionWorker, type TransactionWorkerEvents, TransactionWorkerEventsEnum, type TypeArgument, TypeTag, TypeTagAddress, TypeTagBool, TypeTagGeneric, TypeTagParserError, TypeTagParserErrorType, TypeTagReference, TypeTagSigner, TypeTagStruct, TypeTagU128, TypeTagU16, TypeTagU256, TypeTagU32, TypeTagU64, TypeTagU8, TypeTagVector, U128, U16, U256, U32, U64, U8, Uint16, Uint32, Uint8, UserTransactionResponse, type VerifyEd25519SignatureArgs, type VerifyMultiKeySignatureArgs, type VerifySignatureArgs, type VerifySingleKeySignatureArgs, type ViewFunctionABI, type ViewFunctionJsonPayload, WaitForTransactionOptions, WhereArg, ZeroKnowledgeSig, ZkProof, ZkpVariant, aptosCoinStructTag, aptosRequest, base64UrlDecode, bigIntToBytesLE, buildTransaction, bytesToBigIntLE, checkOrConvertArgument, convertAmountFromHumanReadableToOnChain, convertAmountFromOnChainToHumanReadable, convertArgument, convertCallArgument, convertNumber, createObjectAddress, createResourceAddress, createTokenAddress, deriveKey, deriveTransactionType, deserializeFromScriptArgument, fetchEntryFunctionAbi, fetchFunctionAbi, fetchMoveFunctionAbi, fetchViewFunctionAbi, findFirstNonSignerArg, floorToWholeHour, generateRawTransaction, generateSignedTransaction, generateSignedTransactionForSimulation, generateSigningMessage, generateSigningMessageForSerializable, generateSigningMessageForTransaction, generateTransactionPayload, generateTransactionPayloadWithABI, generateUserTransactionHash, generateViewFunctionPayload, generateViewFunctionPayloadWithABI, get, getAptosFullNode, getAptosPepperService, getAuthenticatorForSimulation, getErrorMessage, getFunctionParts, getIssAudAndUidVal, getKeylessConfig, getKeylessJWKs, hashStrToField, hashValues, isBcsAddress, isBcsBool, isBcsFixedBytes, isBcsString, isBcsU128, isBcsU16, isBcsU256, isBcsU32, isBcsU64, isBcsU8, isBool, isCanonicalEd25519Signature, isEmptyOption, isEncodedEntryFunctionArgument, isEncodedStruct, isKeylessSigner, isLargeNumber, isNumber, isScriptDataInput, isSingleKeySigner, isString, isValidBIP44Path, isValidFunctionInfo, isValidHardenedPath, mnemonicToSeed, normalizeBundle, nowInSeconds, objectStructTag, optionStructTag, padAndPackBytesWithLen, paginateWithCursor, paginateWithObfuscatedCursor, parseEncodedStruct, parseJwtHeader, parseTypeTag, poseidonHash, post, postAptosFaucet, postAptosFullNode, postAptosIndexer, postAptosPepperService, postAptosProvingService, promiseFulfilledStatus, request, sleep, splitPath, standardizeTypeTags, stringStructTag, throwTypeMismatch };
|