@aptos-labs/ts-sdk 1.1.0 → 1.3.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/README.md +35 -7
- package/dist/browser/index.d.ts +18 -19
- package/dist/browser/index.global.js +53 -29
- package/dist/browser/index.global.js.map +1 -1
- package/dist/common/index.d.ts +18 -19
- package/dist/common/index.js +25 -25
- package/dist/common/index.js.map +1 -1
- package/dist/esm/api/account.mjs +1 -1
- package/dist/esm/api/ans.mjs +1 -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.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 +1 -1
- package/dist/esm/api/general.mjs +1 -1
- package/dist/esm/api/index.mjs +1 -1
- package/dist/esm/api/staking.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/helpers.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.d.mts +1 -1
- package/dist/esm/api/utils.mjs +1 -1
- package/dist/esm/bcs/consts.mjs +1 -1
- package/dist/esm/bcs/deserializer.d.mts +1 -1
- package/dist/esm/bcs/deserializer.mjs +1 -1
- package/dist/esm/bcs/index.mjs +1 -1
- package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -1
- package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -1
- package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
- package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
- package/dist/esm/bcs/serializer.mjs +1 -1
- package/dist/esm/chunk-2MH57VSA.mjs +2 -0
- package/dist/esm/chunk-2MH57VSA.mjs.map +1 -0
- package/dist/esm/{chunk-KVJ2KGMW.mjs → chunk-2QV6HI3M.mjs} +2 -2
- package/dist/esm/{chunk-3RMXGSHK.mjs → chunk-4DI53MOX.mjs} +2 -2
- package/dist/esm/{chunk-3O4GKLXA.mjs → chunk-526UH53R.mjs} +2 -2
- package/dist/esm/{chunk-3O4GKLXA.mjs.map → chunk-526UH53R.mjs.map} +1 -1
- package/dist/esm/chunk-56CNRT2K.mjs +2 -0
- package/dist/esm/chunk-56CNRT2K.mjs.map +1 -0
- package/dist/esm/chunk-5I4AJ6KA.mjs +2 -0
- package/dist/esm/chunk-5I4AJ6KA.mjs.map +1 -0
- package/dist/esm/{chunk-KSWQZKMQ.mjs → chunk-5M7VRRAU.mjs} +2 -2
- package/dist/esm/chunk-5SU5YHP2.mjs +2 -0
- package/dist/esm/chunk-5SU5YHP2.mjs.map +1 -0
- package/dist/esm/chunk-63764T3K.mjs +2 -0
- package/dist/esm/chunk-63764T3K.mjs.map +1 -0
- package/dist/esm/{chunk-BUM2FIHF.mjs → chunk-6EUKJGSP.mjs} +2 -2
- package/dist/esm/{chunk-BUM2FIHF.mjs.map → chunk-6EUKJGSP.mjs.map} +1 -1
- package/dist/esm/{chunk-UDMADMVO.mjs → chunk-6IFMQ5AS.mjs} +2 -2
- package/dist/esm/{chunk-TCSN7PYL.mjs → chunk-754CLAXM.mjs} +2 -2
- package/dist/esm/{chunk-PRKZ2KJ4.mjs → chunk-7D5LHQNS.mjs} +2 -2
- package/dist/esm/{chunk-4K252UDE.mjs → chunk-7IGH7N52.mjs} +2 -2
- package/dist/esm/chunk-7LEBWRPP.mjs +2 -0
- package/dist/esm/chunk-7LEBWRPP.mjs.map +1 -0
- package/dist/esm/chunk-7POEROH7.mjs +2 -0
- package/dist/esm/chunk-7POEROH7.mjs.map +1 -0
- package/dist/esm/{chunk-VBUKPN4Q.mjs → chunk-AA4ETD22.mjs} +2 -2
- package/dist/esm/{chunk-F2GFSFPW.mjs → chunk-B2ZKW23W.mjs} +2 -2
- package/dist/esm/{chunk-4ZYW3BPF.mjs → chunk-B7FGGGWZ.mjs} +2 -2
- package/dist/esm/{chunk-LUCDRB52.mjs → chunk-BVQXUADY.mjs} +2 -2
- package/dist/esm/{chunk-2HBIGMDV.mjs → chunk-CKWHFVGW.mjs} +2 -2
- package/dist/esm/{chunk-KH3M3YPI.mjs → chunk-E6NGWPZM.mjs} +2 -2
- package/dist/esm/{chunk-UZB7CTLX.mjs → chunk-EK7YYYKL.mjs} +2 -2
- package/dist/esm/{chunk-6F4ACCCZ.mjs → chunk-ERWQOVBF.mjs} +2 -2
- package/dist/esm/{chunk-UR5E2UDO.mjs → chunk-F7CR75CJ.mjs} +2 -2
- package/dist/esm/{chunk-7B3VSBCX.mjs → chunk-F7MOQC7Z.mjs} +2 -2
- package/dist/esm/{chunk-OWP2MKTX.mjs → chunk-FBFMQZTM.mjs} +2 -2
- package/dist/esm/{chunk-AS7RX4RK.mjs → chunk-FIO7MFHJ.mjs} +2 -2
- package/dist/esm/{chunk-SMN2QQ4Q.mjs → chunk-FP5DPRYL.mjs} +2 -2
- package/dist/esm/{chunk-ZWH2ESXT.mjs → chunk-FVA2OPG4.mjs} +1 -1
- package/dist/esm/{chunk-YLI6J47P.mjs → chunk-GIM5LIAP.mjs} +2 -2
- package/dist/esm/chunk-HGC2PEHW.mjs +2 -0
- package/dist/esm/{chunk-SODP7NAK.mjs.map → chunk-HGC2PEHW.mjs.map} +1 -1
- package/dist/esm/chunk-HHJBCGAQ.mjs +2 -0
- package/dist/esm/{chunk-EOC4UI5B.mjs.map → chunk-HHJBCGAQ.mjs.map} +1 -1
- package/dist/esm/{chunk-C3Y52GHM.mjs → chunk-HI6QP2FB.mjs} +2 -2
- package/dist/esm/{chunk-RCYWJZR4.mjs → chunk-I7WRJY7K.mjs} +2 -2
- package/dist/esm/{chunk-NLONZHYT.mjs → chunk-IHCIKE42.mjs} +2 -2
- package/dist/esm/{chunk-NZ6RYGJQ.mjs → chunk-IZ4H63EF.mjs} +2 -2
- package/dist/esm/{chunk-ZLYSA7JR.mjs → chunk-J2CXWDE7.mjs} +2 -2
- package/dist/esm/{chunk-6MKBROIC.mjs → chunk-KVTWA3N3.mjs} +2 -2
- package/dist/esm/{chunk-D2XLC3KK.mjs → chunk-KZID24G2.mjs} +2 -2
- package/dist/esm/{chunk-OU4MEM5F.mjs → chunk-M7PXZWVX.mjs} +2 -2
- package/dist/esm/{chunk-R3SAAJ2N.mjs → chunk-MSQ5V3EF.mjs} +2 -2
- package/dist/esm/{chunk-IU5JZNH4.mjs → chunk-N4RBQZ2B.mjs} +2 -2
- package/dist/esm/{chunk-OXO3Z2MF.mjs → chunk-NI7GRYCP.mjs} +2 -2
- package/dist/esm/{chunk-GQI3HWOB.mjs → chunk-NWRKJFHV.mjs} +2 -2
- package/dist/esm/{chunk-HQ4DGB7L.mjs → chunk-O57QZZF2.mjs} +2 -2
- package/dist/esm/{chunk-SI6QMT4N.mjs → chunk-OZ3JUNJX.mjs} +2 -2
- package/dist/esm/chunk-PAY4TBCF.mjs +2 -0
- package/dist/esm/chunk-PAY4TBCF.mjs.map +1 -0
- package/dist/esm/{chunk-6DYNAFAP.mjs → chunk-PPTG6BDV.mjs} +2 -2
- package/dist/esm/{chunk-FGTQT7Q5.mjs → chunk-QKTV6AZ7.mjs} +2 -2
- package/dist/esm/{chunk-7QJYTQSU.mjs → chunk-RNO5ZG3C.mjs} +2 -2
- package/dist/esm/{chunk-BV6SCEXY.mjs → chunk-RSOBVX62.mjs} +2 -2
- package/dist/esm/chunk-RYX746TE.mjs +2 -0
- package/dist/esm/chunk-RYX746TE.mjs.map +1 -0
- package/dist/esm/{chunk-F52GIFKT.mjs → chunk-S4QKXXBT.mjs} +2 -2
- package/dist/esm/{chunk-N25GOEVL.mjs → chunk-SBMJNU2O.mjs} +2 -2
- package/dist/esm/{chunk-R4APGSSC.mjs → chunk-T2P2T3OS.mjs} +2 -2
- package/dist/esm/{chunk-R4APGSSC.mjs.map → chunk-T2P2T3OS.mjs.map} +1 -1
- package/dist/esm/{chunk-TTDCRLRD.mjs → chunk-TKRPOJH3.mjs} +2 -2
- package/dist/esm/{chunk-HDNJ4JK4.mjs → chunk-U2YE33UN.mjs} +2 -2
- package/dist/esm/{chunk-NMFS5KAE.mjs → chunk-UCHGKGCF.mjs} +2 -2
- package/dist/esm/{chunk-SR7XLV76.mjs → chunk-UFMUQN35.mjs} +2 -2
- package/dist/esm/{chunk-SR7XLV76.mjs.map → chunk-UFMUQN35.mjs.map} +1 -1
- package/dist/esm/chunk-UNSMG2E5.mjs +2 -0
- package/dist/esm/chunk-UNSMG2E5.mjs.map +1 -0
- package/dist/esm/chunk-V6JFR2CB.mjs +2 -0
- package/dist/esm/chunk-VO2CATMP.mjs +2 -0
- package/dist/esm/chunk-VO2CATMP.mjs.map +1 -0
- package/dist/esm/{chunk-VMCFN5CT.mjs → chunk-VRSUCKJA.mjs} +2 -2
- package/dist/esm/{chunk-3QS3MFWJ.mjs → chunk-YVSIS6BA.mjs} +2 -2
- package/dist/esm/{chunk-5HZKDT5C.mjs → chunk-ZFIMVSCR.mjs} +2 -2
- package/dist/esm/{chunk-4VG7DV6F.mjs → chunk-ZLYF5TLK.mjs} +2 -2
- package/dist/esm/cli/index.d.mts +2 -0
- package/dist/esm/cli/index.mjs +2 -0
- package/dist/esm/cli/index.mjs.map +1 -0
- package/dist/esm/cli/localNode.d.mts +37 -0
- package/dist/esm/cli/localNode.mjs +2 -0
- package/dist/esm/cli/localNode.mjs.map +1 -0
- package/dist/esm/client/core.mjs +1 -1
- package/dist/esm/client/get.d.mts +1 -1
- package/dist/esm/client/get.mjs +1 -1
- package/dist/esm/client/index.mjs +1 -1
- package/dist/esm/client/post.d.mts +1 -1
- package/dist/esm/client/post.mjs +1 -1
- package/dist/esm/client/types.d.mts +1 -1
- package/dist/esm/client/types.mjs +1 -1
- package/dist/esm/core/account.mjs +1 -1
- package/dist/esm/core/accountAddress.d.mts +1 -1
- package/dist/esm/core/accountAddress.mjs +1 -1
- package/dist/esm/core/authenticationKey.mjs +1 -1
- package/dist/esm/core/common.d.mts +1 -1
- package/dist/esm/core/common.mjs +1 -1
- package/dist/esm/core/crypto/anyPublicKey.mjs +1 -1
- package/dist/esm/core/crypto/anySignature.mjs +1 -1
- package/dist/esm/core/crypto/asymmetricCrypto.mjs +1 -1
- package/dist/esm/core/crypto/ed25519.mjs +1 -1
- package/dist/esm/core/crypto/hdKey.d.mts +1 -1
- package/dist/esm/core/crypto/hdKey.mjs +1 -1
- package/dist/esm/core/crypto/index.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/secp256k1.mjs +1 -1
- package/dist/esm/core/hex.mjs +1 -1
- package/dist/esm/core/index.mjs +1 -1
- package/dist/esm/index.d.mts +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/internal/account.d.mts +1 -1
- package/dist/esm/internal/account.mjs +1 -1
- package/dist/esm/internal/ans.d.mts +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 +3 -2
- 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.d.mts +1 -1
- package/dist/esm/internal/general.mjs +1 -1
- package/dist/esm/internal/staking.mjs +1 -1
- package/dist/esm/internal/transaction.mjs +1 -1
- package/dist/esm/internal/transactionSubmission.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/chainId.mjs +1 -1
- package/dist/esm/transactions/instances/identifier.mjs +1 -1
- package/dist/esm/transactions/instances/index.d.mts +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/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/transactionArgument.d.mts +1 -1
- package/dist/esm/transactions/instances/transactionPayload.d.mts +7 -7
- package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
- package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
- package/dist/esm/transactions/management/asyncQueue.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/transactionBuilder.d.mts +3 -3
- 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 +7 -7
- package/dist/esm/types/generated/operations.d.mts +1 -1
- package/dist/esm/types/generated/queries.d.mts +1 -1
- package/dist/esm/types/generated/queries.mjs +1 -1
- package/dist/esm/types/generated/types.d.mts +1 -1
- package/dist/esm/types/generated/types.mjs +1 -1
- package/dist/esm/types/index.d.mts +2 -2
- package/dist/esm/types/index.mjs +1 -1
- package/dist/esm/types/indexer.d.mts +1 -1
- package/dist/esm/utils/apiEndpoints.mjs +1 -1
- package/dist/esm/utils/const.d.mts +0 -2
- package/dist/esm/utils/const.mjs +1 -1
- package/dist/esm/utils/helpers.mjs +1 -1
- package/dist/esm/utils/index.mjs +1 -1
- package/dist/esm/utils/memoize.mjs +1 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +19 -17
- package/src/api/account.ts +10 -21
- package/src/api/digitalAsset.ts +6 -23
- package/src/api/event.ts +3 -3
- package/src/api/fungibleAsset.ts +4 -4
- package/src/api/general.ts +1 -1
- package/src/api/staking.ts +3 -3
- package/src/api/utils.ts +6 -19
- package/src/bcs/consts.ts +9 -7
- package/src/cli/index.ts +1 -0
- package/src/cli/localNode.ts +105 -0
- package/src/internal/digitalAsset.ts +4 -4
- package/src/internal/general.ts +2 -2
- package/src/internal/transaction.ts +1 -1
- package/src/transactions/instances/transactionPayload.ts +14 -12
- package/src/transactions/transactionBuilder/remoteAbi.ts +9 -7
- package/src/transactions/transactionBuilder/transactionBuilder.ts +7 -7
- package/src/transactions/types.ts +6 -5
- package/src/utils/const.ts +2 -2
- package/src/version.ts +1 -1
- package/dist/esm/chunk-4TIQQKXV.mjs +0 -2
- package/dist/esm/chunk-4TIQQKXV.mjs.map +0 -1
- package/dist/esm/chunk-DNDWTM7A.mjs +0 -2
- package/dist/esm/chunk-DNDWTM7A.mjs.map +0 -1
- package/dist/esm/chunk-EHJEK7FU.mjs +0 -2
- package/dist/esm/chunk-EMQWD6KP.mjs +0 -2
- package/dist/esm/chunk-EMQWD6KP.mjs.map +0 -1
- package/dist/esm/chunk-EOC4UI5B.mjs +0 -2
- package/dist/esm/chunk-IEL6J6Z3.mjs +0 -2
- package/dist/esm/chunk-IEL6J6Z3.mjs.map +0 -1
- package/dist/esm/chunk-IPW2YTRD.mjs +0 -2
- package/dist/esm/chunk-IPW2YTRD.mjs.map +0 -1
- package/dist/esm/chunk-PANYJULW.mjs +0 -2
- package/dist/esm/chunk-PANYJULW.mjs.map +0 -1
- package/dist/esm/chunk-PJMRQLJ5.mjs +0 -2
- package/dist/esm/chunk-PJMRQLJ5.mjs.map +0 -1
- package/dist/esm/chunk-SODP7NAK.mjs +0 -2
- package/dist/esm/chunk-T3ID6KFN.mjs +0 -2
- package/dist/esm/chunk-T3ID6KFN.mjs.map +0 -1
- package/dist/esm/chunk-VA4K6DEK.mjs +0 -2
- package/dist/esm/chunk-VA4K6DEK.mjs.map +0 -1
- package/dist/esm/chunk-YLPG6XMH.mjs +0 -2
- package/dist/esm/chunk-YLPG6XMH.mjs.map +0 -1
- /package/dist/esm/{chunk-KVJ2KGMW.mjs.map → chunk-2QV6HI3M.mjs.map} +0 -0
- /package/dist/esm/{chunk-3RMXGSHK.mjs.map → chunk-4DI53MOX.mjs.map} +0 -0
- /package/dist/esm/{chunk-KSWQZKMQ.mjs.map → chunk-5M7VRRAU.mjs.map} +0 -0
- /package/dist/esm/{chunk-UDMADMVO.mjs.map → chunk-6IFMQ5AS.mjs.map} +0 -0
- /package/dist/esm/{chunk-TCSN7PYL.mjs.map → chunk-754CLAXM.mjs.map} +0 -0
- /package/dist/esm/{chunk-PRKZ2KJ4.mjs.map → chunk-7D5LHQNS.mjs.map} +0 -0
- /package/dist/esm/{chunk-4K252UDE.mjs.map → chunk-7IGH7N52.mjs.map} +0 -0
- /package/dist/esm/{chunk-VBUKPN4Q.mjs.map → chunk-AA4ETD22.mjs.map} +0 -0
- /package/dist/esm/{chunk-F2GFSFPW.mjs.map → chunk-B2ZKW23W.mjs.map} +0 -0
- /package/dist/esm/{chunk-4ZYW3BPF.mjs.map → chunk-B7FGGGWZ.mjs.map} +0 -0
- /package/dist/esm/{chunk-LUCDRB52.mjs.map → chunk-BVQXUADY.mjs.map} +0 -0
- /package/dist/esm/{chunk-2HBIGMDV.mjs.map → chunk-CKWHFVGW.mjs.map} +0 -0
- /package/dist/esm/{chunk-KH3M3YPI.mjs.map → chunk-E6NGWPZM.mjs.map} +0 -0
- /package/dist/esm/{chunk-UZB7CTLX.mjs.map → chunk-EK7YYYKL.mjs.map} +0 -0
- /package/dist/esm/{chunk-6F4ACCCZ.mjs.map → chunk-ERWQOVBF.mjs.map} +0 -0
- /package/dist/esm/{chunk-UR5E2UDO.mjs.map → chunk-F7CR75CJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-7B3VSBCX.mjs.map → chunk-F7MOQC7Z.mjs.map} +0 -0
- /package/dist/esm/{chunk-OWP2MKTX.mjs.map → chunk-FBFMQZTM.mjs.map} +0 -0
- /package/dist/esm/{chunk-AS7RX4RK.mjs.map → chunk-FIO7MFHJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-SMN2QQ4Q.mjs.map → chunk-FP5DPRYL.mjs.map} +0 -0
- /package/dist/esm/{chunk-ZWH2ESXT.mjs.map → chunk-FVA2OPG4.mjs.map} +0 -0
- /package/dist/esm/{chunk-YLI6J47P.mjs.map → chunk-GIM5LIAP.mjs.map} +0 -0
- /package/dist/esm/{chunk-C3Y52GHM.mjs.map → chunk-HI6QP2FB.mjs.map} +0 -0
- /package/dist/esm/{chunk-RCYWJZR4.mjs.map → chunk-I7WRJY7K.mjs.map} +0 -0
- /package/dist/esm/{chunk-NLONZHYT.mjs.map → chunk-IHCIKE42.mjs.map} +0 -0
- /package/dist/esm/{chunk-NZ6RYGJQ.mjs.map → chunk-IZ4H63EF.mjs.map} +0 -0
- /package/dist/esm/{chunk-ZLYSA7JR.mjs.map → chunk-J2CXWDE7.mjs.map} +0 -0
- /package/dist/esm/{chunk-6MKBROIC.mjs.map → chunk-KVTWA3N3.mjs.map} +0 -0
- /package/dist/esm/{chunk-D2XLC3KK.mjs.map → chunk-KZID24G2.mjs.map} +0 -0
- /package/dist/esm/{chunk-OU4MEM5F.mjs.map → chunk-M7PXZWVX.mjs.map} +0 -0
- /package/dist/esm/{chunk-R3SAAJ2N.mjs.map → chunk-MSQ5V3EF.mjs.map} +0 -0
- /package/dist/esm/{chunk-IU5JZNH4.mjs.map → chunk-N4RBQZ2B.mjs.map} +0 -0
- /package/dist/esm/{chunk-OXO3Z2MF.mjs.map → chunk-NI7GRYCP.mjs.map} +0 -0
- /package/dist/esm/{chunk-GQI3HWOB.mjs.map → chunk-NWRKJFHV.mjs.map} +0 -0
- /package/dist/esm/{chunk-HQ4DGB7L.mjs.map → chunk-O57QZZF2.mjs.map} +0 -0
- /package/dist/esm/{chunk-SI6QMT4N.mjs.map → chunk-OZ3JUNJX.mjs.map} +0 -0
- /package/dist/esm/{chunk-6DYNAFAP.mjs.map → chunk-PPTG6BDV.mjs.map} +0 -0
- /package/dist/esm/{chunk-FGTQT7Q5.mjs.map → chunk-QKTV6AZ7.mjs.map} +0 -0
- /package/dist/esm/{chunk-7QJYTQSU.mjs.map → chunk-RNO5ZG3C.mjs.map} +0 -0
- /package/dist/esm/{chunk-BV6SCEXY.mjs.map → chunk-RSOBVX62.mjs.map} +0 -0
- /package/dist/esm/{chunk-F52GIFKT.mjs.map → chunk-S4QKXXBT.mjs.map} +0 -0
- /package/dist/esm/{chunk-N25GOEVL.mjs.map → chunk-SBMJNU2O.mjs.map} +0 -0
- /package/dist/esm/{chunk-TTDCRLRD.mjs.map → chunk-TKRPOJH3.mjs.map} +0 -0
- /package/dist/esm/{chunk-HDNJ4JK4.mjs.map → chunk-U2YE33UN.mjs.map} +0 -0
- /package/dist/esm/{chunk-NMFS5KAE.mjs.map → chunk-UCHGKGCF.mjs.map} +0 -0
- /package/dist/esm/{chunk-EHJEK7FU.mjs.map → chunk-V6JFR2CB.mjs.map} +0 -0
- /package/dist/esm/{chunk-VMCFN5CT.mjs.map → chunk-VRSUCKJA.mjs.map} +0 -0
- /package/dist/esm/{chunk-3QS3MFWJ.mjs.map → chunk-YVSIS6BA.mjs.map} +0 -0
- /package/dist/esm/{chunk-5HZKDT5C.mjs.map → chunk-ZFIMVSCR.mjs.map} +0 -0
- /package/dist/esm/{chunk-4VG7DV6F.mjs.map → chunk-ZLYF5TLK.mjs.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as s}from"./chunk-F7CR75CJ.mjs";import{g as n}from"./chunk-UFMUQN35.mjs";import{p as g,u as d}from"./chunk-BQSE5HHW.mjs";async function m(e){let{aptosConfig:t,poolAddress:o}=e,r=s.from(o).toStringLong(),i=await n({aptosConfig:t,query:{query:d,variables:{where_condition:{pool_address:{_eq:r}}}}});return i.num_active_delegator_per_pool[0]?i.num_active_delegator_per_pool[0].num_active_delegator:0}async function f(e){let{aptosConfig:t,options:o}=e,r={query:d,variables:{order_by:o?.orderBy}};return(await n({aptosConfig:t,query:r})).num_active_delegator_per_pool}async function A(e){let{aptosConfig:t,delegatorAddress:o,poolAddress:r}=e,a={query:g,variables:{delegatorAddress:s.from(o).toStringLong(),poolAddress:s.from(r).toStringLong()}};return(await n({aptosConfig:t,query:a})).delegated_staking_activities}export{m as a,f as b,A as c};
|
|
2
|
+
//# sourceMappingURL=chunk-CKWHFVGW.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-MSQ5V3EF.mjs";import{a as e}from"./chunk-3JPVQHOR.mjs";var n=()=>Math.floor(Date.now()/1e3),r=class{constructor(t,i,o,a,c){this.lastUncommintedNumber=null;this.currentNumber=null;this.lock=!1;this.aptosConfig=t,this.account=i,this.maxWaitTime=o,this.maximumInFlight=a,this.sleepTime=c}async nextSequenceNumber(){for(;this.lock;)await e(this.sleepTime);this.lock=!0;let t=BigInt(0);try{if((this.lastUncommintedNumber===null||this.currentNumber===null)&&await this.initialize(),this.currentNumber-this.lastUncommintedNumber>=this.maximumInFlight){await this.update();let i=n();for(;this.currentNumber-this.lastUncommintedNumber>=this.maximumInFlight;)await e(this.sleepTime),n()-i>this.maxWaitTime?(console.warn(`Waited over 30 seconds for a transaction to commit, resyncing ${this.account.accountAddress.toString()}`),await this.initialize()):await this.update()}t=this.currentNumber,this.currentNumber+=BigInt(1)}catch(i){console.error("error in getting next sequence number for this account",i)}finally{this.lock=!1}return t}async initialize(){let{sequence_number:t}=await s({aptosConfig:this.aptosConfig,accountAddress:this.account.accountAddress});this.currentNumber=BigInt(t),this.lastUncommintedNumber=BigInt(t)}async update(){let{sequence_number:t}=await s({aptosConfig:this.aptosConfig,accountAddress:this.account.accountAddress});return this.lastUncommintedNumber=BigInt(t),this.lastUncommintedNumber}async synchronize(){if(this.lastUncommintedNumber!==this.currentNumber){for(;this.lock;)await e(this.sleepTime);this.lock=!0;try{await this.update();let t=n();for(;this.lastUncommintedNumber!==this.currentNumber;)n()-t>this.maxWaitTime?(console.warn(`Waited over 30 seconds for a transaction to commit, resyncing ${this.account.accountAddress.toString()}`),await this.initialize()):(await e(this.sleepTime),await this.update())}catch(t){console.error("error in synchronizing this account sequence number with the one on chain",t)}finally{this.lock=!1}}}};export{r as a};
|
|
2
|
+
//# sourceMappingURL=chunk-E6NGWPZM.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as n}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as n}from"./chunk-IZ4H63EF.mjs";async function p(e){let{aptosConfig:t,overrides:s,params:r,contentType:o,acceptType:i,path:a,originMethod:u,type:R}=e,d=t.getRequestUrl(R);return n({url:d,method:"GET",originMethod:u,path:a,contentType:o?.valueOf(),acceptType:i?.valueOf(),params:r,overrides:{...t.clientConfig,...s}},t)}async function g(e){return p({...e,type:0})}async function f(e){let t=[],s,r=e.params;for(;;){r.start=s;let o=await p({type:0,aptosConfig:e.aptosConfig,originMethod:e.originMethod,path:e.path,params:r,overrides:e.overrides});if(s=o.headers["x-aptos-cursor"],delete o.headers,t.push(...o.data),s==null)break}return t}export{p as a,g as b,f as c};
|
|
2
|
+
//# sourceMappingURL=chunk-EK7YYYKL.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as o}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as o}from"./chunk-2QV6HI3M.mjs";import{a as p,b as g}from"./chunk-7IGH7N52.mjs";import{a as A}from"./chunk-UCHGKGCF.mjs";import{a as h}from"./chunk-FBFMQZTM.mjs";import{a as d,c as b}from"./chunk-ZFIMVSCR.mjs";import{a as y}from"./chunk-N4RBQZ2B.mjs";var n=class extends y{static deserialize(t){let i=t.deserializeUleb128AsU32();switch(i){case 0:return a.load(t);case 1:return u.load(t);case 2:return l.load(t);case 3:return c.load(t);default:throw new Error(`Unknown variant index for AccountAuthenticator: ${i}`)}}isEd25519(){return this instanceof a}isMultiEd25519(){return this instanceof u}isSingleKey(){return this instanceof l}isMultiKey(){return this instanceof c}},a=class s extends n{constructor(i,e){super();this.public_key=i,this.signature=e}serialize(i){i.serializeU32AsUleb128(0),this.public_key.serialize(i),this.signature.serialize(i)}static load(i){let e=d.deserialize(i),r=b.deserialize(i);return new s(e,r)}},u=class s extends n{constructor(i,e){super();this.public_key=i,this.signature=e}serialize(i){i.serializeU32AsUleb128(1),this.public_key.serialize(i),this.signature.serialize(i)}static load(i){let e=p.deserialize(i),r=g.deserialize(i);return new s(e,r)}},l=class s extends n{constructor(i,e){super();this.public_key=i,this.signature=e}serialize(i){i.serializeU32AsUleb128(2),this.public_key.serialize(i),this.signature.serialize(i)}static load(i){let e=h.deserialize(i),r=o.deserialize(i);return new s(e,r)}},c=class s extends n{constructor(i,e,r){super();this.public_keys=i,this.signatures=e,this.signatures_bitmap=r}serialize(i){i.serializeU32AsUleb128(3),this.public_keys.serialize(i),i.serializeVector(this.signatures),i.serializeBytes(this.signatures_bitmap)}static load(i){let e=A.deserialize(i),r=i.deserializeVector(o),z=i.deserializeBytes();return new s(e,r,z)}};export{n as a,a as b,u as c,l as d,c as e};
|
|
2
|
+
//# sourceMappingURL=chunk-ERWQOVBF.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a}from"./chunk-N4RBQZ2B.mjs";import{a as i}from"./chunk-FBPNHF54.mjs";import{bytesToHex as o,hexToBytes as l}from"@noble/hashes/utils";var h=(s=>(s.INCORRECT_NUMBER_OF_BYTES="incorrect_number_of_bytes",s.INVALID_HEX_CHARS="invalid_hex_chars",s.TOO_SHORT="too_short",s.TOO_LONG="too_long",s.LEADING_ZERO_X_REQUIRED="leading_zero_x_required",s.LONG_FORM_REQUIRED_UNLESS_SPECIAL="long_form_required_unless_special",s.INVALID_PADDING_ZEROES="INVALID_PADDING_ZEROES",s))(h||{}),r=class r extends a{constructor(t){super();if(t.length!==r.LENGTH)throw new i("AccountAddress data should be exactly 32 bytes long","incorrect_number_of_bytes");this.data=t}isSpecial(){return this.data.slice(0,this.data.length-1).every(t=>t===0)&&this.data[this.data.length-1]<16}toString(){return`0x${this.toStringWithoutPrefix()}`}toStringWithoutPrefix(){let t=o(this.data);return this.isSpecial()&&(t=t[t.length-1]),t}toStringLong(){return`0x${this.toStringLongWithoutPrefix()}`}toStringLongWithoutPrefix(){return o(this.data)}toUint8Array(){return this.data}serialize(t){t.serializeFixedBytes(this.data)}serializeForEntryFunction(t){let e=this.bcsToBytes();t.serializeBytes(e)}serializeForScriptFunction(t){t.serializeU32AsUleb128(3),t.serialize(this)}static deserialize(t){let e=t.deserializeFixedBytes(r.LENGTH);return new r(e)}static fromStringStrict(t){if(!t.startsWith("0x"))throw new i("Hex string must start with a leading 0x.","leading_zero_x_required");let e=r.fromString(t);if(t.length!==r.LONG_STRING_LENGTH+2)if(e.isSpecial()){if(t.length!==3)throw new i(`The given hex string ${t} is a special address not in LONG form, it must be 0x0 to 0xf without padding zeroes.`,"INVALID_PADDING_ZEROES")}else throw new i(`The given hex string ${t} is not a special address, it must be represented as 0x + 64 chars.`,"long_form_required_unless_special");return e}static fromString(t){let e=t;if(t.startsWith("0x")&&(e=t.slice(2)),e.length===0)throw new i("Hex string is too short, must be 1 to 64 chars long, excluding the leading 0x.","too_short");if(e.length>64)throw new i("Hex string is too long, must be 1 to 64 chars long, excluding the leading 0x.","too_long");let n;try{n=l(e.padStart(64,"0"))}catch(d){throw new i(`Hex characters are invalid: ${d?.message}`,"invalid_hex_chars")}return new r(n)}static from(t){return t instanceof r?t:t instanceof Uint8Array?new r(t):r.fromString(t)}static fromStrict(t){return t instanceof r?t:t instanceof Uint8Array?new r(t):r.fromStringStrict(t)}static isValid(t){try{return t.strict?r.fromStrict(t.input):r.from(t.input),{valid:!0}}catch(e){return{valid:!1,invalidReason:e?.invalidReason,invalidReasonMessage:e?.message}}}equals(t){return this.data.length!==t.data.length?!1:this.data.every((e,n)=>e===t.data[n])}};r.LENGTH=32,r.LONG_STRING_LENGTH=64,r.ZERO=r.from("0x0"),r.ONE=r.from("0x1"),r.TWO=r.from("0x2"),r.THREE=r.from("0x3"),r.FOUR=r.from("0x4");var c=r;export{h as a,c as b};
|
|
2
|
+
//# sourceMappingURL=chunk-F7CR75CJ.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as l,b as s,c as u,d as c,e as d,f as m,g as U}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as l,b as s,c as u,d as c,e as d,f as m,g as U}from"./chunk-VRSUCKJA.mjs";import{a as o}from"./chunk-N4RBQZ2B.mjs";import{b as z}from"./chunk-NL72WE3E.mjs";var t=class n extends o{constructor(e){super();this.values=e}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){if(!(this.values[0]instanceof s)&&this.values[0]!==void 0)throw new Error("Script function arguments only accept u8 vectors");e.serializeU32AsUleb128(4),e.serialize(this)}static U8(e){let r;if(Array.isArray(e)&&typeof e[0]=="number")r=e;else if(typeof e=="string"){let i=z.fromHexInput(e);r=Array.from(i.toUint8Array())}else if(e instanceof Uint8Array)r=Array.from(e);else throw new Error("Invalid input type");return new n(r.map(i=>new s(i)))}static U16(e){return new n(e.map(r=>new u(r)))}static U32(e){return new n(e.map(r=>new c(r)))}static U64(e){return new n(e.map(r=>new d(r)))}static U128(e){return new n(e.map(r=>new m(r)))}static U256(e){return new n(e.map(r=>new U(r)))}static Bool(e){return new n(e.map(r=>new l(r)))}static MoveString(e){return new n(e.map(r=>new a(r)))}serialize(e){e.serializeVector(this.values)}static deserialize(e,r){let i=e.deserializeUleb128AsU32(),y=new Array;for(let w=0;w<i;w+=1)y.push(r.deserialize(e));return new n(y)}},a=class n extends o{constructor(e){super();this.value=e}serialize(e){e.serializeStr(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){let r=this.bcsToBytes().slice(1);t.U8(r).serializeForScriptFunction(e)}static deserialize(e){return new n(e.deserializeStr())}},f=class n extends o{constructor(e){super();typeof e<"u"&&e!==null?this.vec=new t([e]):this.vec=new t([]),[this.value]=this.vec.values}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}unwrap(){if(this.isSome())return this.vec.values[0];throw new Error("Called unwrap on a MoveOption with no value")}isSome(){return this.vec.values.length===1}serialize(e){this.vec.serialize(e)}static U8(e){return new n(e!=null?new s(e):void 0)}static U16(e){return new n(e!=null?new u(e):void 0)}static U32(e){return new n(e!=null?new c(e):void 0)}static U64(e){return new n(e!=null?new d(e):void 0)}static U128(e){return new n(e!=null?new m(e):void 0)}static U256(e){return new n(e!=null?new U(e):void 0)}static Bool(e){return new n(e!=null?new l(e):void 0)}static MoveString(e){return new n(e!=null?new a(e):void 0)}static deserialize(e,r){let i=t.deserialize(e,r);return new n(i.values[0])}};export{t as a,a as b,f as c};
|
|
2
|
+
//# sourceMappingURL=chunk-F7MOQC7Z.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as r}from"./chunk-ZFIMVSCR.mjs";import{a as t}from"./chunk-I7WRJY7K.mjs";import{a as s}from"./chunk-V6JFR2CB.mjs";var c=class n extends s{constructor(e){super();this.publicKey=e}toUint8Array(){return this.publicKey.toUint8Array()}toString(){return this.publicKey.toString()}verifySignature(e){let{message:i,signature:u}=e;return this.publicKey.verifySignature({message:i,signature:u})}serialize(e){if(this.publicKey instanceof r)e.serializeU32AsUleb128(0),this.publicKey.serialize(e);else if(this.publicKey instanceof t)e.serializeU32AsUleb128(1),this.publicKey.serialize(e);else throw new Error("Unknown public key type")}static deserialize(e){let i=e.deserializeUleb128AsU32();switch(i){case 0:return new n(r.load(e));case 1:return new n(t.load(e));default:throw new Error(`Unknown variant index for AnyPublicKey: ${i}`)}}static isPublicKey(e){return e instanceof n}isEd25519(){return this.publicKey instanceof r}isSecp256k1PublicKey(){return this.publicKey instanceof t}};export{c as a};
|
|
2
|
+
//# sourceMappingURL=chunk-FBFMQZTM.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as l}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as l}from"./chunk-E6NGWPZM.mjs";import{a as o,b as c}from"./chunk-U6Z4FNB7.mjs";import{a as h,h as d}from"./chunk-AA4ETD22.mjs";import{f as u}from"./chunk-6EUKJGSP.mjs";var p="fulfilled",f=class{constructor(t,n,e=30,s=100,r=10){this.taskQueue=new o;this.transactionsQueue=new o;this.outstandingTransactions=new o;this.sentTransactions=[];this.executedTransactions=[];this.aptosConfig=t,this.account=n,this.started=!1,this.accountSequnceNumber=new l(t,n,e,s,r)}async submitNextTransaction(){try{for(;;){if(this.transactionsQueue.isEmpty())return;let t=await this.accountSequnceNumber.nextSequenceNumber();if(t===null)return;let n=await this.generateNextTransaction(this.account,t);if(!n)return;let e=d({aptosConfig:this.aptosConfig,transaction:n,signer:this.account});await this.outstandingTransactions.enqueue([e,t])}}catch(t){if(t instanceof c)return;throw new Error(`Submit transaction failed for ${this.account.accountAddress.toString()} with error ${t}`)}}async processTransactions(){try{for(;;){let t=[],n=[],[e,s]=await this.outstandingTransactions.dequeue();for(t.push(e),n.push(s);!this.outstandingTransactions.isEmpty();)[e,s]=await this.outstandingTransactions.dequeue(),t.push(e),n.push(s);let r=await Promise.allSettled(t);for(let a=0;a<r.length&&a<n.length;a+=1){let i=r[a];s=n[a],i.status===p?(this.sentTransactions.push([i.value.hash,s,null]),await this.checkTransaction(i,s)):this.sentTransactions.push([i.status,s,i.reason])}}}catch(t){if(t instanceof c)return;throw new Error(`Process execution failed for ${this.account.accountAddress.toString()} with error ${t}`)}}async checkTransaction(t,n){try{let e=[];e.push(u({aptosConfig:this.aptosConfig,transactionHash:t.value.hash}));let s=await Promise.allSettled(e);for(let r=0;r<s.length;r+=1){let a=s[r];a.status===p?this.executedTransactions.push([a.value.hash,n,null]):this.executedTransactions.push([a.status,n,a.reason])}}catch(e){throw new Error(`Check transaction failed for ${this.account.accountAddress.toString()} with error ${e}`)}}async push(t,n){await this.transactionsQueue.enqueue([t,n])}async generateNextTransaction(t,n){if(this.transactionsQueue.isEmpty())return;let[e,s]=await this.transactionsQueue.dequeue();return await h({aptosConfig:this.aptosConfig,sender:t.accountAddress,data:e,options:{...s,accountSequenceNumber:n}})}async run(){try{for(;!this.taskQueue.isCancelled();)await(await this.taskQueue.dequeue())()}catch(t){throw new Error(`Unable to start transaction batching: ${t}`)}}start(){if(this.started)throw new Error("worker has already started");this.started=!0,this.taskQueue.enqueue(()=>this.submitNextTransaction()),this.taskQueue.enqueue(()=>this.processTransactions()),this.run()}stop(){if(this.taskQueue.isCancelled())throw new Error("worker has already stopped");this.started=!1,this.taskQueue.cancel()}};export{f as a};
|
|
2
|
+
//# sourceMappingURL=chunk-FIO7MFHJ.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as u}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as u}from"./chunk-SBMJNU2O.mjs";import{a as K}from"./chunk-7IGH7N52.mjs";import{a as n}from"./chunk-FBFMQZTM.mjs";import{a as p,b as o}from"./chunk-ZFIMVSCR.mjs";import{a as d,b as y}from"./chunk-I7WRJY7K.mjs";import{b as l}from"./chunk-NL72WE3E.mjs";var g=class a{constructor(t){let{privateKey:e,address:i,legacy:r}=t,c=r??!0;if(this.publicKey=e.publicKey(),this.publicKey instanceof p)c?this.signingScheme=0:(this.publicKey=new n(this.publicKey),this.signingScheme=2);else if(this.publicKey instanceof K)this.signingScheme=1;else if(this.publicKey instanceof d)this.publicKey=new n(this.publicKey),this.signingScheme=2;else throw new Error("Can not create new Account, unsupported public key type");this.privateKey=e,this.accountAddress=i}static generate(t){let e=t?.legacy??!0,i,r;switch(t?.scheme){case 2:i=y.generate(),r=new n(i.publicKey());break;default:i=o.generate(),e===!1?r=new n(i.publicKey()):r=i.publicKey()}let s=u.fromPublicKey({publicKey:r}).derivedAddress();return new a({privateKey:i,address:s,legacy:t?.legacy})}static fromPrivateKey(t){let{privateKey:e,legacy:i}=t,r=i??!0,c;if(e instanceof y)c=new n(e.publicKey());else if(e instanceof o)r?c=e.publicKey():c=new n(e.publicKey());else throw new Error(`Unsupported private key ${e}`);let m=u.fromPublicKey({publicKey:c}).derivedAddress();return new a({privateKey:e,address:m,legacy:r})}static fromPrivateKeyAndAddress(t){let{privateKey:e,address:i,legacy:r}=t;return new a({privateKey:e,address:i,legacy:r})}static fromDerivationPath(t){let{path:e,mnemonic:i,scheme:r,legacy:c}=t,s;switch(r){case 2:s=y.fromDerivationPath(e,i);break;case 0:s=o.fromDerivationPath(e,i);break;default:throw new Error(`Unsupported scheme ${r}`)}return a.fromPrivateKey({privateKey:s,legacy:c})}static authKey(t){let{publicKey:e}=t;return u.fromPublicKey({publicKey:e})}sign(t){return this.privateKey.sign(t)}verifySignature(t){let{message:e,signature:i}=t,r=l.fromHexInput(e).toUint8Array();return this.publicKey.verifySignature({message:r,signature:i})}};export{g as a};
|
|
2
|
+
//# sourceMappingURL=chunk-FP5DPRYL.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
var h=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var j=(g,b,d,c)=>{for(var a=c>1?void 0:c?i(b,d):b,e=g.length-1,f;e>=0;e--)(f=g[e])&&(a=(c?f(b,d,a):f(a))||a);return c&&a&&h(b,d,a),a};export{j as a};
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
//# sourceMappingURL=chunk-FVA2OPG4.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as i}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as i}from"./chunk-ZLYF5TLK.mjs";import{g as t}from"./chunk-6EUKJGSP.mjs";var r=class{constructor(o){this.config=o}async fundAccount(o){let n=await i({aptosConfig:this.config,...o});return o.options?.waitForIndexer!==!1&&await t({aptosConfig:this.config,minimumLedgerVersion:BigInt(n.version)}),n}};export{r as a};
|
|
2
|
+
//# sourceMappingURL=chunk-GIM5LIAP.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/version.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * The current version of the SDK\n *\n * hardcoded for now, we would want to have it injected dynamically\n */\nexport const VERSION = \"1.
|
|
1
|
+
{"version":3,"sources":["../../src/version.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * The current version of the SDK\n *\n * hardcoded for now, we would want to have it injected dynamically\n */\nexport const VERSION = \"1.3.0\";\n"],"mappings":"AAQO,IAAMA,EAAU","names":["VERSION"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var S=(E=>(E[E.FULLNODE=0]="FULLNODE",E[E.INDEXER=1]="INDEXER",E[E.FAUCET=2]="FAUCET",E))(S||{}),n="devnet",o=2e5,N=20,T=20,A="0x1::aptos_coin::AptosCoin",a="APTOS::RawTransaction",r="APTOS::RawTransactionWithData",t=(_=>(_.ACCOUNT_TRANSACTION_PROCESSOR="account_transactions_processor",_.DEFAULT="default_processor",_.EVENTS_PROCESSOR="events_processor",_.FUNGIBLE_ASSET_PROCESSOR="fungible_asset_processor",_.STAKE_PROCESSOR="stake_processor",_.TOKEN_V2_PROCESSOR="token_v2_processor",_.USER_TRANSACTION_PROCESSOR="user_transaction_processor",_))(t||{});export{S as a,n as b,o as c,N as d,T as e,A as f,a as g,r as h,t as i};
|
|
2
|
+
//# sourceMappingURL=chunk-HHJBCGAQ.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/const.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Network } from \"./apiEndpoints\";\n\n/**\n * Type of API endpoint for request routing\n */\nexport enum AptosApiType {\n FULLNODE,\n INDEXER,\n FAUCET,\n}\n\nexport const DEFAULT_NETWORK = Network.DEVNET;\n\n/**\n * The default max gas amount when none is given.\n *\n * This is the maximum number of gas units that will be used by a transaction before being rejected.\n *\n * Note that max gas amount varies based on the transaction. A larger transaction will go over this\n * default gas amount, and the value will need to be changed for the specific transaction.\n */\nexport const DEFAULT_MAX_GAS_AMOUNT = 200000;\n\n/**\n * The default transaction expiration seconds from now.\n *\n * This time is how long until the blockchain nodes will reject the transaction.\n *\n * Note that the transaction expiration time varies based on network connection and network load. It may need to be\n * increased for the transaction to be processed.\n */\nexport const DEFAULT_TXN_EXP_SEC_FROM_NOW = 20;\n\n/**\n * The default number of seconds to wait for a transaction to be processed.\n *\n * This time is the amount of time that the SDK will wait for a transaction to be processed when waiting for\n * the results of the transaction. It may take longer based on network connection and network load.\n */\nexport const DEFAULT_TXN_TIMEOUT_SEC = 20;\n\n/**\n * The default gas currency for the network.\n */\nexport const APTOS_COIN = \"0x1::aptos_coin::AptosCoin\";\n\nexport const RAW_TRANSACTION_SALT = \"APTOS::RawTransaction\";\nexport const RAW_TRANSACTION_WITH_DATA_SALT = \"APTOS::RawTransactionWithData\";\n\n/**\n * The list of supported Processor types for our indexer api.\n *\n * These can be found from the processor_status table in the indexer database.\n * {@link https://cloud.hasura.io/public/graphiql?endpoint=https://indexer.mainnet.aptoslabs.com/v1/graphql}\n */\nexport enum ProcessorType {\n ACCOUNT_TRANSACTION_PROCESSOR = \"account_transactions_processor\",\n
|
|
1
|
+
{"version":3,"sources":["../../src/utils/const.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Network } from \"./apiEndpoints\";\n\n/**\n * Type of API endpoint for request routing\n */\nexport enum AptosApiType {\n FULLNODE,\n INDEXER,\n FAUCET,\n}\n\nexport const DEFAULT_NETWORK = Network.DEVNET;\n\n/**\n * The default max gas amount when none is given.\n *\n * This is the maximum number of gas units that will be used by a transaction before being rejected.\n *\n * Note that max gas amount varies based on the transaction. A larger transaction will go over this\n * default gas amount, and the value will need to be changed for the specific transaction.\n */\nexport const DEFAULT_MAX_GAS_AMOUNT = 200000;\n\n/**\n * The default transaction expiration seconds from now.\n *\n * This time is how long until the blockchain nodes will reject the transaction.\n *\n * Note that the transaction expiration time varies based on network connection and network load. It may need to be\n * increased for the transaction to be processed.\n */\nexport const DEFAULT_TXN_EXP_SEC_FROM_NOW = 20;\n\n/**\n * The default number of seconds to wait for a transaction to be processed.\n *\n * This time is the amount of time that the SDK will wait for a transaction to be processed when waiting for\n * the results of the transaction. It may take longer based on network connection and network load.\n */\nexport const DEFAULT_TXN_TIMEOUT_SEC = 20;\n\n/**\n * The default gas currency for the network.\n */\nexport const APTOS_COIN = \"0x1::aptos_coin::AptosCoin\";\n\nexport const RAW_TRANSACTION_SALT = \"APTOS::RawTransaction\";\nexport const RAW_TRANSACTION_WITH_DATA_SALT = \"APTOS::RawTransactionWithData\";\n\n/**\n * The list of supported Processor types for our indexer api.\n *\n * These can be found from the processor_status table in the indexer database.\n * {@link https://cloud.hasura.io/public/graphiql?endpoint=https://indexer.mainnet.aptoslabs.com/v1/graphql}\n */\nexport enum ProcessorType {\n ACCOUNT_TRANSACTION_PROCESSOR = \"account_transactions_processor\",\n DEFAULT = \"default_processor\",\n EVENTS_PROCESSOR = \"events_processor\",\n // Fungible asset processor also handles coins\n FUNGIBLE_ASSET_PROCESSOR = \"fungible_asset_processor\",\n STAKE_PROCESSOR = \"stake_processor\",\n // Token V2 processor replaces Token processor (not only for digital assets)\n TOKEN_V2_PROCESSOR = \"token_v2_processor\",\n USER_TRANSACTION_PROCESSOR = \"user_transaction_processor\",\n}\n"],"mappings":"AAQO,IAAKA,OACVA,IAAA,uBACAA,IAAA,qBACAA,IAAA,mBAHUA,OAAA,IAMCC,WAUAC,EAAyB,IAUzBC,EAA+B,GAQ/BC,EAA0B,GAK1BC,EAAa,6BAEbC,EAAuB,wBACvBC,EAAiC,gCAQlCC,OACVA,EAAA,8BAAgC,iCAChCA,EAAA,QAAU,oBACVA,EAAA,iBAAmB,mBAEnBA,EAAA,yBAA2B,2BAC3BA,EAAA,gBAAkB,kBAElBA,EAAA,mBAAqB,qBACrBA,EAAA,2BAA6B,6BATnBA,OAAA","names":["AptosApiType","DEFAULT_NETWORK","DEFAULT_MAX_GAS_AMOUNT","DEFAULT_TXN_EXP_SEC_FROM_NOW","DEFAULT_TXN_TIMEOUT_SEC","APTOS_COIN","RAW_TRANSACTION_SALT","RAW_TRANSACTION_WITH_DATA_SALT","ProcessorType"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a}from"./chunk-IHCIKE42.mjs";import{b as n}from"./chunk-F7CR75CJ.mjs";import{a as x}from"./chunk-N4RBQZ2B.mjs";var t=class extends x{static deserialize(e){let r=e.deserializeUleb128AsU32();switch(r){case 0:return u.load(e);case 1:return c.load(e);case 2:return p.load(e);case 3:return z.load(e);case 4:return S.load(e);case 5:return U.load(e);case 6:return y.load(e);case 7:return b.load(e);case 8:return d.load(e);case 9:return g.load(e);case 10:return T.load(e);case 255:return h.load(e);default:throw new Error(`Unknown variant index for TypeTag: ${r}`)}}isBool(){return this instanceof u}isAddress(){return this instanceof S}isGeneric(){return this instanceof h}isSigner(){return this instanceof U}isVector(){return this instanceof y}isStruct(){return this instanceof b}isU8(){return this instanceof c}isU16(){return this instanceof d}isU32(){return this instanceof g}isU64(){return this instanceof p}isU128(){return this instanceof z}isU256(){return this instanceof T}},u=class i extends t{toString(){return"bool"}serialize(e){e.serializeU32AsUleb128(0)}static load(e){return new i}},c=class i extends t{toString(){return"u8"}serialize(e){e.serializeU32AsUleb128(1)}static load(e){return new i}},d=class i extends t{toString(){return"u16"}serialize(e){e.serializeU32AsUleb128(8)}static load(e){return new i}},g=class i extends t{toString(){return"u32"}serialize(e){e.serializeU32AsUleb128(9)}static load(e){return new i}},p=class i extends t{toString(){return"u64"}serialize(e){e.serializeU32AsUleb128(2)}static load(e){return new i}},z=class i extends t{toString(){return"u128"}serialize(e){e.serializeU32AsUleb128(3)}static load(e){return new i}},T=class i extends t{toString(){return"u256"}serialize(e){e.serializeU32AsUleb128(10)}static load(e){return new i}},S=class i extends t{toString(){return"address"}serialize(e){e.serializeU32AsUleb128(4)}static load(e){return new i}},U=class i extends t{toString(){return"signer"}serialize(e){e.serializeU32AsUleb128(5)}static load(e){return new i}},f=class i extends t{constructor(r){super();this.value=r}toString(){return`&${this.value.toString()}`}serialize(r){r.serializeU32AsUleb128(254)}static load(r){let s=t.deserialize(r);return new i(s)}},h=class i extends t{constructor(r){super();this.value=r;if(r<0)throw new Error("Generic type parameter index cannot be negative")}toString(){return`T${this.value}`}serialize(r){r.serializeU32AsUleb128(255),r.serializeU32(this.value)}static load(r){let s=r.deserializeU32();return new i(s)}},y=class i extends t{constructor(r){super();this.value=r}toString(){return`vector<${this.value.toString()}>`}serialize(r){r.serializeU32AsUleb128(6),this.value.serialize(r)}static load(r){let s=t.deserialize(r);return new i(s)}},b=class i extends t{constructor(r){super();this.value=r}toString(){let r="";return this.value.typeArgs.length>0&&(r=`<${this.value.typeArgs.map(s=>s.toString()).join(", ")}>`),`${this.value.address.toString()}::${this.value.moduleName.identifier}::${this.value.name.identifier}${r}`}serialize(r){r.serializeU32AsUleb128(7),this.value.serialize(r)}static load(r){let s=o.deserialize(r);return new i(s)}isTypeTag(r,s,l){return this.value.moduleName.identifier===s&&this.value.name.identifier===l&&this.value.address.equals(r)}isString(){return this.isTypeTag(n.ONE,"string","String")}isOption(){return this.isTypeTag(n.ONE,"option","Option")}isObject(){return this.isTypeTag(n.ONE,"object","Object")}},o=class i extends x{constructor(r,s,l,v){super();this.address=r,this.moduleName=s,this.name=l,this.typeArgs=v}serialize(r){r.serialize(this.address),r.serialize(this.moduleName),r.serialize(this.name),r.serializeVector(this.typeArgs)}static deserialize(r){let s=n.deserialize(r),l=a.deserialize(r),v=a.deserialize(r),A=r.deserializeVector(t);return new i(s,l,v,A)}};function E(){return new o(n.ONE,new a("aptos_coin"),new a("AptosCoin"),[])}function j(){return new o(n.ONE,new a("string"),new a("String"),[])}function V(i){return new o(n.ONE,new a("option"),new a("Option"),[i])}function G(i){return new o(n.ONE,new a("object"),new a("Object"),[i])}export{t as a,u as b,c,d,g as e,p as f,z as g,T as h,S as i,U as j,f as k,h as l,y as m,b as n,o,E as p,j as q,V as r,G as s};
|
|
2
|
+
//# sourceMappingURL=chunk-HI6QP2FB.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as p,b as g,c as h}from"./chunk-V6JFR2CB.mjs";import{e as d,j as m}from"./chunk-LR65XHSF.mjs";import{b as s}from"./chunk-NL72WE3E.mjs";import{sha3_256 as f}from"@noble/hashes/sha3";import{secp256k1 as o}from"@noble/curves/secp256k1";import{HDKey as H}from"@scure/bip32";var i=class i extends p{constructor(e){super();let t=s.fromHexInput(e);if(t.toUint8Array().length!==i.LENGTH)throw new Error(`PublicKey length should be ${i.LENGTH}`);this.key=t}toUint8Array(){return this.key.toUint8Array()}toString(){return this.key.toString()}verifySignature(e){let{message:t,signature:a}=e,y=s.fromHexInput(t).toUint8Array(),v=f(y),x=a.toUint8Array();return o.verify(x,v,this.toUint8Array())}serialize(e){e.serializeBytes(this.key.toUint8Array())}static deserialize(e){let t=e.deserializeBytes();return new i(t)}static load(e){let t=e.deserializeBytes();return new i(t)}static isPublicKey(e){return e instanceof i}};i.LENGTH=65;var u=i,r=class r extends g{constructor(e){super();let t=s.fromHexInput(e);if(t.toUint8Array().length!==r.LENGTH)throw new Error(`PrivateKey length should be ${r.LENGTH}`);this.key=t}toUint8Array(){return this.key.toUint8Array()}toString(){return this.key.toString()}sign(e){let t=s.fromHexInput(e),a=f(t.toUint8Array()),y=o.sign(a,this.key.toUint8Array());return new c(y.toCompactRawBytes())}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let t=e.deserializeBytes();return new r(t)}static generate(){let e=o.utils.randomPrivateKey();return new r(e)}publicKey(){let e=o.getPublicKey(this.key.toUint8Array(),!1);return new u(e)}static fromDerivationPath(e,t){if(!d(e))throw new Error(`Invalid derivation path ${e}`);return r.fromDerivationPathInner(e,m(t))}static fromDerivationPathInner(e,t){let{privateKey:a}=H.fromMasterSeed(t).derive(e);if(a===null)throw new Error("Invalid key");return new r(a)}static isPrivateKey(e){return e instanceof r}};r.LENGTH=32;var S=r,n=class n extends h{constructor(e){super();let t=s.fromHexInput(e);if(t.toUint8Array().length!==n.LENGTH)throw new Error(`Signature length should be ${n.LENGTH}, recieved ${t.toUint8Array().length}`);this.data=t}toUint8Array(){return this.data.toUint8Array()}toString(){return this.data.toString()}serialize(e){e.serializeBytes(this.data.toUint8Array())}static deserialize(e){let t=e.deserializeBytes();return new n(t)}static load(e){let t=e.deserializeBytes();return new n(t)}static isSignature(e){return e instanceof n}};n.LENGTH=64;var c=n;export{u as a,S as b,c};
|
|
2
|
+
//# sourceMappingURL=chunk-I7WRJY7K.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as e}from"./chunk-N4RBQZ2B.mjs";var r=class t extends e{constructor(i){super();this.identifier=i}serialize(i){i.serializeStr(this.identifier)}static deserialize(i){let s=i.deserializeStr();return new t(s)}};export{r as a};
|
|
2
|
+
//# sourceMappingURL=chunk-IHCIKE42.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as d}from"./chunk-6FBKUTGF.mjs";import{a as R}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as d}from"./chunk-6FBKUTGF.mjs";import{a as R}from"./chunk-HGC2PEHW.mjs";var p={400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",429:"Too Many Requests",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable"};async function c(n,a){let{url:o,method:u,body:i,contentType:s,params:e,overrides:t}=n,r={...t?.HEADERS,"x-aptos-client":`aptos-typescript-sdk/${R}`,"content-type":s??"application/json"};return t?.AUTH_TOKEN&&o.includes("faucet")&&(r.Authorization=`Bearer ${t?.AUTH_TOKEN}`),t?.API_KEY&&!o.includes("faucet")&&(r.Authorization=`Bearer ${t?.API_KEY}`),a.provider({url:o,method:u,body:i,params:e,headers:r,overrides:t})}async function T(n,a){let{url:o,path:u}=n,i=`${o}/${u??""}`,s=await c({...n,url:i},a.client),e={status:s.status,statusText:s.statusText,data:s.data,headers:s.headers,config:s.config,request:s.request,url:i};if(a.isIndexerRequest(o)){let r=e.data;if(r.errors)throw new d(n,e,r.errors[0].message??`Unhandled Error ${s.status} : ${s.statusText}`);e.data=r.data}if(e.status>=200&&e.status<300)return e;let t;throw e&&e.data&&"message"in e.data&&"error_code"in e.data?t=JSON.stringify(e.data):e.status in p?t=p[e.status]:t=`Unhandled Error ${e.status} : ${e.statusText}`,new d(n,e,t)}export{c as a,T as b};
|
|
2
|
+
//# sourceMappingURL=chunk-IZ4H63EF.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as o}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as o}from"./chunk-IZ4H63EF.mjs";async function s(e){let{type:p,originMethod:n,path:i,body:r,acceptType:R,contentType:y,params:u,aptosConfig:t,overrides:m}=e,c=t.getRequestUrl(p);return o({url:c,method:"POST",originMethod:n,path:i,body:r,contentType:y?.valueOf(),acceptType:R?.valueOf(),params:u,overrides:{...t.clientConfig,...m}},t)}async function A(e){return s({...e,type:0})}async function f(e){return s({...e,type:1})}async function x(e){return s({...e,type:2})}export{s as a,A as b,f as c,x as d};
|
|
2
|
+
//# sourceMappingURL=chunk-J2CXWDE7.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as i}from"./chunk-6EMN3BOV.mjs";import{g as a}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as i}from"./chunk-6EMN3BOV.mjs";import{g as a}from"./chunk-AA4ETD22.mjs";import{a as o}from"./chunk-FVA2OPG4.mjs";var n=class{constructor(t){this.config=t}async simple(t){return a({aptosConfig:this.config,...t})}async multiAgent(t){return a({aptosConfig:this.config,...t})}};o([i],n.prototype,"simple",1),o([i],n.prototype,"multiAgent",1);export{n as a};
|
|
2
|
+
//# sourceMappingURL=chunk-KVTWA3N3.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as r}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as r}from"./chunk-F7CR75CJ.mjs";import{g as d}from"./chunk-UFMUQN35.mjs";import{q as c}from"./chunk-BQSE5HHW.mjs";async function v(o){let{accountAddress:t,aptosConfig:e,creationNumber:n}=o,i={account_address:{_eq:r.from(t).toStringLong()},creation_number:{_eq:n}};return p({aptosConfig:e,options:{where:i}})}async function y(o){let{accountAddress:t,aptosConfig:e,eventType:n,options:s}=o,a={where:{account_address:{_eq:r.from(t).toStringLong()},indexed_type:{_eq:n}},pagination:s,orderBy:s?.orderBy};return p({aptosConfig:e,options:a})}async function p(o){let{aptosConfig:t,options:e}=o,n={query:c,variables:{where_condition:e?.where,offset:e?.offset,limit:e?.limit,order_by:e?.orderBy}};return(await d({aptosConfig:t,query:n,originMethod:"getEvents"})).events}export{v as a,y as b,p as c};
|
|
2
|
+
//# sourceMappingURL=chunk-KZID24G2.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as s}from"./chunk-6EMN3BOV.mjs";import{f as r}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as s}from"./chunk-6EMN3BOV.mjs";import{f as r}from"./chunk-AA4ETD22.mjs";import{a as o}from"./chunk-FVA2OPG4.mjs";var i=class{constructor(n){this.config=n}async simple(n){return r({aptosConfig:this.config,...n})}async multiAgent(n){return r({aptosConfig:this.config,...n})}};o([s],i.prototype,"simple",1),o([s],i.prototype,"multiAgent",1);export{i as a};
|
|
2
|
+
//# sourceMappingURL=chunk-M7PXZWVX.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as f}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as f}from"./chunk-FP5DPRYL.mjs";import{a as p}from"./chunk-SBMJNU2O.mjs";import{a as _}from"./chunk-FBFMQZTM.mjs";import{b as y}from"./chunk-ZFIMVSCR.mjs";import{b as m}from"./chunk-I7WRJY7K.mjs";import{b as c}from"./chunk-F7CR75CJ.mjs";import{a as S}from"./chunk-AH44UPM4.mjs";import{d as b,g as d}from"./chunk-UFMUQN35.mjs";import{d as C,e as h,f as w,g as k,h as T,j as O,k as q,l as v}from"./chunk-BQSE5HHW.mjs";import{b as g,c as A}from"./chunk-EK7YYYKL.mjs";import{a as l}from"./chunk-6FBKUTGF.mjs";async function M(e){let{aptosConfig:n,accountAddress:t}=e,{data:o}=await g({aptosConfig:n,originMethod:"getInfo",path:`accounts/${c.from(t).toString()}`});return o}async function io(e){let{aptosConfig:n,accountAddress:t,options:o}=e;return A({aptosConfig:n,originMethod:"getModules",path:`accounts/${c.from(t).toString()}/modules`,params:{ledger_version:o?.ledgerVersion,start:o?.offset,limit:o?.limit??1e3}})}async function uo(e){return e.options?.ledgerVersion!==void 0?P(e):S(async()=>P(e),`module-${e.accountAddress}-${e.moduleName}`,1e3*60*5)()}async function P(e){let{aptosConfig:n,accountAddress:t,moduleName:o,options:r}=e,{data:s}=await g({aptosConfig:n,originMethod:"getModule",path:`accounts/${c.from(t).toString()}/module/${o}`,params:{ledger_version:r?.ledgerVersion}});return s}async function go(e){let{aptosConfig:n,accountAddress:t,options:o}=e;return A({aptosConfig:n,originMethod:"getTransactions",path:`accounts/${c.from(t).toString()}/transactions`,params:{start:o?.offset,limit:o?.limit}})}async function Ao(e){let{aptosConfig:n,accountAddress:t,options:o}=e;return A({aptosConfig:n,originMethod:"getResources",path:`accounts/${c.from(t).toString()}/resources`,params:{ledger_version:o?.ledgerVersion,start:o?.offset,limit:o?.limit??999}})}async function K(e){let{aptosConfig:n,accountAddress:t,resourceType:o,options:r}=e,{data:s}=await g({aptosConfig:n,originMethod:"getResource",path:`accounts/${c.from(t).toString()}/resource/${o}`,params:{ledger_version:r?.ledgerVersion}});return s.data}async function Q(e){let{aptosConfig:n,authenticationKey:t,options:o}=e,r=await K({aptosConfig:n,accountAddress:"0x1",resourceType:"0x1::account::OriginatingAddress",options:o}),{address_map:{handle:s}}=r,a=c.from(t);try{let i=await b({aptosConfig:n,handle:s,data:{key:a.toString(),key_type:"address",value_type:"address"},options:o});return c.from(i)}catch(i){if(i instanceof l&&i.data.error_code==="table_item_not_found")return a;throw i}}async function po(e){let{aptosConfig:n,accountAddress:t}=e,r={owner_address:{_eq:c.from(t).toStringLong()},amount:{_gt:0}},a=await d({aptosConfig:n,query:{query:q,variables:{where_condition:r}},originMethod:"getAccountTokensCount"});return a.current_token_ownerships_v2_aggregate.aggregate?a.current_token_ownerships_v2_aggregate.aggregate.count:0}async function fo(e){let{aptosConfig:n,accountAddress:t,options:o}=e,s={owner_address:{_eq:c.from(t).toStringLong()},amount:{_gt:0}};o?.tokenStandard&&(s.token_standard={_eq:o?.tokenStandard});let a={query:T,variables:{where_condition:s,offset:o?.offset,limit:o?.limit,order_by:o?.orderBy}};return(await d({aptosConfig:n,query:a,originMethod:"getAccountOwnedTokens"})).current_token_ownerships_v2}async function lo(e){let{aptosConfig:n,accountAddress:t,collectionAddress:o,options:r}=e,s=c.from(t).toStringLong(),a=c.from(o).toStringLong(),i={owner_address:{_eq:s},current_token_data:{collection_id:{_eq:a}},amount:{_gt:0}};r?.tokenStandard&&(i.token_standard={_eq:r?.tokenStandard});let u={query:O,variables:{where_condition:i,offset:r?.offset,limit:r?.limit,order_by:r?.orderBy}};return(await d({aptosConfig:n,query:u,originMethod:"getAccountOwnedTokensFromCollectionAddress"})).current_token_ownerships_v2}async function yo(e){let{aptosConfig:n,accountAddress:t,options:o}=e,s={owner_address:{_eq:c.from(t).toStringLong()},amount:{_gt:0}};o?.tokenStandard&&(s.current_collection={token_standard:{_eq:o?.tokenStandard}});let a={query:w,variables:{where_condition:s,offset:o?.offset,limit:o?.limit,order_by:o?.orderBy}};return(await d({aptosConfig:n,query:a,originMethod:"getAccountCollectionsWithOwnedTokens"})).current_collection_ownership_v2_view}async function mo(e){let{aptosConfig:n,accountAddress:t}=e,o=c.from(t).toStringLong(),s=await d({aptosConfig:n,query:{query:v,variables:{address:o}},originMethod:"getAccountTransactionsCount"});return s.account_transactions_aggregate.aggregate?s.account_transactions_aggregate.aggregate.count:0}async function _o(e){let{aptosConfig:n,accountAddress:t,coinType:o}=e,r=c.from(t).toStringLong(),s=await I({aptosConfig:n,accountAddress:r,options:{where:{asset_type:{_eq:o}}}});return s[0]?s[0].amount:0}async function I(e){let{aptosConfig:n,accountAddress:t,options:o}=e,r=c.from(t).toStringLong(),s={...o?.where,owner_address:{_eq:r}},a={query:h,variables:{where_condition:s,offset:o?.offset,limit:o?.limit,order_by:o?.orderBy}};return(await d({aptosConfig:n,query:a,originMethod:"getAccountCoinsData"})).current_fungible_asset_balances}async function Co(e){let{aptosConfig:n,accountAddress:t}=e,o=c.from(t).toStringLong(),s=await d({aptosConfig:n,query:{query:C,variables:{address:o}},originMethod:"getAccountCoinsCount"});if(!s.current_fungible_asset_balances_aggregate.aggregate)throw Error("Failed to get the count of account coins");return s.current_fungible_asset_balances_aggregate.aggregate.count}async function ho(e){let{aptosConfig:n,accountAddress:t,options:o}=e,s={owner_address:{_eq:c.from(t).toStringLong()}},a={query:k,variables:{where_condition:s,offset:o?.offset,limit:o?.limit,order_by:o?.orderBy}};return(await d({aptosConfig:n,query:a,originMethod:"getAccountOwnedObjects"})).current_objects}async function wo(e){let{aptosConfig:n,privateKey:t}=e,o=new _(t.publicKey());if(t instanceof m){let s=p.fromPublicKeyAndScheme({publicKey:o,scheme:2}).derivedAddress();return f.fromPrivateKeyAndAddress({privateKey:t,address:s})}if(t instanceof y){let r=p.fromPublicKeyAndScheme({publicKey:o,scheme:2});if(await G({authKey:r,aptosConfig:n})){let u=r.derivedAddress();return f.fromPrivateKeyAndAddress({privateKey:t,address:u,legacy:!1})}let a=p.fromPublicKeyAndScheme({publicKey:o,scheme:0});if(await G({authKey:a,aptosConfig:n})){let u=a.derivedAddress();return f.fromPrivateKeyAndAddress({privateKey:t,address:u,legacy:!0})}}throw new Error(`Can't derive account from private key ${t}`)}async function G(e){let{aptosConfig:n,authKey:t}=e,o=await Q({aptosConfig:n,authenticationKey:t.derivedAddress()});try{return await M({aptosConfig:n,accountAddress:o}),!0}catch(r){if(r.status===404)return!1;throw new Error(`Error while looking for an account info ${o.toString()}`)}}export{M as a,io as b,uo as c,go as d,Ao as e,K as f,Q as g,po as h,fo as i,lo as j,yo as k,mo as l,_o as m,I as n,Co as o,ho as p,wo as q,G as r};
|
|
2
|
+
//# sourceMappingURL=chunk-MSQ5V3EF.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as c}from"./chunk-NL72WE3E.mjs";import{a as U,b,c as f,d as u,e as h,f as y}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as c}from"./chunk-NL72WE3E.mjs";import{a as U,b,c as f,d as u,e as h,f as y}from"./chunk-56CNRT2K.mjs";import{a as s}from"./chunk-FVA2OPG4.mjs";var B=class{bcsToBytes(){let e=new n;return this.serialize(e),e.toUint8Array()}bcsToHex(){let e=this.bcsToBytes();return c.fromHexInput(e)}},n=class{constructor(e=64){if(e<=0)throw new Error("Length needs to be greater than 0");this.buffer=new ArrayBuffer(e),this.offset=0}ensureBufferWillHandleSize(e){for(;this.buffer.byteLength<this.offset+e;){let t=new ArrayBuffer(this.buffer.byteLength*2);new Uint8Array(t).set(new Uint8Array(this.buffer)),this.buffer=t}}appendToBuffer(e){this.ensureBufferWillHandleSize(e.length),new Uint8Array(this.buffer,this.offset).set(e),this.offset+=e.length}serializeWithFunction(e,t,i){this.ensureBufferWillHandleSize(t);let a=new DataView(this.buffer,this.offset);e.apply(a,[0,i,!0]),this.offset+=t}serializeStr(e){let t=new TextEncoder;this.serializeBytes(t.encode(e))}serializeBytes(e){this.serializeU32AsUleb128(e.length),this.appendToBuffer(e)}serializeFixedBytes(e){this.appendToBuffer(e)}serializeBool(e){A(e);let t=e?1:0;this.appendToBuffer(new Uint8Array([t]))}serializeU8(e){this.appendToBuffer(new Uint8Array([e]))}serializeU16(e){this.serializeWithFunction(DataView.prototype.setUint16,2,e)}serializeU32(e){this.serializeWithFunction(DataView.prototype.setUint32,4,e)}serializeU64(e){let t=BigInt(e)&BigInt(f),i=BigInt(e)>>BigInt(32);this.serializeU32(Number(t)),this.serializeU32(Number(i))}serializeU128(e){let t=BigInt(e)&u,i=BigInt(e)>>BigInt(64);this.serializeU64(t),this.serializeU64(i)}serializeU256(e){let t=BigInt(e)&h,i=BigInt(e)>>BigInt(128);this.serializeU128(t),this.serializeU128(i)}serializeU32AsUleb128(e){let t=e,i=[];for(;t>>>7;)i.push(t&127|128),t>>>=7;i.push(t),this.appendToBuffer(new Uint8Array(i))}toUint8Array(){return new Uint8Array(this.buffer).slice(0,this.offset)}serialize(e){e.serialize(this)}serializeVector(e){this.serializeU32AsUleb128(e.length),e.forEach(t=>{t.serialize(this)})}};s([o(0,U)],n.prototype,"serializeU8",1),s([o(0,b)],n.prototype,"serializeU16",1),s([o(0,f)],n.prototype,"serializeU32",1),s([o(BigInt(0),u)],n.prototype,"serializeU64",1),s([o(BigInt(0),h)],n.prototype,"serializeU128",1),s([o(BigInt(0),y)],n.prototype,"serializeU256",1),s([o(0,f)],n.prototype,"serializeU32AsUleb128",1);function A(r){if(typeof r!="boolean")throw new Error(`${r} is not a boolean value`)}var g=(r,e,t)=>`${r} is out of range: [${e}, ${t}]`;function w(r,e,t){let i=BigInt(r);if(i>BigInt(t)||i<BigInt(e))throw new Error(g(r,e,t))}function o(r,e){return(t,i,a)=>{let p=a.value;return a.value=function(l){return w(l,r,e),p.apply(this,[l])},a}}export{B as a,n as b,A as c,g as d,w as e};
|
|
2
|
+
//# sourceMappingURL=chunk-N4RBQZ2B.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as e}from"./chunk-YVSIS6BA.mjs";import{a as i}from"./chunk-NWRKJFHV.mjs";import{a as r}from"./chunk-N4RBQZ2B.mjs";var n=class o extends r{constructor(t,a){super();this.raw_txn=t,this.authenticator=a}serialize(t){this.raw_txn.serialize(t),this.authenticator.serialize(t)}static deserialize(t){let a=e.deserialize(t),s=i.deserialize(t);return new o(a,s)}};export{n as a};
|
|
2
|
+
//# sourceMappingURL=chunk-NI7GRYCP.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as n}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as n}from"./chunk-ERWQOVBF.mjs";import{a as g,b as _}from"./chunk-7IGH7N52.mjs";import{a as p,c as b}from"./chunk-ZFIMVSCR.mjs";import{b as o}from"./chunk-F7CR75CJ.mjs";import{a as h}from"./chunk-N4RBQZ2B.mjs";var c=class extends h{static deserialize(t){let e=t.deserializeUleb128AsU32();switch(e){case 0:return d.load(t);case 1:return u.load(t);case 2:return l.load(t);case 3:return A.load(t);case 4:return y.load(t);default:throw new Error(`Unknown variant index for TransactionAuthenticator: ${e}`)}}},d=class i extends c{constructor(e,r){super();this.public_key=e,this.signature=r}serialize(e){e.serializeU32AsUleb128(0),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let r=p.deserialize(e),s=b.deserialize(e);return new i(r,s)}},u=class i extends c{constructor(e,r){super();this.public_key=e,this.signature=r}serialize(e){e.serializeU32AsUleb128(1),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let r=g.deserialize(e),s=_.deserialize(e);return new i(r,s)}},l=class i extends c{constructor(e,r,s){super();this.sender=e,this.secondary_signer_addresses=r,this.secondary_signers=s}serialize(e){e.serializeU32AsUleb128(2),this.sender.serialize(e),e.serializeVector(this.secondary_signer_addresses),e.serializeVector(this.secondary_signers)}static load(e){let r=n.deserialize(e),s=e.deserializeVector(o),a=e.deserializeVector(n);return new i(r,s,a)}},A=class i extends c{constructor(e,r,s,a){super();this.sender=e,this.secondary_signer_addresses=r,this.secondary_signers=s,this.fee_payer=a}serialize(e){e.serializeU32AsUleb128(3),this.sender.serialize(e),e.serializeVector(this.secondary_signer_addresses),e.serializeVector(this.secondary_signers),this.fee_payer.address.serialize(e),this.fee_payer.authenticator.serialize(e)}static load(e){let r=n.deserialize(e),s=e.deserializeVector(o),a=e.deserializeVector(n),z=o.deserialize(e),S=n.deserialize(e),E={address:z,authenticator:S};return new i(r,s,a,E)}},y=class i extends c{constructor(e){super();this.sender=e}serialize(e){e.serializeU32AsUleb128(4),this.sender.serialize(e)}static load(e){let r=n.deserialize(e);return new i(r)}};export{c as a,d as b,u as c,l as d,A as e,y as f};
|
|
2
|
+
//# sourceMappingURL=chunk-NWRKJFHV.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as t}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as t}from"./chunk-F7CR75CJ.mjs";import{a as o,b as r}from"./chunk-F7MOQC7Z.mjs";import{e as u}from"./chunk-VRSUCKJA.mjs";import{a as i}from"./chunk-N4RBQZ2B.mjs";var c=class extends i{constructor(e){super();this.accountAddress=t.ONE;this.moduleName=new r("account");this.structName=new r("RotationProofChallenge");this.sequenceNumber=new u(e.sequenceNumber),this.originator=e.originator,this.currentAuthKey=e.currentAuthKey,this.newPublicKey=o.U8(e.newPublicKey.toUint8Array())}serialize(e){e.serialize(this.accountAddress),e.serialize(this.moduleName),e.serialize(this.structName),e.serialize(this.sequenceNumber),e.serialize(this.originator),e.serialize(this.currentAuthKey),e.serialize(this.newPublicKey)}};export{c as a};
|
|
2
|
+
//# sourceMappingURL=chunk-O57QZZF2.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as A}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as A}from"./chunk-FIO7MFHJ.mjs";import{a as T}from"./chunk-RSOBVX62.mjs";import{a as d}from"./chunk-M7PXZWVX.mjs";import{a as h}from"./chunk-KVTWA3N3.mjs";import{d as p,e as a,h as m,i as f,j as y}from"./chunk-AA4ETD22.mjs";import{a as s,b as r,c as e,d as c,e as u,f as g}from"./chunk-6EUKJGSP.mjs";var P=class{constructor(n){this.config=n,this.build=new T(this.config),this.simulate=new d(this.config),this.submit=new h(this.config)}async getTransactions(n){return s({aptosConfig:this.config,...n})}async getTransactionByVersion(n){return e({aptosConfig:this.config,...n})}async getTransactionByHash(n){return c({aptosConfig:this.config,...n})}async isPendingTransaction(n){return u({aptosConfig:this.config,...n})}async waitForTransaction(n){return g({aptosConfig:this.config,...n})}async getGasPriceEstimation(){return r({aptosConfig:this.config})}getSigningMessage(n){return p(n)}async publishPackageTransaction(n){return f({aptosConfig:this.config,...n})}async rotateAuthKey(n){return y({aptosConfig:this.config,...n})}sign(n){return a({...n})}signAsFeePayer(n){let{signer:t,transaction:o}=n;if(!o.feePayerAddress)throw new Error(`Transaction ${o} is not a Fee Payer transaction`);return o.feePayerAddress=t.accountAddress,a({signer:t,transaction:o})}async batchTransactionsForSingleAccount(n){try{let{sender:t,data:o,options:l}=n,i=new A(this.config,t);i.start();for(let w of o)await i.push(w,l)}catch(t){throw new Error(`failed to submit transactions with error: ${t}`)}}async signAndSubmitTransaction(n){let{signer:t,transaction:o}=n;return m({aptosConfig:this.config,signer:t,transaction:o})}};export{P as a};
|
|
2
|
+
//# sourceMappingURL=chunk-OZ3JUNJX.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a}from"./chunk-3JPVQHOR.mjs";import{spawn as n}from"child_process";import c from"tree-kill";var i=class{constructor(){this.MAXIMUM_WAIT_TIME_SEC=30;this.READINESS_ENDPOINT="http://127.0.0.1:8070/";this.process=null}stop(){this.process?.pid&&c(this.process.pid)}async run(){await this.checkIfProcessIsUp()||(this.start(),await this.waitUntilProcessIsUp())}start(){let s=n("npx",["aptos","node","run-local-testnet","--force-restart","--assume-yes","--with-indexer-api"]);this.process=s,s.stderr?.on("data",o=>{let e=o.toString();console.log(e)}),s.stdout?.on("data",o=>{let e=o.toString();console.log(e)})}async waitUntilProcessIsUp(){let t=await this.checkIfProcessIsUp(),r=Date.now()/1e3,s=r;for(;!t&&r+this.MAXIMUM_WAIT_TIME_SEC>s;)await a(1e3),t=await this.checkIfProcessIsUp(),s=Date.now()/1e3;if(!t)throw new Error("Process failed to start");return!0}async checkIfProcessIsUp(){try{return(await fetch(this.READINESS_ENDPOINT)).status===200}catch{return!1}}};export{i as a};
|
|
2
|
+
//# sourceMappingURL=chunk-PAY4TBCF.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/cli/localNode.ts"],"sourcesContent":["import { ChildProcessWithoutNullStreams, spawn } from \"child_process\";\nimport kill from \"tree-kill\";\nimport { sleep } from \"../utils/helpers\";\n\nexport class LocalNode {\n readonly MAXIMUM_WAIT_TIME_SEC = 30;\n\n readonly READINESS_ENDPOINT = \"http://127.0.0.1:8070/\";\n\n process: ChildProcessWithoutNullStreams | null = null;\n\n /**\n * kills all the descendent processes\n * of the node process, including the node process itself\n */\n stop() {\n if (!this.process?.pid) return;\n kill(this.process.pid);\n }\n\n /**\n * Runs a local testnet and waits for process to be up.\n *\n * If local node process is already up it returns and does\n * not start the process\n */\n async run() {\n const nodeIsUp = await this.checkIfProcessIsUp();\n if (nodeIsUp) {\n return;\n }\n this.start();\n await this.waitUntilProcessIsUp();\n }\n\n /**\n * Starts the local testnet by running the aptos node run-local-testnet command\n */\n start() {\n const cliCommand = \"npx\";\n const cliArgs = [\"aptos\", \"node\", \"run-local-testnet\", \"--force-restart\", \"--assume-yes\", \"--with-indexer-api\"];\n\n const childProcess = spawn(cliCommand, cliArgs);\n this.process = childProcess;\n\n childProcess.stderr?.on(\"data\", (data: any) => {\n const str = data.toString();\n // Print local node output log\n // eslint-disable-next-line no-console\n console.log(str);\n });\n\n childProcess.stdout?.on(\"data\", (data: any) => {\n const str = data.toString();\n // Print local node output log\n // eslint-disable-next-line no-console\n console.log(str);\n });\n }\n\n /**\n * Waits for the local testnet process to be up\n *\n * @returns Promise<boolean>\n */\n async waitUntilProcessIsUp(): Promise<boolean> {\n let operational = await this.checkIfProcessIsUp();\n const start = Date.now() / 1000;\n let last = start;\n\n while (!operational && start + this.MAXIMUM_WAIT_TIME_SEC > last) {\n // eslint-disable-next-line no-await-in-loop\n await sleep(1000);\n // eslint-disable-next-line no-await-in-loop\n operational = await this.checkIfProcessIsUp();\n last = Date.now() / 1000;\n }\n\n // If we are here it means something blocks the process to start.\n // Might worth checking if another process is running on port 8080\n if (!operational) {\n throw new Error(\"Process failed to start\");\n }\n\n return true;\n }\n\n /**\n * Checks if the local testnet is up\n *\n * @returns Promise<boolean>\n */\n async checkIfProcessIsUp(): Promise<boolean> {\n try {\n // Query readiness endpoint\n const data = await fetch(this.READINESS_ENDPOINT);\n if (data.status === 200) {\n return true;\n }\n return false;\n } catch (err: any) {\n return false;\n }\n }\n}\n"],"mappings":"oCAAA,OAAyC,SAAAA,MAAa,gBACtD,OAAOC,MAAU,YAGV,IAAMC,EAAN,KAAgB,CAAhB,cACL,KAAS,sBAAwB,GAEjC,KAAS,mBAAqB,yBAE9B,aAAiD,KAMjD,MAAO,CACA,KAAK,SAAS,KACnBC,EAAK,KAAK,QAAQ,GAAG,CACvB,CAQA,MAAM,KAAM,CACO,MAAM,KAAK,mBAAmB,IAI/C,KAAK,MAAM,EACX,MAAM,KAAK,qBAAqB,EAClC,CAKA,OAAQ,CAIN,IAAMC,EAAeC,EAHF,MACH,CAAC,QAAS,OAAQ,oBAAqB,kBAAmB,eAAgB,oBAAoB,CAEhE,EAC9C,KAAK,QAAUD,EAEfA,EAAa,QAAQ,GAAG,OAASE,GAAc,CAC7C,IAAMC,EAAMD,EAAK,SAAS,EAG1B,QAAQ,IAAIC,CAAG,CACjB,CAAC,EAEDH,EAAa,QAAQ,GAAG,OAASE,GAAc,CAC7C,IAAMC,EAAMD,EAAK,SAAS,EAG1B,QAAQ,IAAIC,CAAG,CACjB,CAAC,CACH,CAOA,MAAM,sBAAyC,CAC7C,IAAIC,EAAc,MAAM,KAAK,mBAAmB,EAC1CC,EAAQ,KAAK,IAAI,EAAI,IACvBC,EAAOD,EAEX,KAAO,CAACD,GAAeC,EAAQ,KAAK,sBAAwBC,GAE1D,MAAMC,EAAM,GAAI,EAEhBH,EAAc,MAAM,KAAK,mBAAmB,EAC5CE,EAAO,KAAK,IAAI,EAAI,IAKtB,GAAI,CAACF,EACH,MAAM,IAAI,MAAM,yBAAyB,EAG3C,MAAO,EACT,CAOA,MAAM,oBAAuC,CAC3C,GAAI,CAGF,OADa,MAAM,MAAM,KAAK,kBAAkB,GACvC,SAAW,GAItB,MAAmB,CACjB,MAAO,EACT,CACF,CACF","names":["spawn","kill","LocalNode","kill","childProcess","spawn","data","str","operational","start","last","sleep"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as i}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as i}from"./chunk-B2ZKW23W.mjs";import{a as r}from"./chunk-N4RBQZ2B.mjs";var t=class l extends r{constructor(e){super();this.value=new i(e)}serialize(e){e.serialize(this.value)}serializeForEntryFunction(e){e.serializeU32AsUleb128(this.value.value.length),e.serialize(this)}static deserialize(e,s){let a=i.deserialize(e,s);return new l(a.value)}};export{t as a};
|
|
2
|
+
//# sourceMappingURL=chunk-PPTG6BDV.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as i}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as i}from"./chunk-N4RBQZ2B.mjs";var r=class a extends i{constructor(e){super();this.chainId=e}serialize(e){e.serializeU8(this.chainId)}static deserialize(e){let s=e.deserializeU8();return new a(s)}};export{r as a};
|
|
2
|
+
//# sourceMappingURL=chunk-QKTV6AZ7.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as r}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as r}from"./chunk-F7CR75CJ.mjs";import{a,b as g,c as f}from"./chunk-F7MOQC7Z.mjs";import{a as i}from"./chunk-B2ZKW23W.mjs";import{a as o,b as u,c as s,d as c,e as p,f as y,g as m}from"./chunk-VRSUCKJA.mjs";function M(n){return typeof n=="boolean"}function D(n){return typeof n=="string"}function N(n){return typeof n=="number"}function P(n){return typeof n=="number"||typeof n=="bigint"||typeof n=="string"}function w(n){return n==null}function G(n){return A(n)||x(n)||S(n)||B(n)||U(n)||I(n)||b(n)||T(n)||E(n)||d(n)||n instanceof a||n instanceof f}function A(n){return n instanceof o}function T(n){return n instanceof r}function E(n){return n instanceof g}function d(n){return n instanceof i}function x(n){return n instanceof u}function S(n){return n instanceof s}function B(n){return n instanceof c}function U(n){return n instanceof p}function I(n){return n instanceof y}function b(n){return n instanceof m}function $(n){return"bytecode"in n}function R(n,t){throw new Error(`Type mismatch for argument ${t}, expected '${n}'`)}function W(n){let t=n.params.findIndex(e=>e!=="signer"&&e!=="&signer");return t<0?n.params.length:t}function L(n){let t=n.split("::");if(t.length!==3)throw new Error(`Invalid function ${n}`);let e=t[0],F=t[1],l=t[2];return{moduleAddress:e,moduleName:F,functionName:l}}export{M as a,D as b,N as c,P as d,w as e,G as f,A as g,T as h,E as i,d as j,x as k,S as l,B as m,U as n,I as o,b as p,$ as q,R as r,W as s,L as t};
|
|
2
|
+
//# sourceMappingURL=chunk-RNO5ZG3C.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as t}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as t}from"./chunk-AA4ETD22.mjs";var o=class{constructor(n){this.config=n}async simple(n){return t({aptosConfig:this.config,...n})}async multiAgent(n){return t({aptosConfig:this.config,...n})}};export{o as a};
|
|
2
|
+
//# sourceMappingURL=chunk-RSOBVX62.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as o,b as r,c as t}from"./chunk-KZID24G2.mjs";import{a as n}from"./chunk-UNSMG2E5.mjs";var s=class{constructor(e){this.config=e}async getAccountEventsByCreationNumber(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"events_processor"}),o({aptosConfig:this.config,...e})}async getAccountEventsByEventType(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"events_processor"}),r({aptosConfig:this.config,...e})}async getEvents(e){return await n({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"events_processor"}),t({aptosConfig:this.config,...e})}};export{s as a};
|
|
2
|
+
//# sourceMappingURL=chunk-RYX746TE.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/api/event.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { getAccountEventsByCreationNumber, getAccountEventsByEventType, getEvents } from \"../internal/event\";\nimport { AnyNumber, GetEventsResponse, MoveStructId, OrderByArg, PaginationArgs, WhereArg } from \"../types\";\nimport { EventsBoolExp } from \"../types/generated/types\";\nimport { AccountAddressInput } from \"../core\";\nimport { ProcessorType } from \"../utils/const\";\nimport { AptosConfig } from \"./aptosConfig\";\nimport { waitForIndexerOnVersion } from \"./utils\";\n\n/**\n * A class to query all `Event` Aptos related queries\n */\nexport class Event {\n constructor(readonly config: AptosConfig) {}\n\n /**\n * Get events by creation number and an account address\n *\n * @param args.accountAddress - The account address\n * @param args.creationNumber - The event creation number\n * @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying\n *\n * @returns Promise<GetEventsResponse>\n */\n async getAccountEventsByCreationNumber(args: {\n accountAddress: AccountAddressInput;\n creationNumber: AnyNumber;\n minimumLedgerVersion?: AnyNumber;\n }): Promise<GetEventsResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.EVENTS_PROCESSOR,\n });\n return getAccountEventsByCreationNumber({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Get events by event type and an account address\n *\n * @param args.accountAddress - The account address\n * @param args.eventType - The event type\n * @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying\n *\n * @returns Promise<GetEventsResponse>\n */\n async getAccountEventsByEventType(args: {\n accountAddress: AccountAddressInput;\n eventType: MoveStructId;\n minimumLedgerVersion?: AnyNumber;\n options?: PaginationArgs & OrderByArg<GetEventsResponse[0]>;\n }): Promise<GetEventsResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.EVENTS_PROCESSOR,\n });\n return getAccountEventsByEventType({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Get all events\n *\n * An optional `where` can be passed in to filter out the response.\n *@param args.minimumLedgerVersion Optional ledger version to sync up to, before querying\n * @example\n * ```\n * { where:\n * {\n * transaction_version: { _eq: 123456 },\n * }\n * }\n * ```\n *\n * @returns GetEventsQuery response type\n */\n async getEvents(args?: {\n minimumLedgerVersion?: AnyNumber;\n options?: PaginationArgs & OrderByArg<GetEventsResponse[0]> & WhereArg<EventsBoolExp>;\n }): Promise<GetEventsResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args?.minimumLedgerVersion,\n processorType: ProcessorType.EVENTS_PROCESSOR,\n });\n return getEvents({ aptosConfig: this.config, ...args });\n }\n}\n"],"mappings":"gGAcO,IAAMA,EAAN,KAAY,CACjB,YAAqBC,EAAqB,CAArB,YAAAA,CAAsB,CAW3C,MAAM,iCAAiCC,EAIR,CAC7B,aAAMC,EAAwB,CAC5B,OAAQ,KAAK,OACb,qBAAsBD,EAAK,qBAC3B,gCACF,CAAC,EACME,EAAiC,CAAE,YAAa,KAAK,OAAQ,GAAGF,CAAK,CAAC,CAC/E,CAWA,MAAM,4BAA4BA,EAKH,CAC7B,aAAMC,EAAwB,CAC5B,OAAQ,KAAK,OACb,qBAAsBD,EAAK,qBAC3B,gCACF,CAAC,EACMG,EAA4B,CAAE,YAAa,KAAK,OAAQ,GAAGH,CAAK,CAAC,CAC1E,CAkBA,MAAM,UAAUA,EAGe,CAC7B,aAAMC,EAAwB,CAC5B,OAAQ,KAAK,OACb,qBAAsBD,GAAM,qBAC5B,gCACF,CAAC,EACMI,EAAU,CAAE,YAAa,KAAK,OAAQ,GAAGJ,CAAK,CAAC,CACxD,CACF","names":["Event","config","args","waitForIndexerOnVersion","getAccountEventsByCreationNumber","getAccountEventsByEventType","getEvents"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as l,c as f,d as x,e as v,f as U,g as A,h as P,i as C,j as y,k as E,l as b,m as I,n as G,o as M}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as l,c as f,d as x,e as v,f as U,g as A,h as P,i as C,j as y,k as E,l as b,m as I,n as G,o as M}from"./chunk-HI6QP2FB.mjs";import{a as d}from"./chunk-IHCIKE42.mjs";import{b as w}from"./chunk-F7CR75CJ.mjs";function N(e){return!!e.match(/^[_a-zA-Z0-9]+$/)}function V(e){return!!e.match(/\s/)}function $(e){return!!e.match(/^T[0-9]+$/)}function F(e,n){let i=n;for(;i<e.length;i+=1){let c=e[i];if(!V(c))break}return i}var S=(t=>(t.InvalidTypeTag="unknown type",t.UnexpectedGenericType="unexpected generic type",t.UnexpectedTypeArgumentClose="unexpected '>'",t.UnexpectedWhitespaceCharacter="unexpected whitespace character",t.UnexpectedComma="unexpected ','",t.TypeArgumentCountMismatch="type argument count doesn't match expected amount",t.MissingTypeArgumentClose="no matching '>' for '<'",t.UnexpectedPrimitiveTypeArguments="primitive types not expected to have type arguments",t.UnexpectedVectorTypeArgumentCount="vector type expected to have exactly one type argument",t.UnexpectedStructFormat="unexpected struct format, must be of the form 0xaddress::module_name::struct_name",t.InvalidModuleNameCharacter="module name must only contain alphanumeric or '_' characters",t.InvalidStructNameCharacter="struct name must only contain alphanumeric or '_' characters",t))(S||{}),r=class extends Error{constructor(n,i){super(`Failed to parse typeTag '${n}', ${i}`)}};function Z(e,n){let i=n?.allowGenerics??!1,c=[],o=[],p=[],T=0,a="",u=1;for(;T<e.length;){let g=e[T];if(g==="<")c.push({savedExpectedTypes:u,savedStr:a,savedTypes:p}),a="",p=[],u=1;else if(g===">"){if(a!==""){let _=m(a,o,i);p.push(_)}let s=c.pop();if(s===void 0)throw new r(e,"unexpected '>'");if(u!==p.length)throw new r(e,"type argument count doesn't match expected amount");let{savedStr:h,savedTypes:t,savedExpectedTypes:W}=s;o=p,p=t,a=h,u=W}else if(g===","){if(a.length!==0){let s=m(a,o,i);o=[],p.push(s),a="",u+=1}}else if(V(g)){let s=!1;if(a.length!==0){let t=m(a,o,i);o=[],p.push(t),a="",s=!0}T=F(e,T);let h=e[T];if(T<e.length&&s&&h!==","&&h!==">")throw new r(e,"unexpected whitespace character");continue}else a+=g;T+=1}if(c.length>0)throw new r(e,"no matching '>' for '<'");switch(p.length){case 0:return m(a,o,i);case 1:if(a==="")return p[0];throw new r(e,"unexpected ','");default:throw new r(e,"unexpected whitespace character")}}function m(e,n,i){switch(e){case"&signer":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new E(new y);case"signer":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new y;case"bool":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new l;case"address":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new C;case"u8":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new f;case"u16":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new x;case"u32":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new v;case"u64":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new U;case"u128":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new A;case"u256":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new P;case"vector":if(n.length!==1)throw new r(e,"vector type expected to have exactly one type argument");return new I(n[0]);default:if($(e)){if(i)return new b(Number(e.split("T")[1]));throw new r(e,"unexpected generic type")}if(!e.match(/.*:.*/))throw new r(e,"unknown type");let c=e.split("::");if(c.length!==3)throw new r(e,"unexpected struct format, must be of the form 0xaddress::module_name::struct_name");if(!N(c[1]))throw new r(e,"module name must only contain alphanumeric or '_' characters");if(!N(c[2]))throw new r(e,"struct name must only contain alphanumeric or '_' characters");return new G(new M(w.fromString(c[0]),new d(c[1]),new d(c[2]),n))}}export{S as a,r as b,Z as c};
|
|
2
|
+
//# sourceMappingURL=chunk-S4QKXXBT.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as y}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as y}from"./chunk-7IGH7N52.mjs";import{a as m}from"./chunk-UCHGKGCF.mjs";import{a as d}from"./chunk-FBFMQZTM.mjs";import{a as l}from"./chunk-ZFIMVSCR.mjs";import{b as u}from"./chunk-F7CR75CJ.mjs";import{a as c}from"./chunk-N4RBQZ2B.mjs";import{b as s}from"./chunk-NL72WE3E.mjs";import{sha3_256 as b}from"@noble/hashes/sha3";var i=class i extends c{constructor(r){super();let{data:t}=r,e=s.fromHexInput(t);if(e.toUint8Array().length!==i.LENGTH)throw new Error(`Authentication Key length should be ${i.LENGTH}`);this.data=e}serialize(r){r.serializeFixedBytes(this.data.toUint8Array())}static deserialize(r){let t=r.deserializeFixedBytes(i.LENGTH);return new i({data:t})}toString(){return this.data.toString()}toUint8Array(){return this.data.toUint8Array()}static fromPublicKeyAndScheme(r){let{publicKey:t,scheme:e}=r,n;switch(e){case 3:case 2:{let a=t.bcsToBytes();n=new Uint8Array([...a,e]);break}case 0:case 1:{let a=t.toUint8Array(),p=s.fromHexInput(a).toUint8Array();n=new Uint8Array([...p,e]);break}default:throw new Error(`Scheme ${e} is not supported`)}let o=b.create();o.update(n);let f=o.digest();return new i({data:f})}static fromPublicKey(r){let{publicKey:t}=r,e;if(t instanceof l)e=0 .valueOf();else if(t instanceof y)e=1 .valueOf();else if(t instanceof d)e=2 .valueOf();else if(t instanceof m)e=3 .valueOf();else throw new Error("No supported authentication scheme for public key");return i.fromPublicKeyAndScheme({publicKey:t,scheme:e})}derivedAddress(){return new u(this.data.toUint8Array())}};i.LENGTH=32;var h=i;export{h as a};
|
|
2
|
+
//# sourceMappingURL=chunk-SBMJNU2O.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as o,b as s,c as t,d as r,e as n,f as i,g as a,i as g,j as c}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as o,b as s,c as t,d as r,e as n,f as i,g as a,i as g,j as c}from"./chunk-UFMUQN35.mjs";var u=class{constructor(e){this.config=e}async getLedgerInfo(){return o({aptosConfig:this.config})}async getChainId(){return(await this.getLedgerInfo()).chain_id}async getBlockByVersion(e){return s({aptosConfig:this.config,...e})}async getBlockByHeight(e){return t({aptosConfig:this.config,...e})}async getTableItem(e){return r({aptosConfig:this.config,...e})}async view(e){return n({aptosConfig:this.config,...e})}async getChainTopUserTransactions(e){return i({aptosConfig:this.config,...e})}async queryIndexer(e){return a({aptosConfig:this.config,...e})}async getIndexerLastSuccessVersion(){return g({aptosConfig:this.config})}async getProcessorStatus(e){return c({aptosConfig:this.config,processorType:e})}};export{u as a};
|
|
2
|
+
//# sourceMappingURL=chunk-T2P2T3OS.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/api/general.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { AptosConfig } from \"./aptosConfig\";\nimport {\n getBlockByHeight,\n getBlockByVersion,\n getChainTopUserTransactions,\n getIndexerLastSuccessVersion,\n getLedgerInfo,\n getProcessorStatus,\n getTableItem,\n queryIndexer,\n view,\n} from \"../internal/general\";\nimport {\n AnyNumber,\n Block,\n GetChainTopUserTransactionsResponse,\n GetProcessorStatusResponse,\n GraphqlQuery,\n LedgerInfo,\n LedgerVersionArg,\n MoveValue,\n TableItemRequest,\n InputViewRequestData,\n} from \"../types\";\nimport { ProcessorType } from \"../utils/const\";\n\n/**\n * A class to query all `General` Aptos related queries\n */\nexport class General {\n readonly config: AptosConfig;\n\n constructor(config: AptosConfig) {\n this.config = config;\n }\n\n /**\n * Queries for the Aptos ledger info\n *\n * @returns Aptos Ledger Info\n *\n * @example An example of the returned data\n * ```\n * {\n * \"chain_id\": 4,\n * \"epoch\": \"8\",\n * \"ledger_version\": \"714\",\n * \"oldest_ledger_version\": \"0\",\n * \"ledger_timestamp\": \"1694695496521775\",\n * \"node_role\": \"validator\",\n * \"oldest_block_height\": \"0\",\n * \"block_height\": \"359\",\n * \"git_hash\": \"c82193f36f4e185fed9f68c4ad21f6c6dd390c6e\"\n * }\n * ```\n */\n async getLedgerInfo(): Promise<LedgerInfo> {\n return getLedgerInfo({ aptosConfig: this.config });\n }\n\n /**\n * Queries for the chain id\n *\n * @returns The chain id\n */\n async getChainId(): Promise<number> {\n const result = await this.getLedgerInfo();\n return result.chain_id;\n }\n\n /**\n * Queries for block by transaction version\n *\n * @param args.ledgerVersion Ledger version to lookup block information for\n * @param args.options.withTransactions If set to true, include all transactions in the block\n *\n * @returns Block information with optional transactions\n */\n async getBlockByVersion(args: {\n ledgerVersion: AnyNumber;\n options?: { withTransactions?: boolean };\n }): Promise<Block> {\n return getBlockByVersion({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Get block by block height\n *\n * @param args.blockHeight Block height to lookup. Starts at 0\n * @param args.options.withTransactions If set to true, include all transactions in the block\n *\n * @returns Block with optional transactions\n */\n async getBlockByHeight(args: { blockHeight: AnyNumber; options?: { withTransactions?: boolean } }): Promise<Block> {\n return getBlockByHeight({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries for a table item for a table identified by the handle and the key for the item.\n * Key and value types need to be passed in to help with key serialization and value deserialization.\n * @param args.handle A pointer to where that table is stored\n * @param args.data Object that describes table item\n * @param args.options.ledgerVersion The ledger version to query, if not provided it will get the latest version\n *\n * @example https://fullnode.devnet.aptoslabs.com/v1/accounts/0x1/resource/0x1::coin::CoinInfo%3C0x1::aptos_coin::AptosCoin%3E\n * {\n * data.key_type = \"address\" // Move type of table key\n * data.value_type = \"u128\" // Move type of table value\n * data.key = \"0x619dc29a0aac8fa146714058e8dd6d2d0f3bdf5f6331907bf91f3acd81e6935\" // Value of table key\n * }\n *\n * @returns Table item value rendered in JSON\n */\n async getTableItem<T>(args: { handle: string; data: TableItemRequest; options?: LedgerVersionArg }): Promise<T> {\n return getTableItem<T>({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries for a Move view function\n * @param args.payload Payload for the view function\n * @param args.options.ledgerVersion The ledger version to query, if not provided it will get the latest version\n * @example\n * `\n * const payload: ViewRequest = {\n * function: \"0x1::coin::balance\",\n * typeArguments: [\"0x1::aptos_coin::AptosCoin\"],\n * functionArguments: [accountAddress],\n * };\n * `\n *\n * @returns an array of Move values\n */\n async view<T extends Array<MoveValue>>(args: {\n payload: InputViewRequestData;\n options?: LedgerVersionArg;\n }): Promise<T> {\n return view<T>({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries top user transactions\n *\n * @param args.limit The number of transactions to return\n * @returns GetChainTopUserTransactionsResponse\n */\n async getChainTopUserTransactions(args: { limit: number }): Promise<GetChainTopUserTransactionsResponse> {\n return getChainTopUserTransactions({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * A generic function for retrieving data from Aptos Indexer.\n * For more detailed queries specification see\n * {@link https://cloud.hasura.io/public/graphiql?endpoint=https://indexer.mainnet.aptoslabs.com/v1/graphql}\n *\n * @param args.query.query A GraphQL query\n * @param args.query.variables The variables for the query\n * @example\n * ```\n * {\n * query: `query MyQuery {\n ledger_infos {\n chain_id\n }\n }`;\n * }\n * ```\n *\n * @return The provided T type\n */\n async queryIndexer<T extends {}>(args: { query: GraphqlQuery }): Promise<T> {\n return queryIndexer<T>({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Queries for the last successful indexer version\n *\n * This is useful to tell what ledger version the indexer is updated to, as it can be behind the full nodes.\n */\n async getIndexerLastSuccessVersion(): Promise<
|
|
1
|
+
{"version":3,"sources":["../../src/api/general.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { AptosConfig } from \"./aptosConfig\";\nimport {\n getBlockByHeight,\n getBlockByVersion,\n getChainTopUserTransactions,\n getIndexerLastSuccessVersion,\n getLedgerInfo,\n getProcessorStatus,\n getTableItem,\n queryIndexer,\n view,\n} from \"../internal/general\";\nimport {\n AnyNumber,\n Block,\n GetChainTopUserTransactionsResponse,\n GetProcessorStatusResponse,\n GraphqlQuery,\n LedgerInfo,\n LedgerVersionArg,\n MoveValue,\n TableItemRequest,\n InputViewRequestData,\n} from \"../types\";\nimport { ProcessorType } from \"../utils/const\";\n\n/**\n * A class to query all `General` Aptos related queries\n */\nexport class General {\n readonly config: AptosConfig;\n\n constructor(config: AptosConfig) {\n this.config = config;\n }\n\n /**\n * Queries for the Aptos ledger info\n *\n * @returns Aptos Ledger Info\n *\n * @example An example of the returned data\n * ```\n * {\n * \"chain_id\": 4,\n * \"epoch\": \"8\",\n * \"ledger_version\": \"714\",\n * \"oldest_ledger_version\": \"0\",\n * \"ledger_timestamp\": \"1694695496521775\",\n * \"node_role\": \"validator\",\n * \"oldest_block_height\": \"0\",\n * \"block_height\": \"359\",\n * \"git_hash\": \"c82193f36f4e185fed9f68c4ad21f6c6dd390c6e\"\n * }\n * ```\n */\n async getLedgerInfo(): Promise<LedgerInfo> {\n return getLedgerInfo({ aptosConfig: this.config });\n }\n\n /**\n * Queries for the chain id\n *\n * @returns The chain id\n */\n async getChainId(): Promise<number> {\n const result = await this.getLedgerInfo();\n return result.chain_id;\n }\n\n /**\n * Queries for block by transaction version\n *\n * @param args.ledgerVersion Ledger version to lookup block information for\n * @param args.options.withTransactions If set to true, include all transactions in the block\n *\n * @returns Block information with optional transactions\n */\n async getBlockByVersion(args: {\n ledgerVersion: AnyNumber;\n options?: { withTransactions?: boolean };\n }): Promise<Block> {\n return getBlockByVersion({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Get block by block height\n *\n * @param args.blockHeight Block height to lookup. Starts at 0\n * @param args.options.withTransactions If set to true, include all transactions in the block\n *\n * @returns Block with optional transactions\n */\n async getBlockByHeight(args: { blockHeight: AnyNumber; options?: { withTransactions?: boolean } }): Promise<Block> {\n return getBlockByHeight({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries for a table item for a table identified by the handle and the key for the item.\n * Key and value types need to be passed in to help with key serialization and value deserialization.\n * @param args.handle A pointer to where that table is stored\n * @param args.data Object that describes table item\n * @param args.options.ledgerVersion The ledger version to query, if not provided it will get the latest version\n *\n * @example https://fullnode.devnet.aptoslabs.com/v1/accounts/0x1/resource/0x1::coin::CoinInfo%3C0x1::aptos_coin::AptosCoin%3E\n * {\n * data.key_type = \"address\" // Move type of table key\n * data.value_type = \"u128\" // Move type of table value\n * data.key = \"0x619dc29a0aac8fa146714058e8dd6d2d0f3bdf5f6331907bf91f3acd81e6935\" // Value of table key\n * }\n *\n * @returns Table item value rendered in JSON\n */\n async getTableItem<T>(args: { handle: string; data: TableItemRequest; options?: LedgerVersionArg }): Promise<T> {\n return getTableItem<T>({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries for a Move view function\n * @param args.payload Payload for the view function\n * @param args.options.ledgerVersion The ledger version to query, if not provided it will get the latest version\n * @example\n * `\n * const payload: ViewRequest = {\n * function: \"0x1::coin::balance\",\n * typeArguments: [\"0x1::aptos_coin::AptosCoin\"],\n * functionArguments: [accountAddress],\n * };\n * `\n *\n * @returns an array of Move values\n */\n async view<T extends Array<MoveValue>>(args: {\n payload: InputViewRequestData;\n options?: LedgerVersionArg;\n }): Promise<T> {\n return view<T>({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries top user transactions\n *\n * @param args.limit The number of transactions to return\n * @returns GetChainTopUserTransactionsResponse\n */\n async getChainTopUserTransactions(args: { limit: number }): Promise<GetChainTopUserTransactionsResponse> {\n return getChainTopUserTransactions({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * A generic function for retrieving data from Aptos Indexer.\n * For more detailed queries specification see\n * {@link https://cloud.hasura.io/public/graphiql?endpoint=https://indexer.mainnet.aptoslabs.com/v1/graphql}\n *\n * @param args.query.query A GraphQL query\n * @param args.query.variables The variables for the query\n * @example\n * ```\n * {\n * query: `query MyQuery {\n ledger_infos {\n chain_id\n }\n }`;\n * }\n * ```\n *\n * @return The provided T type\n */\n async queryIndexer<T extends {}>(args: { query: GraphqlQuery }): Promise<T> {\n return queryIndexer<T>({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Queries for the last successful indexer version\n *\n * This is useful to tell what ledger version the indexer is updated to, as it can be behind the full nodes.\n */\n async getIndexerLastSuccessVersion(): Promise<bigint> {\n return getIndexerLastSuccessVersion({ aptosConfig: this.config });\n }\n\n /**\n * Query the processor status for a specific processor type.\n *\n * @param processorType The processor type to query\n * @returns\n */\n async getProcessorStatus(processorType: ProcessorType): Promise<GetProcessorStatusResponse[0]> {\n return getProcessorStatus({ aptosConfig: this.config, processorType });\n }\n}\n"],"mappings":"iGAgCO,IAAMA,EAAN,KAAc,CAGnB,YAAYC,EAAqB,CAC/B,KAAK,OAASA,CAChB,CAsBA,MAAM,eAAqC,CACzC,OAAOC,EAAc,CAAE,YAAa,KAAK,MAAO,CAAC,CACnD,CAOA,MAAM,YAA8B,CAElC,OADe,MAAM,KAAK,cAAc,GAC1B,QAChB,CAUA,MAAM,kBAAkBC,EAGL,CACjB,OAAOC,EAAkB,CACvB,YAAa,KAAK,OAClB,GAAGD,CACL,CAAC,CACH,CAUA,MAAM,iBAAiBA,EAA4F,CACjH,OAAOE,EAAiB,CAAE,YAAa,KAAK,OAAQ,GAAGF,CAAK,CAAC,CAC/D,CAkBA,MAAM,aAAgBA,EAA0F,CAC9G,OAAOG,EAAgB,CAAE,YAAa,KAAK,OAAQ,GAAGH,CAAK,CAAC,CAC9D,CAiBA,MAAM,KAAiCA,EAGxB,CACb,OAAOI,EAAQ,CAAE,YAAa,KAAK,OAAQ,GAAGJ,CAAK,CAAC,CACtD,CAQA,MAAM,4BAA4BA,EAAuE,CACvG,OAAOK,EAA4B,CACjC,YAAa,KAAK,OAClB,GAAGL,CACL,CAAC,CACH,CAsBA,MAAM,aAA2BA,EAA2C,CAC1E,OAAOM,EAAgB,CACrB,YAAa,KAAK,OAClB,GAAGN,CACL,CAAC,CACH,CAOA,MAAM,8BAAgD,CACpD,OAAOO,EAA6B,CAAE,YAAa,KAAK,MAAO,CAAC,CAClE,CAQA,MAAM,mBAAmBC,EAAsE,CAC7F,OAAOC,EAAmB,CAAE,YAAa,KAAK,OAAQ,cAAAD,CAAc,CAAC,CACvE,CACF","names":["General","config","getLedgerInfo","args","getBlockByVersion","getBlockByHeight","getTableItem","view","getChainTopUserTransactions","queryIndexer","getIndexerLastSuccessVersion","processorType","getProcessorStatus"]}
|