@aptos-labs/ts-sdk 1.13.1-zeta.2 → 1.13.1-zeta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/index.d.ts +10 -10
- package/dist/common/index.js +6 -6
- package/dist/common/index.js.map +1 -1
- package/dist/esm/account/Account.mjs +1 -1
- package/dist/esm/account/Ed25519Account.mjs +1 -1
- package/dist/esm/account/EphemeralKeyPair.d.mts +3 -2
- package/dist/esm/account/EphemeralKeyPair.mjs +1 -1
- package/dist/esm/account/KeylessAccount.d.mts +7 -7
- package/dist/esm/account/KeylessAccount.mjs +1 -1
- package/dist/esm/account/MultiKeyAccount.mjs +1 -1
- package/dist/esm/account/SingleKeyAccount.mjs +1 -1
- package/dist/esm/account/index.mjs +1 -1
- package/dist/esm/api/account.mjs +1 -1
- package/dist/esm/api/ans.mjs +1 -1
- package/dist/esm/api/aptos.mjs +1 -1
- package/dist/esm/api/aptosConfig.mjs +1 -1
- package/dist/esm/api/coin.mjs +1 -1
- package/dist/esm/api/digitalAsset.mjs +1 -1
- package/dist/esm/api/event.mjs +1 -1
- package/dist/esm/api/faucet.mjs +1 -1
- package/dist/esm/api/fungibleAsset.mjs +1 -1
- package/dist/esm/api/general.mjs +1 -1
- package/dist/esm/api/index.mjs +1 -1
- package/dist/esm/api/keyless.d.mts +0 -1
- package/dist/esm/api/keyless.mjs +1 -1
- package/dist/esm/api/staking.mjs +1 -1
- package/dist/esm/api/transaction.d.mts +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/simulate.mjs +1 -1
- package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
- package/dist/esm/api/utils.mjs +1 -1
- package/dist/esm/bcs/index.mjs +1 -1
- package/dist/esm/bcs/serializable/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-EESTYBZ5.mjs → chunk-34J6ODJ2.mjs} +2 -2
- package/dist/esm/{chunk-7EQOLMEJ.mjs → chunk-3FVRXELT.mjs} +2 -2
- package/dist/esm/chunk-3L24FVGY.mjs +2 -0
- package/dist/esm/chunk-3L24FVGY.mjs.map +1 -0
- package/dist/esm/{chunk-Q225PZMV.mjs → chunk-3VGX3TXH.mjs} +2 -2
- package/dist/esm/{chunk-7CVJJZBP.mjs → chunk-3YALT5WV.mjs} +2 -2
- package/dist/esm/{chunk-3FL3NLZ6.mjs → chunk-47DNXBM6.mjs} +2 -2
- package/dist/esm/{chunk-PWPUAWER.mjs → chunk-4RXBUEQO.mjs} +2 -2
- package/dist/esm/{chunk-Y4VKIX2V.mjs → chunk-5VSMDXZ6.mjs} +2 -2
- package/dist/esm/{chunk-Y4VKIX2V.mjs.map → chunk-5VSMDXZ6.mjs.map} +1 -1
- package/dist/esm/{chunk-ND5A52N4.mjs → chunk-6GQAHQGW.mjs} +2 -2
- package/dist/esm/{chunk-5NKRMZEX.mjs → chunk-6M6XXPQQ.mjs} +2 -2
- package/dist/esm/{chunk-VVJEWB26.mjs → chunk-6RBUXB5I.mjs} +2 -2
- package/dist/esm/{chunk-V7CRIOJF.mjs → chunk-6VIF4V3V.mjs} +2 -2
- package/dist/esm/chunk-7IFNIXKE.mjs +2 -0
- package/dist/esm/{chunk-XLTRVMUO.mjs.map → chunk-7IFNIXKE.mjs.map} +1 -1
- package/dist/esm/{chunk-ZSZCPOHE.mjs → chunk-7JNPSNL6.mjs} +2 -2
- package/dist/esm/{chunk-5TNUDFLP.mjs → chunk-7PICPK26.mjs} +2 -2
- package/dist/esm/{chunk-JYFKKB34.mjs → chunk-7STYQ5ZE.mjs} +2 -2
- package/dist/esm/{chunk-Q2Y6S77E.mjs → chunk-AKEMNKDV.mjs} +2 -2
- package/dist/esm/{chunk-F2OCQQAA.mjs → chunk-AP3W3ZNS.mjs} +2 -2
- package/dist/esm/{chunk-U24GVATE.mjs → chunk-BSSOXHEL.mjs} +2 -2
- package/dist/esm/{chunk-PLB5ERQA.mjs → chunk-BUYPCQV7.mjs} +2 -2
- package/dist/esm/chunk-C2L72C66.mjs +2 -0
- package/dist/esm/chunk-C2L72C66.mjs.map +1 -0
- package/dist/esm/{chunk-JTFH6ACV.mjs → chunk-C3AEWQ3A.mjs} +2 -2
- package/dist/esm/{chunk-UZHVGPGH.mjs → chunk-C3L4ETUF.mjs} +2 -2
- package/dist/esm/{chunk-HZC6A3QL.mjs → chunk-COW5IGYC.mjs} +2 -2
- package/dist/esm/{chunk-42ZSGMQO.mjs → chunk-CTLYHRB6.mjs} +2 -2
- package/dist/esm/{chunk-S5YUB2BI.mjs → chunk-D73X3S27.mjs} +2 -2
- package/dist/esm/{chunk-SI3UTR5R.mjs → chunk-DWU72IVJ.mjs} +2 -2
- package/dist/esm/{chunk-35ZI4WOQ.mjs → chunk-EB7AI4B4.mjs} +2 -2
- package/dist/esm/{chunk-RBDX3YWC.mjs → chunk-FEWIHUNW.mjs} +2 -2
- package/dist/esm/{chunk-IXA3IGQT.mjs → chunk-FVU47J7S.mjs} +2 -2
- package/dist/esm/chunk-HB5NROHB.mjs +2 -0
- package/dist/esm/{chunk-IMGPWY3W.mjs.map → chunk-HB5NROHB.mjs.map} +1 -1
- package/dist/esm/{chunk-XI4LX4EC.mjs → chunk-HGZGTBA4.mjs} +2 -2
- package/dist/esm/chunk-HINA3HEN.mjs +2 -0
- package/dist/esm/chunk-HINA3HEN.mjs.map +1 -0
- package/dist/esm/{chunk-M3PUC5JD.mjs → chunk-HVNZOMAF.mjs} +2 -2
- package/dist/esm/{chunk-T7TIIAWK.mjs → chunk-JTCWZB3Q.mjs} +2 -2
- package/dist/esm/{chunk-KMPAYC5Z.mjs → chunk-KGJITNRZ.mjs} +2 -2
- package/dist/esm/{chunk-BM43VTGD.mjs → chunk-L4VMX4P3.mjs} +2 -2
- package/dist/esm/{chunk-PYFNAWZ5.mjs → chunk-LIBP67EZ.mjs} +2 -2
- package/dist/esm/{chunk-AULJLLO5.mjs → chunk-LS2FSDDC.mjs} +2 -2
- package/dist/esm/{chunk-QUJQWJB7.mjs → chunk-M3JTEH74.mjs} +2 -2
- package/dist/esm/{chunk-RM7D2ITN.mjs → chunk-MGOHPDX4.mjs} +2 -2
- package/dist/esm/{chunk-V76TXXWZ.mjs → chunk-MMLFUGI5.mjs} +2 -2
- package/dist/esm/{chunk-55BHW3A6.mjs → chunk-MOOOOZNS.mjs} +2 -2
- package/dist/esm/{chunk-MRCVSUJQ.mjs → chunk-MWUJCP27.mjs} +2 -2
- package/dist/esm/{chunk-5GIWRESN.mjs → chunk-NC5HHEEM.mjs} +2 -2
- package/dist/esm/{chunk-AKW2HAKU.mjs → chunk-OPCSBCGS.mjs} +2 -2
- package/dist/esm/{chunk-MCSLNNV3.mjs → chunk-PBAEIXWS.mjs} +2 -2
- package/dist/esm/{chunk-IVBYTTN7.mjs → chunk-PFFAQZHT.mjs} +2 -2
- package/dist/esm/{chunk-NG3IWN2V.mjs → chunk-PJEWWA6X.mjs} +2 -2
- package/dist/esm/{chunk-BTEW6JF2.mjs → chunk-PSNM2PID.mjs} +2 -2
- package/dist/esm/{chunk-N37BFHNS.mjs → chunk-PTIZKRON.mjs} +2 -2
- package/dist/esm/{chunk-4VKZBIH7.mjs → chunk-Q45JYX4F.mjs} +2 -2
- package/dist/esm/{chunk-55W7VV7Z.mjs → chunk-QRFKEZVG.mjs} +2 -2
- package/dist/esm/{chunk-LODRH4QJ.mjs → chunk-QUX233BC.mjs} +2 -2
- package/dist/esm/{chunk-VMR46ALO.mjs → chunk-R7BAM2G6.mjs} +2 -2
- package/dist/esm/{chunk-CKMU5DQN.mjs → chunk-RXBRW27O.mjs} +2 -2
- package/dist/esm/{chunk-XFI6MEYQ.mjs → chunk-S6R7FPJE.mjs} +2 -2
- package/dist/esm/{chunk-7GO6HWMQ.mjs → chunk-SAQWY35C.mjs} +2 -2
- package/dist/esm/{chunk-NVN6BTXK.mjs → chunk-SC34237T.mjs} +2 -2
- package/dist/esm/{chunk-GSOKKQQ7.mjs → chunk-SNZ4BCEF.mjs} +2 -2
- package/dist/esm/{chunk-KX5ESZO7.mjs → chunk-STYDBDYL.mjs} +2 -2
- package/dist/esm/{chunk-U7EZI5D5.mjs → chunk-T23OVRNF.mjs} +2 -2
- package/dist/esm/{chunk-52DBSOFA.mjs → chunk-TVRJ3M7B.mjs} +2 -2
- package/dist/esm/{chunk-6FEGU4XJ.mjs → chunk-ULEPSALQ.mjs} +2 -2
- package/dist/esm/{chunk-ED6PYTNG.mjs → chunk-UT37XKQU.mjs} +2 -2
- package/dist/esm/{chunk-UPVELRIE.mjs → chunk-UXW3KCDT.mjs} +2 -2
- package/dist/esm/{chunk-JIX5F3BC.mjs → chunk-V4VR4VQI.mjs} +2 -2
- package/dist/esm/{chunk-CFGG43FJ.mjs → chunk-W352LMVK.mjs} +2 -2
- package/dist/esm/{chunk-Z5GI2A3I.mjs → chunk-WPVBC4JS.mjs} +2 -2
- package/dist/esm/{chunk-7URCUZPH.mjs → chunk-WTVN3XGK.mjs} +2 -2
- package/dist/esm/{chunk-EGFL5FCU.mjs → chunk-XHPLLMR5.mjs} +2 -2
- package/dist/esm/{chunk-K7ESGXR3.mjs → chunk-XQ7ZPP3P.mjs} +2 -2
- package/dist/esm/{chunk-JZ7UTFTR.mjs → chunk-Y76WJ62G.mjs} +2 -2
- package/dist/esm/{chunk-V7E4HC3Y.mjs → chunk-YE4H3QXN.mjs} +2 -2
- package/dist/esm/{chunk-MUZPVCQF.mjs → chunk-YYGADL3D.mjs} +2 -2
- package/dist/esm/{chunk-7BT2KH4T.mjs → chunk-ZDKFYKT4.mjs} +2 -2
- package/dist/esm/{chunk-O63GDJY4.mjs → chunk-ZGTJMNZG.mjs} +2 -2
- package/dist/esm/{chunk-WZCUABDL.mjs → chunk-ZNEBMSNC.mjs} +2 -2
- package/dist/esm/client/core.mjs +1 -1
- package/dist/esm/client/get.mjs +1 -1
- package/dist/esm/client/index.mjs +1 -1
- package/dist/esm/client/post.mjs +1 -1
- package/dist/esm/core/account/index.mjs +1 -1
- package/dist/esm/core/account/utils/address.mjs +1 -1
- package/dist/esm/core/account/utils/index.mjs +1 -1
- package/dist/esm/core/accountAddress.mjs +1 -1
- package/dist/esm/core/authenticationKey.mjs +1 -1
- package/dist/esm/core/crypto/ed25519.mjs +1 -1
- package/dist/esm/core/crypto/ephemeral.mjs +1 -1
- package/dist/esm/core/crypto/index.mjs +1 -1
- package/dist/esm/core/crypto/keyless.mjs +1 -1
- package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
- package/dist/esm/core/crypto/multiKey.mjs +1 -1
- package/dist/esm/core/crypto/publicKey.mjs +1 -1
- package/dist/esm/core/crypto/secp256k1.mjs +1 -1
- package/dist/esm/core/crypto/signature.mjs +1 -1
- package/dist/esm/core/crypto/singleKey.mjs +1 -1
- package/dist/esm/core/index.mjs +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/internal/account.mjs +1 -1
- package/dist/esm/internal/ans.mjs +1 -1
- package/dist/esm/internal/coin.mjs +1 -1
- package/dist/esm/internal/digitalAsset.mjs +1 -1
- package/dist/esm/internal/event.mjs +1 -1
- package/dist/esm/internal/faucet.mjs +1 -1
- package/dist/esm/internal/fungibleAsset.mjs +1 -1
- package/dist/esm/internal/general.mjs +1 -1
- package/dist/esm/internal/keyless.d.mts +0 -1
- package/dist/esm/internal/keyless.mjs +1 -1
- package/dist/esm/internal/staking.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/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.mjs +1 -1
- package/dist/esm/transactions/typeTag/index.mjs +1 -1
- package/dist/esm/transactions/typeTag/parser.mjs +1 -1
- package/dist/esm/utils/apiEndpoints.mjs +1 -1
- package/dist/esm/utils/index.mjs +1 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/src/account/EphemeralKeyPair.ts +12 -8
- package/src/account/KeylessAccount.ts +20 -30
- package/src/api/keyless.ts +0 -1
- package/src/internal/keyless.ts +4 -8
- package/src/utils/apiEndpoints.ts +1 -1
- package/src/version.ts +1 -1
- package/dist/esm/chunk-BIRZ55IO.mjs +0 -2
- package/dist/esm/chunk-BIRZ55IO.mjs.map +0 -1
- package/dist/esm/chunk-IMGPWY3W.mjs +0 -2
- package/dist/esm/chunk-LXDHLUP4.mjs +0 -2
- package/dist/esm/chunk-LXDHLUP4.mjs.map +0 -1
- package/dist/esm/chunk-P6EM7SA6.mjs +0 -2
- package/dist/esm/chunk-P6EM7SA6.mjs.map +0 -1
- package/dist/esm/chunk-XLTRVMUO.mjs +0 -2
- /package/dist/esm/{chunk-EESTYBZ5.mjs.map → chunk-34J6ODJ2.mjs.map} +0 -0
- /package/dist/esm/{chunk-7EQOLMEJ.mjs.map → chunk-3FVRXELT.mjs.map} +0 -0
- /package/dist/esm/{chunk-Q225PZMV.mjs.map → chunk-3VGX3TXH.mjs.map} +0 -0
- /package/dist/esm/{chunk-7CVJJZBP.mjs.map → chunk-3YALT5WV.mjs.map} +0 -0
- /package/dist/esm/{chunk-3FL3NLZ6.mjs.map → chunk-47DNXBM6.mjs.map} +0 -0
- /package/dist/esm/{chunk-PWPUAWER.mjs.map → chunk-4RXBUEQO.mjs.map} +0 -0
- /package/dist/esm/{chunk-ND5A52N4.mjs.map → chunk-6GQAHQGW.mjs.map} +0 -0
- /package/dist/esm/{chunk-5NKRMZEX.mjs.map → chunk-6M6XXPQQ.mjs.map} +0 -0
- /package/dist/esm/{chunk-VVJEWB26.mjs.map → chunk-6RBUXB5I.mjs.map} +0 -0
- /package/dist/esm/{chunk-V7CRIOJF.mjs.map → chunk-6VIF4V3V.mjs.map} +0 -0
- /package/dist/esm/{chunk-ZSZCPOHE.mjs.map → chunk-7JNPSNL6.mjs.map} +0 -0
- /package/dist/esm/{chunk-5TNUDFLP.mjs.map → chunk-7PICPK26.mjs.map} +0 -0
- /package/dist/esm/{chunk-JYFKKB34.mjs.map → chunk-7STYQ5ZE.mjs.map} +0 -0
- /package/dist/esm/{chunk-Q2Y6S77E.mjs.map → chunk-AKEMNKDV.mjs.map} +0 -0
- /package/dist/esm/{chunk-F2OCQQAA.mjs.map → chunk-AP3W3ZNS.mjs.map} +0 -0
- /package/dist/esm/{chunk-U24GVATE.mjs.map → chunk-BSSOXHEL.mjs.map} +0 -0
- /package/dist/esm/{chunk-PLB5ERQA.mjs.map → chunk-BUYPCQV7.mjs.map} +0 -0
- /package/dist/esm/{chunk-JTFH6ACV.mjs.map → chunk-C3AEWQ3A.mjs.map} +0 -0
- /package/dist/esm/{chunk-UZHVGPGH.mjs.map → chunk-C3L4ETUF.mjs.map} +0 -0
- /package/dist/esm/{chunk-HZC6A3QL.mjs.map → chunk-COW5IGYC.mjs.map} +0 -0
- /package/dist/esm/{chunk-42ZSGMQO.mjs.map → chunk-CTLYHRB6.mjs.map} +0 -0
- /package/dist/esm/{chunk-S5YUB2BI.mjs.map → chunk-D73X3S27.mjs.map} +0 -0
- /package/dist/esm/{chunk-SI3UTR5R.mjs.map → chunk-DWU72IVJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-35ZI4WOQ.mjs.map → chunk-EB7AI4B4.mjs.map} +0 -0
- /package/dist/esm/{chunk-RBDX3YWC.mjs.map → chunk-FEWIHUNW.mjs.map} +0 -0
- /package/dist/esm/{chunk-IXA3IGQT.mjs.map → chunk-FVU47J7S.mjs.map} +0 -0
- /package/dist/esm/{chunk-XI4LX4EC.mjs.map → chunk-HGZGTBA4.mjs.map} +0 -0
- /package/dist/esm/{chunk-M3PUC5JD.mjs.map → chunk-HVNZOMAF.mjs.map} +0 -0
- /package/dist/esm/{chunk-T7TIIAWK.mjs.map → chunk-JTCWZB3Q.mjs.map} +0 -0
- /package/dist/esm/{chunk-KMPAYC5Z.mjs.map → chunk-KGJITNRZ.mjs.map} +0 -0
- /package/dist/esm/{chunk-BM43VTGD.mjs.map → chunk-L4VMX4P3.mjs.map} +0 -0
- /package/dist/esm/{chunk-PYFNAWZ5.mjs.map → chunk-LIBP67EZ.mjs.map} +0 -0
- /package/dist/esm/{chunk-AULJLLO5.mjs.map → chunk-LS2FSDDC.mjs.map} +0 -0
- /package/dist/esm/{chunk-QUJQWJB7.mjs.map → chunk-M3JTEH74.mjs.map} +0 -0
- /package/dist/esm/{chunk-RM7D2ITN.mjs.map → chunk-MGOHPDX4.mjs.map} +0 -0
- /package/dist/esm/{chunk-V76TXXWZ.mjs.map → chunk-MMLFUGI5.mjs.map} +0 -0
- /package/dist/esm/{chunk-55BHW3A6.mjs.map → chunk-MOOOOZNS.mjs.map} +0 -0
- /package/dist/esm/{chunk-MRCVSUJQ.mjs.map → chunk-MWUJCP27.mjs.map} +0 -0
- /package/dist/esm/{chunk-5GIWRESN.mjs.map → chunk-NC5HHEEM.mjs.map} +0 -0
- /package/dist/esm/{chunk-AKW2HAKU.mjs.map → chunk-OPCSBCGS.mjs.map} +0 -0
- /package/dist/esm/{chunk-MCSLNNV3.mjs.map → chunk-PBAEIXWS.mjs.map} +0 -0
- /package/dist/esm/{chunk-IVBYTTN7.mjs.map → chunk-PFFAQZHT.mjs.map} +0 -0
- /package/dist/esm/{chunk-NG3IWN2V.mjs.map → chunk-PJEWWA6X.mjs.map} +0 -0
- /package/dist/esm/{chunk-BTEW6JF2.mjs.map → chunk-PSNM2PID.mjs.map} +0 -0
- /package/dist/esm/{chunk-N37BFHNS.mjs.map → chunk-PTIZKRON.mjs.map} +0 -0
- /package/dist/esm/{chunk-4VKZBIH7.mjs.map → chunk-Q45JYX4F.mjs.map} +0 -0
- /package/dist/esm/{chunk-55W7VV7Z.mjs.map → chunk-QRFKEZVG.mjs.map} +0 -0
- /package/dist/esm/{chunk-LODRH4QJ.mjs.map → chunk-QUX233BC.mjs.map} +0 -0
- /package/dist/esm/{chunk-VMR46ALO.mjs.map → chunk-R7BAM2G6.mjs.map} +0 -0
- /package/dist/esm/{chunk-CKMU5DQN.mjs.map → chunk-RXBRW27O.mjs.map} +0 -0
- /package/dist/esm/{chunk-XFI6MEYQ.mjs.map → chunk-S6R7FPJE.mjs.map} +0 -0
- /package/dist/esm/{chunk-7GO6HWMQ.mjs.map → chunk-SAQWY35C.mjs.map} +0 -0
- /package/dist/esm/{chunk-NVN6BTXK.mjs.map → chunk-SC34237T.mjs.map} +0 -0
- /package/dist/esm/{chunk-GSOKKQQ7.mjs.map → chunk-SNZ4BCEF.mjs.map} +0 -0
- /package/dist/esm/{chunk-KX5ESZO7.mjs.map → chunk-STYDBDYL.mjs.map} +0 -0
- /package/dist/esm/{chunk-U7EZI5D5.mjs.map → chunk-T23OVRNF.mjs.map} +0 -0
- /package/dist/esm/{chunk-52DBSOFA.mjs.map → chunk-TVRJ3M7B.mjs.map} +0 -0
- /package/dist/esm/{chunk-6FEGU4XJ.mjs.map → chunk-ULEPSALQ.mjs.map} +0 -0
- /package/dist/esm/{chunk-ED6PYTNG.mjs.map → chunk-UT37XKQU.mjs.map} +0 -0
- /package/dist/esm/{chunk-UPVELRIE.mjs.map → chunk-UXW3KCDT.mjs.map} +0 -0
- /package/dist/esm/{chunk-JIX5F3BC.mjs.map → chunk-V4VR4VQI.mjs.map} +0 -0
- /package/dist/esm/{chunk-CFGG43FJ.mjs.map → chunk-W352LMVK.mjs.map} +0 -0
- /package/dist/esm/{chunk-Z5GI2A3I.mjs.map → chunk-WPVBC4JS.mjs.map} +0 -0
- /package/dist/esm/{chunk-7URCUZPH.mjs.map → chunk-WTVN3XGK.mjs.map} +0 -0
- /package/dist/esm/{chunk-EGFL5FCU.mjs.map → chunk-XHPLLMR5.mjs.map} +0 -0
- /package/dist/esm/{chunk-K7ESGXR3.mjs.map → chunk-XQ7ZPP3P.mjs.map} +0 -0
- /package/dist/esm/{chunk-JZ7UTFTR.mjs.map → chunk-Y76WJ62G.mjs.map} +0 -0
- /package/dist/esm/{chunk-V7E4HC3Y.mjs.map → chunk-YE4H3QXN.mjs.map} +0 -0
- /package/dist/esm/{chunk-MUZPVCQF.mjs.map → chunk-YYGADL3D.mjs.map} +0 -0
- /package/dist/esm/{chunk-7BT2KH4T.mjs.map → chunk-ZDKFYKT4.mjs.map} +0 -0
- /package/dist/esm/{chunk-O63GDJY4.mjs.map → chunk-ZGTJMNZG.mjs.map} +0 -0
- /package/dist/esm/{chunk-WZCUABDL.mjs.map → chunk-ZNEBMSNC.mjs.map} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as j}from"./chunk-3L24FVGY.mjs";import{a as g,b as I}from"./chunk-D73X3S27.mjs";import{d as x}from"./chunk-WPVBC4JS.mjs";import{a as E,b as T}from"./chunk-6M6XXPQQ.mjs";import{i as w,j as K,k as h,m as A,n as b,o as l}from"./chunk-WTVN3XGK.mjs";import{k as S}from"./chunk-S5HG2QUD.mjs";import{b as P}from"./chunk-T23OVRNF.mjs";import{a as f}from"./chunk-6IFMQ5AS.mjs";import{b as y}from"./chunk-TVRJ3M7B.mjs";import{b as c}from"./chunk-AOCNYMMX.mjs";import{jwtDecode as D}from"jwt-decode";import{decode as U}from"base-64";function v(z){let e=z.replace(/-/g,"+").replace(/_/g,"/"),r=e+"==".substring(0,(3-e.length%3)%3);return U(r)}var o=class o{constructor(e){let{address:r,ephemeralKeyPair:t,iss:n,uidKey:a,uidVal:i,aud:s,pepper:p,proof:u,jwt:d}=e;this.ephemeralKeyPair=t;let B=K(e);this.publicKey=new w(n,B),this.accountAddress=r?P.from(r):this.publicKey.authKey().derivedAddress(),this.uidKey=a,this.uidVal=i,this.aud=s,this.jwt=d,this.proof=u,this.signingScheme=2;let m=c.fromHexInput(p).toUint8Array();if(m.length!==o.PEPPER_LENGTH)throw new Error(`Pepper length in bytes should be ${o.PEPPER_LENGTH}`);this.pepper=m}serialize(e){e.serializeStr(this.jwt),e.serializeStr(this.uidKey),e.serializeFixedBytes(this.pepper),this.ephemeralKeyPair.serialize(e),this.proof.serialize(e)}static deserialize(e){let r=e.deserializeStr(),t=e.deserializeStr(),n=e.deserializeFixedBytes(31),a=j.deserialize(e),i=A.deserialize(e);return o.fromJWTAndProof({proof:i,pepper:n,uidKey:t,jwt:r,ephemeralKeyPair:a})}bcsToBytes(){let e=new y;return this.serialize(e),e.toUint8Array()}bcsToHex(){let e=this.bcsToBytes();return c.fromHexInput(e)}signWithAuthenticator(e){let r=g(e),t=new T(this.sign(r.bcsToBytes())),n=new E(this.publicKey);return new x(n,t)}async waitForProofFetch(){this.proof instanceof Promise&&await this.proof}sign(e){let{expiryDateSecs:r}=this.ephemeralKeyPair,t=Math.floor(new Date().getTime()/1e3);if(r<t)throw new Error("Ephemeral key pair is expired.");if(this.proof instanceof Promise)throw new Error("Failed to fetch proof.");let n=this.jwt.split(".")[0],a=this.ephemeralKeyPair.getPublicKey(),i=new y;i.serializeFixedBytes(c.fromHexInput(e).toUint8Array()),i.serializeOption(this.proof.proof);let s=I(i.toUint8Array(),"APTOS::TransactionAndProof"),p=this.ephemeralKeyPair.sign(s);return new l({jwtHeader:v(n),openIdSignatureOrZkProof:new h(this.proof),expiryDateSecs:r,ephemeralPublicKey:a,ephemeralSignature:p})}signTransaction(e){let r=g(e);return this.sign(r.bcsToBytes())}signWithOpenIdSignature(e){let[r,t,n]=this.jwt.split("."),a=new b({jwtSignature:n,jwtPayloadJson:t,uidKey:this.uidKey,epkBlinder:this.ephemeralKeyPair.blinder,pepper:this.pepper}),{expiryDateSecs:i}=this.ephemeralKeyPair,s=this.ephemeralKeyPair.getPublicKey(),p=this.ephemeralKeyPair.sign(e);return new l({jwtHeader:r,openIdSignatureOrZkProof:new h(a),expiryDateSecs:i,ephemeralPublicKey:s,ephemeralSignature:p})}verifySignature(e){return!0}static fromBytes(e){return o.deserialize(new f(e))}static fromJWTAndProof(e){let{proof:r,jwt:t,ephemeralKeyPair:n,pepper:a}=e,i=e.uidKey??"sub",s=D(t),p=s.iss;if(typeof s.aud!="string")throw new Error("aud was not found or an array of values");let u=s.aud,d=s[i];return new o({proof:r,ephemeralKeyPair:n,iss:p,uidKey:i,uidVal:d,aud:u,pepper:a,jwt:t})}static fromDerivationPath(e,r){return S(e,o.SLIP_0010_SEED,r)}};o.PEPPER_LENGTH=31,o.SLIP_0010_SEED="32 bytes";var H=o;export{H as a};
|
|
2
|
+
//# sourceMappingURL=chunk-HINA3HEN.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/account/KeylessAccount.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { JwtPayload, jwtDecode } from \"jwt-decode\";\nimport { decode } from \"base-64\";\nimport { HexInput, SigningScheme } from \"../types\";\nimport { AccountAddress } from \"../core/accountAddress\";\nimport {\n AnyPublicKey,\n AnySignature,\n KeylessPublicKey,\n KeylessSignature,\n OpenIdSignature,\n OpenIdSignatureOrZkProof,\n Signature,\n SignedGroth16Signature,\n computeAddressSeed,\n fromDerivationPath as fromDerivationPathInner,\n} from \"../core/crypto\";\n\nimport { Account } from \"./Account\";\nimport { EphemeralKeyPair } from \"./EphemeralKeyPair\";\nimport { Hex } from \"../core/hex\";\nimport { AccountAuthenticatorSingleKey } from \"../transactions/authenticator/account\";\nimport { Deserializer, Serializer } from \"../bcs\";\nimport { deriveTransactionType, generateSigningMessage } from \"../transactions/transactionBuilder/signingMessage\";\nimport { AnyRawTransaction } from \"../transactions/types\";\n\nfunction base64UrlDecode(base64Url: string): string {\n // Replace base64url-specific characters\n const base64 = base64Url.replace(/-/g, \"+\").replace(/_/g, \"/\");\n\n // Pad the string with '=' characters if needed\n const paddedBase64 = base64 + \"==\".substring(0, (3 - (base64.length % 3)) % 3);\n\n // Decode the base64 string using the base-64 library\n const decodedString = decode(paddedBase64);\n\n return decodedString;\n}\n\nexport class KeylessAccount implements Account {\n static readonly PEPPER_LENGTH: number = 31;\n\n static readonly SLIP_0010_SEED: string = \"32 bytes\";\n\n publicKey: KeylessPublicKey;\n\n ephemeralKeyPair: EphemeralKeyPair;\n\n uidKey: string;\n\n uidVal: string;\n\n aud: string;\n\n pepper: Uint8Array;\n\n accountAddress: AccountAddress;\n\n proof: SignedGroth16Signature;\n\n signingScheme: SigningScheme;\n\n jwt: string;\n\n constructor(args: {\n address?: AccountAddress;\n ephemeralKeyPair: EphemeralKeyPair;\n iss: string;\n uidKey: string;\n uidVal: string;\n aud: string;\n pepper: HexInput;\n proof: SignedGroth16Signature;\n jwt: string;\n }) {\n const { address, ephemeralKeyPair, iss, uidKey, uidVal, aud, pepper, proof, jwt } = args;\n this.ephemeralKeyPair = ephemeralKeyPair;\n const addressSeed = computeAddressSeed(args);\n this.publicKey = new KeylessPublicKey(iss, addressSeed);\n this.accountAddress = address ? AccountAddress.from(address) : this.publicKey.authKey().derivedAddress();\n this.uidKey = uidKey;\n this.uidVal = uidVal;\n this.aud = aud;\n this.jwt = jwt;\n this.proof = proof;\n\n this.signingScheme = SigningScheme.SingleKey;\n const pepperBytes = Hex.fromHexInput(pepper).toUint8Array();\n if (pepperBytes.length !== KeylessAccount.PEPPER_LENGTH) {\n throw new Error(`Pepper length in bytes should be ${KeylessAccount.PEPPER_LENGTH}`);\n }\n this.pepper = pepperBytes;\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeStr(this.jwt);\n serializer.serializeStr(this.uidKey);\n serializer.serializeFixedBytes(this.pepper);\n this.ephemeralKeyPair.serialize(serializer);\n this.proof.serialize(serializer);\n }\n\n static deserialize(deserializer: Deserializer): KeylessAccount {\n const jwt = deserializer.deserializeStr();\n const uidKey = deserializer.deserializeStr();\n const pepper = deserializer.deserializeFixedBytes(31);\n const ephemeralKeyPair = EphemeralKeyPair.deserialize(deserializer);\n const proof = SignedGroth16Signature.deserialize(deserializer);\n return KeylessAccount.fromJWTAndProof({\n proof,\n pepper,\n uidKey,\n jwt,\n ephemeralKeyPair,\n });\n }\n\n bcsToBytes(): Uint8Array {\n const serializer = new Serializer();\n this.serialize(serializer);\n return serializer.toUint8Array();\n }\n\n bcsToHex(): Hex {\n const bcsBytes = this.bcsToBytes();\n return Hex.fromHexInput(bcsBytes);\n }\n\n signWithAuthenticator(transaction: AnyRawTransaction): AccountAuthenticatorSingleKey {\n const raw = deriveTransactionType(transaction);\n const signature = new AnySignature(this.sign(raw.bcsToBytes()));\n const publicKey = new AnyPublicKey(this.publicKey);\n return new AccountAuthenticatorSingleKey(publicKey, signature);\n }\n\n async waitForProofFetch() {\n if (this.proof instanceof Promise) {\n await this.proof;\n }\n }\n\n sign(data: HexInput): Signature {\n const { expiryDateSecs } = this.ephemeralKeyPair;\n const currentTimeInSeconds = Math.floor(new Date().getTime() / 1000);\n if (expiryDateSecs < currentTimeInSeconds) {\n throw new Error(\"Ephemeral key pair is expired.\");\n }\n if (this.proof instanceof Promise) {\n throw new Error(\"Failed to fetch proof.\");\n }\n const jwtHeader = this.jwt.split(\".\")[0];\n const ephemeralPublicKey = this.ephemeralKeyPair.getPublicKey();\n\n const serializer = new Serializer();\n serializer.serializeFixedBytes(Hex.fromHexInput(data).toUint8Array());\n serializer.serializeOption(this.proof.proof);\n const signMess = generateSigningMessage(serializer.toUint8Array(), \"APTOS::TransactionAndProof\");\n\n const ephemeralSignature = this.ephemeralKeyPair.sign(signMess);\n\n return new KeylessSignature({\n jwtHeader: base64UrlDecode(jwtHeader),\n openIdSignatureOrZkProof: new OpenIdSignatureOrZkProof(this.proof),\n expiryDateSecs,\n ephemeralPublicKey,\n ephemeralSignature,\n });\n }\n\n signTransaction(transaction: AnyRawTransaction): Signature {\n const raw = deriveTransactionType(transaction);\n return this.sign(raw.bcsToBytes());\n }\n\n signWithOpenIdSignature(data: HexInput): Signature {\n const [jwtHeader, jwtPayload, jwtSignature] = this.jwt.split(\".\");\n const openIdSig = new OpenIdSignature({\n jwtSignature,\n jwtPayloadJson: jwtPayload,\n uidKey: this.uidKey,\n epkBlinder: this.ephemeralKeyPair.blinder,\n pepper: this.pepper,\n });\n\n const { expiryDateSecs } = this.ephemeralKeyPair;\n const ephemeralPublicKey = this.ephemeralKeyPair.getPublicKey();\n const ephemeralSignature = this.ephemeralKeyPair.sign(data);\n return new KeylessSignature({\n jwtHeader,\n openIdSignatureOrZkProof: new OpenIdSignatureOrZkProof(openIdSig),\n expiryDateSecs,\n ephemeralPublicKey,\n ephemeralSignature,\n });\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars, class-methods-use-this\n verifySignature(args: { message: HexInput; signature: Signature }): boolean {\n return true;\n }\n\n static fromBytes(bytes: Uint8Array): KeylessAccount {\n return KeylessAccount.deserialize(new Deserializer(bytes));\n }\n\n static fromJWTAndProof(args: {\n proof: SignedGroth16Signature;\n jwt: string;\n ephemeralKeyPair: EphemeralKeyPair;\n pepper: HexInput;\n uidKey?: string;\n }): KeylessAccount {\n const { proof, jwt, ephemeralKeyPair, pepper } = args;\n const uidKey = args.uidKey ?? \"sub\";\n\n const jwtPayload = jwtDecode<JwtPayload & { [key: string]: string }>(jwt);\n const iss = jwtPayload.iss!;\n if (typeof jwtPayload.aud !== \"string\") {\n throw new Error(\"aud was not found or an array of values\");\n }\n const aud = jwtPayload.aud!;\n const uidVal = jwtPayload[uidKey];\n return new KeylessAccount({\n proof,\n ephemeralKeyPair,\n iss,\n uidKey,\n uidVal,\n aud,\n pepper,\n jwt,\n });\n }\n\n static fromDerivationPath(path: string, seed: Uint8Array): Uint8Array {\n return fromDerivationPathInner(path, KeylessAccount.SLIP_0010_SEED, seed);\n }\n}\n"],"mappings":"2cAGA,OAAqB,aAAAA,MAAiB,aACtC,OAAS,UAAAC,MAAc,UAwBvB,SAASC,EAAgBC,EAA2B,CAElD,IAAMC,EAASD,EAAU,QAAQ,KAAM,GAAG,EAAE,QAAQ,KAAM,GAAG,EAGvDE,EAAeD,EAAS,KAAK,UAAU,GAAI,EAAKA,EAAO,OAAS,GAAM,CAAC,EAK7E,OAFsBE,EAAOD,CAAY,CAG3C,CAEO,IAAME,EAAN,MAAMA,CAAkC,CAyB7C,YAAYC,EAUT,CACD,GAAM,CAAE,QAAAC,EAAS,iBAAAC,EAAkB,IAAAC,EAAK,OAAAC,EAAQ,OAAAC,EAAQ,IAAAC,EAAK,OAAAC,EAAQ,MAAAC,EAAO,IAAAC,CAAI,EAAIT,EACpF,KAAK,iBAAmBE,EACxB,IAAMQ,EAAcC,EAAmBX,CAAI,EAC3C,KAAK,UAAY,IAAIY,EAAiBT,EAAKO,CAAW,EACtD,KAAK,eAAiBT,EAAUY,EAAe,KAAKZ,CAAO,EAAI,KAAK,UAAU,QAAQ,EAAE,eAAe,EACvG,KAAK,OAASG,EACd,KAAK,OAASC,EACd,KAAK,IAAMC,EACX,KAAK,IAAMG,EACX,KAAK,MAAQD,EAEb,KAAK,cAAgB,EACrB,IAAMM,EAAcC,EAAI,aAAaR,CAAM,EAAE,aAAa,EAC1D,GAAIO,EAAY,SAAWf,EAAe,cACxC,MAAM,IAAI,MAAM,oCAAoCA,EAAe,aAAa,EAAE,EAEpF,KAAK,OAASe,CAChB,CAEA,UAAUE,EAA8B,CACtCA,EAAW,aAAa,KAAK,GAAG,EAChCA,EAAW,aAAa,KAAK,MAAM,EACnCA,EAAW,oBAAoB,KAAK,MAAM,EAC1C,KAAK,iBAAiB,UAAUA,CAAU,EAC1C,KAAK,MAAM,UAAUA,CAAU,CACjC,CAEA,OAAO,YAAYC,EAA4C,CAC7D,IAAMR,EAAMQ,EAAa,eAAe,EAClCb,EAASa,EAAa,eAAe,EACrCV,EAASU,EAAa,sBAAsB,EAAE,EAC9Cf,EAAmBgB,EAAiB,YAAYD,CAAY,EAC5DT,EAAQW,EAAuB,YAAYF,CAAY,EAC7D,OAAOlB,EAAe,gBAAgB,CACpC,MAAAS,EACA,OAAAD,EACA,OAAAH,EACA,IAAAK,EACA,iBAAAP,CACF,CAAC,CACH,CAEA,YAAyB,CACvB,IAAMc,EAAa,IAAII,EACvB,YAAK,UAAUJ,CAAU,EAClBA,EAAW,aAAa,CACjC,CAEA,UAAgB,CACd,IAAMK,EAAW,KAAK,WAAW,EACjC,OAAON,EAAI,aAAaM,CAAQ,CAClC,CAEA,sBAAsBC,EAA+D,CACnF,IAAMC,EAAMC,EAAsBF,CAAW,EACvCG,EAAY,IAAIC,EAAa,KAAK,KAAKH,EAAI,WAAW,CAAC,CAAC,EACxDI,EAAY,IAAIC,EAAa,KAAK,SAAS,EACjD,OAAO,IAAIC,EAA8BF,EAAWF,CAAS,CAC/D,CAEA,MAAM,mBAAoB,CACpB,KAAK,iBAAiB,SACxB,MAAM,KAAK,KAEf,CAEA,KAAKK,EAA2B,CAC9B,GAAM,CAAE,eAAAC,CAAe,EAAI,KAAK,iBAC1BC,EAAuB,KAAK,MAAM,IAAI,KAAK,EAAE,QAAQ,EAAI,GAAI,EACnE,GAAID,EAAiBC,EACnB,MAAM,IAAI,MAAM,gCAAgC,EAElD,GAAI,KAAK,iBAAiB,QACxB,MAAM,IAAI,MAAM,wBAAwB,EAE1C,IAAMC,EAAY,KAAK,IAAI,MAAM,GAAG,EAAE,CAAC,EACjCC,EAAqB,KAAK,iBAAiB,aAAa,EAExDlB,EAAa,IAAII,EACvBJ,EAAW,oBAAoBD,EAAI,aAAae,CAAI,EAAE,aAAa,CAAC,EACpEd,EAAW,gBAAgB,KAAK,MAAM,KAAK,EAC3C,IAAMmB,EAAWC,EAAuBpB,EAAW,aAAa,EAAG,4BAA4B,EAEzFqB,EAAqB,KAAK,iBAAiB,KAAKF,CAAQ,EAE9D,OAAO,IAAIG,EAAiB,CAC1B,UAAW5C,EAAgBuC,CAAS,EACpC,yBAA0B,IAAIM,EAAyB,KAAK,KAAK,EACjE,eAAAR,EACA,mBAAAG,EACA,mBAAAG,CACF,CAAC,CACH,CAEA,gBAAgBf,EAA2C,CACzD,IAAMC,EAAMC,EAAsBF,CAAW,EAC7C,OAAO,KAAK,KAAKC,EAAI,WAAW,CAAC,CACnC,CAEA,wBAAwBO,EAA2B,CACjD,GAAM,CAACG,EAAWO,EAAYC,CAAY,EAAI,KAAK,IAAI,MAAM,GAAG,EAC1DC,EAAY,IAAIC,EAAgB,CACpC,aAAAF,EACA,eAAgBD,EAChB,OAAQ,KAAK,OACb,WAAY,KAAK,iBAAiB,QAClC,OAAQ,KAAK,MACf,CAAC,EAEK,CAAE,eAAAT,CAAe,EAAI,KAAK,iBAC1BG,EAAqB,KAAK,iBAAiB,aAAa,EACxDG,EAAqB,KAAK,iBAAiB,KAAKP,CAAI,EAC1D,OAAO,IAAIQ,EAAiB,CAC1B,UAAAL,EACA,yBAA0B,IAAIM,EAAyBG,CAAS,EAChE,eAAAX,EACA,mBAAAG,EACA,mBAAAG,CACF,CAAC,CACH,CAGA,gBAAgBrC,EAA4D,CAC1E,MAAO,EACT,CAEA,OAAO,UAAU4C,EAAmC,CAClD,OAAO7C,EAAe,YAAY,IAAI8C,EAAaD,CAAK,CAAC,CAC3D,CAEA,OAAO,gBAAgB5C,EAMJ,CACjB,GAAM,CAAE,MAAAQ,EAAO,IAAAC,EAAK,iBAAAP,EAAkB,OAAAK,CAAO,EAAIP,EAC3CI,EAASJ,EAAK,QAAU,MAExBwC,EAAaM,EAAkDrC,CAAG,EAClEN,EAAMqC,EAAW,IACvB,GAAI,OAAOA,EAAW,KAAQ,SAC5B,MAAM,IAAI,MAAM,yCAAyC,EAE3D,IAAMlC,EAAMkC,EAAW,IACjBnC,EAASmC,EAAWpC,CAAM,EAChC,OAAO,IAAIL,EAAe,CACxB,MAAAS,EACA,iBAAAN,EACA,IAAAC,EACA,OAAAC,EACA,OAAAC,EACA,IAAAC,EACA,OAAAC,EACA,IAAAE,CACF,CAAC,CACH,CAEA,OAAO,mBAAmBsC,EAAcC,EAA8B,CACpE,OAAOC,EAAwBF,EAAMhD,EAAe,eAAgBiD,CAAI,CAC1E,CACF,EAtMajD,EACK,cAAwB,GAD7BA,EAGK,eAAyB,WAHpC,IAAMmD,EAANnD","names":["jwtDecode","decode","base64UrlDecode","base64Url","base64","paddedBase64","decode","_KeylessAccount","args","address","ephemeralKeyPair","iss","uidKey","uidVal","aud","pepper","proof","jwt","addressSeed","computeAddressSeed","KeylessPublicKey","AccountAddress","pepperBytes","Hex","serializer","deserializer","EphemeralKeyPair","SignedGroth16Signature","Serializer","bcsBytes","transaction","raw","deriveTransactionType","signature","AnySignature","publicKey","AnyPublicKey","AccountAuthenticatorSingleKey","data","expiryDateSecs","currentTimeInSeconds","jwtHeader","ephemeralPublicKey","signMess","generateSigningMessage","ephemeralSignature","KeylessSignature","OpenIdSignatureOrZkProof","jwtPayload","jwtSignature","openIdSig","OpenIdSignature","bytes","Deserializer","jwtDecode","path","seed","fromDerivationPath","KeylessAccount"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as a}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{c as a}from"./chunk-L4VMX4P3.mjs";import e from"eventemitter3";var i=class extends e{constructor(t){super();this.config=t}start(t){let{sender:n}=t;this.account=n,this.transactionWorker=new a(this.config,n),this.transactionWorker.start(),this.registerToEvents()}push(t){let{data:n,options:o}=t;for(let r of n)this.transactionWorker.push(r,o)}registerToEvents(){this.transactionWorker.on("transactionSent",async t=>{this.emit("transactionSent",t)}),this.transactionWorker.on("transactionSendFailed",async t=>{this.emit("transactionSendFailed",t)}),this.transactionWorker.on("transactionExecuted",async t=>{this.emit("transactionExecuted",t)}),this.transactionWorker.on("transactionExecutionFailed",async t=>{this.emit("transactionExecutionFailed",t)}),this.transactionWorker.on("executionFinish",async t=>{this.emit("executionFinish",t)})}forSingleAccount(t){try{let{sender:n,data:o,options:r}=t;this.start({sender:n}),this.push({data:o,options:r})}catch(n){throw new Error(`failed to submit transactions with error: ${n}`)}}};export{i as a};
|
|
2
|
+
//# sourceMappingURL=chunk-HVNZOMAF.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as f}from"./chunk-T23OVRNF.mjs";import{a as m,b as a,c as g}from"./chunk-EB7AI4B4.mjs";import{a as r}from"./chunk-3FVRXELT.mjs";import{a as i,b as o,c as u,d as s,e as c,f as p,g as y}from"./chunk-6RBUXB5I.mjs";function M(n){return typeof n=="boolean"}function D(n){return typeof n=="string"}function N(n){return typeof n=="number"}function P(n){return typeof n=="number"||typeof n=="bigint"||typeof n=="string"}function w(n){return n==null}function G(n){return A(n)||x(n)||S(n)||B(n)||U(n)||I(n)||b(n)||T(n)||E(n)||d(n)||n instanceof m||n instanceof g}function A(n){return n instanceof i}function T(n){return n instanceof f}function E(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 c}function I(n){return n instanceof p}function b(n){return n instanceof y}function $(n){return"bytecode"in n}function R(n,t){throw new Error(`Type mismatch for argument ${t}, expected '${n}'`)}function W(n){let t=n.params.findIndex(e=>e!=="signer"&&e!=="&signer");return t<0?n.params.length:t}function L(n){let t=n.split("::");if(t.length!==3)throw new Error(`Invalid function ${n}`);let e=t[0],F=t[1],l=t[2];return{moduleAddress:e,moduleName:F,functionName:l}}export{M as a,D as b,N as c,P as d,w as e,G as f,A as g,T as h,E as i,d as j,x as k,S as l,B as m,U as n,I as o,b as p,$ as q,R as r,W as s,L as t};
|
|
2
|
+
//# sourceMappingURL=chunk-JTCWZB3Q.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as u,b as l}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as u,b as l}from"./chunk-6M6XXPQQ.mjs";import{b as g}from"./chunk-COW5IGYC.mjs";import{a as f}from"./chunk-STYDBDYL.mjs";import{a as m}from"./chunk-7STYQ5ZE.mjs";function p(y){let o=y;return o-=o>>1&1431655765,o=(o&858993459)+(o>>2&858993459),(o+(o>>4)&252645135)*16843009>>24}var d=class y extends g{constructor(e){super();let{publicKeys:i,signaturesRequired:t}=e;if(t<1)throw new Error("The number of required signatures needs to be greater than 0");if(i.length<t)throw new Error(`Provided ${i.length} public keys is smaller than the ${t} required signatures`);this.publicKeys=i.map(r=>r instanceof u?r:new u(r)),this.signaturesRequired=t}verifySignature(e){throw new Error("not implemented")}authKey(){return m.fromSchemeAndBytes({scheme:3,input:this.toUint8Array()})}toUint8Array(){return this.bcsToBytes()}serialize(e){e.serializeVector(this.publicKeys),e.serializeU8(this.signaturesRequired)}static deserialize(e){let i=e.deserializeVector(u),t=e.deserializeU8();return new y({publicKeys:i,signaturesRequired:t})}createBitmap(e){let{bits:i}=e,t=128,r=new Uint8Array([0,0,0,0]),s=new Set;return i.forEach((n,c)=>{if(c+1>this.publicKeys.length)throw new Error(`Signature index ${c+1} is out of public keys range, ${this.publicKeys.length}.`);if(s.has(n))throw new Error(`Duplicate bit ${n} detected.`);s.add(n);let h=Math.floor(n/8),b=r[h];b|=t>>n%8,r[h]=b}),r}getIndex(e){let i=e instanceof u?e:new u(e),t=this.publicKeys.findIndex(r=>r.toString()===i.toString());if(t!==-1)return t;throw new Error("Public key not found in MultiKey")}},a=class a extends f{constructor(e){super();let{signatures:i,bitmap:t}=e;if(i.length>a.MAX_SIGNATURES_SUPPORTED)throw new Error(`The number of signatures cannot be greater than ${a.MAX_SIGNATURES_SUPPORTED}`);if(this.signatures=i.map(s=>s instanceof l?s:new l(s)),!(t instanceof Uint8Array))this.bitmap=a.createBitmap({bits:t});else{if(t.length!==a.BITMAP_LEN)throw new Error(`"bitmap" length should be ${a.BITMAP_LEN}`);this.bitmap=t}let r=this.bitmap.reduce((s,n)=>s+p(n),0);if(r!==this.signatures.length)throw new Error(`Expecting ${r} signatures from the bitmap, but got ${this.signatures.length}`)}static createBitmap(e){let{bits:i}=e,t=128,r=new Uint8Array([0,0,0,0]),s=new Set;return i.forEach(n=>{if(n>=a.MAX_SIGNATURES_SUPPORTED)throw new Error(`Cannot have a signature larger than ${a.MAX_SIGNATURES_SUPPORTED-1}.`);if(s.has(n))throw new Error("Duplicate bits detected.");s.add(n);let c=Math.floor(n/8),h=r[c];h|=t>>n%8,r[c]=h}),r}toUint8Array(){return this.bcsToBytes()}serialize(e){e.serializeVector(this.signatures),e.serializeBytes(this.bitmap)}static deserialize(e){let i=e.deserializeBytes(),t=i.reduce((s,n)=>s+p(n),0),r=[];for(let s=0;s<t;s+=1){let n=l.deserialize(e);r.push(n)}return new a({signatures:r,bitmap:i})}};a.BITMAP_LEN=4,a.MAX_SIGNATURES_SUPPORTED=a.BITMAP_LEN*8;var A=a;export{d as a,A as b};
|
|
2
|
+
//# sourceMappingURL=chunk-KGJITNRZ.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as l}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as l}from"./chunk-PSNM2PID.mjs";import{a as o,b as c}from"./chunk-U6Z4FNB7.mjs";import{a as h,h as d}from"./chunk-MMLFUGI5.mjs";import{g as u}from"./chunk-RXBRW27O.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,options:{timeoutSecs:3}}));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-L4VMX4P3.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as t}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as t}from"./chunk-MMLFUGI5.mjs";var o=class{constructor(n){this.config=n}async simple(n){return t({aptosConfig:this.config,...n})}async multiAgent(n){return t({aptosConfig:this.config,...n})}};export{o as a};
|
|
2
|
+
//# sourceMappingURL=chunk-LIBP67EZ.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"./chunk-6FBKUTGF.mjs";import{a as R}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a}from"./chunk-6FBKUTGF.mjs";import{a as R}from"./chunk-HB5NROHB.mjs";var c={400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",429:"Too Many Requests",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable"};async function l(s,i){let{url:u,method:n,body:d,contentType:p,params:t,overrides:e,originMethod:o}=s,r={...e?.HEADERS,"x-aptos-client":`aptos-typescript-sdk/${R}`,"content-type":p??"application/json","x-aptos-typescript-sdk-origin-method":o};return e?.AUTH_TOKEN&&(r.Authorization=`Bearer ${e?.AUTH_TOKEN}`),e?.API_KEY&&(r.Authorization=`Bearer ${e?.API_KEY}`),i.provider({url:u,method:n,body:d,params:t,headers:r,overrides:e})}async function N(s,i,u){let{url:n,path:d}=s,p=d?`${n}/${d}`:n,t=await l({...s,url:p},i.client),e={status:t.status,statusText:t.statusText,data:t.data,headers:t.headers,config:t.config,request:t.request,url:p};if(e.status===401)throw new a(s,e,`Error: ${e.data}`);if(u==="Indexer"){let r=e.data;if(r.errors)throw new a(s,e,`Indexer error: ${r.errors[0].message}`??`Indexer unhandled Error ${t.status} : ${t.statusText}`);e.data=r.data}if(e.status>=200&&e.status<300)return e;if(e.status>=500)throw new a(s,e,`${t.data}`);if(i.isPepperServiceRequest(n))throw new a(s,e,`${t.data}`);let o;throw e&&e.data&&"message"in e.data&&"error_code"in e.data?o=JSON.stringify(e.data):e.status in c?o=c[e.status]:o=`Unhandled Error ${e.status} : ${e.statusText}`,new a(s,e,`${u} error: ${o}`)}export{l as a,N as b};
|
|
2
|
+
//# sourceMappingURL=chunk-LS2FSDDC.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as r}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as r}from"./chunk-MMLFUGI5.mjs";import{f as t,i as o}from"./chunk-3VGX3TXH.mjs";import{e as n}from"./chunk-YE5B2S5L.mjs";var u={typeParameters:[{constraints:[]}],parameters:[new o,new t]};async function y(e){let{aptosConfig:i,sender:s,recipient:c,amount:p,coinType:a,options:m}=e;return r({aptosConfig:i,sender:s,data:{function:"0x1::aptos_account::transfer_coins",typeArguments:[a??n],functionArguments:[c,p],abi:u},options:m})}export{y as a};
|
|
2
|
+
//# sourceMappingURL=chunk-M3JTEH74.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as e}from"./chunk-TVRJ3M7B.mjs";var r=class t extends e{constructor(i){super();this.identifier=i}serialize(i){i.serializeStr(this.identifier)}static deserialize(i){let s=i.deserializeStr();return new t(s)}};export{r as a};
|
|
2
|
+
//# sourceMappingURL=chunk-MGOHPDX4.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as g,f as d,g as b,i as S}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as g,f as d,g as b,i as S}from"./chunk-PBAEIXWS.mjs";import{a as C}from"./chunk-S6R7FPJE.mjs";import{b as f}from"./chunk-Y76WJ62G.mjs";import{a as P}from"./chunk-FVU47J7S.mjs";import{a as w}from"./chunk-Q45JYX4F.mjs";import{a as I}from"./chunk-HINA3HEN.mjs";import{d as l}from"./chunk-D73X3S27.mjs";import{a as T}from"./chunk-NC5HHEEM.mjs";import{c as A,m as s}from"./chunk-3VGX3TXH.mjs";import{b as p}from"./chunk-T23OVRNF.mjs";import{a as r}from"./chunk-EB7AI4B4.mjs";import{b as y}from"./chunk-6RBUXB5I.mjs";async function h(t){let a=await D(t);return G(t,a)}async function D(t){let{aptosConfig:a,data:n}=t,e,o;return"bytecode"in n?o=await g(n):"multisigAddress"in n?(e={aptosConfig:a,multisigAddress:n.multisigAddress,function:n.function,functionArguments:n.functionArguments,typeArguments:n.typeArguments,abi:n.abi},o=await g(e)):(e={aptosConfig:a,function:n.function,functionArguments:n.functionArguments,typeArguments:n.typeArguments,abi:n.abi},o=await g(e)),o}async function G(t,a){let{aptosConfig:n,sender:e,options:o}=t,i;if(K(t)&&(i=p.ZERO.toString()),U(t)){let{secondarySignerAddresses:c}=t;return d({aptosConfig:n,sender:e,payload:a,options:o,secondarySignerAddresses:c,feePayerAddress:i})}return d({aptosConfig:n,sender:e,payload:a,options:o,feePayerAddress:i})}function K(t){return t.withFeePayer===!0}function U(t){return"secondarySignerAddresses"in t}function Y(t){let{transaction:a}=t;return l(a)}function _(t){let{signer:a,transaction:n}=t;return a.signWithAuthenticator(n)}async function $(t){let{aptosConfig:a,transaction:n,signerPublicKey:e,secondarySignersPublicKeys:o,feePayerPublicKey:i,options:c}=t,u=b({transaction:n,signerPublicKey:e,secondarySignersPublicKeys:o,feePayerPublicKey:i,options:c}),{data:m}=await f({aptosConfig:a,body:u,path:"transactions/simulate",params:{estimate_gas_unit_price:t.options?.estimateGasUnitPrice??!1,estimate_max_gas_amount:t.options?.estimateMaxGasAmount??!1,estimate_prioritized_gas_unit_price:t.options?.estimatePrioritizedGasUnitPrice??!1},originMethod:"simulateTransaction",contentType:"application/x.aptos.signed_transaction+bcs"});return m}async function B(t){let{aptosConfig:a}=t,n=S({...t}),{data:e}=await f({aptosConfig:a,body:n,path:"transactions",originMethod:"submitTransaction",contentType:"application/x.aptos.signed_transaction+bcs"});return e}async function M(t){let{aptosConfig:a,signer:n,transaction:e}=t;(n instanceof I||n instanceof w)&&await n.waitForProofFetch();let o=_({signer:n,transaction:e});return B({aptosConfig:a,transaction:e,senderAuthenticator:o})}var N={typeParameters:[],parameters:[s.u8(),new s(s.u8())]};async function nn(t){let{aptosConfig:a,account:n,metadataBytes:e,moduleBytecode:o,options:i}=t,c=o.map(u=>r.U8(u));return h({aptosConfig:a,sender:p.from(n),data:{function:"0x1::code::publish_package_txn",functionArguments:[r.U8(e),new r(c)],abi:N},options:i})}var F={typeParameters:[],parameters:[new A,s.u8(),new A,s.u8(),s.u8(),s.u8()]};async function tn(t){let{aptosConfig:a,fromAccount:n,toNewPrivateKey:e}=t,o=await C({aptosConfig:a,accountAddress:n.accountAddress}),i=P.fromPrivateKey({privateKey:e,legacy:!0}),u=new T({sequenceNumber:BigInt(o.sequence_number),originator:n.accountAddress,currentAuthKey:p.from(o.authentication_key),newPublicKey:i.publicKey}).bcsToBytes(),m=n.sign(u),R=i.sign(u),x=await h({aptosConfig:a,sender:n.accountAddress,data:{function:"0x1::account::rotate_authentication_key",functionArguments:[new y(n.signingScheme),r.U8(n.publicKey.toUint8Array()),new y(i.signingScheme),r.U8(i.publicKey.toUint8Array()),r.U8(m.toUint8Array()),r.U8(R.toUint8Array())],abi:F}});return M({aptosConfig:a,signer:n,transaction:x})}export{h as a,D as b,G as c,Y as d,_ as e,$ as f,B as g,M as h,nn as i,tn as j};
|
|
2
|
+
//# sourceMappingURL=chunk-MMLFUGI5.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{f as n}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{f as n}from"./chunk-SNZ4BCEF.mjs";import{p as g,u as d}from"./chunk-S4SEFF4K.mjs";import{b as s}from"./chunk-T23OVRNF.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-MOOOOZNS.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as i}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as i}from"./chunk-TVRJ3M7B.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-MWUJCP27.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as o}from"./chunk-T23OVRNF.mjs";import{a as u,b as r}from"./chunk-EB7AI4B4.mjs";import{e as t}from"./chunk-6RBUXB5I.mjs";import{a as i}from"./chunk-TVRJ3M7B.mjs";var c=class extends i{constructor(e){super();this.accountAddress=o.ONE;this.moduleName=new r("account");this.structName=new r("RotationProofChallenge");this.sequenceNumber=new t(e.sequenceNumber),this.originator=e.originator,this.currentAuthKey=e.currentAuthKey,this.newPublicKey=u.U8(e.newPublicKey.toUint8Array())}serialize(e){e.serialize(this.accountAddress),e.serialize(this.moduleName),e.serialize(this.structName),e.serialize(this.sequenceNumber),e.serialize(this.originator),e.serialize(this.currentAuthKey),e.serialize(this.newPublicKey)}};export{c as a};
|
|
2
|
+
//# sourceMappingURL=chunk-NC5HHEEM.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{d as s}from"./chunk-D73X3S27.mjs";import{d as p}from"./chunk-WPVBC4JS.mjs";import{a as y,b as u}from"./chunk-6M6XXPQQ.mjs";import{b as a}from"./chunk-PTIZKRON.mjs";import{b as i}from"./chunk-7JNPSNL6.mjs";import{b as g}from"./chunk-T23OVRNF.mjs";var m=class o{constructor(e){this.signingScheme=2;let{privateKey:r,address:t}=e;this.privateKey=r,this.publicKey=new y(r.publicKey()),this.accountAddress=t?g.from(t):this.publicKey.authKey().derivedAddress()}static generate(e={}){let{scheme:r=0}=e,t;switch(r){case 0:t=i.generate();break;case 2:t=a.generate();break;default:throw new Error(`Unsupported signature scheme ${r}`)}return new o({privateKey:t})}static fromDerivationPath(e){let{scheme:r=0,path:t,mnemonic:c}=e,n;switch(r){case 0:n=i.fromDerivationPath(t,c);break;case 2:n=a.fromDerivationPath(t,c);break;default:throw new Error(`Unsupported signature scheme ${r}`)}return new o({privateKey:n})}verifySignature(e){return this.publicKey.verifySignature(e)}signWithAuthenticator(e){let r=this.sign(s(e));return new p(this.publicKey,r)}sign(e){return new u(this.privateKey.sign(e))}signTransaction(e){return this.sign(s(e))}};export{m as a};
|
|
2
|
+
//# sourceMappingURL=chunk-OPCSBCGS.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as R,c as Q,d as Y,e as _}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as R,c as Q,d as Y,e as _}from"./chunk-SC34237T.mjs";import{q as J,t as y}from"./chunk-JTCWZB3Q.mjs";import{a as nn}from"./chunk-7PICPK26.mjs";import{a as Z}from"./chunk-S6R7FPJE.mjs";import{b as j}from"./chunk-RXBRW27O.mjs";import{a as z}from"./chunk-AH44UPM4.mjs";import{a as L}from"./chunk-SNZ4BCEF.mjs";import{g as D}from"./chunk-5VSMDXZ6.mjs";import{a as X}from"./chunk-D73X3S27.mjs";import{a as d}from"./chunk-AP3W3ZNS.mjs";import{a as H}from"./chunk-47DNXBM6.mjs";import{a as l,c as T,d as w}from"./chunk-UT37XKQU.mjs";import{c as k,d as v,e as O,f as b,g as V,h as q,i as K}from"./chunk-FEWIHUNW.mjs";import{b as x,d as B,e as E,f as F}from"./chunk-ZGTJMNZG.mjs";import{b as p,d as g,e as W}from"./chunk-WPVBC4JS.mjs";import{a as U}from"./chunk-MWUJCP27.mjs";import{b as C,c as G}from"./chunk-YE5B2S5L.mjs";import{a as M,b as N}from"./chunk-6M6XXPQQ.mjs";import{a as $,c as S}from"./chunk-7JNPSNL6.mjs";import{b as u}from"./chunk-T23OVRNF.mjs";import{b as P}from"./chunk-AOCNYMMX.mjs";import{sha3_256 as sn}from"@noble/hashes/sha3";async function Un(n){if(J(n))return dn(n);let{moduleAddress:e,moduleName:t,functionName:o}=y(n.function),r=await en({key:"entry-function",moduleAddress:e,moduleName:t,functionName:o,aptosConfig:n.aptosConfig,abi:n.abi,fetch:Q});return cn({...n,abi:r})}function cn(n){let e=n.abi,{moduleAddress:t,moduleName:o,functionName:r}=y(n.function),a=R(n.typeArguments);if(a.length!==e.typeParameters.length)throw new Error(`Type argument count mismatch, expected ${e.typeParameters.length}, received ${a.length}`);let i=n.functionArguments.map((s,m)=>_(n.function,e,s,m,a));if(i.length!==e.parameters.length)throw new Error(`Too few arguments for '${t}::${o}::${r}', expected ${e.parameters.length} but got ${i.length}`);let c=b.build(`${t}::${o}`,r,a,i);if("multisigAddress"in n){let s=u.from(n.multisigAddress);return new O(new q(s,new K(c)))}return new v(c)}async function kn(n){let{moduleAddress:e,moduleName:t,functionName:o}=y(n.function),r=await en({key:"view-function",moduleAddress:e,moduleName:t,functionName:o,aptosConfig:n.aptosConfig,abi:n.abi,fetch:Y});return un({abi:r,...n})}function un(n){let e=n.abi,{moduleAddress:t,moduleName:o,functionName:r}=y(n.function),a=R(n.typeArguments);if(a.length!==e.typeParameters.length)throw new Error(`Type argument count mismatch, expected ${e.typeParameters.length}, received ${a.length}`);let i=n?.functionArguments?.map((c,s)=>_(n.function,e,c,s,a))??[];if(i.length!==e.parameters.length)throw new Error(`Too few arguments for '${t}::${o}::${r}', expected ${e.parameters.length} but got ${i.length}`);return b.build(`${t}::${o}`,r,a,i)}function dn(n){return new k(new V(P.fromHexInput(n.bytecode).toUint8Array(),n.typeArguments??[],n.functionArguments))}async function mn(n){let{aptosConfig:e,sender:t,payload:o,options:r,feePayerAddress:a}=n,i=async()=>D[e.network]?{chainId:D[e.network]}:{chainId:(await L({aptosConfig:e})).chain_id},c=async()=>r?.gasUnitPrice?{gasEstimate:r.gasUnitPrice}:{gasEstimate:(await j({aptosConfig:e})).gas_estimate},s=async()=>{let f=async()=>r?.accountSequenceNumber!==void 0?r.accountSequenceNumber:(await Z({aptosConfig:e,accountAddress:t})).sequence_number;if(a&&u.from(a).equals(u.ZERO))try{return await f()}catch{return 0}else return f()},[{chainId:m},{gasEstimate:A},I]=await Promise.all([i(),c(),s()]),{maxGasAmount:an,gasUnitPrice:rn,expireTimestamp:on}={maxGasAmount:r?.maxGasAmount?BigInt(r.maxGasAmount):BigInt(2e5),gasUnitPrice:BigInt(A),expireTimestamp:BigInt(Math.floor(Date.now()/1e3)+20),...r};return new l(u.from(t),BigInt(I),o,BigInt(an),BigInt(rn),BigInt(on),new U(m))}async function vn(n){let{aptosConfig:e,sender:t,payload:o,options:r,feePayerAddress:a}=n,i=await mn({aptosConfig:e,sender:t,payload:o,options:r,feePayerAddress:a});if("secondarySignerAddresses"in n){let c=n.secondarySignerAddresses?.map(s=>u.from(s))??[];return new nn(i,c,n.feePayerAddress?u.from(n.feePayerAddress):void 0)}return new H(i,n.feePayerAddress?u.from(n.feePayerAddress):void 0)}function On(n){let{signerPublicKey:e,transaction:t,secondarySignersPublicKeys:o,feePayerPublicKey:r}=n,a=h(e);if(t.feePayerAddress){let c=new w(t.rawTransaction,t.secondarySignerAddresses??[],t.feePayerAddress),s=[];o&&(s=o.map(I=>h(I)));let m=h(r),A=new E(a,t.secondarySignerAddresses??[],s,{address:t.feePayerAddress,authenticator:m});return new d(c.raw_txn,A).bcsToBytes()}if(t.secondarySignerAddresses){let c=new T(t.rawTransaction,t.secondarySignerAddresses),s=[];s=o.map(A=>h(A));let m=new B(a,t.secondarySignerAddresses,s);return new d(c.raw_txn,m).bcsToBytes()}let i;if(a instanceof p)i=new x(a.public_key,a.signature);else if(a instanceof g)i=new F(a);else throw new Error("Invalid public key");return new d(t.rawTransaction,i).bcsToBytes()}function h(n){return n instanceof M?new g(n,new N(new S(new Uint8Array(64)))):new p(new $(n.toUint8Array()),new S(new Uint8Array(64)))}function An(n){let{transaction:e,senderAuthenticator:t,feePayerAuthenticator:o,additionalSignersAuthenticators:r}=n,a=X(e);if((o||r)&&(a instanceof T||a instanceof w))return fn(a,t,o,r);if(t instanceof p&&a instanceof l){let i=new x(t.public_key,t.signature);return new d(a,i).bcsToBytes()}if((t instanceof g||t instanceof W)&&a instanceof l){let i=new F(t);return new d(a,i).bcsToBytes()}throw new Error(`Cannot generate a signed transaction, ${t} is not a supported account authentication scheme`)}function tn(n){let e=sn.create();for(let t of n)e.update(t);return e.digest()}var yn=tn(["APTOS::Transaction"]);function Vn(n){let e=An(n);return new P(tn([yn,new Uint8Array([0]),e])).toString()}function fn(n,e,t,o){if(n instanceof w){if(!t)throw new Error("Must provide a feePayerAuthenticator argument to generate a signed fee payer transaction");let r=new E(e,n.secondary_signer_addresses,o??[],{address:n.fee_payer_address,authenticator:t});return new d(n.raw_txn,r).bcsToBytes()}if(n instanceof T){if(!o)throw new Error("Must provide a additionalSignersAuthenticators argument to generate a signed multi agent transaction");let r=new B(e,n.secondary_signer_addresses,o??[]);return new d(n.raw_txn,r).bcsToBytes()}throw new Error(`Cannot prepare multi signers transaction to submission, ${typeof n} transaction is not supported`)}async function en({key:n,moduleAddress:e,moduleName:t,functionName:o,aptosConfig:r,abi:a,fetch:i}){return a!==void 0?a:z(async()=>i(e,t,o,r),`${n}-${r.network}-${e}-${t}-${o}`,1e3*60*5)()}export{Un as a,cn as b,kn as c,un as d,mn as e,vn as f,On as g,h,An as i,tn as j,Vn as k,fn as l};
|
|
2
|
+
//# sourceMappingURL=chunk-PBAEIXWS.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as l,c as f,d as x,e as v,f as U,g as A,h as P,i as C,j as y,k as E,l as b,m as I,n as G,o as M}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as l,c as f,d as x,e as v,f as U,g as A,h as P,i as C,j as y,k as E,l as b,m as I,n as G,o as M}from"./chunk-3VGX3TXH.mjs";import{a as d}from"./chunk-MGOHPDX4.mjs";import{b as w}from"./chunk-T23OVRNF.mjs";function N(e){return!!e.match(/^[_a-zA-Z0-9]+$/)}function V(e){return!!e.match(/\s/)}function $(e){return!!e.match(/^T[0-9]+$/)}function F(e,n){let i=n;for(;i<e.length;i+=1){let c=e[i];if(!V(c))break}return i}var S=(t=>(t.InvalidTypeTag="unknown type",t.UnexpectedGenericType="unexpected generic type",t.UnexpectedTypeArgumentClose="unexpected '>'",t.UnexpectedWhitespaceCharacter="unexpected whitespace character",t.UnexpectedComma="unexpected ','",t.TypeArgumentCountMismatch="type argument count doesn't match expected amount",t.MissingTypeArgumentClose="no matching '>' for '<'",t.UnexpectedPrimitiveTypeArguments="primitive types not expected to have type arguments",t.UnexpectedVectorTypeArgumentCount="vector type expected to have exactly one type argument",t.UnexpectedStructFormat="unexpected struct format, must be of the form 0xaddress::module_name::struct_name",t.InvalidModuleNameCharacter="module name must only contain alphanumeric or '_' characters",t.InvalidStructNameCharacter="struct name must only contain alphanumeric or '_' characters",t))(S||{}),r=class extends Error{constructor(n,i){super(`Failed to parse typeTag '${n}', ${i}`)}};function Z(e,n){let i=n?.allowGenerics??!1,c=[],o=[],p=[],T=0,a="",u=1;for(;T<e.length;){let g=e[T];if(g==="<")c.push({savedExpectedTypes:u,savedStr:a,savedTypes:p}),a="",p=[],u=1;else if(g===">"){if(a!==""){let _=m(a,o,i);p.push(_)}let s=c.pop();if(s===void 0)throw new r(e,"unexpected '>'");if(u!==p.length)throw new r(e,"type argument count doesn't match expected amount");let{savedStr:h,savedTypes:t,savedExpectedTypes:W}=s;o=p,p=t,a=h,u=W}else if(g===","){if(a.length!==0){let s=m(a,o,i);o=[],p.push(s),a="",u+=1}}else if(V(g)){let s=!1;if(a.length!==0){let t=m(a,o,i);o=[],p.push(t),a="",s=!0}T=F(e,T);let h=e[T];if(T<e.length&&s&&h!==","&&h!==">")throw new r(e,"unexpected whitespace character");continue}else a+=g;T+=1}if(c.length>0)throw new r(e,"no matching '>' for '<'");switch(p.length){case 0:return m(a,o,i);case 1:if(a==="")return p[0];throw new r(e,"unexpected ','");default:throw new r(e,"unexpected whitespace character")}}function m(e,n,i){switch(e){case"&signer":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new E(new y);case"signer":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new y;case"bool":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new l;case"address":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new C;case"u8":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new f;case"u16":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new x;case"u32":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new v;case"u64":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new U;case"u128":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new A;case"u256":if(n.length>0)throw new r(e,"primitive types not expected to have type arguments");return new P;case"vector":if(n.length!==1)throw new r(e,"vector type expected to have exactly one type argument");return new I(n[0]);default:if($(e)){if(i)return new b(Number(e.split("T")[1]));throw new r(e,"unexpected generic type")}if(!e.match(/:/))throw new r(e,"unknown type");let c=e.split("::");if(c.length!==3)throw new r(e,"unexpected struct format, must be of the form 0xaddress::module_name::struct_name");if(!N(c[1]))throw new r(e,"module name must only contain alphanumeric or '_' characters");if(!N(c[2]))throw new r(e,"struct name must only contain alphanumeric or '_' characters");return new G(new M(w.fromString(c[0]),new d(c[1]),new d(c[2]),n))}}export{S as a,r as b,Z as c};
|
|
2
|
+
//# sourceMappingURL=chunk-PFFAQZHT.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-UXW3KCDT.mjs";import{a as n}from"./chunk-QRFKEZVG.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-PJEWWA6X.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-S6R7FPJE.mjs";import{a as e}from"./chunk-3JPVQHOR.mjs";var n=()=>Math.floor(Date.now()/1e3),r=class{constructor(t,i,o,a,c){this.lastUncommintedNumber=null;this.currentNumber=null;this.lock=!1;this.aptosConfig=t,this.account=i,this.maxWaitTime=o,this.maximumInFlight=a,this.sleepTime=c}async nextSequenceNumber(){for(;this.lock;)await e(this.sleepTime);this.lock=!0;let t=BigInt(0);try{if((this.lastUncommintedNumber===null||this.currentNumber===null)&&await this.initialize(),this.currentNumber-this.lastUncommintedNumber>=this.maximumInFlight){await this.update();let i=n();for(;this.currentNumber-this.lastUncommintedNumber>=this.maximumInFlight;)await e(this.sleepTime),n()-i>this.maxWaitTime?(console.warn(`Waited over 30 seconds for a transaction to commit, resyncing ${this.account.accountAddress.toString()}`),await this.initialize()):await this.update()}t=this.currentNumber,this.currentNumber+=BigInt(1)}catch(i){console.error("error in getting next sequence number for this account",i)}finally{this.lock=!1}return t}async initialize(){let{sequence_number:t}=await s({aptosConfig:this.aptosConfig,accountAddress:this.account.accountAddress});this.currentNumber=BigInt(t),this.lastUncommintedNumber=BigInt(t)}async update(){let{sequence_number:t}=await s({aptosConfig:this.aptosConfig,accountAddress:this.account.accountAddress});return this.lastUncommintedNumber=BigInt(t),this.lastUncommintedNumber}async synchronize(){if(this.lastUncommintedNumber!==this.currentNumber){for(;this.lock;)await e(this.sleepTime);this.lock=!0;try{await this.update();let t=n();for(;this.lastUncommintedNumber!==this.currentNumber;)n()-t>this.maxWaitTime?(console.warn(`Waited over 30 seconds for a transaction to commit, resyncing ${this.account.accountAddress.toString()}`),await this.initialize()):(await e(this.sleepTime),await this.update())}catch(t){console.error("error in synchronizing this account sequence number with the one on chain",t)}finally{this.lock=!1}}}};export{r as a};
|
|
2
|
+
//# sourceMappingURL=chunk-PSNM2PID.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as d}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as d}from"./chunk-COW5IGYC.mjs";import{a as v}from"./chunk-STYDBDYL.mjs";import{a as u}from"./chunk-TJDC5PWD.mjs";import{f as h,l as f}from"./chunk-S5HG2QUD.mjs";import{a as g}from"./chunk-TVRJ3M7B.mjs";import{b as s}from"./chunk-AOCNYMMX.mjs";import{sha3_256 as A}from"@noble/hashes/sha3";import{secp256k1 as o}from"@noble/curves/secp256k1";import{HDKey as U}from"@scure/bip32";var n=class n extends d{constructor(e){super();let r=s.fromHexInput(e);if(r.toUint8Array().length!==n.LENGTH)throw new Error(`PublicKey length should be ${n.LENGTH}`);this.key=r}verifySignature(e){let{message:r,signature:i}=e;if(!(i instanceof y))return!1;let l=u(r),c=s.fromHexInput(l).toUint8Array(),x=A(c),S=i.toUint8Array();return o.verify(S,x,this.key.toUint8Array(),{lowS:!0})}toUint8Array(){return this.key.toUint8Array()}serialize(e){e.serializeBytes(this.key.toUint8Array())}static deserialize(e){let r=e.deserializeBytes();return new n(r)}static isPublicKey(e){return e instanceof n}};n.LENGTH=65;var m=n,t=class t extends g{constructor(e){super();let r=s.fromHexInput(e);if(r.toUint8Array().length!==t.LENGTH)throw new Error(`PrivateKey length should be ${t.LENGTH}`);this.key=r}static generate(){let e=o.utils.randomPrivateKey();return new t(e)}static fromDerivationPath(e,r){if(!h(e))throw new Error(`Invalid derivation path ${e}`);return t.fromDerivationPathInner(e,f(r))}static fromDerivationPathInner(e,r){let{privateKey:i}=U.fromMasterSeed(r).derive(e);if(i===null)throw new Error("Invalid key");return new t(i)}sign(e){let r=u(e),i=s.fromHexInput(r),l=A(i.toUint8Array()),c=o.sign(l,this.key.toUint8Array(),{lowS:!0});return new y(c.toCompactRawBytes())}publicKey(){let e=o.getPublicKey(this.key.toUint8Array(),!1);return new m(e)}toUint8Array(){return this.key.toUint8Array()}toString(){return this.key.toString()}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let r=e.deserializeBytes();return new t(r)}static isPrivateKey(e){return e instanceof t}};t.LENGTH=32;var H=t,a=class a extends v{constructor(e){super();let r=s.fromHexInput(e);if(r.toUint8Array().length!==a.LENGTH)throw new Error(`Signature length should be ${a.LENGTH}, received ${r.toUint8Array().length}`);this.data=r}toUint8Array(){return this.data.toUint8Array()}serialize(e){e.serializeBytes(this.data.toUint8Array())}static deserialize(e){let r=e.deserializeBytes();return new a(r)}};a.LENGTH=64;var y=a;export{m as a,H as b,y as c};
|
|
2
|
+
//# sourceMappingURL=chunk-PTIZKRON.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a}from"./chunk-HINA3HEN.mjs";import{e as u}from"./chunk-WPVBC4JS.mjs";import{a as o,b as r}from"./chunk-KGJITNRZ.mjs";var g=class c{constructor(t){let{multiKey:i,signers:s}=t;this.publicKey=i,this.signers=s,this.signingScheme=3,this.accountAddress=this.publicKey.authKey().derivedAddress();let e=[];for(let n of s)e.push(this.publicKey.getIndex(n.publicKey));this.signaturesBitmap=this.publicKey.createBitmap({bits:e})}static fromPublicKeysAndSigners(t){let{publicKeys:i,signaturesRequired:s,signers:e}=t,n=new o({publicKeys:i,signaturesRequired:s});return new c({multiKey:n,signers:e})}static isMultiKeySigner(t){return t instanceof c}signWithAuthenticator(t){return new u(this.publicKey,this.signTransaction(t))}async waitForProofFetch(){let t=this.signers.filter(i=>i instanceof a);await Promise.all(t.filter(i=>i.proof instanceof Promise).map(i=>i.proof))}sign(t){let i=[];for(let s of this.signers)i.push(s.sign(t));return new r({signatures:i,bitmap:this.signaturesBitmap})}signTransaction(t){let i=[];for(let s of this.signers)i.push(s.signTransaction(t));return new r({signatures:i,bitmap:this.signaturesBitmap})}verifySignature(t){return!0}};export{g as a};
|
|
2
|
+
//# sourceMappingURL=chunk-Q45JYX4F.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{h as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{h as e}from"./chunk-RXBRW27O.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-QRFKEZVG.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as g}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as g}from"./chunk-AKEMNKDV.mjs";import{a as m}from"./chunk-MMLFUGI5.mjs";import{f as A}from"./chunk-SNZ4BCEF.mjs";import{t as f}from"./chunk-S4SEFF4K.mjs";import{b as w}from"./chunk-T23OVRNF.mjs";var T=["A name must be between 3 and 63 characters long,","and can only contain lowercase a-z, 0-9, and hyphens.","A name may not start or end with a hyphen."].join(" ");function E(e){return!(!e||e.length<3||e.length>63||!/^[a-z\d][a-z\d-]{1,61}[a-z\d]$/.test(e))}function c(e){let[n,t,...o]=e.replace(/\.apt$/,"").split(".");if(o.length>0)throw new Error(`${e} is invalid. A name can only have two parts, a domain and a subdomain separated by a "."`);if(!E(n))throw new Error(`${n} is not valid. ${T}`);if(t&&!E(t))throw new Error(`${t} is not valid. ${T}`);return{domainName:t||n,subdomainName:t?n:void 0}}var z="0x37368b46ce665362562c6d1d4ec01a08c8644c488690df5a17e13ba163e20221",G="0x585fc9f0f0c54183b039ffc770ca282ebd87307916c215a3e692f2f8e4305e82",P={testnet:"0x5f8fd2347449685cf41d4db97926ec3a096eaf381332be4f1318ad4d16a8497c",mainnet:"0x867ed1f6bf916171b1de3ee92849b8978b7d1b9e0a8cc982a3d19d535dfd9c0c",local:G,custom:null,devnet:null,randomnet:null};function d(e){let n=P[e.network];if(!n)throw new Error(`The ANS contract is not deployed to ${e.network}`);return n}var b=e=>{if(e&&typeof e=="object"&&"vec"in e&&Array.isArray(e.vec))return e.vec[0]};async function V(e){let{aptosConfig:n,name:t}=e,o=d(n),{domainName:r,subdomainName:s}=c(t),i=await g({aptosConfig:n,payload:{function:`${o}::router::get_owner_addr`,functionArguments:[r,s]}}),a=b(i[0]);return a?w.from(a):void 0}async function j(e){let{aptosConfig:n,expiration:t,name:o,sender:r,targetAddress:s,toAddress:i,options:a,transferable:u}=e,p=d(n),{domainName:N,subdomainName:l}=c(o),S=t.policy==="subdomain:independent"||t.policy==="subdomain:follow-domain";if(l&&!S)throw new Error("Subdomains must have an expiration policy of either 'subdomain:independent' or 'subdomain:follow-domain'");if(S&&!l)throw new Error(`Policy is set to ${t.policy} but no subdomain was provided`);if(t.policy==="domain"){let h=t.years??1;if(h!==1)throw new Error("For now, names can only be registered for 1 year at a time");let D=h*31536e3;return await m({aptosConfig:n,sender:r.accountAddress.toString(),data:{function:`${p}::router::register_domain`,functionArguments:[N,D,s,i]},options:a})}if(!l)throw new Error(`${t.policy} requires a subdomain to be provided.`);let _=await I({aptosConfig:n,name:N});if(!_)throw new Error("The domain does not exist");let x=t.policy==="subdomain:independent"?t.expirationDate:_;if(x>_)throw new Error("The subdomain expiration time cannot be greater than the domain expiration time");return await m({aptosConfig:n,sender:r.accountAddress.toString(),data:{function:`${p}::router::register_subdomain`,functionArguments:[N,l,Math.round(x/1e3),t.policy==="subdomain:follow-domain"?1:0,!!u,s,i]},options:a})}async function I(e){let{aptosConfig:n,name:t}=e,o=d(n),{domainName:r,subdomainName:s}=c(t);try{let i=await g({aptosConfig:n,payload:{function:`${o}::router::get_expiration`,functionArguments:[r,s]}});return Number(i[0])*1e3}catch{return}}async function Y(e){let{aptosConfig:n,address:t}=e,o=d(n),r=await g({aptosConfig:n,payload:{function:`${o}::router::get_primary_name`,functionArguments:[w.from(t).toString()]}}),s=b(r[1]),i=b(r[0]);if(s)return[i,s].filter(Boolean).join(".")}async function K(e){let{aptosConfig:n,sender:t,name:o,options:r}=e,s=d(n);if(!o)return await m({aptosConfig:n,sender:t.accountAddress.toString(),data:{function:`${s}::router::clear_primary_name`,functionArguments:[]},options:r});let{domainName:i,subdomainName:a}=c(o);return await m({aptosConfig:n,sender:t.accountAddress.toString(),data:{function:`${s}::router::set_primary_name`,functionArguments:[i,a]},options:r})}async function W(e){let{aptosConfig:n,name:t}=e,o=d(n),{domainName:r,subdomainName:s}=c(t),i=await g({aptosConfig:n,payload:{function:`${o}::router::get_target_addr`,functionArguments:[r,s]}}),a=b(i[0]);return a?w.from(a):void 0}async function F(e){let{aptosConfig:n,sender:t,name:o,address:r,options:s}=e,i=d(n),{domainName:a,subdomainName:u}=c(o);return await m({aptosConfig:n,sender:t.accountAddress.toString(),data:{function:`${i}::router::set_target_addr`,functionArguments:[a,u,r]},options:s})}async function H(e){let{aptosConfig:n,name:t}=e,{domainName:o,subdomainName:r=""}=c(t),a=(await A({aptosConfig:n,query:{query:f,variables:{where_condition:{domain:{_eq:o},subdomain:{_eq:r},is_active:{_eq:!0}},limit:1}},originMethod:"getName"})).current_aptos_names[0];return a&&(a=y(a)),a}async function J(e){let{aptosConfig:n,options:t,accountAddress:o}=e,r=await C({aptosConfig:n});return(await A({aptosConfig:n,originMethod:"getAccountNames",query:{query:f,variables:{limit:t?.limit,offset:t?.offset,order_by:t?.orderBy,where_condition:{...e.options?.where??{},owner_address:{_eq:o.toString()},expiration_timestamp:{_gte:r}}}}})).current_aptos_names.map(y)}async function X(e){let{aptosConfig:n,options:t,accountAddress:o}=e,r=await C({aptosConfig:n});return(await A({aptosConfig:n,originMethod:"getAccountDomains",query:{query:f,variables:{limit:t?.limit,offset:t?.offset,order_by:t?.orderBy,where_condition:{...e.options?.where??{},owner_address:{_eq:o.toString()},expiration_timestamp:{_gte:r},subdomain:{_eq:""}}}}})).current_aptos_names.map(y)}async function Z(e){let{aptosConfig:n,options:t,accountAddress:o}=e,r=await C({aptosConfig:n});return(await A({aptosConfig:n,originMethod:"getAccountSubdomains",query:{query:f,variables:{limit:t?.limit,offset:t?.offset,order_by:t?.orderBy,where_condition:{...e.options?.where??{},owner_address:{_eq:o.toString()},expiration_timestamp:{_gte:r},subdomain:{_neq:""}}}}})).current_aptos_names.map(y)}async function ee(e){let{aptosConfig:n,options:t,domain:o}=e;return(await A({aptosConfig:n,originMethod:"getDomainSubdomains",query:{query:f,variables:{limit:t?.limit,offset:t?.offset,order_by:t?.orderBy,where_condition:{...e.options?.where??{},domain:{_eq:o},subdomain:{_neq:""},is_active:{_eq:!0}}}}})).current_aptos_names.map(y)}async function C(e){let{aptosConfig:n}=e,t=d(n),[o]=await g({aptosConfig:n,payload:{function:`${t}::config::reregistration_grace_sec`,functionArguments:[]}}),r=o/60/60/24,s=()=>new Date;return new Date(s().setDate(s().getDate()-r)).toISOString()}async function ne(e){let{aptosConfig:n,sender:t,name:o,years:r=1,options:s}=e,i=d(n),a=r*31536e3,{domainName:u,subdomainName:p}=c(o);if(p)throw new Error("Subdomains cannot be renewed");if(r!==1)throw new Error("Currently, only 1 year renewals are supported");return await m({aptosConfig:n,sender:t.accountAddress.toString(),data:{function:`${i}::router::renew_domain`,functionArguments:[u,a]},options:s})}function y(e){return{...e,expiration_timestamp:new Date(e.expiration_timestamp).getTime()}}export{T as a,E as b,c,z as d,G as e,V as f,j as g,I as h,Y as i,K as j,W as k,F as l,H as m,J as n,X as o,Z as p,ee as q,ne as r};
|
|
2
|
+
//# sourceMappingURL=chunk-QUX233BC.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as t,c as n}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as t,c as n}from"./chunk-7JNPSNL6.mjs";import{a as u}from"./chunk-COW5IGYC.mjs";import{a as l}from"./chunk-STYDBDYL.mjs";import{a as s}from"./chunk-6IFMQ5AS.mjs";import{b as o}from"./chunk-AOCNYMMX.mjs";var c=class i extends u{constructor(e){super();let r=e.constructor.name;switch(r){case t.name:this.publicKey=e,this.variant=0;break;default:throw new Error(`Unsupported key for EphemeralPublicKey - ${r}`)}}toUint8Array(){return this.bcsToBytes()}toString(){return this.bcsToHex().toString()}verifySignature(e){let{message:r,signature:a}=e;return this.publicKey.verifySignature({message:r,signature:a})}serialize(e){if(this.publicKey instanceof t)e.serializeU32AsUleb128(0),this.publicKey.serialize(e);else throw new Error("Unknown public key type")}static deserialize(e){let r=e.deserializeUleb128AsU32();switch(r){case 0:return new i(t.deserialize(e));default:throw new Error(`Unknown variant index for EphemeralPublicKey: ${r}`)}}static isPublicKey(e){return e instanceof i}isEd25519(){return this.publicKey instanceof t}},p=class i extends l{constructor(e){super();let r=e.constructor.name;switch(r){case n.name:this.signature=e;break;default:throw new Error(`Unsupported signature for EphemeralSignature - ${r}`)}}toUint8Array(){return this.signature.toUint8Array()}toString(){return this.signature.toString()}static fromHex(e){let r=o.fromHexInput(e),a=new s(r.toUint8Array());return i.deserialize(a)}serialize(e){if(this.signature instanceof n)e.serializeU32AsUleb128(0),this.signature.serialize(e);else throw new Error("Unknown signature type")}static deserialize(e){let r=e.deserializeUleb128AsU32();switch(r){case 0:return new i(n.deserialize(e));default:throw new Error(`Unknown variant index for EphemeralSignature: ${r}`)}}};export{c as a,p as b};
|
|
2
|
+
//# sourceMappingURL=chunk-R7BAM2G6.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as R}from"./chunk-AH44UPM4.mjs";import{h as x,i as P}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as R}from"./chunk-AH44UPM4.mjs";import{h as x,i as P}from"./chunk-SNZ4BCEF.mjs";import{a as h}from"./chunk-3JPVQHOR.mjs";import{b as c,d as A}from"./chunk-CTLYHRB6.mjs";import{a as C}from"./chunk-6FBKUTGF.mjs";import{d as w}from"./chunk-YE5B2S5L.mjs";async function v(s){let{aptosConfig:n,options:t}=s;return A({aptosConfig:n,originMethod:"getTransactions",path:"transactions",params:{start:t?.offset,limit:t?.limit}})}async function D(s){let{aptosConfig:n}=s;return R(async()=>{let{data:t}=await c({aptosConfig:n,originMethod:"getGasPriceEstimation",path:"estimate_gas_price"});return t},`gas-price-${n.network}`,1e3*60*5)()}async function N(s){let{aptosConfig:n,ledgerVersion:t}=s,{data:o}=await c({aptosConfig:n,originMethod:"getTransactionByVersion",path:`transactions/by_version/${t}`});return o}async function T(s){let{aptosConfig:n,transactionHash:t}=s,{data:o}=await c({aptosConfig:n,path:`transactions/by_hash/${t}`,originMethod:"getTransactionByHash"});return o}async function G(s){let{aptosConfig:n,transactionHash:t}=s;try{return(await T({aptosConfig:n,transactionHash:t})).type==="pending_transaction"}catch(o){if(o?.status===404)return!0;throw o}}async function b(s){let{aptosConfig:n,transactionHash:t}=s,{data:o}=await c({aptosConfig:n,path:`transactions/wait_by_hash/${t}`,originMethod:"longWaitForTransaction"});return o}async function W(s){let{aptosConfig:n,transactionHash:t,options:o}=s,r=o?.timeoutSecs??20,u=o?.checkSuccess??!0,a=!0,p=0,e,g,m=200,E=1.5;function d(i){if(!(i instanceof C)||(g=i,i.status!==404&&i.status>=400&&i.status<500))throw i}try{e=await T({aptosConfig:n,transactionHash:t}),a=e.type==="pending_transaction"}catch(i){d(i)}if(a){let i=Date.now();try{e=await b({aptosConfig:n,transactionHash:t}),a=e.type==="pending_transaction"}catch(l){d(l)}p=(Date.now()-i)/1e3}for(;a&&!(p>=r);){try{if(e=await T({aptosConfig:n,transactionHash:t}),a=e.type==="pending_transaction",!a)break}catch(i){d(i)}await h(m),p+=m/1e3,m*=E}if(e===void 0)throw g||new f(`Fetching transaction ${t} failed and timed out after ${r} seconds`,e);if(e.type==="pending_transaction")throw new f(`Transaction ${t} timed out in pending state after ${r} seconds`,e);if(!u)return e;if(!e.success)throw new y(`Transaction ${t} failed with an error: ${e.vm_status}`,e);return e}async function O(s){let{aptosConfig:n,processorType:t}=s,o=BigInt(s.minimumLedgerVersion),r=3e3,u=new Date().getTime(),a=BigInt(-1);for(;a<o;){if(new Date().getTime()-u>r)throw new Error("waitForLastSuccessIndexerVersionSync timeout");if(t===void 0?a=await x({aptosConfig:n}):a=(await P({aptosConfig:n,processorType:t})).last_success_version,a>=o)break;await h(200)}}var f=class extends Error{constructor(t,o){super(t);this.lastSubmittedTransaction=o}},y=class extends Error{constructor(t,o){super(t);this.transaction=o}};export{v as a,D as b,N as c,T as d,G as e,b as f,W as g,O as h,f as i,y as j};
|
|
2
|
+
//# sourceMappingURL=chunk-RXBRW27O.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as P}from"./chunk-AH44UPM4.mjs";import{d as v,f as d}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as P}from"./chunk-AH44UPM4.mjs";import{d as v,f as d}from"./chunk-SNZ4BCEF.mjs";import{d as C,e as w,f as h,g as k,h as T,j as b,k as O,l as q}from"./chunk-S4SEFF4K.mjs";import{b as p,d as f}from"./chunk-CTLYHRB6.mjs";import{a as _}from"./chunk-6FBKUTGF.mjs";import{a as A}from"./chunk-FVU47J7S.mjs";import{a as m}from"./chunk-6M6XXPQQ.mjs";import{b as y}from"./chunk-PTIZKRON.mjs";import{b as l}from"./chunk-7JNPSNL6.mjs";import{a as g}from"./chunk-7STYQ5ZE.mjs";import{b as c}from"./chunk-T23OVRNF.mjs";async function S(t){let{aptosConfig:n,accountAddress:e}=t,{data:o}=await p({aptosConfig:n,originMethod:"getInfo",path:`accounts/${c.from(e).toString()}`});return o}async function z(t){let{aptosConfig:n,accountAddress:e,options:o}=t;return f({aptosConfig:n,originMethod:"getModules",path:`accounts/${c.from(e).toString()}/modules`,params:{ledger_version:o?.ledgerVersion,start:o?.offset,limit:o?.limit??1e3}})}async function H(t){return t.options?.ledgerVersion!==void 0?G(t):P(async()=>G(t),`module-${t.accountAddress}-${t.moduleName}`,1e3*60*5)()}async function G(t){let{aptosConfig:n,accountAddress:e,moduleName:o,options:s}=t,{data:r}=await p({aptosConfig:n,originMethod:"getModule",path:`accounts/${c.from(e).toString()}/module/${o}`,params:{ledger_version:s?.ledgerVersion}});return r}async function J(t){let{aptosConfig:n,accountAddress:e,options:o}=t;return f({aptosConfig:n,originMethod:"getTransactions",path:`accounts/${c.from(e).toString()}/transactions`,params:{start:o?.offset,limit:o?.limit}})}async function U(t){let{aptosConfig:n,accountAddress:e,options:o}=t;return f({aptosConfig:n,originMethod:"getResources",path:`accounts/${c.from(e).toString()}/resources`,params:{ledger_version:o?.ledgerVersion,start:o?.offset,limit:o?.limit??999}})}async function K(t){let{aptosConfig:n,accountAddress:e,resourceType:o,options:s}=t,{data:r}=await p({aptosConfig:n,originMethod:"getResource",path:`accounts/${c.from(e).toString()}/resource/${o}`,params:{ledger_version:s?.ledgerVersion}});return r.data}async function Q(t){let{aptosConfig:n,authenticationKey:e,options:o}=t,s=await K({aptosConfig:n,accountAddress:"0x1",resourceType:"0x1::account::OriginatingAddress",options:o}),{address_map:{handle:r}}=s,a=c.from(e);try{let i=await v({aptosConfig:n,handle:r,data:{key:a.toString(),key_type:"address",value_type:"address"},options:o});return c.from(i)}catch(i){if(i instanceof _&&i.data.error_code==="table_item_not_found")return a;throw i}}async function X(t){let{aptosConfig:n,accountAddress:e}=t,s={owner_address:{_eq:c.from(e).toStringLong()},amount:{_gt:0}},a=await d({aptosConfig:n,query:{query:O,variables:{where_condition:s}},originMethod:"getAccountTokensCount"});return a.current_token_ownerships_v2_aggregate.aggregate?a.current_token_ownerships_v2_aggregate.aggregate.count:0}async function Y(t){let{aptosConfig:n,accountAddress:e,options:o}=t,r={owner_address:{_eq:c.from(e).toStringLong()},amount:{_gt:0}};o?.tokenStandard&&(r.token_standard={_eq:o?.tokenStandard});let a={query:T,variables:{where_condition:r,offset:o?.offset,limit:o?.limit,order_by:o?.orderBy}};return(await d({aptosConfig:n,query:a,originMethod:"getAccountOwnedTokens"})).current_token_ownerships_v2}async function Z(t){let{aptosConfig:n,accountAddress:e,collectionAddress:o,options:s}=t,r=c.from(e).toStringLong(),a=c.from(o).toStringLong(),i={owner_address:{_eq:r},current_token_data:{collection_id:{_eq:a}},amount:{_gt:0}};s?.tokenStandard&&(i.token_standard={_eq:s?.tokenStandard});let u={query:b,variables:{where_condition:i,offset:s?.offset,limit:s?.limit,order_by:s?.orderBy}};return(await d({aptosConfig:n,query:u,originMethod:"getAccountOwnedTokensFromCollectionAddress"})).current_token_ownerships_v2}async function oo(t){let{aptosConfig:n,accountAddress:e,options:o}=t,r={owner_address:{_eq:c.from(e).toStringLong()},amount:{_gt:0}};o?.tokenStandard&&(r.current_collection={token_standard:{_eq:o?.tokenStandard}});let a={query:h,variables:{where_condition:r,offset:o?.offset,limit:o?.limit,order_by:o?.orderBy}};return(await d({aptosConfig:n,query:a,originMethod:"getAccountCollectionsWithOwnedTokens"})).current_collection_ownership_v2_view}async function to(t){let{aptosConfig:n,accountAddress:e}=t,o=c.from(e).toStringLong(),r=await d({aptosConfig:n,query:{query:q,variables:{address:o}},originMethod:"getAccountTransactionsCount"});return r.account_transactions_aggregate.aggregate?r.account_transactions_aggregate.aggregate.count:0}async function eo(t){let{aptosConfig:n,accountAddress:e,coinType:o}=t,s=c.from(e).toStringLong(),r=await I({aptosConfig:n,accountAddress:s,options:{where:{asset_type:{_eq:o}}}});return r[0]?r[0].amount:0}async function I(t){let{aptosConfig:n,accountAddress:e,options:o}=t,s=c.from(e).toStringLong(),r={...o?.where,owner_address:{_eq:s}},a={query:w,variables:{where_condition:r,offset:o?.offset,limit:o?.limit,order_by:o?.orderBy}};return(await d({aptosConfig:n,query:a,originMethod:"getAccountCoinsData"})).current_fungible_asset_balances}async function no(t){let{aptosConfig:n,accountAddress:e}=t,o=c.from(e).toStringLong(),r=await d({aptosConfig:n,query:{query:C,variables:{address:o}},originMethod:"getAccountCoinsCount"});if(!r.current_fungible_asset_balances_aggregate.aggregate)throw Error("Failed to get the count of account coins");return r.current_fungible_asset_balances_aggregate.aggregate.count}async function ro(t){let{aptosConfig:n,accountAddress:e,options:o}=t,r={owner_address:{_eq:c.from(e).toStringLong()}},a={query:k,variables:{where_condition:r,offset:o?.offset,limit:o?.limit,order_by:o?.orderBy}};return(await d({aptosConfig:n,query:a,originMethod:"getAccountOwnedObjects"})).current_objects}async function so(t){let{aptosConfig:n,privateKey:e}=t,o=new m(e.publicKey());if(e instanceof y){let r=g.fromPublicKey({publicKey:o}).derivedAddress();return A.fromPrivateKey({privateKey:e,address:r})}if(e instanceof l){let s=g.fromPublicKey({publicKey:o});if(await M({authKey:s,aptosConfig:n})){let u=s.derivedAddress();return A.fromPrivateKey({privateKey:e,address:u,legacy:!1})}let a=g.fromPublicKey({publicKey:o.publicKey});if(await M({authKey:a,aptosConfig:n})){let u=a.derivedAddress();return A.fromPrivateKey({privateKey:e,address:u,legacy:!0})}}throw new Error(`Can't derive account from private key ${e}`)}async function M(t){let{aptosConfig:n,authKey:e}=t,o=await Q({aptosConfig:n,authenticationKey:e.derivedAddress()});try{return await S({aptosConfig:n,accountAddress:o}),!0}catch(s){if(s.status===404)return!1;throw new Error(`Error while looking for an account info ${o.toString()}`)}}export{S as a,z as b,H as c,J as d,U as e,K as f,Q as g,X as h,Y as i,Z as j,oo as k,to as l,eo as m,I as n,no as o,ro as p,so as q,M as r};
|
|
2
|
+
//# sourceMappingURL=chunk-S6R7FPJE.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as i,b as t,c as n,d as o}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as i,b as t,c as n,d as o}from"./chunk-XQ7ZPP3P.mjs";import{a as s}from"./chunk-QRFKEZVG.mjs";var r=class{constructor(e){this.config=e}async getFungibleAssetMetadata(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),i({aptosConfig:this.config,...e})}async getFungibleAssetMetadataByAssetType(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),(await i({aptosConfig:this.config,options:{where:{asset_type:{_eq:e.assetType}}}}))[0]}async getFungibleAssetActivities(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),t({aptosConfig:this.config,...e})}async getCurrentFungibleAssetBalances(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),n({aptosConfig:this.config,...e})}async transferFungibleAsset(e){return o({aptosConfig:this.config,...e})}};export{r as a};
|
|
2
|
+
//# sourceMappingURL=chunk-SAQWY35C.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as A}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{c as A}from"./chunk-PFFAQZHT.mjs";import{a as x,b as c,c as w,d as g,e as M,f as C,g as O,h,i as _,k as V,l as G,m as j,n as k,o as z,p as D,r as i,s as L}from"./chunk-JTCWZB3Q.mjs";import{c as I}from"./chunk-S6R7FPJE.mjs";import{n as p}from"./chunk-3VGX3TXH.mjs";import{b as U}from"./chunk-T23OVRNF.mjs";import{a as o,b as S,c as T}from"./chunk-EB7AI4B4.mjs";import{a as d,b as E,c as B,d as v,e as $,f as b,g as F}from"./chunk-6RBUXB5I.mjs";var R=new TextEncoder;function Z(n){return n?.map(e=>c(e)?A(e):e)??[]}async function P(n,e,t,u){let r=await I({aptosConfig:u,accountAddress:n,moduleName:e});if(r.abi)return r.abi.exposed_functions.find(f=>f.name===t)}async function N(n,e,t,u){let r=await P(n,e,t,u);if(!r)throw new Error(`Could not find entry function ABI for '${n}::${e}::${t}'`);if(!r.is_entry)throw new Error(`'${n}::${e}::${t}' is not an entry function`);let f=L(r),y=[];for(let s=f;s<r.params.length;s+=1)y.push(A(r.params[s],{allowGenerics:!0}));return{signers:f,typeParameters:r.generic_type_params,parameters:y}}async function a(n,e,t,u){let r=await P(n,e,t,u);if(!r)throw new Error(`Could not find view function ABI for '${n}::${e}::${t}'`);if(!r.is_view)throw new Error(`'${n}::${e}::${t}' is not an view function`);let f=[];for(let s=0;s<r.params.length;s+=1)f.push(A(r.params[s],{allowGenerics:!0}));let y=[];for(let s=0;s<r.return.length;s+=1)y.push(A(r.return[s],{allowGenerics:!0}));return{typeParameters:r.generic_type_params,parameters:f,returnTypes:y}}function nn(n,e,t,u,r){if(u>=e.parameters.length)throw new Error(`Too many arguments for '${n}', expected ${e.parameters.length}`);let f=e.parameters[u];return l(t,f,u,r)}function l(n,e,t,u){return C(n)?(m(e,n,t),n):X(n,e,t,u)}function X(n,e,t,u){if(e.isBool()){if(x(n))return new d(n);i("boolean",t)}if(e.isAddress()){if(c(n))return U.fromString(n);i("string | AccountAddress",t)}if(e.isU8()){if(w(n))return new E(n);i("number",t)}if(e.isU16()){if(w(n))return new B(n);i("number",t)}if(e.isU32()){if(w(n))return new v(n);i("number",t)}if(e.isU64()){if(g(n))return new $(BigInt(n));i("bigint | number | string",t)}if(e.isU128()){if(g(n))return new b(BigInt(n));i("bigint | number | string",t)}if(e.isU256()){if(g(n))return new F(BigInt(n));i("bigint | number | string",t)}if(e.isGeneric()){let r=e.value;if(r<0||r>=u.length)throw new Error(`Generic argument ${e.toString()} is invalid for argument ${t}`);return l(n,u[r],t,u)}if(e.isVector()){if(e.value.isU8()){if(c(n))return o.U8(R.encode(n));if(n instanceof Uint8Array)return o.U8(n);if(n instanceof ArrayBuffer)return o.U8(new Uint8Array(n))}if(Array.isArray(n))return new o(n.map(r=>l(r,e.value,t,u)));throw new Error(`Type mismatch for argument ${t}, type '${e.toString()}'`)}if(e.isStruct()){if(e.isString()){if(c(n))return new S(n);i("string",t)}if(e.isObject()){if(c(n))return U.fromString(n);i("string | AccountAddress",t)}if(e.isOption())return M(n)?new T(null):new T(l(n,e.value.typeArgs[0],t,u));throw new Error(`Unsupported struct input type for argument ${t}, type '${e.toString()}'`)}throw new Error(`Type mismatch for argument ${t}, type '${e.toString()}'`)}function m(n,e,t){if(n.isBool()){if(O(e))return;i("Bool",t)}if(n.isAddress()){if(h(e))return;i("AccountAddress",t)}if(n.isU8()){if(V(e))return;i("U8",t)}if(n.isU16()){if(G(e))return;i("U16",t)}if(n.isU32()){if(j(e))return;i("U32",t)}if(n.isU64()){if(k(e))return;i("U64",t)}if(n.isU128()){if(z(e))return;i("U128",t)}if(n.isU256()){if(D(e))return;i("U256",t)}if(n.isVector()){if(e instanceof o){e.values.length>0&&m(n.value,e.values[0],t);return}i("MoveVector",t)}if(n instanceof p){if(n.isString()){if(_(e))return;i("MoveString",t)}if(n.isObject()){if(h(e))return;i("AccountAddress",t)}if(n.isOption()){if(e instanceof T){e.value!==void 0&&m(n.value.typeArgs[0],e.value,t);return}i("MoveOption",t)}}throw new Error(`Type mismatch for argument ${t}, expected '${n.toString()}'`)}export{Z as a,P as b,N as c,a as d,nn as e,l as f};
|
|
2
|
+
//# sourceMappingURL=chunk-SC34237T.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{m as g,v as a}from"./chunk-S4SEFF4K.mjs";import{b as
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{m as g,v as a}from"./chunk-S4SEFF4K.mjs";import{b as p,c}from"./chunk-Y76WJ62G.mjs";import{b as n}from"./chunk-CTLYHRB6.mjs";async function h(o){let{aptosConfig:t}=o,{data:e}=await n({aptosConfig:t,originMethod:"getLedgerInfo",path:""});return e}async function l(o){let{aptosConfig:t,ledgerVersion:e,options:s}=o,{data:r}=await n({aptosConfig:t,originMethod:"getBlockByVersion",path:`blocks/by_version/${e}`,params:{with_transactions:s?.withTransactions}});return r}async function C(o){let{aptosConfig:t,blockHeight:e,options:s}=o,{data:r}=await n({aptosConfig:t,originMethod:"getBlockByHeight",path:`blocks/by_height/${e}`,params:{with_transactions:s?.withTransactions}});return r}async function m(o){let{aptosConfig:t,handle:e,data:s,options:r}=o;return(await p({aptosConfig:t,originMethod:"getTableItem",path:`tables/${e}/item`,params:{ledger_version:r?.ledgerVersion},body:s})).data}async function T(o){let{aptosConfig:t,limit:e}=o;return(await i({aptosConfig:t,query:{query:g,variables:{limit:e}},originMethod:"getChainTopUserTransactions"})).user_transactions}async function i(o){let{aptosConfig:t,query:e,originMethod:s}=o,{data:r}=await c({aptosConfig:t,originMethod:s??"queryIndexer",path:"",body:e,overrides:{WITH_CREDENTIALS:!1}});return r}async function f(o){let{aptosConfig:t}=o;return(await i({aptosConfig:t,query:{query:a},originMethod:"getProcessorStatuses"})).processor_status}async function q(o){let t=await f({aptosConfig:o.aptosConfig});return BigInt(t[0].last_success_version)}async function b(o){let{aptosConfig:t,processorType:e}=o;return(await i({aptosConfig:t,query:{query:a,variables:{where_condition:{processor:{_eq:e}}}},originMethod:"getProcessorStatus"})).processor_status[0]}export{h as a,l as b,C as c,m as d,T as e,i as f,f as g,q as h,b as i};
|
|
2
|
+
//# sourceMappingURL=chunk-SNZ4BCEF.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as r}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as r}from"./chunk-TVRJ3M7B.mjs";import{b as t}from"./chunk-AOCNYMMX.mjs";var o=class extends r{toString(){let i=this.toUint8Array();return t.fromHexInput(i).toString()}};export{o as a};
|
|
2
|
+
//# sourceMappingURL=chunk-STYDBDYL.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a}from"./chunk-TVRJ3M7B.mjs";import{a as i}from"./chunk-FBPNHF54.mjs";import{bytesToHex as o,hexToBytes as l}from"@noble/hashes/utils";var h=(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))(h||{}),r=class r extends a{constructor(t){super();if(t.length!==r.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=o(this.data);return this.isSpecial()&&(t=t[t.length-1]),t}toStringLong(){return`0x${this.toStringLongWithoutPrefix()}`}toStringLongWithoutPrefix(){return o(this.data)}toUint8Array(){return this.data}serialize(t){t.serializeFixedBytes(this.data)}serializeForEntryFunction(t){let e=this.bcsToBytes();t.serializeBytes(e)}serializeForScriptFunction(t){t.serializeU32AsUleb128(3),t.serialize(this)}static deserialize(t){let e=t.deserializeFixedBytes(r.LENGTH);return new r(e)}static fromStringStrict(t){if(!t.startsWith("0x"))throw new i("Hex string must start with a leading 0x.","leading_zero_x_required");let e=r.fromString(t);if(t.length!==r.LONG_STRING_LENGTH+2)if(e.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 e}static fromString(t){let e=t;if(t.startsWith("0x")&&(e=t.slice(2)),e.length===0)throw new i("Hex string is too short, must be 1 to 64 chars long, excluding the leading 0x.","too_short");if(e.length>64)throw new i("Hex string is too long, must be 1 to 64 chars long, excluding the leading 0x.","too_long");let n;try{n=l(e.padStart(64,"0"))}catch(d){throw new i(`Hex characters are invalid: ${d?.message}`,"invalid_hex_chars")}return new r(n)}static from(t){return t instanceof r?t:t instanceof Uint8Array?new r(t):r.fromString(t)}static fromStrict(t){return t instanceof r?t:t instanceof Uint8Array?new r(t):r.fromStringStrict(t)}static isValid(t){try{return t.strict?r.fromStrict(t.input):r.from(t.input),{valid:!0}}catch(e){return{valid:!1,invalidReason:e?.invalidReason,invalidReasonMessage:e?.message}}}equals(t){return this.data.length!==t.data.length?!1:this.data.every((e,n)=>e===t.data[n])}};r.LENGTH=32,r.LONG_STRING_LENGTH=64,r.ZERO=r.from("0x0"),r.ONE=r.from("0x1"),r.TWO=r.from("0x2"),r.THREE=r.from("0x3"),r.FOUR=r.from("0x4");var c=r;export{h as a,c as b};
|
|
2
|
+
//# sourceMappingURL=chunk-T23OVRNF.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as U,b,c as f,d as l,e as h,f as y}from"./chunk-56CNRT2K.mjs";import{
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as c}from"./chunk-AOCNYMMX.mjs";import{a as U,b,c as f,d as l,e as h,f as y}from"./chunk-56CNRT2K.mjs";import{a as s}from"./chunk-FVA2OPG4.mjs";var B=class{bcsToBytes(){let e=new n;return this.serialize(e),e.toUint8Array()}bcsToHex(){let e=this.bcsToBytes();return c.fromHexInput(e)}},n=class{constructor(e=64){if(e<=0)throw new Error("Length needs to be greater than 0");this.buffer=new ArrayBuffer(e),this.offset=0}ensureBufferWillHandleSize(e){for(;this.buffer.byteLength<this.offset+e;){let t=new ArrayBuffer(this.buffer.byteLength*2);new Uint8Array(t).set(new Uint8Array(this.buffer)),this.buffer=t}}appendToBuffer(e){this.ensureBufferWillHandleSize(e.length),new Uint8Array(this.buffer,this.offset).set(e),this.offset+=e.length}serializeWithFunction(e,t,i){this.ensureBufferWillHandleSize(t);let a=new DataView(this.buffer,this.offset);e.apply(a,[0,i,!0]),this.offset+=t}serializeStr(e){let t=new TextEncoder;this.serializeBytes(t.encode(e))}serializeBytes(e){this.serializeU32AsUleb128(e.length),this.appendToBuffer(e)}serializeFixedBytes(e){this.appendToBuffer(e)}serializeBool(e){p(e);let t=e?1:0;this.appendToBuffer(new Uint8Array([t]))}serializeU8(e){this.appendToBuffer(new Uint8Array([e]))}serializeU16(e){this.serializeWithFunction(DataView.prototype.setUint16,2,e)}serializeU32(e){this.serializeWithFunction(DataView.prototype.setUint32,4,e)}serializeU64(e){let t=BigInt(e)&BigInt(f),i=BigInt(e)>>BigInt(32);this.serializeU32(Number(t)),this.serializeU32(Number(i))}serializeU128(e){let t=BigInt(e)&l,i=BigInt(e)>>BigInt(64);this.serializeU64(t),this.serializeU64(i)}serializeU256(e){let t=BigInt(e)&h,i=BigInt(e)>>BigInt(128);this.serializeU128(t),this.serializeU128(i)}serializeU32AsUleb128(e){let t=e,i=[];for(;t>>>7;)i.push(t&127|128),t>>>=7;i.push(t),this.appendToBuffer(new Uint8Array(i))}toUint8Array(){return new Uint8Array(this.buffer).slice(0,this.offset)}serialize(e){e.serialize(this)}serializeVector(e){this.serializeU32AsUleb128(e.length),e.forEach(t=>{t.serialize(this)})}serializeOption(e){e===void 0?this.serializeU32AsUleb128(0):(this.serializeU32AsUleb128(1),e.serialize(this))}serializeOptionStr(e){e===void 0?this.serializeU32AsUleb128(0):(this.serializeU32AsUleb128(1),this.serializeStr(e))}};s([o(0,U)],n.prototype,"serializeU8",1),s([o(0,b)],n.prototype,"serializeU16",1),s([o(0,f)],n.prototype,"serializeU32",1),s([o(BigInt(0),l)],n.prototype,"serializeU64",1),s([o(BigInt(0),h)],n.prototype,"serializeU128",1),s([o(BigInt(0),y)],n.prototype,"serializeU256",1),s([o(0,f)],n.prototype,"serializeU32AsUleb128",1);function p(r){if(typeof r!="boolean")throw new Error(`${r} is not a boolean value`)}var z=(r,e,t)=>`${r} is out of range: [${e}, ${t}]`;function g(r,e,t){let i=BigInt(r);if(i>BigInt(t)||i<BigInt(e))throw new Error(z(r,e,t))}function o(r,e){return(t,i,a)=>{let A=a.value;return a.value=function(u){return g(u,r,e),A.apply(this,[u])},a}}export{B as a,n as b,p as c,z as d,g as e};
|
|
2
|
+
//# sourceMappingURL=chunk-TVRJ3M7B.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as i}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as i}from"./chunk-W352LMVK.mjs";import{h as t}from"./chunk-RXBRW27O.mjs";var r=class{constructor(o){this.config=o}async fundAccount(o){let n=await i({aptosConfig:this.config,...o});return o.options?.waitForIndexer!==!1&&await t({aptosConfig:this.config,minimumLedgerVersion:BigInt(n.version)}),n}};export{r as a};
|
|
2
|
+
//# sourceMappingURL=chunk-ULEPSALQ.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as m}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as m}from"./chunk-FEWIHUNW.mjs";import{a as h}from"./chunk-MWUJCP27.mjs";import{b as t}from"./chunk-T23OVRNF.mjs";import{a as u}from"./chunk-TVRJ3M7B.mjs";var o=class i extends u{constructor(e,s,a,n,d,l,_){super();this.sender=e,this.sequence_number=s,this.payload=a,this.max_gas_amount=n,this.gas_unit_price=d,this.expiration_timestamp_secs=l,this.chain_id=_}serialize(e){this.sender.serialize(e),e.serializeU64(this.sequence_number),this.payload.serialize(e),e.serializeU64(this.max_gas_amount),e.serializeU64(this.gas_unit_price),e.serializeU64(this.expiration_timestamp_secs),this.chain_id.serialize(e)}static deserialize(e){let s=t.deserialize(e),a=e.deserializeU64(),n=m.deserialize(e),d=e.deserializeU64(),l=e.deserializeU64(),_=e.deserializeU64(),b=h.deserialize(e);return new i(s,a,n,d,l,_,b)}},c=class extends u{static deserialize(r){let e=r.deserializeUleb128AsU32();switch(e){case 0:return p.load(r);case 1:return y.load(r);default:throw new Error(`Unknown variant index for RawTransactionWithData: ${e}`)}}},p=class i extends c{constructor(e,s){super();this.raw_txn=e,this.secondary_signer_addresses=s}serialize(e){e.serializeU32AsUleb128(0),this.raw_txn.serialize(e),e.serializeVector(this.secondary_signer_addresses)}static load(e){let s=o.deserialize(e),a=e.deserializeVector(t);return new i(s,a)}},y=class i extends c{constructor(e,s,a){super();this.raw_txn=e,this.secondary_signer_addresses=s,this.fee_payer_address=a}serialize(e){e.serializeU32AsUleb128(1),this.raw_txn.serialize(e),e.serializeVector(this.secondary_signer_addresses),this.fee_payer_address.serialize(e)}static load(e){let s=o.deserialize(e),a=e.deserializeVector(t),n=t.deserialize(e);return new i(s,a,n)}};export{o as a,c as b,p as c,y as d};
|
|
2
|
+
//# sourceMappingURL=chunk-UT37XKQU.mjs.map
|