@aptos-labs/ts-sdk 1.32.1 → 1.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/{accountAddress-6RqI8Aam.d.ts → accountAddress-fJZJVSBc.d.ts} +2 -1
- package/dist/common/chunk-F43XVDYJ.js.map +1 -1
- package/dist/common/cli/index.d.ts +1 -1
- package/dist/common/cli/index.js.map +1 -1
- package/dist/common/index.d.ts +25 -14
- package/dist/common/index.js +31 -31
- package/dist/common/index.js.map +1 -1
- package/dist/esm/account/AbstractKeylessAccount.mjs +1 -1
- package/dist/esm/account/Account.mjs +1 -1
- package/dist/esm/account/Ed25519Account.mjs +1 -1
- package/dist/esm/account/EphemeralKeyPair.mjs +1 -1
- package/dist/esm/account/FederatedKeylessAccount.mjs +1 -1
- package/dist/esm/account/KeylessAccount.mjs +1 -1
- package/dist/esm/account/MultiKeyAccount.mjs +1 -1
- package/dist/esm/account/SingleKeyAccount.mjs +1 -1
- package/dist/esm/account/index.mjs +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/coin.d.mts +2 -2
- package/dist/esm/api/coin.mjs +1 -1
- package/dist/esm/api/digitalAsset.mjs +1 -1
- package/dist/esm/api/event.mjs +1 -1
- package/dist/esm/api/faucet.mjs +1 -1
- package/dist/esm/api/fungibleAsset.mjs +1 -1
- package/dist/esm/api/general.mjs +1 -1
- package/dist/esm/api/index.mjs +1 -1
- package/dist/esm/api/keyless.d.mts +1 -1
- package/dist/esm/api/keyless.mjs +1 -1
- package/dist/esm/api/object.mjs +1 -1
- package/dist/esm/api/staking.mjs +1 -1
- package/dist/esm/api/table.mjs +1 -1
- package/dist/esm/api/transaction.mjs +1 -1
- package/dist/esm/api/transactionSubmission/build.mjs +1 -1
- package/dist/esm/api/transactionSubmission/helpers.mjs +1 -1
- package/dist/esm/api/transactionSubmission/management.mjs +1 -1
- package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
- package/dist/esm/api/transactionSubmission/simulate.d.mts +9 -8
- package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
- package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
- package/dist/esm/api/utils.mjs +1 -1
- package/dist/esm/bcs/index.mjs +1 -1
- package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
- package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
- package/dist/esm/{chunk-X7JNNNMC.mjs → chunk-2D7OMWVL.mjs} +2 -2
- package/dist/esm/{chunk-SY4HK6CC.mjs → chunk-476F5NJ6.mjs} +2 -2
- package/dist/esm/chunk-476F5NJ6.mjs.map +1 -0
- package/dist/esm/{chunk-JGLEKXFP.mjs → chunk-4ULPBQ3M.mjs} +2 -2
- package/dist/esm/{chunk-MBEWPBGN.mjs → chunk-4ZNSNWQL.mjs} +2 -2
- package/dist/esm/{chunk-KM6IOJ6Y.mjs → chunk-5XLZACVT.mjs} +2 -2
- package/dist/esm/{chunk-UKVH4UGL.mjs → chunk-64IZ5PQR.mjs} +2 -2
- package/dist/esm/{chunk-AGEJNSEX.mjs → chunk-6AEXQEO2.mjs} +2 -2
- package/dist/esm/{chunk-7OHMMGS6.mjs → chunk-737YW3CY.mjs} +2 -2
- package/dist/esm/{chunk-FYYTCJS4.mjs → chunk-7ZA434Z3.mjs} +2 -2
- package/dist/esm/{chunk-2REHS35S.mjs → chunk-7ZVXQAG4.mjs} +2 -2
- package/dist/esm/{chunk-VGITSRT6.mjs → chunk-A7TJF3BX.mjs} +2 -2
- package/dist/esm/{chunk-BP45UJII.mjs → chunk-ALOYOMRE.mjs} +2 -2
- package/dist/esm/{chunk-K62JTXWQ.mjs → chunk-B5BXB2BB.mjs} +2 -2
- package/dist/esm/{chunk-LYO22HMF.mjs → chunk-BWV6OYLG.mjs} +2 -2
- package/dist/esm/{chunk-HPZQGMSH.mjs → chunk-CK5NDXQT.mjs} +2 -2
- package/dist/esm/{chunk-H7AALSJ7.mjs → chunk-FH27D7S3.mjs} +2 -2
- package/dist/esm/{chunk-JIT2FYGE.mjs → chunk-FSBEKFEF.mjs} +2 -2
- package/dist/esm/{chunk-IQ4SCMB6.mjs → chunk-FUC7SLH7.mjs} +2 -2
- package/dist/esm/{chunk-JONEH52T.mjs → chunk-GT7QFXER.mjs} +2 -2
- package/dist/esm/{chunk-UWLW2VLZ.mjs → chunk-H7PDLUNP.mjs} +2 -2
- package/dist/esm/{chunk-ETF76XA3.mjs → chunk-HKVZ7CAG.mjs} +2 -2
- package/dist/esm/{chunk-II26BNYA.mjs → chunk-HULCIESG.mjs} +2 -2
- package/dist/esm/chunk-HULCIESG.mjs.map +1 -0
- package/dist/esm/{chunk-2YTHKFJZ.mjs → chunk-I3452DF5.mjs} +2 -2
- package/dist/esm/chunk-IHGA5KAD.mjs +2 -0
- package/dist/esm/{chunk-I2NMCLNW.mjs.map → chunk-IHGA5KAD.mjs.map} +1 -1
- package/dist/esm/{chunk-4J2JYRV3.mjs → chunk-JKA22FG5.mjs} +2 -2
- package/dist/esm/{chunk-HBWIDPNN.mjs → chunk-JUQBFGUD.mjs} +2 -2
- package/dist/esm/{chunk-TGW36YOD.mjs → chunk-JYGAG754.mjs} +2 -2
- package/dist/esm/{chunk-P2FTRAK3.mjs → chunk-KKLF7DQV.mjs} +2 -2
- package/dist/esm/{chunk-WYOFF5DJ.mjs → chunk-KPPM2BSC.mjs} +2 -2
- package/dist/esm/{chunk-2LQ4FTSR.mjs → chunk-L3J2QVIY.mjs} +2 -2
- package/dist/esm/{chunk-ML7D2CVG.mjs → chunk-LK67PZX3.mjs} +2 -2
- package/dist/esm/{chunk-CPKG25HX.mjs → chunk-LRN4ALMT.mjs} +2 -2
- package/dist/esm/{chunk-OVI7L7OG.mjs → chunk-LWXBEIFO.mjs} +2 -2
- package/dist/esm/{chunk-EJKX6MGV.mjs → chunk-LZ5PSDOS.mjs} +2 -2
- package/dist/esm/{chunk-XIB6LX22.mjs → chunk-MCWOKFVH.mjs} +2 -2
- package/dist/esm/{chunk-NF7ZQQE3.mjs → chunk-MV5PGWJQ.mjs} +2 -2
- package/dist/esm/{chunk-IUSAYAEI.mjs → chunk-MWNYODWU.mjs} +2 -2
- package/dist/esm/chunk-OEM75TVE.mjs +2 -0
- package/dist/esm/chunk-OEM75TVE.mjs.map +1 -0
- package/dist/esm/{chunk-RC43EXC4.mjs → chunk-OGBU52BQ.mjs} +2 -2
- package/dist/esm/{chunk-SPX2YFZN.mjs → chunk-P6RNNESB.mjs} +2 -2
- package/dist/esm/{chunk-YP3VO6GM.mjs → chunk-P74XXLE4.mjs} +2 -2
- package/dist/esm/{chunk-I5GENJBA.mjs → chunk-QK32EQSF.mjs} +2 -2
- package/dist/esm/{chunk-RLH25IDA.mjs → chunk-QLC7SSLJ.mjs} +2 -2
- package/dist/esm/chunk-QN7AK5PU.mjs +2 -0
- package/dist/esm/chunk-QN7AK5PU.mjs.map +1 -0
- package/dist/esm/{chunk-GX4CYRK4.mjs → chunk-QZT2M7UA.mjs} +2 -2
- package/dist/esm/{chunk-ERDYU5YQ.mjs → chunk-R2YT2IM5.mjs} +2 -2
- package/dist/esm/{chunk-RSO5YIDW.mjs → chunk-RV7PNWDY.mjs} +2 -2
- package/dist/esm/{chunk-CEW2NI3K.mjs → chunk-S22QVNK7.mjs} +2 -2
- package/dist/esm/{chunk-E2GPZCQI.mjs → chunk-S3YVCCYI.mjs} +2 -2
- package/dist/esm/{chunk-YIQ3JFHW.mjs → chunk-SMFTISPN.mjs} +2 -2
- package/dist/esm/{chunk-VGJIATTB.mjs → chunk-TTERI67T.mjs} +2 -2
- package/dist/esm/chunk-U2PRGW4O.mjs +2 -0
- package/dist/esm/chunk-U2PRGW4O.mjs.map +1 -0
- package/dist/esm/{chunk-L25CRR2W.mjs → chunk-U7UTBXJD.mjs} +2 -2
- package/dist/esm/{chunk-GZBVXXUL.mjs → chunk-VAKNMHOA.mjs} +2 -2
- package/dist/esm/{chunk-LHBMBCFC.mjs → chunk-VELQA2Y3.mjs} +2 -2
- package/dist/esm/{chunk-KTM6KVUJ.mjs → chunk-WTWWJWKC.mjs} +2 -2
- package/dist/esm/{chunk-KX43GEAB.mjs → chunk-WXLSHECY.mjs} +2 -2
- package/dist/esm/{chunk-FFCCBAEZ.mjs → chunk-XOOYRVFK.mjs} +2 -2
- package/dist/esm/{chunk-KCEI5JYS.mjs → chunk-XVPWTWPY.mjs} +2 -2
- package/dist/esm/{chunk-U3GE6IPF.mjs → chunk-Y5HLXDYG.mjs} +2 -2
- package/dist/esm/{chunk-5KCKWL2C.mjs → chunk-YITOC4Z6.mjs} +2 -2
- package/dist/esm/chunk-YQHOQJRQ.mjs +2 -0
- package/dist/esm/{chunk-RZGTHCJY.mjs.map → chunk-YQHOQJRQ.mjs.map} +1 -1
- package/dist/esm/{chunk-LGHPJTF3.mjs → chunk-YT3IP57B.mjs} +2 -2
- package/dist/esm/client/core.mjs +1 -1
- package/dist/esm/client/get.mjs +1 -1
- package/dist/esm/client/index.mjs +1 -1
- package/dist/esm/client/post.mjs +1 -1
- package/dist/esm/core/account/index.mjs +1 -1
- package/dist/esm/core/account/utils/address.mjs +1 -1
- package/dist/esm/core/account/utils/index.mjs +1 -1
- package/dist/esm/core/accountAddress.mjs +1 -1
- package/dist/esm/core/authenticationKey.mjs +1 -1
- package/dist/esm/core/crypto/ed25519.mjs +1 -1
- package/dist/esm/core/crypto/ephemeral.mjs +1 -1
- package/dist/esm/core/crypto/federatedKeyless.mjs +1 -1
- package/dist/esm/core/crypto/index.mjs +1 -1
- package/dist/esm/core/crypto/keyless.mjs +1 -1
- package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
- package/dist/esm/core/crypto/multiKey.mjs +1 -1
- package/dist/esm/core/crypto/privateKey.mjs +1 -1
- package/dist/esm/core/crypto/proof.mjs +1 -1
- package/dist/esm/core/crypto/publicKey.mjs +1 -1
- package/dist/esm/core/crypto/secp256k1.mjs +1 -1
- package/dist/esm/core/crypto/signature.mjs +1 -1
- package/dist/esm/core/crypto/singleKey.mjs +1 -1
- package/dist/esm/core/index.mjs +1 -1
- package/dist/esm/errors/index.mjs +1 -1
- package/dist/esm/index.d.mts +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/internal/account.mjs +1 -1
- package/dist/esm/internal/ans.mjs +1 -1
- package/dist/esm/internal/coin.mjs +1 -1
- package/dist/esm/internal/digitalAsset.mjs +1 -1
- package/dist/esm/internal/event.mjs +1 -1
- package/dist/esm/internal/faucet.mjs +1 -1
- package/dist/esm/internal/fungibleAsset.mjs +1 -1
- package/dist/esm/internal/general.mjs +1 -1
- package/dist/esm/internal/keyless.mjs +1 -1
- package/dist/esm/internal/object.mjs +1 -1
- package/dist/esm/internal/staking.mjs +1 -1
- package/dist/esm/internal/table.mjs +1 -1
- package/dist/esm/internal/transaction.mjs +1 -1
- package/dist/esm/internal/transactionSubmission.d.mts +1 -1
- package/dist/esm/internal/transactionSubmission.mjs +1 -1
- package/dist/esm/internal/view.mjs +1 -1
- package/dist/esm/transactions/authenticator/account.d.mts +10 -1
- package/dist/esm/transactions/authenticator/account.mjs +1 -1
- package/dist/esm/transactions/authenticator/index.d.mts +1 -1
- package/dist/esm/transactions/authenticator/index.mjs +1 -1
- package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
- package/dist/esm/transactions/index.d.mts +1 -1
- package/dist/esm/transactions/index.mjs +1 -1
- package/dist/esm/transactions/instances/index.mjs +1 -1
- package/dist/esm/transactions/instances/moduleId.mjs +1 -1
- package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
- package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
- package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
- package/dist/esm/transactions/management/index.mjs +1 -1
- package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +2 -2
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
- package/dist/esm/transactions/typeTag/index.mjs +1 -1
- package/dist/esm/transactions/typeTag/parser.mjs +1 -1
- package/dist/esm/transactions/types.d.mts +3 -2
- package/dist/esm/types/index.mjs +1 -1
- package/dist/esm/types/types.d.mts +2 -1
- package/dist/esm/types/types.mjs +1 -1
- package/dist/esm/utils/index.mjs +1 -1
- package/dist/esm/utils/normalizeBundle.mjs +1 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -2
- package/src/api/transactionSubmission/helpers.ts +0 -6
- package/src/api/transactionSubmission/simulate.ts +9 -8
- package/src/internal/transactionSubmission.ts +1 -1
- package/src/transactions/authenticator/account.ts +19 -0
- package/src/transactions/transactionBuilder/transactionBuilder.ts +25 -17
- package/src/transactions/types.ts +3 -2
- package/src/types/types.ts +1 -0
- package/src/version.ts +1 -1
- package/dist/esm/chunk-26WX3UFP.mjs +0 -2
- package/dist/esm/chunk-26WX3UFP.mjs.map +0 -1
- package/dist/esm/chunk-DYELAVMR.mjs +0 -2
- package/dist/esm/chunk-DYELAVMR.mjs.map +0 -1
- package/dist/esm/chunk-I2NMCLNW.mjs +0 -2
- package/dist/esm/chunk-II26BNYA.mjs.map +0 -1
- package/dist/esm/chunk-RZGTHCJY.mjs +0 -2
- package/dist/esm/chunk-SY4HK6CC.mjs.map +0 -1
- package/dist/esm/chunk-WQF3IOXC.mjs +0 -2
- package/dist/esm/chunk-WQF3IOXC.mjs.map +0 -1
- /package/dist/esm/{chunk-X7JNNNMC.mjs.map → chunk-2D7OMWVL.mjs.map} +0 -0
- /package/dist/esm/{chunk-JGLEKXFP.mjs.map → chunk-4ULPBQ3M.mjs.map} +0 -0
- /package/dist/esm/{chunk-MBEWPBGN.mjs.map → chunk-4ZNSNWQL.mjs.map} +0 -0
- /package/dist/esm/{chunk-KM6IOJ6Y.mjs.map → chunk-5XLZACVT.mjs.map} +0 -0
- /package/dist/esm/{chunk-UKVH4UGL.mjs.map → chunk-64IZ5PQR.mjs.map} +0 -0
- /package/dist/esm/{chunk-AGEJNSEX.mjs.map → chunk-6AEXQEO2.mjs.map} +0 -0
- /package/dist/esm/{chunk-7OHMMGS6.mjs.map → chunk-737YW3CY.mjs.map} +0 -0
- /package/dist/esm/{chunk-FYYTCJS4.mjs.map → chunk-7ZA434Z3.mjs.map} +0 -0
- /package/dist/esm/{chunk-2REHS35S.mjs.map → chunk-7ZVXQAG4.mjs.map} +0 -0
- /package/dist/esm/{chunk-VGITSRT6.mjs.map → chunk-A7TJF3BX.mjs.map} +0 -0
- /package/dist/esm/{chunk-BP45UJII.mjs.map → chunk-ALOYOMRE.mjs.map} +0 -0
- /package/dist/esm/{chunk-K62JTXWQ.mjs.map → chunk-B5BXB2BB.mjs.map} +0 -0
- /package/dist/esm/{chunk-LYO22HMF.mjs.map → chunk-BWV6OYLG.mjs.map} +0 -0
- /package/dist/esm/{chunk-HPZQGMSH.mjs.map → chunk-CK5NDXQT.mjs.map} +0 -0
- /package/dist/esm/{chunk-H7AALSJ7.mjs.map → chunk-FH27D7S3.mjs.map} +0 -0
- /package/dist/esm/{chunk-JIT2FYGE.mjs.map → chunk-FSBEKFEF.mjs.map} +0 -0
- /package/dist/esm/{chunk-IQ4SCMB6.mjs.map → chunk-FUC7SLH7.mjs.map} +0 -0
- /package/dist/esm/{chunk-JONEH52T.mjs.map → chunk-GT7QFXER.mjs.map} +0 -0
- /package/dist/esm/{chunk-UWLW2VLZ.mjs.map → chunk-H7PDLUNP.mjs.map} +0 -0
- /package/dist/esm/{chunk-ETF76XA3.mjs.map → chunk-HKVZ7CAG.mjs.map} +0 -0
- /package/dist/esm/{chunk-2YTHKFJZ.mjs.map → chunk-I3452DF5.mjs.map} +0 -0
- /package/dist/esm/{chunk-4J2JYRV3.mjs.map → chunk-JKA22FG5.mjs.map} +0 -0
- /package/dist/esm/{chunk-HBWIDPNN.mjs.map → chunk-JUQBFGUD.mjs.map} +0 -0
- /package/dist/esm/{chunk-TGW36YOD.mjs.map → chunk-JYGAG754.mjs.map} +0 -0
- /package/dist/esm/{chunk-P2FTRAK3.mjs.map → chunk-KKLF7DQV.mjs.map} +0 -0
- /package/dist/esm/{chunk-WYOFF5DJ.mjs.map → chunk-KPPM2BSC.mjs.map} +0 -0
- /package/dist/esm/{chunk-2LQ4FTSR.mjs.map → chunk-L3J2QVIY.mjs.map} +0 -0
- /package/dist/esm/{chunk-ML7D2CVG.mjs.map → chunk-LK67PZX3.mjs.map} +0 -0
- /package/dist/esm/{chunk-CPKG25HX.mjs.map → chunk-LRN4ALMT.mjs.map} +0 -0
- /package/dist/esm/{chunk-OVI7L7OG.mjs.map → chunk-LWXBEIFO.mjs.map} +0 -0
- /package/dist/esm/{chunk-EJKX6MGV.mjs.map → chunk-LZ5PSDOS.mjs.map} +0 -0
- /package/dist/esm/{chunk-XIB6LX22.mjs.map → chunk-MCWOKFVH.mjs.map} +0 -0
- /package/dist/esm/{chunk-NF7ZQQE3.mjs.map → chunk-MV5PGWJQ.mjs.map} +0 -0
- /package/dist/esm/{chunk-IUSAYAEI.mjs.map → chunk-MWNYODWU.mjs.map} +0 -0
- /package/dist/esm/{chunk-RC43EXC4.mjs.map → chunk-OGBU52BQ.mjs.map} +0 -0
- /package/dist/esm/{chunk-SPX2YFZN.mjs.map → chunk-P6RNNESB.mjs.map} +0 -0
- /package/dist/esm/{chunk-YP3VO6GM.mjs.map → chunk-P74XXLE4.mjs.map} +0 -0
- /package/dist/esm/{chunk-I5GENJBA.mjs.map → chunk-QK32EQSF.mjs.map} +0 -0
- /package/dist/esm/{chunk-RLH25IDA.mjs.map → chunk-QLC7SSLJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-GX4CYRK4.mjs.map → chunk-QZT2M7UA.mjs.map} +0 -0
- /package/dist/esm/{chunk-ERDYU5YQ.mjs.map → chunk-R2YT2IM5.mjs.map} +0 -0
- /package/dist/esm/{chunk-RSO5YIDW.mjs.map → chunk-RV7PNWDY.mjs.map} +0 -0
- /package/dist/esm/{chunk-CEW2NI3K.mjs.map → chunk-S22QVNK7.mjs.map} +0 -0
- /package/dist/esm/{chunk-E2GPZCQI.mjs.map → chunk-S3YVCCYI.mjs.map} +0 -0
- /package/dist/esm/{chunk-YIQ3JFHW.mjs.map → chunk-SMFTISPN.mjs.map} +0 -0
- /package/dist/esm/{chunk-VGJIATTB.mjs.map → chunk-TTERI67T.mjs.map} +0 -0
- /package/dist/esm/{chunk-L25CRR2W.mjs.map → chunk-U7UTBXJD.mjs.map} +0 -0
- /package/dist/esm/{chunk-GZBVXXUL.mjs.map → chunk-VAKNMHOA.mjs.map} +0 -0
- /package/dist/esm/{chunk-LHBMBCFC.mjs.map → chunk-VELQA2Y3.mjs.map} +0 -0
- /package/dist/esm/{chunk-KTM6KVUJ.mjs.map → chunk-WTWWJWKC.mjs.map} +0 -0
- /package/dist/esm/{chunk-KX43GEAB.mjs.map → chunk-WXLSHECY.mjs.map} +0 -0
- /package/dist/esm/{chunk-FFCCBAEZ.mjs.map → chunk-XOOYRVFK.mjs.map} +0 -0
- /package/dist/esm/{chunk-KCEI5JYS.mjs.map → chunk-XVPWTWPY.mjs.map} +0 -0
- /package/dist/esm/{chunk-U3GE6IPF.mjs.map → chunk-Y5HLXDYG.mjs.map} +0 -0
- /package/dist/esm/{chunk-5KCKWL2C.mjs.map → chunk-YITOC4Z6.mjs.map} +0 -0
- /package/dist/esm/{chunk-LGHPJTF3.mjs.map → chunk-YT3IP57B.mjs.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as c}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as c}from"./chunk-476F5NJ6.mjs";import{c as p}from"./chunk-AOROYJ74.mjs";import{c as o}from"./chunk-CK5NDXQT.mjs";import{n as u,q as g,r as A}from"./chunk-VHNX2NUR.mjs";import{f as a,i as r}from"./chunk-T6ADNZE5.mjs";async function G(t){let{aptosConfig:s,options:e}=t,n={query:A,variables:{where_condition:e?.where,limit:e?.limit,offset:e?.offset}};return(await o({aptosConfig:s,query:n,originMethod:"getFungibleAssetMetadata"})).fungible_asset_metadata}async function h(t){let{aptosConfig:s,options:e}=t,n={query:g,variables:{where_condition:e?.where,limit:e?.limit,offset:e?.offset}};return(await o({aptosConfig:s,query:n,originMethod:"getFungibleAssetActivities"})).fungible_asset_activities}async function M(t){let{aptosConfig:s,options:e}=t,n={query:u,variables:{where_condition:e?.where,limit:e?.limit,offset:e?.offset}};return(await o({aptosConfig:s,query:n,originMethod:"getCurrentFungibleAssetBalances"})).current_fungible_asset_balances}var b={typeParameters:[{constraints:[]}],parameters:[p("0x1::object::Object"),new r,new a]};async function x(t){let{aptosConfig:s,sender:e,fungibleAssetMetadataAddress:n,recipient:i,amount:l,options:f}=t;return c({aptosConfig:s,sender:e.accountAddress,data:{function:"0x1::primary_fungible_store::transfer",typeArguments:["0x1::fungible_asset::Metadata"],functionArguments:[n,i,l],abi:b},options:f})}export{G as a,h as b,M as c,x as d};
|
|
2
|
+
//# sourceMappingURL=chunk-FH27D7S3.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as m}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as m}from"./chunk-476F5NJ6.mjs";import{a as g}from"./chunk-2D7OMWVL.mjs";import{c as A}from"./chunk-CK5NDXQT.mjs";import{s as f}from"./chunk-VHNX2NUR.mjs";import{b as w}from"./chunk-JNO7KPMG.mjs";var T=["A name must be between 3 and 63 characters long,","and can only contain lowercase a-z, 0-9, and hyphens.","A name may not start or end with a hyphen."].join(" ");function D(e){return!(!e||e.length<3||e.length>63||!/^[a-z\d][a-z\d-]{1,61}[a-z\d]$/.test(e))}function c(e){let[t,n,...o]=e.replace(/\.apt$/,"").split(".");if(o.length>0)throw new Error(`${e} is invalid. A name can only have two parts, a domain and a subdomain separated by a "."`);if(!D(t))throw new Error(`${t} is not valid. ${T}`);if(n&&!D(n))throw new Error(`${n} is not valid. ${T}`);return{domainName:n||t,subdomainName:n?t:void 0}}var I=(n=>(n[n.Independent=0]="Independent",n[n.FollowsDomain=1]="FollowsDomain",n))(I||{});function E(e){if(!e)return!1;let t=new Date(e.domain_expiration_timestamp).getTime()<Date.now(),n=new Date(e.expiration_timestamp).getTime()<Date.now();return e.subdomain&&t?!1:e.subdomain&&e.subdomain_expiration_policy===1?!0:!n}var j="0x37368b46ce665362562c6d1d4ec01a08c8644c488690df5a17e13ba163e20221",v="0x585fc9f0f0c54183b039ffc770ca282ebd87307916c215a3e692f2f8e4305e82",O={testnet:"0x5f8fd2347449685cf41d4db97926ec3a096eaf381332be4f1318ad4d16a8497c",mainnet:"0x867ed1f6bf916171b1de3ee92849b8978b7d1b9e0a8cc982a3d19d535dfd9c0c",local:v,custom:null,devnet:null};function d(e){let t=O[e.network];if(!t)throw new Error(`The ANS contract is not deployed to ${e.network}`);return t}var b=e=>{if(e&&typeof e=="object"&&"vec"in e&&Array.isArray(e.vec))return e.vec[0]};async function F(e){let{aptosConfig:t,name:n}=e,o=d(t),{domainName:r,subdomainName:s}=c(n),i=await g({aptosConfig:t,payload:{function:`${o}::router::get_owner_addr`,functionArguments:[r,s]}}),a=b(i[0]);return a?w.from(a):void 0}async function Y(e){let{aptosConfig:t,expiration:n,name:o,sender:r,targetAddress:s,toAddress:i,options:a,transferable:u}=e,p=d(t),{domainName:y,subdomainName:N}=c(o),x=n.policy==="subdomain:independent"||n.policy==="subdomain:follow-domain";if(N&&!x)throw new Error("Subdomains must have an expiration policy of either 'subdomain:independent' or 'subdomain:follow-domain'");if(x&&!N)throw new Error(`Policy is set to ${n.policy} but no subdomain was provided`);if(n.policy==="domain"){let h=n.years??1;if(h!==1)throw new Error("For now, names can only be registered for 1 year at a time");let G=h*31536e3;return await m({aptosConfig:t,sender:r.accountAddress.toString(),data:{function:`${p}::router::register_domain`,functionArguments:[y,G,s,i]},options:a})}if(!N)throw new Error(`${n.policy} requires a subdomain to be provided.`);let _=await P({aptosConfig:t,name:y});if(!_)throw new Error("The domain does not exist");let S=n.policy==="subdomain:independent"?n.expirationDate:_;if(S>_)throw new Error("The subdomain expiration time cannot be greater than the domain expiration time");return await m({aptosConfig:t,sender:r.accountAddress.toString(),data:{function:`${p}::router::register_subdomain`,functionArguments:[y,N,Math.round(S/1e3),n.policy==="subdomain:follow-domain"?1:0,!!u,s,i]},options:a})}async function P(e){let{aptosConfig:t,name:n}=e,o=d(t),{domainName:r,subdomainName:s}=c(n);try{let i=await g({aptosConfig:t,payload:{function:`${o}::router::get_expiration`,functionArguments:[r,s]}});return Number(i[0])*1e3}catch{return}}async function K(e){let{aptosConfig:t,address:n}=e,o=d(t),r=await g({aptosConfig:t,payload:{function:`${o}::router::get_primary_name`,functionArguments:[w.from(n).toString()]}}),s=b(r[1]),i=b(r[0]);if(s)return[i,s].filter(Boolean).join(".")}async function W(e){let{aptosConfig:t,sender:n,name:o,options:r}=e,s=d(t);if(!o)return await m({aptosConfig:t,sender:n.accountAddress.toString(),data:{function:`${s}::router::clear_primary_name`,functionArguments:[]},options:r});let{domainName:i,subdomainName:a}=c(o);return await m({aptosConfig:t,sender:n.accountAddress.toString(),data:{function:`${s}::router::set_primary_name`,functionArguments:[i,a]},options:r})}async function H(e){let{aptosConfig:t,name:n}=e,o=d(t),{domainName:r,subdomainName:s}=c(n),i=await g({aptosConfig:t,payload:{function:`${o}::router::get_target_addr`,functionArguments:[r,s]}}),a=b(i[0]);return a?w.from(a):void 0}async function J(e){let{aptosConfig:t,sender:n,name:o,address:r,options:s}=e,i=d(t),{domainName:a,subdomainName:u}=c(o);return await m({aptosConfig:t,sender:n.accountAddress.toString(),data:{function:`${i}::router::set_target_addr`,functionArguments:[a,u,r]},options:s})}async function X(e){let{aptosConfig:t,name:n}=e,{domainName:o,subdomainName:r=""}=c(n),a=(await A({aptosConfig:t,query:{query:f,variables:{where_condition:{domain:{_eq:o},subdomain:{_eq:r}},limit:1}},originMethod:"getName"})).current_aptos_names[0];return a&&(a=l(a)),E(a)?a:void 0}async function Z(e){let{aptosConfig:t,options:n,accountAddress:o}=e,r=await C({aptosConfig:t});return(await A({aptosConfig:t,originMethod:"getAccountNames",query:{query:f,variables:{limit:n?.limit,offset:n?.offset,order_by:n?.orderBy,where_condition:{...e.options?.where??{},owner_address:{_eq:o.toString()},expiration_timestamp:{_gte:r}}}}})).current_aptos_names.map(l)}async function ee(e){let{aptosConfig:t,options:n,accountAddress:o}=e,r=await C({aptosConfig:t});return(await A({aptosConfig:t,originMethod:"getAccountDomains",query:{query:f,variables:{limit:n?.limit,offset:n?.offset,order_by:n?.orderBy,where_condition:{...e.options?.where??{},owner_address:{_eq:o.toString()},expiration_timestamp:{_gte:r},subdomain:{_eq:""}}}}})).current_aptos_names.map(l)}async function ne(e){let{aptosConfig:t,options:n,accountAddress:o}=e,r=await C({aptosConfig:t});return(await A({aptosConfig:t,originMethod:"getAccountSubdomains",query:{query:f,variables:{limit:n?.limit,offset:n?.offset,order_by:n?.orderBy,where_condition:{...e.options?.where??{},owner_address:{_eq:o.toString()},expiration_timestamp:{_gte:r},subdomain:{_neq:""}}}}})).current_aptos_names.map(l)}async function te(e){let{aptosConfig:t,options:n,domain:o}=e;return(await A({aptosConfig:t,originMethod:"getDomainSubdomains",query:{query:f,variables:{limit:n?.limit,offset:n?.offset,order_by:n?.orderBy,where_condition:{...e.options?.where??{},domain:{_eq:o},subdomain:{_neq:""}}}}})).current_aptos_names.map(l).filter(E)}async function C(e){let{aptosConfig:t}=e,n=d(t),[o]=await g({aptosConfig:t,payload:{function:`${n}::config::reregistration_grace_sec`,functionArguments:[]}}),r=o/60/60/24,s=()=>new Date;return new Date(s().setDate(s().getDate()-r)).toISOString()}async function oe(e){let{aptosConfig:t,sender:n,name:o,years:r=1,options:s}=e,i=d(t),a=r*31536e3,{domainName:u,subdomainName:p}=c(o);if(p)throw new Error("Subdomains cannot be renewed");if(r!==1)throw new Error("Currently, only 1 year renewals are supported");return await m({aptosConfig:t,sender:n.accountAddress.toString(),data:{function:`${i}::router::renew_domain`,functionArguments:[u,a]},options:s})}function l(e){return{...e,expiration_timestamp:new Date(e.expiration_timestamp).getTime()}}export{T as a,D as b,c,I as d,E as e,j as f,v as g,F as h,Y as i,P as j,K as k,W as l,H as m,J as n,X as o,Z as p,ee as q,ne as r,te as s,oe as t};
|
|
2
|
+
//# sourceMappingURL=chunk-FSBEKFEF.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{i as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{i as s}from"./chunk-B5BXB2BB.mjs";import{b as c}from"./chunk-MHN6XY4Z.mjs";import{a as d}from"./chunk-AKIO3OIT.mjs";import{b as i}from"./chunk-JNO7KPMG.mjs";import{b as n}from"./chunk-AJ5JHBAE.mjs";var u=class r extends c{constructor(e,t){super(),this.jwkAddress=i.from(e),this.keylessPublicKey=t}authKey(){let e=new n;return e.serializeU32AsUleb128(4),e.serializeFixedBytes(this.bcsToBytes()),d.fromSchemeAndBytes({scheme:2,input:e.toUint8Array()})}verifySignature(e){throw new Error("Not yet implemented")}serialize(e){this.jwkAddress.serialize(e),this.keylessPublicKey.serialize(e)}static deserialize(e){let t=i.deserialize(e),l=s.deserialize(e);return new r(t,l)}static isPublicKey(e){return e instanceof r}static create(e){return new r(e.jwkAddress,s.create(e))}static fromJwtAndPepper(e){return new r(e.jwkAddress,s.fromJwtAndPepper(e))}static isInstance(e){return"jwkAddress"in e&&e.jwkAddress instanceof i&&"keylessPublicKey"in e&&e.keylessPublicKey instanceof s}};export{u as a};
|
|
2
|
+
//# sourceMappingURL=chunk-FUC7SLH7.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as h}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as h}from"./chunk-HULCIESG.mjs";import{a as T}from"./chunk-Y5HLXDYG.mjs";import{a as f}from"./chunk-MCWOKFVH.mjs";import{a as d}from"./chunk-XVPWTWPY.mjs";import{d as c,e as u,f as g,i as m,j as p,k as y,l as A}from"./chunk-476F5NJ6.mjs";import{a,b as o,c as i,d as s,e,g as r}from"./chunk-QK32EQSF.mjs";var P=class{constructor(n){this.config=n,this.build=new f(this.config),this.simulate=new h(this.config),this.submit=new T(this.config),this.batch=new d(this.config)}async getTransactions(n){return a({aptosConfig:this.config,...n})}async getTransactionByVersion(n){return i({aptosConfig:this.config,...n})}async getTransactionByHash(n){return s({aptosConfig:this.config,...n})}async isPendingTransaction(n){return e({aptosConfig:this.config,...n})}async waitForTransaction(n){return r({aptosConfig:this.config,...n})}async getGasPriceEstimation(){return o({aptosConfig:this.config})}getSigningMessage(n){return c(n)}async publishPackageTransaction(n){return y({aptosConfig:this.config,...n})}async rotateAuthKey(n){return A({aptosConfig:this.config,...n})}sign(n){return u({...n})}signAsFeePayer(n){return g({...n})}async batchTransactionsForSingleAccount(n){try{let{sender:t,data:l,options:b}=n;this.batch.forSingleAccount({sender:t,data:l,options:b})}catch(t){throw new Error(`failed to submit transactions with error: ${t}`)}}async signAndSubmitTransaction(n){return m({aptosConfig:this.config,...n})}async signAndSubmitAsFeePayer(n){return p({aptosConfig:this.config,...n})}};export{P as a};
|
|
2
|
+
//# sourceMappingURL=chunk-GT7QFXER.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as O,b as _}from"./chunk-TQA6HY6A.mjs";import{d as E}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as O,b as _}from"./chunk-TQA6HY6A.mjs";import{d as E}from"./chunk-OEM75TVE.mjs";import{a as R}from"./chunk-LZ5PSDOS.mjs";import{a as P,b as w}from"./chunk-KKLF7DQV.mjs";import{a as I}from"./chunk-FUC7SLH7.mjs";import{i as T,j as b,k as x,n as g,q as v,s as k}from"./chunk-B5BXB2BB.mjs";import{b as m}from"./chunk-JNO7KPMG.mjs";import{d as r}from"./chunk-F45G3GP3.mjs";import{a as K}from"./chunk-AJ5JHBAE.mjs";import{b as h}from"./chunk-SPRNSFUV.mjs";import{e as F}from"./chunk-V4FKFCBL.mjs";import C from"eventemitter3";import{jwtDecode as D}from"jwt-decode";function se(f){return f!=null&&typeof f.checkKeylessAccountValidity=="function"}var p=class p extends K{constructor(e){super();let{address:i,ephemeralKeyPair:t,publicKey:o,uidKey:y,uidVal:n,aud:c,pepper:s,proof:a,proofFetchCallback:l,jwt:d,verificationKeyHash:u}=e;if(this.ephemeralKeyPair=t,this.publicKey=o,this.accountAddress=i?m.from(i):this.publicKey.authKey().derivedAddress(),this.uidKey=y,this.uidVal=n,this.aud=c,this.jwt=d,this.emitter=new C,this.proofOrPromise=a,a instanceof g)this.proof=a;else{if(l===void 0)throw new Error("Must provide callback for async proof fetch");this.emitter.on("proofFetchFinish",async N=>{await l(N),this.emitter.removeAllListeners()}),this.init(a)}this.signingScheme=2;let S=h.fromHexInput(s).toUint8Array();if(S.length!==p.PEPPER_LENGTH)throw new Error(`Pepper length in bytes should be ${p.PEPPER_LENGTH}`);if(this.pepper=S,u!==void 0){if(h.hexInputToUint8Array(u).length!==32)throw new Error("verificationKeyHash must be 32 bytes");this.verificationKeyHash=h.hexInputToUint8Array(u)}}async init(e){try{this.proof=await e,this.emitter.emit("proofFetchFinish",{status:"Success"})}catch(i){i instanceof Error?this.emitter.emit("proofFetchFinish",{status:"Failed",error:i.toString()}):this.emitter.emit("proofFetchFinish",{status:"Failed",error:"Unknown"})}}serialize(e){if(this.accountAddress.serialize(e),e.serializeStr(this.jwt),e.serializeStr(this.uidKey),e.serializeFixedBytes(this.pepper),this.ephemeralKeyPair.serialize(e),this.proof===void 0)throw new Error("Cannot serialize - proof undefined");this.proof.serialize(e),e.serializeOption(this.verificationKeyHash,32)}static partialDeserialize(e){let i=m.deserialize(e),t=e.deserializeStr(),o=e.deserializeStr(),y=e.deserializeFixedBytes(31),n=R.deserialize(e),c=g.deserialize(e),s=e.deserializeOption("fixedBytes",32);return{address:i,jwt:t,uidKey:o,pepper:y,ephemeralKeyPair:n,proof:c,verificationKeyHash:s}}isExpired(){return this.ephemeralKeyPair.isExpired()}signWithAuthenticator(e){let i=new w(this.sign(e)),t=new P(this.publicKey);return new E(t,i)}signTransactionWithAuthenticator(e){let i=new w(this.signTransaction(e)),t=new P(this.publicKey);return new E(t,i)}async waitForProofFetch(){this.proofOrPromise instanceof Promise&&await this.proofOrPromise}async checkKeylessAccountValidity(e){if(this.isExpired())throw r.fromErrorType({type:0});if(await this.waitForProofFetch(),this.proof===void 0)throw r.fromErrorType({type:2});let i=D(this.jwt,{header:!0});if(i.kid===void 0)throw r.fromErrorType({type:12,details:"checkKeylessAccountValidity failed. JWT is missing 'kid' in header. This should never happen."});if(this.verificationKeyHash!==void 0){let{verificationKey:t}=await v({aptosConfig:e});if(h.hexInputToString(t.hash())!==h.hexInputToString(this.verificationKeyHash))throw r.fromErrorType({type:4})}else console.warn("[Aptos SDK] The verification key hash was not set. Proof may be invalid if the verification key has rotated.");await p.fetchJWK({aptosConfig:e,publicKey:this.publicKey,kid:i.kid})}sign(e){let{expiryDateSecs:i}=this.ephemeralKeyPair;if(this.isExpired())throw r.fromErrorType({type:0});if(this.proof===void 0)throw r.fromErrorType({type:1,details:"Proof not found - make sure to call `await account.checkKeylessAccountValidity()` before signing."});let t=this.ephemeralKeyPair.getPublicKey(),o=this.ephemeralKeyPair.sign(e);return new b({jwtHeader:F(this.jwt.split(".")[0]),ephemeralCertificate:new x(this.proof,0),expiryDateSecs:i,ephemeralPublicKey:t,ephemeralSignature:o})}signTransaction(e){if(this.proof===void 0)throw r.fromErrorType({type:1,details:"Proof not found - make sure to call `await account.checkKeylessAccountValidity()` before signing."});let i=O(e),o=new A(i,this.proof.proof).hash();return this.sign(o)}verifySignature(e){let{message:i,signature:t}=e;return!(this.isExpired()||!this.ephemeralKeyPair.getPublicKey().verifySignature({message:i,signature:t.ephemeralSignature}))}static async fetchJWK(e){let{aptosConfig:i,publicKey:t,kid:o}=e,y=t instanceof T?t:t.keylessPublicKey,{iss:n}=y,c,s=t instanceof I?t.jwkAddress:void 0;try{c=await k({aptosConfig:i,jwkAddr:s})}catch(d){throw r.fromErrorType({type:24,error:d,details:`Failed to fetch ${s?"Federated":"Patched"}JWKs ${s?`for address ${s}`:"0x1"}`})}let a=c.get(n);if(a===void 0)throw r.fromErrorType({type:7,details:`JWKs for issuer ${n} not found.`});let l=a.find(d=>d.kid===o);if(l===void 0)throw r.fromErrorType({type:6,details:`JWK with kid '${o}' for issuer '${n}' not found.`});return l}};p.PEPPER_LENGTH=31;var H=p,A=class extends K{constructor(i,t){super();this.domainSeparator="APTOS::TransactionAndProof";this.transaction=i,this.proof=t}serialize(i){i.serializeFixedBytes(this.transaction.bcsToBytes()),i.serializeOption(this.proof)}hash(){return _(this.bcsToBytes(),this.domainSeparator)}};export{se as a,H as b,A as c};
|
|
2
|
+
//# sourceMappingURL=chunk-H7PDLUNP.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as r,b as i,c as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as r,b as i,c as s}from"./chunk-5XLZACVT.mjs";import{a as o}from"./chunk-ALOYOMRE.mjs";var t=class{constructor(e){this.config=e}async getNumberOfDelegators(e){return await o({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"stake_processor"}),r({aptosConfig:this.config,...e})}async getNumberOfDelegatorsForAllPools(e){return await o({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"stake_processor"}),i({aptosConfig:this.config,...e})}async getDelegatedStakingActivities(e){return await o({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"stake_processor"}),s({aptosConfig:this.config,...e})}};export{t as a};
|
|
2
|
+
//# sourceMappingURL=chunk-HKVZ7CAG.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as s}from"./chunk-IHGA5KAD.mjs";import{g as r}from"./chunk-476F5NJ6.mjs";import{a as o}from"./chunk-KDMSOCZY.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-HULCIESG.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/api/transactionSubmission/simulate.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { PublicKey } from \"../../core\";\nimport { simulateTransaction } from \"../../internal/transactionSubmission\";\nimport { AnyRawTransaction, InputSimulateTransactionOptions } from \"../../transactions\";\nimport { UserTransactionResponse } from \"../../types\";\nimport { AptosConfig } from \"../aptosConfig\";\nimport { ValidateFeePayerDataOnSimulation } from \"./helpers\";\n\n/**\n * A class to handle all `Simulate` transaction operations.\n */\nexport class Simulate {\n readonly config: AptosConfig;\n\n /**\n * Initializes a new instance of the Aptos client with the specified configuration.\n * This allows you to interact with the Aptos blockchain using the provided settings.\n *\n * @param config - The configuration settings for the Aptos client.\n * @param config.network - The network to connect to (e.g., TESTNET, MAINNET).\n * @param config.nodeUrl - The URL of the Aptos node to connect to.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * async function runExample() {\n * // Create a configuration for the Aptos client\n * const config = new AptosConfig({ network: Network.TESTNET }); // Specify your desired network\n *\n * // Initialize the Aptos client with the configuration\n * const aptos = new Aptos(config);\n *\n * console.log(\"Aptos client initialized:\", aptos);\n * }\n * runExample().catch(console.error);\n * ```\n */\n constructor(config: AptosConfig) {\n this.config = config;\n }\n\n /**\n * Simulates a transaction based on the provided parameters and returns the result.\n * This function helps you understand the outcome of a transaction before executing it on the blockchain.\n *\n * @param args - The parameters for simulating the transaction.\n * @param args.signerPublicKey - The public key of the signer for the transaction (optional).\n * @param args.transaction - The raw transaction data to simulate.\n * @param args.feePayerPublicKey - The public key of the fee payer (optional).\n * @param args.options - Additional options for simulating the transaction (optional).\n *\n * @example\n * ```typescript\n * import {\n * Account,\n * Aptos,\n * AptosConfig,\n * Network,\n * } from \"@aptos-labs/ts-sdk\";\n *\n * async function example() {\n * let sender = Account.generate();\n * let receiver = Account.generate();\n *\n * // 0. Set up the client and test accounts\n * const config = new AptosConfig({ network: Network.DEVNET });\n * const aptos = new Aptos(config);\n *\n * await aptos.fundAccount({\n * accountAddress: sender.accountAddress,\n * amount: 100_000_000,\n * });\n *\n * // 1. Build the transaction to preview the impact of it\n * const transaction = await aptos.transaction.build.simple({\n * sender: sender.accountAddress,\n * data: {\n * // All transactions on Aptos are implemented via smart contracts.\n * function: \"0x1::aptos_account::transfer\",\n * functionArguments: [receiver.accountAddress, 100],\n * },\n * });\n *\n * // 2. Simulate to see what would happen if we execute this transaction\n * const [userTransactionResponse] = await aptos.transaction.simulate.simple({\n * signerPublicKey: sender.publicKey,\n * transaction,\n * });\n * console.log(userTransactionResponse);\n *\n * // If the fee looks ok, continue to signing!\n * // ...\n * }\n *\n * example();\n * ```\n */\n @ValidateFeePayerDataOnSimulation\n async simple(args: {\n signerPublicKey?: PublicKey;\n transaction: AnyRawTransaction;\n feePayerPublicKey?: PublicKey;\n options?: InputSimulateTransactionOptions;\n }): Promise<Array<UserTransactionResponse>> {\n return simulateTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Simulates a multi-agent transaction by generating a signed transaction and posting it to the Aptos full node.\n * This function helps in understanding the outcome of a transaction involving multiple signers before it is executed.\n *\n * @param args - The parameters for simulating the transaction.\n * @param args.signerPublicKey - The public key of the primary signer (optional).\n * @param args.transaction - The raw transaction to be simulated.\n * @param args.secondarySignersPublicKeys - An array of public keys for secondary signers (optional).\n * Each element of the array can be optional, allowing the corresponding key check to be skipped.\n * @param args.feePayerPublicKey - The public key of the fee payer (optional).\n * @param args.options - Options for simulating the transaction (optional).\n *\n * @example\n * ```typescript\n * import {\n * Account,\n * Aptos,\n * AptosConfig,\n * Network,\n * } from \"@aptos-labs/ts-sdk\";\n *\n * async function example() {\n * let sender1 = Account.generate();\n * let sender2 = Account.generate();\n * let receiver = Account.generate();\n *\n * // 0. Set up the client and test accounts\n * const config = new AptosConfig({ network: Network.DEVNET });\n * const aptos = new Aptos(config);\n *\n * await aptos.fundAccount({\n * accountAddress: sender.accountAddress,\n * amount: 100_000_000,\n * });\n *\n * // 1. Build\n * console.log(\"\\n=== 1. Building the transaction ===\\n\");\n * const transaction = await aptos.transaction.build.multiAgent({\n * sender: sender1.accountAddress,\n * secondarySignerAddresses: [sender2.accountAddress],\n * data: {\n * // REPLACE WITH YOUR MULTI-AGENT FUNCTION HERE\n * function:\n * \"<REPLACE WITH YOUR MULTI AGENT MOVE ENTRY FUNCTION> (Syntax {address}::{module}::{function})\",\n * functionArguments: [],\n * },\n * });\n * console.log(\"Transaction:\", transaction);\n *\n * // 2. Simulate (Optional)\n * console.log(\"\\n === 2. Simulating Response (Optional) === \\n\");\n * const [userTransactionResponse] = await aptos.transaction.simulate.multiAgent(\n * {\n * signerPublicKey: sender1.publicKey,\n * secondarySignersPublicKeys: [sender2.publicKey],\n * transaction,\n * },\n * );\n * console.log(userTransactionResponse);\n *\n * // If the fee looks ok, continue to signing!\n * // ...\n * }\n *\n * example();\n * ```\n */\n @ValidateFeePayerDataOnSimulation\n async multiAgent(args: {\n signerPublicKey?: PublicKey;\n transaction: AnyRawTransaction;\n secondarySignersPublicKeys?: Array<PublicKey | undefined>;\n feePayerPublicKey?: PublicKey;\n options?: InputSimulateTransactionOptions;\n }): Promise<Array<UserTransactionResponse>> {\n return simulateTransaction({ aptosConfig: this.config, ...args });\n }\n}\n"],"mappings":"2HAaO,IAAMA,EAAN,KAAe,CA2BpB,YAAYC,EAAqB,CAC/B,KAAK,OAASA,CAChB,CA2DA,MAAM,OAAOC,EAK+B,CAC1C,OAAOC,EAAoB,CAAE,YAAa,KAAK,OAAQ,GAAGD,CAAK,CAAC,CAClE,CAsEA,MAAM,WAAWA,EAM2B,CAC1C,OAAOC,EAAoB,CAAE,YAAa,KAAK,OAAQ,GAAGD,CAAK,CAAC,CAClE,CACF,EAtFQE,EAAA,CADLC,GAvFUL,EAwFL,sBA6EAI,EAAA,CADLC,GApKUL,EAqKL","names":["Simulate","config","args","simulateTransaction","__decorateClass","ValidateFeePayerDataOnSimulation"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as h,d as l}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as h,d as l}from"./chunk-TTERI67T.mjs";import{b as E}from"./chunk-MHN6XY4Z.mjs";import{a as p}from"./chunk-4O5XDQDO.mjs";import{a as g}from"./chunk-AKIO3OIT.mjs";var o=class o extends E{constructor(r){super();let{publicKeys:e,threshold:t}=r;if(e.length>o.MAX_KEYS||e.length<o.MIN_KEYS)throw new Error(`Must have between ${o.MIN_KEYS} and ${o.MAX_KEYS} public keys, inclusive`);if(t<o.MIN_THRESHOLD||t>e.length)throw new Error(`Threshold must be between ${o.MIN_THRESHOLD} and ${e.length}, inclusive`);this.publicKeys=e,this.threshold=t}verifySignature(r){let{message:e,signature:t}=r;if(!(t instanceof y))return!1;let s=[];for(let i=0;i<4;i+=1)for(let n=0;n<8;n+=1)if((t.bitmap[i]&1<<7-n)!==0){let u=i*8+n;s.push(u)}if(s.length!==t.signatures.length)throw new Error("Bitmap and signatures length mismatch");if(s.length<this.threshold)throw new Error("Not enough signatures");for(let i=0;i<s.length;i+=1)if(!this.publicKeys[s[i]].verifySignature({message:e,signature:t.signatures[i]}))return!1;return!0}authKey(){return g.fromSchemeAndBytes({scheme:1,input:this.toUint8Array()})}toUint8Array(){let r=new Uint8Array(this.publicKeys.length*h.LENGTH+1);return this.publicKeys.forEach((e,t)=>{r.set(e.toUint8Array(),t*h.LENGTH)}),r[this.publicKeys.length*h.LENGTH]=this.threshold,r}serialize(r){r.serializeBytes(this.toUint8Array())}static deserialize(r){let e=r.deserializeBytes(),t=e[e.length-1],s=[];for(let i=0;i<e.length-1;i+=h.LENGTH){let n=i;s.push(new h(e.subarray(n,n+h.LENGTH)))}return new o({publicKeys:s,threshold:t})}};o.MAX_KEYS=32,o.MIN_KEYS=2,o.MIN_THRESHOLD=1;var d=o,a=class a extends p{constructor(r){super();let{signatures:e,bitmap:t}=r;if(e.length>a.MAX_SIGNATURES_SUPPORTED)throw new Error(`The number of signatures cannot be greater than ${a.MAX_SIGNATURES_SUPPORTED}`);if(this.signatures=e,!(t instanceof Uint8Array))this.bitmap=a.createBitmap({bits:t});else{if(t.length!==a.BITMAP_LEN)throw new Error(`"bitmap" length should be ${a.BITMAP_LEN}`);this.bitmap=t}}toUint8Array(){let r=new Uint8Array(this.signatures.length*l.LENGTH+a.BITMAP_LEN);return this.signatures.forEach((e,t)=>{r.set(e.toUint8Array(),t*l.LENGTH)}),r.set(this.bitmap,this.signatures.length*l.LENGTH),r}serialize(r){r.serializeBytes(this.toUint8Array())}static deserialize(r){let e=r.deserializeBytes(),t=e.subarray(e.length-4),s=[];for(let i=0;i<e.length-t.length;i+=l.LENGTH){let n=i;s.push(new l(e.subarray(n,n+l.LENGTH)))}return new a({signatures:s,bitmap:t})}static createBitmap(r){let{bits:e}=r,t=128,s=new Uint8Array([0,0,0,0]),i=new Set;return e.forEach((n,c)=>{if(n>=a.MAX_SIGNATURES_SUPPORTED)throw new Error(`Cannot have a signature larger than ${a.MAX_SIGNATURES_SUPPORTED-1}.`);if(i.has(n))throw new Error("Duplicate bits detected.");if(c>0&&n<=e[c-1])throw new Error("The bits need to be sorted in ascending order.");i.add(n);let u=Math.floor(n/8),b=s[u];b|=t>>n%8,s[u]=b}),s}};a.MAX_SIGNATURES_SUPPORTED=32,a.BITMAP_LEN=4;var y=a;export{d as a,y as b};
|
|
2
|
+
//# sourceMappingURL=chunk-I3452DF5.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function i(r,o,t){let n=t.value;return t.value=async function(...e){let[a]=e;if(a.transaction.feePayerAddress&&!a.feePayerAuthenticator)throw new Error("You are submitting a Fee Payer transaction but missing the feePayerAuthenticator");return n.apply(this,e)},t}function u(r,o,t){let n=t.value;return t.value=async function(...e){return n.apply(this,e)},t}export{i as a,u as b};
|
|
2
|
+
//# sourceMappingURL=chunk-IHGA5KAD.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/api/transactionSubmission/helpers.ts"],"sourcesContent":["/**\n * Validates the fee payer data when submitting a transaction to ensure that the fee payer authenticator is provided if a fee\n * payer address is specified.\n * This helps prevent errors in transaction submission related to fee payer authentication.\n *\n * @param target - The target object where the method is defined.\n * @param propertyKey - The name of the method being decorated.\n * @param descriptor - The property descriptor for the method.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * class TransactionHandler {\n * @ValidateFeePayerDataOnSubmission\n * async submitTransaction(methodArgs: { transaction: { feePayerAddress: string }, feePayerAuthenticator?: string }) {\n * // Logic to submit the transaction\n * }\n * }\n *\n * async function runExample() {\n * const handler = new TransactionHandler();\n *\n * // Attempt to submit a transaction without a fee payer authenticator\n * try {\n * await handler.submitTransaction({\n * transaction: { feePayerAddress: \"0x1\" }, // replace with a real fee payer address\n * });\n * } catch (error) {\n * console.error(error.message); // Should log the error message\n * }\n *\n * // Submit a transaction with a fee payer authenticator\n * await handler.submitTransaction({\n * transaction: { feePayerAddress: \"0x1\" }, // replace with a real fee payer address\n * feePayerAuthenticator: \"authenticatorValue\", // replace with a real authenticator\n * });\n *\n * console.log(\"Transaction submitted successfully.\");\n * }\n * runExample().catch(console.error);\n * ```\n */\nexport function ValidateFeePayerDataOnSubmission(target: unknown, propertyKey: string, descriptor: PropertyDescriptor) {\n const originalMethod = descriptor.value;\n /* eslint-disable-next-line func-names, no-param-reassign */\n descriptor.value = async function (...args: any[]) {\n const [methodArgs] = args;\n\n if (methodArgs.transaction.feePayerAddress && !methodArgs.feePayerAuthenticator) {\n throw new Error(\"You are submitting a Fee Payer transaction but missing the feePayerAuthenticator\");\n }\n\n return originalMethod.apply(this, args);\n };\n\n return descriptor;\n}\n\n/**\n * Validates that the fee payer public key is provided when simulating a Fee Payer transaction.\n * This ensures that all necessary data is present for the simulation to proceed correctly.\n *\n * @param target - The target object where the method is defined.\n * @param propertyKey - The name of the method being decorated.\n * @param descriptor - The property descriptor for the method.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * const methodArgs = {\n * transaction: {\n * feePayerAddress: \"0x1\", // replace with a real fee payer address\n * },\n * feePayerPublicKey: undefined, // missing fee payer public key\n * };\n *\n * try {\n * // This will throw an error due to missing feePayerPublicKey\n * await aptos.someMethod(methodArgs);\n * } catch (error) {\n * console.error(error.message); // Output the error message\n * }\n * }\n * runExample().catch(console.error);\n * ```\n */\nexport function ValidateFeePayerDataOnSimulation(target: unknown, propertyKey: string, descriptor: PropertyDescriptor) {\n const originalMethod = descriptor.value;\n /* eslint-disable-next-line func-names, no-param-reassign */\n descriptor.value = async function (...args: any[]) {\n
|
|
1
|
+
{"version":3,"sources":["../../src/api/transactionSubmission/helpers.ts"],"sourcesContent":["/**\n * Validates the fee payer data when submitting a transaction to ensure that the fee payer authenticator is provided if a fee\n * payer address is specified.\n * This helps prevent errors in transaction submission related to fee payer authentication.\n *\n * @param target - The target object where the method is defined.\n * @param propertyKey - The name of the method being decorated.\n * @param descriptor - The property descriptor for the method.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * class TransactionHandler {\n * @ValidateFeePayerDataOnSubmission\n * async submitTransaction(methodArgs: { transaction: { feePayerAddress: string }, feePayerAuthenticator?: string }) {\n * // Logic to submit the transaction\n * }\n * }\n *\n * async function runExample() {\n * const handler = new TransactionHandler();\n *\n * // Attempt to submit a transaction without a fee payer authenticator\n * try {\n * await handler.submitTransaction({\n * transaction: { feePayerAddress: \"0x1\" }, // replace with a real fee payer address\n * });\n * } catch (error) {\n * console.error(error.message); // Should log the error message\n * }\n *\n * // Submit a transaction with a fee payer authenticator\n * await handler.submitTransaction({\n * transaction: { feePayerAddress: \"0x1\" }, // replace with a real fee payer address\n * feePayerAuthenticator: \"authenticatorValue\", // replace with a real authenticator\n * });\n *\n * console.log(\"Transaction submitted successfully.\");\n * }\n * runExample().catch(console.error);\n * ```\n */\nexport function ValidateFeePayerDataOnSubmission(target: unknown, propertyKey: string, descriptor: PropertyDescriptor) {\n const originalMethod = descriptor.value;\n /* eslint-disable-next-line func-names, no-param-reassign */\n descriptor.value = async function (...args: any[]) {\n const [methodArgs] = args;\n\n if (methodArgs.transaction.feePayerAddress && !methodArgs.feePayerAuthenticator) {\n throw new Error(\"You are submitting a Fee Payer transaction but missing the feePayerAuthenticator\");\n }\n\n return originalMethod.apply(this, args);\n };\n\n return descriptor;\n}\n\n/**\n * Validates that the fee payer public key is provided when simulating a Fee Payer transaction.\n * This ensures that all necessary data is present for the simulation to proceed correctly.\n *\n * @param target - The target object where the method is defined.\n * @param propertyKey - The name of the method being decorated.\n * @param descriptor - The property descriptor for the method.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * const methodArgs = {\n * transaction: {\n * feePayerAddress: \"0x1\", // replace with a real fee payer address\n * },\n * feePayerPublicKey: undefined, // missing fee payer public key\n * };\n *\n * try {\n * // This will throw an error due to missing feePayerPublicKey\n * await aptos.someMethod(methodArgs);\n * } catch (error) {\n * console.error(error.message); // Output the error message\n * }\n * }\n * runExample().catch(console.error);\n * ```\n */\nexport function ValidateFeePayerDataOnSimulation(target: unknown, propertyKey: string, descriptor: PropertyDescriptor) {\n const originalMethod = descriptor.value;\n /* eslint-disable-next-line func-names, no-param-reassign */\n descriptor.value = async function (...args: any[]) {\n return originalMethod.apply(this, args);\n };\n\n return descriptor;\n}\n"],"mappings":"AA8CO,SAASA,EAAiCC,EAAiBC,EAAqBC,EAAgC,CACrH,IAAMC,EAAiBD,EAAW,MAElC,OAAAA,EAAW,MAAQ,kBAAmBE,EAAa,CACjD,GAAM,CAACC,CAAU,EAAID,EAErB,GAAIC,EAAW,YAAY,iBAAmB,CAACA,EAAW,sBACxD,MAAM,IAAI,MAAM,kFAAkF,EAGpG,OAAOF,EAAe,MAAM,KAAMC,CAAI,CACxC,EAEOF,CACT,CAmCO,SAASI,EAAiCN,EAAiBC,EAAqBC,EAAgC,CACrH,IAAMC,EAAiBD,EAAW,MAElC,OAAAA,EAAW,MAAQ,kBAAmBE,EAAa,CACjD,OAAOD,EAAe,MAAM,KAAMC,CAAI,CACxC,EAEOF,CACT","names":["ValidateFeePayerDataOnSubmission","target","propertyKey","descriptor","originalMethod","args","methodArgs","ValidateFeePayerDataOnSimulation"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-7ZA434Z3.mjs";import{a as e,c as n}from"./chunk-V4FKFCBL.mjs";var 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, re-syncing ${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, re-syncing ${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-JKA22FG5.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as i,b as o,c as a,d as c,e as p,f as d,g,h as u,i as A,j as y,k as m,l,m as T,n as f,o as C,p as I,q as O,r as P,s as D,t as V,u as S,v as h,w as R,x as G}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as i,b as o,c as a,d as c,e as p,f as d,g,h as u,i as A,j as y,k as m,l,m as T,n as f,o as C,p as I,q as O,r as P,s as D,t as V,u as S,v as h,w as R,x as G}from"./chunk-6AEXQEO2.mjs";import{a as e}from"./chunk-ALOYOMRE.mjs";import{b as s}from"./chunk-JNO7KPMG.mjs";var L=class{constructor(t){this.config=t}async getCollectionData(t){await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"});let{creatorAddress:N,collectionName:_,options:n}=t,w=s.from(N),r={collection_name:{_eq:_},creator_address:{_eq:w.toStringLong()}};return n?.tokenStandard&&(r.token_standard={_eq:n?.tokenStandard??"v2"}),d({aptosConfig:this.config,options:{where:r}})}async getCollectionDataByCreatorAddressAndCollectionName(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),g({aptosConfig:this.config,...t})}async getCollectionDataByCreatorAddress(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),u({aptosConfig:this.config,...t})}async getCollectionDataByCollectionId(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),A({aptosConfig:this.config,...t})}async getCollectionId(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),y({aptosConfig:this.config,...t})}async getDigitalAssetData(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),i({aptosConfig:this.config,...t})}async getCurrentDigitalAssetOwnership(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),o({aptosConfig:this.config,...t})}async getOwnedDigitalAssets(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),a({aptosConfig:this.config,...t})}async getDigitalAssetActivity(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),c({aptosConfig:this.config,...t})}async createCollectionTransaction(t){return p({aptosConfig:this.config,...t})}async mintDigitalAssetTransaction(t){return m({aptosConfig:this.config,...t})}async transferDigitalAssetTransaction(t){return l({aptosConfig:this.config,...t})}async mintSoulBoundTransaction(t){return T({aptosConfig:this.config,...t})}async burnDigitalAssetTransaction(t){return f({aptosConfig:this.config,...t})}async freezeDigitalAssetTransaferTransaction(t){return C({aptosConfig:this.config,...t})}async unfreezeDigitalAssetTransaferTransaction(t){return I({aptosConfig:this.config,...t})}async setDigitalAssetDescriptionTransaction(t){return O({aptosConfig:this.config,...t})}async setDigitalAssetNameTransaction(t){return P({aptosConfig:this.config,...t})}async setDigitalAssetURITransaction(t){return D({aptosConfig:this.config,...t})}async addDigitalAssetPropertyTransaction(t){return V({aptosConfig:this.config,...t})}async removeDigitalAssetPropertyTransaction(t){return S({aptosConfig:this.config,...t})}async updateDigitalAssetPropertyTransaction(t){return h({aptosConfig:this.config,...t})}async addDigitalAssetTypedPropertyTransaction(t){return R({aptosConfig:this.config,...t})}async updateDigitalAssetTypedPropertyTransaction(t){return G({aptosConfig:this.config,...t})}};export{L as a};
|
|
2
|
+
//# sourceMappingURL=chunk-JUQBFGUD.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as c}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as c}from"./chunk-QLC7SSLJ.mjs";import{a as n}from"./chunk-L3J2QVIY.mjs";import{c as i}from"./chunk-TTERI67T.mjs";var o=class{static generate(e={}){let{scheme:t=0,legacy:r=!0}=e;return t===0&&r?n.generate():c.generate({scheme:t})}static fromPrivateKey(e){let{privateKey:t,address:r,legacy:a=!0}=e;return t instanceof i&&a?new n({privateKey:t,address:r}):new c({privateKey:t,address:r})}static fromPrivateKeyAndAddress(e){return this.fromPrivateKey(e)}static fromDerivationPath(e){let{scheme:t=0,mnemonic:r,path:a,legacy:s=!0}=e;return t===0&&s?n.fromDerivationPath({mnemonic:r,path:a}):c.fromDerivationPath({scheme:t,mnemonic:r,path:a})}static authKey(e){let{publicKey:t}=e;return t.authKey()}verifySignature(e){return this.publicKey.verifySignature(e)}};export{o as a};
|
|
2
|
+
//# sourceMappingURL=chunk-JYGAG754.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,c}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a,c}from"./chunk-SMFTISPN.mjs";import{a as u}from"./chunk-FUC7SLH7.mjs";import{i as o,j as l}from"./chunk-B5BXB2BB.mjs";import{b as n,d as s}from"./chunk-TTERI67T.mjs";import{b as p}from"./chunk-MHN6XY4Z.mjs";import{a as f}from"./chunk-4O5XDQDO.mjs";import{a as b}from"./chunk-AKIO3OIT.mjs";var K=class r extends p{constructor(e){if(super(),this.publicKey=e,e instanceof n)this.variant=0;else if(e instanceof a)this.variant=1;else if(e instanceof o)this.variant=3;else if(e instanceof u)this.variant=4;else throw new Error("Unsupported public key type")}verifySignature(e){let{message:t,signature:i}=e;return y.isInstance(i)?this.publicKey.verifySignature({message:t,signature:i.signature}):!1}authKey(){return b.fromSchemeAndBytes({scheme:2,input:this.toUint8Array()})}toUint8Array(){return this.bcsToBytes()}serialize(e){e.serializeU32AsUleb128(this.variant),this.publicKey.serialize(e)}static deserialize(e){let t=e.deserializeUleb128AsU32(),i;switch(t){case 0:i=n.deserialize(e);break;case 1:i=a.deserialize(e);break;case 3:i=o.deserialize(e);break;case 4:i=u.deserialize(e);break;default:throw new Error(`Unknown variant index for AnyPublicKey: ${t}`)}return new r(i)}static isPublicKey(e){return e instanceof r}isEd25519(){return this.publicKey instanceof n}isSecp256k1PublicKey(){return this.publicKey instanceof a}static isInstance(e){return"publicKey"in e&&"variant"in e}},y=class r extends f{constructor(e){if(super(),this.signature=e,e instanceof s)this.variant=0;else if(e instanceof c)this.variant=1;else if(e instanceof l)this.variant=3;else throw new Error("Unsupported signature type")}toUint8Array(){return console.warn("[Aptos SDK] Calls to AnySignature.toUint8Array() will soon return the underlying signature bytes. Use AnySignature.bcsToBytes() instead."),this.bcsToBytes()}serialize(e){e.serializeU32AsUleb128(this.variant),this.signature.serialize(e)}static deserialize(e){let t=e.deserializeUleb128AsU32(),i;switch(t){case 0:i=s.deserialize(e);break;case 1:i=c.deserialize(e);break;case 3:i=l.deserialize(e);break;default:throw new Error(`Unknown variant index for AnySignature: ${t}`)}return new r(i)}static isInstance(e){return"signature"in e&&typeof e.signature=="object"&&e.signature!==null&&"toUint8Array"in e.signature}};export{K as a,y as b};
|
|
2
|
+
//# sourceMappingURL=chunk-KKLF7DQV.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as _}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as _}from"./chunk-476F5NJ6.mjs";import{g}from"./chunk-7ZA434Z3.mjs";import{a as C}from"./chunk-VELQA2Y3.mjs";import{a as l}from"./chunk-P74XXLE4.mjs";import{a as v}from"./chunk-FUC7SLH7.mjs";import{i as k,l as E,m as S,n as b,q as y}from"./chunk-B5BXB2BB.mjs";import{b as h}from"./chunk-QZT2M7UA.mjs";import{e as A,f as x}from"./chunk-YT3IP57B.mjs";import{d as K}from"./chunk-F45G3GP3.mjs";import{j as w}from"./chunk-J7PJSK3J.mjs";import{a as u}from"./chunk-Q3CWUEXI.mjs";import{b as f}from"./chunk-SPRNSFUV.mjs";import{jwtDecode as T}from"jwt-decode";async function j(r){let{aptosConfig:i,jwt:a,ephemeralKeyPair:e,uidKey:p="sub",derivationPath:s}=r,t={jwt_b64:a,epk:e.getPublicKey().bcsToHex().toStringWithoutPrefix(),exp_date_secs:e.expiryDateSecs,epk_blinder:f.fromHexInput(e.blinder).toStringWithoutPrefix(),uid_key:p,derivation_path:s},{data:n}=await A({aptosConfig:i,path:"fetch",body:t,originMethod:"getPepper",overrides:{WITH_CREDENTIALS:!1}});return f.fromHexInput(n.pepper).toUint8Array()}async function F(r){let{aptosConfig:i,jwt:a,ephemeralKeyPair:e,pepper:p=await j(r),uidKey:s="sub",maxExpHorizonSecs:t=(await y({aptosConfig:i})).maxExpHorizonSecs}=r;if(f.fromHexInput(p).toUint8Array().length!==l.PEPPER_LENGTH)throw new Error(`Pepper needs to be ${l.PEPPER_LENGTH} bytes`);let n=T(a);if(typeof n.iat!="number")throw new Error("iat was not found");if(t<e.expiryDateSecs-n.iat)throw Error(`The EphemeralKeyPair is too long lived. It's lifespan must be less than ${t}`);let o={jwt_b64:a,epk:e.getPublicKey().bcsToHex().toStringWithoutPrefix(),epk_blinder:f.fromHexInput(e.blinder).toStringWithoutPrefix(),exp_date_secs:e.expiryDateSecs,exp_horizon_secs:t,pepper:f.fromHexInput(p).toStringWithoutPrefix(),uid_key:s},{data:c}=await x({aptosConfig:i,path:"prove",body:o,originMethod:"getProof",overrides:{WITH_CREDENTIALS:!1}}),d=c.proof,m=new E({a:d.a,b:d.b,c:d.c});return new b({proof:new S(m,0),trainingWheelsSignature:h.fromHex(c.training_wheels_signature),expHorizonSecs:t})}async function oe(r){let{aptosConfig:i,jwt:a,jwkAddress:e,uidKey:p,proofFetchCallback:s,pepper:t=await j(r)}=r,{verificationKey:n,maxExpHorizonSecs:o}=await y({aptosConfig:i}),c=F({...r,pepper:t,maxExpHorizonSecs:o}),d=s?c:await c;if(e!==void 0){let H=v.fromJwtAndPepper({jwt:a,pepper:t,jwkAddress:e,uidKey:p}),I=await g({aptosConfig:i,authenticationKey:H.authKey().derivedAddress()});return C.create({...r,address:I,proof:d,pepper:t,proofFetchCallback:s,jwkAddress:e,verificationKey:n})}let m=k.fromJwtAndPepper({jwt:a,pepper:t,uidKey:p}),P=await g({aptosConfig:i,authenticationKey:m.authKey().derivedAddress()});return l.create({...r,address:P,proof:d,pepper:t,proofFetchCallback:s,verificationKey:n})}async function re(r){let{aptosConfig:i,sender:a,iss:e,options:p}=r,{jwksUrl:s}=r;s===void 0&&(w.test(e)?s="https://www.googleapis.com/service_accounts/v1/jwk/securetoken@system.gserviceaccount.com":s=e.endsWith("/")?`${e}.well-known/jwks.json`:`${e}/.well-known/jwks.json`);let t;try{if(t=await fetch(s),!t.ok)throw new Error(`${t.status} ${t.statusText}`)}catch(o){let c;throw o instanceof Error?c=`${o.message}`:c=`error unknown - ${o}`,K.fromErrorType({type:14,details:`Failed to fetch JWKS at ${s}: ${c}`})}let n=await t.json();return _({aptosConfig:i,sender:a.accountAddress,data:{function:"0x1::jwks::update_federated_jwk_set",functionArguments:[e,u.MoveString(n.keys.map(o=>o.kid)),u.MoveString(n.keys.map(o=>o.alg)),u.MoveString(n.keys.map(o=>o.e)),u.MoveString(n.keys.map(o=>o.n))]},options:p})}export{j as a,F as b,oe as c,re as d};
|
|
2
|
+
//# sourceMappingURL=chunk-KPPM2BSC.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as s}from"./chunk-TQA6HY6A.mjs";import{b as i}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{d as s}from"./chunk-TQA6HY6A.mjs";import{b as i}from"./chunk-OEM75TVE.mjs";import{c as n}from"./chunk-TTERI67T.mjs";import{b as o}from"./chunk-JNO7KPMG.mjs";var c=class a{constructor(t){this.signingScheme=0;let{privateKey:e,address:r}=t;this.privateKey=e,this.publicKey=e.publicKey(),this.accountAddress=r?o.from(r):this.publicKey.authKey().derivedAddress()}static generate(){let t=n.generate();return new a({privateKey:t})}static fromDerivationPath(t){let{path:e,mnemonic:r}=t,u=n.fromDerivationPath(e,r);return new a({privateKey:u})}verifySignature(t){return this.publicKey.verifySignature(t)}signWithAuthenticator(t){return new i(this.publicKey,this.privateKey.sign(t))}signTransactionWithAuthenticator(t){return new i(this.publicKey,this.signTransaction(t))}sign(t){return this.privateKey.sign(t)}signTransaction(t){return this.sign(s(t))}};export{c as a};
|
|
2
|
+
//# sourceMappingURL=chunk-L3J2QVIY.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as u}from"./chunk-S3YVCCYI.mjs";import{a as A}from"./chunk-RV7PNWDY.mjs";import{a as h}from"./chunk-HKVZ7CAG.mjs";import{a as y}from"./chunk-64IZ5PQR.mjs";import{a as m}from"./chunk-GT7QFXER.mjs";import{a as d}from"./chunk-V5NDNR36.mjs";import{a as r}from"./chunk-A7TJF3BX.mjs";import{a}from"./chunk-JUQBFGUD.mjs";import{a as c}from"./chunk-4ULPBQ3M.mjs";import{a as l}from"./chunk-VAKNMHOA.mjs";import{a as f}from"./chunk-XOOYRVFK.mjs";import{a as g}from"./chunk-737YW3CY.mjs";import{a as s}from"./chunk-MWNYODWU.mjs";import{a as p}from"./chunk-7ZVXQAG4.mjs";var t=class{constructor(n){this.config=new d(n),this.account=new s(this.config),this.ans=new p(this.config),this.coin=new r(this.config),this.digitalAsset=new a(this.config),this.event=new c(this.config),this.faucet=new l(this.config),this.fungibleAsset=new f(this.config),this.general=new g(this.config),this.staking=new h(this.config),this.transaction=new m(this.config),this.table=new y(this.config),this.keyless=new u(this.config),this.object=new A(this.config)}};function e(b,n,w){Object.getOwnPropertyNames(n.prototype).forEach(i=>{let o=Object.getOwnPropertyDescriptor(n.prototype,i);o&&(o.value=function(...j){return this[w][i](...j)},Object.defineProperty(b.prototype,i,o))})}e(t,s,"account");e(t,p,"ans");e(t,r,"coin");e(t,a,"digitalAsset");e(t,c,"event");e(t,l,"faucet");e(t,f,"fungibleAsset");e(t,g,"general");e(t,h,"staking");e(t,m,"transaction");e(t,y,"table");e(t,u,"keyless");e(t,A,"object");export{t as a};
|
|
2
|
+
//# sourceMappingURL=chunk-LK67PZX3.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as p}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as p}from"./chunk-P6RNNESB.mjs";async function r(e){let{aptosConfig:t,overrides:s,params:n,contentType:o,acceptType:i,path:a,originMethod:R,type:d}=e,u=t.getRequestUrl(d);return p({url:u,method:"GET",originMethod:R,path:a,contentType:o,acceptType:i,params:n,overrides:{...t.clientConfig,...s}},t,e.type)}async function y(e){let{aptosConfig:t}=e;return r({...e,type:"Fullnode",overrides:{...t.clientConfig,...t.fullnodeConfig,...e.overrides,HEADERS:{...t.clientConfig?.HEADERS,...t.fullnodeConfig?.HEADERS}}})}async function m(e){return r({...e,type:"Pepper"})}async function A(e){let t=[],s,n=e.params;do{let o=await r({type:"Fullnode",aptosConfig:e.aptosConfig,originMethod:e.originMethod,path:e.path,params:n,overrides:e.overrides});s=o.headers["x-aptos-cursor"],delete o.headers,t.push(...o.data),n.start=s}while(s!=null);return t}export{r as a,y as b,m as c,A as d};
|
|
2
|
+
//# sourceMappingURL=chunk-LRN4ALMT.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as o,b as l}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as o,b as l}from"./chunk-KKLF7DQV.mjs";import{b as m}from"./chunk-MHN6XY4Z.mjs";import{a as g}from"./chunk-4O5XDQDO.mjs";import{a as y}from"./chunk-AKIO3OIT.mjs";function d(h){let e=h;return e-=e>>1&1431655765,e=(e&858993459)+(e>>2&858993459),(e+(e>>4)&252645135)*16843009>>24}var p=class h extends m{constructor(e){super();let{publicKeys:r,signaturesRequired:t}=e;if(t<1)throw new Error("The number of required signatures needs to be greater than 0");if(r.length<t)throw new Error(`Provided ${r.length} public keys is smaller than the ${t} required signatures`);this.publicKeys=r.map(i=>i instanceof o?i:new o(i)),this.signaturesRequired=t}verifySignature(e){throw new Error("not implemented")}authKey(){return y.fromSchemeAndBytes({scheme:3,input:this.toUint8Array()})}serialize(e){e.serializeVector(this.publicKeys),e.serializeU8(this.signaturesRequired)}static deserialize(e){let r=e.deserializeVector(o),t=e.deserializeU8();return new h({publicKeys:r,signaturesRequired:t})}createBitmap(e){let{bits:r}=e,t=128,i=new Uint8Array([0,0,0,0]),a=new Set;return r.forEach((n,u)=>{if(u+1>this.publicKeys.length)throw new Error(`Signature index ${u+1} is out of public keys range, ${this.publicKeys.length}.`);if(a.has(n))throw new Error(`Duplicate bit ${n} detected.`);a.add(n);let c=Math.floor(n/8),b=i[c];b|=t>>n%8,i[c]=b}),i}getIndex(e){let r=e instanceof o?e:new o(e),t=this.publicKeys.findIndex(i=>i.toString()===r.toString());if(t!==-1)return t;throw new Error("Public key not found in MultiKey")}static isInstance(e){return"publicKeys"in e&&"signaturesRequired"in e}},s=class s extends g{constructor(e){super();let{signatures:r,bitmap:t}=e;if(r.length>s.MAX_SIGNATURES_SUPPORTED)throw new Error(`The number of signatures cannot be greater than ${s.MAX_SIGNATURES_SUPPORTED}`);if(this.signatures=r.map(a=>a instanceof l?a:new l(a)),!(t instanceof Uint8Array))this.bitmap=s.createBitmap({bits:t});else{if(t.length!==s.BITMAP_LEN)throw new Error(`"bitmap" length should be ${s.BITMAP_LEN}`);this.bitmap=t}let i=this.bitmap.reduce((a,n)=>a+d(n),0);if(i!==this.signatures.length)throw new Error(`Expecting ${i} signatures from the bitmap, but got ${this.signatures.length}`)}static createBitmap(e){let{bits:r}=e,t=128,i=new Uint8Array([0,0,0,0]),a=new Set;return r.forEach(n=>{if(n>=s.MAX_SIGNATURES_SUPPORTED)throw new Error(`Cannot have a signature larger than ${s.MAX_SIGNATURES_SUPPORTED-1}.`);if(a.has(n))throw new Error("Duplicate bits detected.");a.add(n);let u=Math.floor(n/8),c=i[u];c|=t>>n%8,i[u]=c}),i}serialize(e){e.serializeVector(this.signatures),e.serializeBytes(this.bitmap)}static deserialize(e){let r=e.deserializeVector(l),t=e.deserializeBytes();return new s({signatures:r,bitmap:t})}};s.BITMAP_LEN=4,s.MAX_SIGNATURES_SUPPORTED=s.BITMAP_LEN*8;var f=s;export{p as a,f as b};
|
|
2
|
+
//# sourceMappingURL=chunk-LWXBEIFO.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as p,b as u}from"./chunk-QZT2M7UA.mjs";import{b as h,c as d,e as m}from"./chunk-GMKKHGXK.mjs";import{c as s}from"./chunk-TTERI67T.mjs";import{a as l}from"./chunk-D52UKPQF.mjs";import{a as c}from"./chunk-AJ5JHBAE.mjs";import{b as y}from"./chunk-SPRNSFUV.mjs";import{c as b,d as K}from"./chunk-V4FKFCBL.mjs";import{randomBytes as E}from"@noble/hashes/utils";var S=1209600,i=class i extends c{constructor(e){super();let{privateKey:r,expiryDateSecs:a,blinder:n}=e;this.privateKey=r,this.publicKey=new p(r.publicKey()),this.expiryDateSecs=a||K(b()+S),this.blinder=n!==void 0?y.fromHexInput(n).toUint8Array():v();let t=h(this.publicKey.bcsToBytes(),93);t.push(BigInt(this.expiryDateSecs)),t.push(d(this.blinder));let x=m(t);this.nonce=x.toString()}getPublicKey(){return this.publicKey}isExpired(){return Math.floor(Date.now()/1e3)>this.expiryDateSecs}serialize(e){e.serializeU32AsUleb128(this.publicKey.variant),e.serializeBytes(this.privateKey.toUint8Array()),e.serializeU64(this.expiryDateSecs),e.serializeFixedBytes(this.blinder)}static deserialize(e){let r=e.deserializeUleb128AsU32(),a;switch(r){case 0:a=s.deserialize(e);break;default:throw new Error(`Unknown variant index for EphemeralPublicKey: ${r}`)}let n=e.deserializeU64(),t=e.deserializeFixedBytes(31);return new i({privateKey:a,expiryDateSecs:Number(n),blinder:t})}static fromBytes(e){return i.deserialize(new l(e))}static generate(e){let r;switch(e?.scheme){case 0:default:r=s.generate()}return new i({privateKey:r,expiryDateSecs:e?.expiryDateSecs})}sign(e){if(this.isExpired())throw new Error("EphemeralKeyPair has expired");return new u(this.privateKey.sign(e))}};i.BLINDER_LENGTH=31;var o=i;function v(){return E(o.BLINDER_LENGTH)}export{o as a};
|
|
2
|
+
//# sourceMappingURL=chunk-LZ5PSDOS.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as t}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as t}from"./chunk-476F5NJ6.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-MCWOKFVH.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as g}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as g}from"./chunk-H7PDLUNP.mjs";import{e as a}from"./chunk-OEM75TVE.mjs";import{a as m,b as u}from"./chunk-LWXBEIFO.mjs";import{b as y}from"./chunk-JNO7KPMG.mjs";var p=class l{constructor(e){let{multiKey:s,signers:i,address:r}=e;this.publicKey=s,this.signingScheme=3,this.accountAddress=r?y.from(r):this.publicKey.authKey().derivedAddress();let t=[];for(let n of i)t.push(this.publicKey.getIndex(n.publicKey));let c=i.map((n,o)=>[n,t[o]]);c.sort((n,o)=>n[1]-o[1]),this.signers=c.map(n=>n[0]),this.signerIndicies=c.map(n=>n[1]),this.signaturesBitmap=this.publicKey.createBitmap({bits:t})}static fromPublicKeysAndSigners(e){let{publicKeys:s,signaturesRequired:i,signers:r}=e,t=new m({publicKeys:s,signaturesRequired:i});return new l({multiKey:t,signers:r})}static isMultiKeySigner(e){return e instanceof l}signWithAuthenticator(e){return new a(this.publicKey,this.sign(e))}signTransactionWithAuthenticator(e){return new a(this.publicKey,this.signTransaction(e))}async waitForProofFetch(){let s=this.signers.filter(i=>i instanceof g).map(async i=>i.waitForProofFetch());await Promise.all(s)}async checkKeylessAccountValidity(e){let i=this.signers.filter(r=>r instanceof g).map(r=>r.checkKeylessAccountValidity(e));await Promise.all(i)}sign(e){let s=[];for(let i of this.signers)s.push(i.sign(e));return new u({signatures:s,bitmap:this.signaturesBitmap})}signTransaction(e){let s=[];for(let i of this.signers)s.push(i.signTransaction(e));return new u({signatures:s,bitmap:this.signaturesBitmap})}verifySignature(e){let{message:s,signature:i}=e;if(!this.signerIndicies.every((t,c)=>c===0||t>=this.signerIndicies[c-1]))return!1;for(let t=0;t<i.signatures.length;t+=1){let c=i.signatures[t];if(!this.publicKey.publicKeys[this.signerIndicies[t]].verifySignature({message:s,signature:c}))return!1}return!0}};export{p as a};
|
|
2
|
+
//# sourceMappingURL=chunk-MV5PGWJQ.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as d}from"./chunk-
|
|
1
|
+
import{a as o}from"./chunk-ALOYOMRE.mjs";import{a as d}from"./chunk-2D7OMWVL.mjs";import{a as y,b as l,c as C,d as T,e as O,f as h,g as L,h as P,i as S,j as V,k as b,l as R,n as w,o as I,p as v,q as k}from"./chunk-7ZA434Z3.mjs";import{a as f}from"./chunk-6ZOVTYLJ.mjs";import{b as r}from"./chunk-JNO7KPMG.mjs";import{a as p}from"./chunk-HBIDHQ2M.mjs";import{e as u,f as A}from"./chunk-J7PJSK3J.mjs";import{h as g,i as m}from"./chunk-V4FKFCBL.mjs";var M=class{constructor(e){this.config=e}async getAccountInfo(e){return y({aptosConfig:this.config,...e})}async getAccountModules(e){return l({aptosConfig:this.config,...e})}async getAccountModule(e){return C({aptosConfig:this.config,...e})}async getAccountTransactions(e){return T({aptosConfig:this.config,...e})}async getAccountResources(e){return O({aptosConfig:this.config,...e})}async getAccountResource(e){return h({aptosConfig:this.config,...e})}async lookupOriginalAccountAddress(e){return L({aptosConfig:this.config,...e})}async getAccountTokensCount(e){return await o({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"account_transactions_processor"}),P({aptosConfig:this.config,...e})}async getAccountOwnedTokens(e){return await o({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),S({aptosConfig:this.config,...e})}async getAccountOwnedTokensFromCollectionAddress(e){return await o({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),V({aptosConfig:this.config,...e})}async getAccountCollectionsWithOwnedTokens(e){return await o({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),b({aptosConfig:this.config,...e})}async getAccountTransactionsCount(e){return await o({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"account_transactions_processor"}),R({aptosConfig:this.config,...e})}async getAccountCoinsData(e){return await o({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"fungible_asset_processor"}),w({aptosConfig:this.config,...e})}async getAccountCoinsCount(e){return await o({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"fungible_asset_processor"}),I({aptosConfig:this.config,...e})}async getAccountAPTAmount(e){return this.getAccountCoinAmount({coinType:u,faMetadataAddress:A,...e})}async getAccountCoinAmount(e){let{accountAddress:a,coinType:s,faMetadataAddress:t,minimumLedgerVersion:N}=e;N&&console.warn(`minimumLedgerVersion is not used anymore, here for backward
|
|
2
2
|
compatibility see https://github.com/aptos-labs/aptos-ts-sdk/pull/519,
|
|
3
3
|
will be removed in the near future`);let c=s;s===void 0&&t!==void 0&&(c=await p(async()=>{try{let n=(await d({aptosConfig:this.config,payload:{function:"0x1::coin::paired_coin",functionArguments:[t]}})).at(0);if(n.vec.length>0&&m(n.vec[0]))return g(n.vec[0])}catch{}},`coin-mapping-${t.toString()}`,1e3*60*5)());let i;if(s!==void 0&&t!==void 0)i=r.from(t).toStringLong();else if(s!==void 0&&t===void 0)s===u?i=r.A.toStringLong():i=f(r.A,s).toStringLong();else if(s===void 0&&t!==void 0){let n=r.from(t);i=n.toStringLong(),n===r.A&&(c=u)}else throw new Error("Either coinType, faMetadataAddress, or both must be provided");if(c!==void 0){let[n]=await d({aptosConfig:this.config,payload:{function:"0x1::coin::balance",typeArguments:[c],functionArguments:[a]}});return parseInt(n,10)}let[E]=await d({aptosConfig:this.config,payload:{function:"0x1::primary_fungible_store::balance",typeArguments:["0x1::object::ObjectCore"],functionArguments:[a,i]}});return parseInt(E,10)}async getAccountOwnedObjects(e){return await o({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"default_processor"}),v({aptosConfig:this.config,...e})}async deriveAccountFromPrivateKey(e){return k({aptosConfig:this.config,...e})}};export{M as a};
|
|
4
|
-
//# sourceMappingURL=chunk-
|
|
4
|
+
//# sourceMappingURL=chunk-MWNYODWU.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as b,b as p}from"./chunk-I3452DF5.mjs";import{a as z,b as A}from"./chunk-LWXBEIFO.mjs";import{a as h,b as g}from"./chunk-KKLF7DQV.mjs";import{b as d,d as y}from"./chunk-TTERI67T.mjs";import{a as o}from"./chunk-AJ5JHBAE.mjs";var s=class extends o{static deserialize(e){let i=e.deserializeUleb128AsU32();switch(i){case 0:return u.load(e);case 1:return l.load(e);case 2:return n.load(e);case 3:return a.load(e);case 4:return c.load(e);default:throw new Error(`Unknown variant index for AccountAuthenticator: ${i}`)}}isEd25519(){return this instanceof u}isMultiEd25519(){return this instanceof l}isSingleKey(){return this instanceof n}isMultiKey(){return this instanceof a}},u=class t extends s{constructor(e,i){super(),this.public_key=e,this.signature=i}serialize(e){e.serializeU32AsUleb128(0),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let i=d.deserialize(e),r=y.deserialize(e);return new t(i,r)}},l=class t extends s{constructor(e,i){super(),this.public_key=e,this.signature=i}serialize(e){e.serializeU32AsUleb128(1),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let i=b.deserialize(e),r=p.deserialize(e);return new t(i,r)}},n=class t extends s{constructor(e,i){super(),this.public_key=e,this.signature=i}serialize(e){e.serializeU32AsUleb128(2),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let i=h.deserialize(e),r=g.deserialize(e);return new t(i,r)}},a=class t extends s{constructor(e,i){super(),this.public_keys=e,this.signatures=i}serialize(e){e.serializeU32AsUleb128(3),this.public_keys.serialize(e),this.signatures.serialize(e)}static load(e){let i=z.deserialize(e),r=A.deserialize(e);return new t(i,r)}},c=class t extends s{serialize(e){e.serializeU32AsUleb128(4)}static load(e){return new t}};export{s as a,u as b,l as c,n as d,a as e,c as f};
|
|
2
|
+
//# sourceMappingURL=chunk-OEM75TVE.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/transactions/authenticator/account.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/* eslint-disable @typescript-eslint/naming-convention */\n\nimport { Serializer, Deserializer, Serializable } from \"../../bcs\";\nimport { AnyPublicKey, AnySignature } from \"../../core/crypto\";\nimport { Ed25519PublicKey, Ed25519Signature } from \"../../core/crypto/ed25519\";\nimport { MultiEd25519PublicKey, MultiEd25519Signature } from \"../../core/crypto/multiEd25519\";\nimport { MultiKey, MultiKeySignature } from \"../../core/crypto/multiKey\";\nimport { AccountAuthenticatorVariant } from \"../../types\";\n\n/**\n * Represents an account authenticator that can handle multiple authentication variants.\n * This class serves as a base for different types of account authenticators, allowing for serialization\n * and deserialization of various authenticator types.\n *\n * @extends Serializable\n */\nexport abstract class AccountAuthenticator extends Serializable {\n abstract serialize(serializer: Serializer): void;\n\n /**\n * Deserializes an AccountAuthenticator from the provided deserializer.\n * This function helps in reconstructing the AccountAuthenticator object based on the variant index.\n *\n * @param deserializer - The deserializer instance used to read the serialized data.\n */\n static deserialize(deserializer: Deserializer): AccountAuthenticator {\n const index = deserializer.deserializeUleb128AsU32();\n switch (index) {\n case AccountAuthenticatorVariant.Ed25519:\n return AccountAuthenticatorEd25519.load(deserializer);\n case AccountAuthenticatorVariant.MultiEd25519:\n return AccountAuthenticatorMultiEd25519.load(deserializer);\n case AccountAuthenticatorVariant.SingleKey:\n return AccountAuthenticatorSingleKey.load(deserializer);\n case AccountAuthenticatorVariant.MultiKey:\n return AccountAuthenticatorMultiKey.load(deserializer);\n case AccountAuthenticatorVariant.NoAccountAuthenticator:\n return AccountAuthenticatorNoAccountAuthenticator.load(deserializer);\n default:\n throw new Error(`Unknown variant index for AccountAuthenticator: ${index}`);\n }\n }\n\n /**\n * Determines if the current instance is an Ed25519 account authenticator.\n *\n * @returns {boolean} True if the instance is of type AccountAuthenticatorEd25519, otherwise false.\n */\n isEd25519(): this is AccountAuthenticatorEd25519 {\n return this instanceof AccountAuthenticatorEd25519;\n }\n\n /**\n * Determines if the current instance is of type AccountAuthenticatorMultiEd25519.\n *\n * @returns {boolean} True if the instance is a multi-signature Ed25519 account authenticator, otherwise false.\n */\n isMultiEd25519(): this is AccountAuthenticatorMultiEd25519 {\n return this instanceof AccountAuthenticatorMultiEd25519;\n }\n\n /**\n * Determines if the current instance is of the type AccountAuthenticatorSingleKey.\n *\n * @returns {boolean} True if the instance is an AccountAuthenticatorSingleKey, otherwise false.\n */\n isSingleKey(): this is AccountAuthenticatorSingleKey {\n return this instanceof AccountAuthenticatorSingleKey;\n }\n\n /**\n * Determine if the current instance is of type AccountAuthenticatorMultiKey.\n *\n * @returns {boolean} Returns true if the instance is an AccountAuthenticatorMultiKey, otherwise false.\n */\n isMultiKey(): this is AccountAuthenticatorMultiKey {\n return this instanceof AccountAuthenticatorMultiKey;\n }\n}\n\n/**\n * Represents an Ed25519 transaction authenticator for multi-signer transactions.\n * This class encapsulates the account's Ed25519 public key and signature.\n *\n * @param public_key - The Ed25519 public key associated with the account.\n * @param signature - The Ed25519 signature for the account.\n */\nexport class AccountAuthenticatorEd25519 extends AccountAuthenticator {\n public readonly public_key: Ed25519PublicKey;\n\n public readonly signature: Ed25519Signature;\n\n /**\n * Creates an instance of the class with the specified public keys and signatures.\n *\n * @param public_key The public key used for verification.\n * @param signature The signatures corresponding to the public keys.\n */\n constructor(public_key: Ed25519PublicKey, signature: Ed25519Signature) {\n super();\n this.public_key = public_key;\n this.signature = signature;\n }\n\n /**\n * Serializes the account authenticator data into the provided serializer.\n * This function captures the multi-key variant, public keys, and signatures for serialization.\n *\n * @param serializer - The serializer instance used to perform the serialization.\n */\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(AccountAuthenticatorVariant.Ed25519);\n this.public_key.serialize(serializer);\n this.signature.serialize(serializer);\n }\n\n /**\n * Loads an instance of AccountAuthenticatorMultiKey from the provided deserializer.\n * This function helps in reconstructing the authenticator object using the deserialized public keys and signatures.\n *\n * @param deserializer - The deserializer used to extract the necessary data for loading the authenticator.\n */\n static load(deserializer: Deserializer): AccountAuthenticatorEd25519 {\n const public_key = Ed25519PublicKey.deserialize(deserializer);\n const signature = Ed25519Signature.deserialize(deserializer);\n return new AccountAuthenticatorEd25519(public_key, signature);\n }\n}\n\n/**\n * Represents a transaction authenticator for Multi Ed25519, designed for multi-signer transactions.\n *\n * @param public_key - The MultiEd25519 public key of the account.\n * @param signature - The MultiEd25519 signature of the account.\n */\nexport class AccountAuthenticatorMultiEd25519 extends AccountAuthenticator {\n public readonly public_key: MultiEd25519PublicKey;\n\n public readonly signature: MultiEd25519Signature;\n\n constructor(public_key: MultiEd25519PublicKey, signature: MultiEd25519Signature) {\n super();\n this.public_key = public_key;\n this.signature = signature;\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(AccountAuthenticatorVariant.MultiEd25519);\n this.public_key.serialize(serializer);\n this.signature.serialize(serializer);\n }\n\n static load(deserializer: Deserializer): AccountAuthenticatorMultiEd25519 {\n const public_key = MultiEd25519PublicKey.deserialize(deserializer);\n const signature = MultiEd25519Signature.deserialize(deserializer);\n return new AccountAuthenticatorMultiEd25519(public_key, signature);\n }\n}\n\n/**\n * Represents an account authenticator that utilizes a single key for signing.\n * This class is designed to handle authentication using a public key and its corresponding signature.\n *\n * @param public_key - The public key used for authentication.\n * @param signature - The signature associated with the public key.\n */\nexport class AccountAuthenticatorSingleKey extends AccountAuthenticator {\n public readonly public_key: AnyPublicKey;\n\n public readonly signature: AnySignature;\n\n constructor(public_key: AnyPublicKey, signature: AnySignature) {\n super();\n this.public_key = public_key;\n this.signature = signature;\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(AccountAuthenticatorVariant.SingleKey);\n this.public_key.serialize(serializer);\n this.signature.serialize(serializer);\n }\n\n static load(deserializer: Deserializer): AccountAuthenticatorSingleKey {\n const public_key = AnyPublicKey.deserialize(deserializer);\n const signature = AnySignature.deserialize(deserializer);\n return new AccountAuthenticatorSingleKey(public_key, signature);\n }\n}\n\n/**\n * Represents an account authenticator that supports multiple keys and signatures for multi-signature scenarios.\n *\n * @param public_keys - The public keys used for authentication.\n * @param signatures - The signatures corresponding to the public keys.\n */\nexport class AccountAuthenticatorMultiKey extends AccountAuthenticator {\n public readonly public_keys: MultiKey;\n\n public readonly signatures: MultiKeySignature;\n\n constructor(public_keys: MultiKey, signatures: MultiKeySignature) {\n super();\n this.public_keys = public_keys;\n this.signatures = signatures;\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(AccountAuthenticatorVariant.MultiKey);\n this.public_keys.serialize(serializer);\n this.signatures.serialize(serializer);\n }\n\n static load(deserializer: Deserializer): AccountAuthenticatorMultiKey {\n const public_keys = MultiKey.deserialize(deserializer);\n const signatures = MultiKeySignature.deserialize(deserializer);\n return new AccountAuthenticatorMultiKey(public_keys, signatures);\n }\n}\n\n/**\n * AccountAuthenticatorNoAccountAuthenticator for no account authenticator\n * It represents the absence of a public key for transaction simulation.\n * It allows skipping the public/auth key check during the simulation.\n */\nexport class AccountAuthenticatorNoAccountAuthenticator extends AccountAuthenticator {\n // eslint-disable-next-line class-methods-use-this\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(AccountAuthenticatorVariant.NoAccountAuthenticator);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static load(deserializer: Deserializer): AccountAuthenticatorNoAccountAuthenticator {\n return new AccountAuthenticatorNoAccountAuthenticator();\n }\n}\n"],"mappings":"yOAmBO,IAAeA,EAAf,cAA4CC,CAAa,CAS9D,OAAO,YAAYC,EAAkD,CACnE,IAAMC,EAAQD,EAAa,wBAAwB,EACnD,OAAQC,EAAO,CACb,OACE,OAAOC,EAA4B,KAAKF,CAAY,EACtD,OACE,OAAOG,EAAiC,KAAKH,CAAY,EAC3D,OACE,OAAOI,EAA8B,KAAKJ,CAAY,EACxD,OACE,OAAOK,EAA6B,KAAKL,CAAY,EACvD,OACE,OAAOM,EAA2C,KAAKN,CAAY,EACrE,QACE,MAAM,IAAI,MAAM,mDAAmDC,CAAK,EAAE,CAC9E,CACF,CAOA,WAAiD,CAC/C,OAAO,gBAAgBC,CACzB,CAOA,gBAA2D,CACzD,OAAO,gBAAgBC,CACzB,CAOA,aAAqD,CACnD,OAAO,gBAAgBC,CACzB,CAOA,YAAmD,CACjD,OAAO,gBAAgBC,CACzB,CACF,EASaH,EAAN,MAAMK,UAAoCT,CAAqB,CAWpE,YAAYU,EAA8BC,EAA6B,CACrE,MAAM,EACN,KAAK,WAAaD,EAClB,KAAK,UAAYC,CACnB,CAQA,UAAUC,EAA8B,CACtCA,EAAW,uBAAyD,EACpE,KAAK,WAAW,UAAUA,CAAU,EACpC,KAAK,UAAU,UAAUA,CAAU,CACrC,CAQA,OAAO,KAAKV,EAAyD,CACnE,IAAMQ,EAAaG,EAAiB,YAAYX,CAAY,EACtDS,EAAYG,EAAiB,YAAYZ,CAAY,EAC3D,OAAO,IAAIO,EAA4BC,EAAYC,CAAS,CAC9D,CACF,EAQaN,EAAN,MAAMU,UAAyCf,CAAqB,CAKzE,YAAYU,EAAmCC,EAAkC,CAC/E,MAAM,EACN,KAAK,WAAaD,EAClB,KAAK,UAAYC,CACnB,CAEA,UAAUC,EAA8B,CACtCA,EAAW,uBAA8D,EACzE,KAAK,WAAW,UAAUA,CAAU,EACpC,KAAK,UAAU,UAAUA,CAAU,CACrC,CAEA,OAAO,KAAKV,EAA8D,CACxE,IAAMQ,EAAaM,EAAsB,YAAYd,CAAY,EAC3DS,EAAYM,EAAsB,YAAYf,CAAY,EAChE,OAAO,IAAIa,EAAiCL,EAAYC,CAAS,CACnE,CACF,EASaL,EAAN,MAAMY,UAAsClB,CAAqB,CAKtE,YAAYU,EAA0BC,EAAyB,CAC7D,MAAM,EACN,KAAK,WAAaD,EAClB,KAAK,UAAYC,CACnB,CAEA,UAAUC,EAA8B,CACtCA,EAAW,uBAA2D,EACtE,KAAK,WAAW,UAAUA,CAAU,EACpC,KAAK,UAAU,UAAUA,CAAU,CACrC,CAEA,OAAO,KAAKV,EAA2D,CACrE,IAAMQ,EAAaS,EAAa,YAAYjB,CAAY,EAClDS,EAAYS,EAAa,YAAYlB,CAAY,EACvD,OAAO,IAAIgB,EAA8BR,EAAYC,CAAS,CAChE,CACF,EAQaJ,EAAN,MAAMc,UAAqCrB,CAAqB,CAKrE,YAAYsB,EAAuBC,EAA+B,CAChE,MAAM,EACN,KAAK,YAAcD,EACnB,KAAK,WAAaC,CACpB,CAEA,UAAUX,EAA8B,CACtCA,EAAW,uBAA0D,EACrE,KAAK,YAAY,UAAUA,CAAU,EACrC,KAAK,WAAW,UAAUA,CAAU,CACtC,CAEA,OAAO,KAAKV,EAA0D,CACpE,IAAMoB,EAAcE,EAAS,YAAYtB,CAAY,EAC/CqB,EAAaE,EAAkB,YAAYvB,CAAY,EAC7D,OAAO,IAAImB,EAA6BC,EAAaC,CAAU,CACjE,CACF,EAOaf,EAAN,MAAMkB,UAAmD1B,CAAqB,CAEnF,UAAUY,EAA8B,CACtCA,EAAW,uBAAwE,CACrF,CAGA,OAAO,KAAKV,EAAwE,CAClF,OAAO,IAAIwB,CACb,CACF","names":["AccountAuthenticator","Serializable","deserializer","index","AccountAuthenticatorEd25519","AccountAuthenticatorMultiEd25519","AccountAuthenticatorSingleKey","AccountAuthenticatorMultiKey","AccountAuthenticatorNoAccountAuthenticator","_AccountAuthenticatorEd25519","public_key","signature","serializer","Ed25519PublicKey","Ed25519Signature","_AccountAuthenticatorMultiEd25519","MultiEd25519PublicKey","MultiEd25519Signature","_AccountAuthenticatorSingleKey","AnyPublicKey","AnySignature","_AccountAuthenticatorMultiKey","public_keys","signatures","MultiKey","MultiKeySignature","_AccountAuthenticatorNoAccountAuthenticator"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as l}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as l}from"./chunk-JKA22FG5.mjs";import{a as o,b as c}from"./chunk-2CJC43CV.mjs";import{a as h,i as d}from"./chunk-476F5NJ6.mjs";import{g as u}from"./chunk-QK32EQSF.mjs";import g from"eventemitter3";var m="fulfilled",f=(n=>(n.TransactionSent="transactionSent",n.TransactionSendFailed="transactionSendFailed",n.TransactionExecuted="transactionExecuted",n.TransactionExecutionFailed="transactionExecutionFailed",n.ExecutionFinish="executionFinish",n))(f||{}),p=class extends g{constructor(t,e,a=30,n=100,i=10){super();this.taskQueue=new o;this.transactionsQueue=new o;this.outstandingTransactions=new o;this.sentTransactions=[];this.executedTransactions=[];this.aptosConfig=t,this.account=e,this.started=!1,this.accountSequnceNumber=new l(t,e,a,n,i)}async submitNextTransaction(){try{for(;;){let t=await this.accountSequnceNumber.nextSequenceNumber();if(t===null)return;let e=await this.generateNextTransaction(this.account,t);if(!e)return;let a=d({aptosConfig:this.aptosConfig,transaction:e,signer:this.account});await this.outstandingTransactions.enqueue([a,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=[],e=[],[a,n]=await this.outstandingTransactions.dequeue();for(t.push(a),e.push(n);!this.outstandingTransactions.isEmpty();)[a,n]=await this.outstandingTransactions.dequeue(),t.push(a),e.push(n);let i=await Promise.allSettled(t);for(let s=0;s<i.length&&s<e.length;s+=1){let r=i[s];n=e[s],r.status===m?(this.sentTransactions.push([r.value.hash,n,null]),this.emit("transactionSent",{message:`transaction hash ${r.value.hash} has been committed to chain`,transactionHash:r.value.hash}),await this.checkTransaction(r,n)):(this.sentTransactions.push([r.status,n,r.reason]),this.emit("transactionSendFailed",{message:`failed to commit transaction ${this.sentTransactions.length} with error ${r.reason}`,error:r.reason}))}this.emit("executionFinish",{message:`execute ${i.length} transactions finished`})}}catch(t){if(t instanceof c)return;throw new Error(`Process execution failed for ${this.account.accountAddress.toString()} with error ${t}`)}}async checkTransaction(t,e){try{let a=[];a.push(u({aptosConfig:this.aptosConfig,transactionHash:t.value.hash}));let n=await Promise.allSettled(a);for(let i=0;i<n.length;i+=1){let s=n[i];s.status===m?(this.executedTransactions.push([s.value.hash,e,null]),this.emit("transactionExecuted",{message:`transaction hash ${s.value.hash} has been executed on chain`,transactionHash:t.value.hash})):(this.executedTransactions.push([s.status,e,s.reason]),this.emit("transactionExecutionFailed",{message:`failed to execute transaction ${this.executedTransactions.length} with error ${s.reason}`,error:s.reason}))}}catch(a){throw new Error(`Check transaction failed for ${this.account.accountAddress.toString()} with error ${a}`)}}async push(t,e){this.transactionsQueue.enqueue([t,e])}async generateNextTransaction(t,e){if(this.transactionsQueue.isEmpty())return;let[a,n]=await this.transactionsQueue.dequeue();return h({aptosConfig:this.aptosConfig,sender:t.accountAddress,data:a,options:{...n,accountSequenceNumber:e}})}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{m as a,f as b,p as c};
|
|
2
|
+
//# sourceMappingURL=chunk-OGBU52BQ.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e as r}from"./chunk-F45G3GP3.mjs";import{a as d}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{e as r}from"./chunk-F45G3GP3.mjs";import{a as d}from"./chunk-YQHOQJRQ.mjs";async function A(s,u){let{url:t,method:n,body:i,contentType:a,params:o,overrides:e,originMethod:R}=s,p={...e?.HEADERS,"x-aptos-client":`aptos-typescript-sdk/${d}`,"content-type":a??"application/json","x-aptos-typescript-sdk-origin-method":R};return e?.AUTH_TOKEN&&(p.Authorization=`Bearer ${e?.AUTH_TOKEN}`),e?.API_KEY&&(p.Authorization=`Bearer ${e?.API_KEY}`),u.provider({url:t,method:n,body:i,params:o,headers:p,overrides:e})}async function P(s,u,t){let{url:n,path:i}=s,a=i?`${n}/${i}`:n,o=await A({...s,url:a},u.client),e={status:o.status,statusText:o.statusText??"No status text provided",data:o.data,headers:o.headers,config:o.config,request:o.request,url:a};if(e.status===401)throw new r({apiType:t,aptosRequest:s,aptosResponse:e});if(t==="Indexer"){let R=e.data;if(R.errors)throw new r({apiType:t,aptosRequest:s,aptosResponse:e});e.data=R.data}else if((t==="Pepper"||t==="Prover")&&e.status>=400)throw new r({apiType:t,aptosRequest:s,aptosResponse:e});if(e.status>=200&&e.status<300)return e;throw new r({apiType:t,aptosRequest:s,aptosResponse:e})}export{A as a,P as b};
|
|
2
|
+
//# sourceMappingURL=chunk-P6RNNESB.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as K}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as K}from"./chunk-H7PDLUNP.mjs";import{i as m,r as u}from"./chunk-B5BXB2BB.mjs";import{a as y}from"./chunk-D52UKPQF.mjs";import{b as f}from"./chunk-SPRNSFUV.mjs";var h=class c extends K{constructor(e){let r=m.create(e);super({publicKey:r,...e}),this.publicKey=r}serialize(e){super.serialize(e)}static deserialize(e){let{address:r,proof:l,ephemeralKeyPair:i,jwt:o,uidKey:t,pepper:s,verificationKeyHash:n}=K.partialDeserialize(e),{iss:a,aud:p,uidVal:d}=u({jwt:o,uidKey:t});return new c({address:r,proof:l,ephemeralKeyPair:i,iss:a,uidKey:t,uidVal:d,aud:p,pepper:s,jwt:o,verificationKeyHash:n})}static fromBytes(e){return c.deserialize(new y(f.hexInputToUint8Array(e)))}static create(e){let{address:r,proof:l,jwt:i,ephemeralKeyPair:o,pepper:t,uidKey:s="sub",proofFetchCallback:n,verificationKey:a}=e,{iss:p,aud:d,uidVal:g}=u({jwt:i,uidKey:s});return new c({address:r,proof:l,ephemeralKeyPair:o,iss:p,uidKey:s,uidVal:g,aud:d,pepper:t,jwt:i,proofFetchCallback:n,verificationKeyHash:a?a.hash():void 0})}};export{h as a};
|
|
2
|
+
//# sourceMappingURL=chunk-P74XXLE4.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e as x,f as B}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{e as x,f as B}from"./chunk-CK5NDXQT.mjs";import{a as k}from"./chunk-HBIDHQ2M.mjs";import{b as f,d as A}from"./chunk-LRN4ALMT.mjs";import{e as b}from"./chunk-F45G3GP3.mjs";import{d as C}from"./chunk-J7PJSK3J.mjs";import{a as d}from"./chunk-V4FKFCBL.mjs";async function H(o){let{aptosConfig:n,options:t}=o;return A({aptosConfig:n,originMethod:"getTransactions",path:"transactions",params:{start:t?.offset,limit:t?.limit}})}async function W(o){let{aptosConfig:n}=o;return k(async()=>{let{data:t}=await f({aptosConfig:n,originMethod:"getGasPriceEstimation",path:"estimate_gas_price"});return t},`gas-price-${n.network}`,1e3*60*5)()}async function O(o){let{aptosConfig:n,ledgerVersion:t}=o,{data:s}=await f({aptosConfig:n,originMethod:"getTransactionByVersion",path:`transactions/by_version/${t}`});return s}async function y(o){let{aptosConfig:n,transactionHash:t}=o,{data:s}=await f({aptosConfig:n,path:`transactions/by_hash/${t}`,originMethod:"getTransactionByHash"});return s}async function q(o){let{aptosConfig:n,transactionHash:t}=o;try{return(await y({aptosConfig:n,transactionHash:t})).type==="pending_transaction"}catch(s){if(s?.status===404)return!0;throw s}}async function R(o){let{aptosConfig:n,transactionHash:t}=o,{data:s}=await f({aptosConfig:n,path:`transactions/wait_by_hash/${t}`,originMethod:"longWaitForTransaction"});return s}async function z(o){let{aptosConfig:n,transactionHash:t,options:s}=o,r=s?.timeoutSecs??20,u=s?.checkSuccess??!0,e=!0,p=0,i,g,l=200,h=1.5;function c(a){if(!(a instanceof b)||(g=a,a.status!==404&&a.status>=400&&a.status<500))throw a}try{i=await y({aptosConfig:n,transactionHash:t}),e=i.type==="pending_transaction"}catch(a){c(a)}if(e){let a=Date.now();try{i=await R({aptosConfig:n,transactionHash:t}),e=i.type==="pending_transaction"}catch(w){c(w)}p=(Date.now()-a)/1e3}for(;e&&!(p>=r);){try{if(i=await y({aptosConfig:n,transactionHash:t}),e=i.type==="pending_transaction",!e)break}catch(a){c(a)}await d(l),p+=l/1e3,l*=h}if(i===void 0)throw g||new m(`Fetching transaction ${t} failed and timed out after ${r} seconds`,i);if(i.type==="pending_transaction")throw new m(`Transaction ${t} timed out in pending state after ${r} seconds`,i);if(!u)return i;if(!i.success)throw new T(`Transaction ${t} failed with an error: ${i.vm_status}`,i);return i}async function U(o){let{aptosConfig:n,processorType:t}=o,s=BigInt(o.minimumLedgerVersion),r=3e3,u=new Date().getTime(),e=BigInt(-1);for(;e<s;){if(new Date().getTime()-u>r)throw new Error("waitForLastSuccessIndexerVersionSync timeout");if(t===void 0?e=await x({aptosConfig:n}):e=(await B({aptosConfig:n,processorType:t})).last_success_version,e>=s)break;await d(200)}}var m=class extends Error{constructor(n,t){super(n),this.lastSubmittedTransaction=t}},T=class extends Error{constructor(n,t){super(n),this.transaction=t}};async function X(o){let{aptosConfig:n,ledgerVersion:t,options:s}=o,{data:r}=await f({aptosConfig:n,originMethod:"getBlockByVersion",path:`blocks/by_version/${t}`,params:{with_transactions:s?.withTransactions}});return P({block:r,...o})}async function j(o){let{aptosConfig:n,blockHeight:t,options:s}=o,{data:r}=await f({aptosConfig:n,originMethod:"getBlockByHeight",path:`blocks/by_height/${t}`,params:{with_transactions:s?.withTransactions}});return P({block:r,...o})}async function P(o){let{aptosConfig:n,block:t,options:s}=o;if(s?.withTransactions){t.transactions=t.transactions??[];let r=t.transactions[t.transactions.length-1],u=BigInt(t.first_version),e=BigInt(t.last_version),p=r?.version,i;if(p===void 0?i=u-1n:i=BigInt(p),i===e)return t;let g=[],l=100n;for(let c=i+1n;c<e;c+=BigInt(100))g.push(H({aptosConfig:n,options:{offset:c,limit:Math.min(Number(l),Number(e-c+1n))}}));let h=await Promise.all(g);for(let c of h)t.transactions.push(...c)}return t}export{H as a,W as b,O as c,y as d,q as e,R as f,z as g,U as h,m as i,T as j,X as k,j as l};
|
|
2
|
+
//# sourceMappingURL=chunk-QK32EQSF.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as p}from"./chunk-TQA6HY6A.mjs";import{d as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{d as p}from"./chunk-TQA6HY6A.mjs";import{d as s}from"./chunk-OEM75TVE.mjs";import{a as u,b as y}from"./chunk-KKLF7DQV.mjs";import{b as a}from"./chunk-SMFTISPN.mjs";import{c as i}from"./chunk-TTERI67T.mjs";import{b as g}from"./chunk-JNO7KPMG.mjs";var h=class c{constructor(e){this.signingScheme=2;let{privateKey:r,address:t}=e;this.privateKey=r,this.publicKey=new u(r.publicKey()),this.accountAddress=t?g.from(t):this.publicKey.authKey().derivedAddress()}static generate(e={}){let{scheme:r=0}=e,t;switch(r){case 0:t=i.generate();break;case 2:t=a.generate();break;default:throw new Error(`Unsupported signature scheme ${r}`)}return new c({privateKey:t})}static fromDerivationPath(e){let{scheme:r=0,path:t,mnemonic:o}=e,n;switch(r){case 0:n=i.fromDerivationPath(t,o);break;case 2:n=a.fromDerivationPath(t,o);break;default:throw new Error(`Unsupported signature scheme ${r}`)}return new c({privateKey:n})}verifySignature(e){return this.publicKey.verifySignature(e)}signWithAuthenticator(e){return new s(this.publicKey,this.sign(e))}signTransactionWithAuthenticator(e){return new s(this.publicKey,this.signTransaction(e))}sign(e){return new y(this.privateKey.sign(e))}signTransaction(e){return this.sign(p(e))}};export{h as a};
|
|
2
|
+
//# sourceMappingURL=chunk-QLC7SSLJ.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as w,c as cn,d as un,e as $}from"./chunk-WTWWJWKC.mjs";import{r as sn,u as f}from"./chunk-5O3RHPER.mjs";import{a as rn}from"./chunk-7ZA434Z3.mjs";import{b as on}from"./chunk-QK32EQSF.mjs";import{a as an}from"./chunk-CK5NDXQT.mjs";import{a as y}from"./chunk-BWV6OYLG.mjs";import{a as tn}from"./chunk-O4MRRWRI.mjs";import{b as D,d as R,e as M,f as T}from"./chunk-WXLSHECY.mjs";import{a as q,b as l,d as h,e as B,f as E}from"./chunk-OEM75TVE.mjs";import{a as en}from"./chunk-4IQZOAN7.mjs";import{a as Q,c as Y,d as nn}from"./chunk-D54FD6XE.mjs";import{c as X,d as z,e as L,f as F,g as Z,h as j,i as J}from"./chunk-A3USS2NC.mjs";import{a as H}from"./chunk-OPO5EYF7.mjs";import{a as O,b as V}from"./chunk-LWXBEIFO.mjs";import{a as x,b as p}from"./chunk-KKLF7DQV.mjs";import{a as G}from"./chunk-SMFTISPN.mjs";import{a as v}from"./chunk-FUC7SLH7.mjs";import{i as b,j as k}from"./chunk-B5BXB2BB.mjs";import{b as N,d as W}from"./chunk-TTERI67T.mjs";import{b as u}from"./chunk-JNO7KPMG.mjs";import{a as C}from"./chunk-HBIDHQ2M.mjs";import{a as _}from"./chunk-UZTJWOLS.mjs";import{g as S}from"./chunk-D3OEQLUE.mjs";import{b as K,c as U}from"./chunk-J7PJSK3J.mjs";import{b as P}from"./chunk-SPRNSFUV.mjs";import{sha3_256 as gn}from"@noble/hashes/sha3";async function Hn(n){if(sn(n))return hn(n);let{moduleAddress:e,moduleName:t,functionName:i}=f(n.function),r=await An({key:"entry-function",moduleAddress:e,moduleName:t,functionName:i,aptosConfig:n.aptosConfig,abi:n.abi,fetch:cn});return pn({...n,abi:r})}function pn(n){let e=n.abi,{moduleAddress:t,moduleName:i,functionName:r}=f(n.function),a=w(n.typeArguments);if(a.length!==e.typeParameters.length)throw new Error(`Type argument count mismatch, expected ${e.typeParameters.length}, received ${a.length}`);let o=n.functionArguments.map((s,d)=>$(n.function,e,s,d,a));if(o.length!==e.parameters.length)throw new Error(`Too few arguments for '${t}::${i}::${r}', expected ${e.parameters.length} but got ${o.length}`);let c=F.build(`${t}::${i}`,r,a,o);if("multisigAddress"in n){let s=u.from(n.multisigAddress);return new L(new j(s,new J(c)))}return new z(c)}async function Xn(n){let{moduleAddress:e,moduleName:t,functionName:i}=f(n.function),r=await An({key:"view-function",moduleAddress:e,moduleName:t,functionName:i,aptosConfig:n.aptosConfig,abi:n.abi,fetch:un});return ln({abi:r,...n})}function ln(n){let e=n.abi,{moduleAddress:t,moduleName:i,functionName:r}=f(n.function),a=w(n.typeArguments);if(a.length!==e.typeParameters.length)throw new Error(`Type argument count mismatch, expected ${e.typeParameters.length}, received ${a.length}`);let o=n?.functionArguments?.map((c,s)=>$(n.function,e,c,s,a))??[];if(o.length!==e.parameters.length)throw new Error(`Too few arguments for '${t}::${i}::${r}', expected ${e.parameters.length} but got ${o.length}`);return F.build(`${t}::${i}`,r,a,o)}function hn(n){return new X(new Z(P.fromHexInput(n.bytecode).toUint8Array(),w(n.typeArguments),n.functionArguments))}async function Tn(n){let{aptosConfig:e,sender:t,payload:i,options:r,feePayerAddress:a}=n,o=async()=>S[e.network]?{chainId:S[e.network]}:{chainId:(await an({aptosConfig:e})).chain_id},c=async()=>r?.gasUnitPrice?{gasEstimate:r.gasUnitPrice}:{gasEstimate:(await on({aptosConfig:e})).gas_estimate},s=async()=>{let g=async()=>r?.accountSequenceNumber!==void 0?r.accountSequenceNumber:(await rn({aptosConfig:e,accountAddress:t})).sequence_number;if(a&&u.from(a).equals(u.ZERO))try{return await g()}catch{return 0}else return g()},[{chainId:d},{gasEstimate:m},I]=await Promise.all([o(),c(),s()]),{maxGasAmount:mn,gasUnitPrice:yn,expireTimestamp:fn}={maxGasAmount:r?.maxGasAmount?BigInt(r.maxGasAmount):BigInt(2e5),gasUnitPrice:r?.gasUnitPrice??BigInt(m),expireTimestamp:r?.expireTimestamp??BigInt(Math.floor(Date.now()/1e3)+20)};return new Q(u.from(t),BigInt(I),i,BigInt(mn),BigInt(yn),BigInt(fn),new H(d))}async function zn(n){let{aptosConfig:e,sender:t,payload:i,options:r,feePayerAddress:a}=n,o=await Tn({aptosConfig:e,sender:t,payload:i,options:r,feePayerAddress:a});if("secondarySignerAddresses"in n){let c=n.secondarySignerAddresses?.map(s=>u.from(s))??[];return new en(o,c,n.feePayerAddress?u.from(n.feePayerAddress):void 0)}return new tn(o,n.feePayerAddress?u.from(n.feePayerAddress):void 0)}function Ln(n){let{signerPublicKey:e,transaction:t,secondarySignersPublicKeys:i,feePayerPublicKey:r}=n,a=A(e);if(t.feePayerAddress){let c=new nn(t.rawTransaction,t.secondarySignerAddresses??[],t.feePayerAddress),s=[];t.secondarySignerAddresses&&(i?s=i.map(I=>A(I)):s=Array.from({length:t.secondarySignerAddresses.length},()=>A(void 0)));let d=A(r),m=new M(a,t.secondarySignerAddresses??[],s,{address:t.feePayerAddress,authenticator:d});return new y(c.raw_txn,m).bcsToBytes()}if(t.secondarySignerAddresses){let c=new Y(t.rawTransaction,t.secondarySignerAddresses),s=[];i?s=i.map(m=>A(m)):s=Array.from({length:t.secondarySignerAddresses.length},()=>A(void 0));let d=new R(a,t.secondarySignerAddresses,s);return new y(c.raw_txn,d).bcsToBytes()}let o;if(a instanceof l)o=new D(a.public_key,a.signature);else if(a instanceof h||a instanceof B)o=new T(a);else if(a instanceof E)o=new T(a);else throw new Error("Invalid public key");return new y(t.rawTransaction,o).bcsToBytes()}function A(n){if(!n)return new E;let t=b.isInstance(n)||v.isInstance(n)||G.isInstance(n)?new x(n):n,i=new W(new Uint8Array(64));if(N.isInstance(t))return new l(t,i);if(x.isInstance(t))return b.isInstance(t.publicKey)?new h(t,new p(k.getSimulationSignature())):new h(t,new p(i));if(O.isInstance(t))return new B(t,new V({signatures:t.publicKeys.map(()=>new p(i)),bitmap:t.createBitmap({bits:Array(t.publicKeys.length).fill(0).map((r,a)=>a)})}));throw new Error("Unsupported PublicKey used for simulations")}function wn(n){let{transaction:e,feePayerAuthenticator:t,additionalSignersAuthenticators:i}=n,r=_(q,n.senderAuthenticator),a;if(e.feePayerAddress){if(!t)throw new Error("Must provide a feePayerAuthenticator argument to generate a signed fee payer transaction");a=new M(r,e.secondarySignerAddresses??[],i??[],{address:e.feePayerAddress,authenticator:t})}else if(e.secondarySignerAddresses){if(!i)throw new Error("Must provide a additionalSignersAuthenticators argument to generate a signed multi agent transaction");a=new R(r,e.secondarySignerAddresses,i)}else r instanceof l?a=new D(r.public_key,r.signature):a=new T(r);return new y(e.rawTransaction,a).bcsToBytes()}function dn(n){let e=gn.create();for(let t of n)e.update(t);return e.digest()}var In=dn(["APTOS::Transaction"]);function Zn(n){let e=wn(n);return new P(dn([In,new Uint8Array([0]),e])).toString()}async function An({key:n,moduleAddress:e,moduleName:t,functionName:i,aptosConfig:r,abi:a,fetch:o}){return a!==void 0?a:C(async()=>o(e,t,i,r),`${n}-${r.network}-${e}-${t}-${i}`,1e3*60*5)()}export{Hn as a,pn as b,Xn as c,ln as d,Tn as e,zn as f,Ln as g,A as h,wn as i,dn as j,Zn as k};
|
|
2
|
+
//# sourceMappingURL=chunk-QN7AK5PU.mjs.map
|