@aptos-labs/ts-sdk 1.29.0 → 1.30.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 +2 -2
- package/dist/common/{accountAddress-DUCC2ffJ.d.ts → accountAddress-DnSqjhSl.d.ts} +700 -245
- package/dist/common/{chunk-HBPH2AD3.js → chunk-7IYTZDXV.js} +1 -1
- package/dist/common/chunk-7IYTZDXV.js.map +1 -0
- package/dist/common/cli/index.d.ts +123 -126
- package/dist/common/cli/index.js +1 -1
- package/dist/common/cli/index.js.map +1 -1
- package/dist/common/index.d.ts +5921 -1627
- package/dist/common/index.js +8 -8
- package/dist/common/index.js.map +1 -1
- package/dist/esm/Ed25519Account-DpH9qAcg.d.mts +470 -0
- package/dist/esm/account/AbstractKeylessAccount.d.mts +6 -5
- package/dist/esm/account/AbstractKeylessAccount.mjs +1 -1
- package/dist/esm/account/Account.d.mts +2 -2
- package/dist/esm/account/Account.mjs +1 -1
- package/dist/esm/account/Ed25519Account.d.mts +2 -2
- package/dist/esm/account/Ed25519Account.mjs +1 -1
- package/dist/esm/account/EphemeralKeyPair.d.mts +49 -14
- package/dist/esm/account/EphemeralKeyPair.mjs +1 -1
- package/dist/esm/account/FederatedKeylessAccount.d.mts +3 -3
- package/dist/esm/account/FederatedKeylessAccount.mjs +1 -1
- package/dist/esm/account/KeylessAccount.d.mts +42 -4
- package/dist/esm/account/KeylessAccount.mjs +1 -1
- package/dist/esm/account/MultiKeyAccount.d.mts +54 -34
- package/dist/esm/account/MultiKeyAccount.mjs +1 -1
- package/dist/esm/account/SingleKeyAccount.d.mts +2 -2
- package/dist/esm/account/SingleKeyAccount.mjs +1 -1
- package/dist/esm/account/index.d.mts +2 -2
- package/dist/esm/account/index.mjs +1 -1
- package/dist/esm/api/account.d.mts +446 -161
- package/dist/esm/api/account.mjs +1 -1
- package/dist/esm/api/ans.d.mts +369 -122
- package/dist/esm/api/ans.mjs +1 -1
- package/dist/esm/api/aptos.d.mts +40 -7
- package/dist/esm/api/aptos.mjs +1 -1
- package/dist/esm/api/aptosConfig.d.mts +102 -14
- package/dist/esm/api/aptosConfig.mjs +1 -1
- package/dist/esm/api/coin.d.mts +52 -15
- package/dist/esm/api/coin.mjs +1 -1
- package/dist/esm/api/digitalAsset.d.mts +710 -300
- package/dist/esm/api/digitalAsset.mjs +1 -1
- package/dist/esm/api/event.d.mts +129 -26
- package/dist/esm/api/event.mjs +1 -1
- package/dist/esm/api/faucet.d.mts +44 -7
- package/dist/esm/api/faucet.mjs +1 -1
- package/dist/esm/api/fungibleAsset.d.mts +152 -49
- package/dist/esm/api/fungibleAsset.mjs +1 -1
- package/dist/esm/api/general.d.mts +171 -55
- package/dist/esm/api/general.mjs +1 -1
- package/dist/esm/api/index.d.mts +2 -2
- package/dist/esm/api/index.mjs +1 -1
- package/dist/esm/api/keyless.d.mts +82 -11
- package/dist/esm/api/keyless.mjs +1 -1
- package/dist/esm/api/object.d.mts +51 -7
- package/dist/esm/api/object.mjs +1 -1
- package/dist/esm/api/staking.d.mts +86 -17
- package/dist/esm/api/staking.mjs +1 -1
- package/dist/esm/api/table.d.mts +118 -38
- package/dist/esm/api/table.mjs +1 -1
- package/dist/esm/api/transaction.d.mts +440 -109
- package/dist/esm/api/transaction.mjs +1 -1
- package/dist/esm/api/transactionSubmission/build.d.mts +99 -13
- package/dist/esm/api/transactionSubmission/build.mjs +1 -1
- package/dist/esm/api/transactionSubmission/helpers.d.mts +79 -0
- package/dist/esm/api/transactionSubmission/helpers.mjs +1 -1
- package/dist/esm/api/transactionSubmission/management.d.mts +111 -12
- package/dist/esm/api/transactionSubmission/management.mjs +1 -1
- package/dist/esm/api/transactionSubmission/sign.d.mts +97 -3
- 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 +140 -15
- package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
- package/dist/esm/api/transactionSubmission/submit.d.mts +104 -13
- package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
- package/dist/esm/api/utils.d.mts +26 -3
- package/dist/esm/api/utils.mjs +1 -1
- package/dist/esm/bcs/consts.mjs +1 -1
- package/dist/esm/bcs/deserializer.d.mts +82 -32
- package/dist/esm/bcs/deserializer.mjs +1 -1
- package/dist/esm/bcs/index.mjs +1 -1
- package/dist/esm/bcs/serializable/entryFunctionBytes.d.mts +25 -6
- package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -1
- package/dist/esm/bcs/serializable/fixedBytes.d.mts +51 -21
- package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -1
- package/dist/esm/bcs/serializable/movePrimitives.d.mts +79 -0
- package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
- package/dist/esm/bcs/serializable/moveStructs.d.mts +119 -32
- package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
- package/dist/esm/bcs/serializer.d.mts +111 -76
- package/dist/esm/bcs/serializer.mjs +1 -1
- package/dist/esm/{chunk-U6Z4FNB7.mjs → chunk-2CJC43CV.mjs} +1 -1
- package/dist/esm/chunk-2CJC43CV.mjs.map +1 -0
- package/dist/esm/{chunk-P2EIZ7WL.mjs → chunk-2I56E4T2.mjs} +2 -2
- package/dist/esm/chunk-2I56E4T2.mjs.map +1 -0
- package/dist/esm/{chunk-P3TAY5PP.mjs → chunk-2QRWGJJA.mjs} +2 -2
- package/dist/esm/chunk-2QRWGJJA.mjs.map +1 -0
- package/dist/esm/chunk-37UZKMJI.mjs +2 -0
- package/dist/esm/chunk-37UZKMJI.mjs.map +1 -0
- package/dist/esm/chunk-4CDDWSKZ.mjs +2 -0
- package/dist/esm/chunk-4CDDWSKZ.mjs.map +1 -0
- package/dist/esm/chunk-4OV7QU2U.mjs +2 -0
- package/dist/esm/chunk-4OV7QU2U.mjs.map +1 -0
- package/dist/esm/{chunk-SWNFKKRE.mjs → chunk-5AAFF2PV.mjs} +2 -2
- package/dist/esm/chunk-5AAFF2PV.mjs.map +1 -0
- package/dist/esm/chunk-5CCHECTE.mjs +2 -0
- package/dist/esm/chunk-5CCHECTE.mjs.map +1 -0
- package/dist/esm/{chunk-KUOB4DDE.mjs → chunk-5XXIIWG7.mjs} +2 -2
- package/dist/esm/chunk-5XXIIWG7.mjs.map +1 -0
- package/dist/esm/chunk-5ZBHIUWG.mjs +2 -0
- package/dist/esm/chunk-5ZBHIUWG.mjs.map +1 -0
- package/dist/esm/chunk-6AGTDRNM.mjs +2 -0
- package/dist/esm/chunk-6AGTDRNM.mjs.map +1 -0
- package/dist/esm/chunk-6FLHGOKP.mjs +2 -0
- package/dist/esm/chunk-6FLHGOKP.mjs.map +1 -0
- package/dist/esm/{chunk-LG7RJQ57.mjs → chunk-6Q2O5G3J.mjs} +1 -1
- package/dist/esm/chunk-6Q2O5G3J.mjs.map +1 -0
- package/dist/esm/chunk-7D3RY73L.mjs +2 -0
- package/dist/esm/chunk-7D3RY73L.mjs.map +1 -0
- package/dist/esm/{chunk-QBSU3L5Q.mjs → chunk-7PVIWKGT.mjs} +2 -2
- package/dist/esm/chunk-7PVIWKGT.mjs.map +1 -0
- package/dist/esm/chunk-7V6RL27I.mjs +2 -0
- package/dist/esm/chunk-7V6RL27I.mjs.map +1 -0
- package/dist/esm/{chunk-44GYWUSH.mjs → chunk-7XS45O6M.mjs} +1 -1
- package/dist/esm/chunk-7XS45O6M.mjs.map +1 -0
- package/dist/esm/{chunk-YUNDX5I7.mjs → chunk-AGBA3Y7A.mjs} +2 -2
- package/dist/esm/chunk-AGBA3Y7A.mjs.map +1 -0
- package/dist/esm/{chunk-OKAQO57B.mjs → chunk-BQXVHY7J.mjs} +2 -2
- package/dist/esm/chunk-BQXVHY7J.mjs.map +1 -0
- package/dist/esm/chunk-CRL4WGOH.mjs +2 -0
- package/dist/esm/chunk-CRL4WGOH.mjs.map +1 -0
- package/dist/esm/{chunk-APN6AV5Q.mjs → chunk-D3KBNFZR.mjs} +2 -2
- package/dist/esm/chunk-D3KBNFZR.mjs.map +1 -0
- package/dist/esm/{chunk-SCHZ67F3.mjs → chunk-D3OEQLUE.mjs} +1 -1
- package/dist/esm/{chunk-SCHZ67F3.mjs.map → chunk-D3OEQLUE.mjs.map} +1 -1
- package/dist/esm/{chunk-FZ5EYP3D.mjs → chunk-DCUVV3VY.mjs} +2 -2
- package/dist/esm/chunk-DCUVV3VY.mjs.map +1 -0
- package/dist/esm/{chunk-S2KDCIZN.mjs → chunk-DXQT55L3.mjs} +2 -2
- package/dist/esm/chunk-DXQT55L3.mjs.map +1 -0
- package/dist/esm/chunk-DZJXOL64.mjs +2 -0
- package/dist/esm/chunk-DZJXOL64.mjs.map +1 -0
- package/dist/esm/{chunk-Y2GWUE7C.mjs → chunk-EF2PUPUH.mjs} +2 -2
- package/dist/esm/chunk-EF2PUPUH.mjs.map +1 -0
- package/dist/esm/{chunk-J64ARI4E.mjs → chunk-EKZQ3EYX.mjs} +2 -2
- package/dist/esm/chunk-EKZQ3EYX.mjs.map +1 -0
- package/dist/esm/{chunk-F76N4MQO.mjs → chunk-EN2HDNFE.mjs} +2 -2
- package/dist/esm/chunk-EN2HDNFE.mjs.map +1 -0
- package/dist/esm/{chunk-L2QXU6F4.mjs → chunk-FO4F3OJJ.mjs} +2 -2
- package/dist/esm/chunk-FO4F3OJJ.mjs.map +1 -0
- package/dist/esm/{chunk-HKBBA653.mjs → chunk-FPF4KZ5M.mjs} +2 -2
- package/dist/esm/chunk-FPF4KZ5M.mjs.map +1 -0
- package/dist/esm/{chunk-OMV7445F.mjs → chunk-FY7TSOUU.mjs} +2 -2
- package/dist/esm/chunk-FY7TSOUU.mjs.map +1 -0
- package/dist/esm/{chunk-ELYS7CWV.mjs → chunk-GIQQF2PD.mjs} +2 -2
- package/dist/esm/chunk-GIQQF2PD.mjs.map +1 -0
- package/dist/esm/{chunk-SRPI2FFA.mjs → chunk-GMKKHGXK.mjs} +1 -1
- package/dist/esm/chunk-GMKKHGXK.mjs.map +1 -0
- package/dist/esm/chunk-GPZRGLU2.mjs +2 -0
- package/dist/esm/chunk-GPZRGLU2.mjs.map +1 -0
- package/dist/esm/{chunk-TDGQGILY.mjs → chunk-GQABU3RQ.mjs} +1 -1
- package/dist/esm/chunk-GQABU3RQ.mjs.map +1 -0
- package/dist/esm/{chunk-JH6VLTMS.mjs → chunk-HAMXSLWF.mjs} +2 -2
- package/dist/esm/chunk-HAMXSLWF.mjs.map +1 -0
- package/dist/esm/{chunk-AH44UPM4.mjs → chunk-HBIDHQ2M.mjs} +1 -1
- package/dist/esm/chunk-HBIDHQ2M.mjs.map +1 -0
- package/dist/esm/{chunk-QPB6EJVM.mjs → chunk-HCV3NGLS.mjs} +2 -2
- package/dist/esm/chunk-HCV3NGLS.mjs.map +1 -0
- package/dist/esm/{chunk-2BTTX2KO.mjs → chunk-HDTKBFRX.mjs} +2 -2
- package/dist/esm/chunk-HDTKBFRX.mjs.map +1 -0
- package/dist/esm/chunk-HGVZ7ULA.mjs +2 -0
- package/dist/esm/chunk-HGVZ7ULA.mjs.map +1 -0
- package/dist/esm/{chunk-6EMN3BOV.mjs → chunk-I2NMCLNW.mjs} +1 -1
- package/dist/esm/chunk-I2NMCLNW.mjs.map +1 -0
- package/dist/esm/chunk-IBLZ6MZU.mjs +2 -0
- package/dist/esm/chunk-IBLZ6MZU.mjs.map +1 -0
- package/dist/esm/chunk-IECDO22V.mjs +2 -0
- package/dist/esm/chunk-IECDO22V.mjs.map +1 -0
- package/dist/esm/{chunk-KUZ2YTJH.mjs → chunk-IFHQSZLK.mjs} +2 -2
- package/dist/esm/chunk-IFHQSZLK.mjs.map +1 -0
- package/dist/esm/{chunk-EXP5STXZ.mjs → chunk-J245N3XF.mjs} +1 -1
- package/dist/esm/chunk-J245N3XF.mjs.map +1 -0
- package/dist/esm/{chunk-7VKFXX5Q.mjs → chunk-JDYASF3E.mjs} +2 -2
- package/dist/esm/chunk-JDYASF3E.mjs.map +1 -0
- package/dist/esm/{chunk-H6YNXJNF.mjs → chunk-JGNMNCQB.mjs} +2 -2
- package/dist/esm/chunk-JGNMNCQB.mjs.map +1 -0
- package/dist/esm/{chunk-R76DHMGR.mjs → chunk-JNHFQTFC.mjs} +2 -2
- package/dist/esm/chunk-JNHFQTFC.mjs.map +1 -0
- package/dist/esm/{chunk-5PCNWXRN.mjs → chunk-JY3JJ55D.mjs} +2 -2
- package/dist/esm/chunk-JY3JJ55D.mjs.map +1 -0
- package/dist/esm/{chunk-3W2DHZXK.mjs → chunk-K6MZXKVV.mjs} +2 -2
- package/dist/esm/chunk-K6MZXKVV.mjs.map +1 -0
- package/dist/esm/{chunk-FVA2OPG4.mjs → chunk-KDMSOCZY.mjs} +1 -1
- package/dist/esm/{chunk-BCUSI3N6.mjs → chunk-KFNDDPOW.mjs} +2 -2
- package/dist/esm/chunk-KFNDDPOW.mjs.map +1 -0
- package/dist/esm/{chunk-4TB3AWQE.mjs → chunk-KFSVKIFO.mjs} +2 -2
- package/dist/esm/chunk-KFSVKIFO.mjs.map +1 -0
- package/dist/esm/chunk-KIW54KWR.mjs +2 -0
- package/dist/esm/{chunk-OHRL766V.mjs → chunk-KM6UXNC7.mjs} +2 -2
- package/dist/esm/chunk-KM6UXNC7.mjs.map +1 -0
- package/dist/esm/{chunk-NWOMSL6K.mjs → chunk-KRVLR3L4.mjs} +2 -2
- package/dist/esm/chunk-KRVLR3L4.mjs.map +1 -0
- package/dist/esm/{chunk-4HR32TSY.mjs → chunk-KSKQVOBA.mjs} +2 -2
- package/dist/esm/chunk-KSKQVOBA.mjs.map +1 -0
- package/dist/esm/{chunk-ZROQH5YL.mjs → chunk-KSUZS6EL.mjs} +2 -2
- package/dist/esm/chunk-L5I7F3NZ.mjs +2 -0
- package/dist/esm/chunk-L5I7F3NZ.mjs.map +1 -0
- package/dist/esm/{chunk-MAMPMCO7.mjs → chunk-LD5MUWGW.mjs} +2 -2
- package/dist/esm/chunk-LD5MUWGW.mjs.map +1 -0
- package/dist/esm/{chunk-UAL27G6B.mjs → chunk-LEKBJ2EG.mjs} +1 -1
- package/dist/esm/chunk-LEKBJ2EG.mjs.map +1 -0
- package/dist/esm/chunk-LZS7BQ2B.mjs +2 -0
- package/dist/esm/chunk-LZS7BQ2B.mjs.map +1 -0
- package/dist/esm/{chunk-53RB2PRH.mjs → chunk-N3OYD6VZ.mjs} +2 -2
- package/dist/esm/chunk-N3OYD6VZ.mjs.map +1 -0
- package/dist/esm/{chunk-KEYAPEAX.mjs → chunk-N47FTRYO.mjs} +1 -1
- package/dist/esm/chunk-N47FTRYO.mjs.map +1 -0
- package/dist/esm/{chunk-YDZBU2DJ.mjs → chunk-NODYW7DM.mjs} +2 -2
- package/dist/esm/chunk-NODYW7DM.mjs.map +1 -0
- package/dist/esm/{chunk-HVMFZF6P.mjs → chunk-NV6DHDM3.mjs} +2 -2
- package/dist/esm/chunk-NV6DHDM3.mjs.map +1 -0
- package/dist/esm/{chunk-YU3IYJRL.mjs → chunk-OLPI7QAH.mjs} +2 -2
- package/dist/esm/chunk-OLPI7QAH.mjs.map +1 -0
- package/dist/esm/chunk-ONBFUPEC.mjs +2 -0
- package/dist/esm/chunk-ONBFUPEC.mjs.map +1 -0
- package/dist/esm/{chunk-A42BPAD4.mjs → chunk-OS2EG6AE.mjs} +2 -2
- package/dist/esm/chunk-OS2EG6AE.mjs.map +1 -0
- package/dist/esm/chunk-OTY3NO7Q.mjs +2 -0
- package/dist/esm/chunk-OTY3NO7Q.mjs.map +1 -0
- package/dist/esm/{chunk-MNVUSJEK.mjs → chunk-OV5UQ75K.mjs} +2 -2
- package/dist/esm/chunk-OV5UQ75K.mjs.map +1 -0
- package/dist/esm/{chunk-P5V7OZNN.mjs → chunk-OZN3OOJV.mjs} +2 -2
- package/dist/esm/chunk-OZN3OOJV.mjs.map +1 -0
- package/dist/esm/{chunk-WRRQ7L5K.mjs → chunk-PCLU4KLY.mjs} +2 -2
- package/dist/esm/chunk-PCLU4KLY.mjs.map +1 -0
- package/dist/esm/{chunk-Q3TAEOH5.mjs → chunk-PGZWRY7A.mjs} +2 -2
- package/dist/esm/chunk-PGZWRY7A.mjs.map +1 -0
- package/dist/esm/{chunk-X34JJPW5.mjs → chunk-PHG2IWZW.mjs} +2 -2
- package/dist/esm/chunk-PHG2IWZW.mjs.map +1 -0
- package/dist/esm/{chunk-LR65XHSF.mjs → chunk-PHP47DI4.mjs} +2 -2
- package/dist/esm/chunk-PHP47DI4.mjs.map +1 -0
- package/dist/esm/chunk-PRZ7AIGA.mjs +2 -0
- package/dist/esm/chunk-PRZ7AIGA.mjs.map +1 -0
- package/dist/esm/{chunk-6UZ3VI5Y.mjs → chunk-QBP4XJT5.mjs} +2 -2
- package/dist/esm/chunk-QBP4XJT5.mjs.map +1 -0
- package/dist/esm/{chunk-5VD4MHB3.mjs → chunk-QBWGWHJK.mjs} +2 -2
- package/dist/esm/chunk-QBWGWHJK.mjs.map +1 -0
- package/dist/esm/chunk-QQIVWB6G.mjs +2 -0
- package/dist/esm/chunk-QQIVWB6G.mjs.map +1 -0
- package/dist/esm/{chunk-367OG3DB.mjs → chunk-QRTZYRH2.mjs} +2 -2
- package/dist/esm/chunk-QRTZYRH2.mjs.map +1 -0
- package/dist/esm/{chunk-2F7Z7RMW.mjs → chunk-R3Y6WH2U.mjs} +2 -2
- package/dist/esm/chunk-R3Y6WH2U.mjs.map +1 -0
- package/dist/esm/{chunk-S2W4D6NZ.mjs → chunk-RAXP3STS.mjs} +2 -2
- package/dist/esm/chunk-RAXP3STS.mjs.map +1 -0
- package/dist/esm/{chunk-F3M2UQA4.mjs → chunk-RNAKZVRN.mjs} +2 -2
- package/dist/esm/chunk-RNAKZVRN.mjs.map +1 -0
- package/dist/esm/{chunk-TQWGQLM6.mjs → chunk-RUDS7RSB.mjs} +2 -2
- package/dist/esm/chunk-RUDS7RSB.mjs.map +1 -0
- package/dist/esm/{chunk-GMBSQDPO.mjs → chunk-S3FVA55H.mjs} +2 -2
- package/dist/esm/chunk-S3FVA55H.mjs.map +1 -0
- package/dist/esm/{chunk-BSAHPS6E.mjs → chunk-TIZL5YVP.mjs} +2 -2
- package/dist/esm/chunk-TIZL5YVP.mjs.map +1 -0
- package/dist/esm/{chunk-SDWE6WMM.mjs → chunk-TRU3EK64.mjs} +2 -2
- package/dist/esm/chunk-TRU3EK64.mjs.map +1 -0
- package/dist/esm/chunk-UI3AKMZX.mjs +2 -0
- package/dist/esm/{chunk-UAEODDZS.mjs.map → chunk-UI3AKMZX.mjs.map} +1 -1
- package/dist/esm/{chunk-ADE6MVXC.mjs → chunk-UKAXCARD.mjs} +2 -2
- package/dist/esm/chunk-UKAXCARD.mjs.map +1 -0
- package/dist/esm/{chunk-NMD45OTM.mjs → chunk-V5NDNR36.mjs} +2 -2
- package/dist/esm/chunk-V5NDNR36.mjs.map +1 -0
- package/dist/esm/{chunk-O2BPA6TS.mjs → chunk-VQTEGTUQ.mjs} +2 -2
- package/dist/esm/chunk-VQTEGTUQ.mjs.map +1 -0
- package/dist/esm/{chunk-45IUUCAV.mjs → chunk-WIXNX7HY.mjs} +2 -2
- package/dist/esm/chunk-WIXNX7HY.mjs.map +1 -0
- package/dist/esm/{chunk-CRA2MFJC.mjs → chunk-WOOH5MMX.mjs} +2 -2
- package/dist/esm/chunk-WOOH5MMX.mjs.map +1 -0
- package/dist/esm/{chunk-GWSDIX6C.mjs → chunk-WSVOJSAC.mjs} +2 -2
- package/dist/esm/chunk-WSVOJSAC.mjs.map +1 -0
- package/dist/esm/{chunk-IR4SLC2M.mjs → chunk-WUCPTRXU.mjs} +2 -2
- package/dist/esm/chunk-WUCPTRXU.mjs.map +1 -0
- package/dist/esm/chunk-XHCALZ7X.mjs +2 -0
- package/dist/esm/chunk-XHCALZ7X.mjs.map +1 -0
- package/dist/esm/{chunk-WJRZWAIS.mjs → chunk-XIY2VORC.mjs} +2 -2
- package/dist/esm/chunk-XIY2VORC.mjs.map +1 -0
- package/dist/esm/chunk-XOCRDV2V.mjs +2 -0
- package/dist/esm/chunk-XOCRDV2V.mjs.map +1 -0
- package/dist/esm/{chunk-D3Q4BC3I.mjs → chunk-Z36WHOZV.mjs} +2 -2
- package/dist/esm/chunk-Z36WHOZV.mjs.map +1 -0
- package/dist/esm/{chunk-BOYYQAB4.mjs → chunk-ZINOJTLU.mjs} +2 -2
- package/dist/esm/chunk-ZINOJTLU.mjs.map +1 -0
- package/dist/esm/{chunk-RXE6NNOL.mjs → chunk-ZS3EWM5A.mjs} +2 -2
- package/dist/esm/chunk-ZS3EWM5A.mjs.map +1 -0
- package/dist/esm/{chunk-GDUAFXIQ.mjs → chunk-ZUTOMGB7.mjs} +2 -2
- package/dist/esm/chunk-ZUTOMGB7.mjs.map +1 -0
- package/dist/esm/cli/index.mjs +1 -1
- package/dist/esm/cli/localNode.d.mts +26 -10
- package/dist/esm/cli/localNode.mjs +1 -1
- package/dist/esm/cli/move.d.mts +104 -123
- package/dist/esm/cli/move.mjs +1 -1
- package/dist/esm/client/core.d.mts +21 -6
- package/dist/esm/client/core.mjs +1 -1
- package/dist/esm/client/get.d.mts +34 -6
- package/dist/esm/client/get.mjs +1 -1
- package/dist/esm/client/index.mjs +1 -1
- package/dist/esm/client/post.d.mts +63 -6
- package/dist/esm/client/post.mjs +1 -1
- package/dist/esm/client/types.d.mts +21 -8
- package/dist/esm/client/types.mjs +1 -1
- package/dist/esm/core/account/index.mjs +1 -1
- package/dist/esm/core/account/utils/address.d.mts +1 -1
- package/dist/esm/core/account/utils/address.mjs +1 -1
- package/dist/esm/core/account/utils/index.mjs +1 -1
- package/dist/esm/core/accountAddress.d.mts +63 -48
- package/dist/esm/core/accountAddress.mjs +1 -1
- package/dist/esm/core/authenticationKey.d.mts +1 -1
- package/dist/esm/core/authenticationKey.mjs +1 -1
- package/dist/esm/core/common.d.mts +6 -0
- package/dist/esm/core/common.mjs +1 -1
- package/dist/esm/core/crypto/ed25519.d.mts +77 -26
- package/dist/esm/core/crypto/ed25519.mjs +1 -1
- package/dist/esm/core/crypto/ephemeral.d.mts +36 -14
- package/dist/esm/core/crypto/ephemeral.mjs +1 -1
- package/dist/esm/core/crypto/federatedKeyless.d.mts +2 -14
- package/dist/esm/core/crypto/federatedKeyless.mjs +1 -1
- package/dist/esm/core/crypto/hdKey.d.mts +9 -6
- package/dist/esm/core/crypto/hdKey.mjs +1 -1
- package/dist/esm/core/crypto/index.d.mts +1 -1
- package/dist/esm/core/crypto/index.mjs +1 -1
- package/dist/esm/core/crypto/keyless.d.mts +126 -45
- package/dist/esm/core/crypto/keyless.mjs +1 -1
- package/dist/esm/core/crypto/multiEd25519.d.mts +45 -6
- package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
- package/dist/esm/core/crypto/multiKey.d.mts +58 -7
- package/dist/esm/core/crypto/multiKey.mjs +1 -1
- package/dist/esm/core/crypto/poseidon.d.mts +35 -5
- package/dist/esm/core/crypto/poseidon.mjs +1 -1
- package/dist/esm/core/crypto/privateKey.d.mts +10 -6
- package/dist/esm/core/crypto/proof.d.mts +2 -6
- package/dist/esm/core/crypto/proof.mjs +1 -1
- package/dist/esm/core/crypto/publicKey.d.mts +1 -1
- package/dist/esm/core/crypto/publicKey.mjs +1 -1
- package/dist/esm/core/crypto/secp256k1.d.mts +72 -27
- package/dist/esm/core/crypto/secp256k1.mjs +1 -1
- package/dist/esm/core/crypto/signature.d.mts +5 -4
- package/dist/esm/core/crypto/signature.mjs +1 -1
- package/dist/esm/core/crypto/singleKey.d.mts +63 -5
- package/dist/esm/core/crypto/singleKey.mjs +1 -1
- package/dist/esm/core/crypto/utils.mjs +1 -1
- package/dist/esm/core/hex.d.mts +27 -28
- package/dist/esm/core/hex.mjs +1 -1
- package/dist/esm/core/index.d.mts +1 -1
- package/dist/esm/core/index.mjs +1 -1
- package/dist/esm/index.d.mts +2 -2
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/internal/account.d.mts +191 -12
- package/dist/esm/internal/account.mjs +1 -1
- package/dist/esm/internal/ans.d.mts +206 -14
- package/dist/esm/internal/ans.mjs +1 -1
- package/dist/esm/internal/coin.d.mts +13 -1
- package/dist/esm/internal/coin.mjs +1 -1
- package/dist/esm/internal/digitalAsset.d.mts +330 -2
- package/dist/esm/internal/digitalAsset.mjs +1 -1
- package/dist/esm/internal/event.d.mts +39 -0
- package/dist/esm/internal/event.mjs +1 -1
- package/dist/esm/internal/faucet.d.mts +14 -0
- package/dist/esm/internal/faucet.mjs +1 -1
- package/dist/esm/internal/fungibleAsset.d.mts +48 -2
- package/dist/esm/internal/fungibleAsset.mjs +1 -1
- package/dist/esm/internal/general.d.mts +46 -0
- package/dist/esm/internal/general.mjs +1 -1
- package/dist/esm/internal/keyless.d.mts +38 -2
- package/dist/esm/internal/keyless.mjs +1 -1
- package/dist/esm/internal/object.d.mts +21 -0
- package/dist/esm/internal/object.mjs +1 -1
- package/dist/esm/internal/staking.d.mts +26 -0
- package/dist/esm/internal/staking.mjs +1 -1
- package/dist/esm/internal/table.d.mts +33 -1
- package/dist/esm/internal/table.mjs +1 -1
- package/dist/esm/internal/transaction.d.mts +107 -5
- package/dist/esm/internal/transaction.mjs +1 -1
- package/dist/esm/internal/transactionSubmission.d.mts +72 -29
- package/dist/esm/internal/transactionSubmission.mjs +1 -1
- package/dist/esm/internal/view.d.mts +1 -1
- package/dist/esm/internal/view.mjs +1 -1
- package/dist/esm/publicKey-_tPa99ea.d.mts +151 -0
- package/dist/esm/transactions/authenticator/account.d.mts +66 -17
- package/dist/esm/transactions/authenticator/account.mjs +1 -1
- package/dist/esm/transactions/authenticator/index.d.mts +1 -1
- package/dist/esm/transactions/authenticator/index.mjs +1 -1
- package/dist/esm/transactions/authenticator/transaction.d.mts +53 -20
- package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
- package/dist/esm/transactions/index.d.mts +1 -1
- package/dist/esm/transactions/index.mjs +1 -1
- package/dist/esm/transactions/instances/chainId.d.mts +20 -1
- package/dist/esm/transactions/instances/chainId.mjs +1 -1
- package/dist/esm/transactions/instances/identifier.d.mts +21 -3
- package/dist/esm/transactions/instances/identifier.mjs +1 -1
- package/dist/esm/transactions/instances/index.d.mts +1 -1
- package/dist/esm/transactions/instances/index.mjs +1 -1
- package/dist/esm/transactions/instances/moduleId.d.mts +22 -8
- package/dist/esm/transactions/instances/moduleId.mjs +1 -1
- package/dist/esm/transactions/instances/multiAgentTransaction.d.mts +24 -8
- package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/rawTransaction.d.mts +31 -4
- package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/rotationProofChallenge.d.mts +25 -3
- package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
- package/dist/esm/transactions/instances/signedTransaction.d.mts +29 -7
- package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/simpleTransaction.d.mts +23 -8
- package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/transactionArgument.d.mts +23 -0
- package/dist/esm/transactions/instances/transactionPayload.d.mts +72 -26
- package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
- package/dist/esm/transactions/management/accountSequenceNumber.d.mts +37 -11
- package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
- package/dist/esm/transactions/management/asyncQueue.d.mts +22 -19
- package/dist/esm/transactions/management/asyncQueue.mjs +1 -1
- package/dist/esm/transactions/management/index.d.mts +2 -2
- package/dist/esm/transactions/management/index.mjs +1 -1
- package/dist/esm/transactions/management/transactionWorker.d.mts +67 -36
- package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/helpers.d.mts +74 -4
- package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/index.d.mts +1 -1
- package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +45 -23
- package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/signingMessage.d.mts +20 -15
- package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +101 -30
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
- package/dist/esm/transactions/typeTag/index.d.mts +244 -3
- package/dist/esm/transactions/typeTag/index.mjs +1 -1
- package/dist/esm/transactions/typeTag/parser.d.mts +31 -2
- package/dist/esm/transactions/typeTag/parser.mjs +1 -1
- package/dist/esm/transactions/types.d.mts +82 -34
- package/dist/esm/types/generated/queries.mjs +1 -1
- package/dist/esm/types/generated/types.mjs +1 -1
- package/dist/esm/types/index.d.mts +320 -59
- package/dist/esm/types/index.mjs +1 -1
- package/dist/esm/types/indexer.d.mts +65 -2
- package/dist/esm/types/keyless.d.mts +18 -0
- package/dist/esm/utils/apiEndpoints.d.mts +3 -0
- package/dist/esm/utils/apiEndpoints.mjs +1 -1
- package/dist/esm/utils/const.d.mts +2 -4
- package/dist/esm/utils/const.mjs +1 -1
- package/dist/esm/utils/helpers.d.mts +25 -10
- package/dist/esm/utils/helpers.mjs +1 -1
- package/dist/esm/utils/index.mjs +1 -1
- package/dist/esm/utils/memoize.d.mts +12 -10
- package/dist/esm/utils/memoize.mjs +1 -1
- package/dist/esm/utils/normalizeBundle.d.mts +11 -5
- 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 +23 -22
- package/src/account/AbstractKeylessAccount.ts +7 -5
- package/src/account/Account.ts +88 -54
- package/src/account/Ed25519Account.ts +56 -21
- package/src/account/EphemeralKeyPair.ts +50 -15
- package/src/account/FederatedKeylessAccount.ts +4 -3
- package/src/account/KeylessAccount.ts +46 -3
- package/src/account/MultiKeyAccount.ts +56 -35
- package/src/account/SingleKeyAccount.ts +60 -28
- package/src/api/account.ts +443 -159
- package/src/api/ans.ts +367 -120
- package/src/api/aptos.ts +38 -5
- package/src/api/aptosConfig.ts +102 -14
- package/src/api/coin.ts +49 -12
- package/src/api/digitalAsset.ts +707 -296
- package/src/api/event.ts +128 -25
- package/src/api/faucet.ts +44 -7
- package/src/api/fungibleAsset.ts +149 -46
- package/src/api/general.ts +168 -52
- package/src/api/keyless.ts +117 -21
- package/src/api/object.ts +49 -5
- package/src/api/staking.ts +84 -15
- package/src/api/table.ts +117 -37
- package/src/api/transaction.ts +438 -107
- package/src/api/transactionSubmission/build.ts +98 -12
- package/src/api/transactionSubmission/helpers.ts +79 -0
- package/src/api/transactionSubmission/management.ts +110 -10
- package/src/api/transactionSubmission/sign.ts +96 -2
- package/src/api/transactionSubmission/simulate.ts +139 -14
- package/src/api/transactionSubmission/submit.ts +103 -12
- package/src/api/utils.ts +26 -3
- package/src/bcs/deserializer.ts +82 -32
- package/src/bcs/serializable/entryFunctionBytes.ts +27 -6
- package/src/bcs/serializable/fixedBytes.ts +55 -25
- package/src/bcs/serializable/movePrimitives.ts +91 -0
- package/src/bcs/serializable/moveStructs.ts +123 -35
- package/src/bcs/serializer.ts +131 -84
- package/src/cli/localNode.ts +46 -17
- package/src/cli/move.ts +119 -136
- package/src/client/core.ts +23 -8
- package/src/client/get.ts +34 -6
- package/src/client/post.ts +63 -6
- package/src/client/types.ts +40 -13
- package/src/core/account/utils/address.ts +1 -1
- package/src/core/accountAddress.ts +63 -50
- package/src/core/authenticationKey.ts +47 -20
- package/src/core/common.ts +6 -0
- package/src/core/crypto/ed25519.ts +76 -25
- package/src/core/crypto/ephemeral.ts +37 -21
- package/src/core/crypto/federatedKeyless.ts +1 -20
- package/src/core/crypto/hdKey.ts +10 -7
- package/src/core/crypto/keyless.ts +140 -63
- package/src/core/crypto/multiEd25519.ts +44 -5
- package/src/core/crypto/multiKey.ts +66 -19
- package/src/core/crypto/poseidon.ts +72 -5
- package/src/core/crypto/privateKey.ts +9 -5
- package/src/core/crypto/proof.ts +3 -12
- package/src/core/crypto/publicKey.ts +15 -5
- package/src/core/crypto/secp256k1.ts +76 -26
- package/src/core/crypto/signature.ts +7 -4
- package/src/core/crypto/singleKey.ts +62 -5
- package/src/core/hex.ts +27 -28
- package/src/internal/account.ts +248 -12
- package/src/internal/ans.ts +219 -15
- package/src/internal/coin.ts +12 -0
- package/src/internal/digitalAsset.ts +344 -3
- package/src/internal/event.ts +51 -0
- package/src/internal/faucet.ts +14 -0
- package/src/internal/fungibleAsset.ts +46 -0
- package/src/internal/general.ts +46 -0
- package/src/internal/keyless.ts +37 -1
- package/src/internal/object.ts +21 -0
- package/src/internal/queries/getTableItemsData.graphql +1 -1
- package/src/internal/queries/getTableItemsMetadata.graphql +1 -1
- package/src/internal/staking.ts +27 -1
- package/src/internal/table.ts +32 -0
- package/src/internal/transaction.ts +120 -7
- package/src/internal/transactionSubmission.ts +86 -30
- package/src/transactions/authenticator/account.ts +65 -16
- package/src/transactions/authenticator/transaction.ts +52 -19
- package/src/transactions/instances/chainId.ts +20 -1
- package/src/transactions/instances/identifier.ts +21 -3
- package/src/transactions/instances/moduleId.ts +22 -8
- package/src/transactions/instances/multiAgentTransaction.ts +26 -10
- package/src/transactions/instances/rawTransaction.ts +31 -4
- package/src/transactions/instances/rotationProofChallenge.ts +24 -2
- package/src/transactions/instances/signedTransaction.ts +28 -6
- package/src/transactions/instances/simpleTransaction.ts +26 -11
- package/src/transactions/instances/transactionArgument.ts +26 -0
- package/src/transactions/instances/transactionPayload.ts +73 -26
- package/src/transactions/management/accountSequenceNumber.ts +38 -11
- package/src/transactions/management/asyncQueue.ts +22 -19
- package/src/transactions/management/transactionWorker.ts +66 -40
- package/src/transactions/transactionBuilder/helpers.ts +130 -3
- package/src/transactions/transactionBuilder/remoteAbi.ts +71 -30
- package/src/transactions/transactionBuilder/signingMessage.ts +19 -14
- package/src/transactions/transactionBuilder/transactionBuilder.ts +166 -42
- package/src/transactions/typeTag/index.ts +264 -3
- package/src/transactions/typeTag/parser.ts +54 -20
- package/src/transactions/types.ts +81 -33
- package/src/types/index.ts +338 -61
- package/src/types/indexer.ts +82 -2
- package/src/types/keyless.ts +21 -0
- package/src/utils/apiEndpoints.ts +3 -0
- package/src/utils/const.ts +2 -4
- package/src/utils/helpers.ts +25 -10
- package/src/utils/memoize.ts +12 -10
- package/src/utils/normalizeBundle.ts +11 -5
- package/src/version.ts +1 -1
- package/dist/common/chunk-HBPH2AD3.js.map +0 -1
- package/dist/esm/Ed25519Account-B1VMJOY2.d.mts +0 -361
- package/dist/esm/chunk-2BTTX2KO.mjs.map +0 -1
- package/dist/esm/chunk-2F7Z7RMW.mjs.map +0 -1
- package/dist/esm/chunk-367OG3DB.mjs.map +0 -1
- package/dist/esm/chunk-3W2DHZXK.mjs.map +0 -1
- package/dist/esm/chunk-44GYWUSH.mjs.map +0 -1
- package/dist/esm/chunk-45IUUCAV.mjs.map +0 -1
- package/dist/esm/chunk-4HR32TSY.mjs.map +0 -1
- package/dist/esm/chunk-4TB3AWQE.mjs.map +0 -1
- package/dist/esm/chunk-53RB2PRH.mjs.map +0 -1
- package/dist/esm/chunk-5PCNWXRN.mjs.map +0 -1
- package/dist/esm/chunk-5VD4MHB3.mjs.map +0 -1
- package/dist/esm/chunk-6EMN3BOV.mjs.map +0 -1
- package/dist/esm/chunk-6UZ3VI5Y.mjs.map +0 -1
- package/dist/esm/chunk-76OH2Z4Q.mjs +0 -2
- package/dist/esm/chunk-76OH2Z4Q.mjs.map +0 -1
- package/dist/esm/chunk-7VKFXX5Q.mjs.map +0 -1
- package/dist/esm/chunk-A42BPAD4.mjs.map +0 -1
- package/dist/esm/chunk-A63SMUOU.mjs +0 -2
- package/dist/esm/chunk-A63SMUOU.mjs.map +0 -1
- package/dist/esm/chunk-ADE6MVXC.mjs.map +0 -1
- package/dist/esm/chunk-AH44UPM4.mjs.map +0 -1
- package/dist/esm/chunk-APN6AV5Q.mjs.map +0 -1
- package/dist/esm/chunk-B5NYEWNM.mjs +0 -2
- package/dist/esm/chunk-B5NYEWNM.mjs.map +0 -1
- package/dist/esm/chunk-BA4RBST6.mjs +0 -2
- package/dist/esm/chunk-BA4RBST6.mjs.map +0 -1
- package/dist/esm/chunk-BCUSI3N6.mjs.map +0 -1
- package/dist/esm/chunk-BOYYQAB4.mjs.map +0 -1
- package/dist/esm/chunk-BSAHPS6E.mjs.map +0 -1
- package/dist/esm/chunk-BSUYPXRD.mjs +0 -2
- package/dist/esm/chunk-BSUYPXRD.mjs.map +0 -1
- package/dist/esm/chunk-BWNTSJOC.mjs +0 -2
- package/dist/esm/chunk-BWNTSJOC.mjs.map +0 -1
- package/dist/esm/chunk-CB6H4VMZ.mjs +0 -2
- package/dist/esm/chunk-CB6H4VMZ.mjs.map +0 -1
- package/dist/esm/chunk-CRA2MFJC.mjs.map +0 -1
- package/dist/esm/chunk-D3Q4BC3I.mjs.map +0 -1
- package/dist/esm/chunk-E4O26ZJB.mjs +0 -2
- package/dist/esm/chunk-E4O26ZJB.mjs.map +0 -1
- package/dist/esm/chunk-ELYS7CWV.mjs.map +0 -1
- package/dist/esm/chunk-EXP5STXZ.mjs.map +0 -1
- package/dist/esm/chunk-F3M2UQA4.mjs.map +0 -1
- package/dist/esm/chunk-F63E4CR7.mjs +0 -2
- package/dist/esm/chunk-F63E4CR7.mjs.map +0 -1
- package/dist/esm/chunk-F76N4MQO.mjs.map +0 -1
- package/dist/esm/chunk-FZ5EYP3D.mjs.map +0 -1
- package/dist/esm/chunk-G5MGSV7Y.mjs +0 -2
- package/dist/esm/chunk-G5MGSV7Y.mjs.map +0 -1
- package/dist/esm/chunk-G5XLMQ5E.mjs +0 -2
- package/dist/esm/chunk-G5XLMQ5E.mjs.map +0 -1
- package/dist/esm/chunk-GDO6Q2FI.mjs +0 -2
- package/dist/esm/chunk-GDO6Q2FI.mjs.map +0 -1
- package/dist/esm/chunk-GDUAFXIQ.mjs.map +0 -1
- package/dist/esm/chunk-GMBSQDPO.mjs.map +0 -1
- package/dist/esm/chunk-GWSDIX6C.mjs.map +0 -1
- package/dist/esm/chunk-H6YNXJNF.mjs.map +0 -1
- package/dist/esm/chunk-HAT5S2XX.mjs +0 -2
- package/dist/esm/chunk-HAT5S2XX.mjs.map +0 -1
- package/dist/esm/chunk-HHGJXVAE.mjs +0 -2
- package/dist/esm/chunk-HHGJXVAE.mjs.map +0 -1
- package/dist/esm/chunk-HKBBA653.mjs.map +0 -1
- package/dist/esm/chunk-HVMFZF6P.mjs.map +0 -1
- package/dist/esm/chunk-IR4SLC2M.mjs.map +0 -1
- package/dist/esm/chunk-J64ARI4E.mjs.map +0 -1
- package/dist/esm/chunk-JH6VLTMS.mjs.map +0 -1
- package/dist/esm/chunk-KEYAPEAX.mjs.map +0 -1
- package/dist/esm/chunk-KUOB4DDE.mjs.map +0 -1
- package/dist/esm/chunk-KUZ2YTJH.mjs.map +0 -1
- package/dist/esm/chunk-L2QXU6F4.mjs.map +0 -1
- package/dist/esm/chunk-LG7RJQ57.mjs.map +0 -1
- package/dist/esm/chunk-LNEZEYYE.mjs +0 -2
- package/dist/esm/chunk-LNEZEYYE.mjs.map +0 -1
- package/dist/esm/chunk-LR65XHSF.mjs.map +0 -1
- package/dist/esm/chunk-MAMPMCO7.mjs.map +0 -1
- package/dist/esm/chunk-MDJ66AA3.mjs +0 -2
- package/dist/esm/chunk-MDJ66AA3.mjs.map +0 -1
- package/dist/esm/chunk-MLDQ2TY2.mjs +0 -2
- package/dist/esm/chunk-MLDQ2TY2.mjs.map +0 -1
- package/dist/esm/chunk-MNVUSJEK.mjs.map +0 -1
- package/dist/esm/chunk-MQGW234H.mjs +0 -2
- package/dist/esm/chunk-MQGW234H.mjs.map +0 -1
- package/dist/esm/chunk-NMD45OTM.mjs.map +0 -1
- package/dist/esm/chunk-NWOMSL6K.mjs.map +0 -1
- package/dist/esm/chunk-O2BPA6TS.mjs.map +0 -1
- package/dist/esm/chunk-OHRL766V.mjs.map +0 -1
- package/dist/esm/chunk-OKAQO57B.mjs.map +0 -1
- package/dist/esm/chunk-OMV7445F.mjs.map +0 -1
- package/dist/esm/chunk-P2EIZ7WL.mjs.map +0 -1
- package/dist/esm/chunk-P3TAY5PP.mjs.map +0 -1
- package/dist/esm/chunk-P5V7OZNN.mjs.map +0 -1
- package/dist/esm/chunk-Q3TAEOH5.mjs.map +0 -1
- package/dist/esm/chunk-Q4XR6QOZ.mjs +0 -2
- package/dist/esm/chunk-QBSU3L5Q.mjs.map +0 -1
- package/dist/esm/chunk-QPB6EJVM.mjs.map +0 -1
- package/dist/esm/chunk-R76DHMGR.mjs.map +0 -1
- package/dist/esm/chunk-RXE6NNOL.mjs.map +0 -1
- package/dist/esm/chunk-S2KDCIZN.mjs.map +0 -1
- package/dist/esm/chunk-S2W4D6NZ.mjs.map +0 -1
- package/dist/esm/chunk-SDWE6WMM.mjs.map +0 -1
- package/dist/esm/chunk-SRPI2FFA.mjs.map +0 -1
- package/dist/esm/chunk-STUXKQVZ.mjs +0 -2
- package/dist/esm/chunk-STUXKQVZ.mjs.map +0 -1
- package/dist/esm/chunk-SUJLWCRN.mjs +0 -2
- package/dist/esm/chunk-SUJLWCRN.mjs.map +0 -1
- package/dist/esm/chunk-SWNFKKRE.mjs.map +0 -1
- package/dist/esm/chunk-TDGQGILY.mjs.map +0 -1
- package/dist/esm/chunk-TQWGQLM6.mjs.map +0 -1
- package/dist/esm/chunk-U6Z4FNB7.mjs.map +0 -1
- package/dist/esm/chunk-UAEODDZS.mjs +0 -2
- package/dist/esm/chunk-UAL27G6B.mjs.map +0 -1
- package/dist/esm/chunk-WJRZWAIS.mjs.map +0 -1
- package/dist/esm/chunk-WRRQ7L5K.mjs.map +0 -1
- package/dist/esm/chunk-X34JJPW5.mjs.map +0 -1
- package/dist/esm/chunk-XMW65WCQ.mjs +0 -2
- package/dist/esm/chunk-XMW65WCQ.mjs.map +0 -1
- package/dist/esm/chunk-Y2GWUE7C.mjs.map +0 -1
- package/dist/esm/chunk-Y3BATGHX.mjs +0 -2
- package/dist/esm/chunk-Y3BATGHX.mjs.map +0 -1
- package/dist/esm/chunk-YDZBU2DJ.mjs.map +0 -1
- package/dist/esm/chunk-YPHH6CAO.mjs +0 -2
- package/dist/esm/chunk-YPHH6CAO.mjs.map +0 -1
- package/dist/esm/chunk-YU3IYJRL.mjs.map +0 -1
- package/dist/esm/chunk-YUNDX5I7.mjs.map +0 -1
- package/dist/esm/publicKey-B3XRNhHO.d.mts +0 -113
- /package/dist/esm/{chunk-FVA2OPG4.mjs.map → chunk-KDMSOCZY.mjs.map} +0 -0
- /package/dist/esm/{chunk-Q4XR6QOZ.mjs.map → chunk-KIW54KWR.mjs.map} +0 -0
- /package/dist/esm/{chunk-ZROQH5YL.mjs.map → chunk-KSUZS6EL.mjs.map} +0 -0
|
@@ -42,9 +42,12 @@ const MAX_NUM_INPUT_SCALARS = 16;
|
|
|
42
42
|
const MAX_NUM_INPUT_BYTES = (MAX_NUM_INPUT_SCALARS - 1) * BYTES_PACKED_PER_SCALAR;
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
|
-
* Hashes a string to a field element via
|
|
45
|
+
* Hashes a string to a field element via Poseidon hashing.
|
|
46
|
+
* This function is useful for converting a string into a fixed-size hash that can be used in cryptographic applications.
|
|
46
47
|
*
|
|
47
|
-
* @
|
|
48
|
+
* @param str - The string to be hashed.
|
|
49
|
+
* @param maxSizeBytes - The maximum size in bytes for the resulting hash.
|
|
50
|
+
* @returns bigint - The result of the hash.
|
|
48
51
|
*/
|
|
49
52
|
export function hashStrToField(str: string, maxSizeBytes: number): bigint {
|
|
50
53
|
const textEncoder = new TextEncoder();
|
|
@@ -52,6 +55,14 @@ export function hashStrToField(str: string, maxSizeBytes: number): bigint {
|
|
|
52
55
|
return hashBytesWithLen(strBytes, maxSizeBytes);
|
|
53
56
|
}
|
|
54
57
|
|
|
58
|
+
/**
|
|
59
|
+
* Computes a Poseidon hash of the provided byte array, ensuring that the byte array does not exceed the specified maximum size.
|
|
60
|
+
* This function is useful for generating a hash from a byte array while enforcing size constraints.
|
|
61
|
+
*
|
|
62
|
+
* @param bytes - The byte array to be hashed.
|
|
63
|
+
* @param maxSizeBytes - The maximum allowed size for the byte array.
|
|
64
|
+
* @throws Error if the length of the inputted bytes exceeds the specified maximum size.
|
|
65
|
+
*/
|
|
55
66
|
function hashBytesWithLen(bytes: Uint8Array, maxSizeBytes: number): bigint {
|
|
56
67
|
if (bytes.length > maxSizeBytes) {
|
|
57
68
|
throw new Error(`Inputted bytes of length ${bytes} is longer than ${maxSizeBytes}`);
|
|
@@ -60,6 +71,14 @@ function hashBytesWithLen(bytes: Uint8Array, maxSizeBytes: number): bigint {
|
|
|
60
71
|
return poseidonHash(packed);
|
|
61
72
|
}
|
|
62
73
|
|
|
74
|
+
/**
|
|
75
|
+
* Pads the input byte array with zeros to a specified maximum size and then packs the bytes.
|
|
76
|
+
* This function ensures that the byte array does not exceed the specified maximum size, throwing an error if it does.
|
|
77
|
+
*
|
|
78
|
+
* @param bytes - The byte array to be padded and packed.
|
|
79
|
+
* @param maxSizeBytes - The maximum size in bytes that the input array can have.
|
|
80
|
+
* @throws Error if the input byte array exceeds the specified maximum size.
|
|
81
|
+
*/
|
|
63
82
|
function padAndPackBytesNoLen(bytes: Uint8Array, maxSizeBytes: number): bigint[] {
|
|
64
83
|
if (bytes.length > maxSizeBytes) {
|
|
65
84
|
throw new Error(`Input bytes of length ${bytes} is longer than ${maxSizeBytes}`);
|
|
@@ -68,6 +87,16 @@ function padAndPackBytesNoLen(bytes: Uint8Array, maxSizeBytes: number): bigint[]
|
|
|
68
87
|
return packBytes(paddedStrBytes);
|
|
69
88
|
}
|
|
70
89
|
|
|
90
|
+
/**
|
|
91
|
+
* Pads and packs the given byte array to a specified maximum size and appends its length.
|
|
92
|
+
* This function ensures that the byte array does not exceed the maximum size, throwing an error if it does.
|
|
93
|
+
* It is useful for preparing byte data for further processing or transmission by ensuring a consistent format.
|
|
94
|
+
*
|
|
95
|
+
* @param bytes - The byte array to be padded and packed.
|
|
96
|
+
* @param maxSizeBytes - The maximum allowed size for the byte array.
|
|
97
|
+
* @throws Error if the length of the input bytes exceeds the maximum size.
|
|
98
|
+
* @returns A new Uint8Array that contains the padded and packed bytes along with the length of the original byte array.
|
|
99
|
+
*/
|
|
71
100
|
export function padAndPackBytesWithLen(bytes: Uint8Array, maxSizeBytes: number): bigint[] {
|
|
72
101
|
if (bytes.length > maxSizeBytes) {
|
|
73
102
|
throw new Error(`Input bytes of length ${bytes} is longer than ${maxSizeBytes}`);
|
|
@@ -75,6 +104,11 @@ export function padAndPackBytesWithLen(bytes: Uint8Array, maxSizeBytes: number):
|
|
|
75
104
|
return padAndPackBytesNoLen(bytes, maxSizeBytes).concat([BigInt(bytes.length)]);
|
|
76
105
|
}
|
|
77
106
|
|
|
107
|
+
/**
|
|
108
|
+
* Packs a Uint8Array into an array of BigInts, ensuring the input does not exceed the maximum allowed bytes.
|
|
109
|
+
* @param bytes - The Uint8Array to be packed.
|
|
110
|
+
* @throws {Error} Throws an error if the input exceeds the maximum number of bytes allowed.
|
|
111
|
+
*/
|
|
78
112
|
function packBytes(bytes: Uint8Array): bigint[] {
|
|
79
113
|
if (bytes.length > MAX_NUM_INPUT_BYTES) {
|
|
80
114
|
throw new Error(`Can't pack more than ${MAX_NUM_INPUT_BYTES}. Was given ${bytes.length} bytes`);
|
|
@@ -82,6 +116,14 @@ function packBytes(bytes: Uint8Array): bigint[] {
|
|
|
82
116
|
return chunkUint8Array(bytes, BYTES_PACKED_PER_SCALAR).map((chunk) => bytesToBigIntLE(chunk));
|
|
83
117
|
}
|
|
84
118
|
|
|
119
|
+
/**
|
|
120
|
+
* Splits a Uint8Array into smaller chunks of the specified size.
|
|
121
|
+
* This function is useful for processing large arrays in manageable segments.
|
|
122
|
+
*
|
|
123
|
+
* @param array - The Uint8Array to be split into chunks.
|
|
124
|
+
* @param chunkSize - The size of each chunk.
|
|
125
|
+
* @returns An array of Uint8Array chunks.
|
|
126
|
+
*/
|
|
85
127
|
function chunkUint8Array(array: Uint8Array, chunkSize: number): Uint8Array[] {
|
|
86
128
|
const result: Uint8Array[] = [];
|
|
87
129
|
for (let i = 0; i < array.length; i += chunkSize) {
|
|
@@ -90,6 +132,13 @@ function chunkUint8Array(array: Uint8Array, chunkSize: number): Uint8Array[] {
|
|
|
90
132
|
return result;
|
|
91
133
|
}
|
|
92
134
|
|
|
135
|
+
/**
|
|
136
|
+
* Converts a little-endian byte array into a BigInt.
|
|
137
|
+
* This function is useful for interpreting byte data as a numerical value in a way that respects the little-endian format.
|
|
138
|
+
*
|
|
139
|
+
* @param bytes - The byte array to convert.
|
|
140
|
+
* @returns The resulting BigInt representation of the byte array.
|
|
141
|
+
*/
|
|
93
142
|
export function bytesToBigIntLE(bytes: Uint8Array): bigint {
|
|
94
143
|
let result = BigInt(0);
|
|
95
144
|
for (let i = bytes.length - 1; i >= 0; i -= 1) {
|
|
@@ -98,6 +147,15 @@ export function bytesToBigIntLE(bytes: Uint8Array): bigint {
|
|
|
98
147
|
return result;
|
|
99
148
|
}
|
|
100
149
|
|
|
150
|
+
/**
|
|
151
|
+
* Converts a bigint value into a little-endian byte array of a specified length.
|
|
152
|
+
* This function is useful for representing large integers in a byte format, which is often required for cryptographic operations
|
|
153
|
+
* or binary data manipulation.
|
|
154
|
+
*
|
|
155
|
+
* @param value - The number to convert into bytes.
|
|
156
|
+
* @param length - The desired length of the resulting byte array.
|
|
157
|
+
* @returns A Uint8Array containing the little-endian representation of the bigint value.
|
|
158
|
+
*/
|
|
101
159
|
export function bigIntToBytesLE(value: bigint | number, length: number): Uint8Array {
|
|
102
160
|
let val = BigInt(value);
|
|
103
161
|
const bytes = new Uint8Array(length);
|
|
@@ -108,6 +166,14 @@ export function bigIntToBytesLE(value: bigint | number, length: number): Uint8Ar
|
|
|
108
166
|
return bytes;
|
|
109
167
|
}
|
|
110
168
|
|
|
169
|
+
/**
|
|
170
|
+
* Pads the input Uint8Array with zeros to achieve the specified size.
|
|
171
|
+
* This function is useful for ensuring that a byte array meets a required length for further processing.
|
|
172
|
+
*
|
|
173
|
+
* @param inputArray - The Uint8Array to be padded.
|
|
174
|
+
* @param paddedSize - The desired size of the padded array, which must be greater than or equal to the input array size.
|
|
175
|
+
* @throws Error if paddedSize is less than the length of inputArray.
|
|
176
|
+
*/
|
|
111
177
|
function padUint8ArrayWithZeros(inputArray: Uint8Array, paddedSize: number): Uint8Array {
|
|
112
178
|
if (paddedSize < inputArray.length) {
|
|
113
179
|
throw new Error("Padded size must be greater than or equal to the input array size.");
|
|
@@ -128,11 +194,12 @@ function padUint8ArrayWithZeros(inputArray: Uint8Array, paddedSize: number): Uin
|
|
|
128
194
|
}
|
|
129
195
|
|
|
130
196
|
/**
|
|
131
|
-
* Hashes up to 16 scalar elements via the
|
|
132
|
-
*
|
|
197
|
+
* Hashes up to 16 scalar elements via the Poseidon hashing algorithm.
|
|
133
198
|
* Each element must be scalar fields of the BN254 elliptic curve group.
|
|
134
199
|
*
|
|
135
|
-
* @
|
|
200
|
+
* @param inputs - An array of elements to be hashed, which can be of type number, bigint, or string.
|
|
201
|
+
* @returns bigint - The result of the hash.
|
|
202
|
+
* @throws Error - Throws an error if the input length exceeds the maximum allowed.
|
|
136
203
|
*/
|
|
137
204
|
export function poseidonHash(inputs: (number | bigint | string)[]): bigint {
|
|
138
205
|
if (inputs.length > numInputsToPoseidonFunc.length) {
|
|
@@ -3,18 +3,22 @@ import { PublicKey } from "./publicKey";
|
|
|
3
3
|
import { Signature } from "./signature";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* Represents a private key used for signing messages and deriving the associated public key.
|
|
7
|
+
*
|
|
8
|
+
* @method sign - Signs the given message with the private key.
|
|
9
|
+
* @method publicKey - Derives the public key associated with the private key.
|
|
10
|
+
* @method toUint8Array - Retrieves the private key in bytes.
|
|
8
11
|
*/
|
|
9
12
|
export interface PrivateKey {
|
|
10
13
|
/**
|
|
11
|
-
* Sign the given message with the private key.
|
|
12
|
-
* @param message in HexInput format
|
|
14
|
+
* Sign the given message with the private key to create a signature.
|
|
15
|
+
* @param message - The message to be signed, provided in HexInput format.
|
|
16
|
+
* @returns A Signature object representing the signed message.
|
|
13
17
|
*/
|
|
14
18
|
sign(message: HexInput): Signature;
|
|
15
19
|
|
|
16
20
|
/**
|
|
17
|
-
* Derive the public key associated with the private key
|
|
21
|
+
* Derive the public key associated with the private key.
|
|
18
22
|
*/
|
|
19
23
|
publicKey(): PublicKey;
|
|
20
24
|
|
package/src/core/crypto/proof.ts
CHANGED
|
@@ -1,16 +1,7 @@
|
|
|
1
1
|
import { Serializable } from "../../bcs";
|
|
2
|
-
import { Hex } from "../hex";
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
|
-
* An abstract representation of a
|
|
6
|
-
*
|
|
4
|
+
* An abstract representation of a cryptographic proof associated with specific
|
|
5
|
+
* zero-knowledge proof schemes, such as Groth16 and PLONK.
|
|
7
6
|
*/
|
|
8
|
-
export abstract class Proof extends Serializable {
|
|
9
|
-
/**
|
|
10
|
-
* Get the proof as a hex string with a 0x prefix e.g. 0x123456...
|
|
11
|
-
*/
|
|
12
|
-
toString(): string {
|
|
13
|
-
const bytes = this.bcsToBytes();
|
|
14
|
-
return Hex.fromHexInput(bytes).toString();
|
|
15
|
-
}
|
|
16
|
-
}
|
|
7
|
+
export abstract class Proof extends Serializable {}
|
|
@@ -5,7 +5,10 @@ import { Hex } from "../hex";
|
|
|
5
5
|
import { Signature } from "./signature";
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Represents the arguments required to verify a digital signature.
|
|
9
|
+
*
|
|
10
|
+
* @param message - The original message that was signed.
|
|
11
|
+
* @param signature - The signature to be verified against the message.
|
|
9
12
|
*/
|
|
10
13
|
export interface VerifySignatureArgs {
|
|
11
14
|
message: HexInput;
|
|
@@ -13,9 +16,10 @@ export interface VerifySignatureArgs {
|
|
|
13
16
|
}
|
|
14
17
|
|
|
15
18
|
/**
|
|
16
|
-
*
|
|
19
|
+
* Represents an abstract public key.
|
|
17
20
|
*
|
|
18
|
-
*
|
|
21
|
+
* This class provides a common interface for verifying signatures associated with the public key.
|
|
22
|
+
* It allows for the retrieval of the raw public key bytes and the public key in a hexadecimal string format.
|
|
19
23
|
*/
|
|
20
24
|
export abstract class PublicKey extends Serializable {
|
|
21
25
|
/**
|
|
@@ -28,10 +32,14 @@ export abstract class PublicKey extends Serializable {
|
|
|
28
32
|
/**
|
|
29
33
|
* Get the raw public key bytes
|
|
30
34
|
*/
|
|
31
|
-
|
|
35
|
+
toUint8Array(): Uint8Array {
|
|
36
|
+
return this.bcsToBytes();
|
|
37
|
+
}
|
|
32
38
|
|
|
33
39
|
/**
|
|
34
|
-
* Get the public key as a hex string with a 0x prefix
|
|
40
|
+
* Get the public key as a hex string with a 0x prefix.
|
|
41
|
+
*
|
|
42
|
+
* @returns The public key in hex format.
|
|
35
43
|
*/
|
|
36
44
|
toString(): string {
|
|
37
45
|
const bytes = this.toUint8Array();
|
|
@@ -43,6 +51,8 @@ export abstract class PublicKey extends Serializable {
|
|
|
43
51
|
* An abstract representation of an account public key.
|
|
44
52
|
*
|
|
45
53
|
* Provides a common interface for deriving an authentication key.
|
|
54
|
+
*
|
|
55
|
+
* @abstract
|
|
46
56
|
*/
|
|
47
57
|
export abstract class AccountPublicKey extends PublicKey {
|
|
48
58
|
/**
|
|
@@ -14,9 +14,11 @@ import { Signature } from "./signature";
|
|
|
14
14
|
import { convertSigningMessage } from "./utils";
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
* Represents
|
|
17
|
+
* Represents a Secp256k1 ECDSA public key.
|
|
18
18
|
*
|
|
19
|
-
*
|
|
19
|
+
* @extends PublicKey
|
|
20
|
+
* @static
|
|
21
|
+
* @property LENGTH - The length of the Secp256k1 public key in bytes.
|
|
20
22
|
*/
|
|
21
23
|
export class Secp256k1PublicKey extends PublicKey {
|
|
22
24
|
// Secp256k1 ecdsa public keys contain a prefix indicating compression and two 32-byte coordinates.
|
|
@@ -26,9 +28,11 @@ export class Secp256k1PublicKey extends PublicKey {
|
|
|
26
28
|
private readonly key: Hex;
|
|
27
29
|
|
|
28
30
|
/**
|
|
29
|
-
* Create a new PublicKey instance from a
|
|
31
|
+
* Create a new PublicKey instance from a HexInput, which can be a string or Uint8Array.
|
|
32
|
+
* This constructor validates the length of the provided signature data.
|
|
30
33
|
*
|
|
31
|
-
* @param hexInput A HexInput (string or Uint8Array)
|
|
34
|
+
* @param hexInput - A HexInput (string or Uint8Array) representing the signature data.
|
|
35
|
+
* @throws Error if the length of the signature data is not equal to Secp256k1Signature.LENGTH.
|
|
32
36
|
*/
|
|
33
37
|
constructor(hexInput: HexInput) {
|
|
34
38
|
super();
|
|
@@ -42,9 +46,13 @@ export class Secp256k1PublicKey extends PublicKey {
|
|
|
42
46
|
|
|
43
47
|
// region PublicKey
|
|
44
48
|
/**
|
|
45
|
-
* Verifies a Secp256k1 signature against the public key
|
|
49
|
+
* Verifies a Secp256k1 signature against the public key.
|
|
50
|
+
*
|
|
51
|
+
* This function checks the validity of a signature for a given message, ensuring that the signature is canonical as a malleability check.
|
|
46
52
|
*
|
|
47
|
-
*
|
|
53
|
+
* @param args - The arguments for verifying the signature.
|
|
54
|
+
* @param args.message - The message that was signed.
|
|
55
|
+
* @param args.signature - The signature to verify against the public key.
|
|
48
56
|
*/
|
|
49
57
|
verifySignature(args: VerifySignatureArgs): boolean {
|
|
50
58
|
const { message, signature } = args;
|
|
@@ -55,6 +63,11 @@ export class Secp256k1PublicKey extends PublicKey {
|
|
|
55
63
|
return secp256k1.verify(signatureBytes, messageSha3Bytes, this.key.toUint8Array(), { lowS: true });
|
|
56
64
|
}
|
|
57
65
|
|
|
66
|
+
/**
|
|
67
|
+
* Get the data as a Uint8Array representation.
|
|
68
|
+
*
|
|
69
|
+
* @returns Uint8Array representation of the data.
|
|
70
|
+
*/
|
|
58
71
|
toUint8Array(): Uint8Array {
|
|
59
72
|
return this.key.toUint8Array();
|
|
60
73
|
}
|
|
@@ -63,10 +76,28 @@ export class Secp256k1PublicKey extends PublicKey {
|
|
|
63
76
|
|
|
64
77
|
// region Serializable
|
|
65
78
|
|
|
79
|
+
/**
|
|
80
|
+
* Serializes the data into a byte array using the provided serializer.
|
|
81
|
+
* This function is essential for converting data into a format suitable for transmission or storage.
|
|
82
|
+
*
|
|
83
|
+
* @param serializer - The serializer instance used to convert the data.
|
|
84
|
+
*/
|
|
66
85
|
serialize(serializer: Serializer): void {
|
|
67
86
|
serializer.serializeBytes(this.key.toUint8Array());
|
|
68
87
|
}
|
|
69
88
|
|
|
89
|
+
/**
|
|
90
|
+
* Deserializes a Secp256k1Signature from the provided deserializer.
|
|
91
|
+
* This function allows you to reconstruct a Secp256k1Signature object from its serialized byte representation.
|
|
92
|
+
*
|
|
93
|
+
* @param deserializer - The deserializer instance used to read the serialized data.
|
|
94
|
+
*/
|
|
95
|
+
// eslint-disable-next-line class-methods-use-this
|
|
96
|
+
deserialize(deserializer: Deserializer) {
|
|
97
|
+
const hex = deserializer.deserializeBytes();
|
|
98
|
+
return new Secp256k1Signature(hex);
|
|
99
|
+
}
|
|
100
|
+
|
|
70
101
|
static deserialize(deserializer: Deserializer): Secp256k1PublicKey {
|
|
71
102
|
const bytes = deserializer.deserializeBytes();
|
|
72
103
|
return new Secp256k1PublicKey(bytes);
|
|
@@ -75,20 +106,30 @@ export class Secp256k1PublicKey extends PublicKey {
|
|
|
75
106
|
// endregion
|
|
76
107
|
|
|
77
108
|
/**
|
|
109
|
+
* Determine if the provided public key is an instance of Secp256k1PublicKey.
|
|
110
|
+
*
|
|
78
111
|
* @deprecated use `instanceof Secp256k1PublicKey` instead
|
|
79
|
-
* @param publicKey
|
|
112
|
+
* @param publicKey - The public key to check.
|
|
80
113
|
*/
|
|
81
114
|
static isPublicKey(publicKey: PublicKey): publicKey is Secp256k1PublicKey {
|
|
82
115
|
return publicKey instanceof Secp256k1PublicKey;
|
|
83
116
|
}
|
|
84
117
|
|
|
118
|
+
/**
|
|
119
|
+
* Determines if the provided public key is a valid instance of a Secp256k1 public key.
|
|
120
|
+
* This function checks for the presence of a "key" property and validates the length of the key data.
|
|
121
|
+
*
|
|
122
|
+
* @param publicKey - The public key to validate.
|
|
123
|
+
* @returns A boolean indicating whether the public key is a valid Secp256k1 public key.
|
|
124
|
+
*/
|
|
85
125
|
static isInstance(publicKey: PublicKey): publicKey is Secp256k1PublicKey {
|
|
86
126
|
return "key" in publicKey && (publicKey.key as any)?.data?.length === Secp256k1PublicKey.LENGTH;
|
|
87
127
|
}
|
|
88
128
|
}
|
|
89
129
|
|
|
90
130
|
/**
|
|
91
|
-
*
|
|
131
|
+
* Represents a Secp256k1 ECDSA private key, providing functionality to create, sign messages,
|
|
132
|
+
* derive public keys, and serialize/deserialize the key.
|
|
92
133
|
*/
|
|
93
134
|
export class Secp256k1PrivateKey extends Serializable implements PrivateKey {
|
|
94
135
|
/**
|
|
@@ -123,7 +164,7 @@ export class Secp256k1PrivateKey extends Serializable implements PrivateKey {
|
|
|
123
164
|
/**
|
|
124
165
|
* Generate a new random private key.
|
|
125
166
|
*
|
|
126
|
-
* @returns Secp256k1PrivateKey
|
|
167
|
+
* @returns Secp256k1PrivateKey - A newly generated Secp256k1 private key.
|
|
127
168
|
*/
|
|
128
169
|
static generate(): Secp256k1PrivateKey {
|
|
129
170
|
const hexInput = secp256k1.utils.randomPrivateKey();
|
|
@@ -131,12 +172,14 @@ export class Secp256k1PrivateKey extends Serializable implements PrivateKey {
|
|
|
131
172
|
}
|
|
132
173
|
|
|
133
174
|
/**
|
|
134
|
-
* Derives a private key from a mnemonic seed phrase.
|
|
175
|
+
* Derives a private key from a mnemonic seed phrase using a specified BIP44 path.
|
|
135
176
|
*
|
|
136
|
-
* @param path
|
|
137
|
-
* @param mnemonics
|
|
177
|
+
* @param path - The BIP44 path to derive the key from.
|
|
178
|
+
* @param mnemonics - The mnemonic seed phrase used for key generation.
|
|
138
179
|
*
|
|
139
|
-
* @returns The generated key
|
|
180
|
+
* @returns The generated private key.
|
|
181
|
+
*
|
|
182
|
+
* @throws Error if the provided path is not a valid BIP44 path.
|
|
140
183
|
*/
|
|
141
184
|
static fromDerivationPath(path: string, mnemonics: string): Secp256k1PrivateKey {
|
|
142
185
|
if (!isValidBIP44Path(path)) {
|
|
@@ -146,13 +189,13 @@ export class Secp256k1PrivateKey extends Serializable implements PrivateKey {
|
|
|
146
189
|
}
|
|
147
190
|
|
|
148
191
|
/**
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
* @param path the BIP44 path
|
|
153
|
-
* @param seed the seed phrase created by the mnemonics
|
|
192
|
+
* Derives a private key from a specified BIP44 path using a given seed.
|
|
193
|
+
* This function is essential for generating keys that follow the hierarchical deterministic (HD) wallet structure.
|
|
154
194
|
*
|
|
155
|
-
* @
|
|
195
|
+
* @param path - The BIP44 path used for key derivation.
|
|
196
|
+
* @param seed - The seed phrase created by the mnemonics, represented as a Uint8Array.
|
|
197
|
+
* @returns The generated private key as an instance of Secp256k1PrivateKey.
|
|
198
|
+
* @throws Error if the derived private key is invalid.
|
|
156
199
|
*/
|
|
157
200
|
private static fromDerivationPathInner(path: string, seed: Uint8Array): Secp256k1PrivateKey {
|
|
158
201
|
const { privateKey } = HDKey.fromMasterSeed(seed).derive(path);
|
|
@@ -170,11 +213,10 @@ export class Secp256k1PrivateKey extends Serializable implements PrivateKey {
|
|
|
170
213
|
|
|
171
214
|
/**
|
|
172
215
|
* Sign the given message with the private key.
|
|
216
|
+
* This function generates a cryptographic signature for the provided message, ensuring the signature is canonical and non-malleable.
|
|
173
217
|
*
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
* @param message a message as a string or Uint8Array
|
|
177
|
-
* @returns Signature
|
|
218
|
+
* @param message - A message in HexInput format to be signed.
|
|
219
|
+
* @returns Signature - The generated signature for the provided message.
|
|
178
220
|
*/
|
|
179
221
|
sign(message: HexInput): Secp256k1Signature {
|
|
180
222
|
const messageToSign = convertSigningMessage(message);
|
|
@@ -187,7 +229,7 @@ export class Secp256k1PrivateKey extends Serializable implements PrivateKey {
|
|
|
187
229
|
/**
|
|
188
230
|
* Derive the Secp256k1PublicKey from this private key.
|
|
189
231
|
*
|
|
190
|
-
* @returns Secp256k1PublicKey
|
|
232
|
+
* @returns Secp256k1PublicKey The derived public key.
|
|
191
233
|
*/
|
|
192
234
|
publicKey(): Secp256k1PublicKey {
|
|
193
235
|
const bytes = secp256k1.getPublicKey(this.key.toUint8Array(), false);
|
|
@@ -204,7 +246,7 @@ export class Secp256k1PrivateKey extends Serializable implements PrivateKey {
|
|
|
204
246
|
}
|
|
205
247
|
|
|
206
248
|
/**
|
|
207
|
-
* Get the private key as a
|
|
249
|
+
* Get the private key as a string representation.
|
|
208
250
|
*
|
|
209
251
|
* @returns string representation of the private key
|
|
210
252
|
*/
|
|
@@ -228,6 +270,10 @@ export class Secp256k1PrivateKey extends Serializable implements PrivateKey {
|
|
|
228
270
|
// endregion
|
|
229
271
|
|
|
230
272
|
/**
|
|
273
|
+
* Determines if the provided private key is an instance of Secp256k1PrivateKey.
|
|
274
|
+
*
|
|
275
|
+
* @param privateKey - The private key to be checked.
|
|
276
|
+
*
|
|
231
277
|
* @deprecated use `instanceof Secp256k1PrivateKey` instead
|
|
232
278
|
*/
|
|
233
279
|
static isPrivateKey(privateKey: PrivateKey): privateKey is Secp256k1PrivateKey {
|
|
@@ -236,7 +282,11 @@ export class Secp256k1PrivateKey extends Serializable implements PrivateKey {
|
|
|
236
282
|
}
|
|
237
283
|
|
|
238
284
|
/**
|
|
239
|
-
*
|
|
285
|
+
* Represents a signature of a message signed using a Secp256k1 ECDSA private key.
|
|
286
|
+
*
|
|
287
|
+
* @static
|
|
288
|
+
* @readonly
|
|
289
|
+
* @length The length of Secp256k1 ECDSA signatures, which is 64 bytes.
|
|
240
290
|
*/
|
|
241
291
|
export class Secp256k1Signature extends Signature {
|
|
242
292
|
/**
|
|
@@ -3,19 +3,22 @@ import { Hex } from "../hex";
|
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* An abstract representation of a crypto signature,
|
|
6
|
-
* associated
|
|
6
|
+
* associated with a specific signature scheme, e.g., Ed25519 or Secp256k1.
|
|
7
7
|
*
|
|
8
|
-
* This
|
|
9
|
-
* and can be verified against a CryptoPublicKey.
|
|
8
|
+
* This class represents the product of signing a message directly from a
|
|
9
|
+
* PrivateKey and can be verified against a CryptoPublicKey.
|
|
10
10
|
*/
|
|
11
11
|
export abstract class Signature extends Serializable {
|
|
12
12
|
/**
|
|
13
13
|
* Get the raw signature bytes
|
|
14
14
|
*/
|
|
15
|
-
|
|
15
|
+
toUint8Array(): Uint8Array {
|
|
16
|
+
return this.bcsToBytes();
|
|
17
|
+
}
|
|
16
18
|
|
|
17
19
|
/**
|
|
18
20
|
* Get the signature as a hex string with a 0x prefix e.g. 0x123456...
|
|
21
|
+
* @returns The hex string representation of the signature.
|
|
19
22
|
*/
|
|
20
23
|
toString(): string {
|
|
21
24
|
const bytes = this.toUint8Array();
|
|
@@ -29,6 +29,13 @@ export class AnyPublicKey extends AccountPublicKey {
|
|
|
29
29
|
|
|
30
30
|
// region Constructors
|
|
31
31
|
|
|
32
|
+
/**
|
|
33
|
+
* Creates an instance of the signature class based on the provided signature type.
|
|
34
|
+
* This allows for the handling of different signature variants such as Ed25519, Secp256k1, and Keyless.
|
|
35
|
+
*
|
|
36
|
+
* @param publicKey - The publicKey object which determines the variant to be used.
|
|
37
|
+
* @throws Error if the provided signature type is unsupported.
|
|
38
|
+
*/
|
|
32
39
|
constructor(publicKey: PublicKey) {
|
|
33
40
|
super();
|
|
34
41
|
this.publicKey = publicKey;
|
|
@@ -49,6 +56,15 @@ export class AnyPublicKey extends AccountPublicKey {
|
|
|
49
56
|
|
|
50
57
|
// region AccountPublicKey
|
|
51
58
|
|
|
59
|
+
/**
|
|
60
|
+
* Verifies the provided signature against the given message.
|
|
61
|
+
* This function helps ensure the integrity and authenticity of the message by confirming that the signature is valid.
|
|
62
|
+
*
|
|
63
|
+
* @param args - The arguments for signature verification.
|
|
64
|
+
* @param args.message - The message that was signed.
|
|
65
|
+
* @param args.signature - The signature to verify, which must be an instance of AnySignature.
|
|
66
|
+
* @returns A boolean indicating whether the signature is valid for the given message.
|
|
67
|
+
*/
|
|
52
68
|
verifySignature(args: VerifySignatureArgs): boolean {
|
|
53
69
|
const { message, signature } = args;
|
|
54
70
|
if (!AnySignature.isInstance(signature)) {
|
|
@@ -61,6 +77,12 @@ export class AnyPublicKey extends AccountPublicKey {
|
|
|
61
77
|
});
|
|
62
78
|
}
|
|
63
79
|
|
|
80
|
+
/**
|
|
81
|
+
* Generates an authentication key from the current instance's byte representation.
|
|
82
|
+
* This function is essential for creating a unique identifier for authentication purposes.
|
|
83
|
+
*
|
|
84
|
+
* @returns {AuthenticationKey} The generated authentication key.
|
|
85
|
+
*/
|
|
64
86
|
authKey(): AuthenticationKey {
|
|
65
87
|
return AuthenticationKey.fromSchemeAndBytes({
|
|
66
88
|
scheme: AuthenticationKeyScheme.SingleKey,
|
|
@@ -68,6 +90,14 @@ export class AnyPublicKey extends AccountPublicKey {
|
|
|
68
90
|
});
|
|
69
91
|
}
|
|
70
92
|
|
|
93
|
+
/**
|
|
94
|
+
* Get the signature in bytes (Uint8Array).
|
|
95
|
+
*
|
|
96
|
+
* This function is a warning that it will soon return the underlying signature bytes directly.
|
|
97
|
+
* Use AnySignature.bcsToBytes() instead.
|
|
98
|
+
*
|
|
99
|
+
* @returns Uint8Array representation of the signature.
|
|
100
|
+
*/
|
|
71
101
|
toUint8Array() {
|
|
72
102
|
return this.bcsToBytes();
|
|
73
103
|
}
|
|
@@ -76,11 +106,23 @@ export class AnyPublicKey extends AccountPublicKey {
|
|
|
76
106
|
|
|
77
107
|
// region Serializable
|
|
78
108
|
|
|
109
|
+
/**
|
|
110
|
+
* Serializes the current object using the provided serializer.
|
|
111
|
+
* This function helps in converting the object into a format suitable for transmission or storage.
|
|
112
|
+
*
|
|
113
|
+
* @param serializer - The serializer instance used to perform the serialization.
|
|
114
|
+
*/
|
|
79
115
|
serialize(serializer: Serializer): void {
|
|
80
116
|
serializer.serializeU32AsUleb128(this.variant);
|
|
81
117
|
this.publicKey.serialize(serializer);
|
|
82
118
|
}
|
|
83
119
|
|
|
120
|
+
/**
|
|
121
|
+
* Deserializes an AnySignature from the provided deserializer.
|
|
122
|
+
* This function helps in reconstructing the AnySignature object from its serialized form, allowing for further processing or validation.
|
|
123
|
+
*
|
|
124
|
+
* @param deserializer - The deserializer instance used to read the serialized data.
|
|
125
|
+
*/
|
|
84
126
|
static deserialize(deserializer: Deserializer): AnyPublicKey {
|
|
85
127
|
const variantIndex = deserializer.deserializeUleb128AsU32();
|
|
86
128
|
let publicKey: PublicKey;
|
|
@@ -102,17 +144,21 @@ export class AnyPublicKey extends AccountPublicKey {
|
|
|
102
144
|
}
|
|
103
145
|
return new AnyPublicKey(publicKey);
|
|
104
146
|
}
|
|
105
|
-
|
|
106
147
|
// endregion
|
|
107
148
|
|
|
108
149
|
/**
|
|
109
|
-
*
|
|
150
|
+
* Determines if the provided public key is an instance of AnyPublicKey.
|
|
151
|
+
*
|
|
152
|
+
* @param publicKey - The public key to check.
|
|
153
|
+
* @deprecated Use `instanceof AnyPublicKey` instead.
|
|
110
154
|
*/
|
|
111
155
|
static isPublicKey(publicKey: AccountPublicKey): publicKey is AnyPublicKey {
|
|
112
156
|
return publicKey instanceof AnyPublicKey;
|
|
113
157
|
}
|
|
114
158
|
|
|
115
159
|
/**
|
|
160
|
+
* Determines if the current public key is an instance of Ed25519PublicKey.
|
|
161
|
+
*
|
|
116
162
|
* @deprecated use `publicKey instanceof Ed25519PublicKey` instead.
|
|
117
163
|
*/
|
|
118
164
|
isEd25519(): boolean {
|
|
@@ -120,21 +166,32 @@ export class AnyPublicKey extends AccountPublicKey {
|
|
|
120
166
|
}
|
|
121
167
|
|
|
122
168
|
/**
|
|
169
|
+
* Checks if the public key is an instance of Secp256k1PublicKey.
|
|
170
|
+
*
|
|
123
171
|
* @deprecated use `publicKey instanceof Secp256k1PublicKey` instead.
|
|
124
172
|
*/
|
|
125
173
|
isSecp256k1PublicKey(): boolean {
|
|
126
174
|
return this.publicKey instanceof Secp256k1PublicKey;
|
|
127
175
|
}
|
|
128
176
|
|
|
177
|
+
/**
|
|
178
|
+
* Determines if the provided publicKey is an instance of a valid PublicKey object.
|
|
179
|
+
*
|
|
180
|
+
* @param publicKey - The publicKey to be checked for validity.
|
|
181
|
+
* @param publicKey.publicKey - The actual publicKey object that needs to be validated.
|
|
182
|
+
* @returns True if the signature is a valid instance; otherwise, false.
|
|
183
|
+
*/
|
|
129
184
|
static isInstance(publicKey: PublicKey): publicKey is AnyPublicKey {
|
|
130
185
|
return "publicKey" in publicKey && "variant" in publicKey;
|
|
131
186
|
}
|
|
132
187
|
}
|
|
133
188
|
|
|
134
189
|
/**
|
|
135
|
-
*
|
|
136
|
-
* This
|
|
137
|
-
*
|
|
190
|
+
* Represents a signature that utilizes the SingleKey authentication scheme.
|
|
191
|
+
* This class is designed to encapsulate various types of signatures, which can
|
|
192
|
+
* only be generated by a `SingleKeySigner` due to the shared authentication mechanism.
|
|
193
|
+
*
|
|
194
|
+
* @extends Signature
|
|
138
195
|
*/
|
|
139
196
|
export class AnySignature extends Signature {
|
|
140
197
|
public readonly signature: Signature;
|