@aptos-labs/ts-sdk 1.19.0 → 1.21.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-Lv-GSihU.d.ts → accountAddress-NYtf3uZq.d.ts} +31 -20
- package/dist/common/cli/index.d.ts +86 -12
- package/dist/common/cli/index.js +1 -1
- package/dist/common/cli/index.js.map +1 -1
- package/dist/common/index.d.ts +117 -7
- package/dist/common/index.js +62 -51
- package/dist/common/index.js.map +1 -1
- package/dist/esm/account/Account.mjs +1 -1
- package/dist/esm/account/Ed25519Account.mjs +1 -1
- package/dist/esm/account/EphemeralKeyPair.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.mjs +1 -1
- package/dist/esm/api/account.d.mts +3 -3
- package/dist/esm/api/account.mjs +1 -1
- package/dist/esm/api/ans.mjs +1 -1
- package/dist/esm/api/aptos.d.mts +3 -1
- package/dist/esm/api/aptos.mjs +1 -1
- package/dist/esm/api/aptosConfig.mjs +1 -1
- package/dist/esm/api/coin.mjs +1 -1
- package/dist/esm/api/digitalAsset.d.mts +49 -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.d.mts +21 -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.mjs +1 -1
- package/dist/esm/api/object.d.mts +39 -0
- package/dist/esm/api/object.mjs +2 -0
- package/dist/esm/api/object.mjs.map +1 -0
- 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/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/{chunk-4ZM7V7HN.mjs → chunk-3DCHEXE3.mjs} +2 -2
- package/dist/esm/chunk-3NPBKAPF.mjs +2 -0
- package/dist/esm/chunk-3NPBKAPF.mjs.map +1 -0
- package/dist/esm/{chunk-3EDNV7KS.mjs → chunk-43IKKJ2Y.mjs} +2 -2
- package/dist/esm/{chunk-E2JEBCSY.mjs → chunk-463B3NF7.mjs} +2 -2
- package/dist/esm/{chunk-MUAV4P6C.mjs → chunk-4ARX2MGY.mjs} +2 -2
- package/dist/esm/chunk-4GNJJZ4R.mjs +2 -0
- package/dist/esm/chunk-4GNJJZ4R.mjs.map +1 -0
- package/dist/esm/chunk-4KYQ7N3N.mjs +2 -0
- package/dist/esm/{chunk-EAXCOIOP.mjs.map → chunk-4KYQ7N3N.mjs.map} +1 -1
- package/dist/esm/chunk-5M235PLS.mjs +2 -0
- package/dist/esm/chunk-5M235PLS.mjs.map +1 -0
- package/dist/esm/{chunk-MH6HIFMG.mjs → chunk-67BD7B6N.mjs} +2 -2
- package/dist/esm/chunk-6TRGVQLA.mjs +2 -0
- package/dist/esm/chunk-6TRGVQLA.mjs.map +1 -0
- package/dist/esm/{chunk-VRSZLJVR.mjs → chunk-7CMCN6LB.mjs} +2 -2
- package/dist/esm/{chunk-IOMJ5OWV.mjs → chunk-7HS4UJGE.mjs} +2 -2
- package/dist/esm/{chunk-HED6CPN2.mjs → chunk-7RVYF5OP.mjs} +2 -2
- package/dist/esm/{chunk-4EPLOSKY.mjs → chunk-7WFKAS7T.mjs} +2 -2
- package/dist/esm/{chunk-YXXEXFQH.mjs → chunk-7X6HZUXX.mjs} +2 -2
- package/dist/esm/{chunk-N5A4L6Z6.mjs → chunk-CUSKA6RZ.mjs} +2 -2
- package/dist/esm/{chunk-A2Z7I2EY.mjs → chunk-F6REP536.mjs} +2 -2
- package/dist/esm/{chunk-ILXK4OH5.mjs → chunk-GWH34VNI.mjs} +2 -2
- package/dist/esm/{chunk-JM7CSDJ3.mjs → chunk-H6CS3BD7.mjs} +2 -2
- package/dist/esm/{chunk-OKLLJQM4.mjs → chunk-H6QWMF3Q.mjs} +2 -2
- package/dist/esm/{chunk-7JUBWA7V.mjs → chunk-I2T6BJOA.mjs} +2 -2
- package/dist/esm/{chunk-GXLFQEPR.mjs → chunk-IN2L5ZAT.mjs} +2 -2
- package/dist/esm/{chunk-RUVDYKIZ.mjs → chunk-IPGKZUSA.mjs} +2 -2
- package/dist/esm/{chunk-KUAN2WZF.mjs → chunk-IPTCWBFV.mjs} +2 -2
- package/dist/esm/{chunk-ICE6OL3A.mjs → chunk-J5KAD2RM.mjs} +2 -2
- package/dist/esm/{chunk-3KZ7HFFA.mjs → chunk-J5YHMYHB.mjs} +2 -2
- package/dist/esm/{chunk-Y37TV7SM.mjs → chunk-JB5R6RGF.mjs} +2 -2
- package/dist/esm/{chunk-4U3MAEYH.mjs → chunk-KDIPFPMS.mjs} +2 -2
- package/dist/esm/chunk-L36ZHC7J.mjs +2 -0
- package/dist/esm/{chunk-YE5B2S5L.mjs.map → chunk-L36ZHC7J.mjs.map} +1 -1
- package/dist/esm/{chunk-GPZEPKKD.mjs → chunk-L6RINMT6.mjs} +2 -2
- package/dist/esm/{chunk-47M33ENP.mjs → chunk-LBKYNX5K.mjs} +2 -2
- package/dist/esm/{chunk-LWFSV3OA.mjs → chunk-LBU3LV7I.mjs} +2 -2
- package/dist/esm/{chunk-LLLINNAG.mjs → chunk-LTMOMXPN.mjs} +2 -2
- package/dist/esm/chunk-LTMOMXPN.mjs.map +1 -0
- package/dist/esm/{chunk-CAC7G2HC.mjs → chunk-NAGFCYG6.mjs} +2 -2
- package/dist/esm/{chunk-LAZTLEXF.mjs → chunk-NLJVP5RP.mjs} +2 -2
- package/dist/esm/{chunk-XSHUCBNT.mjs → chunk-O7XEE7QT.mjs} +2 -2
- package/dist/esm/{chunk-QTNKFKDE.mjs → chunk-OVG4SGPI.mjs} +2 -2
- package/dist/esm/{chunk-3JEL6FIZ.mjs → chunk-P43CXEO4.mjs} +2 -2
- package/dist/esm/chunk-PY23BQ2H.mjs +2 -0
- package/dist/esm/chunk-PY23BQ2H.mjs.map +1 -0
- package/dist/esm/{chunk-FGFQZQGX.mjs → chunk-Q7ZP25NJ.mjs} +2 -2
- package/dist/esm/chunk-S6H5Q2IK.mjs +2 -0
- package/dist/esm/chunk-S6H5Q2IK.mjs.map +1 -0
- package/dist/esm/chunk-S7G6VBUB.mjs +2 -0
- package/dist/esm/chunk-S7G6VBUB.mjs.map +1 -0
- package/dist/esm/{chunk-FD2VCIZG.mjs → chunk-SK2HTEP7.mjs} +2 -2
- package/dist/esm/{chunk-V5JJHVMP.mjs → chunk-SQQ2424E.mjs} +2 -2
- package/dist/esm/{chunk-64P5SB7N.mjs → chunk-T4NXIMZL.mjs} +2 -2
- package/dist/esm/{chunk-PS7L2TLP.mjs → chunk-T7YRD4PM.mjs} +2 -2
- package/dist/esm/{chunk-OLVNRYGT.mjs → chunk-TCEOTADF.mjs} +2 -2
- package/dist/esm/{chunk-BCY5UOGP.mjs → chunk-TWRYY6DD.mjs} +2 -2
- package/dist/esm/{chunk-VY2MJZWM.mjs → chunk-TZOKV22Z.mjs} +2 -2
- package/dist/esm/{chunk-K6NUFABY.mjs → chunk-UJYWEIQ2.mjs} +2 -2
- package/dist/esm/{chunk-HACVLK5I.mjs → chunk-UYF7AQLE.mjs} +2 -2
- package/dist/esm/{chunk-YF6UA3XW.mjs → chunk-V5COHBA4.mjs} +2 -2
- package/dist/esm/{chunk-BI5P5ASH.mjs → chunk-VEGT6ZPK.mjs} +2 -2
- package/dist/esm/{chunk-TFNJPJF6.mjs → chunk-VN2CRWOI.mjs} +2 -2
- package/dist/esm/{chunk-WUWJLSGN.mjs → chunk-VQPLSJEI.mjs} +2 -2
- package/dist/esm/{chunk-ZQUDGZIZ.mjs → chunk-W26LO3CR.mjs} +2 -2
- package/dist/esm/{chunk-HJT2Q5NL.mjs → chunk-XVWNPR4T.mjs} +2 -2
- package/dist/esm/{chunk-6ZQWPHLV.mjs → chunk-XWVMFCW3.mjs} +2 -2
- package/dist/esm/{chunk-GMHGYDZQ.mjs → chunk-Y2H7FG2P.mjs} +2 -2
- package/dist/esm/{chunk-HIHKTLLM.mjs → chunk-YMFEA2TJ.mjs} +55 -44
- package/dist/esm/chunk-YMFEA2TJ.mjs.map +1 -0
- package/dist/esm/chunk-Z4CGG42L.mjs +2 -0
- package/dist/esm/chunk-Z4CGG42L.mjs.map +1 -0
- package/dist/esm/chunk-ZL4JYTID.mjs +2 -0
- package/dist/esm/chunk-ZL4JYTID.mjs.map +1 -0
- package/dist/esm/cli/index.mjs +1 -1
- package/dist/esm/cli/move.d.mts +85 -11
- package/dist/esm/cli/move.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/crypto/ed25519.mjs +1 -1
- package/dist/esm/core/crypto/ephemeral.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/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/index.d.mts +3 -2
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/internal/account.d.mts +3 -3
- package/dist/esm/internal/account.mjs +1 -1
- package/dist/esm/internal/ans.mjs +1 -1
- package/dist/esm/internal/coin.mjs +1 -1
- package/dist/esm/internal/digitalAsset.d.mts +14 -4
- 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.d.mts +25 -0
- package/dist/esm/internal/object.mjs +2 -0
- package/dist/esm/internal/object.mjs.map +1 -0
- 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.d.mts +7 -2
- package/dist/esm/internal/view.mjs +1 -1
- package/dist/esm/transactions/authenticator/account.mjs +1 -1
- package/dist/esm/transactions/authenticator/index.mjs +1 -1
- package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
- package/dist/esm/transactions/index.d.mts +1 -1
- package/dist/esm/transactions/index.mjs +1 -1
- package/dist/esm/transactions/instances/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.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/transactionBuilder/helpers.mjs +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.mjs +1 -1
- package/dist/esm/transactions/typeTag/index.mjs +1 -1
- package/dist/esm/transactions/typeTag/parser.mjs +1 -1
- package/dist/esm/transactions/types.d.mts +18 -2
- package/dist/esm/types/generated/operations.d.mts +37 -26
- package/dist/esm/types/generated/queries.d.mts +5 -5
- package/dist/esm/types/generated/queries.mjs +1 -1
- package/dist/esm/types/generated/types.d.mts +227 -15
- package/dist/esm/types/generated/types.mjs +1 -1
- package/dist/esm/types/generated/types.mjs.map +1 -1
- package/dist/esm/types/index.d.mts +1 -1
- package/dist/esm/types/indexer.d.mts +3 -3
- package/dist/esm/utils/const.d.mts +2 -1
- package/dist/esm/utils/const.mjs +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/api/account.ts +3 -3
- package/src/api/aptos.ts +6 -0
- package/src/api/digitalAsset.ts +81 -1
- package/src/api/general.ts +25 -2
- package/src/api/object.ts +43 -0
- package/src/cli/move.ts +152 -13
- package/src/core/index.ts +1 -0
- package/src/internal/account.ts +7 -9
- package/src/internal/digitalAsset.ts +67 -24
- package/src/internal/event.ts +3 -21
- package/src/internal/object.ts +45 -0
- package/src/internal/queries/getCollectionData.graphql +19 -10
- package/src/internal/queries/{getAccountOwnedObjects.graphql → getObjectData.graphql} +1 -1
- package/src/internal/view.ts +27 -1
- package/src/transactions/types.ts +19 -1
- package/src/types/generated/operations.ts +37 -26
- package/src/types/generated/queries.ts +51 -40
- package/src/types/generated/types.ts +252 -14
- package/src/types/indexer.ts +2 -2
- package/src/utils/const.ts +1 -0
- package/src/version.ts +1 -1
- package/dist/esm/chunk-5Y3O7MLN.mjs +0 -2
- package/dist/esm/chunk-5Y3O7MLN.mjs.map +0 -1
- package/dist/esm/chunk-DCBXXRXS.mjs +0 -2
- package/dist/esm/chunk-DCBXXRXS.mjs.map +0 -1
- package/dist/esm/chunk-EAXCOIOP.mjs +0 -2
- package/dist/esm/chunk-FTA2ZMUX.mjs +0 -2
- package/dist/esm/chunk-FTA2ZMUX.mjs.map +0 -1
- package/dist/esm/chunk-GRZVD45M.mjs +0 -2
- package/dist/esm/chunk-GRZVD45M.mjs.map +0 -1
- package/dist/esm/chunk-HIHKTLLM.mjs.map +0 -1
- package/dist/esm/chunk-LLLINNAG.mjs.map +0 -1
- package/dist/esm/chunk-MKOIEX4B.mjs +0 -2
- package/dist/esm/chunk-MKOIEX4B.mjs.map +0 -1
- package/dist/esm/chunk-NBGXHLM4.mjs +0 -2
- package/dist/esm/chunk-NBGXHLM4.mjs.map +0 -1
- package/dist/esm/chunk-SYV4KFI7.mjs +0 -2
- package/dist/esm/chunk-SYV4KFI7.mjs.map +0 -1
- package/dist/esm/chunk-YE5B2S5L.mjs +0 -2
- /package/dist/esm/{chunk-4ZM7V7HN.mjs.map → chunk-3DCHEXE3.mjs.map} +0 -0
- /package/dist/esm/{chunk-3EDNV7KS.mjs.map → chunk-43IKKJ2Y.mjs.map} +0 -0
- /package/dist/esm/{chunk-E2JEBCSY.mjs.map → chunk-463B3NF7.mjs.map} +0 -0
- /package/dist/esm/{chunk-MUAV4P6C.mjs.map → chunk-4ARX2MGY.mjs.map} +0 -0
- /package/dist/esm/{chunk-MH6HIFMG.mjs.map → chunk-67BD7B6N.mjs.map} +0 -0
- /package/dist/esm/{chunk-VRSZLJVR.mjs.map → chunk-7CMCN6LB.mjs.map} +0 -0
- /package/dist/esm/{chunk-IOMJ5OWV.mjs.map → chunk-7HS4UJGE.mjs.map} +0 -0
- /package/dist/esm/{chunk-HED6CPN2.mjs.map → chunk-7RVYF5OP.mjs.map} +0 -0
- /package/dist/esm/{chunk-4EPLOSKY.mjs.map → chunk-7WFKAS7T.mjs.map} +0 -0
- /package/dist/esm/{chunk-YXXEXFQH.mjs.map → chunk-7X6HZUXX.mjs.map} +0 -0
- /package/dist/esm/{chunk-N5A4L6Z6.mjs.map → chunk-CUSKA6RZ.mjs.map} +0 -0
- /package/dist/esm/{chunk-A2Z7I2EY.mjs.map → chunk-F6REP536.mjs.map} +0 -0
- /package/dist/esm/{chunk-ILXK4OH5.mjs.map → chunk-GWH34VNI.mjs.map} +0 -0
- /package/dist/esm/{chunk-JM7CSDJ3.mjs.map → chunk-H6CS3BD7.mjs.map} +0 -0
- /package/dist/esm/{chunk-OKLLJQM4.mjs.map → chunk-H6QWMF3Q.mjs.map} +0 -0
- /package/dist/esm/{chunk-7JUBWA7V.mjs.map → chunk-I2T6BJOA.mjs.map} +0 -0
- /package/dist/esm/{chunk-GXLFQEPR.mjs.map → chunk-IN2L5ZAT.mjs.map} +0 -0
- /package/dist/esm/{chunk-RUVDYKIZ.mjs.map → chunk-IPGKZUSA.mjs.map} +0 -0
- /package/dist/esm/{chunk-KUAN2WZF.mjs.map → chunk-IPTCWBFV.mjs.map} +0 -0
- /package/dist/esm/{chunk-ICE6OL3A.mjs.map → chunk-J5KAD2RM.mjs.map} +0 -0
- /package/dist/esm/{chunk-3KZ7HFFA.mjs.map → chunk-J5YHMYHB.mjs.map} +0 -0
- /package/dist/esm/{chunk-Y37TV7SM.mjs.map → chunk-JB5R6RGF.mjs.map} +0 -0
- /package/dist/esm/{chunk-4U3MAEYH.mjs.map → chunk-KDIPFPMS.mjs.map} +0 -0
- /package/dist/esm/{chunk-GPZEPKKD.mjs.map → chunk-L6RINMT6.mjs.map} +0 -0
- /package/dist/esm/{chunk-47M33ENP.mjs.map → chunk-LBKYNX5K.mjs.map} +0 -0
- /package/dist/esm/{chunk-LWFSV3OA.mjs.map → chunk-LBU3LV7I.mjs.map} +0 -0
- /package/dist/esm/{chunk-CAC7G2HC.mjs.map → chunk-NAGFCYG6.mjs.map} +0 -0
- /package/dist/esm/{chunk-LAZTLEXF.mjs.map → chunk-NLJVP5RP.mjs.map} +0 -0
- /package/dist/esm/{chunk-XSHUCBNT.mjs.map → chunk-O7XEE7QT.mjs.map} +0 -0
- /package/dist/esm/{chunk-QTNKFKDE.mjs.map → chunk-OVG4SGPI.mjs.map} +0 -0
- /package/dist/esm/{chunk-3JEL6FIZ.mjs.map → chunk-P43CXEO4.mjs.map} +0 -0
- /package/dist/esm/{chunk-FGFQZQGX.mjs.map → chunk-Q7ZP25NJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-FD2VCIZG.mjs.map → chunk-SK2HTEP7.mjs.map} +0 -0
- /package/dist/esm/{chunk-V5JJHVMP.mjs.map → chunk-SQQ2424E.mjs.map} +0 -0
- /package/dist/esm/{chunk-64P5SB7N.mjs.map → chunk-T4NXIMZL.mjs.map} +0 -0
- /package/dist/esm/{chunk-PS7L2TLP.mjs.map → chunk-T7YRD4PM.mjs.map} +0 -0
- /package/dist/esm/{chunk-OLVNRYGT.mjs.map → chunk-TCEOTADF.mjs.map} +0 -0
- /package/dist/esm/{chunk-BCY5UOGP.mjs.map → chunk-TWRYY6DD.mjs.map} +0 -0
- /package/dist/esm/{chunk-VY2MJZWM.mjs.map → chunk-TZOKV22Z.mjs.map} +0 -0
- /package/dist/esm/{chunk-K6NUFABY.mjs.map → chunk-UJYWEIQ2.mjs.map} +0 -0
- /package/dist/esm/{chunk-HACVLK5I.mjs.map → chunk-UYF7AQLE.mjs.map} +0 -0
- /package/dist/esm/{chunk-YF6UA3XW.mjs.map → chunk-V5COHBA4.mjs.map} +0 -0
- /package/dist/esm/{chunk-BI5P5ASH.mjs.map → chunk-VEGT6ZPK.mjs.map} +0 -0
- /package/dist/esm/{chunk-TFNJPJF6.mjs.map → chunk-VN2CRWOI.mjs.map} +0 -0
- /package/dist/esm/{chunk-WUWJLSGN.mjs.map → chunk-VQPLSJEI.mjs.map} +0 -0
- /package/dist/esm/{chunk-ZQUDGZIZ.mjs.map → chunk-W26LO3CR.mjs.map} +0 -0
- /package/dist/esm/{chunk-HJT2Q5NL.mjs.map → chunk-XVWNPR4T.mjs.map} +0 -0
- /package/dist/esm/{chunk-6ZQWPHLV.mjs.map → chunk-XWVMFCW3.mjs.map} +0 -0
- /package/dist/esm/{chunk-GMHGYDZQ.mjs.map → chunk-Y2H7FG2P.mjs.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Network } from '../utils/apiEndpoints.mjs';
|
|
2
2
|
import { TokenStandard, OrderBy } from './indexer.mjs';
|
|
3
|
-
export { GetANSNameResponse, GetAccountCoinsDataResponse, GetAccountCollectionsWithOwnedTokenResponse,
|
|
3
|
+
export { GetANSNameResponse, GetAccountCoinsDataResponse, GetAccountCollectionsWithOwnedTokenResponse, GetAccountOwnedTokensFromCollectionResponse, GetAccountOwnedTokensQueryResponse, GetChainTopUserTransactionsResponse, GetCollectionDataResponse, GetCurrentFungibleAssetBalancesResponse, GetCurrentTokenOwnershipResponse, GetDelegatedStakingActivitiesResponse, GetEventsResponse, GetFungibleAssetActivitiesResponse, GetFungibleAssetMetadataResponse, GetNumberOfDelegatorsResponse, GetObjectDataQueryResponse, GetOwnedTokensResponse, GetProcessorStatusResponse, GetTableItemsDataResponse, GetTableItemsMetadataResponse, GetTokenActivityResponse, GetTokenDataResponse, GraphqlQuery, OrderByValue } from './indexer.mjs';
|
|
4
4
|
import './generated/operations.mjs';
|
|
5
5
|
import './generated/types.mjs';
|
|
6
6
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GetObjectDataQuery, GetAccountOwnedTokensQuery, GetAccountOwnedTokensFromCollectionQuery, GetAccountCollectionsWithOwnedTokensQuery, GetAccountCoinsDataQuery, GetChainTopUserTransactionsQuery, GetEventsQuery, GetNumberOfDelegatorsQuery, GetDelegatedStakingActivitiesQuery, GetCollectionDataQuery, GetTokenDataQuery, GetProcessorStatusQuery, GetFungibleAssetMetadataQuery, GetFungibleAssetActivitiesQuery, GetCurrentFungibleAssetBalancesQuery, GetTokenActivityQuery, GetCurrentTokenOwnershipQuery, GetTableItemsDataQuery, GetTableItemsMetadataQuery, GetNamesQuery } from './generated/operations.mjs';
|
|
2
2
|
import './generated/types.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -21,7 +21,7 @@ import './generated/types.mjs';
|
|
|
21
21
|
* These types are used as the return type when calling a sdk api function
|
|
22
22
|
* that calls the function that queries the server (usually under the /api/ folder)
|
|
23
23
|
*/
|
|
24
|
-
type
|
|
24
|
+
type GetObjectDataQueryResponse = GetObjectDataQuery["current_objects"];
|
|
25
25
|
type GetAccountOwnedTokensQueryResponse = GetAccountOwnedTokensQuery["current_token_ownerships_v2"];
|
|
26
26
|
type GetAccountOwnedTokensFromCollectionResponse = GetAccountOwnedTokensFromCollectionQuery["current_token_ownerships_v2"];
|
|
27
27
|
type GetAccountCollectionsWithOwnedTokenResponse = GetAccountCollectionsWithOwnedTokensQuery["current_collection_ownership_v2_view"];
|
|
@@ -62,4 +62,4 @@ type GraphqlQuery = {
|
|
|
62
62
|
variables?: {};
|
|
63
63
|
};
|
|
64
64
|
|
|
65
|
-
export type { GetANSNameResponse, GetAccountCoinsDataResponse, GetAccountCollectionsWithOwnedTokenResponse,
|
|
65
|
+
export type { GetANSNameResponse, GetAccountCoinsDataResponse, GetAccountCollectionsWithOwnedTokenResponse, GetAccountOwnedTokensFromCollectionResponse, GetAccountOwnedTokensQueryResponse, GetChainTopUserTransactionsResponse, GetCollectionDataResponse, GetCurrentFungibleAssetBalancesResponse, GetCurrentTokenOwnershipResponse, GetDelegatedStakingActivitiesResponse, GetEventsResponse, GetFungibleAssetActivitiesResponse, GetFungibleAssetMetadataResponse, GetNumberOfDelegatorsResponse, GetObjectDataQueryResponse, GetOwnedTokensResponse, GetProcessorStatusResponse, GetTableItemsDataResponse, GetTableItemsMetadataResponse, GetTokenActivityResponse, GetTokenDataResponse, GraphqlQuery, OrderBy, OrderByValue, TokenStandard };
|
|
@@ -52,7 +52,8 @@ declare enum ProcessorType {
|
|
|
52
52
|
FUNGIBLE_ASSET_PROCESSOR = "fungible_asset_processor",
|
|
53
53
|
STAKE_PROCESSOR = "stake_processor",
|
|
54
54
|
TOKEN_V2_PROCESSOR = "token_v2_processor",
|
|
55
|
-
USER_TRANSACTION_PROCESSOR = "user_transaction_processor"
|
|
55
|
+
USER_TRANSACTION_PROCESSOR = "user_transaction_processor",
|
|
56
|
+
OBJECT_PROCESSOR = "objects_processor"
|
|
56
57
|
}
|
|
57
58
|
|
|
58
59
|
export { APTOS_COIN, AptosApiType, DEFAULT_MAX_GAS_AMOUNT, DEFAULT_TXN_EXP_SEC_FROM_NOW, DEFAULT_TXN_TIMEOUT_SEC, ProcessorType, RAW_TRANSACTION_SALT, RAW_TRANSACTION_WITH_DATA_SALT };
|
package/dist/esm/utils/const.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h}from"../chunk-
|
|
1
|
+
import{a,b,c,d,e,f,g,h}from"../chunk-L36ZHC7J.mjs";import"../chunk-FVA2OPG4.mjs";export{e as APTOS_COIN,a as AptosApiType,b as DEFAULT_MAX_GAS_AMOUNT,c as DEFAULT_TXN_EXP_SEC_FROM_NOW,d as DEFAULT_TXN_TIMEOUT_SEC,h as ProcessorType,f as RAW_TRANSACTION_SALT,g as RAW_TRANSACTION_WITH_DATA_SALT};
|
|
2
2
|
//# sourceMappingURL=const.mjs.map
|
package/dist/esm/utils/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-GED6IT3S.mjs";import{a as q}from"../chunk-WV5AD4IE.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-P5V7OZNN.mjs";import"../chunk-H6YNXJNF.mjs";import"../chunk-KMJ6TF6Y.mjs";import"../chunk-YPHH6CAO.mjs";import"../chunk-
|
|
1
|
+
import"../chunk-GED6IT3S.mjs";import{a as q}from"../chunk-WV5AD4IE.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-P5V7OZNN.mjs";import"../chunk-H6YNXJNF.mjs";import"../chunk-KMJ6TF6Y.mjs";import"../chunk-YPHH6CAO.mjs";import"../chunk-DZXM2MQY.mjs";import"../chunk-Q6LFIZ3L.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-A63SMUOU.mjs";import"../chunk-BCUSI3N6.mjs";import"../chunk-LG7RJQ57.mjs";import"../chunk-56CNRT2K.mjs";import{a as i,b as j,c as k,d as l,e as m,f as n,g as o,h as p}from"../chunk-L36ZHC7J.mjs";import{a,b,c,d,e,f,g,h}from"../chunk-SCHZ67F3.mjs";import"../chunk-FVA2OPG4.mjs";export{m as APTOS_COIN,i as AptosApiType,j as DEFAULT_MAX_GAS_AMOUNT,k as DEFAULT_TXN_EXP_SEC_FROM_NOW,l as DEFAULT_TXN_TIMEOUT_SEC,f as Network,g as NetworkToChainId,c as NetworkToFaucetAPI,a as NetworkToIndexerAPI,h as NetworkToNetworkName,b as NetworkToNodeAPI,d as NetworkToPepperAPI,e as NetworkToProverAPI,p as ProcessorType,n as RAW_TRANSACTION_SALT,o as RAW_TRANSACTION_WITH_DATA_SALT,q as normalizeBundle};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-WV5AD4IE.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-P5V7OZNN.mjs";import"../chunk-H6YNXJNF.mjs";import"../chunk-KMJ6TF6Y.mjs";import"../chunk-YPHH6CAO.mjs";import"../chunk-
|
|
1
|
+
import{a}from"../chunk-WV5AD4IE.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-P5V7OZNN.mjs";import"../chunk-H6YNXJNF.mjs";import"../chunk-KMJ6TF6Y.mjs";import"../chunk-YPHH6CAO.mjs";import"../chunk-DZXM2MQY.mjs";import"../chunk-Q6LFIZ3L.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-A63SMUOU.mjs";import"../chunk-BCUSI3N6.mjs";import"../chunk-LG7RJQ57.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-FVA2OPG4.mjs";export{a as normalizeBundle};
|
|
2
2
|
//# sourceMappingURL=normalizeBundle.mjs.map
|
package/dist/esm/version.d.mts
CHANGED
package/dist/esm/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-4KYQ7N3N.mjs";import"./chunk-FVA2OPG4.mjs";export{a as VERSION};
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|
package/package.json
CHANGED
package/src/api/account.ts
CHANGED
|
@@ -8,9 +8,9 @@ import {
|
|
|
8
8
|
AnyNumber,
|
|
9
9
|
GetAccountCoinsDataResponse,
|
|
10
10
|
GetAccountCollectionsWithOwnedTokenResponse,
|
|
11
|
-
GetAccountOwnedObjectsResponse,
|
|
12
11
|
GetAccountOwnedTokensFromCollectionResponse,
|
|
13
12
|
GetAccountOwnedTokensQueryResponse,
|
|
13
|
+
GetObjectDataQueryResponse,
|
|
14
14
|
LedgerVersionArg,
|
|
15
15
|
MoveModuleBytecode,
|
|
16
16
|
MoveResource,
|
|
@@ -471,8 +471,8 @@ export class Account {
|
|
|
471
471
|
async getAccountOwnedObjects(args: {
|
|
472
472
|
accountAddress: AccountAddressInput;
|
|
473
473
|
minimumLedgerVersion?: AnyNumber;
|
|
474
|
-
options?: PaginationArgs & OrderByArg<
|
|
475
|
-
}): Promise<
|
|
474
|
+
options?: PaginationArgs & OrderByArg<GetObjectDataQueryResponse[0]>;
|
|
475
|
+
}): Promise<GetObjectDataQueryResponse> {
|
|
476
476
|
await waitForIndexerOnVersion({
|
|
477
477
|
config: this.config,
|
|
478
478
|
minimumLedgerVersion: args.minimumLedgerVersion,
|
package/src/api/aptos.ts
CHANGED
|
@@ -14,6 +14,7 @@ import { Staking } from "./staking";
|
|
|
14
14
|
import { Transaction } from "./transaction";
|
|
15
15
|
import { Table } from "./table";
|
|
16
16
|
import { Keyless } from "./keyless";
|
|
17
|
+
import { AptosObject } from "./object";
|
|
17
18
|
|
|
18
19
|
/**
|
|
19
20
|
* This class is the main entry point into Aptos's
|
|
@@ -53,6 +54,8 @@ export class Aptos {
|
|
|
53
54
|
|
|
54
55
|
readonly keyless: Keyless;
|
|
55
56
|
|
|
57
|
+
readonly object: AptosObject;
|
|
58
|
+
|
|
56
59
|
constructor(settings?: AptosConfig) {
|
|
57
60
|
this.config = new AptosConfig(settings);
|
|
58
61
|
this.account = new Account(this.config);
|
|
@@ -67,6 +70,7 @@ export class Aptos {
|
|
|
67
70
|
this.transaction = new Transaction(this.config);
|
|
68
71
|
this.table = new Table(this.config);
|
|
69
72
|
this.keyless = new Keyless(this.config);
|
|
73
|
+
this.object = new AptosObject(this.config);
|
|
70
74
|
}
|
|
71
75
|
}
|
|
72
76
|
|
|
@@ -84,6 +88,7 @@ export interface Aptos
|
|
|
84
88
|
Keyless,
|
|
85
89
|
Staking,
|
|
86
90
|
Table,
|
|
91
|
+
AptosObject,
|
|
87
92
|
Omit<Transaction, "build" | "simulate" | "submit" | "batch"> {}
|
|
88
93
|
|
|
89
94
|
/**
|
|
@@ -119,3 +124,4 @@ applyMixin(Aptos, Staking, "staking");
|
|
|
119
124
|
applyMixin(Aptos, Transaction, "transaction");
|
|
120
125
|
applyMixin(Aptos, Table, "table");
|
|
121
126
|
applyMixin(Aptos, Keyless, "keyless");
|
|
127
|
+
applyMixin(Aptos, AptosObject, "object");
|
package/src/api/digitalAsset.ts
CHANGED
|
@@ -25,6 +25,8 @@ import {
|
|
|
25
25
|
freezeDigitalAssetTransferTransaction,
|
|
26
26
|
getCollectionData,
|
|
27
27
|
getCollectionDataByCollectionId,
|
|
28
|
+
getCollectionDataByCreatorAddress,
|
|
29
|
+
getCollectionDataByCreatorAddressAndCollectionName,
|
|
28
30
|
getCollectionId,
|
|
29
31
|
getCurrentDigitalAssetOwnership,
|
|
30
32
|
getDigitalAssetActivity,
|
|
@@ -55,6 +57,9 @@ export class DigitalAsset {
|
|
|
55
57
|
constructor(readonly config: AptosConfig) {}
|
|
56
58
|
|
|
57
59
|
/**
|
|
60
|
+
* @deprecated use getCollectionDataByCreatorAddressAndCollectionName - this function
|
|
61
|
+
* will be removed in the next major release
|
|
62
|
+
*
|
|
58
63
|
* Queries data of a specific collection by the collection creator address and the collection name.
|
|
59
64
|
*
|
|
60
65
|
* If, for some reason, a creator account has 2 collections with the same name in v1 and v2,
|
|
@@ -80,7 +85,81 @@ export class DigitalAsset {
|
|
|
80
85
|
minimumLedgerVersion: args.minimumLedgerVersion,
|
|
81
86
|
processorType: ProcessorType.TOKEN_V2_PROCESSOR,
|
|
82
87
|
});
|
|
83
|
-
|
|
88
|
+
|
|
89
|
+
const { creatorAddress, collectionName, options } = args;
|
|
90
|
+
const address = AccountAddress.from(creatorAddress);
|
|
91
|
+
|
|
92
|
+
const whereCondition: any = {
|
|
93
|
+
collection_name: { _eq: collectionName },
|
|
94
|
+
creator_address: { _eq: address.toStringLong() },
|
|
95
|
+
};
|
|
96
|
+
if (options?.tokenStandard) {
|
|
97
|
+
whereCondition.token_standard = { _eq: options?.tokenStandard ?? "v2" };
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return getCollectionData({ aptosConfig: this.config, options: { where: whereCondition } });
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Queries data of a specific collection by the collection creator address and the collection name.
|
|
105
|
+
*
|
|
106
|
+
* If, for some reason, a creator account has 2 collections with the same name in v1 and v2,
|
|
107
|
+
* can pass an optional `tokenStandard` parameter to query a specific standard
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* const collection = await aptos.getCollectionDataByCreatorAddressAndCollectionName({
|
|
111
|
+
* creatorAddress:"0x123",
|
|
112
|
+
* collectionName:"myCollection"
|
|
113
|
+
* })
|
|
114
|
+
*
|
|
115
|
+
* @param args.creatorAddress the address of the collection's creator
|
|
116
|
+
* @param args.collectionName the name of the collection
|
|
117
|
+
* @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying
|
|
118
|
+
* @param args.options.tokenStandard the token standard to query
|
|
119
|
+
* @returns GetCollectionDataResponse response type
|
|
120
|
+
*/
|
|
121
|
+
async getCollectionDataByCreatorAddressAndCollectionName(args: {
|
|
122
|
+
creatorAddress: AccountAddressInput;
|
|
123
|
+
collectionName: string;
|
|
124
|
+
minimumLedgerVersion?: AnyNumber;
|
|
125
|
+
options?: TokenStandardArg & PaginationArgs;
|
|
126
|
+
}): Promise<GetCollectionDataResponse> {
|
|
127
|
+
await waitForIndexerOnVersion({
|
|
128
|
+
config: this.config,
|
|
129
|
+
minimumLedgerVersion: args.minimumLedgerVersion,
|
|
130
|
+
processorType: ProcessorType.TOKEN_V2_PROCESSOR,
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
return getCollectionDataByCreatorAddressAndCollectionName({ aptosConfig: this.config, ...args });
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Queries data of a specific collection by the collection creator address and the collection name.
|
|
138
|
+
*
|
|
139
|
+
* If, for some reason, a creator account has 2 collections with the same name in v1 and v2,
|
|
140
|
+
* can pass an optional `tokenStandard` parameter to query a specific standard
|
|
141
|
+
*
|
|
142
|
+
* @example
|
|
143
|
+
* const collection = await aptos.getCollectionDataByCreatorAddressAnd({creatorAddress:"0x123"})
|
|
144
|
+
*
|
|
145
|
+
* @param args.creatorAddress the address of the collection's creator
|
|
146
|
+
* @param args.collectionName the name of the collection
|
|
147
|
+
* @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying
|
|
148
|
+
* @param args.options.tokenStandard the token standard to query
|
|
149
|
+
* @returns GetCollectionDataResponse response type
|
|
150
|
+
*/
|
|
151
|
+
async getCollectionDataByCreatorAddress(args: {
|
|
152
|
+
creatorAddress: AccountAddressInput;
|
|
153
|
+
minimumLedgerVersion?: AnyNumber;
|
|
154
|
+
options?: TokenStandardArg & PaginationArgs;
|
|
155
|
+
}): Promise<GetCollectionDataResponse> {
|
|
156
|
+
await waitForIndexerOnVersion({
|
|
157
|
+
config: this.config,
|
|
158
|
+
minimumLedgerVersion: args.minimumLedgerVersion,
|
|
159
|
+
processorType: ProcessorType.TOKEN_V2_PROCESSOR,
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
return getCollectionDataByCreatorAddress({ aptosConfig: this.config, ...args });
|
|
84
163
|
}
|
|
85
164
|
|
|
86
165
|
/**
|
|
@@ -96,6 +175,7 @@ export class DigitalAsset {
|
|
|
96
175
|
async getCollectionDataByCollectionId(args: {
|
|
97
176
|
collectionId: AccountAddressInput;
|
|
98
177
|
minimumLedgerVersion?: AnyNumber;
|
|
178
|
+
options?: TokenStandardArg & PaginationArgs;
|
|
99
179
|
}): Promise<GetCollectionDataResponse> {
|
|
100
180
|
await waitForIndexerOnVersion({
|
|
101
181
|
config: this.config,
|
package/src/api/general.ts
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
queryIndexer,
|
|
11
11
|
} from "../internal/general";
|
|
12
12
|
import { getBlockByHeight, getBlockByVersion } from "../internal/transaction";
|
|
13
|
-
import { view } from "../internal/view";
|
|
13
|
+
import { view, viewJson } from "../internal/view";
|
|
14
14
|
import {
|
|
15
15
|
AnyNumber,
|
|
16
16
|
Block,
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
MoveValue,
|
|
23
23
|
} from "../types";
|
|
24
24
|
import { ProcessorType } from "../utils/const";
|
|
25
|
-
import { InputViewFunctionData } from "../transactions";
|
|
25
|
+
import { InputViewFunctionData, InputViewFunctionJsonData } from "../transactions";
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* A class to query all `General` Aptos related queries
|
|
@@ -132,6 +132,29 @@ export class General {
|
|
|
132
132
|
return view<T>({ aptosConfig: this.config, ...args });
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
+
/**
|
|
136
|
+
* Queries for a Move view function with JSON, this provides compatability with the old `aptos` package
|
|
137
|
+
* @param args.payload Payload for the view function
|
|
138
|
+
* @param args.options.ledgerVersion The ledger version to query, if not provided it will get the latest version
|
|
139
|
+
*
|
|
140
|
+
* @example
|
|
141
|
+
* const data = await aptos.view({
|
|
142
|
+
* payload: {
|
|
143
|
+
* function: "0x1::coin::balance",
|
|
144
|
+
* typeArguments: ["0x1::aptos_coin::AptosCoin"],
|
|
145
|
+
* functionArguments: [accountAddress.toString()],
|
|
146
|
+
* }
|
|
147
|
+
* })
|
|
148
|
+
*
|
|
149
|
+
* @returns an array of Move values
|
|
150
|
+
*/
|
|
151
|
+
async viewJson<T extends Array<MoveValue>>(args: {
|
|
152
|
+
payload: InputViewFunctionJsonData;
|
|
153
|
+
options?: LedgerVersionArg;
|
|
154
|
+
}): Promise<T> {
|
|
155
|
+
return viewJson<T>({ aptosConfig: this.config, ...args });
|
|
156
|
+
}
|
|
157
|
+
|
|
135
158
|
/**
|
|
136
159
|
* Queries top user transactions
|
|
137
160
|
*
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// Copyright © Aptos Foundation
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import { AnyNumber, GetObjectDataQueryResponse, OrderByArg, PaginationArgs } from "../types";
|
|
5
|
+
import { AccountAddressInput } from "../core";
|
|
6
|
+
import { AptosConfig } from "./aptosConfig";
|
|
7
|
+
import { ProcessorType } from "../utils";
|
|
8
|
+
import { waitForIndexerOnVersion } from "./utils";
|
|
9
|
+
import { getObjectDataByObjectAddress } from "../internal/object";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* A class to query all `Object` related queries on Aptos.
|
|
13
|
+
*/
|
|
14
|
+
export class AptosObject {
|
|
15
|
+
constructor(readonly config: AptosConfig) {}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Fetch the object data based on the oabject address
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* const object = await aptos.getObjectDataByObjectAddress({objectAddress:"0x123"})
|
|
22
|
+
*
|
|
23
|
+
* @param args.objectAddress The object address
|
|
24
|
+
* @param args.options Configuration options for waitForTransaction
|
|
25
|
+
*
|
|
26
|
+
* @returns The object data
|
|
27
|
+
*/
|
|
28
|
+
async getObjectDataByObjectAddress(args: {
|
|
29
|
+
objectAddress: AccountAddressInput;
|
|
30
|
+
minimumLedgerVersion?: AnyNumber;
|
|
31
|
+
options?: PaginationArgs & OrderByArg<GetObjectDataQueryResponse[0]>;
|
|
32
|
+
}): Promise<GetObjectDataQueryResponse[0]> {
|
|
33
|
+
await waitForIndexerOnVersion({
|
|
34
|
+
config: this.config,
|
|
35
|
+
minimumLedgerVersion: args.minimumLedgerVersion,
|
|
36
|
+
processorType: ProcessorType.OBJECT_PROCESSOR,
|
|
37
|
+
});
|
|
38
|
+
return getObjectDataByObjectAddress({
|
|
39
|
+
aptosConfig: this.config,
|
|
40
|
+
...args,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
package/src/cli/move.ts
CHANGED
|
@@ -9,13 +9,13 @@ export class Move {
|
|
|
9
9
|
* Function to initialize current directory for Aptos
|
|
10
10
|
*
|
|
11
11
|
* Configuration will be pushed into .aptos/config.yaml
|
|
12
|
-
* @param args.network optional
|
|
12
|
+
* @param args.network optional Network type argument to use for default settings, default is local
|
|
13
13
|
* @param args.profile optional Profile to use from the config file, default is 'default'
|
|
14
14
|
* This will be used to override associated settings such as the REST URL, the Faucet URL, and the private key arguments.
|
|
15
15
|
*
|
|
16
|
-
* @returns
|
|
16
|
+
* @returns stdout
|
|
17
17
|
*/
|
|
18
|
-
async init(args: { network?: Network; profile?: string }): Promise<
|
|
18
|
+
async init(args: { network?: Network; profile?: string }): Promise<{ output: string }> {
|
|
19
19
|
const { network, profile } = args;
|
|
20
20
|
const cliArgs = ["aptos", "init", `--network=${network ?? "local"}`, `--profile=${profile ?? "default"}`];
|
|
21
21
|
|
|
@@ -32,12 +32,12 @@ export class Move {
|
|
|
32
32
|
* alice:0x1234, bob:0x5678
|
|
33
33
|
* }
|
|
34
34
|
*
|
|
35
|
-
* @returns
|
|
35
|
+
* @returns stdout
|
|
36
36
|
*/
|
|
37
37
|
async compile(args: {
|
|
38
38
|
packageDirectoryPath: string;
|
|
39
39
|
namedAddresses: Record<string, AccountAddress>;
|
|
40
|
-
}): Promise<
|
|
40
|
+
}): Promise<{ output: string }> {
|
|
41
41
|
const { packageDirectoryPath, namedAddresses } = args;
|
|
42
42
|
const cliArgs = ["aptos", "move", "compile", "--package-dir", packageDirectoryPath];
|
|
43
43
|
|
|
@@ -58,9 +58,12 @@ export class Move {
|
|
|
58
58
|
* alice:0x1234, bob:0x5678
|
|
59
59
|
* }
|
|
60
60
|
*
|
|
61
|
-
* @returns
|
|
61
|
+
* @returns stdout
|
|
62
62
|
*/
|
|
63
|
-
async test(args: {
|
|
63
|
+
async test(args: {
|
|
64
|
+
packageDirectoryPath: string;
|
|
65
|
+
namedAddresses: Record<string, AccountAddress>;
|
|
66
|
+
}): Promise<{ output: string }> {
|
|
64
67
|
const { packageDirectoryPath, namedAddresses } = args;
|
|
65
68
|
const cliArgs = ["aptos", "move", "test", "--package-dir", packageDirectoryPath];
|
|
66
69
|
|
|
@@ -72,7 +75,7 @@ export class Move {
|
|
|
72
75
|
}
|
|
73
76
|
|
|
74
77
|
/**
|
|
75
|
-
* Function to
|
|
78
|
+
* Function to publish the modules to the publisher account on the Aptos blockchain
|
|
76
79
|
*
|
|
77
80
|
* @param args.packageDirectoryPath Path to a move package (the folder with a Move.toml file)
|
|
78
81
|
* @param args.namedAddresses Named addresses for the move binary
|
|
@@ -82,13 +85,13 @@ export class Move {
|
|
|
82
85
|
* }
|
|
83
86
|
* @param args.profile optional Profile to use from the config file.
|
|
84
87
|
*
|
|
85
|
-
* @returns
|
|
88
|
+
* @returns stdout
|
|
86
89
|
*/
|
|
87
90
|
async publish(args: {
|
|
88
91
|
packageDirectoryPath: string;
|
|
89
92
|
namedAddresses: Record<string, AccountAddress>;
|
|
90
93
|
profile?: string;
|
|
91
|
-
}): Promise<
|
|
94
|
+
}): Promise<{ output: string }> {
|
|
92
95
|
const { packageDirectoryPath, namedAddresses, profile } = args;
|
|
93
96
|
const cliArgs = [
|
|
94
97
|
"aptos",
|
|
@@ -106,17 +109,134 @@ export class Move {
|
|
|
106
109
|
return this.runCommand(cliArgs);
|
|
107
110
|
}
|
|
108
111
|
|
|
112
|
+
/**
|
|
113
|
+
* Function to create a new object and publish the Move package to it on the Aptos blockchain
|
|
114
|
+
*
|
|
115
|
+
* @param args.packageDirectoryPath Path to a move package (the folder with a Move.toml file)
|
|
116
|
+
* @param args.addressName Address name for the Move package
|
|
117
|
+
* @example
|
|
118
|
+
* MoonCoin, please find the actual address name in Move.toml
|
|
119
|
+
* @param args.namedAddresses Named addresses for the move binary
|
|
120
|
+
* @example
|
|
121
|
+
* {
|
|
122
|
+
* alice:0x1234, bob:0x5678
|
|
123
|
+
* }
|
|
124
|
+
* @param args.profile optional Profile to use from the config file.
|
|
125
|
+
*
|
|
126
|
+
* A complete example in cli
|
|
127
|
+
* aptos move create-object-and-publish-package \
|
|
128
|
+
* --package-dir path_to_directory_that_has_move.toml \
|
|
129
|
+
* --address-name launchpad_addr \
|
|
130
|
+
* --named-addresses "launchpad_addr=0x123,initial_creator_addr=0x456"\
|
|
131
|
+
* --profile my_profile \
|
|
132
|
+
* --assume-yes
|
|
133
|
+
* @returns object address
|
|
134
|
+
*/
|
|
135
|
+
async createObjectAndPublishPackage(args: {
|
|
136
|
+
packageDirectoryPath: string;
|
|
137
|
+
addressName: string;
|
|
138
|
+
namedAddresses: Record<string, AccountAddress>;
|
|
139
|
+
profile?: string;
|
|
140
|
+
}): Promise<{ objectAddress: string }> {
|
|
141
|
+
const { packageDirectoryPath, addressName, namedAddresses, profile } = args;
|
|
142
|
+
const cliArgs = [
|
|
143
|
+
"aptos",
|
|
144
|
+
"move",
|
|
145
|
+
"create-object-and-publish-package",
|
|
146
|
+
"--package-dir",
|
|
147
|
+
packageDirectoryPath,
|
|
148
|
+
"--address-name",
|
|
149
|
+
addressName,
|
|
150
|
+
`--profile=${profile ?? "default"}`,
|
|
151
|
+
];
|
|
152
|
+
|
|
153
|
+
const addressesMap = this.parseNamedAddresses(namedAddresses);
|
|
154
|
+
|
|
155
|
+
cliArgs.push(...this.prepareNamedAddresses(addressesMap));
|
|
156
|
+
|
|
157
|
+
const result = await this.runCommand(cliArgs);
|
|
158
|
+
return { objectAddress: this.extractAddressFromOutput(result.output) };
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Function to upgrade a Move package previously published to an object on the Aptos blockchain
|
|
163
|
+
* Caller must be the object owner to call this function
|
|
164
|
+
*
|
|
165
|
+
* @param args.packageDirectoryPath Path to a move package (the folder with a Move.toml file)
|
|
166
|
+
* @param args.objectAddress Address of the object that the Move package published to
|
|
167
|
+
* @example
|
|
168
|
+
* 0x1000
|
|
169
|
+
* @param args.namedAddresses Named addresses for the move binary
|
|
170
|
+
* @example
|
|
171
|
+
* {
|
|
172
|
+
* alice:0x1234, bob:0x5678
|
|
173
|
+
* }
|
|
174
|
+
* @param args.profile optional Profile to use from the config file.
|
|
175
|
+
*
|
|
176
|
+
* @returns stdout
|
|
177
|
+
*/
|
|
178
|
+
async upgradeObjectPackage(args: {
|
|
179
|
+
packageDirectoryPath: string;
|
|
180
|
+
objectAddress: string;
|
|
181
|
+
namedAddresses: Record<string, AccountAddress>;
|
|
182
|
+
profile?: string;
|
|
183
|
+
}): Promise<{ output: string }> {
|
|
184
|
+
const { packageDirectoryPath, objectAddress, namedAddresses, profile } = args;
|
|
185
|
+
const cliArgs = [
|
|
186
|
+
"aptos",
|
|
187
|
+
"move",
|
|
188
|
+
"upgrade-object-package",
|
|
189
|
+
"--package-dir",
|
|
190
|
+
packageDirectoryPath,
|
|
191
|
+
"--object-address",
|
|
192
|
+
objectAddress,
|
|
193
|
+
`--profile=${profile ?? "default"}`,
|
|
194
|
+
];
|
|
195
|
+
|
|
196
|
+
const addressesMap = this.parseNamedAddresses(namedAddresses);
|
|
197
|
+
|
|
198
|
+
cliArgs.push(...this.prepareNamedAddresses(addressesMap));
|
|
199
|
+
|
|
200
|
+
return this.runCommand(cliArgs);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Function to run a Move script, please run compile before running this
|
|
205
|
+
*
|
|
206
|
+
* @param args.compiledScriptPath Path to a compiled Move script bytecode file
|
|
207
|
+
* @param args.namedAddresses Named addresses for the move binary
|
|
208
|
+
* @example
|
|
209
|
+
* build/my_package/bytecode_scripts/my_move_script.mv
|
|
210
|
+
* @param args.profile optional Profile to use from the config file.
|
|
211
|
+
*
|
|
212
|
+
* @returns stdout
|
|
213
|
+
*/
|
|
214
|
+
async runScript(args: { compiledScriptPath: string; profile?: string }): Promise<{ output: string }> {
|
|
215
|
+
const { compiledScriptPath, profile } = args;
|
|
216
|
+
const cliArgs = [
|
|
217
|
+
"aptos",
|
|
218
|
+
"move",
|
|
219
|
+
"run-script",
|
|
220
|
+
"--compiled-script-path",
|
|
221
|
+
compiledScriptPath,
|
|
222
|
+
`--profile=${profile ?? "default"}`,
|
|
223
|
+
];
|
|
224
|
+
|
|
225
|
+
return this.runCommand(cliArgs);
|
|
226
|
+
}
|
|
227
|
+
|
|
109
228
|
/**
|
|
110
229
|
* Run a move command
|
|
111
230
|
*
|
|
112
231
|
* @param args
|
|
113
|
-
* @returns
|
|
232
|
+
* @returns stdout
|
|
114
233
|
*/
|
|
115
234
|
// eslint-disable-next-line class-methods-use-this
|
|
116
|
-
private async runCommand(args: Array<string>): Promise<
|
|
235
|
+
private async runCommand(args: Array<string>): Promise<{ output: string }> {
|
|
117
236
|
return new Promise((resolve, reject) => {
|
|
118
237
|
const currentPlatform = platform();
|
|
119
238
|
let childProcess;
|
|
239
|
+
let stdout = "";
|
|
120
240
|
|
|
121
241
|
// Check if current OS is windows
|
|
122
242
|
if (currentPlatform === "win32") {
|
|
@@ -125,13 +245,17 @@ export class Move {
|
|
|
125
245
|
childProcess = spawn("npx", args);
|
|
126
246
|
}
|
|
127
247
|
|
|
248
|
+
childProcess.stdout.on("data", (data) => {
|
|
249
|
+
stdout += data.toString();
|
|
250
|
+
});
|
|
251
|
+
|
|
128
252
|
childProcess.stdout.pipe(process.stdout);
|
|
129
253
|
childProcess.stderr.pipe(process.stderr);
|
|
130
254
|
process.stdin.pipe(childProcess.stdin);
|
|
131
255
|
|
|
132
256
|
childProcess.on("close", (code) => {
|
|
133
257
|
if (code === 0) {
|
|
134
|
-
resolve(
|
|
258
|
+
resolve({ output: stdout }); // Resolve with stdout if the child process exits successfully
|
|
135
259
|
} else {
|
|
136
260
|
reject(new Error(`Child process exited with code ${code}`)); // Reject with an error if the child process exits with an error code
|
|
137
261
|
}
|
|
@@ -186,4 +310,19 @@ export class Move {
|
|
|
186
310
|
|
|
187
311
|
return addressesMap;
|
|
188
312
|
}
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Extract object address from the output
|
|
316
|
+
*
|
|
317
|
+
* @param output
|
|
318
|
+
* @returns object address
|
|
319
|
+
*/
|
|
320
|
+
// eslint-disable-next-line class-methods-use-this
|
|
321
|
+
private extractAddressFromOutput(output: string): string {
|
|
322
|
+
const match = output.match("Code was successfully deployed to object address (0x[0-9a-fA-F]+)\\.");
|
|
323
|
+
if (match) {
|
|
324
|
+
return match[1];
|
|
325
|
+
}
|
|
326
|
+
throw new Error("Failed to extract object address from output");
|
|
327
|
+
}
|
|
189
328
|
}
|