@aptos-labs/ts-sdk 1.16.0 → 1.17.0-zeta.1
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-ccLvlUQe.d.ts → accountAddress-jP2Ua0t9.d.ts} +97 -5
- package/dist/common/chunk-BHKSQXUZ.js +2 -0
- package/dist/common/chunk-BHKSQXUZ.js.map +1 -0
- package/dist/common/cli/index.d.ts +1 -1
- package/dist/common/cli/index.js +1 -1
- package/dist/common/index.d.ts +857 -122
- package/dist/common/index.js +28 -28
- package/dist/common/index.js.map +1 -1
- package/dist/esm/{Ed25519Account-B1VMJOY2.d.mts → Ed25519Account-9zBaZEnp.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 +90 -0
- package/dist/esm/account/EphemeralKeyPair.mjs +2 -0
- package/dist/esm/account/KeylessAccount.d.mts +206 -0
- package/dist/esm/account/KeylessAccount.mjs +2 -0
- package/dist/esm/account/MultiKeyAccount.d.mts +13 -7
- 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 +9 -2
- package/dist/esm/account/index.mjs +1 -1
- package/dist/esm/api/account.d.mts +4 -4
- package/dist/esm/api/account.mjs +1 -1
- package/dist/esm/api/ans.d.mts +4 -4
- package/dist/esm/api/ans.mjs +1 -1
- package/dist/esm/api/aptos.d.mts +12 -3
- package/dist/esm/api/aptos.mjs +1 -1
- package/dist/esm/api/aptosConfig.d.mts +20 -0
- package/dist/esm/api/aptosConfig.mjs +1 -1
- package/dist/esm/api/coin.d.mts +5 -5
- package/dist/esm/api/coin.mjs +1 -1
- package/dist/esm/api/digitalAsset.d.mts +6 -6
- package/dist/esm/api/digitalAsset.mjs +1 -1
- package/dist/esm/api/event.d.mts +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 +3 -3
- package/dist/esm/api/fungibleAsset.mjs +1 -1
- package/dist/esm/api/general.d.mts +3 -3
- package/dist/esm/api/general.mjs +1 -1
- package/dist/esm/api/index.d.mts +10 -2
- package/dist/esm/api/index.mjs +1 -1
- package/dist/esm/api/keyless.d.mts +85 -0
- package/dist/esm/api/keyless.mjs +2 -0
- package/dist/esm/api/keyless.mjs.map +1 -0
- package/dist/esm/api/staking.d.mts +2 -2
- package/dist/esm/api/staking.mjs +1 -1
- package/dist/esm/api/table.d.mts +1 -1
- package/dist/esm/api/table.mjs +1 -1
- package/dist/esm/api/transaction.d.mts +3 -3
- package/dist/esm/api/transaction.mjs +1 -1
- package/dist/esm/api/transactionSubmission/build.d.mts +3 -3
- 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 +4 -4
- 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 +3 -3
- package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
- package/dist/esm/api/transactionSubmission/submit.d.mts +3 -3
- package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
- package/dist/esm/api/utils.mjs +1 -1
- package/dist/esm/bcs/deserializer.d.mts +32 -0
- package/dist/esm/bcs/deserializer.mjs +1 -1
- package/dist/esm/bcs/index.mjs +1 -1
- package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -1
- package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -1
- package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
- package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
- package/dist/esm/bcs/serializer.d.mts +42 -0
- package/dist/esm/bcs/serializer.mjs +1 -1
- package/dist/esm/chunk-2G4IGSGM.mjs +2 -0
- package/dist/esm/{chunk-XHEZAVN3.mjs.map → chunk-2G4IGSGM.mjs.map} +1 -1
- package/dist/esm/{chunk-BCLP2ENK.mjs → chunk-2H24BEJI.mjs} +2 -2
- package/dist/esm/chunk-37FFZSIM.mjs +2 -0
- package/dist/esm/chunk-37FFZSIM.mjs.map +1 -0
- package/dist/esm/{chunk-DO444YYD.mjs → chunk-3AIEYUPP.mjs} +2 -2
- package/dist/esm/chunk-3IFR6T3V.mjs +2 -0
- package/dist/esm/chunk-3IFR6T3V.mjs.map +1 -0
- package/dist/esm/chunk-3RJZNUCQ.mjs +2 -0
- package/dist/esm/chunk-3SACE4I2.mjs +2 -0
- package/dist/esm/{chunk-T2WZWN6W.mjs.map → chunk-3SACE4I2.mjs.map} +1 -1
- package/dist/esm/chunk-472OGHMG.mjs +2 -0
- package/dist/esm/chunk-474YDCFP.mjs +2 -0
- package/dist/esm/chunk-474YDCFP.mjs.map +1 -0
- package/dist/esm/chunk-4BJA3QUQ.mjs +2 -0
- package/dist/esm/{chunk-NYXLPBKE.mjs.map → chunk-4BJA3QUQ.mjs.map} +1 -1
- package/dist/esm/chunk-4CUDBBTC.mjs +2 -0
- package/dist/esm/chunk-4CUDBBTC.mjs.map +1 -0
- package/dist/esm/chunk-4VPCPASN.mjs +2 -0
- package/dist/esm/chunk-4W7T4HRZ.mjs +2 -0
- package/dist/esm/chunk-4W7T4HRZ.mjs.map +1 -0
- package/dist/esm/chunk-54LCK6EN.mjs +2 -0
- package/dist/esm/chunk-54LCK6EN.mjs.map +1 -0
- package/dist/esm/{chunk-DBC2JY65.mjs → chunk-5C5GZJ57.mjs} +2 -2
- package/dist/esm/chunk-5SEAQESO.mjs +2 -0
- package/dist/esm/chunk-5SEAQESO.mjs.map +1 -0
- package/dist/esm/{chunk-HZ3YB6TN.mjs → chunk-5UXARGTJ.mjs} +2 -2
- package/dist/esm/{chunk-I3MG3W4J.mjs → chunk-5X5GQF3E.mjs} +2 -2
- package/dist/esm/{chunk-GHYE26Q5.mjs → chunk-6FBKUTGF.mjs} +2 -2
- package/dist/esm/chunk-7BW2N4IE.mjs +2 -0
- package/dist/esm/{chunk-MEXWNZY6.mjs → chunk-7M6OCGHL.mjs} +2 -2
- package/dist/esm/chunk-7Z6DYLCA.mjs +1 -0
- package/dist/esm/chunk-7Z6DYLCA.mjs.map +1 -0
- package/dist/esm/{chunk-BCUSI3N6.mjs → chunk-AOCNYMMX.mjs} +2 -2
- package/dist/esm/chunk-AQ4I7VVB.mjs +1 -0
- package/dist/esm/chunk-AQ4I7VVB.mjs.map +1 -0
- package/dist/esm/{chunk-VJL6AF64.mjs → chunk-ASK3DESW.mjs} +2 -2
- package/dist/esm/{chunk-JWTZDA6A.mjs → chunk-BO44HPGU.mjs} +2 -2
- package/dist/esm/chunk-CKQ74DYE.mjs +2 -0
- package/dist/esm/chunk-CKQ74DYE.mjs.map +1 -0
- package/dist/esm/chunk-DJPYZIJY.mjs +2 -0
- package/dist/esm/chunk-DJPYZIJY.mjs.map +1 -0
- package/dist/esm/{chunk-JNDRFTEA.mjs → chunk-DPWEHSHH.mjs} +2 -2
- package/dist/esm/{chunk-WNVUG2UF.mjs → chunk-EFMAZTIM.mjs} +2 -2
- package/dist/esm/chunk-EQF5MW2W.mjs +2 -0
- package/dist/esm/chunk-EQF5MW2W.mjs.map +1 -0
- package/dist/esm/{chunk-UF5B4XMN.mjs → chunk-ET4WC6TJ.mjs} +2 -2
- package/dist/esm/{chunk-UEI62FBQ.mjs → chunk-F3ZVWLDH.mjs} +2 -2
- package/dist/esm/{chunk-UEI62FBQ.mjs.map → chunk-F3ZVWLDH.mjs.map} +1 -1
- package/dist/esm/chunk-FBPNHF54.mjs +2 -0
- package/dist/esm/{chunk-YJIRT3GJ.mjs → chunk-FGGRPEQ3.mjs} +2 -2
- package/dist/esm/chunk-FIG65OJD.mjs +2 -0
- package/dist/esm/{chunk-ISIUQQMV.mjs → chunk-FNFQA7NS.mjs} +2 -2
- package/dist/esm/{chunk-XXBMHWNV.mjs → chunk-FR6UGCOX.mjs} +2 -2
- package/dist/esm/chunk-FR6UGCOX.mjs.map +1 -0
- package/dist/esm/chunk-GRHLQDHF.mjs +2 -0
- package/dist/esm/chunk-GSCM444Z.mjs +2 -0
- package/dist/esm/{chunk-QKV2H27T.mjs → chunk-HJAB473N.mjs} +2 -2
- package/dist/esm/chunk-HP6YVTTT.mjs +2 -0
- package/dist/esm/{chunk-LGOZUIGE.mjs.map → chunk-HP6YVTTT.mjs.map} +1 -1
- package/dist/esm/chunk-IBDBKQMF.mjs +2 -0
- package/dist/esm/chunk-IBDBKQMF.mjs.map +1 -0
- package/dist/esm/chunk-IBN7ETCB.mjs +2 -0
- package/dist/esm/{chunk-5NSXEM3O.mjs.map → chunk-IBN7ETCB.mjs.map} +1 -1
- package/dist/esm/chunk-IEVABWIO.mjs +2 -0
- package/dist/esm/chunk-IEVABWIO.mjs.map +1 -0
- package/dist/esm/{chunk-YTJ73ZX3.mjs → chunk-IFAWCHUG.mjs} +2 -2
- package/dist/esm/chunk-IT7YNITU.mjs +2 -0
- package/dist/esm/chunk-IVVWQKCF.mjs +2 -0
- package/dist/esm/chunk-IVVWQKCF.mjs.map +1 -0
- package/dist/esm/{chunk-TZCETTAW.mjs → chunk-IXFYYWAC.mjs} +2 -2
- package/dist/esm/{chunk-FW6TF3O2.mjs → chunk-J7HG6SQO.mjs} +2 -2
- package/dist/esm/{chunk-HMTYASEZ.mjs → chunk-JLXE5JF6.mjs} +2 -2
- package/dist/esm/{chunk-AKJZL3HT.mjs → chunk-KDLQ2V3L.mjs} +2 -2
- package/dist/esm/{chunk-OOH7MH2H.mjs → chunk-KGKEU2WI.mjs} +2 -2
- package/dist/esm/chunk-L5CPAOUM.mjs +2 -0
- package/dist/esm/chunk-L5CPAOUM.mjs.map +1 -0
- package/dist/esm/{chunk-FLUCRNGU.mjs → chunk-L5ZHZWHI.mjs} +2 -2
- package/dist/esm/chunk-M3KFXIQ6.mjs +2 -0
- package/dist/esm/chunk-M3KFXIQ6.mjs.map +1 -0
- package/dist/esm/{chunk-S5AGI7RQ.mjs → chunk-MLX6DFMR.mjs} +2 -2
- package/dist/esm/chunk-MNTLX37G.mjs +2 -0
- package/dist/esm/chunk-MNTLX37G.mjs.map +1 -0
- package/dist/esm/{chunk-RC6B45PP.mjs → chunk-MRUDDEJ3.mjs} +2 -2
- package/dist/esm/chunk-NMD45OTM.mjs +2 -0
- package/dist/esm/chunk-NMD45OTM.mjs.map +1 -0
- package/dist/esm/chunk-NW3WUTTD.mjs +2 -0
- package/dist/esm/{chunk-LVYNEPH4.mjs → chunk-O6QLAP7N.mjs} +2 -2
- package/dist/esm/{chunk-LKVJZTBM.mjs → chunk-OHZHYL3E.mjs} +2 -2
- package/dist/esm/chunk-OHZHYL3E.mjs.map +1 -0
- package/dist/esm/{chunk-QIELBIZW.mjs → chunk-P67NJHS5.mjs} +2 -2
- package/dist/esm/{chunk-TAVPFLW5.mjs → chunk-PBMSO6WI.mjs} +2 -2
- package/dist/esm/chunk-Q6LFIZ3L.mjs +2 -0
- package/dist/esm/chunk-Q6LFIZ3L.mjs.map +1 -0
- package/dist/esm/{chunk-43HKFNUB.mjs → chunk-QFVQSFBZ.mjs} +2 -2
- package/dist/esm/{chunk-YMHX6GC2.mjs → chunk-R5THMTSP.mjs} +2 -2
- package/dist/esm/chunk-SCHZ67F3.mjs +2 -0
- package/dist/esm/chunk-SCHZ67F3.mjs.map +1 -0
- package/dist/esm/{chunk-AR3GW64L.mjs → chunk-SNDFJWYM.mjs} +2 -2
- package/dist/esm/{chunk-JHBMHOSV.mjs → chunk-T5YEMU53.mjs} +2 -2
- package/dist/esm/{chunk-DPWXEJP6.mjs → chunk-TAT3K5M7.mjs} +2 -2
- package/dist/esm/{chunk-LM7CN4LT.mjs → chunk-TCK35M7E.mjs} +2 -2
- package/dist/esm/chunk-TJDC5PWD.mjs +2 -0
- package/dist/esm/{chunk-LF6IQT54.mjs → chunk-TUCCV62K.mjs} +2 -2
- package/dist/esm/{chunk-OLKEU7WZ.mjs → chunk-U2R36WTE.mjs} +2 -2
- package/dist/esm/chunk-U5F4NL24.mjs +2 -0
- package/dist/esm/{chunk-4KMISR2H.mjs → chunk-UMLUOYFK.mjs} +2 -2
- package/dist/esm/{chunk-4KMISR2H.mjs.map → chunk-UMLUOYFK.mjs.map} +1 -1
- package/dist/esm/chunk-VAKWRPVP.mjs +2 -0
- package/dist/esm/chunk-VAKWRPVP.mjs.map +1 -0
- package/dist/esm/chunk-VJFCEX7W.mjs +2 -0
- package/dist/esm/chunk-VJFCEX7W.mjs.map +1 -0
- package/dist/esm/chunk-WA2NTBYY.mjs +2 -0
- package/dist/esm/{chunk-X6BYF2UD.mjs → chunk-WIYDJE6F.mjs} +2 -2
- package/dist/esm/chunk-XBVVP7O2.mjs +2 -0
- package/dist/esm/chunk-XBVVP7O2.mjs.map +1 -0
- package/dist/esm/chunk-XH33BXEY.mjs +2 -0
- package/dist/esm/chunk-XH33BXEY.mjs.map +1 -0
- package/dist/esm/{chunk-CX4BEIQT.mjs → chunk-XVZBWW46.mjs} +2 -2
- package/dist/esm/{chunk-V367QLY3.mjs → chunk-Y4E6NTAS.mjs} +2 -2
- package/dist/esm/{chunk-6SK246YU.mjs → chunk-YA4XTZNZ.mjs} +2 -2
- package/dist/esm/chunk-YD5IB4TH.mjs +2 -0
- package/dist/esm/chunk-YD5IB4TH.mjs.map +1 -0
- package/dist/esm/{chunk-A7J2UMLS.mjs → chunk-YDNOKWV3.mjs} +2 -2
- package/dist/esm/chunk-YE5B2S5L.mjs +2 -0
- package/dist/esm/chunk-YE5B2S5L.mjs.map +1 -0
- package/dist/esm/{chunk-4D42AAH3.mjs → chunk-YRUF6N3U.mjs} +2 -2
- package/dist/esm/chunk-YTQVMLFD.mjs +2 -0
- package/dist/esm/chunk-YTQVMLFD.mjs.map +1 -0
- package/dist/esm/{chunk-ZMXURV35.mjs → chunk-ZIDLP5MI.mjs} +2 -2
- package/dist/esm/{chunk-OO5EJW3B.mjs → chunk-ZMHGGT4E.mjs} +2 -2
- package/dist/esm/{chunk-AWPRGMUP.mjs → chunk-ZV5MKFV7.mjs} +2 -2
- package/dist/esm/cli/index.mjs +1 -1
- package/dist/esm/cli/localNode.mjs +1 -1
- package/dist/esm/client/core.mjs +1 -1
- package/dist/esm/client/get.d.mts +8 -1
- package/dist/esm/client/get.mjs +1 -1
- package/dist/esm/client/index.d.mts +2 -2
- package/dist/esm/client/index.mjs +1 -1
- package/dist/esm/client/post.d.mts +9 -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/cryptoHashable.d.mts +21 -0
- package/dist/esm/core/crypto/cryptoHashable.mjs +2 -0
- package/dist/esm/core/crypto/cryptoHashable.mjs.map +1 -0
- 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 +73 -0
- package/dist/esm/core/crypto/ephemeral.mjs +2 -0
- package/dist/esm/core/crypto/ephemeral.mjs.map +1 -0
- package/dist/esm/core/crypto/index.d.mts +7 -1
- package/dist/esm/core/crypto/index.mjs +1 -1
- package/dist/esm/core/crypto/keyless.d.mts +321 -0
- package/dist/esm/core/crypto/keyless.mjs +2 -0
- package/dist/esm/core/crypto/keyless.mjs.map +1 -0
- 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/poseidon.d.mts +19 -0
- package/dist/esm/core/crypto/poseidon.mjs +2 -0
- package/dist/esm/core/crypto/poseidon.mjs.map +1 -0
- package/dist/esm/core/crypto/privateKey.d.mts +1 -1
- package/dist/esm/core/crypto/proof.d.mts +21 -0
- package/dist/esm/core/crypto/proof.mjs +2 -0
- package/dist/esm/core/crypto/proof.mjs.map +1 -0
- 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 +7 -1
- package/dist/esm/core/index.mjs +1 -1
- package/dist/esm/index.d.mts +15 -7
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/internal/account.d.mts +3 -3
- 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 +4 -4
- 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.d.mts +1 -1
- package/dist/esm/internal/event.mjs +1 -1
- package/dist/esm/internal/faucet.d.mts +3 -3
- package/dist/esm/internal/faucet.mjs +1 -1
- package/dist/esm/internal/fungibleAsset.d.mts +3 -3
- package/dist/esm/internal/fungibleAsset.mjs +1 -1
- package/dist/esm/internal/general.d.mts +2 -16
- package/dist/esm/internal/general.mjs +1 -1
- package/dist/esm/internal/keyless.d.mts +73 -0
- package/dist/esm/internal/keyless.mjs +2 -0
- package/dist/esm/internal/keyless.mjs.map +1 -0
- package/dist/esm/internal/staking.d.mts +2 -2
- package/dist/esm/internal/staking.mjs +1 -1
- package/dist/esm/internal/table.mjs +1 -1
- package/dist/esm/internal/transaction.d.mts +16 -2
- package/dist/esm/internal/transaction.mjs +1 -1
- package/dist/esm/internal/transactionSubmission.d.mts +6 -6
- 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 +2 -2
- 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 +3 -3
- package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/signingMessage.d.mts +4 -1
- 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.d.mts +3 -1
- package/dist/esm/transactions/typeTag/parser.mjs +1 -1
- package/dist/esm/transactions/types.d.mts +23 -5
- package/dist/esm/types/index.d.mts +21 -5
- package/dist/esm/types/index.mjs +1 -1
- package/dist/esm/types/keyless.d.mts +52 -0
- package/dist/esm/types/keyless.mjs +1 -0
- package/dist/esm/types/keyless.mjs.map +1 -0
- package/dist/esm/utils/apiEndpoints.d.mts +3 -1
- package/dist/esm/utils/apiEndpoints.mjs +1 -1
- package/dist/esm/utils/const.d.mts +3 -1
- package/dist/esm/utils/const.mjs +1 -1
- package/dist/esm/utils/helpers.d.mts +4 -1
- package/dist/esm/utils/helpers.mjs +1 -1
- package/dist/esm/utils/index.d.mts +1 -1
- package/dist/esm/utils/index.mjs +1 -1
- package/dist/esm/utils/normalizeBundle.mjs +1 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +11 -4
- package/src/account/EphemeralKeyPair.ts +158 -0
- package/src/account/KeylessAccount.ts +360 -0
- package/src/account/MultiKeyAccount.ts +11 -0
- package/src/account/index.ts +2 -0
- package/src/api/aptos.ts +6 -0
- package/src/api/aptosConfig.ts +46 -1
- package/src/api/general.ts +1 -2
- package/src/api/keyless.ts +51 -0
- package/src/bcs/deserializer.ts +46 -0
- package/src/bcs/serializer.ts +58 -0
- package/src/client/core.ts +4 -0
- package/src/client/get.ts +12 -0
- package/src/client/post.ts +18 -0
- package/src/core/crypto/cryptoHashable.ts +16 -0
- package/src/core/crypto/ephemeral.ts +138 -0
- package/src/core/crypto/index.ts +2 -0
- package/src/core/crypto/keyless.ts +679 -0
- package/src/core/crypto/poseidon.ts +144 -0
- package/src/core/crypto/proof.ts +16 -0
- package/src/core/crypto/singleKey.ts +11 -0
- package/src/internal/general.ts +1 -38
- package/src/internal/keyless.ts +121 -0
- package/src/internal/transaction.ts +92 -0
- package/src/internal/transactionSubmission.ts +6 -1
- package/src/transactions/management/accountSequenceNumber.ts +5 -8
- package/src/transactions/transactionBuilder/remoteAbi.ts +3 -2
- package/src/transactions/transactionBuilder/signingMessage.ts +4 -1
- package/src/transactions/transactionBuilder/transactionBuilder.ts +22 -2
- package/src/transactions/typeTag/parser.ts +98 -52
- package/src/transactions/types.ts +22 -3
- package/src/types/index.ts +24 -2
- package/src/types/keyless.ts +42 -0
- package/src/utils/apiEndpoints.ts +16 -0
- package/src/utils/const.ts +2 -0
- package/src/utils/helpers.ts +22 -0
- package/src/version.ts +1 -1
- package/dist/common/chunk-KSEUZTKY.js +0 -2
- package/dist/common/chunk-KSEUZTKY.js.map +0 -1
- package/dist/esm/chunk-2XVDVF5C.mjs +0 -2
- package/dist/esm/chunk-3JPVQHOR.mjs +0 -2
- package/dist/esm/chunk-3JPVQHOR.mjs.map +0 -1
- package/dist/esm/chunk-43YYG5VO.mjs +0 -2
- package/dist/esm/chunk-43YYG5VO.mjs.map +0 -1
- package/dist/esm/chunk-5NSXEM3O.mjs +0 -2
- package/dist/esm/chunk-5SQAHWDI.mjs +0 -2
- package/dist/esm/chunk-5TTCAW72.mjs +0 -2
- package/dist/esm/chunk-5TTCAW72.mjs.map +0 -1
- package/dist/esm/chunk-6IFMQ5AS.mjs +0 -2
- package/dist/esm/chunk-6IFMQ5AS.mjs.map +0 -1
- package/dist/esm/chunk-6JFZZLRC.mjs +0 -2
- package/dist/esm/chunk-6JFZZLRC.mjs.map +0 -1
- package/dist/esm/chunk-AFTMLXYT.mjs +0 -2
- package/dist/esm/chunk-CCQRMKD2.mjs +0 -2
- package/dist/esm/chunk-CCQRMKD2.mjs.map +0 -1
- package/dist/esm/chunk-CYNQRMO5.mjs +0 -2
- package/dist/esm/chunk-CYNQRMO5.mjs.map +0 -1
- package/dist/esm/chunk-EUUIYMYC.mjs +0 -2
- package/dist/esm/chunk-F7EMGK4M.mjs +0 -2
- package/dist/esm/chunk-F7J7ZW4H.mjs +0 -2
- package/dist/esm/chunk-FNKDXPPQ.mjs +0 -2
- package/dist/esm/chunk-FVN6MJTH.mjs +0 -2
- package/dist/esm/chunk-FVN6MJTH.mjs.map +0 -1
- package/dist/esm/chunk-FWPK5KC2.mjs +0 -2
- package/dist/esm/chunk-FWPK5KC2.mjs.map +0 -1
- package/dist/esm/chunk-HYCGMFC2.mjs +0 -2
- package/dist/esm/chunk-HYCGMFC2.mjs.map +0 -1
- package/dist/esm/chunk-JE7INUQ2.mjs +0 -2
- package/dist/esm/chunk-JE7INUQ2.mjs.map +0 -1
- package/dist/esm/chunk-LG7RJQ57.mjs +0 -2
- package/dist/esm/chunk-LGOZUIGE.mjs +0 -2
- package/dist/esm/chunk-LKVJZTBM.mjs.map +0 -1
- package/dist/esm/chunk-LX53BIRN.mjs +0 -2
- package/dist/esm/chunk-NYXLPBKE.mjs +0 -2
- package/dist/esm/chunk-OIH4KBXW.mjs +0 -2
- package/dist/esm/chunk-OIH4KBXW.mjs.map +0 -1
- package/dist/esm/chunk-OWW6SIDP.mjs +0 -2
- package/dist/esm/chunk-OWW6SIDP.mjs.map +0 -1
- package/dist/esm/chunk-P2CIREOD.mjs +0 -2
- package/dist/esm/chunk-R5NNAF5B.mjs +0 -2
- package/dist/esm/chunk-R5NNAF5B.mjs.map +0 -1
- package/dist/esm/chunk-ROXFCLDT.mjs +0 -2
- package/dist/esm/chunk-RTSWVT2Q.mjs +0 -2
- package/dist/esm/chunk-RTSWVT2Q.mjs.map +0 -1
- package/dist/esm/chunk-T2WZWN6W.mjs +0 -2
- package/dist/esm/chunk-UO3NZ5AH.mjs +0 -1
- package/dist/esm/chunk-UVSRX4SV.mjs +0 -1
- package/dist/esm/chunk-V3DEJBS6.mjs +0 -2
- package/dist/esm/chunk-V6J6AW5T.mjs +0 -2
- package/dist/esm/chunk-V6J6AW5T.mjs.map +0 -1
- package/dist/esm/chunk-VEB6NALT.mjs +0 -2
- package/dist/esm/chunk-VEB6NALT.mjs.map +0 -1
- package/dist/esm/chunk-WZSVQBPA.mjs +0 -2
- package/dist/esm/chunk-XHEZAVN3.mjs +0 -2
- package/dist/esm/chunk-XXBMHWNV.mjs.map +0 -1
- /package/dist/esm/{chunk-UO3NZ5AH.mjs.map → account/EphemeralKeyPair.mjs.map} +0 -0
- /package/dist/esm/{chunk-UVSRX4SV.mjs.map → account/KeylessAccount.mjs.map} +0 -0
- /package/dist/esm/{chunk-BCLP2ENK.mjs.map → chunk-2H24BEJI.mjs.map} +0 -0
- /package/dist/esm/{chunk-DO444YYD.mjs.map → chunk-3AIEYUPP.mjs.map} +0 -0
- /package/dist/esm/{chunk-ROXFCLDT.mjs.map → chunk-3RJZNUCQ.mjs.map} +0 -0
- /package/dist/esm/{chunk-LX53BIRN.mjs.map → chunk-472OGHMG.mjs.map} +0 -0
- /package/dist/esm/{chunk-AFTMLXYT.mjs.map → chunk-4VPCPASN.mjs.map} +0 -0
- /package/dist/esm/{chunk-DBC2JY65.mjs.map → chunk-5C5GZJ57.mjs.map} +0 -0
- /package/dist/esm/{chunk-HZ3YB6TN.mjs.map → chunk-5UXARGTJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-I3MG3W4J.mjs.map → chunk-5X5GQF3E.mjs.map} +0 -0
- /package/dist/esm/{chunk-GHYE26Q5.mjs.map → chunk-6FBKUTGF.mjs.map} +0 -0
- /package/dist/esm/{chunk-2XVDVF5C.mjs.map → chunk-7BW2N4IE.mjs.map} +0 -0
- /package/dist/esm/{chunk-MEXWNZY6.mjs.map → chunk-7M6OCGHL.mjs.map} +0 -0
- /package/dist/esm/{chunk-BCUSI3N6.mjs.map → chunk-AOCNYMMX.mjs.map} +0 -0
- /package/dist/esm/{chunk-VJL6AF64.mjs.map → chunk-ASK3DESW.mjs.map} +0 -0
- /package/dist/esm/{chunk-JWTZDA6A.mjs.map → chunk-BO44HPGU.mjs.map} +0 -0
- /package/dist/esm/{chunk-JNDRFTEA.mjs.map → chunk-DPWEHSHH.mjs.map} +0 -0
- /package/dist/esm/{chunk-WNVUG2UF.mjs.map → chunk-EFMAZTIM.mjs.map} +0 -0
- /package/dist/esm/{chunk-UF5B4XMN.mjs.map → chunk-ET4WC6TJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-LG7RJQ57.mjs.map → chunk-FBPNHF54.mjs.map} +0 -0
- /package/dist/esm/{chunk-YJIRT3GJ.mjs.map → chunk-FGGRPEQ3.mjs.map} +0 -0
- /package/dist/esm/{chunk-5SQAHWDI.mjs.map → chunk-FIG65OJD.mjs.map} +0 -0
- /package/dist/esm/{chunk-ISIUQQMV.mjs.map → chunk-FNFQA7NS.mjs.map} +0 -0
- /package/dist/esm/{chunk-FNKDXPPQ.mjs.map → chunk-GRHLQDHF.mjs.map} +0 -0
- /package/dist/esm/{chunk-WZSVQBPA.mjs.map → chunk-GSCM444Z.mjs.map} +0 -0
- /package/dist/esm/{chunk-QKV2H27T.mjs.map → chunk-HJAB473N.mjs.map} +0 -0
- /package/dist/esm/{chunk-YTJ73ZX3.mjs.map → chunk-IFAWCHUG.mjs.map} +0 -0
- /package/dist/esm/{chunk-EUUIYMYC.mjs.map → chunk-IT7YNITU.mjs.map} +0 -0
- /package/dist/esm/{chunk-TZCETTAW.mjs.map → chunk-IXFYYWAC.mjs.map} +0 -0
- /package/dist/esm/{chunk-FW6TF3O2.mjs.map → chunk-J7HG6SQO.mjs.map} +0 -0
- /package/dist/esm/{chunk-HMTYASEZ.mjs.map → chunk-JLXE5JF6.mjs.map} +0 -0
- /package/dist/esm/{chunk-AKJZL3HT.mjs.map → chunk-KDLQ2V3L.mjs.map} +0 -0
- /package/dist/esm/{chunk-OOH7MH2H.mjs.map → chunk-KGKEU2WI.mjs.map} +0 -0
- /package/dist/esm/{chunk-FLUCRNGU.mjs.map → chunk-L5ZHZWHI.mjs.map} +0 -0
- /package/dist/esm/{chunk-S5AGI7RQ.mjs.map → chunk-MLX6DFMR.mjs.map} +0 -0
- /package/dist/esm/{chunk-RC6B45PP.mjs.map → chunk-MRUDDEJ3.mjs.map} +0 -0
- /package/dist/esm/{chunk-P2CIREOD.mjs.map → chunk-NW3WUTTD.mjs.map} +0 -0
- /package/dist/esm/{chunk-LVYNEPH4.mjs.map → chunk-O6QLAP7N.mjs.map} +0 -0
- /package/dist/esm/{chunk-QIELBIZW.mjs.map → chunk-P67NJHS5.mjs.map} +0 -0
- /package/dist/esm/{chunk-TAVPFLW5.mjs.map → chunk-PBMSO6WI.mjs.map} +0 -0
- /package/dist/esm/{chunk-43HKFNUB.mjs.map → chunk-QFVQSFBZ.mjs.map} +0 -0
- /package/dist/esm/{chunk-YMHX6GC2.mjs.map → chunk-R5THMTSP.mjs.map} +0 -0
- /package/dist/esm/{chunk-AR3GW64L.mjs.map → chunk-SNDFJWYM.mjs.map} +0 -0
- /package/dist/esm/{chunk-JHBMHOSV.mjs.map → chunk-T5YEMU53.mjs.map} +0 -0
- /package/dist/esm/{chunk-DPWXEJP6.mjs.map → chunk-TAT3K5M7.mjs.map} +0 -0
- /package/dist/esm/{chunk-LM7CN4LT.mjs.map → chunk-TCK35M7E.mjs.map} +0 -0
- /package/dist/esm/{chunk-F7EMGK4M.mjs.map → chunk-TJDC5PWD.mjs.map} +0 -0
- /package/dist/esm/{chunk-LF6IQT54.mjs.map → chunk-TUCCV62K.mjs.map} +0 -0
- /package/dist/esm/{chunk-OLKEU7WZ.mjs.map → chunk-U2R36WTE.mjs.map} +0 -0
- /package/dist/esm/{chunk-V3DEJBS6.mjs.map → chunk-U5F4NL24.mjs.map} +0 -0
- /package/dist/esm/{chunk-F7J7ZW4H.mjs.map → chunk-WA2NTBYY.mjs.map} +0 -0
- /package/dist/esm/{chunk-X6BYF2UD.mjs.map → chunk-WIYDJE6F.mjs.map} +0 -0
- /package/dist/esm/{chunk-CX4BEIQT.mjs.map → chunk-XVZBWW46.mjs.map} +0 -0
- /package/dist/esm/{chunk-V367QLY3.mjs.map → chunk-Y4E6NTAS.mjs.map} +0 -0
- /package/dist/esm/{chunk-6SK246YU.mjs.map → chunk-YA4XTZNZ.mjs.map} +0 -0
- /package/dist/esm/{chunk-A7J2UMLS.mjs.map → chunk-YDNOKWV3.mjs.map} +0 -0
- /package/dist/esm/{chunk-4D42AAH3.mjs.map → chunk-YRUF6N3U.mjs.map} +0 -0
- /package/dist/esm/{chunk-ZMXURV35.mjs.map → chunk-ZIDLP5MI.mjs.map} +0 -0
- /package/dist/esm/{chunk-OO5EJW3B.mjs.map → chunk-ZMHGGT4E.mjs.map} +0 -0
- /package/dist/esm/{chunk-AWPRGMUP.mjs.map → chunk-ZV5MKFV7.mjs.map} +0 -0
- /package/dist/esm/{publicKey-B3XRNhHO.d.mts → publicKey-lq5djCIY.d.mts} +0 -0
|
@@ -7,6 +7,7 @@ import { AccountAddress } from "../core/accountAddress";
|
|
|
7
7
|
import { HexInput, SigningScheme } from "../types";
|
|
8
8
|
import { AccountAuthenticatorMultiKey } from "../transactions/authenticator/account";
|
|
9
9
|
import { AnyRawTransaction } from "../transactions/types";
|
|
10
|
+
import { KeylessAccount } from "./KeylessAccount";
|
|
10
11
|
|
|
11
12
|
export interface VerifyMultiKeySignatureArgs {
|
|
12
13
|
message: HexInput;
|
|
@@ -123,6 +124,16 @@ export class MultiKeyAccount implements Account {
|
|
|
123
124
|
return new AccountAuthenticatorMultiKey(this.publicKey, this.signTransaction(transaction));
|
|
124
125
|
}
|
|
125
126
|
|
|
127
|
+
/**
|
|
128
|
+
* Waits for any proofs on any KeylessAccount signers to be fetched. If the proof is fetched a syncronously, call this
|
|
129
|
+
* to ensure signing with the KeylessAccount does not fail as the proof must be ready.
|
|
130
|
+
* @return
|
|
131
|
+
*/
|
|
132
|
+
async waitForProofFetch() {
|
|
133
|
+
const keylessSigners = this.signers.filter((signer) => signer instanceof KeylessAccount) as KeylessAccount[];
|
|
134
|
+
await Promise.all(keylessSigners.filter((signer) => signer.proof instanceof Promise).map((signer) => signer.proof));
|
|
135
|
+
}
|
|
136
|
+
|
|
126
137
|
/**
|
|
127
138
|
* Sign the given message using the MultiKeyAccount's signers
|
|
128
139
|
* @param message in HexInput format
|
package/src/account/index.ts
CHANGED
package/src/api/aptos.ts
CHANGED
|
@@ -13,6 +13,7 @@ import { ANS } from "./ans";
|
|
|
13
13
|
import { Staking } from "./staking";
|
|
14
14
|
import { Transaction } from "./transaction";
|
|
15
15
|
import { Table } from "./table";
|
|
16
|
+
import { Keyless } from "./keyless";
|
|
16
17
|
|
|
17
18
|
/**
|
|
18
19
|
* This class is the main entry point into Aptos's
|
|
@@ -50,6 +51,8 @@ export class Aptos {
|
|
|
50
51
|
|
|
51
52
|
readonly table: Table;
|
|
52
53
|
|
|
54
|
+
readonly keyless: Keyless;
|
|
55
|
+
|
|
53
56
|
constructor(settings?: AptosConfig) {
|
|
54
57
|
this.config = new AptosConfig(settings);
|
|
55
58
|
this.account = new Account(this.config);
|
|
@@ -63,6 +66,7 @@ export class Aptos {
|
|
|
63
66
|
this.staking = new Staking(this.config);
|
|
64
67
|
this.transaction = new Transaction(this.config);
|
|
65
68
|
this.table = new Table(this.config);
|
|
69
|
+
this.keyless = new Keyless(this.config);
|
|
66
70
|
}
|
|
67
71
|
}
|
|
68
72
|
|
|
@@ -77,6 +81,7 @@ export interface Aptos
|
|
|
77
81
|
Faucet,
|
|
78
82
|
FungibleAsset,
|
|
79
83
|
General,
|
|
84
|
+
Keyless,
|
|
80
85
|
Staking,
|
|
81
86
|
Table,
|
|
82
87
|
Omit<Transaction, "build" | "simulate" | "submit" | "batch"> {}
|
|
@@ -113,3 +118,4 @@ applyMixin(Aptos, General, "general");
|
|
|
113
118
|
applyMixin(Aptos, Staking, "staking");
|
|
114
119
|
applyMixin(Aptos, Transaction, "transaction");
|
|
115
120
|
applyMixin(Aptos, Table, "table");
|
|
121
|
+
applyMixin(Aptos, Keyless, "keyless");
|
package/src/api/aptosConfig.ts
CHANGED
|
@@ -3,7 +3,14 @@
|
|
|
3
3
|
|
|
4
4
|
import aptosClient from "@aptos-labs/aptos-client";
|
|
5
5
|
import { AptosSettings, ClientConfig, Client, FullNodeConfig, IndexerConfig, FaucetConfig } from "../types";
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
NetworkToNodeAPI,
|
|
8
|
+
NetworkToFaucetAPI,
|
|
9
|
+
NetworkToIndexerAPI,
|
|
10
|
+
Network,
|
|
11
|
+
NetworkToPepperAPI,
|
|
12
|
+
NetworkToProverAPI,
|
|
13
|
+
} from "../utils/apiEndpoints";
|
|
7
14
|
import { AptosApiType } from "../utils/const";
|
|
8
15
|
|
|
9
16
|
/**
|
|
@@ -34,6 +41,16 @@ export class AptosConfig {
|
|
|
34
41
|
*/
|
|
35
42
|
readonly faucet?: string;
|
|
36
43
|
|
|
44
|
+
/**
|
|
45
|
+
* The optional hardcoded pepper service URL to send requests to instead of using the network
|
|
46
|
+
*/
|
|
47
|
+
readonly pepper?: string;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* The optional hardcoded prover service URL to send requests to instead of using the network
|
|
51
|
+
*/
|
|
52
|
+
readonly prover?: string;
|
|
53
|
+
|
|
37
54
|
/**
|
|
38
55
|
* The optional hardcoded indexer URL to send requests to instead of using the network
|
|
39
56
|
*/
|
|
@@ -63,6 +80,8 @@ export class AptosConfig {
|
|
|
63
80
|
this.network = settings?.network ?? Network.DEVNET;
|
|
64
81
|
this.fullnode = settings?.fullnode;
|
|
65
82
|
this.faucet = settings?.faucet;
|
|
83
|
+
this.pepper = settings?.pepper;
|
|
84
|
+
this.prover = settings?.prover;
|
|
66
85
|
this.indexer = settings?.indexer;
|
|
67
86
|
this.client = settings?.client ?? { provider: aptosClient };
|
|
68
87
|
this.clientConfig = settings?.clientConfig ?? {};
|
|
@@ -95,8 +114,34 @@ export class AptosConfig {
|
|
|
95
114
|
if (this.indexer !== undefined) return this.indexer;
|
|
96
115
|
if (this.network === Network.CUSTOM) throw new Error("Please provide a custom indexer url");
|
|
97
116
|
return NetworkToIndexerAPI[this.network];
|
|
117
|
+
case AptosApiType.PEPPER:
|
|
118
|
+
if (this.pepper !== undefined) return this.pepper;
|
|
119
|
+
if (this.network === Network.CUSTOM) throw new Error("Please provide a custom pepper service url");
|
|
120
|
+
return NetworkToPepperAPI[this.network];
|
|
121
|
+
case AptosApiType.PROVER:
|
|
122
|
+
if (this.prover !== undefined) return this.prover;
|
|
123
|
+
if (this.network === Network.CUSTOM) throw new Error("Please provide a custom prover service url");
|
|
124
|
+
return NetworkToProverAPI[this.network];
|
|
98
125
|
default:
|
|
99
126
|
throw Error(`apiType ${apiType} is not supported`);
|
|
100
127
|
}
|
|
101
128
|
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Checks if the URL is a known pepper service endpoint
|
|
132
|
+
*
|
|
133
|
+
* @internal
|
|
134
|
+
* */
|
|
135
|
+
isPepperServiceRequest(url: string): boolean {
|
|
136
|
+
return NetworkToPepperAPI[this.network] === url;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Checks if the URL is a known prover service endpoint
|
|
141
|
+
*
|
|
142
|
+
* @internal
|
|
143
|
+
* */
|
|
144
|
+
isProverServiceRequest(url: string): boolean {
|
|
145
|
+
return NetworkToProverAPI[this.network] === url;
|
|
146
|
+
}
|
|
102
147
|
}
|
package/src/api/general.ts
CHANGED
|
@@ -3,14 +3,13 @@
|
|
|
3
3
|
|
|
4
4
|
import { AptosConfig } from "./aptosConfig";
|
|
5
5
|
import {
|
|
6
|
-
getBlockByHeight,
|
|
7
|
-
getBlockByVersion,
|
|
8
6
|
getChainTopUserTransactions,
|
|
9
7
|
getIndexerLastSuccessVersion,
|
|
10
8
|
getLedgerInfo,
|
|
11
9
|
getProcessorStatus,
|
|
12
10
|
queryIndexer,
|
|
13
11
|
} from "../internal/general";
|
|
12
|
+
import { getBlockByHeight, getBlockByVersion } from "../internal/transaction";
|
|
14
13
|
import { view } from "../internal/view";
|
|
15
14
|
import {
|
|
16
15
|
AnyNumber,
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// Copyright © Aptos Foundation
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import { EphemeralKeyPair, KeylessAccount, ProofFetchCallback } from "../account";
|
|
5
|
+
import { deriveKeylessAccount, getPepper } from "../internal/keyless";
|
|
6
|
+
import { HexInput } from "../types";
|
|
7
|
+
import { AptosConfig } from "./aptosConfig";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* A class to query all `Keyless` related queries on Aptos.
|
|
11
|
+
*
|
|
12
|
+
* More documentation on how to integrate Keyless Accounts see the below
|
|
13
|
+
* https://aptos.dev/guides/keyless-accounts/#aptos-keyless-integration-guide
|
|
14
|
+
*/
|
|
15
|
+
export class Keyless {
|
|
16
|
+
constructor(readonly config: AptosConfig) {}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Fetches the pepper from the Aptos pepper service API.
|
|
20
|
+
*
|
|
21
|
+
* @param args.jwt JWT token
|
|
22
|
+
* @param args.ephemeralKeyPair the EphemeralKeyPair used to generate the nonce in the JWT token
|
|
23
|
+
* @returns The pepper which is a Uint8Array of length 31.
|
|
24
|
+
*/
|
|
25
|
+
async getPepper(args: { jwt: string; ephemeralKeyPair: EphemeralKeyPair }): Promise<Uint8Array> {
|
|
26
|
+
return getPepper({ aptosConfig: this.config, ...args });
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Fetches the pepper from the Aptos pepper service API.
|
|
31
|
+
*
|
|
32
|
+
* @param args.jwt JWT token
|
|
33
|
+
* @param args.ephemeralKeyPair the EphemeralKeyPair used to generate the nonce in the JWT token
|
|
34
|
+
* @param args.uidKey a key in the JWT token to use to set the uidVal in the IdCommitment
|
|
35
|
+
* @param args.pepper the pepper
|
|
36
|
+
* @param args.proofFetchCallback a callback function that if set, the fetch of the proof will be done in the background. Once
|
|
37
|
+
* fetching finishes the callback function will be called. This should be used to provide a more responsive user experience as now
|
|
38
|
+
* they are not blocked on fetching the proof. Thus the function will return much more quickly.
|
|
39
|
+
*
|
|
40
|
+
* @returns A KeylessAccount that can be used to sign transactions
|
|
41
|
+
*/
|
|
42
|
+
async deriveKeylessAccount(args: {
|
|
43
|
+
jwt: string;
|
|
44
|
+
ephemeralKeyPair: EphemeralKeyPair;
|
|
45
|
+
uidKey?: string;
|
|
46
|
+
pepper?: HexInput;
|
|
47
|
+
proofFetchCallback?: ProofFetchCallback;
|
|
48
|
+
}): Promise<KeylessAccount> {
|
|
49
|
+
return deriveKeylessAccount({ aptosConfig: this.config, ...args });
|
|
50
|
+
}
|
|
51
|
+
}
|
package/src/bcs/deserializer.ts
CHANGED
|
@@ -56,6 +56,52 @@ export class Deserializer {
|
|
|
56
56
|
return textDecoder.decode(value);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
/**
|
|
60
|
+
* Deserializes a an optional string.
|
|
61
|
+
*
|
|
62
|
+
* BCS layout for Optional<String>: 0 if none, else 1 | string_length | string_content
|
|
63
|
+
* @example
|
|
64
|
+
* ```ts
|
|
65
|
+
* const deserializer = new Deserializer(new Uint8Array([0x00]));
|
|
66
|
+
* assert(deserializer.deserializeOptionStr() === undefined);
|
|
67
|
+
* const deserializer = new Deserializer(new Uint8Array([1, 8, 49, 50, 51, 52, 97, 98, 99, 100]));
|
|
68
|
+
* assert(deserializer.deserializeOptionStr() === "1234abcd");
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
deserializeOptionStr(): string | undefined {
|
|
72
|
+
const exists = this.deserializeUleb128AsU32();
|
|
73
|
+
if (exists === 1) {
|
|
74
|
+
return this.deserializeStr();
|
|
75
|
+
}
|
|
76
|
+
return undefined;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Deserializes a an optional deserializable class.
|
|
81
|
+
*
|
|
82
|
+
* BCS layout for Optional<T>: 0 if none, else 1 | bcs representation of class
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* const deserializer = new Deserializer(new Uint8Array([1, 2, 3]));
|
|
86
|
+
* const value = deserializer.deserializeOption(MyClass); // where MyClass has a `deserialize` function
|
|
87
|
+
* // value is now an instance of MyClass
|
|
88
|
+
*
|
|
89
|
+
* const deserializer = new Deserializer(new Uint8Array([0]));
|
|
90
|
+
* const value = deserializer.deserializeOption(MyClass); // where MyClass has a `deserialize` function
|
|
91
|
+
* // value is undefined
|
|
92
|
+
*
|
|
93
|
+
* @param cls The BCS-deserializable class to deserialize the buffered bytes into.
|
|
94
|
+
*
|
|
95
|
+
* @returns the deserialized value of class type T
|
|
96
|
+
*/
|
|
97
|
+
deserializeOption<T>(cls: Deserializable<T>): T | undefined {
|
|
98
|
+
const exists = this.deserializeUleb128AsU32();
|
|
99
|
+
if (exists === 1) {
|
|
100
|
+
return this.deserialize(cls);
|
|
101
|
+
}
|
|
102
|
+
return undefined;
|
|
103
|
+
}
|
|
104
|
+
|
|
59
105
|
/**
|
|
60
106
|
* Deserializes an array of bytes.
|
|
61
107
|
*
|
package/src/bcs/serializer.ts
CHANGED
|
@@ -316,6 +316,64 @@ export class Serializer {
|
|
|
316
316
|
item.serialize(this);
|
|
317
317
|
});
|
|
318
318
|
}
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Serializes a BCS Serializable values into a serializer instance or undefined.
|
|
322
|
+
* Note that this does not return anything. The bytes are added to the serializer instance's byte buffer.
|
|
323
|
+
*
|
|
324
|
+
* @param values The array of BCS Serializable values
|
|
325
|
+
*
|
|
326
|
+
* @example
|
|
327
|
+
* ```ts
|
|
328
|
+
* const serializer = new Serializer();
|
|
329
|
+
* serializer.serializeOption(new AccountAddress(...));
|
|
330
|
+
* const serializedBytes = serializer.toUint8Array();
|
|
331
|
+
* // serializedBytes is now the BCS-serialized byte representation of AccountAddress
|
|
332
|
+
*
|
|
333
|
+
* const serializer = new Serializer();
|
|
334
|
+
* serializer.serializeOption(undefined);
|
|
335
|
+
* assert(serializer.toUint8Array() === new Uint8Array([0x00]));
|
|
336
|
+
* ```
|
|
337
|
+
*/
|
|
338
|
+
serializeOption<T extends Serializable>(value?: T): void {
|
|
339
|
+
if (value === undefined) {
|
|
340
|
+
this.serializeU32AsUleb128(0);
|
|
341
|
+
} else {
|
|
342
|
+
this.serializeU32AsUleb128(1);
|
|
343
|
+
value.serialize(this);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* Serializes an optional string. UTF8 string is supported.
|
|
349
|
+
*
|
|
350
|
+
* The existence of the string is encoded first, 0 if undefined and 1 if it exists.
|
|
351
|
+
* Them the number of bytes in the string content is serialized, as a uleb128-encoded u32 integer.
|
|
352
|
+
* Then the string content is serialized as UTF8 encoded bytes.
|
|
353
|
+
*
|
|
354
|
+
* BCS layout for optional "string": 1 | string_length | string_content
|
|
355
|
+
* where string_length is a u32 integer encoded as a uleb128 integer, equal to the number of bytes in string_content.
|
|
356
|
+
*
|
|
357
|
+
* BCS layout for undefined: 0
|
|
358
|
+
* @example
|
|
359
|
+
* ```ts
|
|
360
|
+
* const serializer = new Serializer();
|
|
361
|
+
* serializer.serializeOptionStr("1234abcd");
|
|
362
|
+
* assert(serializer.toUint8Array() === new Uint8Array([1, 8, 49, 50, 51, 52, 97, 98, 99, 100]));
|
|
363
|
+
*
|
|
364
|
+
* const serializer = new Serializer();
|
|
365
|
+
* serializer.serializeOptionStr(undefined);
|
|
366
|
+
* assert(serializer.toUint8Array() === new Uint8Array([0]));
|
|
367
|
+
* ```
|
|
368
|
+
*/
|
|
369
|
+
serializeOptionStr(value?: string): void {
|
|
370
|
+
if (value === undefined) {
|
|
371
|
+
this.serializeU32AsUleb128(0);
|
|
372
|
+
} else {
|
|
373
|
+
this.serializeU32AsUleb128(1);
|
|
374
|
+
this.serializeStr(value);
|
|
375
|
+
}
|
|
376
|
+
}
|
|
319
377
|
}
|
|
320
378
|
|
|
321
379
|
export function ensureBoolean(value: unknown): asserts value is boolean {
|
package/src/client/core.ts
CHANGED
|
@@ -100,6 +100,10 @@ export async function aptosRequest<Req extends {}, Res extends {}>(
|
|
|
100
100
|
);
|
|
101
101
|
}
|
|
102
102
|
result.data = indexerResponse.data as Res;
|
|
103
|
+
} else if (apiType === AptosApiType.PEPPER || apiType === AptosApiType.PROVER) {
|
|
104
|
+
if (result.status >= 400) {
|
|
105
|
+
throw new AptosApiError(options, result, `${response.data}`);
|
|
106
|
+
}
|
|
103
107
|
}
|
|
104
108
|
|
|
105
109
|
if (result.status >= 200 && result.status < 300) {
|
package/src/client/get.ts
CHANGED
|
@@ -89,6 +89,18 @@ export async function getAptosFullNode<Req extends {}, Res extends {}>(
|
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
+
/**
|
|
93
|
+
* Makes a get request to the pepper service
|
|
94
|
+
*
|
|
95
|
+
* @param options GetAptosRequestOptions
|
|
96
|
+
* @returns AptosResponse
|
|
97
|
+
*/
|
|
98
|
+
export async function getAptosPepperService<Req extends {}, Res extends {}>(
|
|
99
|
+
options: GetAptosRequestOptions,
|
|
100
|
+
): Promise<AptosResponse<Req, Res>> {
|
|
101
|
+
return get<Req, Res>({ ...options, type: AptosApiType.PEPPER });
|
|
102
|
+
}
|
|
103
|
+
|
|
92
104
|
/// This function is a helper for paginating using a function wrapping an API
|
|
93
105
|
export async function paginateWithCursor<Req extends Record<string, any>, Res extends Array<{}>>(
|
|
94
106
|
options: GetAptosRequestOptions,
|
package/src/client/post.ts
CHANGED
|
@@ -135,3 +135,21 @@ export async function postAptosFaucet<Req extends {}, Res extends {}>(
|
|
|
135
135
|
},
|
|
136
136
|
});
|
|
137
137
|
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Makes a post request to the pepper service
|
|
141
|
+
*
|
|
142
|
+
* @param options GetAptosRequestOptions
|
|
143
|
+
* @returns AptosResponse
|
|
144
|
+
*/
|
|
145
|
+
export async function postAptosPepperService<Req extends {}, Res extends {}>(
|
|
146
|
+
options: PostAptosRequestOptions,
|
|
147
|
+
): Promise<AptosResponse<Req, Res>> {
|
|
148
|
+
return post<Req, Res>({ ...options, type: AptosApiType.PEPPER });
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export async function postAptosProvingService<Req extends {}, Res extends {}>(
|
|
152
|
+
options: PostAptosRequestOptions,
|
|
153
|
+
): Promise<AptosResponse<Req, Res>> {
|
|
154
|
+
return post<Req, Res>({ ...options, type: AptosApiType.PROVER });
|
|
155
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { generateSigningMessage } from "../../transactions/transactionBuilder/signingMessage";
|
|
2
|
+
import { Serializable } from "../../bcs/serializer";
|
|
3
|
+
|
|
4
|
+
export type AptsoDomainSeparator = `APTOS::${string}`;
|
|
5
|
+
export abstract class CryptoHashable extends Serializable {
|
|
6
|
+
abstract readonly domainSeparator: AptsoDomainSeparator;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Hashes the bcs serialized from of the class. This is the typescript corollary to the BCSCryptoHash macro in aptos-core.
|
|
10
|
+
*
|
|
11
|
+
* @returns Uint8Array
|
|
12
|
+
*/
|
|
13
|
+
hash(): Uint8Array {
|
|
14
|
+
return generateSigningMessage(this.bcsToBytes(), this.domainSeparator);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { Serializer, Deserializer } from "../../bcs";
|
|
2
|
+
import { EphemeralPublicKeyVariant, EphemeralSignatureVariant, HexInput } from "../../types";
|
|
3
|
+
import { PublicKey } from "./publicKey";
|
|
4
|
+
import { Signature } from "./signature";
|
|
5
|
+
import { Ed25519PublicKey, Ed25519Signature } from "./ed25519";
|
|
6
|
+
import { Hex } from "../hex";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Represents ephemeral public keys for Aptos Keyless accounts.
|
|
10
|
+
*
|
|
11
|
+
* These are not public keys used as a public key on an account. They are only used ephemerally on Keyless accounts.
|
|
12
|
+
*/
|
|
13
|
+
export class EphemeralPublicKey extends PublicKey {
|
|
14
|
+
/**
|
|
15
|
+
* The public key itself
|
|
16
|
+
*/
|
|
17
|
+
public readonly publicKey: PublicKey;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* An enum indicating the scheme of the ephemeral public key
|
|
21
|
+
*/
|
|
22
|
+
public readonly variant: EphemeralPublicKeyVariant;
|
|
23
|
+
|
|
24
|
+
constructor(publicKey: PublicKey) {
|
|
25
|
+
super();
|
|
26
|
+
const publicKeyType = publicKey.constructor.name;
|
|
27
|
+
switch (publicKeyType) {
|
|
28
|
+
case Ed25519PublicKey.name:
|
|
29
|
+
this.publicKey = publicKey;
|
|
30
|
+
this.variant = EphemeralPublicKeyVariant.Ed25519;
|
|
31
|
+
break;
|
|
32
|
+
default:
|
|
33
|
+
throw new Error(`Unsupported key for EphemeralPublicKey - ${publicKeyType}`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Get the public key in bytes (Uint8Array).
|
|
39
|
+
*
|
|
40
|
+
* @returns Uint8Array representation of the public key
|
|
41
|
+
*/
|
|
42
|
+
toUint8Array(): Uint8Array {
|
|
43
|
+
return this.bcsToBytes();
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Verifies a signed data with a the ephemeral public key
|
|
48
|
+
*
|
|
49
|
+
* @param args.message message
|
|
50
|
+
* @param args.signature The signature that was signed by the private key of the ephemeral public key
|
|
51
|
+
* @returns true if the signature is valid
|
|
52
|
+
*/
|
|
53
|
+
verifySignature(args: { message: HexInput; signature: EphemeralSignature }): boolean {
|
|
54
|
+
const { message, signature } = args;
|
|
55
|
+
return this.publicKey.verifySignature({ message, signature });
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
serialize(serializer: Serializer): void {
|
|
59
|
+
if (this.publicKey instanceof Ed25519PublicKey) {
|
|
60
|
+
serializer.serializeU32AsUleb128(EphemeralPublicKeyVariant.Ed25519);
|
|
61
|
+
this.publicKey.serialize(serializer);
|
|
62
|
+
} else {
|
|
63
|
+
throw new Error("Unknown public key type");
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
static deserialize(deserializer: Deserializer): EphemeralPublicKey {
|
|
68
|
+
const index = deserializer.deserializeUleb128AsU32();
|
|
69
|
+
switch (index) {
|
|
70
|
+
case EphemeralPublicKeyVariant.Ed25519:
|
|
71
|
+
return new EphemeralPublicKey(Ed25519PublicKey.deserialize(deserializer));
|
|
72
|
+
default:
|
|
73
|
+
throw new Error(`Unknown variant index for EphemeralPublicKey: ${index}`);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
static isPublicKey(publicKey: PublicKey): publicKey is EphemeralPublicKey {
|
|
78
|
+
return publicKey instanceof EphemeralPublicKey;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Represents ephemeral signatures used in Aptos Keyless accounts.
|
|
84
|
+
*
|
|
85
|
+
* These signatures are used inside of KeylessSignature
|
|
86
|
+
*/
|
|
87
|
+
export class EphemeralSignature extends Signature {
|
|
88
|
+
/**
|
|
89
|
+
* The signature signed by the private key of an EphemeralKeyPair
|
|
90
|
+
*/
|
|
91
|
+
public readonly signature: Signature;
|
|
92
|
+
|
|
93
|
+
constructor(signature: Signature) {
|
|
94
|
+
super();
|
|
95
|
+
const signatureType = signature.constructor.name;
|
|
96
|
+
switch (signatureType) {
|
|
97
|
+
case Ed25519Signature.name:
|
|
98
|
+
this.signature = signature;
|
|
99
|
+
break;
|
|
100
|
+
default:
|
|
101
|
+
throw new Error(`Unsupported signature for EphemeralSignature - ${signatureType}`);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Get the public key in bytes (Uint8Array).
|
|
107
|
+
*
|
|
108
|
+
* @returns Uint8Array representation of the public key
|
|
109
|
+
*/
|
|
110
|
+
toUint8Array(): Uint8Array {
|
|
111
|
+
return this.bcsToBytes();
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
static fromHex(hexInput: HexInput): EphemeralSignature {
|
|
115
|
+
const data = Hex.fromHexInput(hexInput);
|
|
116
|
+
const deserializer = new Deserializer(data.toUint8Array());
|
|
117
|
+
return EphemeralSignature.deserialize(deserializer);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
serialize(serializer: Serializer): void {
|
|
121
|
+
if (this.signature instanceof Ed25519Signature) {
|
|
122
|
+
serializer.serializeU32AsUleb128(EphemeralSignatureVariant.Ed25519);
|
|
123
|
+
this.signature.serialize(serializer);
|
|
124
|
+
} else {
|
|
125
|
+
throw new Error("Unknown signature type");
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
static deserialize(deserializer: Deserializer): EphemeralSignature {
|
|
130
|
+
const index = deserializer.deserializeUleb128AsU32();
|
|
131
|
+
switch (index) {
|
|
132
|
+
case EphemeralSignatureVariant.Ed25519:
|
|
133
|
+
return new EphemeralSignature(Ed25519Signature.deserialize(deserializer));
|
|
134
|
+
default:
|
|
135
|
+
throw new Error(`Unknown variant index for EphemeralSignature: ${index}`);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
package/src/core/crypto/index.ts
CHANGED
|
@@ -5,6 +5,8 @@ export * from "./ed25519";
|
|
|
5
5
|
export * from "./hdKey";
|
|
6
6
|
export * from "./multiEd25519";
|
|
7
7
|
export * from "./multiKey";
|
|
8
|
+
export * from "./ephemeral";
|
|
9
|
+
export * from "./keyless";
|
|
8
10
|
export * from "./privateKey";
|
|
9
11
|
export * from "./publicKey";
|
|
10
12
|
export * from "./secp256k1";
|