@aptos-labs/ts-sdk 1.17.0-zeta.1 → 1.18.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-jP2Ua0t9.d.ts → accountAddress-Lv-GSihU.d.ts} +10 -8
- package/dist/common/cli/index.d.ts +1 -1
- package/dist/common/index.d.ts +30 -54
- package/dist/common/index.js +9 -7
- 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/EphemeralKeyPair.d.mts +1 -6
- package/dist/esm/account/EphemeralKeyPair.mjs +1 -1
- package/dist/esm/account/KeylessAccount.d.mts +7 -38
- package/dist/esm/account/KeylessAccount.mjs +1 -1
- package/dist/esm/account/MultiKeyAccount.d.mts +2 -2
- 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 +3 -4
- 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 -6
- package/dist/esm/api/aptos.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 +1 -1
- package/dist/esm/api/general.mjs +1 -1
- package/dist/esm/api/index.d.mts +5 -6
- package/dist/esm/api/index.mjs +1 -1
- package/dist/esm/api/keyless.d.mts +27 -8
- package/dist/esm/api/keyless.mjs +1 -1
- package/dist/esm/api/staking.mjs +1 -1
- package/dist/esm/api/table.mjs +1 -1
- 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.mjs +1 -1
- package/dist/esm/bcs/index.mjs +1 -1
- package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -1
- package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -1
- package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
- package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
- package/dist/esm/bcs/serializer.mjs +1 -1
- package/dist/esm/{chunk-IBDBKQMF.mjs → chunk-27EDTWDR.mjs} +2 -2
- package/dist/esm/{chunk-MNTLX37G.mjs → chunk-27IBTALL.mjs} +2 -2
- package/dist/esm/chunk-3DSVH6LX.mjs +2 -0
- package/dist/esm/chunk-3DSVH6LX.mjs.map +1 -0
- package/dist/esm/{chunk-JLXE5JF6.mjs → chunk-3XA2PJT3.mjs} +2 -2
- package/dist/esm/{chunk-MLX6DFMR.mjs → chunk-42XI3HFJ.mjs} +2 -2
- package/dist/esm/{chunk-ASK3DESW.mjs → chunk-4435A7EV.mjs} +2 -2
- package/dist/esm/{chunk-U2R36WTE.mjs → chunk-4IMYC7VX.mjs} +2 -2
- package/dist/esm/{chunk-ZMHGGT4E.mjs → chunk-4OMMO2ZM.mjs} +2 -2
- package/dist/esm/chunk-4TODRUKS.mjs +2 -0
- package/dist/esm/{chunk-PBMSO6WI.mjs → chunk-5AVPZE2Z.mjs} +2 -2
- package/dist/esm/{chunk-FR6UGCOX.mjs → chunk-5YKVCBMZ.mjs} +2 -2
- package/dist/esm/chunk-5YKVCBMZ.mjs.map +1 -0
- package/dist/esm/{chunk-VJFCEX7W.mjs → chunk-6AO7XFMJ.mjs} +2 -2
- package/dist/esm/{chunk-T5YEMU53.mjs → chunk-6J7KF4CI.mjs} +2 -2
- package/dist/esm/chunk-6QGVRNV6.mjs +2 -0
- package/dist/esm/{chunk-IBN7ETCB.mjs.map → chunk-6QGVRNV6.mjs.map} +1 -1
- package/dist/esm/{chunk-IXFYYWAC.mjs → chunk-6RI3QGKV.mjs} +2 -2
- package/dist/esm/chunk-772PPMHG.mjs +2 -0
- package/dist/esm/{chunk-TCK35M7E.mjs → chunk-774QDXM7.mjs} +2 -2
- package/dist/esm/{chunk-KDLQ2V3L.mjs → chunk-A5XE22JG.mjs} +2 -2
- package/dist/esm/chunk-ANH2FYMX.mjs +2 -0
- package/dist/esm/{chunk-WIYDJE6F.mjs → chunk-AX7L7E42.mjs} +2 -2
- package/dist/esm/{chunk-XVZBWW46.mjs → chunk-B3UIFT2G.mjs} +2 -2
- package/dist/esm/{chunk-AOCNYMMX.mjs → chunk-BCUSI3N6.mjs} +2 -2
- package/dist/esm/chunk-BF4ZE37Q.mjs +2 -0
- package/dist/esm/chunk-BI5F4IYT.mjs +2 -0
- package/dist/esm/chunk-BI5F4IYT.mjs.map +1 -0
- package/dist/esm/{chunk-Y4E6NTAS.mjs → chunk-BTTZZ2IQ.mjs} +2 -2
- package/dist/esm/{chunk-L5ZHZWHI.mjs → chunk-C75WI2DU.mjs} +2 -2
- package/dist/esm/{chunk-R5THMTSP.mjs → chunk-CDTDQXTN.mjs} +2 -2
- package/dist/esm/{chunk-4CUDBBTC.mjs → chunk-CR2SYJYG.mjs} +2 -2
- package/dist/esm/{chunk-4CUDBBTC.mjs.map → chunk-CR2SYJYG.mjs.map} +1 -1
- package/dist/esm/{chunk-J7HG6SQO.mjs → chunk-CVHPBWAE.mjs} +2 -2
- package/dist/esm/chunk-DBDIEGAX.mjs +2 -0
- package/dist/esm/{chunk-HP6YVTTT.mjs.map → chunk-DBDIEGAX.mjs.map} +1 -1
- package/dist/esm/{chunk-SNDFJWYM.mjs → chunk-DIJ7EEXC.mjs} +2 -2
- package/dist/esm/{chunk-OHZHYL3E.mjs → chunk-DKEUYXWU.mjs} +2 -2
- package/dist/esm/chunk-DZXM2MQY.mjs +2 -0
- package/dist/esm/chunk-DZXM2MQY.mjs.map +1 -0
- package/dist/esm/chunk-E37YRKWK.mjs +2 -0
- package/dist/esm/{chunk-IFAWCHUG.mjs → chunk-ENKXK5WP.mjs} +2 -2
- package/dist/esm/{chunk-P67NJHS5.mjs → chunk-EPYUPOEE.mjs} +2 -2
- package/dist/esm/chunk-F7EMGK4M.mjs +2 -0
- package/dist/esm/{chunk-ZIDLP5MI.mjs → chunk-FDVU4LJF.mjs} +2 -2
- package/dist/esm/{chunk-YRUF6N3U.mjs → chunk-FY7RZWGY.mjs} +2 -2
- package/dist/esm/chunk-G4UKDWKT.mjs +2 -0
- package/dist/esm/{chunk-DPWEHSHH.mjs → chunk-GBCAP4Z5.mjs} +2 -2
- package/dist/esm/{chunk-6FBKUTGF.mjs → chunk-GHYE26Q5.mjs} +2 -2
- package/dist/esm/{chunk-YA4XTZNZ.mjs → chunk-GWUK3P3Y.mjs} +2 -2
- package/dist/esm/{chunk-S3EDNXZE.mjs → chunk-HIHKTLLM.mjs} +20 -18
- package/dist/esm/chunk-HIHKTLLM.mjs.map +1 -0
- package/dist/esm/{chunk-UMLUOYFK.mjs → chunk-HPZ2S4FE.mjs} +2 -2
- package/dist/esm/{chunk-UMLUOYFK.mjs.map → chunk-HPZ2S4FE.mjs.map} +1 -1
- package/dist/esm/chunk-HZCFCP4P.mjs +2 -0
- package/dist/esm/{chunk-M3KFXIQ6.mjs.map → chunk-HZCFCP4P.mjs.map} +1 -1
- package/dist/esm/chunk-IMGLHDIA.mjs +2 -0
- package/dist/esm/{chunk-2G4IGSGM.mjs → chunk-IPBKWCHZ.mjs} +2 -2
- package/dist/esm/chunk-IYZMBB6Z.mjs +2 -0
- package/dist/esm/chunk-IYZMBB6Z.mjs.map +1 -0
- package/dist/esm/{chunk-TAT3K5M7.mjs → chunk-JBI3MFD3.mjs} +2 -2
- package/dist/esm/{chunk-VAKWRPVP.mjs → chunk-JWNKY2N3.mjs} +2 -2
- package/dist/esm/chunk-KZWAQOS5.mjs +2 -0
- package/dist/esm/chunk-KZWAQOS5.mjs.map +1 -0
- package/dist/esm/chunk-LG7RJQ57.mjs +2 -0
- package/dist/esm/chunk-LXLISEQ4.mjs +2 -0
- package/dist/esm/chunk-M2QV232A.mjs +2 -0
- package/dist/esm/{chunk-7M6OCGHL.mjs → chunk-MIEL2ZWA.mjs} +2 -2
- package/dist/esm/{chunk-XH33BXEY.mjs → chunk-MRYNASDY.mjs} +2 -2
- package/dist/esm/chunk-MS4MRLGA.mjs +2 -0
- package/dist/esm/{chunk-YDNOKWV3.mjs → chunk-NCKTBQKI.mjs} +2 -2
- package/dist/esm/{chunk-QFVQSFBZ.mjs → chunk-O5IXBRSF.mjs} +2 -2
- package/dist/esm/{chunk-DJPYZIJY.mjs → chunk-OFERLF6R.mjs} +2 -2
- package/dist/esm/chunk-P2YIFHMW.mjs +2 -0
- package/dist/esm/{chunk-4BJA3QUQ.mjs.map → chunk-P2YIFHMW.mjs.map} +1 -1
- package/dist/esm/{chunk-BO44HPGU.mjs → chunk-PI34ZZ2Q.mjs} +2 -2
- package/dist/esm/{chunk-2H24BEJI.mjs → chunk-PPJYFA3V.mjs} +2 -2
- package/dist/esm/chunk-PS4JR3KO.mjs +2 -0
- package/dist/esm/{chunk-54LCK6EN.mjs.map → chunk-PS4JR3KO.mjs.map} +1 -1
- package/dist/esm/{chunk-3SACE4I2.mjs → chunk-Q5M2JKZ5.mjs} +2 -2
- package/dist/esm/{chunk-TUCCV62K.mjs → chunk-QUHKUJEO.mjs} +2 -2
- package/dist/esm/{chunk-ET4WC6TJ.mjs → chunk-RQ7N6FTV.mjs} +2 -2
- package/dist/esm/{chunk-MRUDDEJ3.mjs → chunk-S2FOCEY3.mjs} +2 -2
- package/dist/esm/{chunk-EQF5MW2W.mjs → chunk-SZ2FGGM6.mjs} +2 -2
- package/dist/esm/{chunk-KGKEU2WI.mjs → chunk-TSTGVIAU.mjs} +2 -2
- package/dist/esm/{chunk-F3ZVWLDH.mjs → chunk-TYS55ZIF.mjs} +2 -2
- package/dist/esm/{chunk-F3ZVWLDH.mjs.map → chunk-TYS55ZIF.mjs.map} +1 -1
- package/dist/esm/{chunk-L5CPAOUM.mjs → chunk-VJZVCHIS.mjs} +2 -2
- package/dist/esm/{chunk-XBVVP7O2.mjs → chunk-WRKH7MMI.mjs} +2 -2
- package/dist/esm/chunk-WV5AD4IE.mjs +2 -0
- package/dist/esm/{chunk-EFMAZTIM.mjs → chunk-XAFM4JZX.mjs} +2 -2
- package/dist/esm/{chunk-FGGRPEQ3.mjs → chunk-XAISUKMY.mjs} +2 -2
- package/dist/esm/{chunk-O6QLAP7N.mjs → chunk-XEYFKOYN.mjs} +2 -2
- package/dist/esm/{chunk-5C5GZJ57.mjs → chunk-XHCH7LG5.mjs} +2 -2
- package/dist/esm/{chunk-CKQ74DYE.mjs → chunk-XQM7P7PK.mjs} +2 -2
- package/dist/esm/{chunk-3AIEYUPP.mjs → chunk-XZMPH72M.mjs} +2 -2
- package/dist/esm/{chunk-5X5GQF3E.mjs → chunk-Y5PEEKOM.mjs} +2 -2
- package/dist/esm/chunk-YJCZU6PR.mjs +2 -0
- package/dist/esm/{chunk-ZV5MKFV7.mjs → chunk-YLDLEASQ.mjs} +2 -2
- package/dist/esm/{chunk-5UXARGTJ.mjs → chunk-YOJC4OXK.mjs} +2 -2
- package/dist/esm/{chunk-HJAB473N.mjs → chunk-YXRXKYCR.mjs} +2 -2
- package/dist/esm/client/core.mjs +1 -1
- package/dist/esm/client/get.mjs +1 -1
- package/dist/esm/client/index.mjs +1 -1
- package/dist/esm/client/post.mjs +1 -1
- package/dist/esm/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/ephemeral.d.mts +1 -1
- package/dist/esm/core/crypto/ephemeral.mjs +1 -1
- package/dist/esm/core/crypto/index.d.mts +1 -1
- package/dist/esm/core/crypto/index.mjs +1 -1
- package/dist/esm/core/crypto/keyless.d.mts +2 -2
- package/dist/esm/core/crypto/keyless.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/proof.mjs +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 -1
- package/dist/esm/core/index.mjs +1 -1
- package/dist/esm/index.d.mts +3 -4
- 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.mjs +1 -1
- package/dist/esm/internal/keyless.d.mts +3 -4
- package/dist/esm/internal/keyless.mjs +1 -1
- package/dist/esm/internal/staking.mjs +1 -1
- package/dist/esm/internal/table.mjs +1 -1
- package/dist/esm/internal/transaction.mjs +1 -1
- package/dist/esm/internal/transactionSubmission.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 +2 -2
- package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +1 -1
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
- package/dist/esm/transactions/typeTag/index.mjs +1 -1
- package/dist/esm/transactions/typeTag/parser.mjs +1 -1
- package/dist/esm/transactions/types.d.mts +1 -1
- package/dist/esm/types/generated/operations.d.mts +14 -12
- package/dist/esm/types/generated/queries.d.mts +4 -4
- package/dist/esm/types/generated/queries.mjs +1 -1
- package/dist/esm/types/generated/types.d.mts +20 -2
- package/dist/esm/types/generated/types.mjs +1 -1
- package/dist/esm/types/generated/types.mjs.map +1 -1
- package/dist/esm/types/keyless.d.mts +0 -1
- package/dist/esm/utils/index.mjs +1 -1
- package/dist/esm/utils/normalizeBundle.mjs +1 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -3
- package/src/account/EphemeralKeyPair.ts +5 -13
- package/src/account/KeylessAccount.ts +24 -14
- package/src/account/MultiKeyAccount.ts +2 -1
- package/src/api/keyless.ts +30 -3
- package/src/bcs/deserializer.ts +4 -10
- package/src/bcs/serializer.ts +3 -4
- package/src/core/crypto/keyless.ts +1 -1
- package/src/internal/keyless.ts +24 -16
- package/src/internal/queries/getFungibleAssetMetadata.graphql +2 -0
- package/src/transactions/transactionBuilder/signingMessage.ts +2 -2
- package/src/types/generated/operations.ts +14 -12
- package/src/types/generated/queries.ts +30 -3
- package/src/types/generated/types.ts +20 -2
- package/src/types/keyless.ts +1 -1
- package/src/version.ts +1 -1
- package/dist/esm/chunk-37FFZSIM.mjs +0 -2
- package/dist/esm/chunk-3IFR6T3V.mjs +0 -2
- package/dist/esm/chunk-3IFR6T3V.mjs.map +0 -1
- package/dist/esm/chunk-3RJZNUCQ.mjs +0 -2
- package/dist/esm/chunk-472OGHMG.mjs +0 -2
- package/dist/esm/chunk-474YDCFP.mjs +0 -2
- package/dist/esm/chunk-474YDCFP.mjs.map +0 -1
- package/dist/esm/chunk-4BJA3QUQ.mjs +0 -2
- package/dist/esm/chunk-4VPCPASN.mjs +0 -2
- package/dist/esm/chunk-4W7T4HRZ.mjs +0 -2
- package/dist/esm/chunk-4W7T4HRZ.mjs.map +0 -1
- package/dist/esm/chunk-54LCK6EN.mjs +0 -2
- package/dist/esm/chunk-5SEAQESO.mjs +0 -2
- package/dist/esm/chunk-5SEAQESO.mjs.map +0 -1
- package/dist/esm/chunk-7BW2N4IE.mjs +0 -2
- package/dist/esm/chunk-FBPNHF54.mjs +0 -2
- package/dist/esm/chunk-FIG65OJD.mjs +0 -2
- package/dist/esm/chunk-FR6UGCOX.mjs.map +0 -1
- package/dist/esm/chunk-GRHLQDHF.mjs +0 -2
- package/dist/esm/chunk-GSCM444Z.mjs +0 -2
- package/dist/esm/chunk-HP6YVTTT.mjs +0 -2
- package/dist/esm/chunk-IBN7ETCB.mjs +0 -2
- package/dist/esm/chunk-IEVABWIO.mjs +0 -2
- package/dist/esm/chunk-IEVABWIO.mjs.map +0 -1
- package/dist/esm/chunk-IT7YNITU.mjs +0 -2
- package/dist/esm/chunk-M3KFXIQ6.mjs +0 -2
- package/dist/esm/chunk-NW3WUTTD.mjs +0 -2
- package/dist/esm/chunk-S3EDNXZE.mjs.map +0 -1
- package/dist/esm/chunk-TJDC5PWD.mjs +0 -2
- package/dist/esm/chunk-U5F4NL24.mjs +0 -2
- package/dist/esm/chunk-WA2NTBYY.mjs +0 -2
- package/dist/esm/chunk-YD5IB4TH.mjs +0 -2
- package/dist/esm/chunk-YD5IB4TH.mjs.map +0 -1
- package/dist/esm/core/crypto/cryptoHashable.d.mts +0 -21
- package/dist/esm/core/crypto/cryptoHashable.mjs +0 -2
- package/dist/esm/core/crypto/cryptoHashable.mjs.map +0 -1
- package/src/core/crypto/cryptoHashable.ts +0 -16
- /package/dist/esm/{chunk-IBDBKQMF.mjs.map → chunk-27EDTWDR.mjs.map} +0 -0
- /package/dist/esm/{chunk-MNTLX37G.mjs.map → chunk-27IBTALL.mjs.map} +0 -0
- /package/dist/esm/{chunk-JLXE5JF6.mjs.map → chunk-3XA2PJT3.mjs.map} +0 -0
- /package/dist/esm/{chunk-MLX6DFMR.mjs.map → chunk-42XI3HFJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-ASK3DESW.mjs.map → chunk-4435A7EV.mjs.map} +0 -0
- /package/dist/esm/{chunk-U2R36WTE.mjs.map → chunk-4IMYC7VX.mjs.map} +0 -0
- /package/dist/esm/{chunk-ZMHGGT4E.mjs.map → chunk-4OMMO2ZM.mjs.map} +0 -0
- /package/dist/esm/{chunk-IT7YNITU.mjs.map → chunk-4TODRUKS.mjs.map} +0 -0
- /package/dist/esm/{chunk-PBMSO6WI.mjs.map → chunk-5AVPZE2Z.mjs.map} +0 -0
- /package/dist/esm/{chunk-VJFCEX7W.mjs.map → chunk-6AO7XFMJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-T5YEMU53.mjs.map → chunk-6J7KF4CI.mjs.map} +0 -0
- /package/dist/esm/{chunk-IXFYYWAC.mjs.map → chunk-6RI3QGKV.mjs.map} +0 -0
- /package/dist/esm/{chunk-U5F4NL24.mjs.map → chunk-772PPMHG.mjs.map} +0 -0
- /package/dist/esm/{chunk-TCK35M7E.mjs.map → chunk-774QDXM7.mjs.map} +0 -0
- /package/dist/esm/{chunk-KDLQ2V3L.mjs.map → chunk-A5XE22JG.mjs.map} +0 -0
- /package/dist/esm/{chunk-472OGHMG.mjs.map → chunk-ANH2FYMX.mjs.map} +0 -0
- /package/dist/esm/{chunk-WIYDJE6F.mjs.map → chunk-AX7L7E42.mjs.map} +0 -0
- /package/dist/esm/{chunk-XVZBWW46.mjs.map → chunk-B3UIFT2G.mjs.map} +0 -0
- /package/dist/esm/{chunk-AOCNYMMX.mjs.map → chunk-BCUSI3N6.mjs.map} +0 -0
- /package/dist/esm/{chunk-4VPCPASN.mjs.map → chunk-BF4ZE37Q.mjs.map} +0 -0
- /package/dist/esm/{chunk-Y4E6NTAS.mjs.map → chunk-BTTZZ2IQ.mjs.map} +0 -0
- /package/dist/esm/{chunk-L5ZHZWHI.mjs.map → chunk-C75WI2DU.mjs.map} +0 -0
- /package/dist/esm/{chunk-R5THMTSP.mjs.map → chunk-CDTDQXTN.mjs.map} +0 -0
- /package/dist/esm/{chunk-J7HG6SQO.mjs.map → chunk-CVHPBWAE.mjs.map} +0 -0
- /package/dist/esm/{chunk-SNDFJWYM.mjs.map → chunk-DIJ7EEXC.mjs.map} +0 -0
- /package/dist/esm/{chunk-OHZHYL3E.mjs.map → chunk-DKEUYXWU.mjs.map} +0 -0
- /package/dist/esm/{chunk-GSCM444Z.mjs.map → chunk-E37YRKWK.mjs.map} +0 -0
- /package/dist/esm/{chunk-IFAWCHUG.mjs.map → chunk-ENKXK5WP.mjs.map} +0 -0
- /package/dist/esm/{chunk-P67NJHS5.mjs.map → chunk-EPYUPOEE.mjs.map} +0 -0
- /package/dist/esm/{chunk-TJDC5PWD.mjs.map → chunk-F7EMGK4M.mjs.map} +0 -0
- /package/dist/esm/{chunk-ZIDLP5MI.mjs.map → chunk-FDVU4LJF.mjs.map} +0 -0
- /package/dist/esm/{chunk-YRUF6N3U.mjs.map → chunk-FY7RZWGY.mjs.map} +0 -0
- /package/dist/esm/{chunk-FIG65OJD.mjs.map → chunk-G4UKDWKT.mjs.map} +0 -0
- /package/dist/esm/{chunk-DPWEHSHH.mjs.map → chunk-GBCAP4Z5.mjs.map} +0 -0
- /package/dist/esm/{chunk-6FBKUTGF.mjs.map → chunk-GHYE26Q5.mjs.map} +0 -0
- /package/dist/esm/{chunk-YA4XTZNZ.mjs.map → chunk-GWUK3P3Y.mjs.map} +0 -0
- /package/dist/esm/{chunk-WA2NTBYY.mjs.map → chunk-IMGLHDIA.mjs.map} +0 -0
- /package/dist/esm/{chunk-2G4IGSGM.mjs.map → chunk-IPBKWCHZ.mjs.map} +0 -0
- /package/dist/esm/{chunk-TAT3K5M7.mjs.map → chunk-JBI3MFD3.mjs.map} +0 -0
- /package/dist/esm/{chunk-VAKWRPVP.mjs.map → chunk-JWNKY2N3.mjs.map} +0 -0
- /package/dist/esm/{chunk-FBPNHF54.mjs.map → chunk-LG7RJQ57.mjs.map} +0 -0
- /package/dist/esm/{chunk-NW3WUTTD.mjs.map → chunk-LXLISEQ4.mjs.map} +0 -0
- /package/dist/esm/{chunk-37FFZSIM.mjs.map → chunk-M2QV232A.mjs.map} +0 -0
- /package/dist/esm/{chunk-7M6OCGHL.mjs.map → chunk-MIEL2ZWA.mjs.map} +0 -0
- /package/dist/esm/{chunk-XH33BXEY.mjs.map → chunk-MRYNASDY.mjs.map} +0 -0
- /package/dist/esm/{chunk-7BW2N4IE.mjs.map → chunk-MS4MRLGA.mjs.map} +0 -0
- /package/dist/esm/{chunk-YDNOKWV3.mjs.map → chunk-NCKTBQKI.mjs.map} +0 -0
- /package/dist/esm/{chunk-QFVQSFBZ.mjs.map → chunk-O5IXBRSF.mjs.map} +0 -0
- /package/dist/esm/{chunk-DJPYZIJY.mjs.map → chunk-OFERLF6R.mjs.map} +0 -0
- /package/dist/esm/{chunk-BO44HPGU.mjs.map → chunk-PI34ZZ2Q.mjs.map} +0 -0
- /package/dist/esm/{chunk-2H24BEJI.mjs.map → chunk-PPJYFA3V.mjs.map} +0 -0
- /package/dist/esm/{chunk-3SACE4I2.mjs.map → chunk-Q5M2JKZ5.mjs.map} +0 -0
- /package/dist/esm/{chunk-TUCCV62K.mjs.map → chunk-QUHKUJEO.mjs.map} +0 -0
- /package/dist/esm/{chunk-ET4WC6TJ.mjs.map → chunk-RQ7N6FTV.mjs.map} +0 -0
- /package/dist/esm/{chunk-MRUDDEJ3.mjs.map → chunk-S2FOCEY3.mjs.map} +0 -0
- /package/dist/esm/{chunk-EQF5MW2W.mjs.map → chunk-SZ2FGGM6.mjs.map} +0 -0
- /package/dist/esm/{chunk-KGKEU2WI.mjs.map → chunk-TSTGVIAU.mjs.map} +0 -0
- /package/dist/esm/{chunk-L5CPAOUM.mjs.map → chunk-VJZVCHIS.mjs.map} +0 -0
- /package/dist/esm/{chunk-XBVVP7O2.mjs.map → chunk-WRKH7MMI.mjs.map} +0 -0
- /package/dist/esm/{chunk-3RJZNUCQ.mjs.map → chunk-WV5AD4IE.mjs.map} +0 -0
- /package/dist/esm/{chunk-EFMAZTIM.mjs.map → chunk-XAFM4JZX.mjs.map} +0 -0
- /package/dist/esm/{chunk-FGGRPEQ3.mjs.map → chunk-XAISUKMY.mjs.map} +0 -0
- /package/dist/esm/{chunk-O6QLAP7N.mjs.map → chunk-XEYFKOYN.mjs.map} +0 -0
- /package/dist/esm/{chunk-5C5GZJ57.mjs.map → chunk-XHCH7LG5.mjs.map} +0 -0
- /package/dist/esm/{chunk-CKQ74DYE.mjs.map → chunk-XQM7P7PK.mjs.map} +0 -0
- /package/dist/esm/{chunk-3AIEYUPP.mjs.map → chunk-XZMPH72M.mjs.map} +0 -0
- /package/dist/esm/{chunk-5X5GQF3E.mjs.map → chunk-Y5PEEKOM.mjs.map} +0 -0
- /package/dist/esm/{chunk-GRHLQDHF.mjs.map → chunk-YJCZU6PR.mjs.map} +0 -0
- /package/dist/esm/{chunk-ZV5MKFV7.mjs.map → chunk-YLDLEASQ.mjs.map} +0 -0
- /package/dist/esm/{chunk-5UXARGTJ.mjs.map → chunk-YOJC4OXK.mjs.map} +0 -0
- /package/dist/esm/{chunk-HJAB473N.mjs.map → chunk-YXRXKYCR.mjs.map} +0 -0
- /package/dist/esm/{publicKey-lq5djCIY.d.mts → publicKey-B3XRNhHO.d.mts} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as Types from "./operations";
|
|
2
2
|
|
|
3
|
-
import { GraphQLClient } from "graphql-request";
|
|
4
|
-
|
|
3
|
+
import { GraphQLClient, RequestOptions } from "graphql-request";
|
|
4
|
+
type GraphQLClientRequestHeaders = RequestOptions["requestHeaders"];
|
|
5
5
|
export const TokenActivitiesFieldsFragmentDoc = `
|
|
6
6
|
fragment TokenActivitiesFields on token_activities_v2 {
|
|
7
7
|
after_value
|
|
@@ -357,6 +357,8 @@ export const GetFungibleAssetMetadata = `
|
|
|
357
357
|
name
|
|
358
358
|
symbol
|
|
359
359
|
token_standard
|
|
360
|
+
supply_v2
|
|
361
|
+
maximum_v2
|
|
360
362
|
}
|
|
361
363
|
}
|
|
362
364
|
`;
|
|
@@ -490,9 +492,10 @@ export type SdkFunctionWrapper = <T>(
|
|
|
490
492
|
action: (requestHeaders?: Record<string, string>) => Promise<T>,
|
|
491
493
|
operationName: string,
|
|
492
494
|
operationType?: string,
|
|
495
|
+
variables?: any,
|
|
493
496
|
) => Promise<T>;
|
|
494
497
|
|
|
495
|
-
const defaultWrapper: SdkFunctionWrapper = (action, _operationName, _operationType) => action();
|
|
498
|
+
const defaultWrapper: SdkFunctionWrapper = (action, _operationName, _operationType, _variables) => action();
|
|
496
499
|
|
|
497
500
|
export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper = defaultWrapper) {
|
|
498
501
|
return {
|
|
@@ -508,6 +511,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
|
|
|
508
511
|
}),
|
|
509
512
|
"getAccountCoinsCount",
|
|
510
513
|
"query",
|
|
514
|
+
variables,
|
|
511
515
|
);
|
|
512
516
|
},
|
|
513
517
|
getAccountCoinsData(
|
|
@@ -522,6 +526,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
|
|
|
522
526
|
}),
|
|
523
527
|
"getAccountCoinsData",
|
|
524
528
|
"query",
|
|
529
|
+
variables,
|
|
525
530
|
);
|
|
526
531
|
},
|
|
527
532
|
getAccountCollectionsWithOwnedTokens(
|
|
@@ -537,6 +542,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
|
|
|
537
542
|
),
|
|
538
543
|
"getAccountCollectionsWithOwnedTokens",
|
|
539
544
|
"query",
|
|
545
|
+
variables,
|
|
540
546
|
);
|
|
541
547
|
},
|
|
542
548
|
getAccountOwnedObjects(
|
|
@@ -551,6 +557,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
|
|
|
551
557
|
}),
|
|
552
558
|
"getAccountOwnedObjects",
|
|
553
559
|
"query",
|
|
560
|
+
variables,
|
|
554
561
|
);
|
|
555
562
|
},
|
|
556
563
|
getAccountOwnedTokens(
|
|
@@ -565,6 +572,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
|
|
|
565
572
|
}),
|
|
566
573
|
"getAccountOwnedTokens",
|
|
567
574
|
"query",
|
|
575
|
+
variables,
|
|
568
576
|
);
|
|
569
577
|
},
|
|
570
578
|
getAccountOwnedTokensByTokenData(
|
|
@@ -579,6 +587,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
|
|
|
579
587
|
}),
|
|
580
588
|
"getAccountOwnedTokensByTokenData",
|
|
581
589
|
"query",
|
|
590
|
+
variables,
|
|
582
591
|
);
|
|
583
592
|
},
|
|
584
593
|
getAccountOwnedTokensFromCollection(
|
|
@@ -594,6 +603,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
|
|
|
594
603
|
),
|
|
595
604
|
"getAccountOwnedTokensFromCollection",
|
|
596
605
|
"query",
|
|
606
|
+
variables,
|
|
597
607
|
);
|
|
598
608
|
},
|
|
599
609
|
getAccountTokensCount(
|
|
@@ -608,6 +618,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
|
|
|
608
618
|
}),
|
|
609
619
|
"getAccountTokensCount",
|
|
610
620
|
"query",
|
|
621
|
+
variables,
|
|
611
622
|
);
|
|
612
623
|
},
|
|
613
624
|
getAccountTransactionsCount(
|
|
@@ -622,6 +633,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
|
|
|
622
633
|
}),
|
|
623
634
|
"getAccountTransactionsCount",
|
|
624
635
|
"query",
|
|
636
|
+
variables,
|
|
625
637
|
);
|
|
626
638
|
},
|
|
627
639
|
getChainTopUserTransactions(
|
|
@@ -636,6 +648,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
|
|
|
636
648
|
}),
|
|
637
649
|
"getChainTopUserTransactions",
|
|
638
650
|
"query",
|
|
651
|
+
variables,
|
|
639
652
|
);
|
|
640
653
|
},
|
|
641
654
|
getCollectionData(
|
|
@@ -650,6 +663,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
|
|
|
650
663
|
}),
|
|
651
664
|
"getCollectionData",
|
|
652
665
|
"query",
|
|
666
|
+
variables,
|
|
653
667
|
);
|
|
654
668
|
},
|
|
655
669
|
getCurrentFungibleAssetBalances(
|
|
@@ -664,6 +678,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
|
|
|
664
678
|
}),
|
|
665
679
|
"getCurrentFungibleAssetBalances",
|
|
666
680
|
"query",
|
|
681
|
+
variables,
|
|
667
682
|
);
|
|
668
683
|
},
|
|
669
684
|
getDelegatedStakingActivities(
|
|
@@ -678,6 +693,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
|
|
|
678
693
|
}),
|
|
679
694
|
"getDelegatedStakingActivities",
|
|
680
695
|
"query",
|
|
696
|
+
variables,
|
|
681
697
|
);
|
|
682
698
|
},
|
|
683
699
|
getEvents(
|
|
@@ -689,6 +705,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
|
|
|
689
705
|
client.request<Types.GetEventsQuery>(GetEvents, variables, { ...requestHeaders, ...wrappedRequestHeaders }),
|
|
690
706
|
"getEvents",
|
|
691
707
|
"query",
|
|
708
|
+
variables,
|
|
692
709
|
);
|
|
693
710
|
},
|
|
694
711
|
getFungibleAssetActivities(
|
|
@@ -703,6 +720,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
|
|
|
703
720
|
}),
|
|
704
721
|
"getFungibleAssetActivities",
|
|
705
722
|
"query",
|
|
723
|
+
variables,
|
|
706
724
|
);
|
|
707
725
|
},
|
|
708
726
|
getFungibleAssetMetadata(
|
|
@@ -717,6 +735,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
|
|
|
717
735
|
}),
|
|
718
736
|
"getFungibleAssetMetadata",
|
|
719
737
|
"query",
|
|
738
|
+
variables,
|
|
720
739
|
);
|
|
721
740
|
},
|
|
722
741
|
getNames(
|
|
@@ -728,6 +747,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
|
|
|
728
747
|
client.request<Types.GetNamesQuery>(GetNames, variables, { ...requestHeaders, ...wrappedRequestHeaders }),
|
|
729
748
|
"getNames",
|
|
730
749
|
"query",
|
|
750
|
+
variables,
|
|
731
751
|
);
|
|
732
752
|
},
|
|
733
753
|
getNumberOfDelegators(
|
|
@@ -742,6 +762,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
|
|
|
742
762
|
}),
|
|
743
763
|
"getNumberOfDelegators",
|
|
744
764
|
"query",
|
|
765
|
+
variables,
|
|
745
766
|
);
|
|
746
767
|
},
|
|
747
768
|
getProcessorStatus(
|
|
@@ -756,6 +777,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
|
|
|
756
777
|
}),
|
|
757
778
|
"getProcessorStatus",
|
|
758
779
|
"query",
|
|
780
|
+
variables,
|
|
759
781
|
);
|
|
760
782
|
},
|
|
761
783
|
getTableItemsData(
|
|
@@ -770,6 +792,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
|
|
|
770
792
|
}),
|
|
771
793
|
"getTableItemsData",
|
|
772
794
|
"query",
|
|
795
|
+
variables,
|
|
773
796
|
);
|
|
774
797
|
},
|
|
775
798
|
getTableItemsMetadata(
|
|
@@ -784,6 +807,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
|
|
|
784
807
|
}),
|
|
785
808
|
"getTableItemsMetadata",
|
|
786
809
|
"query",
|
|
810
|
+
variables,
|
|
787
811
|
);
|
|
788
812
|
},
|
|
789
813
|
getTokenActivity(
|
|
@@ -798,6 +822,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
|
|
|
798
822
|
}),
|
|
799
823
|
"getTokenActivity",
|
|
800
824
|
"query",
|
|
825
|
+
variables,
|
|
801
826
|
);
|
|
802
827
|
},
|
|
803
828
|
getCurrentTokenOwnership(
|
|
@@ -812,6 +837,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
|
|
|
812
837
|
}),
|
|
813
838
|
"getCurrentTokenOwnership",
|
|
814
839
|
"query",
|
|
840
|
+
variables,
|
|
815
841
|
);
|
|
816
842
|
},
|
|
817
843
|
getTokenData(
|
|
@@ -826,6 +852,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
|
|
|
826
852
|
}),
|
|
827
853
|
"getTokenData",
|
|
828
854
|
"query",
|
|
855
|
+
variables,
|
|
829
856
|
);
|
|
830
857
|
},
|
|
831
858
|
};
|
|
@@ -3539,14 +3539,15 @@ export type CurrentTokenDatasV2 = {
|
|
|
3539
3539
|
current_token_ownerships: Array<CurrentTokenOwnershipsV2>;
|
|
3540
3540
|
/** An aggregate relationship */
|
|
3541
3541
|
current_token_ownerships_aggregate: CurrentTokenOwnershipsV2Aggregate;
|
|
3542
|
-
decimals
|
|
3542
|
+
decimals?: Maybe<Scalars["bigint"]["output"]>;
|
|
3543
3543
|
description: Scalars["String"]["output"];
|
|
3544
|
+
is_deleted_v2?: Maybe<Scalars["Boolean"]["output"]>;
|
|
3544
3545
|
is_fungible_v2?: Maybe<Scalars["Boolean"]["output"]>;
|
|
3545
3546
|
largest_property_version_v1?: Maybe<Scalars["numeric"]["output"]>;
|
|
3546
3547
|
last_transaction_timestamp: Scalars["timestamp"]["output"];
|
|
3547
3548
|
last_transaction_version: Scalars["bigint"]["output"];
|
|
3548
3549
|
maximum?: Maybe<Scalars["numeric"]["output"]>;
|
|
3549
|
-
supply
|
|
3550
|
+
supply?: Maybe<Scalars["numeric"]["output"]>;
|
|
3550
3551
|
token_data_id: Scalars["String"]["output"];
|
|
3551
3552
|
token_name: Scalars["String"]["output"];
|
|
3552
3553
|
token_properties: Scalars["jsonb"]["output"];
|
|
@@ -3590,6 +3591,7 @@ export type CurrentTokenDatasV2BoolExp = {
|
|
|
3590
3591
|
current_token_ownerships_aggregate?: InputMaybe<CurrentTokenOwnershipsV2AggregateBoolExp>;
|
|
3591
3592
|
decimals?: InputMaybe<BigintComparisonExp>;
|
|
3592
3593
|
description?: InputMaybe<StringComparisonExp>;
|
|
3594
|
+
is_deleted_v2?: InputMaybe<BooleanComparisonExp>;
|
|
3593
3595
|
is_fungible_v2?: InputMaybe<BooleanComparisonExp>;
|
|
3594
3596
|
largest_property_version_v1?: InputMaybe<NumericComparisonExp>;
|
|
3595
3597
|
last_transaction_timestamp?: InputMaybe<TimestampComparisonExp>;
|
|
@@ -3612,6 +3614,7 @@ export type CurrentTokenDatasV2OrderBy = {
|
|
|
3612
3614
|
current_token_ownerships_aggregate?: InputMaybe<CurrentTokenOwnershipsV2AggregateOrderBy>;
|
|
3613
3615
|
decimals?: InputMaybe<OrderBy>;
|
|
3614
3616
|
description?: InputMaybe<OrderBy>;
|
|
3617
|
+
is_deleted_v2?: InputMaybe<OrderBy>;
|
|
3615
3618
|
is_fungible_v2?: InputMaybe<OrderBy>;
|
|
3616
3619
|
largest_property_version_v1?: InputMaybe<OrderBy>;
|
|
3617
3620
|
last_transaction_timestamp?: InputMaybe<OrderBy>;
|
|
@@ -3634,6 +3637,8 @@ export enum CurrentTokenDatasV2SelectColumn {
|
|
|
3634
3637
|
/** column name */
|
|
3635
3638
|
Description = "description",
|
|
3636
3639
|
/** column name */
|
|
3640
|
+
IsDeletedV2 = "is_deleted_v2",
|
|
3641
|
+
/** column name */
|
|
3637
3642
|
IsFungibleV2 = "is_fungible_v2",
|
|
3638
3643
|
/** column name */
|
|
3639
3644
|
LargestPropertyVersionV1 = "largest_property_version_v1",
|
|
@@ -3670,6 +3675,7 @@ export type CurrentTokenDatasV2StreamCursorValueInput = {
|
|
|
3670
3675
|
collection_id?: InputMaybe<Scalars["String"]["input"]>;
|
|
3671
3676
|
decimals?: InputMaybe<Scalars["bigint"]["input"]>;
|
|
3672
3677
|
description?: InputMaybe<Scalars["String"]["input"]>;
|
|
3678
|
+
is_deleted_v2?: InputMaybe<Scalars["Boolean"]["input"]>;
|
|
3673
3679
|
is_fungible_v2?: InputMaybe<Scalars["Boolean"]["input"]>;
|
|
3674
3680
|
largest_property_version_v1?: InputMaybe<Scalars["numeric"]["input"]>;
|
|
3675
3681
|
last_transaction_timestamp?: InputMaybe<Scalars["timestamp"]["input"]>;
|
|
@@ -5415,10 +5421,12 @@ export type FungibleAssetMetadata = {
|
|
|
5415
5421
|
icon_uri?: Maybe<Scalars["String"]["output"]>;
|
|
5416
5422
|
last_transaction_timestamp: Scalars["timestamp"]["output"];
|
|
5417
5423
|
last_transaction_version: Scalars["bigint"]["output"];
|
|
5424
|
+
maximum_v2?: Maybe<Scalars["numeric"]["output"]>;
|
|
5418
5425
|
name: Scalars["String"]["output"];
|
|
5419
5426
|
project_uri?: Maybe<Scalars["String"]["output"]>;
|
|
5420
5427
|
supply_aggregator_table_handle_v1?: Maybe<Scalars["String"]["output"]>;
|
|
5421
5428
|
supply_aggregator_table_key_v1?: Maybe<Scalars["String"]["output"]>;
|
|
5429
|
+
supply_v2?: Maybe<Scalars["numeric"]["output"]>;
|
|
5422
5430
|
symbol: Scalars["String"]["output"];
|
|
5423
5431
|
token_standard: Scalars["String"]["output"];
|
|
5424
5432
|
};
|
|
@@ -5434,10 +5442,12 @@ export type FungibleAssetMetadataBoolExp = {
|
|
|
5434
5442
|
icon_uri?: InputMaybe<StringComparisonExp>;
|
|
5435
5443
|
last_transaction_timestamp?: InputMaybe<TimestampComparisonExp>;
|
|
5436
5444
|
last_transaction_version?: InputMaybe<BigintComparisonExp>;
|
|
5445
|
+
maximum_v2?: InputMaybe<NumericComparisonExp>;
|
|
5437
5446
|
name?: InputMaybe<StringComparisonExp>;
|
|
5438
5447
|
project_uri?: InputMaybe<StringComparisonExp>;
|
|
5439
5448
|
supply_aggregator_table_handle_v1?: InputMaybe<StringComparisonExp>;
|
|
5440
5449
|
supply_aggregator_table_key_v1?: InputMaybe<StringComparisonExp>;
|
|
5450
|
+
supply_v2?: InputMaybe<NumericComparisonExp>;
|
|
5441
5451
|
symbol?: InputMaybe<StringComparisonExp>;
|
|
5442
5452
|
token_standard?: InputMaybe<StringComparisonExp>;
|
|
5443
5453
|
};
|
|
@@ -5450,10 +5460,12 @@ export type FungibleAssetMetadataOrderBy = {
|
|
|
5450
5460
|
icon_uri?: InputMaybe<OrderBy>;
|
|
5451
5461
|
last_transaction_timestamp?: InputMaybe<OrderBy>;
|
|
5452
5462
|
last_transaction_version?: InputMaybe<OrderBy>;
|
|
5463
|
+
maximum_v2?: InputMaybe<OrderBy>;
|
|
5453
5464
|
name?: InputMaybe<OrderBy>;
|
|
5454
5465
|
project_uri?: InputMaybe<OrderBy>;
|
|
5455
5466
|
supply_aggregator_table_handle_v1?: InputMaybe<OrderBy>;
|
|
5456
5467
|
supply_aggregator_table_key_v1?: InputMaybe<OrderBy>;
|
|
5468
|
+
supply_v2?: InputMaybe<OrderBy>;
|
|
5457
5469
|
symbol?: InputMaybe<OrderBy>;
|
|
5458
5470
|
token_standard?: InputMaybe<OrderBy>;
|
|
5459
5471
|
};
|
|
@@ -5473,6 +5485,8 @@ export enum FungibleAssetMetadataSelectColumn {
|
|
|
5473
5485
|
/** column name */
|
|
5474
5486
|
LastTransactionVersion = "last_transaction_version",
|
|
5475
5487
|
/** column name */
|
|
5488
|
+
MaximumV2 = "maximum_v2",
|
|
5489
|
+
/** column name */
|
|
5476
5490
|
Name = "name",
|
|
5477
5491
|
/** column name */
|
|
5478
5492
|
ProjectUri = "project_uri",
|
|
@@ -5481,6 +5495,8 @@ export enum FungibleAssetMetadataSelectColumn {
|
|
|
5481
5495
|
/** column name */
|
|
5482
5496
|
SupplyAggregatorTableKeyV1 = "supply_aggregator_table_key_v1",
|
|
5483
5497
|
/** column name */
|
|
5498
|
+
SupplyV2 = "supply_v2",
|
|
5499
|
+
/** column name */
|
|
5484
5500
|
Symbol = "symbol",
|
|
5485
5501
|
/** column name */
|
|
5486
5502
|
TokenStandard = "token_standard",
|
|
@@ -5502,10 +5518,12 @@ export type FungibleAssetMetadataStreamCursorValueInput = {
|
|
|
5502
5518
|
icon_uri?: InputMaybe<Scalars["String"]["input"]>;
|
|
5503
5519
|
last_transaction_timestamp?: InputMaybe<Scalars["timestamp"]["input"]>;
|
|
5504
5520
|
last_transaction_version?: InputMaybe<Scalars["bigint"]["input"]>;
|
|
5521
|
+
maximum_v2?: InputMaybe<Scalars["numeric"]["input"]>;
|
|
5505
5522
|
name?: InputMaybe<Scalars["String"]["input"]>;
|
|
5506
5523
|
project_uri?: InputMaybe<Scalars["String"]["input"]>;
|
|
5507
5524
|
supply_aggregator_table_handle_v1?: InputMaybe<Scalars["String"]["input"]>;
|
|
5508
5525
|
supply_aggregator_table_key_v1?: InputMaybe<Scalars["String"]["input"]>;
|
|
5526
|
+
supply_v2?: InputMaybe<Scalars["numeric"]["input"]>;
|
|
5509
5527
|
symbol?: InputMaybe<Scalars["String"]["input"]>;
|
|
5510
5528
|
token_standard?: InputMaybe<Scalars["String"]["input"]>;
|
|
5511
5529
|
};
|
package/src/types/keyless.ts
CHANGED
|
@@ -20,7 +20,7 @@ export type PepperFetchRequest = {
|
|
|
20
20
|
uid_key: string;
|
|
21
21
|
derivation_path: string;
|
|
22
22
|
};
|
|
23
|
-
export type PepperFetchResponse = {
|
|
23
|
+
export type PepperFetchResponse = { pepper: string; address: string };
|
|
24
24
|
|
|
25
25
|
export type KeylessConfigurationResponse = {
|
|
26
26
|
max_commited_epk_bytes: number;
|
package/src/version.ts
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as r}from"./chunk-56CNRT2K.mjs";var n=class{constructor(e){this.buffer=new ArrayBuffer(e.length),new Uint8Array(this.buffer).set(e,0),this.offset=0}read(e){if(this.offset+e>this.buffer.byteLength)throw new Error("Reached to the end of buffer");let i=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,i}deserializeStr(){let e=this.deserializeBytes();return new TextDecoder().decode(e)}deserializeOptionStr(){if(this.deserializeUleb128AsU32()===1)return this.deserializeStr()}deserializeOption(e){if(this.deserializeUleb128AsU32()===1)return this.deserialize(e)}deserializeBytes(){let e=this.deserializeUleb128AsU32();return new Uint8Array(this.read(e))}deserializeFixedBytes(e){return new Uint8Array(this.read(e))}deserializeBool(){let e=new Uint8Array(this.read(1))[0];if(e!==1&&e!==0)throw new Error("Invalid boolean value");return e===1}deserializeU8(){return new DataView(this.read(1)).getUint8(0)}deserializeU16(){return new DataView(this.read(2)).getUint16(0,!0)}deserializeU32(){return new DataView(this.read(4)).getUint32(0,!0)}deserializeU64(){let e=this.deserializeU32(),i=this.deserializeU32();return BigInt(BigInt(i)<<BigInt(32)|BigInt(e))}deserializeU128(){let e=this.deserializeU64(),i=this.deserializeU64();return BigInt(i<<BigInt(64)|e)}deserializeU256(){let e=this.deserializeU128(),i=this.deserializeU128();return BigInt(i<<BigInt(128)|e)}deserializeUleb128AsU32(){let e=BigInt(0),i=0;for(;e<r;){let t=this.deserializeU8();if(e|=BigInt(t&127)<<BigInt(i),!(t&128))break;i+=7}if(e>r)throw new Error("Overflow while parsing uleb128-encoded uint32 value");return Number(e)}deserialize(e){return e.deserialize(this)}deserializeVector(e){let i=this.deserializeUleb128AsU32(),t=new Array;for(let s=0;s<i;s+=1)t.push(this.deserialize(e));return t}};export{n as a};
|
|
2
|
-
//# sourceMappingURL=chunk-3IFR6T3V.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/bcs/deserializer.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/* eslint-disable no-bitwise */\nimport { MAX_U32_NUMBER } from \"./consts\";\nimport { Uint8, Uint16, Uint32, Uint64, Uint128, Uint256 } from \"../types\";\n\n/**\n * This interface exists to define Deserializable<T> inputs for functions that\n * deserialize a byte buffer into a type T.\n * It is not intended to be implemented or extended, because Typescript has no support\n * for static methods in interfaces.\n */\nexport interface Deserializable<T> {\n deserialize(deserializer: Deserializer): T;\n}\n\nexport class Deserializer {\n private buffer: ArrayBuffer;\n\n private offset: number;\n\n constructor(data: Uint8Array) {\n // copies data to prevent outside mutation of buffer.\n this.buffer = new ArrayBuffer(data.length);\n new Uint8Array(this.buffer).set(data, 0);\n this.offset = 0;\n }\n\n private read(length: number): ArrayBuffer {\n if (this.offset + length > this.buffer.byteLength) {\n throw new Error(\"Reached to the end of buffer\");\n }\n\n const bytes = this.buffer.slice(this.offset, this.offset + length);\n this.offset += length;\n return bytes;\n }\n\n /**\n * Deserializes a string. UTF8 string is supported. Reads the string's bytes length \"l\" first,\n * and then reads \"l\" bytes of content. Decodes the byte array into a string.\n *\n * BCS layout for \"string\": string_length | string_content\n * where string_length is a u32 integer encoded as a uleb128 integer, equal to the number of bytes in string_content.\n *\n * @example\n * ```ts\n * const deserializer = new Deserializer(new Uint8Array([8, 49, 50, 51, 52, 97, 98, 99, 100]));\n * assert(deserializer.deserializeStr() === \"1234abcd\");\n * ```\n */\n deserializeStr(): string {\n const value = this.deserializeBytes();\n const textDecoder = new TextDecoder();\n return textDecoder.decode(value);\n }\n\n /**\n * Deserializes a an optional string.\n *\n * BCS layout for Optional<String>: 0 if none, else 1 | string_length | string_content\n * @example\n * ```ts\n * const deserializer = new Deserializer(new Uint8Array([0x00]));\n * assert(deserializer.deserializeOptionStr() === undefined);\n * const deserializer = new Deserializer(new Uint8Array([1, 8, 49, 50, 51, 52, 97, 98, 99, 100]));\n * assert(deserializer.deserializeOptionStr() === \"1234abcd\");\n * ```\n */\n deserializeOptionStr(): string | undefined {\n const exists = this.deserializeUleb128AsU32();\n if (exists === 1) {\n return this.deserializeStr();\n }\n return undefined;\n }\n\n /**\n * Deserializes a an optional deserializable class.\n *\n * BCS layout for Optional<T>: 0 if none, else 1 | bcs representation of class\n *\n * @example\n * const deserializer = new Deserializer(new Uint8Array([1, 2, 3]));\n * const value = deserializer.deserializeOption(MyClass); // where MyClass has a `deserialize` function\n * // value is now an instance of MyClass\n *\n * const deserializer = new Deserializer(new Uint8Array([0]));\n * const value = deserializer.deserializeOption(MyClass); // where MyClass has a `deserialize` function\n * // value is undefined\n *\n * @param cls The BCS-deserializable class to deserialize the buffered bytes into.\n *\n * @returns the deserialized value of class type T\n */\n deserializeOption<T>(cls: Deserializable<T>): T | undefined {\n const exists = this.deserializeUleb128AsU32();\n if (exists === 1) {\n return this.deserialize(cls);\n }\n return undefined;\n }\n\n /**\n * Deserializes an array of bytes.\n *\n * BCS layout for \"bytes\": bytes_length | bytes\n * where bytes_length is a u32 integer encoded as a uleb128 integer, equal to the length of the bytes array.\n */\n deserializeBytes(): Uint8Array {\n const len = this.deserializeUleb128AsU32();\n return new Uint8Array(this.read(len));\n }\n\n /**\n * Deserializes an array of bytes. The number of bytes to read is already known.\n *\n */\n deserializeFixedBytes(len: number): Uint8Array {\n return new Uint8Array(this.read(len));\n }\n\n /**\n * Deserializes a boolean value.\n *\n * BCS layout for \"boolean\": One byte. \"0x01\" for true and \"0x00\" for false.\n */\n deserializeBool(): boolean {\n const bool = new Uint8Array(this.read(1))[0];\n if (bool !== 1 && bool !== 0) {\n throw new Error(\"Invalid boolean value\");\n }\n return bool === 1;\n }\n\n /**\n * Deserializes a uint8 number.\n *\n * BCS layout for \"uint8\": One byte. Binary format in little-endian representation.\n */\n deserializeU8(): Uint8 {\n return new DataView(this.read(1)).getUint8(0);\n }\n\n /**\n * Deserializes a uint16 number.\n *\n * BCS layout for \"uint16\": Two bytes. Binary format in little-endian representation.\n * @example\n * ```ts\n * const deserializer = new Deserializer(new Uint8Array([0x34, 0x12]));\n * assert(deserializer.deserializeU16() === 4660);\n * ```\n */\n deserializeU16(): Uint16 {\n return new DataView(this.read(2)).getUint16(0, true);\n }\n\n /**\n * Deserializes a uint32 number.\n *\n * BCS layout for \"uint32\": Four bytes. Binary format in little-endian representation.\n * @example\n * ```ts\n * const deserializer = new Deserializer(new Uint8Array([0x78, 0x56, 0x34, 0x12]));\n * assert(deserializer.deserializeU32() === 305419896);\n * ```\n */\n deserializeU32(): Uint32 {\n return new DataView(this.read(4)).getUint32(0, true);\n }\n\n /**\n * Deserializes a uint64 number.\n *\n * BCS layout for \"uint64\": Eight bytes. Binary format in little-endian representation.\n * @example\n * ```ts\n * const deserializer = new Deserializer(new Uint8Array([0x00, 0xEF, 0xCD, 0xAB, 0x78, 0x56, 0x34, 0x12]));\n * assert(deserializer.deserializeU64() === 1311768467750121216);\n * ```\n */\n deserializeU64(): Uint64 {\n const low = this.deserializeU32();\n const high = this.deserializeU32();\n\n // combine the two 32-bit values and return (little endian)\n return BigInt((BigInt(high) << BigInt(32)) | BigInt(low));\n }\n\n /**\n * Deserializes a uint128 number.\n *\n * BCS layout for \"uint128\": Sixteen bytes. Binary format in little-endian representation.\n */\n deserializeU128(): Uint128 {\n const low = this.deserializeU64();\n const high = this.deserializeU64();\n\n // combine the two 64-bit values and return (little endian)\n return BigInt((high << BigInt(64)) | low);\n }\n\n /**\n * Deserializes a uint256 number.\n *\n * BCS layout for \"uint256\": Thirty-two bytes. Binary format in little-endian representation.\n */\n deserializeU256(): Uint256 {\n const low = this.deserializeU128();\n const high = this.deserializeU128();\n\n // combine the two 128-bit values and return (little endian)\n return BigInt((high << BigInt(128)) | low);\n }\n\n /**\n * Deserializes a uleb128 encoded uint32 number.\n *\n * BCS use uleb128 encoding in two cases: (1) lengths of variable-length sequences and (2) tags of enum values\n */\n deserializeUleb128AsU32(): Uint32 {\n let value: bigint = BigInt(0);\n let shift = 0;\n\n while (value < MAX_U32_NUMBER) {\n const byte = this.deserializeU8();\n value |= BigInt(byte & 0x7f) << BigInt(shift);\n\n if ((byte & 0x80) === 0) {\n break;\n }\n shift += 7;\n }\n\n if (value > MAX_U32_NUMBER) {\n throw new Error(\"Overflow while parsing uleb128-encoded uint32 value\");\n }\n\n return Number(value);\n }\n\n /**\n * Helper function that primarily exists to support alternative syntax for deserialization.\n * That is, if we have a `const deserializer: new Deserializer(...)`, instead of having to use\n * `MyClass.deserialize(deserializer)`, we can call `deserializer.deserialize(MyClass)`.\n *\n * @example const deserializer = new Deserializer(new Uint8Array([1, 2, 3]));\n * const value = deserializer.deserialize(MyClass); // where MyClass has a `deserialize` function\n * // value is now an instance of MyClass\n * // equivalent to `const value = MyClass.deserialize(deserializer)`\n * @param cls The BCS-deserializable class to deserialize the buffered bytes into.\n *\n * @returns the deserialized value of class type T\n */\n deserialize<T>(cls: Deserializable<T>): T {\n // NOTE: `deserialize` in `cls.deserialize(this)` here is a static method defined in `cls`,\n // It is separate from the `deserialize` instance method defined here in Deserializer.\n return cls.deserialize(this);\n }\n\n /**\n * Deserializes an array of BCS Deserializable values given an existing Deserializer\n * instance with a loaded byte buffer.\n *\n * @param cls The BCS-deserializable class to deserialize the buffered bytes into.\n * @example\n * // serialize a vector of addresses\n * const addresses = new Array<AccountAddress>(\n * AccountAddress.from(\"0x1\"),\n * AccountAddress.from(\"0x2\"),\n * AccountAddress.from(\"0xa\"),\n * AccountAddress.from(\"0xb\"),\n * );\n * const serializer = new Serializer();\n * serializer.serializeVector(addresses);\n * const serializedBytes = serializer.toUint8Array();\n *\n * // deserialize the bytes into an array of addresses\n * const deserializer = new Deserializer(serializedBytes);\n * const deserializedAddresses = deserializer.deserializeVector(AccountAddress);\n * // deserializedAddresses is now an array of AccountAddress instances\n * @returns an array of deserialized values of type T\n */\n deserializeVector<T>(cls: Deserializable<T>): Array<T> {\n const length = this.deserializeUleb128AsU32();\n const vector = new Array<T>();\n for (let i = 0; i < length; i += 1) {\n vector.push(this.deserialize(cls));\n }\n return vector;\n }\n}\n"],"mappings":"yCAiBO,IAAMA,EAAN,KAAmB,CAKxB,YAAYC,EAAkB,CAE5B,KAAK,OAAS,IAAI,YAAYA,EAAK,MAAM,EACzC,IAAI,WAAW,KAAK,MAAM,EAAE,IAAIA,EAAM,CAAC,EACvC,KAAK,OAAS,CAChB,CAEQ,KAAKC,EAA6B,CACxC,GAAI,KAAK,OAASA,EAAS,KAAK,OAAO,WACrC,MAAM,IAAI,MAAM,8BAA8B,EAGhD,IAAMC,EAAQ,KAAK,OAAO,MAAM,KAAK,OAAQ,KAAK,OAASD,CAAM,EACjE,YAAK,QAAUA,EACRC,CACT,CAeA,gBAAyB,CACvB,IAAMC,EAAQ,KAAK,iBAAiB,EAEpC,OADoB,IAAI,YAAY,EACjB,OAAOA,CAAK,CACjC,CAcA,sBAA2C,CAEzC,GADe,KAAK,wBAAwB,IAC7B,EACb,OAAO,KAAK,eAAe,CAG/B,CAoBA,kBAAqBC,EAAuC,CAE1D,GADe,KAAK,wBAAwB,IAC7B,EACb,OAAO,KAAK,YAAYA,CAAG,CAG/B,CAQA,kBAA+B,CAC7B,IAAMC,EAAM,KAAK,wBAAwB,EACzC,OAAO,IAAI,WAAW,KAAK,KAAKA,CAAG,CAAC,CACtC,CAMA,sBAAsBA,EAAyB,CAC7C,OAAO,IAAI,WAAW,KAAK,KAAKA,CAAG,CAAC,CACtC,CAOA,iBAA2B,CACzB,IAAMC,EAAO,IAAI,WAAW,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC,EAC3C,GAAIA,IAAS,GAAKA,IAAS,EACzB,MAAM,IAAI,MAAM,uBAAuB,EAEzC,OAAOA,IAAS,CAClB,CAOA,eAAuB,CACrB,OAAO,IAAI,SAAS,KAAK,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAC9C,CAYA,gBAAyB,CACvB,OAAO,IAAI,SAAS,KAAK,KAAK,CAAC,CAAC,EAAE,UAAU,EAAG,EAAI,CACrD,CAYA,gBAAyB,CACvB,OAAO,IAAI,SAAS,KAAK,KAAK,CAAC,CAAC,EAAE,UAAU,EAAG,EAAI,CACrD,CAYA,gBAAyB,CACvB,IAAMC,EAAM,KAAK,eAAe,EAC1BC,EAAO,KAAK,eAAe,EAGjC,OAAO,OAAQ,OAAOA,CAAI,GAAK,OAAO,EAAE,EAAK,OAAOD,CAAG,CAAC,CAC1D,CAOA,iBAA2B,CACzB,IAAMA,EAAM,KAAK,eAAe,EAC1BC,EAAO,KAAK,eAAe,EAGjC,OAAO,OAAQA,GAAQ,OAAO,EAAE,EAAKD,CAAG,CAC1C,CAOA,iBAA2B,CACzB,IAAMA,EAAM,KAAK,gBAAgB,EAC3BC,EAAO,KAAK,gBAAgB,EAGlC,OAAO,OAAQA,GAAQ,OAAO,GAAG,EAAKD,CAAG,CAC3C,CAOA,yBAAkC,CAChC,IAAIJ,EAAgB,OAAO,CAAC,EACxBM,EAAQ,EAEZ,KAAON,EAAQO,GAAgB,CAC7B,IAAMC,EAAO,KAAK,cAAc,EAGhC,GAFAR,GAAS,OAAOQ,EAAO,GAAI,GAAK,OAAOF,CAAK,EAEvC,EAAAE,EAAO,KACV,MAEFF,GAAS,CACX,CAEA,GAAIN,EAAQO,EACV,MAAM,IAAI,MAAM,qDAAqD,EAGvE,OAAO,OAAOP,CAAK,CACrB,CAeA,YAAeC,EAA2B,CAGxC,OAAOA,EAAI,YAAY,IAAI,CAC7B,CAyBA,kBAAqBA,EAAkC,CACrD,IAAMH,EAAS,KAAK,wBAAwB,EACtCW,EAAS,IAAI,MACnB,QAASC,EAAI,EAAGA,EAAIZ,EAAQY,GAAK,EAC/BD,EAAO,KAAK,KAAK,YAAYR,CAAG,CAAC,EAEnC,OAAOQ,CACT,CACF","names":["Deserializer","data","length","bytes","value","cls","len","bool","low","high","shift","MAX_U32_NUMBER","byte","vector","i"]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as m}from"./chunk-FIG65OJD.mjs";import{a as h}from"./chunk-NW3WUTTD.mjs";import{b as t}from"./chunk-F3ZVWLDH.mjs";import{a as u}from"./chunk-UMLUOYFK.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-472OGHMG.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as l,b as y}from"./chunk-L5CPAOUM.mjs";import{b as u,c as h,e as d}from"./chunk-IVVWQKCF.mjs";import{b as a}from"./chunk-XVZBWW46.mjs";import{b as m,c as b}from"./chunk-YTQVMLFD.mjs";import{a as o}from"./chunk-3IFR6T3V.mjs";import{a as p}from"./chunk-UMLUOYFK.mjs";import{b as c}from"./chunk-AOCNYMMX.mjs";import{randomBytes as x}from"@noble/hashes/utils";var E=1209600,i=class i extends p{constructor(e){super();let{privateKey:r,expiryDateSecs:t,blinder:n}=e;this.privateKey=r,this.publicKey=new l(r.publicKey()),this.expiryDateSecs=t||b(m()+E),this.blinder=n!==void 0?c.fromHexInput(n).toUint8Array():S(),this.nonce=this.generateNonce()}getPublicKey(){return this.publicKey}isExpired(){return Math.floor(Date.now()/1e3)>this.expiryDateSecs}serialize(e){e.serializeU32AsUleb128(this.publicKey.variant),e.serializeBytes(this.privateKey.toUint8Array()),e.serializeU64(this.expiryDateSecs),e.serializeFixedBytes(this.blinder)}static deserialize(e){let r=e.deserializeUleb128AsU32(),t;switch(r){case 0:t=a.deserialize(e);break;default:throw new Error(`Unknown variant index for EphemeralPublicKey: ${r}`)}let n=e.deserializeU64(),K=e.deserializeFixedBytes(31);return new i({privateKey:t,expiryDateSecs:Number(n),blinder:K})}static fromBytes(e){return i.deserialize(new o(e))}static generate(e){let r;switch(e?.scheme){case 0:default:r=a.generate()}return new i({privateKey:r,expiryDateSecs:e?.expiryDateSecs})}generateNonce(){let e=u(this.publicKey.bcsToBytes(),93);return e.push(BigInt(this.expiryDateSecs)),e.push(h(this.blinder)),d(e).toString()}sign(e){if(this.isExpired())throw new Error("EphemeralKeyPair has expired");return new y(this.privateKey.sign(e))}};i.BLINDER_LENGTH=31;var s=i;function S(){return x(s.BLINDER_LENGTH)}export{s as a};
|
|
2
|
-
//# sourceMappingURL=chunk-474YDCFP.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/account/EphemeralKeyPair.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { randomBytes } from \"@noble/hashes/utils\";\n\nimport { Ed25519PrivateKey, EphemeralPublicKey, EphemeralSignature, PrivateKey } from \"../core/crypto\";\nimport { Hex } from \"../core/hex\";\nimport { bytesToBigIntLE, padAndPackBytesWithLen, poseidonHash } from \"../core/crypto/poseidon\";\nimport { EphemeralPublicKeyVariant, HexInput } from \"../types\";\nimport { Deserializer, Serializable, Serializer } from \"../bcs\";\nimport { floorToWholeHour, nowInSeconds } from \"../utils/helpers\";\n\nconst TWO_WEEKS_IN_SECONDS = 1_209_600;\n\n/**\n * A class which contains a key pair that is used in signing transactions via the Keyless authentication scheme. This key pair\n * is ephemeral and has an expiration time. For more details on how this class is used -\n * https://aptos.dev/guides/keyless-accounts/#1-present-the-user-with-a-sign-in-with-idp-button-on-the-ui\n */\nexport class EphemeralKeyPair extends Serializable {\n static readonly BLINDER_LENGTH: number = 31;\n\n /**\n * A byte array of length BLINDER_LENGTH used to obfuscate the public key from the IdP.\n * Used in calculating the nonce passed to the IdP and as a secret witness in proof generation.\n */\n readonly blinder: Uint8Array;\n\n /**\n * A timestamp in seconds indicating when the ephemeral key pair is expired. After expiry, a new\n * EphemeralKeyPair must be generated and a new JWT needs to be created.\n */\n readonly expiryDateSecs: number;\n\n /**\n * The value passed to the IdP when the user authenticates. It comprises of a hash of the\n * ephermeral public key, expiry date, and blinder.\n */\n readonly nonce: string;\n\n /**\n * A private key used to sign transactions. This private key is not tied to any account on the chain as it\n * is ephemeral (not permanent) in nature.\n */\n private privateKey: PrivateKey;\n\n /**\n * A public key used to verify transactions. This public key is not tied to any account on the chain as it\n * is ephemeral (not permanent) in nature.\n */\n private publicKey: EphemeralPublicKey;\n\n constructor(args: { privateKey: PrivateKey; expiryDateSecs?: number; blinder?: HexInput }) {\n super();\n const { privateKey, expiryDateSecs, blinder } = args;\n this.privateKey = privateKey;\n this.publicKey = new EphemeralPublicKey(privateKey.publicKey());\n // By default, we set the expiry date to be two weeks in the future floored to the nearest hour\n this.expiryDateSecs = expiryDateSecs || floorToWholeHour(nowInSeconds() + TWO_WEEKS_IN_SECONDS);\n // Generate the blinder if not provided\n this.blinder = blinder !== undefined ? Hex.fromHexInput(blinder).toUint8Array() : generateBlinder();\n // Calculate the nonce\n this.nonce = this.generateNonce();\n }\n\n /**\n * Returns the public key of the key pair.\n * @return EphemeralPublicKey\n */\n getPublicKey(): EphemeralPublicKey {\n return this.publicKey;\n }\n\n /**\n * Returns the public key of the key pair.\n * @return boolean\n */\n isExpired(): boolean {\n const currentTimeSecs: number = Math.floor(Date.now() / 1000);\n return currentTimeSecs > this.expiryDateSecs;\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(this.publicKey.variant);\n serializer.serializeBytes(this.privateKey.toUint8Array());\n serializer.serializeU64(this.expiryDateSecs);\n serializer.serializeFixedBytes(this.blinder);\n }\n\n static deserialize(deserializer: Deserializer): EphemeralKeyPair {\n const variantIndex = deserializer.deserializeUleb128AsU32();\n let privateKey: PrivateKey;\n switch (variantIndex) {\n case EphemeralPublicKeyVariant.Ed25519:\n privateKey = Ed25519PrivateKey.deserialize(deserializer);\n break;\n default:\n throw new Error(`Unknown variant index for EphemeralPublicKey: ${variantIndex}`);\n }\n const expiryDateSecs = deserializer.deserializeU64();\n const blinder = deserializer.deserializeFixedBytes(31);\n return new EphemeralKeyPair({ privateKey, expiryDateSecs: Number(expiryDateSecs), blinder });\n }\n\n static fromBytes(bytes: Uint8Array): EphemeralKeyPair {\n return EphemeralKeyPair.deserialize(new Deserializer(bytes));\n }\n\n /**\n * Returns the public key of the key pair.\n * @param scheme the type of keypair to use for the EphemeralKeyPair. Only Ed25519 supported for now.\n * @param expiryDateSecs the date of expiry.\n * @return boolean\n */\n static generate(args?: { scheme?: EphemeralPublicKeyVariant; expiryDateSecs?: number }): EphemeralKeyPair {\n let privateKey: PrivateKey;\n\n switch (args?.scheme) {\n case EphemeralPublicKeyVariant.Ed25519:\n default:\n privateKey = Ed25519PrivateKey.generate();\n }\n\n return new EphemeralKeyPair({ privateKey, expiryDateSecs: args?.expiryDateSecs });\n }\n\n /**\n * From the ephemeral public key, expiry timestamp, and blinder, calculate the nonce to be used at authentication via OIDC.\n * @returns string\n */\n private generateNonce(): string {\n const fields = padAndPackBytesWithLen(this.publicKey.bcsToBytes(), 93);\n fields.push(BigInt(this.expiryDateSecs));\n fields.push(bytesToBigIntLE(this.blinder));\n const nonceHash = poseidonHash(fields);\n return nonceHash.toString();\n }\n\n /**\n * Sign the given message with the private key.\n * @param data in HexInput format\n * @returns EphemeralSignature\n */\n sign(data: HexInput): EphemeralSignature {\n if (this.isExpired()) {\n throw new Error(\"EphemeralKeyPair has expired\");\n }\n return new EphemeralSignature(this.privateKey.sign(data));\n }\n}\n\n/**\n * Generates a random byte array of length EphemeralKeyPair.BLINDER_LENGTH\n * @returns Uint8Array\n */\nfunction generateBlinder(): Uint8Array {\n return randomBytes(EphemeralKeyPair.BLINDER_LENGTH);\n}\n"],"mappings":"2TAGA,OAAS,eAAAA,MAAmB,sBAS5B,IAAMC,EAAuB,QAOhBC,EAAN,MAAMA,UAAyBC,CAAa,CAiCjD,YAAYC,EAA+E,CACzF,MAAM,EACN,GAAM,CAAE,WAAAC,EAAY,eAAAC,EAAgB,QAAAC,CAAQ,EAAIH,EAChD,KAAK,WAAaC,EAClB,KAAK,UAAY,IAAIG,EAAmBH,EAAW,UAAU,CAAC,EAE9D,KAAK,eAAiBC,GAAkBG,EAAiBC,EAAa,EAAIT,CAAoB,EAE9F,KAAK,QAAUM,IAAY,OAAYI,EAAI,aAAaJ,CAAO,EAAE,aAAa,EAAIK,EAAgB,EAElG,KAAK,MAAQ,KAAK,cAAc,CAClC,CAMA,cAAmC,CACjC,OAAO,KAAK,SACd,CAMA,WAAqB,CAEnB,OADgC,KAAK,MAAM,KAAK,IAAI,EAAI,GAAI,EACnC,KAAK,cAChC,CAEA,UAAUC,EAA8B,CACtCA,EAAW,sBAAsB,KAAK,UAAU,OAAO,EACvDA,EAAW,eAAe,KAAK,WAAW,aAAa,CAAC,EACxDA,EAAW,aAAa,KAAK,cAAc,EAC3CA,EAAW,oBAAoB,KAAK,OAAO,CAC7C,CAEA,OAAO,YAAYC,EAA8C,CAC/D,IAAMC,EAAeD,EAAa,wBAAwB,EACtDT,EACJ,OAAQU,EAAc,CACpB,OACEV,EAAaW,EAAkB,YAAYF,CAAY,EACvD,MACF,QACE,MAAM,IAAI,MAAM,iDAAiDC,CAAY,EAAE,CACnF,CACA,IAAMT,EAAiBQ,EAAa,eAAe,EAC7CP,EAAUO,EAAa,sBAAsB,EAAE,EACrD,OAAO,IAAIZ,EAAiB,CAAE,WAAAG,EAAY,eAAgB,OAAOC,CAAc,EAAG,QAAAC,CAAQ,CAAC,CAC7F,CAEA,OAAO,UAAUU,EAAqC,CACpD,OAAOf,EAAiB,YAAY,IAAIgB,EAAaD,CAAK,CAAC,CAC7D,CAQA,OAAO,SAASb,EAA0F,CACxG,IAAIC,EAEJ,OAAQD,GAAM,OAAQ,CACpB,OACA,QACEC,EAAaW,EAAkB,SAAS,CAC5C,CAEA,OAAO,IAAId,EAAiB,CAAE,WAAAG,EAAY,eAAgBD,GAAM,cAAe,CAAC,CAClF,CAMQ,eAAwB,CAC9B,IAAMe,EAASC,EAAuB,KAAK,UAAU,WAAW,EAAG,EAAE,EACrE,OAAAD,EAAO,KAAK,OAAO,KAAK,cAAc,CAAC,EACvCA,EAAO,KAAKE,EAAgB,KAAK,OAAO,CAAC,EACvBC,EAAaH,CAAM,EACpB,SAAS,CAC5B,CAOA,KAAKI,EAAoC,CACvC,GAAI,KAAK,UAAU,EACjB,MAAM,IAAI,MAAM,8BAA8B,EAEhD,OAAO,IAAIC,EAAmB,KAAK,WAAW,KAAKD,CAAI,CAAC,CAC1D,CACF,EAlIarB,EACK,eAAyB,GADpC,IAAMuB,EAANvB,EAwIP,SAASU,GAA8B,CACrC,OAAOc,EAAYD,EAAiB,cAAc,CACpD","names":["randomBytes","TWO_WEEKS_IN_SECONDS","_EphemeralKeyPair","Serializable","args","privateKey","expiryDateSecs","blinder","EphemeralPublicKey","floorToWholeHour","nowInSeconds","Hex","generateBlinder","serializer","deserializer","variantIndex","Ed25519PrivateKey","bytes","Deserializer","fields","padAndPackBytesWithLen","bytesToBigIntLE","poseidonHash","data","EphemeralSignature","EphemeralKeyPair","randomBytes"]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as r,c as o}from"./chunk-5SEAQESO.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-4W7T4HRZ.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 *\n * More documentation on how to integrate Keyless Accounts see the below\n * https://aptos.dev/guides/keyless-accounts/#aptos-keyless-integration-guide\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.proofFetchCallback a callback function that if set, the fetch of the proof will be done in the background. Once\n * fetching finishes the callback function will be called. This should be used to provide a more responsive user experience as now\n * they are not blocked on fetching the proof. Thus the function will return much more quickly.\n *\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 proofFetchCallback?: ProofFetchCallback;\n }): Promise<KeylessAccount> {\n return deriveKeylessAccount({ aptosConfig: this.config, ...args });\n }\n}\n"],"mappings":"gDAcO,IAAMA,EAAN,KAAc,CACnB,YAAqBC,EAAqB,CAArB,YAAAA,CAAsB,CAS3C,MAAM,UAAUC,EAAgF,CAC9F,OAAOC,EAAU,CAAE,YAAa,KAAK,OAAQ,GAAGD,CAAK,CAAC,CACxD,CAeA,MAAM,qBAAqBA,EAMC,CAC1B,OAAOE,EAAqB,CAAE,YAAa,KAAK,OAAQ,GAAGF,CAAK,CAAC,CACnE,CACF","names":["Keyless","config","args","getPepper","deriveKeylessAccount"]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as T}from"./chunk-37FFZSIM.mjs";import{a as w,b as m}from"./chunk-L5CPAOUM.mjs";import{a as h,c as v,d as B,e as P}from"./chunk-IVVWQKCF.mjs";import{a as I,c as V}from"./chunk-XVZBWW46.mjs";import{b as C}from"./chunk-WA2NTBYY.mjs";import{a as y}from"./chunk-4VPCPASN.mjs";import{a as U}from"./chunk-EFMAZTIM.mjs";import{b}from"./chunk-F3ZVWLDH.mjs";import{a as _}from"./chunk-AH44UPM4.mjs";import{b as A}from"./chunk-IBDBKQMF.mjs";import{a as E}from"./chunk-3IFR6T3V.mjs";import{a as d,b as H}from"./chunk-UMLUOYFK.mjs";import{b as u}from"./chunk-AOCNYMMX.mjs";import{jwtDecode as F}from"jwt-decode";var ge=1e7,L=120,N=30,O=330,fe=120,Se=350,xe=300,be=93,o=class o extends C{constructor(e,t){super();let a=u.fromHexInput(t).toUint8Array();if(a.length!==o.ID_COMMITMENT_LENGTH)throw new Error(`Id Commitment length in bytes should be ${o.ID_COMMITMENT_LENGTH}`);this.iss=e,this.idCommitment=a}authKey(){let e=new H;return e.serializeU32AsUleb128(3),e.serializeFixedBytes(this.bcsToBytes()),U.fromSchemeAndBytes({scheme:2,input:e.toUint8Array()})}toUint8Array(){return this.bcsToBytes()}toString(){return u.fromHexInput(this.toUint8Array()).toString()}verifySignature(e){throw new Error("Not yet implemented")}serialize(e){e.serializeStr(this.iss),e.serializeBytes(this.idCommitment)}static deserialize(e){let t=e.deserializeStr(),a=e.deserializeBytes();return new o(t,a)}static load(e){let t=e.deserializeStr(),a=e.deserializeBytes();return new o(t,a)}static isPublicKey(e){return e instanceof o}static create(e){return D(e),new o(e.iss,D(e))}static fromJWTAndPepper(e){let{jwt:t,pepper:a,uidKey:n="sub"}=e,s=F(t),c=s.iss;if(typeof s.aud!="string")throw new Error("aud was not found or an array of values");let R=s.aud,k=s[n];return o.create({iss:c,uidKey:n,uidVal:k,aud:R,pepper:a})}};o.ID_COMMITMENT_LENGTH=32;var z=o;function D(i){let{uidKey:r,uidVal:e,aud:t,pepper:a}=i,n=[v(u.fromHexInput(a).toUint8Array()),h(t,L),h(e,O),h(r,N)];return B(P(n),z.ID_COMMITMENT_LENGTH)}var M=class i extends y{constructor(e){super();let{jwtHeader:t,ephemeralCertificate:a,expiryDateSecs:n,ephemeralPublicKey:s,ephemeralSignature:c}=e;this.jwtHeader=t,this.ephemeralCertificate=a,this.expiryDateSecs=n,this.ephemeralPublicKey=s,this.ephemeralSignature=c}toUint8Array(){return this.bcsToBytes()}serialize(e){this.ephemeralCertificate.serialize(e),e.serializeStr(this.jwtHeader),e.serializeU64(this.expiryDateSecs),this.ephemeralPublicKey.serialize(e),this.ephemeralSignature.serialize(e)}static deserialize(e){let t=g.deserialize(e),a=e.deserializeStr(),n=e.deserializeU64(),s=w.deserialize(e),c=m.deserialize(e);return new i({jwtHeader:a,expiryDateSecs:Number(n),ephemeralCertificate:t,ephemeralPublicKey:s,ephemeralSignature:c})}static getSimulationSignature(){return new i({jwtHeader:"{}",ephemeralCertificate:new g(new x({proof:new S(new f({a:new Uint8Array(32),b:new Uint8Array(64),c:new Uint8Array(32)}),0),expHorizonSecs:0}),0),expiryDateSecs:0,ephemeralPublicKey:new w(new I(new Uint8Array(32))),ephemeralSignature:new m(new V(new Uint8Array(64)))})}static isSignature(e){return e instanceof i}},g=class i extends y{constructor(e,t){super();this.signature=e,this.variant=t}toUint8Array(){return this.signature.toUint8Array()}serialize(e){e.serializeU32AsUleb128(this.variant),this.signature.serialize(e)}static deserialize(e){let t=e.deserializeUleb128AsU32();switch(t){case 0:return new i(x.deserialize(e),t);default:throw new Error(`Unknown variant index for EphemeralCertificate: ${t}`)}}},l=class i extends d{constructor(e){super();if(this.data=u.fromHexInput(e).toUint8Array(),this.data.length!==32)throw new Error("Input needs to be 32 bytes")}serialize(e){e.serializeFixedBytes(this.data)}static deserialize(e){let t=e.deserializeFixedBytes(32);return new i(t)}},p=class i extends d{constructor(e){super();if(this.data=u.fromHexInput(e).toUint8Array(),this.data.length!==64)throw new Error("Input needs to be 64 bytes")}serialize(e){e.serializeFixedBytes(this.data)}static deserialize(e){let t=e.deserializeFixedBytes(64);return new i(t)}},f=class i extends T{constructor(e){super();let{a:t,b:a,c:n}=e;this.a=new l(t),this.b=new p(a),this.c=new l(n)}serialize(e){this.a.serialize(e),this.b.serialize(e),this.c.serialize(e)}static deserialize(e){let t=l.deserialize(e).bcsToBytes(),a=p.deserialize(e).bcsToBytes(),n=l.deserialize(e).bcsToBytes();return new i({a:t,b:a,c:n})}},S=class i extends d{constructor(e,t){super();this.proof=e,this.variant=t}serialize(e){e.serializeU32AsUleb128(this.variant),this.proof.serialize(e)}static deserialize(e){let t=e.deserializeUleb128AsU32();switch(t){case 0:return new i(f.deserialize(e),t);default:throw new Error(`Unknown variant index for ZkProof: ${t}`)}}},x=class i extends y{constructor(e){super();let{proof:t,expHorizonSecs:a,trainingWheelsSignature:n,extraField:s,overrideAudVal:c}=e;this.proof=t,this.expHorizonSecs=a,this.trainingWheelsSignature=n,this.extraField=s,this.overrideAudVal=c}toUint8Array(){return this.bcsToBytes()}static fromBytes(e){return i.deserialize(new E(e))}serialize(e){this.proof.serialize(e),e.serializeU64(this.expHorizonSecs),e.serializeOptionStr(this.extraField),e.serializeOptionStr(this.overrideAudVal),e.serializeOption(this.trainingWheelsSignature)}static deserialize(e){let t=S.deserialize(e),a=Number(e.deserializeU64()),n=e.deserializeOptionStr(),s=e.deserializeOptionStr(),c=e.deserializeOption(m);return new i({proof:t,expHorizonSecs:a,trainingWheelsSignature:c,extraField:n,overrideAudVal:s})}},K=class i{constructor(r,e){this.verficationKey=r,this.maxExpHorizonSecs=e}static create(r,e){return new i(new G({alphaG1:r.alpha_g1,betaG2:r.beta_g2,deltaG2:r.delta_g2,gammaAbcG1:r.gamma_abc_g1,gammaG2:r.gamma_g2}),e)}},G=class i{constructor(r){let{alphaG1:e,betaG2:t,deltaG2:a,gammaAbcG1:n,gammaG2:s}=r;this.alphaG1=new l(e),this.betaG2=new p(t),this.deltaG2=new p(a),this.gammaAbcG1=[new l(n[0]),new l(n[1])],this.gammaG2=new p(s)}static fromGroth16VerificationKeyResponse(r){return new i({alphaG1:r.alpha_g1,betaG2:r.beta_g2,deltaG2:r.delta_g2,gammaAbcG1:r.gamma_abc_g1,gammaG2:r.gamma_g2})}};async function we(i){let{aptosConfig:r}=i;return _(async()=>{let e=await j(i),t=await Z(i);return K.create(t,Number(e.max_exp_horizon_secs))},`keyless-configuration-${r.network}`,1e3*60*5)()}async function j(i){let{aptosConfig:r,options:e}=i,t="0x1::keyless_account::Configuration",{data:a}=await A({aptosConfig:r,originMethod:"getKeylessConfigurationResource",path:`accounts/${b.from("0x1").toString()}/resource/${t}`,params:{ledger_version:e?.ledgerVersion}});return a.data}async function Z(i){let{aptosConfig:r,options:e}=i,t="0x1::keyless_account::Groth16VerificationKey",{data:a}=await A({aptosConfig:r,originMethod:"getGroth16VerificationKeyResource",path:`accounts/${b.from("0x1").toString()}/resource/${t}`,params:{ledger_version:e?.ledgerVersion}});return a.data}export{ge as a,L as b,N as c,O as d,fe as e,Se as f,xe as g,be as h,z as i,M as j,g as k,f as l,S as m,x as n,K as o,we as p};
|
|
2
|
-
//# sourceMappingURL=chunk-54LCK6EN.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a}from"./chunk-IEVABWIO.mjs";import{l as g,m,n as y,p as d}from"./chunk-54LCK6EN.mjs";import{b as l}from"./chunk-L5CPAOUM.mjs";import{b as x}from"./chunk-YTQVMLFD.mjs";import{e as u,f as h}from"./chunk-2G4IGSGM.mjs";import{b as n}from"./chunk-AOCNYMMX.mjs";async function K(t){let{aptosConfig:r,jwt:e,ephemeralKeyPair:o,uidKey:p="sub",derivationPath:s}=t,i={jwt_b64:e,epk:o.getPublicKey().bcsToHex().toStringWithoutPrefix(),exp_date_secs:o.expiryDateSecs,epk_blinder:n.fromHexInput(o.blinder).toStringWithoutPrefix(),uid_key:p,derivation_path:s},{data:c}=await u({aptosConfig:r,path:"fetch",body:i,originMethod:"getPepper",overrides:{WITH_CREDENTIALS:!1}});return n.fromHexInput(c.pepper).toUint8Array()}async function w(t){let{aptosConfig:r,jwt:e,ephemeralKeyPair:o,pepper:p,uidKey:s="sub"}=t,{maxExpHorizonSecs:i}=await d({aptosConfig:r});if(i<o.expiryDateSecs-x())throw Error(`The EphemeralKeyPair is too long lived. It's lifespan must be less than ${i}`);let c={jwt_b64:e,epk:o.getPublicKey().bcsToHex().toStringWithoutPrefix(),epk_blinder:n.fromHexInput(o.blinder).toStringWithoutPrefix(),exp_date_secs:o.expiryDateSecs,exp_horizon_secs:i,pepper:n.fromHexInput(p).toStringWithoutPrefix(),uid_key:s},{data:P}=await h({aptosConfig:r,path:"prove",body:c,originMethod:"getProof",overrides:{WITH_CREDENTIALS:!1}}),f=P.proof,b=new g({a:f.a,b:f.b,c:f.c});return new y({proof:new m(b,0),trainingWheelsSignature:l.fromHex(P.training_wheels_signature),expHorizonSecs:i})}async function T(t){let{proofFetchCallback:r}=t,{pepper:e}=t;if(e===void 0?e=await K(t):e=n.fromHexInput(e).toUint8Array(),e.length!==a.PEPPER_LENGTH)throw new Error(`Pepper needs to be ${a.PEPPER_LENGTH} bytes`);let o=w({...t,pepper:e}),p=r?o:await o;return a.create({...t,proof:p,pepper:e,proofFetchCallback:r})}export{K as a,w as b,T as c};
|
|
2
|
-
//# sourceMappingURL=chunk-5SEAQESO.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 * keyless namespace and without having a dependency cycle error.\n */\nimport { AptosConfig } from \"../api/aptosConfig\";\nimport { postAptosPepperService, postAptosProvingService } from \"../client\";\nimport { EphemeralSignature, Groth16Zkp, Hex, ZeroKnowledgeSig, ZkProof, getKeylessConfig } from \"../core\";\nimport { HexInput, ZkpVariant } from \"../types\";\nimport { EphemeralKeyPair, KeylessAccount, ProofFetchCallback } from \"../account\";\nimport { PepperFetchRequest, PepperFetchResponse, ProverRequest, ProverResponse } from \"../types/keyless\";\nimport { nowInSeconds } from \"../utils/helpers\";\n\nexport async function getPepper(args: {\n aptosConfig: AptosConfig;\n jwt: string;\n ephemeralKeyPair: EphemeralKeyPair;\n uidKey?: string;\n derivationPath?: string;\n}): Promise<Uint8Array> {\n const { aptosConfig, jwt, ephemeralKeyPair, uidKey = \"sub\", derivationPath } = args;\n\n const body = {\n jwt_b64: jwt,\n epk: ephemeralKeyPair.getPublicKey().bcsToHex().toStringWithoutPrefix(),\n exp_date_secs: ephemeralKeyPair.expiryDateSecs,\n epk_blinder: Hex.fromHexInput(ephemeralKeyPair.blinder).toStringWithoutPrefix(),\n uid_key: uidKey,\n derivation_path: derivationPath,\n };\n const { data } = await postAptosPepperService<PepperFetchRequest, 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}): Promise<ZeroKnowledgeSig> {\n const { aptosConfig, jwt, ephemeralKeyPair, pepper, uidKey = \"sub\" } = args;\n const { maxExpHorizonSecs } = await getKeylessConfig({ aptosConfig });\n if (maxExpHorizonSecs < ephemeralKeyPair.expiryDateSecs - nowInSeconds()) {\n throw Error(`The EphemeralKeyPair is too long lived. It's lifespan must be less than ${maxExpHorizonSecs}`);\n }\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: ephemeralKeyPair.expiryDateSecs,\n exp_horizon_secs: maxExpHorizonSecs,\n pepper: Hex.fromHexInput(pepper).toStringWithoutPrefix(),\n uid_key: uidKey,\n };\n\n const { data } = await postAptosProvingService<ProverRequest, 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 const signedProof = new ZeroKnowledgeSig({\n proof: new ZkProof(groth16Zkp, ZkpVariant.Groth16),\n trainingWheelsSignature: EphemeralSignature.fromHex(data.training_wheels_signature),\n expHorizonSecs: maxExpHorizonSecs,\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 proofFetchCallback?: ProofFetchCallback;\n}): Promise<KeylessAccount> {\n const { proofFetchCallback } = args;\n let { pepper } = args;\n if (pepper === undefined) {\n pepper = await getPepper(args);\n } else {\n pepper = Hex.fromHexInput(pepper).toUint8Array();\n }\n\n if (pepper.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 // If a callback is provided, pass in the proof as a promise to KeylessAccount.create. This will make the proof be fetched in the\n // background and the callback will handle the outcome of the fetch. This allows the developer to not have to block on the proof fetch\n // allowing for faster rendering of UX.\n //\n // If no callback is provided, the just await the proof fetch and continue syncronously.\n const proof = proofFetchCallback ? proofPromise : await proofPromise;\n\n const keylessAccount = KeylessAccount.create({ ...args, proof, pepper, proofFetchCallback });\n\n return keylessAccount;\n}\n"],"mappings":"wQAiBA,eAAsBA,EAAUC,EAMR,CACtB,GAAM,CAAE,YAAAC,EAAa,IAAAC,EAAK,iBAAAC,EAAkB,OAAAC,EAAS,MAAO,eAAAC,CAAe,EAAIL,EAEzEM,EAAO,CACX,QAASJ,EACT,IAAKC,EAAiB,aAAa,EAAE,SAAS,EAAE,sBAAsB,EACtE,cAAeA,EAAiB,eAChC,YAAaI,EAAI,aAAaJ,EAAiB,OAAO,EAAE,sBAAsB,EAC9E,QAASC,EACT,gBAAiBC,CACnB,EACM,CAAE,KAAAG,CAAK,EAAI,MAAMC,EAAgE,CACrF,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,EAMD,CAC5B,GAAM,CAAE,YAAAC,EAAa,IAAAC,EAAK,iBAAAC,EAAkB,OAAAQ,EAAQ,OAAAP,EAAS,KAAM,EAAIJ,EACjE,CAAE,kBAAAY,CAAkB,EAAI,MAAMC,EAAiB,CAAE,YAAAZ,CAAY,CAAC,EACpE,GAAIW,EAAoBT,EAAiB,eAAiBW,EAAa,EACrE,MAAM,MAAM,4EAA4EF,CAAiB,EAAE,EAE7G,IAAMG,EAAO,CACX,QAASb,EACT,IAAKC,EAAiB,aAAa,EAAE,SAAS,EAAE,sBAAsB,EACtE,YAAaI,EAAI,aAAaJ,EAAiB,OAAO,EAAE,sBAAsB,EAC9E,cAAeA,EAAiB,eAChC,iBAAkBS,EAClB,OAAQL,EAAI,aAAaI,CAAM,EAAE,sBAAsB,EACvD,QAASP,CACX,EAEM,CAAE,KAAAI,CAAK,EAAI,MAAMQ,EAAuD,CAC5E,YAAAf,EACA,KAAM,QACN,KAAMc,EACN,aAAc,WACd,UAAW,CAAE,iBAAkB,EAAM,CACvC,CAAC,EAEKE,EAAcT,EAAK,MACnBU,EAAa,IAAIC,EAAW,CAChC,EAAGF,EAAY,EACf,EAAGA,EAAY,EACf,EAAGA,EAAY,CACjB,CAAC,EAOD,OALoB,IAAIG,EAAiB,CACvC,MAAO,IAAIC,EAAQH,GAA8B,EACjD,wBAAyBI,EAAmB,QAAQd,EAAK,yBAAyB,EAClF,eAAgBI,CAClB,CAAC,CAEH,CAEA,eAAsBW,EAAqBvB,EAOf,CAC1B,GAAM,CAAE,mBAAAwB,CAAmB,EAAIxB,EAC3B,CAAE,OAAAW,CAAO,EAAIX,EAOjB,GANIW,IAAW,OACbA,EAAS,MAAMZ,EAAUC,CAAI,EAE7BW,EAASJ,EAAI,aAAaI,CAAM,EAAE,aAAa,EAG7CA,EAAO,SAAWc,EAAe,cACnC,MAAM,IAAI,MAAM,sBAAsBA,EAAe,aAAa,QAAQ,EAG5E,IAAMC,EAAehB,EAAS,CAAE,GAAGV,EAAM,OAAAW,CAAO,CAAC,EAM3CgB,EAAQH,EAAqBE,EAAe,MAAMA,EAIxD,OAFuBD,EAAe,OAAO,CAAE,GAAGzB,EAAM,MAAA2B,EAAO,OAAAhB,EAAQ,mBAAAa,CAAmB,CAAC,CAG7F","names":["getPepper","args","aptosConfig","jwt","ephemeralKeyPair","uidKey","derivationPath","body","Hex","data","postAptosPepperService","getProof","pepper","maxExpHorizonSecs","getKeylessConfig","nowInSeconds","json","postAptosProvingService","proofPoints","groth16Zkp","Groth16Zkp","ZeroKnowledgeSig","ZkProof","EphemeralSignature","deriveKeylessAccount","proofFetchCallback","KeylessAccount","proofPromise","proof"]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as r}from"./chunk-UMLUOYFK.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-7BW2N4IE.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as m}from"./chunk-MLX6DFMR.mjs";import{a as g}from"./chunk-TUCCV62K.mjs";import{a as p}from"./chunk-GSCM444Z.mjs";import{b as y}from"./chunk-F3ZVWLDH.mjs";import{a as S}from"./chunk-GRHLQDHF.mjs";import{a as v}from"./chunk-FGGRPEQ3.mjs";import{a as F,b as d,c as T,d as x,e as E,f as _,g as w}from"./chunk-IBN7ETCB.mjs";import{a as u}from"./chunk-UMLUOYFK.mjs";function D(r){let e=r.deserializeUleb128AsU32();switch(e){case 0:return d.deserialize(r);case 1:return E.deserialize(r);case 2:return _.deserialize(r);case 3:return y.deserialize(r);case 4:return v.deserialize(r,d);case 5:return F.deserialize(r);case 6:return T.deserialize(r);case 7:return x.deserialize(r);case 8:return w.deserialize(r);default:throw new Error(`Unknown variant index for ScriptTransactionArgument: ${e}`)}}var a=class extends u{static deserialize(e){let t=e.deserializeUleb128AsU32();switch(t){case 0:return A.load(e);case 2:return z.load(e);case 3:return h.load(e);default:throw new Error(`Unknown variant index for TransactionPayload: ${t}`)}}},A=class r extends a{constructor(t){super();this.script=t}serialize(t){t.serializeU32AsUleb128(0),this.script.serialize(t)}static load(t){let i=U.deserialize(t);return new r(i)}},z=class r extends a{constructor(t){super();this.entryFunction=t}serialize(t){t.serializeU32AsUleb128(2),this.entryFunction.serialize(t)}static load(t){let i=l.deserialize(t);return new r(i)}},h=class r extends a{constructor(t){super();this.multiSig=t}serialize(t){t.serializeU32AsUleb128(3),this.multiSig.serialize(t)}static load(t){let i=f.deserialize(t);return new r(i)}},l=class r{constructor(e,t,i,n){this.module_name=e,this.function_name=t,this.type_args=i,this.args=n}static build(e,t,i,n){return new r(g.fromStr(e),new p(t),i,n)}serialize(e){this.module_name.serialize(e),this.function_name.serialize(e),e.serializeVector(this.type_args),e.serializeU32AsUleb128(this.args.length),this.args.forEach(t=>{t.serializeForEntryFunction(e)})}static deserialize(e){let t=g.deserialize(e),i=p.deserialize(e),n=e.deserializeVector(m),o=e.deserializeUleb128AsU32(),s=new Array;for(let c=0;c<o;c+=1){let M=e.deserializeUleb128AsU32(),B=S.deserialize(e,M);s.push(B)}return new r(t,i,n,s)}},U=class r{constructor(e,t,i){this.bytecode=e,this.type_args=t,this.args=i}serialize(e){e.serializeBytes(this.bytecode),e.serializeVector(this.type_args),e.serializeU32AsUleb128(this.args.length),this.args.forEach(t=>{t.serializeForScriptFunction(e)})}static deserialize(e){let t=e.deserializeBytes(),i=e.deserializeVector(m),n=e.deserializeUleb128AsU32(),o=new Array;for(let s=0;s<n;s+=1){let c=D(e);o.push(c)}return new r(t,i,o)}},f=class r{constructor(e,t){this.multisig_address=e,this.transaction_payload=t}serialize(e){this.multisig_address.serialize(e),this.transaction_payload===void 0?e.serializeBool(!1):(e.serializeBool(!0),this.transaction_payload.serialize(e))}static deserialize(e){let t=y.deserialize(e),i=e.deserializeBool(),n;return i&&(n=b.deserialize(e)),new r(t,n)}},b=class r extends u{constructor(t){super();this.transaction_payload=t}serialize(t){t.serializeU32AsUleb128(0),this.transaction_payload.serialize(t)}static deserialize(t){return t.deserializeUleb128AsU32(),new r(l.deserialize(t))}};export{D as a,a as b,A as c,z as d,h as e,l as f,U as g,f as h,b as i};
|
|
2
|
-
//# sourceMappingURL=chunk-FIG65OJD.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/transactions/transactionBuilder/signingMessage.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * This file handles the generation of the signing message.\n */\nimport { sha3_256 as sha3Hash } from \"@noble/hashes/sha3\";\nimport { RAW_TRANSACTION_SALT, RAW_TRANSACTION_WITH_DATA_SALT } from \"../../utils/const\";\nimport { FeePayerRawTransaction, MultiAgentRawTransaction } from \"../instances\";\nimport { AnyRawTransaction, AnyRawTransactionInstance } from \"../types\";\nimport { Serializable } from \"../../bcs/serializer\";\n\n/**\n * Derive the raw transaction type - FeePayerRawTransaction or MultiAgentRawTransaction or RawTransaction\n *\n * @param transaction A aptos transaction type\n *\n * @returns FeePayerRawTransaction | MultiAgentRawTransaction | RawTransaction\n */\nexport function deriveTransactionType(transaction: AnyRawTransaction): AnyRawTransactionInstance {\n if (transaction.feePayerAddress) {\n return new FeePayerRawTransaction(\n transaction.rawTransaction,\n transaction.secondarySignerAddresses ?? [],\n transaction.feePayerAddress,\n );\n }\n if (transaction.secondarySignerAddresses) {\n return new MultiAgentRawTransaction(transaction.rawTransaction, transaction.secondarySignerAddresses);\n }\n\n return transaction.rawTransaction;\n}\n\n/**\n * Generates the 'signing message' form of a message to be signed.\n *\n * @param bytes The byte representation of the message to be signed and sent to the chain\n * @param domainSeparator A domain separator that starts with 'APTOS::'\n *\n * @returns The Uint8Array of the signing message\n */\nexport function generateSigningMessage(bytes: Uint8Array, domainSeparator: string): Uint8Array {\n const hash = sha3Hash.create();\n\n if (!domainSeparator.startsWith(\"APTOS::\")) {\n throw new Error(`Domain separator needs to start with 'APTOS::'. Provided - ${domainSeparator}`);\n }\n\n hash.update(domainSeparator);\n\n const prefix = hash.digest();\n\n const body = bytes;\n\n const mergedArray = new Uint8Array(prefix.length + body.length);\n mergedArray.set(prefix);\n mergedArray.set(body, prefix.length);\n\n return mergedArray;\n}\n\n/**\n * @deprected\n * Use CryptoHashable instead by having your class implement it and call hash() to get the signing message.\n *\n * Generates the 'signing message' form of a serilizable value. It bcs serializes the value and uses the name of\n * its constructor as the domain separator.\n *\n * @param serializable An object that has a bcs serialized form\n *\n * @returns The Uint8Array of the signing message\n */\nexport function generateSigningMessageForSerializable(serializable: Serializable): Uint8Array {\n return generateSigningMessage(serializable.bcsToBytes(), `APTOS::${serializable.constructor.name}`);\n}\n\n/**\n * Generates the 'signing message' form of a transaction. It derives the type of transaction and\n * applies the appropriate domain separator based on if there is extra data such as a fee payer or\n * secondary signers.\n *\n * @param transaction A transaction that is to be signed\n *\n * @returns The Uint8Array of the signing message\n */\nexport function generateSigningMessageForTransaction(transaction: AnyRawTransaction): Uint8Array {\n const rawTxn = deriveTransactionType(transaction);\n if (transaction.feePayerAddress) {\n return generateSigningMessage(rawTxn.bcsToBytes(), RAW_TRANSACTION_WITH_DATA_SALT);\n }\n if (transaction.secondarySignerAddresses) {\n return generateSigningMessage(rawTxn.bcsToBytes(), RAW_TRANSACTION_WITH_DATA_SALT);\n }\n return generateSigningMessage(rawTxn.bcsToBytes(), RAW_TRANSACTION_SALT);\n}\n"],"mappings":"gGAMA,OAAS,YAAYA,MAAgB,qBAa9B,SAASC,EAAsBC,EAA2D,CAC/F,OAAIA,EAAY,gBACP,IAAIC,EACTD,EAAY,eACZA,EAAY,0BAA4B,CAAC,EACzCA,EAAY,eACd,EAEEA,EAAY,yBACP,IAAIE,EAAyBF,EAAY,eAAgBA,EAAY,wBAAwB,EAG/FA,EAAY,cACrB,CAUO,SAASG,EAAuBC,EAAmBC,EAAqC,CAC7F,IAAMC,EAAOC,EAAS,OAAO,EAE7B,GAAI,CAACF,EAAgB,WAAW,SAAS,EACvC,MAAM,IAAI,MAAM,+DAA+DA,CAAe,EAAE,EAGlGC,EAAK,OAAOD,CAAe,EAE3B,IAAMG,EAASF,EAAK,OAAO,EAErBG,EAAOL,EAEPM,EAAc,IAAI,WAAWF,EAAO,OAASC,EAAK,MAAM,EAC9D,OAAAC,EAAY,IAAIF,CAAM,EACtBE,EAAY,IAAID,EAAMD,EAAO,MAAM,EAE5BE,CACT,CAaO,SAASC,EAAsCC,EAAwC,CAC5F,OAAOT,EAAuBS,EAAa,WAAW,EAAG,UAAUA,EAAa,YAAY,IAAI,EAAE,CACpG,CAWO,SAASC,EAAqCb,EAA4C,CAC/F,IAAMc,EAASf,EAAsBC,CAAW,EAChD,OAAIA,EAAY,gBACPG,EAAuBW,EAAO,WAAW,EAAGC,CAA8B,EAE/Ef,EAAY,yBACPG,EAAuBW,EAAO,WAAW,EAAGC,CAA8B,EAE5EZ,EAAuBW,EAAO,WAAW,EAAGE,CAAoB,CACzE","names":["sha3Hash","deriveTransactionType","transaction","FeePayerRawTransaction","MultiAgentRawTransaction","generateSigningMessage","bytes","domainSeparator","hash","sha3Hash","prefix","body","mergedArray","generateSigningMessageForSerializable","serializable","generateSigningMessageForTransaction","rawTxn","RAW_TRANSACTION_WITH_DATA_SALT","RAW_TRANSACTION_SALT"]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as i}from"./chunk-7BW2N4IE.mjs";import{a as r}from"./chunk-UMLUOYFK.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-GRHLQDHF.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as b,b as p}from"./chunk-SNDFJWYM.mjs";import{a as z,b as A}from"./chunk-ZV5MKFV7.mjs";import{a as g,b as h}from"./chunk-4CUDBBTC.mjs";import{a as y,c as d}from"./chunk-XVZBWW46.mjs";import{a as o}from"./chunk-UMLUOYFK.mjs";var u=class extends o{static deserialize(t){let i=t.deserializeUleb128AsU32();switch(i){case 0:return l.load(t);case 1:return n.load(t);case 2:return a.load(t);case 3:return c.load(t);default:throw new Error(`Unknown variant index for AccountAuthenticator: ${i}`)}}isEd25519(){return this instanceof l}isMultiEd25519(){return this instanceof n}isSingleKey(){return this instanceof a}isMultiKey(){return this instanceof c}},l=class s extends u{constructor(i,e){super();this.public_key=i,this.signature=e}serialize(i){i.serializeU32AsUleb128(0),this.public_key.serialize(i),this.signature.serialize(i)}static load(i){let e=y.deserialize(i),r=d.deserialize(i);return new s(e,r)}},n=class s extends u{constructor(i,e){super();this.public_key=i,this.signature=e}serialize(i){i.serializeU32AsUleb128(1),this.public_key.serialize(i),this.signature.serialize(i)}static load(i){let e=b.deserialize(i),r=p.deserialize(i);return new s(e,r)}},a=class s extends u{constructor(i,e){super();this.public_key=i,this.signature=e}serialize(i){i.serializeU32AsUleb128(2),this.public_key.serialize(i),this.signature.serialize(i)}static load(i){let e=g.deserialize(i),r=h.deserialize(i);return new s(e,r)}},c=class s extends u{constructor(i,e){super();this.public_keys=i,this.signatures=e}serialize(i){i.serializeU32AsUleb128(3),this.public_keys.serialize(i),this.signatures.serialize(i)}static load(i){let e=z.deserialize(i),r=A.deserialize(i);return new s(e,r)}};export{u as a,l as b,n as c,a as d,c as e};
|
|
2
|
-
//# sourceMappingURL=chunk-HP6YVTTT.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as s,c as d,e as t}from"./chunk-UMLUOYFK.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-IBN7ETCB.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as v}from"./chunk-YD5IB4TH.mjs";import{a as x}from"./chunk-474YDCFP.mjs";import{a as E}from"./chunk-FR6UGCOX.mjs";import{d as y}from"./chunk-HP6YVTTT.mjs";import{a as u,b as f}from"./chunk-4CUDBBTC.mjs";import{i as S,j as F,k as A,n as d}from"./chunk-54LCK6EN.mjs";import{b as K}from"./chunk-F3ZVWLDH.mjs";import{d as b}from"./chunk-YTQVMLFD.mjs";import{a as g}from"./chunk-3IFR6T3V.mjs";import{a as w}from"./chunk-UMLUOYFK.mjs";import{b as P}from"./chunk-AOCNYMMX.mjs";import{jwtDecode as H}from"jwt-decode";import Z from"eventemitter3";var n=class n extends w{constructor(e){super();let{address:r,ephemeralKeyPair:t,uidKey:i,uidVal:a,aud:s,pepper:h,proofOrFetcher:o,proofFetchCallback:c,jwt:l}=e;if(this.ephemeralKeyPair=t,this.publicKey=S.create(e),this.accountAddress=r?K.from(r):this.publicKey.authKey().derivedAddress(),this.uidKey=i,this.uidVal=a,this.aud=s,this.jwt=l,this.emitter=new Z,this.proofOrPromise=o,o instanceof d)this.proof=o;else{if(c===void 0)throw new Error("Must provide callback for async proof fetch");this.emitter.on("proofFetchFinish",async z=>{await c(z),this.emitter.removeAllListeners()}),this.init(o)}this.signingScheme=2;let p=P.fromHexInput(h).toUint8Array();if(p.length!==n.PEPPER_LENGTH)throw new Error(`Pepper length in bytes should be ${n.PEPPER_LENGTH}`);this.pepper=p}async init(e){try{this.proof=await e,this.emitter.emit("proofFetchFinish",{status:"Success"})}catch(r){r instanceof Error?this.emitter.emit("proofFetchFinish",{status:"Failed",error:r.toString()}):this.emitter.emit("proofFetchFinish",{status:"Failed",error:"Unknown"})}}serialize(e){if(e.serializeStr(this.jwt),e.serializeStr(this.uidKey),e.serializeFixedBytes(this.pepper),this.ephemeralKeyPair.serialize(e),this.proof===void 0)throw new Error("Connot serialize - proof undefined");this.proof.serialize(e)}static deserialize(e){let r=e.deserializeStr(),t=e.deserializeStr(),i=e.deserializeFixedBytes(31),a=x.deserialize(e),s=d.deserialize(e);return n.create({proof:s,pepper:i,uidKey:t,jwt:r,ephemeralKeyPair:a})}isExpired(){return this.ephemeralKeyPair.isExpired()}signWithAuthenticator(e){let r=new f(this.sign(e)),t=new u(this.publicKey);return new y(t,r)}signTransactionWithAuthenticator(e){let r=new f(this.signTransaction(e)),t=new u(this.publicKey);return new y(t,r)}async waitForProofFetch(){this.proofOrPromise instanceof Promise&&await this.proofOrPromise}sign(e){let{expiryDateSecs:r}=this.ephemeralKeyPair;if(this.isExpired())throw new Error("EphemeralKeyPair is expired");if(this.proof===void 0)throw new Error("Proof not defined");let t=this.ephemeralKeyPair.getPublicKey(),i=this.ephemeralKeyPair.sign(e);return new F({jwtHeader:b(this.jwt.split(".")[0]),ephemeralCertificate:new A(this.proof,0),expiryDateSecs:r,ephemeralPublicKey:t,ephemeralSignature:i})}signTransaction(e){if(this.proof===void 0)throw new Error("Proof not found");let r=E(e),i=new m(r,this.proof.proof).hash();return this.sign(i)}verifySignature(e){throw new Error("Not implemented")}static fromBytes(e){return n.deserialize(new g(e))}static create(e){let{proof:r,jwt:t,ephemeralKeyPair:i,pepper:a,uidKey:s="sub",proofFetchCallback:h}=e,o=H(t),c=o.iss;if(typeof o.aud!="string")throw new Error("aud was not found or an array of values");let l=o.aud,p=o[s];return new n({proofOrFetcher:r,ephemeralKeyPair:i,iss:c,uidKey:s,uidVal:p,aud:l,pepper:a,jwt:t,proofFetchCallback:h})}};n.PEPPER_LENGTH=31;var T=n,m=class extends v{constructor(e,r){super();this.transaction=e,this.proof=r,this.domainSeparator="APTOS::TransactionAndProof"}serialize(e){e.serializeFixedBytes(this.transaction.bcsToBytes()),e.serializeOption(this.proof)}};export{T as a,m as b};
|
|
2
|
-
//# sourceMappingURL=chunk-IEVABWIO.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/account/KeylessAccount.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { JwtPayload, jwtDecode } from \"jwt-decode\";\nimport EventEmitter from \"eventemitter3\";\nimport { EphemeralCertificateVariant, HexInput, SigningScheme } from \"../types\";\nimport { AccountAddress } from \"../core/accountAddress\";\nimport {\n AnyPublicKey,\n AnySignature,\n KeylessPublicKey,\n KeylessSignature,\n EphemeralCertificate,\n Signature,\n ZeroKnowledgeSig,\n ZkProof,\n} from \"../core/crypto\";\n\nimport { Account } from \"./Account\";\nimport { EphemeralKeyPair } from \"./EphemeralKeyPair\";\nimport { Hex } from \"../core/hex\";\nimport { AccountAuthenticatorSingleKey } from \"../transactions/authenticator/account\";\nimport { Deserializer, Serializable, Serializer } from \"../bcs\";\nimport { deriveTransactionType } from \"../transactions/transactionBuilder/signingMessage\";\nimport { AnyRawTransaction, AnyRawTransactionInstance } from \"../transactions/types\";\nimport { AptsoDomainSeparator, CryptoHashable } from \"../core/crypto/cryptoHashable\";\nimport { base64UrlDecode } from \"../utils/helpers\";\n\n/**\n * Account implementation for the Keyless authentication scheme.\n *\n * Used to represent a Keyless based account and sign transactions with it.\n *\n * Use KeylessAccount.fromJWTAndProof to instantiate a KeylessAccount with a JWT, proof and EphemeralKeyPair.\n *\n * When the proof expires or the JWT becomes invalid, the KeylessAccount must be instantiated again with a new JWT,\n * EphemeralKeyPair, and corresponding proof.\n */\nexport class KeylessAccount extends Serializable implements Account {\n static readonly PEPPER_LENGTH: number = 31;\n\n /**\n * The KeylessPublicKey associated with the account\n */\n readonly publicKey: KeylessPublicKey;\n\n /**\n * The EphemeralKeyPair used to generate sign.\n */\n readonly ephemeralKeyPair: EphemeralKeyPair;\n\n /**\n * The claim on the JWT to identify a user. This is typically 'sub' or 'email'.\n */\n readonly uidKey: string;\n\n /**\n * The value of the uidKey claim on the JWT. This intended to be a stable user identifier.\n */\n readonly uidVal: string;\n\n /**\n * The value of the 'aud' claim on the JWT, also known as client ID. This is the identifier for the dApp's\n * OIDC registration with the identity provider.\n */\n readonly aud: string;\n\n /**\n * A value contains 31 bytes of entropy that preserves privacy of the account. Typically fetched from a pepper provider.\n */\n readonly pepper: Uint8Array;\n\n /**\n * Account address associated with the account\n */\n readonly accountAddress: AccountAddress;\n\n /**\n * The zero knowledge signature (if ready) which contains the proof used to validate the EphemeralKeyPair.\n */\n proof: ZeroKnowledgeSig | undefined;\n\n /**\n * The proof of the EphemeralKeyPair or a promise that provides the proof. This is used to allow for awaiting on\n * fetching the proof.\n */\n readonly proofOrPromise: ZeroKnowledgeSig | Promise<ZeroKnowledgeSig>;\n\n /**\n * Signing scheme used to sign transactions\n */\n readonly signingScheme: SigningScheme;\n\n /**\n * The JWT token used to derive the account\n */\n readonly jwt: string;\n\n /**\n * An event emitter used to assist in handling asycronous proof fetching.\n */\n private readonly emitter: EventEmitter<ProofFetchEvents>;\n\n constructor(args: {\n address?: AccountAddress;\n ephemeralKeyPair: EphemeralKeyPair;\n iss: string;\n uidKey: string;\n uidVal: string;\n aud: string;\n pepper: HexInput;\n proofOrFetcher: ZeroKnowledgeSig | Promise<ZeroKnowledgeSig>;\n proofFetchCallback?: ProofFetchCallback;\n jwt: string;\n }) {\n super();\n const { address, ephemeralKeyPair, uidKey, uidVal, aud, pepper, proofOrFetcher, proofFetchCallback, jwt } = args;\n this.ephemeralKeyPair = ephemeralKeyPair;\n this.publicKey = KeylessPublicKey.create(args);\n this.accountAddress = address ? AccountAddress.from(address) : this.publicKey.authKey().derivedAddress();\n this.uidKey = uidKey;\n this.uidVal = uidVal;\n this.aud = aud;\n this.jwt = jwt;\n this.emitter = new EventEmitter<ProofFetchEvents>();\n this.proofOrPromise = proofOrFetcher;\n if (proofOrFetcher instanceof ZeroKnowledgeSig) {\n this.proof = proofOrFetcher;\n } else {\n if (proofFetchCallback === undefined) {\n throw new Error(\"Must provide callback for async proof fetch\");\n }\n this.emitter.on(\"proofFetchFinish\", async (status) => {\n await proofFetchCallback(status);\n this.emitter.removeAllListeners();\n });\n this.init(proofOrFetcher);\n }\n this.signingScheme = SigningScheme.SingleKey;\n const pepperBytes = Hex.fromHexInput(pepper).toUint8Array();\n if (pepperBytes.length !== KeylessAccount.PEPPER_LENGTH) {\n throw new Error(`Pepper length in bytes should be ${KeylessAccount.PEPPER_LENGTH}`);\n }\n this.pepper = pepperBytes;\n }\n\n /**\n * This initializes the asyncronous proof fetch\n * @return\n */\n async init(promise: Promise<ZeroKnowledgeSig>) {\n try {\n this.proof = await promise;\n this.emitter.emit(\"proofFetchFinish\", { status: \"Success\" });\n } catch (error) {\n if (error instanceof Error) {\n this.emitter.emit(\"proofFetchFinish\", { status: \"Failed\", error: error.toString() });\n } else {\n this.emitter.emit(\"proofFetchFinish\", { status: \"Failed\", error: \"Unknown\" });\n }\n }\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeStr(this.jwt);\n serializer.serializeStr(this.uidKey);\n serializer.serializeFixedBytes(this.pepper);\n this.ephemeralKeyPair.serialize(serializer);\n if (this.proof === undefined) {\n throw new Error(\"Connot serialize - proof undefined\");\n }\n this.proof.serialize(serializer);\n }\n\n static deserialize(deserializer: Deserializer): KeylessAccount {\n const jwt = deserializer.deserializeStr();\n const uidKey = deserializer.deserializeStr();\n const pepper = deserializer.deserializeFixedBytes(31);\n const ephemeralKeyPair = EphemeralKeyPair.deserialize(deserializer);\n const proof = ZeroKnowledgeSig.deserialize(deserializer);\n return KeylessAccount.create({\n proof,\n pepper,\n uidKey,\n jwt,\n ephemeralKeyPair,\n });\n }\n\n /**\n * Checks if the proof is expired. If so the account must be rederived with a new EphemeralKeyPair\n * and JWT token.\n * @return boolean\n */\n isExpired(): boolean {\n return this.ephemeralKeyPair.isExpired();\n }\n\n /**\n * Sign a message using Keyless.\n * @param message the message to sign, as binary input\n * @return the AccountAuthenticator containing the signature, together with the account's public key\n */\n signWithAuthenticator(message: HexInput): AccountAuthenticatorSingleKey {\n const signature = new AnySignature(this.sign(message));\n const publicKey = new AnyPublicKey(this.publicKey);\n return new AccountAuthenticatorSingleKey(publicKey, signature);\n }\n\n /**\n * Sign a transaction using Keyless.\n * @param transaction the raw transaction\n * @return the AccountAuthenticator containing the signature of the transaction, together with the account's public key\n */\n signTransactionWithAuthenticator(transaction: AnyRawTransaction): AccountAuthenticatorSingleKey {\n const signature = new AnySignature(this.signTransaction(transaction));\n const publicKey = new AnyPublicKey(this.publicKey);\n return new AccountAuthenticatorSingleKey(publicKey, signature);\n }\n\n /**\n * Waits for asyncronous proof fetching to finish.\n * @return\n */\n async waitForProofFetch() {\n if (this.proofOrPromise instanceof Promise) {\n await this.proofOrPromise;\n }\n }\n\n /**\n * Sign the given message using Keyless.\n * @param message in HexInput format\n * @returns Signature\n */\n sign(data: HexInput): KeylessSignature {\n const { expiryDateSecs } = this.ephemeralKeyPair;\n if (this.isExpired()) {\n throw new Error(\"EphemeralKeyPair is expired\");\n }\n if (this.proof === undefined) {\n throw new Error(\"Proof not defined\");\n }\n const ephemeralPublicKey = this.ephemeralKeyPair.getPublicKey();\n const ephemeralSignature = this.ephemeralKeyPair.sign(data);\n\n return new KeylessSignature({\n jwtHeader: base64UrlDecode(this.jwt.split(\".\")[0]),\n ephemeralCertificate: new EphemeralCertificate(this.proof, EphemeralCertificateVariant.ZkProof),\n expiryDateSecs,\n ephemeralPublicKey,\n ephemeralSignature,\n });\n }\n\n /**\n * Sign the given transaction with Keyless.\n * Signs the transaction and proof to guard against proof malleability.\n * @param transaction the transaction to be signed\n * @returns KeylessSignature\n */\n signTransaction(transaction: AnyRawTransaction): KeylessSignature {\n if (this.proof === undefined) {\n throw new Error(\"Proof not found\");\n }\n const raw = deriveTransactionType(transaction);\n const txnAndProof = new TransactionAndProof(raw, this.proof.proof);\n const signMess = txnAndProof.hash();\n return this.sign(signMess);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars, class-methods-use-this\n verifySignature(args: { message: HexInput; signature: Signature }): boolean {\n throw new Error(\"Not implemented\");\n }\n\n static fromBytes(bytes: Uint8Array): KeylessAccount {\n return KeylessAccount.deserialize(new Deserializer(bytes));\n }\n\n static create(args: {\n proof: ZeroKnowledgeSig | Promise<ZeroKnowledgeSig>;\n jwt: string;\n ephemeralKeyPair: EphemeralKeyPair;\n pepper: HexInput;\n uidKey?: string;\n proofFetchCallback?: ProofFetchCallback;\n }): KeylessAccount {\n const { proof, jwt, ephemeralKeyPair, pepper, uidKey = \"sub\", proofFetchCallback } = args;\n\n const jwtPayload = jwtDecode<JwtPayload & { [key: string]: string }>(jwt);\n const iss = jwtPayload.iss!;\n if (typeof jwtPayload.aud !== \"string\") {\n throw new Error(\"aud was not found or an array of values\");\n }\n const aud = jwtPayload.aud!;\n const uidVal = jwtPayload[uidKey];\n return new KeylessAccount({\n proofOrFetcher: proof,\n ephemeralKeyPair,\n iss,\n uidKey,\n uidVal,\n aud,\n pepper,\n jwt,\n proofFetchCallback,\n });\n }\n}\n\n/**\n * A container class to hold a transaction and a proof. It implements CryptoHashable which is used to create\n * the signing message for Keyless transactions. We sign over the proof to ensure non-malleability.\n */\nexport class TransactionAndProof extends CryptoHashable {\n /**\n * The transaction to sign.\n */\n transaction: AnyRawTransactionInstance;\n\n /**\n * The zero knowledge proof used in signing the transaction.\n */\n proof?: ZkProof;\n\n /**\n * The domain separator prefix used when hashing.\n */\n domainSeparator: AptsoDomainSeparator;\n\n constructor(transaction: AnyRawTransactionInstance, proof?: ZkProof) {\n super();\n this.transaction = transaction;\n this.proof = proof;\n this.domainSeparator = \"APTOS::TransactionAndProof\";\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeFixedBytes(this.transaction.bcsToBytes());\n serializer.serializeOption(this.proof);\n }\n}\n\nexport type ProofFetchSuccess = {\n status: \"Success\";\n};\n\nexport type ProofFetchFailure = {\n status: \"Failed\";\n error: string;\n};\n\nexport type ProofFetchStatus = ProofFetchSuccess | ProofFetchFailure;\n\nexport type ProofFetchCallback = (status: ProofFetchStatus) => Promise<void>;\n\nexport interface ProofFetchEvents {\n proofFetchFinish: (status: ProofFetchStatus) => void;\n}\n"],"mappings":"+dAGA,OAAqB,aAAAA,MAAiB,aACtC,OAAOC,MAAkB,gBAkClB,IAAMC,EAAN,MAAMA,UAAuBC,CAAgC,CAiElE,YAAYC,EAWT,CACD,MAAM,EACN,GAAM,CAAE,QAAAC,EAAS,iBAAAC,EAAkB,OAAAC,EAAQ,OAAAC,EAAQ,IAAAC,EAAK,OAAAC,EAAQ,eAAAC,EAAgB,mBAAAC,EAAoB,IAAAC,CAAI,EAAIT,EAU5G,GATA,KAAK,iBAAmBE,EACxB,KAAK,UAAYQ,EAAiB,OAAOV,CAAI,EAC7C,KAAK,eAAiBC,EAAUU,EAAe,KAAKV,CAAO,EAAI,KAAK,UAAU,QAAQ,EAAE,eAAe,EACvG,KAAK,OAASE,EACd,KAAK,OAASC,EACd,KAAK,IAAMC,EACX,KAAK,IAAMI,EACX,KAAK,QAAU,IAAIG,EACnB,KAAK,eAAiBL,EAClBA,aAA0BM,EAC5B,KAAK,MAAQN,MACR,CACL,GAAIC,IAAuB,OACzB,MAAM,IAAI,MAAM,6CAA6C,EAE/D,KAAK,QAAQ,GAAG,mBAAoB,MAAOM,GAAW,CACpD,MAAMN,EAAmBM,CAAM,EAC/B,KAAK,QAAQ,mBAAmB,CAClC,CAAC,EACD,KAAK,KAAKP,CAAc,CAC1B,CACA,KAAK,cAAgB,EACrB,IAAMQ,EAAcC,EAAI,aAAaV,CAAM,EAAE,aAAa,EAC1D,GAAIS,EAAY,SAAWjB,EAAe,cACxC,MAAM,IAAI,MAAM,oCAAoCA,EAAe,aAAa,EAAE,EAEpF,KAAK,OAASiB,CAChB,CAMA,MAAM,KAAKE,EAAoC,CAC7C,GAAI,CACF,KAAK,MAAQ,MAAMA,EACnB,KAAK,QAAQ,KAAK,mBAAoB,CAAE,OAAQ,SAAU,CAAC,CAC7D,OAASC,EAAO,CACVA,aAAiB,MACnB,KAAK,QAAQ,KAAK,mBAAoB,CAAE,OAAQ,SAAU,MAAOA,EAAM,SAAS,CAAE,CAAC,EAEnF,KAAK,QAAQ,KAAK,mBAAoB,CAAE,OAAQ,SAAU,MAAO,SAAU,CAAC,CAEhF,CACF,CAEA,UAAUC,EAA8B,CAKtC,GAJAA,EAAW,aAAa,KAAK,GAAG,EAChCA,EAAW,aAAa,KAAK,MAAM,EACnCA,EAAW,oBAAoB,KAAK,MAAM,EAC1C,KAAK,iBAAiB,UAAUA,CAAU,EACtC,KAAK,QAAU,OACjB,MAAM,IAAI,MAAM,oCAAoC,EAEtD,KAAK,MAAM,UAAUA,CAAU,CACjC,CAEA,OAAO,YAAYC,EAA4C,CAC7D,IAAMX,EAAMW,EAAa,eAAe,EAClCjB,EAASiB,EAAa,eAAe,EACrCd,EAASc,EAAa,sBAAsB,EAAE,EAC9ClB,EAAmBmB,EAAiB,YAAYD,CAAY,EAC5DE,EAAQT,EAAiB,YAAYO,CAAY,EACvD,OAAOtB,EAAe,OAAO,CAC3B,MAAAwB,EACA,OAAAhB,EACA,OAAAH,EACA,IAAAM,EACA,iBAAAP,CACF,CAAC,CACH,CAOA,WAAqB,CACnB,OAAO,KAAK,iBAAiB,UAAU,CACzC,CAOA,sBAAsBqB,EAAkD,CACtE,IAAMC,EAAY,IAAIC,EAAa,KAAK,KAAKF,CAAO,CAAC,EAC/CG,EAAY,IAAIC,EAAa,KAAK,SAAS,EACjD,OAAO,IAAIC,EAA8BF,EAAWF,CAAS,CAC/D,CAOA,iCAAiCK,EAA+D,CAC9F,IAAML,EAAY,IAAIC,EAAa,KAAK,gBAAgBI,CAAW,CAAC,EAC9DH,EAAY,IAAIC,EAAa,KAAK,SAAS,EACjD,OAAO,IAAIC,EAA8BF,EAAWF,CAAS,CAC/D,CAMA,MAAM,mBAAoB,CACpB,KAAK,0BAA0B,SACjC,MAAM,KAAK,cAEf,CAOA,KAAKM,EAAkC,CACrC,GAAM,CAAE,eAAAC,CAAe,EAAI,KAAK,iBAChC,GAAI,KAAK,UAAU,EACjB,MAAM,IAAI,MAAM,6BAA6B,EAE/C,GAAI,KAAK,QAAU,OACjB,MAAM,IAAI,MAAM,mBAAmB,EAErC,IAAMC,EAAqB,KAAK,iBAAiB,aAAa,EACxDC,EAAqB,KAAK,iBAAiB,KAAKH,CAAI,EAE1D,OAAO,IAAII,EAAiB,CAC1B,UAAWC,EAAgB,KAAK,IAAI,MAAM,GAAG,EAAE,CAAC,CAAC,EACjD,qBAAsB,IAAIC,EAAqB,KAAK,OAA0C,EAC9F,eAAAL,EACA,mBAAAC,EACA,mBAAAC,CACF,CAAC,CACH,CAQA,gBAAgBJ,EAAkD,CAChE,GAAI,KAAK,QAAU,OACjB,MAAM,IAAI,MAAM,iBAAiB,EAEnC,IAAMQ,EAAMC,EAAsBT,CAAW,EAEvCU,EADc,IAAIC,EAAoBH,EAAK,KAAK,MAAM,KAAK,EACpC,KAAK,EAClC,OAAO,KAAK,KAAKE,CAAQ,CAC3B,CAGA,gBAAgBvC,EAA4D,CAC1E,MAAM,IAAI,MAAM,iBAAiB,CACnC,CAEA,OAAO,UAAUyC,EAAmC,CAClD,OAAO3C,EAAe,YAAY,IAAI4C,EAAaD,CAAK,CAAC,CAC3D,CAEA,OAAO,OAAOzC,EAOK,CACjB,GAAM,CAAE,MAAAsB,EAAO,IAAAb,EAAK,iBAAAP,EAAkB,OAAAI,EAAQ,OAAAH,EAAS,MAAO,mBAAAK,CAAmB,EAAIR,EAE/E2C,EAAaC,EAAkDnC,CAAG,EAClEoC,EAAMF,EAAW,IACvB,GAAI,OAAOA,EAAW,KAAQ,SAC5B,MAAM,IAAI,MAAM,yCAAyC,EAE3D,IAAMtC,EAAMsC,EAAW,IACjBvC,EAASuC,EAAWxC,CAAM,EAChC,OAAO,IAAIL,EAAe,CACxB,eAAgBwB,EAChB,iBAAApB,EACA,IAAA2C,EACA,OAAA1C,EACA,OAAAC,EACA,IAAAC,EACA,OAAAC,EACA,IAAAG,EACA,mBAAAD,CACF,CAAC,CACH,CACF,EA/QaV,EACK,cAAwB,GADnC,IAAMgD,EAANhD,EAqRM0C,EAAN,cAAkCO,CAAe,CAgBtD,YAAYlB,EAAwCP,EAAiB,CACnE,MAAM,EACN,KAAK,YAAcO,EACnB,KAAK,MAAQP,EACb,KAAK,gBAAkB,4BACzB,CAEA,UAAUH,EAA8B,CACtCA,EAAW,oBAAoB,KAAK,YAAY,WAAW,CAAC,EAC5DA,EAAW,gBAAgB,KAAK,KAAK,CACvC,CACF","names":["jwtDecode","EventEmitter","_KeylessAccount","Serializable","args","address","ephemeralKeyPair","uidKey","uidVal","aud","pepper","proofOrFetcher","proofFetchCallback","jwt","KeylessPublicKey","AccountAddress","EventEmitter","ZeroKnowledgeSig","status","pepperBytes","Hex","promise","error","serializer","deserializer","EphemeralKeyPair","proof","message","signature","AnySignature","publicKey","AnyPublicKey","AccountAuthenticatorSingleKey","transaction","data","expiryDateSecs","ephemeralPublicKey","ephemeralSignature","KeylessSignature","base64UrlDecode","EphemeralCertificate","raw","deriveTransactionType","signMess","TransactionAndProof","bytes","Deserializer","jwtPayload","jwtDecode","iss","KeylessAccount","CryptoHashable"]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as i}from"./chunk-472OGHMG.mjs";import{a as e}from"./chunk-U5F4NL24.mjs";import{a as r}from"./chunk-UMLUOYFK.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-IT7YNITU.mjs.map
|