@aptos-labs/ts-sdk 1.31.0 → 1.32.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/README.md +1 -1
- package/dist/common/{accountAddress-DnSqjhSl.d.ts → accountAddress-6RqI8Aam.d.ts} +144 -63
- package/dist/common/chunk-F43XVDYJ.js +2 -0
- package/dist/common/chunk-F43XVDYJ.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 +446 -111
- package/dist/common/index.js +36 -29
- package/dist/common/index.js.map +1 -1
- package/dist/esm/{Ed25519Account-DpH9qAcg.d.mts → Ed25519Account-B3xHXAQe.d.mts} +2 -2
- package/dist/esm/account/AbstractKeylessAccount.d.mts +85 -14
- package/dist/esm/account/AbstractKeylessAccount.mjs +1 -1
- package/dist/esm/account/Account.d.mts +4 -4
- package/dist/esm/account/Account.mjs +1 -1
- package/dist/esm/account/Ed25519Account.d.mts +4 -4
- package/dist/esm/account/Ed25519Account.mjs +1 -1
- package/dist/esm/account/EphemeralKeyPair.d.mts +3 -3
- package/dist/esm/account/EphemeralKeyPair.mjs +1 -1
- package/dist/esm/account/FederatedKeylessAccount.d.mts +56 -8
- package/dist/esm/account/FederatedKeylessAccount.mjs +1 -1
- package/dist/esm/account/KeylessAccount.d.mts +28 -11
- package/dist/esm/account/KeylessAccount.mjs +1 -1
- package/dist/esm/account/MultiKeyAccount.d.mts +22 -10
- package/dist/esm/account/MultiKeyAccount.mjs +1 -1
- package/dist/esm/account/SingleKeyAccount.d.mts +4 -4
- package/dist/esm/account/SingleKeyAccount.mjs +1 -1
- package/dist/esm/account/index.d.mts +5 -5
- package/dist/esm/account/index.mjs +1 -1
- package/dist/esm/api/account.d.mts +5 -5
- package/dist/esm/api/account.mjs +1 -1
- package/dist/esm/api/ans.d.mts +3 -3
- package/dist/esm/api/ans.mjs +1 -1
- package/dist/esm/api/aptos.d.mts +4 -4
- package/dist/esm/api/aptos.mjs +1 -1
- package/dist/esm/api/aptosConfig.d.mts +1 -1
- 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 +5 -5
- package/dist/esm/api/digitalAsset.mjs +1 -1
- package/dist/esm/api/event.d.mts +3 -3
- package/dist/esm/api/event.mjs +1 -1
- package/dist/esm/api/faucet.d.mts +2 -2
- package/dist/esm/api/faucet.mjs +1 -1
- package/dist/esm/api/fungibleAsset.d.mts +5 -5
- 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 +4 -4
- package/dist/esm/api/index.mjs +1 -1
- package/dist/esm/api/keyless.d.mts +7 -7
- package/dist/esm/api/keyless.mjs +1 -1
- package/dist/esm/api/object.d.mts +3 -3
- package/dist/esm/api/object.mjs +1 -1
- package/dist/esm/api/staking.d.mts +3 -3
- package/dist/esm/api/staking.mjs +1 -1
- package/dist/esm/api/table.d.mts +3 -3
- 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 +4 -4
- 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.d.mts +2 -2
- package/dist/esm/api/utils.mjs +1 -1
- package/dist/esm/bcs/consts.d.mts +2 -2
- package/dist/esm/bcs/deserializer.d.mts +35 -27
- package/dist/esm/bcs/deserializer.mjs +1 -1
- package/dist/esm/bcs/index.d.mts +2 -2
- package/dist/esm/bcs/index.mjs +1 -1
- package/dist/esm/bcs/serializable/entryFunctionBytes.d.mts +2 -2
- package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -1
- package/dist/esm/bcs/serializable/fixedBytes.d.mts +2 -2
- package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -1
- package/dist/esm/bcs/serializable/movePrimitives.d.mts +2 -2
- package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
- package/dist/esm/bcs/serializable/moveStructs.d.mts +11 -12
- package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
- package/dist/esm/bcs/serializer.d.mts +13 -13
- package/dist/esm/bcs/serializer.mjs +1 -1
- package/dist/esm/{chunk-22ZSW5EN.mjs → chunk-26WX3UFP.mjs} +2 -2
- package/dist/esm/{chunk-A2AEFKXS.mjs → chunk-2E3BT4YW.mjs} +2 -2
- package/dist/esm/{chunk-VYMRIKUV.mjs → chunk-2LQ4FTSR.mjs} +2 -2
- package/dist/esm/{chunk-L5J3V3HW.mjs → chunk-2REHS35S.mjs} +2 -2
- package/dist/esm/{chunk-CC7VOPYH.mjs → chunk-2YTHKFJZ.mjs} +2 -2
- package/dist/esm/{chunk-6FLHGOKP.mjs → chunk-42H7WETG.mjs} +2 -2
- package/dist/esm/{chunk-RBJNSUSU.mjs → chunk-4IQZOAN7.mjs} +2 -2
- package/dist/esm/{chunk-ZPQUCT22.mjs → chunk-4J2JYRV3.mjs} +2 -2
- package/dist/esm/chunk-4O5XDQDO.mjs +2 -0
- package/dist/esm/chunk-5B3SMBXQ.mjs +2 -0
- package/dist/esm/{chunk-5N6KJ7KS.mjs → chunk-5KCKWL2C.mjs} +2 -2
- package/dist/esm/{chunk-IFXUWUP2.mjs → chunk-5O3RHPER.mjs} +2 -2
- package/dist/esm/{chunk-PCLU4KLY.mjs → chunk-6ZOVTYLJ.mjs} +2 -2
- package/dist/esm/chunk-7ECCT6PK.mjs +1 -0
- package/dist/esm/{chunk-RAJTNQNL.mjs → chunk-7OHMMGS6.mjs} +2 -2
- package/dist/esm/{chunk-ZPIMARUG.mjs → chunk-A3USS2NC.mjs} +2 -2
- package/dist/esm/{chunk-NODYW7DM.mjs → chunk-ACVIE7IE.mjs} +2 -2
- package/dist/esm/{chunk-RNRNGJDA.mjs → chunk-AGEJNSEX.mjs} +2 -2
- package/dist/esm/{chunk-QQIVWB6G.mjs → chunk-AJ5JHBAE.mjs} +2 -2
- package/dist/esm/{chunk-QQIVWB6G.mjs.map → chunk-AJ5JHBAE.mjs.map} +1 -1
- package/dist/esm/{chunk-PRZ7AIGA.mjs → chunk-AKIO3OIT.mjs} +2 -2
- package/dist/esm/{chunk-KRVLR3L4.mjs → chunk-AOROYJ74.mjs} +2 -2
- package/dist/esm/chunk-AVZYJAXR.mjs +2 -0
- package/dist/esm/chunk-AVZYJAXR.mjs.map +1 -0
- package/dist/esm/{chunk-BG2TZI3H.mjs → chunk-BP45UJII.mjs} +2 -2
- package/dist/esm/{chunk-JGNMNCQB.mjs → chunk-BRV3RLKW.mjs} +2 -2
- package/dist/esm/{chunk-EE7GDBA5.mjs → chunk-CEW2NI3K.mjs} +2 -2
- package/dist/esm/{chunk-RNJHULIT.mjs → chunk-CPKG25HX.mjs} +2 -2
- package/dist/esm/chunk-CPKG25HX.mjs.map +1 -0
- package/dist/esm/chunk-D52UKPQF.mjs +2 -0
- package/dist/esm/chunk-D52UKPQF.mjs.map +1 -0
- package/dist/esm/{chunk-4LKLOUMG.mjs → chunk-D54FD6XE.mjs} +2 -2
- package/dist/esm/{chunk-MK2QAHXC.mjs → chunk-DYELAVMR.mjs} +2 -2
- package/dist/esm/{chunk-MSHZ4FWB.mjs → chunk-E2GPZCQI.mjs} +2 -2
- package/dist/esm/{chunk-MSHZ4FWB.mjs.map → chunk-E2GPZCQI.mjs.map} +1 -1
- package/dist/esm/chunk-EJKX6MGV.mjs +2 -0
- package/dist/esm/{chunk-WV2VJQDS.mjs.map → chunk-EJKX6MGV.mjs.map} +1 -1
- package/dist/esm/{chunk-OXM4BVAY.mjs → chunk-ERDYU5YQ.mjs} +2 -2
- package/dist/esm/{chunk-7JK7UG4E.mjs → chunk-ETF76XA3.mjs} +2 -2
- package/dist/esm/chunk-F45G3GP3.mjs +7 -0
- package/dist/esm/chunk-F45G3GP3.mjs.map +1 -0
- package/dist/esm/chunk-FD6FGKYY.mjs +1 -0
- package/dist/esm/{chunk-LDZPO76C.mjs → chunk-FFCCBAEZ.mjs} +2 -2
- package/dist/esm/chunk-FYYTCJS4.mjs +2 -0
- package/dist/esm/chunk-FYYTCJS4.mjs.map +1 -0
- package/dist/esm/{chunk-OAEDFM7T.mjs → chunk-GX4CYRK4.mjs} +2 -2
- package/dist/esm/{chunk-UCRROMZN.mjs → chunk-GZBVXXUL.mjs} +2 -2
- package/dist/esm/{chunk-AT2ZGTXQ.mjs → chunk-H7AALSJ7.mjs} +2 -2
- package/dist/esm/{chunk-EUGLLGYW.mjs → chunk-HBWIDPNN.mjs} +2 -2
- package/dist/esm/{chunk-BVVHGSWC.mjs → chunk-HPZQGMSH.mjs} +2 -2
- package/dist/esm/{chunk-T5BCTWGK.mjs → chunk-I5GENJBA.mjs} +2 -2
- package/dist/esm/chunk-I5GENJBA.mjs.map +1 -0
- package/dist/esm/{chunk-73GCGRFW.mjs → chunk-II26BNYA.mjs} +2 -2
- package/dist/esm/{chunk-BOWPP6YG.mjs → chunk-IQ4SCMB6.mjs} +2 -2
- package/dist/esm/chunk-IUSAYAEI.mjs +4 -0
- package/dist/esm/{chunk-HM5HITUC.mjs.map → chunk-IUSAYAEI.mjs.map} +1 -1
- package/dist/esm/{chunk-J245N3XF.mjs → chunk-J7PJSK3J.mjs} +2 -2
- package/dist/esm/{chunk-J245N3XF.mjs.map → chunk-J7PJSK3J.mjs.map} +1 -1
- package/dist/esm/{chunk-CL6EEMSL.mjs → chunk-JGLEKXFP.mjs} +2 -2
- package/dist/esm/{chunk-SOLWFAUY.mjs → chunk-JIT2FYGE.mjs} +2 -2
- package/dist/esm/chunk-JIT2FYGE.mjs.map +1 -0
- package/dist/esm/chunk-JNO7KPMG.mjs +4 -0
- package/dist/esm/chunk-JNO7KPMG.mjs.map +1 -0
- package/dist/esm/{chunk-AZ6LVQEG.mjs → chunk-JONEH52T.mjs} +2 -2
- package/dist/esm/chunk-K62JTXWQ.mjs +2 -0
- package/dist/esm/chunk-K62JTXWQ.mjs.map +1 -0
- package/dist/esm/{chunk-IAVI3H4V.mjs → chunk-KCEI5JYS.mjs} +2 -2
- package/dist/esm/{chunk-XFY4O2S3.mjs → chunk-KM6IOJ6Y.mjs} +2 -2
- package/dist/esm/{chunk-DMSHPWA5.mjs → chunk-KTM6KVUJ.mjs} +2 -2
- package/dist/esm/chunk-KX43GEAB.mjs +2 -0
- package/dist/esm/chunk-KX43GEAB.mjs.map +1 -0
- package/dist/esm/{chunk-KYJU5PWF.mjs → chunk-L25CRR2W.mjs} +2 -2
- package/dist/esm/{chunk-2652SPOM.mjs → chunk-LGHPJTF3.mjs} +2 -2
- package/dist/esm/chunk-LGHPJTF3.mjs.map +1 -0
- package/dist/esm/{chunk-AGBA3Y7A.mjs → chunk-LGTOOAQI.mjs} +2 -2
- package/dist/esm/chunk-LHBMBCFC.mjs +2 -0
- package/dist/esm/chunk-LHBMBCFC.mjs.map +1 -0
- package/dist/esm/{chunk-F2RY4YQ7.mjs → chunk-LYO22HMF.mjs} +2 -2
- package/dist/esm/{chunk-KW4FVBDD.mjs → chunk-MBEWPBGN.mjs} +2 -2
- package/dist/esm/chunk-MHN6XY4Z.mjs +2 -0
- package/dist/esm/{chunk-JVTDP4KV.mjs → chunk-ML7D2CVG.mjs} +2 -2
- package/dist/esm/chunk-NF7ZQQE3.mjs +2 -0
- package/dist/esm/chunk-NF7ZQQE3.mjs.map +1 -0
- package/dist/esm/{chunk-XQ7ONNII.mjs → chunk-O4MRRWRI.mjs} +2 -2
- package/dist/esm/{chunk-PHP47DI4.mjs → chunk-OIOGOW6I.mjs} +1 -1
- package/dist/esm/{chunk-PHP47DI4.mjs.map → chunk-OIOGOW6I.mjs.map} +1 -1
- package/dist/esm/{chunk-ZINOJTLU.mjs → chunk-OPO5EYF7.mjs} +2 -2
- package/dist/esm/{chunk-6DMDYBV6.mjs → chunk-OVI7L7OG.mjs} +2 -2
- package/dist/esm/{chunk-TPJLAYW6.mjs → chunk-P2FTRAK3.mjs} +2 -2
- package/dist/esm/{chunk-IECDO22V.mjs → chunk-Q3CWUEXI.mjs} +2 -2
- package/dist/esm/chunk-Q3CWUEXI.mjs.map +1 -0
- package/dist/esm/{chunk-4JXB6V5O.mjs → chunk-RC43EXC4.mjs} +2 -2
- package/dist/esm/{chunk-WZCKSN2U.mjs → chunk-RLH25IDA.mjs} +2 -2
- package/dist/esm/{chunk-UGL2GPGK.mjs → chunk-RSO5YIDW.mjs} +2 -2
- package/dist/esm/chunk-RZGTHCJY.mjs +2 -0
- package/dist/esm/{chunk-2CGJLPHP.mjs.map → chunk-RZGTHCJY.mjs.map} +1 -1
- package/dist/esm/chunk-SPRNSFUV.mjs +2 -0
- package/dist/esm/chunk-SPRNSFUV.mjs.map +1 -0
- package/dist/esm/{chunk-2GEIHUHT.mjs → chunk-SPX2YFZN.mjs} +2 -2
- package/dist/esm/chunk-SPX2YFZN.mjs.map +1 -0
- package/dist/esm/chunk-SY4HK6CC.mjs +2 -0
- package/dist/esm/chunk-SY4HK6CC.mjs.map +1 -0
- package/dist/esm/{chunk-OTY3NO7Q.mjs → chunk-T6ADNZE5.mjs} +2 -2
- package/dist/esm/{chunk-3H5DGQKX.mjs → chunk-TGW36YOD.mjs} +2 -2
- package/dist/esm/{chunk-WSZCPSV4.mjs → chunk-TQA6HY6A.mjs} +2 -2
- package/dist/esm/{chunk-XFJD6QIP.mjs → chunk-U3GE6IPF.mjs} +2 -2
- package/dist/esm/chunk-UGTIALNW.mjs +2 -0
- package/dist/esm/{chunk-JNRMHDRA.mjs → chunk-UKVH4UGL.mjs} +2 -2
- package/dist/esm/chunk-UWLW2VLZ.mjs +2 -0
- package/dist/esm/chunk-UWLW2VLZ.mjs.map +1 -0
- package/dist/esm/chunk-UZTJWOLS.mjs +2 -0
- package/dist/esm/chunk-V4FKFCBL.mjs +2 -0
- package/dist/esm/chunk-V4FKFCBL.mjs.map +1 -0
- package/dist/esm/{chunk-4ZK3JNQT.mjs → chunk-VGITSRT6.mjs} +2 -2
- package/dist/esm/chunk-VGJIATTB.mjs +2 -0
- package/dist/esm/chunk-VGJIATTB.mjs.map +1 -0
- package/dist/esm/{chunk-XOCRDV2V.mjs → chunk-VQZMI3EZ.mjs} +2 -2
- package/dist/esm/chunk-WQF3IOXC.mjs +2 -0
- package/dist/esm/chunk-WQF3IOXC.mjs.map +1 -0
- package/dist/esm/chunk-WYOFF5DJ.mjs +2 -0
- package/dist/esm/chunk-WYOFF5DJ.mjs.map +1 -0
- package/dist/esm/{chunk-YZ5BCOGI.mjs → chunk-X7JNNNMC.mjs} +2 -2
- package/dist/esm/{chunk-JN36BNWA.mjs → chunk-XIB6LX22.mjs} +2 -2
- package/dist/esm/chunk-YIQ3JFHW.mjs +2 -0
- package/dist/esm/chunk-YIQ3JFHW.mjs.map +1 -0
- package/dist/esm/chunk-YP3VO6GM.mjs +2 -0
- package/dist/esm/chunk-YP3VO6GM.mjs.map +1 -0
- package/dist/esm/{chunk-OZN3OOJV.mjs → chunk-ZMBXHMVQ.mjs} +2 -2
- package/dist/esm/cli/index.d.mts +2 -2
- package/dist/esm/cli/index.mjs +1 -1
- package/dist/esm/cli/localNode.mjs +1 -1
- package/dist/esm/cli/move.d.mts +1 -1
- package/dist/esm/client/core.d.mts +1 -2
- package/dist/esm/client/core.mjs +1 -1
- package/dist/esm/client/get.d.mts +1 -2
- package/dist/esm/client/get.mjs +1 -1
- package/dist/esm/client/index.d.mts +2 -3
- package/dist/esm/client/index.mjs +1 -1
- package/dist/esm/client/post.d.mts +1 -2
- package/dist/esm/client/post.mjs +1 -1
- package/dist/esm/core/account/index.d.mts +2 -2
- package/dist/esm/core/account/index.mjs +1 -1
- package/dist/esm/core/account/utils/address.d.mts +2 -2
- package/dist/esm/core/account/utils/address.mjs +1 -1
- package/dist/esm/core/account/utils/index.d.mts +2 -2
- package/dist/esm/core/account/utils/index.mjs +1 -1
- package/dist/esm/core/accountAddress.d.mts +19 -10
- package/dist/esm/core/accountAddress.mjs +1 -1
- package/dist/esm/core/authenticationKey.d.mts +3 -3
- package/dist/esm/core/authenticationKey.mjs +1 -1
- package/dist/esm/core/crypto/ed25519.d.mts +26 -12
- package/dist/esm/core/crypto/ed25519.mjs +1 -1
- package/dist/esm/core/crypto/ephemeral.d.mts +3 -3
- package/dist/esm/core/crypto/ephemeral.mjs +1 -1
- package/dist/esm/core/crypto/federatedKeyless.d.mts +4 -4
- package/dist/esm/core/crypto/federatedKeyless.mjs +1 -1
- package/dist/esm/core/crypto/hdKey.d.mts +0 -1
- package/dist/esm/core/crypto/hdKey.mjs +1 -1
- package/dist/esm/core/crypto/index.d.mts +4 -4
- package/dist/esm/core/crypto/index.mjs +1 -1
- package/dist/esm/core/crypto/keyless.d.mts +72 -11
- package/dist/esm/core/crypto/keyless.mjs +1 -1
- package/dist/esm/core/crypto/multiEd25519.d.mts +3 -3
- package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
- package/dist/esm/core/crypto/multiKey.d.mts +3 -3
- package/dist/esm/core/crypto/multiKey.mjs +1 -1
- package/dist/esm/core/crypto/privateKey.d.mts +37 -10
- package/dist/esm/core/crypto/privateKey.mjs +1 -1
- package/dist/esm/core/crypto/proof.d.mts +2 -2
- package/dist/esm/core/crypto/proof.mjs +1 -1
- package/dist/esm/core/crypto/publicKey.d.mts +3 -3
- package/dist/esm/core/crypto/publicKey.mjs +1 -1
- package/dist/esm/core/crypto/secp256k1.d.mts +23 -9
- package/dist/esm/core/crypto/secp256k1.mjs +1 -1
- package/dist/esm/core/crypto/signature.d.mts +2 -2
- package/dist/esm/core/crypto/signature.mjs +1 -1
- package/dist/esm/core/crypto/singleKey.d.mts +3 -3
- package/dist/esm/core/crypto/singleKey.mjs +1 -1
- package/dist/esm/core/crypto/utils.d.mts +2 -2
- package/dist/esm/core/crypto/utils.mjs +1 -1
- package/dist/esm/core/hex.d.mts +39 -3
- package/dist/esm/core/hex.mjs +1 -1
- package/dist/esm/core/index.d.mts +5 -5
- package/dist/esm/core/index.mjs +1 -1
- package/dist/esm/errors/index.d.mts +122 -0
- package/dist/esm/errors/index.mjs +2 -0
- package/dist/esm/index.d.mts +10 -10
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/internal/account.d.mts +4 -4
- package/dist/esm/internal/account.mjs +1 -1
- package/dist/esm/internal/ans.d.mts +4 -4
- package/dist/esm/internal/ans.mjs +1 -1
- package/dist/esm/internal/coin.d.mts +2 -2
- package/dist/esm/internal/coin.mjs +1 -1
- package/dist/esm/internal/digitalAsset.d.mts +4 -4
- package/dist/esm/internal/digitalAsset.mjs +1 -1
- package/dist/esm/internal/event.d.mts +2 -2
- package/dist/esm/internal/event.mjs +1 -1
- package/dist/esm/internal/faucet.d.mts +1 -1
- package/dist/esm/internal/faucet.mjs +1 -1
- package/dist/esm/internal/fungibleAsset.d.mts +4 -4
- package/dist/esm/internal/fungibleAsset.mjs +1 -1
- package/dist/esm/internal/general.d.mts +2 -2
- package/dist/esm/internal/general.mjs +1 -1
- package/dist/esm/internal/keyless.d.mts +9 -5
- package/dist/esm/internal/keyless.mjs +1 -1
- package/dist/esm/internal/object.d.mts +2 -2
- package/dist/esm/internal/object.mjs +1 -1
- package/dist/esm/internal/staking.d.mts +1 -1
- package/dist/esm/internal/staking.mjs +1 -1
- package/dist/esm/internal/table.d.mts +2 -2
- package/dist/esm/internal/table.mjs +1 -1
- package/dist/esm/internal/transaction.d.mts +1 -1
- package/dist/esm/internal/transaction.mjs +1 -1
- package/dist/esm/internal/transactionSubmission.d.mts +3 -3
- package/dist/esm/internal/transactionSubmission.mjs +1 -1
- package/dist/esm/internal/view.d.mts +3 -3
- package/dist/esm/internal/view.mjs +1 -1
- package/dist/esm/{publicKey-_tPa99ea.d.mts → publicKey-BVXX1nVl.d.mts} +2 -2
- package/dist/esm/transactions/authenticator/account.d.mts +3 -3
- package/dist/esm/transactions/authenticator/account.mjs +1 -1
- package/dist/esm/transactions/authenticator/index.d.mts +3 -3
- package/dist/esm/transactions/authenticator/index.mjs +1 -1
- package/dist/esm/transactions/authenticator/transaction.d.mts +9 -4
- package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
- package/dist/esm/transactions/index.d.mts +3 -3
- package/dist/esm/transactions/index.mjs +1 -1
- package/dist/esm/transactions/instances/chainId.d.mts +2 -2
- package/dist/esm/transactions/instances/chainId.mjs +1 -1
- package/dist/esm/transactions/instances/identifier.d.mts +2 -2
- package/dist/esm/transactions/instances/identifier.mjs +1 -1
- package/dist/esm/transactions/instances/index.d.mts +3 -3
- package/dist/esm/transactions/instances/index.mjs +1 -1
- package/dist/esm/transactions/instances/moduleId.d.mts +2 -2
- package/dist/esm/transactions/instances/moduleId.mjs +1 -1
- package/dist/esm/transactions/instances/multiAgentTransaction.d.mts +2 -2
- package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/rawTransaction.d.mts +2 -2
- package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/rotationProofChallenge.d.mts +3 -3
- package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
- package/dist/esm/transactions/instances/signedTransaction.d.mts +3 -3
- package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/simpleTransaction.d.mts +2 -2
- package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/transactionArgument.d.mts +2 -2
- package/dist/esm/transactions/instances/transactionPayload.d.mts +2 -2
- package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
- package/dist/esm/transactions/management/accountSequenceNumber.d.mts +4 -4
- package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
- package/dist/esm/transactions/management/index.d.mts +4 -4
- package/dist/esm/transactions/management/index.mjs +1 -1
- package/dist/esm/transactions/management/transactionWorker.d.mts +4 -4
- package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/helpers.d.mts +2 -2
- package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/index.d.mts +3 -3
- 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 +3 -3
- package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +3 -3
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
- package/dist/esm/transactions/typeTag/index.d.mts +2 -2
- package/dist/esm/transactions/typeTag/index.mjs +1 -1
- package/dist/esm/transactions/typeTag/parser.d.mts +2 -2
- package/dist/esm/transactions/typeTag/parser.mjs +1 -1
- package/dist/esm/transactions/types.d.mts +2 -2
- package/dist/esm/types/index.d.mts +3 -1260
- package/dist/esm/types/index.mjs +1 -1
- package/dist/esm/types/keyless.d.mts +22 -1
- package/dist/esm/types/types.d.mts +1289 -0
- package/dist/esm/types/types.mjs +2 -0
- package/dist/esm/types/types.mjs.map +1 -0
- package/dist/esm/utils/const.d.mts +7 -1
- package/dist/esm/utils/const.mjs +1 -1
- package/dist/esm/utils/helpers.d.mts +10 -3
- package/dist/esm/utils/helpers.mjs +1 -1
- package/dist/esm/utils/index.d.mts +3 -3
- package/dist/esm/utils/index.mjs +1 -1
- package/dist/esm/utils/normalizeBundle.d.mts +2 -2
- 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 +1 -1
- package/src/account/AbstractKeylessAccount.ts +203 -10
- package/src/account/FederatedKeylessAccount.ts +83 -35
- package/src/account/KeylessAccount.ts +44 -37
- package/src/account/MultiKeyAccount.ts +18 -5
- package/src/api/keyless.ts +2 -2
- package/src/bcs/deserializer.ts +53 -30
- package/src/bcs/serializable/moveStructs.ts +16 -17
- package/src/bcs/serializer.ts +22 -12
- package/src/client/core.ts +2 -2
- package/src/client/get.ts +1 -2
- package/src/client/index.ts +0 -1
- package/src/client/post.ts +1 -2
- package/src/core/accountAddress.ts +36 -9
- package/src/core/crypto/ed25519.ts +34 -14
- package/src/core/crypto/hdKey.ts +0 -1
- package/src/core/crypto/keyless.ts +245 -38
- package/src/core/crypto/privateKey.ts +81 -5
- package/src/core/crypto/secp256k1.ts +31 -11
- package/src/core/hex.ts +47 -0
- package/src/errors/index.ts +406 -0
- package/src/index.ts +1 -0
- package/src/internal/account.ts +6 -6
- package/src/internal/ans.ts +2 -1
- package/src/internal/keyless.ts +57 -19
- package/src/internal/transaction.ts +2 -1
- package/src/internal/transactionSubmission.ts +36 -18
- package/src/transactions/authenticator/transaction.ts +20 -0
- package/src/types/index.ts +1 -1483
- package/src/types/keyless.ts +19 -0
- package/src/types/types.ts +1512 -0
- package/src/utils/const.ts +7 -0
- package/src/utils/helpers.ts +10 -0
- package/src/version.ts +1 -1
- package/dist/common/chunk-7IYTZDXV.js +0 -2
- package/dist/common/chunk-7IYTZDXV.js.map +0 -1
- package/dist/esm/chunk-2652SPOM.mjs.map +0 -1
- package/dist/esm/chunk-2CGJLPHP.mjs +0 -2
- package/dist/esm/chunk-2GEIHUHT.mjs.map +0 -1
- package/dist/esm/chunk-4CDDWSKZ.mjs +0 -2
- package/dist/esm/chunk-4OV7QU2U.mjs +0 -2
- package/dist/esm/chunk-4VU2ABLU.mjs +0 -2
- package/dist/esm/chunk-4VU2ABLU.mjs.map +0 -1
- package/dist/esm/chunk-5S3Z7MT4.mjs +0 -2
- package/dist/esm/chunk-5S3Z7MT4.mjs.map +0 -1
- package/dist/esm/chunk-5SGSPCOY.mjs +0 -2
- package/dist/esm/chunk-5SGSPCOY.mjs.map +0 -1
- package/dist/esm/chunk-7XS45O6M.mjs +0 -2
- package/dist/esm/chunk-7XS45O6M.mjs.map +0 -1
- package/dist/esm/chunk-BAGUHYFD.mjs +0 -2
- package/dist/esm/chunk-BAGUHYFD.mjs.map +0 -1
- package/dist/esm/chunk-CDQGPCHU.mjs +0 -2
- package/dist/esm/chunk-CDQGPCHU.mjs.map +0 -1
- package/dist/esm/chunk-FTZGP6XW.mjs +0 -2
- package/dist/esm/chunk-FTZGP6XW.mjs.map +0 -1
- package/dist/esm/chunk-GLATLXF6.mjs +0 -2
- package/dist/esm/chunk-GLATLXF6.mjs.map +0 -1
- package/dist/esm/chunk-GQABU3RQ.mjs +0 -2
- package/dist/esm/chunk-GQABU3RQ.mjs.map +0 -1
- package/dist/esm/chunk-HM5HITUC.mjs +0 -4
- package/dist/esm/chunk-IBLZ6MZU.mjs +0 -2
- package/dist/esm/chunk-IECDO22V.mjs.map +0 -1
- package/dist/esm/chunk-KFNDDPOW.mjs +0 -2
- package/dist/esm/chunk-KFNDDPOW.mjs.map +0 -1
- package/dist/esm/chunk-KIW54KWR.mjs +0 -2
- package/dist/esm/chunk-KM6UXNC7.mjs +0 -2
- package/dist/esm/chunk-KM6UXNC7.mjs.map +0 -1
- package/dist/esm/chunk-KUX6GQ2E.mjs +0 -1
- package/dist/esm/chunk-LEKBJ2EG.mjs +0 -2
- package/dist/esm/chunk-LEKBJ2EG.mjs.map +0 -1
- package/dist/esm/chunk-M22UGFQ5.mjs +0 -2
- package/dist/esm/chunk-M22UGFQ5.mjs.map +0 -1
- package/dist/esm/chunk-N2FKVZ4D.mjs +0 -1
- package/dist/esm/chunk-N47FTRYO.mjs +0 -2
- package/dist/esm/chunk-N47FTRYO.mjs.map +0 -1
- package/dist/esm/chunk-ONBFUPEC.mjs +0 -2
- package/dist/esm/chunk-P3J54CQG.mjs +0 -2
- package/dist/esm/chunk-P3J54CQG.mjs.map +0 -1
- package/dist/esm/chunk-RNJHULIT.mjs.map +0 -1
- package/dist/esm/chunk-SGQFWWLQ.mjs +0 -2
- package/dist/esm/chunk-SGQFWWLQ.mjs.map +0 -1
- package/dist/esm/chunk-SOLWFAUY.mjs.map +0 -1
- package/dist/esm/chunk-T5BCTWGK.mjs.map +0 -1
- package/dist/esm/chunk-WV2VJQDS.mjs +0 -2
- package/dist/esm/chunk-Y267I7DC.mjs +0 -2
- package/dist/esm/chunk-Y267I7DC.mjs.map +0 -1
- package/dist/esm/client/types.d.mts +0 -66
- package/dist/esm/client/types.mjs +0 -2
- package/src/client/types.ts +0 -138
- /package/dist/esm/{chunk-22ZSW5EN.mjs.map → chunk-26WX3UFP.mjs.map} +0 -0
- /package/dist/esm/{chunk-A2AEFKXS.mjs.map → chunk-2E3BT4YW.mjs.map} +0 -0
- /package/dist/esm/{chunk-VYMRIKUV.mjs.map → chunk-2LQ4FTSR.mjs.map} +0 -0
- /package/dist/esm/{chunk-L5J3V3HW.mjs.map → chunk-2REHS35S.mjs.map} +0 -0
- /package/dist/esm/{chunk-CC7VOPYH.mjs.map → chunk-2YTHKFJZ.mjs.map} +0 -0
- /package/dist/esm/{chunk-6FLHGOKP.mjs.map → chunk-42H7WETG.mjs.map} +0 -0
- /package/dist/esm/{chunk-RBJNSUSU.mjs.map → chunk-4IQZOAN7.mjs.map} +0 -0
- /package/dist/esm/{chunk-ZPQUCT22.mjs.map → chunk-4J2JYRV3.mjs.map} +0 -0
- /package/dist/esm/{chunk-IBLZ6MZU.mjs.map → chunk-4O5XDQDO.mjs.map} +0 -0
- /package/dist/esm/{chunk-KIW54KWR.mjs.map → chunk-5B3SMBXQ.mjs.map} +0 -0
- /package/dist/esm/{chunk-5N6KJ7KS.mjs.map → chunk-5KCKWL2C.mjs.map} +0 -0
- /package/dist/esm/{chunk-IFXUWUP2.mjs.map → chunk-5O3RHPER.mjs.map} +0 -0
- /package/dist/esm/{chunk-PCLU4KLY.mjs.map → chunk-6ZOVTYLJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-KUX6GQ2E.mjs.map → chunk-7ECCT6PK.mjs.map} +0 -0
- /package/dist/esm/{chunk-RAJTNQNL.mjs.map → chunk-7OHMMGS6.mjs.map} +0 -0
- /package/dist/esm/{chunk-ZPIMARUG.mjs.map → chunk-A3USS2NC.mjs.map} +0 -0
- /package/dist/esm/{chunk-NODYW7DM.mjs.map → chunk-ACVIE7IE.mjs.map} +0 -0
- /package/dist/esm/{chunk-RNRNGJDA.mjs.map → chunk-AGEJNSEX.mjs.map} +0 -0
- /package/dist/esm/{chunk-PRZ7AIGA.mjs.map → chunk-AKIO3OIT.mjs.map} +0 -0
- /package/dist/esm/{chunk-KRVLR3L4.mjs.map → chunk-AOROYJ74.mjs.map} +0 -0
- /package/dist/esm/{chunk-BG2TZI3H.mjs.map → chunk-BP45UJII.mjs.map} +0 -0
- /package/dist/esm/{chunk-JGNMNCQB.mjs.map → chunk-BRV3RLKW.mjs.map} +0 -0
- /package/dist/esm/{chunk-EE7GDBA5.mjs.map → chunk-CEW2NI3K.mjs.map} +0 -0
- /package/dist/esm/{chunk-4LKLOUMG.mjs.map → chunk-D54FD6XE.mjs.map} +0 -0
- /package/dist/esm/{chunk-MK2QAHXC.mjs.map → chunk-DYELAVMR.mjs.map} +0 -0
- /package/dist/esm/{chunk-OXM4BVAY.mjs.map → chunk-ERDYU5YQ.mjs.map} +0 -0
- /package/dist/esm/{chunk-7JK7UG4E.mjs.map → chunk-ETF76XA3.mjs.map} +0 -0
- /package/dist/esm/{chunk-N2FKVZ4D.mjs.map → chunk-FD6FGKYY.mjs.map} +0 -0
- /package/dist/esm/{chunk-LDZPO76C.mjs.map → chunk-FFCCBAEZ.mjs.map} +0 -0
- /package/dist/esm/{chunk-OAEDFM7T.mjs.map → chunk-GX4CYRK4.mjs.map} +0 -0
- /package/dist/esm/{chunk-UCRROMZN.mjs.map → chunk-GZBVXXUL.mjs.map} +0 -0
- /package/dist/esm/{chunk-AT2ZGTXQ.mjs.map → chunk-H7AALSJ7.mjs.map} +0 -0
- /package/dist/esm/{chunk-EUGLLGYW.mjs.map → chunk-HBWIDPNN.mjs.map} +0 -0
- /package/dist/esm/{chunk-BVVHGSWC.mjs.map → chunk-HPZQGMSH.mjs.map} +0 -0
- /package/dist/esm/{chunk-73GCGRFW.mjs.map → chunk-II26BNYA.mjs.map} +0 -0
- /package/dist/esm/{chunk-BOWPP6YG.mjs.map → chunk-IQ4SCMB6.mjs.map} +0 -0
- /package/dist/esm/{chunk-CL6EEMSL.mjs.map → chunk-JGLEKXFP.mjs.map} +0 -0
- /package/dist/esm/{chunk-AZ6LVQEG.mjs.map → chunk-JONEH52T.mjs.map} +0 -0
- /package/dist/esm/{chunk-IAVI3H4V.mjs.map → chunk-KCEI5JYS.mjs.map} +0 -0
- /package/dist/esm/{chunk-XFY4O2S3.mjs.map → chunk-KM6IOJ6Y.mjs.map} +0 -0
- /package/dist/esm/{chunk-DMSHPWA5.mjs.map → chunk-KTM6KVUJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-KYJU5PWF.mjs.map → chunk-L25CRR2W.mjs.map} +0 -0
- /package/dist/esm/{chunk-AGBA3Y7A.mjs.map → chunk-LGTOOAQI.mjs.map} +0 -0
- /package/dist/esm/{chunk-F2RY4YQ7.mjs.map → chunk-LYO22HMF.mjs.map} +0 -0
- /package/dist/esm/{chunk-KW4FVBDD.mjs.map → chunk-MBEWPBGN.mjs.map} +0 -0
- /package/dist/esm/{chunk-4OV7QU2U.mjs.map → chunk-MHN6XY4Z.mjs.map} +0 -0
- /package/dist/esm/{chunk-JVTDP4KV.mjs.map → chunk-ML7D2CVG.mjs.map} +0 -0
- /package/dist/esm/{chunk-XQ7ONNII.mjs.map → chunk-O4MRRWRI.mjs.map} +0 -0
- /package/dist/esm/{chunk-ZINOJTLU.mjs.map → chunk-OPO5EYF7.mjs.map} +0 -0
- /package/dist/esm/{chunk-6DMDYBV6.mjs.map → chunk-OVI7L7OG.mjs.map} +0 -0
- /package/dist/esm/{chunk-TPJLAYW6.mjs.map → chunk-P2FTRAK3.mjs.map} +0 -0
- /package/dist/esm/{chunk-4JXB6V5O.mjs.map → chunk-RC43EXC4.mjs.map} +0 -0
- /package/dist/esm/{chunk-WZCKSN2U.mjs.map → chunk-RLH25IDA.mjs.map} +0 -0
- /package/dist/esm/{chunk-UGL2GPGK.mjs.map → chunk-RSO5YIDW.mjs.map} +0 -0
- /package/dist/esm/{chunk-OTY3NO7Q.mjs.map → chunk-T6ADNZE5.mjs.map} +0 -0
- /package/dist/esm/{chunk-3H5DGQKX.mjs.map → chunk-TGW36YOD.mjs.map} +0 -0
- /package/dist/esm/{chunk-WSZCPSV4.mjs.map → chunk-TQA6HY6A.mjs.map} +0 -0
- /package/dist/esm/{chunk-XFJD6QIP.mjs.map → chunk-U3GE6IPF.mjs.map} +0 -0
- /package/dist/esm/{chunk-ONBFUPEC.mjs.map → chunk-UGTIALNW.mjs.map} +0 -0
- /package/dist/esm/{chunk-JNRMHDRA.mjs.map → chunk-UKVH4UGL.mjs.map} +0 -0
- /package/dist/esm/{chunk-4CDDWSKZ.mjs.map → chunk-UZTJWOLS.mjs.map} +0 -0
- /package/dist/esm/{chunk-4ZK3JNQT.mjs.map → chunk-VGITSRT6.mjs.map} +0 -0
- /package/dist/esm/{chunk-XOCRDV2V.mjs.map → chunk-VQZMI3EZ.mjs.map} +0 -0
- /package/dist/esm/{chunk-YZ5BCOGI.mjs.map → chunk-X7JNNNMC.mjs.map} +0 -0
- /package/dist/esm/{chunk-JN36BNWA.mjs.map → chunk-XIB6LX22.mjs.map} +0 -0
- /package/dist/esm/{chunk-OZN3OOJV.mjs.map → chunk-ZMBXHMVQ.mjs.map} +0 -0
- /package/dist/esm/{client/types.mjs.map → errors/index.mjs.map} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{A,B,C,D,E,F,G,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-WQF3IOXC.mjs";import"../chunk-KDMSOCZY.mjs";export{g as AccountAuthenticatorVariant,i as AnyPublicKeyVariant,j as AnySignatureVariant,G as DeriveScheme,m as EphemeralCertificateVariant,k as EphemeralPublicKeyVariant,l as EphemeralSignatureVariant,a as MimeType,C as MoveAbility,B as MoveFunctionVisibility,h as PrivateKeyVariants,D as RoleType,c as ScriptTransactionArgumentVariants,E as SigningScheme,F as SigningSchemeInput,f as TransactionAuthenticatorVariant,d as TransactionPayloadVariants,o as TransactionResponseType,e as TransactionVariants,b as TypeTagVariants,n as ZkpVariant,v as isBlockEpilogueTransactionResponse,s as isBlockMetadataTransactionResponse,w as isEd25519Signature,z as isFeePayerSignature,r as isGenesisTransactionResponse,y as isMultiAgentSignature,A as isMultiEd25519Signature,p as isPendingTransactionResponse,x as isSecp256k1Signature,t as isStateCheckpointTransactionResponse,q as isUserTransactionResponse,u as isValidatorTransactionResponse};
|
|
2
|
+
//# sourceMappingURL=types.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -54,5 +54,11 @@ declare enum ProcessorType {
|
|
|
54
54
|
USER_TRANSACTION_PROCESSOR = "user_transaction_processor",
|
|
55
55
|
OBJECT_PROCESSOR = "objects_processor"
|
|
56
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* Regular expression pattern for Firebase Auth issuer URLs
|
|
59
|
+
* Matches URLs in the format: https://securetoken.google.com/[project-id]
|
|
60
|
+
* where project-id can contain letters, numbers, hyphens, and underscores
|
|
61
|
+
*/
|
|
62
|
+
declare const FIREBASE_AUTH_ISS_PATTERN: RegExp;
|
|
57
63
|
|
|
58
|
-
export { APTOS_COIN, APTOS_FA, AptosApiType, DEFAULT_MAX_GAS_AMOUNT, DEFAULT_TXN_EXP_SEC_FROM_NOW, DEFAULT_TXN_TIMEOUT_SEC, ProcessorType, RAW_TRANSACTION_SALT, RAW_TRANSACTION_WITH_DATA_SALT };
|
|
64
|
+
export { APTOS_COIN, APTOS_FA, AptosApiType, DEFAULT_MAX_GAS_AMOUNT, DEFAULT_TXN_EXP_SEC_FROM_NOW, DEFAULT_TXN_TIMEOUT_SEC, FIREBASE_AUTH_ISS_PATTERN, ProcessorType, RAW_TRANSACTION_SALT, RAW_TRANSACTION_WITH_DATA_SALT };
|
package/dist/esm/utils/const.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i}from"../chunk-
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j}from"../chunk-J7PJSK3J.mjs";import"../chunk-KDMSOCZY.mjs";export{e as APTOS_COIN,f as APTOS_FA,a as AptosApiType,b as DEFAULT_MAX_GAS_AMOUNT,c as DEFAULT_TXN_EXP_SEC_FROM_NOW,d as DEFAULT_TXN_TIMEOUT_SEC,j as FIREBASE_AUTH_ISS_PATTERN,i as ProcessorType,g as RAW_TRANSACTION_SALT,h as RAW_TRANSACTION_WITH_DATA_SALT};
|
|
2
2
|
//# sourceMappingURL=const.mjs.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { MoveStructId } from '../types/
|
|
2
|
-
import './apiEndpoints.mjs';
|
|
1
|
+
import { MoveStructId } from '../types/types.mjs';
|
|
3
2
|
import '../types/indexer.mjs';
|
|
4
3
|
import '../types/generated/operations.mjs';
|
|
5
4
|
import '../types/generated/types.mjs';
|
|
5
|
+
import './apiEndpoints.mjs';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Sleep for the specified amount of time in milliseconds.
|
|
@@ -11,6 +11,13 @@ import '../types/generated/types.mjs';
|
|
|
11
11
|
* @param timeMs - The time in milliseconds to sleep.
|
|
12
12
|
*/
|
|
13
13
|
declare function sleep(timeMs: number): Promise<null>;
|
|
14
|
+
/**
|
|
15
|
+
* Get the error message from an unknown error.
|
|
16
|
+
*
|
|
17
|
+
* @param error The error to get the message from
|
|
18
|
+
* @returns The error message
|
|
19
|
+
*/
|
|
20
|
+
declare function getErrorMessage(error: unknown): string;
|
|
14
21
|
declare const nowInSeconds: () => number;
|
|
15
22
|
/**
|
|
16
23
|
* Floors the given timestamp to the nearest whole hour.
|
|
@@ -86,4 +93,4 @@ declare const isEncodedStruct: (structObj: any) => structObj is {
|
|
|
86
93
|
struct_name: string;
|
|
87
94
|
};
|
|
88
95
|
|
|
89
|
-
export { base64UrlDecode, convertAmountFromHumanReadableToOnChain, convertAmountFromOnChainToHumanReadable, floorToWholeHour, isEncodedStruct, nowInSeconds, parseEncodedStruct, sleep };
|
|
96
|
+
export { base64UrlDecode, convertAmountFromHumanReadableToOnChain, convertAmountFromOnChainToHumanReadable, floorToWholeHour, getErrorMessage, isEncodedStruct, nowInSeconds, parseEncodedStruct, sleep };
|
|
@@ -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,i}from"../chunk-V4FKFCBL.mjs";import"../chunk-KDMSOCZY.mjs";export{e as base64UrlDecode,f as convertAmountFromHumanReadableToOnChain,g as convertAmountFromOnChainToHumanReadable,d as floorToWholeHour,b as getErrorMessage,i as isEncodedStruct,c as nowInSeconds,h as parseEncodedStruct,a as sleep};
|
|
2
2
|
//# sourceMappingURL=helpers.mjs.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { Network, NetworkToChainId, NetworkToFaucetAPI, NetworkToIndexerAPI, NetworkToNetworkName, NetworkToNodeAPI, NetworkToPepperAPI, NetworkToProverAPI } from './apiEndpoints.mjs';
|
|
2
|
-
export { APTOS_COIN, APTOS_FA, 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';
|
|
2
|
+
export { APTOS_COIN, APTOS_FA, AptosApiType, DEFAULT_MAX_GAS_AMOUNT, DEFAULT_TXN_EXP_SEC_FROM_NOW, DEFAULT_TXN_TIMEOUT_SEC, FIREBASE_AUTH_ISS_PATTERN, ProcessorType, RAW_TRANSACTION_SALT, RAW_TRANSACTION_WITH_DATA_SALT } from './const.mjs';
|
|
3
3
|
export { DeserializableClass, normalizeBundle } from './normalizeBundle.mjs';
|
|
4
|
-
export { base64UrlDecode, convertAmountFromHumanReadableToOnChain, convertAmountFromOnChainToHumanReadable, floorToWholeHour, isEncodedStruct, nowInSeconds, parseEncodedStruct, sleep } from './helpers.mjs';
|
|
4
|
+
export { base64UrlDecode, convertAmountFromHumanReadableToOnChain, convertAmountFromOnChainToHumanReadable, floorToWholeHour, getErrorMessage, isEncodedStruct, nowInSeconds, parseEncodedStruct, sleep } from './helpers.mjs';
|
|
5
5
|
import '../bcs/deserializer.mjs';
|
|
6
|
-
import '../types/
|
|
6
|
+
import '../types/types.mjs';
|
|
7
7
|
import '../types/indexer.mjs';
|
|
8
8
|
import '../types/generated/operations.mjs';
|
|
9
9
|
import '../types/generated/types.mjs';
|
package/dist/esm/utils/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-HGLO5LDS.mjs";import{a as
|
|
1
|
+
import"../chunk-HGLO5LDS.mjs";import{a as s}from"../chunk-UZTJWOLS.mjs";import{a as t,b as u,c as v,d as w,e as x,f as y,g as z,h as A,i as B}from"../chunk-V4FKFCBL.mjs";import{a,b,c,d,e,f,g,h}from"../chunk-D3OEQLUE.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,i as q,j as r}from"../chunk-J7PJSK3J.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-ZMBXHMVQ.mjs";import"../chunk-BRV3RLKW.mjs";import"../chunk-Q3CWUEXI.mjs";import"../chunk-42H7WETG.mjs";import"../chunk-FD6FGKYY.mjs";import"../chunk-WQF3IOXC.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-D52UKPQF.mjs";import"../chunk-AJ5JHBAE.mjs";import"../chunk-SPRNSFUV.mjs";import"../chunk-6Q2O5G3J.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-KDMSOCZY.mjs";export{m as APTOS_COIN,n as APTOS_FA,i as AptosApiType,j as DEFAULT_MAX_GAS_AMOUNT,k as DEFAULT_TXN_EXP_SEC_FROM_NOW,l as DEFAULT_TXN_TIMEOUT_SEC,r as FIREBASE_AUTH_ISS_PATTERN,f as Network,g as NetworkToChainId,c as NetworkToFaucetAPI,a as NetworkToIndexerAPI,h as NetworkToNetworkName,b as NetworkToNodeAPI,d as NetworkToPepperAPI,e as NetworkToProverAPI,q as ProcessorType,o as RAW_TRANSACTION_SALT,p as RAW_TRANSACTION_WITH_DATA_SALT,x as base64UrlDecode,y as convertAmountFromHumanReadableToOnChain,z as convertAmountFromOnChainToHumanReadable,w as floorToWholeHour,u as getErrorMessage,B as isEncodedStruct,s as normalizeBundle,v as nowInSeconds,A as parseEncodedStruct,t as sleep};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Deserializer } from '../bcs/deserializer.mjs';
|
|
2
2
|
import { Serializable } from '../bcs/serializer.mjs';
|
|
3
|
-
import '../types/
|
|
4
|
-
import './apiEndpoints.mjs';
|
|
3
|
+
import '../types/types.mjs';
|
|
5
4
|
import '../types/indexer.mjs';
|
|
6
5
|
import '../types/generated/operations.mjs';
|
|
7
6
|
import '../types/generated/types.mjs';
|
|
7
|
+
import './apiEndpoints.mjs';
|
|
8
8
|
import '../core/hex.mjs';
|
|
9
9
|
import '../core/common.mjs';
|
|
10
10
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-UZTJWOLS.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-ZMBXHMVQ.mjs";import"../chunk-BRV3RLKW.mjs";import"../chunk-Q3CWUEXI.mjs";import"../chunk-42H7WETG.mjs";import"../chunk-FD6FGKYY.mjs";import"../chunk-WQF3IOXC.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-D52UKPQF.mjs";import"../chunk-AJ5JHBAE.mjs";import"../chunk-SPRNSFUV.mjs";import"../chunk-6Q2O5G3J.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-KDMSOCZY.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-RZGTHCJY.mjs";import"./chunk-KDMSOCZY.mjs";export{a as VERSION};
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|
package/package.json
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
4
|
import EventEmitter from "eventemitter3";
|
|
5
|
+
import { jwtDecode } from "jwt-decode";
|
|
5
6
|
import { EphemeralCertificateVariant, HexInput, SigningScheme } from "../types";
|
|
6
7
|
import { AccountAddress } from "../core/accountAddress";
|
|
7
8
|
import {
|
|
@@ -12,23 +13,39 @@ import {
|
|
|
12
13
|
EphemeralCertificate,
|
|
13
14
|
ZeroKnowledgeSig,
|
|
14
15
|
ZkProof,
|
|
16
|
+
getKeylessJWKs,
|
|
17
|
+
MoveJWK,
|
|
18
|
+
getKeylessConfig,
|
|
15
19
|
} from "../core/crypto";
|
|
16
20
|
|
|
17
|
-
import { Account } from "./Account";
|
|
18
21
|
import { EphemeralKeyPair } from "./EphemeralKeyPair";
|
|
19
22
|
import { Hex } from "../core/hex";
|
|
20
23
|
import { AccountAuthenticatorSingleKey } from "../transactions/authenticator/account";
|
|
21
|
-
import { Serializable, Serializer } from "../bcs";
|
|
24
|
+
import { Deserializer, Serializable, Serializer } from "../bcs";
|
|
22
25
|
import { deriveTransactionType, generateSigningMessage } from "../transactions/transactionBuilder/signingMessage";
|
|
23
26
|
import { AnyRawTransaction, AnyRawTransactionInstance } from "../transactions/types";
|
|
24
27
|
import { base64UrlDecode } from "../utils/helpers";
|
|
25
28
|
import { FederatedKeylessPublicKey } from "../core/crypto/federatedKeyless";
|
|
29
|
+
import { Account } from "./Account";
|
|
30
|
+
import { AptosConfig } from "../api/aptosConfig";
|
|
31
|
+
import { KeylessError, KeylessErrorType } from "../errors";
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* An interface which defines if an Account utilizes Keyless signing.
|
|
35
|
+
*/
|
|
36
|
+
export interface KeylessSigner extends Account {
|
|
37
|
+
checkKeylessAccountValidity(aptosConfig: AptosConfig): Promise<void>;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function isKeylessSigner(obj: any): obj is KeylessSigner {
|
|
41
|
+
return obj !== null && obj !== undefined && typeof obj.checkKeylessAccountValidity === "function";
|
|
42
|
+
}
|
|
26
43
|
|
|
27
44
|
/**
|
|
28
45
|
* Account implementation for the Keyless authentication scheme. This abstract class is used for standard Keyless Accounts
|
|
29
46
|
* and Federated Keyless Accounts.
|
|
30
47
|
*/
|
|
31
|
-
export abstract class AbstractKeylessAccount extends Serializable implements
|
|
48
|
+
export abstract class AbstractKeylessAccount extends Serializable implements KeylessSigner {
|
|
32
49
|
static readonly PEPPER_LENGTH: number = 31;
|
|
33
50
|
|
|
34
51
|
/**
|
|
@@ -88,12 +105,36 @@ export abstract class AbstractKeylessAccount extends Serializable implements Acc
|
|
|
88
105
|
*/
|
|
89
106
|
readonly jwt: string;
|
|
90
107
|
|
|
108
|
+
/**
|
|
109
|
+
* The hash of the verification key used to verify the proof. This is optional and can be used to check verifying key
|
|
110
|
+
* rotations which may invalidate the proof.
|
|
111
|
+
*/
|
|
112
|
+
readonly verificationKeyHash?: Uint8Array;
|
|
113
|
+
|
|
91
114
|
/**
|
|
92
115
|
* An event emitter used to assist in handling asynchronous proof fetching.
|
|
93
116
|
*/
|
|
94
117
|
private readonly emitter: EventEmitter<ProofFetchEvents>;
|
|
95
118
|
|
|
96
|
-
|
|
119
|
+
/**
|
|
120
|
+
* Use the static generator `create(...)` instead.
|
|
121
|
+
* Creates an instance of the KeylessAccount with an optional proof.
|
|
122
|
+
*
|
|
123
|
+
* @param args - The parameters for creating a KeylessAccount.
|
|
124
|
+
* @param args.address - Optional account address associated with the KeylessAccount.
|
|
125
|
+
* @param args.publicKey - A KeylessPublicKey or FederatedKeylessPublicKey.
|
|
126
|
+
* @param args.ephemeralKeyPair - The ephemeral key pair used in the account creation.
|
|
127
|
+
* @param args.iss - A JWT issuer.
|
|
128
|
+
* @param args.uidKey - The claim on the JWT to identify a user. This is typically 'sub' or 'email'.
|
|
129
|
+
* @param args.uidVal - The unique id for this user, intended to be a stable user identifier.
|
|
130
|
+
* @param args.aud - The value of the 'aud' claim on the JWT, also known as client ID. This is the identifier for the dApp's
|
|
131
|
+
* OIDC registration with the identity provider.
|
|
132
|
+
* @param args.pepper - A hexadecimal input used for additional security.
|
|
133
|
+
* @param args.proof - A Zero Knowledge Signature or a promise that resolves to one.
|
|
134
|
+
* @param args.proofFetchCallback - Optional callback function for fetching proof.
|
|
135
|
+
* @param args.jwt - A JSON Web Token used for authentication.
|
|
136
|
+
* @param args.verificationKeyHash Optional 32-byte verification key hash as hex input used to check proof validity.
|
|
137
|
+
*/
|
|
97
138
|
protected constructor(args: {
|
|
98
139
|
address?: AccountAddress;
|
|
99
140
|
publicKey: KeylessPublicKey | FederatedKeylessPublicKey;
|
|
@@ -106,9 +147,22 @@ export abstract class AbstractKeylessAccount extends Serializable implements Acc
|
|
|
106
147
|
proof: ZeroKnowledgeSig | Promise<ZeroKnowledgeSig>;
|
|
107
148
|
proofFetchCallback?: ProofFetchCallback;
|
|
108
149
|
jwt: string;
|
|
150
|
+
verificationKeyHash?: HexInput;
|
|
109
151
|
}) {
|
|
110
152
|
super();
|
|
111
|
-
const {
|
|
153
|
+
const {
|
|
154
|
+
address,
|
|
155
|
+
ephemeralKeyPair,
|
|
156
|
+
publicKey,
|
|
157
|
+
uidKey,
|
|
158
|
+
uidVal,
|
|
159
|
+
aud,
|
|
160
|
+
pepper,
|
|
161
|
+
proof,
|
|
162
|
+
proofFetchCallback,
|
|
163
|
+
jwt,
|
|
164
|
+
verificationKeyHash,
|
|
165
|
+
} = args;
|
|
112
166
|
this.ephemeralKeyPair = ephemeralKeyPair;
|
|
113
167
|
this.publicKey = publicKey;
|
|
114
168
|
this.accountAddress = address ? AccountAddress.from(address) : this.publicKey.authKey().derivedAddress();
|
|
@@ -137,11 +191,17 @@ export abstract class AbstractKeylessAccount extends Serializable implements Acc
|
|
|
137
191
|
throw new Error(`Pepper length in bytes should be ${AbstractKeylessAccount.PEPPER_LENGTH}`);
|
|
138
192
|
}
|
|
139
193
|
this.pepper = pepperBytes;
|
|
194
|
+
if (verificationKeyHash !== undefined) {
|
|
195
|
+
if (Hex.hexInputToUint8Array(verificationKeyHash).length !== 32) {
|
|
196
|
+
throw new Error("verificationKeyHash must be 32 bytes");
|
|
197
|
+
}
|
|
198
|
+
this.verificationKeyHash = Hex.hexInputToUint8Array(verificationKeyHash);
|
|
199
|
+
}
|
|
140
200
|
}
|
|
141
201
|
|
|
142
202
|
/**
|
|
143
|
-
* This initializes the asynchronous proof fetch
|
|
144
|
-
* @return
|
|
203
|
+
* This initializes the asynchronous proof fetch.
|
|
204
|
+
* @return Emits whether the proof succeeds or fails, but has no return.
|
|
145
205
|
*/
|
|
146
206
|
async init(promise: Promise<ZeroKnowledgeSig>) {
|
|
147
207
|
try {
|
|
@@ -156,7 +216,14 @@ export abstract class AbstractKeylessAccount extends Serializable implements Acc
|
|
|
156
216
|
}
|
|
157
217
|
}
|
|
158
218
|
|
|
219
|
+
/**
|
|
220
|
+
* Serializes the jwt data into a format suitable for transmission or storage.
|
|
221
|
+
* This function ensures that both the jwt data and the proof are properly serialized.
|
|
222
|
+
*
|
|
223
|
+
* @param serializer - The serializer instance used to convert the jwt data into bytes.
|
|
224
|
+
*/
|
|
159
225
|
serialize(serializer: Serializer): void {
|
|
226
|
+
this.accountAddress.serialize(serializer);
|
|
160
227
|
serializer.serializeStr(this.jwt);
|
|
161
228
|
serializer.serializeStr(this.uidKey);
|
|
162
229
|
serializer.serializeFixedBytes(this.pepper);
|
|
@@ -165,6 +232,27 @@ export abstract class AbstractKeylessAccount extends Serializable implements Acc
|
|
|
165
232
|
throw new Error("Cannot serialize - proof undefined");
|
|
166
233
|
}
|
|
167
234
|
this.proof.serialize(serializer);
|
|
235
|
+
serializer.serializeOption(this.verificationKeyHash, 32);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
static partialDeserialize(deserializer: Deserializer): {
|
|
239
|
+
address: AccountAddress;
|
|
240
|
+
jwt: string;
|
|
241
|
+
uidKey: string;
|
|
242
|
+
pepper: Uint8Array;
|
|
243
|
+
ephemeralKeyPair: EphemeralKeyPair;
|
|
244
|
+
proof: ZeroKnowledgeSig;
|
|
245
|
+
verificationKeyHash?: Uint8Array;
|
|
246
|
+
} {
|
|
247
|
+
const address = AccountAddress.deserialize(deserializer);
|
|
248
|
+
const jwt = deserializer.deserializeStr();
|
|
249
|
+
const uidKey = deserializer.deserializeStr();
|
|
250
|
+
const pepper = deserializer.deserializeFixedBytes(31);
|
|
251
|
+
const ephemeralKeyPair = EphemeralKeyPair.deserialize(deserializer);
|
|
252
|
+
const proof = ZeroKnowledgeSig.deserialize(deserializer);
|
|
253
|
+
const verificationKeyHash = deserializer.deserializeOption("fixedBytes", 32);
|
|
254
|
+
|
|
255
|
+
return { address, jwt, uidKey, pepper, ephemeralKeyPair, proof, verificationKeyHash };
|
|
168
256
|
}
|
|
169
257
|
|
|
170
258
|
/**
|
|
@@ -208,6 +296,45 @@ export abstract class AbstractKeylessAccount extends Serializable implements Acc
|
|
|
208
296
|
}
|
|
209
297
|
}
|
|
210
298
|
|
|
299
|
+
/**
|
|
300
|
+
* Validates that the Keyless Account can be used to sign transactions.
|
|
301
|
+
* @return
|
|
302
|
+
*/
|
|
303
|
+
async checkKeylessAccountValidity(aptosConfig: AptosConfig): Promise<void> {
|
|
304
|
+
if (this.isExpired()) {
|
|
305
|
+
throw KeylessError.fromErrorType({
|
|
306
|
+
type: KeylessErrorType.EPHEMERAL_KEY_PAIR_EXPIRED,
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
await this.waitForProofFetch();
|
|
310
|
+
if (this.proof === undefined) {
|
|
311
|
+
throw KeylessError.fromErrorType({
|
|
312
|
+
type: KeylessErrorType.ASYNC_PROOF_FETCH_FAILED,
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
const header = jwtDecode(this.jwt, { header: true });
|
|
316
|
+
if (header.kid === undefined) {
|
|
317
|
+
throw KeylessError.fromErrorType({
|
|
318
|
+
type: KeylessErrorType.JWT_PARSING_ERROR,
|
|
319
|
+
details: "checkKeylessAccountValidity failed. JWT is missing 'kid' in header. This should never happen.",
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
if (this.verificationKeyHash !== undefined) {
|
|
323
|
+
const { verificationKey } = await getKeylessConfig({ aptosConfig });
|
|
324
|
+
if (Hex.hexInputToString(verificationKey.hash()) !== Hex.hexInputToString(this.verificationKeyHash)) {
|
|
325
|
+
throw KeylessError.fromErrorType({
|
|
326
|
+
type: KeylessErrorType.INVALID_PROOF_VERIFICATION_KEY_NOT_FOUND,
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
} else {
|
|
330
|
+
// eslint-disable-next-line no-console
|
|
331
|
+
console.warn(
|
|
332
|
+
"[Aptos SDK] The verification key hash was not set. Proof may be invalid if the verification key has rotated.",
|
|
333
|
+
);
|
|
334
|
+
}
|
|
335
|
+
await AbstractKeylessAccount.fetchJWK({ aptosConfig, publicKey: this.publicKey, kid: header.kid });
|
|
336
|
+
}
|
|
337
|
+
|
|
211
338
|
/**
|
|
212
339
|
* Sign the given message using Keyless.
|
|
213
340
|
* @param message in HexInput format
|
|
@@ -216,10 +343,15 @@ export abstract class AbstractKeylessAccount extends Serializable implements Acc
|
|
|
216
343
|
sign(message: HexInput): KeylessSignature {
|
|
217
344
|
const { expiryDateSecs } = this.ephemeralKeyPair;
|
|
218
345
|
if (this.isExpired()) {
|
|
219
|
-
throw
|
|
346
|
+
throw KeylessError.fromErrorType({
|
|
347
|
+
type: KeylessErrorType.EPHEMERAL_KEY_PAIR_EXPIRED,
|
|
348
|
+
});
|
|
220
349
|
}
|
|
221
350
|
if (this.proof === undefined) {
|
|
222
|
-
throw
|
|
351
|
+
throw KeylessError.fromErrorType({
|
|
352
|
+
type: KeylessErrorType.PROOF_NOT_FOUND,
|
|
353
|
+
details: "Proof not found - make sure to call `await account.checkKeylessAccountValidity()` before signing.",
|
|
354
|
+
});
|
|
223
355
|
}
|
|
224
356
|
const ephemeralPublicKey = this.ephemeralKeyPair.getPublicKey();
|
|
225
357
|
const ephemeralSignature = this.ephemeralKeyPair.sign(message);
|
|
@@ -241,7 +373,10 @@ export abstract class AbstractKeylessAccount extends Serializable implements Acc
|
|
|
241
373
|
*/
|
|
242
374
|
signTransaction(transaction: AnyRawTransaction): KeylessSignature {
|
|
243
375
|
if (this.proof === undefined) {
|
|
244
|
-
throw
|
|
376
|
+
throw KeylessError.fromErrorType({
|
|
377
|
+
type: KeylessErrorType.PROOF_NOT_FOUND,
|
|
378
|
+
details: "Proof not found - make sure to call `await account.checkKeylessAccountValidity()` before signing.",
|
|
379
|
+
});
|
|
245
380
|
}
|
|
246
381
|
const raw = deriveTransactionType(transaction);
|
|
247
382
|
const txnAndProof = new TransactionAndProof(raw, this.proof.proof);
|
|
@@ -270,6 +405,58 @@ export abstract class AbstractKeylessAccount extends Serializable implements Acc
|
|
|
270
405
|
}
|
|
271
406
|
return true;
|
|
272
407
|
}
|
|
408
|
+
|
|
409
|
+
/**
|
|
410
|
+
* Fetches the JWK from the issuer's well-known JWKS endpoint.
|
|
411
|
+
*
|
|
412
|
+
* @param args.publicKey The keyless public key to query
|
|
413
|
+
* @param args.kid The kid of the JWK to fetch
|
|
414
|
+
* @returns A JWK matching the `kid` in the JWT header.
|
|
415
|
+
* @throws {KeylessError} If the JWK cannot be fetched
|
|
416
|
+
*/
|
|
417
|
+
static async fetchJWK(args: {
|
|
418
|
+
aptosConfig: AptosConfig;
|
|
419
|
+
publicKey: KeylessPublicKey | FederatedKeylessPublicKey;
|
|
420
|
+
kid: string;
|
|
421
|
+
}): Promise<MoveJWK> {
|
|
422
|
+
const { aptosConfig, publicKey, kid } = args;
|
|
423
|
+
const keylessPubKey = publicKey instanceof KeylessPublicKey ? publicKey : publicKey.keylessPublicKey;
|
|
424
|
+
const { iss } = keylessPubKey;
|
|
425
|
+
|
|
426
|
+
let allJWKs: Map<string, MoveJWK[]>;
|
|
427
|
+
const jwkAddr = publicKey instanceof FederatedKeylessPublicKey ? publicKey.jwkAddress : undefined;
|
|
428
|
+
try {
|
|
429
|
+
allJWKs = await getKeylessJWKs({ aptosConfig, jwkAddr });
|
|
430
|
+
} catch (error) {
|
|
431
|
+
throw KeylessError.fromErrorType({
|
|
432
|
+
type: KeylessErrorType.FULL_NODE_JWKS_LOOKUP_ERROR,
|
|
433
|
+
error,
|
|
434
|
+
details: `Failed to fetch ${jwkAddr ? "Federated" : "Patched"}JWKs ${jwkAddr ? `for address ${jwkAddr}` : "0x1"}`,
|
|
435
|
+
});
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
// Find the corresponding JWK set by `iss`
|
|
439
|
+
const jwksForIssuer = allJWKs.get(iss);
|
|
440
|
+
|
|
441
|
+
if (jwksForIssuer === undefined) {
|
|
442
|
+
throw KeylessError.fromErrorType({
|
|
443
|
+
type: KeylessErrorType.INVALID_JWT_ISS_NOT_RECOGNIZED,
|
|
444
|
+
details: `JWKs for issuer ${iss} not found.`,
|
|
445
|
+
});
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
// Find the corresponding JWK by `kid`
|
|
449
|
+
const jwk = jwksForIssuer.find((key) => key.kid === kid);
|
|
450
|
+
|
|
451
|
+
if (jwk === undefined) {
|
|
452
|
+
throw KeylessError.fromErrorType({
|
|
453
|
+
type: KeylessErrorType.INVALID_JWT_JWK_NOT_FOUND,
|
|
454
|
+
details: `JWK with kid '${kid}' for issuer '${iss}' not found.`,
|
|
455
|
+
});
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
return jwk;
|
|
459
|
+
}
|
|
273
460
|
}
|
|
274
461
|
|
|
275
462
|
/**
|
|
@@ -298,6 +485,12 @@ export class TransactionAndProof extends Serializable {
|
|
|
298
485
|
this.proof = proof;
|
|
299
486
|
}
|
|
300
487
|
|
|
488
|
+
/**
|
|
489
|
+
* Serializes the transaction data into a format suitable for transmission or storage.
|
|
490
|
+
* This function ensures that both the transaction bytes and the proof are properly serialized.
|
|
491
|
+
*
|
|
492
|
+
* @param serializer - The serializer instance used to convert the transaction data into bytes.
|
|
493
|
+
*/
|
|
301
494
|
serialize(serializer: Serializer): void {
|
|
302
495
|
serializer.serializeFixedBytes(this.transaction.bcsToBytes());
|
|
303
496
|
serializer.serializeOption(this.proof);
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
// Copyright © Aptos Foundation
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
-
import { JwtPayload, jwtDecode } from "jwt-decode";
|
|
5
4
|
import { HexInput } from "../types";
|
|
6
5
|
import { AccountAddress, AccountAddressInput } from "../core/accountAddress";
|
|
7
|
-
import { ZeroKnowledgeSig } from "../core/crypto";
|
|
6
|
+
import { getIssAudAndUidVal, Groth16VerificationKey, ZeroKnowledgeSig } from "../core/crypto";
|
|
8
7
|
|
|
9
8
|
import { EphemeralKeyPair } from "./EphemeralKeyPair";
|
|
10
9
|
import { Deserializer, Serializer } from "../bcs";
|
|
11
10
|
import { FederatedKeylessPublicKey } from "../core/crypto/federatedKeyless";
|
|
12
11
|
import { AbstractKeylessAccount, ProofFetchCallback } from "./AbstractKeylessAccount";
|
|
12
|
+
import { Hex } from "../core";
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Account implementation for the FederatedKeyless authentication scheme.
|
|
16
16
|
*
|
|
17
17
|
* Used to represent a FederatedKeyless based account and sign transactions with it.
|
|
18
18
|
*
|
|
19
|
-
* Use `FederatedKeylessAccount.create()` to instantiate a KeylessAccount with a JWT, proof, EphemeralKeyPair and the
|
|
20
|
-
* address the
|
|
19
|
+
* Use `FederatedKeylessAccount.create()` to instantiate a KeylessAccount with a JSON Web Token (JWT), proof, EphemeralKeyPair and the
|
|
20
|
+
* address the JSON Web Key Set (JWKS) are installed that will be used to verify the JWT.
|
|
21
21
|
*
|
|
22
22
|
* When the proof expires or the JWT becomes invalid, the KeylessAccount must be instantiated again with a new JWT,
|
|
23
23
|
* EphemeralKeyPair, and corresponding proof.
|
|
@@ -28,7 +28,20 @@ export class FederatedKeylessAccount extends AbstractKeylessAccount {
|
|
|
28
28
|
*/
|
|
29
29
|
readonly publicKey: FederatedKeylessPublicKey;
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Use the static generator `FederatedKeylessAccount.create(...)` instead.
|
|
33
|
+
* Creates a KeylessAccount instance using the provided parameters.
|
|
34
|
+
* This function allows you to set up a KeylessAccount with specific attributes such as address, proof, and JWT.
|
|
35
|
+
*
|
|
36
|
+
* @param args - The parameters for creating a KeylessAccount.
|
|
37
|
+
* @param args.address - Optional account address associated with the KeylessAccount.
|
|
38
|
+
* @param args.proof - A Zero Knowledge Signature or a promise that resolves to one.
|
|
39
|
+
* @param args.jwt - A JSON Web Token used for authentication.
|
|
40
|
+
* @param args.ephemeralKeyPair - The ephemeral key pair used in the account creation.
|
|
41
|
+
* @param args.jwkAddress - The address which stores the JSON Web Key Set (JWKS) used to verify the JWT.
|
|
42
|
+
* @param args.uidKey - Optional key for user identification, defaults to "sub".
|
|
43
|
+
* @param args.proofFetchCallback - Optional callback function for fetching proof.
|
|
44
|
+
*/
|
|
32
45
|
private constructor(args: {
|
|
33
46
|
address?: AccountAddress;
|
|
34
47
|
ephemeralKeyPair: EphemeralKeyPair;
|
|
@@ -41,45 +54,75 @@ export class FederatedKeylessAccount extends AbstractKeylessAccount {
|
|
|
41
54
|
proof: ZeroKnowledgeSig | Promise<ZeroKnowledgeSig>;
|
|
42
55
|
proofFetchCallback?: ProofFetchCallback;
|
|
43
56
|
jwt: string;
|
|
57
|
+
verificationKeyHash?: HexInput;
|
|
44
58
|
}) {
|
|
45
59
|
const publicKey = FederatedKeylessPublicKey.create(args);
|
|
46
60
|
super({ publicKey, ...args });
|
|
47
61
|
this.publicKey = publicKey;
|
|
48
62
|
}
|
|
49
63
|
|
|
64
|
+
/**
|
|
65
|
+
* Serializes the transaction data into a format suitable for transmission or storage.
|
|
66
|
+
* This function ensures that both the transaction bytes and the proof are properly serialized.
|
|
67
|
+
*
|
|
68
|
+
* @param serializer - The serializer instance used to convert the transaction data into bytes.
|
|
69
|
+
*/
|
|
50
70
|
serialize(serializer: Serializer): void {
|
|
51
|
-
|
|
52
|
-
throw new Error("Cannot serialize - proof undefined");
|
|
53
|
-
}
|
|
54
|
-
serializer.serializeStr(this.jwt);
|
|
55
|
-
serializer.serializeStr(this.uidKey);
|
|
56
|
-
serializer.serializeFixedBytes(this.pepper);
|
|
71
|
+
super.serialize(serializer);
|
|
57
72
|
this.publicKey.jwkAddress.serialize(serializer);
|
|
58
|
-
this.ephemeralKeyPair.serialize(serializer);
|
|
59
|
-
this.proof.serialize(serializer);
|
|
60
73
|
}
|
|
61
74
|
|
|
75
|
+
/**
|
|
76
|
+
* Deserializes the provided deserializer to create a KeylessAccount instance.
|
|
77
|
+
* This function extracts necessary components such as the JWT, UID key, pepper, ephemeral key pair, and proof from the deserializer.
|
|
78
|
+
*
|
|
79
|
+
* @param deserializer - The deserializer instance used to retrieve the serialized data.
|
|
80
|
+
* @returns A KeylessAccount instance created from the deserialized data.
|
|
81
|
+
*/
|
|
62
82
|
static deserialize(deserializer: Deserializer): FederatedKeylessAccount {
|
|
63
|
-
const jwt =
|
|
64
|
-
|
|
65
|
-
const pepper = deserializer.deserializeFixedBytes(31);
|
|
83
|
+
const { address, proof, ephemeralKeyPair, jwt, uidKey, pepper, verificationKeyHash } =
|
|
84
|
+
AbstractKeylessAccount.partialDeserialize(deserializer);
|
|
66
85
|
const jwkAddress = AccountAddress.deserialize(deserializer);
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
|
|
86
|
+
const { iss, aud, uidVal } = getIssAudAndUidVal({ jwt, uidKey });
|
|
87
|
+
return new FederatedKeylessAccount({
|
|
88
|
+
address,
|
|
70
89
|
proof,
|
|
71
|
-
|
|
72
|
-
|
|
90
|
+
ephemeralKeyPair,
|
|
91
|
+
iss,
|
|
73
92
|
uidKey,
|
|
93
|
+
uidVal,
|
|
94
|
+
aud,
|
|
95
|
+
pepper,
|
|
74
96
|
jwt,
|
|
75
|
-
|
|
97
|
+
verificationKeyHash,
|
|
98
|
+
jwkAddress,
|
|
76
99
|
});
|
|
77
100
|
}
|
|
78
101
|
|
|
79
|
-
|
|
80
|
-
|
|
102
|
+
/**
|
|
103
|
+
* Deserialize bytes using this account's information.
|
|
104
|
+
*
|
|
105
|
+
* @param bytes The bytes being interpreted.
|
|
106
|
+
* @returns
|
|
107
|
+
*/
|
|
108
|
+
static fromBytes(bytes: HexInput): FederatedKeylessAccount {
|
|
109
|
+
return FederatedKeylessAccount.deserialize(new Deserializer(Hex.hexInputToUint8Array(bytes)));
|
|
81
110
|
}
|
|
82
111
|
|
|
112
|
+
/**
|
|
113
|
+
* Creates a KeylessAccount instance using the provided parameters.
|
|
114
|
+
* This function allows you to set up a KeylessAccount with specific attributes such as address, proof, and JWT.
|
|
115
|
+
* This is used instead of the KeylessAccount constructor.
|
|
116
|
+
*
|
|
117
|
+
* @param args - The parameters for creating a KeylessAccount.
|
|
118
|
+
* @param args.address - Optional account address associated with the KeylessAccount.
|
|
119
|
+
* @param args.proof - A Zero Knowledge Signature or a promise that resolves to one.
|
|
120
|
+
* @param args.jwt - A JSON Web Token used for authentication.
|
|
121
|
+
* @param args.ephemeralKeyPair - The ephemeral key pair used in the account creation.
|
|
122
|
+
* @param args.jwkAddress - The address which stores the JSON Web Key Set (JWKS) used to verify the JWT.
|
|
123
|
+
* @param args.uidKey - Optional key for user identification, defaults to "sub".
|
|
124
|
+
* @param args.proofFetchCallback - Optional callback function for fetching proof.
|
|
125
|
+
*/
|
|
83
126
|
static create(args: {
|
|
84
127
|
address?: AccountAddress;
|
|
85
128
|
proof: ZeroKnowledgeSig | Promise<ZeroKnowledgeSig>;
|
|
@@ -89,29 +132,34 @@ export class FederatedKeylessAccount extends AbstractKeylessAccount {
|
|
|
89
132
|
jwkAddress: AccountAddressInput;
|
|
90
133
|
uidKey?: string;
|
|
91
134
|
proofFetchCallback?: ProofFetchCallback;
|
|
135
|
+
verificationKey?: Groth16VerificationKey;
|
|
92
136
|
}): FederatedKeylessAccount {
|
|
93
|
-
const {
|
|
137
|
+
const {
|
|
138
|
+
address,
|
|
139
|
+
proof,
|
|
140
|
+
jwt,
|
|
141
|
+
ephemeralKeyPair,
|
|
142
|
+
pepper,
|
|
143
|
+
jwkAddress,
|
|
144
|
+
uidKey = "sub",
|
|
145
|
+
proofFetchCallback,
|
|
146
|
+
verificationKey,
|
|
147
|
+
} = args;
|
|
94
148
|
|
|
95
|
-
const
|
|
96
|
-
if (typeof jwtPayload.iss !== "string") {
|
|
97
|
-
throw new Error("iss was not found");
|
|
98
|
-
}
|
|
99
|
-
if (typeof jwtPayload.aud !== "string") {
|
|
100
|
-
throw new Error("aud was not found or an array of values");
|
|
101
|
-
}
|
|
102
|
-
const uidVal = jwtPayload[uidKey];
|
|
149
|
+
const { iss, aud, uidVal } = getIssAudAndUidVal({ jwt, uidKey });
|
|
103
150
|
return new FederatedKeylessAccount({
|
|
104
151
|
address,
|
|
105
152
|
proof,
|
|
106
153
|
ephemeralKeyPair,
|
|
107
|
-
iss
|
|
154
|
+
iss,
|
|
108
155
|
uidKey,
|
|
109
156
|
uidVal,
|
|
110
|
-
aud
|
|
157
|
+
aud,
|
|
111
158
|
pepper,
|
|
112
159
|
jwkAddress: AccountAddress.from(jwkAddress),
|
|
113
160
|
jwt,
|
|
114
161
|
proofFetchCallback,
|
|
162
|
+
verificationKeyHash: verificationKey ? verificationKey.hash() : undefined,
|
|
115
163
|
});
|
|
116
164
|
}
|
|
117
165
|
}
|