@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
package/dist/esm/utils/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-GED6IT3S.mjs";import{a as q}from"../chunk-
|
|
1
|
+
import"../chunk-GED6IT3S.mjs";import{a as q}from"../chunk-WV5AD4IE.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-YJCZU6PR.mjs";import"../chunk-MS4MRLGA.mjs";import"../chunk-XAISUKMY.mjs";import"../chunk-6QGVRNV6.mjs";import"../chunk-DZXM2MQY.mjs";import"../chunk-Q6LFIZ3L.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-HPZ2S4FE.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-BCUSI3N6.mjs";import"../chunk-LG7RJQ57.mjs";import{a,b,c,d,e,f,g,h}from"../chunk-SCHZ67F3.mjs";import{a as i,b as j,c as k,d as l,e as m,f as n,g as o,h as p}from"../chunk-YE5B2S5L.mjs";import"../chunk-FVA2OPG4.mjs";export{m as APTOS_COIN,i as AptosApiType,j as DEFAULT_MAX_GAS_AMOUNT,k as DEFAULT_TXN_EXP_SEC_FROM_NOW,l as DEFAULT_TXN_TIMEOUT_SEC,f as Network,g as NetworkToChainId,c as NetworkToFaucetAPI,a as NetworkToIndexerAPI,h as NetworkToNetworkName,b as NetworkToNodeAPI,d as NetworkToPepperAPI,e as NetworkToProverAPI,p as ProcessorType,n as RAW_TRANSACTION_SALT,o as RAW_TRANSACTION_WITH_DATA_SALT,q as normalizeBundle};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-WV5AD4IE.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-YJCZU6PR.mjs";import"../chunk-MS4MRLGA.mjs";import"../chunk-XAISUKMY.mjs";import"../chunk-6QGVRNV6.mjs";import"../chunk-DZXM2MQY.mjs";import"../chunk-Q6LFIZ3L.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-HPZ2S4FE.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-BCUSI3N6.mjs";import"../chunk-LG7RJQ57.mjs";import"../chunk-FVA2OPG4.mjs";export{a as normalizeBundle};
|
|
2
2
|
//# sourceMappingURL=normalizeBundle.mjs.map
|
package/dist/esm/version.d.mts
CHANGED
package/dist/esm/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-P2YIFHMW.mjs";import"./chunk-FVA2OPG4.mjs";export{a as VERSION};
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aptos-labs/ts-sdk",
|
|
3
3
|
"description": "Aptos TypeScript SDK",
|
|
4
|
-
"packageManager": "pnpm@9.
|
|
4
|
+
"packageManager": "pnpm@8.9.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=11.0.0"
|
|
@@ -55,7 +55,6 @@
|
|
|
55
55
|
"@scure/bip39": "^1.3.0",
|
|
56
56
|
"eventemitter3": "^5.0.1",
|
|
57
57
|
"form-data": "^4.0.0",
|
|
58
|
-
"jose": "^5.1.3",
|
|
59
58
|
"js-base64": "^3.7.7",
|
|
60
59
|
"jwt-decode": "^4.0.0",
|
|
61
60
|
"poseidon-lite": "^0.2.0"
|
|
@@ -92,5 +91,5 @@
|
|
|
92
91
|
"typedoc": "^0.25.4",
|
|
93
92
|
"typescript": "^5.3.3"
|
|
94
93
|
},
|
|
95
|
-
"version": "1.
|
|
94
|
+
"version": "1.18.0"
|
|
96
95
|
}
|
|
@@ -60,7 +60,11 @@ export class EphemeralKeyPair extends Serializable {
|
|
|
60
60
|
// Generate the blinder if not provided
|
|
61
61
|
this.blinder = blinder !== undefined ? Hex.fromHexInput(blinder).toUint8Array() : generateBlinder();
|
|
62
62
|
// Calculate the nonce
|
|
63
|
-
|
|
63
|
+
const fields = padAndPackBytesWithLen(this.publicKey.bcsToBytes(), 93);
|
|
64
|
+
fields.push(BigInt(this.expiryDateSecs));
|
|
65
|
+
fields.push(bytesToBigIntLE(this.blinder));
|
|
66
|
+
const nonceHash = poseidonHash(fields);
|
|
67
|
+
this.nonce = nonceHash.toString();
|
|
64
68
|
}
|
|
65
69
|
|
|
66
70
|
/**
|
|
@@ -124,18 +128,6 @@ export class EphemeralKeyPair extends Serializable {
|
|
|
124
128
|
return new EphemeralKeyPair({ privateKey, expiryDateSecs: args?.expiryDateSecs });
|
|
125
129
|
}
|
|
126
130
|
|
|
127
|
-
/**
|
|
128
|
-
* From the ephemeral public key, expiry timestamp, and blinder, calculate the nonce to be used at authentication via OIDC.
|
|
129
|
-
* @returns string
|
|
130
|
-
*/
|
|
131
|
-
private generateNonce(): string {
|
|
132
|
-
const fields = padAndPackBytesWithLen(this.publicKey.bcsToBytes(), 93);
|
|
133
|
-
fields.push(BigInt(this.expiryDateSecs));
|
|
134
|
-
fields.push(bytesToBigIntLE(this.blinder));
|
|
135
|
-
const nonceHash = poseidonHash(fields);
|
|
136
|
-
return nonceHash.toString();
|
|
137
|
-
}
|
|
138
|
-
|
|
139
131
|
/**
|
|
140
132
|
* Sign the given message with the private key.
|
|
141
133
|
* @param data in HexInput format
|
|
@@ -21,9 +21,8 @@ import { EphemeralKeyPair } from "./EphemeralKeyPair";
|
|
|
21
21
|
import { Hex } from "../core/hex";
|
|
22
22
|
import { AccountAuthenticatorSingleKey } from "../transactions/authenticator/account";
|
|
23
23
|
import { Deserializer, Serializable, Serializer } from "../bcs";
|
|
24
|
-
import { deriveTransactionType } from "../transactions/transactionBuilder/signingMessage";
|
|
24
|
+
import { deriveTransactionType, generateSigningMessage } from "../transactions/transactionBuilder/signingMessage";
|
|
25
25
|
import { AnyRawTransaction, AnyRawTransactionInstance } from "../transactions/types";
|
|
26
|
-
import { AptsoDomainSeparator, CryptoHashable } from "../core/crypto/cryptoHashable";
|
|
27
26
|
import { base64UrlDecode } from "../utils/helpers";
|
|
28
27
|
|
|
29
28
|
/**
|
|
@@ -101,7 +100,8 @@ export class KeylessAccount extends Serializable implements Account {
|
|
|
101
100
|
*/
|
|
102
101
|
private readonly emitter: EventEmitter<ProofFetchEvents>;
|
|
103
102
|
|
|
104
|
-
constructor
|
|
103
|
+
// Use the static constructor 'create' instead.
|
|
104
|
+
private constructor(args: {
|
|
105
105
|
address?: AccountAddress;
|
|
106
106
|
ephemeralKeyPair: EphemeralKeyPair;
|
|
107
107
|
iss: string;
|
|
@@ -109,12 +109,12 @@ export class KeylessAccount extends Serializable implements Account {
|
|
|
109
109
|
uidVal: string;
|
|
110
110
|
aud: string;
|
|
111
111
|
pepper: HexInput;
|
|
112
|
-
|
|
112
|
+
proof: ZeroKnowledgeSig | Promise<ZeroKnowledgeSig>;
|
|
113
113
|
proofFetchCallback?: ProofFetchCallback;
|
|
114
114
|
jwt: string;
|
|
115
115
|
}) {
|
|
116
116
|
super();
|
|
117
|
-
const { address, ephemeralKeyPair, uidKey, uidVal, aud, pepper,
|
|
117
|
+
const { address, ephemeralKeyPair, uidKey, uidVal, aud, pepper, proof, proofFetchCallback, jwt } = args;
|
|
118
118
|
this.ephemeralKeyPair = ephemeralKeyPair;
|
|
119
119
|
this.publicKey = KeylessPublicKey.create(args);
|
|
120
120
|
this.accountAddress = address ? AccountAddress.from(address) : this.publicKey.authKey().derivedAddress();
|
|
@@ -123,9 +123,9 @@ export class KeylessAccount extends Serializable implements Account {
|
|
|
123
123
|
this.aud = aud;
|
|
124
124
|
this.jwt = jwt;
|
|
125
125
|
this.emitter = new EventEmitter<ProofFetchEvents>();
|
|
126
|
-
this.proofOrPromise =
|
|
127
|
-
if (
|
|
128
|
-
this.proof =
|
|
126
|
+
this.proofOrPromise = proof;
|
|
127
|
+
if (proof instanceof ZeroKnowledgeSig) {
|
|
128
|
+
this.proof = proof;
|
|
129
129
|
} else {
|
|
130
130
|
if (proofFetchCallback === undefined) {
|
|
131
131
|
throw new Error("Must provide callback for async proof fetch");
|
|
@@ -134,7 +134,7 @@ export class KeylessAccount extends Serializable implements Account {
|
|
|
134
134
|
await proofFetchCallback(status);
|
|
135
135
|
this.emitter.removeAllListeners();
|
|
136
136
|
});
|
|
137
|
-
this.init(
|
|
137
|
+
this.init(proof);
|
|
138
138
|
}
|
|
139
139
|
this.signingScheme = SigningScheme.SingleKey;
|
|
140
140
|
const pepperBytes = Hex.fromHexInput(pepper).toUint8Array();
|
|
@@ -279,6 +279,7 @@ export class KeylessAccount extends Serializable implements Account {
|
|
|
279
279
|
}
|
|
280
280
|
|
|
281
281
|
static create(args: {
|
|
282
|
+
address?: AccountAddress;
|
|
282
283
|
proof: ZeroKnowledgeSig | Promise<ZeroKnowledgeSig>;
|
|
283
284
|
jwt: string;
|
|
284
285
|
ephemeralKeyPair: EphemeralKeyPair;
|
|
@@ -286,7 +287,7 @@ export class KeylessAccount extends Serializable implements Account {
|
|
|
286
287
|
uidKey?: string;
|
|
287
288
|
proofFetchCallback?: ProofFetchCallback;
|
|
288
289
|
}): KeylessAccount {
|
|
289
|
-
const { proof, jwt, ephemeralKeyPair, pepper, uidKey = "sub", proofFetchCallback } = args;
|
|
290
|
+
const { address, proof, jwt, ephemeralKeyPair, pepper, uidKey = "sub", proofFetchCallback } = args;
|
|
290
291
|
|
|
291
292
|
const jwtPayload = jwtDecode<JwtPayload & { [key: string]: string }>(jwt);
|
|
292
293
|
const iss = jwtPayload.iss!;
|
|
@@ -296,7 +297,8 @@ export class KeylessAccount extends Serializable implements Account {
|
|
|
296
297
|
const aud = jwtPayload.aud!;
|
|
297
298
|
const uidVal = jwtPayload[uidKey];
|
|
298
299
|
return new KeylessAccount({
|
|
299
|
-
|
|
300
|
+
address,
|
|
301
|
+
proof,
|
|
300
302
|
ephemeralKeyPair,
|
|
301
303
|
iss,
|
|
302
304
|
uidKey,
|
|
@@ -313,7 +315,7 @@ export class KeylessAccount extends Serializable implements Account {
|
|
|
313
315
|
* A container class to hold a transaction and a proof. It implements CryptoHashable which is used to create
|
|
314
316
|
* the signing message for Keyless transactions. We sign over the proof to ensure non-malleability.
|
|
315
317
|
*/
|
|
316
|
-
|
|
318
|
+
class TransactionAndProof extends Serializable {
|
|
317
319
|
/**
|
|
318
320
|
* The transaction to sign.
|
|
319
321
|
*/
|
|
@@ -327,19 +329,27 @@ export class TransactionAndProof extends CryptoHashable {
|
|
|
327
329
|
/**
|
|
328
330
|
* The domain separator prefix used when hashing.
|
|
329
331
|
*/
|
|
330
|
-
domainSeparator
|
|
332
|
+
readonly domainSeparator = "APTOS::TransactionAndProof";
|
|
331
333
|
|
|
332
334
|
constructor(transaction: AnyRawTransactionInstance, proof?: ZkProof) {
|
|
333
335
|
super();
|
|
334
336
|
this.transaction = transaction;
|
|
335
337
|
this.proof = proof;
|
|
336
|
-
this.domainSeparator = "APTOS::TransactionAndProof";
|
|
337
338
|
}
|
|
338
339
|
|
|
339
340
|
serialize(serializer: Serializer): void {
|
|
340
341
|
serializer.serializeFixedBytes(this.transaction.bcsToBytes());
|
|
341
342
|
serializer.serializeOption(this.proof);
|
|
342
343
|
}
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* Hashes the bcs serialized from of the class. This is the typescript corollary to the BCSCryptoHash macro in aptos-core.
|
|
347
|
+
*
|
|
348
|
+
* @returns Uint8Array
|
|
349
|
+
*/
|
|
350
|
+
hash(): Uint8Array {
|
|
351
|
+
return generateSigningMessage(this.bcsToBytes(), this.domainSeparator);
|
|
352
|
+
}
|
|
343
353
|
}
|
|
344
354
|
|
|
345
355
|
export type ProofFetchSuccess = {
|
|
@@ -131,7 +131,8 @@ export class MultiKeyAccount implements Account {
|
|
|
131
131
|
*/
|
|
132
132
|
async waitForProofFetch() {
|
|
133
133
|
const keylessSigners = this.signers.filter((signer) => signer instanceof KeylessAccount) as KeylessAccount[];
|
|
134
|
-
|
|
134
|
+
const promises = keylessSigners.map(async (signer) => signer.waitForProofFetch());
|
|
135
|
+
await Promise.all(promises);
|
|
135
136
|
}
|
|
136
137
|
|
|
137
138
|
/**
|
package/src/api/keyless.ts
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
4
|
import { EphemeralKeyPair, KeylessAccount, ProofFetchCallback } from "../account";
|
|
5
|
-
import {
|
|
5
|
+
import { ZeroKnowledgeSig } from "../core";
|
|
6
|
+
import { deriveKeylessAccount, getPepper, getProof } from "../internal/keyless";
|
|
6
7
|
import { HexInput } from "../types";
|
|
7
8
|
import { AptosConfig } from "./aptosConfig";
|
|
8
9
|
|
|
@@ -20,14 +21,40 @@ export class Keyless {
|
|
|
20
21
|
*
|
|
21
22
|
* @param args.jwt JWT token
|
|
22
23
|
* @param args.ephemeralKeyPair the EphemeralKeyPair used to generate the nonce in the JWT token
|
|
24
|
+
* @param args.derivationPath a derivation path used for creating multiple accounts per user via the BIP-44 standard. Defaults
|
|
25
|
+
* to "m/44'/637'/0'/0'/0".
|
|
23
26
|
* @returns The pepper which is a Uint8Array of length 31.
|
|
24
27
|
*/
|
|
25
|
-
async getPepper(args: {
|
|
28
|
+
async getPepper(args: {
|
|
29
|
+
jwt: string;
|
|
30
|
+
ephemeralKeyPair: EphemeralKeyPair;
|
|
31
|
+
derivationPath?: string;
|
|
32
|
+
}): Promise<Uint8Array> {
|
|
26
33
|
return getPepper({ aptosConfig: this.config, ...args });
|
|
27
34
|
}
|
|
28
35
|
|
|
29
36
|
/**
|
|
30
|
-
* Fetches
|
|
37
|
+
* Fetches a proof from the Aptos prover service API.
|
|
38
|
+
*
|
|
39
|
+
* @param args.jwt JWT token
|
|
40
|
+
* @param args.ephemeralKeyPair the EphemeralKeyPair used to generate the nonce in the JWT token
|
|
41
|
+
* @param args.uidKey a key in the JWT token to use to set the uidVal in the IdCommitment
|
|
42
|
+
* @param args.pepper the pepper used for the account. If not provided it will be fetched from the Aptos pepper service
|
|
43
|
+
*
|
|
44
|
+
* @returns The proof which is represented by a ZeroKnowledgeSig.
|
|
45
|
+
*/
|
|
46
|
+
async getProof(args: {
|
|
47
|
+
jwt: string;
|
|
48
|
+
ephemeralKeyPair: EphemeralKeyPair;
|
|
49
|
+
pepper?: HexInput;
|
|
50
|
+
uidKey?: string;
|
|
51
|
+
}): Promise<ZeroKnowledgeSig> {
|
|
52
|
+
return getProof({ aptosConfig: this.config, ...args });
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Derives the Keyless Account from the JWT token and corresponding EphemeralKeyPair. It will lookup the pepper from
|
|
57
|
+
* the pepper service if not explicitly provided. It will compute the proof via the proving service. It will ch
|
|
31
58
|
*
|
|
32
59
|
* @param args.jwt JWT token
|
|
33
60
|
* @param args.ephemeralKeyPair the EphemeralKeyPair used to generate the nonce in the JWT token
|
package/src/bcs/deserializer.ts
CHANGED
|
@@ -69,11 +69,8 @@ export class Deserializer {
|
|
|
69
69
|
* ```
|
|
70
70
|
*/
|
|
71
71
|
deserializeOptionStr(): string | undefined {
|
|
72
|
-
const exists = this.
|
|
73
|
-
|
|
74
|
-
return this.deserializeStr();
|
|
75
|
-
}
|
|
76
|
-
return undefined;
|
|
72
|
+
const exists = this.deserializeBool();
|
|
73
|
+
return exists ? this.deserializeStr() : undefined;
|
|
77
74
|
}
|
|
78
75
|
|
|
79
76
|
/**
|
|
@@ -95,11 +92,8 @@ export class Deserializer {
|
|
|
95
92
|
* @returns the deserialized value of class type T
|
|
96
93
|
*/
|
|
97
94
|
deserializeOption<T>(cls: Deserializable<T>): T | undefined {
|
|
98
|
-
const exists = this.
|
|
99
|
-
|
|
100
|
-
return this.deserialize(cls);
|
|
101
|
-
}
|
|
102
|
-
return undefined;
|
|
95
|
+
const exists = this.deserializeBool();
|
|
96
|
+
return exists ? this.deserialize(cls) : undefined;
|
|
103
97
|
}
|
|
104
98
|
|
|
105
99
|
/**
|
package/src/bcs/serializer.ts
CHANGED
|
@@ -336,10 +336,9 @@ export class Serializer {
|
|
|
336
336
|
* ```
|
|
337
337
|
*/
|
|
338
338
|
serializeOption<T extends Serializable>(value?: T): void {
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
this.serializeU32AsUleb128(1);
|
|
339
|
+
const hasValue = value !== undefined;
|
|
340
|
+
this.serializeBool(hasValue);
|
|
341
|
+
if (hasValue) {
|
|
343
342
|
value.serialize(this);
|
|
344
343
|
}
|
|
345
344
|
}
|
|
@@ -155,7 +155,7 @@ export class KeylessPublicKey extends AccountPublicKey {
|
|
|
155
155
|
return new KeylessPublicKey(args.iss, computeIdCommitment(args));
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
-
static
|
|
158
|
+
static fromJwtAndPepper(args: { jwt: string; pepper: HexInput; uidKey?: string }): KeylessPublicKey {
|
|
159
159
|
const { jwt, pepper, uidKey = "sub" } = args;
|
|
160
160
|
const jwtPayload = jwtDecode<JwtPayload & { [key: string]: string }>(jwt);
|
|
161
161
|
const iss = jwtPayload.iss!;
|
package/src/internal/keyless.ts
CHANGED
|
@@ -9,11 +9,20 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import { AptosConfig } from "../api/aptosConfig";
|
|
11
11
|
import { postAptosPepperService, postAptosProvingService } from "../client";
|
|
12
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
EphemeralSignature,
|
|
14
|
+
Groth16Zkp,
|
|
15
|
+
Hex,
|
|
16
|
+
KeylessPublicKey,
|
|
17
|
+
ZeroKnowledgeSig,
|
|
18
|
+
ZkProof,
|
|
19
|
+
getKeylessConfig,
|
|
20
|
+
} from "../core";
|
|
13
21
|
import { HexInput, ZkpVariant } from "../types";
|
|
14
22
|
import { EphemeralKeyPair, KeylessAccount, ProofFetchCallback } from "../account";
|
|
15
23
|
import { PepperFetchRequest, PepperFetchResponse, ProverRequest, ProverResponse } from "../types/keyless";
|
|
16
24
|
import { nowInSeconds } from "../utils/helpers";
|
|
25
|
+
import { lookupOriginalAccountAddress } from "./account";
|
|
17
26
|
|
|
18
27
|
export async function getPepper(args: {
|
|
19
28
|
aptosConfig: AptosConfig;
|
|
@@ -46,10 +55,13 @@ export async function getProof(args: {
|
|
|
46
55
|
aptosConfig: AptosConfig;
|
|
47
56
|
jwt: string;
|
|
48
57
|
ephemeralKeyPair: EphemeralKeyPair;
|
|
49
|
-
pepper
|
|
58
|
+
pepper?: HexInput;
|
|
50
59
|
uidKey?: string;
|
|
51
60
|
}): Promise<ZeroKnowledgeSig> {
|
|
52
|
-
const { aptosConfig, jwt, ephemeralKeyPair, pepper, uidKey = "sub" } = args;
|
|
61
|
+
const { aptosConfig, jwt, ephemeralKeyPair, pepper = await getPepper(args), uidKey = "sub" } = args;
|
|
62
|
+
if (Hex.fromHexInput(pepper).toUint8Array().length !== KeylessAccount.PEPPER_LENGTH) {
|
|
63
|
+
throw new Error(`Pepper needs to be ${KeylessAccount.PEPPER_LENGTH} bytes`);
|
|
64
|
+
}
|
|
53
65
|
const { maxExpHorizonSecs } = await getKeylessConfig({ aptosConfig });
|
|
54
66
|
if (maxExpHorizonSecs < ephemeralKeyPair.expiryDateSecs - nowInSeconds()) {
|
|
55
67
|
throw Error(`The EphemeralKeyPair is too long lived. It's lifespan must be less than ${maxExpHorizonSecs}`);
|
|
@@ -95,18 +107,7 @@ export async function deriveKeylessAccount(args: {
|
|
|
95
107
|
pepper?: HexInput;
|
|
96
108
|
proofFetchCallback?: ProofFetchCallback;
|
|
97
109
|
}): Promise<KeylessAccount> {
|
|
98
|
-
const { proofFetchCallback } = args;
|
|
99
|
-
let { pepper } = args;
|
|
100
|
-
if (pepper === undefined) {
|
|
101
|
-
pepper = await getPepper(args);
|
|
102
|
-
} else {
|
|
103
|
-
pepper = Hex.fromHexInput(pepper).toUint8Array();
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
if (pepper.length !== KeylessAccount.PEPPER_LENGTH) {
|
|
107
|
-
throw new Error(`Pepper needs to be ${KeylessAccount.PEPPER_LENGTH} bytes`);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
+
const { aptosConfig, jwt, uidKey, proofFetchCallback, pepper = await getPepper(args) } = args;
|
|
110
111
|
const proofPromise = getProof({ ...args, pepper });
|
|
111
112
|
// If a callback is provided, pass in the proof as a promise to KeylessAccount.create. This will make the proof be fetched in the
|
|
112
113
|
// background and the callback will handle the outcome of the fetch. This allows the developer to not have to block on the proof fetch
|
|
@@ -115,7 +116,14 @@ export async function deriveKeylessAccount(args: {
|
|
|
115
116
|
// If no callback is provided, the just await the proof fetch and continue syncronously.
|
|
116
117
|
const proof = proofFetchCallback ? proofPromise : await proofPromise;
|
|
117
118
|
|
|
118
|
-
|
|
119
|
+
// Look up the original address to handle key rotations
|
|
120
|
+
const publicKey = KeylessPublicKey.fromJwtAndPepper({ jwt, pepper, uidKey });
|
|
121
|
+
const address = await lookupOriginalAccountAddress({
|
|
122
|
+
aptosConfig,
|
|
123
|
+
authenticationKey: publicKey.authKey().derivedAddress(),
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
const keylessAccount = KeylessAccount.create({ ...args, address, proof, pepper, proofFetchCallback });
|
|
119
127
|
|
|
120
128
|
return keylessAccount;
|
|
121
129
|
}
|
|
@@ -8,7 +8,7 @@ import { sha3_256 as sha3Hash } from "@noble/hashes/sha3";
|
|
|
8
8
|
import { RAW_TRANSACTION_SALT, RAW_TRANSACTION_WITH_DATA_SALT } from "../../utils/const";
|
|
9
9
|
import { FeePayerRawTransaction, MultiAgentRawTransaction } from "../instances";
|
|
10
10
|
import { AnyRawTransaction, AnyRawTransactionInstance } from "../types";
|
|
11
|
-
import { Serializable } from "../../bcs
|
|
11
|
+
import { Serializable } from "../../bcs";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Derive the raw transaction type - FeePayerRawTransaction or MultiAgentRawTransaction or RawTransaction
|
|
@@ -61,7 +61,7 @@ export function generateSigningMessage(bytes: Uint8Array, domainSeparator: strin
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
/**
|
|
64
|
-
* @
|
|
64
|
+
* @deprecated
|
|
65
65
|
* Use CryptoHashable instead by having your class implement it and call hash() to get the signing message.
|
|
66
66
|
*
|
|
67
67
|
* Generates the 'signing message' form of a serilizable value. It bcs serializes the value and uses the name of
|
|
@@ -49,13 +49,13 @@ export type CurrentTokenOwnershipFieldsFragment = {
|
|
|
49
49
|
last_transaction_timestamp: any;
|
|
50
50
|
last_transaction_version: any;
|
|
51
51
|
maximum?: any | null;
|
|
52
|
-
supply
|
|
52
|
+
supply?: any | null;
|
|
53
53
|
token_data_id: string;
|
|
54
54
|
token_name: string;
|
|
55
55
|
token_properties: any;
|
|
56
56
|
token_standard: string;
|
|
57
57
|
token_uri: string;
|
|
58
|
-
decimals
|
|
58
|
+
decimals?: any | null;
|
|
59
59
|
current_collection?: {
|
|
60
60
|
collection_id: string;
|
|
61
61
|
collection_name: string;
|
|
@@ -206,13 +206,13 @@ export type GetAccountOwnedTokensQuery = {
|
|
|
206
206
|
last_transaction_timestamp: any;
|
|
207
207
|
last_transaction_version: any;
|
|
208
208
|
maximum?: any | null;
|
|
209
|
-
supply
|
|
209
|
+
supply?: any | null;
|
|
210
210
|
token_data_id: string;
|
|
211
211
|
token_name: string;
|
|
212
212
|
token_properties: any;
|
|
213
213
|
token_standard: string;
|
|
214
214
|
token_uri: string;
|
|
215
|
-
decimals
|
|
215
|
+
decimals?: any | null;
|
|
216
216
|
current_collection?: {
|
|
217
217
|
collection_id: string;
|
|
218
218
|
collection_name: string;
|
|
@@ -262,13 +262,13 @@ export type GetAccountOwnedTokensByTokenDataQuery = {
|
|
|
262
262
|
last_transaction_timestamp: any;
|
|
263
263
|
last_transaction_version: any;
|
|
264
264
|
maximum?: any | null;
|
|
265
|
-
supply
|
|
265
|
+
supply?: any | null;
|
|
266
266
|
token_data_id: string;
|
|
267
267
|
token_name: string;
|
|
268
268
|
token_properties: any;
|
|
269
269
|
token_standard: string;
|
|
270
270
|
token_uri: string;
|
|
271
|
-
decimals
|
|
271
|
+
decimals?: any | null;
|
|
272
272
|
current_collection?: {
|
|
273
273
|
collection_id: string;
|
|
274
274
|
collection_name: string;
|
|
@@ -318,13 +318,13 @@ export type GetAccountOwnedTokensFromCollectionQuery = {
|
|
|
318
318
|
last_transaction_timestamp: any;
|
|
319
319
|
last_transaction_version: any;
|
|
320
320
|
maximum?: any | null;
|
|
321
|
-
supply
|
|
321
|
+
supply?: any | null;
|
|
322
322
|
token_data_id: string;
|
|
323
323
|
token_name: string;
|
|
324
324
|
token_properties: any;
|
|
325
325
|
token_standard: string;
|
|
326
326
|
token_uri: string;
|
|
327
|
-
decimals
|
|
327
|
+
decimals?: any | null;
|
|
328
328
|
current_collection?: {
|
|
329
329
|
collection_id: string;
|
|
330
330
|
collection_name: string;
|
|
@@ -496,6 +496,8 @@ export type GetFungibleAssetMetadataQuery = {
|
|
|
496
496
|
name: string;
|
|
497
497
|
symbol: string;
|
|
498
498
|
token_standard: string;
|
|
499
|
+
supply_v2?: any | null;
|
|
500
|
+
maximum_v2?: any | null;
|
|
499
501
|
}>;
|
|
500
502
|
};
|
|
501
503
|
|
|
@@ -620,13 +622,13 @@ export type GetCurrentTokenOwnershipQuery = {
|
|
|
620
622
|
last_transaction_timestamp: any;
|
|
621
623
|
last_transaction_version: any;
|
|
622
624
|
maximum?: any | null;
|
|
623
|
-
supply
|
|
625
|
+
supply?: any | null;
|
|
624
626
|
token_data_id: string;
|
|
625
627
|
token_name: string;
|
|
626
628
|
token_properties: any;
|
|
627
629
|
token_standard: string;
|
|
628
630
|
token_uri: string;
|
|
629
|
-
decimals
|
|
631
|
+
decimals?: any | null;
|
|
630
632
|
current_collection?: {
|
|
631
633
|
collection_id: string;
|
|
632
634
|
collection_name: string;
|
|
@@ -663,13 +665,13 @@ export type GetTokenDataQuery = {
|
|
|
663
665
|
last_transaction_timestamp: any;
|
|
664
666
|
last_transaction_version: any;
|
|
665
667
|
maximum?: any | null;
|
|
666
|
-
supply
|
|
668
|
+
supply?: any | null;
|
|
667
669
|
token_data_id: string;
|
|
668
670
|
token_name: string;
|
|
669
671
|
token_properties: any;
|
|
670
672
|
token_standard: string;
|
|
671
673
|
token_uri: string;
|
|
672
|
-
decimals
|
|
674
|
+
decimals?: any | null;
|
|
673
675
|
current_collection?: {
|
|
674
676
|
collection_id: string;
|
|
675
677
|
collection_name: string;
|