@aptos-labs/ts-sdk 1.33.0 → 1.33.2-sc.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/README.md +11 -6
- package/dist/common/{accountAddress-fJZJVSBc.d.ts → accountAddress-Cf1amU98.d.ts} +293 -1
- package/dist/common/{chunk-F43XVDYJ.js → chunk-IHUCZKG2.js} +1 -1
- package/dist/common/chunk-IHUCZKG2.js.map +1 -0
- package/dist/common/cli/index.d.ts +56 -9
- package/dist/common/cli/index.js +1 -1
- package/dist/common/cli/index.js.map +1 -1
- package/dist/common/index.d.ts +2126 -305
- package/dist/common/index.js +33 -33
- package/dist/common/index.js.map +1 -1
- package/dist/esm/{Ed25519Account-B3xHXAQe.d.mts → Ed25519Account-D4j3_WIS.d.mts} +122 -12
- package/dist/esm/account/AbstractKeylessAccount.d.mts +82 -7
- package/dist/esm/account/AbstractKeylessAccount.mjs +1 -1
- package/dist/esm/account/Account.d.mts +6 -4
- package/dist/esm/account/Account.mjs +1 -1
- package/dist/esm/account/AccountUtils.d.mts +65 -0
- package/dist/esm/account/AccountUtils.mjs +2 -0
- package/dist/esm/account/Ed25519Account.d.mts +4 -2
- package/dist/esm/account/Ed25519Account.mjs +1 -1
- package/dist/esm/account/EphemeralKeyPair.d.mts +30 -1
- package/dist/esm/account/EphemeralKeyPair.mjs +1 -1
- package/dist/esm/account/FederatedKeylessAccount.d.mts +26 -5
- package/dist/esm/account/FederatedKeylessAccount.mjs +1 -1
- package/dist/esm/account/KeylessAccount.d.mts +31 -5
- package/dist/esm/account/KeylessAccount.mjs +1 -1
- package/dist/esm/account/MultiKeyAccount.d.mts +41 -5
- package/dist/esm/account/MultiKeyAccount.mjs +1 -1
- package/dist/esm/account/SingleKeyAccount.d.mts +5 -3
- package/dist/esm/account/SingleKeyAccount.mjs +1 -1
- package/dist/esm/account/index.d.mts +5 -2
- package/dist/esm/account/index.mjs +1 -1
- package/dist/esm/account/utils.d.mts +19 -0
- package/dist/esm/account/utils.mjs +2 -0
- package/dist/esm/api/account.d.mts +26 -4
- package/dist/esm/api/account.mjs +1 -1
- package/dist/esm/api/ans.d.mts +19 -2
- package/dist/esm/api/ans.mjs +1 -1
- package/dist/esm/api/aptos.d.mts +7 -2
- package/dist/esm/api/aptos.mjs +1 -1
- package/dist/esm/api/aptosConfig.d.mts +17 -0
- package/dist/esm/api/aptosConfig.mjs +1 -1
- package/dist/esm/api/coin.d.mts +8 -3
- package/dist/esm/api/coin.mjs +1 -1
- package/dist/esm/api/digitalAsset.d.mts +30 -2
- package/dist/esm/api/digitalAsset.mjs +1 -1
- package/dist/esm/api/event.d.mts +7 -0
- package/dist/esm/api/event.mjs +1 -1
- package/dist/esm/api/faucet.d.mts +12 -2
- package/dist/esm/api/faucet.mjs +1 -1
- package/dist/esm/api/fungibleAsset.d.mts +12 -2
- package/dist/esm/api/fungibleAsset.mjs +1 -1
- package/dist/esm/api/general.d.mts +15 -1
- package/dist/esm/api/general.mjs +1 -1
- package/dist/esm/api/index.d.mts +5 -2
- package/dist/esm/api/index.mjs +1 -1
- package/dist/esm/api/keyless.d.mts +10 -3
- package/dist/esm/api/keyless.mjs +1 -1
- package/dist/esm/api/object.d.mts +4 -0
- package/dist/esm/api/object.mjs +1 -1
- package/dist/esm/api/staking.d.mts +6 -0
- package/dist/esm/api/staking.mjs +1 -1
- package/dist/esm/api/table.d.mts +6 -0
- package/dist/esm/api/table.mjs +1 -1
- package/dist/esm/api/transaction.d.mts +25 -6
- package/dist/esm/api/transaction.mjs +1 -1
- package/dist/esm/api/transactionSubmission/build.d.mts +72 -1
- package/dist/esm/api/transactionSubmission/build.mjs +1 -1
- package/dist/esm/api/transactionSubmission/helpers.d.mts +2 -0
- package/dist/esm/api/transactionSubmission/helpers.mjs +1 -1
- package/dist/esm/api/transactionSubmission/management.d.mts +9 -2
- package/dist/esm/api/transactionSubmission/management.mjs +1 -1
- package/dist/esm/api/transactionSubmission/sign.d.mts +8 -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 +7 -1
- package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
- package/dist/esm/api/transactionSubmission/submit.d.mts +7 -1
- package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
- package/dist/esm/api/utils.d.mts +2 -0
- package/dist/esm/api/utils.mjs +1 -1
- package/dist/esm/bcs/consts.d.mts +1 -0
- package/dist/esm/bcs/deserializer.d.mts +57 -2
- package/dist/esm/bcs/deserializer.mjs +1 -1
- package/dist/esm/bcs/index.d.mts +1 -0
- package/dist/esm/bcs/index.mjs +1 -1
- package/dist/esm/bcs/serializable/entryFunctionBytes.d.mts +11 -0
- package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -1
- package/dist/esm/bcs/serializable/fixedBytes.d.mts +13 -0
- package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -1
- package/dist/esm/bcs/serializable/movePrimitives.d.mts +25 -0
- package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
- package/dist/esm/bcs/serializable/moveStructs.d.mts +57 -0
- package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
- package/dist/esm/bcs/serializer.d.mts +61 -0
- package/dist/esm/bcs/serializer.mjs +1 -1
- package/dist/esm/{chunk-XVPWTWPY.mjs → chunk-32WLD3F3.mjs} +2 -2
- package/dist/esm/chunk-32WLD3F3.mjs.map +1 -0
- package/dist/esm/chunk-35DKMW7Q.mjs +2 -0
- package/dist/esm/chunk-35DKMW7Q.mjs.map +1 -0
- package/dist/esm/chunk-3OLFJ65O.mjs +2 -0
- package/dist/esm/chunk-3OLFJ65O.mjs.map +1 -0
- package/dist/esm/chunk-3XH3NNSR.mjs +2 -0
- package/dist/esm/chunk-3XH3NNSR.mjs.map +1 -0
- package/dist/esm/chunk-4RXKALLC.mjs +2 -0
- package/dist/esm/chunk-4RXKALLC.mjs.map +1 -0
- package/dist/esm/{chunk-64IZ5PQR.mjs → chunk-4UYVRG5Z.mjs} +2 -2
- package/dist/esm/chunk-4UYVRG5Z.mjs.map +1 -0
- package/dist/esm/chunk-4YLUM62M.mjs +2 -0
- package/dist/esm/chunk-4YLUM62M.mjs.map +1 -0
- package/dist/esm/{chunk-KKLF7DQV.mjs → chunk-4ZJJINCW.mjs} +2 -2
- package/dist/esm/chunk-4ZJJINCW.mjs.map +1 -0
- package/dist/esm/{chunk-U7UTBXJD.mjs → chunk-66AQ2MJ6.mjs} +2 -2
- package/dist/esm/chunk-66AQ2MJ6.mjs.map +1 -0
- package/dist/esm/{chunk-LZ5PSDOS.mjs → chunk-67BUAZ6O.mjs} +2 -2
- package/dist/esm/chunk-67BUAZ6O.mjs.map +1 -0
- package/dist/esm/{chunk-A3USS2NC.mjs → chunk-67ZANQ3R.mjs} +2 -2
- package/dist/esm/chunk-67ZANQ3R.mjs.map +1 -0
- package/dist/esm/{chunk-JUQBFGUD.mjs → chunk-6IIAGMDR.mjs} +2 -2
- package/dist/esm/chunk-6IIAGMDR.mjs.map +1 -0
- package/dist/esm/{chunk-BWV6OYLG.mjs → chunk-6IPM5P4L.mjs} +2 -2
- package/dist/esm/chunk-6IPM5P4L.mjs.map +1 -0
- package/dist/esm/{chunk-WXLSHECY.mjs → chunk-6XHBRRS6.mjs} +2 -2
- package/dist/esm/chunk-6XHBRRS6.mjs.map +1 -0
- package/dist/esm/chunk-7HLNV3QL.mjs +2 -0
- package/dist/esm/chunk-7HLNV3QL.mjs.map +1 -0
- package/dist/esm/{chunk-CK5NDXQT.mjs → chunk-A3NEASNH.mjs} +2 -2
- package/dist/esm/chunk-A3NEASNH.mjs.map +1 -0
- package/dist/esm/{chunk-2CJC43CV.mjs → chunk-A5L76YP7.mjs} +1 -1
- package/dist/esm/chunk-A5L76YP7.mjs.map +1 -0
- package/dist/esm/{chunk-P74XXLE4.mjs → chunk-AD3A7DTH.mjs} +2 -2
- package/dist/esm/chunk-AD3A7DTH.mjs.map +1 -0
- package/dist/esm/chunk-AIABPCUF.mjs +2 -0
- package/dist/esm/{chunk-YQHOQJRQ.mjs.map → chunk-AIABPCUF.mjs.map} +1 -1
- package/dist/esm/{chunk-AOROYJ74.mjs → chunk-AZWVCBK2.mjs} +2 -2
- package/dist/esm/chunk-AZWVCBK2.mjs.map +1 -0
- package/dist/esm/chunk-BFIXIXHO.mjs +2 -0
- package/dist/esm/chunk-BFIXIXHO.mjs.map +1 -0
- package/dist/esm/{chunk-6ZOVTYLJ.mjs → chunk-BI3BTSUB.mjs} +2 -2
- package/dist/esm/chunk-BI3BTSUB.mjs.map +1 -0
- package/dist/esm/{chunk-OIOGOW6I.mjs → chunk-C3Q23D22.mjs} +1 -1
- package/dist/esm/chunk-C3Q23D22.mjs.map +1 -0
- package/dist/esm/{chunk-KPPM2BSC.mjs → chunk-CDYLZDD2.mjs} +2 -2
- package/dist/esm/chunk-CDYLZDD2.mjs.map +1 -0
- package/dist/esm/{chunk-5XLZACVT.mjs → chunk-CGTHWGSJ.mjs} +2 -2
- package/dist/esm/chunk-CGTHWGSJ.mjs.map +1 -0
- package/dist/esm/{chunk-P6RNNESB.mjs → chunk-CNCRJ56P.mjs} +2 -2
- package/dist/esm/chunk-CNCRJ56P.mjs.map +1 -0
- package/dist/esm/{chunk-VQZMI3EZ.mjs → chunk-CWKNJZB6.mjs} +2 -2
- package/dist/esm/chunk-CWKNJZB6.mjs.map +1 -0
- package/dist/esm/chunk-CWRANLXZ.mjs +2 -0
- package/dist/esm/chunk-CWRANLXZ.mjs.map +1 -0
- package/dist/esm/{chunk-476F5NJ6.mjs → chunk-CYMVZJHC.mjs} +2 -2
- package/dist/esm/chunk-CYMVZJHC.mjs.map +1 -0
- package/dist/esm/{chunk-V4FKFCBL.mjs → chunk-DAFSKSZ5.mjs} +1 -1
- package/dist/esm/chunk-DAFSKSZ5.mjs.map +1 -0
- package/dist/esm/chunk-DPW6ELCQ.mjs +2 -0
- package/dist/esm/chunk-DPW6ELCQ.mjs.map +1 -0
- package/dist/esm/{chunk-HKVZ7CAG.mjs → chunk-DW3ETAZB.mjs} +2 -2
- package/dist/esm/chunk-DW3ETAZB.mjs.map +1 -0
- package/dist/esm/{chunk-AJ5JHBAE.mjs → chunk-EBMEXURY.mjs} +2 -2
- package/dist/esm/chunk-EBMEXURY.mjs.map +1 -0
- package/dist/esm/{chunk-4IQZOAN7.mjs → chunk-EBS4BKER.mjs} +2 -2
- package/dist/esm/chunk-EBS4BKER.mjs.map +1 -0
- package/dist/esm/{chunk-VAKNMHOA.mjs → chunk-ECZYQTNN.mjs} +2 -2
- package/dist/esm/chunk-ECZYQTNN.mjs.map +1 -0
- package/dist/esm/chunk-EMURYYVO.mjs +2 -0
- package/dist/esm/chunk-EMURYYVO.mjs.map +1 -0
- package/dist/esm/chunk-F2ZTBAJJ.mjs +2 -0
- package/dist/esm/chunk-F2ZTBAJJ.mjs.map +1 -0
- package/dist/esm/chunk-FC2IYWI7.mjs +2 -0
- package/dist/esm/chunk-FC2IYWI7.mjs.map +1 -0
- package/dist/esm/chunk-FKJ3GCBI.mjs +2 -0
- package/dist/esm/chunk-FKJ3GCBI.mjs.map +1 -0
- package/dist/esm/{chunk-AKIO3OIT.mjs → chunk-FN4C3CKC.mjs} +2 -2
- package/dist/esm/chunk-FN4C3CKC.mjs.map +1 -0
- package/dist/esm/{chunk-6AEXQEO2.mjs → chunk-FNXO3URE.mjs} +2 -2
- package/dist/esm/chunk-FNXO3URE.mjs.map +1 -0
- package/dist/esm/{chunk-FH27D7S3.mjs → chunk-FQECACH3.mjs} +2 -2
- package/dist/esm/chunk-FQECACH3.mjs.map +1 -0
- package/dist/esm/{chunk-LK67PZX3.mjs → chunk-FQXEX2HN.mjs} +2 -2
- package/dist/esm/chunk-FQXEX2HN.mjs.map +1 -0
- package/dist/esm/{chunk-T6ADNZE5.mjs → chunk-G4O6FXCF.mjs} +2 -2
- package/dist/esm/chunk-G4O6FXCF.mjs.map +1 -0
- package/dist/esm/chunk-G5ZWH5T3.mjs +2 -0
- package/dist/esm/chunk-G5ZWH5T3.mjs.map +1 -0
- package/dist/esm/{chunk-HULCIESG.mjs → chunk-GL4OJVYH.mjs} +2 -2
- package/dist/esm/chunk-GL4OJVYH.mjs.map +1 -0
- package/dist/esm/{chunk-GMKKHGXK.mjs → chunk-GOXRBEIJ.mjs} +1 -1
- package/dist/esm/chunk-GOXRBEIJ.mjs.map +1 -0
- package/dist/esm/chunk-GP4TLDVZ.mjs +1 -0
- package/dist/esm/{chunk-ALOYOMRE.mjs → chunk-H3XZ3FZY.mjs} +2 -2
- package/dist/esm/{chunk-ALOYOMRE.mjs.map → chunk-H3XZ3FZY.mjs.map} +1 -1
- package/dist/esm/{chunk-O4MRRWRI.mjs → chunk-I7JGKVOC.mjs} +2 -2
- package/dist/esm/chunk-I7JGKVOC.mjs.map +1 -0
- package/dist/esm/{chunk-6Q2O5G3J.mjs → chunk-IF4UU2MT.mjs} +1 -1
- package/dist/esm/chunk-IF4UU2MT.mjs.map +1 -0
- package/dist/esm/{chunk-QN7AK5PU.mjs → chunk-IJ2QKE4W.mjs} +2 -2
- package/dist/esm/chunk-IJ2QKE4W.mjs.map +1 -0
- package/dist/esm/chunk-JJM6ELMS.mjs +2 -0
- package/dist/esm/chunk-JJM6ELMS.mjs.map +1 -0
- package/dist/esm/{chunk-TQA6HY6A.mjs → chunk-K2CSACQY.mjs} +2 -2
- package/dist/esm/chunk-K2CSACQY.mjs.map +1 -0
- package/dist/esm/{chunk-2D7OMWVL.mjs → chunk-KFCLSJC3.mjs} +2 -2
- package/dist/esm/chunk-KFGXOZ77.mjs +2 -0
- package/dist/esm/chunk-KFGXOZ77.mjs.map +1 -0
- package/dist/esm/{chunk-B5BXB2BB.mjs → chunk-KG23XFU2.mjs} +2 -2
- package/dist/esm/chunk-KG23XFU2.mjs.map +1 -0
- package/dist/esm/chunk-KNTAED2Z.mjs +2 -0
- package/dist/esm/chunk-KNTAED2Z.mjs.map +1 -0
- package/dist/esm/{chunk-4ZNSNWQL.mjs → chunk-KPLWOVKG.mjs} +2 -2
- package/dist/esm/chunk-KPLWOVKG.mjs.map +1 -0
- package/dist/esm/{chunk-BRV3RLKW.mjs → chunk-MT2RJ7H3.mjs} +2 -2
- package/dist/esm/chunk-MT2RJ7H3.mjs.map +1 -0
- package/dist/esm/{chunk-ACVIE7IE.mjs → chunk-N4DM5FYH.mjs} +2 -2
- package/dist/esm/chunk-N4DM5FYH.mjs.map +1 -0
- package/dist/esm/{chunk-Q3CWUEXI.mjs → chunk-N4VVDQA5.mjs} +2 -2
- package/dist/esm/chunk-N4VVDQA5.mjs.map +1 -0
- package/dist/esm/{chunk-LGTOOAQI.mjs → chunk-N6YTF76Q.mjs} +2 -2
- package/dist/esm/chunk-N6YTF76Q.mjs.map +1 -0
- package/dist/esm/{chunk-OEM75TVE.mjs → chunk-NDUIXMIA.mjs} +2 -2
- package/dist/esm/chunk-NDUIXMIA.mjs.map +1 -0
- package/dist/esm/{chunk-FUC7SLH7.mjs → chunk-NW2WUKWV.mjs} +2 -2
- package/dist/esm/chunk-NW2WUKWV.mjs.map +1 -0
- package/dist/esm/{chunk-I3452DF5.mjs → chunk-ODEDSSQL.mjs} +2 -2
- package/dist/esm/chunk-ODEDSSQL.mjs.map +1 -0
- package/dist/esm/{chunk-42H7WETG.mjs → chunk-ORMOQWWH.mjs} +2 -2
- package/dist/esm/chunk-ORMOQWWH.mjs.map +1 -0
- package/dist/esm/{chunk-JKA22FG5.mjs → chunk-P4VF7BN4.mjs} +2 -2
- package/dist/esm/chunk-P4VF7BN4.mjs.map +1 -0
- package/dist/esm/chunk-P54RNN4V.mjs +2 -0
- package/dist/esm/chunk-P54RNN4V.mjs.map +1 -0
- package/dist/esm/{chunk-D54FD6XE.mjs → chunk-PHJRCZQ3.mjs} +2 -2
- package/dist/esm/chunk-PHJRCZQ3.mjs.map +1 -0
- package/dist/esm/{chunk-YITOC4Z6.mjs → chunk-PNDCGNVH.mjs} +2 -2
- package/dist/esm/chunk-PNDCGNVH.mjs.map +1 -0
- package/dist/esm/{chunk-Y5HLXDYG.mjs → chunk-PTS3BTOU.mjs} +2 -2
- package/dist/esm/chunk-PTS3BTOU.mjs.map +1 -0
- package/dist/esm/{chunk-737YW3CY.mjs → chunk-PUNTBVRJ.mjs} +2 -2
- package/dist/esm/chunk-PUNTBVRJ.mjs.map +1 -0
- package/dist/esm/{chunk-MWNYODWU.mjs → chunk-Q2C6ZY5N.mjs} +2 -2
- package/dist/esm/chunk-Q2C6ZY5N.mjs.map +1 -0
- package/dist/esm/{chunk-R2YT2IM5.mjs → chunk-Q3VS6AEN.mjs} +2 -2
- package/dist/esm/{chunk-R2YT2IM5.mjs.map → chunk-Q3VS6AEN.mjs.map} +1 -1
- package/dist/esm/{chunk-JNO7KPMG.mjs → chunk-Q4C4U6I4.mjs} +2 -2
- package/dist/esm/chunk-Q4C4U6I4.mjs.map +1 -0
- package/dist/esm/{chunk-F45G3GP3.mjs → chunk-QHEKBHNU.mjs} +2 -2
- package/dist/esm/chunk-R7QOPBWA.mjs +2 -0
- package/dist/esm/chunk-R7QOPBWA.mjs.map +1 -0
- package/dist/esm/{chunk-J7PJSK3J.mjs → chunk-RJ7F4JDV.mjs} +1 -1
- package/dist/esm/chunk-RJ7F4JDV.mjs.map +1 -0
- package/dist/esm/chunk-ROT6S6BM.mjs +2 -0
- package/dist/esm/chunk-ROT6S6BM.mjs.map +1 -0
- package/dist/esm/{chunk-OGBU52BQ.mjs → chunk-SOLQ5VON.mjs} +2 -2
- package/dist/esm/chunk-SOLQ5VON.mjs.map +1 -0
- package/dist/esm/{chunk-L3J2QVIY.mjs → chunk-SQR3AIY7.mjs} +2 -2
- package/dist/esm/chunk-SQR3AIY7.mjs.map +1 -0
- package/dist/esm/{chunk-SPRNSFUV.mjs → chunk-STY74NUA.mjs} +2 -2
- package/dist/esm/chunk-STY74NUA.mjs.map +1 -0
- package/dist/esm/{chunk-YT3IP57B.mjs → chunk-SZRZ3HIL.mjs} +2 -2
- package/dist/esm/chunk-SZRZ3HIL.mjs.map +1 -0
- package/dist/esm/{chunk-QZT2M7UA.mjs → chunk-T6NQDM7D.mjs} +2 -2
- package/dist/esm/chunk-T6NQDM7D.mjs.map +1 -0
- package/dist/esm/{chunk-ZMBXHMVQ.mjs → chunk-TOBQ5UE6.mjs} +2 -2
- package/dist/esm/chunk-TOBQ5UE6.mjs.map +1 -0
- package/dist/esm/{chunk-4ULPBQ3M.mjs → chunk-UF6SI2QE.mjs} +2 -2
- package/dist/esm/chunk-UF6SI2QE.mjs.map +1 -0
- package/dist/esm/chunk-UIRAXHDH.mjs +1 -0
- package/dist/esm/chunk-UIRAXHDH.mjs.map +1 -0
- package/dist/esm/{chunk-S3YVCCYI.mjs → chunk-UONSJQUV.mjs} +2 -2
- package/dist/esm/chunk-UONSJQUV.mjs.map +1 -0
- package/dist/esm/{chunk-S22QVNK7.mjs → chunk-UQ7D5CSM.mjs} +2 -2
- package/dist/esm/chunk-UQ7D5CSM.mjs.map +1 -0
- package/dist/esm/{chunk-5O3RHPER.mjs → chunk-UYONA6PP.mjs} +2 -2
- package/dist/esm/chunk-UYONA6PP.mjs.map +1 -0
- package/dist/esm/{chunk-A7TJF3BX.mjs → chunk-VCIJX6R4.mjs} +2 -2
- package/dist/esm/chunk-VCIJX6R4.mjs.map +1 -0
- package/dist/esm/{chunk-FSBEKFEF.mjs → chunk-VVAKGJDN.mjs} +2 -2
- package/dist/esm/chunk-VVAKGJDN.mjs.map +1 -0
- package/dist/esm/chunk-VZELORLW.mjs +2 -0
- package/dist/esm/chunk-VZELORLW.mjs.map +1 -0
- package/dist/esm/{chunk-IHGA5KAD.mjs → chunk-W4BSN6SK.mjs} +1 -1
- package/dist/esm/chunk-W4BSN6SK.mjs.map +1 -0
- package/dist/esm/chunk-WCMW2L3P.mjs +2 -0
- package/dist/esm/chunk-WCMW2L3P.mjs.map +1 -0
- package/dist/esm/{chunk-XOOYRVFK.mjs → chunk-X3SO2LDX.mjs} +2 -2
- package/dist/esm/chunk-X3SO2LDX.mjs.map +1 -0
- package/dist/esm/{chunk-TTERI67T.mjs → chunk-XGF7UNEW.mjs} +2 -2
- package/dist/esm/chunk-XGF7UNEW.mjs.map +1 -0
- package/dist/esm/chunk-XHPWHA6B.mjs +2 -0
- package/dist/esm/chunk-XHPWHA6B.mjs.map +1 -0
- package/dist/esm/{chunk-2E3BT4YW.mjs → chunk-XIFIACCB.mjs} +2 -2
- package/dist/esm/chunk-XIFIACCB.mjs.map +1 -0
- package/dist/esm/chunk-XJJVJOX5.mjs +2 -0
- package/dist/esm/{chunk-UGTIALNW.mjs.map → chunk-XJJVJOX5.mjs.map} +1 -1
- package/dist/esm/{chunk-OPO5EYF7.mjs → chunk-XKUIMGKU.mjs} +2 -2
- package/dist/esm/chunk-XKUIMGKU.mjs.map +1 -0
- package/dist/esm/{chunk-7ZVXQAG4.mjs → chunk-XLFX2YQA.mjs} +2 -2
- package/dist/esm/chunk-XLFX2YQA.mjs.map +1 -0
- package/dist/esm/chunk-XTOIL6MB.mjs +2 -0
- package/dist/esm/chunk-XTOIL6MB.mjs.map +1 -0
- package/dist/esm/{chunk-RV7PNWDY.mjs → chunk-Y6QTKAQO.mjs} +2 -2
- package/dist/esm/chunk-Y6QTKAQO.mjs.map +1 -0
- package/dist/esm/{chunk-HBIDHQ2M.mjs → chunk-YOZBVVKL.mjs} +1 -1
- package/dist/esm/chunk-YOZBVVKL.mjs.map +1 -0
- package/dist/esm/{chunk-QK32EQSF.mjs → chunk-YPGI5HAA.mjs} +2 -2
- package/dist/esm/chunk-YPGI5HAA.mjs.map +1 -0
- package/dist/esm/{chunk-GT7QFXER.mjs → chunk-ZJNPBHEI.mjs} +2 -2
- package/dist/esm/chunk-ZJNPBHEI.mjs.map +1 -0
- package/dist/esm/cli/index.d.mts +1 -0
- package/dist/esm/cli/index.mjs +1 -1
- package/dist/esm/cli/localNode.d.mts +20 -8
- package/dist/esm/cli/localNode.mjs +1 -1
- package/dist/esm/cli/move.d.mts +36 -0
- package/dist/esm/cli/move.mjs +1 -1
- package/dist/esm/client/core.d.mts +5 -0
- package/dist/esm/client/core.mjs +1 -1
- package/dist/esm/client/get.d.mts +34 -1
- package/dist/esm/client/get.mjs +1 -1
- package/dist/esm/client/index.d.mts +2 -1
- package/dist/esm/client/index.mjs +1 -1
- package/dist/esm/client/post.d.mts +38 -0
- package/dist/esm/client/post.mjs +1 -1
- package/dist/esm/core/account/index.d.mts +1 -0
- package/dist/esm/core/account/index.mjs +1 -1
- package/dist/esm/core/account/utils/address.d.mts +7 -0
- package/dist/esm/core/account/utils/address.mjs +1 -1
- package/dist/esm/core/account/utils/index.d.mts +1 -0
- package/dist/esm/core/account/utils/index.mjs +1 -1
- package/dist/esm/core/accountAddress.d.mts +47 -0
- package/dist/esm/core/accountAddress.mjs +1 -1
- package/dist/esm/core/authenticationKey.d.mts +2 -1
- package/dist/esm/core/authenticationKey.mjs +1 -1
- package/dist/esm/core/common.d.mts +14 -0
- package/dist/esm/core/common.mjs +1 -1
- package/dist/esm/core/crypto/ed25519.d.mts +58 -5
- package/dist/esm/core/crypto/ed25519.mjs +1 -1
- package/dist/esm/core/crypto/ephemeral.d.mts +24 -1
- package/dist/esm/core/crypto/ephemeral.mjs +1 -1
- package/dist/esm/core/crypto/federatedKeyless.d.mts +14 -1
- package/dist/esm/core/crypto/federatedKeyless.mjs +1 -1
- package/dist/esm/core/crypto/hdKey.d.mts +28 -0
- package/dist/esm/core/crypto/hdKey.mjs +1 -1
- package/dist/esm/core/crypto/index.d.mts +3 -2
- package/dist/esm/core/crypto/index.mjs +1 -1
- package/dist/esm/core/crypto/keyless.d.mts +132 -1
- package/dist/esm/core/crypto/keyless.mjs +1 -1
- package/dist/esm/core/crypto/multiEd25519.d.mts +42 -1
- package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
- package/dist/esm/core/crypto/multiKey.d.mts +39 -1
- package/dist/esm/core/crypto/multiKey.mjs +1 -1
- package/dist/esm/core/crypto/poseidon.d.mts +10 -0
- package/dist/esm/core/crypto/poseidon.mjs +1 -1
- package/dist/esm/core/crypto/privateKey.d.mts +10 -1
- package/dist/esm/core/crypto/privateKey.mjs +1 -1
- package/dist/esm/core/crypto/proof.d.mts +3 -0
- package/dist/esm/core/crypto/proof.mjs +1 -1
- package/dist/esm/core/crypto/publicKey.d.mts +2 -1
- package/dist/esm/core/crypto/publicKey.mjs +1 -1
- package/dist/esm/core/crypto/secp256k1.d.mts +52 -3
- package/dist/esm/core/crypto/secp256k1.mjs +1 -1
- package/dist/esm/core/crypto/signature.d.mts +7 -0
- package/dist/esm/core/crypto/signature.mjs +1 -1
- package/dist/esm/core/crypto/singleKey.d.mts +37 -2
- package/dist/esm/core/crypto/singleKey.mjs +1 -1
- package/dist/esm/core/crypto/utils.d.mts +3 -0
- package/dist/esm/core/crypto/utils.mjs +1 -1
- package/dist/esm/core/hex.d.mts +21 -0
- package/dist/esm/core/hex.mjs +1 -1
- package/dist/esm/core/index.d.mts +3 -2
- package/dist/esm/core/index.mjs +1 -1
- package/dist/esm/errors/index.d.mts +1 -0
- package/dist/esm/errors/index.mjs +1 -1
- package/dist/esm/index.d.mts +9 -6
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/internal/account.d.mts +25 -4
- package/dist/esm/internal/account.mjs +1 -1
- package/dist/esm/internal/ans.d.mts +28 -2
- package/dist/esm/internal/ans.mjs +1 -1
- package/dist/esm/internal/coin.d.mts +4 -1
- package/dist/esm/internal/coin.mjs +1 -1
- package/dist/esm/internal/digitalAsset.d.mts +32 -2
- package/dist/esm/internal/digitalAsset.mjs +1 -1
- package/dist/esm/internal/event.d.mts +6 -0
- package/dist/esm/internal/event.mjs +1 -1
- package/dist/esm/internal/faucet.d.mts +6 -0
- package/dist/esm/internal/faucet.mjs +1 -1
- package/dist/esm/internal/fungibleAsset.d.mts +9 -2
- package/dist/esm/internal/fungibleAsset.mjs +1 -1
- package/dist/esm/internal/general.d.mts +8 -0
- package/dist/esm/internal/general.mjs +1 -1
- package/dist/esm/internal/keyless.d.mts +7 -2
- package/dist/esm/internal/keyless.mjs +1 -1
- package/dist/esm/internal/object.d.mts +3 -0
- package/dist/esm/internal/object.mjs +1 -1
- package/dist/esm/internal/staking.d.mts +6 -1
- package/dist/esm/internal/staking.mjs +1 -1
- package/dist/esm/internal/table.d.mts +4 -0
- package/dist/esm/internal/table.mjs +1 -1
- package/dist/esm/internal/transaction.d.mts +15 -0
- package/dist/esm/internal/transaction.mjs +1 -1
- package/dist/esm/internal/transactionSubmission.d.mts +17 -5
- package/dist/esm/internal/transactionSubmission.mjs +1 -1
- package/dist/esm/internal/view.d.mts +3 -1
- package/dist/esm/internal/view.mjs +1 -1
- package/dist/esm/{publicKey-BVXX1nVl.d.mts → publicKey-BMtGNNLg.d.mts} +36 -0
- package/dist/esm/transactions/authenticator/account.d.mts +29 -1
- package/dist/esm/transactions/authenticator/account.mjs +1 -1
- package/dist/esm/transactions/authenticator/index.d.mts +3 -1
- package/dist/esm/transactions/authenticator/index.mjs +1 -1
- package/dist/esm/transactions/authenticator/transaction.d.mts +24 -2
- package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
- package/dist/esm/transactions/index.d.mts +6 -3
- package/dist/esm/transactions/index.mjs +1 -1
- package/dist/esm/transactions/instances/chainId.d.mts +9 -0
- package/dist/esm/transactions/instances/chainId.mjs +1 -1
- package/dist/esm/transactions/instances/identifier.d.mts +9 -0
- package/dist/esm/transactions/instances/identifier.mjs +1 -1
- package/dist/esm/transactions/instances/index.d.mts +3 -1
- package/dist/esm/transactions/instances/index.mjs +1 -1
- package/dist/esm/transactions/instances/moduleId.d.mts +11 -0
- package/dist/esm/transactions/instances/moduleId.mjs +1 -1
- package/dist/esm/transactions/instances/multiAgentTransaction.d.mts +9 -0
- package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/rawTransaction.d.mts +31 -0
- package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/rotationProofChallenge.d.mts +8 -1
- package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
- package/dist/esm/transactions/instances/signedTransaction.d.mts +11 -1
- package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/simpleTransaction.d.mts +9 -0
- package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/transactionArgument.d.mts +17 -0
- package/dist/esm/transactions/instances/transactionPayload.d.mts +49 -0
- package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
- package/dist/esm/transactions/management/accountSequenceNumber.d.mts +20 -2
- package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
- package/dist/esm/transactions/management/asyncQueue.d.mts +16 -0
- package/dist/esm/transactions/management/asyncQueue.mjs +1 -1
- package/dist/esm/transactions/management/index.d.mts +4 -2
- package/dist/esm/transactions/management/index.mjs +1 -1
- package/dist/esm/transactions/management/transactionWorker.d.mts +46 -7
- package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
- package/dist/esm/transactions/scriptComposer/index.d.mts +47 -0
- package/dist/esm/transactions/scriptComposer/index.mjs +2 -0
- package/dist/esm/transactions/scriptComposer/index.mjs.map +1 -0
- package/dist/esm/transactions/transactionBuilder/helpers.d.mts +65 -1
- package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/index.d.mts +4 -2
- package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +37 -3
- package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/signingMessage.d.mts +11 -1
- package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +43 -1
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
- package/dist/esm/transactions/typeTag/index.d.mts +83 -0
- package/dist/esm/transactions/typeTag/index.mjs +1 -1
- package/dist/esm/transactions/typeTag/parser.d.mts +9 -0
- package/dist/esm/transactions/typeTag/parser.mjs +1 -1
- package/dist/esm/transactions/types.d.mts +90 -2
- package/dist/esm/types/index.d.mts +1 -0
- package/dist/esm/types/index.mjs +1 -1
- package/dist/esm/types/indexer.d.mts +52 -0
- package/dist/esm/types/keyless.d.mts +12 -0
- package/dist/esm/types/types.d.mts +1 -0
- package/dist/esm/utils/apiEndpoints.d.mts +30 -0
- package/dist/esm/utils/apiEndpoints.mjs +1 -1
- package/dist/esm/utils/const.d.mts +24 -0
- package/dist/esm/utils/const.mjs +1 -1
- package/dist/esm/utils/helpers.d.mts +21 -0
- package/dist/esm/utils/helpers.mjs +1 -1
- package/dist/esm/utils/index.d.mts +1 -0
- package/dist/esm/utils/index.mjs +1 -1
- package/dist/esm/utils/memoize.d.mts +4 -0
- package/dist/esm/utils/memoize.mjs +1 -1
- package/dist/esm/utils/normalizeBundle.d.mts +9 -0
- 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 +10 -4
- package/src/account/AbstractKeylessAccount.ts +80 -9
- package/src/account/Account.ts +51 -6
- package/src/account/AccountUtils.ts +216 -0
- package/src/account/Ed25519Account.ts +26 -0
- package/src/account/EphemeralKeyPair.ts +30 -0
- package/src/account/FederatedKeylessAccount.ts +10 -3
- package/src/account/KeylessAccount.ts +13 -1
- package/src/account/MultiKeyAccount.ts +75 -12
- package/src/account/SingleKeyAccount.ts +63 -6
- package/src/account/index.ts +1 -0
- package/src/account/utils.ts +16 -0
- package/src/api/account.ts +22 -2
- package/src/api/ans.ts +15 -0
- package/src/api/aptos.ts +3 -0
- package/src/api/aptosConfig.ts +24 -0
- package/src/api/coin.ts +3 -0
- package/src/api/digitalAsset.ts +26 -0
- package/src/api/event.ts +6 -0
- package/src/api/faucet.ts +11 -2
- package/src/api/fungibleAsset.ts +8 -0
- package/src/api/general.ts +12 -0
- package/src/api/keyless.ts +6 -0
- package/src/api/object.ts +3 -0
- package/src/api/staking.ts +5 -0
- package/src/api/table.ts +5 -0
- package/src/api/transaction.ts +19 -3
- package/src/api/transactionSubmission/build.ts +89 -2
- package/src/api/transactionSubmission/helpers.ts +2 -0
- package/src/api/transactionSubmission/management.ts +5 -0
- package/src/api/transactionSubmission/sign.ts +4 -0
- package/src/api/transactionSubmission/simulate.ts +4 -0
- package/src/api/transactionSubmission/submit.ts +4 -0
- package/src/api/utils.ts +1 -0
- package/src/bcs/deserializer.ts +64 -2
- package/src/bcs/serializable/entryFunctionBytes.ts +10 -0
- package/src/bcs/serializable/fixedBytes.ts +12 -0
- package/src/bcs/serializable/movePrimitives.ts +26 -0
- package/src/bcs/serializable/moveStructs.ts +56 -0
- package/src/bcs/serializer.ts +64 -1
- package/src/cli/localNode.ts +22 -8
- package/src/cli/move.ts +42 -0
- package/src/client/core.ts +4 -0
- package/src/client/get.ts +75 -1
- package/src/client/post.ts +37 -0
- package/src/core/account/utils/address.ts +6 -0
- package/src/core/accountAddress.ts +46 -0
- package/src/core/authenticationKey.ts +22 -0
- package/src/core/common.ts +14 -0
- package/src/core/crypto/ed25519.ts +58 -4
- package/src/core/crypto/ephemeral.ts +22 -0
- package/src/core/crypto/federatedKeyless.ts +12 -0
- package/src/core/crypto/hdKey.ts +29 -0
- package/src/core/crypto/keyless.ts +134 -0
- package/src/core/crypto/multiEd25519.ts +40 -0
- package/src/core/crypto/multiKey.ts +37 -1
- package/src/core/crypto/poseidon.ts +20 -0
- package/src/core/crypto/privateKey.ts +17 -8
- package/src/core/crypto/proof.ts +2 -0
- package/src/core/crypto/publicKey.ts +14 -0
- package/src/core/crypto/secp256k1.ts +62 -5
- package/src/core/crypto/signature.ts +8 -0
- package/src/core/crypto/singleKey.ts +34 -2
- package/src/core/crypto/utils.ts +2 -0
- package/src/core/hex.ts +20 -0
- package/src/internal/account.ts +27 -7
- package/src/internal/ans.ts +27 -0
- package/src/internal/coin.ts +1 -0
- package/src/internal/digitalAsset.ts +30 -0
- package/src/internal/event.ts +6 -0
- package/src/internal/faucet.ts +5 -0
- package/src/internal/fungibleAsset.ts +5 -0
- package/src/internal/general.ts +7 -0
- package/src/internal/keyless.ts +4 -0
- package/src/internal/object.ts +2 -0
- package/src/internal/staking.ts +5 -1
- package/src/internal/table.ts +3 -0
- package/src/internal/transaction.ts +16 -0
- package/src/internal/transactionSubmission.ts +15 -2
- package/src/transactions/authenticator/account.ts +26 -0
- package/src/transactions/authenticator/transaction.ts +20 -0
- package/src/transactions/index.ts +1 -0
- package/src/transactions/instances/chainId.ts +8 -0
- package/src/transactions/instances/identifier.ts +8 -0
- package/src/transactions/instances/moduleId.ts +10 -0
- package/src/transactions/instances/multiAgentTransaction.ts +8 -0
- package/src/transactions/instances/rawTransaction.ts +30 -0
- package/src/transactions/instances/rotationProofChallenge.ts +6 -0
- package/src/transactions/instances/signedTransaction.ts +8 -0
- package/src/transactions/instances/simpleTransaction.ts +8 -0
- package/src/transactions/instances/transactionArgument.ts +16 -0
- package/src/transactions/instances/transactionPayload.ts +50 -0
- package/src/transactions/management/accountSequenceNumber.ts +16 -0
- package/src/transactions/management/asyncQueue.ts +16 -0
- package/src/transactions/management/transactionWorker.ts +42 -5
- package/src/transactions/scriptComposer/index.ts +86 -0
- package/src/transactions/transactionBuilder/helpers.ts +82 -10
- package/src/transactions/transactionBuilder/remoteAbi.ts +75 -1
- package/src/transactions/transactionBuilder/signingMessage.ts +10 -0
- package/src/transactions/transactionBuilder/transactionBuilder.ts +58 -0
- package/src/transactions/typeTag/index.ts +82 -0
- package/src/transactions/typeTag/parser.ts +24 -0
- package/src/transactions/types.ts +89 -0
- package/src/types/index.ts +1 -0
- package/src/types/indexer.ts +52 -0
- package/src/types/keyless.ts +12 -0
- package/src/utils/apiEndpoints.ts +30 -2
- package/src/utils/const.ts +24 -1
- package/src/utils/helpers.ts +22 -0
- package/src/utils/memoize.ts +6 -0
- package/src/utils/normalizeBundle.ts +8 -1
- package/src/version.ts +1 -1
- package/dist/common/chunk-F43XVDYJ.js.map +0 -1
- package/dist/esm/chunk-2CJC43CV.mjs.map +0 -1
- package/dist/esm/chunk-2E3BT4YW.mjs.map +0 -1
- package/dist/esm/chunk-42H7WETG.mjs.map +0 -1
- package/dist/esm/chunk-476F5NJ6.mjs.map +0 -1
- package/dist/esm/chunk-4IQZOAN7.mjs.map +0 -1
- package/dist/esm/chunk-4O5XDQDO.mjs +0 -2
- package/dist/esm/chunk-4O5XDQDO.mjs.map +0 -1
- package/dist/esm/chunk-4ULPBQ3M.mjs.map +0 -1
- package/dist/esm/chunk-4ZNSNWQL.mjs.map +0 -1
- package/dist/esm/chunk-5B3SMBXQ.mjs +0 -2
- package/dist/esm/chunk-5B3SMBXQ.mjs.map +0 -1
- package/dist/esm/chunk-5O3RHPER.mjs.map +0 -1
- package/dist/esm/chunk-5XLZACVT.mjs.map +0 -1
- package/dist/esm/chunk-64IZ5PQR.mjs.map +0 -1
- package/dist/esm/chunk-6AEXQEO2.mjs.map +0 -1
- package/dist/esm/chunk-6Q2O5G3J.mjs.map +0 -1
- package/dist/esm/chunk-6ZOVTYLJ.mjs.map +0 -1
- package/dist/esm/chunk-737YW3CY.mjs.map +0 -1
- package/dist/esm/chunk-7ZA434Z3.mjs +0 -2
- package/dist/esm/chunk-7ZA434Z3.mjs.map +0 -1
- package/dist/esm/chunk-7ZVXQAG4.mjs.map +0 -1
- package/dist/esm/chunk-A3USS2NC.mjs.map +0 -1
- package/dist/esm/chunk-A7TJF3BX.mjs.map +0 -1
- package/dist/esm/chunk-ACVIE7IE.mjs.map +0 -1
- package/dist/esm/chunk-AITN3DO4.mjs +0 -2
- package/dist/esm/chunk-AITN3DO4.mjs.map +0 -1
- package/dist/esm/chunk-AJ5JHBAE.mjs.map +0 -1
- package/dist/esm/chunk-AKIO3OIT.mjs.map +0 -1
- package/dist/esm/chunk-AOROYJ74.mjs.map +0 -1
- package/dist/esm/chunk-AVZYJAXR.mjs +0 -2
- package/dist/esm/chunk-AVZYJAXR.mjs.map +0 -1
- package/dist/esm/chunk-B5BXB2BB.mjs.map +0 -1
- package/dist/esm/chunk-BRV3RLKW.mjs.map +0 -1
- package/dist/esm/chunk-BWV6OYLG.mjs.map +0 -1
- package/dist/esm/chunk-CK5NDXQT.mjs.map +0 -1
- package/dist/esm/chunk-D3OEQLUE.mjs +0 -2
- package/dist/esm/chunk-D3OEQLUE.mjs.map +0 -1
- package/dist/esm/chunk-D52UKPQF.mjs +0 -2
- package/dist/esm/chunk-D52UKPQF.mjs.map +0 -1
- package/dist/esm/chunk-D54FD6XE.mjs.map +0 -1
- package/dist/esm/chunk-FD6FGKYY.mjs +0 -1
- package/dist/esm/chunk-FH27D7S3.mjs.map +0 -1
- package/dist/esm/chunk-FSBEKFEF.mjs.map +0 -1
- package/dist/esm/chunk-FUC7SLH7.mjs.map +0 -1
- package/dist/esm/chunk-GAEAYY44.mjs +0 -1
- package/dist/esm/chunk-GMKKHGXK.mjs.map +0 -1
- package/dist/esm/chunk-GT7QFXER.mjs.map +0 -1
- package/dist/esm/chunk-H7PDLUNP.mjs +0 -2
- package/dist/esm/chunk-H7PDLUNP.mjs.map +0 -1
- package/dist/esm/chunk-HBIDHQ2M.mjs.map +0 -1
- package/dist/esm/chunk-HKVZ7CAG.mjs.map +0 -1
- package/dist/esm/chunk-HULCIESG.mjs.map +0 -1
- package/dist/esm/chunk-I3452DF5.mjs.map +0 -1
- package/dist/esm/chunk-I5OYNCZS.mjs +0 -1
- package/dist/esm/chunk-IHGA5KAD.mjs.map +0 -1
- package/dist/esm/chunk-J7PJSK3J.mjs.map +0 -1
- package/dist/esm/chunk-JKA22FG5.mjs.map +0 -1
- package/dist/esm/chunk-JNO7KPMG.mjs.map +0 -1
- package/dist/esm/chunk-JUQBFGUD.mjs.map +0 -1
- package/dist/esm/chunk-JYGAG754.mjs +0 -2
- package/dist/esm/chunk-JYGAG754.mjs.map +0 -1
- package/dist/esm/chunk-KKLF7DQV.mjs.map +0 -1
- package/dist/esm/chunk-KPPM2BSC.mjs.map +0 -1
- package/dist/esm/chunk-L3J2QVIY.mjs.map +0 -1
- package/dist/esm/chunk-LGTOOAQI.mjs.map +0 -1
- package/dist/esm/chunk-LK67PZX3.mjs.map +0 -1
- package/dist/esm/chunk-LRN4ALMT.mjs +0 -2
- package/dist/esm/chunk-LRN4ALMT.mjs.map +0 -1
- package/dist/esm/chunk-LWXBEIFO.mjs +0 -2
- package/dist/esm/chunk-LWXBEIFO.mjs.map +0 -1
- package/dist/esm/chunk-LZ5PSDOS.mjs.map +0 -1
- package/dist/esm/chunk-MCWOKFVH.mjs +0 -2
- package/dist/esm/chunk-MCWOKFVH.mjs.map +0 -1
- package/dist/esm/chunk-MHN6XY4Z.mjs +0 -2
- package/dist/esm/chunk-MHN6XY4Z.mjs.map +0 -1
- package/dist/esm/chunk-MV5PGWJQ.mjs +0 -2
- package/dist/esm/chunk-MV5PGWJQ.mjs.map +0 -1
- package/dist/esm/chunk-MWNYODWU.mjs.map +0 -1
- package/dist/esm/chunk-O4MRRWRI.mjs.map +0 -1
- package/dist/esm/chunk-OEM75TVE.mjs.map +0 -1
- package/dist/esm/chunk-OGBU52BQ.mjs.map +0 -1
- package/dist/esm/chunk-OIOGOW6I.mjs.map +0 -1
- package/dist/esm/chunk-OPO5EYF7.mjs.map +0 -1
- package/dist/esm/chunk-P6RNNESB.mjs.map +0 -1
- package/dist/esm/chunk-P74XXLE4.mjs.map +0 -1
- package/dist/esm/chunk-Q3CWUEXI.mjs.map +0 -1
- package/dist/esm/chunk-QK32EQSF.mjs.map +0 -1
- package/dist/esm/chunk-QLC7SSLJ.mjs +0 -2
- package/dist/esm/chunk-QLC7SSLJ.mjs.map +0 -1
- package/dist/esm/chunk-QN7AK5PU.mjs.map +0 -1
- package/dist/esm/chunk-QZT2M7UA.mjs.map +0 -1
- package/dist/esm/chunk-RV7PNWDY.mjs.map +0 -1
- package/dist/esm/chunk-S22QVNK7.mjs.map +0 -1
- package/dist/esm/chunk-S3YVCCYI.mjs.map +0 -1
- package/dist/esm/chunk-SMFTISPN.mjs +0 -2
- package/dist/esm/chunk-SMFTISPN.mjs.map +0 -1
- package/dist/esm/chunk-SPRNSFUV.mjs.map +0 -1
- package/dist/esm/chunk-T6ADNZE5.mjs.map +0 -1
- package/dist/esm/chunk-TQA6HY6A.mjs.map +0 -1
- package/dist/esm/chunk-TTERI67T.mjs.map +0 -1
- package/dist/esm/chunk-U7UTBXJD.mjs.map +0 -1
- package/dist/esm/chunk-UGTIALNW.mjs +0 -2
- package/dist/esm/chunk-UZTJWOLS.mjs +0 -2
- package/dist/esm/chunk-UZTJWOLS.mjs.map +0 -1
- package/dist/esm/chunk-V4FKFCBL.mjs.map +0 -1
- package/dist/esm/chunk-V5NDNR36.mjs +0 -2
- package/dist/esm/chunk-V5NDNR36.mjs.map +0 -1
- package/dist/esm/chunk-VAKNMHOA.mjs.map +0 -1
- package/dist/esm/chunk-VELQA2Y3.mjs +0 -2
- package/dist/esm/chunk-VELQA2Y3.mjs.map +0 -1
- package/dist/esm/chunk-VQZMI3EZ.mjs.map +0 -1
- package/dist/esm/chunk-WTWWJWKC.mjs +0 -2
- package/dist/esm/chunk-WTWWJWKC.mjs.map +0 -1
- package/dist/esm/chunk-WXLSHECY.mjs.map +0 -1
- package/dist/esm/chunk-XOOYRVFK.mjs.map +0 -1
- package/dist/esm/chunk-XVPWTWPY.mjs.map +0 -1
- package/dist/esm/chunk-Y5HLXDYG.mjs.map +0 -1
- package/dist/esm/chunk-YITOC4Z6.mjs.map +0 -1
- package/dist/esm/chunk-YQHOQJRQ.mjs +0 -2
- package/dist/esm/chunk-YT3IP57B.mjs.map +0 -1
- package/dist/esm/chunk-ZMBXHMVQ.mjs.map +0 -1
- /package/dist/esm/{chunk-FD6FGKYY.mjs.map → account/AccountUtils.mjs.map} +0 -0
- /package/dist/esm/{chunk-GAEAYY44.mjs.map → account/utils.mjs.map} +0 -0
- /package/dist/esm/{chunk-I5OYNCZS.mjs.map → chunk-GP4TLDVZ.mjs.map} +0 -0
- /package/dist/esm/{chunk-2D7OMWVL.mjs.map → chunk-KFCLSJC3.mjs.map} +0 -0
- /package/dist/esm/{chunk-F45G3GP3.mjs.map → chunk-QHEKBHNU.mjs.map} +0 -0
|
@@ -11,6 +11,8 @@ import { AnyPublicKey, AnySignature } from "./singleKey";
|
|
|
11
11
|
* This function can help you determine the population count of a given byte value.
|
|
12
12
|
*
|
|
13
13
|
* @param byte - The byte value for which to count the number of set bits.
|
|
14
|
+
* @group Implementation
|
|
15
|
+
* @category Serialization
|
|
14
16
|
*/
|
|
15
17
|
/* eslint-disable no-bitwise */
|
|
16
18
|
function bitCount(byte: number) {
|
|
@@ -29,15 +31,21 @@ function bitCount(byte: number) {
|
|
|
29
31
|
* The public keys of each individual agent can be any type of public key supported by Aptos.
|
|
30
32
|
* Since [AIP-55](https://github.com/aptos-foundation/AIPs/pull/263), Aptos supports
|
|
31
33
|
* `Legacy` and `Unified` authentication keys.
|
|
34
|
+
* @group Implementation
|
|
35
|
+
* @category Serialization
|
|
32
36
|
*/
|
|
33
37
|
export class MultiKey extends AccountPublicKey {
|
|
34
38
|
/**
|
|
35
39
|
* List of any public keys
|
|
40
|
+
* @group Implementation
|
|
41
|
+
* @category Serialization
|
|
36
42
|
*/
|
|
37
43
|
public readonly publicKeys: AnyPublicKey[];
|
|
38
44
|
|
|
39
45
|
/**
|
|
40
46
|
* The minimum number of valid signatures required, for the number of public keys specified
|
|
47
|
+
* @group Implementation
|
|
48
|
+
* @category Serialization
|
|
41
49
|
*/
|
|
42
50
|
public readonly signaturesRequired: number;
|
|
43
51
|
|
|
@@ -52,6 +60,8 @@ export class MultiKey extends AccountPublicKey {
|
|
|
52
60
|
*
|
|
53
61
|
* @throws Error if the number of signatures exceeds the maximum supported, if the bitmap length is incorrect, or if the number
|
|
54
62
|
* of signatures does not match the bitmap.
|
|
63
|
+
* @group Implementation
|
|
64
|
+
* @category Serialization
|
|
55
65
|
*/
|
|
56
66
|
// region Constructors
|
|
57
67
|
constructor(args: { publicKeys: Array<PublicKey>; signaturesRequired: number }) {
|
|
@@ -89,6 +99,8 @@ export class MultiKey extends AccountPublicKey {
|
|
|
89
99
|
* @param args - The arguments for verifying the signature.
|
|
90
100
|
* @param args.message - The message that was signed.
|
|
91
101
|
* @param args.signature - The signature to verify.
|
|
102
|
+
* @group Implementation
|
|
103
|
+
* @category Serialization
|
|
92
104
|
*/
|
|
93
105
|
// eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars
|
|
94
106
|
verifySignature(args: VerifySignatureArgs): boolean {
|
|
@@ -100,6 +112,8 @@ export class MultiKey extends AccountPublicKey {
|
|
|
100
112
|
* This key can be used for secure authentication processes within the system.
|
|
101
113
|
*
|
|
102
114
|
* @returns {AuthenticationKey} The generated authentication key.
|
|
115
|
+
* @group Implementation
|
|
116
|
+
* @category Serialization
|
|
103
117
|
*/
|
|
104
118
|
authKey(): AuthenticationKey {
|
|
105
119
|
return AuthenticationKey.fromSchemeAndBytes({
|
|
@@ -117,6 +131,8 @@ export class MultiKey extends AccountPublicKey {
|
|
|
117
131
|
* This allows the object to be converted into a format suitable for transmission or storage.
|
|
118
132
|
*
|
|
119
133
|
* @param serializer - The serializer instance used to perform the serialization.
|
|
134
|
+
* @group Implementation
|
|
135
|
+
* @category Serialization
|
|
120
136
|
*/
|
|
121
137
|
serialize(serializer: Serializer): void {
|
|
122
138
|
serializer.serializeVector(this.publicKeys);
|
|
@@ -128,6 +144,8 @@ export class MultiKey extends AccountPublicKey {
|
|
|
128
144
|
* This function retrieves the signatures and bitmap necessary for creating a MultiKeySignature object.
|
|
129
145
|
*
|
|
130
146
|
* @param deserializer - The deserializer instance used to read the serialized data.
|
|
147
|
+
* @group Implementation
|
|
148
|
+
* @category Serialization
|
|
131
149
|
*/
|
|
132
150
|
static deserialize(deserializer: Deserializer): MultiKey {
|
|
133
151
|
const keys = deserializer.deserializeVector(AnyPublicKey);
|
|
@@ -144,6 +162,8 @@ export class MultiKey extends AccountPublicKey {
|
|
|
144
162
|
*
|
|
145
163
|
* @param args.bits array of the index mapping to the matching public keys
|
|
146
164
|
* @returns Uint8array bit map
|
|
165
|
+
* @group Implementation
|
|
166
|
+
* @category Serialization
|
|
147
167
|
*/
|
|
148
168
|
createBitmap(args: { bits: number[] }): Uint8Array {
|
|
149
169
|
const { bits } = args;
|
|
@@ -188,6 +208,8 @@ export class MultiKey extends AccountPublicKey {
|
|
|
188
208
|
* @param publicKey - The public key to find the index for.
|
|
189
209
|
* @returns The corresponding index of the public key, if it exists.
|
|
190
210
|
* @throws Error - If the public key is not found in the MultiKey.
|
|
211
|
+
* @group Implementation
|
|
212
|
+
* @category Serialization
|
|
191
213
|
*/
|
|
192
214
|
getIndex(publicKey: PublicKey): number {
|
|
193
215
|
const anyPublicKey = publicKey instanceof AnyPublicKey ? publicKey : new AnyPublicKey(publicKey);
|
|
@@ -196,7 +218,7 @@ export class MultiKey extends AccountPublicKey {
|
|
|
196
218
|
if (index !== -1) {
|
|
197
219
|
return index;
|
|
198
220
|
}
|
|
199
|
-
throw new Error(
|
|
221
|
+
throw new Error(`Public key ${publicKey} not found in MultiKey ${this.publicKeys}`);
|
|
200
222
|
}
|
|
201
223
|
|
|
202
224
|
public static isInstance(value: PublicKey): value is MultiKey {
|
|
@@ -211,20 +233,28 @@ export class MultiKey extends AccountPublicKey {
|
|
|
211
233
|
*
|
|
212
234
|
* It includes functionality to validate the number of signatures against a bitmap,
|
|
213
235
|
* which indicates which public keys have signed the transaction.
|
|
236
|
+
* @group Implementation
|
|
237
|
+
* @category Serialization
|
|
214
238
|
*/
|
|
215
239
|
export class MultiKeySignature extends Signature {
|
|
216
240
|
/**
|
|
217
241
|
* Number of bytes in the bitmap representing who signed the transaction (32-bits)
|
|
242
|
+
* @group Implementation
|
|
243
|
+
* @category Serialization
|
|
218
244
|
*/
|
|
219
245
|
static BITMAP_LEN: number = 4;
|
|
220
246
|
|
|
221
247
|
/**
|
|
222
248
|
* Maximum number of Ed25519 signatures supported
|
|
249
|
+
* @group Implementation
|
|
250
|
+
* @category Serialization
|
|
223
251
|
*/
|
|
224
252
|
static MAX_SIGNATURES_SUPPORTED = MultiKeySignature.BITMAP_LEN * 8;
|
|
225
253
|
|
|
226
254
|
/**
|
|
227
255
|
* The list of underlying Ed25519 signatures
|
|
256
|
+
* @group Implementation
|
|
257
|
+
* @category Serialization
|
|
228
258
|
*/
|
|
229
259
|
public readonly signatures: AnySignature[];
|
|
230
260
|
|
|
@@ -232,6 +262,8 @@ export class MultiKeySignature extends Signature {
|
|
|
232
262
|
* 32-bit Bitmap representing who signed the transaction
|
|
233
263
|
*
|
|
234
264
|
* This is represented where each public key can be masked to determine whether the message was signed by that key.
|
|
265
|
+
* @group Implementation
|
|
266
|
+
* @category Serialization
|
|
235
267
|
*/
|
|
236
268
|
public readonly bitmap: Uint8Array;
|
|
237
269
|
|
|
@@ -244,6 +276,8 @@ export class MultiKeySignature extends Signature {
|
|
|
244
276
|
* @param args.signatures A list of signatures
|
|
245
277
|
* @param args.bitmap 4 bytes, at most 32 signatures are supported. If Nth bit value is `1`, the Nth
|
|
246
278
|
* signature should be provided in `signatures`. Bits are read from left to right
|
|
279
|
+
* @group Implementation
|
|
280
|
+
* @category Serialization
|
|
247
281
|
*/
|
|
248
282
|
constructor(args: { signatures: Array<Signature | AnySignature>; bitmap: Uint8Array | number[] }) {
|
|
249
283
|
super();
|
|
@@ -285,6 +319,8 @@ export class MultiKeySignature extends Signature {
|
|
|
285
319
|
* The result bitmap should be 0b1010000000000000000000000000001
|
|
286
320
|
*
|
|
287
321
|
* @returns bitmap that is 32bit long
|
|
322
|
+
* @group Implementation
|
|
323
|
+
* @category Serialization
|
|
288
324
|
*/
|
|
289
325
|
static createBitmap(args: { bits: number[] }): Uint8Array {
|
|
290
326
|
const { bits } = args;
|
|
@@ -48,6 +48,8 @@ const MAX_NUM_INPUT_BYTES = (MAX_NUM_INPUT_SCALARS - 1) * BYTES_PACKED_PER_SCALA
|
|
|
48
48
|
* @param str - The string to be hashed.
|
|
49
49
|
* @param maxSizeBytes - The maximum size in bytes for the resulting hash.
|
|
50
50
|
* @returns bigint - The result of the hash.
|
|
51
|
+
* @group Implementation
|
|
52
|
+
* @category Serialization
|
|
51
53
|
*/
|
|
52
54
|
export function hashStrToField(str: string, maxSizeBytes: number): bigint {
|
|
53
55
|
const textEncoder = new TextEncoder();
|
|
@@ -62,6 +64,8 @@ export function hashStrToField(str: string, maxSizeBytes: number): bigint {
|
|
|
62
64
|
* @param bytes - The byte array to be hashed.
|
|
63
65
|
* @param maxSizeBytes - The maximum allowed size for the byte array.
|
|
64
66
|
* @throws Error if the length of the inputted bytes exceeds the specified maximum size.
|
|
67
|
+
* @group Implementation
|
|
68
|
+
* @category Serialization
|
|
65
69
|
*/
|
|
66
70
|
function hashBytesWithLen(bytes: Uint8Array, maxSizeBytes: number): bigint {
|
|
67
71
|
if (bytes.length > maxSizeBytes) {
|
|
@@ -78,6 +82,8 @@ function hashBytesWithLen(bytes: Uint8Array, maxSizeBytes: number): bigint {
|
|
|
78
82
|
* @param bytes - The byte array to be padded and packed.
|
|
79
83
|
* @param maxSizeBytes - The maximum size in bytes that the input array can have.
|
|
80
84
|
* @throws Error if the input byte array exceeds the specified maximum size.
|
|
85
|
+
* @group Implementation
|
|
86
|
+
* @category Serialization
|
|
81
87
|
*/
|
|
82
88
|
function padAndPackBytesNoLen(bytes: Uint8Array, maxSizeBytes: number): bigint[] {
|
|
83
89
|
if (bytes.length > maxSizeBytes) {
|
|
@@ -96,6 +102,8 @@ function padAndPackBytesNoLen(bytes: Uint8Array, maxSizeBytes: number): bigint[]
|
|
|
96
102
|
* @param maxSizeBytes - The maximum allowed size for the byte array.
|
|
97
103
|
* @throws Error if the length of the input bytes exceeds the maximum size.
|
|
98
104
|
* @returns A new Uint8Array that contains the padded and packed bytes along with the length of the original byte array.
|
|
105
|
+
* @group Implementation
|
|
106
|
+
* @category Serialization
|
|
99
107
|
*/
|
|
100
108
|
export function padAndPackBytesWithLen(bytes: Uint8Array, maxSizeBytes: number): bigint[] {
|
|
101
109
|
if (bytes.length > maxSizeBytes) {
|
|
@@ -108,6 +116,8 @@ export function padAndPackBytesWithLen(bytes: Uint8Array, maxSizeBytes: number):
|
|
|
108
116
|
* Packs a Uint8Array into an array of BigInts, ensuring the input does not exceed the maximum allowed bytes.
|
|
109
117
|
* @param bytes - The Uint8Array to be packed.
|
|
110
118
|
* @throws {Error} Throws an error if the input exceeds the maximum number of bytes allowed.
|
|
119
|
+
* @group Implementation
|
|
120
|
+
* @category Serialization
|
|
111
121
|
*/
|
|
112
122
|
function packBytes(bytes: Uint8Array): bigint[] {
|
|
113
123
|
if (bytes.length > MAX_NUM_INPUT_BYTES) {
|
|
@@ -123,6 +133,8 @@ function packBytes(bytes: Uint8Array): bigint[] {
|
|
|
123
133
|
* @param array - The Uint8Array to be split into chunks.
|
|
124
134
|
* @param chunkSize - The size of each chunk.
|
|
125
135
|
* @returns An array of Uint8Array chunks.
|
|
136
|
+
* @group Implementation
|
|
137
|
+
* @category Serialization
|
|
126
138
|
*/
|
|
127
139
|
function chunkUint8Array(array: Uint8Array, chunkSize: number): Uint8Array[] {
|
|
128
140
|
const result: Uint8Array[] = [];
|
|
@@ -138,6 +150,8 @@ function chunkUint8Array(array: Uint8Array, chunkSize: number): Uint8Array[] {
|
|
|
138
150
|
*
|
|
139
151
|
* @param bytes - The byte array to convert.
|
|
140
152
|
* @returns The resulting BigInt representation of the byte array.
|
|
153
|
+
* @group Implementation
|
|
154
|
+
* @category Serialization
|
|
141
155
|
*/
|
|
142
156
|
export function bytesToBigIntLE(bytes: Uint8Array): bigint {
|
|
143
157
|
let result = BigInt(0);
|
|
@@ -155,6 +169,8 @@ export function bytesToBigIntLE(bytes: Uint8Array): bigint {
|
|
|
155
169
|
* @param value - The number to convert into bytes.
|
|
156
170
|
* @param length - The desired length of the resulting byte array.
|
|
157
171
|
* @returns A Uint8Array containing the little-endian representation of the bigint value.
|
|
172
|
+
* @group Implementation
|
|
173
|
+
* @category Serialization
|
|
158
174
|
*/
|
|
159
175
|
export function bigIntToBytesLE(value: bigint | number, length: number): Uint8Array {
|
|
160
176
|
let val = BigInt(value);
|
|
@@ -173,6 +189,8 @@ export function bigIntToBytesLE(value: bigint | number, length: number): Uint8Ar
|
|
|
173
189
|
* @param inputArray - The Uint8Array to be padded.
|
|
174
190
|
* @param paddedSize - The desired size of the padded array, which must be greater than or equal to the input array size.
|
|
175
191
|
* @throws Error if paddedSize is less than the length of inputArray.
|
|
192
|
+
* @group Implementation
|
|
193
|
+
* @category Serialization
|
|
176
194
|
*/
|
|
177
195
|
function padUint8ArrayWithZeros(inputArray: Uint8Array, paddedSize: number): Uint8Array {
|
|
178
196
|
if (paddedSize < inputArray.length) {
|
|
@@ -200,6 +218,8 @@ function padUint8ArrayWithZeros(inputArray: Uint8Array, paddedSize: number): Uin
|
|
|
200
218
|
* @param inputs - An array of elements to be hashed, which can be of type number, bigint, or string.
|
|
201
219
|
* @returns bigint - The result of the hash.
|
|
202
220
|
* @throws Error - Throws an error if the input length exceeds the maximum allowed.
|
|
221
|
+
* @group Implementation
|
|
222
|
+
* @category Serialization
|
|
203
223
|
*/
|
|
204
224
|
export function poseidonHash(inputs: (number | bigint | string)[]): bigint {
|
|
205
225
|
if (inputs.length > numInputsToPoseidonFunc.length) {
|
|
@@ -7,22 +7,30 @@ import { Signature } from "./signature";
|
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Represents a private key used for signing messages and deriving the associated public key.
|
|
10
|
+
* @group Implementation
|
|
11
|
+
* @category Serialization
|
|
10
12
|
*/
|
|
11
13
|
export interface PrivateKey {
|
|
12
14
|
/**
|
|
13
15
|
* Sign the given message with the private key to create a signature.
|
|
14
16
|
* @param message - The message to be signed, provided in HexInput format.
|
|
15
17
|
* @returns A Signature object representing the signed message.
|
|
18
|
+
* @group Implementation
|
|
19
|
+
* @category Serialization
|
|
16
20
|
*/
|
|
17
21
|
sign(message: HexInput): Signature;
|
|
18
22
|
|
|
19
23
|
/**
|
|
20
24
|
* Derive the public key associated with the private key.
|
|
25
|
+
* @group Implementation
|
|
26
|
+
* @category Serialization
|
|
21
27
|
*/
|
|
22
28
|
publicKey(): PublicKey;
|
|
23
29
|
|
|
24
30
|
/**
|
|
25
31
|
* Get the private key in bytes (Uint8Array).
|
|
32
|
+
* @group Implementation
|
|
33
|
+
* @category Serialization
|
|
26
34
|
*/
|
|
27
35
|
toUint8Array(): Uint8Array;
|
|
28
36
|
}
|
|
@@ -49,7 +57,15 @@ export class PrivateKey {
|
|
|
49
57
|
*/
|
|
50
58
|
public static formatPrivateKey(privateKey: HexInput, type: PrivateKeyVariants): string {
|
|
51
59
|
const aip80Prefix = PrivateKey.AIP80_PREFIXES[type];
|
|
52
|
-
|
|
60
|
+
|
|
61
|
+
// Remove the prefix if it exists
|
|
62
|
+
let formattedPrivateKey = privateKey;
|
|
63
|
+
if (typeof formattedPrivateKey === "string" && formattedPrivateKey.startsWith(aip80Prefix)) {
|
|
64
|
+
// eslint-disable-next-line prefer-destructuring
|
|
65
|
+
formattedPrivateKey = formattedPrivateKey.split("-")[2];
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return `${aip80Prefix}${Hex.fromHexInput(formattedPrivateKey).toString()}`;
|
|
53
69
|
}
|
|
54
70
|
|
|
55
71
|
/**
|
|
@@ -91,13 +107,6 @@ export class PrivateKey {
|
|
|
91
107
|
} else {
|
|
92
108
|
// The value is an Uint8Array
|
|
93
109
|
data = Hex.fromHexInput(value);
|
|
94
|
-
// If the strictness is false, the user has opted into non-AIP-80 compliant private keys.
|
|
95
|
-
if (strict !== false) {
|
|
96
|
-
// eslint-disable-next-line no-console
|
|
97
|
-
console.warn(
|
|
98
|
-
"[Aptos SDK] It is recommended that private keys are parsed as AIP-80 compliant strings instead of Uint8Array (https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-80.md). You can fix the private key by formatting it with `PrivateKey.formatPrivateKey(privateKey: Uint8Array, type: 'ed25519' | 'secp256k1'): string`.",
|
|
99
|
-
);
|
|
100
|
-
}
|
|
101
110
|
}
|
|
102
111
|
|
|
103
112
|
return data;
|
package/src/core/crypto/proof.ts
CHANGED
|
@@ -3,5 +3,7 @@ import { Serializable } from "../../bcs";
|
|
|
3
3
|
/**
|
|
4
4
|
* An abstract representation of a cryptographic proof associated with specific
|
|
5
5
|
* zero-knowledge proof schemes, such as Groth16 and PLONK.
|
|
6
|
+
* @group Implementation
|
|
7
|
+
* @category Serialization
|
|
6
8
|
*/
|
|
7
9
|
export abstract class Proof extends Serializable {}
|
|
@@ -9,6 +9,8 @@ import { Signature } from "./signature";
|
|
|
9
9
|
*
|
|
10
10
|
* @param message - The original message that was signed.
|
|
11
11
|
* @param signature - The signature to be verified against the message.
|
|
12
|
+
* @group Implementation
|
|
13
|
+
* @category Serialization
|
|
12
14
|
*/
|
|
13
15
|
export interface VerifySignatureArgs {
|
|
14
16
|
message: HexInput;
|
|
@@ -20,17 +22,23 @@ export interface VerifySignatureArgs {
|
|
|
20
22
|
*
|
|
21
23
|
* This class provides a common interface for verifying signatures associated with the public key.
|
|
22
24
|
* It allows for the retrieval of the raw public key bytes and the public key in a hexadecimal string format.
|
|
25
|
+
* @group Implementation
|
|
26
|
+
* @category Serialization
|
|
23
27
|
*/
|
|
24
28
|
export abstract class PublicKey extends Serializable {
|
|
25
29
|
/**
|
|
26
30
|
* Verifies that the private key associated with this public key signed the message with the given signature.
|
|
27
31
|
* @param args.message The message that was signed
|
|
28
32
|
* @param args.signature The signature to verify
|
|
33
|
+
* @group Implementation
|
|
34
|
+
* @category Serialization
|
|
29
35
|
*/
|
|
30
36
|
abstract verifySignature(args: VerifySignatureArgs): boolean;
|
|
31
37
|
|
|
32
38
|
/**
|
|
33
39
|
* Get the raw public key bytes
|
|
40
|
+
* @group Implementation
|
|
41
|
+
* @category Serialization
|
|
34
42
|
*/
|
|
35
43
|
toUint8Array(): Uint8Array {
|
|
36
44
|
return this.bcsToBytes();
|
|
@@ -40,6 +48,8 @@ export abstract class PublicKey extends Serializable {
|
|
|
40
48
|
* Get the public key as a hex string with a 0x prefix.
|
|
41
49
|
*
|
|
42
50
|
* @returns The public key in hex format.
|
|
51
|
+
* @group Implementation
|
|
52
|
+
* @category Serialization
|
|
43
53
|
*/
|
|
44
54
|
toString(): string {
|
|
45
55
|
const bytes = this.toUint8Array();
|
|
@@ -53,10 +63,14 @@ export abstract class PublicKey extends Serializable {
|
|
|
53
63
|
* Provides a common interface for deriving an authentication key.
|
|
54
64
|
*
|
|
55
65
|
* @abstract
|
|
66
|
+
* @group Implementation
|
|
67
|
+
* @category Serialization
|
|
56
68
|
*/
|
|
57
69
|
export abstract class AccountPublicKey extends PublicKey {
|
|
58
70
|
/**
|
|
59
71
|
* Get the authentication key associated with this public key
|
|
72
|
+
* @group Implementation
|
|
73
|
+
* @category Serialization
|
|
60
74
|
*/
|
|
61
75
|
abstract authKey(): AuthenticationKey;
|
|
62
76
|
}
|
|
@@ -18,11 +18,16 @@ import { convertSigningMessage } from "./utils";
|
|
|
18
18
|
*
|
|
19
19
|
* @extends PublicKey
|
|
20
20
|
* @property LENGTH - The length of the Secp256k1 public key in bytes.
|
|
21
|
+
* @group Implementation
|
|
22
|
+
* @category Serialization
|
|
21
23
|
*/
|
|
22
24
|
export class Secp256k1PublicKey extends PublicKey {
|
|
23
25
|
// Secp256k1 ecdsa public keys contain a prefix indicating compression and two 32-byte coordinates.
|
|
24
26
|
static readonly LENGTH: number = 65;
|
|
25
27
|
|
|
28
|
+
// If it's compressed, it is only 33 bytes
|
|
29
|
+
static readonly COMPRESSED_LENGTH: number = 33;
|
|
30
|
+
|
|
26
31
|
// Hex value of the public key
|
|
27
32
|
private readonly key: Hex;
|
|
28
33
|
|
|
@@ -32,15 +37,24 @@ export class Secp256k1PublicKey extends PublicKey {
|
|
|
32
37
|
*
|
|
33
38
|
* @param hexInput - A HexInput (string or Uint8Array) representing the signature data.
|
|
34
39
|
* @throws Error if the length of the signature data is not equal to Secp256k1Signature.LENGTH.
|
|
40
|
+
* @group Implementation
|
|
41
|
+
* @category Serialization
|
|
35
42
|
*/
|
|
36
43
|
constructor(hexInput: HexInput) {
|
|
37
44
|
super();
|
|
38
45
|
|
|
39
46
|
const hex = Hex.fromHexInput(hexInput);
|
|
40
|
-
|
|
41
|
-
|
|
47
|
+
const { length } = hex.toUint8Array();
|
|
48
|
+
if (length === Secp256k1PublicKey.LENGTH) {
|
|
49
|
+
this.key = hex;
|
|
50
|
+
} else if (length === Secp256k1PublicKey.COMPRESSED_LENGTH) {
|
|
51
|
+
const point = secp256k1.ProjectivePoint.fromHex(hex.toUint8Array());
|
|
52
|
+
this.key = Hex.fromHexInput(point.toRawBytes(false));
|
|
53
|
+
} else {
|
|
54
|
+
throw new Error(
|
|
55
|
+
`PublicKey length should be ${Secp256k1PublicKey.LENGTH} or ${Secp256k1PublicKey.COMPRESSED_LENGTH}, received ${length}`,
|
|
56
|
+
);
|
|
42
57
|
}
|
|
43
|
-
this.key = hex;
|
|
44
58
|
}
|
|
45
59
|
|
|
46
60
|
// region PublicKey
|
|
@@ -52,6 +66,8 @@ export class Secp256k1PublicKey extends PublicKey {
|
|
|
52
66
|
* @param args - The arguments for verifying the signature.
|
|
53
67
|
* @param args.message - The message that was signed.
|
|
54
68
|
* @param args.signature - The signature to verify against the public key.
|
|
69
|
+
* @group Implementation
|
|
70
|
+
* @category Serialization
|
|
55
71
|
*/
|
|
56
72
|
verifySignature(args: VerifySignatureArgs): boolean {
|
|
57
73
|
const { message, signature } = args;
|
|
@@ -66,6 +82,8 @@ export class Secp256k1PublicKey extends PublicKey {
|
|
|
66
82
|
* Get the data as a Uint8Array representation.
|
|
67
83
|
*
|
|
68
84
|
* @returns Uint8Array representation of the data.
|
|
85
|
+
* @group Implementation
|
|
86
|
+
* @category Serialization
|
|
69
87
|
*/
|
|
70
88
|
toUint8Array(): Uint8Array {
|
|
71
89
|
return this.key.toUint8Array();
|
|
@@ -80,6 +98,8 @@ export class Secp256k1PublicKey extends PublicKey {
|
|
|
80
98
|
* This function is essential for converting data into a format suitable for transmission or storage.
|
|
81
99
|
*
|
|
82
100
|
* @param serializer - The serializer instance used to convert the data.
|
|
101
|
+
* @group Implementation
|
|
102
|
+
* @category Serialization
|
|
83
103
|
*/
|
|
84
104
|
serialize(serializer: Serializer): void {
|
|
85
105
|
serializer.serializeBytes(this.key.toUint8Array());
|
|
@@ -90,6 +110,8 @@ export class Secp256k1PublicKey extends PublicKey {
|
|
|
90
110
|
* This function allows you to reconstruct a Secp256k1Signature object from its serialized byte representation.
|
|
91
111
|
*
|
|
92
112
|
* @param deserializer - The deserializer instance used to read the serialized data.
|
|
113
|
+
* @group Implementation
|
|
114
|
+
* @category Serialization
|
|
93
115
|
*/
|
|
94
116
|
// eslint-disable-next-line class-methods-use-this
|
|
95
117
|
deserialize(deserializer: Deserializer) {
|
|
@@ -109,6 +131,8 @@ export class Secp256k1PublicKey extends PublicKey {
|
|
|
109
131
|
*
|
|
110
132
|
* @deprecated use `instanceof Secp256k1PublicKey` instead
|
|
111
133
|
* @param publicKey - The public key to check.
|
|
134
|
+
* @group Implementation
|
|
135
|
+
* @category Serialization
|
|
112
136
|
*/
|
|
113
137
|
static isPublicKey(publicKey: PublicKey): publicKey is Secp256k1PublicKey {
|
|
114
138
|
return publicKey instanceof Secp256k1PublicKey;
|
|
@@ -120,6 +144,8 @@ export class Secp256k1PublicKey extends PublicKey {
|
|
|
120
144
|
*
|
|
121
145
|
* @param publicKey - The public key to validate.
|
|
122
146
|
* @returns A boolean indicating whether the public key is a valid Secp256k1 public key.
|
|
147
|
+
* @group Implementation
|
|
148
|
+
* @category Serialization
|
|
123
149
|
*/
|
|
124
150
|
static isInstance(publicKey: PublicKey): publicKey is Secp256k1PublicKey {
|
|
125
151
|
return "key" in publicKey && (publicKey.key as any)?.data?.length === Secp256k1PublicKey.LENGTH;
|
|
@@ -129,16 +155,22 @@ export class Secp256k1PublicKey extends PublicKey {
|
|
|
129
155
|
/**
|
|
130
156
|
* Represents a Secp256k1 ECDSA private key, providing functionality to create, sign messages,
|
|
131
157
|
* derive public keys, and serialize/deserialize the key.
|
|
158
|
+
* @group Implementation
|
|
159
|
+
* @category Serialization
|
|
132
160
|
*/
|
|
133
161
|
export class Secp256k1PrivateKey extends Serializable implements PrivateKey {
|
|
134
162
|
/**
|
|
135
163
|
* Length of Secp256k1 ecdsa private key
|
|
164
|
+
* @group Implementation
|
|
165
|
+
* @category Serialization
|
|
136
166
|
*/
|
|
137
167
|
static readonly LENGTH: number = 32;
|
|
138
168
|
|
|
139
169
|
/**
|
|
140
170
|
* The private key bytes
|
|
141
171
|
* @private
|
|
172
|
+
* @group Implementation
|
|
173
|
+
* @category Serialization
|
|
142
174
|
*/
|
|
143
175
|
private readonly key: Hex;
|
|
144
176
|
|
|
@@ -151,6 +183,8 @@ export class Secp256k1PrivateKey extends Serializable implements PrivateKey {
|
|
|
151
183
|
*
|
|
152
184
|
* @param hexInput A HexInput (string or Uint8Array)
|
|
153
185
|
* @param strict If true, private key must AIP-80 compliant.
|
|
186
|
+
* @group Implementation
|
|
187
|
+
* @category Serialization
|
|
154
188
|
*/
|
|
155
189
|
constructor(hexInput: HexInput, strict?: boolean) {
|
|
156
190
|
super();
|
|
@@ -167,6 +201,8 @@ export class Secp256k1PrivateKey extends Serializable implements PrivateKey {
|
|
|
167
201
|
* Generate a new random private key.
|
|
168
202
|
*
|
|
169
203
|
* @returns Secp256k1PrivateKey - A newly generated Secp256k1 private key.
|
|
204
|
+
* @group Implementation
|
|
205
|
+
* @category Serialization
|
|
170
206
|
*/
|
|
171
207
|
static generate(): Secp256k1PrivateKey {
|
|
172
208
|
const hexInput = secp256k1.utils.randomPrivateKey();
|
|
@@ -182,6 +218,8 @@ export class Secp256k1PrivateKey extends Serializable implements PrivateKey {
|
|
|
182
218
|
* @returns The generated private key.
|
|
183
219
|
*
|
|
184
220
|
* @throws Error if the provided path is not a valid BIP44 path.
|
|
221
|
+
* @group Implementation
|
|
222
|
+
* @category Serialization
|
|
185
223
|
*/
|
|
186
224
|
static fromDerivationPath(path: string, mnemonics: string): Secp256k1PrivateKey {
|
|
187
225
|
if (!isValidBIP44Path(path)) {
|
|
@@ -198,6 +236,8 @@ export class Secp256k1PrivateKey extends Serializable implements PrivateKey {
|
|
|
198
236
|
* @param seed - The seed phrase created by the mnemonics, represented as a Uint8Array.
|
|
199
237
|
* @returns The generated private key as an instance of Secp256k1PrivateKey.
|
|
200
238
|
* @throws Error if the derived private key is invalid.
|
|
239
|
+
* @group Implementation
|
|
240
|
+
* @category Serialization
|
|
201
241
|
*/
|
|
202
242
|
private static fromDerivationPathInner(path: string, seed: Uint8Array): Secp256k1PrivateKey {
|
|
203
243
|
const { privateKey } = HDKey.fromMasterSeed(seed).derive(path);
|
|
@@ -219,6 +259,8 @@ export class Secp256k1PrivateKey extends Serializable implements PrivateKey {
|
|
|
219
259
|
*
|
|
220
260
|
* @param message - A message in HexInput format to be signed.
|
|
221
261
|
* @returns Signature - The generated signature for the provided message.
|
|
262
|
+
* @group Implementation
|
|
263
|
+
* @category Serialization
|
|
222
264
|
*/
|
|
223
265
|
sign(message: HexInput): Secp256k1Signature {
|
|
224
266
|
const messageToSign = convertSigningMessage(message);
|
|
@@ -232,6 +274,8 @@ export class Secp256k1PrivateKey extends Serializable implements PrivateKey {
|
|
|
232
274
|
* Derive the Secp256k1PublicKey from this private key.
|
|
233
275
|
*
|
|
234
276
|
* @returns Secp256k1PublicKey The derived public key.
|
|
277
|
+
* @group Implementation
|
|
278
|
+
* @category Serialization
|
|
235
279
|
*/
|
|
236
280
|
publicKey(): Secp256k1PublicKey {
|
|
237
281
|
const bytes = secp256k1.getPublicKey(this.key.toUint8Array(), false);
|
|
@@ -242,6 +286,8 @@ export class Secp256k1PrivateKey extends Serializable implements PrivateKey {
|
|
|
242
286
|
* Get the private key in bytes (Uint8Array).
|
|
243
287
|
*
|
|
244
288
|
* @returns
|
|
289
|
+
* @group Implementation
|
|
290
|
+
* @category Serialization
|
|
245
291
|
*/
|
|
246
292
|
toUint8Array(): Uint8Array {
|
|
247
293
|
return this.key.toUint8Array();
|
|
@@ -251,6 +297,8 @@ export class Secp256k1PrivateKey extends Serializable implements PrivateKey {
|
|
|
251
297
|
* Get the private key as a string representation.
|
|
252
298
|
*
|
|
253
299
|
* @returns string representation of the private key
|
|
300
|
+
* @group Implementation
|
|
301
|
+
* @category Serialization
|
|
254
302
|
*/
|
|
255
303
|
toString(): string {
|
|
256
304
|
return this.toHexString();
|
|
@@ -297,6 +345,8 @@ export class Secp256k1PrivateKey extends Serializable implements PrivateKey {
|
|
|
297
345
|
* @param privateKey - The private key to be checked.
|
|
298
346
|
*
|
|
299
347
|
* @deprecated use `instanceof Secp256k1PrivateKey` instead
|
|
348
|
+
* @group Implementation
|
|
349
|
+
* @category Serialization
|
|
300
350
|
*/
|
|
301
351
|
static isPrivateKey(privateKey: PrivateKey): privateKey is Secp256k1PrivateKey {
|
|
302
352
|
return privateKey instanceof Secp256k1PrivateKey;
|
|
@@ -306,17 +356,22 @@ export class Secp256k1PrivateKey extends Serializable implements PrivateKey {
|
|
|
306
356
|
/**
|
|
307
357
|
* Represents a signature of a message signed using a Secp256k1 ECDSA private key.
|
|
308
358
|
*
|
|
359
|
+
* @group Implementation
|
|
360
|
+
* @category Serialization
|
|
309
361
|
*/
|
|
310
362
|
export class Secp256k1Signature extends Signature {
|
|
311
363
|
/**
|
|
312
|
-
* Secp256k1 ecdsa signatures are 256-bit
|
|
313
|
-
* @
|
|
364
|
+
* Secp256k1 ecdsa signatures are 256-bit.
|
|
365
|
+
* @group Implementation
|
|
366
|
+
* @category Serialization
|
|
314
367
|
*/
|
|
315
368
|
static readonly LENGTH = 64;
|
|
316
369
|
|
|
317
370
|
/**
|
|
318
371
|
* The signature bytes
|
|
319
372
|
* @private
|
|
373
|
+
* @group Implementation
|
|
374
|
+
* @category Serialization
|
|
320
375
|
*/
|
|
321
376
|
private readonly data: Hex;
|
|
322
377
|
|
|
@@ -326,6 +381,8 @@ export class Secp256k1Signature extends Signature {
|
|
|
326
381
|
* Create a new Signature instance from a Uint8Array or String.
|
|
327
382
|
*
|
|
328
383
|
* @param hexInput A HexInput (string or Uint8Array)
|
|
384
|
+
* @group Implementation
|
|
385
|
+
* @category Serialization
|
|
329
386
|
*/
|
|
330
387
|
constructor(hexInput: HexInput) {
|
|
331
388
|
super();
|
|
@@ -7,10 +7,14 @@ import { Hex } from "../hex";
|
|
|
7
7
|
*
|
|
8
8
|
* This class represents the product of signing a message directly from a
|
|
9
9
|
* PrivateKey and can be verified against a CryptoPublicKey.
|
|
10
|
+
* @group Implementation
|
|
11
|
+
* @category Serialization
|
|
10
12
|
*/
|
|
11
13
|
export abstract class Signature extends Serializable {
|
|
12
14
|
/**
|
|
13
15
|
* Get the raw signature bytes
|
|
16
|
+
* @group Implementation
|
|
17
|
+
* @category Serialization
|
|
14
18
|
*/
|
|
15
19
|
toUint8Array(): Uint8Array {
|
|
16
20
|
return this.bcsToBytes();
|
|
@@ -19,6 +23,8 @@ export abstract class Signature extends Serializable {
|
|
|
19
23
|
/**
|
|
20
24
|
* Get the signature as a hex string with a 0x prefix e.g. 0x123456...
|
|
21
25
|
* @returns The hex string representation of the signature.
|
|
26
|
+
* @group Implementation
|
|
27
|
+
* @category Serialization
|
|
22
28
|
*/
|
|
23
29
|
toString(): string {
|
|
24
30
|
const bytes = this.toUint8Array();
|
|
@@ -32,6 +38,8 @@ export abstract class Signature extends Serializable {
|
|
|
32
38
|
*
|
|
33
39
|
* This is the product of signing a message through an account,
|
|
34
40
|
* and can be verified against an AccountPublicKey.
|
|
41
|
+
* @group Implementation
|
|
42
|
+
* @category Serialization
|
|
35
43
|
*/
|
|
36
44
|
// export abstract class AccountSignature extends Serializable {
|
|
37
45
|
// /**
|