@aptos-labs/ts-sdk 1.33.2 → 1.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/dist/common/{accountAddress-Cf1amU98.d.ts → accountAddress-CDtCLtJA.d.ts} +3 -2
- package/dist/common/chunk-ZYPBABLQ.js +4 -0
- package/dist/common/chunk-ZYPBABLQ.js.map +1 -0
- package/dist/common/cli/index.d.ts +1 -1
- package/dist/common/cli/index.js +1 -1
- package/dist/common/cli/index.js.map +1 -1
- package/dist/common/index.d.ts +2631 -2273
- package/dist/common/index.js +28 -30
- package/dist/common/index.js.map +1 -1
- package/dist/esm/account/AbstractKeylessAccount.d.mts +1 -0
- package/dist/esm/account/AbstractKeylessAccount.mjs +1 -1
- package/dist/esm/account/AbstractedAccount.d.mts +91 -0
- package/dist/esm/account/AbstractedAccount.mjs +2 -0
- package/dist/esm/account/Account.d.mts +1 -0
- package/dist/esm/account/Account.mjs +1 -1
- package/dist/esm/account/AccountUtils.d.mts +17 -16
- package/dist/esm/account/AccountUtils.mjs +1 -1
- package/dist/esm/account/Ed25519Account.d.mts +1 -0
- package/dist/esm/account/Ed25519Account.mjs +1 -1
- package/dist/esm/account/EphemeralKeyPair.d.mts +1 -0
- package/dist/esm/account/EphemeralKeyPair.mjs +1 -1
- package/dist/esm/account/FederatedKeylessAccount.d.mts +1 -0
- package/dist/esm/account/FederatedKeylessAccount.mjs +1 -1
- package/dist/esm/account/KeylessAccount.d.mts +1 -0
- package/dist/esm/account/KeylessAccount.mjs +1 -1
- package/dist/esm/account/MultiKeyAccount.d.mts +1 -0
- package/dist/esm/account/MultiKeyAccount.mjs +1 -1
- package/dist/esm/account/SingleKeyAccount.d.mts +1 -0
- package/dist/esm/account/SingleKeyAccount.mjs +1 -1
- package/dist/esm/account/index.d.mts +3 -0
- package/dist/esm/account/index.mjs +1 -1
- package/dist/esm/account/utils.d.mts +1 -0
- package/dist/esm/account/utils.mjs +1 -1
- package/dist/esm/api/account/abstraction.d.mts +209 -0
- package/dist/esm/api/account/abstraction.mjs +2 -0
- package/dist/esm/api/account.d.mts +3 -0
- package/dist/esm/api/account.mjs +1 -1
- package/dist/esm/api/ans.d.mts +1 -0
- package/dist/esm/api/ans.mjs +1 -1
- package/dist/esm/api/aptos.d.mts +3 -0
- package/dist/esm/api/aptos.mjs +1 -1
- package/dist/esm/api/aptosConfig.d.mts +1 -0
- package/dist/esm/api/coin.d.mts +1 -0
- package/dist/esm/api/coin.mjs +1 -1
- package/dist/esm/api/digitalAsset.d.mts +1 -0
- package/dist/esm/api/digitalAsset.mjs +1 -1
- package/dist/esm/api/event.d.mts +1 -0
- package/dist/esm/api/event.mjs +1 -1
- package/dist/esm/api/faucet.d.mts +1 -0
- package/dist/esm/api/faucet.mjs +1 -1
- package/dist/esm/api/fungibleAsset.d.mts +1 -0
- package/dist/esm/api/fungibleAsset.mjs +1 -1
- package/dist/esm/api/general.d.mts +1 -0
- package/dist/esm/api/general.mjs +1 -1
- package/dist/esm/api/index.d.mts +3 -0
- package/dist/esm/api/index.mjs +1 -1
- package/dist/esm/api/keyless.d.mts +2 -1
- package/dist/esm/api/keyless.mjs +1 -1
- package/dist/esm/api/object.d.mts +1 -0
- package/dist/esm/api/object.mjs +1 -1
- package/dist/esm/api/staking.d.mts +1 -0
- package/dist/esm/api/staking.mjs +1 -1
- package/dist/esm/api/table.d.mts +1 -0
- package/dist/esm/api/table.mjs +1 -1
- package/dist/esm/api/transaction.d.mts +2 -0
- package/dist/esm/api/transaction.mjs +1 -1
- package/dist/esm/api/transactionSubmission/build.d.mts +66 -0
- package/dist/esm/api/transactionSubmission/build.mjs +1 -1
- package/dist/esm/api/transactionSubmission/management.d.mts +1 -0
- package/dist/esm/api/transactionSubmission/management.mjs +1 -1
- package/dist/esm/api/transactionSubmission/sign.d.mts +1 -0
- 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 +1 -0
- package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
- package/dist/esm/api/transactionSubmission/submit.d.mts +1 -0
- package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
- package/dist/esm/api/utils.d.mts +1 -0
- package/dist/esm/api/utils.mjs +1 -1
- package/dist/esm/bcs/consts.d.mts +1 -0
- package/dist/esm/bcs/deserializer.d.mts +1 -0
- package/dist/esm/bcs/index.d.mts +1 -0
- package/dist/esm/bcs/index.mjs +1 -1
- package/dist/esm/bcs/serializable/entryFunctionBytes.d.mts +1 -0
- package/dist/esm/bcs/serializable/fixedBytes.d.mts +1 -0
- package/dist/esm/bcs/serializable/movePrimitives.d.mts +1 -0
- package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
- package/dist/esm/bcs/serializable/moveStructs.d.mts +1 -0
- package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
- package/dist/esm/bcs/serializer.d.mts +1 -0
- package/dist/esm/{chunk-OEQ2U7GK.mjs → chunk-2FNFUTFJ.mjs} +2 -2
- package/dist/esm/{chunk-DOQV5BSA.mjs → chunk-2GIPNLDO.mjs} +2 -2
- package/dist/esm/{chunk-6YHDZLRN.mjs → chunk-33CBJFX2.mjs} +2 -2
- package/dist/esm/{chunk-WUWPN7XV.mjs → chunk-3EY7MT2M.mjs} +2 -2
- package/dist/esm/{chunk-2UXW3EB7.mjs → chunk-3HFZN7L5.mjs} +2 -2
- package/dist/esm/chunk-3OLFJ65O.mjs +2 -0
- package/dist/esm/chunk-3OLFJ65O.mjs.map +1 -0
- package/dist/esm/chunk-42T3UGSW.mjs +2 -0
- package/dist/esm/chunk-42T3UGSW.mjs.map +1 -0
- package/dist/esm/chunk-4776UXL6.mjs +2 -0
- package/dist/esm/chunk-4776UXL6.mjs.map +1 -0
- package/dist/esm/{chunk-QQEK7WVP.mjs → chunk-4T75XRI2.mjs} +2 -2
- package/dist/esm/{chunk-MCLYDS3O.mjs → chunk-4UK4MUSD.mjs} +2 -2
- package/dist/esm/{chunk-FIEMUPXF.mjs → chunk-5BSMF22B.mjs} +2 -2
- package/dist/esm/chunk-66HHRRIX.mjs +2 -0
- package/dist/esm/chunk-66HHRRIX.mjs.map +1 -0
- package/dist/esm/{chunk-XYB6KYKW.mjs → chunk-6JTNS5O6.mjs} +2 -2
- package/dist/esm/{chunk-E7JDVKFY.mjs → chunk-6LGXFXXR.mjs} +2 -2
- package/dist/esm/{chunk-43GCGE6C.mjs → chunk-6PBMD2BQ.mjs} +2 -2
- package/dist/esm/chunk-7C2RDOWS.mjs +1 -0
- package/dist/esm/{chunk-OROPNHRY.mjs → chunk-7CYCKCVU.mjs} +2 -2
- package/dist/esm/chunk-7DPHPPMG.mjs +2 -0
- package/dist/esm/chunk-7DPHPPMG.mjs.map +1 -0
- package/dist/esm/chunk-ABXES4FS.mjs +2 -0
- package/dist/esm/chunk-ABXES4FS.mjs.map +1 -0
- package/dist/esm/{chunk-VV4HCOJQ.mjs → chunk-AC3BISWL.mjs} +2 -2
- package/dist/esm/chunk-BBUN4IO4.mjs +2 -0
- package/dist/esm/chunk-BBUN4IO4.mjs.map +1 -0
- package/dist/esm/{chunk-QHEKBHNU.mjs → chunk-BUTMGMSD.mjs} +2 -2
- package/dist/esm/{chunk-V6VPMNWJ.mjs → chunk-BYHCW7MI.mjs} +2 -2
- package/dist/esm/{chunk-M77M6NSB.mjs → chunk-CRFLR3ZY.mjs} +2 -2
- package/dist/esm/chunk-CSG67JHZ.mjs +2 -0
- package/dist/esm/chunk-CSG67JHZ.mjs.map +1 -0
- package/dist/esm/{chunk-5VMAJTTV.mjs → chunk-CXNF73OX.mjs} +2 -2
- package/dist/esm/{chunk-4EUS4E6S.mjs → chunk-D6T3NYOA.mjs} +2 -2
- package/dist/esm/chunk-DBIZE7G6.mjs +2 -0
- package/dist/esm/chunk-DBIZE7G6.mjs.map +1 -0
- package/dist/esm/{chunk-X6UNY6YM.mjs → chunk-DLLDRANJ.mjs} +2 -2
- package/dist/esm/{chunk-ZAIVZDOL.mjs → chunk-DMS7K76O.mjs} +2 -2
- package/dist/esm/chunk-DNJQWGB7.mjs +2 -0
- package/dist/esm/chunk-DNJQWGB7.mjs.map +1 -0
- package/dist/esm/{chunk-BGSEBFFC.mjs → chunk-DNWFDS7F.mjs} +2 -2
- package/dist/esm/{chunk-OHZURQPY.mjs → chunk-DWJ3PGWE.mjs} +2 -2
- package/dist/esm/chunk-EGZI6EJ2.mjs +2 -0
- package/dist/esm/chunk-EGZI6EJ2.mjs.map +1 -0
- package/dist/esm/chunk-EY2JUXEC.mjs +2 -0
- package/dist/esm/{chunk-77AEKF7K.mjs.map → chunk-EY2JUXEC.mjs.map} +1 -1
- package/dist/esm/{chunk-IEUEMBFD.mjs → chunk-G6RLN6ET.mjs} +2 -2
- package/dist/esm/{chunk-NBNZ53ZV.mjs → chunk-GQX5KMF7.mjs} +2 -2
- package/dist/esm/{chunk-2FBJWTJD.mjs → chunk-H4GZWYIG.mjs} +2 -2
- package/dist/esm/chunk-HEAWDTLG.mjs +2 -0
- package/dist/esm/chunk-HEAWDTLG.mjs.map +1 -0
- package/dist/esm/{chunk-2N5KYALM.mjs → chunk-HFCWJ6QL.mjs} +2 -2
- package/dist/esm/{chunk-2TJ6OTVD.mjs → chunk-HL2O3T57.mjs} +2 -2
- package/dist/esm/chunk-HLJE5XGE.mjs +2 -0
- package/dist/esm/chunk-HLJE5XGE.mjs.map +1 -0
- package/dist/esm/{chunk-5EYTHMRZ.mjs → chunk-HT2WC3QV.mjs} +2 -2
- package/dist/esm/{chunk-VVXBVJXD.mjs → chunk-I7YHK6ZF.mjs} +2 -2
- package/dist/esm/chunk-IMTC3J2M.mjs +2 -0
- package/dist/esm/chunk-IMTC3J2M.mjs.map +1 -0
- package/dist/esm/{chunk-ONTWK5FU.mjs → chunk-J7HRQ2IH.mjs} +2 -2
- package/dist/esm/{chunk-S7RZGC56.mjs → chunk-JF66JS2R.mjs} +2 -2
- package/dist/esm/{chunk-UC23V7PU.mjs → chunk-KEJAUCQF.mjs} +2 -2
- package/dist/esm/{chunk-6CXMDJQR.mjs → chunk-L2AQG3G3.mjs} +2 -2
- package/dist/esm/{chunk-XTJOA5QN.mjs → chunk-L6FONDPA.mjs} +2 -2
- package/dist/esm/{chunk-67ZVDKJF.mjs → chunk-N7C6LQPZ.mjs} +2 -2
- package/dist/esm/{chunk-OR6GFWLG.mjs → chunk-O37BZP2G.mjs} +2 -2
- package/dist/esm/{chunk-XZ4JRYCE.mjs → chunk-OURSLL3I.mjs} +2 -2
- package/dist/esm/{chunk-7IY3DTEF.mjs → chunk-P7SE5LQE.mjs} +2 -2
- package/dist/esm/{chunk-6YWYAVFS.mjs → chunk-PNSF3E67.mjs} +2 -2
- package/dist/esm/{chunk-E5HGSOG2.mjs → chunk-PR3W2QEH.mjs} +2 -2
- package/dist/esm/{chunk-P7A5RILV.mjs → chunk-PWYJWTEM.mjs} +2 -2
- package/dist/esm/{chunk-ZPV7HPA4.mjs → chunk-Q7RG7KQS.mjs} +2 -2
- package/dist/esm/{chunk-WQRGDSPD.mjs → chunk-QBFGY74I.mjs} +2 -2
- package/dist/esm/{chunk-XY43TPRH.mjs → chunk-S47HA7O7.mjs} +2 -2
- package/dist/esm/{chunk-5EBUWO2M.mjs → chunk-SCBYJU6K.mjs} +2 -2
- package/dist/esm/chunk-TDGUMBON.mjs +4 -0
- package/dist/esm/chunk-TDGUMBON.mjs.map +1 -0
- package/dist/esm/{chunk-FZD5RWSZ.mjs → chunk-TM6IKHMX.mjs} +2 -2
- package/dist/esm/{chunk-KOORZTHC.mjs → chunk-U2SJIG2T.mjs} +2 -2
- package/dist/esm/chunk-UIRAXHDH.mjs +1 -0
- package/dist/esm/chunk-UIRAXHDH.mjs.map +1 -0
- package/dist/esm/{chunk-S4LZMY2L.mjs → chunk-ULHOJ2BE.mjs} +2 -2
- package/dist/esm/{chunk-VUIHJIMX.mjs → chunk-UTXEW2FT.mjs} +2 -2
- package/dist/esm/{chunk-4ZYPDCSP.mjs → chunk-V2EXS6TM.mjs} +2 -2
- package/dist/esm/{chunk-6IEZPA4H.mjs → chunk-V7G2EDNR.mjs} +2 -2
- package/dist/esm/{chunk-MWBRD43V.mjs → chunk-VKDTI6NX.mjs} +2 -2
- package/dist/esm/{chunk-NYETBDSR.mjs → chunk-VOCI2675.mjs} +2 -2
- package/dist/esm/{chunk-NWLJ6RW7.mjs → chunk-WXDA4CCR.mjs} +2 -2
- package/dist/esm/{chunk-ZGVNZE7J.mjs → chunk-X24PSWCX.mjs} +2 -2
- package/dist/esm/chunk-X2CPDUOS.mjs +2 -0
- package/dist/esm/chunk-X2CPDUOS.mjs.map +1 -0
- package/dist/esm/{chunk-YCQUYDZI.mjs → chunk-X6IHNXWY.mjs} +2 -2
- package/dist/esm/{chunk-JJM6ELMS.mjs → chunk-XAPQNCTN.mjs} +2 -2
- package/dist/esm/{chunk-5YWH3XPN.mjs → chunk-XDIX7NIP.mjs} +2 -2
- package/dist/esm/{chunk-DYATTONT.mjs → chunk-XH3BEKII.mjs} +2 -2
- package/dist/esm/{chunk-AXYARCYT.mjs → chunk-XXHZQFYW.mjs} +2 -2
- package/dist/esm/{chunk-3RCAJICY.mjs → chunk-Y3Y4DVCK.mjs} +2 -2
- package/dist/esm/{chunk-OSBRPVVI.mjs → chunk-YIF242TF.mjs} +2 -2
- package/dist/esm/{chunk-CWKNJZB6.mjs → chunk-ZCEBDPBJ.mjs} +2 -2
- package/dist/esm/{chunk-2WCATZVL.mjs → chunk-ZP5EBIBE.mjs} +2 -2
- package/dist/esm/cli/index.d.mts +1 -0
- package/dist/esm/cli/index.mjs +1 -1
- package/dist/esm/cli/localNode.mjs +1 -1
- package/dist/esm/cli/move.d.mts +1 -0
- package/dist/esm/client/core.d.mts +1 -0
- package/dist/esm/client/core.mjs +1 -1
- package/dist/esm/client/get.d.mts +1 -0
- package/dist/esm/client/get.mjs +1 -1
- package/dist/esm/client/index.d.mts +1 -0
- package/dist/esm/client/index.mjs +1 -1
- package/dist/esm/client/post.d.mts +1 -0
- package/dist/esm/client/post.mjs +1 -1
- package/dist/esm/core/account/index.d.mts +1 -0
- package/dist/esm/core/account/index.mjs +1 -1
- package/dist/esm/core/account/utils/address.d.mts +1 -0
- package/dist/esm/core/account/utils/address.mjs +1 -1
- package/dist/esm/core/account/utils/index.d.mts +1 -0
- package/dist/esm/core/account/utils/index.mjs +1 -1
- package/dist/esm/core/accountAddress.d.mts +1 -0
- package/dist/esm/core/accountAddress.mjs +1 -1
- package/dist/esm/core/authenticationKey.d.mts +1 -0
- package/dist/esm/core/authenticationKey.mjs +1 -1
- package/dist/esm/core/crypto/abstraction.d.mts +30 -0
- package/dist/esm/core/crypto/abstraction.mjs +2 -0
- package/dist/esm/core/crypto/abstraction.mjs.map +1 -0
- package/dist/esm/core/crypto/ed25519.d.mts +1 -0
- package/dist/esm/core/crypto/ed25519.mjs +1 -1
- package/dist/esm/core/crypto/ephemeral.d.mts +1 -0
- package/dist/esm/core/crypto/ephemeral.mjs +1 -1
- package/dist/esm/core/crypto/federatedKeyless.d.mts +1 -0
- package/dist/esm/core/crypto/federatedKeyless.mjs +1 -1
- package/dist/esm/core/crypto/index.d.mts +1 -0
- package/dist/esm/core/crypto/index.mjs +1 -1
- package/dist/esm/core/crypto/keyless.d.mts +1 -0
- package/dist/esm/core/crypto/keyless.mjs +1 -1
- package/dist/esm/core/crypto/multiEd25519.d.mts +1 -0
- package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
- package/dist/esm/core/crypto/multiKey.d.mts +1 -0
- package/dist/esm/core/crypto/multiKey.mjs +1 -1
- package/dist/esm/core/crypto/privateKey.d.mts +1 -0
- package/dist/esm/core/crypto/privateKey.mjs +1 -1
- package/dist/esm/core/crypto/proof.d.mts +1 -0
- package/dist/esm/core/crypto/proof.mjs +1 -1
- package/dist/esm/core/crypto/publicKey.d.mts +1 -0
- package/dist/esm/core/crypto/publicKey.mjs +1 -1
- package/dist/esm/core/crypto/secp256k1.d.mts +1 -0
- package/dist/esm/core/crypto/secp256k1.mjs +1 -1
- package/dist/esm/core/crypto/signature.d.mts +1 -0
- package/dist/esm/core/crypto/signature.mjs +1 -1
- package/dist/esm/core/crypto/singleKey.d.mts +1 -0
- package/dist/esm/core/crypto/singleKey.mjs +1 -1
- package/dist/esm/core/crypto/utils.d.mts +1 -0
- package/dist/esm/core/hex.d.mts +1 -0
- package/dist/esm/core/index.d.mts +1 -0
- package/dist/esm/core/index.mjs +1 -1
- package/dist/esm/errors/index.d.mts +1 -0
- package/dist/esm/errors/index.mjs +1 -1
- package/dist/esm/index.d.mts +10 -5
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/internal/abstraction.d.mts +55 -0
- package/dist/esm/internal/abstraction.mjs +2 -0
- package/dist/esm/internal/abstraction.mjs.map +1 -0
- package/dist/esm/internal/account.d.mts +1 -0
- package/dist/esm/internal/account.mjs +1 -1
- package/dist/esm/internal/ans.d.mts +1 -0
- package/dist/esm/internal/ans.mjs +1 -1
- package/dist/esm/internal/coin.d.mts +1 -0
- package/dist/esm/internal/coin.mjs +1 -1
- package/dist/esm/internal/digitalAsset.d.mts +1 -0
- package/dist/esm/internal/digitalAsset.mjs +1 -1
- package/dist/esm/internal/event.d.mts +1 -0
- package/dist/esm/internal/event.mjs +1 -1
- package/dist/esm/internal/faucet.d.mts +1 -0
- package/dist/esm/internal/faucet.mjs +1 -1
- package/dist/esm/internal/fungibleAsset.d.mts +1 -0
- package/dist/esm/internal/fungibleAsset.mjs +1 -1
- package/dist/esm/internal/general.d.mts +1 -0
- package/dist/esm/internal/general.mjs +1 -1
- package/dist/esm/internal/keyless.d.mts +1 -0
- package/dist/esm/internal/keyless.mjs +1 -1
- package/dist/esm/internal/object.d.mts +1 -0
- package/dist/esm/internal/object.mjs +1 -1
- package/dist/esm/internal/staking.d.mts +1 -0
- package/dist/esm/internal/staking.mjs +1 -1
- package/dist/esm/internal/table.d.mts +1 -0
- package/dist/esm/internal/table.mjs +1 -1
- package/dist/esm/internal/transaction.d.mts +1 -0
- package/dist/esm/internal/transaction.mjs +1 -1
- package/dist/esm/internal/transactionSubmission.d.mts +1 -0
- package/dist/esm/internal/transactionSubmission.mjs +1 -1
- package/dist/esm/internal/view.d.mts +1 -0
- package/dist/esm/internal/view.mjs +1 -1
- package/dist/esm/transactions/authenticator/account.d.mts +12 -3
- package/dist/esm/transactions/authenticator/account.mjs +1 -1
- package/dist/esm/transactions/authenticator/index.d.mts +2 -1
- package/dist/esm/transactions/authenticator/index.mjs +1 -1
- package/dist/esm/transactions/authenticator/transaction.d.mts +3 -2
- package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
- package/dist/esm/transactions/index.d.mts +6 -4
- package/dist/esm/transactions/index.mjs +1 -1
- package/dist/esm/transactions/instances/chainId.d.mts +1 -0
- package/dist/esm/transactions/instances/identifier.d.mts +1 -0
- package/dist/esm/transactions/instances/index.d.mts +1 -0
- package/dist/esm/transactions/instances/index.mjs +1 -1
- package/dist/esm/transactions/instances/moduleId.d.mts +1 -0
- package/dist/esm/transactions/instances/moduleId.mjs +1 -1
- package/dist/esm/transactions/instances/multiAgentTransaction.d.mts +1 -0
- package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/rawTransaction.d.mts +1 -0
- package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/rotationProofChallenge.d.mts +1 -0
- package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
- package/dist/esm/transactions/instances/signedTransaction.d.mts +5 -4
- package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/simpleTransaction.d.mts +1 -0
- package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/transactionArgument.d.mts +1 -0
- package/dist/esm/transactions/instances/transactionPayload.d.mts +1 -0
- package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
- package/dist/esm/transactions/management/accountSequenceNumber.d.mts +1 -0
- package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
- package/dist/esm/transactions/management/index.d.mts +1 -0
- package/dist/esm/transactions/management/index.mjs +1 -1
- package/dist/esm/transactions/management/transactionWorker.d.mts +1 -0
- package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
- package/dist/esm/transactions/scriptComposer/index.d.mts +53 -0
- package/dist/esm/transactions/scriptComposer/index.mjs +2 -0
- package/dist/esm/transactions/scriptComposer/index.mjs.map +1 -0
- package/dist/esm/transactions/transactionBuilder/helpers.d.mts +3 -17
- package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/index.d.mts +3 -2
- package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +23 -2
- package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/signingMessage.d.mts +1 -0
- package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +3 -2
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
- package/dist/esm/transactions/typeTag/index.d.mts +1 -0
- package/dist/esm/transactions/typeTag/index.mjs +1 -1
- package/dist/esm/transactions/typeTag/parser.d.mts +1 -0
- package/dist/esm/transactions/typeTag/parser.mjs +1 -1
- package/dist/esm/transactions/types.d.mts +10 -1
- package/dist/esm/types/abstraction.d.mts +8 -0
- package/dist/esm/types/abstraction.mjs +2 -0
- package/dist/esm/types/abstraction.mjs.map +1 -0
- package/dist/esm/types/index.d.mts +1 -0
- package/dist/esm/types/index.mjs +1 -1
- package/dist/esm/types/types.d.mts +3 -1
- package/dist/esm/types/types.mjs +1 -1
- package/dist/esm/utils/helpers.d.mts +19 -2
- package/dist/esm/utils/helpers.mjs +1 -1
- package/dist/esm/utils/index.d.mts +2 -1
- package/dist/esm/utils/index.mjs +1 -1
- package/dist/esm/utils/normalizeBundle.d.mts +1 -0
- 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 +25 -18
- package/src/account/AbstractedAccount.ts +111 -0
- package/src/account/index.ts +1 -0
- package/src/api/account/abstraction.ts +239 -0
- package/src/api/account.ts +6 -1
- package/src/api/aptos.ts +3 -0
- package/src/api/transactionSubmission/build.ts +85 -2
- package/src/core/crypto/abstraction.ts +47 -0
- package/src/internal/abstraction.ts +79 -0
- package/src/transactions/authenticator/account.ts +52 -1
- package/src/transactions/index.ts +1 -0
- package/src/transactions/scriptComposer/index.ts +87 -0
- package/src/transactions/transactionBuilder/helpers.ts +1 -22
- package/src/transactions/transactionBuilder/remoteAbi.ts +62 -1
- package/src/transactions/transactionBuilder/transactionBuilder.ts +2 -1
- package/src/transactions/types.ts +11 -0
- package/src/types/abstraction.ts +6 -0
- package/src/types/index.ts +1 -0
- package/src/types/types.ts +1 -0
- package/src/utils/helpers.ts +28 -1
- package/src/version.ts +1 -1
- package/dist/common/chunk-IHUCZKG2.js +0 -2
- package/dist/common/chunk-IHUCZKG2.js.map +0 -1
- package/dist/esm/chunk-5PXDPMF2.mjs +0 -4
- package/dist/esm/chunk-5PXDPMF2.mjs.map +0 -1
- package/dist/esm/chunk-77AEKF7K.mjs +0 -2
- package/dist/esm/chunk-AFEHO5PP.mjs +0 -2
- package/dist/esm/chunk-AFEHO5PP.mjs.map +0 -1
- package/dist/esm/chunk-DAFSKSZ5.mjs +0 -2
- package/dist/esm/chunk-DAFSKSZ5.mjs.map +0 -1
- package/dist/esm/chunk-FD6FGKYY.mjs +0 -1
- package/dist/esm/chunk-GP4TLDVZ.mjs +0 -1
- package/dist/esm/chunk-HBH2NQKU.mjs +0 -2
- package/dist/esm/chunk-HBH2NQKU.mjs.map +0 -1
- package/dist/esm/chunk-I5OYNCZS.mjs +0 -1
- package/dist/esm/chunk-JBEUUULP.mjs +0 -2
- package/dist/esm/chunk-JBEUUULP.mjs.map +0 -1
- package/dist/esm/chunk-KVM2SGSF.mjs +0 -2
- package/dist/esm/chunk-KVM2SGSF.mjs.map +0 -1
- package/dist/esm/chunk-MLSAZJZK.mjs +0 -2
- package/dist/esm/chunk-MLSAZJZK.mjs.map +0 -1
- package/dist/esm/chunk-QHC5DKVZ.mjs +0 -2
- package/dist/esm/chunk-QHC5DKVZ.mjs.map +0 -1
- package/dist/esm/chunk-U2PRGW4O.mjs +0 -2
- package/dist/esm/chunk-U2PRGW4O.mjs.map +0 -1
- /package/dist/esm/{chunk-FD6FGKYY.mjs.map → account/AbstractedAccount.mjs.map} +0 -0
- /package/dist/esm/{chunk-GP4TLDVZ.mjs.map → api/account/abstraction.mjs.map} +0 -0
- /package/dist/esm/{chunk-OEQ2U7GK.mjs.map → chunk-2FNFUTFJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-DOQV5BSA.mjs.map → chunk-2GIPNLDO.mjs.map} +0 -0
- /package/dist/esm/{chunk-6YHDZLRN.mjs.map → chunk-33CBJFX2.mjs.map} +0 -0
- /package/dist/esm/{chunk-WUWPN7XV.mjs.map → chunk-3EY7MT2M.mjs.map} +0 -0
- /package/dist/esm/{chunk-2UXW3EB7.mjs.map → chunk-3HFZN7L5.mjs.map} +0 -0
- /package/dist/esm/{chunk-QQEK7WVP.mjs.map → chunk-4T75XRI2.mjs.map} +0 -0
- /package/dist/esm/{chunk-MCLYDS3O.mjs.map → chunk-4UK4MUSD.mjs.map} +0 -0
- /package/dist/esm/{chunk-FIEMUPXF.mjs.map → chunk-5BSMF22B.mjs.map} +0 -0
- /package/dist/esm/{chunk-XYB6KYKW.mjs.map → chunk-6JTNS5O6.mjs.map} +0 -0
- /package/dist/esm/{chunk-E7JDVKFY.mjs.map → chunk-6LGXFXXR.mjs.map} +0 -0
- /package/dist/esm/{chunk-43GCGE6C.mjs.map → chunk-6PBMD2BQ.mjs.map} +0 -0
- /package/dist/esm/{chunk-I5OYNCZS.mjs.map → chunk-7C2RDOWS.mjs.map} +0 -0
- /package/dist/esm/{chunk-OROPNHRY.mjs.map → chunk-7CYCKCVU.mjs.map} +0 -0
- /package/dist/esm/{chunk-VV4HCOJQ.mjs.map → chunk-AC3BISWL.mjs.map} +0 -0
- /package/dist/esm/{chunk-QHEKBHNU.mjs.map → chunk-BUTMGMSD.mjs.map} +0 -0
- /package/dist/esm/{chunk-V6VPMNWJ.mjs.map → chunk-BYHCW7MI.mjs.map} +0 -0
- /package/dist/esm/{chunk-M77M6NSB.mjs.map → chunk-CRFLR3ZY.mjs.map} +0 -0
- /package/dist/esm/{chunk-5VMAJTTV.mjs.map → chunk-CXNF73OX.mjs.map} +0 -0
- /package/dist/esm/{chunk-4EUS4E6S.mjs.map → chunk-D6T3NYOA.mjs.map} +0 -0
- /package/dist/esm/{chunk-X6UNY6YM.mjs.map → chunk-DLLDRANJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-ZAIVZDOL.mjs.map → chunk-DMS7K76O.mjs.map} +0 -0
- /package/dist/esm/{chunk-BGSEBFFC.mjs.map → chunk-DNWFDS7F.mjs.map} +0 -0
- /package/dist/esm/{chunk-OHZURQPY.mjs.map → chunk-DWJ3PGWE.mjs.map} +0 -0
- /package/dist/esm/{chunk-IEUEMBFD.mjs.map → chunk-G6RLN6ET.mjs.map} +0 -0
- /package/dist/esm/{chunk-NBNZ53ZV.mjs.map → chunk-GQX5KMF7.mjs.map} +0 -0
- /package/dist/esm/{chunk-2FBJWTJD.mjs.map → chunk-H4GZWYIG.mjs.map} +0 -0
- /package/dist/esm/{chunk-2N5KYALM.mjs.map → chunk-HFCWJ6QL.mjs.map} +0 -0
- /package/dist/esm/{chunk-2TJ6OTVD.mjs.map → chunk-HL2O3T57.mjs.map} +0 -0
- /package/dist/esm/{chunk-5EYTHMRZ.mjs.map → chunk-HT2WC3QV.mjs.map} +0 -0
- /package/dist/esm/{chunk-VVXBVJXD.mjs.map → chunk-I7YHK6ZF.mjs.map} +0 -0
- /package/dist/esm/{chunk-ONTWK5FU.mjs.map → chunk-J7HRQ2IH.mjs.map} +0 -0
- /package/dist/esm/{chunk-S7RZGC56.mjs.map → chunk-JF66JS2R.mjs.map} +0 -0
- /package/dist/esm/{chunk-UC23V7PU.mjs.map → chunk-KEJAUCQF.mjs.map} +0 -0
- /package/dist/esm/{chunk-6CXMDJQR.mjs.map → chunk-L2AQG3G3.mjs.map} +0 -0
- /package/dist/esm/{chunk-XTJOA5QN.mjs.map → chunk-L6FONDPA.mjs.map} +0 -0
- /package/dist/esm/{chunk-67ZVDKJF.mjs.map → chunk-N7C6LQPZ.mjs.map} +0 -0
- /package/dist/esm/{chunk-OR6GFWLG.mjs.map → chunk-O37BZP2G.mjs.map} +0 -0
- /package/dist/esm/{chunk-XZ4JRYCE.mjs.map → chunk-OURSLL3I.mjs.map} +0 -0
- /package/dist/esm/{chunk-7IY3DTEF.mjs.map → chunk-P7SE5LQE.mjs.map} +0 -0
- /package/dist/esm/{chunk-6YWYAVFS.mjs.map → chunk-PNSF3E67.mjs.map} +0 -0
- /package/dist/esm/{chunk-E5HGSOG2.mjs.map → chunk-PR3W2QEH.mjs.map} +0 -0
- /package/dist/esm/{chunk-P7A5RILV.mjs.map → chunk-PWYJWTEM.mjs.map} +0 -0
- /package/dist/esm/{chunk-ZPV7HPA4.mjs.map → chunk-Q7RG7KQS.mjs.map} +0 -0
- /package/dist/esm/{chunk-WQRGDSPD.mjs.map → chunk-QBFGY74I.mjs.map} +0 -0
- /package/dist/esm/{chunk-XY43TPRH.mjs.map → chunk-S47HA7O7.mjs.map} +0 -0
- /package/dist/esm/{chunk-5EBUWO2M.mjs.map → chunk-SCBYJU6K.mjs.map} +0 -0
- /package/dist/esm/{chunk-FZD5RWSZ.mjs.map → chunk-TM6IKHMX.mjs.map} +0 -0
- /package/dist/esm/{chunk-KOORZTHC.mjs.map → chunk-U2SJIG2T.mjs.map} +0 -0
- /package/dist/esm/{chunk-S4LZMY2L.mjs.map → chunk-ULHOJ2BE.mjs.map} +0 -0
- /package/dist/esm/{chunk-VUIHJIMX.mjs.map → chunk-UTXEW2FT.mjs.map} +0 -0
- /package/dist/esm/{chunk-4ZYPDCSP.mjs.map → chunk-V2EXS6TM.mjs.map} +0 -0
- /package/dist/esm/{chunk-6IEZPA4H.mjs.map → chunk-V7G2EDNR.mjs.map} +0 -0
- /package/dist/esm/{chunk-MWBRD43V.mjs.map → chunk-VKDTI6NX.mjs.map} +0 -0
- /package/dist/esm/{chunk-NYETBDSR.mjs.map → chunk-VOCI2675.mjs.map} +0 -0
- /package/dist/esm/{chunk-NWLJ6RW7.mjs.map → chunk-WXDA4CCR.mjs.map} +0 -0
- /package/dist/esm/{chunk-ZGVNZE7J.mjs.map → chunk-X24PSWCX.mjs.map} +0 -0
- /package/dist/esm/{chunk-YCQUYDZI.mjs.map → chunk-X6IHNXWY.mjs.map} +0 -0
- /package/dist/esm/{chunk-JJM6ELMS.mjs.map → chunk-XAPQNCTN.mjs.map} +0 -0
- /package/dist/esm/{chunk-5YWH3XPN.mjs.map → chunk-XDIX7NIP.mjs.map} +0 -0
- /package/dist/esm/{chunk-DYATTONT.mjs.map → chunk-XH3BEKII.mjs.map} +0 -0
- /package/dist/esm/{chunk-AXYARCYT.mjs.map → chunk-XXHZQFYW.mjs.map} +0 -0
- /package/dist/esm/{chunk-3RCAJICY.mjs.map → chunk-Y3Y4DVCK.mjs.map} +0 -0
- /package/dist/esm/{chunk-OSBRPVVI.mjs.map → chunk-YIF242TF.mjs.map} +0 -0
- /package/dist/esm/{chunk-CWKNJZB6.mjs.map → chunk-ZCEBDPBJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-2WCATZVL.mjs.map → chunk-ZP5EBIBE.mjs.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{b as T}from"./chunk-
|
|
1
|
+
import{b as T}from"./chunk-42T3UGSW.mjs";var N=(r=>(r[r.API_ERROR=0]="API_ERROR",r[r.EXTERNAL_API_ERROR=1]="EXTERNAL_API_ERROR",r[r.SESSION_EXPIRED=2]="SESSION_EXPIRED",r[r.INVALID_STATE=3]="INVALID_STATE",r[r.UNKNOWN=4]="UNKNOWN",r))(N||{}),l=(s=>(s.REAUTHENTICATE="Re-authentiate to continue using your keyless account",s.REAUTHENTICATE_UNSURE="Try re-authentiating. If the error persists join the telegram group at https://t.me/+h5CN-W35yUFiYzkx for further support",s.UPDATE_REQUEST_PARAMS="Update the invalid request parameters and reauthenticate.",s.RATE_LIMIT_EXCEEDED="Cache the keyless account and reuse it to avoid making too many requests. Keyless accounts are valid until either the EphemeralKeyPair expires, when the JWK is rotated, or when the proof verifying key is changed, whichever comes soonest.",s.SERVER_ERROR="Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx",s.CALL_PRECHECK="Call `await account.checkKeylessAccountValidity()` to wait for asyncronous changes and check for account validity before signing or serializing.",s.REINSTANTIATE="Try instantiating the account again. Avoid manipulating the account object directly",s.JOIN_SUPPORT_GROUP="For support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx",s.UNKNOWN="Error unknown. For support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx",s))(l||{}),u=(e=>(e[e.EPHEMERAL_KEY_PAIR_EXPIRED=0]="EPHEMERAL_KEY_PAIR_EXPIRED",e[e.PROOF_NOT_FOUND=1]="PROOF_NOT_FOUND",e[e.ASYNC_PROOF_FETCH_FAILED=2]="ASYNC_PROOF_FETCH_FAILED",e[e.INVALID_PROOF_VERIFICATION_FAILED=3]="INVALID_PROOF_VERIFICATION_FAILED",e[e.INVALID_PROOF_VERIFICATION_KEY_NOT_FOUND=4]="INVALID_PROOF_VERIFICATION_KEY_NOT_FOUND",e[e.INVALID_JWT_SIG=5]="INVALID_JWT_SIG",e[e.INVALID_JWT_JWK_NOT_FOUND=6]="INVALID_JWT_JWK_NOT_FOUND",e[e.INVALID_JWT_ISS_NOT_RECOGNIZED=7]="INVALID_JWT_ISS_NOT_RECOGNIZED",e[e.INVALID_JWT_FEDERATED_ISS_NOT_SUPPORTED=8]="INVALID_JWT_FEDERATED_ISS_NOT_SUPPORTED",e[e.INVALID_TW_SIG_VERIFICATION_FAILED=9]="INVALID_TW_SIG_VERIFICATION_FAILED",e[e.INVALID_TW_SIG_PUBLIC_KEY_NOT_FOUND=10]="INVALID_TW_SIG_PUBLIC_KEY_NOT_FOUND",e[e.INVALID_EXPIRY_HORIZON=11]="INVALID_EXPIRY_HORIZON",e[e.JWT_PARSING_ERROR=12]="JWT_PARSING_ERROR",e[e.JWK_FETCH_FAILED=13]="JWK_FETCH_FAILED",e[e.JWK_FETCH_FAILED_FEDERATED=14]="JWK_FETCH_FAILED_FEDERATED",e[e.RATE_LIMIT_EXCEEDED=15]="RATE_LIMIT_EXCEEDED",e[e.PEPPER_SERVICE_INTERNAL_ERROR=16]="PEPPER_SERVICE_INTERNAL_ERROR",e[e.PEPPER_SERVICE_BAD_REQUEST=17]="PEPPER_SERVICE_BAD_REQUEST",e[e.PEPPER_SERVICE_OTHER=18]="PEPPER_SERVICE_OTHER",e[e.PROVER_SERVICE_INTERNAL_ERROR=19]="PROVER_SERVICE_INTERNAL_ERROR",e[e.PROVER_SERVICE_BAD_REQUEST=20]="PROVER_SERVICE_BAD_REQUEST",e[e.PROVER_SERVICE_OTHER=21]="PROVER_SERVICE_OTHER",e[e.FULL_NODE_CONFIG_LOOKUP_ERROR=22]="FULL_NODE_CONFIG_LOOKUP_ERROR",e[e.FULL_NODE_VERIFICATION_KEY_LOOKUP_ERROR=23]="FULL_NODE_VERIFICATION_KEY_LOOKUP_ERROR",e[e.FULL_NODE_JWKS_LOOKUP_ERROR=24]="FULL_NODE_JWKS_LOOKUP_ERROR",e[e.FULL_NODE_OTHER=25]="FULL_NODE_OTHER",e[e.UNKNOWN=26]="UNKNOWN",e))(u||{}),A={0:["The ephemeral keypair has expired.",2,"Re-authentiate to continue using your keyless account"],1:["The required proof could not be found.",3,"Call `await account.checkKeylessAccountValidity()` to wait for asyncronous changes and check for account validity before signing or serializing."],2:["The required proof failed to fetch.",3,"Try re-authentiating. If the error persists join the telegram group at https://t.me/+h5CN-W35yUFiYzkx for further support"],3:["The provided proof is invalid.",3,"Try re-authentiating. If the error persists join the telegram group at https://t.me/+h5CN-W35yUFiYzkx for further support"],4:["The verification key used to authenticate was updated.",2,"Re-authentiate to continue using your keyless account"],5:["The JWK was found, but JWT failed verification",3,"Try re-authentiating. If the error persists join the telegram group at https://t.me/+h5CN-W35yUFiYzkx for further support"],6:["The JWK required to verify the JWT could not be found. The JWK may have been rotated out.",2,"Re-authentiate to continue using your keyless account"],7:["The JWT issuer is not recognized.",3,"Update the invalid request parameters and reauthenticate."],8:["The JWT issuer is not supported by the Federated Keyless ",0,"Try re-authentiating. If the error persists join the telegram group at https://t.me/+h5CN-W35yUFiYzkx for further support"],9:["The training wheels signature is invalid.",3,"Try re-authentiating. If the error persists join the telegram group at https://t.me/+h5CN-W35yUFiYzkx for further support"],10:["The public key used to verify the training wheels signature was not found.",2,"Re-authentiate to continue using your keyless account"],11:["The expiry horizon is invalid.",2,"Re-authentiate to continue using your keyless account"],13:["Failed to fetch JWKS.",1,"For support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],14:["Failed to fetch JWKS for Federated Keyless provider.",1,"For support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],15:["Rate limit exceeded. Too many requests in a short period.",0,"Cache the keyless account and reuse it to avoid making too many requests. Keyless accounts are valid until either the EphemeralKeyPair expires, when the JWK is rotated, or when the proof verifying key is changed, whichever comes soonest."],16:["Internal error from Pepper service.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],17:["Bad request sent to Pepper service.",0,"Update the invalid request parameters and reauthenticate."],18:["Unknown error from Pepper service.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],19:["Internal error from Prover service.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],20:["Bad request sent to Prover service.",0,"Update the invalid request parameters and reauthenticate."],21:["Unknown error from Prover service.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],12:["Error when parsing JWT. This should never happen. Join https://t.me/+h5CN-W35yUFiYzkx for support",3,"Try instantiating the account again. Avoid manipulating the account object directly"],22:["Error when looking up on-chain keyless configuration.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],23:["Error when looking up on-chain verification key.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],24:["Error when looking up on-chain JWKS.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],25:["Unknown error from full node.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],26:["An unknown error has occurred.",4,"Error unknown. For support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"]},O=class i extends Error{constructor(o){let{innerError:E,category:t,resolutionTip:R,type:r,message:_=A[r][0],details:n}=o;super(_),this.name="KeylessError",this.innerError=E,this.category=t,this.resolutionTip=R,this.type=r,this.details=n,this.message=i.constructMessage(_,R,E,n)}static constructMessage(o,E,t,R){let r=`
|
|
2
2
|
Message: ${o}`;return R&&(r+=`
|
|
3
3
|
Details: ${R}`),t instanceof I?r+=`
|
|
4
4
|
AptosApiError: ${t.message}`:t!==void 0&&(r+=`
|
|
5
5
|
Error: ${T(t)}`),r+=`
|
|
6
6
|
KeylessErrorResolutionTip: ${E}`,r}static fromErrorType(o){let{error:E,type:t,details:R}=o,[r,_,n]=A[t];return new i({message:r,details:R,innerError:E,category:_,resolutionTip:n,type:t})}},I=class extends Error{constructor({apiType:o,aptosRequest:E,aptosResponse:t}){super(P({apiType:o,aptosRequest:E,aptosResponse:t})),this.name="AptosApiError",this.url=t.url,this.status=t.status,this.statusText=t.statusText,this.data=t.data,this.request=E}};function P({apiType:i,aptosRequest:o,aptosResponse:E}){let t=E.headers?.traceparent?.split("-")[1],R=t?`(trace_id:${t}) `:"",r=`Request to [${i}]: ${o.method} ${E.url??o.url} ${R}failed with`;return i==="Indexer"&&E.data?.errors?.[0]?.message!=null?`${r}: ${E.data.errors[0].message}`:E.data?.message!=null&&E.data?.error_code!=null?`${r}: ${JSON.stringify(E.data)}`:`${r} status: ${E.statusText}(code:${E.status}) and response body: ${S(E.data)}`}var a=400;function S(i){let o=JSON.stringify(i);return o.length<=a?o:`truncated(original_size:${o.length}): ${o.slice(0,a/2)}...${o.slice(-a/2)}`}export{N as a,l as b,u as c,O as d,I as e};
|
|
7
|
-
//# sourceMappingURL=chunk-
|
|
7
|
+
//# sourceMappingURL=chunk-BUTMGMSD.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-3EY7MT2M.mjs";import{a as e,c as n}from"./chunk-42T3UGSW.mjs";var r=class{constructor(t,i,o,a,c){this.lastUncommintedNumber=null;this.currentNumber=null;this.lock=!1;this.aptosConfig=t,this.account=i,this.maxWaitTime=o,this.maximumInFlight=a,this.sleepTime=c}async nextSequenceNumber(){for(;this.lock;)await e(this.sleepTime);this.lock=!0;let t=BigInt(0);try{if((this.lastUncommintedNumber===null||this.currentNumber===null)&&await this.initialize(),this.currentNumber-this.lastUncommintedNumber>=this.maximumInFlight){await this.update();let i=n();for(;this.currentNumber-this.lastUncommintedNumber>=this.maximumInFlight;)await e(this.sleepTime),n()-i>this.maxWaitTime?(console.warn(`Waited over 30 seconds for a transaction to commit, re-syncing ${this.account.accountAddress.toString()}`),await this.initialize()):await this.update()}t=this.currentNumber,this.currentNumber+=BigInt(1)}catch(i){console.error("error in getting next sequence number for this account",i)}finally{this.lock=!1}return t}async initialize(){let{sequence_number:t}=await s({aptosConfig:this.aptosConfig,accountAddress:this.account.accountAddress});this.currentNumber=BigInt(t),this.lastUncommintedNumber=BigInt(t)}async update(){let{sequence_number:t}=await s({aptosConfig:this.aptosConfig,accountAddress:this.account.accountAddress});return this.lastUncommintedNumber=BigInt(t),this.lastUncommintedNumber}async synchronize(){if(this.lastUncommintedNumber!==this.currentNumber){for(;this.lock;)await e(this.sleepTime);this.lock=!0;try{await this.update();let t=n();for(;this.lastUncommintedNumber!==this.currentNumber;)n()-t>this.maxWaitTime?(console.warn(`Waited over 30 seconds for a transaction to commit, re-syncing ${this.account.accountAddress.toString()}`),await this.initialize()):(await e(this.sleepTime),await this.update())}catch(t){console.error("error in synchronizing this account sequence number with the one on chain",t)}finally{this.lock=!1}}}};export{r as a};
|
|
2
|
+
//# sourceMappingURL=chunk-BYHCW7MI.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as K}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as K}from"./chunk-4T75XRI2.mjs";import{i as m,r as u}from"./chunk-G6RLN6ET.mjs";import{a as f}from"./chunk-XTOIL6MB.mjs";import{b as y}from"./chunk-STY74NUA.mjs";var h=class c extends K{constructor(e){let r=m.create(e);super({publicKey:r,...e}),this.publicKey=r}serialize(e){super.serialize(e)}static deserialize(e){let{address:r,proof:l,ephemeralKeyPair:i,jwt:o,uidKey:t,pepper:s,verificationKeyHash:n}=K.partialDeserialize(e),{iss:a,aud:p,uidVal:d}=u({jwt:o,uidKey:t});return new c({address:r,proof:l,ephemeralKeyPair:i,iss:a,uidKey:t,uidVal:d,aud:p,pepper:s,jwt:o,verificationKeyHash:n})}static fromBytes(e){return c.deserialize(new f(y.hexInputToUint8Array(e)))}static create(e){let{address:r,proof:l,jwt:i,ephemeralKeyPair:o,pepper:t,uidKey:s="sub",proofFetchCallback:n,verificationKey:a}=e,{iss:p,aud:d,uidVal:g}=u({jwt:i,uidKey:s});return new c({address:r,proof:l,ephemeralKeyPair:o,iss:p,uidKey:s,uidVal:g,aud:d,pepper:t,jwt:i,proofFetchCallback:n,verificationKeyHash:a?a.hash():void 0})}};export{h as a};
|
|
2
|
+
//# sourceMappingURL=chunk-CRFLR3ZY.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as u,c as d,f as p}from"./chunk-HEAWDTLG.mjs";import{j as l}from"./chunk-42T3UGSW.mjs";import{ScriptComposerWasm as m}from"@aptos-labs/script-composer-pack";var g=class o{constructor(t){this.config=t,this.builder=void 0}async init(){if(!o.transactionComposer){let t=await import("@aptos-labs/script-composer-pack"),{TransactionComposer:e,initSync:n}=t;m.isInitialized||m.init(),n({module:m.wasm}),o.transactionComposer=e}this.builder=o.transactionComposer.single_signer()}async addBatchedCalls(t){let{moduleAddress:e,moduleName:n,functionName:a}=l(t.function),c=this.config.getRequestUrl("Fullnode");await this.builder.load_module(c,`${e}::${n}`),t.typeArguments!==void 0&&await Promise.all(t.typeArguments.map(i=>this.builder.load_type_tag(c,i.toString())));let r=u(t.typeArguments),s=await d(e,n,a,this.config);if(r.length!==s.typeParameters.length)throw new Error(`Type argument count mismatch, expected ${s.typeParameters.length}, received ${r.length}`);let f=t.functionArguments.map((i,h)=>p(i,a,s,h,r));return this.builder.add_batched_call(`${e}::${n}`,a,r.map(i=>i.toString()),f)}build(){return this.builder.generate_batched_calls(!0)}};export{g as a};
|
|
2
|
+
//# sourceMappingURL=chunk-CSG67JHZ.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/transactions/scriptComposer/index.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { ScriptComposerWasm } from \"@aptos-labs/script-composer-pack\";\nimport { AptosApiType, getFunctionParts } from \"../../utils\";\nimport { AptosConfig } from \"../../api/aptosConfig\";\nimport { InputBatchedFunctionData } from \"../types\";\nimport { fetchMoveFunctionAbi, standardizeTypeTags } from \"../transactionBuilder\";\nimport { CallArgument } from \"../../types\";\nimport { convertCallArgument } from \"../transactionBuilder/remoteAbi\";\n\n/**\n * A wrapper class around TransactionComposer, which is a WASM library compiled\n * from aptos-core/aptos-move/script-composer.\n * This class allows the SDK caller to build a transaction that invokes multiple Move functions\n * and allow for arguments to be passed around.\n * */\nexport class AptosScriptComposer {\n private config: AptosConfig;\n\n private builder?: any;\n\n private static transactionComposer?: any;\n\n constructor(aptosConfig: AptosConfig) {\n this.config = aptosConfig;\n this.builder = undefined;\n }\n\n // Initializing the wasm needed for the script composer, must be called\n // before using the composer.\n async init() {\n if (!AptosScriptComposer.transactionComposer) {\n const module = await import(\"@aptos-labs/script-composer-pack\");\n const { TransactionComposer, initSync } = module;\n if (!ScriptComposerWasm.isInitialized) {\n ScriptComposerWasm.init();\n }\n initSync({ module: ScriptComposerWasm.wasm });\n AptosScriptComposer.transactionComposer = TransactionComposer;\n }\n this.builder = AptosScriptComposer.transactionComposer.single_signer();\n }\n\n // Add a move function invocation to the TransactionComposer.\n //\n // Similar to how to create an entry function, the difference is that input arguments could\n // either be a `CallArgument` which represents an abstract value returned from a previous Move call\n // or the regular entry function arguments.\n //\n // The function would also return a list of `CallArgument` that can be passed on to future calls.\n async addBatchedCalls(input: InputBatchedFunctionData): Promise<CallArgument[]> {\n const { moduleAddress, moduleName, functionName } = getFunctionParts(input.function);\n const nodeUrl = this.config.getRequestUrl(AptosApiType.FULLNODE);\n\n // Load the calling module into the builder.\n await this.builder.load_module(nodeUrl, `${moduleAddress}::${moduleName}`);\n\n // Load the calling type arguments into the loader.\n if (input.typeArguments !== undefined) {\n await Promise.all(input.typeArguments.map((typeTag) => this.builder.load_type_tag(nodeUrl, typeTag.toString())));\n }\n const typeArguments = standardizeTypeTags(input.typeArguments);\n const functionAbi = await fetchMoveFunctionAbi(moduleAddress, moduleName, functionName, this.config);\n // Check the type argument count against the ABI\n if (typeArguments.length !== functionAbi.typeParameters.length) {\n throw new Error(\n `Type argument count mismatch, expected ${functionAbi.typeParameters.length}, received ${typeArguments.length}`,\n );\n }\n\n const functionArguments: CallArgument[] = input.functionArguments.map((arg, i) =>\n convertCallArgument(arg, functionName, functionAbi, i, typeArguments),\n );\n\n return this.builder.add_batched_call(\n `${moduleAddress}::${moduleName}`,\n functionName,\n typeArguments.map((arg) => arg.toString()),\n functionArguments,\n );\n }\n\n build(): Uint8Array {\n return this.builder.generate_batched_calls(true);\n }\n}\n"],"mappings":"gGAGA,OAAS,sBAAAA,MAA0B,mCAc5B,IAAMC,EAAN,MAAMC,CAAoB,CAO/B,YAAYC,EAA0B,CACpC,KAAK,OAASA,EACd,KAAK,QAAU,MACjB,CAIA,MAAM,MAAO,CACX,GAAI,CAACD,EAAoB,oBAAqB,CAC5C,IAAME,EAAS,KAAM,QAAO,kCAAkC,EACxD,CAAE,oBAAAC,EAAqB,SAAAC,CAAS,EAAIF,EACrCG,EAAmB,eACtBA,EAAmB,KAAK,EAE1BD,EAAS,CAAE,OAAQC,EAAmB,IAAK,CAAC,EAC5CL,EAAoB,oBAAsBG,CAC5C,CACA,KAAK,QAAUH,EAAoB,oBAAoB,cAAc,CACvE,CASA,MAAM,gBAAgBM,EAA0D,CAC9E,GAAM,CAAE,cAAAC,EAAe,WAAAC,EAAY,aAAAC,CAAa,EAAIC,EAAiBJ,EAAM,QAAQ,EAC7EK,EAAU,KAAK,OAAO,wBAAmC,EAG/D,MAAM,KAAK,QAAQ,YAAYA,EAAS,GAAGJ,CAAa,KAAKC,CAAU,EAAE,EAGrEF,EAAM,gBAAkB,QAC1B,MAAM,QAAQ,IAAIA,EAAM,cAAc,IAAKM,GAAY,KAAK,QAAQ,cAAcD,EAASC,EAAQ,SAAS,CAAC,CAAC,CAAC,EAEjH,IAAMC,EAAgBC,EAAoBR,EAAM,aAAa,EACvDS,EAAc,MAAMC,EAAqBT,EAAeC,EAAYC,EAAc,KAAK,MAAM,EAEnG,GAAII,EAAc,SAAWE,EAAY,eAAe,OACtD,MAAM,IAAI,MACR,0CAA0CA,EAAY,eAAe,MAAM,cAAcF,EAAc,MAAM,EAC/G,EAGF,IAAMI,EAAoCX,EAAM,kBAAkB,IAAI,CAACY,EAAKC,IAC1EC,EAAoBF,EAAKT,EAAcM,EAAaI,EAAGN,CAAa,CACtE,EAEA,OAAO,KAAK,QAAQ,iBAClB,GAAGN,CAAa,KAAKC,CAAU,GAC/BC,EACAI,EAAc,IAAKK,GAAQA,EAAI,SAAS,CAAC,EACzCD,CACF,CACF,CAEA,OAAoB,CAClB,OAAO,KAAK,QAAQ,uBAAuB,EAAI,CACjD,CACF","names":["ScriptComposerWasm","AptosScriptComposer","_AptosScriptComposer","aptosConfig","module","TransactionComposer","initSync","ScriptComposerWasm","input","moduleAddress","moduleName","functionName","getFunctionParts","nodeUrl","typeTag","typeArguments","standardizeTypeTags","functionAbi","fetchMoveFunctionAbi","functionArguments","arg","i","convertCallArgument"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as p}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{d as p}from"./chunk-V2EXS6TM.mjs";import{d as s}from"./chunk-EGZI6EJ2.mjs";import{a as g,b as y}from"./chunk-UTXEW2FT.mjs";import{b as a}from"./chunk-GQX5KMF7.mjs";import{c}from"./chunk-TM6IKHMX.mjs";import{b as u}from"./chunk-Q4C4U6I4.mjs";function P(t){return typeof t=="object"&&t!==null&&"getAnyPublicKey"in t&&typeof t.getAnyPublicKey=="function"}var A=class t{constructor(e){this.signingScheme=2;let{privateKey:r,address:n}=e;this.privateKey=r,this.publicKey=new g(r.publicKey()),this.accountAddress=n?u.from(n):this.publicKey.authKey().derivedAddress()}getAnyPublicKey(){return this.publicKey}static generate(e={}){let{scheme:r=0}=e,n;switch(r){case 0:n=c.generate();break;case 2:n=a.generate();break;default:throw new Error(`Unsupported signature scheme ${r}`)}return new t({privateKey:n})}static fromDerivationPath(e){let{scheme:r=0,path:n,mnemonic:o}=e,i;switch(r){case 0:i=c.fromDerivationPath(n,o);break;case 2:i=a.fromDerivationPath(n,o);break;default:throw new Error(`Unsupported signature scheme ${r}`)}return new t({privateKey:i})}verifySignature(e){return this.publicKey.verifySignature(e)}signWithAuthenticator(e){return new s(this.publicKey,this.sign(e))}signTransactionWithAuthenticator(e){return new s(this.publicKey,this.signTransaction(e))}sign(e){return new y(this.privateKey.sign(e))}signTransaction(e){return this.sign(p(e))}static fromEd25519Account(e){return new t({privateKey:e.privateKey,address:e.accountAddress})}};export{P as a,A as b};
|
|
2
|
+
//# sourceMappingURL=chunk-CXNF73OX.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as a}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{c as a}from"./chunk-OURSLL3I.mjs";import e from"eventemitter3";var i=class extends e{constructor(t){super(),this.config=t}start(t){let{sender:n}=t;this.account=n,this.transactionWorker=new a(this.config,n),this.transactionWorker.start(),this.registerToEvents()}push(t){let{data:n,options:o}=t;for(let r of n)this.transactionWorker.push(r,o)}registerToEvents(){this.transactionWorker.on("transactionSent",async t=>{this.emit("transactionSent",t)}),this.transactionWorker.on("transactionSendFailed",async t=>{this.emit("transactionSendFailed",t)}),this.transactionWorker.on("transactionExecuted",async t=>{this.emit("transactionExecuted",t)}),this.transactionWorker.on("transactionExecutionFailed",async t=>{this.emit("transactionExecutionFailed",t)}),this.transactionWorker.on("executionFinish",async t=>{this.emit("executionFinish",t)})}forSingleAccount(t){try{let{sender:n,data:o,options:r}=t;this.start({sender:n}),this.push({data:o,options:r})}catch(n){throw new Error(`failed to submit transactions with error: ${n}`)}}};export{i as a};
|
|
2
|
+
//# sourceMappingURL=chunk-D6T3NYOA.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{b as o}from"./chunk-EMURYYVO.mjs";import{a as s}from"./chunk-WCMW2L3P.mjs";import{a as i}from"./chunk-FN4C3CKC.mjs";import{b as t}from"./chunk-STY74NUA.mjs";var n=class r extends s{constructor(e){super(),this.value=t.fromHexInput(e)}serialize(e){e.serializeBytes(this.value.toUint8Array())}static deserialize(e){return new r(e.deserializeBytes())}},a=class extends o{constructor(e){super(),this.accountAddress=e}authKey(){return new i({data:this.accountAddress.toUint8Array()})}verifySignature(e){throw new Error("This function is not implemented for AbstractPublicKey.")}serialize(e){throw new Error("This function is not implemented for AbstractPublicKey.")}};export{n as a,a as b};
|
|
2
|
+
//# sourceMappingURL=chunk-DBIZE7G6.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/core/crypto/abstraction.ts"],"sourcesContent":["import { Deserializer, Serializer } from \"../../bcs\";\nimport { HexInput } from \"../../types\";\nimport { AccountAddress } from \"../accountAddress\";\nimport { AuthenticationKey } from \"../authenticationKey\";\nimport { Hex } from \"../hex\";\nimport { AccountPublicKey, VerifySignatureArgs } from \"./publicKey\";\nimport { Signature } from \"./signature\";\n\nexport class AbstractSignature extends Signature {\n readonly value: Hex;\n\n constructor(value: HexInput) {\n super();\n this.value = Hex.fromHexInput(value);\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeBytes(this.value.toUint8Array());\n }\n\n static deserialize(deserializer: Deserializer): AbstractSignature {\n return new AbstractSignature(deserializer.deserializeBytes());\n }\n}\n\nexport class AbstractPublicKey extends AccountPublicKey {\n readonly accountAddress: AccountAddress;\n\n constructor(accountAddress: AccountAddress) {\n super();\n this.accountAddress = accountAddress;\n }\n\n authKey(): AuthenticationKey {\n return new AuthenticationKey({ data: this.accountAddress.toUint8Array() });\n }\n\n // eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars\n verifySignature(args: VerifySignatureArgs): boolean {\n throw new Error(\"This function is not implemented for AbstractPublicKey.\");\n }\n\n // eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars\n serialize(serializer: Serializer): void {\n throw new Error(\"This function is not implemented for AbstractPublicKey.\");\n }\n}\n"],"mappings":"oKAQO,IAAMA,EAAN,MAAMC,UAA0BC,CAAU,CAG/C,YAAYC,EAAiB,CAC3B,MAAM,EACN,KAAK,MAAQC,EAAI,aAAaD,CAAK,CACrC,CAEA,UAAUE,EAA8B,CACtCA,EAAW,eAAe,KAAK,MAAM,aAAa,CAAC,CACrD,CAEA,OAAO,YAAYC,EAA+C,CAChE,OAAO,IAAIL,EAAkBK,EAAa,iBAAiB,CAAC,CAC9D,CACF,EAEaC,EAAN,cAAgCC,CAAiB,CAGtD,YAAYC,EAAgC,CAC1C,MAAM,EACN,KAAK,eAAiBA,CACxB,CAEA,SAA6B,CAC3B,OAAO,IAAIC,EAAkB,CAAE,KAAM,KAAK,eAAe,aAAa,CAAE,CAAC,CAC3E,CAGA,gBAAgBC,EAAoC,CAClD,MAAM,IAAI,MAAM,yDAAyD,CAC3E,CAGA,UAAUN,EAA8B,CACtC,MAAM,IAAI,MAAM,yDAAyD,CAC3E,CACF","names":["AbstractSignature","_AbstractSignature","Signature","value","Hex","serializer","deserializer","AbstractPublicKey","AccountPublicKey","accountAddress","AuthenticationKey","args"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as n}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{c as n}from"./chunk-AC3BISWL.mjs";import{o as g,t as d}from"./chunk-VHNX2NUR.mjs";import{b as s}from"./chunk-Q4C4U6I4.mjs";async function m(e){let{aptosConfig:t,poolAddress:o}=e,r=s.from(o).toStringLong(),i=await n({aptosConfig:t,query:{query:d,variables:{where_condition:{pool_address:{_eq:r}}}}});return i.num_active_delegator_per_pool[0]?i.num_active_delegator_per_pool[0].num_active_delegator:0}async function f(e){let{aptosConfig:t,options:o}=e,r={query:d,variables:{order_by:o?.orderBy}};return(await n({aptosConfig:t,query:r})).num_active_delegator_per_pool}async function A(e){let{aptosConfig:t,delegatorAddress:o,poolAddress:r}=e,a={query:g,variables:{delegatorAddress:s.from(o).toStringLong(),poolAddress:s.from(r).toStringLong()}};return(await n({aptosConfig:t,query:a})).delegated_staking_activities}export{m as a,f as b,A as c};
|
|
2
|
+
//# sourceMappingURL=chunk-DLLDRANJ.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as f}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as f}from"./chunk-4T75XRI2.mjs";import{a as A}from"./chunk-DNWFDS7F.mjs";import{r as y}from"./chunk-G6RLN6ET.mjs";import{b as K}from"./chunk-Q4C4U6I4.mjs";import{a as m}from"./chunk-XTOIL6MB.mjs";var h=class d extends f{constructor(e){let r=A.create(e);super({publicKey:r,...e}),this.publicKey=r,this.audless=e.audless??!1}serialize(e){super.serialize(e),this.publicKey.jwkAddress.serialize(e)}static deserialize(e){let{address:r,proof:l,ephemeralKeyPair:s,jwt:i,uidKey:o,pepper:c,verificationKeyHash:t}=f.partialDeserialize(e),n=K.deserialize(e),{iss:a,aud:p,uidVal:u}=y({jwt:i,uidKey:o});return new d({address:r,proof:l,ephemeralKeyPair:s,iss:a,uidKey:o,uidVal:u,aud:p,pepper:c,jwt:i,verificationKeyHash:t,jwkAddress:n})}static fromBytes(e){return d.deserialize(m.fromHex(e))}static create(e){let{address:r,proof:l,jwt:s,ephemeralKeyPair:i,pepper:o,jwkAddress:c,uidKey:t="sub",proofFetchCallback:n,verificationKey:a}=e,{iss:p,aud:u,uidVal:w}=y({jwt:s,uidKey:t});return new d({address:r,proof:l,ephemeralKeyPair:i,iss:p,uidKey:t,uidVal:w,aud:u,pepper:o,jwkAddress:K.from(c),jwt:s,proofFetchCallback:n,verificationKeyHash:a?a.hash():void 0})}};export{h as a};
|
|
2
|
+
//# sourceMappingURL=chunk-DMS7K76O.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as t}from"./chunk-2FNFUTFJ.mjs";import{a as p}from"./chunk-CSG67JHZ.mjs";import{e as s}from"./chunk-7DPHPPMG.mjs";import{a as i}from"./chunk-KEJAUCQF.mjs";import{c as a}from"./chunk-J7HRQ2IH.mjs";import{b as r}from"./chunk-Q4C4U6I4.mjs";import{a as e}from"./chunk-XTOIL6MB.mjs";var c=class{constructor(n){this.config=n}async simple(n){return t({aptosConfig:this.config,...n})}async scriptComposer(n){let o=new p(this.config);await o.init();let d=(await n.builder(o)).build(),u=await s({aptosConfig:this.config,payload:a.load(new e(d)),...n});return new i(u,n.withFeePayer===!0?r.ZERO:void 0)}async multiAgent(n){return t({aptosConfig:this.config,...n})}};export{c as a};
|
|
2
|
+
//# sourceMappingURL=chunk-DNJQWGB7.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/api/transactionSubmission/build.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { AccountAddress, AccountAddressInput } from \"../../core\";\nimport { generateTransaction } from \"../../internal/transactionSubmission\";\nimport {\n InputGenerateTransactionPayloadData,\n InputGenerateTransactionOptions,\n AptosScriptComposer,\n TransactionPayloadScript,\n generateRawTransaction,\n} from \"../../transactions\";\nimport { MultiAgentTransaction } from \"../../transactions/instances/multiAgentTransaction\";\nimport { SimpleTransaction } from \"../../transactions/instances/simpleTransaction\";\nimport { AptosConfig } from \"../aptosConfig\";\nimport { Deserializer } from \"../../bcs\";\n\n/**\n * A class to handle all `Build` transaction operations.\n * @group Implementation\n */\nexport class Build {\n readonly config: AptosConfig;\n\n /**\n * Initializes a new instance of the Aptos client with the specified configuration.\n * This allows you to interact with the Aptos blockchain using the provided settings.\n *\n * @param config - The configuration settings for the Aptos client.\n * @param config.network - The network to connect to (e.g., TESTNET, MAINNET).\n * @param config.nodeUrl - The URL of the Aptos node to connect to.\n * @param config.account - The account details for authentication.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * async function runExample() {\n * // Create a configuration for the Aptos client\n * const config = new AptosConfig({\n * network: Network.TESTNET, // specify the network\n * nodeUrl: \"https://testnet.aptos.dev\", // specify the node URL\n * });\n *\n * // Initialize the Aptos client\n * const aptos = new Aptos(config);\n *\n * console.log(\"Aptos client initialized:\", aptos);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Implementation\n */\n constructor(config: AptosConfig) {\n this.config = config;\n }\n\n /**\n * Build a simple transaction.\n *\n * This function allows you to create a transaction with specified sender and data.\n *\n * @param args.sender - The sender account address.\n * @param args.data - The transaction data.\n * @param args.options - Optional transaction configurations.\n * @param args.withFeePayer - Whether there is a fee payer for the transaction.\n *\n * @returns SimpleTransaction\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Build a simple transaction\n * const transaction = await aptos.transaction.simple({\n * sender: \"0x1\", // replace with a real sender account address\n * data: {\n * function: \"0x1::aptos_account::transfer\",\n * functionArguments: [\"0x2\", 100], // replace with a real destination account address\n * },\n * options: {\n * gasUnitPrice: 100, // specify your own gas unit price if needed\n * maxGasAmount: 1000, // specify your own max gas amount if needed\n * },\n * });\n *\n * console.log(transaction);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Implementation\n */\n async simple(args: {\n sender: AccountAddressInput;\n data: InputGenerateTransactionPayloadData;\n options?: InputGenerateTransactionOptions;\n withFeePayer?: boolean;\n }): Promise<SimpleTransaction> {\n return generateTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Build a transaction from a series of Move calls.\n *\n * This function allows you to create a transaction with a list of Move calls.\n *\n * Right now we only tested this logic with single signer and we will add support\n * for mutli agent transactions if needed.\n *\n * @param args.sender - The sender account address.\n * @param args.builder - The closure to construct the list of calls.\n * @param args.options - Optional transaction configurations.\n * @param args.withFeePayer - Whether there is a fee payer for the transaction.\n *\n * @returns SimpleTransaction\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Build a transaction from a chained series of Move calls.\n * const transaction = await aptos.transaction.build.scriptComposer({\n * sender: \"0x1\", // replace with a real sender account address\n * builder: builder: async (builder) => {\n * const coin = await builder.addBatchedCalls({\n * function: \"0x1::coin::withdraw\",\n * functionArguments: [CallArgument.new_signer(0), 1],\n * typeArguments: [\"0x1::aptos_coin::AptosCoin\"],\n * });\n *\n * // Pass the returned value from the first function call to the second call\n * const fungibleAsset = await builder.addBatchedCalls({\n * function: \"0x1::coin::coin_to_fungible_asset\",\n * functionArguments: [coin[0]],\n * typeArguments: [\"0x1::aptos_coin::AptosCoin\"],\n * });\n *\n * await builder.addBatchedCalls({\n * function: \"0x1::primary_fungible_store::deposit\",\n * functionArguments: [singleSignerED25519SenderAccount.accountAddress, fungibleAsset[0]],\n * typeArguments: [],\n * });\n * return builder;\n * },\n * options: {\n * gasUnitPrice: 100, // specify your own gas unit price if needed\n * maxGasAmount: 1000, // specify your own max gas amount if needed\n * },\n * });\n *\n * console.log(transaction);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async scriptComposer(args: {\n sender: AccountAddressInput;\n builder: (builder: AptosScriptComposer) => Promise<AptosScriptComposer>;\n options?: InputGenerateTransactionOptions;\n withFeePayer?: boolean;\n }): Promise<SimpleTransaction> {\n const composer = new AptosScriptComposer(this.config);\n await composer.init();\n const builder = await args.builder(composer);\n const bytes = builder.build();\n const rawTxn = await generateRawTransaction({\n aptosConfig: this.config,\n payload: TransactionPayloadScript.load(new Deserializer(bytes)),\n ...args,\n });\n return new SimpleTransaction(rawTxn, args.withFeePayer === true ? AccountAddress.ZERO : undefined);\n }\n\n /**\n * Build a multi-agent transaction that allows multiple signers to authorize a transaction.\n *\n * @param args - The parameters for creating the multi-agent transaction.\n * @param args.sender - The sender account address.\n * @param args.data - The transaction data.\n * @param args.secondarySignerAddresses - An array of the secondary signers' account addresses.\n * @param args.options - Optional transaction configurations.\n * @param args.withFeePayer - Whether there is a fee payer for the transaction.\n *\n * @returns MultiAgentTransaction\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Build a multi-agent transaction\n * const transaction = await aptos.multiAgent({\n * sender: \"0x1\", // replace with a real sender account address\n * data: {\n * // Transaction data structure\n * function: \"0x1::aptos_account::transfer\",\n * functionArguments: [\"0x2\", 100], // replace with a real destination account address and amount\n * },\n * secondarySignerAddresses: [\"0x3\", \"0x4\"], // replace with real secondary signer addresses\n * options: {\n * // Optional transaction configurations\n * maxGasAmount: \"1000\",\n * gasUnitPrice: \"1\",\n * },\n * });\n *\n * console.log(transaction);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Implementation\n */\n async multiAgent(args: {\n sender: AccountAddressInput;\n data: InputGenerateTransactionPayloadData;\n secondarySignerAddresses: AccountAddressInput[];\n options?: InputGenerateTransactionOptions;\n withFeePayer?: boolean;\n }): Promise<MultiAgentTransaction> {\n return generateTransaction({ aptosConfig: this.config, ...args });\n }\n}\n"],"mappings":"+RAqBO,IAAMA,EAAN,KAAY,CAgCjB,YAAYC,EAAqB,CAC/B,KAAK,OAASA,CAChB,CAyCA,MAAM,OAAOC,EAKkB,CAC7B,OAAOC,EAAoB,CAAE,YAAa,KAAK,OAAQ,GAAGD,CAAK,CAAC,CAClE,CA4DA,MAAM,eAAeA,EAKU,CAC7B,IAAME,EAAW,IAAIC,EAAoB,KAAK,MAAM,EACpD,MAAMD,EAAS,KAAK,EAEpB,IAAME,GADU,MAAMJ,EAAK,QAAQE,CAAQ,GACrB,MAAM,EACtBG,EAAS,MAAMC,EAAuB,CAC1C,YAAa,KAAK,OAClB,QAASC,EAAyB,KAAK,IAAIC,EAAaJ,CAAK,CAAC,EAC9D,GAAGJ,CACL,CAAC,EACD,OAAO,IAAIS,EAAkBJ,EAAQL,EAAK,eAAiB,GAAOU,EAAe,KAAO,MAAS,CACnG,CA4CA,MAAM,WAAWV,EAMkB,CACjC,OAAOC,EAAoB,CAAE,YAAa,KAAK,OAAQ,GAAGD,CAAK,CAAC,CAClE,CACF","names":["Build","config","args","generateTransaction","composer","AptosScriptComposer","bytes","rawTxn","generateRawTransaction","TransactionPayloadScript","Deserializer","SimpleTransaction","AccountAddress"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{i as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{i as s}from"./chunk-G6RLN6ET.mjs";import{b as c}from"./chunk-EMURYYVO.mjs";import{a as d}from"./chunk-FN4C3CKC.mjs";import{b as i}from"./chunk-Q4C4U6I4.mjs";import{b as n}from"./chunk-EBMEXURY.mjs";var u=class r extends c{constructor(e,t){super(),this.jwkAddress=i.from(e),this.keylessPublicKey=t}authKey(){let e=new n;return e.serializeU32AsUleb128(4),e.serializeFixedBytes(this.bcsToBytes()),d.fromSchemeAndBytes({scheme:2,input:e.toUint8Array()})}verifySignature(e){throw new Error("Not yet implemented")}serialize(e){this.jwkAddress.serialize(e),this.keylessPublicKey.serialize(e)}static deserialize(e){let t=i.deserialize(e),l=s.deserialize(e);return new r(t,l)}static isPublicKey(e){return e instanceof r}static create(e){return new r(e.jwkAddress,s.create(e))}static fromJwtAndPepper(e){return new r(e.jwkAddress,s.fromJwtAndPepper(e))}static isInstance(e){return"jwkAddress"in e&&e.jwkAddress instanceof i&&"keylessPublicKey"in e&&e.keylessPublicKey instanceof s}};export{u as a};
|
|
2
|
+
//# sourceMappingURL=chunk-DNWFDS7F.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as u,c as r}from"./chunk-IDTLNF4M.mjs";import{e as t}from"./chunk-ORMOQWWH.mjs";import{b as o}from"./chunk-Q4C4U6I4.mjs";import{a as i}from"./chunk-EBMEXURY.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-DWJ3PGWE.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as z,b as m}from"./chunk-I7YHK6ZF.mjs";import{a as E,b as K}from"./chunk-PNSF3E67.mjs";import{a as x,b as M}from"./chunk-UTXEW2FT.mjs";import{b as h,d as A}from"./chunk-TM6IKHMX.mjs";import{j as S,k as f}from"./chunk-42T3UGSW.mjs";import{b as d}from"./chunk-Q4C4U6I4.mjs";import{a as g}from"./chunk-EBMEXURY.mjs";import{b as r}from"./chunk-STY74NUA.mjs";var n=class extends g{static deserialize(e){let i=e.deserializeUleb128AsU32();switch(i){case 0:return a.load(e);case 1:return u.load(e);case 2:return o.load(e);case 3:return l.load(e);case 4:return y.load(e);case 5:return p.load(e);default:throw new Error(`Unknown variant index for AccountAuthenticator: ${i}`)}}isEd25519(){return this instanceof a}isMultiEd25519(){return this instanceof u}isSingleKey(){return this instanceof o}isMultiKey(){return this instanceof l}},a=class s extends n{constructor(e,i){super(),this.public_key=e,this.signature=i}serialize(e){e.serializeU32AsUleb128(0),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let i=h.deserialize(e),t=A.deserialize(e);return new s(i,t)}},u=class s extends n{constructor(e,i){super(),this.public_key=e,this.signature=i}serialize(e){e.serializeU32AsUleb128(1),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let i=z.deserialize(e),t=m.deserialize(e);return new s(i,t)}},o=class s extends n{constructor(e,i){super(),this.public_key=e,this.signature=i}serialize(e){e.serializeU32AsUleb128(2),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let i=x.deserialize(e),t=M.deserialize(e);return new s(i,t)}},l=class s extends n{constructor(e,i){super(),this.public_keys=e,this.signatures=i}serialize(e){e.serializeU32AsUleb128(3),this.public_keys.serialize(e),this.signatures.serialize(e)}static load(e){let i=E.deserialize(e),t=K.deserialize(e);return new s(i,t)}},y=class s extends n{serialize(e){e.serializeU32AsUleb128(4)}static load(e){return new s}},p=class s extends n{constructor(e,i,t){if(super(),!f(e))throw new Error(`Invalid function info ${e} passed into AccountAuthenticatorAbstraction`);this.functionInfo=e,this.authenticator=r.fromHexInput(t),this.signingMessageDigest=r.fromHexInput(r.fromHexInput(i).toUint8Array())}serialize(e){e.serializeU32AsUleb128(5);let{moduleAddress:i,moduleName:t,functionName:c}=S(this.functionInfo);d.fromString(i).serialize(e),e.serializeStr(t),e.serializeStr(c),e.serializeU32AsUleb128(0),e.serializeBytes(this.signingMessageDigest.toUint8Array()),e.serializeFixedBytes(this.authenticator.toUint8Array())}static load(e){let i=d.deserialize(e),t=e.deserializeStr(),c=e.deserializeStr(),b=e.deserializeUleb128AsU32();if(b===0){let U=e.deserializeBytes(),k=e.deserializeFixedBytes(e.remaining());return new s(`${i}::${t}::${c}`,U,k)}throw new Error(`Unknown variant index for AccountAuthenticatorAbstraction: ${b}`)}};export{n as a,a as b,u as c,o as d,l as e,y as f,p as g};
|
|
2
|
+
//# sourceMappingURL=chunk-EGZI6EJ2.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, HexInput, MoveFunctionId } from \"../../types\";\nimport { AbstractionAuthDataVariant } from \"../../types/abstraction\";\nimport { AccountAddress, Hex } from \"../../core\";\nimport { getFunctionParts, isValidFunctionInfo } from \"../../utils/helpers\";\n\n/**\n * Represents an account authenticator that can handle multiple authentication variants.\n * This class serves as a base for different types of account authenticators, allowing for serialization\n * and deserialization of various authenticator types.\n *\n * @extends Serializable\n * @group Implementation\n * @category Transactions\n */\nexport abstract class AccountAuthenticator extends Serializable {\n abstract serialize(serializer: Serializer): void;\n\n /**\n * Deserializes an AccountAuthenticator from the provided deserializer.\n * This function helps in reconstructing the AccountAuthenticator object based on the variant index.\n *\n * @param deserializer - The deserializer instance used to read the serialized data.\n * @group Implementation\n * @category Transactions\n */\n static deserialize(deserializer: Deserializer): AccountAuthenticator {\n const index = deserializer.deserializeUleb128AsU32();\n switch (index) {\n case AccountAuthenticatorVariant.Ed25519:\n return AccountAuthenticatorEd25519.load(deserializer);\n case AccountAuthenticatorVariant.MultiEd25519:\n return AccountAuthenticatorMultiEd25519.load(deserializer);\n case AccountAuthenticatorVariant.SingleKey:\n return AccountAuthenticatorSingleKey.load(deserializer);\n case AccountAuthenticatorVariant.MultiKey:\n return AccountAuthenticatorMultiKey.load(deserializer);\n case AccountAuthenticatorVariant.NoAccountAuthenticator:\n return AccountAuthenticatorNoAccountAuthenticator.load(deserializer);\n case AccountAuthenticatorVariant.Abstraction:\n return AccountAuthenticatorAbstraction.load(deserializer);\n default:\n throw new Error(`Unknown variant index for AccountAuthenticator: ${index}`);\n }\n }\n\n /**\n * Determines if the current instance is an Ed25519 account authenticator.\n *\n * @returns {boolean} True if the instance is of type AccountAuthenticatorEd25519, otherwise false.\n * @group Implementation\n * @category Transactions\n */\n isEd25519(): this is AccountAuthenticatorEd25519 {\n return this instanceof AccountAuthenticatorEd25519;\n }\n\n /**\n * Determines if the current instance is of type AccountAuthenticatorMultiEd25519.\n *\n * @returns {boolean} True if the instance is a multi-signature Ed25519 account authenticator, otherwise false.\n * @group Implementation\n * @category Transactions\n */\n isMultiEd25519(): this is AccountAuthenticatorMultiEd25519 {\n return this instanceof AccountAuthenticatorMultiEd25519;\n }\n\n /**\n * Determines if the current instance is of the type AccountAuthenticatorSingleKey.\n *\n * @returns {boolean} True if the instance is an AccountAuthenticatorSingleKey, otherwise false.\n * @group Implementation\n * @category Transactions\n */\n isSingleKey(): this is AccountAuthenticatorSingleKey {\n return this instanceof AccountAuthenticatorSingleKey;\n }\n\n /**\n * Determine if the current instance is of type AccountAuthenticatorMultiKey.\n *\n * @returns {boolean} Returns true if the instance is an AccountAuthenticatorMultiKey, otherwise false.\n * @group Implementation\n * @category Transactions\n */\n isMultiKey(): this is AccountAuthenticatorMultiKey {\n return this instanceof AccountAuthenticatorMultiKey;\n }\n}\n\n/**\n * Represents an Ed25519 transaction authenticator for multi-signer transactions.\n * This class encapsulates the account's Ed25519 public key and signature.\n *\n * @param public_key - The Ed25519 public key associated with the account.\n * @param signature - The Ed25519 signature for the account.\n * @group Implementation\n * @category Transactions\n */\nexport class AccountAuthenticatorEd25519 extends AccountAuthenticator {\n public readonly public_key: Ed25519PublicKey;\n\n public readonly signature: Ed25519Signature;\n\n /**\n * Creates an instance of the class with the specified public keys and signatures.\n *\n * @param public_key The public key used for verification.\n * @param signature The signatures corresponding to the public keys.\n * @group Implementation\n * @category Transactions\n */\n constructor(public_key: Ed25519PublicKey, signature: Ed25519Signature) {\n super();\n this.public_key = public_key;\n this.signature = signature;\n }\n\n /**\n * Serializes the account authenticator data into the provided serializer.\n * This function captures the multi-key variant, public keys, and signatures for serialization.\n *\n * @param serializer - The serializer instance used to perform the serialization.\n * @group Implementation\n * @category Transactions\n */\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(AccountAuthenticatorVariant.Ed25519);\n this.public_key.serialize(serializer);\n this.signature.serialize(serializer);\n }\n\n /**\n * Loads an instance of AccountAuthenticatorMultiKey from the provided deserializer.\n * This function helps in reconstructing the authenticator object using the deserialized public keys and signatures.\n *\n * @param deserializer - The deserializer used to extract the necessary data for loading the authenticator.\n * @group Implementation\n * @category Transactions\n */\n static load(deserializer: Deserializer): AccountAuthenticatorEd25519 {\n const public_key = Ed25519PublicKey.deserialize(deserializer);\n const signature = Ed25519Signature.deserialize(deserializer);\n return new AccountAuthenticatorEd25519(public_key, signature);\n }\n}\n\n/**\n * Represents a transaction authenticator for Multi Ed25519, designed for multi-signer transactions.\n *\n * @param public_key - The MultiEd25519 public key of the account.\n * @param signature - The MultiEd25519 signature of the account.\n * @group Implementation\n * @category Transactions\n */\nexport class AccountAuthenticatorMultiEd25519 extends AccountAuthenticator {\n public readonly public_key: MultiEd25519PublicKey;\n\n public readonly signature: MultiEd25519Signature;\n\n constructor(public_key: MultiEd25519PublicKey, signature: MultiEd25519Signature) {\n super();\n this.public_key = public_key;\n this.signature = signature;\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(AccountAuthenticatorVariant.MultiEd25519);\n this.public_key.serialize(serializer);\n this.signature.serialize(serializer);\n }\n\n static load(deserializer: Deserializer): AccountAuthenticatorMultiEd25519 {\n const public_key = MultiEd25519PublicKey.deserialize(deserializer);\n const signature = MultiEd25519Signature.deserialize(deserializer);\n return new AccountAuthenticatorMultiEd25519(public_key, signature);\n }\n}\n\n/**\n * Represents an account authenticator that utilizes a single key for signing.\n * This class is designed to handle authentication using a public key and its corresponding signature.\n *\n * @param public_key - The public key used for authentication.\n * @param signature - The signature associated with the public key.\n * @group Implementation\n * @category Transactions\n */\nexport class AccountAuthenticatorSingleKey extends AccountAuthenticator {\n public readonly public_key: AnyPublicKey;\n\n public readonly signature: AnySignature;\n\n constructor(public_key: AnyPublicKey, signature: AnySignature) {\n super();\n this.public_key = public_key;\n this.signature = signature;\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(AccountAuthenticatorVariant.SingleKey);\n this.public_key.serialize(serializer);\n this.signature.serialize(serializer);\n }\n\n static load(deserializer: Deserializer): AccountAuthenticatorSingleKey {\n const public_key = AnyPublicKey.deserialize(deserializer);\n const signature = AnySignature.deserialize(deserializer);\n return new AccountAuthenticatorSingleKey(public_key, signature);\n }\n}\n\n/**\n * Represents an account authenticator that supports multiple keys and signatures for multi-signature scenarios.\n *\n * @param public_keys - The public keys used for authentication.\n * @param signatures - The signatures corresponding to the public keys.\n * @group Implementation\n * @category Transactions\n */\nexport class AccountAuthenticatorMultiKey extends AccountAuthenticator {\n public readonly public_keys: MultiKey;\n\n public readonly signatures: MultiKeySignature;\n\n constructor(public_keys: MultiKey, signatures: MultiKeySignature) {\n super();\n this.public_keys = public_keys;\n this.signatures = signatures;\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(AccountAuthenticatorVariant.MultiKey);\n this.public_keys.serialize(serializer);\n this.signatures.serialize(serializer);\n }\n\n static load(deserializer: Deserializer): AccountAuthenticatorMultiKey {\n const public_keys = MultiKey.deserialize(deserializer);\n const signatures = MultiKeySignature.deserialize(deserializer);\n return new AccountAuthenticatorMultiKey(public_keys, signatures);\n }\n}\n\n/**\n * AccountAuthenticatorNoAccountAuthenticator for no account authenticator\n * It represents the absence of a public key for transaction simulation.\n * It allows skipping the public/auth key check during the simulation.\n */\nexport class AccountAuthenticatorNoAccountAuthenticator extends AccountAuthenticator {\n // eslint-disable-next-line class-methods-use-this\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(AccountAuthenticatorVariant.NoAccountAuthenticator);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static load(deserializer: Deserializer): AccountAuthenticatorNoAccountAuthenticator {\n return new AccountAuthenticatorNoAccountAuthenticator();\n }\n}\n\nexport class AccountAuthenticatorAbstraction extends AccountAuthenticator {\n public readonly functionInfo: string;\n\n public readonly signingMessageDigest: Hex;\n\n public readonly authenticator: Hex;\n\n constructor(functionInfo: string, signingMessageDigest: HexInput, authenticator: HexInput) {\n super();\n if (!isValidFunctionInfo(functionInfo)) {\n throw new Error(`Invalid function info ${functionInfo} passed into AccountAuthenticatorAbstraction`);\n }\n this.functionInfo = functionInfo;\n this.authenticator = Hex.fromHexInput(authenticator);\n this.signingMessageDigest = Hex.fromHexInput(Hex.fromHexInput(signingMessageDigest).toUint8Array());\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(AccountAuthenticatorVariant.Abstraction);\n const { moduleAddress, moduleName, functionName } = getFunctionParts(this.functionInfo as MoveFunctionId);\n AccountAddress.fromString(moduleAddress).serialize(serializer);\n serializer.serializeStr(moduleName);\n serializer.serializeStr(functionName);\n serializer.serializeU32AsUleb128(AbstractionAuthDataVariant.V1);\n serializer.serializeBytes(this.signingMessageDigest.toUint8Array());\n serializer.serializeFixedBytes(this.authenticator.toUint8Array());\n }\n\n static load(deserializer: Deserializer): AccountAuthenticatorAbstraction {\n const moduleAddress = AccountAddress.deserialize(deserializer);\n const moduleName = deserializer.deserializeStr();\n const functionName = deserializer.deserializeStr();\n const variant = deserializer.deserializeUleb128AsU32();\n if (variant === AbstractionAuthDataVariant.V1) {\n const signingMessageDigest = deserializer.deserializeBytes();\n const authenticator = deserializer.deserializeFixedBytes(deserializer.remaining());\n return new AccountAuthenticatorAbstraction(\n `${moduleAddress}::${moduleName}::${functionName}`,\n signingMessageDigest,\n authenticator,\n );\n }\n throw new Error(`Unknown variant index for AccountAuthenticatorAbstraction: ${variant}`);\n }\n}\n"],"mappings":"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","names":["AccountAuthenticator","Serializable","deserializer","index","AccountAuthenticatorEd25519","AccountAuthenticatorMultiEd25519","AccountAuthenticatorSingleKey","AccountAuthenticatorMultiKey","AccountAuthenticatorNoAccountAuthenticator","AccountAuthenticatorAbstraction","_AccountAuthenticatorEd25519","public_key","signature","serializer","Ed25519PublicKey","Ed25519Signature","_AccountAuthenticatorMultiEd25519","MultiEd25519PublicKey","MultiEd25519Signature","_AccountAuthenticatorSingleKey","AnyPublicKey","AnySignature","_AccountAuthenticatorMultiKey","public_keys","signatures","MultiKey","MultiKeySignature","_AccountAuthenticatorNoAccountAuthenticator","_AccountAuthenticatorAbstraction","functionInfo","signingMessageDigest","authenticator","isValidFunctionInfo","Hex","moduleAddress","moduleName","functionName","getFunctionParts","AccountAddress","variant"]}
|
|
@@ -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.34.0\";\n"],"mappings":"AAQO,IAAMA,EAAU","names":["VERSION"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as S,c as k,d as R,e as V}from"./chunk-GOXRBEIJ.mjs";import{a as M}from"./chunk-XJJVJOX5.mjs";import{a as E,b as w}from"./chunk-6PBMD2BQ.mjs";import{b as _,d as U}from"./chunk-TM6IKHMX.mjs";import{b as C}from"./chunk-EMURYYVO.mjs";import{a as f}from"./chunk-WCMW2L3P.mjs";import{a as P}from"./chunk-FN4C3CKC.mjs";import{a as D}from"./chunk-YOZBVVKL.mjs";import{b as g}from"./chunk-V7G2EDNR.mjs";import{d as l}from"./chunk-BUTMGMSD.mjs";import{b as B}from"./chunk-42T3UGSW.mjs";import{b as m}from"./chunk-Q4C4U6I4.mjs";import{a as y,b as K}from"./chunk-EBMEXURY.mjs";import{a as h}from"./chunk-XTOIL6MB.mjs";import{b as p,c as T}from"./chunk-STY74NUA.mjs";import{jwtDecode as W}from"jwt-decode";import{sha3_256 as $}from"@noble/hashes/sha3";var He=1e7,Z=120,Y=30,X=330,Te=120,Pe=350,Ce=300,_e=93,o=class o extends C{constructor(e,t){super();let r=p.fromHexInput(t).toUint8Array();if(r.length!==o.ID_COMMITMENT_LENGTH)throw new Error(`Id Commitment length in bytes should be ${o.ID_COMMITMENT_LENGTH}`);this.iss=e,this.idCommitment=r}authKey(){let e=new K;return e.serializeU32AsUleb128(3),e.serializeFixedBytes(this.bcsToBytes()),P.fromSchemeAndBytes({scheme:2,input:e.toUint8Array()})}verifySignature(e){throw new Error("Not yet implemented")}serialize(e){e.serializeStr(this.iss),e.serializeBytes(this.idCommitment)}static deserialize(e){let t=e.deserializeStr(),r=e.deserializeBytes();return new o(t,r)}static load(e){let t=e.deserializeStr(),r=e.deserializeBytes();return new o(t,r)}static isPublicKey(e){return e instanceof o}static create(e){return J(e),new o(e.iss,J(e))}static fromJwtAndPepper(e){let{jwt:t,pepper:r,uidKey:s="sub"}=e,a=W(t);if(typeof a.iss!="string")throw new Error("iss was not found");if(typeof a.aud!="string")throw new Error("aud was not found or an array of values");let n=a[s];return o.create({iss:a.iss,uidKey:s,uidVal:n,aud:a.aud,pepper:r})}static isInstance(e){return"iss"in e&&typeof e.iss=="string"&&"idCommitment"in e&&e.idCommitment instanceof Uint8Array}};o.ID_COMMITMENT_LENGTH=32;var G=o;function J(i){let{uidKey:e,uidVal:t,aud:r,pepper:s}=i,a=[k(p.fromHexInput(s).toUint8Array()),S(r,Z),S(t,X),S(e,Y)];return R(V(a),G.ID_COMMITMENT_LENGTH)}var O=class i extends f{constructor(e){super();let{jwtHeader:t,ephemeralCertificate:r,expiryDateSecs:s,ephemeralPublicKey:a,ephemeralSignature:n}=e;this.jwtHeader=t,this.ephemeralCertificate=r,this.expiryDateSecs=s,this.ephemeralPublicKey=a,this.ephemeralSignature=n}getJwkKid(){return ee(this.jwtHeader).kid}serialize(e){this.ephemeralCertificate.serialize(e),e.serializeStr(this.jwtHeader),e.serializeU64(this.expiryDateSecs),this.ephemeralPublicKey.serialize(e),this.ephemeralSignature.serialize(e)}static deserialize(e){let t=x.deserialize(e),r=e.deserializeStr(),s=e.deserializeU64(),a=E.deserialize(e),n=w.deserialize(e);return new i({jwtHeader:r,expiryDateSecs:Number(s),ephemeralCertificate:t,ephemeralPublicKey:a,ephemeralSignature:n})}static getSimulationSignature(){return new i({jwtHeader:"{}",ephemeralCertificate:new x(new z({proof:new b(new A({a:new Uint8Array(32),b:new Uint8Array(64),c:new Uint8Array(32)}),0),expHorizonSecs:0}),0),expiryDateSecs:0,ephemeralPublicKey:new E(new _(new Uint8Array(32))),ephemeralSignature:new w(new U(new Uint8Array(64)))})}static isSignature(e){return e instanceof i}},x=class i extends f{constructor(e,t){super(),this.signature=e,this.variant=t}toUint8Array(){return this.signature.toUint8Array()}serialize(e){e.serializeU32AsUleb128(this.variant),this.signature.serialize(e)}static deserialize(e){let t=e.deserializeUleb128AsU32();switch(t){case 0:return new i(z.deserialize(e),t);default:throw new Error(`Unknown variant index for EphemeralCertificate: ${t}`)}}},c=class i extends y{constructor(e){if(super(),this.data=p.fromHexInput(e).toUint8Array(),this.data.length!==32)throw new Error("Input needs to be 32 bytes")}serialize(e){e.serializeFixedBytes(this.data)}static deserialize(e){let t=e.deserializeFixedBytes(32);return new i(t)}},d=class i extends y{constructor(e){if(super(),this.data=p.fromHexInput(e).toUint8Array(),this.data.length!==64)throw new Error("Input needs to be 64 bytes")}serialize(e){e.serializeFixedBytes(this.data)}static deserialize(e){let t=e.deserializeFixedBytes(64);return new i(t)}},A=class i extends M{constructor(e){super();let{a:t,b:r,c:s}=e;this.a=new c(t),this.b=new d(r),this.c=new c(s)}serialize(e){this.a.serialize(e),this.b.serialize(e),this.c.serialize(e)}static deserialize(e){let t=c.deserialize(e).bcsToBytes(),r=d.deserialize(e).bcsToBytes(),s=c.deserialize(e).bcsToBytes();return new i({a:t,b:r,c:s})}},b=class i extends y{constructor(e,t){super(),this.proof=e,this.variant=t}serialize(e){e.serializeU32AsUleb128(this.variant),this.proof.serialize(e)}static deserialize(e){let t=e.deserializeUleb128AsU32();switch(t){case 0:return new i(A.deserialize(e),t);default:throw new Error(`Unknown variant index for ZkProof: ${t}`)}}},z=class i extends f{constructor(e){super();let{proof:t,expHorizonSecs:r,trainingWheelsSignature:s,extraField:a,overrideAudVal:n}=e;this.proof=t,this.expHorizonSecs=r,this.trainingWheelsSignature=s,this.extraField=a,this.overrideAudVal=n}static fromBytes(e){return i.deserialize(new h(e))}serialize(e){this.proof.serialize(e),e.serializeU64(this.expHorizonSecs),e.serializeOption(this.extraField),e.serializeOption(this.overrideAudVal),e.serializeOption(this.trainingWheelsSignature)}static deserialize(e){let t=b.deserialize(e),r=Number(e.deserializeU64()),s=e.deserializeOption("string"),a=e.deserializeOption("string"),n=e.deserializeOption(w);return new i({proof:t,expHorizonSecs:r,trainingWheelsSignature:n,extraField:s,overrideAudVal:a})}},v=class i{constructor(e,t){this.verificationKey=e,this.maxExpHorizonSecs=t}static create(e,t){return new i(new I({alphaG1:e.alpha_g1,betaG2:e.beta_g2,deltaG2:e.delta_g2,gammaAbcG1:e.gamma_abc_g1,gammaG2:e.gamma_g2}),t)}},I=class i{constructor(e){let{alphaG1:t,betaG2:r,deltaG2:s,gammaAbcG1:a,gammaG2:n}=e;this.alphaG1=new c(t),this.betaG2=new d(r),this.deltaG2=new d(s),this.gammaAbcG1=[new c(a[0]),new c(a[1])],this.gammaG2=new d(n)}hash(){let e=new K;return this.serialize(e),$.create().update(e.toUint8Array()).digest()}serialize(e){this.alphaG1.serialize(e),this.betaG2.serialize(e),this.deltaG2.serialize(e),this.gammaAbcG1[0].serialize(e),this.gammaAbcG1[1].serialize(e),this.gammaG2.serialize(e)}static fromGroth16VerificationKeyResponse(e){return new i({alphaG1:e.alpha_g1,betaG2:e.beta_g2,deltaG2:e.delta_g2,gammaAbcG1:e.gamma_abc_g1,gammaG2:e.gamma_g2})}};async function Ue(i){let{aptosConfig:e}=i;try{return await D(async()=>{let t=await q(i),r=await Q(i);return v.create(r,Number(t.max_exp_horizon_secs))},`keyless-configuration-${e.network}`,1e3*60*5)()}catch(t){throw t instanceof l?t:l.fromErrorType({type:25,error:t})}}function ke(i){let{jwt:e,uidKey:t="sub"}=i,r;try{r=W(e)}catch(a){throw l.fromErrorType({type:12,details:`Failed to parse JWT - ${B(a)}`})}if(typeof r.iss!="string")throw l.fromErrorType({type:12,details:"JWT is missing 'iss' in the payload. This should never happen."});if(typeof r.aud!="string")throw l.fromErrorType({type:12,details:"JWT is missing 'aud' in the payload or 'aud' is an array of values."});let s=r[t];return{iss:r.iss,aud:r.aud,uidVal:s}}async function q(i){let{aptosConfig:e,options:t}=i,r="0x1::keyless_account::Configuration";try{let{data:s}=await g({aptosConfig:e,originMethod:"getKeylessConfigurationResource",path:`accounts/${m.from("0x1").toString()}/resource/${r}`,params:{ledger_version:t?.ledgerVersion}});return s.data}catch(s){throw l.fromErrorType({type:22,error:s})}}async function Q(i){let{aptosConfig:e,options:t}=i,r="0x1::keyless_account::Groth16VerificationKey";try{let{data:s}=await g({aptosConfig:e,originMethod:"getGroth16VerificationKeyResource",path:`accounts/${m.from("0x1").toString()}/resource/${r}`,params:{ledger_version:t?.ledgerVersion}});return s.data}catch(s){throw l.fromErrorType({type:23,error:s})}}async function Re(i){let{aptosConfig:e,jwkAddr:t,options:r}=i,s;if(t){let n="0x1::jwks::FederatedJWKs",{data:u}=await g({aptosConfig:e,originMethod:"getKeylessJWKs",path:`accounts/${m.from(t).toString()}/resource/${n}`,params:{ledger_version:r?.ledgerVersion}});s=u}else{let n="0x1::jwks::PatchedJWKs",{data:u}=await g({aptosConfig:e,originMethod:"getKeylessJWKs",path:`accounts/0x1/resource/${n}`,params:{ledger_version:r?.ledgerVersion}});s=u}let a=new Map;for(let n of s.data.jwks.entries){let u=[];for(let j of n.jwks){let{data:L}=j.variant,N=new h(p.fromHexInput(L).toUint8Array()),F=H.deserialize(N);u.push(F)}a.set(T(n.issuer),u)}return a}var H=class i extends y{constructor(e){super();let{kid:t,kty:r,alg:s,e:a,n}=e;this.kid=t,this.kty=r,this.alg=s,this.e=a,this.n=n}serialize(e){e.serializeStr(this.kid),e.serializeStr(this.kty),e.serializeStr(this.alg),e.serializeStr(this.e),e.serializeStr(this.n)}static fromMoveStruct(e){let{data:t}=e.variant,r=new h(p.fromHexInput(t).toUint8Array());return i.deserialize(r)}static deserialize(e){let t=e.deserializeStr(),r=e.deserializeStr(),s=e.deserializeStr(),a=e.deserializeStr(),n=e.deserializeStr();return new i({kid:t,kty:r,alg:s,n:a,e:n})}};function ee(i){try{let e=JSON.parse(i);if(e.kid===void 0)throw new Error("JWT header missing kid");return e}catch{throw new Error("Failed to parse JWT header.")}}export{He as a,Z as b,Y as c,X as d,Te as e,Pe as f,Ce as g,_e as h,G as i,O as j,x as k,A as l,b as m,z as n,v as o,I as p,Ue as q,ke as r,Re as s,H as t,ee as u};
|
|
2
|
+
//# sourceMappingURL=chunk-G6RLN6ET.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as m}from"./chunk-DPW6ELCQ.mjs";import{a as u}from"./chunk-ROT6S6BM.mjs";import{a as f}from"./chunk-EMURYYVO.mjs";import{a as S}from"./chunk-WCMW2L3P.mjs";import{e as h,j as d}from"./chunk-C3Q23D22.mjs";import{a as g}from"./chunk-EBMEXURY.mjs";import{b as s}from"./chunk-STY74NUA.mjs";import{sha3_256 as H}from"@noble/hashes/sha3";import{secp256k1 as y}from"@noble/curves/secp256k1";import{HDKey as A}from"@scure/bip32";var i=class i extends f{constructor(e){super();let t=s.fromHexInput(e),{length:r}=t.toUint8Array();if(r===i.LENGTH)this.key=t;else if(r===i.COMPRESSED_LENGTH){let o=y.ProjectivePoint.fromHex(t.toUint8Array());this.key=s.fromHexInput(o.toRawBytes(!1))}else throw new Error(`PublicKey length should be ${i.LENGTH} or ${i.COMPRESSED_LENGTH}, received ${r}`)}verifySignature(e){let{message:t,signature:r}=e,o=m(t),c=s.fromHexInput(o).toUint8Array(),x=H(c),P=r.toUint8Array();return y.verify(P,x,this.key.toUint8Array(),{lowS:!0})}toUint8Array(){return this.key.toUint8Array()}serialize(e){e.serializeBytes(this.key.toUint8Array())}deserialize(e){let t=e.deserializeBytes();return new l(t)}static deserialize(e){let t=e.deserializeBytes();return new i(t)}static isPublicKey(e){return e instanceof i}static isInstance(e){return"key"in e&&e.key?.data?.length===i.LENGTH}};i.LENGTH=65,i.COMPRESSED_LENGTH=33;var p=i,n=class n extends g{constructor(e,t){super();let r=u.parseHexInput(e,"secp256k1",t);if(r.toUint8Array().length!==n.LENGTH)throw new Error(`PrivateKey length should be ${n.LENGTH}`);this.key=r}static generate(){let e=y.utils.randomPrivateKey();return new n(e,!1)}static fromDerivationPath(e,t){if(!h(e))throw new Error(`Invalid derivation path ${e}`);return n.fromDerivationPathInner(e,d(t))}static fromDerivationPathInner(e,t){let{privateKey:r}=A.fromMasterSeed(t).derive(e);if(r===null)throw new Error("Invalid key");return new n(r,!1)}sign(e){let t=m(e),r=s.fromHexInput(t),o=H(r.toUint8Array()),c=y.sign(o,this.key.toUint8Array(),{lowS:!0});return new l(c.toCompactRawBytes())}publicKey(){let e=y.getPublicKey(this.key.toUint8Array(),!1);return new p(e)}toUint8Array(){return this.key.toUint8Array()}toString(){return this.toHexString()}toHexString(){return this.key.toString()}toAIP80String(){return u.formatPrivateKey(this.key.toString(),"secp256k1")}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let t=e.deserializeBytes();return new n(t,!1)}static isPrivateKey(e){return e instanceof n}};n.LENGTH=32;var v=n,a=class a extends S{constructor(e){super();let t=s.fromHexInput(e);if(t.toUint8Array().length!==a.LENGTH)throw new Error(`Signature length should be ${a.LENGTH}, received ${t.toUint8Array().length}`);this.data=t}toUint8Array(){return this.data.toUint8Array()}serialize(e){e.serializeBytes(this.data.toUint8Array())}static deserialize(e){let t=e.deserializeBytes();return new a(t)}};a.LENGTH=64;var l=a;export{p as a,v as b,l as c};
|
|
2
|
+
//# sourceMappingURL=chunk-GQX5KMF7.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as t,b as n,c as o,d as r}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as t,b as n,c as o,d as r}from"./chunk-HL2O3T57.mjs";import{a as s}from"./chunk-JF66JS2R.mjs";import{b as i}from"./chunk-Q4C4U6I4.mjs";var a=class{constructor(e){this.config=e}async getFungibleAssetMetadata(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),t({aptosConfig:this.config,...e})}async getFungibleAssetMetadataByAssetType(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),(await t({aptosConfig:this.config,options:{where:{asset_type:{_eq:e.assetType}}}}))[0]}async getFungibleAssetMetadataByCreatorAddress(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),await t({aptosConfig:this.config,options:{where:{creator_address:{_eq:i.from(e.creatorAddress).toStringLong()}}}})}async getFungibleAssetActivities(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),n({aptosConfig:this.config,...e})}async getCurrentFungibleAssetBalances(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),o({aptosConfig:this.config,...e})}async transferFungibleAsset(e){return r({aptosConfig:this.config,...e})}};export{a};
|
|
2
|
+
//# sourceMappingURL=chunk-H4GZWYIG.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{c as l}from"./chunk-AZWVCBK2.mjs";import{a as k,b as y,d as w,e as U,f as z,g as D,h as J,i as d,j as L,l as R,m as W,n as X,o as q,p as H,q as K,s as i,t as Q}from"./chunk-ABXES4FS.mjs";import{c as j}from"./chunk-3EY7MT2M.mjs";import{b as C,c as x,d as M,e as O,f as _,g as a,h as V,i as G,n as P}from"./chunk-G4O6FXCF.mjs";import{a as T,c as I,d as f}from"./chunk-IDTLNF4M.mjs";import{a as g,b as E,c as v,d as b,e as F,f as $,g as S}from"./chunk-ORMOQWWH.mjs";import{b as m}from"./chunk-Q4C4U6I4.mjs";import{a as p}from"./chunk-3OLFJ65O.mjs";var Y=new TextEncoder;function yn(n){return n?.map(e=>y(e)?l(e):e)??[]}async function B(n,e,t,u){let r=await j({aptosConfig:u,accountAddress:n,moduleName:e});if(r.abi)return r.abi.exposed_functions.find(s=>s.name===t)}async function Tn(n,e,t,u){let r=await B(n,e,t,u);if(!r)throw new Error(`Could not find function ABI for '${n}::${e}::${t}'`);let s=[];for(let c=0;c<r.params.length;c+=1)s.push(l(r.params[c],{allowGenerics:!0}));return{typeParameters:r.generic_type_params,parameters:s}}async function ln(n,e,t,u){let r=await B(n,e,t,u);if(!r)throw new Error(`Could not find entry function ABI for '${n}::${e}::${t}'`);if(!r.is_entry)throw new Error(`'${n}::${e}::${t}' is not an entry function`);let s=Q(r),c=[];for(let o=s;o<r.params.length;o+=1)c.push(l(r.params[o],{allowGenerics:!0}));return{signers:s,typeParameters:r.generic_type_params,parameters:c}}async function An(n,e,t,u){let r=await B(n,e,t,u);if(!r)throw new Error(`Could not find view function ABI for '${n}::${e}::${t}'`);if(!r.is_view)throw new Error(`'${n}::${e}::${t}' is not an view function`);let s=[];for(let o=0;o<r.params.length;o+=1)s.push(l(r.params[o],{allowGenerics:!0}));let c=[];for(let o=0;o<r.return.length;o+=1)c.push(l(r.return[o],{allowGenerics:!0}));return{typeParameters:r.generic_type_params,parameters:s,returnTypes:c}}function gn(n,e,t,u,r){return n instanceof p?n:p.newBytes(Z(e,t,n,u,r).bcsToBytes())}function Z(n,e,t,u,r){if(u>=e.parameters.length)throw new Error(`Too many arguments for '${n}', expected ${e.parameters.length}`);let s=e.parameters[u];return A(t,s,u,r)}function A(n,e,t,u){return D(n)?(h(e,n,t),n):N(n,e,t,u)}function N(n,e,t,u){if(e.isBool()){if(k(n))return new g(n);if(y(n)){if(n==="true")return new g(!0);if(n==="false")return new g(!1)}i("boolean",t)}if(e.isAddress()){if(y(n))return m.fromString(n);i("string | AccountAddress",t)}if(e.isU8()){let r=w(n);if(r!==void 0)return new E(r);i("number | string",t)}if(e.isU16()){let r=w(n);if(r!==void 0)return new v(r);i("number | string",t)}if(e.isU32()){let r=w(n);if(r!==void 0)return new b(r);i("number | string",t)}if(e.isU64()){if(U(n))return new F(BigInt(n));i("bigint | number | string",t)}if(e.isU128()){if(U(n))return new $(BigInt(n));i("bigint | number | string",t)}if(e.isU256()){if(U(n))return new S(BigInt(n));i("bigint | number | string",t)}if(e.isGeneric()){let r=e.value;if(r<0||r>=u.length)throw new Error(`Generic argument ${e.toString()} is invalid for argument ${t}`);return A(n,u[r],t,u)}if(e.isVector()){if(e.value.isU8()){if(y(n))return T.U8(Y.encode(n));if(n instanceof Uint8Array)return T.U8(n);if(n instanceof ArrayBuffer)return T.U8(new Uint8Array(n))}if(y(n)&&n.startsWith("["))return A(JSON.parse(n),e,t,u);if(Array.isArray(n))return new T(n.map(r=>A(r,e.value,t,u)));throw new Error(`Type mismatch for argument ${t}, type '${e.toString()}'`)}if(e.isStruct()){if(e.isString()){if(y(n))return new I(n);i("string",t)}if(e.isObject()){if(y(n))return m.fromString(n);i("string | AccountAddress",t)}if(e.isOption()){if(z(n)){let r=e.value.typeArgs[0];return r instanceof C?new f(null):r instanceof G?new f(null):r instanceof x?new f(null):r instanceof M?new f(null):r instanceof O?new f(null):r instanceof _?new f(null):r instanceof a?new f(null):r instanceof V?new f(null):new f(null)}return new f(A(n,e.value.typeArgs[0],t,u))}throw new Error(`Unsupported struct input type for argument ${t}, type '${e.toString()}'`)}throw new Error(`Type mismatch for argument ${t}, type '${e.toString()}'`)}function h(n,e,t){if(n.isBool()){if(J(e))return;i("Bool",t)}if(n.isAddress()){if(d(e))return;i("AccountAddress",t)}if(n.isU8()){if(R(e))return;i("U8",t)}if(n.isU16()){if(W(e))return;i("U16",t)}if(n.isU32()){if(X(e))return;i("U32",t)}if(n.isU64()){if(q(e))return;i("U64",t)}if(n.isU128()){if(H(e))return;i("U128",t)}if(n.isU256()){if(K(e))return;i("U256",t)}if(n.isVector()){if(e instanceof T){e.values.length>0&&h(n.value,e.values[0],t);return}i("MoveVector",t)}if(n instanceof P){if(n.isString()){if(L(e))return;i("MoveString",t)}if(n.isObject()){if(d(e))return;i("AccountAddress",t)}if(n.isOption()){if(e instanceof f){e.value!==void 0&&h(n.value.typeArgs[0],e.value,t);return}i("MoveOption",t)}}throw new Error(`Type mismatch for argument ${t}, expected '${n.toString()}'`)}export{yn as a,B as b,Tn as c,ln as d,An as e,gn as f,Z as g,A as h};
|
|
2
|
+
//# sourceMappingURL=chunk-HEAWDTLG.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/transactions/transactionBuilder/remoteAbi.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { parseTypeTag } from \"../typeTag/parser\";\nimport {\n TypeTag,\n TypeTagAddress,\n TypeTagBool,\n TypeTagStruct,\n TypeTagU128,\n TypeTagU16,\n TypeTagU256,\n TypeTagU32,\n TypeTagU64,\n TypeTagU8,\n} from \"../typeTag\";\nimport { AptosConfig } from \"../../api/aptosConfig\";\nimport {\n EntryFunctionArgumentTypes,\n SimpleEntryFunctionArgumentTypes,\n EntryFunctionABI,\n ViewFunctionABI,\n FunctionABI,\n TypeArgument,\n} from \"../types\";\nimport { Bool, MoveOption, MoveString, MoveVector, U128, U16, U256, U32, U64, U8 } from \"../../bcs\";\nimport { AccountAddress } from \"../../core\";\nimport { getModule } from \"../../internal/account\";\nimport {\n findFirstNonSignerArg,\n isBcsAddress,\n isBcsBool,\n isBcsString,\n isBcsU128,\n isBcsU16,\n isBcsU256,\n isBcsU32,\n isBcsU64,\n isBcsU8,\n isBool,\n isEncodedEntryFunctionArgument,\n isLargeNumber,\n isEmptyOption,\n isString,\n throwTypeMismatch,\n convertNumber,\n} from \"./helpers\";\nimport { CallArgument, MoveFunction } from \"../../types\";\n\nconst TEXT_ENCODER = new TextEncoder();\n\n/**\n * Convert type arguments to only type tags, allowing for string representations of type tags.\n *\n * @param typeArguments - An optional array of type arguments that may include string representations.\n * @returns An array of TypeTag objects derived from the provided type arguments.\n * @group Implementation\n * @category Transactions\n */\nexport function standardizeTypeTags(typeArguments?: Array<TypeArgument>): Array<TypeTag> {\n return (\n typeArguments?.map((typeArg: TypeArgument): TypeTag => {\n // Convert to TypeTag if it's a string representation\n if (isString(typeArg)) {\n return parseTypeTag(typeArg);\n }\n return typeArg;\n }) ?? []\n );\n}\n\n/**\n * Fetches the ABI of a specified function from the on-chain module ABI. This function allows you to access the details of a\n * specific function within a module.\n *\n * @param moduleAddress - The address of the module from which to fetch the function ABI.\n * @param moduleName - The name of the module containing the function.\n * @param functionName - The name of the function whose ABI is to be fetched.\n * @param aptosConfig - The configuration settings for Aptos.\n * @group Implementation\n * @category Transactions\n */\nexport async function fetchFunctionAbi(\n moduleAddress: string,\n moduleName: string,\n functionName: string,\n aptosConfig: AptosConfig,\n): Promise<MoveFunction | undefined> {\n // This fetch from the API is currently cached\n const module = await getModule({ aptosConfig, accountAddress: moduleAddress, moduleName });\n\n if (module.abi) {\n return module.abi.exposed_functions.find((func) => func.name === functionName);\n }\n\n return undefined;\n}\n\n/**\n * Fetches a function ABI from the on-chain module ABI. It doesn't validate whether it's a view or entry function.\n * @param moduleAddress\n * @param moduleName\n * @param functionName\n * @param aptosConfig\n */\nexport async function fetchMoveFunctionAbi(\n moduleAddress: string,\n moduleName: string,\n functionName: string,\n aptosConfig: AptosConfig,\n): Promise<FunctionABI> {\n const functionAbi = await fetchFunctionAbi(moduleAddress, moduleName, functionName, aptosConfig);\n if (!functionAbi) {\n throw new Error(`Could not find function ABI for '${moduleAddress}::${moduleName}::${functionName}'`);\n }\n const params: TypeTag[] = [];\n for (let i = 0; i < functionAbi.params.length; i += 1) {\n params.push(parseTypeTag(functionAbi.params[i], { allowGenerics: true }));\n }\n\n return {\n typeParameters: functionAbi.generic_type_params,\n parameters: params,\n };\n}\n\n/**\n * Fetches the ABI for an entry function from the specified module address.\n * This function validates if the ABI corresponds to an entry function and retrieves its parameters.\n *\n * @param moduleAddress - The address of the module containing the entry function.\n * @param moduleName - The name of the module containing the entry function.\n * @param functionName - The name of the entry function to fetch the ABI for.\n * @param aptosConfig - The configuration settings for Aptos.\n * @returns An object containing the number of signers, type parameters, and function parameters.\n * @throws Error if the ABI cannot be found or if the function is not an entry function.\n * @group Implementation\n * @category Transactions\n */\nexport async function fetchEntryFunctionAbi(\n moduleAddress: string,\n moduleName: string,\n functionName: string,\n aptosConfig: AptosConfig,\n): Promise<EntryFunctionABI> {\n const functionAbi = await fetchFunctionAbi(moduleAddress, moduleName, functionName, aptosConfig);\n\n // If there's no ABI, then the function is invalid\n if (!functionAbi) {\n throw new Error(`Could not find entry function ABI for '${moduleAddress}::${moduleName}::${functionName}'`);\n }\n\n // Non-entry functions also can't be used\n if (!functionAbi.is_entry) {\n throw new Error(`'${moduleAddress}::${moduleName}::${functionName}' is not an entry function`);\n }\n\n // Remove the signer arguments\n const numSigners = findFirstNonSignerArg(functionAbi);\n const params: TypeTag[] = [];\n for (let i = numSigners; i < functionAbi.params.length; i += 1) {\n params.push(parseTypeTag(functionAbi.params[i], { allowGenerics: true }));\n }\n\n return {\n signers: numSigners,\n typeParameters: functionAbi.generic_type_params,\n parameters: params,\n };\n}\n\n/**\n * Fetches the ABI for a view function from the specified module address.\n * This function ensures that the ABI is valid and retrieves the type parameters, parameters, and return types for the view function.\n *\n * @param moduleAddress - The address of the module containing the view function.\n * @param moduleName - The name of the module containing the view function.\n * @param functionName - The name of the view function for which to fetch the ABI.\n * @param aptosConfig - The configuration settings for Aptos.\n * @returns An object containing the type parameters, parameters, and return types of the view function.\n * @throws Error if the ABI cannot be found or if the function is not a view function.\n * @group Implementation\n * @category Transactions\n */\nexport async function fetchViewFunctionAbi(\n moduleAddress: string,\n moduleName: string,\n functionName: string,\n aptosConfig: AptosConfig,\n): Promise<ViewFunctionABI> {\n const functionAbi = await fetchFunctionAbi(moduleAddress, moduleName, functionName, aptosConfig);\n\n // If there's no ABI, then the function is invalid\n if (!functionAbi) {\n throw new Error(`Could not find view function ABI for '${moduleAddress}::${moduleName}::${functionName}'`);\n }\n\n // Non-view functions can't be used\n if (!functionAbi.is_view) {\n throw new Error(`'${moduleAddress}::${moduleName}::${functionName}' is not an view function`);\n }\n\n // Type tag parameters for the function\n const params: TypeTag[] = [];\n for (let i = 0; i < functionAbi.params.length; i += 1) {\n params.push(parseTypeTag(functionAbi.params[i], { allowGenerics: true }));\n }\n\n // The return types of the view function\n const returnTypes: TypeTag[] = [];\n for (let i = 0; i < functionAbi.return.length; i += 1) {\n returnTypes.push(parseTypeTag(functionAbi.return[i], { allowGenerics: true }));\n }\n\n return {\n typeParameters: functionAbi.generic_type_params,\n parameters: params,\n returnTypes,\n };\n}\n\n/**\n * Converts a entry function argument into CallArgument, if necessary.\n * This function checks the provided argument against the expected parameter type and converts it accordingly.\n *\n * @param functionName - The name of the function for which the argument is being converted.\n * @param functionAbi - The ABI (Application Binary Interface) of the function, which defines its parameters.\n * @param argument - The argument to be converted, which can be of various types. If the argument is already\n * CallArgument returned from TransactionComposer it would be returned immediately.\n * @param position - The index of the argument in the function's parameter list.\n * @param genericTypeParams - An array of type tags for any generic type parameters.\n */\nexport function convertCallArgument(\n argument: CallArgument | EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes,\n functionName: string,\n functionAbi: FunctionABI,\n position: number,\n genericTypeParams: Array<TypeTag>,\n): CallArgument {\n if (argument instanceof CallArgument) {\n return argument;\n }\n return CallArgument.newBytes(\n convertArgument(functionName, functionAbi, argument, position, genericTypeParams).bcsToBytes(),\n );\n}\n\n/**\n * Converts a non-BCS encoded argument into BCS encoded, if necessary.\n * This function checks the provided argument against the expected parameter type and converts it accordingly.\n *\n * @param functionName - The name of the function for which the argument is being converted.\n * @param functionAbi - The ABI (Application Binary Interface) of the function, which defines its parameters.\n * @param arg - The argument to be converted, which can be of various types.\n * @param position - The index of the argument in the function's parameter list.\n * @param genericTypeParams - An array of type tags for any generic type parameters.\n * @group Implementation\n * @category Transactions\n */\nexport function convertArgument(\n functionName: string,\n functionAbi: FunctionABI,\n arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes,\n position: number,\n genericTypeParams: Array<TypeTag>,\n) {\n // Ensure not too many arguments\n if (position >= functionAbi.parameters.length) {\n throw new Error(`Too many arguments for '${functionName}', expected ${functionAbi.parameters.length}`);\n }\n\n const param = functionAbi.parameters[position];\n return checkOrConvertArgument(arg, param, position, genericTypeParams);\n}\n\n/**\n * Checks if the provided argument is BCS encoded and converts it if necessary, ensuring type compatibility with the ABI.\n * This function helps in validating and converting arguments for entry functions based on their expected types.\n *\n * @param arg - The argument to check or convert, which can be either a simple or entry function argument type.\n * @param param - The expected type tag for the argument.\n * @param position - The position of the argument in the function call.\n * @param genericTypeParams - An array of generic type parameters that may be used for conversion.\n * @group Implementation\n * @category Transactions\n */\nexport function checkOrConvertArgument(\n arg: SimpleEntryFunctionArgumentTypes | EntryFunctionArgumentTypes,\n param: TypeTag,\n position: number,\n genericTypeParams: Array<TypeTag>,\n) {\n // If the argument is bcs encoded, we can just use it directly\n if (isEncodedEntryFunctionArgument(arg)) {\n // Ensure the type matches the ABI\n\n /**\n * Checks the type of the provided argument against the expected type.\n * This function helps validate that the argument conforms to the specified type requirements.\n *\n * @param typeArgs - The expected type arguments.\n * @param arg - The argument to be checked.\n * @param position - The position of the argument in the context of the check.\n * @group Implementation\n * @category Transactions\n */\n checkType(param, arg, position);\n return arg;\n }\n\n // If it is not BCS encoded, we will need to convert it with the ABI\n return parseArg(arg, param, position, genericTypeParams);\n}\n\n/**\n * Parses a non-BCS encoded argument into a BCS encoded argument recursively.\n * This function helps convert various types of input arguments into their corresponding BCS encoded formats based on the\n * specified parameter type.\n *\n * @param arg - The argument to be parsed, which can be of various types.\n * @param param - The type tag that defines the expected type of the argument.\n * @param position - The position of the argument in the function call, used for error reporting.\n * @param genericTypeParams - An array of type tags for generic type parameters, used when the parameter type is generic.\n * @group Implementation\n * @category Transactions\n */\nfunction parseArg(\n arg: SimpleEntryFunctionArgumentTypes,\n param: TypeTag,\n position: number,\n genericTypeParams: Array<TypeTag>,\n): EntryFunctionArgumentTypes {\n if (param.isBool()) {\n if (isBool(arg)) {\n return new Bool(arg);\n }\n if (isString(arg)) {\n if (arg === \"true\") return new Bool(true);\n if (arg === \"false\") return new Bool(false);\n }\n\n /**\n * Throws a type mismatch error for the specified move option.\n *\n * @param moveOption - The name of the move option that caused the type mismatch.\n * @param position - The position where the error occurred.\n * @group Implementation\n * @category Transactions\n */\n throwTypeMismatch(\"boolean\", position);\n }\n // TODO: support uint8array?\n if (param.isAddress()) {\n if (isString(arg)) {\n return AccountAddress.fromString(arg);\n }\n throwTypeMismatch(\"string | AccountAddress\", position);\n }\n if (param.isU8()) {\n const num = convertNumber(arg);\n if (num !== undefined) {\n return new U8(num);\n }\n throwTypeMismatch(\"number | string\", position);\n }\n if (param.isU16()) {\n const num = convertNumber(arg);\n if (num !== undefined) {\n return new U16(num);\n }\n throwTypeMismatch(\"number | string\", position);\n }\n if (param.isU32()) {\n const num = convertNumber(arg);\n if (num !== undefined) {\n return new U32(num);\n }\n throwTypeMismatch(\"number | string\", position);\n }\n if (param.isU64()) {\n if (isLargeNumber(arg)) {\n return new U64(BigInt(arg));\n }\n throwTypeMismatch(\"bigint | number | string\", position);\n }\n if (param.isU128()) {\n if (isLargeNumber(arg)) {\n return new U128(BigInt(arg));\n }\n throwTypeMismatch(\"bigint | number | string\", position);\n }\n if (param.isU256()) {\n if (isLargeNumber(arg)) {\n return new U256(BigInt(arg));\n }\n throwTypeMismatch(\"bigint | number | string\", position);\n }\n\n // Generic needs to use the subtype\n if (param.isGeneric()) {\n const genericIndex = param.value;\n if (genericIndex < 0 || genericIndex >= genericTypeParams.length) {\n throw new Error(`Generic argument ${param.toString()} is invalid for argument ${position}`);\n }\n\n return checkOrConvertArgument(arg, genericTypeParams[genericIndex], position, genericTypeParams);\n }\n\n // We have to special case some vectors for Vector<u8>\n if (param.isVector()) {\n // Check special case for Vector<u8>\n if (param.value.isU8()) {\n // We don't allow vector<u8>, but we convert strings to UTF8 Uint8Array\n // This is legacy behavior from the original SDK\n if (isString(arg)) {\n return MoveVector.U8(TEXT_ENCODER.encode(arg));\n }\n if (arg instanceof Uint8Array) {\n return MoveVector.U8(arg);\n }\n if (arg instanceof ArrayBuffer) {\n return MoveVector.U8(new Uint8Array(arg));\n }\n }\n\n if (isString(arg)) {\n // In a web env, arguments are passing as strings\n if (arg.startsWith(\"[\")) {\n return checkOrConvertArgument(JSON.parse(arg), param, position, genericTypeParams);\n }\n }\n\n // TODO: Support Uint16Array, Uint32Array, BigUint64Array?\n\n if (Array.isArray(arg)) {\n return new MoveVector(arg.map((item) => checkOrConvertArgument(item, param.value, position, genericTypeParams)));\n }\n\n throw new Error(`Type mismatch for argument ${position}, type '${param.toString()}'`);\n }\n\n // Handle structs as they're more complex\n if (param.isStruct()) {\n if (param.isString()) {\n if (isString(arg)) {\n return new MoveString(arg);\n }\n throwTypeMismatch(\"string\", position);\n }\n if (param.isObject()) {\n // The inner type of Object doesn't matter, since it's just syntactic sugar\n if (isString(arg)) {\n return AccountAddress.fromString(arg);\n }\n throwTypeMismatch(\"string | AccountAddress\", position);\n }\n\n if (param.isOption()) {\n if (isEmptyOption(arg)) {\n // Here we attempt to reconstruct the underlying type\n // Note, for some reason the `isBool` etc. does not work with the compiler\n const innerParam = param.value.typeArgs[0];\n if (innerParam instanceof TypeTagBool) {\n return new MoveOption<Bool>(null);\n }\n if (innerParam instanceof TypeTagAddress) {\n return new MoveOption<AccountAddress>(null);\n }\n if (innerParam instanceof TypeTagU8) {\n return new MoveOption<U8>(null);\n }\n if (innerParam instanceof TypeTagU16) {\n return new MoveOption<U16>(null);\n }\n if (innerParam instanceof TypeTagU32) {\n return new MoveOption<U32>(null);\n }\n if (innerParam instanceof TypeTagU64) {\n return new MoveOption<U64>(null);\n }\n if (innerParam instanceof TypeTagU128) {\n return new MoveOption<U128>(null);\n }\n if (innerParam instanceof TypeTagU256) {\n return new MoveOption<U256>(null);\n }\n\n // In all other cases, we will use a placeholder, it doesn't actually matter what the type is, but it will be obvious\n // Note: This is a placeholder U8 type, and does not match the actual type, as that can't be dynamically grabbed\n return new MoveOption<MoveString>(null);\n }\n\n return new MoveOption(checkOrConvertArgument(arg, param.value.typeArgs[0], position, genericTypeParams));\n }\n\n throw new Error(`Unsupported struct input type for argument ${position}, type '${param.toString()}'`);\n }\n\n throw new Error(`Type mismatch for argument ${position}, type '${param.toString()}'`);\n}\n\n/**\n * Checks that the type of the BCS encoded argument matches the ABI\n * @param param\n * @param arg\n * @param position\n * @group Implementation\n * @category Transactions\n */\nfunction checkType(param: TypeTag, arg: EntryFunctionArgumentTypes, position: number) {\n if (param.isBool()) {\n if (isBcsBool(arg)) {\n return;\n }\n throwTypeMismatch(\"Bool\", position);\n }\n if (param.isAddress()) {\n if (isBcsAddress(arg)) {\n return;\n }\n throwTypeMismatch(\"AccountAddress\", position);\n }\n if (param.isU8()) {\n if (isBcsU8(arg)) {\n return;\n }\n throwTypeMismatch(\"U8\", position);\n }\n if (param.isU16()) {\n if (isBcsU16(arg)) {\n return;\n }\n throwTypeMismatch(\"U16\", position);\n }\n if (param.isU32()) {\n if (isBcsU32(arg)) {\n return;\n }\n throwTypeMismatch(\"U32\", position);\n }\n if (param.isU64()) {\n if (isBcsU64(arg)) {\n return;\n }\n throwTypeMismatch(\"U64\", position);\n }\n if (param.isU128()) {\n if (isBcsU128(arg)) {\n return;\n }\n throwTypeMismatch(\"U128\", position);\n }\n if (param.isU256()) {\n if (isBcsU256(arg)) {\n return;\n }\n throwTypeMismatch(\"U256\", position);\n }\n if (param.isVector()) {\n if (arg instanceof MoveVector) {\n // If there's anything in it, check that the inner types match\n // Note that since it's typed, the first item should be the same as the rest\n if (arg.values.length > 0) {\n checkType(param.value, arg.values[0], position);\n }\n\n return;\n }\n throwTypeMismatch(\"MoveVector\", position);\n }\n\n // Handle structs as they're more complex\n if (param instanceof TypeTagStruct) {\n if (param.isString()) {\n if (isBcsString(arg)) {\n return;\n }\n throwTypeMismatch(\"MoveString\", position);\n }\n if (param.isObject()) {\n if (isBcsAddress(arg)) {\n return;\n }\n throwTypeMismatch(\"AccountAddress\", position);\n }\n if (param.isOption()) {\n if (arg instanceof MoveOption) {\n // If there's a value, we can check the inner type (otherwise it doesn't really matter)\n if (arg.value !== undefined) {\n checkType(param.value.typeArgs[0], arg.value, position);\n }\n return;\n }\n throwTypeMismatch(\"MoveOption\", position);\n }\n }\n\n throw new Error(`Type mismatch for argument ${position}, expected '${param.toString()}'`);\n}\n"],"mappings":"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","names":["TEXT_ENCODER","standardizeTypeTags","typeArguments","typeArg","isString","parseTypeTag","fetchFunctionAbi","moduleAddress","moduleName","functionName","aptosConfig","module","getModule","func","fetchMoveFunctionAbi","functionAbi","params","i","fetchEntryFunctionAbi","numSigners","findFirstNonSignerArg","fetchViewFunctionAbi","returnTypes","convertCallArgument","argument","position","genericTypeParams","CallArgument","convertArgument","arg","param","checkOrConvertArgument","isEncodedEntryFunctionArgument","checkType","parseArg","isBool","Bool","throwTypeMismatch","AccountAddress","num","convertNumber","U8","U16","U32","isLargeNumber","U64","U128","U256","genericIndex","MoveVector","item","MoveString","isEmptyOption","innerParam","TypeTagBool","MoveOption","TypeTagAddress","TypeTagU8","TypeTagU16","TypeTagU32","TypeTagU64","TypeTagU128","TypeTagU256","isBcsBool","isBcsAddress","isBcsU8","isBcsU16","isBcsU32","isBcsU64","isBcsU128","isBcsU256","TypeTagStruct","isBcsString"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{d as s}from"./chunk-V2EXS6TM.mjs";import{b as i}from"./chunk-EGZI6EJ2.mjs";import{c as n}from"./chunk-TM6IKHMX.mjs";import{b as o}from"./chunk-Q4C4U6I4.mjs";var c=class a{constructor(t){this.signingScheme=0;let{privateKey:e,address:r}=t;this.privateKey=e,this.publicKey=e.publicKey(),this.accountAddress=r?o.from(r):this.publicKey.authKey().derivedAddress()}static generate(){let t=n.generate();return new a({privateKey:t})}static fromDerivationPath(t){let{path:e,mnemonic:r}=t,u=n.fromDerivationPath(e,r);return new a({privateKey:u})}verifySignature(t){return this.publicKey.verifySignature(t)}signWithAuthenticator(t){return new i(this.publicKey,this.privateKey.sign(t))}signTransactionWithAuthenticator(t){return new i(this.publicKey,this.signTransaction(t))}sign(t){return this.privateKey.sign(t)}signTransaction(t){return this.sign(s(t))}};export{c as a};
|
|
2
|
+
//# sourceMappingURL=chunk-HFCWJ6QL.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as c}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as c}from"./chunk-2FNFUTFJ.mjs";import{c as p}from"./chunk-AZWVCBK2.mjs";import{c as o}from"./chunk-AC3BISWL.mjs";import{n as u,q as g,r as A}from"./chunk-VHNX2NUR.mjs";import{f as a,i as r}from"./chunk-G4O6FXCF.mjs";async function G(t){let{aptosConfig:s,options:e}=t,n={query:A,variables:{where_condition:e?.where,limit:e?.limit,offset:e?.offset}};return(await o({aptosConfig:s,query:n,originMethod:"getFungibleAssetMetadata"})).fungible_asset_metadata}async function h(t){let{aptosConfig:s,options:e}=t,n={query:g,variables:{where_condition:e?.where,limit:e?.limit,offset:e?.offset}};return(await o({aptosConfig:s,query:n,originMethod:"getFungibleAssetActivities"})).fungible_asset_activities}async function M(t){let{aptosConfig:s,options:e}=t,n={query:u,variables:{where_condition:e?.where,limit:e?.limit,offset:e?.offset}};return(await o({aptosConfig:s,query:n,originMethod:"getCurrentFungibleAssetBalances"})).current_fungible_asset_balances}var b={typeParameters:[{constraints:[]}],parameters:[p("0x1::object::Object"),new r,new a]};async function x(t){let{aptosConfig:s,sender:e,fungibleAssetMetadataAddress:n,recipient:i,amount:l,options:f}=t;return c({aptosConfig:s,sender:e.accountAddress,data:{function:"0x1::primary_fungible_store::transfer",typeArguments:["0x1::fungible_asset::Metadata"],functionArguments:[n,i,l],abi:b},options:f})}export{G as a,h as b,M as c,x as d};
|
|
2
|
+
//# sourceMappingURL=chunk-HL2O3T57.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as u,b as d,c as p}from"./chunk-BBUN4IO4.mjs";import{a as r}from"./chunk-PWYJWTEM.mjs";import{i as a}from"./chunk-G4O6FXCF.mjs";import{j as s}from"./chunk-42T3UGSW.mjs";import{b as c}from"./chunk-Q4C4U6I4.mjs";var A=class{constructor(n){this.config=n;this.isAccountAbstractionEnabled=async n=>{let o=await this.getAuthenticationFunction(n),{moduleAddress:t,moduleName:i,functionName:m}=s(n.authenticationFunction);return o?.some(e=>c.fromString(t).equals(e.moduleAddress)&&i===e.moduleName&&m===e.functionName)??!1};this.enableAccountAbstractionTransaction=this.addAuthenticationFunctionTransaction;this.disableAccountAbstractionTransaction=async n=>{let{accountAddress:o,authenticationFunction:t,options:i}=n;return t?this.removeAuthenticationFunctionTransaction({accountAddress:o,authenticationFunction:t,options:i}):this.removeDispatchableAuthenticatorTransaction({accountAddress:o,options:i})}}async addAuthenticationFunctionTransaction(n){let{accountAddress:o,authenticationFunction:t,options:i}=n;return u({aptosConfig:this.config,authenticationFunction:t,sender:o,options:i})}async removeAuthenticationFunctionTransaction(n){let{accountAddress:o,authenticationFunction:t,options:i}=n;return d({aptosConfig:this.config,sender:o,authenticationFunction:t,options:i})}async removeDispatchableAuthenticatorTransaction(n){let{accountAddress:o,options:t}=n;return p({aptosConfig:this.config,sender:o,options:t})}async getAuthenticationFunction(n){let{accountAddress:o}=n,[{vec:t}]=await r({aptosConfig:this.config,payload:{function:"0x1::account_abstraction::dispatchable_authenticator",functionArguments:[c.from(o)],abi:{typeParameters:[],parameters:[new a],returnTypes:[]}}});if(t.length!==0)return t[0].map(i=>({moduleAddress:c.fromString(i.module_address),moduleName:i.module_name,functionName:i.function_name}))}};export{A as a};
|
|
2
|
+
//# sourceMappingURL=chunk-HLJE5XGE.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/api/account/abstraction.ts"],"sourcesContent":["import { AccountAddress, AccountAddressInput } from \"../../core\";\nimport {\n addAuthenticationFunctionTransaction,\n removeAuthenticationFunctionTransaction,\n removeDispatchableAuthenticatorTransaction,\n} from \"../../internal/abstraction\";\nimport { view } from \"../../internal/view\";\nimport { InputGenerateTransactionOptions, TypeTagAddress } from \"../../transactions\";\nimport { MoveFunctionId } from \"../../types\";\nimport { getFunctionParts } from \"../../utils/helpers\";\nimport { AptosConfig } from \"../aptosConfig\";\n\nexport class AccountAbstraction {\n constructor(readonly config: AptosConfig) {}\n\n /**\n * Adds a dispatchable authentication function to the account.\n *\n * @example\n * ```ts\n * const txn = await aptos.abstraction.addAuthenticationFunctionTransaction({\n * accountAddress: alice.accountAddress,\n * authenticationFunction: `${alice.accountAddress}::any_authenticator::authenticate`,\n * });\n *\n * const txn = await aptos.signAndSubmitTransaction({ signer: alice, transaction});\n * await aptos.waitForTransaction({ transactionHash: txn.hash });\n * ```\n *\n * @param args.accountAddress - The account to add the authentication function to.\n * @param args.authenticationFunction - The authentication function info to add.\n * @param args.options - The options for the transaction.\n * @returns A transaction to add the authentication function to the account.\n */\n public async addAuthenticationFunctionTransaction(args: {\n accountAddress: AccountAddressInput;\n authenticationFunction: string;\n options?: InputGenerateTransactionOptions;\n }) {\n const { accountAddress, authenticationFunction, options } = args;\n return addAuthenticationFunctionTransaction({\n aptosConfig: this.config,\n authenticationFunction,\n sender: accountAddress,\n options,\n });\n }\n\n /**\n * Removes a dispatchable authentication function from the account.\n *\n * @example\n * ```ts\n * const txn = await aptos.abstraction.removeAuthenticationFunctionTransaction({\n * accountAddress: alice.accountAddress,\n * authenticationFunction: `${alice.accountAddress}::any_authenticator::authenticate`,\n * });\n *\n * const txn = await aptos.signAndSubmitTransaction({ signer: alice, transaction: txn });\n * await aptos.waitForTransaction({ transactionHash: txn.hash });\n * ```\n *\n * @param args.accountAddress - The account to remove the authentication function from.\n * @param args.authenticationFunction - The authentication function info to remove.\n * @param args.options - The options for the transaction.\n * @returns A transaction to remove the authentication function from the account.\n */\n public async removeAuthenticationFunctionTransaction(args: {\n accountAddress: AccountAddressInput;\n authenticationFunction: string;\n options?: InputGenerateTransactionOptions;\n }) {\n const { accountAddress, authenticationFunction, options } = args;\n return removeAuthenticationFunctionTransaction({\n aptosConfig: this.config,\n sender: accountAddress,\n authenticationFunction,\n options,\n });\n }\n\n /**\n * Removes a dispatchable authenticator from the account.\n *\n * @example\n * ```ts\n * const txn = await aptos.abstraction.removeDispatchableAuthenticatorTransaction({\n * accountAddress: alice.accountAddress,\n * });\n *\n * const txn = await aptos.signAndSubmitTransaction({ signer: alice, transaction: txn });\n * await aptos.waitForTransaction({ transactionHash: txn.hash });\n * ```\n *\n * @param args.accountAddress - The account to remove the authenticator from.\n * @param args.options - The options for the transaction.\n * @returns A transaction to remove the authenticator from the account.\n */\n public async removeDispatchableAuthenticatorTransaction(args: {\n accountAddress: AccountAddressInput;\n options?: InputGenerateTransactionOptions;\n }) {\n const { accountAddress, options } = args;\n return removeDispatchableAuthenticatorTransaction({ aptosConfig: this.config, sender: accountAddress, options });\n }\n\n /**\n * Gets the dispatchable authentication function for the account.\n *\n * @example\n * ```ts\n * const functionInfos = await aptos.abstraction.getAuthenticationFunction({\n * accountAddress: alice.accountAddress,\n * });\n *\n * if (functionInfos) {\n * console.log(`Account ${alice.accountAddress.toString()} is using account abstraction!`);\n * } else {\n * console.log(`Account ${alice.accountAddress.toString()} is not using account abstraction.`);\n * }\n * ```\n *\n * @param args.accountAddress - The account to get the dispatchable authentication function for.\n * @returns The dispatchable authentication function for the account.\n */\n public async getAuthenticationFunction(args: { accountAddress: AccountAddressInput }) {\n const { accountAddress } = args;\n const [{ vec: functionInfoOption }] = await view<\n [{ vec: { function_name: string; module_name: string; module_address: string }[][] }]\n >({\n aptosConfig: this.config,\n payload: {\n function: \"0x1::account_abstraction::dispatchable_authenticator\",\n functionArguments: [AccountAddress.from(accountAddress)],\n abi: { typeParameters: [], parameters: [new TypeTagAddress()], returnTypes: [] },\n },\n });\n\n if (functionInfoOption.length === 0) return undefined;\n\n return functionInfoOption[0].map((functionInfo) => ({\n moduleAddress: AccountAddress.fromString(functionInfo.module_address),\n moduleName: functionInfo.module_name,\n functionName: functionInfo.function_name,\n }));\n }\n\n /**\n * Will return true if the account is abstracted, otherwise false.\n *\n * @example\n * ```ts\n * const isAccountAbstractionEnabled = await aptos.abstraction.isAccountAbstractionEnabled({\n * accountAddress: alice.accountAddress,\n * authenticationFunction: `${alice.accountAddress}::any_authenticator::authenticate`,\n * });\n * if (isAccountAbstractionEnabled) {\n * console.log(`Account ${alice.accountAddress.toString()} is using account abstraction!`);\n * } else {\n * console.log(`Account ${alice.accountAddress.toString()} is not using account abstraction.`);\n * }\n * ```\n *\n * @param args.accountAddress - The account to check.\n * @returns Whether the account is abstracted.\n */\n public isAccountAbstractionEnabled = async (args: {\n accountAddress: AccountAddressInput;\n authenticationFunction: string;\n }) => {\n const functionInfos = await this.getAuthenticationFunction(args);\n const { moduleAddress, moduleName, functionName } = getFunctionParts(args.authenticationFunction as MoveFunctionId);\n return (\n functionInfos?.some(\n (functionInfo) =>\n AccountAddress.fromString(moduleAddress).equals(functionInfo.moduleAddress) &&\n moduleName === functionInfo.moduleName &&\n functionName === functionInfo.functionName,\n ) ?? false\n );\n };\n\n /**\n * Creates a transaction to enable account abstraction with the given authentication function.\n *\n * @example\n * ```ts\n * const txn = await aptos.abstraction.enableAccountAbstractionTransaction({\n * accountAddress: alice.accountAddress,\n * authenticationFunction: `{alice.accountAddress}::any_authenticator::authenticate`,\n * });\n *\n * const txn = await aptos.signAndSubmitTransaction({ signer: alice, transaction: txn });\n * await aptos.waitForTransaction({ transactionHash: txn.hash });\n * ```\n *\n * @param args.accountAddress - The account to enable account abstraction for.\n * @param args.authenticationFunction - The authentication function info to use.\n * @param args.options - The options for the transaction.\n * @returns A transaction to enable account abstraction for the account.\n */\n public enableAccountAbstractionTransaction = this.addAuthenticationFunctionTransaction;\n\n /**\n * Creates a transaction to disable account abstraction. If an authentication function is provided, it will specify to\n * remove the authentication function.\n *\n * @example\n * ```ts\n * const txn = await aptos.abstraction.disableAccountAbstractionTransaction({\n * accountAddress: alice.accountAddress,\n * authenticationFunction: `${alice.accountAddress}::any_authenticator::authenticate`,\n * });\n *\n * const txn = await aptos.signAndSubmitTransaction({ signer: alice, transaction: txn });\n * await aptos.waitForTransaction({ transactionHash: txn.hash });\n * ```\n *\n * @param args.accountAddress - The account to disable account abstraction for.\n * @param args.authenticationFunction - The authentication function info to remove.\n * @param args.options - The options for the transaction.\n * @returns A transaction to disable account abstraction for the account.\n */\n public disableAccountAbstractionTransaction = async (args: {\n accountAddress: AccountAddressInput;\n authenticationFunction?: string;\n options?: InputGenerateTransactionOptions;\n }) => {\n const { accountAddress, authenticationFunction, options } = args;\n if (authenticationFunction) {\n return this.removeAuthenticationFunctionTransaction({\n accountAddress,\n authenticationFunction,\n options,\n });\n }\n return this.removeDispatchableAuthenticatorTransaction({ accountAddress, options });\n };\n}\n"],"mappings":"2NAYO,IAAMA,EAAN,KAAyB,CAC9B,YAAqBC,EAAqB,CAArB,YAAAA,EAyJrB,KAAO,4BAA8B,MAAOC,GAGtC,CACJ,IAAMC,EAAgB,MAAM,KAAK,0BAA0BD,CAAI,EACzD,CAAE,cAAAE,EAAe,WAAAC,EAAY,aAAAC,CAAa,EAAIC,EAAiBL,EAAK,sBAAwC,EAClH,OACEC,GAAe,KACZK,GACCC,EAAe,WAAWL,CAAa,EAAE,OAAOI,EAAa,aAAa,GAC1EH,IAAeG,EAAa,YAC5BF,IAAiBE,EAAa,YAClC,GAAK,EAET,EAqBA,KAAO,oCAAsC,KAAK,qCAsBlD,KAAO,qCAAuC,MAAON,GAI/C,CACJ,GAAM,CAAE,eAAAQ,EAAgB,uBAAAC,EAAwB,QAAAC,CAAQ,EAAIV,EAC5D,OAAIS,EACK,KAAK,wCAAwC,CAClD,eAAAD,EACA,uBAAAC,EACA,QAAAC,CACF,CAAC,EAEI,KAAK,2CAA2C,CAAE,eAAAF,EAAgB,QAAAE,CAAQ,CAAC,CACpF,CAhO2C,CAqB3C,MAAa,qCAAqCV,EAI/C,CACD,GAAM,CAAE,eAAAQ,EAAgB,uBAAAC,EAAwB,QAAAC,CAAQ,EAAIV,EAC5D,OAAOW,EAAqC,CAC1C,YAAa,KAAK,OAClB,uBAAAF,EACA,OAAQD,EACR,QAAAE,CACF,CAAC,CACH,CAqBA,MAAa,wCAAwCV,EAIlD,CACD,GAAM,CAAE,eAAAQ,EAAgB,uBAAAC,EAAwB,QAAAC,CAAQ,EAAIV,EAC5D,OAAOY,EAAwC,CAC7C,YAAa,KAAK,OAClB,OAAQJ,EACR,uBAAAC,EACA,QAAAC,CACF,CAAC,CACH,CAmBA,MAAa,2CAA2CV,EAGrD,CACD,GAAM,CAAE,eAAAQ,EAAgB,QAAAE,CAAQ,EAAIV,EACpC,OAAOa,EAA2C,CAAE,YAAa,KAAK,OAAQ,OAAQL,EAAgB,QAAAE,CAAQ,CAAC,CACjH,CAqBA,MAAa,0BAA0BV,EAA+C,CACpF,GAAM,CAAE,eAAAQ,CAAe,EAAIR,EACrB,CAAC,CAAE,IAAKc,CAAmB,CAAC,EAAI,MAAMC,EAE1C,CACA,YAAa,KAAK,OAClB,QAAS,CACP,SAAU,uDACV,kBAAmB,CAACR,EAAe,KAAKC,CAAc,CAAC,EACvD,IAAK,CAAE,eAAgB,CAAC,EAAG,WAAY,CAAC,IAAIQ,CAAgB,EAAG,YAAa,CAAC,CAAE,CACjF,CACF,CAAC,EAED,GAAIF,EAAmB,SAAW,EAElC,OAAOA,EAAmB,CAAC,EAAE,IAAKR,IAAkB,CAClD,cAAeC,EAAe,WAAWD,EAAa,cAAc,EACpE,WAAYA,EAAa,YACzB,aAAcA,EAAa,aAC7B,EAAE,CACJ,CA6FF","names":["AccountAbstraction","config","args","functionInfos","moduleAddress","moduleName","functionName","getFunctionParts","functionInfo","AccountAddress","accountAddress","authenticationFunction","options","addAuthenticationFunctionTransaction","removeAuthenticationFunctionTransaction","removeDispatchableAuthenticatorTransaction","functionInfoOption","view","TypeTagAddress"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as i}from"./chunk-W4BSN6SK.mjs";import{h as a}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as i}from"./chunk-W4BSN6SK.mjs";import{h as a}from"./chunk-2FNFUTFJ.mjs";import{a as o}from"./chunk-KDMSOCZY.mjs";var n=class{constructor(t){this.config=t}async simple(t){return a({aptosConfig:this.config,...t})}async multiAgent(t){return a({aptosConfig:this.config,...t})}};o([i],n.prototype,"simple",1),o([i],n.prototype,"multiAgent",1);export{n as a};
|
|
2
|
+
//# sourceMappingURL=chunk-HT2WC3QV.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as h,d as l}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as h,d as l}from"./chunk-TM6IKHMX.mjs";import{b as E}from"./chunk-EMURYYVO.mjs";import{a as p}from"./chunk-WCMW2L3P.mjs";import{a as g}from"./chunk-FN4C3CKC.mjs";var o=class o extends E{constructor(r){super();let{publicKeys:e,threshold:t}=r;if(e.length>o.MAX_KEYS||e.length<o.MIN_KEYS)throw new Error(`Must have between ${o.MIN_KEYS} and ${o.MAX_KEYS} public keys, inclusive`);if(t<o.MIN_THRESHOLD||t>e.length)throw new Error(`Threshold must be between ${o.MIN_THRESHOLD} and ${e.length}, inclusive`);this.publicKeys=e,this.threshold=t}verifySignature(r){let{message:e,signature:t}=r;if(!(t instanceof y))return!1;let s=[];for(let i=0;i<4;i+=1)for(let n=0;n<8;n+=1)if((t.bitmap[i]&1<<7-n)!==0){let u=i*8+n;s.push(u)}if(s.length!==t.signatures.length)throw new Error("Bitmap and signatures length mismatch");if(s.length<this.threshold)throw new Error("Not enough signatures");for(let i=0;i<s.length;i+=1)if(!this.publicKeys[s[i]].verifySignature({message:e,signature:t.signatures[i]}))return!1;return!0}authKey(){return g.fromSchemeAndBytes({scheme:1,input:this.toUint8Array()})}toUint8Array(){let r=new Uint8Array(this.publicKeys.length*h.LENGTH+1);return this.publicKeys.forEach((e,t)=>{r.set(e.toUint8Array(),t*h.LENGTH)}),r[this.publicKeys.length*h.LENGTH]=this.threshold,r}serialize(r){r.serializeBytes(this.toUint8Array())}static deserialize(r){let e=r.deserializeBytes(),t=e[e.length-1],s=[];for(let i=0;i<e.length-1;i+=h.LENGTH){let n=i;s.push(new h(e.subarray(n,n+h.LENGTH)))}return new o({publicKeys:s,threshold:t})}};o.MAX_KEYS=32,o.MIN_KEYS=2,o.MIN_THRESHOLD=1;var d=o,a=class a extends p{constructor(r){super();let{signatures:e,bitmap:t}=r;if(e.length>a.MAX_SIGNATURES_SUPPORTED)throw new Error(`The number of signatures cannot be greater than ${a.MAX_SIGNATURES_SUPPORTED}`);if(this.signatures=e,!(t instanceof Uint8Array))this.bitmap=a.createBitmap({bits:t});else{if(t.length!==a.BITMAP_LEN)throw new Error(`"bitmap" length should be ${a.BITMAP_LEN}`);this.bitmap=t}}toUint8Array(){let r=new Uint8Array(this.signatures.length*l.LENGTH+a.BITMAP_LEN);return this.signatures.forEach((e,t)=>{r.set(e.toUint8Array(),t*l.LENGTH)}),r.set(this.bitmap,this.signatures.length*l.LENGTH),r}serialize(r){r.serializeBytes(this.toUint8Array())}static deserialize(r){let e=r.deserializeBytes(),t=e.subarray(e.length-4),s=[];for(let i=0;i<e.length-t.length;i+=l.LENGTH){let n=i;s.push(new l(e.subarray(n,n+l.LENGTH)))}return new a({signatures:s,bitmap:t})}static createBitmap(r){let{bits:e}=r,t=128,s=new Uint8Array([0,0,0,0]),i=new Set;return e.forEach((n,c)=>{if(n>=a.MAX_SIGNATURES_SUPPORTED)throw new Error(`Cannot have a signature larger than ${a.MAX_SIGNATURES_SUPPORTED-1}.`);if(i.has(n))throw new Error("Duplicate bits detected.");if(c>0&&n<=e[c-1])throw new Error("The bits need to be sorted in ascending order.");i.add(n);let u=Math.floor(n/8),b=s[u];b|=t>>n%8,s[u]=b}),s}};a.MAX_SIGNATURES_SUPPORTED=32,a.BITMAP_LEN=4;var y=a;export{d as a,y as b};
|
|
2
|
+
//# sourceMappingURL=chunk-I7YHK6ZF.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/types/abstraction.ts"],"sourcesContent":["/**\n * The variant for the AbstractionAuthData enum.\n */\nexport enum AbstractionAuthDataVariant {\n V1 = 0,\n}\n"],"mappings":"AAGO,IAAKA,OACVA,IAAA,GAAK,GAAL,KADUA,OAAA","names":["AbstractionAuthDataVariant"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as m}from"./chunk-G4O6FXCF.mjs";import{a as g}from"./chunk-N4DM5FYH.mjs";import{a as p}from"./chunk-N6YTF76Q.mjs";import{b as
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as m}from"./chunk-G4O6FXCF.mjs";import{a as g}from"./chunk-N4DM5FYH.mjs";import{a as p}from"./chunk-N6YTF76Q.mjs";import{a as v,b as M}from"./chunk-IDTLNF4M.mjs";import{a as S}from"./chunk-TOBQ5UE6.mjs";import{a as F,b as d,c as T,d as x,e as E,f as _,g as w}from"./chunk-ORMOQWWH.mjs";import{b as y}from"./chunk-Q4C4U6I4.mjs";import{a as u}from"./chunk-EBMEXURY.mjs";function I(t){let e=t.deserializeUleb128AsU32();switch(e){case 0:return d.deserialize(t);case 1:return E.deserialize(t);case 2:return _.deserialize(t);case 3:return y.deserialize(t);case 4:return v.deserialize(t,d);case 5:return F.deserialize(t);case 6:return T.deserialize(t);case 7:return x.deserialize(t);case 8:return w.deserialize(t);case 9:return M.deserialize(t);default:throw new Error(`Unknown variant index for ScriptTransactionArgument: ${e}`)}}var a=class extends u{static deserialize(e){let r=e.deserializeUleb128AsU32();switch(r){case 0:return A.load(e);case 2:return z.load(e);case 3:return h.load(e);default:throw new Error(`Unknown variant index for TransactionPayload: ${r}`)}}},A=class t extends a{constructor(e){super(),this.script=e}serialize(e){e.serializeU32AsUleb128(0),this.script.serialize(e)}static load(e){let r=U.deserialize(e);return new t(r)}},z=class t extends a{constructor(e){super(),this.entryFunction=e}serialize(e){e.serializeU32AsUleb128(2),this.entryFunction.serialize(e)}static load(e){let r=l.deserialize(e);return new t(r)}},h=class t extends a{constructor(e){super(),this.multiSig=e}serialize(e){e.serializeU32AsUleb128(3),this.multiSig.serialize(e)}static load(e){let r=f.deserialize(e);return new t(r)}},l=class t{constructor(e,r,i,n){this.module_name=e,this.function_name=r,this.type_args=i,this.args=n}static build(e,r,i,n){return new t(g.fromStr(e),new p(r),i,n)}serialize(e){this.module_name.serialize(e),this.function_name.serialize(e),e.serializeVector(this.type_args),e.serializeU32AsUleb128(this.args.length),this.args.forEach(r=>{r.serializeForEntryFunction(e)})}static deserialize(e){let r=g.deserialize(e),i=p.deserialize(e),n=e.deserializeVector(m),o=e.deserializeUleb128AsU32(),s=new Array;for(let c=0;c<o;c+=1){let B=e.deserializeUleb128AsU32(),D=S.deserialize(e,B);s.push(D)}return new t(r,i,n,s)}},U=class t{constructor(e,r,i){this.bytecode=e,this.type_args=r,this.args=i}serialize(e){e.serializeBytes(this.bytecode),e.serializeVector(this.type_args),e.serializeU32AsUleb128(this.args.length),this.args.forEach(r=>{r.serializeForScriptFunction(e)})}static deserialize(e){let r=e.deserializeBytes(),i=e.deserializeVector(m),n=e.deserializeUleb128AsU32(),o=new Array;for(let s=0;s<n;s+=1){let c=I(e);o.push(c)}return new t(r,i,o)}},f=class t{constructor(e,r){this.multisig_address=e,this.transaction_payload=r}serialize(e){this.multisig_address.serialize(e),this.transaction_payload===void 0?e.serializeBool(!1):(e.serializeBool(!0),this.transaction_payload.serialize(e))}static deserialize(e){let r=y.deserialize(e),i=e.deserializeBool(),n;return i&&(n=b.deserialize(e)),new t(r,n)}},b=class t extends u{constructor(e){super(),this.transaction_payload=e}serialize(e){e.serializeU32AsUleb128(0),this.transaction_payload.serialize(e)}static deserialize(e){return e.deserializeUleb128AsU32(),new t(l.deserialize(e))}};export{I as a,a as b,A as c,z as d,h as e,l as f,U as g,f as h,b as i};
|
|
2
|
+
//# sourceMappingURL=chunk-J7HRQ2IH.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{h as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{h as e}from"./chunk-Y3Y4DVCK.mjs";async function i(o){o.minimumLedgerVersion!==void 0&&await e({aptosConfig:o.config,minimumLedgerVersion:o.minimumLedgerVersion,processorType:o.processorType})}export{i as a};
|
|
2
|
+
//# sourceMappingURL=chunk-JF66JS2R.mjs.map
|