@aptos-labs/ts-sdk 1.15.0 → 1.16.0-zeta.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-ccLvlUQe.d.ts → accountAddress-BtD_TE5q.d.ts} +49 -3
- package/dist/common/chunk-VLEH6QBR.js +2 -0
- package/dist/common/chunk-VLEH6QBR.js.map +1 -0
- package/dist/common/cli/index.d.ts +1 -1
- package/dist/common/cli/index.js +1 -1
- package/dist/common/cli/index.js.map +1 -1
- package/dist/common/index.d.ts +627 -52
- 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 +85 -0
- package/dist/esm/account/EphemeralKeyPair.mjs +2 -0
- package/dist/esm/account/KeylessAccount.d.mts +166 -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 +10 -2
- 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 +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 +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 +10 -2
- package/dist/esm/api/index.mjs +1 -1
- package/dist/esm/api/keyless.d.mts +83 -0
- package/dist/esm/api/keyless.mjs +2 -0
- package/dist/esm/api/keyless.mjs.map +1 -0
- 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/cryptoHasher.d.mts +15 -0
- package/dist/esm/bcs/cryptoHasher.mjs +2 -0
- package/dist/esm/bcs/cryptoHasher.mjs.map +1 -0
- package/dist/esm/bcs/deserializer.d.mts +26 -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 +2 -0
- package/dist/esm/bcs/serializer.mjs +1 -1
- package/dist/esm/chunk-3FVRXELT.mjs +2 -0
- package/dist/esm/{chunk-U3YYSIIT.mjs → chunk-3VGX3TXH.mjs} +2 -2
- package/dist/esm/{chunk-GP6Z47HM.mjs → chunk-3Y6JNFPD.mjs} +2 -2
- package/dist/esm/chunk-4KEEUDZA.mjs +2 -0
- package/dist/esm/chunk-4KEEUDZA.mjs.map +1 -0
- package/dist/esm/chunk-4USAUOCE.mjs +2 -0
- package/dist/esm/{chunk-P5TZBE3L.mjs.map → chunk-4USAUOCE.mjs.map} +1 -1
- package/dist/esm/chunk-5ADNWXP2.mjs +2 -0
- package/dist/esm/chunk-5ADNWXP2.mjs.map +1 -0
- package/dist/esm/{chunk-GUALXVFI.mjs → chunk-5RRZMXND.mjs} +2 -2
- package/dist/esm/chunk-5V2RGYYK.mjs +2 -0
- package/dist/esm/chunk-5V2RGYYK.mjs.map +1 -0
- package/dist/esm/chunk-5YI2GEG5.mjs +2 -0
- package/dist/esm/chunk-5YI2GEG5.mjs.map +1 -0
- package/dist/esm/chunk-6KNAIXZ3.mjs +2 -0
- package/dist/esm/chunk-6KNAIXZ3.mjs.map +1 -0
- package/dist/esm/{chunk-I5T6PHDV.mjs → chunk-6M53MDWB.mjs} +2 -2
- package/dist/esm/chunk-6RBUXB5I.mjs +2 -0
- package/dist/esm/{chunk-SRDIYE3M.mjs.map → chunk-6RBUXB5I.mjs.map} +1 -1
- package/dist/esm/{chunk-4GWNWSZP.mjs → chunk-7H3HRFVM.mjs} +2 -2
- package/dist/esm/chunk-7QGIAVW4.mjs +2 -0
- package/dist/esm/chunk-7QGIAVW4.mjs.map +1 -0
- package/dist/esm/{chunk-5EN52MUT.mjs → chunk-7STYQ5ZE.mjs} +2 -2
- package/dist/esm/chunk-7UBKXR37.mjs +2 -0
- package/dist/esm/chunk-7UBKXR37.mjs.map +1 -0
- package/dist/esm/chunk-7Z6DYLCA.mjs +1 -0
- package/dist/esm/chunk-7Z6DYLCA.mjs.map +1 -0
- package/dist/esm/{chunk-WN3JL7ZT.mjs → chunk-A3UVZHDJ.mjs} +2 -2
- 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-MCRRHBFQ.mjs → chunk-C34M4T77.mjs} +2 -2
- package/dist/esm/chunk-C3L4ETUF.mjs +2 -0
- package/dist/esm/chunk-CNH2RAJQ.mjs +2 -0
- package/dist/esm/chunk-CNH2RAJQ.mjs.map +1 -0
- package/dist/esm/chunk-COW5IGYC.mjs +2 -0
- package/dist/esm/{chunk-CYTRYBWN.mjs → chunk-EADBYPUD.mjs} +2 -2
- package/dist/esm/{chunk-G56GPLTB.mjs → chunk-EB7AI4B4.mjs} +2 -2
- package/dist/esm/{chunk-EZPUVLME.mjs → chunk-EIRSA5UU.mjs} +2 -2
- package/dist/esm/{chunk-YK63A5T6.mjs → chunk-EPTCPBVW.mjs} +2 -2
- package/dist/esm/chunk-EU6CX56Q.mjs +2 -0
- package/dist/esm/chunk-EU6CX56Q.mjs.map +1 -0
- package/dist/esm/{chunk-UW2FPXYA.mjs → chunk-F5C4SZZ7.mjs} +2 -2
- package/dist/esm/{chunk-BN22EYXR.mjs → chunk-FBLSW5TB.mjs} +2 -2
- package/dist/esm/chunk-FBPNHF54.mjs +2 -0
- package/dist/esm/{chunk-KAGLWBIJ.mjs → chunk-HGZGTBA4.mjs} +2 -2
- package/dist/esm/chunk-I5JWDZIP.mjs +2 -0
- package/dist/esm/chunk-I5JWDZIP.mjs.map +1 -0
- package/dist/esm/chunk-IEZO4PIG.mjs +2 -0
- package/dist/esm/{chunk-FFGY7Z4B.mjs → chunk-IJE5YSXW.mjs} +2 -2
- package/dist/esm/chunk-JCDZ2WXX.mjs +2 -0
- package/dist/esm/chunk-JCDZ2WXX.mjs.map +1 -0
- package/dist/esm/chunk-JKZHPY24.mjs +2 -0
- package/dist/esm/{chunk-CJDEPZ4J.mjs.map → chunk-JKZHPY24.mjs.map} +1 -1
- package/dist/esm/chunk-JM2B5E2I.mjs +2 -0
- package/dist/esm/chunk-JM2B5E2I.mjs.map +1 -0
- package/dist/esm/{chunk-WNPL4SEJ.mjs → chunk-KFUOOBMJ.mjs} +2 -2
- package/dist/esm/{chunk-CHWE77CR.mjs → chunk-KKP4FBWZ.mjs} +2 -2
- package/dist/esm/chunk-KPZDC5ZE.mjs +2 -0
- package/dist/esm/chunk-KPZDC5ZE.mjs.map +1 -0
- package/dist/esm/{chunk-ZCG6WBLE.mjs → chunk-LEBJNW6Y.mjs} +2 -2
- package/dist/esm/chunk-LECNIPW7.mjs +2 -0
- package/dist/esm/chunk-LECNIPW7.mjs.map +1 -0
- package/dist/esm/{chunk-3Y46WJUR.mjs → chunk-LO7B3CWN.mjs} +2 -2
- package/dist/esm/{chunk-PIVZMT5D.mjs → chunk-LQH7T3TE.mjs} +2 -2
- package/dist/esm/{chunk-F7NLNWHN.mjs → chunk-M7HZOQ6A.mjs} +2 -2
- package/dist/esm/chunk-MGOHPDX4.mjs +2 -0
- package/dist/esm/{chunk-JX75UKJX.mjs → chunk-MKUAW7KW.mjs} +2 -2
- package/dist/esm/{chunk-2X7A4HUS.mjs → chunk-MTLETLKV.mjs} +2 -2
- package/dist/esm/{chunk-RT6LEYHZ.mjs → chunk-MWN63XBE.mjs} +2 -2
- package/dist/esm/chunk-MWUJCP27.mjs +2 -0
- package/dist/esm/chunk-N466X3S6.mjs +2 -0
- package/dist/esm/chunk-N466X3S6.mjs.map +1 -0
- package/dist/esm/chunk-N7CE244N.mjs +2 -0
- package/dist/esm/{chunk-2XK53QFA.mjs.map → chunk-N7CE244N.mjs.map} +1 -1
- package/dist/esm/{chunk-GM56MMNJ.mjs → chunk-NC5HHEEM.mjs} +2 -2
- package/dist/esm/chunk-NCDP26DV.mjs +2 -0
- package/dist/esm/chunk-NCDP26DV.mjs.map +1 -0
- package/dist/esm/{chunk-TM7NDDT3.mjs → chunk-NQMF46E5.mjs} +2 -2
- package/dist/esm/chunk-NWWXZ7EW.mjs +2 -0
- package/dist/esm/chunk-NWWXZ7EW.mjs.map +1 -0
- package/dist/esm/{chunk-UR3JTLIT.mjs → chunk-ONIYM7IU.mjs} +2 -2
- package/dist/esm/{chunk-R5ST36VJ.mjs → chunk-OT37OTT7.mjs} +2 -2
- package/dist/esm/{chunk-P46OPJB4.mjs → chunk-OX5GWFHX.mjs} +2 -2
- package/dist/esm/{chunk-T2AGN5YT.mjs → chunk-PYUU4OEL.mjs} +2 -2
- package/dist/esm/{chunk-JGSOTNJ5.mjs → chunk-Q3AUNZDW.mjs} +2 -2
- package/dist/esm/chunk-QZRWRX6P.mjs +2 -0
- package/dist/esm/{chunk-YMB2XW2O.mjs.map → chunk-QZRWRX6P.mjs.map} +1 -1
- package/dist/esm/chunk-R2P2XANA.mjs +2 -0
- package/dist/esm/chunk-R2P2XANA.mjs.map +1 -0
- package/dist/esm/{chunk-EA2DKJPX.mjs → chunk-REBMGDZ5.mjs} +2 -2
- package/dist/esm/{chunk-GHYE26Q5.mjs → chunk-RKHPXZM6.mjs} +2 -2
- package/dist/esm/{chunk-GHYE26Q5.mjs.map → chunk-RKHPXZM6.mjs.map} +1 -1
- package/dist/esm/chunk-RUSWW265.mjs +2 -0
- package/dist/esm/{chunk-A4JUQZXI.mjs → chunk-SBQRBBRS.mjs} +2 -2
- package/dist/esm/chunk-STYDBDYL.mjs +2 -0
- package/dist/esm/{chunk-QRS4DGP3.mjs → chunk-T23OVRNF.mjs} +2 -2
- package/dist/esm/{chunk-QRS4DGP3.mjs.map → chunk-T23OVRNF.mjs.map} +1 -1
- package/dist/esm/{chunk-H6FEXRTK.mjs → chunk-T6OEZ4KP.mjs} +2 -2
- package/dist/esm/{chunk-XFSDV3ND.mjs → chunk-TEJ7BXJK.mjs} +2 -2
- package/dist/esm/chunk-TJDC5PWD.mjs +2 -0
- package/dist/esm/{chunk-36QXVFR5.mjs → chunk-TVRJ3M7B.mjs} +2 -2
- package/dist/esm/{chunk-36QXVFR5.mjs.map → chunk-TVRJ3M7B.mjs.map} +1 -1
- package/dist/esm/{chunk-DZSDCUP2.mjs → chunk-UDU5L4XH.mjs} +2 -2
- package/dist/esm/{chunk-F4GDEXZ6.mjs → chunk-UFJGYMEB.mjs} +2 -2
- package/dist/esm/chunk-UO5LUYGO.mjs +2 -0
- package/dist/esm/chunk-UO5LUYGO.mjs.map +1 -0
- package/dist/esm/chunk-UTXJOB3O.mjs +2 -0
- package/dist/esm/{chunk-ZM33M6QO.mjs → chunk-UWI5D7FD.mjs} +2 -2
- package/dist/esm/chunk-VT6XJSRO.mjs +2 -0
- package/dist/esm/chunk-VT6XJSRO.mjs.map +1 -0
- package/dist/esm/{chunk-NGQR5UQ3.mjs → chunk-W36IQO5K.mjs} +2 -2
- package/dist/esm/chunk-W4IWORPF.mjs +2 -0
- package/dist/esm/chunk-W4IWORPF.mjs.map +1 -0
- package/dist/esm/{chunk-AHW3SKT7.mjs → chunk-W637YAND.mjs} +2 -2
- package/dist/esm/{chunk-HSJTQLI2.mjs → chunk-WAXCU6D6.mjs} +2 -2
- package/dist/esm/chunk-WDE54GRQ.mjs +2 -0
- package/dist/esm/chunk-WDE54GRQ.mjs.map +1 -0
- package/dist/esm/{chunk-JQIGQMNZ.mjs → chunk-Y33VGXNI.mjs} +2 -2
- package/dist/esm/chunk-Y5BON557.mjs +2 -0
- package/dist/esm/chunk-YE5B2S5L.mjs +2 -0
- package/dist/esm/chunk-YE5B2S5L.mjs.map +1 -0
- package/dist/esm/{chunk-E56MTU2U.mjs → chunk-YHO2EBXH.mjs} +2 -2
- package/dist/esm/chunk-YZPQVZ7S.mjs +2 -0
- package/dist/esm/chunk-YZPQVZ7S.mjs.map +1 -0
- package/dist/esm/chunk-Z2ZR4PTF.mjs +2 -0
- package/dist/esm/{chunk-ERIPXWXJ.mjs → chunk-Z6JERVLX.mjs} +2 -2
- package/dist/esm/chunk-ZCCYHFPK.mjs +2 -0
- package/dist/esm/chunk-ZCCYHFPK.mjs.map +1 -0
- package/dist/esm/{chunk-35EWRSDK.mjs → chunk-ZNEBMSNC.mjs} +2 -2
- package/dist/esm/chunk-ZUQJLFR2.mjs +2 -0
- package/dist/esm/chunk-ZUQJLFR2.mjs.map +1 -0
- package/dist/esm/cli/index.mjs +1 -1
- package/dist/esm/cli/localNode.mjs +1 -1
- package/dist/esm/cli/move.mjs +1 -1
- package/dist/esm/client/core.mjs +1 -1
- package/dist/esm/client/get.d.mts +2 -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 +3 -1
- package/dist/esm/client/post.mjs +1 -1
- package/dist/esm/client/types.d.mts +5 -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 +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 +4 -1
- package/dist/esm/core/crypto/index.mjs +1 -1
- package/dist/esm/core/crypto/keyless.d.mts +232 -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 +7 -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 +4 -1
- package/dist/esm/core/index.mjs +1 -1
- package/dist/esm/index.d.mts +16 -9
- 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 +76 -0
- package/dist/esm/internal/keyless.mjs +2 -0
- package/dist/esm/internal/keyless.mjs.map +1 -0
- 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 +4 -3
- 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 +3 -2
- 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 +7 -6
- package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +2 -2
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
- package/dist/esm/transactions/typeTag/index.mjs +1 -1
- package/dist/esm/transactions/typeTag/parser.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 +19 -3
- package/dist/esm/types/index.mjs +1 -1
- package/dist/esm/types/keyless.d.mts +16 -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 -3
- package/src/account/EphemeralKeyPair.ts +157 -0
- package/src/account/KeylessAccount.ts +366 -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/keyless.ts +48 -0
- package/src/bcs/cryptoHasher.ts +6 -0
- package/src/bcs/deserializer.ts +40 -0
- package/src/bcs/serializer.ts +18 -0
- package/src/cli/localNode.ts +11 -1
- package/src/cli/move.ts +11 -1
- package/src/client/core.ts +8 -0
- package/src/client/get.ts +6 -0
- package/src/client/post.ts +12 -0
- package/src/client/types.ts +1 -1
- package/src/core/crypto/ephemeral.ts +138 -0
- package/src/core/crypto/index.ts +2 -0
- package/src/core/crypto/keyless.ts +453 -0
- package/src/core/crypto/poseidon.ts +133 -0
- package/src/core/crypto/proof.ts +16 -0
- package/src/core/crypto/singleKey.ts +11 -0
- package/src/internal/keyless.ts +109 -0
- package/src/internal/transactionSubmission.ts +7 -2
- package/src/transactions/transactionBuilder/remoteAbi.ts +16 -2
- package/src/transactions/transactionBuilder/signingMessage.ts +4 -4
- package/src/transactions/transactionBuilder/transactionBuilder.ts +21 -3
- package/src/transactions/typeTag/parser.ts +98 -52
- package/src/transactions/types.ts +22 -3
- package/src/types/index.ts +22 -0
- package/src/types/keyless.ts +6 -0
- package/src/utils/apiEndpoints.ts +14 -0
- package/src/utils/const.ts +2 -0
- package/src/utils/helpers.ts +25 -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-2XK53QFA.mjs +0 -2
- package/dist/esm/chunk-3JPVQHOR.mjs +0 -2
- package/dist/esm/chunk-3JPVQHOR.mjs.map +0 -1
- package/dist/esm/chunk-4NHWV5AI.mjs +0 -2
- package/dist/esm/chunk-53INTTOI.mjs +0 -2
- package/dist/esm/chunk-6IFMQ5AS.mjs +0 -2
- package/dist/esm/chunk-6IFMQ5AS.mjs.map +0 -1
- package/dist/esm/chunk-AF5WNJOP.mjs +0 -2
- package/dist/esm/chunk-B7X6PSE7.mjs +0 -2
- package/dist/esm/chunk-BBKE2QJU.mjs +0 -2
- package/dist/esm/chunk-BBKE2QJU.mjs.map +0 -1
- package/dist/esm/chunk-CEHCDA3G.mjs +0 -2
- package/dist/esm/chunk-CJDEPZ4J.mjs +0 -2
- package/dist/esm/chunk-CYNQRMO5.mjs +0 -2
- package/dist/esm/chunk-CYNQRMO5.mjs.map +0 -1
- package/dist/esm/chunk-F7EMGK4M.mjs +0 -2
- package/dist/esm/chunk-GPEM3JVU.mjs +0 -2
- package/dist/esm/chunk-HYCGMFC2.mjs +0 -2
- package/dist/esm/chunk-HYCGMFC2.mjs.map +0 -1
- package/dist/esm/chunk-IENCDVPF.mjs +0 -2
- package/dist/esm/chunk-IENCDVPF.mjs.map +0 -1
- package/dist/esm/chunk-L54P6EGN.mjs +0 -2
- package/dist/esm/chunk-L54P6EGN.mjs.map +0 -1
- package/dist/esm/chunk-LDQ6JFEF.mjs +0 -2
- package/dist/esm/chunk-LDQ6JFEF.mjs.map +0 -1
- package/dist/esm/chunk-LG7RJQ57.mjs +0 -2
- package/dist/esm/chunk-LQNPI3IR.mjs +0 -2
- package/dist/esm/chunk-LQNPI3IR.mjs.map +0 -1
- package/dist/esm/chunk-MJPUASSD.mjs +0 -2
- package/dist/esm/chunk-MJPUASSD.mjs.map +0 -1
- package/dist/esm/chunk-N3U47Y6Y.mjs +0 -2
- package/dist/esm/chunk-O2K7RZWM.mjs +0 -2
- package/dist/esm/chunk-O2K7RZWM.mjs.map +0 -1
- package/dist/esm/chunk-O4WVPLUX.mjs +0 -2
- package/dist/esm/chunk-OWW6SIDP.mjs +0 -2
- package/dist/esm/chunk-OWW6SIDP.mjs.map +0 -1
- package/dist/esm/chunk-P5TZBE3L.mjs +0 -2
- package/dist/esm/chunk-PF57EOJY.mjs +0 -2
- package/dist/esm/chunk-PZ4SAXY7.mjs +0 -2
- package/dist/esm/chunk-PZ4SAXY7.mjs.map +0 -1
- package/dist/esm/chunk-RFZ5LTGP.mjs +0 -2
- package/dist/esm/chunk-RFZ5LTGP.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-S2VSJJRJ.mjs +0 -2
- package/dist/esm/chunk-S2VSJJRJ.mjs.map +0 -1
- package/dist/esm/chunk-SRDIYE3M.mjs +0 -2
- package/dist/esm/chunk-UGPALAPN.mjs +0 -2
- package/dist/esm/chunk-UO3NZ5AH.mjs +0 -1
- package/dist/esm/chunk-UVSRX4SV.mjs +0 -1
- package/dist/esm/chunk-YCC6HN74.mjs +0 -2
- package/dist/esm/chunk-YCC6HN74.mjs.map +0 -1
- package/dist/esm/chunk-YMB2XW2O.mjs +0 -2
- /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-CEHCDA3G.mjs.map → chunk-3FVRXELT.mjs.map} +0 -0
- /package/dist/esm/{chunk-U3YYSIIT.mjs.map → chunk-3VGX3TXH.mjs.map} +0 -0
- /package/dist/esm/{chunk-GP6Z47HM.mjs.map → chunk-3Y6JNFPD.mjs.map} +0 -0
- /package/dist/esm/{chunk-GUALXVFI.mjs.map → chunk-5RRZMXND.mjs.map} +0 -0
- /package/dist/esm/{chunk-I5T6PHDV.mjs.map → chunk-6M53MDWB.mjs.map} +0 -0
- /package/dist/esm/{chunk-4GWNWSZP.mjs.map → chunk-7H3HRFVM.mjs.map} +0 -0
- /package/dist/esm/{chunk-5EN52MUT.mjs.map → chunk-7STYQ5ZE.mjs.map} +0 -0
- /package/dist/esm/{chunk-WN3JL7ZT.mjs.map → chunk-A3UVZHDJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-BCUSI3N6.mjs.map → chunk-AOCNYMMX.mjs.map} +0 -0
- /package/dist/esm/{chunk-MCRRHBFQ.mjs.map → chunk-C34M4T77.mjs.map} +0 -0
- /package/dist/esm/{chunk-N3U47Y6Y.mjs.map → chunk-C3L4ETUF.mjs.map} +0 -0
- /package/dist/esm/{chunk-4NHWV5AI.mjs.map → chunk-COW5IGYC.mjs.map} +0 -0
- /package/dist/esm/{chunk-CYTRYBWN.mjs.map → chunk-EADBYPUD.mjs.map} +0 -0
- /package/dist/esm/{chunk-G56GPLTB.mjs.map → chunk-EB7AI4B4.mjs.map} +0 -0
- /package/dist/esm/{chunk-EZPUVLME.mjs.map → chunk-EIRSA5UU.mjs.map} +0 -0
- /package/dist/esm/{chunk-YK63A5T6.mjs.map → chunk-EPTCPBVW.mjs.map} +0 -0
- /package/dist/esm/{chunk-UW2FPXYA.mjs.map → chunk-F5C4SZZ7.mjs.map} +0 -0
- /package/dist/esm/{chunk-BN22EYXR.mjs.map → chunk-FBLSW5TB.mjs.map} +0 -0
- /package/dist/esm/{chunk-LG7RJQ57.mjs.map → chunk-FBPNHF54.mjs.map} +0 -0
- /package/dist/esm/{chunk-KAGLWBIJ.mjs.map → chunk-HGZGTBA4.mjs.map} +0 -0
- /package/dist/esm/{chunk-AF5WNJOP.mjs.map → chunk-IEZO4PIG.mjs.map} +0 -0
- /package/dist/esm/{chunk-FFGY7Z4B.mjs.map → chunk-IJE5YSXW.mjs.map} +0 -0
- /package/dist/esm/{chunk-WNPL4SEJ.mjs.map → chunk-KFUOOBMJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-CHWE77CR.mjs.map → chunk-KKP4FBWZ.mjs.map} +0 -0
- /package/dist/esm/{chunk-ZCG6WBLE.mjs.map → chunk-LEBJNW6Y.mjs.map} +0 -0
- /package/dist/esm/{chunk-3Y46WJUR.mjs.map → chunk-LO7B3CWN.mjs.map} +0 -0
- /package/dist/esm/{chunk-PIVZMT5D.mjs.map → chunk-LQH7T3TE.mjs.map} +0 -0
- /package/dist/esm/{chunk-F7NLNWHN.mjs.map → chunk-M7HZOQ6A.mjs.map} +0 -0
- /package/dist/esm/{chunk-B7X6PSE7.mjs.map → chunk-MGOHPDX4.mjs.map} +0 -0
- /package/dist/esm/{chunk-JX75UKJX.mjs.map → chunk-MKUAW7KW.mjs.map} +0 -0
- /package/dist/esm/{chunk-2X7A4HUS.mjs.map → chunk-MTLETLKV.mjs.map} +0 -0
- /package/dist/esm/{chunk-RT6LEYHZ.mjs.map → chunk-MWN63XBE.mjs.map} +0 -0
- /package/dist/esm/{chunk-PF57EOJY.mjs.map → chunk-MWUJCP27.mjs.map} +0 -0
- /package/dist/esm/{chunk-GM56MMNJ.mjs.map → chunk-NC5HHEEM.mjs.map} +0 -0
- /package/dist/esm/{chunk-TM7NDDT3.mjs.map → chunk-NQMF46E5.mjs.map} +0 -0
- /package/dist/esm/{chunk-UR3JTLIT.mjs.map → chunk-ONIYM7IU.mjs.map} +0 -0
- /package/dist/esm/{chunk-R5ST36VJ.mjs.map → chunk-OT37OTT7.mjs.map} +0 -0
- /package/dist/esm/{chunk-P46OPJB4.mjs.map → chunk-OX5GWFHX.mjs.map} +0 -0
- /package/dist/esm/{chunk-T2AGN5YT.mjs.map → chunk-PYUU4OEL.mjs.map} +0 -0
- /package/dist/esm/{chunk-JGSOTNJ5.mjs.map → chunk-Q3AUNZDW.mjs.map} +0 -0
- /package/dist/esm/{chunk-EA2DKJPX.mjs.map → chunk-REBMGDZ5.mjs.map} +0 -0
- /package/dist/esm/{chunk-O4WVPLUX.mjs.map → chunk-RUSWW265.mjs.map} +0 -0
- /package/dist/esm/{chunk-A4JUQZXI.mjs.map → chunk-SBQRBBRS.mjs.map} +0 -0
- /package/dist/esm/{chunk-UGPALAPN.mjs.map → chunk-STYDBDYL.mjs.map} +0 -0
- /package/dist/esm/{chunk-H6FEXRTK.mjs.map → chunk-T6OEZ4KP.mjs.map} +0 -0
- /package/dist/esm/{chunk-XFSDV3ND.mjs.map → chunk-TEJ7BXJK.mjs.map} +0 -0
- /package/dist/esm/{chunk-F7EMGK4M.mjs.map → chunk-TJDC5PWD.mjs.map} +0 -0
- /package/dist/esm/{chunk-DZSDCUP2.mjs.map → chunk-UDU5L4XH.mjs.map} +0 -0
- /package/dist/esm/{chunk-F4GDEXZ6.mjs.map → chunk-UFJGYMEB.mjs.map} +0 -0
- /package/dist/esm/{chunk-ROXFCLDT.mjs.map → chunk-UTXJOB3O.mjs.map} +0 -0
- /package/dist/esm/{chunk-ZM33M6QO.mjs.map → chunk-UWI5D7FD.mjs.map} +0 -0
- /package/dist/esm/{chunk-NGQR5UQ3.mjs.map → chunk-W36IQO5K.mjs.map} +0 -0
- /package/dist/esm/{chunk-AHW3SKT7.mjs.map → chunk-W637YAND.mjs.map} +0 -0
- /package/dist/esm/{chunk-HSJTQLI2.mjs.map → chunk-WAXCU6D6.mjs.map} +0 -0
- /package/dist/esm/{chunk-JQIGQMNZ.mjs.map → chunk-Y33VGXNI.mjs.map} +0 -0
- /package/dist/esm/{chunk-GPEM3JVU.mjs.map → chunk-Y5BON557.mjs.map} +0 -0
- /package/dist/esm/{chunk-E56MTU2U.mjs.map → chunk-YHO2EBXH.mjs.map} +0 -0
- /package/dist/esm/{chunk-53INTTOI.mjs.map → chunk-Z2ZR4PTF.mjs.map} +0 -0
- /package/dist/esm/{chunk-ERIPXWXJ.mjs.map → chunk-Z6JERVLX.mjs.map} +0 -0
- /package/dist/esm/{chunk-35EWRSDK.mjs.map → chunk-ZNEBMSNC.mjs.map} +0 -0
- /package/dist/esm/{publicKey-B3XRNhHO.d.mts → publicKey-lq5djCIY.d.mts} +0 -0
|
@@ -4,7 +4,7 @@ import { Bool, U8, U16, U32, U64, U128, U256 } from '../bcs/serializable/movePri
|
|
|
4
4
|
import { FixedBytes } from '../bcs/serializable/fixedBytes.mjs';
|
|
5
5
|
import { AccountAddress, AccountAddressInput } from '../core/accountAddress.mjs';
|
|
6
6
|
import { AnyNumber, MoveFunctionId, HexInput, MoveFunctionGenericTypeParam } from '../types/index.mjs';
|
|
7
|
-
import { P as PublicKey } from '../publicKey-
|
|
7
|
+
import { P as PublicKey } from '../publicKey-lq5djCIY.mjs';
|
|
8
8
|
import { RawTransaction, MultiAgentRawTransaction, FeePayerRawTransaction } from './instances/rawTransaction.mjs';
|
|
9
9
|
import { AccountAuthenticator } from './authenticator/account.mjs';
|
|
10
10
|
import { TransactionPayloadEntryFunction, TransactionPayloadScript, TransactionPayloadMultiSig } from './instances/transactionPayload.mjs';
|
|
@@ -43,6 +43,24 @@ type EntryFunctionArgumentTypes = Bool | U8 | U16 | U32 | U64 | U128 | U256 | Ac
|
|
|
43
43
|
* Script function arguments to be used when building a raw transaction using BCS serialized arguments
|
|
44
44
|
*/
|
|
45
45
|
type ScriptFunctionArgumentTypes = Bool | U8 | U16 | U32 | U64 | U128 | U256 | AccountAddress | MoveVector<U8> | MoveString | FixedBytes;
|
|
46
|
+
/**
|
|
47
|
+
* TypeArgument inputs for Entry functions, view functions, and scripts
|
|
48
|
+
*
|
|
49
|
+
* This can be a string version of the type argument such as:
|
|
50
|
+
* - u8
|
|
51
|
+
* - u16
|
|
52
|
+
* - u32
|
|
53
|
+
* - u64
|
|
54
|
+
* - u128
|
|
55
|
+
* - u256
|
|
56
|
+
* - bool
|
|
57
|
+
* - address
|
|
58
|
+
* - signer
|
|
59
|
+
* - vector<Type>
|
|
60
|
+
* - address::module::struct
|
|
61
|
+
* - address::module::struct<Type1, Type2>
|
|
62
|
+
*/
|
|
63
|
+
type TypeArgument = TypeTag | string;
|
|
46
64
|
/**
|
|
47
65
|
* Type that holds all raw transaction instances Aptos SDK supports
|
|
48
66
|
*/
|
|
@@ -71,7 +89,7 @@ type InputGenerateTransactionPayloadDataWithRemoteABI = InputScriptData | InputE
|
|
|
71
89
|
*/
|
|
72
90
|
type InputEntryFunctionData = {
|
|
73
91
|
function: MoveFunctionId;
|
|
74
|
-
typeArguments?: Array<
|
|
92
|
+
typeArguments?: Array<TypeArgument>;
|
|
75
93
|
functionArguments: Array<EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes>;
|
|
76
94
|
abi?: EntryFunctionABI;
|
|
77
95
|
};
|
|
@@ -102,7 +120,7 @@ type InputMultiSigDataWithRemoteABI = {
|
|
|
102
120
|
*/
|
|
103
121
|
type InputScriptData = {
|
|
104
122
|
bytecode: HexInput;
|
|
105
|
-
typeArguments?: Array<
|
|
123
|
+
typeArguments?: Array<TypeArgument>;
|
|
106
124
|
functionArguments: Array<ScriptFunctionArgumentTypes>;
|
|
107
125
|
};
|
|
108
126
|
/**
|
|
@@ -110,7 +128,7 @@ type InputScriptData = {
|
|
|
110
128
|
*/
|
|
111
129
|
type InputViewFunctionData = {
|
|
112
130
|
function: MoveFunctionId;
|
|
113
|
-
typeArguments?: Array<
|
|
131
|
+
typeArguments?: Array<TypeArgument>;
|
|
114
132
|
functionArguments?: Array<EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes>;
|
|
115
133
|
abi?: ViewFunctionABI;
|
|
116
134
|
};
|
|
@@ -238,4 +256,4 @@ interface InputSubmitTransactionData {
|
|
|
238
256
|
additionalSignersAuthenticators?: Array<AccountAuthenticator>;
|
|
239
257
|
}
|
|
240
258
|
|
|
241
|
-
export type { AnyRawTransaction, AnyRawTransactionInstance, AnyTransactionPayloadInstance, EntryFunctionABI, EntryFunctionArgumentTypes, FunctionABI, InputEntryFunctionData, InputEntryFunctionDataWithABI, InputEntryFunctionDataWithRemoteABI, InputGenerateMultiAgentRawTransactionArgs, InputGenerateMultiAgentRawTransactionData, InputGenerateRawTransactionArgs, InputGenerateSingleSignerRawTransactionArgs, InputGenerateSingleSignerRawTransactionData, InputGenerateTransactionData, InputGenerateTransactionOptions, InputGenerateTransactionPayloadData, InputGenerateTransactionPayloadDataWithABI, InputGenerateTransactionPayloadDataWithRemoteABI, InputMultiSigData, InputMultiSigDataWithABI, InputMultiSigDataWithRemoteABI, InputScriptData, InputSimulateTransactionData, InputSimulateTransactionOptions, InputSubmitTransactionData, InputViewFunctionData, InputViewFunctionDataWithABI, InputViewFunctionDataWithRemoteABI, ScriptFunctionArgumentTypes, SimpleEntryFunctionArgumentTypes, ViewFunctionABI };
|
|
259
|
+
export type { AnyRawTransaction, AnyRawTransactionInstance, AnyTransactionPayloadInstance, EntryFunctionABI, EntryFunctionArgumentTypes, FunctionABI, InputEntryFunctionData, InputEntryFunctionDataWithABI, InputEntryFunctionDataWithRemoteABI, InputGenerateMultiAgentRawTransactionArgs, InputGenerateMultiAgentRawTransactionData, InputGenerateRawTransactionArgs, InputGenerateSingleSignerRawTransactionArgs, InputGenerateSingleSignerRawTransactionData, InputGenerateTransactionData, InputGenerateTransactionOptions, InputGenerateTransactionPayloadData, InputGenerateTransactionPayloadDataWithABI, InputGenerateTransactionPayloadDataWithRemoteABI, InputMultiSigData, InputMultiSigDataWithABI, InputMultiSigDataWithRemoteABI, InputScriptData, InputSimulateTransactionData, InputSimulateTransactionOptions, InputSubmitTransactionData, InputViewFunctionData, InputViewFunctionDataWithABI, InputViewFunctionDataWithRemoteABI, ScriptFunctionArgumentTypes, SimpleEntryFunctionArgumentTypes, TypeArgument, ViewFunctionABI };
|
|
@@ -97,11 +97,25 @@ declare enum AccountAuthenticatorVariant {
|
|
|
97
97
|
}
|
|
98
98
|
declare enum AnyPublicKeyVariant {
|
|
99
99
|
Ed25519 = 0,
|
|
100
|
-
Secp256k1 = 1
|
|
100
|
+
Secp256k1 = 1,
|
|
101
|
+
Keyless = 3
|
|
101
102
|
}
|
|
102
103
|
declare enum AnySignatureVariant {
|
|
103
104
|
Ed25519 = 0,
|
|
104
|
-
Secp256k1 = 1
|
|
105
|
+
Secp256k1 = 1,
|
|
106
|
+
Keyless = 3
|
|
107
|
+
}
|
|
108
|
+
declare enum EphemeralPublicKeyVariant {
|
|
109
|
+
Ed25519 = 0
|
|
110
|
+
}
|
|
111
|
+
declare enum EphemeralSignatureVariant {
|
|
112
|
+
Ed25519 = 0
|
|
113
|
+
}
|
|
114
|
+
declare enum EphemeralCertificateVariant {
|
|
115
|
+
ZkProof = 0
|
|
116
|
+
}
|
|
117
|
+
declare enum ZkpVariant {
|
|
118
|
+
Groth16 = 0
|
|
105
119
|
}
|
|
106
120
|
/**
|
|
107
121
|
* BCS types
|
|
@@ -123,6 +137,8 @@ type AptosSettings = {
|
|
|
123
137
|
readonly fullnode?: string;
|
|
124
138
|
readonly faucet?: string;
|
|
125
139
|
readonly indexer?: string;
|
|
140
|
+
readonly pepper?: string;
|
|
141
|
+
readonly prover?: string;
|
|
126
142
|
readonly clientConfig?: ClientConfig;
|
|
127
143
|
readonly client?: Client;
|
|
128
144
|
readonly fullnodeConfig?: FullNodeConfig;
|
|
@@ -935,4 +951,4 @@ type GenerateAccountWithSingleSignerSecp256k1Key = {
|
|
|
935
951
|
};
|
|
936
952
|
type GenerateAccount = GenerateAccountWithEd25519 | GenerateAccountWithSingleSignerSecp256k1Key;
|
|
937
953
|
|
|
938
|
-
export { AccountAuthenticatorVariant, type AccountData, type AccountSignature, type AnyNumber, AnyPublicKeyVariant, AnySignatureVariant, type AptosRequest, type AptosSettings, type AuthenticationKeyScheme, type Block, type BlockMetadataTransactionResponse, type Client, type ClientConfig, type ClientHeadersType, type ClientRequest, type ClientResponse, type CommittedTransactionResponse, type DecodedTableData, type DeletedTableData, DeriveScheme, type DirectWriteSet, type EntryFunctionPayloadResponse, type Event, type EventGuid, type FaucetConfig, type FullNodeConfig, type GasEstimation, type GenerateAccount, type GenerateAccountWithEd25519, type GenerateAccountWithSingleSignerSecp256k1Key, type GenesisPayload, type GenesisTransactionResponse, type HexInput, type IndexerConfig, type LedgerInfo, type LedgerVersionArg, MimeType, MoveAbility, type MoveAddressType, type MoveFunction, type MoveFunctionGenericTypeParam, type MoveFunctionId, MoveFunctionVisibility, type MoveModule, type MoveModuleBytecode, type MoveModuleId, type MoveObjectType, type MoveOptionType, type MoveResource, type MoveScriptBytecode, type MoveStruct, type MoveStructField, type MoveStructId, type MoveStructType, type MoveType, type MoveUint128Type, type MoveUint16Type, type MoveUint256Type, type MoveUint32Type, type MoveUint64Type, type MoveUint8Type, type MoveValue, type MultisigPayloadResponse, OrderBy, type OrderByArg, type PaginationArgs, type PendingTransactionResponse, RoleType, type ScriptPayloadResponse, ScriptTransactionArgumentVariants, type ScriptWriteSet, SigningScheme, SigningSchemeInput, type StateCheckpointTransactionResponse, type TableItemRequest, TokenStandard, type TokenStandardArg, TransactionAuthenticatorVariant, type TransactionEd25519Signature, type TransactionFeePayerSignature, type TransactionMultiAgentSignature, type TransactionMultiEd25519Signature, type TransactionPayloadResponse, TransactionPayloadVariants, type TransactionResponse, TransactionResponseType, type TransactionSecp256k1Signature, type TransactionSignature, TransactionVariants, TypeTagVariants, type Uint128, type Uint16, type Uint256, type Uint32, type Uint64, type Uint8, type UserTransactionResponse, type ValidatorTransactionResponse, type WaitForTransactionOptions, type WhereArg, type WriteSet, type WriteSetChange, type WriteSetChangeDeleteModule, type WriteSetChangeDeleteResource, type WriteSetChangeDeleteTableItem, type WriteSetChangeWriteModule, type WriteSetChangeWriteResource, type WriteSetChangeWriteTableItem, isBlockMetadataTransactionResponse, isEd25519Signature, isFeePayerSignature, isGenesisTransactionResponse, isMultiAgentSignature, isMultiEd25519Signature, isPendingTransactionResponse, isSecp256k1Signature, isStateCheckpointTransactionResponse, isUserTransactionResponse, isValidatorTransactionResponse };
|
|
954
|
+
export { AccountAuthenticatorVariant, type AccountData, type AccountSignature, type AnyNumber, AnyPublicKeyVariant, AnySignatureVariant, type AptosRequest, type AptosSettings, type AuthenticationKeyScheme, type Block, type BlockMetadataTransactionResponse, type Client, type ClientConfig, type ClientHeadersType, type ClientRequest, type ClientResponse, type CommittedTransactionResponse, type DecodedTableData, type DeletedTableData, DeriveScheme, type DirectWriteSet, type EntryFunctionPayloadResponse, EphemeralCertificateVariant, EphemeralPublicKeyVariant, EphemeralSignatureVariant, type Event, type EventGuid, type FaucetConfig, type FullNodeConfig, type GasEstimation, type GenerateAccount, type GenerateAccountWithEd25519, type GenerateAccountWithSingleSignerSecp256k1Key, type GenesisPayload, type GenesisTransactionResponse, type HexInput, type IndexerConfig, type LedgerInfo, type LedgerVersionArg, MimeType, MoveAbility, type MoveAddressType, type MoveFunction, type MoveFunctionGenericTypeParam, type MoveFunctionId, MoveFunctionVisibility, type MoveModule, type MoveModuleBytecode, type MoveModuleId, type MoveObjectType, type MoveOptionType, type MoveResource, type MoveScriptBytecode, type MoveStruct, type MoveStructField, type MoveStructId, type MoveStructType, type MoveType, type MoveUint128Type, type MoveUint16Type, type MoveUint256Type, type MoveUint32Type, type MoveUint64Type, type MoveUint8Type, type MoveValue, type MultisigPayloadResponse, OrderBy, type OrderByArg, type PaginationArgs, type PendingTransactionResponse, RoleType, type ScriptPayloadResponse, ScriptTransactionArgumentVariants, type ScriptWriteSet, SigningScheme, SigningSchemeInput, type StateCheckpointTransactionResponse, type TableItemRequest, TokenStandard, type TokenStandardArg, TransactionAuthenticatorVariant, type TransactionEd25519Signature, type TransactionFeePayerSignature, type TransactionMultiAgentSignature, type TransactionMultiEd25519Signature, type TransactionPayloadResponse, TransactionPayloadVariants, type TransactionResponse, TransactionResponseType, type TransactionSecp256k1Signature, type TransactionSignature, TransactionVariants, TypeTagVariants, type Uint128, type Uint16, type Uint256, type Uint32, type Uint64, type Uint8, type UserTransactionResponse, type ValidatorTransactionResponse, type WaitForTransactionOptions, type WhereArg, type WriteSet, type WriteSetChange, type WriteSetChangeDeleteModule, type WriteSetChangeDeleteResource, type WriteSetChangeDeleteTableItem, type WriteSetChangeWriteModule, type WriteSetChangeWriteResource, type WriteSetChangeWriteTableItem, ZkpVariant, isBlockMetadataTransactionResponse, isEd25519Signature, isFeePayerSignature, isGenesisTransactionResponse, isMultiAgentSignature, isMultiEd25519Signature, isPendingTransactionResponse, isSecp256k1Signature, isStateCheckpointTransactionResponse, isUserTransactionResponse, isValidatorTransactionResponse };
|
package/dist/esm/types/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{A,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"../chunk-
|
|
1
|
+
import{A,B,C,D,E,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"../chunk-JM2B5E2I.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-FVA2OPG4.mjs";export{g as AccountAuthenticatorVariant,h as AnyPublicKeyVariant,i as AnySignatureVariant,E as DeriveScheme,l as EphemeralCertificateVariant,j as EphemeralPublicKeyVariant,k as EphemeralSignatureVariant,a as MimeType,A as MoveAbility,z as MoveFunctionVisibility,B as RoleType,c as ScriptTransactionArgumentVariants,C as SigningScheme,D as SigningSchemeInput,f as TransactionAuthenticatorVariant,d as TransactionPayloadVariants,n as TransactionResponseType,e as TransactionVariants,b as TypeTagVariants,m as ZkpVariant,r as isBlockMetadataTransactionResponse,u as isEd25519Signature,x as isFeePayerSignature,q as isGenesisTransactionResponse,w as isMultiAgentSignature,y as isMultiEd25519Signature,o as isPendingTransactionResponse,v as isSecp256k1Signature,s as isStateCheckpointTransactionResponse,p as isUserTransactionResponse,t as isValidatorTransactionResponse};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type ProverResponse = {
|
|
2
|
+
proof: {
|
|
3
|
+
a: string;
|
|
4
|
+
b: string;
|
|
5
|
+
c: string;
|
|
6
|
+
};
|
|
7
|
+
public_inputs_hash: string;
|
|
8
|
+
training_wheels_signature: string;
|
|
9
|
+
};
|
|
10
|
+
type PepperFetchResponse = {
|
|
11
|
+
signature: string;
|
|
12
|
+
pepper: string;
|
|
13
|
+
address: string;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export type { PepperFetchResponse, ProverResponse };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=keyless.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
declare const NetworkToIndexerAPI: Record<string, string>;
|
|
2
2
|
declare const NetworkToNodeAPI: Record<string, string>;
|
|
3
3
|
declare const NetworkToFaucetAPI: Record<string, string>;
|
|
4
|
+
declare const NetworkToPepperAPI: Record<string, string>;
|
|
5
|
+
declare const NetworkToProverAPI: Record<string, string>;
|
|
4
6
|
declare enum Network {
|
|
5
7
|
MAINNET = "mainnet",
|
|
6
8
|
TESTNET = "testnet",
|
|
@@ -11,4 +13,4 @@ declare enum Network {
|
|
|
11
13
|
declare const NetworkToChainId: Record<string, number>;
|
|
12
14
|
declare const NetworkToNetworkName: Record<string, Network>;
|
|
13
15
|
|
|
14
|
-
export { Network, NetworkToChainId, NetworkToFaucetAPI, NetworkToIndexerAPI, NetworkToNetworkName, NetworkToNodeAPI };
|
|
16
|
+
export { Network, NetworkToChainId, NetworkToFaucetAPI, NetworkToIndexerAPI, NetworkToNetworkName, NetworkToNodeAPI, NetworkToPepperAPI, NetworkToProverAPI };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b,c,d,e,f}from"../chunk-
|
|
1
|
+
import{a,b,c,d,e,f,g,h}from"../chunk-WDE54GRQ.mjs";import"../chunk-FVA2OPG4.mjs";export{f as Network,g as NetworkToChainId,c as NetworkToFaucetAPI,a as NetworkToIndexerAPI,h as NetworkToNetworkName,b as NetworkToNodeAPI,d as NetworkToPepperAPI,e as NetworkToProverAPI};
|
|
2
2
|
//# sourceMappingURL=apiEndpoints.mjs.map
|
package/dist/esm/utils/const.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h}from"../chunk-
|
|
1
|
+
import{a,b,c,d,e,f,g,h}from"../chunk-YE5B2S5L.mjs";import"../chunk-FVA2OPG4.mjs";export{e as APTOS_COIN,a as AptosApiType,b as DEFAULT_MAX_GAS_AMOUNT,c as DEFAULT_TXN_EXP_SEC_FROM_NOW,d as DEFAULT_TXN_TIMEOUT_SEC,h as ProcessorType,f as RAW_TRANSACTION_SALT,g as RAW_TRANSACTION_WITH_DATA_SALT};
|
|
2
2
|
//# sourceMappingURL=const.mjs.map
|
|
@@ -3,5 +3,8 @@
|
|
|
3
3
|
* @param timeMs time in milliseconds to sleep
|
|
4
4
|
*/
|
|
5
5
|
declare function sleep(timeMs: number): Promise<null>;
|
|
6
|
+
declare function currentTimeInSeconds(): number;
|
|
7
|
+
declare function floorToWholeHour(timestampInSeconds: number): number;
|
|
8
|
+
declare function base64UrlDecode(base64Url: string): string;
|
|
6
9
|
|
|
7
|
-
export { sleep };
|
|
10
|
+
export { base64UrlDecode, currentTimeInSeconds, floorToWholeHour, sleep };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a,b,c,d}from"../chunk-JCDZ2WXX.mjs";import"../chunk-FVA2OPG4.mjs";export{d as base64UrlDecode,b as currentTimeInSeconds,c as floorToWholeHour,a as sleep};
|
|
2
2
|
//# sourceMappingURL=helpers.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Network, NetworkToChainId, NetworkToFaucetAPI, NetworkToIndexerAPI, NetworkToNetworkName, NetworkToNodeAPI } from './apiEndpoints.mjs';
|
|
1
|
+
export { Network, NetworkToChainId, NetworkToFaucetAPI, NetworkToIndexerAPI, NetworkToNetworkName, NetworkToNodeAPI, NetworkToPepperAPI, NetworkToProverAPI } from './apiEndpoints.mjs';
|
|
2
2
|
export { APTOS_COIN, AptosApiType, DEFAULT_MAX_GAS_AMOUNT, DEFAULT_TXN_EXP_SEC_FROM_NOW, DEFAULT_TXN_TIMEOUT_SEC, ProcessorType, RAW_TRANSACTION_SALT, RAW_TRANSACTION_WITH_DATA_SALT } from './const.mjs';
|
|
3
3
|
export { DeserializableClass, normalizeBundle } from './normalizeBundle.mjs';
|
|
4
4
|
import '../bcs/deserializer.mjs';
|
package/dist/esm/utils/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-GED6IT3S.mjs";import{a as
|
|
1
|
+
import"../chunk-GED6IT3S.mjs";import{a as q}from"../chunk-UTXJOB3O.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-WDE54GRQ.mjs";import{a,b,c,d,e,f,g,h}from"../chunk-YE5B2S5L.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-C3L4ETUF.mjs";import"../chunk-3FVRXELT.mjs";import"../chunk-EB7AI4B4.mjs";import"../chunk-6RBUXB5I.mjs";import"../chunk-JM2B5E2I.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-VT6XJSRO.mjs";import"../chunk-TVRJ3M7B.mjs";import"../chunk-AOCNYMMX.mjs";import"../chunk-FBPNHF54.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-FVA2OPG4.mjs";export{e as APTOS_COIN,a as AptosApiType,b as DEFAULT_MAX_GAS_AMOUNT,c as DEFAULT_TXN_EXP_SEC_FROM_NOW,d as DEFAULT_TXN_TIMEOUT_SEC,n as Network,o as NetworkToChainId,k as NetworkToFaucetAPI,i as NetworkToIndexerAPI,p as NetworkToNetworkName,j as NetworkToNodeAPI,l as NetworkToPepperAPI,m as NetworkToProverAPI,h as ProcessorType,f as RAW_TRANSACTION_SALT,g 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-UTXJOB3O.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-C3L4ETUF.mjs";import"../chunk-3FVRXELT.mjs";import"../chunk-EB7AI4B4.mjs";import"../chunk-6RBUXB5I.mjs";import"../chunk-JM2B5E2I.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-VT6XJSRO.mjs";import"../chunk-TVRJ3M7B.mjs";import"../chunk-AOCNYMMX.mjs";import"../chunk-FBPNHF54.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-FVA2OPG4.mjs";export{a as 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-JKZHPY24.mjs";import"./chunk-FVA2OPG4.mjs";export{a as VERSION};
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|
package/package.json
CHANGED
|
@@ -48,13 +48,18 @@
|
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@aptos-labs/aptos-client": "^0.1.0",
|
|
51
|
-
"@aptos-labs/aptos-cli": "^0.1.
|
|
51
|
+
"@aptos-labs/aptos-cli": "^0.1.2",
|
|
52
52
|
"@noble/curves": "^1.4.0",
|
|
53
53
|
"@noble/hashes": "^1.4.0",
|
|
54
54
|
"@scure/bip32": "^1.4.0",
|
|
55
55
|
"@scure/bip39": "^1.3.0",
|
|
56
|
+
"eventemitter3": "^5.0.1",
|
|
56
57
|
"form-data": "^4.0.0",
|
|
57
|
-
"
|
|
58
|
+
"jose": "^5.1.3",
|
|
59
|
+
"js-base64": "^3.7.7",
|
|
60
|
+
"jwks-rsa": "^3.1.0",
|
|
61
|
+
"jwt-decode": "^4.0.0",
|
|
62
|
+
"poseidon-lite": "^0.2.0"
|
|
58
63
|
},
|
|
59
64
|
"devDependencies": {
|
|
60
65
|
"@babel/traverse": "^7.23.6",
|
|
@@ -63,7 +68,9 @@
|
|
|
63
68
|
"@graphql-codegen/typescript": "^4.0.1",
|
|
64
69
|
"@graphql-codegen/typescript-graphql-request": "^6.0.1",
|
|
65
70
|
"@graphql-codegen/typescript-operations": "^4.0.1",
|
|
71
|
+
"@types/base-64": "^1.0.2",
|
|
66
72
|
"@types/jest": "^29.5.11",
|
|
73
|
+
"@types/jsonwebtoken": "^9.0.6",
|
|
67
74
|
"@types/node": "^20.10.4",
|
|
68
75
|
"@typescript-eslint/eslint-plugin": "^6.14.0",
|
|
69
76
|
"@typescript-eslint/parser": "^6.14.0",
|
|
@@ -76,6 +83,7 @@
|
|
|
76
83
|
"graphql": "^16.8.1",
|
|
77
84
|
"graphql-request": "^6.1.0",
|
|
78
85
|
"jest": "^29.7.0",
|
|
86
|
+
"jsonwebtoken": "^9.0.2",
|
|
79
87
|
"prettier": "^3.1.1",
|
|
80
88
|
"tree-kill": "^1.2.2",
|
|
81
89
|
"ts-jest": "^29.1.1",
|
|
@@ -85,5 +93,5 @@
|
|
|
85
93
|
"typedoc": "^0.25.4",
|
|
86
94
|
"typescript": "^5.3.3"
|
|
87
95
|
},
|
|
88
|
-
"version": "1.
|
|
96
|
+
"version": "1.16.0-zeta.0"
|
|
89
97
|
}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
// Copyright © Aptos Foundation
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import { randomBytes } from "@noble/hashes/utils";
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
EPK_HORIZON_SECS,
|
|
8
|
+
Ed25519PrivateKey,
|
|
9
|
+
EphemeralPublicKey,
|
|
10
|
+
EphemeralSignature,
|
|
11
|
+
PrivateKey,
|
|
12
|
+
} from "../core/crypto";
|
|
13
|
+
import { Hex } from "../core/hex";
|
|
14
|
+
import { bytesToBigIntLE, padAndPackBytesWithLen, poseidonHash } from "../core/crypto/poseidon";
|
|
15
|
+
import { AnyNumber, EphemeralPublicKeyVariant, HexInput } from "../types";
|
|
16
|
+
import { Deserializer, Serializable, Serializer } from "../bcs";
|
|
17
|
+
import { currentTimeInSeconds, floorToWholeHour } from "../utils/helpers";
|
|
18
|
+
|
|
19
|
+
export class EphemeralKeyPair extends Serializable {
|
|
20
|
+
static readonly BLINDER_LENGTH: number = 31;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* A byte array of length BLINDER_LENGTH used to obfuscate the public key from the IdP.
|
|
24
|
+
* Used in calculating the nonce passed to the IdP and as a secret witness in proof generation.
|
|
25
|
+
*/
|
|
26
|
+
readonly blinder: Uint8Array;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* A timestamp in seconds indicating when the ephemeral key pair is expired. After expiry, a new
|
|
30
|
+
* EphemeralKeyPair must be generated and a new JWT needs to be created.
|
|
31
|
+
*/
|
|
32
|
+
readonly expiryDateSecs: bigint | number;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* The value passed to the IdP when the user authenticates. It comprises of a hash of the
|
|
36
|
+
* ephermeral public key, expiry date, and blinder.
|
|
37
|
+
*/
|
|
38
|
+
readonly nonce: string;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* A private key used to sign transactions. This private key is not tied to any account on the chain as it
|
|
42
|
+
* is ephemeral (not permanent) in nature.
|
|
43
|
+
*/
|
|
44
|
+
private privateKey: PrivateKey;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* A public key used to verify transactions. This public key is not tied to any account on the chain as it
|
|
48
|
+
* is ephemeral (not permanent) in nature.
|
|
49
|
+
*/
|
|
50
|
+
private publicKey: EphemeralPublicKey;
|
|
51
|
+
|
|
52
|
+
constructor(args: { privateKey: PrivateKey; expiryDateSecs?: AnyNumber; blinder?: HexInput }) {
|
|
53
|
+
super();
|
|
54
|
+
const { privateKey, expiryDateSecs, blinder } = args;
|
|
55
|
+
this.privateKey = privateKey;
|
|
56
|
+
this.publicKey = new EphemeralPublicKey(privateKey.publicKey());
|
|
57
|
+
// We set the expiry date to be the nearest floored hour
|
|
58
|
+
this.expiryDateSecs = expiryDateSecs || BigInt(floorToWholeHour(currentTimeInSeconds() + EPK_HORIZON_SECS));
|
|
59
|
+
// Generate the blinder if not provided
|
|
60
|
+
this.blinder = blinder !== undefined ? Hex.fromHexInput(blinder).toUint8Array() : generateBlinder();
|
|
61
|
+
// Calculate the nonce
|
|
62
|
+
this.nonce = this.generateNonce();
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Returns the public key of the key pair.
|
|
67
|
+
* @return EphemeralPublicKey
|
|
68
|
+
*/
|
|
69
|
+
getPublicKey(): EphemeralPublicKey {
|
|
70
|
+
return this.publicKey;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Returns the public key of the key pair.
|
|
75
|
+
* @return boolean
|
|
76
|
+
*/
|
|
77
|
+
isExpired(): boolean {
|
|
78
|
+
const currentTimeSecs: number = Math.floor(Date.now() / 1000);
|
|
79
|
+
return currentTimeSecs > this.expiryDateSecs;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
serialize(serializer: Serializer): void {
|
|
83
|
+
serializer.serializeU32AsUleb128(this.publicKey.variant);
|
|
84
|
+
serializer.serializeBytes(this.privateKey.toUint8Array());
|
|
85
|
+
serializer.serializeU64(this.expiryDateSecs);
|
|
86
|
+
serializer.serializeFixedBytes(this.blinder);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
static deserialize(deserializer: Deserializer): EphemeralKeyPair {
|
|
90
|
+
const variantIndex = deserializer.deserializeUleb128AsU32();
|
|
91
|
+
let privateKey: PrivateKey;
|
|
92
|
+
switch (variantIndex) {
|
|
93
|
+
case EphemeralPublicKeyVariant.Ed25519:
|
|
94
|
+
privateKey = Ed25519PrivateKey.deserialize(deserializer);
|
|
95
|
+
break;
|
|
96
|
+
default:
|
|
97
|
+
throw new Error(`Unknown variant index for EphemeralPublicKey: ${variantIndex}`);
|
|
98
|
+
}
|
|
99
|
+
const expiryDateSecs = deserializer.deserializeU64();
|
|
100
|
+
const blinder = deserializer.deserializeFixedBytes(31);
|
|
101
|
+
return new EphemeralKeyPair({ privateKey, expiryDateSecs, blinder });
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
static fromBytes(bytes: Uint8Array): EphemeralKeyPair {
|
|
105
|
+
return EphemeralKeyPair.deserialize(new Deserializer(bytes));
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Returns the public key of the key pair.
|
|
110
|
+
* @param scheme the type of keypair to use for the EphemeralKeyPair. Only Ed25519 supported for now.
|
|
111
|
+
* @param expiryDateSecs the date of expiry.
|
|
112
|
+
* @return boolean
|
|
113
|
+
*/
|
|
114
|
+
static generate(args?: { scheme: EphemeralPublicKeyVariant; expiryDateSecs?: bigint | number }): EphemeralKeyPair {
|
|
115
|
+
let privateKey: PrivateKey;
|
|
116
|
+
|
|
117
|
+
switch (args?.scheme) {
|
|
118
|
+
case EphemeralPublicKeyVariant.Ed25519:
|
|
119
|
+
default:
|
|
120
|
+
privateKey = Ed25519PrivateKey.generate();
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return new EphemeralKeyPair({ privateKey, expiryDateSecs: args?.expiryDateSecs });
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* From the ephemeral public key, expiry timestamp, and blinder, calculate the nonce to be used at authentication via OIDC.
|
|
128
|
+
* @returns string
|
|
129
|
+
*/
|
|
130
|
+
private generateNonce(): string {
|
|
131
|
+
const fields = padAndPackBytesWithLen(this.publicKey.bcsToBytes(), 93);
|
|
132
|
+
fields.push(BigInt(this.expiryDateSecs));
|
|
133
|
+
fields.push(bytesToBigIntLE(this.blinder));
|
|
134
|
+
const nonceHash = poseidonHash(fields);
|
|
135
|
+
return nonceHash.toString();
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Sign the given message with the private key.
|
|
140
|
+
* @param data in HexInput format
|
|
141
|
+
* @returns EphemeralSignature
|
|
142
|
+
*/
|
|
143
|
+
sign(data: HexInput): EphemeralSignature {
|
|
144
|
+
if (this.isExpired()) {
|
|
145
|
+
throw new Error("EphemeralKeyPair has expired");
|
|
146
|
+
}
|
|
147
|
+
return new EphemeralSignature(this.privateKey.sign(data));
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Generates a random byte array of length EphemeralKeyPair.BLINDER_LENGTH
|
|
153
|
+
* @returns Uint8Array
|
|
154
|
+
*/
|
|
155
|
+
function generateBlinder(): Uint8Array {
|
|
156
|
+
return randomBytes(EphemeralKeyPair.BLINDER_LENGTH);
|
|
157
|
+
}
|