@aptos-labs/ts-sdk 1.33.2 → 1.35.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 +15 -9
- package/dist/common/{accountAddress-Cf1amU98.d.ts → accountAddress-CuHovHdK.d.ts} +22 -2
- package/dist/common/chunk-RX5UBAME.js +4 -0
- package/dist/common/chunk-RX5UBAME.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 +3139 -2533
- package/dist/common/index.js +33 -35
- 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 +2 -1
- 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 +3 -2
- 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/MultiEd25519Account.d.mts +108 -0
- package/dist/esm/account/MultiEd25519Account.mjs +2 -0
- package/dist/esm/account/MultiKeyAccount.d.mts +2 -2
- 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 +4 -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 +4 -1
- 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 +6 -1
- package/dist/esm/api/aptos.mjs +1 -1
- package/dist/esm/api/aptosConfig.d.mts +1 -0
- package/dist/esm/api/aptosConfig.mjs +1 -1
- package/dist/esm/api/coin.d.mts +3 -2
- 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/experimental.d.mts +83 -0
- package/dist/esm/api/experimental.mjs +2 -0
- package/dist/esm/api/experimental.mjs.map +1 -0
- 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 +4 -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/deserializer.mjs +1 -1
- 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/entryFunctionBytes.mjs +1 -1
- package/dist/esm/bcs/serializable/fixedBytes.d.mts +1 -0
- package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -1
- 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/bcs/serializer.mjs +1 -1
- package/dist/esm/{chunk-7IY3DTEF.mjs → chunk-27ESCVVC.mjs} +2 -2
- package/dist/esm/chunk-2SAYQUUX.mjs +2 -0
- package/dist/esm/chunk-2SAYQUUX.mjs.map +1 -0
- package/dist/esm/{chunk-VUIHJIMX.mjs → chunk-2TRQERBL.mjs} +2 -2
- package/dist/esm/chunk-2V636AYW.mjs +2 -0
- package/dist/esm/{chunk-XTJOA5QN.mjs → chunk-2YKERRHD.mjs} +2 -2
- package/dist/esm/chunk-2ZLFQBT2.mjs +2 -0
- package/dist/esm/chunk-2ZLFQBT2.mjs.map +1 -0
- package/dist/esm/{chunk-5YWH3XPN.mjs → chunk-3LDVJ2YK.mjs} +2 -2
- package/dist/esm/chunk-3OLFJ65O.mjs +2 -0
- package/dist/esm/chunk-3OLFJ65O.mjs.map +1 -0
- package/dist/esm/{chunk-ONTWK5FU.mjs → chunk-44EHAKKW.mjs} +2 -2
- package/dist/esm/{chunk-OEQ2U7GK.mjs → chunk-53IBOHXB.mjs} +2 -2
- package/dist/esm/{chunk-YCQUYDZI.mjs → chunk-5H5D6QVX.mjs} +2 -2
- package/dist/esm/{chunk-G4O6FXCF.mjs → chunk-5W2ERBGY.mjs} +2 -2
- package/dist/esm/{chunk-NYETBDSR.mjs → chunk-67A5U2X6.mjs} +2 -2
- package/dist/esm/{chunk-AXYARCYT.mjs → chunk-6IJZRG3U.mjs} +2 -2
- package/dist/esm/{chunk-N4DM5FYH.mjs → chunk-6KZT3KFZ.mjs} +2 -2
- package/dist/esm/chunk-752TOOCA.mjs +2 -0
- package/dist/esm/chunk-752TOOCA.mjs.map +1 -0
- package/dist/esm/{chunk-2WCATZVL.mjs → chunk-7A2KHJ3D.mjs} +2 -2
- package/dist/esm/{chunk-ROT6S6BM.mjs → chunk-7CRQNXR5.mjs} +2 -2
- package/dist/esm/{chunk-FZD5RWSZ.mjs → chunk-7OUPEQRN.mjs} +2 -2
- package/dist/esm/chunk-A3VO773Q.mjs +2 -0
- package/dist/esm/{chunk-OHZURQPY.mjs → chunk-AEGA5N2W.mjs} +2 -2
- package/dist/esm/{chunk-BI3BTSUB.mjs → chunk-AIPHJFJL.mjs} +2 -2
- package/dist/esm/chunk-AQWKKSRN.mjs +2 -0
- package/dist/esm/chunk-AQWKKSRN.mjs.map +1 -0
- package/dist/esm/{chunk-4EUS4E6S.mjs → chunk-B23VO5TB.mjs} +2 -2
- package/dist/esm/chunk-BHVSIRNF.mjs +2 -0
- package/dist/esm/chunk-BHVSIRNF.mjs.map +1 -0
- package/dist/esm/chunk-BMPHQ3E7.mjs +2 -0
- package/dist/esm/chunk-BPHCRTHD.mjs +2 -0
- package/dist/esm/chunk-BPHCRTHD.mjs.map +1 -0
- package/dist/esm/{chunk-DYATTONT.mjs → chunk-BQYKFATL.mjs} +2 -2
- package/dist/esm/chunk-BY3XFRUM.mjs +2 -0
- package/dist/esm/{chunk-77AEKF7K.mjs.map → chunk-BY3XFRUM.mjs.map} +1 -1
- package/dist/esm/chunk-CGTMSLVZ.mjs +2 -0
- package/dist/esm/chunk-CGTMSLVZ.mjs.map +1 -0
- package/dist/esm/{chunk-QQEK7WVP.mjs → chunk-CPAAEEF4.mjs} +2 -2
- package/dist/esm/{chunk-ZAIVZDOL.mjs → chunk-CPFQUFVD.mjs} +2 -2
- package/dist/esm/chunk-CXLNTATW.mjs +2 -0
- package/dist/esm/chunk-CXLNTATW.mjs.map +1 -0
- package/dist/esm/{chunk-ZPV7HPA4.mjs → chunk-DAJFOJ3L.mjs} +2 -2
- package/dist/esm/chunk-DOVH6HPL.mjs +2 -0
- package/dist/esm/{chunk-KOORZTHC.mjs → chunk-E5PAUR4N.mjs} +2 -2
- package/dist/esm/{chunk-E7JDVKFY.mjs → chunk-EGCL6KA6.mjs} +2 -2
- package/dist/esm/{chunk-TOBQ5UE6.mjs → chunk-ERLDXTIY.mjs} +2 -2
- package/dist/esm/chunk-FJ5J7CVW.mjs +2 -0
- package/dist/esm/chunk-FJ5J7CVW.mjs.map +1 -0
- package/dist/esm/{chunk-X6UNY6YM.mjs → chunk-FOEPRHAC.mjs} +2 -2
- package/dist/esm/{chunk-XYB6KYKW.mjs → chunk-G5F5ZOH5.mjs} +2 -2
- package/dist/esm/chunk-GFPEB22G.mjs +1 -0
- package/dist/esm/chunk-GFPEB22G.mjs.map +1 -0
- package/dist/esm/{chunk-AZWVCBK2.mjs → chunk-GI4AR6DQ.mjs} +2 -2
- package/dist/esm/{chunk-3RCAJICY.mjs → chunk-GRRBXHVG.mjs} +2 -2
- package/dist/esm/{chunk-5EYTHMRZ.mjs → chunk-GTVMJJQQ.mjs} +2 -2
- package/dist/esm/{chunk-2TJ6OTVD.mjs → chunk-GU4MD5ST.mjs} +2 -2
- package/dist/esm/chunk-H4YAL2IL.mjs +2 -0
- package/dist/esm/{chunk-ZGVNZE7J.mjs → chunk-HBTJN4RJ.mjs} +2 -2
- package/dist/esm/{chunk-IDTLNF4M.mjs → chunk-HHWJHOFZ.mjs} +2 -2
- package/dist/esm/{chunk-XZ4JRYCE.mjs → chunk-HKL4MFNL.mjs} +2 -2
- package/dist/esm/{chunk-IEUEMBFD.mjs → chunk-HVIF6DW6.mjs} +2 -2
- package/dist/esm/{chunk-MWBRD43V.mjs → chunk-HYJQHVDZ.mjs} +2 -2
- package/dist/esm/chunk-HYJQHVDZ.mjs.map +1 -0
- package/dist/esm/{chunk-JJM6ELMS.mjs → chunk-ILUFGYLO.mjs} +2 -2
- package/dist/esm/chunk-IMTC3J2M.mjs +2 -0
- package/dist/esm/chunk-IMTC3J2M.mjs.map +1 -0
- package/dist/esm/chunk-IMYNN4TW.mjs +2 -0
- package/dist/esm/chunk-IMYNN4TW.mjs.map +1 -0
- package/dist/esm/{chunk-DOQV5BSA.mjs → chunk-IOHESHLR.mjs} +2 -2
- package/dist/esm/{chunk-NBNZ53ZV.mjs → chunk-JNNFNYDO.mjs} +2 -2
- package/dist/esm/{chunk-2UXW3EB7.mjs → chunk-K233I26C.mjs} +2 -2
- package/dist/esm/{chunk-VV4HCOJQ.mjs → chunk-KK5HUWF6.mjs} +2 -2
- package/dist/esm/chunk-KSLLV3ZC.mjs +2 -0
- package/dist/esm/chunk-KSLLV3ZC.mjs.map +1 -0
- package/dist/esm/{chunk-67ZVDKJF.mjs → chunk-L6KVC7CJ.mjs} +2 -2
- package/dist/esm/{chunk-Q4C4U6I4.mjs → chunk-LQOSHBB7.mjs} +2 -2
- package/dist/esm/{chunk-XKUIMGKU.mjs → chunk-LS3IDL2N.mjs} +2 -2
- package/dist/esm/{chunk-2N5KYALM.mjs → chunk-MAWGZICD.mjs} +2 -2
- package/dist/esm/{chunk-S7RZGC56.mjs → chunk-MFLHAVIW.mjs} +2 -2
- package/dist/esm/chunk-OLGEN23M.mjs +2 -0
- package/dist/esm/chunk-OLGEN23M.mjs.map +1 -0
- package/dist/esm/{chunk-MCLYDS3O.mjs → chunk-ONGH5DXZ.mjs} +2 -2
- package/dist/esm/chunk-OPD5EKOA.mjs +2 -0
- package/dist/esm/chunk-OPD5EKOA.mjs.map +1 -0
- package/dist/esm/{chunk-4ZYPDCSP.mjs → chunk-P5CM4C2G.mjs} +2 -2
- package/dist/esm/chunk-PC25RPDV.mjs +2 -0
- package/dist/esm/chunk-PC25RPDV.mjs.map +1 -0
- package/dist/esm/{chunk-N6YTF76Q.mjs → chunk-PDAWVDI7.mjs} +2 -2
- package/dist/esm/chunk-PIPDQFL2.mjs +2 -0
- package/dist/esm/chunk-PIPDQFL2.mjs.map +1 -0
- package/dist/esm/{chunk-43GCGE6C.mjs → chunk-PWGTRRSJ.mjs} +2 -2
- package/dist/esm/{chunk-P7A5RILV.mjs → chunk-PYY2RXFP.mjs} +2 -2
- package/dist/esm/chunk-PYY2RXFP.mjs.map +1 -0
- package/dist/esm/chunk-QUJM5W4L.mjs +2 -0
- package/dist/esm/chunk-QUJM5W4L.mjs.map +1 -0
- package/dist/esm/{chunk-2FBJWTJD.mjs → chunk-QYJKCRVA.mjs} +2 -2
- package/dist/esm/chunk-R6QCPXQG.mjs +2 -0
- package/dist/esm/chunk-R6QCPXQG.mjs.map +1 -0
- package/dist/esm/{chunk-6YHDZLRN.mjs → chunk-RDPWCN4B.mjs} +2 -2
- package/dist/esm/{chunk-MT2RJ7H3.mjs → chunk-RIINVEZA.mjs} +2 -2
- package/dist/esm/{chunk-EBMEXURY.mjs → chunk-RXHER6EA.mjs} +2 -2
- package/dist/esm/chunk-SJDHW55X.mjs +2 -0
- package/dist/esm/chunk-SJDHW55X.mjs.map +1 -0
- package/dist/esm/{chunk-UC23V7PU.mjs → chunk-T7X4GZDU.mjs} +2 -2
- package/dist/esm/{chunk-QHEKBHNU.mjs → chunk-TH5JCPN2.mjs} +2 -2
- package/dist/esm/{chunk-ORMOQWWH.mjs → chunk-TKXEVD7A.mjs} +2 -2
- package/dist/esm/{chunk-FN4C3CKC.mjs → chunk-TTY5GFMN.mjs} +2 -2
- package/dist/esm/chunk-TWETGZ3W.mjs +2 -0
- package/dist/esm/chunk-TWETGZ3W.mjs.map +1 -0
- package/dist/esm/{chunk-E5HGSOG2.mjs → chunk-U4DEYWFT.mjs} +2 -2
- package/dist/esm/chunk-UIRAXHDH.mjs +1 -0
- package/dist/esm/chunk-UIRAXHDH.mjs.map +1 -0
- package/dist/esm/{chunk-OROPNHRY.mjs → chunk-UJJGIPOA.mjs} +2 -2
- package/dist/esm/{chunk-CWKNJZB6.mjs → chunk-US2HZFOM.mjs} +2 -2
- package/dist/esm/{chunk-XY43TPRH.mjs → chunk-VDYUMBOT.mjs} +2 -2
- package/dist/esm/chunk-VHY6ZATX.mjs +2 -0
- package/dist/esm/chunk-VHY6ZATX.mjs.map +1 -0
- package/dist/esm/chunk-VWZEJTGP.mjs +4 -0
- package/dist/esm/chunk-VWZEJTGP.mjs.map +1 -0
- package/dist/esm/{chunk-WUWPN7XV.mjs → chunk-W2C5KRUQ.mjs} +2 -2
- package/dist/esm/{chunk-OR6GFWLG.mjs → chunk-W4SMZ6IW.mjs} +2 -2
- package/dist/esm/chunk-WFKPVKU3.mjs +2 -0
- package/dist/esm/chunk-WFKPVKU3.mjs.map +1 -0
- package/dist/esm/{chunk-5VMAJTTV.mjs → chunk-WHVCUVZP.mjs} +2 -2
- package/dist/esm/{chunk-WQRGDSPD.mjs → chunk-WLDYBSOG.mjs} +2 -2
- package/dist/esm/chunk-XRVZAEQO.mjs +2 -0
- package/dist/esm/chunk-XRVZAEQO.mjs.map +1 -0
- package/dist/esm/chunk-XSBUL2WP.mjs +2 -0
- package/dist/esm/chunk-XSBUL2WP.mjs.map +1 -0
- package/dist/esm/{chunk-BGSEBFFC.mjs → chunk-XW3BXTCZ.mjs} +2 -2
- package/dist/esm/{chunk-6CXMDJQR.mjs → chunk-Y65PKZLK.mjs} +2 -2
- package/dist/esm/{chunk-NWLJ6RW7.mjs → chunk-YAGIE4GN.mjs} +2 -2
- package/dist/esm/{chunk-M77M6NSB.mjs → chunk-YLUULY6G.mjs} +2 -2
- package/dist/esm/{chunk-5EBUWO2M.mjs → chunk-YWSDONJJ.mjs} +2 -2
- package/dist/esm/{chunk-V6VPMNWJ.mjs → chunk-YXYYII5S.mjs} +2 -2
- package/dist/esm/{chunk-XTOIL6MB.mjs → chunk-ZD2TY5N3.mjs} +2 -2
- package/dist/esm/{chunk-FIEMUPXF.mjs → chunk-ZS2IVRHT.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 +37 -1
- package/dist/esm/client/core.mjs +1 -1
- package/dist/esm/client/get.d.mts +36 -1
- package/dist/esm/client/get.mjs +1 -1
- package/dist/esm/client/index.d.mts +4 -3
- package/dist/esm/client/index.mjs +1 -1
- package/dist/esm/client/post.d.mts +35 -1
- 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 +2 -1
- 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 +18 -2
- package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
- package/dist/esm/core/crypto/multiKey.d.mts +34 -15
- 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/crypto/utils.mjs +1 -1
- package/dist/esm/core/hex.d.mts +1 -0
- package/dist/esm/core/hex.mjs +1 -1
- package/dist/esm/core/index.d.mts +2 -1
- 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 +16 -9
- 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/experimental.d.mts +52 -0
- package/dist/esm/internal/experimental.mjs +2 -0
- package/dist/esm/internal/experimental.mjs.map +1 -0
- 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/chainId.mjs +1 -1
- package/dist/esm/transactions/instances/identifier.d.mts +1 -0
- package/dist/esm/transactions/instances/identifier.mjs +1 -1
- 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 +1 -0
- 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 +22 -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 +21 -19
- package/src/account/AbstractedAccount.ts +111 -0
- package/src/account/MultiEd25519Account.ts +154 -0
- package/src/account/MultiKeyAccount.ts +1 -2
- package/src/account/index.ts +2 -0
- package/src/api/account/abstraction.ts +239 -0
- package/src/api/account.ts +7 -2
- package/src/api/aptos.ts +9 -0
- package/src/api/aptosConfig.ts +2 -2
- package/src/api/experimental.ts +64 -0
- package/src/api/transactionSubmission/build.ts +85 -2
- package/src/client/core.ts +120 -0
- package/src/client/get.ts +73 -1
- package/src/client/post.ts +70 -1
- package/src/core/crypto/abstraction.ts +47 -0
- package/src/core/crypto/multiEd25519.ts +19 -3
- package/src/core/crypto/multiKey.ts +76 -52
- package/src/core/hex.ts +3 -1
- package/src/internal/abstraction.ts +79 -0
- package/src/internal/experimental.ts +55 -0
- package/src/internal/view.ts +4 -4
- 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 +9 -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 +21 -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-4YLUM62M.mjs +0 -2
- package/dist/esm/chunk-5PXDPMF2.mjs +0 -4
- package/dist/esm/chunk-5PXDPMF2.mjs.map +0 -1
- package/dist/esm/chunk-6IEZPA4H.mjs +0 -2
- package/dist/esm/chunk-6IEZPA4H.mjs.map +0 -1
- package/dist/esm/chunk-6YWYAVFS.mjs +0 -2
- package/dist/esm/chunk-6YWYAVFS.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-DPW6ELCQ.mjs +0 -2
- package/dist/esm/chunk-EMURYYVO.mjs +0 -2
- package/dist/esm/chunk-F2ZTBAJJ.mjs +0 -2
- package/dist/esm/chunk-F2ZTBAJJ.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-MWBRD43V.mjs.map +0 -1
- package/dist/esm/chunk-OSBRPVVI.mjs +0 -2
- package/dist/esm/chunk-OSBRPVVI.mjs.map +0 -1
- package/dist/esm/chunk-P7A5RILV.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-S4LZMY2L.mjs +0 -2
- package/dist/esm/chunk-S4LZMY2L.mjs.map +0 -1
- package/dist/esm/chunk-STY74NUA.mjs +0 -2
- package/dist/esm/chunk-STY74NUA.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-VVXBVJXD.mjs +0 -2
- package/dist/esm/chunk-VVXBVJXD.mjs.map +0 -1
- package/dist/esm/chunk-WCMW2L3P.mjs +0 -2
- package/dist/esm/chunk-XJJVJOX5.mjs +0 -2
- /package/dist/esm/{chunk-FD6FGKYY.mjs.map → account/AbstractedAccount.mjs.map} +0 -0
- /package/dist/esm/{chunk-GP4TLDVZ.mjs.map → account/MultiEd25519Account.mjs.map} +0 -0
- /package/dist/esm/{chunk-I5OYNCZS.mjs.map → api/account/abstraction.mjs.map} +0 -0
- /package/dist/esm/{chunk-7IY3DTEF.mjs.map → chunk-27ESCVVC.mjs.map} +0 -0
- /package/dist/esm/{chunk-VUIHJIMX.mjs.map → chunk-2TRQERBL.mjs.map} +0 -0
- /package/dist/esm/{chunk-XJJVJOX5.mjs.map → chunk-2V636AYW.mjs.map} +0 -0
- /package/dist/esm/{chunk-XTJOA5QN.mjs.map → chunk-2YKERRHD.mjs.map} +0 -0
- /package/dist/esm/{chunk-5YWH3XPN.mjs.map → chunk-3LDVJ2YK.mjs.map} +0 -0
- /package/dist/esm/{chunk-ONTWK5FU.mjs.map → chunk-44EHAKKW.mjs.map} +0 -0
- /package/dist/esm/{chunk-OEQ2U7GK.mjs.map → chunk-53IBOHXB.mjs.map} +0 -0
- /package/dist/esm/{chunk-YCQUYDZI.mjs.map → chunk-5H5D6QVX.mjs.map} +0 -0
- /package/dist/esm/{chunk-G4O6FXCF.mjs.map → chunk-5W2ERBGY.mjs.map} +0 -0
- /package/dist/esm/{chunk-NYETBDSR.mjs.map → chunk-67A5U2X6.mjs.map} +0 -0
- /package/dist/esm/{chunk-AXYARCYT.mjs.map → chunk-6IJZRG3U.mjs.map} +0 -0
- /package/dist/esm/{chunk-N4DM5FYH.mjs.map → chunk-6KZT3KFZ.mjs.map} +0 -0
- /package/dist/esm/{chunk-2WCATZVL.mjs.map → chunk-7A2KHJ3D.mjs.map} +0 -0
- /package/dist/esm/{chunk-ROT6S6BM.mjs.map → chunk-7CRQNXR5.mjs.map} +0 -0
- /package/dist/esm/{chunk-FZD5RWSZ.mjs.map → chunk-7OUPEQRN.mjs.map} +0 -0
- /package/dist/esm/{chunk-WCMW2L3P.mjs.map → chunk-A3VO773Q.mjs.map} +0 -0
- /package/dist/esm/{chunk-OHZURQPY.mjs.map → chunk-AEGA5N2W.mjs.map} +0 -0
- /package/dist/esm/{chunk-BI3BTSUB.mjs.map → chunk-AIPHJFJL.mjs.map} +0 -0
- /package/dist/esm/{chunk-4EUS4E6S.mjs.map → chunk-B23VO5TB.mjs.map} +0 -0
- /package/dist/esm/{chunk-4YLUM62M.mjs.map → chunk-BMPHQ3E7.mjs.map} +0 -0
- /package/dist/esm/{chunk-DYATTONT.mjs.map → chunk-BQYKFATL.mjs.map} +0 -0
- /package/dist/esm/{chunk-QQEK7WVP.mjs.map → chunk-CPAAEEF4.mjs.map} +0 -0
- /package/dist/esm/{chunk-ZAIVZDOL.mjs.map → chunk-CPFQUFVD.mjs.map} +0 -0
- /package/dist/esm/{chunk-ZPV7HPA4.mjs.map → chunk-DAJFOJ3L.mjs.map} +0 -0
- /package/dist/esm/{chunk-DPW6ELCQ.mjs.map → chunk-DOVH6HPL.mjs.map} +0 -0
- /package/dist/esm/{chunk-KOORZTHC.mjs.map → chunk-E5PAUR4N.mjs.map} +0 -0
- /package/dist/esm/{chunk-E7JDVKFY.mjs.map → chunk-EGCL6KA6.mjs.map} +0 -0
- /package/dist/esm/{chunk-TOBQ5UE6.mjs.map → chunk-ERLDXTIY.mjs.map} +0 -0
- /package/dist/esm/{chunk-X6UNY6YM.mjs.map → chunk-FOEPRHAC.mjs.map} +0 -0
- /package/dist/esm/{chunk-XYB6KYKW.mjs.map → chunk-G5F5ZOH5.mjs.map} +0 -0
- /package/dist/esm/{chunk-AZWVCBK2.mjs.map → chunk-GI4AR6DQ.mjs.map} +0 -0
- /package/dist/esm/{chunk-3RCAJICY.mjs.map → chunk-GRRBXHVG.mjs.map} +0 -0
- /package/dist/esm/{chunk-5EYTHMRZ.mjs.map → chunk-GTVMJJQQ.mjs.map} +0 -0
- /package/dist/esm/{chunk-2TJ6OTVD.mjs.map → chunk-GU4MD5ST.mjs.map} +0 -0
- /package/dist/esm/{chunk-EMURYYVO.mjs.map → chunk-H4YAL2IL.mjs.map} +0 -0
- /package/dist/esm/{chunk-ZGVNZE7J.mjs.map → chunk-HBTJN4RJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-IDTLNF4M.mjs.map → chunk-HHWJHOFZ.mjs.map} +0 -0
- /package/dist/esm/{chunk-XZ4JRYCE.mjs.map → chunk-HKL4MFNL.mjs.map} +0 -0
- /package/dist/esm/{chunk-IEUEMBFD.mjs.map → chunk-HVIF6DW6.mjs.map} +0 -0
- /package/dist/esm/{chunk-JJM6ELMS.mjs.map → chunk-ILUFGYLO.mjs.map} +0 -0
- /package/dist/esm/{chunk-DOQV5BSA.mjs.map → chunk-IOHESHLR.mjs.map} +0 -0
- /package/dist/esm/{chunk-NBNZ53ZV.mjs.map → chunk-JNNFNYDO.mjs.map} +0 -0
- /package/dist/esm/{chunk-2UXW3EB7.mjs.map → chunk-K233I26C.mjs.map} +0 -0
- /package/dist/esm/{chunk-VV4HCOJQ.mjs.map → chunk-KK5HUWF6.mjs.map} +0 -0
- /package/dist/esm/{chunk-67ZVDKJF.mjs.map → chunk-L6KVC7CJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-Q4C4U6I4.mjs.map → chunk-LQOSHBB7.mjs.map} +0 -0
- /package/dist/esm/{chunk-XKUIMGKU.mjs.map → chunk-LS3IDL2N.mjs.map} +0 -0
- /package/dist/esm/{chunk-2N5KYALM.mjs.map → chunk-MAWGZICD.mjs.map} +0 -0
- /package/dist/esm/{chunk-S7RZGC56.mjs.map → chunk-MFLHAVIW.mjs.map} +0 -0
- /package/dist/esm/{chunk-MCLYDS3O.mjs.map → chunk-ONGH5DXZ.mjs.map} +0 -0
- /package/dist/esm/{chunk-4ZYPDCSP.mjs.map → chunk-P5CM4C2G.mjs.map} +0 -0
- /package/dist/esm/{chunk-N6YTF76Q.mjs.map → chunk-PDAWVDI7.mjs.map} +0 -0
- /package/dist/esm/{chunk-43GCGE6C.mjs.map → chunk-PWGTRRSJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-2FBJWTJD.mjs.map → chunk-QYJKCRVA.mjs.map} +0 -0
- /package/dist/esm/{chunk-6YHDZLRN.mjs.map → chunk-RDPWCN4B.mjs.map} +0 -0
- /package/dist/esm/{chunk-MT2RJ7H3.mjs.map → chunk-RIINVEZA.mjs.map} +0 -0
- /package/dist/esm/{chunk-EBMEXURY.mjs.map → chunk-RXHER6EA.mjs.map} +0 -0
- /package/dist/esm/{chunk-UC23V7PU.mjs.map → chunk-T7X4GZDU.mjs.map} +0 -0
- /package/dist/esm/{chunk-QHEKBHNU.mjs.map → chunk-TH5JCPN2.mjs.map} +0 -0
- /package/dist/esm/{chunk-ORMOQWWH.mjs.map → chunk-TKXEVD7A.mjs.map} +0 -0
- /package/dist/esm/{chunk-FN4C3CKC.mjs.map → chunk-TTY5GFMN.mjs.map} +0 -0
- /package/dist/esm/{chunk-E5HGSOG2.mjs.map → chunk-U4DEYWFT.mjs.map} +0 -0
- /package/dist/esm/{chunk-OROPNHRY.mjs.map → chunk-UJJGIPOA.mjs.map} +0 -0
- /package/dist/esm/{chunk-CWKNJZB6.mjs.map → chunk-US2HZFOM.mjs.map} +0 -0
- /package/dist/esm/{chunk-XY43TPRH.mjs.map → chunk-VDYUMBOT.mjs.map} +0 -0
- /package/dist/esm/{chunk-WUWPN7XV.mjs.map → chunk-W2C5KRUQ.mjs.map} +0 -0
- /package/dist/esm/{chunk-OR6GFWLG.mjs.map → chunk-W4SMZ6IW.mjs.map} +0 -0
- /package/dist/esm/{chunk-5VMAJTTV.mjs.map → chunk-WHVCUVZP.mjs.map} +0 -0
- /package/dist/esm/{chunk-WQRGDSPD.mjs.map → chunk-WLDYBSOG.mjs.map} +0 -0
- /package/dist/esm/{chunk-BGSEBFFC.mjs.map → chunk-XW3BXTCZ.mjs.map} +0 -0
- /package/dist/esm/{chunk-6CXMDJQR.mjs.map → chunk-Y65PKZLK.mjs.map} +0 -0
- /package/dist/esm/{chunk-NWLJ6RW7.mjs.map → chunk-YAGIE4GN.mjs.map} +0 -0
- /package/dist/esm/{chunk-M77M6NSB.mjs.map → chunk-YLUULY6G.mjs.map} +0 -0
- /package/dist/esm/{chunk-5EBUWO2M.mjs.map → chunk-YWSDONJJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-V6VPMNWJ.mjs.map → chunk-YXYYII5S.mjs.map} +0 -0
- /package/dist/esm/{chunk-XTOIL6MB.mjs.map → chunk-ZD2TY5N3.mjs.map} +0 -0
- /package/dist/esm/{chunk-FIEMUPXF.mjs.map → chunk-ZS2IVRHT.mjs.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as r}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as r}from"./chunk-53IBOHXB.mjs";import{f as t,i as o}from"./chunk-5W2ERBGY.mjs";import{e as n}from"./chunk-RJ7F4JDV.mjs";var u={typeParameters:[{constraints:[]}],parameters:[new o,new t]};async function y(e){let{aptosConfig:i,sender:s,recipient:c,amount:p,coinType:a,options:m}=e;return r({aptosConfig:i,sender:s,data:{function:"0x1::aptos_account::transfer_coins",typeArguments:[a??n],functionArguments:[c,p],abi:u},options:m})}export{y as a};
|
|
2
|
+
//# sourceMappingURL=chunk-7A2KHJ3D.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as r}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as r}from"./chunk-VHY6ZATX.mjs";var a=class a{static formatPrivateKey(i,n){let e=a.AIP80_PREFIXES[n],t=i;return typeof t=="string"&&t.startsWith(e)&&(t=t.split("-")[2]),`${e}${r.fromHexInput(t).toString()}`}static parseHexInput(i,n,e){let t,p=a.AIP80_PREFIXES[n];if(typeof i=="string")if(!e&&!i.startsWith(p))t=r.fromHexInput(i),e!==!1&&console.warn("[Aptos SDK] It is recommended that private keys are AIP-80 compliant (https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-80.md). You can fix the private key by formatting it with `PrivateKey.formatPrivateKey(privateKey: string, type: 'ed25519' | 'secp256k1'): string`.");else if(i.startsWith(p))t=r.fromHexString(i.split("-")[2]);else throw e?new Error("Invalid HexString input while parsing private key. Must AIP-80 compliant string."):new Error("Invalid HexString input while parsing private key.");else t=r.fromHexInput(i);return t}};a.AIP80_PREFIXES={ed25519:"ed25519-priv-",secp256k1:"secp256k1-priv-"};var o=a;export{o as a};
|
|
2
|
+
//# sourceMappingURL=chunk-7CRQNXR5.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as d}from"./chunk-DOVH6HPL.mjs";import{d as A,f as v,g as S,h as E,i as H,j as P}from"./chunk-C3Q23D22.mjs";import{a as x}from"./chunk-7CRQNXR5.mjs";import{b}from"./chunk-H4YAL2IL.mjs";import{a as U}from"./chunk-A3VO773Q.mjs";import{a as K}from"./chunk-TTY5GFMN.mjs";import{a as p}from"./chunk-RXHER6EA.mjs";import{b as o}from"./chunk-VHY6ZATX.mjs";import{ed25519 as y}from"@noble/curves/ed25519";var m=[237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16];function T(I){let e=I.toUint8Array().slice(32);for(let t=m.length-1;t>=0;t-=1){if(e[t]<m[t])return!0;if(e[t]>m[t])return!1}return!1}var n=class n extends b{constructor(e){super();let t=o.fromHexInput(e);if(t.toUint8Array().length!==n.LENGTH)throw new Error(`PublicKey length should be ${n.LENGTH}`);this.key=t}verifySignature(e){let{message:t,signature:i}=e;if(!T(i))return!1;let a=d(t),c=o.fromHexInput(a).toUint8Array(),u=i.toUint8Array(),l=this.key.toUint8Array();return y.verify(u,c,l)}authKey(){return K.fromSchemeAndBytes({scheme:0,input:this.toUint8Array()})}toUint8Array(){return this.key.toUint8Array()}serialize(e){e.serializeBytes(this.key.toUint8Array())}static deserialize(e){let t=e.deserializeBytes();return new n(t)}static isPublicKey(e){return e instanceof n}static isInstance(e){return"key"in e&&e.key?.data?.length===n.LENGTH}};n.LENGTH=32;var f=n,r=class r extends p{constructor(e,t){super();let i=x.parseHexInput(e,"ed25519",t);if(i.toUint8Array().length!==r.LENGTH)throw new Error(`PrivateKey length should be ${r.LENGTH}`);this.signingKey=i}static generate(){let e=y.utils.randomPrivateKey();return new r(e,!1)}static fromDerivationPath(e,t){if(!v(e))throw new Error(`Invalid derivation path ${e}`);return r.fromDerivationPathInner(e,P(t))}static fromDerivationPathInner(e,t,i=A){let{key:a,chainCode:c}=S(r.SLIP_0010_SEED,t),u=H(e).map(g=>parseInt(g,10)),{key:l}=u.reduce((g,w)=>E(g,w+i),{key:a,chainCode:c});return new r(l,!1)}publicKey(){let e=y.getPublicKey(this.signingKey.toUint8Array());return new f(e)}sign(e){let t=d(e),i=o.fromHexInput(t).toUint8Array(),a=y.sign(i,this.signingKey.toUint8Array());return new h(a)}toUint8Array(){return this.signingKey.toUint8Array()}toString(){return this.toHexString()}toHexString(){return this.signingKey.toString()}toAIP80String(){return x.formatPrivateKey(this.signingKey.toString(),"ed25519")}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let t=e.deserializeBytes();return new r(t,!1)}static isPrivateKey(e){return e instanceof r}};r.LENGTH=32,r.SLIP_0010_SEED="ed25519 seed";var z=r,s=class s extends U{constructor(e){super();let t=o.fromHexInput(e);if(t.toUint8Array().length!==s.LENGTH)throw new Error(`Signature length should be ${s.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 s(t)}};s.LENGTH=64;var h=s;export{T as a,f as b,z as c,h as d};
|
|
2
|
+
//# sourceMappingURL=chunk-7OUPEQRN.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as r}from"./chunk-RXHER6EA.mjs";import{b as t}from"./chunk-VHY6ZATX.mjs";var o=class extends r{toUint8Array(){return this.bcsToBytes()}toString(){let i=this.toUint8Array();return t.fromHexInput(i).toString()}};export{o as a};
|
|
2
|
+
//# sourceMappingURL=chunk-A3VO773Q.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as u,c as r}from"./chunk-HHWJHOFZ.mjs";import{e as t}from"./chunk-TKXEVD7A.mjs";import{b as o}from"./chunk-LQOSHBB7.mjs";import{a as i}from"./chunk-RXHER6EA.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-AEGA5N2W.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as c}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as c}from"./chunk-LQOSHBB7.mjs";import{sha3_256 as n}from"@noble/hashes/sha3";var d=(e,r)=>{let t=e.bcsToBytes(),s=typeof r=="string"?Buffer.from(r,"utf8"):r,o=new Uint8Array([...t,...s,254]);return new c(n(o))},f=(e,r)=>{let t=e.bcsToBytes(),s=typeof r=="string"?Buffer.from(r,"utf8"):r,o=new Uint8Array([...t,...s,255]);return new c(n(o))},a=(e,r,t)=>{let s=`${r}::${t}`;return d(e,s)};export{d as a,f as b,a as c};
|
|
2
|
+
//# sourceMappingURL=chunk-AIPHJFJL.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as u,b as d,c as p}from"./chunk-PC25RPDV.mjs";import{a as r}from"./chunk-PYY2RXFP.mjs";import{i as a}from"./chunk-5W2ERBGY.mjs";import{j as s}from"./chunk-BHVSIRNF.mjs";import{b as c}from"./chunk-LQOSHBB7.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-AQWKKSRN.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{c as a}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{c as a}from"./chunk-HKL4MFNL.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-B23VO5TB.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{b as s}from"./chunk-LQOSHBB7.mjs";import{decode as i}from"js-base64";async function m(n){return new Promise(e=>{setTimeout(e,n)})}function l(n){return n instanceof Error?n.message:String(n)}var g=()=>Math.floor(Date.now()/1e3);function p(n){let e=new Date(n*1e3);return e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0),Math.floor(e.getTime()/1e3)}function f(n){let e=n.replace(/-/g,"+").replace(/_/g,"/"),t=e+"==".substring(0,(3-e.length%3)%3);return i(t)}var _=(n,e)=>n*10**e,h=(n,e)=>n/10**e,a=n=>{let e="";for(let t=2;t<n.length;t+=2)e+=String.fromCharCode(parseInt(n.substring(t,t+2),16));return e},x=n=>{let{account_address:e,module_name:t,struct_name:o}=n,r=a(t),c=a(o);return`${e}::${r}::${c}`},S=n=>typeof n=="object"&&!Array.isArray(n)&&n!==null&&"account_address"in n&&"module_name"in n&&"struct_name"in n&&typeof n.account_address=="string"&&typeof n.module_name=="string"&&typeof n.struct_name=="string";function M(n){let e=n.split("::");if(e.length!==3)throw new Error(`Invalid function ${n}`);let t=e[0],o=e[1],r=e[2];return{moduleAddress:t,moduleName:o,functionName:r}}function b(n){let e=n.split("::");return e.length===3&&s.isValid({input:e[0]}).valid}export{m as a,l as b,g as c,p as d,f as e,_ as f,h as g,x as h,S as i,M as j,b as k};
|
|
2
|
+
//# sourceMappingURL=chunk-BHVSIRNF.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/helpers.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { decode } from \"js-base64\";\nimport { MoveFunctionId, MoveStructId } from \"../types\";\nimport { AccountAddress } from \"../core/accountAddress\";\n\n/**\n * Sleep for the specified amount of time in milliseconds.\n * This function can be used to introduce delays in asynchronous operations.\n *\n * @param timeMs - The time in milliseconds to sleep.\n * @group Implementation\n * @category Utils\n */\nexport async function sleep(timeMs: number): Promise<null> {\n return new Promise((resolve) => {\n setTimeout(resolve, timeMs);\n });\n}\n\n/**\n * Get the error message from an unknown error.\n *\n * @param error The error to get the message from\n * @returns The error message\n * @group Implementation\n * @category Utils\n */\nexport function getErrorMessage(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n\n/**\n * @group Implementation\n * @category Utils\n */\nexport const nowInSeconds = () => Math.floor(Date.now() / 1000);\n\n/**\n * Floors the given timestamp to the nearest whole hour.\n * This function is useful for normalizing timestamps to hourly intervals.\n *\n * @param timestampInSeconds - The timestamp in seconds to be floored.\n * @group Implementation\n * @category Utils\n */\nexport function floorToWholeHour(timestampInSeconds: number): number {\n const date = new Date(timestampInSeconds * 1000);\n // Reset minutes and seconds to zero\n date.setMinutes(0);\n date.setSeconds(0);\n date.setMilliseconds(0);\n return Math.floor(date.getTime() / 1000);\n}\n\n/**\n * Decodes a base64 URL-encoded string into its original form.\n * This function is useful for converting base64 URL-encoded data back to a readable format.\n *\n * @param base64Url - The base64 URL-encoded string to decode.\n * @returns The decoded string.\n * @group Implementation\n * @category Utils\n */\nexport function base64UrlDecode(base64Url: string): string {\n // Replace base64url-specific characters\n const base64 = base64Url.replace(/-/g, \"+\").replace(/_/g, \"/\");\n // Pad the string with '=' characters if needed\n const paddedBase64 = base64 + \"==\".substring(0, (3 - (base64.length % 3)) % 3);\n const decodedString = decode(paddedBase64);\n return decodedString;\n}\n\n/**\n * Amount is represented in the smallest unit format on chain, this function converts\n * a human-readable amount format to the smallest unit format\n * @example\n * human-readable amount format: 500\n * on chain amount format when decimal is 8: 50000000000\n *\n * @param value The value in human-readable format\n * @param decimal The token decimal\n * @returns The value in the smallest units\n * @group Implementation\n * @category Utils\n */\nexport const convertAmountFromHumanReadableToOnChain = (value: number, decimal: number) => value * 10 ** decimal;\n\n/**\n * Amount is represented in the smallest unit format on chain, this function converts\n * the smallest unit format to a human-readable amount format\n * @example\n * human-readable amount format: 500\n * on chain amount format when decimal is 8: 50000000000\n *\n * @param value The value in human-readable format\n * @param decimal The token decimal\n * @returns The value in the smallest units\n * @group Implementation\n * @category Utils\n */\nexport const convertAmountFromOnChainToHumanReadable = (value: number, decimal: number) => value / 10 ** decimal;\n\n/**\n * Convert a hex string to an ascii string with the `0x` prefix.\n *\n * `0x6170746f735f636f696e` --> `aptos_coin`\n *\n * @param hex The hex string to convert (e.g. `0x6170746f735f636f696e`)\n * @returns The ascii string\n * @group Implementation\n * @category Utils\n */\nconst hexToAscii = (hex: string) => {\n let str = \"\";\n for (let n = 2; n < hex.length; n += 2) {\n str += String.fromCharCode(parseInt(hex.substring(n, n + 2), 16));\n }\n return str;\n};\n\n/**\n * Convert an encoded struct to a MoveStructId.\n *\n * @example\n * const structObj = {\n * account_address: \"0x1\",\n * module_name: \"0x6170746f735f636f696e\",\n * struct_name: \"0x4170746f73436f696e\",\n * };\n * // structId is \"0x1::aptos_coin::AptosCoin\"\n * const structId = parseEncodedStruct(structObj);\n *\n * @param structObj The struct with account_address, module_name, and struct_name properties\n * @returns The MoveStructId\n * @group Implementation\n * @category Utils\n */\nexport const parseEncodedStruct = (structObj: {\n account_address: string;\n module_name: string;\n struct_name: string;\n}): MoveStructId => {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n const { account_address, module_name, struct_name } = structObj;\n const moduleName = hexToAscii(module_name);\n const structName = hexToAscii(struct_name);\n return `${account_address}::${moduleName}::${structName}`;\n};\n\n/**\n * Determines whether the given object is an encoded struct type with the following properties:\n * - account_address: string\n * - module_name: string\n * - struct_name: string\n *\n * @param structObj The object to check\n * @returns Whether the object is an encoded struct type\n * @group Implementation\n * @category Utils\n */\nexport const isEncodedStruct = (\n structObj: any,\n): structObj is {\n account_address: string;\n module_name: string;\n struct_name: string;\n} =>\n typeof structObj === \"object\" &&\n !Array.isArray(structObj) &&\n structObj !== null &&\n \"account_address\" in structObj &&\n \"module_name\" in structObj &&\n \"struct_name\" in structObj &&\n typeof structObj.account_address === \"string\" &&\n typeof structObj.module_name === \"string\" &&\n typeof structObj.struct_name === \"string\";\n\n/**\n * Splits a function identifier into its constituent parts: module address, module name, and function name.\n * This function helps in validating and extracting details from a function identifier string.\n *\n * @param functionArg - The function identifier string in the format \"moduleAddress::moduleName::functionName\".\n * @returns An object containing the module address, module name, and function name.\n * @throws Error if the function identifier does not contain exactly three parts.\n * @group Implementation\n * @category Transactions\n */\nexport function getFunctionParts(functionArg: MoveFunctionId) {\n const funcNameParts = functionArg.split(\"::\");\n if (funcNameParts.length !== 3) {\n throw new Error(`Invalid function ${functionArg}`);\n }\n const moduleAddress = funcNameParts[0];\n const moduleName = funcNameParts[1];\n const functionName = funcNameParts[2];\n return { moduleAddress, moduleName, functionName };\n}\n\nexport function isValidFunctionInfo(functionInfo: string): boolean {\n const parts = functionInfo.split(\"::\");\n return parts.length === 3 && AccountAddress.isValid({ input: parts[0] }).valid;\n}\n"],"mappings":"yCAGA,OAAS,UAAAA,MAAc,YAYvB,eAAsBC,EAAMC,EAA+B,CACzD,OAAO,IAAI,QAASC,GAAY,CAC9B,WAAWA,EAASD,CAAM,CAC5B,CAAC,CACH,CAUO,SAASE,EAAgBC,EAAwB,CACtD,OAAOA,aAAiB,MAAQA,EAAM,QAAU,OAAOA,CAAK,CAC9D,CAMO,IAAMC,EAAe,IAAM,KAAK,MAAM,KAAK,IAAI,EAAI,GAAI,EAUvD,SAASC,EAAiBC,EAAoC,CACnE,IAAMC,EAAO,IAAI,KAAKD,EAAqB,GAAI,EAE/C,OAAAC,EAAK,WAAW,CAAC,EACjBA,EAAK,WAAW,CAAC,EACjBA,EAAK,gBAAgB,CAAC,EACf,KAAK,MAAMA,EAAK,QAAQ,EAAI,GAAI,CACzC,CAWO,SAASC,EAAgBC,EAA2B,CAEzD,IAAMC,EAASD,EAAU,QAAQ,KAAM,GAAG,EAAE,QAAQ,KAAM,GAAG,EAEvDE,EAAeD,EAAS,KAAK,UAAU,GAAI,EAAKA,EAAO,OAAS,GAAM,CAAC,EAE7E,OADsBE,EAAOD,CAAY,CAE3C,CAeO,IAAME,EAA0C,CAACC,EAAeC,IAAoBD,EAAQ,IAAMC,EAe5FC,EAA0C,CAACF,EAAeC,IAAoBD,EAAQ,IAAMC,EAYnGE,EAAcC,GAAgB,CAClC,IAAIC,EAAM,GACV,QAASC,EAAI,EAAGA,EAAIF,EAAI,OAAQE,GAAK,EACnCD,GAAO,OAAO,aAAa,SAASD,EAAI,UAAUE,EAAGA,EAAI,CAAC,EAAG,EAAE,CAAC,EAElE,OAAOD,CACT,EAmBaE,EAAsBC,GAIf,CAElB,GAAM,CAAE,gBAAAC,EAAiB,YAAAC,EAAa,YAAAC,CAAY,EAAIH,EAChDI,EAAaT,EAAWO,CAAW,EACnCG,EAAaV,EAAWQ,CAAW,EACzC,MAAO,GAAGF,CAAe,KAAKG,CAAU,KAAKC,CAAU,EACzD,EAaaC,EACXN,GAMA,OAAOA,GAAc,UACrB,CAAC,MAAM,QAAQA,CAAS,GACxBA,IAAc,MACd,oBAAqBA,GACrB,gBAAiBA,GACjB,gBAAiBA,GACjB,OAAOA,EAAU,iBAAoB,UACrC,OAAOA,EAAU,aAAgB,UACjC,OAAOA,EAAU,aAAgB,SAY5B,SAASO,EAAiBC,EAA6B,CAC5D,IAAMC,EAAgBD,EAAY,MAAM,IAAI,EAC5C,GAAIC,EAAc,SAAW,EAC3B,MAAM,IAAI,MAAM,oBAAoBD,CAAW,EAAE,EAEnD,IAAME,EAAgBD,EAAc,CAAC,EAC/BL,EAAaK,EAAc,CAAC,EAC5BE,EAAeF,EAAc,CAAC,EACpC,MAAO,CAAE,cAAAC,EAAe,WAAAN,EAAY,aAAAO,CAAa,CACnD,CAEO,SAASC,EAAoBC,EAA+B,CACjE,IAAMC,EAAQD,EAAa,MAAM,IAAI,EACrC,OAAOC,EAAM,SAAW,GAAKC,EAAe,QAAQ,CAAE,MAAOD,EAAM,CAAC,CAAE,CAAC,EAAE,KAC3E","names":["decode","sleep","timeMs","resolve","getErrorMessage","error","nowInSeconds","floorToWholeHour","timestampInSeconds","date","base64UrlDecode","base64Url","base64","paddedBase64","decode","convertAmountFromHumanReadableToOnChain","value","decimal","convertAmountFromOnChainToHumanReadable","hexToAscii","hex","str","n","parseEncodedStruct","structObj","account_address","module_name","struct_name","moduleName","structName","isEncodedStruct","getFunctionParts","functionArg","funcNameParts","moduleAddress","functionName","isValidFunctionInfo","functionInfo","parts","AccountAddress"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as E,b as K}from"./chunk-WFKPVKU3.mjs";import{b as x,c as M}from"./chunk-QUJM5W4L.mjs";import{a as S,b as f}from"./chunk-2TRQERBL.mjs";import{b as h,d as A}from"./chunk-7OUPEQRN.mjs";import{j as z,k as m}from"./chunk-BHVSIRNF.mjs";import{b as d}from"./chunk-LQOSHBB7.mjs";import{a as g}from"./chunk-RXHER6EA.mjs";import{b as r}from"./chunk-VHY6ZATX.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=E.deserialize(e),t=K.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=S.deserialize(e),t=f.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=x.deserialize(e),t=M.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(),!m(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}=z(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-BPHCRTHD.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":"2WAwBO,IAAeA,EAAf,cAA4CC,CAAa,CAW9D,OAAO,YAAYC,EAAkD,CACnE,IAAMC,EAAQD,EAAa,wBAAwB,EACnD,OAAQC,EAAO,CACb,OACE,OAAOC,EAA4B,KAAKF,CAAY,EACtD,OACE,OAAOG,EAAiC,KAAKH,CAAY,EAC3D,OACE,OAAOI,EAA8B,KAAKJ,CAAY,EACxD,OACE,OAAOK,EAA6B,KAAKL,CAAY,EACvD,OACE,OAAOM,EAA2C,KAAKN,CAAY,EACrE,OACE,OAAOO,EAAgC,KAAKP,CAAY,EAC1D,QACE,MAAM,IAAI,MAAM,mDAAmDC,CAAK,EAAE,CAC9E,CACF,CASA,WAAiD,CAC/C,OAAO,gBAAgBC,CACzB,CASA,gBAA2D,CACzD,OAAO,gBAAgBC,CACzB,CASA,aAAqD,CACnD,OAAO,gBAAgBC,CACzB,CASA,YAAmD,CACjD,OAAO,gBAAgBC,CACzB,CACF,EAWaH,EAAN,MAAMM,UAAoCV,CAAqB,CAapE,YAAYW,EAA8BC,EAA6B,CACrE,MAAM,EACN,KAAK,WAAaD,EAClB,KAAK,UAAYC,CACnB,CAUA,UAAUC,EAA8B,CACtCA,EAAW,uBAAyD,EACpE,KAAK,WAAW,UAAUA,CAAU,EACpC,KAAK,UAAU,UAAUA,CAAU,CACrC,CAUA,OAAO,KAAKX,EAAyD,CACnE,IAAMS,EAAaG,EAAiB,YAAYZ,CAAY,EACtDU,EAAYG,EAAiB,YAAYb,CAAY,EAC3D,OAAO,IAAIQ,EAA4BC,EAAYC,CAAS,CAC9D,CACF,EAUaP,EAAN,MAAMW,UAAyChB,CAAqB,CAKzE,YAAYW,EAAmCC,EAAkC,CAC/E,MAAM,EACN,KAAK,WAAaD,EAClB,KAAK,UAAYC,CACnB,CAEA,UAAUC,EAA8B,CACtCA,EAAW,uBAA8D,EACzE,KAAK,WAAW,UAAUA,CAAU,EACpC,KAAK,UAAU,UAAUA,CAAU,CACrC,CAEA,OAAO,KAAKX,EAA8D,CACxE,IAAMS,EAAaM,EAAsB,YAAYf,CAAY,EAC3DU,EAAYM,EAAsB,YAAYhB,CAAY,EAChE,OAAO,IAAIc,EAAiCL,EAAYC,CAAS,CACnE,CACF,EAWaN,EAAN,MAAMa,UAAsCnB,CAAqB,CAKtE,YAAYW,EAA0BC,EAAyB,CAC7D,MAAM,EACN,KAAK,WAAaD,EAClB,KAAK,UAAYC,CACnB,CAEA,UAAUC,EAA8B,CACtCA,EAAW,uBAA2D,EACtE,KAAK,WAAW,UAAUA,CAAU,EACpC,KAAK,UAAU,UAAUA,CAAU,CACrC,CAEA,OAAO,KAAKX,EAA2D,CACrE,IAAMS,EAAaS,EAAa,YAAYlB,CAAY,EAClDU,EAAYS,EAAa,YAAYnB,CAAY,EACvD,OAAO,IAAIiB,EAA8BR,EAAYC,CAAS,CAChE,CACF,EAUaL,EAAN,MAAMe,UAAqCtB,CAAqB,CAKrE,YAAYuB,EAAuBC,EAA+B,CAChE,MAAM,EACN,KAAK,YAAcD,EACnB,KAAK,WAAaC,CACpB,CAEA,UAAUX,EAA8B,CACtCA,EAAW,uBAA0D,EACrE,KAAK,YAAY,UAAUA,CAAU,EACrC,KAAK,WAAW,UAAUA,CAAU,CACtC,CAEA,OAAO,KAAKX,EAA0D,CACpE,IAAMqB,EAAcE,EAAS,YAAYvB,CAAY,EAC/CsB,EAAaE,EAAkB,YAAYxB,CAAY,EAC7D,OAAO,IAAIoB,EAA6BC,EAAaC,CAAU,CACjE,CACF,EAOahB,EAAN,MAAMmB,UAAmD3B,CAAqB,CAEnF,UAAUa,EAA8B,CACtCA,EAAW,uBAAwE,CACrF,CAGA,OAAO,KAAKX,EAAwE,CAClF,OAAO,IAAIyB,CACb,CACF,EAEalB,EAAN,MAAMmB,UAAwC5B,CAAqB,CAOxE,YAAY6B,EAAsBC,EAAgCC,EAAyB,CAEzF,GADA,MAAM,EACF,CAACC,EAAoBH,CAAY,EACnC,MAAM,IAAI,MAAM,yBAAyBA,CAAY,8CAA8C,EAErG,KAAK,aAAeA,EACpB,KAAK,cAAgBI,EAAI,aAAaF,CAAa,EACnD,KAAK,qBAAuBE,EAAI,aAAaA,EAAI,aAAaH,CAAoB,EAAE,aAAa,CAAC,CACpG,CAEA,UAAUjB,EAA8B,CACtCA,EAAW,uBAA6D,EACxE,GAAM,CAAE,cAAAqB,EAAe,WAAAC,EAAY,aAAAC,CAAa,EAAIC,EAAiB,KAAK,YAA8B,EACxGC,EAAe,WAAWJ,CAAa,EAAE,UAAUrB,CAAU,EAC7DA,EAAW,aAAasB,CAAU,EAClCtB,EAAW,aAAauB,CAAY,EACpCvB,EAAW,uBAAmD,EAC9DA,EAAW,eAAe,KAAK,qBAAqB,aAAa,CAAC,EAClEA,EAAW,oBAAoB,KAAK,cAAc,aAAa,CAAC,CAClE,CAEA,OAAO,KAAKX,EAA6D,CACvE,IAAMgC,EAAgBI,EAAe,YAAYpC,CAAY,EACvDiC,EAAajC,EAAa,eAAe,EACzCkC,EAAelC,EAAa,eAAe,EAC3CqC,EAAUrC,EAAa,wBAAwB,EACrD,GAAIqC,IAAY,EAA+B,CAC7C,IAAMT,EAAuB5B,EAAa,iBAAiB,EACrD6B,EAAgB7B,EAAa,sBAAsBA,EAAa,UAAU,CAAC,EACjF,OAAO,IAAI0B,EACT,GAAGM,CAAa,KAAKC,CAAU,KAAKC,CAAY,GAChDN,EACAC,CACF,CACF,CACA,MAAM,IAAI,MAAM,8DAA8DQ,CAAO,EAAE,CACzF,CACF","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,2 +1,2 @@
|
|
|
1
|
-
import{a as i}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as i}from"./chunk-BPHCRTHD.mjs";import{a as g,b}from"./chunk-WFKPVKU3.mjs";import{b as y,d as p}from"./chunk-7OUPEQRN.mjs";import{b as c}from"./chunk-LQOSHBB7.mjs";import{a as h}from"./chunk-RXHER6EA.mjs";var n=class extends h{static deserialize(e){let t=e.deserializeUleb128AsU32();switch(t){case 0:return o.load(e);case 1:return d.load(e);case 2:return u.load(e);case 3:return l.load(e);case 4:return A.load(e);default:throw new Error(`Unknown variant index for TransactionAuthenticator: ${t}`)}}isEd25519(){return this instanceof o}isMultiEd25519(){return this instanceof d}isMultiAgent(){return this instanceof u}isFeePayer(){return this instanceof l}isSingleSender(){return this instanceof A}},o=class r extends n{constructor(e,t){super(),this.public_key=e,this.signature=t}serialize(e){e.serializeU32AsUleb128(0),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let t=y.deserialize(e),s=p.deserialize(e);return new r(t,s)}},d=class r extends n{constructor(e,t){super(),this.public_key=e,this.signature=t}serialize(e){e.serializeU32AsUleb128(1),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let t=g.deserialize(e),s=b.deserialize(e);return new r(t,s)}},u=class r extends n{constructor(e,t,s){super(),this.sender=e,this.secondary_signer_addresses=t,this.secondary_signers=s}serialize(e){e.serializeU32AsUleb128(2),this.sender.serialize(e),e.serializeVector(this.secondary_signer_addresses),e.serializeVector(this.secondary_signers)}static load(e){let t=i.deserialize(e),s=e.deserializeVector(c),a=e.deserializeVector(i);return new r(t,s,a)}},l=class r extends n{constructor(e,t,s,a){super(),this.sender=e,this.secondary_signer_addresses=t,this.secondary_signers=s,this.fee_payer=a}serialize(e){e.serializeU32AsUleb128(3),this.sender.serialize(e),e.serializeVector(this.secondary_signer_addresses),e.serializeVector(this.secondary_signers),this.fee_payer.address.serialize(e),this.fee_payer.authenticator.serialize(e)}static load(e){let t=i.deserialize(e),s=e.deserializeVector(c),a=e.deserializeVector(i),_=c.deserialize(e),z=i.deserialize(e),S={address:_,authenticator:z};return new r(t,s,a,S)}},A=class r extends n{constructor(e){super(),this.sender=e}serialize(e){e.serializeU32AsUleb128(4),this.sender.serialize(e)}static load(e){let t=i.deserialize(e);return new r(t)}};export{n as a,o as b,d as c,u as d,l as e,A as f};
|
|
2
|
+
//# sourceMappingURL=chunk-BQYKFATL.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/version.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * The current version of the SDK\n *\n * hardcoded for now, we would want to have it injected dynamically\n */\nexport const VERSION = \"1.
|
|
1
|
+
{"version":3,"sources":["../../src/version.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * The current version of the SDK\n *\n * hardcoded for now, we would want to have it injected dynamically\n */\nexport const VERSION = \"1.35.0\";\n"],"mappings":"AAQO,IAAMA,EAAU","names":["VERSION"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{b as o}from"./chunk-H4YAL2IL.mjs";import{a as s}from"./chunk-A3VO773Q.mjs";import{a as i}from"./chunk-TTY5GFMN.mjs";import{b as t}from"./chunk-VHY6ZATX.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-CGTMSLVZ.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{a as O,b as _}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as O,b as _}from"./chunk-P5CM4C2G.mjs";import{d as A}from"./chunk-BPHCRTHD.mjs";import{a as R}from"./chunk-5H5D6QVX.mjs";import{a as u,b as w}from"./chunk-2TRQERBL.mjs";import{a as I}from"./chunk-XW3BXTCZ.mjs";import{i as b,j as T,k as x,n as P,q as v,s as k}from"./chunk-HVIF6DW6.mjs";import{d as r}from"./chunk-TH5JCPN2.mjs";import{e as F}from"./chunk-BHVSIRNF.mjs";import{b as g}from"./chunk-LQOSHBB7.mjs";import{a as m}from"./chunk-RXHER6EA.mjs";import{b as y}from"./chunk-VHY6ZATX.mjs";import D from"eventemitter3";import{jwtDecode as W}from"jwt-decode";function ne(f){return f!=null&&typeof f.checkKeylessAccountValidity=="function"}var p=class p extends m{constructor(e){super();this.signingScheme=2;let{address:i,ephemeralKeyPair:t,publicKey:o,uidKey:l,uidVal:n,aud:c,pepper:s,proof:a,proofFetchCallback:h,jwt:d,verificationKeyHash:K}=e;if(this.ephemeralKeyPair=t,this.publicKey=o,this.accountAddress=i?g.from(i):this.publicKey.authKey().derivedAddress(),this.uidKey=l,this.uidVal=n,this.aud=c,this.jwt=d,this.emitter=new D,this.proofOrPromise=a,a instanceof P)this.proof=a;else{if(h===void 0)throw new Error("Must provide callback for async proof fetch");this.emitter.on("proofFetchFinish",async C=>{await h(C),this.emitter.removeAllListeners()}),this.init(a)}let S=y.fromHexInput(s).toUint8Array();if(S.length!==p.PEPPER_LENGTH)throw new Error(`Pepper length in bytes should be ${p.PEPPER_LENGTH}`);if(this.pepper=S,K!==void 0){if(y.hexInputToUint8Array(K).length!==32)throw new Error("verificationKeyHash must be 32 bytes");this.verificationKeyHash=y.hexInputToUint8Array(K)}}getAnyPublicKey(){return new u(this.publicKey)}async init(e){try{this.proof=await e,this.emitter.emit("proofFetchFinish",{status:"Success"})}catch(i){i instanceof Error?this.emitter.emit("proofFetchFinish",{status:"Failed",error:i.toString()}):this.emitter.emit("proofFetchFinish",{status:"Failed",error:"Unknown"})}}serialize(e){if(this.accountAddress.serialize(e),e.serializeStr(this.jwt),e.serializeStr(this.uidKey),e.serializeFixedBytes(this.pepper),this.ephemeralKeyPair.serialize(e),this.proof===void 0)throw new Error("Cannot serialize - proof undefined");this.proof.serialize(e),e.serializeOption(this.verificationKeyHash,32)}static partialDeserialize(e){let i=g.deserialize(e),t=e.deserializeStr(),o=e.deserializeStr(),l=e.deserializeFixedBytes(31),n=R.deserialize(e),c=P.deserialize(e),s=e.deserializeOption("fixedBytes",32);return{address:i,jwt:t,uidKey:o,pepper:l,ephemeralKeyPair:n,proof:c,verificationKeyHash:s}}isExpired(){return this.ephemeralKeyPair.isExpired()}signWithAuthenticator(e){let i=new w(this.sign(e)),t=new u(this.publicKey);return new A(t,i)}signTransactionWithAuthenticator(e){let i=new w(this.signTransaction(e)),t=new u(this.publicKey);return new A(t,i)}async waitForProofFetch(){this.proofOrPromise instanceof Promise&&await this.proofOrPromise}async checkKeylessAccountValidity(e){if(this.isExpired())throw r.fromErrorType({type:0});if(await this.waitForProofFetch(),this.proof===void 0)throw r.fromErrorType({type:2});let i=W(this.jwt,{header:!0});if(i.kid===void 0)throw r.fromErrorType({type:12,details:"checkKeylessAccountValidity failed. JWT is missing 'kid' in header. This should never happen."});if(this.verificationKeyHash!==void 0){let{verificationKey:t}=await v({aptosConfig:e});if(y.hexInputToString(t.hash())!==y.hexInputToString(this.verificationKeyHash))throw r.fromErrorType({type:4})}else console.warn("[Aptos SDK] The verification key hash was not set. Proof may be invalid if the verification key has rotated.");await p.fetchJWK({aptosConfig:e,publicKey:this.publicKey,kid:i.kid})}sign(e){let{expiryDateSecs:i}=this.ephemeralKeyPair;if(this.isExpired())throw r.fromErrorType({type:0});if(this.proof===void 0)throw r.fromErrorType({type:1,details:"Proof not found - make sure to call `await account.checkKeylessAccountValidity()` before signing."});let t=this.ephemeralKeyPair.getPublicKey(),o=this.ephemeralKeyPair.sign(e);return new T({jwtHeader:F(this.jwt.split(".")[0]),ephemeralCertificate:new x(this.proof,0),expiryDateSecs:i,ephemeralPublicKey:t,ephemeralSignature:o})}signTransaction(e){if(this.proof===void 0)throw r.fromErrorType({type:1,details:"Proof not found - make sure to call `await account.checkKeylessAccountValidity()` before signing."});let i=O(e),o=new E(i,this.proof.proof).hash();return this.sign(o)}verifySignature(e){let{message:i,signature:t}=e;return!(this.isExpired()||!this.ephemeralKeyPair.getPublicKey().verifySignature({message:i,signature:t.ephemeralSignature}))}static async fetchJWK(e){let{aptosConfig:i,publicKey:t,kid:o}=e,l=t instanceof b?t:t.keylessPublicKey,{iss:n}=l,c,s=t instanceof I?t.jwkAddress:void 0;try{c=await k({aptosConfig:i,jwkAddr:s})}catch(d){throw r.fromErrorType({type:24,error:d,details:`Failed to fetch ${s?"Federated":"Patched"}JWKs ${s?`for address ${s}`:"0x1"}`})}let a=c.get(n);if(a===void 0)throw r.fromErrorType({type:7,details:`JWKs for issuer ${n} not found.`});let h=a.find(d=>d.kid===o);if(h===void 0)throw r.fromErrorType({type:6,details:`JWK with kid '${o}' for issuer '${n}' not found.`});return h}};p.PEPPER_LENGTH=31;var H=p,E=class extends m{constructor(e,i){super();this.domainSeparator="APTOS::TransactionAndProof";this.transaction=e,this.proof=i}serialize(e){e.serializeFixedBytes(this.transaction.bcsToBytes()),e.serializeOption(this.proof)}hash(){return _(this.bcsToBytes(),this.domainSeparator)}};export{ne as a,H as b,E as c};
|
|
2
|
+
//# sourceMappingURL=chunk-CPAAEEF4.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as f}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as f}from"./chunk-CPAAEEF4.mjs";import{a as A}from"./chunk-XW3BXTCZ.mjs";import{r as y}from"./chunk-HVIF6DW6.mjs";import{a as m}from"./chunk-ZD2TY5N3.mjs";import{b as K}from"./chunk-LQOSHBB7.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-CPFQUFVD.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/api/experimental.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { LedgerVersionArg } from \"../types\";\nimport { AptosConfig } from \"./aptosConfig\";\nimport { InputViewFunctionData } from \"../transactions\";\nimport { viewBinary } from \"../internal/experimental\";\n\n/**\n * A class to have experimental functionality to the SDK. Anything used here is subject to change.\n * @group Experimental\n * @experimental\n */\nexport class Experimental {\n /**\n * Initializes a new instance of the Aptos client with the provided configuration.\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.faucetUrl - The URL of the faucet to use for funding accounts.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * async function runExample() {\n * // Create a new Aptos client with Testnet configuration\n * const config = new AptosConfig({ network: Network.TESTNET }); // Specify your own network if needed\n * const aptos = new Aptos(config);\n *\n * console.log(\"Aptos client initialized:\", aptos);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Experimental\n * @experimental\n */\n constructor(readonly config: AptosConfig) {}\n\n async viewBinary(args: {\n payload: InputViewFunctionData;\n options?: LedgerVersionArg & { convert?: undefined };\n }): Promise<Uint8Array>;\n async viewBinary<T extends {}>(args: {\n payload: InputViewFunctionData;\n options: LedgerVersionArg & { convert: (input: Uint8Array) => T };\n }): Promise<T>;\n\n /**\n * Returns BCS encoded results of the view function. It can also convert the results to a specific type, if a\n * converter is provided.\n *\n * @experimental\n * @group Experimental\n * @param args\n */\n async viewBinary<T extends {} = Uint8Array>(args: {\n payload: InputViewFunctionData;\n options?: LedgerVersionArg & { convert?: (input: Uint8Array) => T };\n }): Promise<Uint8Array | T> {\n return viewBinary<T>({ ...args, aptosConfig: this.config });\n }\n}\n"],"mappings":"yCAaO,IAAMA,EAAN,KAAmB,CAyBxB,YAAqBC,EAAqB,CAArB,YAAAA,CAAsB,CAmB3C,MAAM,WAAsCC,EAGhB,CAC1B,OAAOC,EAAc,CAAE,GAAGD,EAAM,YAAa,KAAK,MAAO,CAAC,CAC5D,CACF","names":["Experimental","config","args","viewBinary"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as o}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as o}from"./chunk-7A2KHJ3D.mjs";var t=class{constructor(n){this.config=n}async transferCoinTransaction(n){return o({aptosConfig:this.config,...n})}};export{t as a};
|
|
2
|
+
//# sourceMappingURL=chunk-DAJFOJ3L.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as u}from"./chunk-OEQ2U7GK.mjs";import{f as M}from"./chunk-MLSAZJZK.mjs";import{c as R}from"./chunk-AZWVCBK2.mjs";import{c as k}from"./chunk-VV4HCOJQ.mjs";import{A as V,m as O,y as q,z as G}from"./chunk-VHNX2NUR.mjs";import{b as w,f as h,i as x,l as A,m as f,n as i,q as p,s as y}from"./chunk-G4O6FXCF.mjs";import{b as c}from"./chunk-Q4C4U6I4.mjs";import{a as _,c as d}from"./chunk-IDTLNF4M.mjs";import{a as T,e as D}from"./chunk-ORMOQWWH.mjs";import{d as E}from"./chunk-56CNRT2K.mjs";var C={BOOLEAN:"bool",U8:"u8",U16:"u16",U32:"u32",U64:"u64",U128:"u128",U256:"u256",ADDRESS:"address",STRING:"0x1::string::String",ARRAY:"vector<u8>"},l="0x4::token::Token";async function It(t){let{aptosConfig:o,digitalAssetAddress:n}=t,e={token_data_id:{_eq:c.from(n).toStringLong()}};return(await k({aptosConfig:o,query:{query:V,variables:{where_condition:e}},originMethod:"getDigitalAssetData"})).current_token_datas_v2[0]}async function Pt(t){let{aptosConfig:o,digitalAssetAddress:n}=t,e={token_data_id:{_eq:c.from(n).toStringLong()},amount:{_gt:0}};return(await k({aptosConfig:o,query:{query:G,variables:{where_condition:e}},originMethod:"getCurrentDigitalAssetOwnership"})).current_token_ownerships_v2[0]}async function bt(t){let{aptosConfig:o,ownerAddress:n,options:e}=t,r={owner_address:{_eq:c.from(n).toStringLong()},amount:{_gt:0}},s={query:G,variables:{where_condition:r,offset:e?.offset,limit:e?.limit,order_by:e?.orderBy}};return(await k({aptosConfig:o,query:s,originMethod:"getOwnedDigitalAssets"})).current_token_ownerships_v2}async function St(t){let{aptosConfig:o,digitalAssetAddress:n,options:e}=t,r={token_data_id:{_eq:c.from(n).toStringLong()}},s={query:q,variables:{where_condition:r,offset:e?.offset,limit:e?.limit,order_by:e?.orderBy}};return(await k({aptosConfig:o,query:s,originMethod:"getDigitalAssetActivity"})).token_activities_v2}var F={typeParameters:[],parameters:[new i(p()),new h,new i(p()),new i(p()),new w,new w,new w,new w,new w,new w,new w,new w,new w,new h,new h]};async function Dt(t){let{aptosConfig:o,options:n,creator:e}=t;return u({aptosConfig:o,sender:e.accountAddress,data:{function:"0x4::aptos_token::create_collection",functionArguments:[new d(t.description),new D(t.maxSupply??E),new d(t.name),new d(t.uri),new T(t.mutableDescription??!0),new T(t.mutableRoyalty??!0),new T(t.mutableURI??!0),new T(t.mutableTokenDescription??!0),new T(t.mutableTokenName??!0),new T(t.mutableTokenProperties??!0),new T(t.mutableTokenURI??!0),new T(t.tokensBurnableByCreator??!0),new T(t.tokensFreezableByCreator??!0),new D(t.royaltyNumerator??0),new D(t.royaltyDenominator??1)],abi:F},options:n})}async function v(t){let{aptosConfig:o,options:n}=t,e=n?.where;n?.tokenStandard&&(e.token_standard={_eq:n?.tokenStandard??"v2"});let r={query:O,variables:{where_condition:e,offset:n?.offset,limit:n?.limit}};return(await k({aptosConfig:o,query:r,originMethod:"getCollectionData"})).current_collections_v2[0]}async function ht(t){let{aptosConfig:o,creatorAddress:n,collectionName:e,options:r}=t,s=c.from(n),a={collection_name:{_eq:e},creator_address:{_eq:s.toStringLong()}};return r?.tokenStandard&&(a.token_standard={_eq:r?.tokenStandard??"v2"}),v({aptosConfig:o,options:{...r,where:a}})}async function vt(t){let{aptosConfig:o,creatorAddress:n,options:e}=t,s={creator_address:{_eq:c.from(n).toStringLong()}};return e?.tokenStandard&&(s.token_standard={_eq:e?.tokenStandard??"v2"}),v({aptosConfig:o,options:{...e,where:s}})}async function xt(t){let{aptosConfig:o,collectionId:n,options:e}=t,s={collection_id:{_eq:c.from(n).toStringLong()}};return e?.tokenStandard&&(s.token_standard={_eq:e?.tokenStandard??"v2"}),v({aptosConfig:o,options:{...e,where:s}})}async function Gt(t){let{creatorAddress:o,collectionName:n,options:e,aptosConfig:r}=t,s=c.from(o),a={collection_name:{_eq:n},creator_address:{_eq:s.toStringLong()}};return e?.tokenStandard&&(a.token_standard={_eq:e?.tokenStandard??"v2"}),(await v({aptosConfig:r,options:{where:a}})).collection_id}var N={typeParameters:[],parameters:[new i(p()),new i(p()),new i(p()),new i(p()),new f(new i(p())),new f(new i(p())),new f(f.u8())]};async function Bt(t){let{aptosConfig:o,options:n,creator:e,collection:r,description:s,name:a,uri:m,propertyKeys:g,propertyTypes:P,propertyValues:I}=t,b=P?.map(S=>C[S]);return u({aptosConfig:o,sender:e.accountAddress,data:{function:"0x4::aptos_token::mint",functionArguments:[new d(r),new d(s),new d(a),new d(m),_.MoveString(g??[]),_.MoveString(b??[]),K(I??[],b??[])],abi:N},options:n})}var Q={typeParameters:[{constraints:["key"]}],parameters:[new i(y(new A(0))),new x]};async function Et(t){let{aptosConfig:o,sender:n,digitalAssetAddress:e,recipient:r,digitalAssetType:s,options:a}=t;return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x1::object::transfer",typeArguments:[s??l],functionArguments:[c.from(e),c.from(r)],abi:Q},options:a})}var Y={typeParameters:[],parameters:[new i(p()),new i(p()),new i(p()),new i(p()),new f(new i(p())),new f(new i(p())),new f(f.u8()),new x]};async function Ot(t){let{aptosConfig:o,account:n,collection:e,description:r,name:s,uri:a,recipient:m,propertyKeys:g,propertyTypes:P,propertyValues:I,options:b}=t;if(g?.length!==I?.length)throw new Error("Property keys and property values counts do not match");if(P?.length!==I?.length)throw new Error("Property types and property values counts do not match");let S=P?.map(U=>C[U]);return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::mint_soul_bound",functionArguments:[e,r,s,a,_.MoveString(g??[]),_.MoveString(S??[]),K(I??[],S??[]),m],abi:Y},options:b})}var L={typeParameters:[{constraints:["key"]}],parameters:[new i(y(new A(0)))]};async function qt(t){let{aptosConfig:o,creator:n,digitalAssetAddress:e,digitalAssetType:r,options:s}=t;return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::burn",typeArguments:[r??l],functionArguments:[c.from(e)],abi:L},options:s})}var z={typeParameters:[{constraints:["key"]}],parameters:[new i(y(new A(0)))]};async function Vt(t){let{aptosConfig:o,creator:n,digitalAssetAddress:e,digitalAssetType:r,options:s}=t;return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::freeze_transfer",typeArguments:[r??l],functionArguments:[e],abi:z},options:s})}var j={typeParameters:[{constraints:["key"]}],parameters:[new i(y(new A(0)))]};async function Rt(t){let{aptosConfig:o,creator:n,digitalAssetAddress:e,digitalAssetType:r,options:s}=t;return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::unfreeze_transfer",typeArguments:[r??l],functionArguments:[e],abi:j},options:s})}var W={typeParameters:[{constraints:["key"]}],parameters:[new i(y(new A(0))),new i(p())]};async function Mt(t){let{aptosConfig:o,creator:n,description:e,digitalAssetAddress:r,digitalAssetType:s,options:a}=t;return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::set_description",typeArguments:[s??l],functionArguments:[c.from(r),new d(e)],abi:W},options:a})}var X={typeParameters:[{constraints:["key"]}],parameters:[new i(y(new A(0))),new i(p())]};async function Kt(t){let{aptosConfig:o,creator:n,name:e,digitalAssetAddress:r,digitalAssetType:s,options:a}=t;return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::set_name",typeArguments:[s??l],functionArguments:[c.from(r),new d(e)],abi:X},options:a})}var H={typeParameters:[{constraints:["key"]}],parameters:[new i(y(new A(0))),new i(p())]};async function Ut(t){let{aptosConfig:o,creator:n,uri:e,digitalAssetAddress:r,digitalAssetType:s,options:a}=t;return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::set_uri",typeArguments:[s??l],functionArguments:[c.from(r),new d(e)],abi:H},options:a})}var J={typeParameters:[{constraints:["key"]}],parameters:[new i(y(new A(0))),new i(p()),new i(p()),f.u8()]};async function Ft(t){let{aptosConfig:o,creator:n,propertyKey:e,propertyType:r,propertyValue:s,digitalAssetAddress:a,digitalAssetType:m,options:g}=t;return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::add_property",typeArguments:[m??l],functionArguments:[c.from(a),new d(e),new d(C[r]),_.U8(B(s,C[r]))],abi:J},options:g})}var Z={typeParameters:[{constraints:["key"]}],parameters:[new i(y(new A(0))),new i(p())]};async function Nt(t){let{aptosConfig:o,creator:n,propertyKey:e,digitalAssetAddress:r,digitalAssetType:s,options:a}=t;return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::remove_property",typeArguments:[s??l],functionArguments:[c.from(r),new d(e)],abi:Z},options:a})}var $={typeParameters:[{constraints:["key"]}],parameters:[new i(y(new A(0))),new i(p()),new i(p()),f.u8()]};async function Qt(t){let{aptosConfig:o,creator:n,propertyKey:e,propertyType:r,propertyValue:s,digitalAssetAddress:a,digitalAssetType:m,options:g}=t;return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::update_property",typeArguments:[m??l],functionArguments:[c.from(a),new d(e),new d(C[r]),B(s,C[r])],abi:$},options:g})}var tt={typeParameters:[{constraints:["key"]},{constraints:[]}],parameters:[new i(y(new A(0))),new i(p()),new A(1)]};async function Yt(t){let{aptosConfig:o,creator:n,propertyKey:e,propertyType:r,propertyValue:s,digitalAssetAddress:a,digitalAssetType:m,options:g}=t;return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::add_typed_property",typeArguments:[m??l,C[r]],functionArguments:[c.from(a),new d(e),s],abi:tt},options:g})}var et={typeParameters:[{constraints:["key"]},{constraints:[]}],parameters:[new i(y(new A(0))),new i(p()),new A(1)]};async function Lt(t){let{aptosConfig:o,creator:n,propertyKey:e,propertyType:r,propertyValue:s,digitalAssetAddress:a,digitalAssetType:m,options:g}=t;return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::update_typed_property",typeArguments:[m??l,C[r]],functionArguments:[c.from(a),new d(e),s],abi:et},options:g})}function K(t,o){let n=new Array;return o.forEach((e,r)=>{n.push(B(t[r],e))}),n}function B(t,o){let n=R(o);return M(t,n,0,[]).bcsToBytes()}export{It as a,Pt as b,bt as c,St as d,Dt as e,v as f,ht as g,vt as h,xt as i,Gt as j,Bt as k,Et as l,Ot as m,qt as n,Vt as o,Rt as p,Mt as q,Kt as r,Ut as s,Ft as t,Nt as u,Qt as v,Yt as w,Lt as x};
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as u}from"./chunk-53IBOHXB.mjs";import{h as M}from"./chunk-XRVZAEQO.mjs";import{c as R}from"./chunk-GI4AR6DQ.mjs";import{c as k}from"./chunk-KK5HUWF6.mjs";import{A as V,m as O,y as q,z as G}from"./chunk-VHNX2NUR.mjs";import{b as w,f as h,i as x,l as A,m as f,n as i,q as p,s as y}from"./chunk-5W2ERBGY.mjs";import{a as _,c as d}from"./chunk-HHWJHOFZ.mjs";import{a as T,e as D}from"./chunk-TKXEVD7A.mjs";import{b as c}from"./chunk-LQOSHBB7.mjs";import{d as E}from"./chunk-56CNRT2K.mjs";var C={BOOLEAN:"bool",U8:"u8",U16:"u16",U32:"u32",U64:"u64",U128:"u128",U256:"u256",ADDRESS:"address",STRING:"0x1::string::String",ARRAY:"vector<u8>"},l="0x4::token::Token";async function It(t){let{aptosConfig:o,digitalAssetAddress:n}=t,e={token_data_id:{_eq:c.from(n).toStringLong()}};return(await k({aptosConfig:o,query:{query:V,variables:{where_condition:e}},originMethod:"getDigitalAssetData"})).current_token_datas_v2[0]}async function Pt(t){let{aptosConfig:o,digitalAssetAddress:n}=t,e={token_data_id:{_eq:c.from(n).toStringLong()},amount:{_gt:0}};return(await k({aptosConfig:o,query:{query:G,variables:{where_condition:e}},originMethod:"getCurrentDigitalAssetOwnership"})).current_token_ownerships_v2[0]}async function bt(t){let{aptosConfig:o,ownerAddress:n,options:e}=t,r={owner_address:{_eq:c.from(n).toStringLong()},amount:{_gt:0}},s={query:G,variables:{where_condition:r,offset:e?.offset,limit:e?.limit,order_by:e?.orderBy}};return(await k({aptosConfig:o,query:s,originMethod:"getOwnedDigitalAssets"})).current_token_ownerships_v2}async function St(t){let{aptosConfig:o,digitalAssetAddress:n,options:e}=t,r={token_data_id:{_eq:c.from(n).toStringLong()}},s={query:q,variables:{where_condition:r,offset:e?.offset,limit:e?.limit,order_by:e?.orderBy}};return(await k({aptosConfig:o,query:s,originMethod:"getDigitalAssetActivity"})).token_activities_v2}var F={typeParameters:[],parameters:[new i(p()),new h,new i(p()),new i(p()),new w,new w,new w,new w,new w,new w,new w,new w,new w,new h,new h]};async function Dt(t){let{aptosConfig:o,options:n,creator:e}=t;return u({aptosConfig:o,sender:e.accountAddress,data:{function:"0x4::aptos_token::create_collection",functionArguments:[new d(t.description),new D(t.maxSupply??E),new d(t.name),new d(t.uri),new T(t.mutableDescription??!0),new T(t.mutableRoyalty??!0),new T(t.mutableURI??!0),new T(t.mutableTokenDescription??!0),new T(t.mutableTokenName??!0),new T(t.mutableTokenProperties??!0),new T(t.mutableTokenURI??!0),new T(t.tokensBurnableByCreator??!0),new T(t.tokensFreezableByCreator??!0),new D(t.royaltyNumerator??0),new D(t.royaltyDenominator??1)],abi:F},options:n})}async function v(t){let{aptosConfig:o,options:n}=t,e=n?.where;n?.tokenStandard&&(e.token_standard={_eq:n?.tokenStandard??"v2"});let r={query:O,variables:{where_condition:e,offset:n?.offset,limit:n?.limit}};return(await k({aptosConfig:o,query:r,originMethod:"getCollectionData"})).current_collections_v2[0]}async function ht(t){let{aptosConfig:o,creatorAddress:n,collectionName:e,options:r}=t,s=c.from(n),a={collection_name:{_eq:e},creator_address:{_eq:s.toStringLong()}};return r?.tokenStandard&&(a.token_standard={_eq:r?.tokenStandard??"v2"}),v({aptosConfig:o,options:{...r,where:a}})}async function vt(t){let{aptosConfig:o,creatorAddress:n,options:e}=t,s={creator_address:{_eq:c.from(n).toStringLong()}};return e?.tokenStandard&&(s.token_standard={_eq:e?.tokenStandard??"v2"}),v({aptosConfig:o,options:{...e,where:s}})}async function xt(t){let{aptosConfig:o,collectionId:n,options:e}=t,s={collection_id:{_eq:c.from(n).toStringLong()}};return e?.tokenStandard&&(s.token_standard={_eq:e?.tokenStandard??"v2"}),v({aptosConfig:o,options:{...e,where:s}})}async function Gt(t){let{creatorAddress:o,collectionName:n,options:e,aptosConfig:r}=t,s=c.from(o),a={collection_name:{_eq:n},creator_address:{_eq:s.toStringLong()}};return e?.tokenStandard&&(a.token_standard={_eq:e?.tokenStandard??"v2"}),(await v({aptosConfig:r,options:{where:a}})).collection_id}var N={typeParameters:[],parameters:[new i(p()),new i(p()),new i(p()),new i(p()),new f(new i(p())),new f(new i(p())),new f(f.u8())]};async function Bt(t){let{aptosConfig:o,options:n,creator:e,collection:r,description:s,name:a,uri:m,propertyKeys:g,propertyTypes:P,propertyValues:I}=t,b=P?.map(S=>C[S]);return u({aptosConfig:o,sender:e.accountAddress,data:{function:"0x4::aptos_token::mint",functionArguments:[new d(r),new d(s),new d(a),new d(m),_.MoveString(g??[]),_.MoveString(b??[]),K(I??[],b??[])],abi:N},options:n})}var Q={typeParameters:[{constraints:["key"]}],parameters:[new i(y(new A(0))),new x]};async function Et(t){let{aptosConfig:o,sender:n,digitalAssetAddress:e,recipient:r,digitalAssetType:s,options:a}=t;return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x1::object::transfer",typeArguments:[s??l],functionArguments:[c.from(e),c.from(r)],abi:Q},options:a})}var Y={typeParameters:[],parameters:[new i(p()),new i(p()),new i(p()),new i(p()),new f(new i(p())),new f(new i(p())),new f(f.u8()),new x]};async function Ot(t){let{aptosConfig:o,account:n,collection:e,description:r,name:s,uri:a,recipient:m,propertyKeys:g,propertyTypes:P,propertyValues:I,options:b}=t;if(g?.length!==I?.length)throw new Error("Property keys and property values counts do not match");if(P?.length!==I?.length)throw new Error("Property types and property values counts do not match");let S=P?.map(U=>C[U]);return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::mint_soul_bound",functionArguments:[e,r,s,a,_.MoveString(g??[]),_.MoveString(S??[]),K(I??[],S??[]),m],abi:Y},options:b})}var L={typeParameters:[{constraints:["key"]}],parameters:[new i(y(new A(0)))]};async function qt(t){let{aptosConfig:o,creator:n,digitalAssetAddress:e,digitalAssetType:r,options:s}=t;return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::burn",typeArguments:[r??l],functionArguments:[c.from(e)],abi:L},options:s})}var z={typeParameters:[{constraints:["key"]}],parameters:[new i(y(new A(0)))]};async function Vt(t){let{aptosConfig:o,creator:n,digitalAssetAddress:e,digitalAssetType:r,options:s}=t;return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::freeze_transfer",typeArguments:[r??l],functionArguments:[e],abi:z},options:s})}var j={typeParameters:[{constraints:["key"]}],parameters:[new i(y(new A(0)))]};async function Rt(t){let{aptosConfig:o,creator:n,digitalAssetAddress:e,digitalAssetType:r,options:s}=t;return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::unfreeze_transfer",typeArguments:[r??l],functionArguments:[e],abi:j},options:s})}var W={typeParameters:[{constraints:["key"]}],parameters:[new i(y(new A(0))),new i(p())]};async function Mt(t){let{aptosConfig:o,creator:n,description:e,digitalAssetAddress:r,digitalAssetType:s,options:a}=t;return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::set_description",typeArguments:[s??l],functionArguments:[c.from(r),new d(e)],abi:W},options:a})}var X={typeParameters:[{constraints:["key"]}],parameters:[new i(y(new A(0))),new i(p())]};async function Kt(t){let{aptosConfig:o,creator:n,name:e,digitalAssetAddress:r,digitalAssetType:s,options:a}=t;return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::set_name",typeArguments:[s??l],functionArguments:[c.from(r),new d(e)],abi:X},options:a})}var H={typeParameters:[{constraints:["key"]}],parameters:[new i(y(new A(0))),new i(p())]};async function Ut(t){let{aptosConfig:o,creator:n,uri:e,digitalAssetAddress:r,digitalAssetType:s,options:a}=t;return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::set_uri",typeArguments:[s??l],functionArguments:[c.from(r),new d(e)],abi:H},options:a})}var J={typeParameters:[{constraints:["key"]}],parameters:[new i(y(new A(0))),new i(p()),new i(p()),f.u8()]};async function Ft(t){let{aptosConfig:o,creator:n,propertyKey:e,propertyType:r,propertyValue:s,digitalAssetAddress:a,digitalAssetType:m,options:g}=t;return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::add_property",typeArguments:[m??l],functionArguments:[c.from(a),new d(e),new d(C[r]),_.U8(B(s,C[r]))],abi:J},options:g})}var Z={typeParameters:[{constraints:["key"]}],parameters:[new i(y(new A(0))),new i(p())]};async function Nt(t){let{aptosConfig:o,creator:n,propertyKey:e,digitalAssetAddress:r,digitalAssetType:s,options:a}=t;return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::remove_property",typeArguments:[s??l],functionArguments:[c.from(r),new d(e)],abi:Z},options:a})}var $={typeParameters:[{constraints:["key"]}],parameters:[new i(y(new A(0))),new i(p()),new i(p()),f.u8()]};async function Qt(t){let{aptosConfig:o,creator:n,propertyKey:e,propertyType:r,propertyValue:s,digitalAssetAddress:a,digitalAssetType:m,options:g}=t;return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::update_property",typeArguments:[m??l],functionArguments:[c.from(a),new d(e),new d(C[r]),B(s,C[r])],abi:$},options:g})}var tt={typeParameters:[{constraints:["key"]},{constraints:[]}],parameters:[new i(y(new A(0))),new i(p()),new A(1)]};async function Yt(t){let{aptosConfig:o,creator:n,propertyKey:e,propertyType:r,propertyValue:s,digitalAssetAddress:a,digitalAssetType:m,options:g}=t;return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::add_typed_property",typeArguments:[m??l,C[r]],functionArguments:[c.from(a),new d(e),s],abi:tt},options:g})}var et={typeParameters:[{constraints:["key"]},{constraints:[]}],parameters:[new i(y(new A(0))),new i(p()),new A(1)]};async function Lt(t){let{aptosConfig:o,creator:n,propertyKey:e,propertyType:r,propertyValue:s,digitalAssetAddress:a,digitalAssetType:m,options:g}=t;return u({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::update_typed_property",typeArguments:[m??l,C[r]],functionArguments:[c.from(a),new d(e),s],abi:et},options:g})}function K(t,o){let n=new Array;return o.forEach((e,r)=>{n.push(B(t[r],e))}),n}function B(t,o){let n=R(o);return M(t,n,0,[]).bcsToBytes()}export{It as a,Pt as b,bt as c,St as d,Dt as e,v as f,ht as g,vt as h,xt as i,Gt as j,Bt as k,Et as l,Ot as m,qt as n,Vt as o,Rt as p,Mt as q,Kt as r,Ut as s,Ft as t,Nt as u,Qt as v,Yt as w,Lt as x};
|
|
2
|
+
//# sourceMappingURL=chunk-E5PAUR4N.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as o,b as r,c as t,d as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as o,b as r,c as t,d as s}from"./chunk-HBTJN4RJ.mjs";import{a as n}from"./chunk-MFLHAVIW.mjs";var i=class{constructor(e){this.config=e}async getModuleEventsByEventType(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"events_processor"}),o({aptosConfig:this.config,...e})}async getAccountEventsByCreationNumber(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"events_processor"}),r({aptosConfig:this.config,...e})}async getAccountEventsByEventType(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"events_processor"}),t({aptosConfig:this.config,...e})}async getEvents(e){return await n({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"events_processor"}),s({aptosConfig:this.config,...e})}};export{i as a};
|
|
2
|
+
//# sourceMappingURL=chunk-EGCL6KA6.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as i}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as i}from"./chunk-RIINVEZA.mjs";import{a as r}from"./chunk-RXHER6EA.mjs";var t=class l extends r{constructor(e){super(),this.value=new i(e)}serialize(e){e.serialize(this.value)}serializeForEntryFunction(e){e.serializeU32AsUleb128(this.value.value.length),e.serialize(this)}static deserialize(e,s){let a=i.deserialize(e,s);return new l(a.value)}};export{t as a};
|
|
2
|
+
//# sourceMappingURL=chunk-ERLDXTIY.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as u,c as d,f as p}from"./chunk-XRVZAEQO.mjs";import{j as l}from"./chunk-BHVSIRNF.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-FJ5J7CVW.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{c as n}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{c as n}from"./chunk-KK5HUWF6.mjs";import{o as g,t as d}from"./chunk-VHNX2NUR.mjs";import{b as s}from"./chunk-LQOSHBB7.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-FOEPRHAC.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as _}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as _}from"./chunk-53IBOHXB.mjs";import{g}from"./chunk-W2C5KRUQ.mjs";import{a as C}from"./chunk-CPFQUFVD.mjs";import{a as l}from"./chunk-YLUULY6G.mjs";import{a as v}from"./chunk-XW3BXTCZ.mjs";import{i as k,l as E,m as S,n as b,q as y}from"./chunk-HVIF6DW6.mjs";import{b as h}from"./chunk-PWGTRRSJ.mjs";import{g as A,h as x}from"./chunk-752TOOCA.mjs";import{d as K}from"./chunk-TH5JCPN2.mjs";import{j as w}from"./chunk-RJ7F4JDV.mjs";import{a as u}from"./chunk-HHWJHOFZ.mjs";import{b as f}from"./chunk-VHY6ZATX.mjs";import{jwtDecode as T}from"jwt-decode";async function j(r){let{aptosConfig:i,jwt:a,ephemeralKeyPair:e,uidKey:p="sub",derivationPath:s}=r,t={jwt_b64:a,epk:e.getPublicKey().bcsToHex().toStringWithoutPrefix(),exp_date_secs:e.expiryDateSecs,epk_blinder:f.fromHexInput(e.blinder).toStringWithoutPrefix(),uid_key:p,derivation_path:s},{data:n}=await A({aptosConfig:i,path:"fetch",body:t,originMethod:"getPepper",overrides:{WITH_CREDENTIALS:!1}});return f.fromHexInput(n.pepper).toUint8Array()}async function F(r){let{aptosConfig:i,jwt:a,ephemeralKeyPair:e,pepper:p=await j(r),uidKey:s="sub",maxExpHorizonSecs:t=(await y({aptosConfig:i})).maxExpHorizonSecs}=r;if(f.fromHexInput(p).toUint8Array().length!==l.PEPPER_LENGTH)throw new Error(`Pepper needs to be ${l.PEPPER_LENGTH} bytes`);let n=T(a);if(typeof n.iat!="number")throw new Error("iat was not found");if(t<e.expiryDateSecs-n.iat)throw Error(`The EphemeralKeyPair is too long lived. It's lifespan must be less than ${t}`);let o={jwt_b64:a,epk:e.getPublicKey().bcsToHex().toStringWithoutPrefix(),epk_blinder:f.fromHexInput(e.blinder).toStringWithoutPrefix(),exp_date_secs:e.expiryDateSecs,exp_horizon_secs:t,pepper:f.fromHexInput(p).toStringWithoutPrefix(),uid_key:s},{data:c}=await x({aptosConfig:i,path:"prove",body:o,originMethod:"getProof",overrides:{WITH_CREDENTIALS:!1}}),d=c.proof,m=new E({a:d.a,b:d.b,c:d.c});return new b({proof:new S(m,0),trainingWheelsSignature:h.fromHex(c.training_wheels_signature),expHorizonSecs:t})}async function oe(r){let{aptosConfig:i,jwt:a,jwkAddress:e,uidKey:p,proofFetchCallback:s,pepper:t=await j(r)}=r,{verificationKey:n,maxExpHorizonSecs:o}=await y({aptosConfig:i}),c=F({...r,pepper:t,maxExpHorizonSecs:o}),d=s?c:await c;if(e!==void 0){let H=v.fromJwtAndPepper({jwt:a,pepper:t,jwkAddress:e,uidKey:p}),I=await g({aptosConfig:i,authenticationKey:H.authKey().derivedAddress()});return C.create({...r,address:I,proof:d,pepper:t,proofFetchCallback:s,jwkAddress:e,verificationKey:n})}let m=k.fromJwtAndPepper({jwt:a,pepper:t,uidKey:p}),P=await g({aptosConfig:i,authenticationKey:m.authKey().derivedAddress()});return l.create({...r,address:P,proof:d,pepper:t,proofFetchCallback:s,verificationKey:n})}async function re(r){let{aptosConfig:i,sender:a,iss:e,options:p}=r,{jwksUrl:s}=r;s===void 0&&(w.test(e)?s="https://www.googleapis.com/service_accounts/v1/jwk/securetoken@system.gserviceaccount.com":s=e.endsWith("/")?`${e}.well-known/jwks.json`:`${e}/.well-known/jwks.json`);let t;try{if(t=await fetch(s),!t.ok)throw new Error(`${t.status} ${t.statusText}`)}catch(o){let c;throw o instanceof Error?c=`${o.message}`:c=`error unknown - ${o}`,K.fromErrorType({type:14,details:`Failed to fetch JWKS at ${s}: ${c}`})}let n=await t.json();return _({aptosConfig:i,sender:a.accountAddress,data:{function:"0x1::jwks::update_federated_jwk_set",functionArguments:[e,u.MoveString(n.keys.map(o=>o.kid)),u.MoveString(n.keys.map(o=>o.alg)),u.MoveString(n.keys.map(o=>o.e)),u.MoveString(n.keys.map(o=>o.n))]},options:p})}export{j as a,F as b,oe as c,re as d};
|
|
2
|
+
//# sourceMappingURL=chunk-G5F5ZOH5.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=chunk-GFPEB22G.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as y,c as f,d as x,e as v,f as A,g as C,h as U,i as b,j as I,k as M,l as P,m as E,n as G,o as N}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as y,c as f,d as x,e as v,f as A,g as C,h as U,i as b,j as I,k as M,l as P,m as E,n as G,o as N}from"./chunk-5W2ERBGY.mjs";import{a as l}from"./chunk-PDAWVDI7.mjs";import{b as w}from"./chunk-LQOSHBB7.mjs";function V(e){return!!e.match(/^[_a-zA-Z0-9]+$/)}function W(e){return!!e.match(/\s/)}function $(e){return!!e.match(/^T[0-9]+$/)}function F(e){return!!e.match(/^&.+$/)}function k(e){switch(e){case"signer":case"address":case"bool":case"u8":case"u16":case"u32":case"u64":case"u128":case"u256":return!0;default:return!1}}function L(e,i){let c=i;for(;c<e.length;c+=1){let s=e[c];if(!W(s))break}return c}var R=(a=>(a.InvalidTypeTag="unknown type",a.UnexpectedGenericType="unexpected generic type",a.UnexpectedTypeArgumentClose="unexpected '>'",a.UnexpectedWhitespaceCharacter="unexpected whitespace character",a.UnexpectedComma="unexpected ','",a.TypeArgumentCountMismatch="type argument count doesn't match expected amount",a.MissingTypeArgumentClose="no matching '>' for '<'",a.MissingTypeArgument="no type argument before ','",a.UnexpectedPrimitiveTypeArguments="primitive types not expected to have type arguments",a.UnexpectedVectorTypeArgumentCount="vector type expected to have exactly one type argument",a.UnexpectedStructFormat="unexpected struct format, must be of the form 0xaddress::module_name::struct_name",a.InvalidModuleNameCharacter="module name must only contain alphanumeric or '_' characters",a.InvalidStructNameCharacter="struct name must only contain alphanumeric or '_' characters",a.InvalidAddress="struct address must be valid",a))(R||{}),t=class extends Error{constructor(i,c){super(`Failed to parse typeTag '${i}', ${c}`)}};function j(e,i){let c=i?.allowGenerics??!1,s=[],u=[],n=[],o=0,r="",T=1;for(;o<e.length;){let d=e[o];if(d==="<")s.push({savedExpectedTypes:T,savedStr:r,savedTypes:n}),r="",n=[],T=1;else if(d===">"){if(r!==""){let a=g(r,u,c);n.push(a)}let p=s.pop();if(p===void 0)throw new t(e,"unexpected '>'");if(T!==n.length)throw new t(e,"type argument count doesn't match expected amount");let{savedStr:m,savedTypes:h,savedExpectedTypes:_}=p;u=n,n=h,r=m,T=_}else if(d===","){if(s.length===0)throw new t(e,"unexpected ','");if(r.length===0)throw new t(e,"no type argument before ','");let p=g(r,u,c);u=[],n.push(p),r="",T+=1}else if(W(d)){let p=!1;if(r.length!==0){let h=g(r,u,c);u=[],n.push(h),r="",p=!0}o=L(e,o);let m=e[o];if(o<e.length&&p&&m!==","&&m!==">")throw new t(e,"unexpected whitespace character");continue}else r+=d;o+=1}if(s.length>0)throw new t(e,"no matching '>' for '<'");switch(n.length){case 0:return g(r,u,c);case 1:if(r==="")return n[0];throw new t(e,"unexpected ','");default:throw new t(e,"unexpected whitespace character")}}function g(e,i,c){let s=e.trim(),u=s.toLowerCase();if(k(u)&&i.length>0)throw new t(e,"primitive types not expected to have type arguments");switch(s.toLowerCase()){case"signer":return new I;case"bool":return new y;case"address":return new b;case"u8":return new f;case"u16":return new x;case"u32":return new v;case"u64":return new A;case"u128":return new C;case"u256":return new U;case"vector":if(i.length!==1)throw new t(e,"vector type expected to have exactly one type argument");return new E(i[0]);default:if(F(s)){let r=s.substring(1);return new M(g(r,i,c))}if($(s)){if(c)return new P(Number(s.split("T")[1]));throw new t(e,"unexpected generic type")}if(!s.match(/:/))throw new t(e,"unknown type");let n=s.split("::");if(n.length!==3)throw new t(e,"unexpected struct format, must be of the form 0xaddress::module_name::struct_name");let o;try{o=w.fromString(n[0])}catch{throw new t(e,"struct address must be valid")}if(!V(n[1]))throw new t(e,"module name must only contain alphanumeric or '_' characters");if(!V(n[2]))throw new t(e,"struct name must only contain alphanumeric or '_' characters");return new G(new N(o,new l(n[1]),new l(n[2]),i))}}export{R as a,t as b,j as c};
|
|
2
|
+
//# sourceMappingURL=chunk-GI4AR6DQ.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e as x,f as B}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{e as x,f as B}from"./chunk-KK5HUWF6.mjs";import{a as k}from"./chunk-YOZBVVKL.mjs";import{c as f,f as A}from"./chunk-SJDHW55X.mjs";import{e as b}from"./chunk-TH5JCPN2.mjs";import{d as C}from"./chunk-RJ7F4JDV.mjs";import{a as d}from"./chunk-BHVSIRNF.mjs";async function H(o){let{aptosConfig:n,options:t}=o;return A({aptosConfig:n,originMethod:"getTransactions",path:"transactions",params:{start:t?.offset,limit:t?.limit}})}async function W(o){let{aptosConfig:n}=o;return k(async()=>{let{data:t}=await f({aptosConfig:n,originMethod:"getGasPriceEstimation",path:"estimate_gas_price"});return t},`gas-price-${n.network}`,1e3*60*5)()}async function O(o){let{aptosConfig:n,ledgerVersion:t}=o,{data:s}=await f({aptosConfig:n,originMethod:"getTransactionByVersion",path:`transactions/by_version/${t}`});return s}async function y(o){let{aptosConfig:n,transactionHash:t}=o,{data:s}=await f({aptosConfig:n,path:`transactions/by_hash/${t}`,originMethod:"getTransactionByHash"});return s}async function q(o){let{aptosConfig:n,transactionHash:t}=o;try{return(await y({aptosConfig:n,transactionHash:t})).type==="pending_transaction"}catch(s){if(s?.status===404)return!0;throw s}}async function R(o){let{aptosConfig:n,transactionHash:t}=o,{data:s}=await f({aptosConfig:n,path:`transactions/wait_by_hash/${t}`,originMethod:"longWaitForTransaction"});return s}async function z(o){let{aptosConfig:n,transactionHash:t,options:s}=o,r=s?.timeoutSecs??20,u=s?.checkSuccess??!0,e=!0,p=0,i,g,l=200,h=1.5;function c(a){if(!(a instanceof b)||(g=a,a.status!==404&&a.status>=400&&a.status<500))throw a}try{i=await y({aptosConfig:n,transactionHash:t}),e=i.type==="pending_transaction"}catch(a){c(a)}if(e){let a=Date.now();try{i=await R({aptosConfig:n,transactionHash:t}),e=i.type==="pending_transaction"}catch(w){c(w)}p=(Date.now()-a)/1e3}for(;e&&!(p>=r);){try{if(i=await y({aptosConfig:n,transactionHash:t}),e=i.type==="pending_transaction",!e)break}catch(a){c(a)}await d(l),p+=l/1e3,l*=h}if(i===void 0)throw g||new m(`Fetching transaction ${t} failed and timed out after ${r} seconds`,i);if(i.type==="pending_transaction")throw new m(`Transaction ${t} timed out in pending state after ${r} seconds`,i);if(!u)return i;if(!i.success)throw new T(`Transaction ${t} failed with an error: ${i.vm_status}`,i);return i}async function U(o){let{aptosConfig:n,processorType:t}=o,s=BigInt(o.minimumLedgerVersion),r=3e3,u=new Date().getTime(),e=BigInt(-1);for(;e<s;){if(new Date().getTime()-u>r)throw new Error("waitForLastSuccessIndexerVersionSync timeout");if(t===void 0?e=await x({aptosConfig:n}):e=(await B({aptosConfig:n,processorType:t})).last_success_version,e>=s)break;await d(200)}}var m=class extends Error{constructor(n,t){super(n),this.lastSubmittedTransaction=t}},T=class extends Error{constructor(n,t){super(n),this.transaction=t}};async function X(o){let{aptosConfig:n,ledgerVersion:t,options:s}=o,{data:r}=await f({aptosConfig:n,originMethod:"getBlockByVersion",path:`blocks/by_version/${t}`,params:{with_transactions:s?.withTransactions}});return P({block:r,...o})}async function j(o){let{aptosConfig:n,blockHeight:t,options:s}=o,{data:r}=await f({aptosConfig:n,originMethod:"getBlockByHeight",path:`blocks/by_height/${t}`,params:{with_transactions:s?.withTransactions}});return P({block:r,...o})}async function P(o){let{aptosConfig:n,block:t,options:s}=o;if(s?.withTransactions){t.transactions=t.transactions??[];let r=t.transactions[t.transactions.length-1],u=BigInt(t.first_version),e=BigInt(t.last_version),p=r?.version,i;if(p===void 0?i=u-1n:i=BigInt(p),i===e)return t;let g=[],l=100n;for(let c=i+1n;c<e;c+=BigInt(100))g.push(H({aptosConfig:n,options:{offset:c,limit:Math.min(Number(l),Number(e-c+1n))}}));let h=await Promise.all(g);for(let c of h)t.transactions.push(...c)}return t}export{H as a,W as b,O as c,y as d,q as e,R as f,z as g,U as h,m as i,T as j,X as k,j as l};
|
|
2
|
+
//# sourceMappingURL=chunk-GRRBXHVG.mjs.map
|
|
@@ -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-53IBOHXB.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-GTVMJJQQ.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as c}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as c}from"./chunk-53IBOHXB.mjs";import{c as p}from"./chunk-GI4AR6DQ.mjs";import{c as o}from"./chunk-KK5HUWF6.mjs";import{n as u,q as g,r as A}from"./chunk-VHNX2NUR.mjs";import{f as a,i as r}from"./chunk-5W2ERBGY.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-GU4MD5ST.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as e}from"./chunk-RXHER6EA.mjs";import{b as r}from"./chunk-VHY6ZATX.mjs";var t=class extends e{toUint8Array(){return this.bcsToBytes()}toString(){let n=this.toUint8Array();return r.fromHexInput(n).toString()}},a=class extends t{};export{t as a,a as b};
|
|
2
|
+
//# sourceMappingURL=chunk-H4YAL2IL.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as d}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{c as d}from"./chunk-KK5HUWF6.mjs";import{p as c}from"./chunk-VHNX2NUR.mjs";import{b as i}from"./chunk-LQOSHBB7.mjs";var a=300,g=t=>{if(t&&t.length>a)throw new Error(`Event type length exceeds the maximum length of ${a}`)};async function m(t){let{aptosConfig:o,eventType:e,options:n}=t,s={_or:[{account_address:{_eq:e.split("::")[0]}},{account_address:{_eq:"0x0000000000000000000000000000000000000000000000000000000000000000"},sequence_number:{_eq:0},creation_number:{_eq:0}}],indexed_type:{_eq:e}};return p({aptosConfig:o,options:{...n,where:s}})}async function f(t){let{accountAddress:o,aptosConfig:e,creationNumber:n,options:s}=t,r={account_address:{_eq:i.from(o).toStringLong()},creation_number:{_eq:n}};return p({aptosConfig:e,options:{...s,where:r}})}async function _(t){let{accountAddress:o,aptosConfig:e,eventType:n,options:s}=t,r={account_address:{_eq:i.from(o).toStringLong()},indexed_type:{_eq:n}};return p({aptosConfig:e,options:{...s,where:r}})}async function p(t){let{aptosConfig:o,options:e}=t;g(e?.where?.indexed_type?._eq);let n={query:c,variables:{where_condition:e?.where,offset:e?.offset,limit:e?.limit,order_by:e?.orderBy}};return(await d({aptosConfig:o,query:n,originMethod:"getEvents"})).events}export{m as a,f as b,_ as c,p as d};
|
|
2
|
+
//# sourceMappingURL=chunk-HBTJN4RJ.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as c,b as o,c as d,d as z,e as m,f as U,g as y}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as c,b as o,c as d,d as z,e as m,f as U,g as y}from"./chunk-TKXEVD7A.mjs";import{a as b}from"./chunk-ZD2TY5N3.mjs";import{a as s}from"./chunk-RXHER6EA.mjs";import{b as u}from"./chunk-VHY6ZATX.mjs";var t=class i extends s{constructor(e){super(),this.values=e}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){if(this.values[0]!==void 0&&!(this.values[0]instanceof o)){new p(this.bcsToBytes()).serializeForScriptFunction(e);return}e.serializeU32AsUleb128(4),e.serialize(this)}static U8(e){let r;if(Array.isArray(e)&&e.length===0)r=[];else if(Array.isArray(e)&&typeof e[0]=="number")r=e;else if(typeof e=="string"){let n=u.fromHexInput(e);r=Array.from(n.toUint8Array())}else if(e instanceof Uint8Array)r=Array.from(e);else throw new Error("Invalid input type, must be an number[], Uint8Array, or hex string");return new i(r.map(n=>new o(n)))}static U16(e){return new i(e.map(r=>new d(r)))}static U32(e){return new i(e.map(r=>new z(r)))}static U64(e){return new i(e.map(r=>new m(r)))}static U128(e){return new i(e.map(r=>new U(r)))}static U256(e){return new i(e.map(r=>new y(r)))}static Bool(e){return new i(e.map(r=>new c(r)))}static MoveString(e){return new i(e.map(r=>new a(r)))}serialize(e){e.serializeVector(this.values)}static deserialize(e,r){let n=e.deserializeUleb128AsU32(),l=new Array;for(let w=0;w<n;w+=1)l.push(r.deserialize(e));return new i(l)}},p=class i extends s{constructor(e){super(),this.value=u.fromHexInput(e).toUint8Array()}serialize(e){e.serializeBytes(this.value)}serializeForEntryFunction(e){this.serialize(e)}serializeForScriptFunction(e){e.serializeU32AsUleb128(9),this.serialize(e)}static deserialize(e){return new i(e.deserializeBytes())}toMoveVector(e){let r=new b(this.bcsToBytes());r.deserializeUleb128AsU32();let n=r.deserializeVector(e);return new t(n)}},a=class i extends s{constructor(e){super(),this.value=e}serialize(e){e.serializeStr(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){let n=new TextEncoder().encode(this.value);t.U8(n).serializeForScriptFunction(e)}static deserialize(e){return new i(e.deserializeStr())}},A=class i extends s{constructor(e){super(),typeof e<"u"&&e!==null?this.vec=new t([e]):this.vec=new t([]),[this.value]=this.vec.values}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}unwrap(){if(this.isSome())return this.vec.values[0];throw new Error("Called unwrap on a MoveOption with no value")}isSome(){return this.vec.values.length===1}serialize(e){this.vec.serialize(e)}static U8(e){return new i(e!=null?new o(e):void 0)}static U16(e){return new i(e!=null?new d(e):void 0)}static U32(e){return new i(e!=null?new z(e):void 0)}static U64(e){return new i(e!=null?new m(e):void 0)}static U128(e){return new i(e!=null?new U(e):void 0)}static U256(e){return new i(e!=null?new y(e):void 0)}static Bool(e){return new i(e!=null?new c(e):void 0)}static MoveString(e){return new i(e!=null?new a(e):void 0)}static deserialize(e,r){let n=t.deserialize(e,r);return new i(n.values[0])}};export{t as a,p as b,a as c,A as d};
|
|
2
|
+
//# sourceMappingURL=chunk-HHWJHOFZ.mjs.map
|