@aptos-labs/ts-sdk 1.34.0 → 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 +8 -9
- package/dist/common/{accountAddress-CDtCLtJA.d.ts → accountAddress-CuHovHdK.d.ts} +19 -0
- 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 +489 -241
- package/dist/common/index.js +32 -32
- package/dist/common/index.js.map +1 -1
- package/dist/esm/account/AbstractKeylessAccount.mjs +1 -1
- package/dist/esm/account/AbstractedAccount.mjs +1 -1
- package/dist/esm/account/Account.d.mts +1 -1
- package/dist/esm/account/Account.mjs +1 -1
- package/dist/esm/account/AccountUtils.mjs +1 -1
- package/dist/esm/account/Ed25519Account.d.mts +2 -2
- package/dist/esm/account/Ed25519Account.mjs +1 -1
- package/dist/esm/account/EphemeralKeyPair.mjs +1 -1
- package/dist/esm/account/FederatedKeylessAccount.mjs +1 -1
- package/dist/esm/account/KeylessAccount.mjs +1 -1
- package/dist/esm/account/MultiEd25519Account.d.mts +108 -0
- package/dist/esm/account/MultiEd25519Account.mjs +2 -0
- package/dist/esm/account/MultiKeyAccount.d.mts +1 -2
- package/dist/esm/account/MultiKeyAccount.mjs +1 -1
- package/dist/esm/account/SingleKeyAccount.mjs +1 -1
- package/dist/esm/account/index.d.mts +1 -0
- package/dist/esm/account/index.mjs +1 -1
- package/dist/esm/account/utils.mjs +1 -1
- package/dist/esm/api/account/abstraction.mjs +1 -1
- package/dist/esm/api/account.d.mts +1 -1
- package/dist/esm/api/account.mjs +1 -1
- package/dist/esm/api/ans.mjs +1 -1
- package/dist/esm/api/aptos.d.mts +3 -1
- package/dist/esm/api/aptos.mjs +1 -1
- package/dist/esm/api/aptosConfig.mjs +1 -1
- package/dist/esm/api/coin.d.mts +2 -2
- package/dist/esm/api/coin.mjs +1 -1
- package/dist/esm/api/digitalAsset.mjs +1 -1
- package/dist/esm/api/event.mjs +1 -1
- package/dist/esm/api/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.mjs +1 -1
- package/dist/esm/api/fungibleAsset.mjs +1 -1
- package/dist/esm/api/general.mjs +1 -1
- package/dist/esm/api/index.d.mts +1 -0
- package/dist/esm/api/index.mjs +1 -1
- package/dist/esm/api/keyless.mjs +1 -1
- package/dist/esm/api/object.mjs +1 -1
- package/dist/esm/api/staking.mjs +1 -1
- package/dist/esm/api/table.mjs +1 -1
- package/dist/esm/api/transaction.mjs +1 -1
- package/dist/esm/api/transactionSubmission/build.mjs +1 -1
- package/dist/esm/api/transactionSubmission/management.mjs +1 -1
- 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.mjs +1 -1
- package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
- package/dist/esm/api/utils.mjs +1 -1
- package/dist/esm/bcs/deserializer.mjs +1 -1
- package/dist/esm/bcs/index.mjs +1 -1
- package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -1
- package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -1
- package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
- package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
- package/dist/esm/bcs/serializer.mjs +1 -1
- package/dist/esm/{chunk-P7SE5LQE.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-UTXEW2FT.mjs → chunk-2TRQERBL.mjs} +2 -2
- package/dist/esm/chunk-2V636AYW.mjs +2 -0
- package/dist/esm/{chunk-L6FONDPA.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-XDIX7NIP.mjs → chunk-3LDVJ2YK.mjs} +2 -2
- package/dist/esm/{chunk-J7HRQ2IH.mjs → chunk-44EHAKKW.mjs} +2 -2
- package/dist/esm/{chunk-2FNFUTFJ.mjs → chunk-53IBOHXB.mjs} +2 -2
- package/dist/esm/{chunk-X6IHNXWY.mjs → chunk-5H5D6QVX.mjs} +2 -2
- package/dist/esm/{chunk-G4O6FXCF.mjs → chunk-5W2ERBGY.mjs} +2 -2
- package/dist/esm/{chunk-VOCI2675.mjs → chunk-67A5U2X6.mjs} +2 -2
- package/dist/esm/{chunk-XXHZQFYW.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-ZP5EBIBE.mjs → chunk-7A2KHJ3D.mjs} +2 -2
- package/dist/esm/{chunk-ROT6S6BM.mjs → chunk-7CRQNXR5.mjs} +2 -2
- package/dist/esm/{chunk-TM6IKHMX.mjs → chunk-7OUPEQRN.mjs} +2 -2
- package/dist/esm/chunk-A3VO773Q.mjs +2 -0
- package/dist/esm/{chunk-DWJ3PGWE.mjs → chunk-AEGA5N2W.mjs} +2 -2
- package/dist/esm/{chunk-BI3BTSUB.mjs → chunk-AIPHJFJL.mjs} +2 -2
- package/dist/esm/{chunk-HLJE5XGE.mjs → chunk-AQWKKSRN.mjs} +2 -2
- package/dist/esm/{chunk-D6T3NYOA.mjs → chunk-B23VO5TB.mjs} +2 -2
- package/dist/esm/{chunk-42T3UGSW.mjs → chunk-BHVSIRNF.mjs} +2 -2
- package/dist/esm/chunk-BMPHQ3E7.mjs +2 -0
- package/dist/esm/{chunk-EGZI6EJ2.mjs → chunk-BPHCRTHD.mjs} +2 -2
- package/dist/esm/{chunk-XH3BEKII.mjs → chunk-BQYKFATL.mjs} +2 -2
- package/dist/esm/chunk-BY3XFRUM.mjs +2 -0
- package/dist/esm/{chunk-EY2JUXEC.mjs.map → chunk-BY3XFRUM.mjs.map} +1 -1
- package/dist/esm/{chunk-DBIZE7G6.mjs → chunk-CGTMSLVZ.mjs} +2 -2
- package/dist/esm/{chunk-4T75XRI2.mjs → chunk-CPAAEEF4.mjs} +2 -2
- package/dist/esm/{chunk-DMS7K76O.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-Q7RG7KQS.mjs → chunk-DAJFOJ3L.mjs} +2 -2
- package/dist/esm/chunk-DOVH6HPL.mjs +2 -0
- package/dist/esm/{chunk-U2SJIG2T.mjs → chunk-E5PAUR4N.mjs} +2 -2
- package/dist/esm/{chunk-6LGXFXXR.mjs → chunk-EGCL6KA6.mjs} +2 -2
- package/dist/esm/{chunk-TOBQ5UE6.mjs → chunk-ERLDXTIY.mjs} +2 -2
- package/dist/esm/{chunk-CSG67JHZ.mjs → chunk-FJ5J7CVW.mjs} +2 -2
- package/dist/esm/{chunk-DLLDRANJ.mjs → chunk-FOEPRHAC.mjs} +2 -2
- package/dist/esm/{chunk-6JTNS5O6.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-Y3Y4DVCK.mjs → chunk-GRRBXHVG.mjs} +2 -2
- package/dist/esm/{chunk-HT2WC3QV.mjs → chunk-GTVMJJQQ.mjs} +2 -2
- package/dist/esm/{chunk-HL2O3T57.mjs → chunk-GU4MD5ST.mjs} +2 -2
- package/dist/esm/chunk-H4YAL2IL.mjs +2 -0
- package/dist/esm/{chunk-X24PSWCX.mjs → chunk-HBTJN4RJ.mjs} +2 -2
- package/dist/esm/{chunk-IDTLNF4M.mjs → chunk-HHWJHOFZ.mjs} +2 -2
- package/dist/esm/{chunk-OURSLL3I.mjs → chunk-HKL4MFNL.mjs} +2 -2
- package/dist/esm/{chunk-G6RLN6ET.mjs → chunk-HVIF6DW6.mjs} +2 -2
- package/dist/esm/{chunk-VKDTI6NX.mjs → chunk-HYJQHVDZ.mjs} +2 -2
- package/dist/esm/chunk-HYJQHVDZ.mjs.map +1 -0
- package/dist/esm/{chunk-XAPQNCTN.mjs → chunk-ILUFGYLO.mjs} +2 -2
- package/dist/esm/{chunk-ABXES4FS.mjs → chunk-IMYNN4TW.mjs} +2 -2
- package/dist/esm/{chunk-2GIPNLDO.mjs → chunk-IOHESHLR.mjs} +2 -2
- package/dist/esm/{chunk-GQX5KMF7.mjs → chunk-JNNFNYDO.mjs} +2 -2
- package/dist/esm/{chunk-3HFZN7L5.mjs → chunk-K233I26C.mjs} +2 -2
- package/dist/esm/{chunk-AC3BISWL.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-N7C6LQPZ.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-HFCWJ6QL.mjs → chunk-MAWGZICD.mjs} +2 -2
- package/dist/esm/{chunk-JF66JS2R.mjs → chunk-MFLHAVIW.mjs} +2 -2
- package/dist/esm/chunk-OLGEN23M.mjs +2 -0
- package/dist/esm/{chunk-4UK4MUSD.mjs → chunk-ONGH5DXZ.mjs} +2 -2
- package/dist/esm/{chunk-4776UXL6.mjs → chunk-OPD5EKOA.mjs} +2 -2
- package/dist/esm/{chunk-V2EXS6TM.mjs → chunk-P5CM4C2G.mjs} +2 -2
- package/dist/esm/{chunk-BBUN4IO4.mjs → chunk-PC25RPDV.mjs} +2 -2
- 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-6PBMD2BQ.mjs → chunk-PWGTRRSJ.mjs} +2 -2
- package/dist/esm/{chunk-PWYJWTEM.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-H4GZWYIG.mjs → chunk-QYJKCRVA.mjs} +2 -2
- package/dist/esm/{chunk-X2CPDUOS.mjs → chunk-R6QCPXQG.mjs} +2 -2
- package/dist/esm/chunk-R6QCPXQG.mjs.map +1 -0
- package/dist/esm/{chunk-33CBJFX2.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-KEJAUCQF.mjs → chunk-T7X4GZDU.mjs} +2 -2
- package/dist/esm/{chunk-BUTMGMSD.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-PR3W2QEH.mjs → chunk-U4DEYWFT.mjs} +2 -2
- package/dist/esm/{chunk-7CYCKCVU.mjs → chunk-UJJGIPOA.mjs} +2 -2
- package/dist/esm/{chunk-ZCEBDPBJ.mjs → chunk-US2HZFOM.mjs} +2 -2
- package/dist/esm/{chunk-S47HA7O7.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-TDGUMBON.mjs → chunk-VWZEJTGP.mjs} +2 -2
- package/dist/esm/{chunk-TDGUMBON.mjs.map → chunk-VWZEJTGP.mjs.map} +1 -1
- package/dist/esm/{chunk-3EY7MT2M.mjs → chunk-W2C5KRUQ.mjs} +2 -2
- package/dist/esm/{chunk-O37BZP2G.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-CXNF73OX.mjs → chunk-WHVCUVZP.mjs} +2 -2
- package/dist/esm/{chunk-QBFGY74I.mjs → chunk-WLDYBSOG.mjs} +2 -2
- package/dist/esm/{chunk-HEAWDTLG.mjs → chunk-XRVZAEQO.mjs} +2 -2
- package/dist/esm/chunk-XSBUL2WP.mjs +2 -0
- package/dist/esm/chunk-XSBUL2WP.mjs.map +1 -0
- package/dist/esm/{chunk-DNWFDS7F.mjs → chunk-XW3BXTCZ.mjs} +2 -2
- package/dist/esm/{chunk-L2AQG3G3.mjs → chunk-Y65PKZLK.mjs} +2 -2
- package/dist/esm/{chunk-WXDA4CCR.mjs → chunk-YAGIE4GN.mjs} +2 -2
- package/dist/esm/{chunk-CRFLR3ZY.mjs → chunk-YLUULY6G.mjs} +2 -2
- package/dist/esm/{chunk-SCBYJU6K.mjs → chunk-YWSDONJJ.mjs} +2 -2
- package/dist/esm/{chunk-BYHCW7MI.mjs → chunk-YXYYII5S.mjs} +2 -2
- package/dist/esm/{chunk-XTOIL6MB.mjs → chunk-ZD2TY5N3.mjs} +2 -2
- package/dist/esm/{chunk-5BSMF22B.mjs → chunk-ZS2IVRHT.mjs} +2 -2
- package/dist/esm/cli/index.mjs +1 -1
- package/dist/esm/cli/localNode.mjs +1 -1
- package/dist/esm/client/core.d.mts +36 -1
- package/dist/esm/client/core.mjs +1 -1
- package/dist/esm/client/get.d.mts +35 -1
- package/dist/esm/client/get.mjs +1 -1
- package/dist/esm/client/index.d.mts +3 -3
- package/dist/esm/client/index.mjs +1 -1
- package/dist/esm/client/post.d.mts +34 -1
- package/dist/esm/client/post.mjs +1 -1
- package/dist/esm/core/account/index.mjs +1 -1
- package/dist/esm/core/account/utils/address.mjs +1 -1
- package/dist/esm/core/account/utils/index.mjs +1 -1
- package/dist/esm/core/accountAddress.mjs +1 -1
- package/dist/esm/core/authenticationKey.mjs +1 -1
- package/dist/esm/core/crypto/abstraction.mjs +1 -1
- package/dist/esm/core/crypto/ed25519.mjs +1 -1
- package/dist/esm/core/crypto/ephemeral.mjs +1 -1
- package/dist/esm/core/crypto/federatedKeyless.mjs +1 -1
- package/dist/esm/core/crypto/index.d.mts +1 -1
- package/dist/esm/core/crypto/index.mjs +1 -1
- package/dist/esm/core/crypto/keyless.mjs +1 -1
- package/dist/esm/core/crypto/multiEd25519.d.mts +17 -2
- package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
- package/dist/esm/core/crypto/multiKey.d.mts +33 -15
- package/dist/esm/core/crypto/multiKey.mjs +1 -1
- package/dist/esm/core/crypto/privateKey.mjs +1 -1
- package/dist/esm/core/crypto/proof.mjs +1 -1
- package/dist/esm/core/crypto/publicKey.mjs +1 -1
- package/dist/esm/core/crypto/secp256k1.mjs +1 -1
- package/dist/esm/core/crypto/signature.mjs +1 -1
- package/dist/esm/core/crypto/singleKey.mjs +1 -1
- package/dist/esm/core/crypto/utils.mjs +1 -1
- package/dist/esm/core/hex.mjs +1 -1
- package/dist/esm/core/index.d.mts +1 -1
- package/dist/esm/core/index.mjs +1 -1
- package/dist/esm/errors/index.mjs +1 -1
- package/dist/esm/index.d.mts +6 -4
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/internal/abstraction.mjs +1 -1
- package/dist/esm/internal/account.mjs +1 -1
- package/dist/esm/internal/ans.mjs +1 -1
- package/dist/esm/internal/coin.mjs +1 -1
- package/dist/esm/internal/digitalAsset.mjs +1 -1
- package/dist/esm/internal/event.mjs +1 -1
- package/dist/esm/internal/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.mjs +1 -1
- package/dist/esm/internal/fungibleAsset.mjs +1 -1
- package/dist/esm/internal/general.mjs +1 -1
- package/dist/esm/internal/keyless.mjs +1 -1
- package/dist/esm/internal/object.mjs +1 -1
- package/dist/esm/internal/staking.mjs +1 -1
- package/dist/esm/internal/table.mjs +1 -1
- package/dist/esm/internal/transaction.mjs +1 -1
- package/dist/esm/internal/transactionSubmission.mjs +1 -1
- package/dist/esm/internal/view.mjs +1 -1
- package/dist/esm/transactions/authenticator/account.mjs +1 -1
- package/dist/esm/transactions/authenticator/index.mjs +1 -1
- package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
- package/dist/esm/transactions/index.mjs +1 -1
- package/dist/esm/transactions/instances/chainId.mjs +1 -1
- package/dist/esm/transactions/instances/identifier.mjs +1 -1
- package/dist/esm/transactions/instances/index.mjs +1 -1
- package/dist/esm/transactions/instances/moduleId.mjs +1 -1
- package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
- package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
- package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
- package/dist/esm/transactions/management/index.mjs +1 -1
- package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
- package/dist/esm/transactions/scriptComposer/index.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +2 -2
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
- package/dist/esm/transactions/typeTag/index.mjs +1 -1
- package/dist/esm/transactions/typeTag/parser.mjs +1 -1
- package/dist/esm/types/index.mjs +1 -1
- package/dist/esm/types/types.d.mts +19 -0
- package/dist/esm/types/types.mjs +1 -1
- package/dist/esm/utils/helpers.mjs +1 -1
- package/dist/esm/utils/index.mjs +1 -1
- package/dist/esm/utils/normalizeBundle.mjs +1 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -7
- package/src/account/MultiEd25519Account.ts +154 -0
- package/src/account/MultiKeyAccount.ts +1 -2
- package/src/account/index.ts +1 -0
- package/src/api/account.ts +1 -1
- package/src/api/aptos.ts +6 -0
- package/src/api/aptosConfig.ts +2 -2
- package/src/api/experimental.ts +64 -0
- 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/multiEd25519.ts +19 -3
- package/src/core/crypto/multiKey.ts +76 -52
- package/src/core/hex.ts +3 -1
- package/src/internal/experimental.ts +55 -0
- package/src/internal/view.ts +4 -4
- package/src/transactions/transactionBuilder/transactionBuilder.ts +7 -0
- package/src/types/types.ts +20 -0
- package/src/version.ts +1 -1
- package/dist/common/chunk-ZYPBABLQ.js +0 -4
- package/dist/common/chunk-ZYPBABLQ.js.map +0 -1
- package/dist/esm/chunk-4YLUM62M.mjs +0 -2
- package/dist/esm/chunk-66HHRRIX.mjs +0 -2
- package/dist/esm/chunk-66HHRRIX.mjs.map +0 -1
- package/dist/esm/chunk-7C2RDOWS.mjs +0 -1
- package/dist/esm/chunk-7DPHPPMG.mjs +0 -2
- package/dist/esm/chunk-7DPHPPMG.mjs.map +0 -1
- package/dist/esm/chunk-DNJQWGB7.mjs +0 -2
- package/dist/esm/chunk-DPW6ELCQ.mjs +0 -2
- package/dist/esm/chunk-EMURYYVO.mjs +0 -2
- package/dist/esm/chunk-EY2JUXEC.mjs +0 -2
- package/dist/esm/chunk-F2ZTBAJJ.mjs +0 -2
- package/dist/esm/chunk-F2ZTBAJJ.mjs.map +0 -1
- package/dist/esm/chunk-I7YHK6ZF.mjs +0 -2
- package/dist/esm/chunk-I7YHK6ZF.mjs.map +0 -1
- package/dist/esm/chunk-PNSF3E67.mjs +0 -2
- package/dist/esm/chunk-PNSF3E67.mjs.map +0 -1
- package/dist/esm/chunk-PWYJWTEM.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-ULHOJ2BE.mjs +0 -2
- package/dist/esm/chunk-ULHOJ2BE.mjs.map +0 -1
- package/dist/esm/chunk-V7G2EDNR.mjs +0 -2
- package/dist/esm/chunk-V7G2EDNR.mjs.map +0 -1
- package/dist/esm/chunk-VKDTI6NX.mjs.map +0 -1
- package/dist/esm/chunk-WCMW2L3P.mjs +0 -2
- package/dist/esm/chunk-X2CPDUOS.mjs.map +0 -1
- package/dist/esm/chunk-XJJVJOX5.mjs +0 -2
- package/dist/esm/chunk-YIF242TF.mjs +0 -2
- package/dist/esm/chunk-YIF242TF.mjs.map +0 -1
- /package/dist/esm/{chunk-7C2RDOWS.mjs.map → account/MultiEd25519Account.mjs.map} +0 -0
- /package/dist/esm/{chunk-P7SE5LQE.mjs.map → chunk-27ESCVVC.mjs.map} +0 -0
- /package/dist/esm/{chunk-UTXEW2FT.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-L6FONDPA.mjs.map → chunk-2YKERRHD.mjs.map} +0 -0
- /package/dist/esm/{chunk-XDIX7NIP.mjs.map → chunk-3LDVJ2YK.mjs.map} +0 -0
- /package/dist/esm/{chunk-J7HRQ2IH.mjs.map → chunk-44EHAKKW.mjs.map} +0 -0
- /package/dist/esm/{chunk-2FNFUTFJ.mjs.map → chunk-53IBOHXB.mjs.map} +0 -0
- /package/dist/esm/{chunk-X6IHNXWY.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-VOCI2675.mjs.map → chunk-67A5U2X6.mjs.map} +0 -0
- /package/dist/esm/{chunk-XXHZQFYW.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-ZP5EBIBE.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-TM6IKHMX.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-DWJ3PGWE.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-HLJE5XGE.mjs.map → chunk-AQWKKSRN.mjs.map} +0 -0
- /package/dist/esm/{chunk-D6T3NYOA.mjs.map → chunk-B23VO5TB.mjs.map} +0 -0
- /package/dist/esm/{chunk-42T3UGSW.mjs.map → chunk-BHVSIRNF.mjs.map} +0 -0
- /package/dist/esm/{chunk-4YLUM62M.mjs.map → chunk-BMPHQ3E7.mjs.map} +0 -0
- /package/dist/esm/{chunk-EGZI6EJ2.mjs.map → chunk-BPHCRTHD.mjs.map} +0 -0
- /package/dist/esm/{chunk-XH3BEKII.mjs.map → chunk-BQYKFATL.mjs.map} +0 -0
- /package/dist/esm/{chunk-DBIZE7G6.mjs.map → chunk-CGTMSLVZ.mjs.map} +0 -0
- /package/dist/esm/{chunk-4T75XRI2.mjs.map → chunk-CPAAEEF4.mjs.map} +0 -0
- /package/dist/esm/{chunk-DMS7K76O.mjs.map → chunk-CPFQUFVD.mjs.map} +0 -0
- /package/dist/esm/{chunk-Q7RG7KQS.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-U2SJIG2T.mjs.map → chunk-E5PAUR4N.mjs.map} +0 -0
- /package/dist/esm/{chunk-6LGXFXXR.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-CSG67JHZ.mjs.map → chunk-FJ5J7CVW.mjs.map} +0 -0
- /package/dist/esm/{chunk-DLLDRANJ.mjs.map → chunk-FOEPRHAC.mjs.map} +0 -0
- /package/dist/esm/{chunk-6JTNS5O6.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-Y3Y4DVCK.mjs.map → chunk-GRRBXHVG.mjs.map} +0 -0
- /package/dist/esm/{chunk-HT2WC3QV.mjs.map → chunk-GTVMJJQQ.mjs.map} +0 -0
- /package/dist/esm/{chunk-HL2O3T57.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-X24PSWCX.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-OURSLL3I.mjs.map → chunk-HKL4MFNL.mjs.map} +0 -0
- /package/dist/esm/{chunk-G6RLN6ET.mjs.map → chunk-HVIF6DW6.mjs.map} +0 -0
- /package/dist/esm/{chunk-XAPQNCTN.mjs.map → chunk-ILUFGYLO.mjs.map} +0 -0
- /package/dist/esm/{chunk-ABXES4FS.mjs.map → chunk-IMYNN4TW.mjs.map} +0 -0
- /package/dist/esm/{chunk-2GIPNLDO.mjs.map → chunk-IOHESHLR.mjs.map} +0 -0
- /package/dist/esm/{chunk-GQX5KMF7.mjs.map → chunk-JNNFNYDO.mjs.map} +0 -0
- /package/dist/esm/{chunk-3HFZN7L5.mjs.map → chunk-K233I26C.mjs.map} +0 -0
- /package/dist/esm/{chunk-AC3BISWL.mjs.map → chunk-KK5HUWF6.mjs.map} +0 -0
- /package/dist/esm/{chunk-N7C6LQPZ.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-HFCWJ6QL.mjs.map → chunk-MAWGZICD.mjs.map} +0 -0
- /package/dist/esm/{chunk-JF66JS2R.mjs.map → chunk-MFLHAVIW.mjs.map} +0 -0
- /package/dist/esm/{chunk-DNJQWGB7.mjs.map → chunk-OLGEN23M.mjs.map} +0 -0
- /package/dist/esm/{chunk-4UK4MUSD.mjs.map → chunk-ONGH5DXZ.mjs.map} +0 -0
- /package/dist/esm/{chunk-4776UXL6.mjs.map → chunk-OPD5EKOA.mjs.map} +0 -0
- /package/dist/esm/{chunk-V2EXS6TM.mjs.map → chunk-P5CM4C2G.mjs.map} +0 -0
- /package/dist/esm/{chunk-BBUN4IO4.mjs.map → chunk-PC25RPDV.mjs.map} +0 -0
- /package/dist/esm/{chunk-N6YTF76Q.mjs.map → chunk-PDAWVDI7.mjs.map} +0 -0
- /package/dist/esm/{chunk-6PBMD2BQ.mjs.map → chunk-PWGTRRSJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-H4GZWYIG.mjs.map → chunk-QYJKCRVA.mjs.map} +0 -0
- /package/dist/esm/{chunk-33CBJFX2.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-KEJAUCQF.mjs.map → chunk-T7X4GZDU.mjs.map} +0 -0
- /package/dist/esm/{chunk-BUTMGMSD.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-PR3W2QEH.mjs.map → chunk-U4DEYWFT.mjs.map} +0 -0
- /package/dist/esm/{chunk-7CYCKCVU.mjs.map → chunk-UJJGIPOA.mjs.map} +0 -0
- /package/dist/esm/{chunk-ZCEBDPBJ.mjs.map → chunk-US2HZFOM.mjs.map} +0 -0
- /package/dist/esm/{chunk-S47HA7O7.mjs.map → chunk-VDYUMBOT.mjs.map} +0 -0
- /package/dist/esm/{chunk-3EY7MT2M.mjs.map → chunk-W2C5KRUQ.mjs.map} +0 -0
- /package/dist/esm/{chunk-O37BZP2G.mjs.map → chunk-W4SMZ6IW.mjs.map} +0 -0
- /package/dist/esm/{chunk-CXNF73OX.mjs.map → chunk-WHVCUVZP.mjs.map} +0 -0
- /package/dist/esm/{chunk-QBFGY74I.mjs.map → chunk-WLDYBSOG.mjs.map} +0 -0
- /package/dist/esm/{chunk-HEAWDTLG.mjs.map → chunk-XRVZAEQO.mjs.map} +0 -0
- /package/dist/esm/{chunk-DNWFDS7F.mjs.map → chunk-XW3BXTCZ.mjs.map} +0 -0
- /package/dist/esm/{chunk-L2AQG3G3.mjs.map → chunk-Y65PKZLK.mjs.map} +0 -0
- /package/dist/esm/{chunk-WXDA4CCR.mjs.map → chunk-YAGIE4GN.mjs.map} +0 -0
- /package/dist/esm/{chunk-CRFLR3ZY.mjs.map → chunk-YLUULY6G.mjs.map} +0 -0
- /package/dist/esm/{chunk-SCBYJU6K.mjs.map → chunk-YWSDONJJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-BYHCW7MI.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-5BSMF22B.mjs.map → chunk-ZS2IVRHT.mjs.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as u}from"./chunk-2FNFUTFJ.mjs";import{h as M}from"./chunk-HEAWDTLG.mjs";import{c as R}from"./chunk-AZWVCBK2.mjs";import{c as k}from"./chunk-AC3BISWL.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{a as _,c as d}from"./chunk-IDTLNF4M.mjs";import{a as T,e as D}from"./chunk-ORMOQWWH.mjs";import{b as c}from"./chunk-Q4C4U6I4.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
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as u,c as d,f as p}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
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
|
|
@@ -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
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as l}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as l}from"./chunk-YXYYII5S.mjs";import{a as o,b as c}from"./chunk-A5L76YP7.mjs";import{a as h,i as d}from"./chunk-53IBOHXB.mjs";import{g as u}from"./chunk-GRRBXHVG.mjs";import g from"eventemitter3";var m="fulfilled",f=(n=>(n.TransactionSent="transactionSent",n.TransactionSendFailed="transactionSendFailed",n.TransactionExecuted="transactionExecuted",n.TransactionExecutionFailed="transactionExecutionFailed",n.ExecutionFinish="executionFinish",n))(f||{}),p=class extends g{constructor(t,e,a=30,n=100,i=10){super();this.taskQueue=new o;this.transactionsQueue=new o;this.outstandingTransactions=new o;this.sentTransactions=[];this.executedTransactions=[];this.aptosConfig=t,this.account=e,this.started=!1,this.accountSequnceNumber=new l(t,e,a,n,i)}async submitNextTransaction(){try{for(;;){let t=await this.accountSequnceNumber.nextSequenceNumber();if(t===null)return;let e=await this.generateNextTransaction(this.account,t);if(!e)return;let a=d({aptosConfig:this.aptosConfig,transaction:e,signer:this.account});await this.outstandingTransactions.enqueue([a,t])}}catch(t){if(t instanceof c)return;throw new Error(`Submit transaction failed for ${this.account.accountAddress.toString()} with error ${t}`)}}async processTransactions(){try{for(;;){let t=[],e=[],[a,n]=await this.outstandingTransactions.dequeue();for(t.push(a),e.push(n);!this.outstandingTransactions.isEmpty();)[a,n]=await this.outstandingTransactions.dequeue(),t.push(a),e.push(n);let i=await Promise.allSettled(t);for(let s=0;s<i.length&&s<e.length;s+=1){let r=i[s];n=e[s],r.status===m?(this.sentTransactions.push([r.value.hash,n,null]),this.emit("transactionSent",{message:`transaction hash ${r.value.hash} has been committed to chain`,transactionHash:r.value.hash}),await this.checkTransaction(r,n)):(this.sentTransactions.push([r.status,n,r.reason]),this.emit("transactionSendFailed",{message:`failed to commit transaction ${this.sentTransactions.length} with error ${r.reason}`,error:r.reason}))}this.emit("executionFinish",{message:`execute ${i.length} transactions finished`})}}catch(t){if(t instanceof c)return;throw new Error(`Process execution failed for ${this.account.accountAddress.toString()} with error ${t}`)}}async checkTransaction(t,e){try{let a=[];a.push(u({aptosConfig:this.aptosConfig,transactionHash:t.value.hash}));let n=await Promise.allSettled(a);for(let i=0;i<n.length;i+=1){let s=n[i];s.status===m?(this.executedTransactions.push([s.value.hash,e,null]),this.emit("transactionExecuted",{message:`transaction hash ${s.value.hash} has been executed on chain`,transactionHash:t.value.hash})):(this.executedTransactions.push([s.status,e,s.reason]),this.emit("transactionExecutionFailed",{message:`failed to execute transaction ${this.executedTransactions.length} with error ${s.reason}`,error:s.reason}))}}catch(a){throw new Error(`Check transaction failed for ${this.account.accountAddress.toString()} with error ${a}`)}}async push(t,e){this.transactionsQueue.enqueue([t,e])}async generateNextTransaction(t,e){if(this.transactionsQueue.isEmpty())return;let[a,n]=await this.transactionsQueue.dequeue();return h({aptosConfig:this.aptosConfig,sender:t.accountAddress,data:a,options:{...n,accountSequenceNumber:e}})}async run(){try{for(;!this.taskQueue.isCancelled();)await(await this.taskQueue.dequeue())()}catch(t){throw new Error(`Unable to start transaction batching: ${t}`)}}start(){if(this.started)throw new Error("worker has already started");this.started=!0,this.taskQueue.enqueue(()=>this.submitNextTransaction()),this.taskQueue.enqueue(()=>this.processTransactions()),this.run()}stop(){if(this.taskQueue.isCancelled())throw new Error("worker has already stopped");this.started=!1,this.taskQueue.cancel()}};export{m as a,f as b,p as c};
|
|
2
|
+
//# sourceMappingURL=chunk-HKL4MFNL.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as S,c as k,d as R,e as V}from"./chunk-GOXRBEIJ.mjs";import{a as M}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as S,c as k,d as R,e as V}from"./chunk-GOXRBEIJ.mjs";import{a as M}from"./chunk-2V636AYW.mjs";import{a as E,b as w}from"./chunk-PWGTRRSJ.mjs";import{b as _,d as U}from"./chunk-7OUPEQRN.mjs";import{b as C}from"./chunk-H4YAL2IL.mjs";import{a as f}from"./chunk-A3VO773Q.mjs";import{a as P}from"./chunk-TTY5GFMN.mjs";import{a as D}from"./chunk-YOZBVVKL.mjs";import{c as g}from"./chunk-SJDHW55X.mjs";import{d as l}from"./chunk-TH5JCPN2.mjs";import{a as h}from"./chunk-ZD2TY5N3.mjs";import{b as B}from"./chunk-BHVSIRNF.mjs";import{b as m}from"./chunk-LQOSHBB7.mjs";import{a as y,b as K}from"./chunk-RXHER6EA.mjs";import{b as p,c as T}from"./chunk-VHY6ZATX.mjs";import{jwtDecode as W}from"jwt-decode";import{sha3_256 as $}from"@noble/hashes/sha3";var He=1e7,Z=120,Y=30,X=330,Te=120,Pe=350,Ce=300,_e=93,o=class o extends C{constructor(e,t){super();let r=p.fromHexInput(t).toUint8Array();if(r.length!==o.ID_COMMITMENT_LENGTH)throw new Error(`Id Commitment length in bytes should be ${o.ID_COMMITMENT_LENGTH}`);this.iss=e,this.idCommitment=r}authKey(){let e=new K;return e.serializeU32AsUleb128(3),e.serializeFixedBytes(this.bcsToBytes()),P.fromSchemeAndBytes({scheme:2,input:e.toUint8Array()})}verifySignature(e){throw new Error("Not yet implemented")}serialize(e){e.serializeStr(this.iss),e.serializeBytes(this.idCommitment)}static deserialize(e){let t=e.deserializeStr(),r=e.deserializeBytes();return new o(t,r)}static load(e){let t=e.deserializeStr(),r=e.deserializeBytes();return new o(t,r)}static isPublicKey(e){return e instanceof o}static create(e){return J(e),new o(e.iss,J(e))}static fromJwtAndPepper(e){let{jwt:t,pepper:r,uidKey:s="sub"}=e,a=W(t);if(typeof a.iss!="string")throw new Error("iss was not found");if(typeof a.aud!="string")throw new Error("aud was not found or an array of values");let n=a[s];return o.create({iss:a.iss,uidKey:s,uidVal:n,aud:a.aud,pepper:r})}static isInstance(e){return"iss"in e&&typeof e.iss=="string"&&"idCommitment"in e&&e.idCommitment instanceof Uint8Array}};o.ID_COMMITMENT_LENGTH=32;var G=o;function J(i){let{uidKey:e,uidVal:t,aud:r,pepper:s}=i,a=[k(p.fromHexInput(s).toUint8Array()),S(r,Z),S(t,X),S(e,Y)];return R(V(a),G.ID_COMMITMENT_LENGTH)}var O=class i extends f{constructor(e){super();let{jwtHeader:t,ephemeralCertificate:r,expiryDateSecs:s,ephemeralPublicKey:a,ephemeralSignature:n}=e;this.jwtHeader=t,this.ephemeralCertificate=r,this.expiryDateSecs=s,this.ephemeralPublicKey=a,this.ephemeralSignature=n}getJwkKid(){return ee(this.jwtHeader).kid}serialize(e){this.ephemeralCertificate.serialize(e),e.serializeStr(this.jwtHeader),e.serializeU64(this.expiryDateSecs),this.ephemeralPublicKey.serialize(e),this.ephemeralSignature.serialize(e)}static deserialize(e){let t=x.deserialize(e),r=e.deserializeStr(),s=e.deserializeU64(),a=E.deserialize(e),n=w.deserialize(e);return new i({jwtHeader:r,expiryDateSecs:Number(s),ephemeralCertificate:t,ephemeralPublicKey:a,ephemeralSignature:n})}static getSimulationSignature(){return new i({jwtHeader:"{}",ephemeralCertificate:new x(new z({proof:new b(new A({a:new Uint8Array(32),b:new Uint8Array(64),c:new Uint8Array(32)}),0),expHorizonSecs:0}),0),expiryDateSecs:0,ephemeralPublicKey:new E(new _(new Uint8Array(32))),ephemeralSignature:new w(new U(new Uint8Array(64)))})}static isSignature(e){return e instanceof i}},x=class i extends f{constructor(e,t){super(),this.signature=e,this.variant=t}toUint8Array(){return this.signature.toUint8Array()}serialize(e){e.serializeU32AsUleb128(this.variant),this.signature.serialize(e)}static deserialize(e){let t=e.deserializeUleb128AsU32();switch(t){case 0:return new i(z.deserialize(e),t);default:throw new Error(`Unknown variant index for EphemeralCertificate: ${t}`)}}},c=class i extends y{constructor(e){if(super(),this.data=p.fromHexInput(e).toUint8Array(),this.data.length!==32)throw new Error("Input needs to be 32 bytes")}serialize(e){e.serializeFixedBytes(this.data)}static deserialize(e){let t=e.deserializeFixedBytes(32);return new i(t)}},d=class i extends y{constructor(e){if(super(),this.data=p.fromHexInput(e).toUint8Array(),this.data.length!==64)throw new Error("Input needs to be 64 bytes")}serialize(e){e.serializeFixedBytes(this.data)}static deserialize(e){let t=e.deserializeFixedBytes(64);return new i(t)}},A=class i extends M{constructor(e){super();let{a:t,b:r,c:s}=e;this.a=new c(t),this.b=new d(r),this.c=new c(s)}serialize(e){this.a.serialize(e),this.b.serialize(e),this.c.serialize(e)}static deserialize(e){let t=c.deserialize(e).bcsToBytes(),r=d.deserialize(e).bcsToBytes(),s=c.deserialize(e).bcsToBytes();return new i({a:t,b:r,c:s})}},b=class i extends y{constructor(e,t){super(),this.proof=e,this.variant=t}serialize(e){e.serializeU32AsUleb128(this.variant),this.proof.serialize(e)}static deserialize(e){let t=e.deserializeUleb128AsU32();switch(t){case 0:return new i(A.deserialize(e),t);default:throw new Error(`Unknown variant index for ZkProof: ${t}`)}}},z=class i extends f{constructor(e){super();let{proof:t,expHorizonSecs:r,trainingWheelsSignature:s,extraField:a,overrideAudVal:n}=e;this.proof=t,this.expHorizonSecs=r,this.trainingWheelsSignature=s,this.extraField=a,this.overrideAudVal=n}static fromBytes(e){return i.deserialize(new h(e))}serialize(e){this.proof.serialize(e),e.serializeU64(this.expHorizonSecs),e.serializeOption(this.extraField),e.serializeOption(this.overrideAudVal),e.serializeOption(this.trainingWheelsSignature)}static deserialize(e){let t=b.deserialize(e),r=Number(e.deserializeU64()),s=e.deserializeOption("string"),a=e.deserializeOption("string"),n=e.deserializeOption(w);return new i({proof:t,expHorizonSecs:r,trainingWheelsSignature:n,extraField:s,overrideAudVal:a})}},v=class i{constructor(e,t){this.verificationKey=e,this.maxExpHorizonSecs=t}static create(e,t){return new i(new I({alphaG1:e.alpha_g1,betaG2:e.beta_g2,deltaG2:e.delta_g2,gammaAbcG1:e.gamma_abc_g1,gammaG2:e.gamma_g2}),t)}},I=class i{constructor(e){let{alphaG1:t,betaG2:r,deltaG2:s,gammaAbcG1:a,gammaG2:n}=e;this.alphaG1=new c(t),this.betaG2=new d(r),this.deltaG2=new d(s),this.gammaAbcG1=[new c(a[0]),new c(a[1])],this.gammaG2=new d(n)}hash(){let e=new K;return this.serialize(e),$.create().update(e.toUint8Array()).digest()}serialize(e){this.alphaG1.serialize(e),this.betaG2.serialize(e),this.deltaG2.serialize(e),this.gammaAbcG1[0].serialize(e),this.gammaAbcG1[1].serialize(e),this.gammaG2.serialize(e)}static fromGroth16VerificationKeyResponse(e){return new i({alphaG1:e.alpha_g1,betaG2:e.beta_g2,deltaG2:e.delta_g2,gammaAbcG1:e.gamma_abc_g1,gammaG2:e.gamma_g2})}};async function Ue(i){let{aptosConfig:e}=i;try{return await D(async()=>{let t=await q(i),r=await Q(i);return v.create(r,Number(t.max_exp_horizon_secs))},`keyless-configuration-${e.network}`,1e3*60*5)()}catch(t){throw t instanceof l?t:l.fromErrorType({type:25,error:t})}}function ke(i){let{jwt:e,uidKey:t="sub"}=i,r;try{r=W(e)}catch(a){throw l.fromErrorType({type:12,details:`Failed to parse JWT - ${B(a)}`})}if(typeof r.iss!="string")throw l.fromErrorType({type:12,details:"JWT is missing 'iss' in the payload. This should never happen."});if(typeof r.aud!="string")throw l.fromErrorType({type:12,details:"JWT is missing 'aud' in the payload or 'aud' is an array of values."});let s=r[t];return{iss:r.iss,aud:r.aud,uidVal:s}}async function q(i){let{aptosConfig:e,options:t}=i,r="0x1::keyless_account::Configuration";try{let{data:s}=await g({aptosConfig:e,originMethod:"getKeylessConfigurationResource",path:`accounts/${m.from("0x1").toString()}/resource/${r}`,params:{ledger_version:t?.ledgerVersion}});return s.data}catch(s){throw l.fromErrorType({type:22,error:s})}}async function Q(i){let{aptosConfig:e,options:t}=i,r="0x1::keyless_account::Groth16VerificationKey";try{let{data:s}=await g({aptosConfig:e,originMethod:"getGroth16VerificationKeyResource",path:`accounts/${m.from("0x1").toString()}/resource/${r}`,params:{ledger_version:t?.ledgerVersion}});return s.data}catch(s){throw l.fromErrorType({type:23,error:s})}}async function Re(i){let{aptosConfig:e,jwkAddr:t,options:r}=i,s;if(t){let n="0x1::jwks::FederatedJWKs",{data:u}=await g({aptosConfig:e,originMethod:"getKeylessJWKs",path:`accounts/${m.from(t).toString()}/resource/${n}`,params:{ledger_version:r?.ledgerVersion}});s=u}else{let n="0x1::jwks::PatchedJWKs",{data:u}=await g({aptosConfig:e,originMethod:"getKeylessJWKs",path:`accounts/0x1/resource/${n}`,params:{ledger_version:r?.ledgerVersion}});s=u}let a=new Map;for(let n of s.data.jwks.entries){let u=[];for(let j of n.jwks){let{data:L}=j.variant,N=new h(p.fromHexInput(L).toUint8Array()),F=H.deserialize(N);u.push(F)}a.set(T(n.issuer),u)}return a}var H=class i extends y{constructor(e){super();let{kid:t,kty:r,alg:s,e:a,n}=e;this.kid=t,this.kty=r,this.alg=s,this.e=a,this.n=n}serialize(e){e.serializeStr(this.kid),e.serializeStr(this.kty),e.serializeStr(this.alg),e.serializeStr(this.e),e.serializeStr(this.n)}static fromMoveStruct(e){let{data:t}=e.variant,r=new h(p.fromHexInput(t).toUint8Array());return i.deserialize(r)}static deserialize(e){let t=e.deserializeStr(),r=e.deserializeStr(),s=e.deserializeStr(),a=e.deserializeStr(),n=e.deserializeStr();return new i({kid:t,kty:r,alg:s,n:a,e:n})}};function ee(i){try{let e=JSON.parse(i);if(e.kid===void 0)throw new Error("JWT header missing kid");return e}catch{throw new Error("Failed to parse JWT header.")}}export{He as a,Z as b,Y as c,X as d,Te as e,Pe as f,Ce as g,_e as h,G as i,O as j,x as k,A as l,b as m,z as n,v as o,I as p,Ue as q,ke as r,Re as s,H as t,ee as u};
|
|
2
|
+
//# sourceMappingURL=chunk-HVIF6DW6.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as g}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as g}from"./chunk-CPAAEEF4.mjs";import{b as m}from"./chunk-WHVCUVZP.mjs";import{a as p}from"./chunk-MAWGZICD.mjs";import{e as a}from"./chunk-BPHCRTHD.mjs";import{b as d,c as u}from"./chunk-QUJM5W4L.mjs";import{b as y}from"./chunk-LQOSHBB7.mjs";var A=class l{constructor(e){this.signingScheme=3;let{multiKey:i,address:s}=e,n=e.signers.map(t=>t instanceof p?m.fromEd25519Account(t):t);if(i.signaturesRequired>n.length)throw new Error(`Not enough signers provided to satisfy the required signatures. Need ${i.signaturesRequired} signers, but only ${n.length} provided`);if(i.signaturesRequired<n.length)throw new Error(`More signers provided than required. Need ${i.signaturesRequired} signers, but ${n.length} provided`);this.publicKey=i,this.accountAddress=s?y.from(s):this.publicKey.authKey().derivedAddress();let r=[];for(let t of n)r.push(this.publicKey.getIndex(t.getAnyPublicKey()));let o=n.map((t,c)=>[t,r[c]]);o.sort((t,c)=>t[1]-c[1]),this.signers=o.map(t=>t[0]),this.signerIndicies=o.map(t=>t[1]),this.signaturesBitmap=this.publicKey.createBitmap({bits:r})}static fromPublicKeysAndSigners(e){let{publicKeys:i,signaturesRequired:s,signers:n}=e,r=new d({publicKeys:i,signaturesRequired:s});return new l({multiKey:r,signers:n})}static isMultiKeySigner(e){return e instanceof l}signWithAuthenticator(e){return new a(this.publicKey,this.sign(e))}signTransactionWithAuthenticator(e){return new a(this.publicKey,this.signTransaction(e))}async waitForProofFetch(){let i=this.signers.filter(s=>s instanceof g).map(async s=>s.waitForProofFetch());await Promise.all(i)}async checkKeylessAccountValidity(e){let s=this.signers.filter(n=>n instanceof g).map(n=>n.checkKeylessAccountValidity(e));await Promise.all(s)}sign(e){let i=[];for(let s of this.signers)i.push(s.sign(e));return new u({signatures:i,bitmap:this.signaturesBitmap})}signTransaction(e){let i=[];for(let s of this.signers)i.push(s.signTransaction(e));return new u({signatures:i,bitmap:this.signaturesBitmap})}verifySignature(e){let{message:i,signature:s}=e;if(!this.signerIndicies.every((r,o)=>o===0||r>=this.signerIndicies[o-1]))return!1;for(let r=0;r<s.signatures.length;r+=1){let o=s.signatures[r];if(!this.publicKey.publicKeys[this.signerIndicies[r]].verifySignature({message:i,signature:o}))return!1}return!0}};export{A as a};
|
|
2
|
+
//# sourceMappingURL=chunk-HYJQHVDZ.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/account/MultiKeyAccount.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { Account } from \"./Account\";\nimport { MultiKey, MultiKeySignature, PublicKey } from \"../core/crypto\";\nimport { AccountAddress, AccountAddressInput } from \"../core/accountAddress\";\nimport { HexInput, SigningScheme } from \"../types\";\nimport { AccountAuthenticatorMultiKey } from \"../transactions/authenticator/account\";\nimport { AnyRawTransaction } from \"../transactions/types\";\nimport { AbstractKeylessAccount, KeylessSigner } from \"./AbstractKeylessAccount\";\nimport { AptosConfig } from \"../api/aptosConfig\";\nimport { SingleKeyAccount, SingleKeySigner, SingleKeySignerOrLegacyEd25519Account } from \"./SingleKeyAccount\";\nimport { Ed25519Account } from \"./Ed25519Account\";\n\n/**\n * Arguments required to verify a multi-key signature against a given message.\n *\n * @param message - The original message that was signed.\n * @param signature - The multi-key signature to be verified.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\nexport interface VerifyMultiKeySignatureArgs {\n message: HexInput;\n signature: MultiKeySignature;\n}\n\n/**\n * Signer implementation for the MultiKey authentication scheme.\n *\n * This account utilizes an M of N signing scheme, where M and N are specified in the {@link MultiKey}.\n * It signs messages using an array of M accounts, each corresponding to a public key in the {@link MultiKey}.\n *\n * Note: Generating a signer instance does not create the account on-chain.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\nexport class MultiKeyAccount implements Account, KeylessSigner {\n /**\n * Public key associated with the account\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n readonly publicKey: MultiKey;\n\n /**\n * Account address associated with the account\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n readonly accountAddress: AccountAddress;\n\n /**\n * Signing scheme used to sign transactions\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n readonly signingScheme: SigningScheme = SigningScheme.MultiKey;\n\n /**\n * The signers used to sign messages. These signers should correspond to public keys in the\n * MultiKeyAccount's public key. The number of signers should be equal to this.publicKey.signaturesRequired.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n readonly signers: Account[];\n\n /**\n * An array of indices where for signer[i], signerIndicies[i] is the index of the corresponding public key in\n * publicKey.publicKeys. Used to derive the right public key to use for verification.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n // TODO: Rename Indicies to Indices\n readonly signerIndicies: number[];\n\n readonly signaturesBitmap: Uint8Array;\n\n /**\n * Constructs a MultiKeyAccount instance, which requires multiple signatures for transactions.\n *\n * @param args - The arguments for creating a MultiKeyAccount.\n * @param args.multiKey - The multikey of the account consisting of N public keys and a number M representing the required signatures.\n * @param args.signers - An array of M signers that will be used to sign the transaction.\n * @param args.address - An optional account address input. If not provided, the derived address from the public key will be used.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n constructor(args: {\n multiKey: MultiKey;\n signers: SingleKeySignerOrLegacyEd25519Account[];\n address?: AccountAddressInput;\n }) {\n const { multiKey, address } = args;\n\n const signers: SingleKeySigner[] = args.signers.map((signer) =>\n signer instanceof Ed25519Account ? SingleKeyAccount.fromEd25519Account(signer) : signer,\n );\n\n if (multiKey.signaturesRequired > signers.length) {\n throw new Error(\n // eslint-disable-next-line max-len\n `Not enough signers provided to satisfy the required signatures. Need ${multiKey.signaturesRequired} signers, but only ${signers.length} provided`,\n );\n } else if (multiKey.signaturesRequired < signers.length) {\n throw new Error(\n // eslint-disable-next-line max-len\n `More signers provided than required. Need ${multiKey.signaturesRequired} signers, but ${signers.length} provided`,\n );\n }\n\n this.publicKey = multiKey;\n\n this.accountAddress = address ? AccountAddress.from(address) : this.publicKey.authKey().derivedAddress();\n\n // For each signer, find its corresponding position in the MultiKey's public keys array\n const bitPositions: number[] = [];\n for (const signer of signers) {\n bitPositions.push(this.publicKey.getIndex(signer.getAnyPublicKey()));\n }\n\n // Create pairs of [signer, position] and sort them by position\n // This sorting is critical because:\n // 1. The on-chain verification expects signatures to be in ascending order by bit position\n // 2. The bitmap must match the order of signatures when verifying\n const signersAndBitPosition: [Account, number][] = signers.map((signer, index) => [signer, bitPositions[index]]);\n signersAndBitPosition.sort((a, b) => a[1] - b[1]);\n\n // Extract the sorted signers and their positions into separate arrays\n this.signers = signersAndBitPosition.map((value) => value[0]);\n this.signerIndicies = signersAndBitPosition.map((value) => value[1]);\n\n // Create a bitmap representing which public keys from the MultiKey are being used\n // This bitmap is used during signature verification to identify which public keys\n // should be used to verify each signature\n this.signaturesBitmap = this.publicKey.createBitmap({ bits: bitPositions });\n }\n\n /**\n * Static constructor to create a MultiKeyAccount using the provided public keys and signers.\n *\n * @param args - The arguments for creating a MultiKeyAccount.\n * @param args.publicKeys - The N public keys of the MultiKeyAccount.\n * @param args.signaturesRequired - The number of signatures required to authorize a transaction.\n * @param args.signers - An array of M signers that will be used to sign the transaction.\n * @returns MultiKeyAccount - The newly created MultiKeyAccount.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n static fromPublicKeysAndSigners(args: {\n publicKeys: PublicKey[];\n signaturesRequired: number;\n signers: SingleKeySignerOrLegacyEd25519Account[];\n }): MultiKeyAccount {\n const { publicKeys, signaturesRequired, signers } = args;\n const multiKey = new MultiKey({ publicKeys, signaturesRequired });\n return new MultiKeyAccount({ multiKey, signers });\n }\n\n /**\n * Determines if the provided account is a multi-key account.\n *\n * @param account - The account to check.\n * @returns A boolean indicating whether the account is a multi-key account.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n static isMultiKeySigner(account: Account): account is MultiKeyAccount {\n return account instanceof MultiKeyAccount;\n }\n\n /**\n * Sign a message using the account's signers and return an AccountAuthenticator containing the signature along with the\n * account's public key.\n * @param message - The signing message, represented as binary input in hexadecimal format.\n * @returns An instance of AccountAuthenticatorMultiKey that includes the signature and the public key.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n signWithAuthenticator(message: HexInput): AccountAuthenticatorMultiKey {\n return new AccountAuthenticatorMultiKey(this.publicKey, this.sign(message));\n }\n\n /**\n * Sign a transaction using the account's signers, returning an AccountAuthenticator that contains the signature and the\n * account's public key.\n * @param transaction - The raw transaction to be signed.\n * @returns An AccountAuthenticatorMultiKey containing the signature of the transaction along with the account's public key.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n signTransactionWithAuthenticator(transaction: AnyRawTransaction): AccountAuthenticatorMultiKey {\n return new AccountAuthenticatorMultiKey(this.publicKey, this.signTransaction(transaction));\n }\n\n /**\n * Waits for any proofs on KeylessAccount signers to be fetched. This ensures that signing with the KeylessAccount does not\n * fail due to missing proofs.\n * @return {Promise<void>} A promise that resolves when all proofs have been fetched.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n async waitForProofFetch(): Promise<void> {\n const keylessSigners = this.signers.filter(\n (signer) => signer instanceof AbstractKeylessAccount,\n ) as AbstractKeylessAccount[];\n const promises = keylessSigners.map(async (signer) => signer.waitForProofFetch());\n await Promise.all(promises);\n }\n\n /**\n * Validates that the Keyless Account can be used to sign transactions.\n * @return\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n async checkKeylessAccountValidity(aptosConfig: AptosConfig): Promise<void> {\n const keylessSigners = this.signers.filter(\n (signer) => signer instanceof AbstractKeylessAccount,\n ) as AbstractKeylessAccount[];\n const promises = keylessSigners.map((signer) => signer.checkKeylessAccountValidity(aptosConfig));\n await Promise.all(promises);\n }\n\n /**\n * Sign the given message using the MultiKeyAccount's signers\n * @param data - The data to be signed in HexInput format.\n * @returns MultiKeySignature\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n sign(data: HexInput): MultiKeySignature {\n const signatures = [];\n for (const signer of this.signers) {\n signatures.push(signer.sign(data));\n }\n return new MultiKeySignature({ signatures, bitmap: this.signaturesBitmap });\n }\n\n /**\n * Sign the given transaction using the MultiKeyAccount's signers.\n * This function aggregates signatures from all signers associated with the MultiKeyAccount.\n *\n * @param transaction - The transaction to be signed.\n * @returns MultiKeySignature - An object containing the aggregated signatures and a bitmap of the signatures.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n signTransaction(transaction: AnyRawTransaction): MultiKeySignature {\n const signatures = [];\n for (const signer of this.signers) {\n signatures.push(signer.signTransaction(transaction));\n }\n return new MultiKeySignature({ signatures, bitmap: this.signaturesBitmap });\n }\n\n /**\n * Verify the given message and signature with the public keys.\n *\n * This function checks if the provided signatures are valid for the given message using the corresponding public keys.\n *\n * @param args - The arguments for verifying the signature.\n * @param args.message - The raw message data in HexInput format.\n * @param args.signature - The signed message MultiKeySignature containing multiple signatures.\n * @returns A boolean indicating whether the signatures are valid for the message.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n verifySignature(args: VerifyMultiKeySignatureArgs): boolean {\n const { message, signature } = args;\n const isSignerIndicesSorted = this.signerIndicies.every(\n (value, i) => i === 0 || value >= this.signerIndicies[i - 1],\n );\n if (!isSignerIndicesSorted) {\n return false;\n }\n for (let i = 0; i < signature.signatures.length; i += 1) {\n const singleSignature = signature.signatures[i];\n const publicKey = this.publicKey.publicKeys[this.signerIndicies[i]];\n if (!publicKey.verifySignature({ message, signature: singleSignature })) {\n return false;\n }\n }\n return true;\n }\n}\n"],"mappings":"6PAqCO,IAAMA,EAAN,MAAMC,CAAkD,CAmD7D,YAAYC,EAIT,CAnCH,KAAS,cAA+B,EAoCtC,GAAM,CAAE,SAAAC,EAAU,QAAAC,CAAQ,EAAIF,EAExBG,EAA6BH,EAAK,QAAQ,IAAKI,GACnDA,aAAkBC,EAAiBC,EAAiB,mBAAmBF,CAAM,EAAIA,CACnF,EAEA,GAAIH,EAAS,mBAAqBE,EAAQ,OACxC,MAAM,IAAI,MAER,wEAAwEF,EAAS,kBAAkB,sBAAsBE,EAAQ,MAAM,WACzI,EACK,GAAIF,EAAS,mBAAqBE,EAAQ,OAC/C,MAAM,IAAI,MAER,6CAA6CF,EAAS,kBAAkB,iBAAiBE,EAAQ,MAAM,WACzG,EAGF,KAAK,UAAYF,EAEjB,KAAK,eAAiBC,EAAUK,EAAe,KAAKL,CAAO,EAAI,KAAK,UAAU,QAAQ,EAAE,eAAe,EAGvG,IAAMM,EAAyB,CAAC,EAChC,QAAWJ,KAAUD,EACnBK,EAAa,KAAK,KAAK,UAAU,SAASJ,EAAO,gBAAgB,CAAC,CAAC,EAOrE,IAAMK,EAA6CN,EAAQ,IAAI,CAACC,EAAQM,IAAU,CAACN,EAAQI,EAAaE,CAAK,CAAC,CAAC,EAC/GD,EAAsB,KAAK,CAACE,EAAGC,IAAMD,EAAE,CAAC,EAAIC,EAAE,CAAC,CAAC,EAGhD,KAAK,QAAUH,EAAsB,IAAKI,GAAUA,EAAM,CAAC,CAAC,EAC5D,KAAK,eAAiBJ,EAAsB,IAAKI,GAAUA,EAAM,CAAC,CAAC,EAKnE,KAAK,iBAAmB,KAAK,UAAU,aAAa,CAAE,KAAML,CAAa,CAAC,CAC5E,CAaA,OAAO,yBAAyBR,EAIZ,CAClB,GAAM,CAAE,WAAAc,EAAY,mBAAAC,EAAoB,QAAAZ,CAAQ,EAAIH,EAC9CC,EAAW,IAAIe,EAAS,CAAE,WAAAF,EAAY,mBAAAC,CAAmB,CAAC,EAChE,OAAO,IAAIhB,EAAgB,CAAE,SAAAE,EAAU,QAAAE,CAAQ,CAAC,CAClD,CAUA,OAAO,iBAAiBc,EAA8C,CACpE,OAAOA,aAAmBlB,CAC5B,CAUA,sBAAsBmB,EAAiD,CACrE,OAAO,IAAIC,EAA6B,KAAK,UAAW,KAAK,KAAKD,CAAO,CAAC,CAC5E,CAUA,iCAAiCE,EAA8D,CAC7F,OAAO,IAAID,EAA6B,KAAK,UAAW,KAAK,gBAAgBC,CAAW,CAAC,CAC3F,CASA,MAAM,mBAAmC,CAIvC,IAAMC,EAHiB,KAAK,QAAQ,OACjCjB,GAAWA,aAAkBkB,CAChC,EACgC,IAAI,MAAOlB,GAAWA,EAAO,kBAAkB,CAAC,EAChF,MAAM,QAAQ,IAAIiB,CAAQ,CAC5B,CAQA,MAAM,4BAA4BE,EAAyC,CAIzE,IAAMF,EAHiB,KAAK,QAAQ,OACjCjB,GAAWA,aAAkBkB,CAChC,EACgC,IAAKlB,GAAWA,EAAO,4BAA4BmB,CAAW,CAAC,EAC/F,MAAM,QAAQ,IAAIF,CAAQ,CAC5B,CASA,KAAKG,EAAmC,CACtC,IAAMC,EAAa,CAAC,EACpB,QAAWrB,KAAU,KAAK,QACxBqB,EAAW,KAAKrB,EAAO,KAAKoB,CAAI,CAAC,EAEnC,OAAO,IAAIE,EAAkB,CAAE,WAAAD,EAAY,OAAQ,KAAK,gBAAiB,CAAC,CAC5E,CAWA,gBAAgBL,EAAmD,CACjE,IAAMK,EAAa,CAAC,EACpB,QAAWrB,KAAU,KAAK,QACxBqB,EAAW,KAAKrB,EAAO,gBAAgBgB,CAAW,CAAC,EAErD,OAAO,IAAIM,EAAkB,CAAE,WAAAD,EAAY,OAAQ,KAAK,gBAAiB,CAAC,CAC5E,CAcA,gBAAgBzB,EAA4C,CAC1D,GAAM,CAAE,QAAAkB,EAAS,UAAAS,CAAU,EAAI3B,EAI/B,GAAI,CAH0B,KAAK,eAAe,MAChD,CAACa,EAAOe,IAAMA,IAAM,GAAKf,GAAS,KAAK,eAAee,EAAI,CAAC,CAC7D,EAEE,MAAO,GAET,QAASA,EAAI,EAAGA,EAAID,EAAU,WAAW,OAAQC,GAAK,EAAG,CACvD,IAAMC,EAAkBF,EAAU,WAAWC,CAAC,EAE9C,GAAI,CADc,KAAK,UAAU,WAAW,KAAK,eAAeA,CAAC,CAAC,EACnD,gBAAgB,CAAE,QAAAV,EAAS,UAAWW,CAAgB,CAAC,EACpE,MAAO,EAEX,CACA,MAAO,EACT,CACF","names":["MultiKeyAccount","_MultiKeyAccount","args","multiKey","address","signers","signer","Ed25519Account","SingleKeyAccount","AccountAddress","bitPositions","signersAndBitPosition","index","a","b","value","publicKeys","signaturesRequired","MultiKey","account","message","AccountAuthenticatorMultiKey","transaction","promises","AbstractKeylessAccount","aptosConfig","data","signatures","MultiKeySignature","signature","i","singleSignature"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as s}from"./chunk-LQOSHBB7.mjs";import{E as r}from"./chunk-R6QCPXQG.mjs";function o(i){let e=i.deserializeUleb128AsU32();if(!Object.values(r).includes(e))throw new Error(`Deserialization of Account failed: SigningScheme variant ${e} is invalid`);return{address:s.deserialize(i),signingScheme:e}}export{o as a};
|
|
2
|
+
//# sourceMappingURL=chunk-ILUFGYLO.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as r}from"./chunk-RIINVEZA.mjs";import{a as m,c as a,d as f}from"./chunk-HHWJHOFZ.mjs";import{a as i,b as o,c as u,d as s,e as p,f as c,g as y}from"./chunk-TKXEVD7A.mjs";import{b as g}from"./chunk-LQOSHBB7.mjs";function D(n){return typeof n=="boolean"}function A(n){return typeof n=="string"}function F(n){return typeof n=="number"}function M(n){if(F(n))return n;if(A(n)&&n!=="")return Number.parseInt(n,10)}function N(n){return typeof n=="number"||typeof n=="bigint"||typeof n=="string"}function G(n){return n==null}function P(n){return T(n)||x(n)||S(n)||B(n)||U(n)||b(n)||I(n)||E(n)||l(n)||d(n)||n instanceof m||n instanceof f}function T(n){return n instanceof i}function E(n){return n instanceof g}function l(n){return n instanceof a}function d(n){return n instanceof r}function x(n){return n instanceof o}function S(n){return n instanceof u}function B(n){return n instanceof s}function U(n){return n instanceof p}function b(n){return n instanceof c}function I(n){return n instanceof y}function w(n){return"bytecode"in n}function O(n,t){throw new Error(`Type mismatch for argument ${t}, expected '${n}'`)}function R(n){let t=n.params.findIndex(e=>e!=="signer"&&e!=="&signer");return t<0?n.params.length:t}export{D as a,A as b,F as c,M as d,N as e,G as f,P as g,T as h,E as i,l as j,d as k,x as l,S as m,B as n,U as o,b as p,I as q,w as r,O as s,R as t};
|
|
2
|
+
//# sourceMappingURL=chunk-IMYNN4TW.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as t}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as t}from"./chunk-MFLHAVIW.mjs";import{a as o,b as r,c as s}from"./chunk-RDPWCN4B.mjs";var a=class{constructor(e){this.config=e}async getTableItem(e){return o({aptosConfig:this.config,...e})}async getTableItemsData(e){return await t({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"default_processor"}),r({aptosConfig:this.config,...e})}async getTableItemsMetadata(e){return await t({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"default_processor"}),s({aptosConfig:this.config,...e})}};export{a};
|
|
2
|
+
//# sourceMappingURL=chunk-IOHESHLR.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as m}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as m}from"./chunk-DOVH6HPL.mjs";import{e as h,j as d}from"./chunk-C3Q23D22.mjs";import{a as u}from"./chunk-7CRQNXR5.mjs";import{a as f}from"./chunk-H4YAL2IL.mjs";import{a as S}from"./chunk-A3VO773Q.mjs";import{a as g}from"./chunk-RXHER6EA.mjs";import{b as s}from"./chunk-VHY6ZATX.mjs";import{sha3_256 as H}from"@noble/hashes/sha3";import{secp256k1 as y}from"@noble/curves/secp256k1";import{HDKey as A}from"@scure/bip32";var i=class i extends f{constructor(e){super();let t=s.fromHexInput(e),{length:r}=t.toUint8Array();if(r===i.LENGTH)this.key=t;else if(r===i.COMPRESSED_LENGTH){let o=y.ProjectivePoint.fromHex(t.toUint8Array());this.key=s.fromHexInput(o.toRawBytes(!1))}else throw new Error(`PublicKey length should be ${i.LENGTH} or ${i.COMPRESSED_LENGTH}, received ${r}`)}verifySignature(e){let{message:t,signature:r}=e,o=m(t),c=s.fromHexInput(o).toUint8Array(),x=H(c),P=r.toUint8Array();return y.verify(P,x,this.key.toUint8Array(),{lowS:!0})}toUint8Array(){return this.key.toUint8Array()}serialize(e){e.serializeBytes(this.key.toUint8Array())}deserialize(e){let t=e.deserializeBytes();return new l(t)}static deserialize(e){let t=e.deserializeBytes();return new i(t)}static isPublicKey(e){return e instanceof i}static isInstance(e){return"key"in e&&e.key?.data?.length===i.LENGTH}};i.LENGTH=65,i.COMPRESSED_LENGTH=33;var p=i,n=class n extends g{constructor(e,t){super();let r=u.parseHexInput(e,"secp256k1",t);if(r.toUint8Array().length!==n.LENGTH)throw new Error(`PrivateKey length should be ${n.LENGTH}`);this.key=r}static generate(){let e=y.utils.randomPrivateKey();return new n(e,!1)}static fromDerivationPath(e,t){if(!h(e))throw new Error(`Invalid derivation path ${e}`);return n.fromDerivationPathInner(e,d(t))}static fromDerivationPathInner(e,t){let{privateKey:r}=A.fromMasterSeed(t).derive(e);if(r===null)throw new Error("Invalid key");return new n(r,!1)}sign(e){let t=m(e),r=s.fromHexInput(t),o=H(r.toUint8Array()),c=y.sign(o,this.key.toUint8Array(),{lowS:!0});return new l(c.toCompactRawBytes())}publicKey(){let e=y.getPublicKey(this.key.toUint8Array(),!1);return new p(e)}toUint8Array(){return this.key.toUint8Array()}toString(){return this.toHexString()}toHexString(){return this.key.toString()}toAIP80String(){return u.formatPrivateKey(this.key.toString(),"secp256k1")}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let t=e.deserializeBytes();return new n(t,!1)}static isPrivateKey(e){return e instanceof n}};n.LENGTH=32;var v=n,a=class a extends S{constructor(e){super();let t=s.fromHexInput(e);if(t.toUint8Array().length!==a.LENGTH)throw new Error(`Signature length should be ${a.LENGTH}, received ${t.toUint8Array().length}`);this.data=t}toUint8Array(){return this.data.toUint8Array()}serialize(e){e.serializeBytes(this.data.toUint8Array())}static deserialize(e){let t=e.deserializeBytes();return new a(t)}};a.LENGTH=64;var l=a;export{p as a,v as b,l as c};
|
|
2
|
+
//# sourceMappingURL=chunk-JNNFNYDO.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as a}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{c as a}from"./chunk-KK5HUWF6.mjs";import{u as n}from"./chunk-VHNX2NUR.mjs";import{b as s}from"./chunk-LQOSHBB7.mjs";async function d(e){let{aptosConfig:o,options:t}=e,r={query:n,variables:{where_condition:t?.where,offset:t?.offset,limit:t?.limit,order_by:t?.orderBy}};return(await a({aptosConfig:o,query:r,originMethod:"getObjectData"})).current_objects}async function f(e){let{aptosConfig:o,objectAddress:t,options:r}=e,c={object_address:{_eq:s.from(t).toStringLong()}};return(await d({aptosConfig:o,options:{...r,where:c}}))[0]}export{d as a,f as b};
|
|
2
|
+
//# sourceMappingURL=chunk-K233I26C.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{l as c,v as n}from"./chunk-VHNX2NUR.mjs";import{c as
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{l as c,v as n}from"./chunk-VHNX2NUR.mjs";import{c as i}from"./chunk-SJDHW55X.mjs";import{e as p}from"./chunk-752TOOCA.mjs";async function d(o){let{aptosConfig:s}=o,{data:e}=await i({aptosConfig:s,originMethod:"getLedgerInfo",path:""});return e}async function C(o){let{aptosConfig:s,limit:e}=o;return(await a({aptosConfig:s,query:{query:c,variables:{limit:e}},originMethod:"getChainTopUserTransactions"})).user_transactions}async function a(o){let{aptosConfig:s,query:e,originMethod:t}=o,{data:r}=await p({aptosConfig:s,originMethod:t??"queryIndexer",path:"",body:e,overrides:{WITH_CREDENTIALS:!1}});return r}async function u(o){let{aptosConfig:s}=o;return(await a({aptosConfig:s,query:{query:n},originMethod:"getProcessorStatuses"})).processor_status}async function h(o){let s=await u({aptosConfig:o.aptosConfig});return BigInt(s[0].last_success_version)}async function T(o){let{aptosConfig:s,processorType:e}=o;return(await a({aptosConfig:s,query:{query:n,variables:{where_condition:{processor:{_eq:e}}}},originMethod:"getProcessorStatus"})).processor_status[0]}export{d as a,C as b,a as c,u as d,h as e,T as f};
|
|
2
|
+
//# sourceMappingURL=chunk-KK5HUWF6.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as o,b as n,c as i,d as r,e as t}from"./chunk-4RXKALLC.mjs";import u,{bcsRequest as f}from"@aptos-labs/aptos-client";var s=class{constructor(e){this.network=e?.network??"devnet",this.fullnode=e?.fullnode,this.faucet=e?.faucet,this.pepper=e?.pepper,this.prover=e?.prover,this.indexer=e?.indexer,this.client=e?.client??{provider:u,binaryProvider:f},this.clientConfig=e?.clientConfig??{},this.fullnodeConfig=e?.fullnodeConfig??{},this.indexerConfig=e?.indexerConfig??{},this.faucetConfig=e?.faucetConfig??{}}getRequestUrl(e){switch(e){case"Fullnode":if(this.fullnode!==void 0)return this.fullnode;if(this.network==="custom")throw new Error("Please provide a custom full node url");return n[this.network];case"Faucet":if(this.faucet!==void 0)return this.faucet;if(this.network==="testnet")throw new Error("There is no way to programmatically mint testnet APT, you must use the minting site at https://aptos.dev/network/faucet");if(this.network==="mainnet")throw new Error("There is no mainnet faucet");if(this.network==="custom")throw new Error("Please provide a custom faucet url");return i[this.network];case"Indexer":if(this.indexer!==void 0)return this.indexer;if(this.network==="custom")throw new Error("Please provide a custom indexer url");return o[this.network];case"Pepper":if(this.pepper!==void 0)return this.pepper;if(this.network==="custom")throw new Error("Please provide a custom pepper service url");return r[this.network];case"Prover":if(this.prover!==void 0)return this.prover;if(this.network==="custom")throw new Error("Please provide a custom prover service url");return t[this.network];default:throw Error(`apiType ${e} is not supported`)}}isPepperServiceRequest(e){return r[this.network]===e}isProverServiceRequest(e){return t[this.network]===e}};export{s as a};
|
|
2
|
+
//# sourceMappingURL=chunk-KSLLV3ZC.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/api/aptosConfig.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport aptosClient, { bcsRequest } from \"@aptos-labs/aptos-client\";\nimport { AptosSettings, ClientConfig, Client, FullNodeConfig, IndexerConfig, FaucetConfig } from \"../types\";\nimport {\n NetworkToNodeAPI,\n NetworkToFaucetAPI,\n NetworkToIndexerAPI,\n Network,\n NetworkToPepperAPI,\n NetworkToProverAPI,\n} from \"../utils/apiEndpoints\";\nimport { AptosApiType } from \"../utils/const\";\n\n/**\n * Represents the configuration settings for an Aptos SDK client instance.\n * This class allows customization of various endpoints and client settings.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * async function runExample() {\n * // Create a configuration for connecting to the Aptos testnet\n * const config = new AptosConfig({ network: Network.TESTNET });\n *\n * // Initialize the Aptos client with the configuration\n * const aptos = new Aptos(config);\n *\n * console.log(\"Aptos client initialized:\", aptos);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Client\n */\nexport class AptosConfig {\n /**\n * The Network that this SDK is associated with. Defaults to DEVNET\n * @group Client\n */\n readonly network: Network;\n\n /**\n * The client instance the SDK uses. Defaults to `@aptos-labs/aptos-client\n * @group Client\n */\n readonly client: Client;\n\n /**\n * The optional hardcoded fullnode URL to send requests to instead of using the network\n * @group Client\n */\n readonly fullnode?: string;\n\n /**\n * The optional hardcoded faucet URL to send requests to instead of using the network\n * @group Client\n */\n readonly faucet?: string;\n\n /**\n * The optional hardcoded pepper service URL to send requests to instead of using the network\n * @group Client\n */\n readonly pepper?: string;\n\n /**\n * The optional hardcoded prover service URL to send requests to instead of using the network\n * @group Client\n */\n readonly prover?: string;\n\n /**\n * The optional hardcoded indexer URL to send requests to instead of using the network\n * @group Client\n */\n readonly indexer?: string;\n\n /**\n * Optional client configurations\n * @group Client\n */\n readonly clientConfig?: ClientConfig;\n\n /**\n * Optional specific Fullnode configurations\n * @group Client\n */\n readonly fullnodeConfig?: FullNodeConfig;\n\n /**\n * Optional specific Indexer configurations\n * @group Client\n */\n readonly indexerConfig?: IndexerConfig;\n\n /**\n * Optional specific Faucet configurations\n * @group Client\n */\n readonly faucetConfig?: FaucetConfig;\n\n /**\n * Initializes an instance of the Aptos client with the specified settings.\n * This allows users to configure various aspects of the client, such as network and endpoints.\n *\n * @param settings - Optional configuration settings for the Aptos client.\n * @param settings.network - The network to connect to, defaults to `Network.DEVNET`.\n * @param settings.fullnode - The fullnode endpoint to use for requests.\n * @param settings.faucet - The faucet endpoint for obtaining test tokens.\n * @param settings.pepper - The pepper used for transaction signing.\n * @param settings.prover - The prover endpoint for transaction verification.\n * @param settings.indexer - The indexer endpoint for querying blockchain data.\n * @param settings.client - Custom client settings, defaults to a standard Aptos client.\n * @param settings.clientConfig - Additional configuration for the client.\n * @param settings.fullnodeConfig - Additional configuration for the fullnode.\n * @param settings.indexerConfig - Additional configuration for the indexer.\n * @param settings.faucetConfig - Additional configuration for the faucet.\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 default settings\n * const config = new AptosConfig({ network: Network.TESTNET }); // Specify the network\n * const aptos = new Aptos(config);\n *\n * console.log(\"Aptos client initialized:\", aptos);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Client\n */\n constructor(settings?: AptosSettings) {\n this.network = settings?.network ?? Network.DEVNET;\n this.fullnode = settings?.fullnode;\n this.faucet = settings?.faucet;\n this.pepper = settings?.pepper;\n this.prover = settings?.prover;\n this.indexer = settings?.indexer;\n this.client = settings?.client ?? { provider: aptosClient, binaryProvider: bcsRequest };\n this.clientConfig = settings?.clientConfig ?? {};\n this.fullnodeConfig = settings?.fullnodeConfig ?? {};\n this.indexerConfig = settings?.indexerConfig ?? {};\n this.faucetConfig = settings?.faucetConfig ?? {};\n }\n\n /**\n * Returns the URL endpoint to send the request to based on the specified API type.\n * If a custom URL was provided in the configuration, that URL is returned. Otherwise, the URL endpoint is derived from the network.\n *\n * @param apiType - The type of Aptos API to get the URL for. This can be one of the following: FULLNODE, FAUCET, INDEXER, PEPPER, PROVER.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network, AptosApiType } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Getting the request URL for the FULLNODE API\n * const url = config.getRequestUrl(AptosApiType.FULLNODE);\n * console.log(\"Request URL for FULLNODE:\", url);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Client\n */\n getRequestUrl(apiType: AptosApiType): string {\n switch (apiType) {\n case AptosApiType.FULLNODE:\n if (this.fullnode !== undefined) return this.fullnode;\n if (this.network === Network.CUSTOM) throw new Error(\"Please provide a custom full node url\");\n return NetworkToNodeAPI[this.network];\n case AptosApiType.FAUCET:\n if (this.faucet !== undefined) return this.faucet;\n if (this.network === Network.TESTNET) {\n throw new Error(\n \"There is no way to programmatically mint testnet APT, you must use the minting site at https://aptos.dev/network/faucet\",\n );\n }\n if (this.network === Network.MAINNET) {\n throw new Error(\"There is no mainnet faucet\");\n }\n if (this.network === Network.CUSTOM) throw new Error(\"Please provide a custom faucet url\");\n return NetworkToFaucetAPI[this.network];\n case AptosApiType.INDEXER:\n if (this.indexer !== undefined) return this.indexer;\n if (this.network === Network.CUSTOM) throw new Error(\"Please provide a custom indexer url\");\n return NetworkToIndexerAPI[this.network];\n case AptosApiType.PEPPER:\n if (this.pepper !== undefined) return this.pepper;\n if (this.network === Network.CUSTOM) throw new Error(\"Please provide a custom pepper service url\");\n return NetworkToPepperAPI[this.network];\n case AptosApiType.PROVER:\n if (this.prover !== undefined) return this.prover;\n if (this.network === Network.CUSTOM) throw new Error(\"Please provide a custom prover service url\");\n return NetworkToProverAPI[this.network];\n default:\n throw Error(`apiType ${apiType} is not supported`);\n }\n }\n\n /**\n * Checks if the provided URL is a known pepper service endpoint.\n *\n * @param url - The URL to check against the known pepper service endpoints.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * const url = \"https://example.pepper.service\"; // replace with a real pepper service URL\n *\n * // Check if the URL is a known pepper service endpoint\n * const isPepperService = config.isPepperServiceRequest(url);\n *\n * console.log(`Is the URL a known pepper service? ${isPepperService}`);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Client\n */\n isPepperServiceRequest(url: string): boolean {\n return NetworkToPepperAPI[this.network] === url;\n }\n\n /**\n * Checks if the provided URL is a known prover service endpoint.\n *\n * @param url - The URL to check against known prover service endpoints.\n * @returns A boolean indicating whether the URL is a known prover service endpoint.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * // Check if the URL is a known prover service endpoint\n * const url = \"https://prover.testnet.aptos.dev\"; // replace with a real URL if needed\n * const isProver = config.isProverServiceRequest(url);\n *\n * console.log(`Is the URL a known prover service? ${isProver}`);\n * ```\n * @group Client\n */\n isProverServiceRequest(url: string): boolean {\n return NetworkToProverAPI[this.network] === url;\n }\n}\n"],"mappings":"qEAGA,OAAOA,GAAe,cAAAC,MAAkB,2BAiCjC,IAAMC,EAAN,KAAkB,CAmGvB,YAAYC,EAA0B,CACpC,KAAK,QAAUA,GAAU,SAAW,SACpC,KAAK,SAAWA,GAAU,SAC1B,KAAK,OAASA,GAAU,OACxB,KAAK,OAASA,GAAU,OACxB,KAAK,OAASA,GAAU,OACxB,KAAK,QAAUA,GAAU,QACzB,KAAK,OAASA,GAAU,QAAU,CAAE,SAAUC,EAAa,eAAgBC,CAAW,EACtF,KAAK,aAAeF,GAAU,cAAgB,CAAC,EAC/C,KAAK,eAAiBA,GAAU,gBAAkB,CAAC,EACnD,KAAK,cAAgBA,GAAU,eAAiB,CAAC,EACjD,KAAK,aAAeA,GAAU,cAAgB,CAAC,CACjD,CAwBA,cAAcG,EAA+B,CAC3C,OAAQA,EAAS,CACf,eACE,GAAI,KAAK,WAAa,OAAW,OAAO,KAAK,SAC7C,GAAI,KAAK,UAAY,SAAgB,MAAM,IAAI,MAAM,uCAAuC,EAC5F,OAAOC,EAAiB,KAAK,OAAO,EACtC,aACE,GAAI,KAAK,SAAW,OAAW,OAAO,KAAK,OAC3C,GAAI,KAAK,UAAY,UACnB,MAAM,IAAI,MACR,yHACF,EAEF,GAAI,KAAK,UAAY,UACnB,MAAM,IAAI,MAAM,4BAA4B,EAE9C,GAAI,KAAK,UAAY,SAAgB,MAAM,IAAI,MAAM,oCAAoC,EACzF,OAAOC,EAAmB,KAAK,OAAO,EACxC,cACE,GAAI,KAAK,UAAY,OAAW,OAAO,KAAK,QAC5C,GAAI,KAAK,UAAY,SAAgB,MAAM,IAAI,MAAM,qCAAqC,EAC1F,OAAOC,EAAoB,KAAK,OAAO,EACzC,aACE,GAAI,KAAK,SAAW,OAAW,OAAO,KAAK,OAC3C,GAAI,KAAK,UAAY,SAAgB,MAAM,IAAI,MAAM,4CAA4C,EACjG,OAAOC,EAAmB,KAAK,OAAO,EACxC,aACE,GAAI,KAAK,SAAW,OAAW,OAAO,KAAK,OAC3C,GAAI,KAAK,UAAY,SAAgB,MAAM,IAAI,MAAM,4CAA4C,EACjG,OAAOC,EAAmB,KAAK,OAAO,EACxC,QACE,MAAM,MAAM,WAAWL,CAAO,mBAAmB,CACrD,CACF,CA0BA,uBAAuBM,EAAsB,CAC3C,OAAOF,EAAmB,KAAK,OAAO,IAAME,CAC9C,CAuBA,uBAAuBA,EAAsB,CAC3C,OAAOD,EAAmB,KAAK,OAAO,IAAMC,CAC9C,CACF","names":["aptosClient","bcsRequest","AptosConfig","settings","aptosClient","bcsRequest","apiType","NetworkToNodeAPI","NetworkToFaucetAPI","NetworkToIndexerAPI","NetworkToPepperAPI","NetworkToProverAPI","url"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as h}from"./chunk-ZS2IVRHT.mjs";import{a as T}from"./chunk-GTVMJJQQ.mjs";import{a as f}from"./chunk-OLGEN23M.mjs";import{a as d}from"./chunk-B23VO5TB.mjs";import{d as c,e as u,f as g,i as m,j as p,k as y,l as A}from"./chunk-53IBOHXB.mjs";import{a,b as o,c as i,d as s,e,g as r}from"./chunk-GRRBXHVG.mjs";var P=class{constructor(n){this.config=n,this.build=new f(this.config),this.simulate=new h(this.config),this.submit=new T(this.config),this.batch=new d(this.config)}async getTransactions(n){return a({aptosConfig:this.config,...n})}async getTransactionByVersion(n){return i({aptosConfig:this.config,...n})}async getTransactionByHash(n){return s({aptosConfig:this.config,...n})}async isPendingTransaction(n){return e({aptosConfig:this.config,...n})}async waitForTransaction(n){return r({aptosConfig:this.config,...n})}async getGasPriceEstimation(){return o({aptosConfig:this.config})}getSigningMessage(n){return c(n)}async publishPackageTransaction(n){return y({aptosConfig:this.config,...n})}async rotateAuthKey(n){return A({aptosConfig:this.config,...n})}sign(n){return u({...n})}signAsFeePayer(n){return g({...n})}async batchTransactionsForSingleAccount(n){try{let{sender:t,data:l,options:b}=n;this.batch.forSingleAccount({sender:t,data:l,options:b})}catch(t){throw new Error(`failed to submit transactions with error: ${t}`)}}async signAndSubmitTransaction(n){return m({aptosConfig:this.config,...n})}async signAndSubmitAsFeePayer(n){return p({aptosConfig:this.config,...n})}};export{P as a};
|
|
2
|
+
//# sourceMappingURL=chunk-L6KVC7CJ.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as d}from"./chunk-
|
|
1
|
+
import{a as d}from"./chunk-RXHER6EA.mjs";import{a as i}from"./chunk-IF4UU2MT.mjs";import{bytesToHex as c,hexToBytes as h}from"@noble/hashes/utils";var u=(s=>(s.INCORRECT_NUMBER_OF_BYTES="incorrect_number_of_bytes",s.INVALID_HEX_CHARS="invalid_hex_chars",s.TOO_SHORT="too_short",s.TOO_LONG="too_long",s.LEADING_ZERO_X_REQUIRED="leading_zero_x_required",s.LONG_FORM_REQUIRED_UNLESS_SPECIAL="long_form_required_unless_special",s.INVALID_PADDING_ZEROES="INVALID_PADDING_ZEROES",s.INVALID_PADDING_STRICTNESS="INVALID_PADDING_STRICTNESS",s))(u||{}),e=class e extends d{constructor(t){if(super(),t.length!==e.LENGTH)throw new i("AccountAddress data should be exactly 32 bytes long","incorrect_number_of_bytes");this.data=t}isSpecial(){return this.data.slice(0,this.data.length-1).every(t=>t===0)&&this.data[this.data.length-1]<16}toString(){return`0x${this.toStringWithoutPrefix()}`}toStringWithoutPrefix(){let t=c(this.data);return this.isSpecial()&&(t=t[t.length-1]),t}toStringLong(){return`0x${this.toStringLongWithoutPrefix()}`}toStringLongWithoutPrefix(){return c(this.data)}toUint8Array(){return this.data}serialize(t){t.serializeFixedBytes(this.data)}serializeForEntryFunction(t){let r=this.bcsToBytes();t.serializeBytes(r)}serializeForScriptFunction(t){t.serializeU32AsUleb128(3),t.serialize(this)}static deserialize(t){let r=t.deserializeFixedBytes(e.LENGTH);return new e(r)}static fromStringStrict(t){if(!t.startsWith("0x"))throw new i("Hex string must start with a leading 0x.","leading_zero_x_required");let r=e.fromString(t);if(t.length!==e.LONG_STRING_LENGTH+2)if(r.isSpecial()){if(t.length!==3)throw new i(`The given hex string ${t} is a special address not in LONG form, it must be 0x0 to 0xf without padding zeroes.`,"INVALID_PADDING_ZEROES")}else throw new i(`The given hex string ${t} is not a special address, it must be represented as 0x + 64 chars.`,"long_form_required_unless_special");return r}static fromString(t,{maxMissingChars:r=4}={}){let n=t;if(t.startsWith("0x")&&(n=t.slice(2)),n.length===0)throw new i("Hex string is too short, must be 1 to 64 chars long, excluding the leading 0x.","too_short");if(n.length>64)throw new i("Hex string is too long, must be 1 to 64 chars long, excluding the leading 0x.","too_long");if(r>63||r<0)throw new i(`maxMissingChars must be between or equal to 0 and 63. Received ${r}`,"INVALID_PADDING_STRICTNESS");let a;try{a=h(n.padStart(64,"0"))}catch(g){throw new i(`Hex characters are invalid: ${g?.message}`,"invalid_hex_chars")}let o=new e(a);if(n.length<64-r&&!o.isSpecial())throw new i(`Hex string is too short, must be ${64-r} to 64 chars long, excluding the leading 0x. You may need to fix
|
|
2
2
|
the addresss by padding it with 0s before passing it to \`fromString\` (e.g. <addressString>.padStart(64, '0')).
|
|
3
3
|
Received ${t}`,"too_short");return o}static from(t,{maxMissingChars:r=4}={}){return typeof t=="string"?e.fromString(t,{maxMissingChars:r}):t instanceof Uint8Array?new e(t):t}static fromStrict(t){return typeof t=="string"?e.fromStringStrict(t):t instanceof Uint8Array?new e(t):t}static isValid(t){try{return t.strict?e.fromStrict(t.input):e.from(t.input),{valid:!0}}catch(r){return{valid:!1,invalidReason:r?.invalidReason,invalidReasonMessage:r?.message}}}equals(t){return this.data.length!==t.data.length?!1:this.data.every((r,n)=>r===t.data[n])}};e.LENGTH=32,e.LONG_STRING_LENGTH=64,e.ZERO=e.from("0x0"),e.ONE=e.from("0x1"),e.TWO=e.from("0x2"),e.THREE=e.from("0x3"),e.FOUR=e.from("0x4"),e.A=e.from("0xA");var l=e;export{u as a,l as b};
|
|
4
|
-
//# sourceMappingURL=chunk-
|
|
4
|
+
//# sourceMappingURL=chunk-LQOSHBB7.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as i}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as i}from"./chunk-RXHER6EA.mjs";var r=class a extends i{constructor(e){super(),this.chainId=e}serialize(e){e.serializeU8(this.chainId)}static deserialize(e){let s=e.deserializeU8();return new a(s)}};export{r as a};
|
|
2
|
+
//# sourceMappingURL=chunk-LS3IDL2N.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{d as s}from"./chunk-P5CM4C2G.mjs";import{b as i}from"./chunk-BPHCRTHD.mjs";import{c as n}from"./chunk-7OUPEQRN.mjs";import{b as o}from"./chunk-LQOSHBB7.mjs";var c=class a{constructor(t){this.signingScheme=0;let{privateKey:e,address:r}=t;this.privateKey=e,this.publicKey=e.publicKey(),this.accountAddress=r?o.from(r):this.publicKey.authKey().derivedAddress()}static generate(){let t=n.generate();return new a({privateKey:t})}static fromDerivationPath(t){let{path:e,mnemonic:r}=t,u=n.fromDerivationPath(e,r);return new a({privateKey:u})}verifySignature(t){return this.publicKey.verifySignature(t)}signWithAuthenticator(t){return new i(this.publicKey,this.privateKey.sign(t))}signTransactionWithAuthenticator(t){return new i(this.publicKey,this.signTransaction(t))}sign(t){return this.privateKey.sign(t)}signTransaction(t){return this.sign(s(t))}};export{c as a};
|
|
2
|
+
//# sourceMappingURL=chunk-MAWGZICD.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{h as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{h as e}from"./chunk-GRRBXHVG.mjs";async function i(o){o.minimumLedgerVersion!==void 0&&await e({aptosConfig:o.config,minimumLedgerVersion:o.minimumLedgerVersion,processorType:o.processorType})}export{i as a};
|
|
2
|
+
//# sourceMappingURL=chunk-MFLHAVIW.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as t}from"./chunk-53IBOHXB.mjs";import{a as p}from"./chunk-FJ5J7CVW.mjs";import{e as s}from"./chunk-PIPDQFL2.mjs";import{a as i}from"./chunk-T7X4GZDU.mjs";import{c as a}from"./chunk-44EHAKKW.mjs";import{a as e}from"./chunk-ZD2TY5N3.mjs";import{b as r}from"./chunk-LQOSHBB7.mjs";var c=class{constructor(n){this.config=n}async simple(n){return t({aptosConfig:this.config,...n})}async scriptComposer(n){let o=new p(this.config);await o.init();let d=(await n.builder(o)).build(),u=await s({aptosConfig:this.config,payload:a.load(new e(d)),...n});return new i(u,n.withFeePayer===!0?r.ZERO:void 0)}async multiAgent(n){return t({aptosConfig:this.config,...n})}};export{c as a};
|
|
2
|
+
//# sourceMappingURL=chunk-OLGEN23M.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as n}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as n}from"./chunk-27ESCVVC.mjs";import{b as i}from"./chunk-LQOSHBB7.mjs";import{a as d}from"./chunk-RXHER6EA.mjs";var o=class t extends d{constructor(e,s,r){super(),this.rawTransaction=e,this.feePayerAddress=r,this.secondarySignerAddresses=s}serialize(e){this.rawTransaction.serialize(e),e.serializeVector(this.secondarySignerAddresses),this.feePayerAddress===void 0?e.serializeBool(!1):(e.serializeBool(!0),this.feePayerAddress.serialize(e))}static deserialize(e){let s=n.deserialize(e),r=e.deserializeVector(i),c=e.deserializeBool(),a;return c&&(a=i.deserialize(e)),new t(s,r,a)}};export{o as a};
|
|
2
|
+
//# sourceMappingURL=chunk-ONGH5DXZ.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as o,b as A}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as o,b as A}from"./chunk-CGTMSLVZ.mjs";import{a as u}from"./chunk-2YKERRHD.mjs";import{d as e}from"./chunk-P5CM4C2G.mjs";import{g as a}from"./chunk-BPHCRTHD.mjs";import{k as c}from"./chunk-BHVSIRNF.mjs";import{b as s}from"./chunk-RXHER6EA.mjs";import{sha3_256 as d}from"@noble/hashes/sha3";var g=class p extends u{constructor({signer:t,accountAddress:n,authenticationFunction:i}){super();this.signingScheme=2;if(!c(i))throw new Error(`Invalid authentication function ${i} passed into AbstractedAccount`);this.authenticationFunction=i,this.accountAddress=n,this.publicKey=new A(this.accountAddress),this.sign=r=>new o(t(r))}static fromPermissionedSigner({signer:t,accountAddress:n}){return new p({signer:i=>{let r=new s;return t.publicKey.serialize(r),t.sign(i).serialize(r),r.toUint8Array()},accountAddress:n??t.accountAddress,authenticationFunction:"0x1::permissioned_delegation::authenticate"})}signWithAuthenticator(t){return new a(this.authenticationFunction,d(t),this.sign(d(t)).toUint8Array())}signTransactionWithAuthenticator(t){return this.signWithAuthenticator(e(t))}signTransaction(t){return this.sign(e(t))}setSigner(t){this.sign=n=>new o(t(n))}};export{g as a};
|
|
2
|
+
//# sourceMappingURL=chunk-OPD5EKOA.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as T,d as c}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{c as T,d as c}from"./chunk-27ESCVVC.mjs";import{g as A,h as a}from"./chunk-RJ7F4JDV.mjs";import{sha3_256 as y}from"@noble/hashes/sha3";function d(e){return e.feePayerAddress?new c(e.rawTransaction,e.secondarySignerAddresses??[],e.feePayerAddress):e.secondarySignerAddresses?new T(e.rawTransaction,e.secondarySignerAddresses):e.rawTransaction}function n(e,r){let i=y.create();if(!r.startsWith("APTOS::"))throw new Error(`Domain separator needs to start with 'APTOS::'. Provided - ${r}`);i.update(r);let s=i.digest(),o=e,t=new Uint8Array(s.length+o.length);return t.set(s),t.set(o,s.length),t}function u(e){return n(e.bcsToBytes(),`APTOS::${e.constructor.name}`)}function S(e){let r=d(e);return e.feePayerAddress?n(r.bcsToBytes(),a):e.secondarySignerAddresses?n(r.bcsToBytes(),a):n(r.bcsToBytes(),A)}export{d as a,n as b,u as c,S as d};
|
|
2
|
+
//# sourceMappingURL=chunk-P5CM4C2G.mjs.map
|