@aptos-labs/ts-sdk 1.14.0 → 1.15.0-win.1
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-csDQ8Gnp.d.ts → accountAddress-ccLvlUQe.d.ts} +20 -1
- package/dist/common/cli/index.d.ts +1 -1
- package/dist/common/cli/index.js +1 -1
- package/dist/common/cli/index.js.map +1 -1
- package/dist/common/index.d.ts +1624 -1390
- package/dist/common/index.js +42 -13
- package/dist/common/index.js.map +1 -1
- package/dist/esm/{Ed25519Account--qjfup2u.d.mts → Ed25519Account-B1VMJOY2.d.mts} +77 -10
- package/dist/esm/account/Account.d.mts +34 -0
- package/dist/esm/account/Account.mjs +2 -0
- package/dist/esm/account/Ed25519Account.d.mts +34 -0
- package/dist/esm/account/Ed25519Account.mjs +2 -0
- package/dist/esm/account/MultiKeyAccount.d.mts +133 -0
- package/dist/esm/account/MultiKeyAccount.mjs +2 -0
- package/dist/esm/account/SingleKeyAccount.d.mts +34 -0
- package/dist/esm/account/SingleKeyAccount.mjs +2 -0
- package/dist/esm/account/index.d.mts +35 -0
- package/dist/esm/account/index.mjs +2 -0
- package/dist/esm/api/account.d.mts +14 -2
- package/dist/esm/api/account.mjs +1 -1
- package/dist/esm/api/ans.d.mts +3 -3
- package/dist/esm/api/ans.mjs +1 -1
- package/dist/esm/api/aptos.d.mts +11 -9
- package/dist/esm/api/aptos.mjs +1 -1
- package/dist/esm/api/coin.d.mts +7 -7
- package/dist/esm/api/coin.mjs +1 -1
- package/dist/esm/api/digitalAsset.d.mts +2 -2
- 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.d.mts +6 -6
- package/dist/esm/api/fungibleAsset.mjs +1 -1
- package/dist/esm/api/general.d.mts +8 -33
- package/dist/esm/api/general.mjs +1 -1
- package/dist/esm/api/index.d.mts +10 -9
- package/dist/esm/api/index.mjs +1 -1
- package/dist/esm/api/staking.mjs +1 -1
- package/dist/esm/api/table.d.mts +84 -0
- package/dist/esm/api/table.mjs +2 -0
- package/dist/esm/api/transaction.d.mts +2 -2
- package/dist/esm/api/transaction.mjs +1 -1
- package/dist/esm/api/transactionSubmission/build.d.mts +2 -2
- package/dist/esm/api/transactionSubmission/build.mjs +1 -1
- package/dist/esm/api/transactionSubmission/management.d.mts +9 -9
- package/dist/esm/api/transactionSubmission/management.mjs +1 -1
- package/dist/esm/api/transactionSubmission/sign.d.mts +2 -2
- package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
- package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -1
- package/dist/esm/api/transactionSubmission/simulate.d.mts +7 -7
- package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
- package/dist/esm/api/transactionSubmission/submit.d.mts +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/entryFunctionBytes.mjs +1 -1
- package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -1
- package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
- package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
- package/dist/esm/bcs/serializer.mjs +1 -1
- package/dist/esm/{chunk-PYXJYEAC.mjs → chunk-2ENDAFGG.mjs} +2 -2
- package/dist/esm/chunk-2ENDAFGG.mjs.map +1 -0
- package/dist/esm/{chunk-XO3HHRJV.mjs → chunk-2O5VFH5O.mjs} +2 -2
- package/dist/esm/{chunk-PXFIA4BL.mjs → chunk-2XK53QFA.mjs} +2 -2
- package/dist/esm/chunk-2ZGHK5BB.mjs +2 -0
- package/dist/esm/chunk-2ZGHK5BB.mjs.map +1 -0
- package/dist/esm/chunk-324M4MB2.mjs +2 -0
- package/dist/esm/chunk-324M4MB2.mjs.map +1 -0
- package/dist/esm/{chunk-RHBCVCOS.mjs → chunk-35EWRSDK.mjs} +2 -2
- package/dist/esm/{chunk-52C73T26.mjs → chunk-36QXVFR5.mjs} +2 -2
- package/dist/esm/{chunk-WCVUDO5S.mjs → chunk-3B6IKORV.mjs} +2 -2
- package/dist/esm/{chunk-CDB34C4N.mjs → chunk-3UGVM4HI.mjs} +2 -2
- package/dist/esm/chunk-3UGVM4HI.mjs.map +1 -0
- package/dist/esm/chunk-3W3BU5BL.mjs +2 -0
- package/dist/esm/chunk-3W3BU5BL.mjs.map +1 -0
- package/dist/esm/chunk-4NHWV5AI.mjs +2 -0
- package/dist/esm/{chunk-HWECUBBA.mjs → chunk-4RZT6HZR.mjs} +2 -2
- package/dist/esm/chunk-4RZT6HZR.mjs.map +1 -0
- package/dist/esm/chunk-4YN7NTBQ.mjs +2 -0
- package/dist/esm/chunk-4YN7NTBQ.mjs.map +1 -0
- package/dist/esm/{chunk-5HY3DEPF.mjs → chunk-5CEZFZHP.mjs} +2 -2
- package/dist/esm/{chunk-NPFNYP75.mjs → chunk-5EN52MUT.mjs} +2 -2
- package/dist/esm/chunk-5LZ66XGE.mjs +2 -0
- package/dist/esm/chunk-5LZ66XGE.mjs.map +1 -0
- package/dist/esm/chunk-5PQHXE4N.mjs +2 -0
- package/dist/esm/chunk-5PQHXE4N.mjs.map +1 -0
- package/dist/esm/chunk-5Y2AZJBC.mjs +2 -0
- package/dist/esm/chunk-5Y2AZJBC.mjs.map +1 -0
- package/dist/esm/chunk-6BIXMATF.mjs +2 -0
- package/dist/esm/chunk-6BIXMATF.mjs.map +1 -0
- package/dist/esm/{chunk-BE4FOV6X.mjs → chunk-6E23TANW.mjs} +2 -2
- package/dist/esm/{chunk-6OV2PQS5.mjs → chunk-6IKL4CPY.mjs} +2 -2
- package/dist/esm/chunk-7PPN3XDQ.mjs +2 -0
- package/dist/esm/{chunk-HG4Q4EFG.mjs → chunk-7T77PZGU.mjs} +2 -2
- package/dist/esm/chunk-7T77PZGU.mjs.map +1 -0
- package/dist/esm/chunk-7VRZLDIJ.mjs +2 -0
- package/dist/esm/chunk-A7EISBPY.mjs +2 -0
- package/dist/esm/chunk-A7EISBPY.mjs.map +1 -0
- package/dist/esm/chunk-B7X6PSE7.mjs +2 -0
- package/dist/esm/{chunk-AOCNYMMX.mjs → chunk-BCUSI3N6.mjs} +2 -2
- package/dist/esm/{chunk-BAV4XY7C.mjs → chunk-BHLICYAI.mjs} +2 -2
- package/dist/esm/chunk-BO2TLWNT.mjs +2 -0
- package/dist/esm/{chunk-N77VJHW5.mjs → chunk-C22QZ32Q.mjs} +2 -2
- package/dist/esm/chunk-CEHCDA3G.mjs +2 -0
- package/dist/esm/chunk-CJDEPZ4J.mjs +2 -0
- package/dist/esm/{chunk-CPBGL37X.mjs.map → chunk-CJDEPZ4J.mjs.map} +1 -1
- package/dist/esm/chunk-EKOTTHRQ.mjs +2 -0
- package/dist/esm/chunk-EKOTTHRQ.mjs.map +1 -0
- package/dist/esm/chunk-F7EMGK4M.mjs +2 -0
- package/dist/esm/{chunk-PMUT3HZE.mjs → chunk-G2RMTVZG.mjs} +2 -2
- package/dist/esm/chunk-G2RMTVZG.mjs.map +1 -0
- package/dist/esm/{chunk-FS3NSGBF.mjs → chunk-G56GPLTB.mjs} +2 -2
- package/dist/esm/{chunk-6FBKUTGF.mjs → chunk-GHYE26Q5.mjs} +2 -2
- package/dist/esm/{chunk-QTRYMRYK.mjs → chunk-GM56MMNJ.mjs} +2 -2
- package/dist/esm/{chunk-2G4ZSGL4.mjs → chunk-GZIOZUKM.mjs} +2 -2
- package/dist/esm/{chunk-SPU745XV.mjs → chunk-HXGEF7O7.mjs} +2 -2
- package/dist/esm/{chunk-O4JRPZZM.mjs → chunk-I6ST47U7.mjs} +2 -2
- package/dist/esm/{chunk-4P5EKAJB.mjs → chunk-IZZ6BA56.mjs} +2 -2
- package/dist/esm/chunk-JFIAWBCK.mjs +2 -0
- package/dist/esm/chunk-JFIAWBCK.mjs.map +1 -0
- package/dist/esm/chunk-JPNTJOQW.mjs +2 -0
- package/dist/esm/chunk-JXCZTOYC.mjs +1 -0
- package/dist/esm/chunk-JXCZTOYC.mjs.map +1 -0
- package/dist/esm/{chunk-UML2VQZT.mjs → chunk-KAGLWBIJ.mjs} +2 -2
- package/dist/esm/chunk-KLTQSLDY.mjs +2 -0
- package/dist/esm/chunk-KLTQSLDY.mjs.map +1 -0
- package/dist/esm/{chunk-AT2A6UGB.mjs → chunk-KNSIJJS3.mjs} +2 -2
- package/dist/esm/{chunk-AT2A6UGB.mjs.map → chunk-KNSIJJS3.mjs.map} +1 -1
- package/dist/esm/{chunk-L5IL2IAB.mjs → chunk-L5KHEQW5.mjs} +2 -2
- package/dist/esm/chunk-LG7RJQ57.mjs +2 -0
- package/dist/esm/{chunk-QD2Y3VK4.mjs → chunk-MI73LIB3.mjs} +2 -2
- package/dist/esm/chunk-MI73LIB3.mjs.map +1 -0
- package/dist/esm/{chunk-U43IJHQN.mjs → chunk-MJPUASSD.mjs} +2 -2
- package/dist/esm/chunk-MVHGVOOC.mjs +2 -0
- package/dist/esm/chunk-MVHGVOOC.mjs.map +1 -0
- package/dist/esm/chunk-N3U47Y6Y.mjs +2 -0
- package/dist/esm/{chunk-P3UFJZY5.mjs → chunk-NOYKXLFN.mjs} +2 -2
- package/dist/esm/chunk-NOYKXLFN.mjs.map +1 -0
- package/dist/esm/chunk-NSZALM2Q.mjs +2 -0
- package/dist/esm/chunk-NSZALM2Q.mjs.map +1 -0
- package/dist/esm/{chunk-UPIN5AIO.mjs → chunk-P6GWG2CY.mjs} +2 -2
- package/dist/esm/chunk-PF57EOJY.mjs +2 -0
- package/dist/esm/{chunk-RW2A63WK.mjs → chunk-PGCCXIAS.mjs} +2 -2
- package/dist/esm/chunk-PGCCXIAS.mjs.map +1 -0
- package/dist/esm/chunk-PHRX2SAA.mjs +2 -0
- package/dist/esm/chunk-PHRX2SAA.mjs.map +1 -0
- package/dist/esm/{chunk-3YZGJLW7.mjs → chunk-PI2NFZEH.mjs} +2 -2
- package/dist/esm/{chunk-IOSQVDZI.mjs → chunk-QRS4DGP3.mjs} +2 -2
- package/dist/esm/{chunk-IOSQVDZI.mjs.map → chunk-QRS4DGP3.mjs.map} +1 -1
- package/dist/esm/{chunk-LDQ6JFEF.mjs → chunk-QSHLNSUP.mjs} +2 -2
- package/dist/esm/{chunk-LDQ6JFEF.mjs.map → chunk-QSHLNSUP.mjs.map} +1 -1
- package/dist/esm/chunk-R2LYYO6V.mjs +2 -0
- package/dist/esm/chunk-R2LYYO6V.mjs.map +1 -0
- package/dist/esm/chunk-RFSO3JRG.mjs +1 -0
- package/dist/esm/chunk-RFSO3JRG.mjs.map +1 -0
- package/dist/esm/{chunk-APDALGDD.mjs → chunk-S2VSJJRJ.mjs} +2 -2
- package/dist/esm/{chunk-S4SEFF4K.mjs → chunk-S3EDNXZE.mjs} +46 -17
- package/dist/esm/chunk-S3EDNXZE.mjs.map +1 -0
- package/dist/esm/chunk-S7TAYRDR.mjs +2 -0
- package/dist/esm/chunk-S7TAYRDR.mjs.map +1 -0
- package/dist/esm/chunk-SFM5C2IG.mjs +2 -0
- package/dist/esm/{chunk-CNMQNPNV.mjs → chunk-SGTNW5YI.mjs} +2 -2
- package/dist/esm/chunk-SRDIYE3M.mjs +2 -0
- package/dist/esm/{chunk-QIAHBEEW.mjs.map → chunk-SRDIYE3M.mjs.map} +1 -1
- package/dist/esm/{chunk-DMKUAQB7.mjs → chunk-U3YYSIIT.mjs} +2 -2
- package/dist/esm/chunk-UGPALAPN.mjs +2 -0
- package/dist/esm/{chunk-BIAEC6FO.mjs → chunk-UM35A7RD.mjs} +2 -2
- package/dist/esm/chunk-UO3NZ5AH.mjs +1 -0
- package/dist/esm/chunk-UO3NZ5AH.mjs.map +1 -0
- package/dist/esm/{chunk-FXNFWLQC.mjs → chunk-UPSCPEEE.mjs} +2 -2
- package/dist/esm/{chunk-S2LTZKM4.mjs → chunk-VGGYFJUY.mjs} +2 -2
- package/dist/esm/{chunk-JCD72AW7.mjs → chunk-YK732P36.mjs} +2 -2
- package/dist/esm/{chunk-UDRSFVAK.mjs → chunk-YMB2XW2O.mjs} +2 -2
- package/dist/esm/{chunk-NWYIE7ZX.mjs → chunk-YZHIXVPR.mjs} +2 -2
- package/dist/esm/chunk-ZGF45HCL.mjs +2 -0
- package/dist/esm/chunk-ZGF45HCL.mjs.map +1 -0
- package/dist/esm/cli/index.d.mts +1 -1
- package/dist/esm/cli/index.mjs +1 -1
- package/dist/esm/cli/move.d.mts +1 -1
- package/dist/esm/cli/move.mjs +1 -1
- package/dist/esm/client/core.mjs +1 -1
- package/dist/esm/client/get.mjs +1 -1
- package/dist/esm/client/index.mjs +1 -1
- package/dist/esm/client/post.mjs +1 -1
- package/dist/esm/client/types.mjs +1 -1
- package/dist/esm/core/account/index.d.mts +5 -14
- 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.d.mts +1 -1
- package/dist/esm/core/authenticationKey.mjs +1 -1
- package/dist/esm/core/common.mjs +1 -1
- package/dist/esm/core/crypto/ed25519.d.mts +1 -1
- package/dist/esm/core/crypto/ed25519.mjs +1 -1
- package/dist/esm/core/crypto/index.d.mts +4 -4
- package/dist/esm/core/crypto/index.mjs +1 -1
- package/dist/esm/core/crypto/multiEd25519.d.mts +1 -1
- package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
- package/dist/esm/core/crypto/multiKey.d.mts +8 -1
- package/dist/esm/core/crypto/multiKey.mjs +1 -1
- package/dist/esm/core/crypto/privateKey.d.mts +1 -1
- package/dist/esm/core/crypto/publicKey.d.mts +1 -1
- package/dist/esm/core/crypto/publicKey.mjs +1 -1
- package/dist/esm/core/crypto/secp256k1.d.mts +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.d.mts +1 -1
- package/dist/esm/core/crypto/singleKey.mjs +1 -1
- package/dist/esm/core/crypto/utils.mjs +1 -1
- package/dist/esm/core/hex.mjs +1 -1
- package/dist/esm/core/index.d.mts +3 -6
- package/dist/esm/core/index.mjs +1 -1
- package/dist/esm/index.d.mts +7 -5
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/internal/account.d.mts +14 -2
- package/dist/esm/internal/account.mjs +1 -1
- package/dist/esm/internal/ans.d.mts +3 -3
- package/dist/esm/internal/ans.mjs +1 -1
- package/dist/esm/internal/coin.d.mts +8 -8
- package/dist/esm/internal/coin.mjs +1 -1
- package/dist/esm/internal/digitalAsset.d.mts +3 -3
- package/dist/esm/internal/digitalAsset.mjs +1 -1
- package/dist/esm/internal/event.d.mts +1 -1
- package/dist/esm/internal/event.mjs +1 -1
- package/dist/esm/internal/faucet.d.mts +1 -1
- package/dist/esm/internal/faucet.mjs +1 -1
- package/dist/esm/internal/fungibleAsset.d.mts +6 -6
- package/dist/esm/internal/fungibleAsset.mjs +1 -1
- package/dist/esm/internal/general.d.mts +2 -8
- package/dist/esm/internal/general.mjs +1 -1
- package/dist/esm/internal/staking.d.mts +1 -1
- package/dist/esm/internal/staking.mjs +1 -1
- package/dist/esm/internal/table.d.mts +31 -0
- package/dist/esm/internal/table.mjs +2 -0
- package/dist/esm/internal/table.mjs.map +1 -0
- package/dist/esm/internal/transaction.mjs +1 -1
- package/dist/esm/internal/transactionSubmission.d.mts +2 -2
- package/dist/esm/internal/transactionSubmission.mjs +1 -1
- package/dist/esm/internal/view.d.mts +7 -7
- package/dist/esm/internal/view.mjs +1 -1
- package/dist/esm/transactions/authenticator/account.d.mts +4 -5
- package/dist/esm/transactions/authenticator/account.mjs +1 -1
- package/dist/esm/transactions/authenticator/index.d.mts +1 -1
- package/dist/esm/transactions/authenticator/index.mjs +1 -1
- package/dist/esm/transactions/authenticator/transaction.d.mts +1 -1
- package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
- package/dist/esm/transactions/index.d.mts +3 -3
- package/dist/esm/transactions/index.mjs +1 -1
- package/dist/esm/transactions/instances/chainId.mjs +1 -1
- package/dist/esm/transactions/instances/identifier.mjs +1 -1
- package/dist/esm/transactions/instances/index.d.mts +1 -1
- package/dist/esm/transactions/instances/index.mjs +1 -1
- package/dist/esm/transactions/instances/moduleId.d.mts +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.d.mts +1 -1
- package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
- package/dist/esm/transactions/instances/signedTransaction.d.mts +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.d.mts +1 -1
- package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
- package/dist/esm/transactions/management/accountSequenceNumber.d.mts +14 -2
- package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
- package/dist/esm/transactions/management/index.d.mts +3 -3
- package/dist/esm/transactions/management/index.mjs +1 -1
- package/dist/esm/transactions/management/transactionWorker.d.mts +2 -2
- package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/helpers.d.mts +9 -9
- package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/index.d.mts +9 -9
- package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +6 -6
- package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/signingMessage.d.mts +72 -0
- package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +2 -0
- package/dist/esm/transactions/transactionBuilder/signingMessage.mjs.map +1 -0
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +7 -29
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
- package/dist/esm/transactions/typeTag/index.mjs +1 -1
- package/dist/esm/transactions/typeTag/parser.mjs +1 -1
- package/dist/esm/transactions/types.d.mts +7 -7
- package/dist/esm/types/generated/operations.d.mts +31 -2
- package/dist/esm/types/generated/queries.d.mts +6 -2
- package/dist/esm/types/generated/queries.mjs +1 -1
- package/dist/esm/types/generated/types.d.mts +212 -7
- package/dist/esm/types/generated/types.mjs +1 -1
- package/dist/esm/types/generated/types.mjs.map +1 -1
- package/dist/esm/types/index.d.mts +1 -1
- package/dist/esm/types/indexer.d.mts +4 -2
- 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/{core/account → account}/Account.ts +25 -15
- package/src/{core/account → account}/Ed25519Account.ts +45 -9
- package/src/account/MultiKeyAccount.ts +176 -0
- package/src/{core/account → account}/SingleKeyAccount.ts +45 -10
- package/src/account/index.ts +4 -0
- package/src/api/account.ts +2 -1
- package/src/api/ans.ts +2 -1
- package/src/api/aptos.ts +6 -0
- package/src/api/digitalAsset.ts +2 -1
- package/src/api/fungibleAsset.ts +2 -1
- package/src/api/general.ts +0 -26
- package/src/api/table.ts +108 -0
- package/src/api/transaction.ts +2 -1
- package/src/api/transactionSubmission/management.ts +1 -1
- package/src/api/transactionSubmission/sign.ts +1 -1
- package/src/cli/move.ts +1 -1
- package/src/core/account/index.ts +0 -3
- package/src/core/crypto/multiKey.ts +17 -6
- package/src/core/index.ts +0 -1
- package/src/index.ts +1 -0
- package/src/internal/account.ts +3 -2
- package/src/internal/ans.ts +2 -1
- package/src/internal/digitalAsset.ts +2 -1
- package/src/internal/fungibleAsset.ts +2 -1
- package/src/internal/general.ts +1 -20
- package/src/internal/queries/currentTokenOwnershipFieldsFragment.graphql +1 -0
- package/src/internal/queries/getTableItemsData.graphql +15 -0
- package/src/internal/queries/getTableItemsMetadata.graphql +12 -0
- package/src/internal/table.ts +82 -0
- package/src/internal/transactionSubmission.ts +5 -7
- package/src/transactions/authenticator/account.ts +6 -11
- package/src/transactions/management/accountSequenceNumber.ts +1 -1
- package/src/transactions/management/transactionWorker.ts +1 -1
- package/src/transactions/transactionBuilder/index.ts +1 -0
- package/src/transactions/transactionBuilder/signingMessage.ts +93 -0
- package/src/transactions/transactionBuilder/transactionBuilder.ts +2 -73
- package/src/types/generated/operations.ts +29 -0
- package/src/types/generated/queries.ts +59 -0
- package/src/types/generated/types.ts +223 -4
- package/src/types/indexer.ts +4 -0
- package/src/version.ts +1 -1
- package/dist/esm/chunk-4374JPA6.mjs +0 -2
- package/dist/esm/chunk-4374JPA6.mjs.map +0 -1
- package/dist/esm/chunk-62P5CJAJ.mjs +0 -2
- package/dist/esm/chunk-62P5CJAJ.mjs.map +0 -1
- package/dist/esm/chunk-B3BRR4WP.mjs +0 -2
- package/dist/esm/chunk-B3BRR4WP.mjs.map +0 -1
- package/dist/esm/chunk-BWFJHFBQ.mjs +0 -2
- package/dist/esm/chunk-CDB34C4N.mjs.map +0 -1
- package/dist/esm/chunk-CF5R4HVB.mjs +0 -2
- package/dist/esm/chunk-CPBGL37X.mjs +0 -2
- package/dist/esm/chunk-DSTKXJMA.mjs +0 -2
- package/dist/esm/chunk-E7FWVXGX.mjs +0 -1
- package/dist/esm/chunk-FBPNHF54.mjs +0 -2
- package/dist/esm/chunk-HG4Q4EFG.mjs.map +0 -1
- package/dist/esm/chunk-HWECUBBA.mjs.map +0 -1
- package/dist/esm/chunk-IR46T46A.mjs +0 -2
- package/dist/esm/chunk-IR46T46A.mjs.map +0 -1
- package/dist/esm/chunk-LBGYH45K.mjs +0 -2
- package/dist/esm/chunk-LBGYH45K.mjs.map +0 -1
- package/dist/esm/chunk-MFL3UCKA.mjs +0 -2
- package/dist/esm/chunk-MFL3UCKA.mjs.map +0 -1
- package/dist/esm/chunk-MLWIHWNH.mjs +0 -1
- package/dist/esm/chunk-NBCHJ75L.mjs +0 -2
- package/dist/esm/chunk-NBCHJ75L.mjs.map +0 -1
- package/dist/esm/chunk-NZGRLKRG.mjs +0 -2
- package/dist/esm/chunk-OGHE4AQA.mjs +0 -2
- package/dist/esm/chunk-P3UFJZY5.mjs.map +0 -1
- package/dist/esm/chunk-PJPXC22D.mjs +0 -2
- package/dist/esm/chunk-PJPXC22D.mjs.map +0 -1
- package/dist/esm/chunk-PMUT3HZE.mjs.map +0 -1
- package/dist/esm/chunk-PYXJYEAC.mjs.map +0 -1
- package/dist/esm/chunk-QD2Y3VK4.mjs.map +0 -1
- package/dist/esm/chunk-QIAHBEEW.mjs +0 -2
- package/dist/esm/chunk-QIAU5K5Y.mjs +0 -2
- package/dist/esm/chunk-QIAU5K5Y.mjs.map +0 -1
- package/dist/esm/chunk-R5QUBEH6.mjs +0 -2
- package/dist/esm/chunk-R7G3CLRI.mjs +0 -1
- package/dist/esm/chunk-RR7I2HLA.mjs +0 -2
- package/dist/esm/chunk-RR7I2HLA.mjs.map +0 -1
- package/dist/esm/chunk-RW2A63WK.mjs.map +0 -1
- package/dist/esm/chunk-S4SEFF4K.mjs.map +0 -1
- package/dist/esm/chunk-TBMAJ6AW.mjs +0 -2
- package/dist/esm/chunk-TGXZVNR5.mjs +0 -2
- package/dist/esm/chunk-TJDC5PWD.mjs +0 -2
- package/dist/esm/chunk-UF534PKA.mjs +0 -2
- package/dist/esm/chunk-UF534PKA.mjs.map +0 -1
- package/dist/esm/chunk-UMDTVVQC.mjs +0 -2
- package/dist/esm/chunk-UMDTVVQC.mjs.map +0 -1
- package/dist/esm/chunk-UNU3RVRJ.mjs +0 -2
- package/dist/esm/chunk-WFZDFFBM.mjs +0 -2
- package/dist/esm/chunk-XIJHRBDL.mjs +0 -2
- package/dist/esm/chunk-XIJHRBDL.mjs.map +0 -1
- package/dist/esm/chunk-ZEHKHKBP.mjs +0 -2
- package/dist/esm/chunk-ZEHKHKBP.mjs.map +0 -1
- package/dist/esm/chunk-ZYYK3UXP.mjs +0 -2
- package/dist/esm/core/account/Account.d.mts +0 -20
- package/dist/esm/core/account/Account.mjs +0 -2
- package/dist/esm/core/account/Ed25519Account.d.mts +0 -20
- package/dist/esm/core/account/Ed25519Account.mjs +0 -2
- package/dist/esm/core/account/SingleKeyAccount.d.mts +0 -20
- package/dist/esm/core/account/SingleKeyAccount.mjs +0 -2
- /package/dist/esm/{core/account → account}/Account.mjs.map +0 -0
- /package/dist/esm/{core/account → account}/Ed25519Account.mjs.map +0 -0
- /package/dist/esm/{chunk-E7FWVXGX.mjs.map → account/MultiKeyAccount.mjs.map} +0 -0
- /package/dist/esm/{core/account → account}/SingleKeyAccount.mjs.map +0 -0
- /package/dist/esm/{chunk-MLWIHWNH.mjs.map → account/index.mjs.map} +0 -0
- /package/dist/esm/{chunk-R7G3CLRI.mjs.map → api/table.mjs.map} +0 -0
- /package/dist/esm/{chunk-XO3HHRJV.mjs.map → chunk-2O5VFH5O.mjs.map} +0 -0
- /package/dist/esm/{chunk-PXFIA4BL.mjs.map → chunk-2XK53QFA.mjs.map} +0 -0
- /package/dist/esm/{chunk-RHBCVCOS.mjs.map → chunk-35EWRSDK.mjs.map} +0 -0
- /package/dist/esm/{chunk-52C73T26.mjs.map → chunk-36QXVFR5.mjs.map} +0 -0
- /package/dist/esm/{chunk-WCVUDO5S.mjs.map → chunk-3B6IKORV.mjs.map} +0 -0
- /package/dist/esm/{chunk-WFZDFFBM.mjs.map → chunk-4NHWV5AI.mjs.map} +0 -0
- /package/dist/esm/{chunk-5HY3DEPF.mjs.map → chunk-5CEZFZHP.mjs.map} +0 -0
- /package/dist/esm/{chunk-NPFNYP75.mjs.map → chunk-5EN52MUT.mjs.map} +0 -0
- /package/dist/esm/{chunk-BE4FOV6X.mjs.map → chunk-6E23TANW.mjs.map} +0 -0
- /package/dist/esm/{chunk-6OV2PQS5.mjs.map → chunk-6IKL4CPY.mjs.map} +0 -0
- /package/dist/esm/{chunk-NZGRLKRG.mjs.map → chunk-7PPN3XDQ.mjs.map} +0 -0
- /package/dist/esm/{chunk-TGXZVNR5.mjs.map → chunk-7VRZLDIJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-DSTKXJMA.mjs.map → chunk-B7X6PSE7.mjs.map} +0 -0
- /package/dist/esm/{chunk-AOCNYMMX.mjs.map → chunk-BCUSI3N6.mjs.map} +0 -0
- /package/dist/esm/{chunk-BAV4XY7C.mjs.map → chunk-BHLICYAI.mjs.map} +0 -0
- /package/dist/esm/{chunk-OGHE4AQA.mjs.map → chunk-BO2TLWNT.mjs.map} +0 -0
- /package/dist/esm/{chunk-N77VJHW5.mjs.map → chunk-C22QZ32Q.mjs.map} +0 -0
- /package/dist/esm/{chunk-TBMAJ6AW.mjs.map → chunk-CEHCDA3G.mjs.map} +0 -0
- /package/dist/esm/{chunk-TJDC5PWD.mjs.map → chunk-F7EMGK4M.mjs.map} +0 -0
- /package/dist/esm/{chunk-FS3NSGBF.mjs.map → chunk-G56GPLTB.mjs.map} +0 -0
- /package/dist/esm/{chunk-6FBKUTGF.mjs.map → chunk-GHYE26Q5.mjs.map} +0 -0
- /package/dist/esm/{chunk-QTRYMRYK.mjs.map → chunk-GM56MMNJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-2G4ZSGL4.mjs.map → chunk-GZIOZUKM.mjs.map} +0 -0
- /package/dist/esm/{chunk-SPU745XV.mjs.map → chunk-HXGEF7O7.mjs.map} +0 -0
- /package/dist/esm/{chunk-O4JRPZZM.mjs.map → chunk-I6ST47U7.mjs.map} +0 -0
- /package/dist/esm/{chunk-4P5EKAJB.mjs.map → chunk-IZZ6BA56.mjs.map} +0 -0
- /package/dist/esm/{chunk-UNU3RVRJ.mjs.map → chunk-JPNTJOQW.mjs.map} +0 -0
- /package/dist/esm/{chunk-UML2VQZT.mjs.map → chunk-KAGLWBIJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-L5IL2IAB.mjs.map → chunk-L5KHEQW5.mjs.map} +0 -0
- /package/dist/esm/{chunk-FBPNHF54.mjs.map → chunk-LG7RJQ57.mjs.map} +0 -0
- /package/dist/esm/{chunk-U43IJHQN.mjs.map → chunk-MJPUASSD.mjs.map} +0 -0
- /package/dist/esm/{chunk-ZYYK3UXP.mjs.map → chunk-N3U47Y6Y.mjs.map} +0 -0
- /package/dist/esm/{chunk-UPIN5AIO.mjs.map → chunk-P6GWG2CY.mjs.map} +0 -0
- /package/dist/esm/{chunk-BWFJHFBQ.mjs.map → chunk-PF57EOJY.mjs.map} +0 -0
- /package/dist/esm/{chunk-3YZGJLW7.mjs.map → chunk-PI2NFZEH.mjs.map} +0 -0
- /package/dist/esm/{chunk-APDALGDD.mjs.map → chunk-S2VSJJRJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-CF5R4HVB.mjs.map → chunk-SFM5C2IG.mjs.map} +0 -0
- /package/dist/esm/{chunk-CNMQNPNV.mjs.map → chunk-SGTNW5YI.mjs.map} +0 -0
- /package/dist/esm/{chunk-DMKUAQB7.mjs.map → chunk-U3YYSIIT.mjs.map} +0 -0
- /package/dist/esm/{chunk-R5QUBEH6.mjs.map → chunk-UGPALAPN.mjs.map} +0 -0
- /package/dist/esm/{chunk-BIAEC6FO.mjs.map → chunk-UM35A7RD.mjs.map} +0 -0
- /package/dist/esm/{chunk-FXNFWLQC.mjs.map → chunk-UPSCPEEE.mjs.map} +0 -0
- /package/dist/esm/{chunk-S2LTZKM4.mjs.map → chunk-VGGYFJUY.mjs.map} +0 -0
- /package/dist/esm/{chunk-JCD72AW7.mjs.map → chunk-YK732P36.mjs.map} +0 -0
- /package/dist/esm/{chunk-UDRSFVAK.mjs.map → chunk-YMB2XW2O.mjs.map} +0 -0
- /package/dist/esm/{chunk-NWYIE7ZX.mjs.map → chunk-YZHIXVPR.mjs.map} +0 -0
- /package/dist/esm/{publicKey-lq5djCIY.d.mts → publicKey-B3XRNhHO.d.mts} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as c}from"./chunk-PI2NFZEH.mjs";import{a as f}from"./chunk-5CEZFZHP.mjs";import{a as g}from"./chunk-NOYKXLFN.mjs";import{a as l}from"./chunk-PHRX2SAA.mjs";import{a as u}from"./chunk-HXGEF7O7.mjs";import{a as m}from"./chunk-NSZALM2Q.mjs";import{a as h}from"./chunk-5PQHXE4N.mjs";import{a as s}from"./chunk-G2RMTVZG.mjs";import{a as p}from"./chunk-5LZ66XGE.mjs";import{a as A}from"./chunk-RTSWVT2Q.mjs";import{a as r}from"./chunk-6IKL4CPY.mjs";import{a}from"./chunk-4RZT6HZR.mjs";var t=class{constructor(i){this.config=new A(i),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 f(this.config),this.fungibleAsset=new g(this.config),this.general=new l(this.config),this.staking=new u(this.config),this.transaction=new h(this.config),this.table=new m(this.config)}};function n(y,i,d){Object.getOwnPropertyNames(i.prototype).forEach(e=>{let o=Object.getOwnPropertyDescriptor(i.prototype,e);o&&(o.value=function(...b){return this[d][e](...b)},Object.defineProperty(y.prototype,e,o))})}n(t,s,"account");n(t,p,"ans");n(t,r,"coin");n(t,a,"digitalAsset");n(t,c,"event");n(t,f,"faucet");n(t,g,"fungibleAsset");n(t,l,"general");n(t,u,"staking");n(t,h,"transaction");n(t,m,"table");export{t as a};
|
|
2
|
+
//# sourceMappingURL=chunk-A7EISBPY.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/api/aptos.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Account } from \"./account\";\nimport { AptosConfig } from \"./aptosConfig\";\nimport { Coin } from \"./coin\";\nimport { DigitalAsset } from \"./digitalAsset\";\nimport { Event } from \"./event\";\nimport { Faucet } from \"./faucet\";\nimport { FungibleAsset } from \"./fungibleAsset\";\nimport { General } from \"./general\";\nimport { ANS } from \"./ans\";\nimport { Staking } from \"./staking\";\nimport { Transaction } from \"./transaction\";\nimport { Table } from \"./table\";\n\n/**\n * This class is the main entry point into Aptos's\n * APIs and separates functionality into different namespaces.\n *\n * To use the SDK, create a new Aptos instance to get access\n * to all the sdk functionality.\n *\n * @example\n *\n * const aptos = new Aptos();\n */\nexport class Aptos {\n readonly config: AptosConfig;\n\n readonly account: Account;\n\n readonly ans: ANS;\n\n readonly coin: Coin;\n\n readonly digitalAsset: DigitalAsset;\n\n readonly event: Event;\n\n readonly faucet: Faucet;\n\n readonly fungibleAsset: FungibleAsset;\n\n readonly general: General;\n\n readonly staking: Staking;\n\n readonly transaction: Transaction;\n\n readonly table: Table;\n\n constructor(settings?: AptosConfig) {\n this.config = new AptosConfig(settings);\n this.account = new Account(this.config);\n this.ans = new ANS(this.config);\n this.coin = new Coin(this.config);\n this.digitalAsset = new DigitalAsset(this.config);\n this.event = new Event(this.config);\n this.faucet = new Faucet(this.config);\n this.fungibleAsset = new FungibleAsset(this.config);\n this.general = new General(this.config);\n this.staking = new Staking(this.config);\n this.transaction = new Transaction(this.config);\n this.table = new Table(this.config);\n }\n}\n\n// extends Aptos interface so all the methods and properties\n// from the other classes will be recognized by typescript.\nexport interface Aptos\n extends Account,\n ANS,\n Coin,\n DigitalAsset,\n Event,\n Faucet,\n FungibleAsset,\n General,\n Staking,\n Table,\n Omit<Transaction, \"build\" | \"simulate\" | \"submit\" | \"batch\"> {}\n\n/**\nIn TypeScript, we can’t inherit or extend from more than one class,\nMixins helps us to get around that by creating a partial classes\nthat we can combine to form a single class that contains all the methods and properties from the partial classes.\n{@link https://www.typescriptlang.org/docs/handbook/mixins.html#alternative-pattern}\n\nHere, we combine any subclass and the Aptos class.\n*/\nfunction applyMixin(targetClass: any, baseClass: any, baseClassProp: string) {\n // Mixin instance methods\n Object.getOwnPropertyNames(baseClass.prototype).forEach((propertyName) => {\n const propertyDescriptor = Object.getOwnPropertyDescriptor(baseClass.prototype, propertyName);\n if (!propertyDescriptor) return;\n // eslint-disable-next-line func-names\n propertyDescriptor.value = function (...args: any) {\n return (this as any)[baseClassProp][propertyName](...args);\n };\n Object.defineProperty(targetClass.prototype, propertyName, propertyDescriptor);\n });\n}\n\napplyMixin(Aptos, Account, \"account\");\napplyMixin(Aptos, ANS, \"ans\");\napplyMixin(Aptos, Coin, \"coin\");\napplyMixin(Aptos, DigitalAsset, \"digitalAsset\");\napplyMixin(Aptos, Event, \"event\");\napplyMixin(Aptos, Faucet, \"faucet\");\napplyMixin(Aptos, FungibleAsset, \"fungibleAsset\");\napplyMixin(Aptos, General, \"general\");\napplyMixin(Aptos, Staking, \"staking\");\napplyMixin(Aptos, Transaction, \"transaction\");\napplyMixin(Aptos, Table, \"table\");\n"],"mappings":"ueA2BO,IAAMA,EAAN,KAAY,CAyBjB,YAAYC,EAAwB,CAClC,KAAK,OAAS,IAAIC,EAAYD,CAAQ,EACtC,KAAK,QAAU,IAAIE,EAAQ,KAAK,MAAM,EACtC,KAAK,IAAM,IAAIC,EAAI,KAAK,MAAM,EAC9B,KAAK,KAAO,IAAIC,EAAK,KAAK,MAAM,EAChC,KAAK,aAAe,IAAIC,EAAa,KAAK,MAAM,EAChD,KAAK,MAAQ,IAAIC,EAAM,KAAK,MAAM,EAClC,KAAK,OAAS,IAAIC,EAAO,KAAK,MAAM,EACpC,KAAK,cAAgB,IAAIC,EAAc,KAAK,MAAM,EAClD,KAAK,QAAU,IAAIC,EAAQ,KAAK,MAAM,EACtC,KAAK,QAAU,IAAIC,EAAQ,KAAK,MAAM,EACtC,KAAK,YAAc,IAAIC,EAAY,KAAK,MAAM,EAC9C,KAAK,MAAQ,IAAIC,EAAM,KAAK,MAAM,CACpC,CACF,EAyBA,SAASC,EAAWC,EAAkBC,EAAgBC,EAAuB,CAE3E,OAAO,oBAAoBD,EAAU,SAAS,EAAE,QAASE,GAAiB,CACxE,IAAMC,EAAqB,OAAO,yBAAyBH,EAAU,UAAWE,CAAY,EACvFC,IAELA,EAAmB,MAAQ,YAAaC,EAAW,CACjD,OAAQ,KAAaH,CAAa,EAAEC,CAAY,EAAE,GAAGE,CAAI,CAC3D,EACA,OAAO,eAAeL,EAAY,UAAWG,EAAcC,CAAkB,EAC/E,CAAC,CACH,CAEAL,EAAWd,EAAOG,EAAS,SAAS,EACpCW,EAAWd,EAAOI,EAAK,KAAK,EAC5BU,EAAWd,EAAOK,EAAM,MAAM,EAC9BS,EAAWd,EAAOM,EAAc,cAAc,EAC9CQ,EAAWd,EAAOO,EAAO,OAAO,EAChCO,EAAWd,EAAOQ,EAAQ,QAAQ,EAClCM,EAAWd,EAAOS,EAAe,eAAe,EAChDK,EAAWd,EAAOU,EAAS,SAAS,EACpCI,EAAWd,EAAOW,EAAS,SAAS,EACpCG,EAAWd,EAAOY,EAAa,aAAa,EAC5CE,EAAWd,EAAOa,EAAO,OAAO","names":["Aptos","settings","AptosConfig","Account","ANS","Coin","DigitalAsset","Event","Faucet","FungibleAsset","General","Staking","Transaction","Table","applyMixin","targetClass","baseClass","baseClassProp","propertyName","propertyDescriptor","args"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a}from"./chunk-LG7RJQ57.mjs";import{bytesToHex as s,hexToBytes as o}from"@noble/hashes/utils";var l=(e=>(e.TOO_SHORT="too_short",e.INVALID_LENGTH="invalid_length",e.INVALID_HEX_CHARS="invalid_hex_chars",e))(l||{}),i=class n{constructor(t){this.data=t}toUint8Array(){return this.data}toStringWithoutPrefix(){return s(this.data)}toString(){return`0x${this.toStringWithoutPrefix()}`}static fromHexString(t){let r=t;if(r.startsWith("0x")&&(r=r.slice(2)),r.length===0)throw new a("Hex string is too short, must be at least 1 char long, excluding the optional leading 0x.","too_short");if(r.length%2!==0)throw new a("Hex string must be an even number of hex characters.","invalid_length");try{return new n(o(r))}catch(e){throw new a(`Hex string contains invalid hex characters: ${e?.message}`,"invalid_hex_chars")}}static fromHexInput(t){return t instanceof Uint8Array?new n(t):n.fromHexString(t)}static isValid(t){try{return n.fromHexString(t),{valid:!0}}catch(r){return{valid:!1,invalidReason:r?.invalidReason,invalidReasonMessage:r?.message}}}equals(t){return this.data.length!==t.data.length?!1:this.data.every((r,e)=>r===t.data[e])}};export{l as a,i as b};
|
|
2
|
+
//# sourceMappingURL=chunk-BCUSI3N6.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as n}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as n}from"./chunk-BO2TLWNT.mjs";import{b as i}from"./chunk-QRS4DGP3.mjs";import{a as d}from"./chunk-36QXVFR5.mjs";var o=class t extends d{constructor(e,s,r){super(),this.rawTransaction=e,this.feePayerAddress=r,this.secondarySignerAddresses=s}serialize(e){this.rawTransaction.serialize(e),e.serializeVector(this.secondarySignerAddresses),this.feePayerAddress===void 0?e.serializeBool(!1):(e.serializeBool(!0),this.feePayerAddress.serialize(e))}static deserialize(e){let s=n.deserialize(e),r=e.deserializeVector(i),c=e.deserializeBool(),a;return c&&(a=i.deserialize(e)),new t(s,r,a)}};export{o as a};
|
|
2
|
+
//# sourceMappingURL=chunk-BHLICYAI.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{b as h}from"./chunk-7VRZLDIJ.mjs";import{a as y}from"./chunk-PF57EOJY.mjs";import{b as n}from"./chunk-QRS4DGP3.mjs";import{a as _}from"./chunk-36QXVFR5.mjs";var t=class i extends _{constructor(e,s,a,r,c,d,l){super(),this.sender=e,this.sequence_number=s,this.payload=a,this.max_gas_amount=r,this.gas_unit_price=c,this.expiration_timestamp_secs=d,this.chain_id=l}serialize(e){this.sender.serialize(e),e.serializeU64(this.sequence_number),this.payload.serialize(e),e.serializeU64(this.max_gas_amount),e.serializeU64(this.gas_unit_price),e.serializeU64(this.expiration_timestamp_secs),this.chain_id.serialize(e)}static deserialize(e){let s=n.deserialize(e),a=e.deserializeU64(),r=h.deserialize(e),c=e.deserializeU64(),d=e.deserializeU64(),l=e.deserializeU64(),m=y.deserialize(e);return new i(s,a,r,c,d,l,m)}},o=class extends _{static deserialize(e){let s=e.deserializeUleb128AsU32();switch(s){case 0:return u.load(e);case 1:return p.load(e);default:throw new Error(`Unknown variant index for RawTransactionWithData: ${s}`)}}},u=class i extends o{constructor(e,s){super(),this.raw_txn=e,this.secondary_signer_addresses=s}serialize(e){e.serializeU32AsUleb128(0),this.raw_txn.serialize(e),e.serializeVector(this.secondary_signer_addresses)}static load(e){let s=t.deserialize(e),a=e.deserializeVector(n);return new i(s,a)}},p=class i extends o{constructor(e,s,a){super(),this.raw_txn=e,this.secondary_signer_addresses=s,this.fee_payer_address=a}serialize(e){e.serializeU32AsUleb128(1),this.raw_txn.serialize(e),e.serializeVector(this.secondary_signer_addresses),this.fee_payer_address.serialize(e)}static load(e){let s=t.deserialize(e),a=e.deserializeVector(n),r=n.deserialize(e);return new i(s,a,r)}};export{t as a,o as b,u as c,p as d};
|
|
2
|
+
//# sourceMappingURL=chunk-BO2TLWNT.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as r}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as r}from"./chunk-3W3BU5BL.mjs";import{f as t,i as o}from"./chunk-U3YYSIIT.mjs";import{e as n}from"./chunk-CYNQRMO5.mjs";var u={typeParameters:[{constraints:[]}],parameters:[new o,new t]};async function y(e){let{aptosConfig:i,sender:s,recipient:c,amount:p,coinType:a,options:m}=e;return r({aptosConfig:i,sender:s,data:{function:"0x1::aptos_account::transfer_coins",typeArguments:[a??n],functionArguments:[c,p],abi:u},options:m})}export{y as a};
|
|
2
|
+
//# sourceMappingURL=chunk-C22QZ32Q.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as r}from"./chunk-36QXVFR5.mjs";import{b as i}from"./chunk-BCUSI3N6.mjs";var t=class a extends r{constructor(e){super(),this.value=i.fromHexInput(e).toUint8Array()}serialize(e){e.serializeFixedBytes(this.value)}serializeForEntryFunction(e){e.serialize(this)}serializeForScriptFunction(e){e.serialize(this)}static deserialize(e,s){let o=e.deserializeFixedBytes(s);return new a(o)}};export{t as a};
|
|
2
|
+
//# sourceMappingURL=chunk-CEHCDA3G.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/version.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * The current version of the SDK\n *\n * hardcoded for now, we would want to have it injected dynamically\n */\nexport const VERSION = \"1.
|
|
1
|
+
{"version":3,"sources":["../../src/version.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * The current version of the SDK\n *\n * hardcoded for now, we would want to have it injected dynamically\n */\nexport const VERSION = \"1.15.0\";\n"],"mappings":"AAQO,IAAMA,EAAU","names":["VERSION"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{e as s}from"./chunk-2ZGHK5BB.mjs";import{w as i,x as m}from"./chunk-S3EDNXZE.mjs";import{b as n}from"./chunk-YMB2XW2O.mjs";async function b(t){let{aptosConfig:a,handle:e,data:o,options:r}=t;return(await n({aptosConfig:a,originMethod:"getTableItem",path:`tables/${e}/item`,params:{ledger_version:r?.ledgerVersion},body:o})).data}async function f(t){let{aptosConfig:a,options:e}=t,o={query:i,variables:{where_condition:e?.where,offset:e?.offset,limit:e?.limit,order_by:e?.orderBy}};return(await s({aptosConfig:a,query:o,originMethod:"getTableItemsData"})).table_items}async function T(t){let{aptosConfig:a,options:e}=t,o={query:m,variables:{where_condition:e?.where,offset:e?.offset,limit:e?.limit,order_by:e?.orderBy}};return(await s({aptosConfig:a,query:o,originMethod:"getTableItemsMetadata"})).table_metadatas}export{b as a,f as b,T as c};
|
|
2
|
+
//# sourceMappingURL=chunk-EKOTTHRQ.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/internal/table.ts"],"sourcesContent":["import { AptosConfig } from \"../api/aptosConfig\";\nimport { postAptosFullNode } from \"../client\";\nimport {\n TableItemRequest,\n LedgerVersionArg,\n PaginationArgs,\n WhereArg,\n OrderByArg,\n GetTableItemsDataResponse,\n GetTableItemsMetadataResponse,\n} from \"../types\";\nimport { GetTableItemsDataQuery, GetTableItemsMetadataQuery } from \"../types/generated/operations\";\nimport { GetTableItemsData, GetTableItemsMetadata } from \"../types/generated/queries\";\nimport { TableItemsBoolExp, TableMetadatasBoolExp } from \"../types/generated/types\";\nimport { queryIndexer } from \"./general\";\n\nexport async function getTableItem<T>(args: {\n aptosConfig: AptosConfig;\n handle: string;\n data: TableItemRequest;\n options?: LedgerVersionArg;\n}): Promise<T> {\n const { aptosConfig, handle, data, options } = args;\n const response = await postAptosFullNode<TableItemRequest, any>({\n aptosConfig,\n originMethod: \"getTableItem\",\n path: `tables/${handle}/item`,\n params: { ledger_version: options?.ledgerVersion },\n body: data,\n });\n return response.data as T;\n}\n\nexport async function getTableItemsData(args: {\n aptosConfig: AptosConfig;\n options?: PaginationArgs & WhereArg<TableItemsBoolExp> & OrderByArg<GetTableItemsDataResponse[0]>;\n}) {\n const { aptosConfig, options } = args;\n\n const graphqlQuery = {\n query: GetTableItemsData,\n variables: {\n where_condition: options?.where,\n offset: options?.offset,\n limit: options?.limit,\n order_by: options?.orderBy,\n },\n };\n\n const data = await queryIndexer<GetTableItemsDataQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getTableItemsData\",\n });\n\n return data.table_items;\n}\n\nexport async function getTableItemsMetadata(args: {\n aptosConfig: AptosConfig;\n options?: PaginationArgs & WhereArg<TableMetadatasBoolExp> & OrderByArg<GetTableItemsMetadataResponse[0]>;\n}): Promise<GetTableItemsMetadataResponse> {\n const { aptosConfig, options } = args;\n\n const graphqlQuery = {\n query: GetTableItemsMetadata,\n variables: {\n where_condition: options?.where,\n offset: options?.offset,\n limit: options?.limit,\n order_by: options?.orderBy,\n },\n };\n\n const data = await queryIndexer<GetTableItemsMetadataQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getTableItemsMetadata\",\n });\n\n return data.table_metadatas;\n}\n"],"mappings":"kIAgBA,eAAsBA,EAAgBC,EAKvB,CACb,GAAM,CAAE,YAAAC,EAAa,OAAAC,EAAQ,KAAAC,EAAM,QAAAC,CAAQ,EAAIJ,EAQ/C,OAPiB,MAAMK,EAAyC,CAC9D,YAAAJ,EACA,aAAc,eACd,KAAM,UAAUC,CAAM,QACtB,OAAQ,CAAE,eAAgBE,GAAS,aAAc,EACjD,KAAMD,CACR,CAAC,GACe,IAClB,CAEA,eAAsBG,EAAkBN,EAGrC,CACD,GAAM,CAAE,YAAAC,EAAa,QAAAG,CAAQ,EAAIJ,EAE3BO,EAAe,CACnB,MAAOC,EACP,UAAW,CACT,gBAAiBJ,GAAS,MAC1B,OAAQA,GAAS,OACjB,MAAOA,GAAS,MAChB,SAAUA,GAAS,OACrB,CACF,EAQA,OANa,MAAMK,EAAqC,CACtD,YAAAR,EACA,MAAOM,EACP,aAAc,mBAChB,CAAC,GAEW,WACd,CAEA,eAAsBG,EAAsBV,EAGD,CACzC,GAAM,CAAE,YAAAC,EAAa,QAAAG,CAAQ,EAAIJ,EAE3BO,EAAe,CACnB,MAAOI,EACP,UAAW,CACT,gBAAiBP,GAAS,MAC1B,OAAQA,GAAS,OACjB,MAAOA,GAAS,MAChB,SAAUA,GAAS,OACrB,CACF,EAQA,OANa,MAAMK,EAAyC,CAC1D,YAAAR,EACA,MAAOM,EACP,aAAc,uBAChB,CAAC,GAEW,eACd","names":["getTableItem","args","aptosConfig","handle","data","options","postAptosFullNode","getTableItemsData","graphqlQuery","GetTableItemsData","queryIndexer","getTableItemsMetadata","GetTableItemsMetadata"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as n}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as n}from"./chunk-UM35A7RD.mjs";import{a as s,b as t,c as r,d as i,e as c,f as u,g as d,h as A,i as g,j as m,k as a,l as p,m as f,n as y,o as C,p as O,q as T}from"./chunk-4YN7NTBQ.mjs";import{e as o}from"./chunk-CYNQRMO5.mjs";var l=class{constructor(e){this.config=e}async getAccountInfo(e){return s({aptosConfig:this.config,...e})}async getAccountModules(e){return t({aptosConfig:this.config,...e})}async getAccountModule(e){return r({aptosConfig:this.config,...e})}async getAccountTransactions(e){return i({aptosConfig:this.config,...e})}async getAccountResources(e){return c({aptosConfig:this.config,...e})}async getAccountResource(e){return u({aptosConfig:this.config,...e})}async lookupOriginalAccountAddress(e){return d({aptosConfig:this.config,...e})}async getAccountTokensCount(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"account_transactions_processor"}),A({aptosConfig:this.config,...e})}async getAccountOwnedTokens(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),g({aptosConfig:this.config,...e})}async getAccountOwnedTokensFromCollectionAddress(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),m({aptosConfig:this.config,...e})}async getAccountCollectionsWithOwnedTokens(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),a({aptosConfig:this.config,...e})}async getAccountTransactionsCount(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"account_transactions_processor"}),p({aptosConfig:this.config,...e})}async getAccountCoinsData(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"fungible_asset_processor"}),y({aptosConfig:this.config,...e})}async getAccountCoinsCount(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"fungible_asset_processor"}),C({aptosConfig:this.config,...e})}async getAccountAPTAmount(e){return this.getAccountCoinAmount({coinType:o,...e})}async getAccountCoinAmount(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"fungible_asset_processor"}),f({aptosConfig:this.config,...e})}async getAccountOwnedObjects(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"default_processor"}),O({aptosConfig:this.config,...e})}async deriveAccountFromPrivateKey(e){return T({aptosConfig:this.config,...e})}};export{l as a};
|
|
2
|
+
//# sourceMappingURL=chunk-G2RMTVZG.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/api/account.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Account as AccountModule } from \"../account\";\nimport { AccountAddress, PrivateKey, AccountAddressInput } from \"../core\";\nimport {\n AccountData,\n AnyNumber,\n GetAccountCoinsDataResponse,\n GetAccountCollectionsWithOwnedTokenResponse,\n GetAccountOwnedObjectsResponse,\n GetAccountOwnedTokensFromCollectionResponse,\n GetAccountOwnedTokensQueryResponse,\n LedgerVersionArg,\n MoveModuleBytecode,\n MoveResource,\n MoveStructId,\n OrderByArg,\n PaginationArgs,\n TokenStandardArg,\n TransactionResponse,\n WhereArg,\n} from \"../types\";\nimport {\n deriveAccountFromPrivateKey,\n getAccountCoinAmount,\n getAccountCoinsCount,\n getAccountCoinsData,\n getAccountCollectionsWithOwnedTokens,\n getAccountOwnedObjects,\n getAccountOwnedTokens,\n getAccountOwnedTokensFromCollectionAddress,\n getAccountTokensCount,\n getAccountTransactionsCount,\n getInfo,\n getModule,\n getModules,\n getResource,\n getResources,\n getTransactions,\n lookupOriginalAccountAddress,\n} from \"../internal/account\";\nimport { APTOS_COIN, ProcessorType } from \"../utils/const\";\nimport { AptosConfig } from \"./aptosConfig\";\nimport { waitForIndexerOnVersion } from \"./utils\";\nimport { CurrentFungibleAssetBalancesBoolExp } from \"../types/generated/types\";\n\n/**\n * A class to query all `Account` related queries on Aptos.\n */\nexport class Account {\n constructor(readonly config: AptosConfig) {}\n\n /**\n * Queries the current state for an Aptos account given its account address\n *\n * @param args.accountAddress Aptos account address\n *\n * @returns The account data\n *\n * @example An example of the returned account\n * ```\n * {\n * sequence_number: \"1\",\n * authentication_key: \"0x5307b5f4bc67829097a8ba9b43dba3b88261eeccd1f709d9bde240fc100fbb69\"\n * }\n * ```\n */\n async getAccountInfo(args: { accountAddress: AccountAddressInput }): Promise<AccountData> {\n return getInfo({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries for all modules in an account given an account address\n *\n * Note: In order to get all account modules, this function may call the API\n * multiple times as it auto paginates.\n *\n * @param args.accountAddress Aptos account address\n * @param args.options.offset The number module to start returning results from\n * @param args.options.limit The number of results to return\n * @param args.options.ledgerVersion The ledger version to query, if not provided it will get the latest version\n *\n * @returns Account modules\n */\n\n async getAccountModules(args: {\n accountAddress: AccountAddressInput;\n options?: PaginationArgs & LedgerVersionArg;\n }): Promise<MoveModuleBytecode[]> {\n return getModules({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries for a specific account module given account address and module name\n *\n * @param args.accountAddress Aptos account address\n * @param args.moduleName The name of the module\n * @param args.options.ledgerVersion The ledger version to query, if not provided it will get the latest version\n *\n * @returns Account module\n *\n * @example\n * const module = await aptos.getAccountModule({accountAddress:\"0x456\"})\n * // An example of an account module response\n * ```\n * {\n * bytecode: \"0xa11ceb0b0600000006010002030206050807070f0d081c200\",\n * abi: { address: \"0x1\" }\n * }\n * ```\n */\n async getAccountModule(args: {\n accountAddress: AccountAddressInput;\n moduleName: string;\n options?: LedgerVersionArg;\n }): Promise<MoveModuleBytecode> {\n return getModule({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries account transactions given an account address\n *\n * Note: In order to get all account transactions, this function may call the API\n * multiple times as it auto paginates.\n *\n * @example\n * const transactions = await aptos.getAccountTransactions({accountAddress:\"0x456\"})\n *\n * @param args.accountAddress Aptos account address\n * @param args.options.offset The number transaction to start returning results from\n * @param args.options.limit The number of results to return\n *\n * @returns The account transactions\n */\n async getAccountTransactions(args: {\n accountAddress: AccountAddressInput;\n options?: PaginationArgs;\n }): Promise<TransactionResponse[]> {\n return getTransactions({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Queries all account resources given an account address\n *\n * Note: In order to get all account resources, this function may call the API\n * multiple times as it auto paginates.\n *\n * @example\n * const resources = await aptos.getAccountResources({accountAddress:\"0x456\"})\n *\n * @param args.accountAddress Aptos account address\n * @param args.options.offset The number resource to start returning results from\n * @param args.options.limit The number of results to return\n * @param args.options.ledgerVersion The ledger version to query, if not provided it will get the latest version\n * @returns Account resources\n */\n async getAccountResources(args: {\n accountAddress: AccountAddressInput;\n options?: PaginationArgs & LedgerVersionArg;\n }): Promise<MoveResource[]> {\n return getResources({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries a specific account resource given account address and resource type. Note that the default is `any` in order\n * to allow for ease of accessing properties of the object.\n *\n * @type The typed output of the resource\n * @param args.accountAddress Aptos account address\n * @param args.resourceType String representation of an on-chain Move struct type, i.e \"0x1::aptos_coin::AptosCoin\"\n * @param args.options.ledgerVersion The ledger version to query, if not provided it will get the latest version\n *\n * @returns Account resource\n *\n * @example\n * const resource = await aptos.getAccountResource({accountAddress:\"0x456\"})\n *\n */\n async getAccountResource<T extends {} = any>(args: {\n accountAddress: AccountAddressInput;\n resourceType: MoveStructId;\n options?: LedgerVersionArg;\n }): Promise<T> {\n return getResource<T>({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Looks up the account address for a given authentication key\n *\n * This handles both if the account's authentication key has been rotated or not.\n *\n * @example\n * const accountAddress = await aptos.lookupOriginalAccountAddress({authenticationKey:account.accountAddress})\n *\n * @param args.authenticationKey The authentication key\n * @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying\n * @param args.options.ledgerVersion The ledger version to query, if not provided it will get the latest version\n * @returns Promise<AccountAddress> The accountAddress associated with the authentication key\n */\n async lookupOriginalAccountAddress(args: {\n authenticationKey: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n options?: LedgerVersionArg;\n }): Promise<AccountAddress> {\n return lookupOriginalAccountAddress({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries the current count of tokens owned by an account\n *\n * @example\n * const tokensCount = await aptos.getAccountTokensCount({accountAddress:\"0x456\"})\n *\n * @param args.accountAddress The account address\n * @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying\n * @returns Current count of tokens owned by the account\n */\n async getAccountTokensCount(args: {\n accountAddress: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n }): Promise<number> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.ACCOUNT_TRANSACTION_PROCESSOR,\n });\n return getAccountTokensCount({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Queries the account's current owned tokens.\n *\n * This query returns all tokens (v1 and v2 standards) an account owns, including NFTs, fungible, soulbound, etc.\n * If you want to get only the token from a specific standard, you can pass an optional tokenStandard param\n *\n * @example\n * const accountOwnedTokens = await aptos.getAccountOwnedTokens({accountAddress:\"0x456\"})\n *\n * @param args.accountAddress The account address we want to get the tokens for\n * @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying\n * @param args.options.tokenStandard The NFT standard to query for\n * @param args.options.offset The number token to start returning results from\n * @param args.options.limit The number of results to return\n * @param args.options.orderBy The order to sort the tokens by\n * @returns Tokens array with the token data\n */\n async getAccountOwnedTokens(args: {\n accountAddress: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n options?: TokenStandardArg & PaginationArgs & OrderByArg<GetAccountOwnedTokensQueryResponse[0]>;\n }): Promise<GetAccountOwnedTokensQueryResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.TOKEN_V2_PROCESSOR,\n });\n return getAccountOwnedTokens({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Queries all current tokens of a specific collection that an account owns by the collection address\n *\n * This query returns all tokens (v1 and v2 standards) an account owns, including NFTs, fungible, soulbound, etc.\n * If you want to get only the token from a specific standard, you can pass an optional tokenStandard param\n *\n * @example\n * const accountOwnedTokens = await aptos.getAccountOwnedTokensFromCollectionAddress({accountAddress:\"0x123\", collectionAddress:\"0x456\"})\n *\n * @param args.accountAddress The account address we want to get the tokens for\n * @param args.collectionAddress The address of the collection being queried\n * @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying\n * @param args.options.tokenStandard The NFT standard to query for\n * @param args.options.offset The number token to start returning results from\n * @param args.options.limit The number of results to return\n * @param args.options.orderBy The order to sort the tokens by\n * @returns Tokens array with the token data\n */\n async getAccountOwnedTokensFromCollectionAddress(args: {\n accountAddress: AccountAddressInput;\n collectionAddress: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n options?: TokenStandardArg & PaginationArgs & OrderByArg<GetAccountOwnedTokensFromCollectionResponse[0]>;\n }): Promise<GetAccountOwnedTokensFromCollectionResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.TOKEN_V2_PROCESSOR,\n });\n return getAccountOwnedTokensFromCollectionAddress({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Queries for all collections that an account currently has tokens for.\n *\n * This query returns all tokens (v1 and v2 standards) an account owns, including NFTs, fungible, soulbound, etc.\n * If you want to get only the token from a specific standard, you can pass an optional tokenStandard param\n *\n * @example\n * const accountCollectionsWithOwnedTokens = await aptos.getAccountCollectionsWithOwnedTokens({accountAddress:\"0x123\"})\n *\n * @param args.accountAddress The account address we want to get the collections for\n * @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying\n * @param args.options.tokenStandard The NFT standard to query for\n * @param args.options.offset The number collection to start returning results from\n * @param args.options.limit The number of results to return\n * @param args.options.orderBy The order to sort the tokens by\n * @returns Collections array with the collections data\n */\n async getAccountCollectionsWithOwnedTokens(args: {\n accountAddress: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n options?: TokenStandardArg & PaginationArgs & OrderByArg<GetAccountCollectionsWithOwnedTokenResponse[0]>;\n }): Promise<GetAccountCollectionsWithOwnedTokenResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.TOKEN_V2_PROCESSOR,\n });\n return getAccountCollectionsWithOwnedTokens({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Queries the current count of transactions submitted by an account\n *\n * @example\n * const accountTransactionsCount = await aptos.getAccountTransactionsCount({accountAddress:\"0x123\"})\n *\n * @param args.accountAddress The account address we want to get the total count for\n * @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying\n * @returns Current count of transactions made by an account\n */\n async getAccountTransactionsCount(args: {\n accountAddress: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n }): Promise<number> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.ACCOUNT_TRANSACTION_PROCESSOR,\n });\n return getAccountTransactionsCount({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Queries an account's coins data\n *\n * @example\n * const accountCoinsData = await aptos.getAccountCoinsData({accountAddress:\"0x123\"})\n *\n * @param args.accountAddress The account address we want to get the coins data for\n * @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying\n * @param args.options.offset optional. The number coin to start returning results from\n * @param args.options.limit optional. The number of results to return\n * @param args.options.orderBy optional. The order to sort the coins by\n * @param args.options.where optional. Filter the results by\n * @returns Array with the coins data\n */\n async getAccountCoinsData(args: {\n accountAddress: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n options?: PaginationArgs &\n OrderByArg<GetAccountCoinsDataResponse[0]> &\n WhereArg<CurrentFungibleAssetBalancesBoolExp>;\n }): Promise<GetAccountCoinsDataResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.FUNGIBLE_ASSET_PROCESSOR,\n });\n return getAccountCoinsData({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Queries the current count of an account's coins aggregated\n *\n * @example\n * const accountCoinsCount = await aptos.getAccountCoinsCount({accountAddress:\"0x123\"})\n *\n * @param args.accountAddress The account address we want to get the total count for\n * @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying\n * @returns Current count of the aggregated count of all account's coins\n */\n async getAccountCoinsCount(args: {\n accountAddress: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n }): Promise<number> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.FUNGIBLE_ASSET_PROCESSOR,\n });\n return getAccountCoinsCount({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries the account's APT amount\n *\n * @example\n * const accountAPTAmount = await aptos.getAccountAPTAmount({accountAddress:\"0x123\"})\n *\n * @param args.accountAddress The account address we want to get the total count for\n * @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying\n * @returns Current amount of account's APT\n */\n async getAccountAPTAmount(args: {\n accountAddress: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n }): Promise<number> {\n return this.getAccountCoinAmount({ coinType: APTOS_COIN, ...args });\n }\n\n /**\n * Queries the account's coin amount by the coin type\n *\n * @example\n * const accountCoinAmount = await aptos.getAccountCoinAmount({accountAddress:\"0x123\", coinType:\"0x1::aptos_coin::AptosCoin\"})\n *\n * @param args.accountAddress The account address we want to get the total count for\n * @param args.coinType The coin type to query\n * @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying\n * @returns Current amount of account's coin\n */\n async getAccountCoinAmount(args: {\n accountAddress: AccountAddressInput;\n coinType: MoveStructId;\n minimumLedgerVersion?: AnyNumber;\n }): Promise<number> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.FUNGIBLE_ASSET_PROCESSOR,\n });\n return getAccountCoinAmount({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries an account's owned objects\n *\n * @example\n * const accountOwnedObjects = await aptos.getAccountOwnedObjects({accountAddress:\"0x123\"})\n *\n * @param args.accountAddress The account address we want to get the objects for\n * @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying\n * @param args.options.offset The starting position to start returning results from\n * @param args.options.limit The number of results to return\n * @param args.options.orderBy The order to sort the objects by\n * @returns Objects array with the object data\n */\n async getAccountOwnedObjects(args: {\n accountAddress: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n options?: PaginationArgs & OrderByArg<GetAccountOwnedObjectsResponse[0]>;\n }): Promise<GetAccountOwnedObjectsResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.DEFAULT,\n });\n return getAccountOwnedObjects({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Derives an account by providing a private key.\n * This functions resolves the provided private key type and derives the public key from it.\n *\n * If the privateKey is a Secp256k1 type, it derives the account using the derived public key and\n * auth key using the SingleKey scheme locally.\n *\n * If the privateKey is a ED25519 type, it looks up the authentication key on chain, and uses it to resolve\n * whether it is a Legacy ED25519 key or a Unified ED25519 key. It then derives the account based\n * on that.\n *\n * @example\n * const account = await aptos.deriveAccountFromPrivateKey({privateKey:new Ed25519PrivateKey(\"0x123\")})\n *\n * @param args.privateKey An account private key\n * @returns Account type\n */\n async deriveAccountFromPrivateKey(args: { privateKey: PrivateKey }): Promise<AccountModule> {\n return deriveAccountFromPrivateKey({ aptosConfig: this.config, ...args });\n }\n}\n"],"mappings":"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","names":["Account","config","args","getInfo","getModules","getModule","getTransactions","getResources","getResource","lookupOriginalAccountAddress","waitForIndexerOnVersion","getAccountTokensCount","getAccountOwnedTokens","getAccountOwnedTokensFromCollectionAddress","getAccountCollectionsWithOwnedTokens","getAccountTransactionsCount","getAccountCoinsData","getAccountCoinsCount","APTOS_COIN","getAccountCoinAmount","getAccountOwnedObjects","deriveAccountFromPrivateKey"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as l,b as s,c as u,d as c,e as d,f as m,g as U}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as l,b as s,c as u,d as c,e as d,f as m,g as U}from"./chunk-SRDIYE3M.mjs";import{a as o}from"./chunk-36QXVFR5.mjs";import{b as w}from"./chunk-BCUSI3N6.mjs";var t=class n extends o{constructor(e){super(),this.values=e}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){if(!(this.values[0]instanceof s)&&this.values[0]!==void 0)throw new Error("Script function arguments only accept u8 vectors");e.serializeU32AsUleb128(4),e.serialize(this)}static U8(e){let r;if(Array.isArray(e)&&typeof e[0]=="number")r=e;else if(typeof e=="string"){let i=w.fromHexInput(e);r=Array.from(i.toUint8Array())}else if(e instanceof Uint8Array)r=Array.from(e);else throw new Error("Invalid input type");return new n(r.map(i=>new s(i)))}static U16(e){return new n(e.map(r=>new u(r)))}static U32(e){return new n(e.map(r=>new c(r)))}static U64(e){return new n(e.map(r=>new d(r)))}static U128(e){return new n(e.map(r=>new m(r)))}static U256(e){return new n(e.map(r=>new U(r)))}static Bool(e){return new n(e.map(r=>new l(r)))}static MoveString(e){return new n(e.map(r=>new a(r)))}serialize(e){e.serializeVector(this.values)}static deserialize(e,r){let i=e.deserializeUleb128AsU32(),p=new Array;for(let y=0;y<i;y+=1)p.push(r.deserialize(e));return new n(p)}},a=class n extends o{constructor(e){super(),this.value=e}serialize(e){e.serializeStr(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){let r=this.bcsToBytes().slice(1);t.U8(r).serializeForScriptFunction(e)}static deserialize(e){return new n(e.deserializeStr())}},z=class n extends o{constructor(e){super(),typeof e<"u"&&e!==null?this.vec=new t([e]):this.vec=new t([]),[this.value]=this.vec.values}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}unwrap(){if(this.isSome())return this.vec.values[0];throw new Error("Called unwrap on a MoveOption with no value")}isSome(){return this.vec.values.length===1}serialize(e){this.vec.serialize(e)}static U8(e){return new n(e!=null?new s(e):void 0)}static U16(e){return new n(e!=null?new u(e):void 0)}static U32(e){return new n(e!=null?new c(e):void 0)}static U64(e){return new n(e!=null?new d(e):void 0)}static U128(e){return new n(e!=null?new m(e):void 0)}static U256(e){return new n(e!=null?new U(e):void 0)}static Bool(e){return new n(e!=null?new l(e):void 0)}static MoveString(e){return new n(e!=null?new a(e):void 0)}static deserialize(e,r){let i=t.deserialize(e,r);return new n(i.values[0])}};export{t as a,a as b,z as c};
|
|
2
|
+
//# sourceMappingURL=chunk-G56GPLTB.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var s=class extends Error{constructor(e,t,a){super(a)
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
var s=class extends Error{constructor(e,t,a){super(a),this.name="AptosApiError",this.url=t.url,this.status=t.status,this.statusText=t.statusText,this.data=t.data,this.request=e}};export{s as a};
|
|
2
|
+
//# sourceMappingURL=chunk-GHYE26Q5.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as o}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as o}from"./chunk-QRS4DGP3.mjs";import{a as u,b as r}from"./chunk-G56GPLTB.mjs";import{e as t}from"./chunk-SRDIYE3M.mjs";import{a as i}from"./chunk-36QXVFR5.mjs";var c=class extends i{constructor(e){super();this.accountAddress=o.ONE;this.moduleName=new r("account");this.structName=new r("RotationProofChallenge");this.sequenceNumber=new t(e.sequenceNumber),this.originator=e.originator,this.currentAuthKey=e.currentAuthKey,this.newPublicKey=u.U8(e.newPublicKey.toUint8Array())}serialize(e){e.serialize(this.accountAddress),e.serialize(this.moduleName),e.serialize(this.structName),e.serialize(this.sequenceNumber),e.serialize(this.originator),e.serialize(this.currentAuthKey),e.serialize(this.newPublicKey)}};export{c as a};
|
|
2
|
+
//# sourceMappingURL=chunk-GM56MMNJ.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as r}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{c as r}from"./chunk-5Y2AZJBC.mjs";import{b as i}from"./chunk-YMB2XW2O.mjs";import{b as t}from"./chunk-36QXVFR5.mjs";async function v(a){let{aptosConfig:o,payload:n,options:s}=a,p=await r({...n,aptosConfig:o}),e=new t;p.serialize(e);let l=e.toUint8Array(),{data:d}=await i({aptosConfig:o,path:"view",originMethod:"view",contentType:"application/x.aptos.view_function+bcs",params:{ledger_version:s?.ledgerVersion},body:l});return d}export{v as a};
|
|
2
|
+
//# sourceMappingURL=chunk-GZIOZUKM.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-VGGYFJUY.mjs";import{a as o}from"./chunk-UM35A7RD.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-HXGEF7O7.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as d}from"./chunk-UGPALAPN.mjs";import{a as u}from"./chunk-F7EMGK4M.mjs";import{e as g,j as h}from"./chunk-LR65XHSF.mjs";import{a as f}from"./chunk-4NHWV5AI.mjs";import{a as p}from"./chunk-36QXVFR5.mjs";import{b as s}from"./chunk-BCUSI3N6.mjs";import{sha3_256 as H}from"@noble/hashes/sha3";import{secp256k1 as o}from"@noble/curves/secp256k1";import{HDKey as S}from"@scure/bip32";var n=class n extends f{constructor(e){super();let r=s.fromHexInput(e);if(r.toUint8Array().length!==n.LENGTH)throw new Error(`PublicKey length should be ${n.LENGTH}`);this.key=r}verifySignature(e){let{message:r,signature:i}=e;if(!(i instanceof y))return!1;let l=u(r),c=s.fromHexInput(l).toUint8Array(),A=H(c),x=i.toUint8Array();return o.verify(x,A,this.key.toUint8Array(),{lowS:!0})}toUint8Array(){return this.key.toUint8Array()}serialize(e){e.serializeBytes(this.key.toUint8Array())}static deserialize(e){let r=e.deserializeBytes();return new n(r)}static isPublicKey(e){return e instanceof n}};n.LENGTH=65;var m=n,t=class t extends p{constructor(e){super();let r=s.fromHexInput(e);if(r.toUint8Array().length!==t.LENGTH)throw new Error(`PrivateKey length should be ${t.LENGTH}`);this.key=r}static generate(){let e=o.utils.randomPrivateKey();return new t(e)}static fromDerivationPath(e,r){if(!g(e))throw new Error(`Invalid derivation path ${e}`);return t.fromDerivationPathInner(e,h(r))}static fromDerivationPathInner(e,r){let{privateKey:i}=S.fromMasterSeed(r).derive(e);if(i===null)throw new Error("Invalid key");return new t(i)}sign(e){let r=u(e),i=s.fromHexInput(r),l=H(i.toUint8Array()),c=o.sign(l,this.key.toUint8Array(),{lowS:!0});return new y(c.toCompactRawBytes())}publicKey(){let e=o.getPublicKey(this.key.toUint8Array(),!1);return new m(e)}toUint8Array(){return this.key.toUint8Array()}toString(){return this.key.toString()}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let r=e.deserializeBytes();return new t(r)}static isPrivateKey(e){return e instanceof t}};t.LENGTH=32;var v=t,a=class a extends d{constructor(e){super();let r=s.fromHexInput(e);if(r.toUint8Array().length!==a.LENGTH)throw new Error(`Signature length should be ${a.LENGTH}, received ${r.toUint8Array().length}`);this.data=r}toUint8Array(){return this.data.toUint8Array()}serialize(e){e.serializeBytes(this.data.toUint8Array())}static deserialize(e){let r=e.deserializeBytes();return new a(r)}};a.LENGTH=64;var y=a;export{m as a,v as b,y as c};
|
|
2
|
+
//# sourceMappingURL=chunk-I6ST47U7.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as s}from"./chunk-6EMN3BOV.mjs";import{f as r}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as s}from"./chunk-6EMN3BOV.mjs";import{f as r}from"./chunk-3W3BU5BL.mjs";import{a as o}from"./chunk-FVA2OPG4.mjs";var i=class{constructor(n){this.config=n}async simple(n){return r({aptosConfig:this.config,...n})}async multiAgent(n){return r({aptosConfig:this.config,...n})}};o([s],i.prototype,"simple",1),o([s],i.prototype,"multiAgent",1);export{i as a};
|
|
2
|
+
//# sourceMappingURL=chunk-IZZ6BA56.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{c as T,d as c}from"./chunk-BO2TLWNT.mjs";import{f as A,g as a}from"./chunk-CYNQRMO5.mjs";import{sha3_256 as y}from"@noble/hashes/sha3";function d(e){return e.feePayerAddress?new c(e.rawTransaction,e.secondarySignerAddresses??[],e.feePayerAddress):e.secondarySignerAddresses?new T(e.rawTransaction,e.secondarySignerAddresses):e.rawTransaction}function n(e,r){let i=y.create();if(!r.startsWith("APTOS::"))throw new Error(`Domain separator needs to start with 'APTOS::'. Provided - ${r}`);i.update(r);let s=i.digest(),o=e,t=new Uint8Array(s.length+o.length);return t.set(s),t.set(o,s.length),t}function u(e){return n(e.bcsToBytes(),`APTOS::${e.constructor.name}`)}function S(e){let r=d(e);return e.feePayerAddress?n(r.bcsToBytes(),a):e.secondarySignerAddresses?n(r.bcsToBytes(),a):n(r.bcsToBytes(),A)}export{d as a,n as b,u as c,S as d};
|
|
2
|
+
//# sourceMappingURL=chunk-JFIAWBCK.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/transactions/transactionBuilder/signingMessage.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * This file handles the generation of the signing message.\n */\nimport { sha3_256 as sha3Hash } from \"@noble/hashes/sha3\";\nimport { RAW_TRANSACTION_SALT, RAW_TRANSACTION_WITH_DATA_SALT } from \"../../utils/const\";\nimport { FeePayerRawTransaction, MultiAgentRawTransaction } from \"../instances\";\nimport { AnyRawTransaction, AnyRawTransactionInstance } from \"../types\";\nimport { Serializable } from \"../../bcs\";\n\n/**\n * Derive the raw transaction type - FeePayerRawTransaction or MultiAgentRawTransaction or RawTransaction\n *\n * @param transaction A aptos transaction type\n *\n * @returns FeePayerRawTransaction | MultiAgentRawTransaction | RawTransaction\n */\nexport function deriveTransactionType(transaction: AnyRawTransaction): AnyRawTransactionInstance {\n if (transaction.feePayerAddress) {\n return new FeePayerRawTransaction(\n transaction.rawTransaction,\n transaction.secondarySignerAddresses ?? [],\n transaction.feePayerAddress,\n );\n }\n if (transaction.secondarySignerAddresses) {\n return new MultiAgentRawTransaction(transaction.rawTransaction, transaction.secondarySignerAddresses);\n }\n\n return transaction.rawTransaction;\n}\n\n/**\n * Generates the 'signing message' form of a message to be signed.\n *\n * @param bytes The byte representation of the message to be signed and sent to the chain\n * @param domainSeparator A domain separator that starts with 'APTOS::'\n *\n * @returns The Uint8Array of the signing message\n */\nexport function generateSigningMessage(bytes: Uint8Array, domainSeparator: string): Uint8Array {\n const hash = sha3Hash.create();\n\n if (!domainSeparator.startsWith(\"APTOS::\")) {\n throw new Error(`Domain separator needs to start with 'APTOS::'. Provided - ${domainSeparator}`);\n }\n\n hash.update(domainSeparator);\n\n const prefix = hash.digest();\n\n const body = bytes;\n\n const mergedArray = new Uint8Array(prefix.length + body.length);\n mergedArray.set(prefix);\n mergedArray.set(body, prefix.length);\n\n return mergedArray;\n}\n\n/**\n * Generates the 'signing message' form of a serilizable value. It bcs serializes the value and uses the name of\n * its constructor as the domain separator.\n *\n * @param serializable An object that has a bcs serialized form\n *\n * @returns The Uint8Array of the signing message\n */\nexport function generateSigningMessageForSerializable(serializable: Serializable): Uint8Array {\n return generateSigningMessage(serializable.bcsToBytes(), `APTOS::${serializable.constructor.name}`);\n}\n\n/**\n * Generates the 'signing message' form of a transaction. It derives the type of transaction and\n * applies the appropriate domain separator based on if there is extra data such as a fee payer or\n * secondary signers.\n *\n * @param transaction A transaction that is to be signed\n *\n * @returns The Uint8Array of the signing message\n */\nexport function generateSigningMessageForTransaction(transaction: AnyRawTransaction): Uint8Array {\n const rawTxn = deriveTransactionType(transaction);\n if (transaction.feePayerAddress) {\n return generateSigningMessage(rawTxn.bcsToBytes(), RAW_TRANSACTION_WITH_DATA_SALT);\n }\n if (transaction.secondarySignerAddresses) {\n return generateSigningMessage(rawTxn.bcsToBytes(), RAW_TRANSACTION_WITH_DATA_SALT);\n }\n return generateSigningMessage(rawTxn.bcsToBytes(), RAW_TRANSACTION_SALT);\n}\n"],"mappings":"gGAMA,OAAS,YAAYA,MAAgB,qBAa9B,SAASC,EAAsBC,EAA2D,CAC/F,OAAIA,EAAY,gBACP,IAAIC,EACTD,EAAY,eACZA,EAAY,0BAA4B,CAAC,EACzCA,EAAY,eACd,EAEEA,EAAY,yBACP,IAAIE,EAAyBF,EAAY,eAAgBA,EAAY,wBAAwB,EAG/FA,EAAY,cACrB,CAUO,SAASG,EAAuBC,EAAmBC,EAAqC,CAC7F,IAAMC,EAAOC,EAAS,OAAO,EAE7B,GAAI,CAACF,EAAgB,WAAW,SAAS,EACvC,MAAM,IAAI,MAAM,+DAA+DA,CAAe,EAAE,EAGlGC,EAAK,OAAOD,CAAe,EAE3B,IAAMG,EAASF,EAAK,OAAO,EAErBG,EAAOL,EAEPM,EAAc,IAAI,WAAWF,EAAO,OAASC,EAAK,MAAM,EAC9D,OAAAC,EAAY,IAAIF,CAAM,EACtBE,EAAY,IAAID,EAAMD,EAAO,MAAM,EAE5BE,CACT,CAUO,SAASC,EAAsCC,EAAwC,CAC5F,OAAOT,EAAuBS,EAAa,WAAW,EAAG,UAAUA,EAAa,YAAY,IAAI,EAAE,CACpG,CAWO,SAASC,EAAqCb,EAA4C,CAC/F,IAAMc,EAASf,EAAsBC,CAAW,EAChD,OAAIA,EAAY,gBACPG,EAAuBW,EAAO,WAAW,EAAGC,CAA8B,EAE/Ef,EAAY,yBACPG,EAAuBW,EAAO,WAAW,EAAGC,CAA8B,EAE5EZ,EAAuBW,EAAO,WAAW,EAAGE,CAAoB,CACzE","names":["sha3Hash","deriveTransactionType","transaction","FeePayerRawTransaction","MultiAgentRawTransaction","generateSigningMessage","bytes","domainSeparator","hash","sha3Hash","prefix","body","mergedArray","generateSigningMessageForSerializable","serializable","generateSigningMessageForTransaction","rawTxn","RAW_TRANSACTION_WITH_DATA_SALT","RAW_TRANSACTION_SALT"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{b as s}from"./chunk-QRS4DGP3.mjs";import{g as e}from"./chunk-L5KHEQW5.mjs";import{d as c}from"./chunk-YMB2XW2O.mjs";import{d as r}from"./chunk-CYNQRMO5.mjs";async function x(a){let{aptosConfig:t,accountAddress:i,amount:p,options:n}=a,u=n?.timeoutSecs||20,{data:d}=await c({aptosConfig:t,path:"fund",body:{address:s.from(i).toString(),amount:p},originMethod:"fundAccount"}),m=d.txn_hashes[0],o=await e({aptosConfig:t,transactionHash:m,options:{timeoutSecs:u,checkSuccess:n?.checkSuccess}});if(o.type==="user_transaction")return o;throw new Error(`Unexpected transaction received for fund account: ${o.type}`)}export{x as a};
|
|
2
|
+
//# sourceMappingURL=chunk-JPNTJOQW.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=chunk-JXCZTOYC.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as c}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as c}from"./chunk-QRS4DGP3.mjs";import{sha3_256 as n}from"@noble/hashes/sha3";var d=(e,r)=>{let t=e.bcsToBytes(),s=typeof r=="string"?Buffer.from(r,"utf8"):r,o=new Uint8Array([...t,...s,254]);return new c(n(o))},f=(e,r)=>{let t=e.bcsToBytes(),s=typeof r=="string"?Buffer.from(r,"utf8"):r,o=new Uint8Array([...t,...s,255]);return new c(n(o))},a=(e,r,t)=>{let s=`${r}::${t}`;return d(e,s)};export{d as a,f as b,a as c};
|
|
2
|
+
//# sourceMappingURL=chunk-KAGLWBIJ.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as o,b as h}from"./chunk-KNSIJJS3.mjs";import{a as g}from"./chunk-UGPALAPN.mjs";import{b as m}from"./chunk-4NHWV5AI.mjs";import{a as b}from"./chunk-5EN52MUT.mjs";function d(l){let e=l;return e-=e>>1&1431655765,e=(e&858993459)+(e>>2&858993459),(e+(e>>4)&252645135)*16843009>>24}var f=class l 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 b.fromSchemeAndBytes({scheme:3,input:this.toUint8Array()})}toUint8Array(){return this.bcsToBytes()}serialize(e){e.serializeVector(this.publicKeys),e.serializeU8(this.signaturesRequired)}static deserialize(e){let r=e.deserializeVector(o),t=e.deserializeU8();return new l({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),y=i[c];y|=t>>n%8,i[c]=y}),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")}},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 h?a:new h(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}toUint8Array(){return this.bcsToBytes()}serialize(e){e.serializeVector(this.signatures),e.serializeBytes(this.bitmap)}static deserialize(e){let r=e.deserializeVector(h),t=e.deserializeBytes();return new s({signatures:r,bitmap:t})}};s.BITMAP_LEN=4,s.MAX_SIGNATURES_SUPPORTED=s.BITMAP_LEN*8;var p=s;export{f as a,p as b};
|
|
2
|
+
//# sourceMappingURL=chunk-KLTQSLDY.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/core/crypto/multiKey.ts"],"sourcesContent":["import { SigningScheme as AuthenticationKeyScheme } from \"../../types\";\nimport { Deserializer } from \"../../bcs/deserializer\";\nimport { Serializer } from \"../../bcs/serializer\";\nimport { AuthenticationKey } from \"../authenticationKey\";\nimport { AccountPublicKey, PublicKey, VerifySignatureArgs } from \"./publicKey\";\nimport { Signature } from \"./signature\";\nimport { AnyPublicKey, AnySignature } from \"./singleKey\";\n\n/* eslint-disable no-bitwise */\n\nfunction bitCount(byte: number) {\n let n = byte;\n n -= (n >> 1) & 0x55555555;\n n = (n & 0x33333333) + ((n >> 2) & 0x33333333);\n return (((n + (n >> 4)) & 0xf0f0f0f) * 0x1010101) >> 24;\n}\n\n/* eslint-enable no-bitwise */\n\n/**\n * Represents the public key of a multi-agent account.\n *\n * The public keys of each individual agent can be any type of public key supported by Aptos.\n * Since [AIP-55](https://github.com/aptos-foundation/AIPs/pull/263) Aptos supports\n * `Legacy` and `Unified` authentication keys.\n */\nexport class MultiKey extends AccountPublicKey {\n /**\n * List of any public keys\n */\n public readonly publicKeys: AnyPublicKey[];\n\n /**\n * The minimum number of valid signatures required, for the number of public keys specified\n */\n public readonly signaturesRequired: number;\n\n // region Constructors\n\n constructor(args: { publicKeys: Array<PublicKey>; signaturesRequired: number }) {\n super();\n const { publicKeys, signaturesRequired } = args;\n\n // Validate number of public keys is greater than signature required\n if (signaturesRequired < 1) {\n throw new Error(\"The number of required signatures needs to be greater than 0\");\n }\n\n // Validate number of public keys is greater than signature required\n if (publicKeys.length < signaturesRequired) {\n throw new Error(\n `Provided ${publicKeys.length} public keys is smaller than the ${signaturesRequired} required signatures`,\n );\n }\n\n // Make sure that all keys are normalized to the SingleKey authentication scheme\n this.publicKeys = publicKeys.map((publicKey) =>\n publicKey instanceof AnyPublicKey ? publicKey : new AnyPublicKey(publicKey),\n );\n\n this.signaturesRequired = signaturesRequired;\n }\n\n // endregion\n\n // region AccountPublicKey\n\n // eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars\n verifySignature(args: VerifySignatureArgs): boolean {\n throw new Error(\"not implemented\");\n }\n\n authKey(): AuthenticationKey {\n return AuthenticationKey.fromSchemeAndBytes({\n scheme: AuthenticationKeyScheme.MultiKey,\n input: this.toUint8Array(),\n });\n }\n\n toUint8Array(): Uint8Array {\n return this.bcsToBytes();\n }\n\n // endregion\n\n // region Serializable\n\n serialize(serializer: Serializer): void {\n serializer.serializeVector(this.publicKeys);\n serializer.serializeU8(this.signaturesRequired);\n }\n\n static deserialize(deserializer: Deserializer): MultiKey {\n const keys = deserializer.deserializeVector(AnyPublicKey);\n const signaturesRequired = deserializer.deserializeU8();\n\n return new MultiKey({ publicKeys: keys, signaturesRequired });\n }\n\n // endregion\n\n /**\n * Create a bitmap that holds the mapping from the original public keys\n * to the signatures passed in\n *\n * @param args.bits array of the index mapping to the matching public keys\n * @returns Uint8array bit map\n */\n createBitmap(args: { bits: number[] }): Uint8Array {\n const { bits } = args;\n // Bits are read from left to right. e.g. 0b10000000 represents the first bit is set in one byte.\n // The decimal value of 0b10000000 is 128.\n const firstBitInByte = 128;\n const bitmap = new Uint8Array([0, 0, 0, 0]);\n\n // Check if duplicates exist in bits\n const dupCheckSet = new Set();\n\n bits.forEach((bit: number, idx: number) => {\n if (idx + 1 > this.publicKeys.length) {\n throw new Error(`Signature index ${idx + 1} is out of public keys range, ${this.publicKeys.length}.`);\n }\n\n if (dupCheckSet.has(bit)) {\n throw new Error(`Duplicate bit ${bit} detected.`);\n }\n\n dupCheckSet.add(bit);\n\n const byteOffset = Math.floor(bit / 8);\n\n let byte = bitmap[byteOffset];\n\n // eslint-disable-next-line no-bitwise\n byte |= firstBitInByte >> bit % 8;\n\n bitmap[byteOffset] = byte;\n });\n\n return bitmap;\n }\n\n /**\n * Get the index of the provided public key.\n *\n * @param publicKey array of the index mapping to the matching public keys\n * @returns the corresponding index of the publicKey, if it exists\n */\n getIndex(publicKey: PublicKey): number {\n const anyPublicKey = publicKey instanceof AnyPublicKey ? publicKey : new AnyPublicKey(publicKey);\n const index = this.publicKeys.findIndex((pk) => pk.toString() === anyPublicKey.toString());\n\n if (index !== -1) {\n return index;\n }\n throw new Error(\"Public key not found in MultiKey\");\n }\n}\n\nexport class MultiKeySignature extends Signature {\n /**\n * Number of bytes in the bitmap representing who signed the transaction (32-bits)\n */\n static BITMAP_LEN: number = 4;\n\n /**\n * Maximum number of Ed25519 signatures supported\n */\n static MAX_SIGNATURES_SUPPORTED = MultiKeySignature.BITMAP_LEN * 8;\n\n /**\n * The list of underlying Ed25519 signatures\n */\n public readonly signatures: AnySignature[];\n\n /**\n * 32-bit Bitmap representing who signed the transaction\n *\n * This is represented where each public key can be masked to determine whether the message was signed by that key.\n */\n public readonly bitmap: Uint8Array;\n\n /**\n * Signature for a K-of-N multi-sig transaction.\n *\n * @see {@link\n * https://aptos.dev/integration/creating-a-signed-transaction/#multisignature-transactions | Creating a Signed Transaction}\n *\n * @param args.signatures A list of signatures\n * @param args.bitmap 4 bytes, at most 32 signatures are supported. If Nth bit value is `1`, the Nth\n * signature should be provided in `signatures`. Bits are read from left to right\n */\n constructor(args: { signatures: Array<Signature | AnySignature>; bitmap: Uint8Array | number[] }) {\n super();\n const { signatures, bitmap } = args;\n\n if (signatures.length > MultiKeySignature.MAX_SIGNATURES_SUPPORTED) {\n throw new Error(`The number of signatures cannot be greater than ${MultiKeySignature.MAX_SIGNATURES_SUPPORTED}`);\n }\n\n // Make sure that all signatures are normalized to the SingleKey authentication scheme\n this.signatures = signatures.map((signature) =>\n signature instanceof AnySignature ? signature : new AnySignature(signature),\n );\n\n if (!(bitmap instanceof Uint8Array)) {\n this.bitmap = MultiKeySignature.createBitmap({ bits: bitmap });\n } else if (bitmap.length !== MultiKeySignature.BITMAP_LEN) {\n throw new Error(`\"bitmap\" length should be ${MultiKeySignature.BITMAP_LEN}`);\n } else {\n this.bitmap = bitmap;\n }\n\n const nSignatures = this.bitmap.reduce((acc, byte) => acc + bitCount(byte), 0);\n if (nSignatures !== this.signatures.length) {\n throw new Error(`Expecting ${nSignatures} signatures from the bitmap, but got ${this.signatures.length}`);\n }\n }\n\n /**\n * Helper method to create a bitmap out of the specified bit positions\n * @param args.bits The bitmap positions that should be set. A position starts at index 0.\n * Valid position should range between 0 and 31.\n * @example\n * Here's an example of valid `bits`\n * ```\n * [0, 2, 31]\n * ```\n * `[0, 2, 31]` means the 1st, 3rd and 32nd bits should be set in the bitmap.\n * The result bitmap should be 0b1010000000000000000000000000001\n *\n * @returns bitmap that is 32bit long\n */\n static createBitmap(args: { bits: number[] }): Uint8Array {\n const { bits } = args;\n // Bits are read from left to right. e.g. 0b10000000 represents the first bit is set in one byte.\n // The decimal value of 0b10000000 is 128.\n const firstBitInByte = 128;\n const bitmap = new Uint8Array([0, 0, 0, 0]);\n\n // Check if duplicates exist in bits\n const dupCheckSet = new Set();\n\n bits.forEach((bit: number) => {\n if (bit >= MultiKeySignature.MAX_SIGNATURES_SUPPORTED) {\n throw new Error(`Cannot have a signature larger than ${MultiKeySignature.MAX_SIGNATURES_SUPPORTED - 1}.`);\n }\n\n if (dupCheckSet.has(bit)) {\n throw new Error(\"Duplicate bits detected.\");\n }\n\n dupCheckSet.add(bit);\n\n const byteOffset = Math.floor(bit / 8);\n\n let byte = bitmap[byteOffset];\n\n // eslint-disable-next-line no-bitwise\n byte |= firstBitInByte >> bit % 8;\n\n bitmap[byteOffset] = byte;\n });\n\n return bitmap;\n }\n\n // region Signature\n\n toUint8Array(): Uint8Array {\n return this.bcsToBytes();\n }\n\n // endregion\n\n // region Serializable\n\n serialize(serializer: Serializer): void {\n // Note: we should not need to serialize the vector length, as it can be derived from the bitmap\n serializer.serializeVector(this.signatures);\n serializer.serializeBytes(this.bitmap);\n }\n\n static deserialize(deserializer: Deserializer): MultiKeySignature {\n const signatures = deserializer.deserializeVector(AnySignature);\n const bitmap = deserializer.deserializeBytes();\n return new MultiKeySignature({ signatures, bitmap });\n }\n\n // endregion\n}\n"],"mappings":"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","names":["bitCount","byte","n","MultiKey","_MultiKey","AccountPublicKey","args","publicKeys","signaturesRequired","publicKey","AnyPublicKey","AuthenticationKey","serializer","deserializer","keys","bits","firstBitInByte","bitmap","dupCheckSet","bit","idx","byteOffset","anyPublicKey","index","pk","_MultiKeySignature","Signature","signatures","signature","AnySignature","nSignatures","acc","MultiKeySignature"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,c}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as n,c as s}from"./chunk-SGTNW5YI.mjs";import{a,c}from"./chunk-I6ST47U7.mjs";import{a as y}from"./chunk-UGPALAPN.mjs";import{b as l}from"./chunk-4NHWV5AI.mjs";import{a as u}from"./chunk-5EN52MUT.mjs";var b=class t extends l{constructor(e){if(super(),this.publicKey=e,e instanceof n)this.variant=0;else if(e instanceof a)this.variant=1;else throw new Error("Unsupported public key type")}verifySignature(e){let{message:r,signature:i}=e;return i instanceof o?this.publicKey.verifySignature({message:r,signature:i.signature}):!1}authKey(){return u.fromSchemeAndBytes({scheme:2,input:this.toUint8Array()})}toUint8Array(){return this.bcsToBytes()}serialize(e){e.serializeU32AsUleb128(this.variant),this.publicKey.serialize(e)}static deserialize(e){let r=e.deserializeUleb128AsU32(),i;switch(r){case 0:i=n.deserialize(e);break;case 1:i=a.deserialize(e);break;default:throw new Error(`Unknown variant index for AnyPublicKey: ${r}`)}return new t(i)}static isPublicKey(e){return e instanceof t}isEd25519(){return this.publicKey instanceof n}isSecp256k1PublicKey(){return this.publicKey instanceof a}},o=class t extends y{constructor(e){if(super(),this.signature=e,e instanceof s)this.variant=0;else if(e instanceof c)this.variant=1;else throw new Error("Unsupported signature type")}toUint8Array(){return this.bcsToBytes()}serialize(e){e.serializeU32AsUleb128(this.variant),this.signature.serialize(e)}static deserialize(e){let r=e.deserializeUleb128AsU32(),i;switch(r){case 0:i=s.deserialize(e);break;case 1:i=c.deserialize(e);break;default:throw new Error(`Unknown variant index for AnySignature: ${r}`)}return new t(i)}};export{b as a,o as b};
|
|
2
|
+
//# sourceMappingURL=chunk-KNSIJJS3.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/crypto/singleKey.ts"],"sourcesContent":["import { Deserializer, Serializer } from \"../../bcs\";\nimport { AnyPublicKeyVariant, AnySignatureVariant, SigningScheme as AuthenticationKeyScheme } from \"../../types\";\nimport { AuthenticationKey } from \"../authenticationKey\";\nimport { Ed25519PublicKey, Ed25519Signature } from \"./ed25519\";\nimport { AccountPublicKey, PublicKey, VerifySignatureArgs } from \"./publicKey\";\nimport { Secp256k1PublicKey, Secp256k1Signature } from \"./secp256k1\";\nimport { Signature } from \"./signature\";\n\n/**\n * Represents any public key supported by Aptos.\n *\n * Since [AIP-55](https://github.com/aptos-foundation/AIPs/pull/263) Aptos supports\n * `Legacy` and `Unified` authentication keys.\n *\n * Any unified authentication key is represented in the SDK as `AnyPublicKey`.\n */\nexport class AnyPublicKey extends AccountPublicKey {\n /**\n * Reference to the inner public key\n */\n public readonly publicKey: PublicKey;\n\n /**\n * Index of the underlying enum variant\n */\n public readonly variant: AnyPublicKeyVariant;\n\n // region Constructors\n\n constructor(publicKey: PublicKey) {\n super();\n this.publicKey = publicKey;\n if (publicKey instanceof Ed25519PublicKey) {\n this.variant = AnyPublicKeyVariant.Ed25519;\n } else if (publicKey instanceof Secp256k1PublicKey) {\n this.variant = AnyPublicKeyVariant.Secp256k1;\n } else {\n throw new Error(\"Unsupported public key type\");\n }\n }\n\n // endregion\n\n // region AccountPublicKey\n\n verifySignature(args: VerifySignatureArgs): boolean {\n const { message, signature } = args;\n if (!(signature instanceof AnySignature)) {\n return false;\n }\n\n return this.publicKey.verifySignature({\n message,\n signature: signature.signature,\n });\n }\n\n authKey(): AuthenticationKey {\n return AuthenticationKey.fromSchemeAndBytes({\n scheme: AuthenticationKeyScheme.SingleKey,\n input: this.toUint8Array(),\n });\n }\n\n toUint8Array() {\n return this.bcsToBytes();\n }\n\n // endregion\n\n // region Serializable\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(this.variant);\n this.publicKey.serialize(serializer);\n }\n\n static deserialize(deserializer: Deserializer): AnyPublicKey {\n const variantIndex = deserializer.deserializeUleb128AsU32();\n let publicKey: PublicKey;\n switch (variantIndex) {\n case AnyPublicKeyVariant.Ed25519:\n publicKey = Ed25519PublicKey.deserialize(deserializer);\n break;\n case AnyPublicKeyVariant.Secp256k1:\n publicKey = Secp256k1PublicKey.deserialize(deserializer);\n break;\n default:\n throw new Error(`Unknown variant index for AnyPublicKey: ${variantIndex}`);\n }\n return new AnyPublicKey(publicKey);\n }\n\n // endregion\n\n /**\n * @deprecated use `instanceof AnyPublicKey` instead.\n */\n static isPublicKey(publicKey: AccountPublicKey): publicKey is AnyPublicKey {\n return publicKey instanceof AnyPublicKey;\n }\n\n /**\n * @deprecated use `publicKey instanceof Ed25519PublicKey` instead.\n */\n isEd25519(): boolean {\n return this.publicKey instanceof Ed25519PublicKey;\n }\n\n /**\n * @deprecated use `publicKey instanceof Secp256k1PublicKey` instead.\n */\n isSecp256k1PublicKey(): boolean {\n return this.publicKey instanceof Secp256k1PublicKey;\n }\n}\n\n/**\n * Instance of signature that uses the SingleKey authentication scheme.\n * This signature can only be generated by a `SingleKeySigner`, since it uses the\n * same authentication scheme.\n */\nexport class AnySignature extends Signature {\n public readonly signature: Signature;\n\n /**\n * Index of the underlying enum variant\n */\n private readonly variant: AnySignatureVariant;\n\n // region Constructors\n\n constructor(signature: Signature) {\n super();\n this.signature = signature;\n\n if (signature instanceof Ed25519Signature) {\n this.variant = AnySignatureVariant.Ed25519;\n } else if (signature instanceof Secp256k1Signature) {\n this.variant = AnySignatureVariant.Secp256k1;\n } else {\n throw new Error(\"Unsupported signature type\");\n }\n }\n\n // endregion\n\n // region AccountSignature\n\n toUint8Array() {\n return this.bcsToBytes();\n }\n\n // endregion\n\n // region Serializable\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(this.variant);\n this.signature.serialize(serializer);\n }\n\n static deserialize(deserializer: Deserializer): AnySignature {\n const variantIndex = deserializer.deserializeUleb128AsU32();\n let signature: Signature;\n switch (variantIndex) {\n case AnySignatureVariant.Ed25519:\n signature = Ed25519Signature.deserialize(deserializer);\n break;\n case AnySignatureVariant.Secp256k1:\n signature = Secp256k1Signature.deserialize(deserializer);\n break;\n default:\n throw new Error(`Unknown variant index for AnySignature: ${variantIndex}`);\n }\n return new AnySignature(signature);\n }\n\n // endregion\n}\n"],"mappings":"iNAgBO,IAAMA,EAAN,MAAMC,UAAqBC,CAAiB,CAajD,YAAYC,EAAsB,
|
|
1
|
+
{"version":3,"sources":["../../src/core/crypto/singleKey.ts"],"sourcesContent":["import { Deserializer, Serializer } from \"../../bcs\";\nimport { AnyPublicKeyVariant, AnySignatureVariant, SigningScheme as AuthenticationKeyScheme } from \"../../types\";\nimport { AuthenticationKey } from \"../authenticationKey\";\nimport { Ed25519PublicKey, Ed25519Signature } from \"./ed25519\";\nimport { AccountPublicKey, PublicKey, VerifySignatureArgs } from \"./publicKey\";\nimport { Secp256k1PublicKey, Secp256k1Signature } from \"./secp256k1\";\nimport { Signature } from \"./signature\";\n\n/**\n * Represents any public key supported by Aptos.\n *\n * Since [AIP-55](https://github.com/aptos-foundation/AIPs/pull/263) Aptos supports\n * `Legacy` and `Unified` authentication keys.\n *\n * Any unified authentication key is represented in the SDK as `AnyPublicKey`.\n */\nexport class AnyPublicKey extends AccountPublicKey {\n /**\n * Reference to the inner public key\n */\n public readonly publicKey: PublicKey;\n\n /**\n * Index of the underlying enum variant\n */\n public readonly variant: AnyPublicKeyVariant;\n\n // region Constructors\n\n constructor(publicKey: PublicKey) {\n super();\n this.publicKey = publicKey;\n if (publicKey instanceof Ed25519PublicKey) {\n this.variant = AnyPublicKeyVariant.Ed25519;\n } else if (publicKey instanceof Secp256k1PublicKey) {\n this.variant = AnyPublicKeyVariant.Secp256k1;\n } else {\n throw new Error(\"Unsupported public key type\");\n }\n }\n\n // endregion\n\n // region AccountPublicKey\n\n verifySignature(args: VerifySignatureArgs): boolean {\n const { message, signature } = args;\n if (!(signature instanceof AnySignature)) {\n return false;\n }\n\n return this.publicKey.verifySignature({\n message,\n signature: signature.signature,\n });\n }\n\n authKey(): AuthenticationKey {\n return AuthenticationKey.fromSchemeAndBytes({\n scheme: AuthenticationKeyScheme.SingleKey,\n input: this.toUint8Array(),\n });\n }\n\n toUint8Array() {\n return this.bcsToBytes();\n }\n\n // endregion\n\n // region Serializable\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(this.variant);\n this.publicKey.serialize(serializer);\n }\n\n static deserialize(deserializer: Deserializer): AnyPublicKey {\n const variantIndex = deserializer.deserializeUleb128AsU32();\n let publicKey: PublicKey;\n switch (variantIndex) {\n case AnyPublicKeyVariant.Ed25519:\n publicKey = Ed25519PublicKey.deserialize(deserializer);\n break;\n case AnyPublicKeyVariant.Secp256k1:\n publicKey = Secp256k1PublicKey.deserialize(deserializer);\n break;\n default:\n throw new Error(`Unknown variant index for AnyPublicKey: ${variantIndex}`);\n }\n return new AnyPublicKey(publicKey);\n }\n\n // endregion\n\n /**\n * @deprecated use `instanceof AnyPublicKey` instead.\n */\n static isPublicKey(publicKey: AccountPublicKey): publicKey is AnyPublicKey {\n return publicKey instanceof AnyPublicKey;\n }\n\n /**\n * @deprecated use `publicKey instanceof Ed25519PublicKey` instead.\n */\n isEd25519(): boolean {\n return this.publicKey instanceof Ed25519PublicKey;\n }\n\n /**\n * @deprecated use `publicKey instanceof Secp256k1PublicKey` instead.\n */\n isSecp256k1PublicKey(): boolean {\n return this.publicKey instanceof Secp256k1PublicKey;\n }\n}\n\n/**\n * Instance of signature that uses the SingleKey authentication scheme.\n * This signature can only be generated by a `SingleKeySigner`, since it uses the\n * same authentication scheme.\n */\nexport class AnySignature extends Signature {\n public readonly signature: Signature;\n\n /**\n * Index of the underlying enum variant\n */\n private readonly variant: AnySignatureVariant;\n\n // region Constructors\n\n constructor(signature: Signature) {\n super();\n this.signature = signature;\n\n if (signature instanceof Ed25519Signature) {\n this.variant = AnySignatureVariant.Ed25519;\n } else if (signature instanceof Secp256k1Signature) {\n this.variant = AnySignatureVariant.Secp256k1;\n } else {\n throw new Error(\"Unsupported signature type\");\n }\n }\n\n // endregion\n\n // region AccountSignature\n\n toUint8Array() {\n return this.bcsToBytes();\n }\n\n // endregion\n\n // region Serializable\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(this.variant);\n this.signature.serialize(serializer);\n }\n\n static deserialize(deserializer: Deserializer): AnySignature {\n const variantIndex = deserializer.deserializeUleb128AsU32();\n let signature: Signature;\n switch (variantIndex) {\n case AnySignatureVariant.Ed25519:\n signature = Ed25519Signature.deserialize(deserializer);\n break;\n case AnySignatureVariant.Secp256k1:\n signature = Secp256k1Signature.deserialize(deserializer);\n break;\n default:\n throw new Error(`Unknown variant index for AnySignature: ${variantIndex}`);\n }\n return new AnySignature(signature);\n }\n\n // endregion\n}\n"],"mappings":"iNAgBO,IAAMA,EAAN,MAAMC,UAAqBC,CAAiB,CAajD,YAAYC,EAAsB,CAGhC,GAFA,MAAM,EACN,KAAK,UAAYA,EACbA,aAAqBC,EACvB,KAAK,QAAU,UACND,aAAqBE,EAC9B,KAAK,QAAU,MAEf,OAAM,IAAI,MAAM,6BAA6B,CAEjD,CAMA,gBAAgBC,EAAoC,CAClD,GAAM,CAAE,QAAAC,EAAS,UAAAC,CAAU,EAAIF,EAC/B,OAAME,aAAqBC,EAIpB,KAAK,UAAU,gBAAgB,CACpC,QAAAF,EACA,UAAWC,EAAU,SACvB,CAAC,EANQ,EAOX,CAEA,SAA6B,CAC3B,OAAOE,EAAkB,mBAAmB,CAC1C,SACA,MAAO,KAAK,aAAa,CAC3B,CAAC,CACH,CAEA,cAAe,CACb,OAAO,KAAK,WAAW,CACzB,CAMA,UAAUC,EAA8B,CACtCA,EAAW,sBAAsB,KAAK,OAAO,EAC7C,KAAK,UAAU,UAAUA,CAAU,CACrC,CAEA,OAAO,YAAYC,EAA0C,CAC3D,IAAMC,EAAeD,EAAa,wBAAwB,EACtDT,EACJ,OAAQU,EAAc,CACpB,OACEV,EAAYC,EAAiB,YAAYQ,CAAY,EACrD,MACF,OACET,EAAYE,EAAmB,YAAYO,CAAY,EACvD,MACF,QACE,MAAM,IAAI,MAAM,2CAA2CC,CAAY,EAAE,CAC7E,CACA,OAAO,IAAIZ,EAAaE,CAAS,CACnC,CAOA,OAAO,YAAYA,EAAwD,CACzE,OAAOA,aAAqBF,CAC9B,CAKA,WAAqB,CACnB,OAAO,KAAK,qBAAqBG,CACnC,CAKA,sBAAgC,CAC9B,OAAO,KAAK,qBAAqBC,CACnC,CACF,EAOaI,EAAN,MAAMK,UAAqBC,CAAU,CAU1C,YAAYP,EAAsB,CAIhC,GAHA,MAAM,EACN,KAAK,UAAYA,EAEbA,aAAqBQ,EACvB,KAAK,QAAU,UACNR,aAAqBS,EAC9B,KAAK,QAAU,MAEf,OAAM,IAAI,MAAM,4BAA4B,CAEhD,CAMA,cAAe,CACb,OAAO,KAAK,WAAW,CACzB,CAMA,UAAUN,EAA8B,CACtCA,EAAW,sBAAsB,KAAK,OAAO,EAC7C,KAAK,UAAU,UAAUA,CAAU,CACrC,CAEA,OAAO,YAAYC,EAA0C,CAC3D,IAAMC,EAAeD,EAAa,wBAAwB,EACtDJ,EACJ,OAAQK,EAAc,CACpB,OACEL,EAAYQ,EAAiB,YAAYJ,CAAY,EACrD,MACF,OACEJ,EAAYS,EAAmB,YAAYL,CAAY,EACvD,MACF,QACE,MAAM,IAAI,MAAM,2CAA2CC,CAAY,EAAE,CAC7E,CACA,OAAO,IAAIC,EAAaN,CAAS,CACnC,CAGF","names":["AnyPublicKey","_AnyPublicKey","AccountPublicKey","publicKey","Ed25519PublicKey","Secp256k1PublicKey","args","message","signature","AnySignature","AuthenticationKey","serializer","deserializer","variantIndex","_AnySignature","Signature","Ed25519Signature","Secp256k1Signature"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as h}from"./chunk-3JPVQHOR.mjs";import{a as R}from"./chunk-AH44UPM4.mjs";import{
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as h}from"./chunk-3JPVQHOR.mjs";import{a as R}from"./chunk-AH44UPM4.mjs";import{g as x,h as P}from"./chunk-2ZGHK5BB.mjs";import{b as c,c as A}from"./chunk-S2VSJJRJ.mjs";import{a as C}from"./chunk-GHYE26Q5.mjs";import{d as w}from"./chunk-CYNQRMO5.mjs";async function v(o){let{aptosConfig:n,options:t}=o;return A({aptosConfig:n,originMethod:"getTransactions",path:"transactions",params:{start:t?.offset,limit:t?.limit}})}async function D(o){let{aptosConfig:n}=o;return R(async()=>{let{data:t}=await c({aptosConfig:n,originMethod:"getGasPriceEstimation",path:"estimate_gas_price"});return t},`gas-price-${n.network}`,1e3*60*5)()}async function N(o){let{aptosConfig:n,ledgerVersion:t}=o,{data:s}=await c({aptosConfig:n,originMethod:"getTransactionByVersion",path:`transactions/by_version/${t}`});return s}async function T(o){let{aptosConfig:n,transactionHash:t}=o,{data:s}=await c({aptosConfig:n,path:`transactions/by_hash/${t}`,originMethod:"getTransactionByHash"});return s}async function G(o){let{aptosConfig:n,transactionHash:t}=o;try{return(await T({aptosConfig:n,transactionHash:t})).type==="pending_transaction"}catch(s){if(s?.status===404)return!0;throw s}}async function b(o){let{aptosConfig:n,transactionHash:t}=o,{data:s}=await c({aptosConfig:n,path:`transactions/wait_by_hash/${t}`,originMethod:"longWaitForTransaction"});return s}async function W(o){let{aptosConfig:n,transactionHash:t,options:s}=o,r=s?.timeoutSecs??20,u=s?.checkSuccess??!0,a=!0,p=0,e,g,m=200,E=1.5;function d(i){if(!(i instanceof C)||(g=i,i.status!==404&&i.status>=400&&i.status<500))throw i}try{e=await T({aptosConfig:n,transactionHash:t}),a=e.type==="pending_transaction"}catch(i){d(i)}if(a){let i=Date.now();try{e=await b({aptosConfig:n,transactionHash:t}),a=e.type==="pending_transaction"}catch(l){d(l)}p=(Date.now()-i)/1e3}for(;a&&!(p>=r);){try{if(e=await T({aptosConfig:n,transactionHash:t}),a=e.type==="pending_transaction",!a)break}catch(i){d(i)}await h(m),p+=m/1e3,m*=E}if(e===void 0)throw g||new f(`Fetching transaction ${t} failed and timed out after ${r} seconds`,e);if(e.type==="pending_transaction")throw new f(`Transaction ${t} timed out in pending state after ${r} seconds`,e);if(!u)return e;if(!e.success)throw new y(`Transaction ${t} failed with an error: ${e.vm_status}`,e);return e}async function O(o){let{aptosConfig:n,processorType:t}=o,s=BigInt(o.minimumLedgerVersion),r=3e3,u=new Date().getTime(),a=BigInt(-1);for(;a<s;){if(new Date().getTime()-u>r)throw new Error("waitForLastSuccessIndexerVersionSync timeout");if(t===void 0?a=await x({aptosConfig:n}):a=(await P({aptosConfig:n,processorType:t})).last_success_version,a>=s)break;await h(200)}}var f=class extends Error{constructor(n,t){super(n),this.lastSubmittedTransaction=t}},y=class extends Error{constructor(n,t){super(n),this.transaction=t}};export{v as a,D as b,N as c,T as d,G as e,b as f,W as g,O as h,f as i,y as j};
|
|
2
|
+
//# sourceMappingURL=chunk-L5KHEQW5.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as l}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as l}from"./chunk-7T77PZGU.mjs";import{a as o,b as c}from"./chunk-U6Z4FNB7.mjs";import{a as h,h as d}from"./chunk-3W3BU5BL.mjs";import{g as u}from"./chunk-L5KHEQW5.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-MI73LIB3.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/transactions/management/transactionWorker.ts"],"sourcesContent":["/* eslint-disable no-await-in-loop */\n\nimport EventEmitter from \"eventemitter3\";\nimport { AptosConfig } from \"../../api/aptosConfig\";\nimport { Account } from \"../../account\";\nimport { waitForTransaction } from \"../../internal/transaction\";\nimport { generateTransaction, signAndSubmitTransaction } from \"../../internal/transactionSubmission\";\nimport { PendingTransactionResponse, TransactionResponse } from \"../../types\";\nimport { InputGenerateTransactionOptions, InputGenerateTransactionPayloadData } from \"../types\";\nimport { AccountSequenceNumber } from \"./accountSequenceNumber\";\nimport { AsyncQueue, AsyncQueueCancelledError } from \"./asyncQueue\";\nimport { SimpleTransaction } from \"../instances/simpleTransaction\";\n\nexport const promiseFulfilledStatus = \"fulfilled\";\n\n// Event types the worker fires during execution and\n// the dapp can listen to\nexport enum TransactionWorkerEventsEnum {\n // fired after a transaction gets sent to the chain\n TransactionSent = \"transactionSent\",\n // fired if there is an error sending the transaction to the chain\n TransactionSendFailed = \"transactionSendFailed\",\n // fired when a single transaction has executed successfully\n TransactionExecuted = \"transactionExecuted\",\n // fired if a single transaction fails in execution\n TransactionExecutionFailed = \"transactionExecutionFailed\",\n // fired when the worker has finished its job / when the queue has been emptied\n ExecutionFinish = \"executionFinish\",\n}\n\n// Typed interface of the worker events\nexport interface TransactionWorkerEvents {\n transactionSent: (data: SuccessEventData) => void;\n transactionSendFailed: (data: FailureEventData) => void;\n transactionExecuted: (data: SuccessEventData) => void;\n transactionExecutionFailed: (data: FailureEventData) => void;\n executionFinish: (data: ExecutionFinishEventData) => void;\n}\n\n// Type for when the worker has finished its job\nexport type ExecutionFinishEventData = {\n message: string;\n};\n\n// Type for a success event\nexport type SuccessEventData = {\n message: string;\n transactionHash: string;\n};\n\n// Type for a failure event\nexport type FailureEventData = {\n message: string;\n error: string;\n};\n\n/**\n * TransactionWorker provides a simple framework for receiving payloads to be processed.\n *\n * Once one `start()` the process and pushes a new transaction, the worker acquires\n * the current account's next sequence number (by using the AccountSequenceNumber class),\n * generates a signed transaction and pushes an async submission process into the `outstandingTransactions` queue.\n * At the same time, the worker processes transactions by reading the `outstandingTransactions` queue\n * and submits the next transaction to chain, it\n * 1) waits for resolution of the submission process or get pre-execution validation error\n * and 2) waits for the resolution of the execution process or get an execution error.\n * The worker fires events for any submission and/or execution success and/or failure.\n */\nexport class TransactionWorker extends EventEmitter<TransactionWorkerEvents> {\n readonly aptosConfig: AptosConfig;\n\n readonly account: Account;\n\n // current account sequence number\n readonly accountSequnceNumber: AccountSequenceNumber;\n\n readonly taskQueue: AsyncQueue<() => Promise<void>> = new AsyncQueue<() => Promise<void>>();\n\n // process has started\n started: boolean;\n\n /**\n * transactions payloads waiting to be generated and signed\n *\n * TODO support entry function payload from ABI builder\n */\n transactionsQueue = new AsyncQueue<\n [InputGenerateTransactionPayloadData, InputGenerateTransactionOptions | undefined]\n >();\n\n /**\n * signed transactions waiting to be submitted\n */\n outstandingTransactions = new AsyncQueue<[Promise<PendingTransactionResponse>, bigint]>();\n\n /**\n * transactions that have been submitted to chain\n */\n sentTransactions: Array<[string, bigint, any]> = [];\n\n /**\n * transactions that have been committed to chain\n */\n executedTransactions: Array<[string, bigint, any]> = [];\n\n /**\n * Provides a simple framework for receiving payloads to be processed.\n *\n * @param aptosConfig - a config object\n * @param sender - a sender as Account\n * @param maxWaitTime - the max wait time to wait before resyncing the sequence number\n * to the current on-chain state, default to 30\n * @param maximumInFlight - submit up to `maximumInFlight` transactions per account.\n * Mempool limits the number of transactions per account to 100, hence why we default to 100.\n * @param sleepTime - If `maximumInFlight` are in flight, wait `sleepTime` seconds before re-evaluating, default to 10\n */\n constructor(\n aptosConfig: AptosConfig,\n account: Account,\n maxWaitTime: number = 30,\n maximumInFlight: number = 100,\n sleepTime: number = 10,\n ) {\n super();\n this.aptosConfig = aptosConfig;\n this.account = account;\n this.started = false;\n this.accountSequnceNumber = new AccountSequenceNumber(\n aptosConfig,\n account,\n maxWaitTime,\n maximumInFlight,\n sleepTime,\n );\n }\n\n /**\n * Gets the current account sequence number,\n * generates the transaction with the account sequence number,\n * adds the transaction to the outstanding transaction queue\n * to be processed later.\n */\n async submitNextTransaction() {\n try {\n /* eslint-disable no-constant-condition */\n while (true) {\n const sequenceNumber = await this.accountSequnceNumber.nextSequenceNumber();\n if (sequenceNumber === null) return;\n const transaction = await this.generateNextTransaction(this.account, sequenceNumber);\n if (!transaction) return;\n const pendingTransaction = signAndSubmitTransaction({\n aptosConfig: this.aptosConfig,\n transaction,\n signer: this.account,\n });\n await this.outstandingTransactions.enqueue([pendingTransaction, sequenceNumber]);\n }\n } catch (error: any) {\n if (error instanceof AsyncQueueCancelledError) {\n return;\n }\n throw new Error(`Submit transaction failed for ${this.account.accountAddress.toString()} with error ${error}`);\n }\n }\n\n /**\n * Reads the outstanding transaction queue and submits the transaction to chain.\n *\n * If the transaction has fulfilled, it pushes the transaction to the processed\n * transactions queue and fires a transactionsFulfilled event.\n *\n * If the transaction has failed, it pushes the transaction to the processed\n * transactions queue with the failure reason and fires a transactionsFailed event.\n */\n async processTransactions() {\n try {\n /* eslint-disable no-constant-condition */\n while (true) {\n const awaitingTransactions = [];\n const sequenceNumbers = [];\n let [pendingTransaction, sequenceNumber] = await this.outstandingTransactions.dequeue();\n\n awaitingTransactions.push(pendingTransaction);\n sequenceNumbers.push(sequenceNumber);\n\n while (!this.outstandingTransactions.isEmpty()) {\n [pendingTransaction, sequenceNumber] = await this.outstandingTransactions.dequeue();\n\n awaitingTransactions.push(pendingTransaction);\n sequenceNumbers.push(sequenceNumber);\n }\n // send awaiting transactions to chain\n const sentTransactions = await Promise.allSettled(awaitingTransactions);\n for (let i = 0; i < sentTransactions.length && i < sequenceNumbers.length; i += 1) {\n // check sent transaction status\n const sentTransaction = sentTransactions[i];\n sequenceNumber = sequenceNumbers[i];\n if (sentTransaction.status === promiseFulfilledStatus) {\n // transaction sent to chain\n this.sentTransactions.push([sentTransaction.value.hash, sequenceNumber, null]);\n // check sent transaction execution\n this.emit(TransactionWorkerEventsEnum.TransactionSent, {\n message: `transaction hash ${sentTransaction.value.hash} has been committed to chain`,\n transactionHash: sentTransaction.value.hash,\n });\n await this.checkTransaction(sentTransaction, sequenceNumber);\n } else {\n // send transaction failed\n this.sentTransactions.push([sentTransaction.status, sequenceNumber, sentTransaction.reason]);\n this.emit(TransactionWorkerEventsEnum.TransactionSendFailed, {\n message: `failed to commit transaction ${this.sentTransactions.length} with error ${sentTransaction.reason}`,\n error: sentTransaction.reason,\n });\n }\n }\n this.emit(TransactionWorkerEventsEnum.ExecutionFinish, {\n message: `execute ${sentTransactions.length} transactions finished`,\n });\n }\n } catch (error: any) {\n if (error instanceof AsyncQueueCancelledError) {\n return;\n }\n throw new Error(`Process execution failed for ${this.account.accountAddress.toString()} with error ${error}`);\n }\n }\n\n /**\n * Once transaction has been sent to chain, we check for its execution status.\n * @param sentTransaction transactions that were sent to chain and are now waiting to be executed\n * @param sequenceNumber the account's sequence number that was sent with the transaction\n */\n async checkTransaction(sentTransaction: PromiseFulfilledResult<PendingTransactionResponse>, sequenceNumber: bigint) {\n try {\n const waitFor: Array<Promise<TransactionResponse>> = [];\n waitFor.push(waitForTransaction({ aptosConfig: this.aptosConfig, transactionHash: sentTransaction.value.hash }));\n const sentTransactions = await Promise.allSettled(waitFor);\n\n for (let i = 0; i < sentTransactions.length; i += 1) {\n const executedTransaction = sentTransactions[i];\n if (executedTransaction.status === promiseFulfilledStatus) {\n // transaction executed to chain\n this.executedTransactions.push([executedTransaction.value.hash, sequenceNumber, null]);\n this.emit(TransactionWorkerEventsEnum.TransactionExecuted, {\n message: `transaction hash ${executedTransaction.value.hash} has been executed on chain`,\n transactionHash: sentTransaction.value.hash,\n });\n } else {\n // transaction execution failed\n this.executedTransactions.push([executedTransaction.status, sequenceNumber, executedTransaction.reason]);\n this.emit(TransactionWorkerEventsEnum.TransactionExecutionFailed, {\n message: `failed to execute transaction ${this.executedTransactions.length} with error ${executedTransaction.reason}`,\n error: executedTransaction.reason,\n });\n }\n }\n } catch (error: any) {\n throw new Error(`Check transaction failed for ${this.account.accountAddress.toString()} with error ${error}`);\n }\n }\n\n /**\n * Push transaction to the transactions queue\n *\n * @param transactionData Transaction payload\n * @param transactionData.abi For all entry function payloads, the ABI to skip remote ABI lookups\n * @param options.maxGasAmount Maximum gas amount for the transaction\n * @param options.gasUnitPrice Gas unit price for the transaction\n * @param options.expireTimestamp expiration timestamp on the transaction\n * @param options.accountSequenceNumber the sequence number for the transaction\n */\n async push(\n transactionData: InputGenerateTransactionPayloadData,\n options?: InputGenerateTransactionOptions,\n ): Promise<void> {\n this.transactionsQueue.enqueue([transactionData, options]);\n }\n\n /**\n * Generates a signed transaction that can be submitted to chain\n * @param account an Aptos account\n * @param sequenceNumber a sequence number the transaction will be generated with\n * @returns\n */\n async generateNextTransaction(account: Account, sequenceNumber: bigint): Promise<SimpleTransaction | undefined> {\n if (this.transactionsQueue.isEmpty()) return undefined;\n const [transactionData, options] = await this.transactionsQueue.dequeue();\n return generateTransaction({\n aptosConfig: this.aptosConfig,\n sender: account.accountAddress,\n data: transactionData,\n options: { ...options, accountSequenceNumber: sequenceNumber },\n });\n }\n\n /**\n * Starts transaction submission and transaction processing.\n */\n async run() {\n try {\n while (!this.taskQueue.isCancelled()) {\n const task = await this.taskQueue.dequeue();\n await task();\n }\n } catch (error: any) {\n throw new Error(`Unable to start transaction batching: ${error}`);\n }\n }\n\n /**\n * Starts the transaction management process.\n */\n start() {\n if (this.started) {\n throw new Error(\"worker has already started\");\n }\n this.started = true;\n this.taskQueue.enqueue(() => this.submitNextTransaction());\n this.taskQueue.enqueue(() => this.processTransactions());\n this.run();\n }\n\n /**\n * Stops the the transaction management process.\n */\n stop() {\n if (this.taskQueue.isCancelled()) {\n throw new Error(\"worker has already stopped\");\n }\n this.started = false;\n this.taskQueue.cancel();\n }\n}\n"],"mappings":"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","names":["EventEmitter","promiseFulfilledStatus","TransactionWorkerEventsEnum","TransactionWorker","EventEmitter","aptosConfig","account","maxWaitTime","maximumInFlight","sleepTime","AsyncQueue","AccountSequenceNumber","sequenceNumber","transaction","pendingTransaction","signAndSubmitTransaction","error","AsyncQueueCancelledError","awaitingTransactions","sequenceNumbers","sentTransactions","i","sentTransaction","waitFor","waitForTransaction","executedTransaction","transactionData","options","generateTransaction"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as l,c as f,d as x,e as v,f as U,g as A,h as P,i as C,j as y,k as E,l as b,m as I,n as G,o as M}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as l,c as f,d as x,e as v,f as U,g as A,h as P,i as C,j as y,k as E,l as b,m as I,n as G,o as M}from"./chunk-U3YYSIIT.mjs";import{a as d}from"./chunk-B7X6PSE7.mjs";import{b as w}from"./chunk-QRS4DGP3.mjs";function N(e){return!!e.match(/^[_a-zA-Z0-9]+$/)}function V(e){return!!e.match(/\s/)}function $(e){return!!e.match(/^T[0-9]+$/)}function F(e,n){let i=n;for(;i<e.length;i+=1){let c=e[i];if(!V(c))break}return i}var S=(t=>(t.InvalidTypeTag="unknown type",t.UnexpectedGenericType="unexpected generic type",t.UnexpectedTypeArgumentClose="unexpected '>'",t.UnexpectedWhitespaceCharacter="unexpected whitespace character",t.UnexpectedComma="unexpected ','",t.TypeArgumentCountMismatch="type argument count doesn't match expected amount",t.MissingTypeArgumentClose="no matching '>' for '<'",t.UnexpectedPrimitiveTypeArguments="primitive types not expected to have type arguments",t.UnexpectedVectorTypeArgumentCount="vector type expected to have exactly one type argument",t.UnexpectedStructFormat="unexpected struct format, must be of the form 0xaddress::module_name::struct_name",t.InvalidModuleNameCharacter="module name must only contain alphanumeric or '_' characters",t.InvalidStructNameCharacter="struct name must only contain alphanumeric or '_' characters",t))(S||{}),r=class extends Error{constructor(n,i){super(`Failed to parse typeTag '${n}', ${i}`)}};function Z(e,n){let i=n?.allowGenerics??!1,c=[],o=[],p=[],T=0,a="",u=1;for(;T<e.length;){let g=e[T];if(g==="<")c.push({savedExpectedTypes:u,savedStr:a,savedTypes:p}),a="",p=[],u=1;else if(g===">"){if(a!==""){let _=m(a,o,i);p.push(_)}let s=c.pop();if(s===void 0)throw new r(e,"unexpected '>'");if(u!==p.length)throw new r(e,"type argument count doesn't match expected amount");let{savedStr:h,savedTypes:t,savedExpectedTypes:W}=s;o=p,p=t,a=h,u=W}else if(g===","){if(a.length!==0){let s=m(a,o,i);o=[],p.push(s),a="",u+=1}}else if(V(g)){let s=!1;if(a.length!==0){let t=m(a,o,i);o=[],p.push(t),a="",s=!0}T=F(e,T);let h=e[T];if(T<e.length&&s&&h!==","&&h!==">")throw new r(e,"unexpected whitespace character");continue}else a+=g;T+=1}if(c.length>0)throw new r(e,"no matching '>' for '<'");switch(p.length){case 0:return m(a,o,i);case 1:if(a==="")return p[0];throw new r(e,"unexpected ','");default:throw new r(e,"unexpected whitespace character")}}function m(e,n,i){switch(e){case"&signer":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new E(new y);case"signer":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new y;case"bool":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new l;case"address":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new C;case"u8":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new f;case"u16":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new x;case"u32":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new v;case"u64":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new U;case"u128":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new A;case"u256":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new P;case"vector":if(n.length!==1)throw new r(e,"vector type expected to have exactly one type argument");return new I(n[0]);default:if($(e)){if(i)return new b(Number(e.split("T")[1]));throw new r(e,"unexpected generic type")}if(!e.match(/:/))throw new r(e,"unknown type");let c=e.split("::");if(c.length!==3)throw new r(e,"unexpected struct format, must be of the form 0xaddress::module_name::struct_name");if(!N(c[1]))throw new r(e,"module name must only contain alphanumeric or '_' characters");if(!N(c[2]))throw new r(e,"struct name must only contain alphanumeric or '_' characters");return new G(new M(w.fromString(c[0]),new d(c[1]),new d(c[2]),n))}}export{S as a,r as b,Z as c};
|
|
2
|
+
//# sourceMappingURL=chunk-MJPUASSD.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as d,b}from"./chunk-2O5VFH5O.mjs";import{a as h,b as z}from"./chunk-KLTQSLDY.mjs";import{a as p,b as g}from"./chunk-KNSIJJS3.mjs";import{a as o,c as y}from"./chunk-SGTNW5YI.mjs";import{a as c}from"./chunk-36QXVFR5.mjs";var r=class extends c{static deserialize(i){let e=i.deserializeUleb128AsU32();switch(e){case 0:return u.load(i);case 1:return l.load(i);case 2:return n.load(i);case 3:return a.load(i);default:throw new Error(`Unknown variant index for AccountAuthenticator: ${e}`)}}isEd25519(){return this instanceof u}isMultiEd25519(){return this instanceof l}isSingleKey(){return this instanceof n}isMultiKey(){return this instanceof a}},u=class t extends r{constructor(i,e){super(),this.public_key=i,this.signature=e}serialize(i){i.serializeU32AsUleb128(0),this.public_key.serialize(i),this.signature.serialize(i)}static load(i){let e=o.deserialize(i),s=y.deserialize(i);return new t(e,s)}},l=class t extends r{constructor(i,e){super(),this.public_key=i,this.signature=e}serialize(i){i.serializeU32AsUleb128(1),this.public_key.serialize(i),this.signature.serialize(i)}static load(i){let e=d.deserialize(i),s=b.deserialize(i);return new t(e,s)}},n=class t extends r{constructor(i,e){super(),this.public_key=i,this.signature=e}serialize(i){i.serializeU32AsUleb128(2),this.public_key.serialize(i),this.signature.serialize(i)}static load(i){let e=p.deserialize(i),s=g.deserialize(i);return new t(e,s)}},a=class t extends r{constructor(i,e){super(),this.public_keys=i,this.signatures=e}serialize(i){i.serializeU32AsUleb128(3),this.public_keys.serialize(i),this.signatures.serialize(i)}static load(i){let e=h.deserialize(i),s=z.deserialize(i);return new t(e,s)}};export{r as a,u as b,l as c,n as d,a as e};
|
|
2
|
+
//# sourceMappingURL=chunk-MVHGVOOC.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\nexport abstract class AccountAuthenticator extends Serializable {\n abstract serialize(serializer: Serializer): void;\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 default:\n throw new Error(`Unknown variant index for AccountAuthenticator: ${index}`);\n }\n }\n\n isEd25519(): this is AccountAuthenticatorEd25519 {\n return this instanceof AccountAuthenticatorEd25519;\n }\n\n isMultiEd25519(): this is AccountAuthenticatorMultiEd25519 {\n return this instanceof AccountAuthenticatorMultiEd25519;\n }\n\n isSingleKey(): this is AccountAuthenticatorSingleKey {\n return this instanceof AccountAuthenticatorSingleKey;\n }\n\n isMultiKey(): this is AccountAuthenticatorMultiKey {\n return this instanceof AccountAuthenticatorMultiKey;\n }\n}\n\n/**\n * Transaction authenticator Ed25519 for a multi signer transaction\n *\n * @param public_key Account's Ed25519 public key.\n * @param signature Account's Ed25519 signature\n *\n */\nexport class AccountAuthenticatorEd25519 extends AccountAuthenticator {\n public readonly public_key: Ed25519PublicKey;\n\n public readonly signature: Ed25519Signature;\n\n constructor(public_key: Ed25519PublicKey, signature: Ed25519Signature) {\n super();\n this.public_key = public_key;\n this.signature = signature;\n }\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 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 * Transaction authenticator Multi Ed25519 for a multi signers transaction\n *\n * @param public_key Account's MultiEd25519 public key.\n * @param signature Account's MultiEd25519 signature\n *\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 * AccountAuthenticatorSingleKey for a single signer\n *\n * @param public_key AnyPublicKey\n * @param signature AnySignature\n *\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 * AccountAuthenticatorMultiKey for a multi signer\n *\n * @param public_keys MultiKey\n * @param signatures Signature\n *\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"],"mappings":"oOAYO,IAAeA,EAAf,cAA4CC,CAAa,CAG9D,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,QACE,MAAM,IAAI,MAAM,mDAAmDC,CAAK,EAAE,CAC9E,CACF,CAEA,WAAiD,CAC/C,OAAO,gBAAgBC,CACzB,CAEA,gBAA2D,CACzD,OAAO,gBAAgBC,CACzB,CAEA,aAAqD,CACnD,OAAO,gBAAgBC,CACzB,CAEA,YAAmD,CACjD,OAAO,gBAAgBC,CACzB,CACF,EASaH,EAAN,MAAMI,UAAoCR,CAAqB,CAKpE,YAAYS,EAA8BC,EAA6B,CACrE,MAAM,EACN,KAAK,WAAaD,EAClB,KAAK,UAAYC,CACnB,CAEA,UAAUC,EAA8B,CACtCA,EAAW,uBAAyD,EACpE,KAAK,WAAW,UAAUA,CAAU,EACpC,KAAK,UAAU,UAAUA,CAAU,CACrC,CAEA,OAAO,KAAKT,EAAyD,CACnE,IAAMO,EAAaG,EAAiB,YAAYV,CAAY,EACtDQ,EAAYG,EAAiB,YAAYX,CAAY,EAC3D,OAAO,IAAIM,EAA4BC,EAAYC,CAAS,CAC9D,CACF,EASaL,EAAN,MAAMS,UAAyCd,CAAqB,CAKzE,YAAYS,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,KAAKT,EAA8D,CACxE,IAAMO,EAAaM,EAAsB,YAAYb,CAAY,EAC3DQ,EAAYM,EAAsB,YAAYd,CAAY,EAChE,OAAO,IAAIY,EAAiCL,EAAYC,CAAS,CACnE,CACF,EASaJ,EAAN,MAAMW,UAAsCjB,CAAqB,CAKtE,YAAYS,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,KAAKT,EAA2D,CACrE,IAAMO,EAAaS,EAAa,YAAYhB,CAAY,EAClDQ,EAAYS,EAAa,YAAYjB,CAAY,EACvD,OAAO,IAAIe,EAA8BR,EAAYC,CAAS,CAChE,CACF,EASaH,EAAN,MAAMa,UAAqCpB,CAAqB,CAKrE,YAAYqB,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,KAAKT,EAA0D,CACpE,IAAMmB,EAAcE,EAAS,YAAYrB,CAAY,EAC/CoB,EAAaE,EAAkB,YAAYtB,CAAY,EAC7D,OAAO,IAAIkB,EAA6BC,EAAaC,CAAU,CACjE,CACF","names":["AccountAuthenticator","Serializable","deserializer","index","AccountAuthenticatorEd25519","AccountAuthenticatorMultiEd25519","AccountAuthenticatorSingleKey","AccountAuthenticatorMultiKey","_AccountAuthenticatorEd25519","public_key","signature","serializer","Ed25519PublicKey","Ed25519Signature","_AccountAuthenticatorMultiEd25519","MultiEd25519PublicKey","MultiEd25519Signature","_AccountAuthenticatorSingleKey","AnyPublicKey","AnySignature","_AccountAuthenticatorMultiKey","public_keys","signatures","MultiKey","MultiKeySignature"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as i}from"./chunk-CEHCDA3G.mjs";import{a as r}from"./chunk-36QXVFR5.mjs";var t=class l extends r{constructor(e){super(),this.value=new i(e)}serialize(e){e.serialize(this.value)}serializeForEntryFunction(e){e.serializeU32AsUleb128(this.value.value.length),e.serialize(this)}static deserialize(e,s){let a=i.deserialize(e,s);return new l(a.value)}};export{t as a};
|
|
2
|
+
//# sourceMappingURL=chunk-N3U47Y6Y.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as i,b as t,c as n,d as o}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as i,b as t,c as n,d as o}from"./chunk-R2LYYO6V.mjs";import{a as s}from"./chunk-UM35A7RD.mjs";var r=class{constructor(e){this.config=e}async getFungibleAssetMetadata(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),i({aptosConfig:this.config,...e})}async getFungibleAssetMetadataByAssetType(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),(await i({aptosConfig:this.config,options:{where:{asset_type:{_eq:e.assetType}}}}))[0]}async getFungibleAssetActivities(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),t({aptosConfig:this.config,...e})}async getCurrentFungibleAssetBalances(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),n({aptosConfig:this.config,...e})}async transferFungibleAsset(e){return o({aptosConfig:this.config,...e})}};export{r as a};
|
|
2
|
+
//# sourceMappingURL=chunk-NOYKXLFN.mjs.map
|