@aptos-labs/ts-sdk 1.14.0-zeta.3 → 1.15.0-win.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/{accountAddress-u9wEan9p.d.ts → accountAddress-ccLvlUQe.d.ts} +22 -49
- package/dist/common/cli/index.d.ts +1 -1
- package/dist/common/cli/index.js +1 -1
- package/dist/common/cli/index.js.map +1 -1
- package/dist/common/index.d.ts +103 -550
- package/dist/common/index.js +55 -26
- package/dist/common/index.js.map +1 -1
- package/dist/esm/{Ed25519Account-9zBaZEnp.d.mts → Ed25519Account-B1VMJOY2.d.mts} +1 -1
- package/dist/esm/account/Account.d.mts +2 -2
- package/dist/esm/account/Account.mjs +1 -1
- package/dist/esm/account/Ed25519Account.d.mts +2 -2
- package/dist/esm/account/Ed25519Account.mjs +1 -1
- package/dist/esm/account/MultiKeyAccount.d.mts +7 -12
- package/dist/esm/account/MultiKeyAccount.mjs +1 -1
- package/dist/esm/account/SingleKeyAccount.d.mts +2 -2
- package/dist/esm/account/SingleKeyAccount.mjs +1 -1
- package/dist/esm/account/index.d.mts +2 -8
- package/dist/esm/account/index.mjs +1 -1
- package/dist/esm/api/account.d.mts +2 -2
- package/dist/esm/api/account.mjs +1 -1
- package/dist/esm/api/ans.d.mts +2 -2
- package/dist/esm/api/ans.mjs +1 -1
- package/dist/esm/api/aptos.d.mts +5 -10
- package/dist/esm/api/aptos.mjs +1 -1
- package/dist/esm/api/aptosConfig.d.mts +0 -20
- package/dist/esm/api/aptosConfig.mjs +1 -1
- package/dist/esm/api/coin.d.mts +1 -1
- package/dist/esm/api/coin.mjs +1 -1
- package/dist/esm/api/digitalAsset.d.mts +2 -2
- package/dist/esm/api/digitalAsset.mjs +1 -1
- package/dist/esm/api/event.mjs +1 -1
- package/dist/esm/api/faucet.mjs +1 -1
- package/dist/esm/api/fungibleAsset.d.mts +2 -2
- package/dist/esm/api/fungibleAsset.mjs +1 -1
- package/dist/esm/api/general.d.mts +2 -27
- package/dist/esm/api/general.mjs +1 -1
- package/dist/esm/api/index.d.mts +3 -8
- package/dist/esm/api/index.mjs +1 -1
- package/dist/esm/api/staking.mjs +1 -1
- package/dist/esm/api/table.d.mts +84 -0
- package/dist/esm/api/table.mjs +2 -0
- package/dist/esm/api/transaction.d.mts +2 -2
- package/dist/esm/api/transaction.mjs +1 -1
- package/dist/esm/api/transactionSubmission/build.d.mts +1 -1
- package/dist/esm/api/transactionSubmission/build.mjs +1 -1
- package/dist/esm/api/transactionSubmission/management.d.mts +2 -2
- package/dist/esm/api/transactionSubmission/management.mjs +1 -1
- package/dist/esm/api/transactionSubmission/sign.d.mts +2 -2
- package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
- package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -1
- package/dist/esm/api/transactionSubmission/simulate.d.mts +1 -1
- package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
- package/dist/esm/api/transactionSubmission/submit.d.mts +1 -1
- package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
- package/dist/esm/api/utils.mjs +1 -1
- package/dist/esm/bcs/deserializer.d.mts +0 -26
- package/dist/esm/bcs/deserializer.mjs +1 -1
- package/dist/esm/bcs/index.mjs +1 -1
- package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -1
- package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -1
- package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
- package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
- package/dist/esm/bcs/serializer.d.mts +0 -2
- package/dist/esm/bcs/serializer.mjs +1 -1
- package/dist/esm/{chunk-3CUVYW32.mjs → chunk-2X7A4HUS.mjs} +2 -2
- package/dist/esm/chunk-2XK53QFA.mjs +2 -0
- package/dist/esm/{chunk-WM2NCYZL.mjs.map → chunk-2XK53QFA.mjs.map} +1 -1
- package/dist/esm/{chunk-Y4SSUCPJ.mjs → chunk-2YZSEM2G.mjs} +2 -2
- package/dist/esm/{chunk-ZNEBMSNC.mjs → chunk-35EWRSDK.mjs} +2 -2
- package/dist/esm/{chunk-TVRJ3M7B.mjs → chunk-36QXVFR5.mjs} +2 -2
- package/dist/esm/{chunk-TVRJ3M7B.mjs.map → chunk-36QXVFR5.mjs.map} +1 -1
- package/dist/esm/chunk-3HSXKDOC.mjs +2 -0
- package/dist/esm/chunk-3HSXKDOC.mjs.map +1 -0
- package/dist/esm/chunk-3N6N3KOS.mjs +2 -0
- package/dist/esm/{chunk-HYDDIAJ6.mjs.map → chunk-3N6N3KOS.mjs.map} +1 -1
- package/dist/esm/{chunk-SLI3KELH.mjs → chunk-477G7LHJ.mjs} +2 -2
- package/dist/esm/chunk-4NHWV5AI.mjs +2 -0
- package/dist/esm/{chunk-7STYQ5ZE.mjs → chunk-5EN52MUT.mjs} +2 -2
- package/dist/esm/{chunk-P7JMD7KZ.mjs → chunk-5VIESFOC.mjs} +2 -2
- package/dist/esm/{chunk-TE3WIJ26.mjs → chunk-5YLAWRI2.mjs} +2 -2
- package/dist/esm/chunk-6IFMQ5AS.mjs +2 -0
- package/dist/esm/chunk-6IFMQ5AS.mjs.map +1 -0
- package/dist/esm/{chunk-3CMS2KOX.mjs → chunk-6JLYD5Q2.mjs} +2 -2
- package/dist/esm/{chunk-HMFL7AOJ.mjs → chunk-6XWDDCQD.mjs} +2 -2
- package/dist/esm/{chunk-CS7B3FVO.mjs → chunk-7NEETXEA.mjs} +2 -2
- package/dist/esm/chunk-7VRZLDIJ.mjs +2 -0
- package/dist/esm/{chunk-24ZOKI52.mjs → chunk-ACG4ZGRQ.mjs} +2 -2
- package/dist/esm/chunk-AQAH67IV.mjs +2 -0
- package/dist/esm/chunk-B7X6PSE7.mjs +2 -0
- package/dist/esm/{chunk-AOCNYMMX.mjs → chunk-BCUSI3N6.mjs} +2 -2
- package/dist/esm/{chunk-HYU23YVP.mjs → chunk-BHLICYAI.mjs} +2 -2
- package/dist/esm/chunk-BO2TLWNT.mjs +2 -0
- package/dist/esm/chunk-CEHCDA3G.mjs +2 -0
- package/dist/esm/chunk-CJDEPZ4J.mjs +2 -0
- package/dist/esm/{chunk-NBEXLW7P.mjs.map → chunk-CJDEPZ4J.mjs.map} +1 -1
- package/dist/esm/{chunk-WWGROAKX.mjs → chunk-CWUH4PNH.mjs} +2 -2
- package/dist/esm/chunk-CYNQRMO5.mjs +2 -0
- package/dist/esm/chunk-CYNQRMO5.mjs.map +1 -0
- package/dist/esm/chunk-DLAIJ2UM.mjs +2 -0
- package/dist/esm/chunk-DLAIJ2UM.mjs.map +1 -0
- package/dist/esm/{chunk-DD2VWOMZ.mjs → chunk-E2NVC2VR.mjs} +2 -2
- package/dist/esm/chunk-F7EMGK4M.mjs +2 -0
- package/dist/esm/{chunk-EB7AI4B4.mjs → chunk-G56GPLTB.mjs} +2 -2
- package/dist/esm/{chunk-RKHPXZM6.mjs → chunk-GHYE26Q5.mjs} +2 -2
- package/dist/esm/{chunk-RKHPXZM6.mjs.map → chunk-GHYE26Q5.mjs.map} +1 -1
- package/dist/esm/{chunk-7IMWGGA6.mjs → chunk-GIAABV7R.mjs} +2 -2
- package/dist/esm/{chunk-KMKSA7LM.mjs → chunk-GKJ2NJG5.mjs} +2 -2
- package/dist/esm/{chunk-NC5HHEEM.mjs → chunk-GM56MMNJ.mjs} +2 -2
- package/dist/esm/{chunk-GQ6HIKZT.mjs → chunk-HMARHACL.mjs} +2 -2
- package/dist/esm/chunk-HNEAPYNI.mjs +2 -0
- package/dist/esm/{chunk-P2WALKSW.mjs → chunk-HSJTQLI2.mjs} +2 -2
- package/dist/esm/chunk-HYCGMFC2.mjs +2 -0
- package/dist/esm/chunk-HYCGMFC2.mjs.map +1 -0
- package/dist/esm/chunk-IENCDVPF.mjs +2 -0
- package/dist/esm/chunk-IENCDVPF.mjs.map +1 -0
- package/dist/esm/{chunk-23MNZ5LZ.mjs → chunk-IZQV2SU6.mjs} +2 -2
- package/dist/esm/chunk-J6OFSYUA.mjs +2 -0
- package/dist/esm/chunk-J6OFSYUA.mjs.map +1 -0
- package/dist/esm/chunk-JB5H65CE.mjs +2 -0
- package/dist/esm/chunk-JB5H65CE.mjs.map +1 -0
- package/dist/esm/{chunk-XZGQMZ2H.mjs → chunk-JFIAWBCK.mjs} +2 -2
- package/dist/esm/chunk-JQIGQMNZ.mjs +2 -0
- package/dist/esm/chunk-JQIGQMNZ.mjs.map +1 -0
- package/dist/esm/chunk-K7HX7JQH.mjs +2 -0
- package/dist/esm/chunk-K7HX7JQH.mjs.map +1 -0
- package/dist/esm/{chunk-HGZGTBA4.mjs → chunk-KAGLWBIJ.mjs} +2 -2
- package/dist/esm/chunk-LG7RJQ57.mjs +2 -0
- package/dist/esm/{chunk-HHVAU5HU.mjs → chunk-MCRRHBFQ.mjs} +2 -2
- package/dist/esm/{chunk-PFFAQZHT.mjs → chunk-MJPUASSD.mjs} +2 -2
- package/dist/esm/{chunk-7XYECSW6.mjs → chunk-MQI2IE6Y.mjs} +2 -2
- package/dist/esm/chunk-N3U47Y6Y.mjs +2 -0
- package/dist/esm/{chunk-L5WUYZ35.mjs → chunk-NZETF6Z4.mjs} +2 -2
- package/dist/esm/chunk-OWW6SIDP.mjs +2 -0
- package/dist/esm/chunk-OWW6SIDP.mjs.map +1 -0
- package/dist/esm/{chunk-CB6CNNM2.mjs → chunk-P6GWG2CY.mjs} +2 -2
- package/dist/esm/chunk-PF57EOJY.mjs +2 -0
- package/dist/esm/{chunk-JLWKIYHV.mjs → chunk-PIVZMT5D.mjs} +2 -2
- package/dist/esm/{chunk-R52BRP36.mjs → chunk-PLXGSUZA.mjs} +2 -2
- package/dist/esm/{chunk-AHNE2QA3.mjs → chunk-PPO4IXE4.mjs} +2 -2
- package/dist/esm/{chunk-PMPTAPM3.mjs → chunk-QIHR7HD6.mjs} +2 -2
- package/dist/esm/{chunk-BTLFW3YY.mjs → chunk-QQ5PHEJF.mjs} +2 -2
- package/dist/esm/{chunk-T23OVRNF.mjs → chunk-QRS4DGP3.mjs} +2 -2
- package/dist/esm/{chunk-T23OVRNF.mjs.map → chunk-QRS4DGP3.mjs.map} +1 -1
- package/dist/esm/{chunk-LDQ6JFEF.mjs → chunk-QSHLNSUP.mjs} +2 -2
- package/dist/esm/{chunk-LDQ6JFEF.mjs.map → chunk-QSHLNSUP.mjs.map} +1 -1
- package/dist/esm/chunk-ROXFCLDT.mjs +2 -0
- package/dist/esm/chunk-RTSWVT2Q.mjs +2 -0
- package/dist/esm/chunk-RTSWVT2Q.mjs.map +1 -0
- package/dist/esm/{chunk-Y33CIIZX.mjs → chunk-RVWYURXG.mjs} +2 -2
- package/dist/esm/{chunk-U5C2PXC6.mjs → chunk-RYD6HRW7.mjs} +2 -2
- package/dist/esm/chunk-S2VSJJRJ.mjs +2 -0
- package/dist/esm/chunk-S2VSJJRJ.mjs.map +1 -0
- package/dist/esm/{chunk-S4SEFF4K.mjs → chunk-S3EDNXZE.mjs} +46 -17
- package/dist/esm/chunk-S3EDNXZE.mjs.map +1 -0
- package/dist/esm/chunk-SRDIYE3M.mjs +2 -0
- package/dist/esm/{chunk-6RBUXB5I.mjs.map → chunk-SRDIYE3M.mjs.map} +1 -1
- package/dist/esm/{chunk-SI7MPP6G.mjs → chunk-T2AGN5YT.mjs} +2 -2
- package/dist/esm/chunk-TGQARO3F.mjs +2 -0
- package/dist/esm/chunk-TGQARO3F.mjs.map +1 -0
- package/dist/esm/chunk-TM7NDDT3.mjs +2 -0
- package/dist/esm/chunk-TM7NDDT3.mjs.map +1 -0
- package/dist/esm/{chunk-HSFG2AIK.mjs → chunk-TT2XR5ZI.mjs} +2 -2
- package/dist/esm/{chunk-3VGX3TXH.mjs → chunk-U3YYSIIT.mjs} +2 -2
- package/dist/esm/chunk-UGPALAPN.mjs +2 -0
- package/dist/esm/{chunk-7SIQDOYY.mjs → chunk-UKSRF2Q3.mjs} +2 -2
- package/dist/esm/chunk-UO3NZ5AH.mjs +1 -0
- package/dist/esm/{chunk-TICM455H.mjs → chunk-UPSCPEEE.mjs} +2 -2
- package/dist/esm/chunk-UVSRX4SV.mjs +1 -0
- package/dist/esm/chunk-WXWWYH73.mjs +2 -0
- package/dist/esm/chunk-WXWWYH73.mjs.map +1 -0
- package/dist/esm/{chunk-O3PLAAN7.mjs → chunk-XBHFMNYB.mjs} +2 -2
- package/dist/esm/{chunk-GNNNICLW.mjs → chunk-XD46HTI2.mjs} +2 -2
- package/dist/esm/{chunk-6WIB3GGF.mjs → chunk-XFSDV3ND.mjs} +2 -2
- package/dist/esm/chunk-YMB2XW2O.mjs +2 -0
- package/dist/esm/{chunk-YNNPWCF6.mjs.map → chunk-YMB2XW2O.mjs.map} +1 -1
- package/dist/esm/{chunk-ZPMS2Q37.mjs → chunk-ZBXOX3S7.mjs} +2 -2
- package/dist/esm/cli/index.mjs +1 -1
- package/dist/esm/cli/move.mjs +1 -1
- package/dist/esm/client/core.mjs +1 -1
- package/dist/esm/client/get.d.mts +1 -2
- package/dist/esm/client/get.mjs +1 -1
- package/dist/esm/client/index.d.mts +2 -2
- package/dist/esm/client/index.mjs +1 -1
- package/dist/esm/client/post.d.mts +1 -3
- package/dist/esm/client/post.mjs +1 -1
- package/dist/esm/client/types.d.mts +1 -5
- package/dist/esm/client/types.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.d.mts +1 -1
- package/dist/esm/core/authenticationKey.mjs +1 -1
- package/dist/esm/core/common.mjs +1 -1
- package/dist/esm/core/crypto/ed25519.d.mts +1 -1
- package/dist/esm/core/crypto/ed25519.mjs +1 -1
- package/dist/esm/core/crypto/index.d.mts +1 -4
- package/dist/esm/core/crypto/index.mjs +1 -1
- package/dist/esm/core/crypto/multiEd25519.d.mts +1 -1
- package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
- package/dist/esm/core/crypto/multiKey.d.mts +1 -1
- package/dist/esm/core/crypto/multiKey.mjs +1 -1
- package/dist/esm/core/crypto/privateKey.d.mts +1 -1
- package/dist/esm/core/crypto/publicKey.d.mts +1 -1
- package/dist/esm/core/crypto/publicKey.mjs +1 -1
- package/dist/esm/core/crypto/secp256k1.d.mts +1 -1
- package/dist/esm/core/crypto/secp256k1.mjs +1 -1
- package/dist/esm/core/crypto/signature.mjs +1 -1
- package/dist/esm/core/crypto/singleKey.d.mts +1 -1
- package/dist/esm/core/crypto/singleKey.mjs +1 -1
- package/dist/esm/core/crypto/utils.mjs +1 -1
- package/dist/esm/core/hex.mjs +1 -1
- package/dist/esm/core/index.d.mts +1 -4
- package/dist/esm/core/index.mjs +1 -1
- package/dist/esm/index.d.mts +9 -14
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/internal/account.d.mts +2 -2
- package/dist/esm/internal/account.mjs +1 -1
- package/dist/esm/internal/ans.d.mts +2 -2
- package/dist/esm/internal/ans.mjs +1 -1
- package/dist/esm/internal/coin.d.mts +1 -1
- package/dist/esm/internal/coin.mjs +1 -1
- package/dist/esm/internal/digitalAsset.d.mts +2 -2
- 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.d.mts +2 -2
- package/dist/esm/internal/fungibleAsset.mjs +1 -1
- package/dist/esm/internal/general.d.mts +2 -8
- package/dist/esm/internal/general.mjs +1 -1
- package/dist/esm/internal/staking.mjs +1 -1
- package/dist/esm/internal/table.d.mts +31 -0
- package/dist/esm/internal/table.mjs +2 -0
- package/dist/esm/internal/transaction.mjs +1 -1
- package/dist/esm/internal/transactionSubmission.d.mts +2 -2
- package/dist/esm/internal/transactionSubmission.mjs +1 -1
- package/dist/esm/internal/view.d.mts +1 -1
- package/dist/esm/internal/view.mjs +1 -1
- package/dist/esm/transactions/authenticator/account.d.mts +1 -1
- package/dist/esm/transactions/authenticator/account.mjs +1 -1
- package/dist/esm/transactions/authenticator/index.d.mts +1 -1
- package/dist/esm/transactions/authenticator/index.mjs +1 -1
- package/dist/esm/transactions/authenticator/transaction.d.mts +1 -1
- package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
- package/dist/esm/transactions/index.d.mts +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.d.mts +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.d.mts +1 -1
- package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
- package/dist/esm/transactions/instances/signedTransaction.d.mts +1 -1
- package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
- package/dist/esm/transactions/management/accountSequenceNumber.d.mts +2 -2
- package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
- package/dist/esm/transactions/management/index.d.mts +2 -2
- package/dist/esm/transactions/management/index.mjs +1 -1
- package/dist/esm/transactions/management/transactionWorker.d.mts +2 -2
- package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/helpers.d.mts +1 -1
- package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/index.d.mts +1 -1
- package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +1 -1
- package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/signingMessage.d.mts +1 -1
- package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +2 -2
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
- package/dist/esm/transactions/typeTag/index.mjs +1 -1
- package/dist/esm/transactions/typeTag/parser.mjs +1 -1
- package/dist/esm/transactions/types.d.mts +1 -1
- package/dist/esm/types/generated/operations.d.mts +31 -2
- package/dist/esm/types/generated/queries.d.mts +6 -2
- package/dist/esm/types/generated/queries.mjs +1 -1
- package/dist/esm/types/generated/types.d.mts +212 -7
- package/dist/esm/types/generated/types.mjs +1 -1
- package/dist/esm/types/generated/types.mjs.map +1 -1
- package/dist/esm/types/index.d.mts +4 -20
- package/dist/esm/types/index.mjs +1 -1
- package/dist/esm/types/indexer.d.mts +4 -2
- package/dist/esm/utils/apiEndpoints.d.mts +1 -3
- package/dist/esm/utils/apiEndpoints.mjs +1 -1
- package/dist/esm/utils/const.d.mts +1 -3
- package/dist/esm/utils/const.mjs +1 -1
- package/dist/esm/utils/index.d.mts +1 -1
- package/dist/esm/utils/index.mjs +1 -1
- package/dist/esm/utils/normalizeBundle.mjs +1 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +3 -11
- package/src/account/MultiKeyAccount.ts +0 -10
- package/src/account/index.ts +0 -2
- package/src/api/aptos.ts +5 -5
- package/src/api/aptosConfig.ts +1 -46
- package/src/api/general.ts +0 -26
- package/src/api/table.ts +108 -0
- package/src/bcs/deserializer.ts +0 -40
- package/src/bcs/serializer.ts +0 -18
- package/src/cli/move.ts +1 -1
- package/src/client/core.ts +0 -8
- package/src/client/get.ts +0 -6
- package/src/client/post.ts +0 -12
- package/src/client/types.ts +1 -1
- package/src/core/crypto/index.ts +0 -2
- package/src/core/crypto/singleKey.ts +0 -11
- package/src/internal/account.ts +2 -1
- package/src/internal/general.ts +1 -20
- package/src/internal/queries/currentTokenOwnershipFieldsFragment.graphql +1 -0
- package/src/internal/queries/getTableItemsData.graphql +15 -0
- package/src/internal/queries/getTableItemsMetadata.graphql +12 -0
- package/src/internal/table.ts +82 -0
- package/src/internal/transactionSubmission.ts +7 -20
- package/src/transactions/transactionBuilder/transactionBuilder.ts +2 -16
- package/src/types/generated/operations.ts +29 -0
- package/src/types/generated/queries.ts +59 -0
- package/src/types/generated/types.ts +223 -4
- package/src/types/index.ts +0 -22
- package/src/types/indexer.ts +4 -0
- package/src/utils/apiEndpoints.ts +0 -14
- package/src/utils/const.ts +0 -2
- package/src/version.ts +1 -1
- package/dist/esm/account/EphemeralKeyPair.d.mts +0 -80
- package/dist/esm/account/EphemeralKeyPair.mjs +0 -2
- package/dist/esm/account/KeylessAccount.d.mts +0 -145
- package/dist/esm/account/KeylessAccount.mjs +0 -2
- package/dist/esm/api/keyless.d.mts +0 -81
- package/dist/esm/api/keyless.mjs +0 -2
- package/dist/esm/chunk-25H3DXTL.mjs +0 -2
- package/dist/esm/chunk-25H3DXTL.mjs.map +0 -1
- package/dist/esm/chunk-2ECWQRBB.mjs +0 -2
- package/dist/esm/chunk-2HD2G4AH.mjs +0 -2
- package/dist/esm/chunk-2HD2G4AH.mjs.map +0 -1
- package/dist/esm/chunk-3COVJN6Z.mjs +0 -2
- package/dist/esm/chunk-3COVJN6Z.mjs.map +0 -1
- package/dist/esm/chunk-3FVRXELT.mjs +0 -2
- package/dist/esm/chunk-3S3GIUQY.mjs +0 -2
- package/dist/esm/chunk-5XOFEQWC.mjs +0 -2
- package/dist/esm/chunk-6RBUXB5I.mjs +0 -2
- package/dist/esm/chunk-75J7H3XD.mjs +0 -2
- package/dist/esm/chunk-75J7H3XD.mjs.map +0 -1
- package/dist/esm/chunk-7KOC7VNK.mjs +0 -2
- package/dist/esm/chunk-7KOC7VNK.mjs.map +0 -1
- package/dist/esm/chunk-7Z6DYLCA.mjs +0 -1
- package/dist/esm/chunk-AJ7UC2G3.mjs +0 -2
- package/dist/esm/chunk-AJ7UC2G3.mjs.map +0 -1
- package/dist/esm/chunk-AQ4I7VVB.mjs +0 -1
- package/dist/esm/chunk-AQ4I7VVB.mjs.map +0 -1
- package/dist/esm/chunk-C3L4ETUF.mjs +0 -2
- package/dist/esm/chunk-CO53EOHE.mjs +0 -2
- package/dist/esm/chunk-CO53EOHE.mjs.map +0 -1
- package/dist/esm/chunk-COW5IGYC.mjs +0 -2
- package/dist/esm/chunk-FBPNHF54.mjs +0 -2
- package/dist/esm/chunk-FLYEALDB.mjs +0 -2
- package/dist/esm/chunk-FLYEALDB.mjs.map +0 -1
- package/dist/esm/chunk-H62IKYXG.mjs +0 -2
- package/dist/esm/chunk-HYDDIAJ6.mjs +0 -2
- package/dist/esm/chunk-JM2B5E2I.mjs +0 -2
- package/dist/esm/chunk-JM2B5E2I.mjs.map +0 -1
- package/dist/esm/chunk-JM544NRW.mjs +0 -2
- package/dist/esm/chunk-JM544NRW.mjs.map +0 -1
- package/dist/esm/chunk-MGOHPDX4.mjs +0 -2
- package/dist/esm/chunk-MOKAU77C.mjs +0 -2
- package/dist/esm/chunk-MOKAU77C.mjs.map +0 -1
- package/dist/esm/chunk-MWUJCP27.mjs +0 -2
- package/dist/esm/chunk-N466X3S6.mjs +0 -2
- package/dist/esm/chunk-N466X3S6.mjs.map +0 -1
- package/dist/esm/chunk-NBEXLW7P.mjs +0 -2
- package/dist/esm/chunk-PGCBIU33.mjs +0 -2
- package/dist/esm/chunk-PGCBIU33.mjs.map +0 -1
- package/dist/esm/chunk-PYUWGGAW.mjs +0 -2
- package/dist/esm/chunk-PYUWGGAW.mjs.map +0 -1
- package/dist/esm/chunk-RKTM5GBP.mjs +0 -2
- package/dist/esm/chunk-RKTM5GBP.mjs.map +0 -1
- package/dist/esm/chunk-S4SEFF4K.mjs.map +0 -1
- package/dist/esm/chunk-STYDBDYL.mjs +0 -2
- package/dist/esm/chunk-TJDC5PWD.mjs +0 -2
- package/dist/esm/chunk-UTXJOB3O.mjs +0 -2
- package/dist/esm/chunk-VL6EYA53.mjs +0 -2
- package/dist/esm/chunk-VL6EYA53.mjs.map +0 -1
- package/dist/esm/chunk-VPKPQBKL.mjs +0 -2
- package/dist/esm/chunk-VPKPQBKL.mjs.map +0 -1
- package/dist/esm/chunk-VSD2AWUR.mjs +0 -2
- package/dist/esm/chunk-VSD2AWUR.mjs.map +0 -1
- package/dist/esm/chunk-VT6XJSRO.mjs +0 -2
- package/dist/esm/chunk-VT6XJSRO.mjs.map +0 -1
- package/dist/esm/chunk-WM2NCYZL.mjs +0 -2
- package/dist/esm/chunk-YE5B2S5L.mjs +0 -2
- package/dist/esm/chunk-YE5B2S5L.mjs.map +0 -1
- package/dist/esm/chunk-YGOJYDJA.mjs +0 -2
- package/dist/esm/chunk-YGOJYDJA.mjs.map +0 -1
- package/dist/esm/chunk-YNNPWCF6.mjs +0 -2
- package/dist/esm/chunk-YV7OBLK2.mjs +0 -2
- package/dist/esm/chunk-YV7OBLK2.mjs.map +0 -1
- package/dist/esm/chunk-ZKRG4C4U.mjs +0 -2
- package/dist/esm/chunk-ZKRG4C4U.mjs.map +0 -1
- package/dist/esm/core/crypto/ephemeral.d.mts +0 -73
- package/dist/esm/core/crypto/ephemeral.mjs +0 -2
- package/dist/esm/core/crypto/ephemeral.mjs.map +0 -1
- package/dist/esm/core/crypto/keyless.d.mts +0 -232
- package/dist/esm/core/crypto/keyless.mjs +0 -2
- package/dist/esm/core/crypto/keyless.mjs.map +0 -1
- package/dist/esm/core/crypto/poseidon.d.mts +0 -7
- package/dist/esm/core/crypto/poseidon.mjs +0 -2
- package/dist/esm/core/crypto/poseidon.mjs.map +0 -1
- package/dist/esm/core/crypto/proof.d.mts +0 -21
- package/dist/esm/core/crypto/proof.mjs +0 -2
- package/dist/esm/core/crypto/proof.mjs.map +0 -1
- package/dist/esm/internal/keyless.d.mts +0 -68
- package/dist/esm/internal/keyless.mjs +0 -2
- package/dist/esm/internal/keyless.mjs.map +0 -1
- package/dist/esm/types/keyless.d.mts +0 -69
- package/dist/esm/types/keyless.mjs +0 -2
- package/dist/esm/types/keyless.mjs.map +0 -1
- package/src/account/EphemeralKeyPair.ts +0 -161
- package/src/account/KeylessAccount.ts +0 -341
- package/src/api/keyless.ts +0 -48
- package/src/core/crypto/ephemeral.ts +0 -138
- package/src/core/crypto/keyless.ts +0 -453
- package/src/core/crypto/poseidon.ts +0 -134
- package/src/core/crypto/proof.ts +0 -16
- package/src/internal/keyless.ts +0 -119
- package/src/types/keyless.ts +0 -37
- /package/dist/esm/{account/EphemeralKeyPair.mjs.map → api/table.mjs.map} +0 -0
- /package/dist/esm/{chunk-3CUVYW32.mjs.map → chunk-2X7A4HUS.mjs.map} +0 -0
- /package/dist/esm/{chunk-Y4SSUCPJ.mjs.map → chunk-2YZSEM2G.mjs.map} +0 -0
- /package/dist/esm/{chunk-ZNEBMSNC.mjs.map → chunk-35EWRSDK.mjs.map} +0 -0
- /package/dist/esm/{chunk-SLI3KELH.mjs.map → chunk-477G7LHJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-COW5IGYC.mjs.map → chunk-4NHWV5AI.mjs.map} +0 -0
- /package/dist/esm/{chunk-7STYQ5ZE.mjs.map → chunk-5EN52MUT.mjs.map} +0 -0
- /package/dist/esm/{chunk-P7JMD7KZ.mjs.map → chunk-5VIESFOC.mjs.map} +0 -0
- /package/dist/esm/{chunk-TE3WIJ26.mjs.map → chunk-5YLAWRI2.mjs.map} +0 -0
- /package/dist/esm/{chunk-3CMS2KOX.mjs.map → chunk-6JLYD5Q2.mjs.map} +0 -0
- /package/dist/esm/{chunk-HMFL7AOJ.mjs.map → chunk-6XWDDCQD.mjs.map} +0 -0
- /package/dist/esm/{chunk-CS7B3FVO.mjs.map → chunk-7NEETXEA.mjs.map} +0 -0
- /package/dist/esm/{chunk-H62IKYXG.mjs.map → chunk-7VRZLDIJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-24ZOKI52.mjs.map → chunk-ACG4ZGRQ.mjs.map} +0 -0
- /package/dist/esm/{chunk-3S3GIUQY.mjs.map → chunk-AQAH67IV.mjs.map} +0 -0
- /package/dist/esm/{chunk-MGOHPDX4.mjs.map → chunk-B7X6PSE7.mjs.map} +0 -0
- /package/dist/esm/{chunk-AOCNYMMX.mjs.map → chunk-BCUSI3N6.mjs.map} +0 -0
- /package/dist/esm/{chunk-HYU23YVP.mjs.map → chunk-BHLICYAI.mjs.map} +0 -0
- /package/dist/esm/{chunk-2ECWQRBB.mjs.map → chunk-BO2TLWNT.mjs.map} +0 -0
- /package/dist/esm/{chunk-3FVRXELT.mjs.map → chunk-CEHCDA3G.mjs.map} +0 -0
- /package/dist/esm/{chunk-WWGROAKX.mjs.map → chunk-CWUH4PNH.mjs.map} +0 -0
- /package/dist/esm/{chunk-DD2VWOMZ.mjs.map → chunk-E2NVC2VR.mjs.map} +0 -0
- /package/dist/esm/{chunk-TJDC5PWD.mjs.map → chunk-F7EMGK4M.mjs.map} +0 -0
- /package/dist/esm/{chunk-EB7AI4B4.mjs.map → chunk-G56GPLTB.mjs.map} +0 -0
- /package/dist/esm/{chunk-7IMWGGA6.mjs.map → chunk-GIAABV7R.mjs.map} +0 -0
- /package/dist/esm/{chunk-KMKSA7LM.mjs.map → chunk-GKJ2NJG5.mjs.map} +0 -0
- /package/dist/esm/{chunk-NC5HHEEM.mjs.map → chunk-GM56MMNJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-GQ6HIKZT.mjs.map → chunk-HMARHACL.mjs.map} +0 -0
- /package/dist/esm/{chunk-5XOFEQWC.mjs.map → chunk-HNEAPYNI.mjs.map} +0 -0
- /package/dist/esm/{chunk-P2WALKSW.mjs.map → chunk-HSJTQLI2.mjs.map} +0 -0
- /package/dist/esm/{chunk-23MNZ5LZ.mjs.map → chunk-IZQV2SU6.mjs.map} +0 -0
- /package/dist/esm/{chunk-XZGQMZ2H.mjs.map → chunk-JFIAWBCK.mjs.map} +0 -0
- /package/dist/esm/{chunk-HGZGTBA4.mjs.map → chunk-KAGLWBIJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-FBPNHF54.mjs.map → chunk-LG7RJQ57.mjs.map} +0 -0
- /package/dist/esm/{chunk-HHVAU5HU.mjs.map → chunk-MCRRHBFQ.mjs.map} +0 -0
- /package/dist/esm/{chunk-PFFAQZHT.mjs.map → chunk-MJPUASSD.mjs.map} +0 -0
- /package/dist/esm/{chunk-7XYECSW6.mjs.map → chunk-MQI2IE6Y.mjs.map} +0 -0
- /package/dist/esm/{chunk-C3L4ETUF.mjs.map → chunk-N3U47Y6Y.mjs.map} +0 -0
- /package/dist/esm/{chunk-L5WUYZ35.mjs.map → chunk-NZETF6Z4.mjs.map} +0 -0
- /package/dist/esm/{chunk-CB6CNNM2.mjs.map → chunk-P6GWG2CY.mjs.map} +0 -0
- /package/dist/esm/{chunk-MWUJCP27.mjs.map → chunk-PF57EOJY.mjs.map} +0 -0
- /package/dist/esm/{chunk-JLWKIYHV.mjs.map → chunk-PIVZMT5D.mjs.map} +0 -0
- /package/dist/esm/{chunk-R52BRP36.mjs.map → chunk-PLXGSUZA.mjs.map} +0 -0
- /package/dist/esm/{chunk-AHNE2QA3.mjs.map → chunk-PPO4IXE4.mjs.map} +0 -0
- /package/dist/esm/{chunk-PMPTAPM3.mjs.map → chunk-QIHR7HD6.mjs.map} +0 -0
- /package/dist/esm/{chunk-BTLFW3YY.mjs.map → chunk-QQ5PHEJF.mjs.map} +0 -0
- /package/dist/esm/{chunk-UTXJOB3O.mjs.map → chunk-ROXFCLDT.mjs.map} +0 -0
- /package/dist/esm/{chunk-Y33CIIZX.mjs.map → chunk-RVWYURXG.mjs.map} +0 -0
- /package/dist/esm/{chunk-U5C2PXC6.mjs.map → chunk-RYD6HRW7.mjs.map} +0 -0
- /package/dist/esm/{chunk-SI7MPP6G.mjs.map → chunk-T2AGN5YT.mjs.map} +0 -0
- /package/dist/esm/{chunk-HSFG2AIK.mjs.map → chunk-TT2XR5ZI.mjs.map} +0 -0
- /package/dist/esm/{chunk-3VGX3TXH.mjs.map → chunk-U3YYSIIT.mjs.map} +0 -0
- /package/dist/esm/{chunk-STYDBDYL.mjs.map → chunk-UGPALAPN.mjs.map} +0 -0
- /package/dist/esm/{chunk-7SIQDOYY.mjs.map → chunk-UKSRF2Q3.mjs.map} +0 -0
- /package/dist/esm/{account/KeylessAccount.mjs.map → chunk-UO3NZ5AH.mjs.map} +0 -0
- /package/dist/esm/{chunk-TICM455H.mjs.map → chunk-UPSCPEEE.mjs.map} +0 -0
- /package/dist/esm/{api/keyless.mjs.map → chunk-UVSRX4SV.mjs.map} +0 -0
- /package/dist/esm/{chunk-O3PLAAN7.mjs.map → chunk-XBHFMNYB.mjs.map} +0 -0
- /package/dist/esm/{chunk-GNNNICLW.mjs.map → chunk-XD46HTI2.mjs.map} +0 -0
- /package/dist/esm/{chunk-6WIB3GGF.mjs.map → chunk-XFSDV3ND.mjs.map} +0 -0
- /package/dist/esm/{chunk-ZPMS2Q37.mjs.map → chunk-ZBXOX3S7.mjs.map} +0 -0
- /package/dist/esm/{chunk-7Z6DYLCA.mjs.map → internal/table.mjs.map} +0 -0
- /package/dist/esm/{publicKey-lq5djCIY.d.mts → publicKey-B3XRNhHO.d.mts} +0 -0
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { Deserializer } from '../bcs/deserializer.mjs';
|
|
2
|
-
import { Serializable, Serializer } from '../bcs/serializer.mjs';
|
|
3
|
-
import { HexInput, EphemeralPublicKeyVariant } from '../types/index.mjs';
|
|
4
|
-
import { PrivateKey } from '../core/crypto/privateKey.mjs';
|
|
5
|
-
import { EphemeralPublicKey, EphemeralSignature } from '../core/crypto/ephemeral.mjs';
|
|
6
|
-
import '../core/hex.mjs';
|
|
7
|
-
import '../core/common.mjs';
|
|
8
|
-
import '../utils/apiEndpoints.mjs';
|
|
9
|
-
import '../types/indexer.mjs';
|
|
10
|
-
import '../types/generated/operations.mjs';
|
|
11
|
-
import '../types/generated/types.mjs';
|
|
12
|
-
import '../publicKey-lq5djCIY.mjs';
|
|
13
|
-
import '../core/accountAddress.mjs';
|
|
14
|
-
import '../transactions/instances/transactionArgument.mjs';
|
|
15
|
-
import '../core/crypto/signature.mjs';
|
|
16
|
-
|
|
17
|
-
declare class EphemeralKeyPair extends Serializable {
|
|
18
|
-
static readonly BLINDER_LENGTH: number;
|
|
19
|
-
/**
|
|
20
|
-
* A byte array of length BLINDER_LENGTH used to obfuscate the public key from the IdP.
|
|
21
|
-
* Used in calculating the nonce passed to the IdP and as a secret witness in proof generation.
|
|
22
|
-
*/
|
|
23
|
-
readonly blinder: Uint8Array;
|
|
24
|
-
/**
|
|
25
|
-
* A timestamp in seconds indicating when the ephemeral key pair is expired. After expiry, a new
|
|
26
|
-
* EphemeralKeyPair must be generated and a new JWT needs to be created.
|
|
27
|
-
*/
|
|
28
|
-
readonly expiryDateSecs: bigint | number;
|
|
29
|
-
/**
|
|
30
|
-
* The value passed to the IdP when the user authenticates. It comprises of a hash of the
|
|
31
|
-
* ephermeral public key, expiry date, and blinder.
|
|
32
|
-
*/
|
|
33
|
-
readonly nonce: string;
|
|
34
|
-
/**
|
|
35
|
-
* A private key used to sign transactions. This private key is not tied to any account on the chain as it
|
|
36
|
-
* is ephemeral in nature.
|
|
37
|
-
*/
|
|
38
|
-
private privateKey;
|
|
39
|
-
/**
|
|
40
|
-
* A public key used to verify transactions. This public key is not tied to any account on the chain as it
|
|
41
|
-
* is ephemeral in nature.
|
|
42
|
-
*/
|
|
43
|
-
private publicKey;
|
|
44
|
-
constructor(args: {
|
|
45
|
-
privateKey: PrivateKey;
|
|
46
|
-
expiryDateSecs?: bigint | number;
|
|
47
|
-
blinder?: HexInput;
|
|
48
|
-
});
|
|
49
|
-
/**
|
|
50
|
-
* Returns the public key of the key pair.
|
|
51
|
-
* @return EphemeralPublicKey
|
|
52
|
-
*/
|
|
53
|
-
getPublicKey(): EphemeralPublicKey;
|
|
54
|
-
/**
|
|
55
|
-
* Returns the public key of the key pair.
|
|
56
|
-
* @return boolean
|
|
57
|
-
*/
|
|
58
|
-
isExpired(): boolean;
|
|
59
|
-
serialize(serializer: Serializer): void;
|
|
60
|
-
static deserialize(deserializer: Deserializer): EphemeralKeyPair;
|
|
61
|
-
static fromBytes(bytes: Uint8Array): EphemeralKeyPair;
|
|
62
|
-
/**
|
|
63
|
-
* Returns the public key of the key pair.
|
|
64
|
-
* @param scheme the type of keypair to use for the EphemeralKeyPair. Only Ed25519 supported for now.
|
|
65
|
-
* @return boolean
|
|
66
|
-
*/
|
|
67
|
-
static generate(args?: {
|
|
68
|
-
scheme: EphemeralPublicKeyVariant;
|
|
69
|
-
}): EphemeralKeyPair;
|
|
70
|
-
private generateNonce;
|
|
71
|
-
/**
|
|
72
|
-
* Sign the given message with the private key.
|
|
73
|
-
*
|
|
74
|
-
* @param data in HexInput format
|
|
75
|
-
* @returns EphemeralSignature
|
|
76
|
-
*/
|
|
77
|
-
sign(data: HexInput): EphemeralSignature;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export { EphemeralKeyPair };
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a}from"../chunk-RKTM5GBP.mjs";import"../chunk-AQ4I7VVB.mjs";import"../chunk-HHVAU5HU.mjs";import"../chunk-JLWKIYHV.mjs";import"../chunk-YV7OBLK2.mjs";import"../chunk-KUX6GQ2E.mjs";import"../chunk-3CUVYW32.mjs";import"../chunk-PGCBIU33.mjs";import"../chunk-FLYEALDB.mjs";import"../chunk-N466X3S6.mjs";import"../chunk-25H3DXTL.mjs";import"../chunk-SI7MPP6G.mjs";import"../chunk-TJDC5PWD.mjs";import"../chunk-COW5IGYC.mjs";import"../chunk-STYDBDYL.mjs";import"../chunk-LR65XHSF.mjs";import"../chunk-7STYQ5ZE.mjs";import"../chunk-T23OVRNF.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-EB7AI4B4.mjs";import"../chunk-6RBUXB5I.mjs";import"../chunk-C3L4ETUF.mjs";import"../chunk-3FVRXELT.mjs";import"../chunk-JM2B5E2I.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-VT6XJSRO.mjs";import"../chunk-TVRJ3M7B.mjs";import"../chunk-AOCNYMMX.mjs";import"../chunk-FBPNHF54.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-FVA2OPG4.mjs";export{a as EphemeralKeyPair};
|
|
2
|
-
//# sourceMappingURL=EphemeralKeyPair.mjs.map
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import EventEmitter from 'eventemitter3';
|
|
2
|
-
import { SigningScheme, HexInput } from '../types/index.mjs';
|
|
3
|
-
import { AccountAddress } from '../core/accountAddress.mjs';
|
|
4
|
-
import { Deserializer } from '../bcs/deserializer.mjs';
|
|
5
|
-
import { Serializable, Serializer } from '../bcs/serializer.mjs';
|
|
6
|
-
import { Signature } from '../core/crypto/signature.mjs';
|
|
7
|
-
import { KeylessPublicKey, ZeroKnowledgeSig, KeylessSignature } from '../core/crypto/keyless.mjs';
|
|
8
|
-
import { A as Account } from '../Ed25519Account-9zBaZEnp.mjs';
|
|
9
|
-
import { EphemeralKeyPair } from './EphemeralKeyPair.mjs';
|
|
10
|
-
import { AccountAuthenticatorSingleKey } from '../transactions/authenticator/account.mjs';
|
|
11
|
-
import { AnyRawTransaction } from '../transactions/types.mjs';
|
|
12
|
-
import '../utils/apiEndpoints.mjs';
|
|
13
|
-
import '../types/indexer.mjs';
|
|
14
|
-
import '../types/generated/operations.mjs';
|
|
15
|
-
import '../types/generated/types.mjs';
|
|
16
|
-
import '../core/common.mjs';
|
|
17
|
-
import '../transactions/instances/transactionArgument.mjs';
|
|
18
|
-
import '../core/hex.mjs';
|
|
19
|
-
import '../publicKey-lq5djCIY.mjs';
|
|
20
|
-
import '../core/crypto/ephemeral.mjs';
|
|
21
|
-
import '../core/crypto/proof.mjs';
|
|
22
|
-
import '../core/crypto/ed25519.mjs';
|
|
23
|
-
import '../core/crypto/privateKey.mjs';
|
|
24
|
-
import '../core/crypto/singleKey.mjs';
|
|
25
|
-
import '../core/crypto/multiEd25519.mjs';
|
|
26
|
-
import '../core/crypto/multiKey.mjs';
|
|
27
|
-
import '../api/aptosConfig.mjs';
|
|
28
|
-
import '../utils/const.mjs';
|
|
29
|
-
import '../bcs/serializable/moveStructs.mjs';
|
|
30
|
-
import '../bcs/serializable/movePrimitives.mjs';
|
|
31
|
-
import '../bcs/serializable/fixedBytes.mjs';
|
|
32
|
-
import '../transactions/instances/rawTransaction.mjs';
|
|
33
|
-
import '../transactions/instances/chainId.mjs';
|
|
34
|
-
import '../transactions/instances/transactionPayload.mjs';
|
|
35
|
-
import '../transactions/instances/identifier.mjs';
|
|
36
|
-
import '../transactions/instances/moduleId.mjs';
|
|
37
|
-
import '../transactions/typeTag/index.mjs';
|
|
38
|
-
import '../transactions/instances/simpleTransaction.mjs';
|
|
39
|
-
import '../transactions/instances/multiAgentTransaction.mjs';
|
|
40
|
-
|
|
41
|
-
declare const IssuerToJwkEndpoint: Record<string, string>;
|
|
42
|
-
declare class KeylessAccount extends Serializable implements Account {
|
|
43
|
-
static readonly PEPPER_LENGTH: number;
|
|
44
|
-
readonly publicKey: KeylessPublicKey;
|
|
45
|
-
readonly ephemeralKeyPair: EphemeralKeyPair;
|
|
46
|
-
readonly uidKey: string;
|
|
47
|
-
readonly uidVal: string;
|
|
48
|
-
readonly aud: string;
|
|
49
|
-
readonly pepper: Uint8Array;
|
|
50
|
-
readonly accountAddress: AccountAddress;
|
|
51
|
-
proof: ZeroKnowledgeSig | undefined;
|
|
52
|
-
readonly proofOrPromise: ZeroKnowledgeSig | Promise<ZeroKnowledgeSig>;
|
|
53
|
-
readonly signingScheme: SigningScheme;
|
|
54
|
-
private jwt;
|
|
55
|
-
private isJwtValid;
|
|
56
|
-
readonly emitter: EventEmitter<ProofFetchEvents>;
|
|
57
|
-
constructor(args: {
|
|
58
|
-
address?: AccountAddress;
|
|
59
|
-
ephemeralKeyPair: EphemeralKeyPair;
|
|
60
|
-
iss: string;
|
|
61
|
-
uidKey: string;
|
|
62
|
-
uidVal: string;
|
|
63
|
-
aud: string;
|
|
64
|
-
pepper: HexInput;
|
|
65
|
-
proofOrFetcher: ZeroKnowledgeSig | Promise<ZeroKnowledgeSig>;
|
|
66
|
-
proofFetchCallback?: ProofFetchCallback;
|
|
67
|
-
jwt: string;
|
|
68
|
-
});
|
|
69
|
-
/**
|
|
70
|
-
* This initializes the asyncronous proof fetch
|
|
71
|
-
* @return
|
|
72
|
-
*/
|
|
73
|
-
init(promise: Promise<ZeroKnowledgeSig>): Promise<void>;
|
|
74
|
-
serialize(serializer: Serializer): void;
|
|
75
|
-
static deserialize(deserializer: Deserializer): KeylessAccount;
|
|
76
|
-
/**
|
|
77
|
-
* Checks if the proof is expired. If so the account must be rederived with a new EphemeralKeyPair
|
|
78
|
-
* and JWT token.
|
|
79
|
-
* @return boolean
|
|
80
|
-
*/
|
|
81
|
-
isExpired(): boolean;
|
|
82
|
-
/**
|
|
83
|
-
* Checks if the the JWK used to verify the token still exists on the issuer's JWK uri.
|
|
84
|
-
* Caches the result.
|
|
85
|
-
* @return boolean
|
|
86
|
-
*/
|
|
87
|
-
checkJwkValidity(): Promise<boolean>;
|
|
88
|
-
/**
|
|
89
|
-
* Sign a message using Keyless.
|
|
90
|
-
* @param message the message to sign, as binary input
|
|
91
|
-
* @return the AccountAuthenticator containing the signature, together with the account's public key
|
|
92
|
-
*/
|
|
93
|
-
signWithAuthenticator(message: HexInput): AccountAuthenticatorSingleKey;
|
|
94
|
-
/**
|
|
95
|
-
* Sign a transaction using Keyless.
|
|
96
|
-
* @param transaction the raw transaction
|
|
97
|
-
* @return the AccountAuthenticator containing the signature of the transaction, together with the account's public key
|
|
98
|
-
*/
|
|
99
|
-
signTransactionWithAuthenticator(transaction: AnyRawTransaction): AccountAuthenticatorSingleKey;
|
|
100
|
-
/**
|
|
101
|
-
* Waits for asyncronous proof fetching to finish.
|
|
102
|
-
* @return
|
|
103
|
-
*/
|
|
104
|
-
waitForProofFetch(): Promise<void>;
|
|
105
|
-
/**
|
|
106
|
-
* Sign the given message using Keyless.
|
|
107
|
-
* @param message in HexInput format
|
|
108
|
-
* @returns Signature
|
|
109
|
-
*/
|
|
110
|
-
sign(data: HexInput): KeylessSignature;
|
|
111
|
-
/**
|
|
112
|
-
* Sign the given transaction with Keyless.
|
|
113
|
-
* Signs the transaction and proof to guard against proof malleability.
|
|
114
|
-
* @param transaction the transaction to be signed
|
|
115
|
-
* @returns KeylessSignature
|
|
116
|
-
*/
|
|
117
|
-
signTransaction(transaction: AnyRawTransaction): KeylessSignature;
|
|
118
|
-
verifySignature(args: {
|
|
119
|
-
message: HexInput;
|
|
120
|
-
signature: Signature;
|
|
121
|
-
}): boolean;
|
|
122
|
-
static fromBytes(bytes: Uint8Array): KeylessAccount;
|
|
123
|
-
static fromJWTAndProof(args: {
|
|
124
|
-
proof: ZeroKnowledgeSig | Promise<ZeroKnowledgeSig>;
|
|
125
|
-
jwt: string;
|
|
126
|
-
ephemeralKeyPair: EphemeralKeyPair;
|
|
127
|
-
pepper: HexInput;
|
|
128
|
-
uidKey?: string;
|
|
129
|
-
proofFetchCallback?: ProofFetchCallback;
|
|
130
|
-
}): KeylessAccount;
|
|
131
|
-
}
|
|
132
|
-
type ProofFetchSuccess = {
|
|
133
|
-
status: "Success";
|
|
134
|
-
};
|
|
135
|
-
type ProofFetchFailure = {
|
|
136
|
-
status: "Failed";
|
|
137
|
-
error: string;
|
|
138
|
-
};
|
|
139
|
-
type ProofFetchStatus = ProofFetchSuccess | ProofFetchFailure;
|
|
140
|
-
type ProofFetchCallback = (status: ProofFetchStatus) => Promise<void>;
|
|
141
|
-
interface ProofFetchEvents {
|
|
142
|
-
proofFetchFinish: (status: ProofFetchStatus) => void;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
export { IssuerToJwkEndpoint, KeylessAccount, type ProofFetchCallback, type ProofFetchEvents, type ProofFetchFailure, type ProofFetchStatus, type ProofFetchSuccess };
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a,b}from"../chunk-VSD2AWUR.mjs";import"../chunk-RKTM5GBP.mjs";import"../chunk-XZGQMZ2H.mjs";import"../chunk-4NMDYPUD.mjs";import"../chunk-5XOFEQWC.mjs";import"../chunk-CB6CNNM2.mjs";import"../chunk-UYVPNUH3.mjs";import"../chunk-HYU23YVP.mjs";import"../chunk-2ECWQRBB.mjs";import"../chunk-H62IKYXG.mjs";import"../chunk-MWUJCP27.mjs";import"../chunk-ZNEBMSNC.mjs";import"../chunk-NC5HHEEM.mjs";import"../chunk-3VGX3TXH.mjs";import"../chunk-MGOHPDX4.mjs";import"../chunk-3S3GIUQY.mjs";import"../chunk-HYDDIAJ6.mjs";import"../chunk-RFSO3JRG.mjs";import"../chunk-AQ4I7VVB.mjs";import"../chunk-HHVAU5HU.mjs";import"../chunk-JLWKIYHV.mjs";import"../chunk-YV7OBLK2.mjs";import"../chunk-KUX6GQ2E.mjs";import"../chunk-3CUVYW32.mjs";import"../chunk-PGCBIU33.mjs";import"../chunk-FLYEALDB.mjs";import"../chunk-N466X3S6.mjs";import"../chunk-25H3DXTL.mjs";import"../chunk-SI7MPP6G.mjs";import"../chunk-TJDC5PWD.mjs";import"../chunk-COW5IGYC.mjs";import"../chunk-STYDBDYL.mjs";import"../chunk-LR65XHSF.mjs";import"../chunk-7STYQ5ZE.mjs";import"../chunk-T23OVRNF.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-EB7AI4B4.mjs";import"../chunk-6RBUXB5I.mjs";import"../chunk-C3L4ETUF.mjs";import"../chunk-3FVRXELT.mjs";import"../chunk-JM2B5E2I.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-VT6XJSRO.mjs";import"../chunk-TVRJ3M7B.mjs";import"../chunk-AOCNYMMX.mjs";import"../chunk-FBPNHF54.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-YE5B2S5L.mjs";import"../chunk-FVA2OPG4.mjs";export{a as IssuerToJwkEndpoint,b as KeylessAccount};
|
|
2
|
-
//# sourceMappingURL=KeylessAccount.mjs.map
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { HexInput } from '../types/index.mjs';
|
|
2
|
-
import { AptosConfig } from './aptosConfig.mjs';
|
|
3
|
-
import { EphemeralKeyPair } from '../account/EphemeralKeyPair.mjs';
|
|
4
|
-
import { ProofFetchCallback, KeylessAccount } from '../account/KeylessAccount.mjs';
|
|
5
|
-
import '../utils/apiEndpoints.mjs';
|
|
6
|
-
import '../types/indexer.mjs';
|
|
7
|
-
import '../types/generated/operations.mjs';
|
|
8
|
-
import '../types/generated/types.mjs';
|
|
9
|
-
import '../utils/const.mjs';
|
|
10
|
-
import '../bcs/deserializer.mjs';
|
|
11
|
-
import '../bcs/serializer.mjs';
|
|
12
|
-
import '../core/hex.mjs';
|
|
13
|
-
import '../core/common.mjs';
|
|
14
|
-
import '../core/crypto/privateKey.mjs';
|
|
15
|
-
import '../publicKey-lq5djCIY.mjs';
|
|
16
|
-
import '../core/accountAddress.mjs';
|
|
17
|
-
import '../transactions/instances/transactionArgument.mjs';
|
|
18
|
-
import '../core/crypto/signature.mjs';
|
|
19
|
-
import '../core/crypto/ephemeral.mjs';
|
|
20
|
-
import 'eventemitter3';
|
|
21
|
-
import '../core/crypto/keyless.mjs';
|
|
22
|
-
import '../core/crypto/proof.mjs';
|
|
23
|
-
import '../Ed25519Account-9zBaZEnp.mjs';
|
|
24
|
-
import '../transactions/authenticator/account.mjs';
|
|
25
|
-
import '../core/crypto/ed25519.mjs';
|
|
26
|
-
import '../core/crypto/multiEd25519.mjs';
|
|
27
|
-
import '../core/crypto/multiKey.mjs';
|
|
28
|
-
import '../core/crypto/singleKey.mjs';
|
|
29
|
-
import '../transactions/types.mjs';
|
|
30
|
-
import '../bcs/serializable/moveStructs.mjs';
|
|
31
|
-
import '../bcs/serializable/movePrimitives.mjs';
|
|
32
|
-
import '../bcs/serializable/fixedBytes.mjs';
|
|
33
|
-
import '../transactions/instances/rawTransaction.mjs';
|
|
34
|
-
import '../transactions/instances/chainId.mjs';
|
|
35
|
-
import '../transactions/instances/transactionPayload.mjs';
|
|
36
|
-
import '../transactions/instances/identifier.mjs';
|
|
37
|
-
import '../transactions/instances/moduleId.mjs';
|
|
38
|
-
import '../transactions/typeTag/index.mjs';
|
|
39
|
-
import '../transactions/instances/simpleTransaction.mjs';
|
|
40
|
-
import '../transactions/instances/multiAgentTransaction.mjs';
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* A class to query all `Keyless` related queries on Aptos.
|
|
44
|
-
*/
|
|
45
|
-
declare class Keyless {
|
|
46
|
-
readonly config: AptosConfig;
|
|
47
|
-
constructor(config: AptosConfig);
|
|
48
|
-
/**
|
|
49
|
-
* Fetches the pepper from the Aptos pepper service API.
|
|
50
|
-
*
|
|
51
|
-
* @param args.jwt JWT token
|
|
52
|
-
* @param args.ephemeralKeyPair the EphemeralKeyPair used to generate the nonce in the JWT token
|
|
53
|
-
* @returns The pepper which is a Uint8Array of length 31.
|
|
54
|
-
*/
|
|
55
|
-
getPepper(args: {
|
|
56
|
-
jwt: string;
|
|
57
|
-
ephemeralKeyPair: EphemeralKeyPair;
|
|
58
|
-
}): Promise<Uint8Array>;
|
|
59
|
-
/**
|
|
60
|
-
* Fetches the pepper from the Aptos pepper service API.
|
|
61
|
-
*
|
|
62
|
-
* @param args.jwt JWT token
|
|
63
|
-
* @param args.ephemeralKeyPair the EphemeralKeyPair used to generate the nonce in the JWT token
|
|
64
|
-
* @param args.uidKey a key in the JWT token to use to set the uidVal in the IdCommitment
|
|
65
|
-
* @param args.pepper the pepper
|
|
66
|
-
* @param args.extraFieldKey a key in the JWT token used to reveal a value on chain
|
|
67
|
-
* @param args.proofFetchCallback a callback function that if set, the fetch of the proof will be done asyncronously. Once
|
|
68
|
-
* if finishes the callback function will be called.
|
|
69
|
-
* @returns A KeylessAccount that can be used to sign transactions
|
|
70
|
-
*/
|
|
71
|
-
deriveKeylessAccount(args: {
|
|
72
|
-
jwt: string;
|
|
73
|
-
ephemeralKeyPair: EphemeralKeyPair;
|
|
74
|
-
uidKey?: string;
|
|
75
|
-
pepper?: HexInput;
|
|
76
|
-
extraFieldKey?: string;
|
|
77
|
-
proofFetchCallback?: ProofFetchCallback;
|
|
78
|
-
}): Promise<KeylessAccount>;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
export { Keyless };
|
package/dist/esm/api/keyless.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a}from"../chunk-7KOC7VNK.mjs";import"../chunk-75J7H3XD.mjs";import"../chunk-7Z6DYLCA.mjs";import"../chunk-Y4SSUCPJ.mjs";import"../chunk-HMFL7AOJ.mjs";import"../chunk-VPKPQBKL.mjs";import"../chunk-VSD2AWUR.mjs";import"../chunk-RKTM5GBP.mjs";import"../chunk-Y33CIIZX.mjs";import"../chunk-XZGQMZ2H.mjs";import"../chunk-4NMDYPUD.mjs";import"../chunk-5XOFEQWC.mjs";import"../chunk-CB6CNNM2.mjs";import"../chunk-UYVPNUH3.mjs";import"../chunk-HYU23YVP.mjs";import"../chunk-2ECWQRBB.mjs";import"../chunk-H62IKYXG.mjs";import"../chunk-MWUJCP27.mjs";import"../chunk-ZNEBMSNC.mjs";import"../chunk-NC5HHEEM.mjs";import"../chunk-3VGX3TXH.mjs";import"../chunk-MGOHPDX4.mjs";import"../chunk-3S3GIUQY.mjs";import"../chunk-HYDDIAJ6.mjs";import"../chunk-RFSO3JRG.mjs";import"../chunk-AQ4I7VVB.mjs";import"../chunk-HHVAU5HU.mjs";import"../chunk-JLWKIYHV.mjs";import"../chunk-YV7OBLK2.mjs";import"../chunk-KUX6GQ2E.mjs";import"../chunk-3CUVYW32.mjs";import"../chunk-PGCBIU33.mjs";import"../chunk-FLYEALDB.mjs";import"../chunk-N466X3S6.mjs";import"../chunk-25H3DXTL.mjs";import"../chunk-SI7MPP6G.mjs";import"../chunk-TJDC5PWD.mjs";import"../chunk-COW5IGYC.mjs";import"../chunk-STYDBDYL.mjs";import"../chunk-LR65XHSF.mjs";import"../chunk-7STYQ5ZE.mjs";import"../chunk-T23OVRNF.mjs";import"../chunk-N2FKVZ4D.mjs";import"../chunk-YGOJYDJA.mjs";import"../chunk-YNNPWCF6.mjs";import"../chunk-WM2NCYZL.mjs";import"../chunk-GED6IT3S.mjs";import"../chunk-UTXJOB3O.mjs";import"../chunk-RKHPXZM6.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-EB7AI4B4.mjs";import"../chunk-6RBUXB5I.mjs";import"../chunk-C3L4ETUF.mjs";import"../chunk-3FVRXELT.mjs";import"../chunk-JM2B5E2I.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-VT6XJSRO.mjs";import"../chunk-TVRJ3M7B.mjs";import"../chunk-AOCNYMMX.mjs";import"../chunk-FBPNHF54.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-NBEXLW7P.mjs";import"../chunk-JM544NRW.mjs";import"../chunk-YE5B2S5L.mjs";import"../chunk-FVA2OPG4.mjs";export{a as Keyless};
|
|
2
|
-
//# sourceMappingURL=keyless.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as t,c as n}from"./chunk-SI7MPP6G.mjs";import{a as l}from"./chunk-COW5IGYC.mjs";import{a as u}from"./chunk-STYDBDYL.mjs";import{a as s}from"./chunk-VT6XJSRO.mjs";import{b as o}from"./chunk-AOCNYMMX.mjs";var c=class i extends l{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()}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}},p=class i extends u{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.bcsToBytes()}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-25H3DXTL.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/crypto/ephemeral.ts"],"sourcesContent":["import { Serializer, Deserializer } from \"../../bcs\";\nimport { EphemeralPublicKeyVariant, EphemeralSignatureVariant, HexInput } from \"../../types\";\nimport { PublicKey } from \"./publicKey\";\nimport { Signature } from \"./signature\";\nimport { Ed25519PublicKey, Ed25519Signature } from \"./ed25519\";\nimport { Hex } from \"../hex\";\n\n/**\n * Represents ephemeral public keys for Aptos Keyless accounts.\n *\n * These are not public keys used as a public key on an account. They are only used ephemerally on Keyless accounts.\n */\nexport class EphemeralPublicKey extends PublicKey {\n /**\n * The public key itself\n */\n public readonly publicKey: PublicKey;\n\n /**\n * An enum indicating the scheme of the ephemeral public key\n */\n public readonly variant: EphemeralPublicKeyVariant;\n\n constructor(publicKey: PublicKey) {\n super();\n const publicKeyType = publicKey.constructor.name;\n switch (publicKeyType) {\n case Ed25519PublicKey.name:\n this.publicKey = publicKey;\n this.variant = EphemeralPublicKeyVariant.Ed25519;\n break;\n default:\n throw new Error(`Unsupported key for EphemeralPublicKey - ${publicKeyType}`);\n }\n }\n\n /**\n * Get the public key in bytes (Uint8Array).\n *\n * @returns Uint8Array representation of the public key\n */\n toUint8Array(): Uint8Array {\n return this.bcsToBytes();\n }\n\n /**\n * Verifies a signed data with a the ephemeral public key\n *\n * @param args.message message\n * @param args.signature The signature that was signed by the private key of the ephemeral public key\n * @returns true if the signature is valid\n */\n verifySignature(args: { message: HexInput; signature: EphemeralSignature }): boolean {\n const { message, signature } = args;\n return this.publicKey.verifySignature({ message, signature });\n }\n\n serialize(serializer: Serializer): void {\n if (this.publicKey instanceof Ed25519PublicKey) {\n serializer.serializeU32AsUleb128(EphemeralPublicKeyVariant.Ed25519);\n this.publicKey.serialize(serializer);\n } else {\n throw new Error(\"Unknown public key type\");\n }\n }\n\n static deserialize(deserializer: Deserializer): EphemeralPublicKey {\n const index = deserializer.deserializeUleb128AsU32();\n switch (index) {\n case EphemeralPublicKeyVariant.Ed25519:\n return new EphemeralPublicKey(Ed25519PublicKey.deserialize(deserializer));\n default:\n throw new Error(`Unknown variant index for EphemeralPublicKey: ${index}`);\n }\n }\n\n static isPublicKey(publicKey: PublicKey): publicKey is EphemeralPublicKey {\n return publicKey instanceof EphemeralPublicKey;\n }\n}\n\n/**\n * Represents ephemeral signatures used in Aptos Keyless accounts.\n *\n * These signatures are used inside of KeylessSignature\n */\nexport class EphemeralSignature extends Signature {\n /**\n * The signature signed by the private key of an EphemeralKeyPair\n */\n public readonly signature: Signature;\n\n constructor(signature: Signature) {\n super();\n const signatureType = signature.constructor.name;\n switch (signatureType) {\n case Ed25519Signature.name:\n this.signature = signature;\n break;\n default:\n throw new Error(`Unsupported signature for EphemeralSignature - ${signatureType}`);\n }\n }\n\n /**\n * Get the public key in bytes (Uint8Array).\n *\n * @returns Uint8Array representation of the public key\n */\n toUint8Array(): Uint8Array {\n return this.bcsToBytes();\n }\n\n static fromHex(hexInput: HexInput): EphemeralSignature {\n const data = Hex.fromHexInput(hexInput);\n const deserializer = new Deserializer(data.toUint8Array());\n return EphemeralSignature.deserialize(deserializer);\n }\n\n serialize(serializer: Serializer): void {\n if (this.signature instanceof Ed25519Signature) {\n serializer.serializeU32AsUleb128(EphemeralSignatureVariant.Ed25519);\n this.signature.serialize(serializer);\n } else {\n throw new Error(\"Unknown signature type\");\n }\n }\n\n static deserialize(deserializer: Deserializer): EphemeralSignature {\n const index = deserializer.deserializeUleb128AsU32();\n switch (index) {\n case EphemeralSignatureVariant.Ed25519:\n return new EphemeralSignature(Ed25519Signature.deserialize(deserializer));\n default:\n throw new Error(`Unknown variant index for EphemeralSignature: ${index}`);\n }\n }\n}\n"],"mappings":"oNAYO,IAAMA,EAAN,MAAMC,UAA2BC,CAAU,CAWhD,YAAYC,EAAsB,CAChC,MAAM,EACN,IAAMC,EAAgBD,EAAU,YAAY,KAC5C,OAAQC,EAAe,CACrB,KAAKC,EAAiB,KACpB,KAAK,UAAYF,EACjB,KAAK,QAAU,EACf,MACF,QACE,MAAM,IAAI,MAAM,4CAA4CC,CAAa,EAAE,CAC/E,CACF,CAOA,cAA2B,CACzB,OAAO,KAAK,WAAW,CACzB,CASA,gBAAgBE,EAAqE,CACnF,GAAM,CAAE,QAAAC,EAAS,UAAAC,CAAU,EAAIF,EAC/B,OAAO,KAAK,UAAU,gBAAgB,CAAE,QAAAC,EAAS,UAAAC,CAAU,CAAC,CAC9D,CAEA,UAAUC,EAA8B,CACtC,GAAI,KAAK,qBAAqBJ,EAC5BI,EAAW,uBAAuD,EAClE,KAAK,UAAU,UAAUA,CAAU,MAEnC,OAAM,IAAI,MAAM,yBAAyB,CAE7C,CAEA,OAAO,YAAYC,EAAgD,CACjE,IAAMC,EAAQD,EAAa,wBAAwB,EACnD,OAAQC,EAAO,CACb,OACE,OAAO,IAAIV,EAAmBI,EAAiB,YAAYK,CAAY,CAAC,EAC1E,QACE,MAAM,IAAI,MAAM,iDAAiDC,CAAK,EAAE,CAC5E,CACF,CAEA,OAAO,YAAYR,EAAuD,CACxE,OAAOA,aAAqBF,CAC9B,CACF,EAOaW,EAAN,MAAMC,UAA2BC,CAAU,CAMhD,YAAYN,EAAsB,CAChC,MAAM,EACN,IAAMO,EAAgBP,EAAU,YAAY,KAC5C,OAAQO,EAAe,CACrB,KAAKC,EAAiB,KACpB,KAAK,UAAYR,EACjB,MACF,QACE,MAAM,IAAI,MAAM,kDAAkDO,CAAa,EAAE,CACrF,CACF,CAOA,cAA2B,CACzB,OAAO,KAAK,WAAW,CACzB,CAEA,OAAO,QAAQE,EAAwC,CACrD,IAAMC,EAAOC,EAAI,aAAaF,CAAQ,EAChCP,EAAe,IAAIU,EAAaF,EAAK,aAAa,CAAC,EACzD,OAAOL,EAAmB,YAAYH,CAAY,CACpD,CAEA,UAAUD,EAA8B,CACtC,GAAI,KAAK,qBAAqBO,EAC5BP,EAAW,uBAAuD,EAClE,KAAK,UAAU,UAAUA,CAAU,MAEnC,OAAM,IAAI,MAAM,wBAAwB,CAE5C,CAEA,OAAO,YAAYC,EAAgD,CACjE,IAAMC,EAAQD,EAAa,wBAAwB,EACnD,OAAQC,EAAO,CACb,OACE,OAAO,IAAIE,EAAmBG,EAAiB,YAAYN,CAAY,CAAC,EAC1E,QACE,MAAM,IAAI,MAAM,iDAAiDC,CAAK,EAAE,CAC5E,CACF,CACF","names":["EphemeralPublicKey","_EphemeralPublicKey","PublicKey","publicKey","publicKeyType","Ed25519PublicKey","args","message","signature","serializer","deserializer","index","EphemeralSignature","_EphemeralSignature","Signature","signatureType","Ed25519Signature","hexInput","data","Hex","Deserializer"]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as m}from"./chunk-H62IKYXG.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-2ECWQRBB.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as A}from"./chunk-Y4SSUCPJ.mjs";import{a as P}from"./chunk-AH44UPM4.mjs";import{d as v,f as d}from"./chunk-ZKRG4C4U.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{a as m}from"./chunk-YV7OBLK2.mjs";import{b as y}from"./chunk-3CUVYW32.mjs";import{b as l}from"./chunk-SI7MPP6G.mjs";import{a as g}from"./chunk-7STYQ5ZE.mjs";import{b as c}from"./chunk-T23OVRNF.mjs";import{b as p,d as f}from"./chunk-YGOJYDJA.mjs";import{a as _}from"./chunk-RKHPXZM6.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-2HD2G4AH.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/internal/account.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * This file contains the underlying implementations for exposed API surface in\n * the {@link api/account}. By moving the methods out into a separate file,\n * other namespaces and processes can access these methods without depending on the entire\n * account namespace and without having a dependency cycle error.\n */\n\nimport { AptosConfig } from \"../api/aptosConfig\";\nimport { AptosApiError, getAptosFullNode, paginateWithCursor } from \"../client\";\nimport { AccountAddress, AccountAddressInput } from \"../core/accountAddress\";\nimport { Account } from \"../account\";\nimport { AnyPublicKey, Ed25519PublicKey, PrivateKey } from \"../core/crypto\";\nimport { getTableItem, queryIndexer } from \"./general\";\nimport {\n AccountData,\n GetAccountCoinsDataResponse,\n GetAccountCollectionsWithOwnedTokenResponse,\n GetAccountOwnedObjectsResponse,\n GetAccountOwnedTokensFromCollectionResponse,\n GetAccountOwnedTokensQueryResponse,\n LedgerVersionArg,\n MoveModuleBytecode,\n MoveResource,\n MoveStructId,\n OrderByArg,\n PaginationArgs,\n TokenStandardArg,\n TransactionResponse,\n WhereArg,\n} from \"../types\";\nimport {\n GetAccountCoinsCountQuery,\n GetAccountCoinsDataQuery,\n GetAccountCollectionsWithOwnedTokensQuery,\n GetAccountOwnedObjectsQuery,\n GetAccountOwnedTokensFromCollectionQuery,\n GetAccountOwnedTokensQuery,\n GetAccountTokensCountQuery,\n GetAccountTransactionsCountQuery,\n} from \"../types/generated/operations\";\nimport {\n GetAccountCoinsCount,\n GetAccountCoinsData,\n GetAccountCollectionsWithOwnedTokens,\n GetAccountOwnedObjects,\n GetAccountOwnedTokens,\n GetAccountOwnedTokensFromCollection,\n GetAccountTokensCount,\n GetAccountTransactionsCount,\n} from \"../types/generated/queries\";\nimport { memoizeAsync } from \"../utils/memoize\";\nimport { Secp256k1PrivateKey, AuthenticationKey, Ed25519PrivateKey } from \"../core\";\nimport { CurrentFungibleAssetBalancesBoolExp } from \"../types/generated/types\";\n\nexport async function getInfo(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n}): Promise<AccountData> {\n const { aptosConfig, accountAddress } = args;\n const { data } = await getAptosFullNode<{}, AccountData>({\n aptosConfig,\n originMethod: \"getInfo\",\n path: `accounts/${AccountAddress.from(accountAddress).toString()}`,\n });\n return data;\n}\n\nexport async function getModules(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n options?: PaginationArgs & LedgerVersionArg;\n}): Promise<MoveModuleBytecode[]> {\n const { aptosConfig, accountAddress, options } = args;\n return paginateWithCursor<{}, MoveModuleBytecode[]>({\n aptosConfig,\n originMethod: \"getModules\",\n path: `accounts/${AccountAddress.from(accountAddress).toString()}/modules`,\n params: {\n ledger_version: options?.ledgerVersion,\n start: options?.offset,\n limit: options?.limit ?? 1000,\n },\n });\n}\n\n/**\n * Queries for a move module given account address and module name\n *\n * @param args.accountAddress Hex-encoded 32 byte Aptos account address\n * @param args.moduleName The name of the module\n * @param args.query.ledgerVersion Specifies ledger version of transactions. By default, latest version will be used\n * @returns The move module.\n */\nexport async function getModule(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n moduleName: string;\n options?: LedgerVersionArg;\n}): Promise<MoveModuleBytecode> {\n // We don't memoize the account module by ledger version, as it's not a common use case, this would be handled\n // by the developer directly\n if (args.options?.ledgerVersion !== undefined) {\n return getModuleInner(args);\n }\n\n return memoizeAsync(\n async () => getModuleInner(args),\n `module-${args.accountAddress}-${args.moduleName}`,\n 1000 * 60 * 5, // 5 minutes\n )();\n}\n\nasync function getModuleInner(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n moduleName: string;\n options?: LedgerVersionArg;\n}): Promise<MoveModuleBytecode> {\n const { aptosConfig, accountAddress, moduleName, options } = args;\n\n const { data } = await getAptosFullNode<{}, MoveModuleBytecode>({\n aptosConfig,\n originMethod: \"getModule\",\n path: `accounts/${AccountAddress.from(accountAddress).toString()}/module/${moduleName}`,\n params: { ledger_version: options?.ledgerVersion },\n });\n return data;\n}\n\nexport async function getTransactions(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n options?: PaginationArgs;\n}): Promise<TransactionResponse[]> {\n const { aptosConfig, accountAddress, options } = args;\n return paginateWithCursor<{}, TransactionResponse[]>({\n aptosConfig,\n originMethod: \"getTransactions\",\n path: `accounts/${AccountAddress.from(accountAddress).toString()}/transactions`,\n params: { start: options?.offset, limit: options?.limit },\n });\n}\n\nexport async function getResources(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n options?: PaginationArgs & LedgerVersionArg;\n}): Promise<MoveResource[]> {\n const { aptosConfig, accountAddress, options } = args;\n return paginateWithCursor<{}, MoveResource[]>({\n aptosConfig,\n originMethod: \"getResources\",\n path: `accounts/${AccountAddress.from(accountAddress).toString()}/resources`,\n params: {\n ledger_version: options?.ledgerVersion,\n start: options?.offset,\n limit: options?.limit ?? 999,\n },\n });\n}\n\nexport async function getResource<T extends {}>(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n resourceType: MoveStructId;\n options?: LedgerVersionArg;\n}): Promise<T> {\n const { aptosConfig, accountAddress, resourceType, options } = args;\n const { data } = await getAptosFullNode<{}, MoveResource>({\n aptosConfig,\n originMethod: \"getResource\",\n path: `accounts/${AccountAddress.from(accountAddress).toString()}/resource/${resourceType}`,\n params: { ledger_version: options?.ledgerVersion },\n });\n return data.data as T;\n}\n\nexport async function lookupOriginalAccountAddress(args: {\n aptosConfig: AptosConfig;\n authenticationKey: AccountAddressInput;\n options?: LedgerVersionArg;\n}): Promise<AccountAddress> {\n const { aptosConfig, authenticationKey, options } = args;\n type OriginatingAddress = {\n address_map: { handle: string };\n };\n const resource = await getResource<OriginatingAddress>({\n aptosConfig,\n accountAddress: \"0x1\",\n resourceType: \"0x1::account::OriginatingAddress\",\n options,\n });\n\n const {\n address_map: { handle },\n } = resource;\n\n const authKeyAddress = AccountAddress.from(authenticationKey);\n\n // If the address is not found in the address map, which means its not rotated\n // then return the address as is\n try {\n const originalAddress = await getTableItem<string>({\n aptosConfig,\n handle,\n data: {\n key: authKeyAddress.toString(),\n key_type: \"address\",\n value_type: \"address\",\n },\n options,\n });\n\n return AccountAddress.from(originalAddress);\n } catch (err) {\n if (err instanceof AptosApiError && err.data.error_code === \"table_item_not_found\") {\n return authKeyAddress;\n }\n\n throw err;\n }\n}\n\nexport async function getAccountTokensCount(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n}): Promise<number> {\n const { aptosConfig, accountAddress } = args;\n\n const address = AccountAddress.from(accountAddress).toStringLong();\n\n const whereCondition: { owner_address: { _eq: string }; amount: { _gt: number } } = {\n owner_address: { _eq: address },\n amount: { _gt: 0 },\n };\n\n const graphqlQuery = {\n query: GetAccountTokensCount,\n variables: { where_condition: whereCondition },\n };\n\n const data = await queryIndexer<GetAccountTokensCountQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getAccountTokensCount\",\n });\n\n // commonjs (aka cjs) doesnt handle Nullish Coalescing for some reason\n // might be because of how ts infer the graphql generated scheme type\n return data.current_token_ownerships_v2_aggregate.aggregate\n ? data.current_token_ownerships_v2_aggregate.aggregate.count\n : 0;\n}\n\nexport async function getAccountOwnedTokens(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n options?: TokenStandardArg & PaginationArgs & OrderByArg<GetAccountOwnedTokensQueryResponse[0]>;\n}): Promise<GetAccountOwnedTokensQueryResponse> {\n const { aptosConfig, accountAddress, options } = args;\n const address = AccountAddress.from(accountAddress).toStringLong();\n\n const whereCondition: { owner_address: { _eq: string }; amount: { _gt: number }; token_standard?: { _eq: string } } =\n {\n owner_address: { _eq: address },\n amount: { _gt: 0 },\n };\n\n if (options?.tokenStandard) {\n whereCondition.token_standard = { _eq: options?.tokenStandard };\n }\n\n const graphqlQuery = {\n query: GetAccountOwnedTokens,\n variables: {\n where_condition: whereCondition,\n offset: options?.offset,\n limit: options?.limit,\n order_by: options?.orderBy,\n },\n };\n\n const data = await queryIndexer<GetAccountOwnedTokensQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getAccountOwnedTokens\",\n });\n\n return data.current_token_ownerships_v2;\n}\n\nexport async function getAccountOwnedTokensFromCollectionAddress(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n collectionAddress: AccountAddressInput;\n options?: TokenStandardArg & PaginationArgs & OrderByArg<GetAccountOwnedTokensFromCollectionResponse[0]>;\n}): Promise<GetAccountOwnedTokensFromCollectionResponse> {\n const { aptosConfig, accountAddress, collectionAddress, options } = args;\n const ownerAddress = AccountAddress.from(accountAddress).toStringLong();\n const collAddress = AccountAddress.from(collectionAddress).toStringLong();\n\n const whereCondition: {\n owner_address: { _eq: string };\n current_token_data: { collection_id: { _eq: string } };\n amount: { _gt: number };\n token_standard?: { _eq: string };\n } = {\n owner_address: { _eq: ownerAddress },\n current_token_data: { collection_id: { _eq: collAddress } },\n amount: { _gt: 0 },\n };\n\n if (options?.tokenStandard) {\n whereCondition.token_standard = { _eq: options?.tokenStandard };\n }\n\n const graphqlQuery = {\n query: GetAccountOwnedTokensFromCollection,\n variables: {\n where_condition: whereCondition,\n offset: options?.offset,\n limit: options?.limit,\n order_by: options?.orderBy,\n },\n };\n\n const data = await queryIndexer<GetAccountOwnedTokensFromCollectionQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getAccountOwnedTokensFromCollectionAddress\",\n });\n\n return data.current_token_ownerships_v2;\n}\n\nexport async function getAccountCollectionsWithOwnedTokens(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n options?: TokenStandardArg & PaginationArgs & OrderByArg<GetAccountCollectionsWithOwnedTokenResponse[0]>;\n}): Promise<GetAccountCollectionsWithOwnedTokenResponse> {\n const { aptosConfig, accountAddress, options } = args;\n const address = AccountAddress.from(accountAddress).toStringLong();\n\n const whereCondition: {\n owner_address: { _eq: string };\n amount: { _gt: number };\n current_collection?: { token_standard: { _eq: string } };\n } = {\n owner_address: { _eq: address },\n amount: { _gt: 0 },\n };\n\n if (options?.tokenStandard) {\n whereCondition.current_collection = {\n token_standard: { _eq: options?.tokenStandard },\n };\n }\n\n const graphqlQuery = {\n query: GetAccountCollectionsWithOwnedTokens,\n variables: {\n where_condition: whereCondition,\n offset: options?.offset,\n limit: options?.limit,\n order_by: options?.orderBy,\n },\n };\n\n const data = await queryIndexer<GetAccountCollectionsWithOwnedTokensQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getAccountCollectionsWithOwnedTokens\",\n });\n\n return data.current_collection_ownership_v2_view;\n}\n\nexport async function getAccountTransactionsCount(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n}): Promise<number> {\n const { aptosConfig, accountAddress } = args;\n\n const address = AccountAddress.from(accountAddress).toStringLong();\n\n const graphqlQuery = {\n query: GetAccountTransactionsCount,\n variables: { address },\n };\n\n const data = await queryIndexer<GetAccountTransactionsCountQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getAccountTransactionsCount\",\n });\n\n // commonjs (aka cjs) doesnt handle Nullish Coalescing for some reason\n // might be because of how ts infer the graphql generated scheme type\n return data.account_transactions_aggregate.aggregate ? data.account_transactions_aggregate.aggregate.count : 0;\n}\n\nexport async function getAccountCoinAmount(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n coinType: MoveStructId;\n}): Promise<number> {\n const { aptosConfig, accountAddress, coinType } = args;\n const address = AccountAddress.from(accountAddress).toStringLong();\n\n const data = await getAccountCoinsData({\n aptosConfig,\n accountAddress: address,\n options: {\n where: { asset_type: { _eq: coinType } },\n },\n });\n\n // commonjs (aka cjs) doesnt handle Nullish Coalescing for some reason\n // might be because of how ts infer the graphql generated scheme type\n return data[0] ? data[0].amount : 0;\n}\n\nexport async function getAccountCoinsData(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n options?: PaginationArgs & OrderByArg<GetAccountCoinsDataResponse[0]> & WhereArg<CurrentFungibleAssetBalancesBoolExp>;\n}): Promise<GetAccountCoinsDataResponse> {\n const { aptosConfig, accountAddress, options } = args;\n const address = AccountAddress.from(accountAddress).toStringLong();\n\n const whereCondition: { owner_address: { _eq: string } } = {\n ...options?.where,\n owner_address: { _eq: address },\n };\n\n const graphqlQuery = {\n query: GetAccountCoinsData,\n variables: {\n where_condition: whereCondition,\n offset: options?.offset,\n limit: options?.limit,\n order_by: options?.orderBy,\n },\n };\n\n const data = await queryIndexer<GetAccountCoinsDataQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getAccountCoinsData\",\n });\n\n return data.current_fungible_asset_balances;\n}\n\nexport async function getAccountCoinsCount(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n}): Promise<number> {\n const { aptosConfig, accountAddress } = args;\n const address = AccountAddress.from(accountAddress).toStringLong();\n\n const graphqlQuery = {\n query: GetAccountCoinsCount,\n variables: { address },\n };\n\n const data = await queryIndexer<GetAccountCoinsCountQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getAccountCoinsCount\",\n });\n\n if (!data.current_fungible_asset_balances_aggregate.aggregate) {\n throw Error(\"Failed to get the count of account coins\");\n }\n\n return data.current_fungible_asset_balances_aggregate.aggregate.count;\n}\n\nexport async function getAccountOwnedObjects(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n options?: PaginationArgs & OrderByArg<GetAccountOwnedObjectsResponse[0]>;\n}): Promise<GetAccountOwnedObjectsResponse> {\n const { aptosConfig, accountAddress, options } = args;\n const address = AccountAddress.from(accountAddress).toStringLong();\n\n const whereCondition: { owner_address: { _eq: string } } = {\n owner_address: { _eq: address },\n };\n const graphqlQuery = {\n query: GetAccountOwnedObjects,\n variables: {\n where_condition: whereCondition,\n offset: options?.offset,\n limit: options?.limit,\n order_by: options?.orderBy,\n },\n };\n const data = await queryIndexer<GetAccountOwnedObjectsQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getAccountOwnedObjects\",\n });\n\n return data.current_objects;\n}\n\n/**\n * NOTE: There is a potential issue once unified single signer scheme will be adopted\n * by the community.\n *\n * Becuase on could create 2 accounts with the same private key with this new authenticator type,\n * we’ll need to determine the order in which we lookup the accounts. First unified\n * scheme and then legacy scheme vs first legacy scheme and then unified scheme.\n *\n */\nexport async function deriveAccountFromPrivateKey(args: {\n aptosConfig: AptosConfig;\n privateKey: PrivateKey;\n}): Promise<Account> {\n const { aptosConfig, privateKey } = args;\n const publicKey = new AnyPublicKey(privateKey.publicKey());\n\n if (privateKey instanceof Secp256k1PrivateKey) {\n // private key is secp256k1, therefore we know it for sure uses a single signer key\n const authKey = AuthenticationKey.fromPublicKey({ publicKey });\n const address = authKey.derivedAddress();\n return Account.fromPrivateKey({ privateKey, address });\n }\n\n if (privateKey instanceof Ed25519PrivateKey) {\n // lookup single sender ed25519\n const singleSenderTransactionAuthenticatorAuthKey = AuthenticationKey.fromPublicKey({\n publicKey,\n });\n const isSingleSenderTransactionAuthenticator = await isAccountExist({\n authKey: singleSenderTransactionAuthenticatorAuthKey,\n aptosConfig,\n });\n if (isSingleSenderTransactionAuthenticator) {\n const address = singleSenderTransactionAuthenticatorAuthKey.derivedAddress();\n return Account.fromPrivateKey({ privateKey, address, legacy: false });\n }\n // lookup legacy ed25519\n const legacyAuthKey = AuthenticationKey.fromPublicKey({\n publicKey: publicKey.publicKey as Ed25519PublicKey,\n });\n const isLegacyEd25519 = await isAccountExist({ authKey: legacyAuthKey, aptosConfig });\n if (isLegacyEd25519) {\n const address = legacyAuthKey.derivedAddress();\n return Account.fromPrivateKey({ privateKey, address, legacy: true });\n }\n }\n // if we are here, it means we couldn't find an address with an\n // auth key that matches the provided private key\n throw new Error(`Can't derive account from private key ${privateKey}`);\n}\n\nexport async function isAccountExist(args: { aptosConfig: AptosConfig; authKey: AuthenticationKey }): Promise<boolean> {\n const { aptosConfig, authKey } = args;\n const accountAddress = await lookupOriginalAccountAddress({\n aptosConfig,\n authenticationKey: authKey.derivedAddress(),\n });\n\n try {\n await getInfo({\n aptosConfig,\n accountAddress,\n });\n return true;\n } catch (error: any) {\n // account not found\n if (error.status === 404) {\n return false;\n }\n throw new Error(`Error while looking for an account info ${accountAddress.toString()}`);\n }\n}\n"],"mappings":"kgBAyDA,eAA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AAkF,CACrH,GAAM,CAAE,YAAAC,EAAa,QAAA6D,CAAQ,EAAI9D,EAC3BE,EAAiB,MAAMe,EAA6B,CACxD,YAAAhB,EACA,kBAAmB6D,EAAQ,eAAe,CAC5C,CAAC,EAED,GAAI,CACF,aAAM/D,EAAQ,CACZ,YAAAE,EACA,eAAAC,CACF,CAAC,EACM,EACT,OAAS6D,EAAY,CAEnB,GAAIA,EAAM,SAAW,IACnB,MAAO,GAET,MAAM,IAAI,MAAM,2CAA2C7D,EAAe,SAAS,CAAC,EAAE,CACxF,CACF","names":["getInfo","args","aptosConfig","accountAddress","data","getAptosFullNode","AccountAddress","getModules","options","paginateWithCursor","getModule","getModuleInner","memoizeAsync","moduleName","getTransactions","getResources","getResource","resourceType","lookupOriginalAccountAddress","authenticationKey","resource","handle","authKeyAddress","originalAddress","getTableItem","err","AptosApiError","getAccountTokensCount","whereCondition","queryIndexer","GetAccountTokensCount","getAccountOwnedTokens","graphqlQuery","GetAccountOwnedTokens","getAccountOwnedTokensFromCollectionAddress","collectionAddress","ownerAddress","collAddress","GetAccountOwnedTokensFromCollection","getAccountCollectionsWithOwnedTokens","GetAccountCollectionsWithOwnedTokens","getAccountTransactionsCount","address","GetAccountTransactionsCount","getAccountCoinAmount","coinType","getAccountCoinsData","GetAccountCoinsData","getAccountCoinsCount","GetAccountCoinsCount","getAccountOwnedObjects","GetAccountOwnedObjects","deriveAccountFromPrivateKey","privateKey","publicKey","AnyPublicKey","Secp256k1PrivateKey","AuthenticationKey","Account","Ed25519PrivateKey","singleSenderTransactionAuthenticatorAuthKey","isAccountExist","legacyAuthKey","authKey","error"]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var n=(r=>(r[r.JWK_EXPIRED=0]="JWK_EXPIRED",r[r.EPK_EXPIRED=1]="EPK_EXPIRED",r[r.UNKNOWN_INVALID_SIGNATURE=2]="UNKNOWN_INVALID_SIGNATURE",r[r.UNKNOWN=3]="UNKNOWN",r))(n||{}),i=class t extends Error{constructor(e){super();this.type=e}static async fromAptosApiError(e,s){return e.data.message.includes("INVALID_SIGNATURE")?s.isExpired()?new t(1):await s.checkJwkValidity()?new t(2):new t(0):new t(3)}};export{n as a,i as b};
|
|
2
|
-
//# sourceMappingURL=chunk-3COVJN6Z.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types/keyless.ts"],"sourcesContent":["import { KeylessAccount } from \"../account\";\nimport { AptosApiError } from \"../client/types\";\n\nexport type ProverResponse = {\n proof: { a: string; b: string; c: string };\n public_inputs_hash: string;\n training_wheels_signature: string;\n};\nexport type PepperFetchResponse = { signature: string; pepper: string; address: string };\n\nexport enum KeylessErrorType {\n JWK_EXPIRED,\n EPK_EXPIRED,\n UNKNOWN_INVALID_SIGNATURE,\n UNKNOWN,\n}\nexport class KeylessError extends Error {\n readonly type: KeylessErrorType;\n\n private constructor(type: KeylessErrorType) {\n super();\n this.type = type;\n }\n\n static async fromAptosApiError(error: AptosApiError, signer: KeylessAccount): Promise<KeylessError> {\n if (!error.data.message.includes(\"INVALID_SIGNATURE\")) {\n return new KeylessError(KeylessErrorType.UNKNOWN);\n }\n if (signer.isExpired()) {\n return new KeylessError(KeylessErrorType.EPK_EXPIRED);\n }\n if (!(await signer.checkJwkValidity())) {\n return new KeylessError(KeylessErrorType.JWK_EXPIRED);\n }\n return new KeylessError(KeylessErrorType.UNKNOWN_INVALID_SIGNATURE);\n }\n}\n"],"mappings":"AAUO,IAAKA,OACVA,IAAA,6BACAA,IAAA,6BACAA,IAAA,yDACAA,IAAA,qBAJUA,OAAA,IAMCC,EAAN,MAAMC,UAAqB,KAAM,CAG9B,YAAYC,EAAwB,CAC1C,MAAM,EACN,KAAK,KAAOA,CACd,CAEA,aAAa,kBAAkBC,EAAsBC,EAA+C,CAClG,OAAKD,EAAM,KAAK,QAAQ,SAAS,mBAAmB,EAGhDC,EAAO,UAAU,EACZ,IAAIH,EAAa,CAA4B,EAEhD,MAAMG,EAAO,iBAAiB,EAG7B,IAAIH,EAAa,CAA0C,EAFzD,IAAIA,EAAa,CAA4B,EAN7C,IAAIA,EAAa,CAAwB,CASpD,CACF","names":["KeylessErrorType","KeylessError","_KeylessError","type","error","signer"]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as r}from"./chunk-TVRJ3M7B.mjs";import{b as i}from"./chunk-AOCNYMMX.mjs";var t=class a extends r{constructor(e){super();this.value=i.fromHexInput(e).toUint8Array()}serialize(e){e.serializeFixedBytes(this.value)}serializeForEntryFunction(e){e.serialize(this)}serializeForScriptFunction(e){e.serialize(this)}static deserialize(e,s){let o=e.deserializeFixedBytes(s);return new a(o)}};export{t as a};
|
|
2
|
-
//# sourceMappingURL=chunk-3FVRXELT.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as n}from"./chunk-HYDDIAJ6.mjs";import{a as g,b as _}from"./chunk-HHVAU5HU.mjs";import{a as p,c as b}from"./chunk-SI7MPP6G.mjs";import{b as o}from"./chunk-T23OVRNF.mjs";import{a as h}from"./chunk-TVRJ3M7B.mjs";var c=class extends h{static deserialize(t){let e=t.deserializeUleb128AsU32();switch(e){case 0:return d.load(t);case 1:return u.load(t);case 2:return l.load(t);case 3:return A.load(t);case 4:return y.load(t);default:throw new Error(`Unknown variant index for TransactionAuthenticator: ${e}`)}}},d=class i extends c{constructor(e,r){super();this.public_key=e,this.signature=r}serialize(e){e.serializeU32AsUleb128(0),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let r=p.deserialize(e),s=b.deserialize(e);return new i(r,s)}},u=class i extends c{constructor(e,r){super();this.public_key=e,this.signature=r}serialize(e){e.serializeU32AsUleb128(1),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let r=g.deserialize(e),s=_.deserialize(e);return new i(r,s)}},l=class i extends c{constructor(e,r,s){super();this.sender=e,this.secondary_signer_addresses=r,this.secondary_signers=s}serialize(e){e.serializeU32AsUleb128(2),this.sender.serialize(e),e.serializeVector(this.secondary_signer_addresses),e.serializeVector(this.secondary_signers)}static load(e){let r=n.deserialize(e),s=e.deserializeVector(o),a=e.deserializeVector(n);return new i(r,s,a)}},A=class i extends c{constructor(e,r,s,a){super();this.sender=e,this.secondary_signer_addresses=r,this.secondary_signers=s,this.fee_payer=a}serialize(e){e.serializeU32AsUleb128(3),this.sender.serialize(e),e.serializeVector(this.secondary_signer_addresses),e.serializeVector(this.secondary_signers),this.fee_payer.address.serialize(e),this.fee_payer.authenticator.serialize(e)}static load(e){let r=n.deserialize(e),s=e.deserializeVector(o),a=e.deserializeVector(n),z=o.deserialize(e),S=n.deserialize(e),E={address:z,authenticator:S};return new i(r,s,a,E)}},y=class i extends c{constructor(e){super();this.sender=e}serialize(e){e.serializeU32AsUleb128(4),this.sender.serialize(e)}static load(e){let r=n.deserialize(e);return new i(r)}};export{c as a,d as b,u as c,l as d,A as e,y as f};
|
|
2
|
-
//# sourceMappingURL=chunk-3S3GIUQY.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as i}from"./chunk-2ECWQRBB.mjs";import{a as e}from"./chunk-3S3GIUQY.mjs";import{a as r}from"./chunk-TVRJ3M7B.mjs";var n=class o extends r{constructor(t,a){super();this.raw_txn=t,this.authenticator=a}serialize(t){this.raw_txn.serialize(t),this.authenticator.serialize(t)}static deserialize(t){let a=i.deserialize(t),s=e.deserialize(t);return new o(a,s)}};export{n as a};
|
|
2
|
-
//# sourceMappingURL=chunk-5XOFEQWC.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as s,c as d,e as t}from"./chunk-TVRJ3M7B.mjs";import{a as l,b as n,c as o,d as c,e as z,f as u}from"./chunk-56CNRT2K.mjs";var U=class i extends s{constructor(e){super();d(e),this.value=e}serialize(e){e.serializeBool(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(5),e.serialize(this)}static deserialize(e){return new i(e.deserializeBool())}},p=class i extends s{constructor(e){super();t(e,0,l),this.value=e}serialize(e){e.serializeU8(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(0),e.serialize(this)}static deserialize(e){return new i(e.deserializeU8())}},b=class i extends s{constructor(e){super();t(e,0,n),this.value=e}serialize(e){e.serializeU16(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(6),e.serialize(this)}static deserialize(e){return new i(e.deserializeU16())}},y=class i extends s{constructor(e){super();t(e,0,o),this.value=e}serialize(e){e.serializeU32(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(7),e.serialize(this)}static deserialize(e){return new i(e.deserializeU32())}},m=class i extends s{constructor(e){super();t(e,BigInt(0),c),this.value=BigInt(e)}serialize(e){e.serializeU64(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(1),e.serialize(this)}static deserialize(e){return new i(e.deserializeU64())}},B=class i extends s{constructor(e){super();t(e,BigInt(0),z),this.value=BigInt(e)}serialize(e){e.serializeU128(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(2),e.serialize(this)}static deserialize(e){return new i(e.deserializeU128())}},v=class i extends s{constructor(e){super();t(e,BigInt(0),u),this.value=BigInt(e)}serialize(e){e.serializeU256(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(8),e.serialize(this)}static deserialize(e){return new i(e.deserializeU256())}};export{U as a,p as b,b as c,y as d,m as e,B as f,v as g};
|
|
2
|
-
//# sourceMappingURL=chunk-6RBUXB5I.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as a}from"./chunk-VSD2AWUR.mjs";import{a as y,l as d,m as u,n as h}from"./chunk-PGCBIU33.mjs";import{b as g}from"./chunk-25H3DXTL.mjs";import{e as m,f as x}from"./chunk-YNNPWCF6.mjs";import{b as n}from"./chunk-AOCNYMMX.mjs";import{jwtDecode as w}from"jwt-decode";async function _(o){let{aptosConfig:r,jwt:e,ephemeralKeyPair:t,uidKey:p,derivationPath:s}=o,i={jwt_b64:e,epk:t.getPublicKey().bcsToHex().toStringWithoutPrefix(),exp_date_secs:Number(t.expiryDateSecs),epk_blinder:n.fromHexInput(t.blinder).toStringWithoutPrefix(),uid_key:p,derivation_path:s},{data:c}=await m({aptosConfig:r,path:"fetch",body:i,originMethod:"getPepper",overrides:{WITH_CREDENTIALS:!1}});return n.fromHexInput(c.pepper).toUint8Array()}async function E(o){let{aptosConfig:r,jwt:e,ephemeralKeyPair:t,pepper:p,uidKey:s,extraFieldKey:i}=o,c={jwt_b64:e,epk:t.getPublicKey().bcsToHex().toStringWithoutPrefix(),epk_blinder:n.fromHexInput(t.blinder).toStringWithoutPrefix(),exp_date_secs:Number(t.expiryDateSecs),exp_horizon_secs:y,pepper:n.fromHexInput(p).toStringWithoutPrefix(),extra_field:i,uid_key:s||"sub"},{data:l}=await x({aptosConfig:r,path:"prove",body:c,originMethod:"getProof",overrides:{WITH_CREDENTIALS:!1}}),f=l.proof,K=new d({a:f.a,b:f.b,c:f.c}),P;if(i){let b=w(e)[i];P=`"${i}":"${b}",`}return new h({proof:new u(K,0),extraField:P,trainingWheelsSignature:g.fromHex(l.training_wheels_signature)})}async function W(o){let{proofFetchCallback:r}=o,{pepper:e}=o;if(e===void 0)e=await _(o);else if(n.fromHexInput(e).toUint8Array().length!==a.PEPPER_LENGTH)throw new Error(`Pepper needs to be ${a.PEPPER_LENGTH} bytes`);let t=E({...o,pepper:e}),p=r?t:await t;return a.fromJWTAndProof({...o,proof:p,pepper:e,proofFetchCallback:r})}export{_ as a,E as b,W as c};
|
|
2
|
-
//# sourceMappingURL=chunk-75J7H3XD.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/internal/keyless.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * This file contains the underlying implementations for exposed API surface in\n * the {@link api/keyless}. By moving the methods out into a separate file,\n * other namespaces and processes can access these methods without depending on the entire\n * faucet namespace and without having a dependency cycle error.\n */\nimport { jwtDecode } from \"jwt-decode\";\nimport { AptosConfig } from \"../api/aptosConfig\";\nimport { postAptosPepperService, postAptosProvingService } from \"../client\";\nimport { EPK_HORIZON_SECS, EphemeralSignature, Groth16Zkp, Hex, ZeroKnowledgeSig, ZkProof } from \"../core\";\nimport { HexInput, ZkpVariant } from \"../types\";\nimport { EphemeralKeyPair, KeylessAccount, ProofFetchCallback } from \"../account\";\nimport { PepperFetchResponse, ProverResponse } from \"../types/keyless\";\n\nexport async function getPepper(args: {\n aptosConfig: AptosConfig;\n jwt: string;\n ephemeralKeyPair: EphemeralKeyPair;\n uidKey?: string;\n derivationPath?: string;\n verify?: boolean;\n}): Promise<Uint8Array> {\n const { aptosConfig, jwt, ephemeralKeyPair, uidKey, derivationPath } = args;\n\n const body = {\n jwt_b64: jwt,\n epk: ephemeralKeyPair.getPublicKey().bcsToHex().toStringWithoutPrefix(),\n exp_date_secs: Number(ephemeralKeyPair.expiryDateSecs),\n epk_blinder: Hex.fromHexInput(ephemeralKeyPair.blinder).toStringWithoutPrefix(),\n uid_key: uidKey,\n derivation_path: derivationPath,\n };\n const { data } = await postAptosPepperService<any, PepperFetchResponse>({\n aptosConfig,\n path: \"fetch\",\n body,\n originMethod: \"getPepper\",\n overrides: { WITH_CREDENTIALS: false },\n });\n return Hex.fromHexInput(data.pepper).toUint8Array();\n}\n\nexport async function getProof(args: {\n aptosConfig: AptosConfig;\n jwt: string;\n ephemeralKeyPair: EphemeralKeyPair;\n pepper: HexInput;\n uidKey?: string;\n extraFieldKey?: string;\n}): Promise<ZeroKnowledgeSig> {\n const { aptosConfig, jwt, ephemeralKeyPair, pepper, uidKey, extraFieldKey } = args;\n const json = {\n jwt_b64: jwt,\n epk: ephemeralKeyPair.getPublicKey().bcsToHex().toStringWithoutPrefix(),\n epk_blinder: Hex.fromHexInput(ephemeralKeyPair.blinder).toStringWithoutPrefix(),\n exp_date_secs: Number(ephemeralKeyPair.expiryDateSecs),\n exp_horizon_secs: EPK_HORIZON_SECS,\n pepper: Hex.fromHexInput(pepper).toStringWithoutPrefix(),\n extra_field: extraFieldKey,\n uid_key: uidKey || \"sub\",\n };\n\n const { data } = await postAptosProvingService<any, ProverResponse>({\n aptosConfig,\n path: \"prove\",\n body: json,\n originMethod: \"getProof\",\n overrides: { WITH_CREDENTIALS: false },\n });\n\n const proofPoints = data.proof;\n const groth16Zkp = new Groth16Zkp({\n a: proofPoints.a,\n b: proofPoints.b,\n c: proofPoints.c,\n });\n\n let extraField;\n if (extraFieldKey) {\n const jwtPayload = jwtDecode<{ [key: string]: string }>(jwt);\n const extraFieldVal = jwtPayload[extraFieldKey];\n extraField = `\"${extraFieldKey}\":\"${extraFieldVal}\",`;\n }\n\n const signedProof = new ZeroKnowledgeSig({\n proof: new ZkProof(groth16Zkp, ZkpVariant.Groth16),\n extraField,\n trainingWheelsSignature: EphemeralSignature.fromHex(data.training_wheels_signature),\n });\n return signedProof;\n}\n\nexport async function deriveKeylessAccount(args: {\n aptosConfig: AptosConfig;\n jwt: string;\n ephemeralKeyPair: EphemeralKeyPair;\n uidKey?: string;\n pepper?: HexInput;\n extraFieldKey?: string;\n proofFetchCallback?: ProofFetchCallback;\n}): Promise<KeylessAccount> {\n const { proofFetchCallback } = args;\n let { pepper } = args;\n if (pepper === undefined) {\n pepper = await getPepper(args);\n } else if (Hex.fromHexInput(pepper).toUint8Array().length !== KeylessAccount.PEPPER_LENGTH) {\n throw new Error(`Pepper needs to be ${KeylessAccount.PEPPER_LENGTH} bytes`);\n }\n\n const proofPromise = getProof({ ...args, pepper });\n const proof = proofFetchCallback ? proofPromise : await proofPromise;\n\n const keylessAccount = KeylessAccount.fromJWTAndProof({ ...args, proof, pepper, proofFetchCallback });\n\n return keylessAccount;\n}\n"],"mappings":"yOASA,OAAS,aAAAA,MAAiB,aAQ1B,eAAsBC,EAAUC,EAOR,CACtB,GAAM,CAAE,YAAAC,EAAa,IAAAC,EAAK,iBAAAC,EAAkB,OAAAC,EAAQ,eAAAC,CAAe,EAAIL,EAEjEM,EAAO,CACX,QAASJ,EACT,IAAKC,EAAiB,aAAa,EAAE,SAAS,EAAE,sBAAsB,EACtE,cAAe,OAAOA,EAAiB,cAAc,EACrD,YAAaI,EAAI,aAAaJ,EAAiB,OAAO,EAAE,sBAAsB,EAC9E,QAASC,EACT,gBAAiBC,CACnB,EACM,CAAE,KAAAG,CAAK,EAAI,MAAMC,EAAiD,CACtE,YAAAR,EACA,KAAM,QACN,KAAAK,EACA,aAAc,YACd,UAAW,CAAE,iBAAkB,EAAM,CACvC,CAAC,EACD,OAAOC,EAAI,aAAaC,EAAK,MAAM,EAAE,aAAa,CACpD,CAEA,eAAsBE,EAASV,EAOD,CAC5B,GAAM,CAAE,YAAAC,EAAa,IAAAC,EAAK,iBAAAC,EAAkB,OAAAQ,EAAQ,OAAAP,EAAQ,cAAAQ,CAAc,EAAIZ,EACxEa,EAAO,CACX,QAASX,EACT,IAAKC,EAAiB,aAAa,EAAE,SAAS,EAAE,sBAAsB,EACtE,YAAaI,EAAI,aAAaJ,EAAiB,OAAO,EAAE,sBAAsB,EAC9E,cAAe,OAAOA,EAAiB,cAAc,EACrD,iBAAkBW,EAClB,OAAQP,EAAI,aAAaI,CAAM,EAAE,sBAAsB,EACvD,YAAaC,EACb,QAASR,GAAU,KACrB,EAEM,CAAE,KAAAI,CAAK,EAAI,MAAMO,EAA6C,CAClE,YAAAd,EACA,KAAM,QACN,KAAMY,EACN,aAAc,WACd,UAAW,CAAE,iBAAkB,EAAM,CACvC,CAAC,EAEKG,EAAcR,EAAK,MACnBS,EAAa,IAAIC,EAAW,CAChC,EAAGF,EAAY,EACf,EAAGA,EAAY,EACf,EAAGA,EAAY,CACjB,CAAC,EAEGG,EACJ,GAAIP,EAAe,CAEjB,IAAMQ,EADaC,EAAqCnB,CAAG,EAC1BU,CAAa,EAC9CO,EAAa,IAAIP,CAAa,MAAMQ,CAAa,IACnD,CAOA,OALoB,IAAIE,EAAiB,CACvC,MAAO,IAAIC,EAAQN,GAA8B,EACjD,WAAAE,EACA,wBAAyBK,EAAmB,QAAQhB,EAAK,yBAAyB,CACpF,CAAC,CAEH,CAEA,eAAsBiB,EAAqBzB,EAQf,CAC1B,GAAM,CAAE,mBAAA0B,CAAmB,EAAI1B,EAC3B,CAAE,OAAAW,CAAO,EAAIX,EACjB,GAAIW,IAAW,OACbA,EAAS,MAAMZ,EAAUC,CAAI,UACpBO,EAAI,aAAaI,CAAM,EAAE,aAAa,EAAE,SAAWgB,EAAe,cAC3E,MAAM,IAAI,MAAM,sBAAsBA,EAAe,aAAa,QAAQ,EAG5E,IAAMC,EAAelB,EAAS,CAAE,GAAGV,EAAM,OAAAW,CAAO,CAAC,EAC3CkB,EAAQH,EAAqBE,EAAe,MAAMA,EAIxD,OAFuBD,EAAe,gBAAgB,CAAE,GAAG3B,EAAM,MAAA6B,EAAO,OAAAlB,EAAQ,mBAAAe,CAAmB,CAAC,CAGtG","names":["jwtDecode","getPepper","args","aptosConfig","jwt","ephemeralKeyPair","uidKey","derivationPath","body","Hex","data","postAptosPepperService","getProof","pepper","extraFieldKey","json","EPK_HORIZON_SECS","postAptosProvingService","proofPoints","groth16Zkp","Groth16Zkp","extraField","extraFieldVal","jwtDecode","ZeroKnowledgeSig","ZkProof","EphemeralSignature","deriveKeylessAccount","proofFetchCallback","KeylessAccount","proofPromise","proof"]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as r,c as o}from"./chunk-75J7H3XD.mjs";var t=class{constructor(e){this.config=e}async getPepper(e){return r({aptosConfig:this.config,...e})}async deriveKeylessAccount(e){return o({aptosConfig:this.config,...e})}};export{t as a};
|
|
2
|
-
//# sourceMappingURL=chunk-7KOC7VNK.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/api/keyless.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { EphemeralKeyPair, KeylessAccount, ProofFetchCallback } from \"../account\";\nimport { deriveKeylessAccount, getPepper } from \"../internal/keyless\";\nimport { HexInput } from \"../types\";\nimport { AptosConfig } from \"./aptosConfig\";\n\n/**\n * A class to query all `Keyless` related queries on Aptos.\n */\nexport class Keyless {\n constructor(readonly config: AptosConfig) {}\n\n /**\n * Fetches the pepper from the Aptos pepper service API.\n *\n * @param args.jwt JWT token\n * @param args.ephemeralKeyPair the EphemeralKeyPair used to generate the nonce in the JWT token\n * @returns The pepper which is a Uint8Array of length 31.\n */\n async getPepper(args: { jwt: string; ephemeralKeyPair: EphemeralKeyPair }): Promise<Uint8Array> {\n return getPepper({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Fetches the pepper from the Aptos pepper service API.\n *\n * @param args.jwt JWT token\n * @param args.ephemeralKeyPair the EphemeralKeyPair used to generate the nonce in the JWT token\n * @param args.uidKey a key in the JWT token to use to set the uidVal in the IdCommitment\n * @param args.pepper the pepper\n * @param args.extraFieldKey a key in the JWT token used to reveal a value on chain\n * @param args.proofFetchCallback a callback function that if set, the fetch of the proof will be done asyncronously. Once\n * if finishes the callback function will be called.\n * @returns A KeylessAccount that can be used to sign transactions\n */\n async deriveKeylessAccount(args: {\n jwt: string;\n ephemeralKeyPair: EphemeralKeyPair;\n uidKey?: string;\n pepper?: HexInput;\n extraFieldKey?: string;\n proofFetchCallback?: ProofFetchCallback;\n }): Promise<KeylessAccount> {\n return deriveKeylessAccount({ aptosConfig: this.config, ...args });\n }\n}\n"],"mappings":"gDAWO,IAAMA,EAAN,KAAc,CACnB,YAAqBC,EAAqB,CAArB,YAAAA,CAAsB,CAS3C,MAAM,UAAUC,EAAgF,CAC9F,OAAOC,EAAU,CAAE,YAAa,KAAK,OAAQ,GAAGD,CAAK,CAAC,CACxD,CAcA,MAAM,qBAAqBA,EAOC,CAC1B,OAAOE,EAAqB,CAAE,YAAa,KAAK,OAAQ,GAAGF,CAAK,CAAC,CACnE,CACF","names":["Keyless","config","args","getPepper","deriveKeylessAccount"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=chunk-7Z6DYLCA.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as c}from"./chunk-HSFG2AIK.mjs";import{a as f}from"./chunk-7SIQDOYY.mjs";import{a as g}from"./chunk-7IMWGGA6.mjs";import{a as l}from"./chunk-VL6EYA53.mjs";import{a as h}from"./chunk-7KOC7VNK.mjs";import{a as y}from"./chunk-PMPTAPM3.mjs";import{a as u}from"./chunk-KMKSA7LM.mjs";import{a as s}from"./chunk-24ZOKI52.mjs";import{a as p}from"./chunk-BTLFW3YY.mjs";import{a as A}from"./chunk-CO53EOHE.mjs";import{a as r}from"./chunk-O3PLAAN7.mjs";import{a}from"./chunk-R52BRP36.mjs";var t=class{constructor(e){this.config=new A(e),this.account=new s(this.config),this.ans=new p(this.config),this.coin=new r(this.config),this.digitalAsset=new a(this.config),this.event=new c(this.config),this.faucet=new f(this.config),this.fungibleAsset=new g(this.config),this.general=new l(this.config),this.staking=new y(this.config),this.transaction=new u(this.config),this.keyless=new h(this.config)}};function n(m,e,d){Object.getOwnPropertyNames(e.prototype).forEach(i=>{let o=Object.getOwnPropertyDescriptor(e.prototype,i);o&&(o.value=function(...w){return this[d][i](...w)},Object.defineProperty(m.prototype,i,o))})}n(t,s,"account");n(t,p,"ans");n(t,r,"coin");n(t,a,"digitalAsset");n(t,c,"event");n(t,f,"faucet");n(t,g,"fungibleAsset");n(t,l,"general");n(t,y,"staking");n(t,u,"transaction");n(t,h,"keyless");export{t as a};
|
|
2
|
-
//# sourceMappingURL=chunk-AJ7UC2G3.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/api/aptos.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Account } from \"./account\";\nimport { AptosConfig } from \"./aptosConfig\";\nimport { Coin } from \"./coin\";\nimport { DigitalAsset } from \"./digitalAsset\";\nimport { Event } from \"./event\";\nimport { Faucet } from \"./faucet\";\nimport { FungibleAsset } from \"./fungibleAsset\";\nimport { General } from \"./general\";\nimport { ANS } from \"./ans\";\nimport { Staking } from \"./staking\";\nimport { Transaction } from \"./transaction\";\nimport { Keyless } from \"./keyless\";\n\n/**\n * This class is the main entry point into Aptos's\n * APIs and separates functionality into different namespaces.\n *\n * To use the SDK, create a new Aptos instance to get access\n * to all the sdk functionality.\n *\n * @example\n *\n * const aptos = new Aptos();\n */\nexport class Aptos {\n readonly config: AptosConfig;\n\n readonly account: Account;\n\n readonly ans: ANS;\n\n readonly coin: Coin;\n\n readonly digitalAsset: DigitalAsset;\n\n readonly event: Event;\n\n readonly faucet: Faucet;\n\n readonly fungibleAsset: FungibleAsset;\n\n readonly general: General;\n\n readonly staking: Staking;\n\n readonly transaction: Transaction;\n\n readonly keyless: Keyless;\n\n constructor(settings?: AptosConfig) {\n this.config = new AptosConfig(settings);\n this.account = new Account(this.config);\n this.ans = new ANS(this.config);\n this.coin = new Coin(this.config);\n this.digitalAsset = new DigitalAsset(this.config);\n this.event = new Event(this.config);\n this.faucet = new Faucet(this.config);\n this.fungibleAsset = new FungibleAsset(this.config);\n this.general = new General(this.config);\n this.staking = new Staking(this.config);\n this.transaction = new Transaction(this.config);\n this.keyless = new Keyless(this.config);\n }\n}\n\n// extends Aptos interface so all the methods and properties\n// from the other classes will be recognized by typescript.\nexport interface Aptos\n extends Account,\n ANS,\n Coin,\n DigitalAsset,\n Event,\n Faucet,\n FungibleAsset,\n General,\n Keyless,\n Staking,\n Omit<Transaction, \"build\" | \"simulate\" | \"submit\" | \"batch\"> {}\n\n/**\nIn TypeScript, we can’t inherit or extend from more than one class,\nMixins helps us to get around that by creating a partial classes\nthat we can combine to form a single class that contains all the methods and properties from the partial classes.\n{@link https://www.typescriptlang.org/docs/handbook/mixins.html#alternative-pattern}\n\nHere, we combine any subclass and the Aptos class.\n*/\nfunction applyMixin(targetClass: any, baseClass: any, baseClassProp: string) {\n // Mixin instance methods\n Object.getOwnPropertyNames(baseClass.prototype).forEach((propertyName) => {\n const propertyDescriptor = Object.getOwnPropertyDescriptor(baseClass.prototype, propertyName);\n if (!propertyDescriptor) return;\n // eslint-disable-next-line func-names\n propertyDescriptor.value = function (...args: any) {\n return (this as any)[baseClassProp][propertyName](...args);\n };\n Object.defineProperty(targetClass.prototype, propertyName, propertyDescriptor);\n });\n}\n\napplyMixin(Aptos, Account, \"account\");\napplyMixin(Aptos, ANS, \"ans\");\napplyMixin(Aptos, Coin, \"coin\");\napplyMixin(Aptos, DigitalAsset, \"digitalAsset\");\napplyMixin(Aptos, Event, \"event\");\napplyMixin(Aptos, Faucet, \"faucet\");\napplyMixin(Aptos, FungibleAsset, \"fungibleAsset\");\napplyMixin(Aptos, General, \"general\");\napplyMixin(Aptos, Staking, \"staking\");\napplyMixin(Aptos, Transaction, \"transaction\");\napplyMixin(Aptos, Keyless, \"keyless\");\n"],"mappings":"ueA2BO,IAAMA,EAAN,KAAY,CAyBjB,YAAYC,EAAwB,CAClC,KAAK,OAAS,IAAIC,EAAYD,CAAQ,EACtC,KAAK,QAAU,IAAIE,EAAQ,KAAK,MAAM,EACtC,KAAK,IAAM,IAAIC,EAAI,KAAK,MAAM,EAC9B,KAAK,KAAO,IAAIC,EAAK,KAAK,MAAM,EAChC,KAAK,aAAe,IAAIC,EAAa,KAAK,MAAM,EAChD,KAAK,MAAQ,IAAIC,EAAM,KAAK,MAAM,EAClC,KAAK,OAAS,IAAIC,EAAO,KAAK,MAAM,EACpC,KAAK,cAAgB,IAAIC,EAAc,KAAK,MAAM,EAClD,KAAK,QAAU,IAAIC,EAAQ,KAAK,MAAM,EACtC,KAAK,QAAU,IAAIC,EAAQ,KAAK,MAAM,EACtC,KAAK,YAAc,IAAIC,EAAY,KAAK,MAAM,EAC9C,KAAK,QAAU,IAAIC,EAAQ,KAAK,MAAM,CACxC,CACF,EAyBA,SAASC,EAAWC,EAAkBC,EAAgBC,EAAuB,CAE3E,OAAO,oBAAoBD,EAAU,SAAS,EAAE,QAASE,GAAiB,CACxE,IAAMC,EAAqB,OAAO,yBAAyBH,EAAU,UAAWE,CAAY,EACvFC,IAELA,EAAmB,MAAQ,YAAaC,EAAW,CACjD,OAAQ,KAAaH,CAAa,EAAEC,CAAY,EAAE,GAAGE,CAAI,CAC3D,EACA,OAAO,eAAeL,EAAY,UAAWG,EAAcC,CAAkB,EAC/E,CAAC,CACH,CAEAL,EAAWd,EAAOG,EAAS,SAAS,EACpCW,EAAWd,EAAOI,EAAK,KAAK,EAC5BU,EAAWd,EAAOK,EAAM,MAAM,EAC9BS,EAAWd,EAAOM,EAAc,cAAc,EAC9CQ,EAAWd,EAAOO,EAAO,OAAO,EAChCO,EAAWd,EAAOQ,EAAQ,QAAQ,EAClCM,EAAWd,EAAOS,EAAe,eAAe,EAChDK,EAAWd,EAAOU,EAAS,SAAS,EACpCI,EAAWd,EAAOW,EAAS,SAAS,EACpCG,EAAWd,EAAOY,EAAa,aAAa,EAC5CE,EAAWd,EAAOa,EAAS,SAAS","names":["Aptos","settings","AptosConfig","Account","ANS","Coin","DigitalAsset","Event","Faucet","FungibleAsset","General","Staking","Transaction","Keyless","applyMixin","targetClass","baseClass","baseClassProp","propertyName","propertyDescriptor","args"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=chunk-AQ4I7VVB.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as i}from"./chunk-3FVRXELT.mjs";import{a as r}from"./chunk-TVRJ3M7B.mjs";var t=class l extends r{constructor(e){super();this.value=new i(e)}serialize(e){e.serialize(this.value)}serializeForEntryFunction(e){e.serializeU32AsUleb128(this.value.value.length),e.serialize(this)}static deserialize(e,s){let a=i.deserialize(e,s);return new l(a.value)}};export{t as a};
|
|
2
|
-
//# sourceMappingURL=chunk-C3L4ETUF.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as t,b as n,c as i,d as r,e as o}from"./chunk-JM544NRW.mjs";import f from"@aptos-labs/aptos-client";var l=class{constructor(e){this.network=e?.network??"devnet",this.fullnode=e?.fullnode,this.faucet=e?.faucet,this.pepper=e?.pepper,this.prover=e?.prover,this.indexer=e?.indexer,this.client=e?.client??{provider:f},this.clientConfig=e?.clientConfig??{},this.fullnodeConfig=e?.fullnodeConfig??{},this.indexerConfig=e?.indexerConfig??{},this.faucetConfig=e?.faucetConfig??{}}getRequestUrl(e){switch(e){case"Fullnode":if(this.fullnode!==void 0)return this.fullnode;if(this.network==="custom")throw new Error("Please provide a custom full node url");return n[this.network];case"Faucet":if(this.faucet!==void 0)return this.faucet;if(this.network==="custom")throw new Error("Please provide a custom faucet url");return i[this.network];case"Indexer":if(this.indexer!==void 0)return this.indexer;if(this.network==="custom")throw new Error("Please provide a custom indexer url");return t[this.network];case"Pepper":if(this.pepper!==void 0)return this.pepper;if(this.network==="custom")throw new Error("Please provide a custom pepper service url");return r[this.network];case"Prover":if(this.prover!==void 0)return this.prover;if(this.network==="custom")throw new Error("Please provide a custom prover service url");return o[this.network];default:throw Error(`apiType ${e} is not supported`)}}isPepperServiceRequest(e){return r[this.network]===e}isProverServiceRequest(e){return o[this.network]===e}};export{l as a};
|
|
2
|
-
//# sourceMappingURL=chunk-CO53EOHE.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/api/aptosConfig.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport aptosClient from \"@aptos-labs/aptos-client\";\nimport { AptosSettings, ClientConfig, Client, FullNodeConfig, IndexerConfig, FaucetConfig } from \"../types\";\nimport {\n NetworkToNodeAPI,\n NetworkToFaucetAPI,\n NetworkToIndexerAPI,\n Network,\n NetworkToPepperAPI,\n NetworkToProverAPI,\n} from \"../utils/apiEndpoints\";\nimport { AptosApiType } from \"../utils/const\";\n\n/**\n * This class holds the config information for the SDK client instance.\n *\n * @example\n *\n * const aptosConfig = new AptosConfig({network:Network.TESTNET})\n */\nexport class AptosConfig {\n /**\n * The Network that this SDK is associated with. Defaults to DEVNET\n */\n readonly network: Network;\n\n /**\n * The client instance the SDK uses. Defaults to `@aptos-labs/aptos-client\n */\n readonly client: Client;\n\n /**\n * The optional hardcoded fullnode URL to send requests to instead of using the network\n */\n readonly fullnode?: string;\n\n /**\n * The optional hardcoded faucet URL to send requests to instead of using the network\n */\n readonly faucet?: string;\n\n /**\n * The optional hardcoded pepper service URL to send requests to instead of using the network\n */\n readonly pepper?: string;\n\n /**\n * The optional hardcoded prover service URL to send requests to instead of using the network\n */\n readonly prover?: string;\n\n /**\n * The optional hardcoded indexer URL to send requests to instead of using the network\n */\n readonly indexer?: string;\n\n /**\n * Optional client configurations\n */\n readonly clientConfig?: ClientConfig;\n\n /**\n * Optional specific Fullnode configurations\n */\n readonly fullnodeConfig?: FullNodeConfig;\n\n /**\n * Optional specific Indexer configurations\n */\n readonly indexerConfig?: IndexerConfig;\n\n /**\n * Optional specific Faucet configurations\n */\n readonly faucetConfig?: FaucetConfig;\n\n constructor(settings?: AptosSettings) {\n this.network = settings?.network ?? Network.DEVNET;\n this.fullnode = settings?.fullnode;\n this.faucet = settings?.faucet;\n this.pepper = settings?.pepper;\n this.prover = settings?.prover;\n this.indexer = settings?.indexer;\n this.client = settings?.client ?? { provider: aptosClient };\n this.clientConfig = settings?.clientConfig ?? {};\n this.fullnodeConfig = settings?.fullnodeConfig ?? {};\n this.indexerConfig = settings?.indexerConfig ?? {};\n this.faucetConfig = settings?.faucetConfig ?? {};\n }\n\n /**\n * Returns the URL endpoint to send the request to.\n * If a custom URL was provided in the config, that URL is returned.\n * If a custom URL was provided but not URL endpoints, an error is thrown.\n * Otherwise, the URL endpoint is derived from the network.\n *\n * @param apiType - The type of Aptos API to get the URL for.\n *\n * @internal\n */\n getRequestUrl(apiType: AptosApiType): string {\n switch (apiType) {\n case AptosApiType.FULLNODE:\n if (this.fullnode !== undefined) return this.fullnode;\n if (this.network === Network.CUSTOM) throw new Error(\"Please provide a custom full node url\");\n return NetworkToNodeAPI[this.network];\n case AptosApiType.FAUCET:\n if (this.faucet !== undefined) return this.faucet;\n if (this.network === Network.CUSTOM) throw new Error(\"Please provide a custom faucet url\");\n return NetworkToFaucetAPI[this.network];\n case AptosApiType.INDEXER:\n if (this.indexer !== undefined) return this.indexer;\n if (this.network === Network.CUSTOM) throw new Error(\"Please provide a custom indexer url\");\n return NetworkToIndexerAPI[this.network];\n case AptosApiType.PEPPER:\n if (this.pepper !== undefined) return this.pepper;\n if (this.network === Network.CUSTOM) throw new Error(\"Please provide a custom pepper service url\");\n return NetworkToPepperAPI[this.network];\n case AptosApiType.PROVER:\n if (this.prover !== undefined) return this.prover;\n if (this.network === Network.CUSTOM) throw new Error(\"Please provide a custom prover service url\");\n return NetworkToProverAPI[this.network];\n default:\n throw Error(`apiType ${apiType} is not supported`);\n }\n }\n\n /**\n * Checks if the URL is a known pepper service endpoint\n *\n * @internal\n * */\n isPepperServiceRequest(url: string): boolean {\n return NetworkToPepperAPI[this.network] === url;\n }\n\n /**\n * Checks if the URL is a known prover service endpoint\n *\n * @internal\n * */\n isProverServiceRequest(url: string): boolean {\n return NetworkToProverAPI[this.network] === url;\n }\n}\n"],"mappings":"qEAGA,OAAOA,MAAiB,2BAmBjB,IAAMC,EAAN,KAAkB,CAwDvB,YAAYC,EAA0B,CACpC,KAAK,QAAUA,GAAU,kBACzB,KAAK,SAAWA,GAAU,SAC1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ptosConfig","settings","aptosClient","apiType","NetworkToNodeAPI","NetworkToFaucetAPI","NetworkToIndexerAPI","NetworkToPepperAPI","NetworkToProverAPI","url"]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{poseidon1 as s,poseidon2 as h,poseidon3 as u,poseidon4 as g,poseidon5 as a,poseidon6 as d,poseidon7 as c,poseidon8 as p,poseidon9 as f,poseidon10 as l,poseidon11 as A,poseidon12 as U,poseidon13 as b,poseidon14 as I,poseidon15 as w,poseidon16 as E}from"poseidon-lite";var y=[s,h,u,g,a,d,c,p,f,l,A,U,b,I,w,E],i=31,B=16,e=(B-1)*i;function x(n,t){let o=new TextEncoder().encode(n);return m(o,t)}function m(n,t){if(n.length>t)throw new Error(`Inputted bytes of length ${n} is longer than ${t}`);let r=_(n,t);return k(r)}function T(n,t){if(n.length>t)throw new Error(`Input bytes of length ${n} is longer than ${t}`);let r=N(n,t);return $(r)}function _(n,t){if(n.length>t)throw new Error(`Input bytes of length ${n} is longer than ${t}`);return T(n,t).concat([BigInt(n.length)])}function $(n){if(n.length>e)throw new Error(`Can't pack more than ${e}. Was given ${n.length} bytes`);return P(n,i).map(t=>L(t))}function P(n,t){let r=[];for(let o=0;o<n.length;o+=t)r.push(n.subarray(o,o+t));return r}function L(n){let t=BigInt(0);for(let r=n.length-1;r>=0;r-=1)t=t<<BigInt(8)|BigInt(n[r]);return t}function M(n,t){let r=new Uint8Array(t);for(let o=0;o<t;o+=1)r[o]=Number(n&BigInt(255)),n>>=BigInt(8);return r}function N(n,t){if(t<n.length)throw new Error("Padded size must be greater than or equal to the input array size.");let r=new Uint8Array(t);r.set(n);for(let o=n.length;o<t;o+=1)r[o]=0;return r}function k(n){let t=y[n.length-1];if(t)return t(n);throw new Error(`Unable to hash input of length ${n.length}`)}export{x as a,_ as b,L as c,M as d,k as e};
|
|
2
|
-
//# sourceMappingURL=chunk-FLYEALDB.mjs.map
|