@aptos-labs/ts-sdk 1.29.1 → 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 +5916 -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 +5 -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 +37 -3
- 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 +445 -160
- 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 +50 -13
- package/dist/esm/api/coin.mjs +1 -1
- package/dist/esm/api/digitalAsset.d.mts +708 -298
- package/dist/esm/api/digitalAsset.mjs +1 -1
- package/dist/esm/api/event.d.mts +128 -25
- 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 +151 -48
- package/dist/esm/api/fungibleAsset.mjs +1 -1
- package/dist/esm/api/general.d.mts +169 -53
- 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 +81 -10
- package/dist/esm/api/keyless.mjs +1 -1
- package/dist/esm/api/object.d.mts +49 -5
- package/dist/esm/api/object.mjs +1 -1
- package/dist/esm/api/staking.d.mts +84 -15
- package/dist/esm/api/staking.mjs +1 -1
- package/dist/esm/api/table.d.mts +117 -37
- 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-WWZ3METZ.mjs → chunk-2I56E4T2.mjs} +2 -2
- package/dist/esm/chunk-2I56E4T2.mjs.map +1 -0
- package/dist/esm/{chunk-HSPBA2TZ.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-RNTXQYJQ.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-CPPBQDHB.mjs → chunk-5XXIIWG7.mjs} +2 -2
- package/dist/esm/chunk-5XXIIWG7.mjs.map +1 -0
- package/dist/esm/{chunk-K2O24YLZ.mjs → chunk-5ZBHIUWG.mjs} +2 -2
- 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-5655UVIK.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-E37YRKWK.mjs → chunk-AGBA3Y7A.mjs} +2 -2
- package/dist/esm/chunk-AGBA3Y7A.mjs.map +1 -0
- package/dist/esm/{chunk-ECWOLU5T.mjs → chunk-BQXVHY7J.mjs} +2 -2
- package/dist/esm/chunk-BQXVHY7J.mjs.map +1 -0
- package/dist/esm/{chunk-PUZ25PTD.mjs → chunk-CRL4WGOH.mjs} +2 -2
- package/dist/esm/chunk-CRL4WGOH.mjs.map +1 -0
- package/dist/esm/{chunk-SWHLSREF.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-MO4IZXLK.mjs → chunk-DCUVV3VY.mjs} +2 -2
- package/dist/esm/chunk-DCUVV3VY.mjs.map +1 -0
- package/dist/esm/{chunk-AFOPNDOJ.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-QCUFTD7K.mjs → chunk-EF2PUPUH.mjs} +2 -2
- package/dist/esm/chunk-EF2PUPUH.mjs.map +1 -0
- package/dist/esm/{chunk-XXHW3ZT3.mjs → chunk-EKZQ3EYX.mjs} +2 -2
- package/dist/esm/chunk-EKZQ3EYX.mjs.map +1 -0
- package/dist/esm/{chunk-XH7YKEYR.mjs → chunk-EN2HDNFE.mjs} +2 -2
- package/dist/esm/chunk-EN2HDNFE.mjs.map +1 -0
- package/dist/esm/{chunk-TL7DR54X.mjs → chunk-FO4F3OJJ.mjs} +2 -2
- package/dist/esm/chunk-FO4F3OJJ.mjs.map +1 -0
- package/dist/esm/{chunk-7ZLBJUVZ.mjs → chunk-FPF4KZ5M.mjs} +2 -2
- package/dist/esm/chunk-FPF4KZ5M.mjs.map +1 -0
- package/dist/esm/{chunk-Y7F2V3R6.mjs → chunk-FY7TSOUU.mjs} +2 -2
- package/dist/esm/chunk-FY7TSOUU.mjs.map +1 -0
- package/dist/esm/{chunk-XK3JFCP3.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-BRFHAO2Y.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-FRGXKOU5.mjs → chunk-HCV3NGLS.mjs} +2 -2
- package/dist/esm/chunk-HCV3NGLS.mjs.map +1 -0
- package/dist/esm/{chunk-GFGX3QDP.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-TMW2HIXC.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-2TQIU7CG.mjs → chunk-JDYASF3E.mjs} +2 -2
- package/dist/esm/chunk-JDYASF3E.mjs.map +1 -0
- package/dist/esm/{chunk-MS4MRLGA.mjs → chunk-JGNMNCQB.mjs} +2 -2
- package/dist/esm/chunk-JGNMNCQB.mjs.map +1 -0
- package/dist/esm/{chunk-TS3PYRAT.mjs → chunk-JNHFQTFC.mjs} +2 -2
- package/dist/esm/chunk-JNHFQTFC.mjs.map +1 -0
- package/dist/esm/{chunk-CVDR5SJR.mjs → chunk-JY3JJ55D.mjs} +2 -2
- package/dist/esm/chunk-JY3JJ55D.mjs.map +1 -0
- package/dist/esm/{chunk-KYSDF3CA.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-DF4WKSTK.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-QPP6BX53.mjs → chunk-KM6UXNC7.mjs} +2 -2
- package/dist/esm/chunk-KM6UXNC7.mjs.map +1 -0
- package/dist/esm/{chunk-PKXEB7XP.mjs → chunk-KRVLR3L4.mjs} +2 -2
- package/dist/esm/chunk-KRVLR3L4.mjs.map +1 -0
- package/dist/esm/{chunk-B6M7QBUO.mjs → chunk-KSKQVOBA.mjs} +2 -2
- package/dist/esm/chunk-KSKQVOBA.mjs.map +1 -0
- package/dist/esm/{chunk-G7MWTE2J.mjs → chunk-KSUZS6EL.mjs} +2 -2
- package/dist/esm/{chunk-YHAPZP5A.mjs → chunk-L5I7F3NZ.mjs} +2 -2
- package/dist/esm/chunk-L5I7F3NZ.mjs.map +1 -0
- package/dist/esm/{chunk-XONG5JZ4.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-6RZZIOGH.mjs → chunk-LZS7BQ2B.mjs} +2 -2
- package/dist/esm/chunk-LZS7BQ2B.mjs.map +1 -0
- package/dist/esm/{chunk-3YKAGVHZ.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-QIW56MUH.mjs → chunk-NODYW7DM.mjs} +2 -2
- package/dist/esm/chunk-NODYW7DM.mjs.map +1 -0
- package/dist/esm/{chunk-25TIHDS6.mjs → chunk-NV6DHDM3.mjs} +2 -2
- package/dist/esm/chunk-NV6DHDM3.mjs.map +1 -0
- package/dist/esm/{chunk-EV2USF7B.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-N5JNKD5F.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-25NSCK4Q.mjs → chunk-OV5UQ75K.mjs} +2 -2
- package/dist/esm/chunk-OV5UQ75K.mjs.map +1 -0
- package/dist/esm/{chunk-YJCZU6PR.mjs → chunk-OZN3OOJV.mjs} +2 -2
- package/dist/esm/chunk-OZN3OOJV.mjs.map +1 -0
- package/dist/esm/{chunk-WP7WF54Q.mjs → chunk-PCLU4KLY.mjs} +2 -2
- package/dist/esm/chunk-PCLU4KLY.mjs.map +1 -0
- package/dist/esm/{chunk-SR24OGHJ.mjs → chunk-PGZWRY7A.mjs} +2 -2
- package/dist/esm/chunk-PGZWRY7A.mjs.map +1 -0
- package/dist/esm/{chunk-SAPUZZEU.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-OY2IX7HW.mjs → chunk-QBP4XJT5.mjs} +2 -2
- package/dist/esm/chunk-QBP4XJT5.mjs.map +1 -0
- package/dist/esm/{chunk-ZGO2SK6F.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-IYQISVDX.mjs → chunk-QRTZYRH2.mjs} +2 -2
- package/dist/esm/chunk-QRTZYRH2.mjs.map +1 -0
- package/dist/esm/{chunk-NH2S6SB2.mjs → chunk-R3Y6WH2U.mjs} +2 -2
- package/dist/esm/chunk-R3Y6WH2U.mjs.map +1 -0
- package/dist/esm/{chunk-X4KEZTUQ.mjs → chunk-RAXP3STS.mjs} +2 -2
- package/dist/esm/chunk-RAXP3STS.mjs.map +1 -0
- package/dist/esm/{chunk-TVFIUUVY.mjs → chunk-RNAKZVRN.mjs} +2 -2
- package/dist/esm/chunk-RNAKZVRN.mjs.map +1 -0
- package/dist/esm/{chunk-NNRAQP36.mjs → chunk-RUDS7RSB.mjs} +2 -2
- package/dist/esm/chunk-RUDS7RSB.mjs.map +1 -0
- package/dist/esm/{chunk-U67PFBTL.mjs → chunk-S3FVA55H.mjs} +2 -2
- package/dist/esm/chunk-S3FVA55H.mjs.map +1 -0
- package/dist/esm/{chunk-LDFTE4MM.mjs → chunk-TIZL5YVP.mjs} +2 -2
- package/dist/esm/chunk-TIZL5YVP.mjs.map +1 -0
- package/dist/esm/{chunk-EWZ2M5BW.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-555I4YHP.mjs.map → chunk-UI3AKMZX.mjs.map} +1 -1
- package/dist/esm/{chunk-B2CXRZL5.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-KXBIA4KR.mjs → chunk-VQTEGTUQ.mjs} +2 -2
- package/dist/esm/chunk-VQTEGTUQ.mjs.map +1 -0
- package/dist/esm/{chunk-BD6BJETG.mjs → chunk-WIXNX7HY.mjs} +2 -2
- package/dist/esm/chunk-WIXNX7HY.mjs.map +1 -0
- package/dist/esm/{chunk-7V6DEA7G.mjs → chunk-WOOH5MMX.mjs} +2 -2
- package/dist/esm/chunk-WOOH5MMX.mjs.map +1 -0
- package/dist/esm/{chunk-DAJOX4PL.mjs → chunk-WSVOJSAC.mjs} +2 -2
- package/dist/esm/chunk-WSVOJSAC.mjs.map +1 -0
- package/dist/esm/{chunk-L5NY7TMI.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-DAXKRXRK.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-STGYDB5E.mjs → chunk-Z36WHOZV.mjs} +2 -2
- package/dist/esm/chunk-Z36WHOZV.mjs.map +1 -0
- package/dist/esm/{chunk-LXLISEQ4.mjs → chunk-ZINOJTLU.mjs} +2 -2
- package/dist/esm/chunk-ZINOJTLU.mjs.map +1 -0
- package/dist/esm/{chunk-46D5QX3G.mjs → chunk-ZS3EWM5A.mjs} +2 -2
- package/dist/esm/chunk-ZS3EWM5A.mjs.map +1 -0
- package/dist/esm/{chunk-QLN2URFX.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 +3 -2
- package/src/account/AbstractKeylessAccount.ts +4 -3
- 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 +1 -1
- package/src/account/KeylessAccount.ts +37 -1
- 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 +22 -7
- 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 +153 -40
- 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-25NSCK4Q.mjs.map +0 -1
- package/dist/esm/chunk-25TIHDS6.mjs.map +0 -1
- package/dist/esm/chunk-2TQIU7CG.mjs.map +0 -1
- package/dist/esm/chunk-3MCYLML2.mjs +0 -2
- package/dist/esm/chunk-3MCYLML2.mjs.map +0 -1
- package/dist/esm/chunk-3YKAGVHZ.mjs.map +0 -1
- package/dist/esm/chunk-44GYWUSH.mjs.map +0 -1
- package/dist/esm/chunk-46D5QX3G.mjs.map +0 -1
- package/dist/esm/chunk-555I4YHP.mjs +0 -2
- package/dist/esm/chunk-5655UVIK.mjs.map +0 -1
- package/dist/esm/chunk-6EMN3BOV.mjs.map +0 -1
- package/dist/esm/chunk-6QGVRNV6.mjs +0 -2
- package/dist/esm/chunk-6QGVRNV6.mjs.map +0 -1
- package/dist/esm/chunk-6RZZIOGH.mjs.map +0 -1
- package/dist/esm/chunk-7V6DEA7G.mjs.map +0 -1
- package/dist/esm/chunk-7ZLBJUVZ.mjs.map +0 -1
- package/dist/esm/chunk-AFOPNDOJ.mjs.map +0 -1
- package/dist/esm/chunk-AH44UPM4.mjs.map +0 -1
- package/dist/esm/chunk-B2CXRZL5.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-B6M7QBUO.mjs.map +0 -1
- package/dist/esm/chunk-BCUSI3N6.mjs.map +0 -1
- package/dist/esm/chunk-BD6BJETG.mjs.map +0 -1
- package/dist/esm/chunk-BF4ZE37Q.mjs +0 -2
- package/dist/esm/chunk-BF4ZE37Q.mjs.map +0 -1
- package/dist/esm/chunk-BKEJMQQ6.mjs +0 -2
- package/dist/esm/chunk-BKEJMQQ6.mjs.map +0 -1
- package/dist/esm/chunk-BRFHAO2Y.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-CCMHWJ3Q.mjs +0 -2
- package/dist/esm/chunk-CCMHWJ3Q.mjs.map +0 -1
- package/dist/esm/chunk-CPPBQDHB.mjs.map +0 -1
- package/dist/esm/chunk-CVDR5SJR.mjs.map +0 -1
- package/dist/esm/chunk-DAJOX4PL.mjs.map +0 -1
- package/dist/esm/chunk-DAXKRXRK.mjs.map +0 -1
- package/dist/esm/chunk-DF4WKSTK.mjs.map +0 -1
- package/dist/esm/chunk-E37YRKWK.mjs.map +0 -1
- package/dist/esm/chunk-ECWOLU5T.mjs.map +0 -1
- package/dist/esm/chunk-EV2USF7B.mjs.map +0 -1
- package/dist/esm/chunk-EWZ2M5BW.mjs.map +0 -1
- package/dist/esm/chunk-EXP5STXZ.mjs.map +0 -1
- package/dist/esm/chunk-FRGXKOU5.mjs.map +0 -1
- package/dist/esm/chunk-GFGX3QDP.mjs.map +0 -1
- package/dist/esm/chunk-GGR3P2TG.mjs +0 -2
- package/dist/esm/chunk-GGR3P2TG.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-HPZ2S4FE.mjs +0 -2
- package/dist/esm/chunk-HPZ2S4FE.mjs.map +0 -1
- package/dist/esm/chunk-HSPBA2TZ.mjs.map +0 -1
- package/dist/esm/chunk-IMGLHDIA.mjs +0 -2
- package/dist/esm/chunk-IMGLHDIA.mjs.map +0 -1
- package/dist/esm/chunk-IYQISVDX.mjs.map +0 -1
- package/dist/esm/chunk-K2O24YLZ.mjs.map +0 -1
- package/dist/esm/chunk-KA6FZNWP.mjs +0 -2
- package/dist/esm/chunk-KA6FZNWP.mjs.map +0 -1
- package/dist/esm/chunk-KEYAPEAX.mjs.map +0 -1
- package/dist/esm/chunk-KXBIA4KR.mjs.map +0 -1
- package/dist/esm/chunk-KYSDF3CA.mjs.map +0 -1
- package/dist/esm/chunk-L5NY7TMI.mjs.map +0 -1
- package/dist/esm/chunk-LDFTE4MM.mjs.map +0 -1
- package/dist/esm/chunk-LG3DAAPD.mjs +0 -2
- package/dist/esm/chunk-LG3DAAPD.mjs.map +0 -1
- package/dist/esm/chunk-LG7RJQ57.mjs.map +0 -1
- package/dist/esm/chunk-LGD5KU56.mjs +0 -2
- package/dist/esm/chunk-LGD5KU56.mjs.map +0 -1
- package/dist/esm/chunk-LR65XHSF.mjs.map +0 -1
- package/dist/esm/chunk-LXLISEQ4.mjs.map +0 -1
- package/dist/esm/chunk-M2QV232A.mjs +0 -2
- package/dist/esm/chunk-M2QV232A.mjs.map +0 -1
- package/dist/esm/chunk-MEWFJJJN.mjs +0 -2
- package/dist/esm/chunk-MEWFJJJN.mjs.map +0 -1
- package/dist/esm/chunk-MO4IZXLK.mjs.map +0 -1
- package/dist/esm/chunk-MS4MRLGA.mjs.map +0 -1
- package/dist/esm/chunk-N5JNKD5F.mjs.map +0 -1
- package/dist/esm/chunk-NH2S6SB2.mjs.map +0 -1
- package/dist/esm/chunk-NMD45OTM.mjs.map +0 -1
- package/dist/esm/chunk-NNRAQP36.mjs.map +0 -1
- package/dist/esm/chunk-OY2IX7HW.mjs.map +0 -1
- package/dist/esm/chunk-PKXEB7XP.mjs.map +0 -1
- package/dist/esm/chunk-PNXUYOYI.mjs +0 -2
- package/dist/esm/chunk-PNXUYOYI.mjs.map +0 -1
- package/dist/esm/chunk-PUZ25PTD.mjs.map +0 -1
- package/dist/esm/chunk-Q4XR6QOZ.mjs +0 -2
- package/dist/esm/chunk-QCUFTD7K.mjs.map +0 -1
- package/dist/esm/chunk-QDIKOQRK.mjs +0 -2
- package/dist/esm/chunk-QDIKOQRK.mjs.map +0 -1
- package/dist/esm/chunk-QIW56MUH.mjs.map +0 -1
- package/dist/esm/chunk-QLN2URFX.mjs.map +0 -1
- package/dist/esm/chunk-QPP6BX53.mjs.map +0 -1
- package/dist/esm/chunk-RNTXQYJQ.mjs.map +0 -1
- package/dist/esm/chunk-SAPUZZEU.mjs.map +0 -1
- package/dist/esm/chunk-SR24OGHJ.mjs.map +0 -1
- package/dist/esm/chunk-SRPI2FFA.mjs.map +0 -1
- package/dist/esm/chunk-STGYDB5E.mjs.map +0 -1
- package/dist/esm/chunk-SWHLSREF.mjs.map +0 -1
- package/dist/esm/chunk-TDGQGILY.mjs.map +0 -1
- package/dist/esm/chunk-TL7DR54X.mjs.map +0 -1
- package/dist/esm/chunk-TMW2HIXC.mjs.map +0 -1
- package/dist/esm/chunk-TS3PYRAT.mjs.map +0 -1
- package/dist/esm/chunk-TVFIUUVY.mjs.map +0 -1
- package/dist/esm/chunk-U67PFBTL.mjs.map +0 -1
- package/dist/esm/chunk-U6Z4FNB7.mjs.map +0 -1
- package/dist/esm/chunk-UAL27G6B.mjs.map +0 -1
- package/dist/esm/chunk-WP7WF54Q.mjs.map +0 -1
- package/dist/esm/chunk-WS4RPKL6.mjs +0 -2
- package/dist/esm/chunk-WS4RPKL6.mjs.map +0 -1
- package/dist/esm/chunk-WWZ3METZ.mjs.map +0 -1
- package/dist/esm/chunk-X4KEZTUQ.mjs.map +0 -1
- package/dist/esm/chunk-XH7YKEYR.mjs.map +0 -1
- package/dist/esm/chunk-XK3JFCP3.mjs.map +0 -1
- package/dist/esm/chunk-XONG5JZ4.mjs.map +0 -1
- package/dist/esm/chunk-XXHW3ZT3.mjs.map +0 -1
- package/dist/esm/chunk-Y7F2V3R6.mjs.map +0 -1
- package/dist/esm/chunk-YHAPZP5A.mjs.map +0 -1
- package/dist/esm/chunk-YJCZU6PR.mjs.map +0 -1
- package/dist/esm/chunk-ZGO2SK6F.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-G7MWTE2J.mjs.map → chunk-KSUZS6EL.mjs.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/internal/transactionSubmission.ts"],"sourcesContent":["/**\n * This file contains the underlying implementations for exposed submission API surface in\n * the {@link api/transaction}. By moving the methods out into a separate file,\n * other namespaces and processes can access these methods without depending on the entire\n * transaction namespace and without having a dependency cycle error.\n */\n\nimport { AptosConfig } from \"../api/aptosConfig\";\nimport { MoveVector, U8 } from \"../bcs\";\nimport { postAptosFullNode } from \"../client\";\nimport { Account, AbstractKeylessAccount, MultiKeyAccount } from \"../account\";\nimport { AccountAddress, AccountAddressInput } from \"../core/accountAddress\";\nimport { PrivateKey } from \"../core/crypto\";\nimport { AccountAuthenticator } from \"../transactions/authenticator/account\";\nimport { RotationProofChallenge } from \"../transactions/instances/rotationProofChallenge\";\nimport {\n buildTransaction,\n generateTransactionPayload,\n generateSignedTransactionForSimulation,\n generateSignedTransaction,\n} from \"../transactions/transactionBuilder/transactionBuilder\";\nimport {\n InputGenerateTransactionData,\n AnyRawTransaction,\n InputSimulateTransactionData,\n InputGenerateTransactionOptions,\n InputGenerateTransactionPayloadDataWithRemoteABI,\n InputSubmitTransactionData,\n InputGenerateMultiAgentRawTransactionData,\n InputGenerateSingleSignerRawTransactionData,\n AnyTransactionPayloadInstance,\n EntryFunctionABI,\n} from \"../transactions/types\";\nimport { getInfo } from \"./account\";\nimport { UserTransactionResponse, PendingTransactionResponse, MimeType, HexInput, TransactionResponse } from \"../types\";\nimport { TypeTagU8, TypeTagVector, generateSigningMessageForTransaction } from \"../transactions\";\nimport { SimpleTransaction } from \"../transactions/instances/simpleTransaction\";\nimport { MultiAgentTransaction } from \"../transactions/instances/multiAgentTransaction\";\n\n/**\n * We are defining function signatures, each with its specific input and output.\n * These are the possible function signature for `generateTransaction` function.\n * When we call `generateTransaction` function with the relevant type properties,\n * Typescript can infer the return type based on the appropriate function overload.\n */\nexport async function generateTransaction(\n args: { aptosConfig: AptosConfig } & InputGenerateSingleSignerRawTransactionData,\n): Promise<SimpleTransaction>;\nexport async function generateTransaction(\n args: { aptosConfig: AptosConfig } & InputGenerateMultiAgentRawTransactionData,\n): Promise<MultiAgentTransaction>;\n/**\n * Generates any transaction by passing in the required arguments\n *\n * @param args.sender The transaction sender's account address as a AccountAddressInput\n * @param args.data EntryFunctionData | ScriptData | MultiSigData\n * @param args.feePayerAddress optional. For a fee payer (aka sponsored) transaction\n * @param args.secondarySignerAddresses optional. For a multi-agent or fee payer (aka sponsored) transactions\n * @param args.options optional. GenerateTransactionOptions type\n *\n * @example\n * For a single signer entry function\n * move function name, move function type arguments, move function arguments\n * `\n * data: {\n * function:\"0x1::aptos_account::transfer\",\n * typeArguments:[]\n * functionArguments :[receiverAddress,10]\n * }\n * `\n *\n * @example\n * For a single signer script function\n * module bytecode, move function type arguments, move function arguments\n * ```\n * data: {\n * bytecode:\"0x001234567\",\n * typeArguments:[],\n * functionArguments :[receiverAddress,10]\n * }\n * ```\n *\n * @return An instance of a RawTransaction, plus optional secondary/fee payer addresses\n * ```\n * {\n * rawTransaction: RawTransaction,\n * secondarySignerAddresses?: Array<AccountAddress>,\n * feePayerAddress?: AccountAddress\n * }\n * ```\n */\nexport async function generateTransaction(\n args: { aptosConfig: AptosConfig } & InputGenerateTransactionData,\n): Promise<AnyRawTransaction> {\n const payload = await buildTransactionPayload(args);\n return buildRawTransaction(args, payload);\n}\n\n/**\n * Builds a transaction payload based on the provided configuration and input data.\n * This function is essential for preparing transaction data for execution on the Aptos blockchain.\n *\n * @param args - The arguments for building the transaction payload.\n * @param args.aptosConfig - Configuration settings for the Aptos network.\n * @param args.data - Input data required to generate the transaction payload, which may include bytecode, multisig address,\n * function name, function arguments, type arguments, and ABI.\n * @returns A promise that resolves to the generated transaction payload instance.\n */\nexport async function buildTransactionPayload(\n args: { aptosConfig: AptosConfig } & InputGenerateTransactionData,\n): Promise<AnyTransactionPayloadInstance> {\n const { aptosConfig, data } = args;\n // Merge in aptosConfig for remote ABI on non-script payloads\n let generateTransactionPayloadData: InputGenerateTransactionPayloadDataWithRemoteABI;\n let payload: AnyTransactionPayloadInstance;\n\n if (\"bytecode\" in data) {\n // TODO: Add ABI checking later\n payload = await generateTransactionPayload(data);\n } else if (\"multisigAddress\" in data) {\n generateTransactionPayloadData = {\n aptosConfig,\n multisigAddress: data.multisigAddress,\n function: data.function,\n functionArguments: data.functionArguments,\n typeArguments: data.typeArguments,\n abi: data.abi,\n };\n payload = await generateTransactionPayload(generateTransactionPayloadData);\n } else {\n generateTransactionPayloadData = {\n aptosConfig,\n function: data.function,\n functionArguments: data.functionArguments,\n typeArguments: data.typeArguments,\n abi: data.abi,\n };\n payload = await generateTransactionPayload(generateTransactionPayloadData);\n }\n return payload;\n}\n\n/**\n * Builds a raw transaction based on the provided configuration and payload.\n * This function helps in creating a transaction that can be sent to the Aptos blockchain.\n *\n * @param args - The arguments for generating the transaction.\n * @param args.aptosConfig - The configuration settings for Aptos.\n * @param args.sender - The address of the sender of the transaction.\n * @param args.options - Additional options for the transaction.\n * @param payload - The payload of the transaction, which defines the action to be performed.\n */\nexport async function buildRawTransaction(\n args: { aptosConfig: AptosConfig } & InputGenerateTransactionData,\n payload: AnyTransactionPayloadInstance,\n): Promise<AnyRawTransaction> {\n const { aptosConfig, sender, options } = args;\n\n let feePayerAddress;\n if (isFeePayerTransactionInput(args)) {\n feePayerAddress = AccountAddress.ZERO.toString();\n }\n\n if (isMultiAgentTransactionInput(args)) {\n const { secondarySignerAddresses } = args;\n return buildTransaction({\n aptosConfig,\n sender,\n payload,\n options,\n secondarySignerAddresses,\n feePayerAddress,\n });\n }\n\n return buildTransaction({\n aptosConfig,\n sender,\n payload,\n options,\n feePayerAddress,\n });\n}\n\n/**\n * Determine if the transaction input includes a fee payer.\n *\n * @param data - The input data for generating a transaction.\n * @param data.withFeePayer - Indicates whether a fee payer is included in the transaction input.\n * @returns A boolean value indicating if the transaction input has a fee payer.\n */\nfunction isFeePayerTransactionInput(data: InputGenerateTransactionData): boolean {\n return data.withFeePayer === true;\n}\n\n/**\n * Determines whether the provided transaction input data includes multiple agent signatures.\n *\n * @param data - The transaction input data to evaluate.\n * @param data.secondarySignerAddresses - An array of secondary signer addresses, indicating multiple agents.\n */\nfunction isMultiAgentTransactionInput(\n data: InputGenerateTransactionData,\n): data is InputGenerateMultiAgentRawTransactionData {\n return \"secondarySignerAddresses\" in data;\n}\n\n/**\n * Builds a signing message that can be signed by external signers.\n *\n * Note: Please prefer using `signTransaction` unless signing outside the SDK.\n *\n * @param args - The arguments for generating the signing message.\n * @param args.transaction - AnyRawTransaction, as generated by `generateTransaction()`.\n *\n * @returns The message to be signed.\n */\nexport function getSigningMessage(args: { transaction: AnyRawTransaction }): Uint8Array {\n const { transaction } = args;\n return generateSigningMessageForTransaction(transaction);\n}\n\n/**\n * Sign a transaction that can later be submitted to the chain.\n *\n * @param args The arguments for signing the transaction.\n * @param args.signer The signer account to sign the transaction.\n * @param args.transaction An instance of a RawTransaction, plus optional secondary/fee payer addresses.\n *\n * @return The signer AccountAuthenticator.\n */\nexport function signTransaction(args: { signer: Account; transaction: AnyRawTransaction }): AccountAuthenticator {\n const { signer, transaction } = args;\n return signer.signTransactionWithAuthenticator(transaction);\n}\n\nexport function signAsFeePayer(args: { signer: Account; transaction: AnyRawTransaction }): AccountAuthenticator {\n const { signer, transaction } = args;\n\n // if transaction doesn't hold a \"feePayerAddress\" prop it means\n // this is not a fee payer transaction\n if (!transaction.feePayerAddress) {\n throw new Error(`Transaction ${transaction} is not a Fee Payer transaction`);\n }\n\n // Set the feePayerAddress to the signer account address\n transaction.feePayerAddress = signer.accountAddress;\n\n return signTransaction({\n signer,\n transaction,\n });\n}\n\n/**\n * Simulates a transaction before signing it to evaluate its potential outcome.\n *\n * @param args The arguments for simulating the transaction.\n * @param args.aptosConfig The configuration for the Aptos network.\n * @param args.transaction The raw transaction to simulate.\n * @param args.signerPublicKey The signer public key.\n * @param args.secondarySignersPublicKeys Optional. For when the transaction involves multiple signers.\n * @param args.feePayerPublicKey Optional. For when the transaction is sponsored by a fee payer.\n * @param args.options Optional. A configuration object to customize the simulation process.\n * @param args.options.estimateGasUnitPrice Optional. Indicates whether to estimate the gas unit price.\n * @param args.options.estimateMaxGasAmount Optional. Indicates whether to estimate the maximum gas amount.\n * @param args.options.estimatePrioritizedGasUnitPrice Optional. Indicates whether to estimate the prioritized gas unit price.\n */\nexport async function simulateTransaction(\n args: { aptosConfig: AptosConfig } & InputSimulateTransactionData,\n): Promise<Array<UserTransactionResponse>> {\n const { aptosConfig, transaction, signerPublicKey, secondarySignersPublicKeys, feePayerPublicKey, options } = args;\n\n const signedTransaction = generateSignedTransactionForSimulation({\n transaction,\n signerPublicKey,\n secondarySignersPublicKeys,\n feePayerPublicKey,\n options,\n });\n\n const { data } = await postAptosFullNode<Uint8Array, Array<UserTransactionResponse>>({\n aptosConfig,\n body: signedTransaction,\n path: \"transactions/simulate\",\n params: {\n estimate_gas_unit_price: args.options?.estimateGasUnitPrice ?? false,\n estimate_max_gas_amount: args.options?.estimateMaxGasAmount ?? false,\n estimate_prioritized_gas_unit_price: args.options?.estimatePrioritizedGasUnitPrice ?? false,\n },\n originMethod: \"simulateTransaction\",\n contentType: MimeType.BCS_SIGNED_TRANSACTION,\n });\n return data;\n}\n\n/**\n * Submit a transaction to the Aptos blockchain.\n *\n * @param args - The arguments for submitting the transaction.\n * @param args.aptosConfig - The configuration for connecting to the Aptos network.\n * @param args.transaction - The Aptos transaction data to be submitted.\n * @param args.senderAuthenticator - The account authenticator of the transaction sender.\n * @param args.secondarySignerAuthenticators - Optional. Authenticators for additional signers in a multi-signer transaction.\n *\n * @returns PendingTransactionResponse - The response containing the status of the submitted transaction.\n */\nexport async function submitTransaction(\n args: {\n aptosConfig: AptosConfig;\n } & InputSubmitTransactionData,\n): Promise<PendingTransactionResponse> {\n const { aptosConfig } = args;\n const signedTransaction = generateSignedTransaction({ ...args });\n const { data } = await postAptosFullNode<Uint8Array, PendingTransactionResponse>({\n aptosConfig,\n body: signedTransaction,\n path: \"transactions\",\n originMethod: \"submitTransaction\",\n contentType: MimeType.BCS_SIGNED_TRANSACTION,\n });\n return data;\n}\nexport type FeePayerOrFeePayerAuthenticatorOrNeither =\n | { feePayer: Account; feePayerAuthenticator?: never }\n | { feePayer?: never; feePayerAuthenticator: AccountAuthenticator }\n | { feePayer?: never; feePayerAuthenticator?: never };\n\nexport async function signAndSubmitTransaction(\n args: FeePayerOrFeePayerAuthenticatorOrNeither & {\n aptosConfig: AptosConfig;\n signer: Account;\n transaction: AnyRawTransaction;\n },\n): Promise<PendingTransactionResponse> {\n const { aptosConfig, signer, feePayer, transaction } = args;\n // If the signer contains a KeylessAccount, await proof fetching in case the proof\n // was fetched asynchronously.\n if (signer instanceof AbstractKeylessAccount || signer instanceof MultiKeyAccount) {\n await signer.waitForProofFetch();\n }\n if (feePayer instanceof AbstractKeylessAccount || feePayer instanceof MultiKeyAccount) {\n await feePayer.waitForProofFetch();\n }\n const feePayerAuthenticator =\n args.feePayerAuthenticator || (feePayer && signAsFeePayer({ signer: feePayer, transaction }));\n\n const senderAuthenticator = signTransaction({ signer, transaction });\n return submitTransaction({\n aptosConfig,\n transaction,\n senderAuthenticator,\n feePayerAuthenticator,\n });\n}\n\nexport async function signAndSubmitAsFeePayer(args: {\n aptosConfig: AptosConfig;\n feePayer: Account;\n senderAuthenticator: AccountAuthenticator;\n transaction: AnyRawTransaction;\n}): Promise<PendingTransactionResponse> {\n const { aptosConfig, senderAuthenticator, feePayer, transaction } = args;\n\n if (feePayer instanceof AbstractKeylessAccount || feePayer instanceof MultiKeyAccount) {\n await feePayer.waitForProofFetch();\n }\n\n const feePayerAuthenticator = signAsFeePayer({ signer: feePayer, transaction });\n\n return submitTransaction({\n aptosConfig,\n transaction,\n senderAuthenticator,\n feePayerAuthenticator,\n });\n}\n\nconst packagePublishAbi: EntryFunctionABI = {\n typeParameters: [],\n parameters: [TypeTagVector.u8(), new TypeTagVector(TypeTagVector.u8())],\n};\n\n/**\n * Publishes a package transaction to the Aptos blockchain.\n * This function allows you to create and send a transaction that publishes a package with the specified metadata and bytecode.\n *\n * @param args - The arguments for the package transaction.\n * @param args.aptosConfig - The configuration settings for the Aptos client.\n * @param args.account - The address of the account sending the transaction.\n * @param args.metadataBytes - The metadata associated with the package, represented as hexadecimal input.\n * @param args.moduleBytecode - An array of module bytecode, each represented as hexadecimal input.\n * @param args.options - Optional parameters for generating the transaction.\n */\nexport async function publicPackageTransaction(args: {\n aptosConfig: AptosConfig;\n account: AccountAddressInput;\n metadataBytes: HexInput;\n moduleBytecode: Array<HexInput>;\n options?: InputGenerateTransactionOptions;\n}): Promise<SimpleTransaction> {\n const { aptosConfig, account, metadataBytes, moduleBytecode, options } = args;\n\n const totalByteCode = moduleBytecode.map((bytecode) => MoveVector.U8(bytecode));\n\n return generateTransaction({\n aptosConfig,\n sender: AccountAddress.from(account),\n data: {\n function: \"0x1::code::publish_package_txn\",\n functionArguments: [MoveVector.U8(metadataBytes), new MoveVector(totalByteCode)],\n abi: packagePublishAbi,\n },\n options,\n });\n}\n\nconst rotateAuthKeyAbi: EntryFunctionABI = {\n typeParameters: [],\n parameters: [\n new TypeTagU8(),\n TypeTagVector.u8(),\n new TypeTagU8(),\n TypeTagVector.u8(),\n TypeTagVector.u8(),\n TypeTagVector.u8(),\n ],\n};\n\n/**\n * Rotates the authentication key for a given account, allowing for enhanced security and management of account access.\n *\n * @param args - The arguments for rotating the authentication key.\n * @param args.aptosConfig - The configuration settings for the Aptos network.\n * @param args.fromAccount - The account from which the authentication key will be rotated.\n * @param args.toNewPrivateKey - The new private key that will be associated with the account.\n *\n * @remarks\n * This function requires the current authentication key and the new private key to sign a challenge that validates the rotation.\n *\n * TODO: Need to refactor and move this function out of transactionSubmission.\n */\nexport async function rotateAuthKey(args: {\n aptosConfig: AptosConfig;\n fromAccount: Account;\n toNewPrivateKey: PrivateKey;\n}): Promise<TransactionResponse> {\n const { aptosConfig, fromAccount, toNewPrivateKey } = args;\n const accountInfo = await getInfo({\n aptosConfig,\n accountAddress: fromAccount.accountAddress,\n });\n\n const newAccount = Account.fromPrivateKey({ privateKey: toNewPrivateKey, legacy: true });\n\n const challenge = new RotationProofChallenge({\n sequenceNumber: BigInt(accountInfo.sequence_number),\n originator: fromAccount.accountAddress,\n currentAuthKey: AccountAddress.from(accountInfo.authentication_key),\n newPublicKey: newAccount.publicKey,\n });\n\n // Sign the challenge\n const challengeHex = challenge.bcsToBytes();\n const proofSignedByCurrentPrivateKey = fromAccount.sign(challengeHex);\n const proofSignedByNewPrivateKey = newAccount.sign(challengeHex);\n\n // Generate transaction\n const rawTxn = await generateTransaction({\n aptosConfig,\n sender: fromAccount.accountAddress,\n data: {\n function: \"0x1::account::rotate_authentication_key\",\n functionArguments: [\n new U8(fromAccount.signingScheme), // from scheme\n MoveVector.U8(fromAccount.publicKey.toUint8Array()),\n new U8(newAccount.signingScheme), // to scheme\n MoveVector.U8(newAccount.publicKey.toUint8Array()),\n MoveVector.U8(proofSignedByCurrentPrivateKey.toUint8Array()),\n MoveVector.U8(proofSignedByNewPrivateKey.toUint8Array()),\n ],\n abi: rotateAuthKeyAbi,\n },\n });\n return signAndSubmitTransaction({\n aptosConfig,\n signer: fromAccount,\n transaction: rawTxn,\n });\n}\n"],"mappings":"wgBA2FA,eAAsBA,EACpBC,EAC4B,CAC5B,IAAMC,EAAU,MAAMC,EAAwBF,CAAI,EAClD,OAAOG,EAAoBH,EAAMC,CAAO,CAC1C,CAYA,eAAsBC,EACpBF,EAC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AY,CACV,IAAIC,EACJT,EAAc,GAAG,EACjB,IAAIS,EACJT,EAAc,GAAG,EACjBA,EAAc,GAAG,EACjBA,EAAc,GAAG,CACnB,CACF,EAeA,eAAsBU,GAAcjD,EAIH,CAC/B,GAAM,CAAE,YAAAI,EAAa,YAAA8C,EAAa,gBAAAC,CAAgB,EAAInD,EAChDoD,EAAc,MAAMC,EAAQ,CAChC,YAAAjD,EACA,eAAgB8C,EAAY,cAC9B,CAAC,EAEKI,EAAaC,EAAQ,eAAe,CAAE,WAAYJ,EAAiB,OAAQ,EAAK,CAAC,EAUjFK,EARY,IAAIC,EAAuB,CAC3C,eAAgB,OAAOL,EAAY,eAAe,EAClD,WAAYF,EAAY,eACxB,eAAgBtC,EAAe,KAAKwC,EAAY,kBAAkB,EAClE,aAAcE,EAAW,SAC3B,CAAC,EAG8B,WAAW,EACpCI,EAAiCR,EAAY,KAAKM,CAAY,EAC9DG,EAA6BL,EAAW,KAAKE,CAAY,EAGzDI,EAAS,MAAM7D,EAAoB,CACvC,YAAAK,EACA,OAAQ8C,EAAY,eACpB,KAAM,CACJ,SAAU,0CACV,kBAAmB,CACjB,IAAIW,EAAGX,EAAY,aAAa,EAChCJ,EAAW,GAAGI,EAAY,UAAU,aAAa,CAAC,EAClD,IAAIW,EAAGP,EAAW,aAAa,EAC/BR,EAAW,GAAGQ,EAAW,UAAU,aAAa,CAAC,EACjDR,EAAW,GAAGY,EAA+B,aAAa,CAAC,EAC3DZ,EAAW,GAAGa,EAA2B,aAAa,CAAC,CACzD,EACA,IAAKZ,CACP,CACF,CAAC,EACD,OAAOhB,EAAyB,CAC9B,YAAA3B,EACA,OAAQ8C,EACR,YAAaU,CACf,CAAC,CACH","names":["generateTransaction","args","payload","buildTransactionPayload","buildRawTransaction","aptosConfig","data","generateTransactionPayloadData","generateTransactionPayload","sender","options","feePayerAddress","isFeePayerTransactionInput","AccountAddress","isMultiAgentTransactionInput","secondarySignerAddresses","buildTransaction","getSigningMessage","transaction","generateSigningMessageForTransaction","signTransaction","signer","signAsFeePayer","simulateTransaction","signerPublicKey","secondarySignersPublicKeys","feePayerPublicKey","signedTransaction","generateSignedTransactionForSimulation","postAptosFullNode","submitTransaction","generateSignedTransaction","signAndSubmitTransaction","feePayer","AbstractKeylessAccount","MultiKeyAccount","feePayerAuthenticator","senderAuthenticator","signAndSubmitAsFeePayer","packagePublishAbi","TypeTagVector","publicPackageTransaction","account","metadataBytes","moduleBytecode","totalByteCode","bytecode","MoveVector","rotateAuthKeyAbi","TypeTagU8","rotateAuthKey","fromAccount","toNewPrivateKey","accountInfo","getInfo","newAccount","Account","challengeHex","RotationProofChallenge","proofSignedByCurrentPrivateKey","proofSignedByNewPrivateKey","rawTxn","U8"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as o,b as r,c as t,d as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as o,b as r,c as t,d as s}from"./chunk-DXQT55L3.mjs";import{a as n}from"./chunk-TRU3EK64.mjs";var i=class{constructor(e){this.config=e}async getModuleEventsByEventType(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"events_processor"}),o({aptosConfig:this.config,...e})}async getAccountEventsByCreationNumber(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"events_processor"}),r({aptosConfig:this.config,...e})}async getAccountEventsByEventType(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"events_processor"}),t({aptosConfig:this.config,...e})}async getEvents(e){return await n({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"events_processor"}),s({aptosConfig:this.config,...e})}};export{i as a};
|
|
2
|
+
//# sourceMappingURL=chunk-2QRWGJJA.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/api/event.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n getAccountEventsByCreationNumber,\n getAccountEventsByEventType,\n getModuleEventsByEventType,\n getEvents,\n} from \"../internal/event\";\nimport { AnyNumber, GetEventsResponse, MoveStructId, OrderByArg, PaginationArgs, WhereArg } from \"../types\";\nimport { EventsBoolExp } from \"../types/generated/types\";\nimport { AccountAddressInput } from \"../core\";\nimport { ProcessorType } from \"../utils/const\";\nimport { AptosConfig } from \"./aptosConfig\";\nimport { waitForIndexerOnVersion } from \"./utils\";\n\n/**\n * A class to query all `Event` Aptos related queries.\n */\nexport class Event {\n /**\n * Initializes a new instance of the Aptos client with the provided configuration.\n *\n * @param config - The configuration settings for the Aptos client.\n * @param config.network - The network to connect to (e.g., Testnet, Mainnet).\n * @param config.nodeUrl - The URL of the Aptos node to connect to.\n * @param config.faucetUrl - The URL of the faucet to use for funding accounts.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * async function runExample() {\n * // Create a new Aptos client with Testnet configuration\n * const config = new AptosConfig({ network: Network.TESTNET }); // Specify your own network if needed\n * const aptos = new Aptos(config);\n *\n * console.log(\"Aptos client initialized:\", aptos);\n * }\n * runExample().catch(console.error);\n * ```\n */\n constructor(readonly config: AptosConfig) {}\n\n /**\n * Retrieve module events based on a specified event type.\n * This function allows you to query for events that are associated with a particular module event type in the Aptos blockchain.\n *\n * @param args - The arguments for retrieving module events.\n * @param args.eventType - The event type to filter the results.\n * @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.\n * @param args.options - Optional pagination and ordering parameters for the event results.\n *\n * @returns Promise<GetEventsResponse> - A promise that resolves to the retrieved events.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Retrieve module events for a specific event type\n * const events = await aptos.getModuleEventsByEventType({\n * eventType: \"0x1::transaction_fee::FeeStatement\", // specify the event type\n * minimumLedgerVersion: 1, // optional: specify minimum ledger version if needed\n * });\n *\n * console.log(events); // log the retrieved events\n * }\n * runExample().catch(console.error);\n * ```\n */\n async getModuleEventsByEventType(args: {\n eventType: MoveStructId;\n minimumLedgerVersion?: AnyNumber;\n options?: PaginationArgs & OrderByArg<GetEventsResponse[0]>;\n }): Promise<GetEventsResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.EVENTS_PROCESSOR,\n });\n return getModuleEventsByEventType({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Retrieve events associated with a specific account address and creation number.\n *\n * @param args - The parameters for retrieving account events.\n * @param args.accountAddress - The account address to query events for.\n * @param args.creationNumber - The event creation number to filter the events.\n * @param args.minimumLedgerVersion - Optional minimum ledger version to sync up to before querying.\n *\n * @returns Promise<GetEventsResponse>\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Get events for the account at creation number 0\n * const events = await aptos.getAccountEventsByCreationNumber({\n * accountAddress: \"0x1\", // replace with a real account address\n * creationNumber: 0,\n * });\n *\n * console.log(events);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async getAccountEventsByCreationNumber(args: {\n accountAddress: AccountAddressInput;\n creationNumber: AnyNumber;\n minimumLedgerVersion?: AnyNumber;\n }): Promise<GetEventsResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.EVENTS_PROCESSOR,\n });\n return getAccountEventsByCreationNumber({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Retrieve events associated with a specific account address and event type.\n *\n * @param args.accountAddress - The account address to query events for.\n * @param args.eventType - The type of event to filter by.\n * @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.\n * @param args.options - Optional pagination and ordering parameters for the event query.\n *\n * @returns Promise<GetEventsResponse>\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Get events for a specific account and event type\n * const events = await aptos.getAccountEventsByEventType({\n * accountAddress: \"0x1\", // replace with a real account address\n * eventType: \"0x1::transaction_fee::FeeStatement\", // replace with a real event type\n * minimumLedgerVersion: 1, // optional, specify if needed\n * });\n *\n * console.log(events);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async getAccountEventsByEventType(args: {\n accountAddress: AccountAddressInput;\n eventType: MoveStructId;\n minimumLedgerVersion?: AnyNumber;\n options?: PaginationArgs & OrderByArg<GetEventsResponse[0]>;\n }): Promise<GetEventsResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.EVENTS_PROCESSOR,\n });\n return getAccountEventsByEventType({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Retrieve all events from the Aptos blockchain.\n * An optional `where` clause can be provided to filter the results based on specific criteria.\n *\n * @param args Optional parameters for the query.\n * @param args.minimumLedgerVersion Optional ledger version to sync up to before querying.\n * @param args.options Optional pagination and filtering options.\n * @param args.options.where Optional condition to filter events.\n * @param args.options.offset Optional pagination offset.\n * @param args.options.limit Optional maximum number of events to return.\n * @param args.options.orderBy Optional ordering of the results.\n *\n * @returns GetEventsQuery response type containing the events.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Retrieve all events\n * const events = await aptos.getEvents();\n *\n * // Retrieve events with filtering by account address\n * const whereCondition = {\n * account_address: { _eq: \"0x123\" }, // replace with a real account address\n * };\n * const filteredEvents = await aptos.getEvents({\n * options: { where: whereCondition },\n * });\n *\n * console.log(events);\n * console.log(filteredEvents);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async getEvents(args?: {\n minimumLedgerVersion?: AnyNumber;\n options?: PaginationArgs & OrderByArg<GetEventsResponse[0]> & WhereArg<EventsBoolExp>;\n }): Promise<GetEventsResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args?.minimumLedgerVersion,\n processorType: ProcessorType.EVENTS_PROCESSOR,\n });\n return getEvents({ aptosConfig: this.config, ...args });\n }\n}\n"],"mappings":"uGAmBO,IAAMA,EAAN,KAAY,CAuBjB,YAAqBC,EAAqB,CAArB,YAAAA,CAAsB,CAgC3C,MAAM,2BAA2BC,EAIF,CAC7B,aAAMC,EAAwB,CAC5B,OAAQ,KAAK,OACb,qBAAsBD,EAAK,qBAC3B,gCACF,CAAC,EACME,EAA2B,CAAE,YAAa,KAAK,OAAQ,GAAGF,CAAK,CAAC,CACzE,CA+BA,MAAM,iCAAiCA,EAIR,CAC7B,aAAMC,EAAwB,CAC5B,OAAQ,KAAK,OACb,qBAAsBD,EAAK,qBAC3B,gCACF,CAAC,EACMG,EAAiC,CAAE,YAAa,KAAK,OAAQ,GAAGH,CAAK,CAAC,CAC/E,CAgCA,MAAM,4BAA4BA,EAKH,CAC7B,aAAMC,EAAwB,CAC5B,OAAQ,KAAK,OACb,qBAAsBD,EAAK,qBAC3B,gCACF,CAAC,EACMI,EAA4B,CAAE,YAAa,KAAK,OAAQ,GAAGJ,CAAK,CAAC,CAC1E,CAyCA,MAAM,UAAUA,EAGe,CAC7B,aAAMC,EAAwB,CAC5B,OAAQ,KAAK,OACb,qBAAsBD,GAAM,qBAC5B,gCACF,CAAC,EACMK,EAAU,CAAE,YAAa,KAAK,OAAQ,GAAGL,CAAK,CAAC,CACxD,CACF","names":["Event","config","args","waitForIndexerOnVersion","getModuleEventsByEventType","getAccountEventsByCreationNumber","getAccountEventsByEventType","getEvents"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{i as s}from"./chunk-5CCHECTE.mjs";import{b as c}from"./chunk-4OV7QU2U.mjs";import{a as d}from"./chunk-PRZ7AIGA.mjs";import{b as i}from"./chunk-KM6UXNC7.mjs";import{b as n}from"./chunk-QQIVWB6G.mjs";var u=class r extends c{constructor(e,t){super(),this.jwkAddress=i.from(e),this.keylessPublicKey=t}authKey(){let e=new n;return e.serializeU32AsUleb128(4),e.serializeFixedBytes(this.bcsToBytes()),d.fromSchemeAndBytes({scheme:2,input:e.toUint8Array()})}verifySignature(e){throw new Error("Not yet implemented")}serialize(e){this.jwkAddress.serialize(e),this.keylessPublicKey.serialize(e)}static deserialize(e){let t=i.deserialize(e),l=s.deserialize(e);return new r(t,l)}static isPublicKey(e){return e instanceof r}static create(e){return new r(e.jwkAddress,s.create(e))}static fromJwtAndPepper(e){return new r(e.jwkAddress,s.fromJwtAndPepper(e))}static isInstance(e){return"jwkAddress"in e&&e.jwkAddress instanceof i&&"keylessPublicKey"in e&&e.keylessPublicKey instanceof s}};export{u as a};
|
|
2
|
+
//# sourceMappingURL=chunk-37UZKMJI.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/core/crypto/federatedKeyless.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { AccountPublicKey, PublicKey } from \"./publicKey\";\nimport { Deserializer, Serializer } from \"../../bcs\";\nimport { HexInput, AnyPublicKeyVariant, SigningScheme } from \"../../types\";\nimport { AuthenticationKey } from \"../authenticationKey\";\nimport { AccountAddress, AccountAddressInput } from \"../accountAddress\";\nimport { KeylessPublicKey, KeylessSignature } from \"./keyless\";\n\n/**\n * Represents the FederatedKeylessPublicKey public key\n *\n * These keys use an on-chain address as a source of truth for the JWK used to verify signatures.\n *\n * FederatedKeylessPublicKey authentication key is represented in the SDK as `AnyPublicKey`.\n */\nexport class FederatedKeylessPublicKey extends AccountPublicKey {\n /**\n * The address that contains the JWK set to be used for verification.\n */\n readonly jwkAddress: AccountAddress;\n\n /**\n * The inner public key which contains the standard Keyless public key.\n */\n readonly keylessPublicKey: KeylessPublicKey;\n\n constructor(jwkAddress: AccountAddressInput, keylessPublicKey: KeylessPublicKey) {\n super();\n this.jwkAddress = AccountAddress.from(jwkAddress);\n this.keylessPublicKey = keylessPublicKey;\n }\n\n /**\n * Get the authentication key for the federated keyless public key\n *\n * @returns AuthenticationKey\n */\n authKey(): AuthenticationKey {\n const serializer = new Serializer();\n serializer.serializeU32AsUleb128(AnyPublicKeyVariant.FederatedKeyless);\n serializer.serializeFixedBytes(this.bcsToBytes());\n return AuthenticationKey.fromSchemeAndBytes({\n scheme: SigningScheme.SingleKey,\n input: serializer.toUint8Array(),\n });\n }\n\n /**\n * Verifies a signed data with a public key\n *\n * @param args.message message\n * @param args.signature The signature\n * @returns true if the signature is valid\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars, class-methods-use-this\n verifySignature(args: { message: HexInput; signature: KeylessSignature }): boolean {\n throw new Error(\"Not yet implemented\");\n }\n\n serialize(serializer: Serializer): void {\n this.jwkAddress.serialize(serializer);\n this.keylessPublicKey.serialize(serializer);\n }\n\n static deserialize(deserializer: Deserializer): FederatedKeylessPublicKey {\n const jwkAddress = AccountAddress.deserialize(deserializer);\n const keylessPublicKey = KeylessPublicKey.deserialize(deserializer);\n return new FederatedKeylessPublicKey(jwkAddress, keylessPublicKey);\n }\n\n static isPublicKey(publicKey: PublicKey): publicKey is FederatedKeylessPublicKey {\n return publicKey instanceof FederatedKeylessPublicKey;\n }\n\n /**\n * Creates a FederatedKeylessPublicKey from the JWT components plus pepper\n *\n * @param args.iss the iss of the identity\n * @param args.uidKey the key to use to get the uidVal in the JWT token\n * @param args.uidVal the value of the uidKey in the JWT token\n * @param args.aud the client ID of the application\n * @param args.pepper The pepper used to maintain privacy of the account\n * @returns FederatedKeylessPublicKey\n */\n static create(args: {\n iss: string;\n uidKey: string;\n uidVal: string;\n aud: string;\n pepper: HexInput;\n jwkAddress: AccountAddressInput;\n }): FederatedKeylessPublicKey {\n return new FederatedKeylessPublicKey(args.jwkAddress, KeylessPublicKey.create(args));\n }\n\n static fromJwtAndPepper(args: {\n jwt: string;\n pepper: HexInput;\n jwkAddress: AccountAddressInput;\n uidKey?: string;\n }): FederatedKeylessPublicKey {\n return new FederatedKeylessPublicKey(args.jwkAddress, KeylessPublicKey.fromJwtAndPepper(args));\n }\n\n static isInstance(publicKey: PublicKey) {\n return (\n \"jwkAddress\" in publicKey &&\n publicKey.jwkAddress instanceof AccountAddress &&\n \"keylessPublicKey\" in publicKey &&\n publicKey.keylessPublicKey instanceof KeylessPublicKey\n );\n }\n}\n"],"mappings":"6MAiBO,IAAMA,EAAN,MAAMC,UAAkCC,CAAiB,CAW9D,YAAYC,EAAiCC,EAAoC,CAC/E,MAAM,EACN,KAAK,WAAaC,EAAe,KAAKF,CAAU,EAChD,KAAK,iBAAmBC,CAC1B,CAOA,SAA6B,CAC3B,IAAME,EAAa,IAAIC,EACvB,OAAAD,EAAW,uBAA0D,EACrEA,EAAW,oBAAoB,KAAK,WAAW,CAAC,EACzCE,EAAkB,mBAAmB,CAC1C,SACA,MAAOF,EAAW,aAAa,CACjC,CAAC,CACH,CAUA,gBAAgBG,EAAmE,CACjF,MAAM,IAAI,MAAM,qBAAqB,CACvC,CAEA,UAAUH,EAA8B,CACtC,KAAK,WAAW,UAAUA,CAAU,EACpC,KAAK,iBAAiB,UAAUA,CAAU,CAC5C,CAEA,OAAO,YAAYI,EAAuD,CACxE,IAAMP,EAAaE,EAAe,YAAYK,CAAY,EACpDN,EAAmBO,EAAiB,YAAYD,CAAY,EAClE,OAAO,IAAIT,EAA0BE,EAAYC,CAAgB,CACnE,CAEA,OAAO,YAAYQ,EAA8D,CAC/E,OAAOA,aAAqBX,CAC9B,CAYA,OAAO,OAAOQ,EAOgB,CAC5B,OAAO,IAAIR,EAA0BQ,EAAK,WAAYE,EAAiB,OAAOF,CAAI,CAAC,CACrF,CAEA,OAAO,iBAAiBA,EAKM,CAC5B,OAAO,IAAIR,EAA0BQ,EAAK,WAAYE,EAAiB,iBAAiBF,CAAI,CAAC,CAC/F,CAEA,OAAO,WAAWG,EAAsB,CACtC,MACE,eAAgBA,GAChBA,EAAU,sBAAsBP,GAChC,qBAAsBO,GACtBA,EAAU,4BAA4BD,CAE1C,CACF","names":["FederatedKeylessPublicKey","_FederatedKeylessPublicKey","AccountPublicKey","jwkAddress","keylessPublicKey","AccountAddress","serializer","Serializer","AuthenticationKey","args","deserializer","KeylessPublicKey","publicKey"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/normalizeBundle.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Deserializer, Serializable } from \"../bcs\";\n\nexport type DeserializableClass<T extends Serializable> = {\n /**\n * Deserializes a serialized object using the provided deserializer.\n * This function allows you to reconstruct an object from its serialized form.\n *\n * @param deserializer - An instance of the Deserializer used to read the serialized data.\n */\n deserialize(deserializer: Deserializer): T;\n};\n\n/**\n * Normalizes an instance of a class by deserializing it from its byte representation.\n * This function allows the `instanceof` operator to work correctly when the input objects originate from a different bundle.\n *\n * @param cls - The class of the object to normalize.\n * @param value - The instance to normalize.\n */\nexport function normalizeBundle<T extends Serializable>(cls: DeserializableClass<T>, value: T) {\n const serializedBytes = value.bcsToBytes();\n const deserializer = new Deserializer(serializedBytes);\n return cls.deserialize(deserializer);\n}\n"],"mappings":"yCAsBO,SAASA,EAAwCC,EAA6BC,EAAU,CAC7F,IAAMC,EAAkBD,EAAM,WAAW,EACnCE,EAAe,IAAIC,EAAaF,CAAe,EACrD,OAAOF,EAAI,YAAYG,CAAY,CACrC","names":["normalizeBundle","cls","value","serializedBytes","deserializer","Deserializer"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as e}from"./chunk-QQIVWB6G.mjs";import{b as r}from"./chunk-KFNDDPOW.mjs";var t=class extends e{toUint8Array(){return this.bcsToBytes()}toString(){let n=this.toUint8Array();return r.fromHexInput(n).toString()}},a=class extends t{};export{t as a,a as b};
|
|
2
|
+
//# sourceMappingURL=chunk-4OV7QU2U.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/core/crypto/publicKey.ts"],"sourcesContent":["import { Serializable } from \"../../bcs\";\nimport { HexInput } from \"../../types\";\nimport { AuthenticationKey } from \"../authenticationKey\";\nimport { Hex } from \"../hex\";\nimport { Signature } from \"./signature\";\n\n/**\n * Represents the arguments required to verify a digital signature.\n *\n * @param message - The original message that was signed.\n * @param signature - The signature to be verified against the message.\n */\nexport interface VerifySignatureArgs {\n message: HexInput;\n signature: Signature;\n}\n\n/**\n * Represents an abstract public key.\n *\n * This class provides a common interface for verifying signatures associated with the public key.\n * It allows for the retrieval of the raw public key bytes and the public key in a hexadecimal string format.\n */\nexport abstract class PublicKey extends Serializable {\n /**\n * Verifies that the private key associated with this public key signed the message with the given signature.\n * @param args.message The message that was signed\n * @param args.signature The signature to verify\n */\n abstract verifySignature(args: VerifySignatureArgs): boolean;\n\n /**\n * Get the raw public key bytes\n */\n toUint8Array(): Uint8Array {\n return this.bcsToBytes();\n }\n\n /**\n * Get the public key as a hex string with a 0x prefix.\n *\n * @returns The public key in hex format.\n */\n toString(): string {\n const bytes = this.toUint8Array();\n return Hex.fromHexInput(bytes).toString();\n }\n}\n\n/**\n * An abstract representation of an account public key.\n *\n * Provides a common interface for deriving an authentication key.\n *\n * @abstract\n */\nexport abstract class AccountPublicKey extends PublicKey {\n /**\n * Get the authentication key associated with this public key\n */\n abstract authKey(): AuthenticationKey;\n}\n"],"mappings":"kFAuBO,IAAeA,EAAf,cAAiCC,CAAa,CAWnD,cAA2B,CACzB,OAAO,KAAK,WAAW,CACzB,CAOA,UAAmB,CACjB,IAAMC,EAAQ,KAAK,aAAa,EAChC,OAAOC,EAAI,aAAaD,CAAK,EAAE,SAAS,CAC1C,CACF,EASsBE,EAAf,cAAwCJ,CAAU,CAKzD","names":["PublicKey","Serializable","bytes","Hex","AccountPublicKey"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as u,c as r}from"./chunk-IECDO22V.mjs";import{e as t}from"./chunk-6FLHGOKP.mjs";import{b as o}from"./chunk-KM6UXNC7.mjs";import{a as i}from"./chunk-QQIVWB6G.mjs";var c=class extends i{constructor(e){super();this.accountAddress=o.ONE;this.moduleName=new r("account");this.structName=new r("RotationProofChallenge");this.sequenceNumber=new t(e.sequenceNumber),this.originator=e.originator,this.currentAuthKey=e.currentAuthKey,this.newPublicKey=u.U8(e.newPublicKey.toUint8Array())}serialize(e){e.serialize(this.accountAddress),e.serialize(this.moduleName),e.serialize(this.structName),e.serialize(this.sequenceNumber),e.serialize(this.originator),e.serialize(this.currentAuthKey),e.serialize(this.newPublicKey)}};export{c as a};
|
|
2
|
+
//# sourceMappingURL=chunk-5AAFF2PV.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/transactions/instances/rotationProofChallenge.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Serializer, Serializable } from \"../../bcs/serializer\";\nimport { AccountAddress } from \"../../core/accountAddress\";\nimport { AnyNumber } from \"../../types\";\nimport { PublicKey } from \"../../core/crypto\";\nimport { MoveString, MoveVector, U64, U8 } from \"../../bcs\";\n\n/**\n * Represents a challenge required for the account owner to sign in order to rotate the authentication key.\n */\nexport class RotationProofChallenge extends Serializable {\n // Resource account address\n public readonly accountAddress: AccountAddress = AccountAddress.ONE;\n\n // Module name, i.e: 0x1::account\n public readonly moduleName: MoveString = new MoveString(\"account\");\n\n // The rotation proof challenge struct name that live under the module\n public readonly structName: MoveString = new MoveString(\"RotationProofChallenge\");\n\n // Signer's address\n public readonly originator: AccountAddress;\n\n // Signer's current authentication key\n public readonly currentAuthKey: AccountAddress;\n\n // New public key to rotate to\n public readonly newPublicKey: MoveVector<U8>;\n\n // Sequence number of the account\n public readonly sequenceNumber: U64;\n\n /**\n * Initializes a new instance of the class with the specified parameters.\n * This constructor sets up the necessary attributes for managing account keys.\n *\n * @param args - The parameters required to create the instance.\n * @param args.sequenceNumber - The sequence number associated with the transaction.\n * @param args.originator - The account address of the originator.\n * @param args.currentAuthKey - The current authentication key of the account.\n * @param args.newPublicKey - The new public key to be set for the account.\n */\n constructor(args: {\n sequenceNumber: AnyNumber;\n originator: AccountAddress;\n currentAuthKey: AccountAddress;\n newPublicKey: PublicKey;\n }) {\n super();\n this.sequenceNumber = new U64(args.sequenceNumber);\n this.originator = args.originator;\n this.currentAuthKey = args.currentAuthKey;\n this.newPublicKey = MoveVector.U8(args.newPublicKey.toUint8Array());\n }\n\n /**\n * Serializes the properties of the current instance for transmission or storage.\n * This function helps in converting the instance data into a format suitable for serialization.\n *\n * @param serializer - The serializer used to serialize the instance properties.\n * @param serializer.accountAddress - The account address to serialize.\n * @param serializer.moduleName - The module name to serialize.\n * @param serializer.structName - The struct name to serialize.\n * @param serializer.sequenceNumber - The sequence number to serialize.\n * @param serializer.originator - The originator to serialize.\n * @param serializer.currentAuthKey - The current authentication key to serialize.\n * @param serializer.newPublicKey - The new public key to serialize.\n */\n serialize(serializer: Serializer): void {\n serializer.serialize(this.accountAddress);\n serializer.serialize(this.moduleName);\n serializer.serialize(this.structName);\n serializer.serialize(this.sequenceNumber);\n serializer.serialize(this.originator);\n serializer.serialize(this.currentAuthKey);\n serializer.serialize(this.newPublicKey);\n }\n}\n"],"mappings":"2KAYO,IAAMA,EAAN,cAAqCC,CAAa,CAgCvD,YAAYC,EAKT,CACD,MAAM,EApCR,KAAgB,eAAiCC,EAAe,IAGhE,KAAgB,WAAyB,IAAIC,EAAW,SAAS,EAGjE,KAAgB,WAAyB,IAAIA,EAAW,wBAAwB,EA+B9E,KAAK,eAAiB,IAAIC,EAAIH,EAAK,cAAc,EACjD,KAAK,WAAaA,EAAK,WACvB,KAAK,eAAiBA,EAAK,eAC3B,KAAK,aAAeI,EAAW,GAAGJ,EAAK,aAAa,aAAa,CAAC,CACpE,CAeA,UAAUK,EAA8B,CACtCA,EAAW,UAAU,KAAK,cAAc,EACxCA,EAAW,UAAU,KAAK,UAAU,EACpCA,EAAW,UAAU,KAAK,UAAU,EACpCA,EAAW,UAAU,KAAK,cAAc,EACxCA,EAAW,UAAU,KAAK,UAAU,EACpCA,EAAW,UAAU,KAAK,cAAc,EACxCA,EAAW,UAAU,KAAK,YAAY,CACxC,CACF","names":["RotationProofChallenge","Serializable","args","AccountAddress","MoveString","U64","MoveVector","serializer"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as B}from"./chunk-ONBFUPEC.mjs";import{a as w,b as m}from"./chunk-XHCALZ7X.mjs";import{a as y,c as P,d as V,e as v}from"./chunk-GMKKHGXK.mjs";import{b as I,d as U}from"./chunk-WSVOJSAC.mjs";import{b as C}from"./chunk-4OV7QU2U.mjs";import{a as d}from"./chunk-IBLZ6MZU.mjs";import{a as H}from"./chunk-PRZ7AIGA.mjs";import{a as T}from"./chunk-HBIDHQ2M.mjs";import{b}from"./chunk-OLPI7QAH.mjs";import{a as G}from"./chunk-N47FTRYO.mjs";import{b as x}from"./chunk-KM6UXNC7.mjs";import{a as u,b as E}from"./chunk-QQIVWB6G.mjs";import{b as p}from"./chunk-KFNDDPOW.mjs";import{jwtDecode as M}from"jwt-decode";var me=1e7,R=120,k=30,F=330,ye=120,he=350,ge=300,fe=93,o=class o extends C{constructor(e,t){super();let i=p.fromHexInput(t).toUint8Array();if(i.length!==o.ID_COMMITMENT_LENGTH)throw new Error(`Id Commitment length in bytes should be ${o.ID_COMMITMENT_LENGTH}`);this.iss=e,this.idCommitment=i}authKey(){let e=new E;return e.serializeU32AsUleb128(3),e.serializeFixedBytes(this.bcsToBytes()),H.fromSchemeAndBytes({scheme:2,input:e.toUint8Array()})}verifySignature(e){throw new Error("Not yet implemented")}serialize(e){e.serializeStr(this.iss),e.serializeBytes(this.idCommitment)}static deserialize(e){let t=e.deserializeStr(),i=e.deserializeBytes();return new o(t,i)}static load(e){let t=e.deserializeStr(),i=e.deserializeBytes();return new o(t,i)}static isPublicKey(e){return e instanceof o}static create(e){return _(e),new o(e.iss,_(e))}static fromJwtAndPepper(e){let{jwt:t,pepper:i,uidKey:a="sub"}=e,n=M(t);if(typeof n.iss!="string")throw new Error("iss was not found");if(typeof n.aud!="string")throw new Error("aud was not found or an array of values");let s=n[a];return o.create({iss:n.iss,uidKey:a,uidVal:s,aud:n.aud,pepper:i})}static isInstance(e){return"iss"in e&&typeof e.iss=="string"&&"idCommitment"in e&&e.idCommitment instanceof Uint8Array}};o.ID_COMMITMENT_LENGTH=32;var z=o;function _(r){let{uidKey:e,uidVal:t,aud:i,pepper:a}=r,n=[P(p.fromHexInput(a).toUint8Array()),y(i,R),y(t,F),y(e,k)];return V(v(n),z.ID_COMMITMENT_LENGTH)}var D=class r extends d{constructor(e){super();let{jwtHeader:t,ephemeralCertificate:i,expiryDateSecs:a,ephemeralPublicKey:n,ephemeralSignature:s}=e;this.jwtHeader=t,this.ephemeralCertificate=i,this.expiryDateSecs=a,this.ephemeralPublicKey=n,this.ephemeralSignature=s}serialize(e){this.ephemeralCertificate.serialize(e),e.serializeStr(this.jwtHeader),e.serializeU64(this.expiryDateSecs),this.ephemeralPublicKey.serialize(e),this.ephemeralSignature.serialize(e)}static deserialize(e){let t=h.deserialize(e),i=e.deserializeStr(),a=e.deserializeU64(),n=w.deserialize(e),s=m.deserialize(e);return new r({jwtHeader:i,expiryDateSecs:Number(a),ephemeralCertificate:t,ephemeralPublicKey:n,ephemeralSignature:s})}static getSimulationSignature(){return new r({jwtHeader:"{}",ephemeralCertificate:new h(new S({proof:new f(new g({a:new Uint8Array(32),b:new Uint8Array(64),c:new Uint8Array(32)}),0),expHorizonSecs:0}),0),expiryDateSecs:0,ephemeralPublicKey:new w(new I(new Uint8Array(32))),ephemeralSignature:new m(new U(new Uint8Array(64)))})}static isSignature(e){return e instanceof r}},h=class r extends d{constructor(e,t){super(),this.signature=e,this.variant=t}toUint8Array(){return this.signature.toUint8Array()}serialize(e){e.serializeU32AsUleb128(this.variant),this.signature.serialize(e)}static deserialize(e){let t=e.deserializeUleb128AsU32();switch(t){case 0:return new r(S.deserialize(e),t);default:throw new Error(`Unknown variant index for EphemeralCertificate: ${t}`)}}},c=class r extends u{constructor(e){if(super(),this.data=p.fromHexInput(e).toUint8Array(),this.data.length!==32)throw new Error("Input needs to be 32 bytes")}serialize(e){e.serializeFixedBytes(this.data)}static deserialize(e){let t=e.deserializeFixedBytes(32);return new r(t)}},l=class r extends u{constructor(e){if(super(),this.data=p.fromHexInput(e).toUint8Array(),this.data.length!==64)throw new Error("Input needs to be 64 bytes")}serialize(e){e.serializeFixedBytes(this.data)}static deserialize(e){let t=e.deserializeFixedBytes(64);return new r(t)}},g=class r extends B{constructor(e){super();let{a:t,b:i,c:a}=e;this.a=new c(t),this.b=new l(i),this.c=new c(a)}serialize(e){this.a.serialize(e),this.b.serialize(e),this.c.serialize(e)}static deserialize(e){let t=c.deserialize(e).bcsToBytes(),i=l.deserialize(e).bcsToBytes(),a=c.deserialize(e).bcsToBytes();return new r({a:t,b:i,c:a})}},f=class r extends u{constructor(e,t){super(),this.proof=e,this.variant=t}serialize(e){e.serializeU32AsUleb128(this.variant),this.proof.serialize(e)}static deserialize(e){let t=e.deserializeUleb128AsU32();switch(t){case 0:return new r(g.deserialize(e),t);default:throw new Error(`Unknown variant index for ZkProof: ${t}`)}}},S=class r extends d{constructor(e){super();let{proof:t,expHorizonSecs:i,trainingWheelsSignature:a,extraField:n,overrideAudVal:s}=e;this.proof=t,this.expHorizonSecs=i,this.trainingWheelsSignature=a,this.extraField=n,this.overrideAudVal=s}static fromBytes(e){return r.deserialize(new G(e))}serialize(e){this.proof.serialize(e),e.serializeU64(this.expHorizonSecs),e.serializeOptionStr(this.extraField),e.serializeOptionStr(this.overrideAudVal),e.serializeOption(this.trainingWheelsSignature)}static deserialize(e){let t=f.deserialize(e),i=Number(e.deserializeU64()),a=e.deserializeOptionStr(),n=e.deserializeOptionStr(),s=e.deserializeOption(m);return new r({proof:t,expHorizonSecs:i,trainingWheelsSignature:s,extraField:a,overrideAudVal:n})}},A=class r{constructor(e,t){this.verficationKey=e,this.maxExpHorizonSecs=t}static create(e,t){return new r(new K({alphaG1:e.alpha_g1,betaG2:e.beta_g2,deltaG2:e.delta_g2,gammaAbcG1:e.gamma_abc_g1,gammaG2:e.gamma_g2}),t)}},K=class r{constructor(e){let{alphaG1:t,betaG2:i,deltaG2:a,gammaAbcG1:n,gammaG2:s}=e;this.alphaG1=new c(t),this.betaG2=new l(i),this.deltaG2=new l(a),this.gammaAbcG1=[new c(n[0]),new c(n[1])],this.gammaG2=new l(s)}static fromGroth16VerificationKeyResponse(e){return new r({alphaG1:e.alpha_g1,betaG2:e.beta_g2,deltaG2:e.delta_g2,gammaAbcG1:e.gamma_abc_g1,gammaG2:e.gamma_g2})}};async function Se(r){let{aptosConfig:e}=r;return T(async()=>{let t=await L(r),i=await N(r);return A.create(i,Number(t.max_exp_horizon_secs))},`keyless-configuration-${e.network}`,1e3*60*5)()}async function L(r){let{aptosConfig:e,options:t}=r,i="0x1::keyless_account::Configuration",{data:a}=await b({aptosConfig:e,originMethod:"getKeylessConfigurationResource",path:`accounts/${x.from("0x1").toString()}/resource/${i}`,params:{ledger_version:t?.ledgerVersion}});return a.data}async function N(r){let{aptosConfig:e,options:t}=r,i="0x1::keyless_account::Groth16VerificationKey",{data:a}=await b({aptosConfig:e,originMethod:"getGroth16VerificationKeyResource",path:`accounts/${x.from("0x1").toString()}/resource/${i}`,params:{ledger_version:t?.ledgerVersion}});return a.data}export{me as a,R as b,k as c,F as d,ye as e,he as f,ge as g,fe as h,z as i,D as j,h as k,g as l,f as m,S as n,A as o,Se as p};
|
|
2
|
+
//# sourceMappingURL=chunk-5CCHECTE.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/core/crypto/keyless.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { JwtPayload, jwtDecode } from \"jwt-decode\";\nimport { AccountPublicKey, PublicKey } from \"./publicKey\";\nimport { Signature } from \"./signature\";\nimport { Deserializer, Serializable, Serializer } from \"../../bcs\";\nimport { Hex } from \"../hex\";\nimport {\n HexInput,\n EphemeralCertificateVariant,\n AnyPublicKeyVariant,\n SigningScheme,\n ZkpVariant,\n LedgerVersionArg,\n MoveResource,\n} from \"../../types\";\nimport { EphemeralPublicKey, EphemeralSignature } from \"./ephemeral\";\nimport { bigIntToBytesLE, bytesToBigIntLE, hashStrToField, poseidonHash } from \"./poseidon\";\nimport { AuthenticationKey } from \"../authenticationKey\";\nimport { Proof } from \"./proof\";\nimport { Ed25519PublicKey, Ed25519Signature } from \"./ed25519\";\nimport { Groth16VerificationKeyResponse, KeylessConfigurationResponse } from \"../../types/keyless\";\nimport { AptosConfig } from \"../../api/aptosConfig\";\nimport { getAptosFullNode } from \"../../client\";\nimport { memoizeAsync } from \"../../utils/memoize\";\nimport { AccountAddress } from \"../accountAddress\";\n\nexport const EPK_HORIZON_SECS = 10000000;\nexport const MAX_AUD_VAL_BYTES = 120;\nexport const MAX_UID_KEY_BYTES = 30;\nexport const MAX_UID_VAL_BYTES = 330;\nexport const MAX_ISS_VAL_BYTES = 120;\nexport const MAX_EXTRA_FIELD_BYTES = 350;\nexport const MAX_JWT_HEADER_B64_BYTES = 300;\nexport const MAX_COMMITED_EPK_BYTES = 93;\n\n/**\n * Represents a Keyless Public Key used for authentication.\n *\n * This class encapsulates the public key functionality for keyless authentication,\n * including methods for generating and verifying signatures, as well as serialization\n * and deserialization of the key. The KeylessPublicKey is represented in the SDK\n * as `AnyPublicKey`.\n */\nexport class KeylessPublicKey extends AccountPublicKey {\n /**\n * The number of bytes that `idCommitment` should be\n */\n static readonly ID_COMMITMENT_LENGTH: number = 32;\n\n /**\n * The value of the 'iss' claim on the JWT which identifies the OIDC provider.\n */\n readonly iss: string;\n\n /**\n * A value representing a cryptographic commitment to a user identity.\n *\n * It is calculated from the aud, uidKey, uidVal, pepper.\n */\n readonly idCommitment: Uint8Array;\n\n /**\n * Constructs an instance with the specified parameters for cryptographic operations.\n *\n * @param args - The parameters required to initialize the instance.\n * @param args.alphaG1 - The hex representation of the alpha G1 value.\n * @param args.betaG2 - The hex representation of the beta G2 value.\n * @param args.deltaG2 - The hex representation of the delta G2 value.\n * @param args.gammaAbcG1 - An array containing two hex representations for gamma ABC G1 values.\n * @param args.gammaG2 - The hex representation of the gamma G2 value.\n */\n // TODO: Fix the JSDoc for the below values\n constructor(iss: string, idCommitment: HexInput) {\n super();\n const idcBytes = Hex.fromHexInput(idCommitment).toUint8Array();\n if (idcBytes.length !== KeylessPublicKey.ID_COMMITMENT_LENGTH) {\n throw new Error(`Id Commitment length in bytes should be ${KeylessPublicKey.ID_COMMITMENT_LENGTH}`);\n }\n this.iss = iss;\n this.idCommitment = idcBytes;\n }\n\n /**\n * Get the authentication key for the keyless public key.\n *\n * @returns AuthenticationKey - The authentication key derived from the keyless public key.\n */\n authKey(): AuthenticationKey {\n const serializer = new Serializer();\n serializer.serializeU32AsUleb128(AnyPublicKeyVariant.Keyless);\n serializer.serializeFixedBytes(this.bcsToBytes());\n return AuthenticationKey.fromSchemeAndBytes({\n scheme: SigningScheme.SingleKey,\n input: serializer.toUint8Array(),\n });\n }\n\n /**\n * Verifies the validity of a signature for a given message.\n *\n * @param args - The arguments for signature verification.\n * @param args.message - The message that was signed.\n * @param args.signature - The signature to verify against the message.\n * @returns true if the signature is valid; otherwise, false.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars, class-methods-use-this\n verifySignature(args: { message: HexInput; signature: KeylessSignature }): boolean {\n throw new Error(\"Not yet implemented\");\n }\n\n /**\n * Serializes the current instance into a format suitable for transmission or storage.\n * This function ensures that all relevant fields are properly serialized, including the proof and optional fields.\n *\n * @param serializer - The serializer instance used to perform the serialization.\n * @param serializer.proof - The proof to be serialized.\n * @param serializer.expHorizonSecs - The expiration horizon in seconds.\n * @param serializer.extraField - An optional additional field for serialization.\n * @param serializer.overrideAudVal - An optional override value for auditing.\n * @param serializer.trainingWheelsSignature - An optional signature for training wheels.\n */\n serialize(serializer: Serializer): void {\n serializer.serializeStr(this.iss);\n serializer.serializeBytes(this.idCommitment);\n }\n\n /**\n * Deserializes a ZeroKnowledgeSig object from the provided deserializer.\n * This function allows you to reconstruct a ZeroKnowledgeSig instance from its serialized form.\n *\n * @param deserializer - The deserializer instance used to read the serialized data.\n * @returns A new instance of ZeroKnowledgeSig.\n */\n static deserialize(deserializer: Deserializer): KeylessPublicKey {\n const iss = deserializer.deserializeStr();\n const addressSeed = deserializer.deserializeBytes();\n return new KeylessPublicKey(iss, addressSeed);\n }\n\n /**\n * Loads a KeylessPublicKey instance from the provided deserializer.\n * This function is used to deserialize the necessary components to create a KeylessPublicKey.\n *\n * @param deserializer - The deserializer used to extract the string and byte data.\n * @param deserializer.deserializeStr - A method to deserialize a string value.\n * @param deserializer.deserializeBytes - A method to deserialize byte data.\n * @returns A new instance of KeylessPublicKey.\n */\n static load(deserializer: Deserializer): KeylessPublicKey {\n const iss = deserializer.deserializeStr();\n const addressSeed = deserializer.deserializeBytes();\n return new KeylessPublicKey(iss, addressSeed);\n }\n\n /**\n * Determines if the provided public key is an instance of KeylessPublicKey.\n *\n * @param publicKey - The public key to check.\n * @returns A boolean indicating whether the public key is a KeylessPublicKey instance.\n */\n static isPublicKey(publicKey: PublicKey): publicKey is KeylessPublicKey {\n return publicKey instanceof KeylessPublicKey;\n }\n\n /**\n * Creates a KeylessPublicKey from the JWT components plus pepper\n *\n * @param args.iss the iss of the identity\n * @param args.uidKey the key to use to get the uidVal in the JWT token\n * @param args.uidVal the value of the uidKey in the JWT token\n * @param args.aud the client ID of the application\n * @param args.pepper The pepper used to maintain privacy of the account\n * @returns KeylessPublicKey\n */\n static create(args: {\n iss: string;\n uidKey: string;\n uidVal: string;\n aud: string;\n pepper: HexInput;\n }): KeylessPublicKey {\n computeIdCommitment(args);\n return new KeylessPublicKey(args.iss, computeIdCommitment(args));\n }\n\n /**\n * Creates a KeylessPublicKey instance from a JWT and a pepper value.\n * This function is useful for generating a public key that can be used for authentication based on the provided JWT claims and pepper.\n *\n * @param args - The arguments for creating the KeylessPublicKey.\n * @param args.jwt - The JSON Web Token to decode.\n * @param args.pepper - The pepper value used in the key creation process.\n * @param args.uidKey - An optional key to retrieve the unique identifier from the JWT payload, defaults to \"sub\".\n * @returns A KeylessPublicKey instance created from the provided JWT and pepper.\n */\n static fromJwtAndPepper(args: { jwt: string; pepper: HexInput; uidKey?: string }): KeylessPublicKey {\n const { jwt, pepper, uidKey = \"sub\" } = args;\n const jwtPayload = jwtDecode<JwtPayload & { [key: string]: string }>(jwt);\n if (typeof jwtPayload.iss !== \"string\") {\n throw new Error(\"iss was not found\");\n }\n if (typeof jwtPayload.aud !== \"string\") {\n throw new Error(\"aud was not found or an array of values\");\n }\n const uidVal = jwtPayload[uidKey];\n return KeylessPublicKey.create({ iss: jwtPayload.iss, uidKey, uidVal, aud: jwtPayload.aud, pepper });\n }\n\n /**\n * Checks if the provided public key is a valid instance by verifying its structure and types.\n *\n * @param publicKey - The public key to validate.\n * @returns A boolean indicating whether the public key is a valid instance.\n */\n static isInstance(publicKey: PublicKey) {\n return (\n \"iss\" in publicKey &&\n typeof publicKey.iss === \"string\" &&\n \"idCommitment\" in publicKey &&\n publicKey.idCommitment instanceof Uint8Array\n );\n }\n}\n\nfunction computeIdCommitment(args: { uidKey: string; uidVal: string; aud: string; pepper: HexInput }): Uint8Array {\n const { uidKey, uidVal, aud, pepper } = args;\n\n const fields = [\n bytesToBigIntLE(Hex.fromHexInput(pepper).toUint8Array()),\n hashStrToField(aud, MAX_AUD_VAL_BYTES),\n hashStrToField(uidVal, MAX_UID_VAL_BYTES),\n hashStrToField(uidKey, MAX_UID_KEY_BYTES),\n ];\n\n return bigIntToBytesLE(poseidonHash(fields), KeylessPublicKey.ID_COMMITMENT_LENGTH);\n}\n\n/**\n * Represents a signature of a message signed via a Keyless Account, utilizing proofs or a JWT token for authentication.\n */\nexport class KeylessSignature extends Signature {\n /**\n * The inner signature ZeroKnowledgeSignature or OpenIdSignature\n */\n readonly ephemeralCertificate: EphemeralCertificate;\n\n /**\n * The jwt header in the token used to create the proof/signature. In json string representation.\n */\n readonly jwtHeader: string;\n\n /**\n * The expiry timestamp in seconds of the EphemeralKeyPair used to sign\n */\n readonly expiryDateSecs: number;\n\n /**\n * The ephemeral public key used to verify the signature\n */\n readonly ephemeralPublicKey: EphemeralPublicKey;\n\n /**\n * The signature resulting from signing with the private key of the EphemeralKeyPair\n */\n readonly ephemeralSignature: EphemeralSignature;\n\n constructor(args: {\n jwtHeader: string;\n ephemeralCertificate: EphemeralCertificate;\n expiryDateSecs: number;\n ephemeralPublicKey: EphemeralPublicKey;\n ephemeralSignature: EphemeralSignature;\n }) {\n super();\n const { jwtHeader, ephemeralCertificate, expiryDateSecs, ephemeralPublicKey, ephemeralSignature } = args;\n this.jwtHeader = jwtHeader;\n this.ephemeralCertificate = ephemeralCertificate;\n this.expiryDateSecs = expiryDateSecs;\n this.ephemeralPublicKey = ephemeralPublicKey;\n this.ephemeralSignature = ephemeralSignature;\n }\n\n serialize(serializer: Serializer): void {\n this.ephemeralCertificate.serialize(serializer);\n serializer.serializeStr(this.jwtHeader);\n serializer.serializeU64(this.expiryDateSecs);\n this.ephemeralPublicKey.serialize(serializer);\n this.ephemeralSignature.serialize(serializer);\n }\n\n static deserialize(deserializer: Deserializer): KeylessSignature {\n const ephemeralCertificate = EphemeralCertificate.deserialize(deserializer);\n const jwtHeader = deserializer.deserializeStr();\n const expiryDateSecs = deserializer.deserializeU64();\n const ephemeralPublicKey = EphemeralPublicKey.deserialize(deserializer);\n const ephemeralSignature = EphemeralSignature.deserialize(deserializer);\n return new KeylessSignature({\n jwtHeader,\n expiryDateSecs: Number(expiryDateSecs),\n ephemeralCertificate,\n ephemeralPublicKey,\n ephemeralSignature,\n });\n }\n\n static getSimulationSignature(): KeylessSignature {\n return new KeylessSignature({\n jwtHeader: \"{}\",\n ephemeralCertificate: new EphemeralCertificate(\n new ZeroKnowledgeSig({\n proof: new ZkProof(\n new Groth16Zkp({ a: new Uint8Array(32), b: new Uint8Array(64), c: new Uint8Array(32) }),\n ZkpVariant.Groth16,\n ),\n expHorizonSecs: 0,\n }),\n EphemeralCertificateVariant.ZkProof,\n ),\n expiryDateSecs: 0,\n ephemeralPublicKey: new EphemeralPublicKey(new Ed25519PublicKey(new Uint8Array(32))),\n ephemeralSignature: new EphemeralSignature(new Ed25519Signature(new Uint8Array(64))),\n });\n }\n\n static isSignature(signature: Signature): signature is KeylessSignature {\n return signature instanceof KeylessSignature;\n }\n}\n\n/**\n * Represents an ephemeral certificate containing a signature, specifically a ZeroKnowledgeSig.\n * This class can be extended to support additional signature types, such as OpenIdSignature.\n *\n * @extends Signature\n */\nexport class EphemeralCertificate extends Signature {\n public readonly signature: Signature;\n\n /**\n * Index of the underlying enum variant\n */\n private readonly variant: EphemeralCertificateVariant;\n\n constructor(signature: Signature, variant: EphemeralCertificateVariant) {\n super();\n this.signature = signature;\n this.variant = variant;\n }\n\n /**\n * Get the public key in bytes (Uint8Array).\n *\n * @returns Uint8Array representation of the public key\n */\n toUint8Array(): Uint8Array {\n return this.signature.toUint8Array();\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(this.variant);\n this.signature.serialize(serializer);\n }\n\n static deserialize(deserializer: Deserializer): EphemeralCertificate {\n const variant = deserializer.deserializeUleb128AsU32();\n switch (variant) {\n case EphemeralCertificateVariant.ZkProof:\n return new EphemeralCertificate(ZeroKnowledgeSig.deserialize(deserializer), variant);\n default:\n throw new Error(`Unknown variant index for EphemeralCertificate: ${variant}`);\n }\n }\n}\n\n/**\n * Represents a fixed-size byte array of 32 bytes, extending the Serializable class.\n * This class is used for handling and serializing G1 bytes in cryptographic operations.\n *\n * @extends Serializable\n */\nclass G1Bytes extends Serializable {\n data: Uint8Array;\n\n constructor(data: HexInput) {\n super();\n this.data = Hex.fromHexInput(data).toUint8Array();\n if (this.data.length !== 32) {\n throw new Error(\"Input needs to be 32 bytes\");\n }\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeFixedBytes(this.data);\n }\n\n static deserialize(deserializer: Deserializer): G1Bytes {\n const bytes = deserializer.deserializeFixedBytes(32);\n return new G1Bytes(bytes);\n }\n}\n\n/**\n * Represents a 64-byte G2 element in a cryptographic context.\n * This class provides methods for serialization and deserialization of G2 bytes.\n *\n * @extends Serializable\n */\nclass G2Bytes extends Serializable {\n data: Uint8Array;\n\n constructor(data: HexInput) {\n super();\n this.data = Hex.fromHexInput(data).toUint8Array();\n if (this.data.length !== 64) {\n throw new Error(\"Input needs to be 64 bytes\");\n }\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeFixedBytes(this.data);\n }\n\n static deserialize(deserializer: Deserializer): G2Bytes {\n const bytes = deserializer.deserializeFixedBytes(64);\n return new G2Bytes(bytes);\n }\n}\n\n/**\n * Represents a Groth16 zero-knowledge proof, consisting of three proof points in compressed serialization format.\n * The points are the compressed serialization of affine representation of the proof.\n *\n * @extends Proof\n */\nexport class Groth16Zkp extends Proof {\n /**\n * The bytes of G1 proof point a\n */\n a: G1Bytes;\n\n /**\n * The bytes of G2 proof point b\n */\n b: G2Bytes;\n\n /**\n * The bytes of G1 proof point c\n */\n c: G1Bytes;\n\n constructor(args: { a: HexInput; b: HexInput; c: HexInput }) {\n super();\n const { a, b, c } = args;\n this.a = new G1Bytes(a);\n this.b = new G2Bytes(b);\n this.c = new G1Bytes(c);\n }\n\n serialize(serializer: Serializer): void {\n this.a.serialize(serializer);\n this.b.serialize(serializer);\n this.c.serialize(serializer);\n }\n\n static deserialize(deserializer: Deserializer): Groth16Zkp {\n const a = G1Bytes.deserialize(deserializer).bcsToBytes();\n const b = G2Bytes.deserialize(deserializer).bcsToBytes();\n const c = G1Bytes.deserialize(deserializer).bcsToBytes();\n return new Groth16Zkp({ a, b, c });\n }\n}\n\n/**\n * Represents a container for different types of zero-knowledge proofs.\n *\n * @extends Serializable\n */\nexport class ZkProof extends Serializable {\n public readonly proof: Proof;\n\n /**\n * Index of the underlying enum variant\n */\n private readonly variant: ZkpVariant;\n\n constructor(proof: Proof, variant: ZkpVariant) {\n super();\n this.proof = proof;\n this.variant = variant;\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(this.variant);\n this.proof.serialize(serializer);\n }\n\n static deserialize(deserializer: Deserializer): ZkProof {\n const variant = deserializer.deserializeUleb128AsU32();\n switch (variant) {\n case ZkpVariant.Groth16:\n return new ZkProof(Groth16Zkp.deserialize(deserializer), variant);\n default:\n throw new Error(`Unknown variant index for ZkProof: ${variant}`);\n }\n }\n}\n\n/**\n * Represents a zero-knowledge signature, encapsulating the proof and its associated metadata.\n *\n * @extends Signature\n */\nexport class ZeroKnowledgeSig extends Signature {\n /**\n * The proof\n */\n readonly proof: ZkProof;\n\n /**\n * The max lifespan of the proof\n */\n readonly expHorizonSecs: number;\n\n /**\n * A key value pair on the JWT token that can be specified on the signature which would reveal the value on chain.\n * Can be used to assert identity or other attributes.\n */\n readonly extraField?: string;\n\n /**\n * The 'aud' value of the recovery service which is set when recovering an account.\n */\n readonly overrideAudVal?: string;\n\n /**\n * The training wheels signature\n */\n readonly trainingWheelsSignature?: EphemeralSignature;\n\n constructor(args: {\n proof: ZkProof;\n expHorizonSecs: number;\n extraField?: string;\n overrideAudVal?: string;\n trainingWheelsSignature?: EphemeralSignature;\n }) {\n super();\n const { proof, expHorizonSecs, trainingWheelsSignature, extraField, overrideAudVal } = args;\n this.proof = proof;\n this.expHorizonSecs = expHorizonSecs;\n this.trainingWheelsSignature = trainingWheelsSignature;\n this.extraField = extraField;\n this.overrideAudVal = overrideAudVal;\n }\n\n /**\n * Deserialize a ZeroKnowledgeSig object from its BCS serialization in bytes.\n *\n * @param bytes - The bytes representing the serialized ZeroKnowledgeSig.\n * @returns ZeroKnowledgeSig - The deserialized ZeroKnowledgeSig object.\n */\n static fromBytes(bytes: Uint8Array): ZeroKnowledgeSig {\n return ZeroKnowledgeSig.deserialize(new Deserializer(bytes));\n }\n\n serialize(serializer: Serializer): void {\n this.proof.serialize(serializer);\n serializer.serializeU64(this.expHorizonSecs);\n serializer.serializeOptionStr(this.extraField);\n serializer.serializeOptionStr(this.overrideAudVal);\n serializer.serializeOption(this.trainingWheelsSignature);\n }\n\n static deserialize(deserializer: Deserializer): ZeroKnowledgeSig {\n const proof = ZkProof.deserialize(deserializer);\n const expHorizonSecs = Number(deserializer.deserializeU64());\n const extraField = deserializer.deserializeOptionStr();\n const overrideAudVal = deserializer.deserializeOptionStr();\n const trainingWheelsSignature = deserializer.deserializeOption(EphemeralSignature);\n return new ZeroKnowledgeSig({ proof, expHorizonSecs, trainingWheelsSignature, extraField, overrideAudVal });\n }\n}\n\n/**\n * Represents the on-chain configuration for how Keyless accounts operate.\n *\n * @remarks\n * This class encapsulates the verification key and the maximum lifespan of ephemeral key pairs,\n * which are essential for the functionality of Keyless accounts.\n */\nexport class KeylessConfiguration {\n /**\n * The verification key used to verify Groth16 proofs on chain\n */\n // TODO: Rename to verificationKey\n readonly verficationKey: Groth16VerificationKey;\n\n /**\n * The maximum lifespan of an ephemeral key pair. This is configured on chain.\n */\n readonly maxExpHorizonSecs: number;\n\n constructor(verficationKey: Groth16VerificationKey, maxExpHorizonSecs: number) {\n this.verficationKey = verficationKey;\n this.maxExpHorizonSecs = maxExpHorizonSecs;\n }\n\n static create(res: Groth16VerificationKeyResponse, maxExpHorizonSecs: number): KeylessConfiguration {\n return new KeylessConfiguration(\n new Groth16VerificationKey({\n alphaG1: res.alpha_g1,\n betaG2: res.beta_g2,\n deltaG2: res.delta_g2,\n gammaAbcG1: res.gamma_abc_g1,\n gammaG2: res.gamma_g2,\n }),\n maxExpHorizonSecs,\n );\n }\n}\n\n/**\n * Represents the verification key stored on-chain used to verify Groth16 proofs.\n */\nclass Groth16VerificationKey {\n // The docstrings below are borrowed from ark-groth16\n\n /**\n * The `alpha * G`, where `G` is the generator of G1\n */\n readonly alphaG1: G1Bytes;\n\n /**\n * The `alpha * H`, where `H` is the generator of G2\n */\n readonly betaG2: G2Bytes;\n\n /**\n * The `delta * H`, where `H` is the generator of G2\n */\n readonly deltaG2: G2Bytes;\n\n /**\n * The `gamma^{-1} * (beta * a_i + alpha * b_i + c_i) * H`, where H is the generator of G1\n */\n readonly gammaAbcG1: G1Bytes[];\n\n /**\n * The `gamma * H`, where `H` is the generator of G2\n */\n readonly gammaG2: G2Bytes;\n\n constructor(args: {\n alphaG1: HexInput;\n betaG2: HexInput;\n deltaG2: HexInput;\n gammaAbcG1: [HexInput, HexInput];\n gammaG2: HexInput;\n }) {\n const { alphaG1, betaG2, deltaG2, gammaAbcG1, gammaG2 } = args;\n this.alphaG1 = new G1Bytes(alphaG1);\n this.betaG2 = new G2Bytes(betaG2);\n this.deltaG2 = new G2Bytes(deltaG2);\n this.gammaAbcG1 = [new G1Bytes(gammaAbcG1[0]), new G1Bytes(gammaAbcG1[1])];\n this.gammaG2 = new G2Bytes(gammaG2);\n }\n\n /**\n * Converts a Groth16VerificationKeyResponse object into a Groth16VerificationKey instance.\n *\n * @param res - The Groth16VerificationKeyResponse object containing the verification key data.\n * @param res.alpha_g1 - The alpha G1 value from the response.\n * @param res.beta_g2 - The beta G2 value from the response.\n * @param res.delta_g2 - The delta G2 value from the response.\n * @param res.gamma_abc_g1 - The gamma ABC G1 value from the response.\n * @param res.gamma_g2 - The gamma G2 value from the response.\n * @returns A Groth16VerificationKey instance constructed from the provided response data.\n */\n static fromGroth16VerificationKeyResponse(res: Groth16VerificationKeyResponse): Groth16VerificationKey {\n return new Groth16VerificationKey({\n alphaG1: res.alpha_g1,\n betaG2: res.beta_g2,\n deltaG2: res.delta_g2,\n gammaAbcG1: res.gamma_abc_g1,\n gammaG2: res.gamma_g2,\n });\n }\n}\n\n/**\n * Retrieves the configuration parameters for Keyless Accounts on the blockchain, including the verifying key and the maximum\n * expiry horizon.\n *\n * @param args - The arguments for retrieving the keyless configuration.\n * @param args.aptosConfig - The Aptos configuration object containing network details.\n * @param args.options - Optional parameters for the request.\n * @param args.options.ledgerVersion - The ledger version to query; if not provided, the latest version will be used.\n * @returns KeylessConfiguration - The configuration object containing the verifying key and maximum expiry horizon.\n */\nexport async function getKeylessConfig(args: {\n aptosConfig: AptosConfig;\n options?: LedgerVersionArg;\n}): Promise<KeylessConfiguration> {\n const { aptosConfig } = args;\n return memoizeAsync(\n async () => {\n const config = await getKeylessConfigurationResource(args);\n const vk = await getGroth16VerificationKeyResource(args);\n return KeylessConfiguration.create(vk, Number(config.max_exp_horizon_secs));\n },\n `keyless-configuration-${aptosConfig.network}`,\n 1000 * 60 * 5, // 5 minutes\n )();\n}\n\n/**\n * Retrieves the KeylessConfiguration set on chain.\n *\n * @param args - The arguments for retrieving the configuration.\n * @param args.aptosConfig - The configuration for connecting to the Aptos network.\n * @param args.options - Optional parameters for the request.\n * @param args.options.ledgerVersion - The ledger version to query; if not provided, it will get the latest version.\n * @returns KeylessConfigurationResponse - The response containing the keyless configuration data.\n */\nasync function getKeylessConfigurationResource(args: {\n aptosConfig: AptosConfig;\n options?: LedgerVersionArg;\n}): Promise<KeylessConfigurationResponse> {\n const { aptosConfig, options } = args;\n const resourceType = \"0x1::keyless_account::Configuration\";\n const { data } = await getAptosFullNode<{}, MoveResource<KeylessConfigurationResponse>>({\n aptosConfig,\n originMethod: \"getKeylessConfigurationResource\",\n path: `accounts/${AccountAddress.from(\"0x1\").toString()}/resource/${resourceType}`,\n params: { ledger_version: options?.ledgerVersion },\n });\n\n return data.data;\n}\n\n/**\n * Retrieves the Groth16VerificationKey set on the blockchain.\n *\n * @param args - The arguments for retrieving the verification key.\n * @param args.aptosConfig - The Aptos configuration object.\n * @param args.options - Optional parameters for the request.\n * @param args.options.ledgerVersion - The ledger version to query; if not provided, it will get the latest version.\n * @returns Groth16VerificationKeyResponse - The response containing the Groth16 verification key data.\n */\nasync function getGroth16VerificationKeyResource(args: {\n aptosConfig: AptosConfig;\n options?: LedgerVersionArg;\n}): Promise<Groth16VerificationKeyResponse> {\n const { aptosConfig, options } = args;\n const resourceType = \"0x1::keyless_account::Groth16VerificationKey\";\n const { data } = await getAptosFullNode<{}, MoveResource<Groth16VerificationKeyResponse>>({\n aptosConfig,\n originMethod: \"getGroth16VerificationKeyResource\",\n path: `accounts/${AccountAddress.from(\"0x1\").toString()}/resource/${resourceType}`,\n params: { ledger_version: options?.ledgerVersion },\n });\n\n return data.data;\n}\n"],"mappings":"0jBAGA,OAAqB,aAAAA,MAAiB,aAyB/B,IAAMC,GAAmB,IACnBC,EAAoB,IACpBC,EAAoB,GACpBC,EAAoB,IACpBC,GAAoB,IACpBC,GAAwB,IACxBC,GAA2B,IAC3BC,GAAyB,GAUzBC,EAAN,MAAMA,UAAyBC,CAAiB,CA6BrD,YAAYC,EAAaC,EAAwB,CAC/C,MAAM,EACN,IAAMC,EAAWC,EAAI,aAAaF,CAAY,EAAE,aAAa,EAC7D,GAAIC,EAAS,SAAWJ,EAAiB,qBACvC,MAAM,IAAI,MAAM,2CAA2CA,EAAiB,oBAAoB,EAAE,EAEpG,KAAK,IAAME,EACX,KAAK,aAAeE,CACtB,CAOA,SAA6B,CAC3B,IAAME,EAAa,IAAIC,EACvB,OAAAD,EAAW,uBAAiD,EAC5DA,EAAW,oBAAoB,KAAK,WAAW,CAAC,EACzCE,EAAkB,mBAAmB,CAC1C,SACA,MAAOF,EAAW,aAAa,CACjC,CAAC,CACH,CAWA,gBAAgBG,EAAmE,CACjF,MAAM,IAAI,MAAM,qBAAqB,CACvC,CAaA,UAAUH,EAA8B,CACtCA,EAAW,aAAa,KAAK,GAAG,EAChCA,EAAW,eAAe,KAAK,YAAY,CAC7C,CASA,OAAO,YAAYI,EAA8C,CAC/D,IAAMR,EAAMQ,EAAa,eAAe,EAClCC,EAAcD,EA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GL,CAC1C,GAAM,CAAE,YAAAsE,EAAa,QAAAM,CAAQ,EAAI5E,EAC3B6E,EAAe,+CACf,CAAE,KAAArC,CAAK,EAAI,MAAMsC,EAAmE,CACxF,YAAAR,EACA,aAAc,oCACd,KAAM,YAAYS,EAAe,KAAK,KAAK,EAAE,SAAS,CAAC,aAAaF,CAAY,GAChF,OAAQ,CAAE,eAAgBD,GAAS,aAAc,CACnD,CAAC,EAED,OAAOpC,EAAK,IACd","names":["jwtDecode","EPK_HORIZON_SECS","MAX_AUD_VAL_BYTES","MAX_UID_KEY_BYTES","MAX_UID_VAL_BYTES","MAX_ISS_VAL_BYTES","MAX_EXTRA_FIELD_BYTES","MAX_JWT_HEADER_B64_BYTES","MAX_COMMITED_EPK_BYTES","_KeylessPublicKey","AccountPublicKey","iss","idCommitment","idcBytes","Hex","serializer","Serializer","AuthenticationKey","args","deserializer","addressSeed","publicKey","computeIdCommitment","jwt","pepper","uidKey","jwtPayload","jwtDecode","uidVal","KeylessPublicKey","aud","fields","bytesToBigIntLE","hashStrToField","bigIntToBytesLE","poseidonHash","KeylessSignature","_KeylessSignature","Signature","jwtHeader","ephemeralCertificate","expiryDateSecs","ephemeralPublicKey","ephemeralSignature","EphemeralCertificate","EphemeralPublicKey","EphemeralSignature","ZeroKnowledgeSig","ZkProof","Groth16Zkp","Ed25519PublicKey","Ed25519Signature","signature","_EphemeralCertificate","variant","G1Bytes","_G1Bytes","Serializable","data","bytes","G2Bytes","_G2Bytes","_Groth16Zkp","Proof","a","b","c","_ZkProof","proof","_ZeroKnowledgeSig","expHorizonSecs","trainingWheelsSignature","extraField","overrideAudVal","Deserializer","KeylessConfiguration","_KeylessConfiguration","verficationKey","maxExpHorizonSecs","res","Groth16VerificationKey","_Groth16VerificationKey","alphaG1","betaG2","deltaG2","gammaAbcG1","gammaG2","getKeylessConfig","aptosConfig","memoizeAsync","config","getKeylessConfigurationResource","vk","getGroth16VerificationKeyResource","options","resourceType","getAptosFullNode","AccountAddress"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as i,b as o,c as a,d as c,e as p,f as d,g,h as u,i as A,j as y,k as m,l,m as T,n as f,o as C,p as I,q as O,r as P,s as D,t as V,u as S,v as h,w as R,x as G}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as i,b as o,c as a,d as c,e as p,f as d,g,h as u,i as A,j as y,k as m,l,m as T,n as f,o as C,p as I,q as O,r as P,s as D,t as V,u as S,v as h,w as R,x as G}from"./chunk-QRTZYRH2.mjs";import{a as e}from"./chunk-TRU3EK64.mjs";import{b as s}from"./chunk-KM6UXNC7.mjs";var L=class{constructor(t){this.config=t}async getCollectionData(t){await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"});let{creatorAddress:N,collectionName:_,options:n}=t,w=s.from(N),r={collection_name:{_eq:_},creator_address:{_eq:w.toStringLong()}};return n?.tokenStandard&&(r.token_standard={_eq:n?.tokenStandard??"v2"}),d({aptosConfig:this.config,options:{where:r}})}async getCollectionDataByCreatorAddressAndCollectionName(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),g({aptosConfig:this.config,...t})}async getCollectionDataByCreatorAddress(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),u({aptosConfig:this.config,...t})}async getCollectionDataByCollectionId(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),A({aptosConfig:this.config,...t})}async getCollectionId(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),y({aptosConfig:this.config,...t})}async getDigitalAssetData(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),i({aptosConfig:this.config,...t})}async getCurrentDigitalAssetOwnership(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),o({aptosConfig:this.config,...t})}async getOwnedDigitalAssets(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),a({aptosConfig:this.config,...t})}async getDigitalAssetActivity(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),c({aptosConfig:this.config,...t})}async createCollectionTransaction(t){return p({aptosConfig:this.config,...t})}async mintDigitalAssetTransaction(t){return m({aptosConfig:this.config,...t})}async transferDigitalAssetTransaction(t){return l({aptosConfig:this.config,...t})}async mintSoulBoundTransaction(t){return T({aptosConfig:this.config,...t})}async burnDigitalAssetTransaction(t){return f({aptosConfig:this.config,...t})}async freezeDigitalAssetTransaferTransaction(t){return C({aptosConfig:this.config,...t})}async unfreezeDigitalAssetTransaferTransaction(t){return I({aptosConfig:this.config,...t})}async setDigitalAssetDescriptionTransaction(t){return O({aptosConfig:this.config,...t})}async setDigitalAssetNameTransaction(t){return P({aptosConfig:this.config,...t})}async setDigitalAssetURITransaction(t){return D({aptosConfig:this.config,...t})}async addDigitalAssetPropertyTransaction(t){return V({aptosConfig:this.config,...t})}async removeDigitalAssetPropertyTransaction(t){return S({aptosConfig:this.config,...t})}async updateDigitalAssetPropertyTransaction(t){return h({aptosConfig:this.config,...t})}async addDigitalAssetTypedPropertyTransaction(t){return R({aptosConfig:this.config,...t})}async updateDigitalAssetTypedPropertyTransaction(t){return G({aptosConfig:this.config,...t})}};export{L as a};
|
|
2
|
+
//# sourceMappingURL=chunk-5XXIIWG7.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/api/digitalAsset.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n AnyNumber,\n GetCollectionDataResponse,\n GetCurrentTokenOwnershipResponse,\n GetOwnedTokensResponse,\n GetTokenActivityResponse,\n GetTokenDataResponse,\n MoveStructId,\n OrderByArg,\n PaginationArgs,\n TokenStandardArg,\n} from \"../types\";\nimport { AccountAddress, AccountAddressInput } from \"../core\";\nimport { Account } from \"../account\";\nimport { InputGenerateTransactionOptions } from \"../transactions/types\";\nimport {\n addDigitalAssetPropertyTransaction,\n addDigitalAssetTypedPropertyTransaction,\n burnDigitalAssetTransaction,\n CreateCollectionOptions,\n createCollectionTransaction,\n freezeDigitalAssetTransferTransaction,\n getCollectionData,\n getCollectionDataByCollectionId,\n getCollectionDataByCreatorAddress,\n getCollectionDataByCreatorAddressAndCollectionName,\n getCollectionId,\n getCurrentDigitalAssetOwnership,\n getDigitalAssetActivity,\n getDigitalAssetData,\n getOwnedDigitalAssets,\n mintDigitalAssetTransaction,\n mintSoulBoundTransaction,\n PropertyType,\n PropertyValue,\n removeDigitalAssetPropertyTransaction,\n setDigitalAssetDescriptionTransaction,\n setDigitalAssetNameTransaction,\n setDigitalAssetURITransaction,\n transferDigitalAssetTransaction,\n unfreezeDigitalAssetTransferTransaction,\n updateDigitalAssetPropertyTransaction,\n updateDigitalAssetTypedPropertyTransaction,\n} from \"../internal/digitalAsset\";\nimport { ProcessorType } from \"../utils/const\";\nimport { AptosConfig } from \"./aptosConfig\";\nimport { waitForIndexerOnVersion } from \"./utils\";\nimport { SimpleTransaction } from \"../transactions/instances/simpleTransaction\";\n\n/**\n * A class to query all `DigitalAsset` related queries on Aptos.\n */\nexport class DigitalAsset {\n /**\n * Initializes a new instance of the Aptos client with the specified configuration.\n * This allows you to interact with the Aptos blockchain using the provided settings.\n *\n * @param config - The configuration settings for the Aptos client.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * async function runExample() {\n * // Create a configuration for the Aptos client\n * const config = new AptosConfig({ network: Network.TESTNET }); // Specify your desired network\n *\n * // Initialize the Aptos client with the configuration\n * const aptos = new Aptos(config);\n *\n * console.log(\"Aptos client initialized:\", aptos);\n * }\n * runExample().catch(console.error);\n * ```\n */\n constructor(readonly config: AptosConfig) {}\n\n /**\n * Queries data of a specific collection by the collection creator address and the collection name.\n * This function is deprecated; use `getCollectionDataByCreatorAddressAndCollectionName` instead.\n *\n * If a creator account has two collections with the same name in v1 and v2, you can pass an optional `tokenStandard` parameter\n * to query a specific standard.\n *\n * @param args - The arguments for querying the collection data.\n * @param args.creatorAddress - The address of the collection's creator.\n * @param args.collectionName - The name of the collection.\n * @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.\n * @param args.options - Optional parameters for the query.\n * @param args.options.tokenStandard - The token standard to query.\n * @returns GetCollectionDataResponse - The response type containing the collection data.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Querying collection data by creator address and collection name\n * const collection = await aptos.getCollectionData({\n * creatorAddress: \"0x1\", // replace with a real creator address\n * collectionName: \"myCollection\", // specify your collection name\n * });\n *\n * console.log(collection);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async getCollectionData(args: {\n creatorAddress: AccountAddressInput;\n collectionName: string;\n minimumLedgerVersion?: AnyNumber;\n options?: TokenStandardArg;\n }): Promise<GetCollectionDataResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.TOKEN_V2_PROCESSOR,\n });\n\n const { creatorAddress, collectionName, options } = args;\n const address = AccountAddress.from(creatorAddress);\n\n const whereCondition: any = {\n collection_name: { _eq: collectionName },\n creator_address: { _eq: address.toStringLong() },\n };\n if (options?.tokenStandard) {\n whereCondition.token_standard = { _eq: options?.tokenStandard ?? \"v2\" };\n }\n\n return getCollectionData({ aptosConfig: this.config, options: { where: whereCondition } });\n }\n\n /**\n * Queries data of a specific collection by the collection creator address and the collection name.\n * If a creator account has multiple collections with the same name across different versions,\n * specify the `tokenStandard` parameter to query a specific standard.\n *\n * @param args.creatorAddress - The address of the collection's creator.\n * @param args.collectionName - The name of the collection.\n * @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.\n * @param args.options.tokenStandard - Optional token standard to query.\n * @returns GetCollectionDataResponse - The response type containing collection data.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Fetching collection data by creator address and collection name\n * const collection = await aptos.getCollectionDataByCreatorAddressAndCollectionName({\n * creatorAddress: \"0x1\", // replace with a real creator address\n * collectionName: \"myCollection\",\n * minimumLedgerVersion: 1, // optional, specify if needed\n * options: { tokenStandard: \"v2\" } // optional, specify if needed\n * });\n *\n * console.log(collection);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async getCollectionDataByCreatorAddressAndCollectionName(args: {\n creatorAddress: AccountAddressInput;\n collectionName: string;\n minimumLedgerVersion?: AnyNumber;\n options?: TokenStandardArg & PaginationArgs;\n }): Promise<GetCollectionDataResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.TOKEN_V2_PROCESSOR,\n });\n\n return getCollectionDataByCreatorAddressAndCollectionName({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Retrieves data for a specific collection created by a given creator address.\n * This function allows you to query collection data while optionally specifying a minimum ledger version and pagination options.\n *\n * @param args.creatorAddress - The address of the collection's creator.\n * @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.\n * @param args.options.tokenStandard - Optional token standard to query.\n * @param args.options.pagination - Optional pagination arguments.\n * @returns GetCollectionDataResponse - The response type containing collection data.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Retrieve collection data by creator address\n * const collectionData = await aptos.getCollectionDataByCreatorAddress({\n * creatorAddress: \"0x1\", // replace with a real creator address\n * minimumLedgerVersion: 1, // specify the minimum ledger version if needed\n * options: {\n * tokenStandard: \"v2\", // specify the token standard if needed\n * pagination: { limit: 10, offset: 0 } // specify pagination options if needed\n * }\n * });\n *\n * console.log(collectionData);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async getCollectionDataByCreatorAddress(args: {\n creatorAddress: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n options?: TokenStandardArg & PaginationArgs;\n }): Promise<GetCollectionDataResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.TOKEN_V2_PROCESSOR,\n });\n\n return getCollectionDataByCreatorAddress({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries data of a specific collection by the collection ID.\n *\n * @param args.collectionId - The ID of the collection, which is the same as the address of the collection object.\n * @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.\n * @param args.options - Optional parameters for token standard and pagination.\n * @returns GetCollectionDataResponse - The response type containing the collection data.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Fetching collection data by collection ID\n * const collection = await aptos.getCollectionDataByCollectionId({\n * collectionId: \"0x123\", // replace with a real collection ID\n * });\n *\n * console.log(collection);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async getCollectionDataByCollectionId(args: {\n collectionId: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n options?: TokenStandardArg & PaginationArgs;\n }): Promise<GetCollectionDataResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.TOKEN_V2_PROCESSOR,\n });\n return getCollectionDataByCollectionId({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries the ID of a specified collection.\n * This ID corresponds to the collection's object address in V2, while V1 does not utilize objects and lacks an address.\n *\n * @param args.creatorAddress - The address of the collection's creator.\n * @param args.collectionName - The name of the collection.\n * @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.\n * @param args.options.tokenStandard - The token standard to query.\n * @returns The collection ID.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Fetching the collection ID for a specific creator and collection name\n * const collectionId = await aptos.getCollectionId({\n * creatorAddress: \"0x1\", // replace with a real creator address\n * collectionName: \"myCollection\"\n * });\n *\n * console.log(\"Collection ID:\", collectionId);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async getCollectionId(args: {\n creatorAddress: AccountAddressInput;\n collectionName: string;\n minimumLedgerVersion?: AnyNumber;\n options?: TokenStandardArg;\n }): Promise<string> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.TOKEN_V2_PROCESSOR,\n });\n return getCollectionId({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Retrieves digital asset data using the address of a digital asset.\n *\n * @param args - The parameters for the request.\n * @param args.digitalAssetAddress - The address of the digital asset.\n * @param args.minimumLedgerVersion - Optional ledger version to sync up to before querying.\n * @returns GetTokenDataResponse containing relevant data for the digital asset.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Fetching digital asset data for a specific address\n * const digitalAsset = await aptos.getDigitalAssetData({\n * digitalAssetAddress: \"0x123\", // replace with a real digital asset address\n * });\n *\n * console.log(digitalAsset);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async getDigitalAssetData(args: {\n digitalAssetAddress: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n }): Promise<GetTokenDataResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.TOKEN_V2_PROCESSOR,\n });\n return getDigitalAssetData({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Retrieves the current ownership data of a specified digital asset using its address.\n *\n * @param args The parameters for the request.\n * @param args.digitalAssetAddress The address of the digital asset.\n * @param args.minimumLedgerVersion Optional ledger version to sync up to before querying.\n *\n * @returns GetCurrentTokenOwnershipResponse containing relevant ownership data of the digital asset.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Getting the current ownership of a digital asset\n * const digitalAssetOwner = await aptos.getCurrentDigitalAssetOwnership({\n * digitalAssetAddress: \"0x123\", // replace with a real digital asset address\n * });\n *\n * console.log(digitalAssetOwner);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async getCurrentDigitalAssetOwnership(args: {\n digitalAssetAddress: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n }): Promise<GetCurrentTokenOwnershipResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.TOKEN_V2_PROCESSOR,\n });\n return getCurrentDigitalAssetOwnership({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Retrieves the digital assets owned by a specified address.\n *\n * @param args.ownerAddress The address of the owner.\n * @param args.minimumLedgerVersion Optional ledger version to sync up to before querying.\n * @param args.options Optional pagination and ordering parameters for the response.\n *\n * @returns GetOwnedTokensResponse containing ownership data of the digital assets belonging to the ownerAddress.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Fetching the digital assets owned by the specified address\n * const digitalAssets = await aptos.getOwnedDigitalAssets({\n * ownerAddress: \"0x1\", // replace with a real account address\n * });\n *\n * console.log(digitalAssets);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async getOwnedDigitalAssets(args: {\n ownerAddress: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n options?: PaginationArgs & OrderByArg<GetOwnedTokensResponse[0]>;\n }): Promise<GetOwnedTokensResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.TOKEN_V2_PROCESSOR,\n });\n return getOwnedDigitalAssets({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Retrieves the activity data for a specified digital asset using its address.\n *\n * @param args - The parameters for the request.\n * @param args.digitalAssetAddress - The address of the digital asset.\n * @param args.minimumLedgerVersion - Optional minimum ledger version to sync up to before querying.\n * @param args.options - Optional pagination and ordering parameters.\n *\n * @returns A promise that resolves to the activity data related to the digital asset.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Get the activity data for a digital asset\n * const digitalAssetActivity = await aptos.getDigitalAssetActivity({\n * digitalAssetAddress: \"0x123\", // replace with a real digital asset address\n * });\n *\n * console.log(digitalAssetActivity);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async getDigitalAssetActivity(args: {\n digitalAssetAddress: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n options?: PaginationArgs & OrderByArg<GetTokenActivityResponse[0]>;\n }): Promise<GetTokenActivityResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.TOKEN_V2_PROCESSOR,\n });\n return getDigitalAssetActivity({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Creates a new collection within the specified account.\n *\n * @param args.creator - The account of the collection's creator.\n * @param args.description - The description of the collection.\n * @param args.name - The name of the collection.\n * @param args.uri - The URI to additional info about the collection.\n * @param args.options - Optional parameters for generating the transaction.\n *\n * The parameters below are optional:\n * @param args.maxSupply - Controls the max supply of the digital assets. Defaults to MAX_U64_BIG_INT.\n * @param args.mutableDescription - Controls mutability of the collection's description. Defaults to true.\n * @param args.mutableRoyalty - Controls mutability of the collection's royalty. Defaults to true.\n * @param args.mutableUri - Controls mutability of the collection's URI. Defaults to true.\n * @param args.mutableTokenDescription - Controls mutability of the digital asset's description. Defaults to true.\n * @param args.mutableTokenName - Controls mutability of the digital asset's name. Defaults to true.\n * @param args.mutableTokenProperties - Controls mutability of digital asset's properties. Defaults to true.\n * @param args.mutableTokenUri - Controls mutability of the digital asset's URI. Defaults to true.\n * @param args.tokensBurnableByCreator - Controls whether digital assets can be burnable by the creator. Defaults to true.\n * @param args.tokensFreezableByCreator - Controls whether digital assets can be frozen by the creator. Defaults to true.\n * @param args.royaltyNumerator - The numerator of the royalty to be paid to the creator when a digital asset is transferred.\n * Defaults to 0.\n * @param args.royaltyDenominator - The denominator of the royalty to be paid to the creator when a digital asset is\n * transferred. Defaults to 1.\n *\n * @returns A SimpleTransaction that when submitted will create the collection.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Creating a new collection transaction\n * const transaction = await aptos.createCollectionTransaction({\n * creator: Account.generate(), // Replace with a real account\n * description: \"A unique collection of digital assets.\",\n * name: \"My Digital Collection\",\n * uri: \"https://mycollection.com\",\n * });\n *\n * console.log(\"Transaction created:\", transaction);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async createCollectionTransaction(\n args: {\n creator: Account;\n description: string;\n name: string;\n uri: string;\n options?: InputGenerateTransactionOptions;\n } & CreateCollectionOptions,\n ): Promise<SimpleTransaction> {\n return createCollectionTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Create a transaction to mint a digital asset into the creator's account within an existing collection.\n * This function helps you generate a transaction that can be simulated or submitted to the blockchain for minting a digital asset.\n *\n * @param args.creator - The creator of the collection.\n * @param args.collection - The name of the collection the digital asset belongs to.\n * @param args.description - The description of the digital asset.\n * @param args.name - The name of the digital asset.\n * @param args.uri - The URI to additional info about the digital asset.\n * @param args.propertyKeys - Optional array of property keys for the digital asset.\n * @param args.propertyTypes - Optional array of property types for the digital asset.\n * @param args.propertyValues - Optional array of property values for the digital asset.\n * @param args.options - Optional transaction generation options.\n *\n * @returns A SimpleTransaction that can be simulated or submitted to the chain.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Creating a transaction to mint a digital asset\n * const transaction = await aptos.mintDigitalAssetTransaction({\n * creator: Account.generate(), // replace with a real account\n * collection: \"MyCollection\",\n * description: \"This is a digital asset.\",\n * name: \"MyDigitalAsset\",\n * uri: \"https://example.com/my-digital-asset\",\n * });\n *\n * console.log(transaction);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async mintDigitalAssetTransaction(args: {\n creator: Account;\n collection: string;\n description: string;\n name: string;\n uri: string;\n propertyKeys?: Array<string>;\n propertyTypes?: Array<PropertyType>;\n propertyValues?: Array<PropertyValue>;\n options?: InputGenerateTransactionOptions;\n }): Promise<SimpleTransaction> {\n return mintDigitalAssetTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Transfer ownership of a non-fungible digital asset.\n * This function allows you to transfer a digital asset only if it is not frozen, meaning the ownership transfer is not disabled.\n *\n * @param args The arguments for transferring the digital asset.\n * @param args.sender The sender account of the current digital asset owner.\n * @param args.digitalAssetAddress The address of the digital asset being transferred.\n * @param args.recipient The account address of the recipient.\n * @param args.digitalAssetType Optional. The type of the digital asset, defaults to \"0x4::token::Token\".\n * @param args.options Optional. Additional options for generating the transaction.\n *\n * @returns A SimpleTransaction that can be simulated or submitted to the chain.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Transfer a digital asset\n * const transaction = await aptos.transferDigitalAssetTransaction({\n * sender: Account.generate(), // replace with a real sender account\n * digitalAssetAddress: \"0x123\", // replace with a real digital asset address\n * recipient: \"0x456\", // replace with a real recipient account address\n * });\n *\n * console.log(transaction);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async transferDigitalAssetTransaction(args: {\n sender: Account;\n digitalAssetAddress: AccountAddressInput;\n recipient: AccountAddress;\n digitalAssetType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }): Promise<SimpleTransaction> {\n return transferDigitalAssetTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Mint a soul bound digital asset into a recipient's account.\n * This function allows you to create a unique digital asset that is bound to a specific account.\n *\n * @param args - The arguments for minting the soul bound transaction.\n * @param args.account - The account that mints the digital asset.\n * @param args.collection - The collection name that the digital asset belongs to.\n * @param args.description - The digital asset description.\n * @param args.name - The digital asset name.\n * @param args.uri - The digital asset URL.\n * @param args.recipient - The account address where the digital asset will be created.\n * @param args.propertyKeys - The property keys for storing on-chain properties.\n * @param args.propertyTypes - The type of property values.\n * @param args.propertyValues - The property values to be stored on-chain.\n * @param args.options - Additional options for generating the transaction.\n *\n * @returns A SimpleTransaction that can be simulated or submitted to the chain.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Mint a soul bound digital asset\n * const transaction = await aptos.mintSoulBoundTransaction({\n * account: Account.generate(), // Replace with a real account\n * collection: \"collectionName\",\n * description: \"collectionDescription\",\n * name: \"digitalAssetName\",\n * uri: \"digital-asset-uri.com\",\n * recipient: \"0x123\" // Replace with a real recipient account address\n * });\n *\n * console.log(transaction);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async mintSoulBoundTransaction(args: {\n account: Account;\n collection: string;\n description: string;\n name: string;\n uri: string;\n recipient: AccountAddressInput;\n propertyKeys?: Array<string>;\n propertyTypes?: Array<PropertyType>;\n propertyValues?: Array<PropertyValue>;\n options?: InputGenerateTransactionOptions;\n }): Promise<SimpleTransaction> {\n return mintSoulBoundTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Burn a digital asset by its creator, allowing for the removal of a specified digital asset from the blockchain.\n *\n * @param args The arguments for burning the digital asset.\n * @param args.creator The creator account that is burning the digital asset.\n * @param args.digitalAssetAddress The address of the digital asset to be burned.\n * @param args.digitalAssetType Optional. The type of the digital asset being burned.\n * @param args.options Optional. Additional options for generating the transaction.\n *\n * @returns A SimpleTransaction that can be simulated or submitted to the chain.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network, Account } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * const creator = Account.generate(); // Replace with a real creator account\n * const transaction = await aptos.burnDigitalAssetTransaction({\n * creator: creator,\n * digitalAssetAddress: \"0x123\", // Replace with a real digital asset address\n * });\n *\n * console.log(transaction);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async burnDigitalAssetTransaction(args: {\n creator: Account;\n digitalAssetAddress: AccountAddressInput;\n digitalAssetType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }) {\n return burnDigitalAssetTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Freeze the ability to transfer a specified digital asset.\n * This function allows the creator to restrict the transfer capability of a digital asset.\n *\n * @param args The arguments for freezing the digital asset transfer.\n * @param args.creator The creator account initiating the freeze.\n * @param args.digitalAssetAddress The address of the digital asset to be frozen.\n * @param args.digitalAssetType Optional. The type of the digital asset being frozen.\n * @param args.options Optional. Additional options for generating the transaction.\n *\n * @returns A SimpleTransaction that can be simulated or submitted to the chain.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Freeze the digital asset transfer\n * const transaction = await aptos.freezeDigitalAssetTransaferTransaction({\n * creator: Account.generate(), // Replace with a real account if needed\n * digitalAssetAddress: \"0x123\", // Replace with a real digital asset address\n * });\n *\n * console.log(transaction);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async freezeDigitalAssetTransaferTransaction(args: {\n creator: Account;\n digitalAssetAddress: AccountAddressInput;\n digitalAssetType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }) {\n return freezeDigitalAssetTransferTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Unfreeze the ability to transfer a digital asset.\n * This function allows the specified creator account to unfreeze the transfer of a digital asset identified by its address.\n *\n * @param args The parameters for unfreezing the digital asset transfer.\n * @param args.creator The creator account that is unfreezing the digital asset transfer.\n * @param args.digitalAssetAddress The address of the digital asset to unfreeze.\n * @param args.digitalAssetType Optional. The type of the digital asset being unfrozen.\n * @param args.options Optional. Additional options for generating the transaction.\n *\n * @returns A SimpleTransaction that can be simulated or submitted to the chain.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Unfreeze the ability to transfer a digital asset\n * const transaction = await aptos.unfreezeDigitalAssetTransaferTransaction({\n * creator: Account.generate(), // replace with a real creator account\n * digitalAssetAddress: \"0x123\", // replace with a real digital asset address\n * });\n *\n * console.log(transaction);\n * }\n * runExample().catch(console.error);\n * ```\n */\n // TODO: Rename Transafer to Transfer\n async unfreezeDigitalAssetTransaferTransaction(args: {\n creator: Account;\n digitalAssetAddress: AccountAddressInput;\n digitalAssetType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }) {\n return unfreezeDigitalAssetTransferTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Set the digital asset description to provide additional context or information about the asset.\n *\n * @param args The parameters for setting the digital asset description.\n * @param args.creator The creator account responsible for the digital asset.\n * @param args.description The digital asset description to be set.\n * @param args.digitalAssetAddress The address of the digital asset.\n * @param args.digitalAssetType Optional. The type of the digital asset.\n * @param args.options Optional. Additional options for generating the transaction.\n *\n * @returns A SimpleTransaction that can be simulated or submitted to the chain.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Set the digital asset description\n * const transaction = await aptos.setDigitalAssetDescriptionTransaction({\n * creator: Account.generate(), // replace with a real account\n * description: \"This is a digital asset description.\",\n * digitalAssetAddress: \"0x123\", // replace with a real digital asset address\n * });\n *\n * console.log(transaction);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async setDigitalAssetDescriptionTransaction(args: {\n creator: Account;\n description: string;\n digitalAssetAddress: AccountAddressInput;\n digitalAssetType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }) {\n return setDigitalAssetDescriptionTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Set the digital asset name, allowing you to define a name for a specific digital asset on the blockchain.\n *\n * @param args The parameters for setting the digital asset name.\n * @param args.creator The creator account responsible for the transaction.\n * @param args.name The desired name for the digital asset.\n * @param args.digitalAssetAddress The address of the digital asset.\n * @param args.digitalAssetType Optional. The type of the digital asset, represented as a Move struct ID.\n * @param args.options Optional. Additional options for generating the transaction.\n *\n * @returns A SimpleTransaction that can be simulated or submitted to the blockchain.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network, Account } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * const creator = Account.generate(); // Generate a new account for the creator\n * const digitalAssetAddress = \"0x123\"; // replace with a real digital asset address\n *\n * // Set the digital asset name\n * const transaction = await aptos.setDigitalAssetNameTransaction({\n * creator: creator,\n * name: \"digitalAssetName\",\n * digitalAssetAddress: digitalAssetAddress,\n * });\n *\n * console.log(transaction);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async setDigitalAssetNameTransaction(args: {\n creator: Account;\n name: string;\n digitalAssetAddress: AccountAddressInput;\n digitalAssetType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }) {\n return setDigitalAssetNameTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Set the URI for a digital asset, allowing you to associate a unique identifier with the asset.\n *\n * @param args The parameters for the transaction.\n * @param args.creator The creator account initiating the transaction.\n * @param args.uri The digital asset URI to be set.\n * @param args.digitalAssetAddress The address of the digital asset.\n * @param args.digitalAssetType Optional. The type of the digital asset.\n * @param args.options Optional. Additional options for generating the transaction.\n * @returns A SimpleTransaction that can be simulated or submitted to the chain.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Set the URI for a digital asset\n * const transaction = await aptos.setDigitalAssetURITransaction({\n * creator: Account.generate(), // Replace with a real creator account\n * uri: \"digital-asset-uri.com\",\n * digitalAssetAddress: \"0x123\", // Replace with a real digital asset address\n * });\n *\n * console.log(transaction);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async setDigitalAssetURITransaction(args: {\n creator: Account;\n uri: string;\n digitalAssetAddress: AccountAddressInput;\n digitalAssetType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }) {\n return setDigitalAssetURITransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Add a digital asset property to the blockchain.\n * This function allows you to specify a new property for a digital asset, including its key, type, and value.\n *\n * @param args - The arguments for adding a digital asset property.\n * @param args.creator - The account that mints the digital asset.\n * @param args.propertyKey - The property key for storing on-chain properties.\n * @param args.propertyType - The type of property value.\n * @param args.propertyValue - The property value to be stored on-chain.\n * @param args.digitalAssetAddress - The digital asset address.\n * @param args.digitalAssetType - (Optional) The type of the digital asset.\n * @param args.options - (Optional) Options for generating the transaction.\n * @returns A SimpleTransaction that can be simulated or submitted to the chain.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Add a digital asset property\n * const transaction = await aptos.addDigitalAssetPropertyTransaction({\n * creator: Account.generate(), // Replace with a real account\n * propertyKey: \"newKey\",\n * propertyType: \"BOOLEAN\",\n * propertyValue: true,\n * digitalAssetAddress: \"0x123\", // Replace with a real digital asset address\n * });\n *\n * console.log(transaction);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async addDigitalAssetPropertyTransaction(args: {\n creator: Account;\n propertyKey: string;\n propertyType: PropertyType;\n propertyValue: PropertyValue;\n digitalAssetAddress: AccountAddressInput;\n digitalAssetType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }) {\n return addDigitalAssetPropertyTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Remove a digital asset property from the blockchain.\n * This function allows you to delete an existing property associated with a digital asset.\n *\n * @param args The parameters required to remove the digital asset property.\n * @param args.creator The account that mints the digital asset.\n * @param args.propertyKey The property key for storing on-chain properties.\n * @param args.propertyType The type of property value.\n * @param args.propertyValue The property value to be stored on-chain.\n * @param args.digitalAssetAddress The digital asset address.\n * @param args.digitalAssetType Optional. The type of the digital asset.\n * @param args.options Optional. Additional options for generating the transaction.\n *\n * @returns A SimpleTransaction that can be simulated or submitted to the chain.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Remove a digital asset property\n * const transaction = await aptos.removeDigitalAssetPropertyTransaction({\n * creator: Account.generate(), // replace with a real account\n * propertyKey: \"newKey\",\n * propertyType: \"BOOLEAN\",\n * propertyValue: true,\n * digitalAssetAddress: \"0x123\", // replace with a real digital asset address\n * });\n *\n * console.log(transaction);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async removeDigitalAssetPropertyTransaction(args: {\n creator: Account;\n propertyKey: string;\n propertyType: PropertyType;\n propertyValue: PropertyValue;\n digitalAssetAddress: AccountAddressInput;\n digitalAssetType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }) {\n return removeDigitalAssetPropertyTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Update a digital asset property on-chain.\n *\n * @param args The parameters for updating the digital asset property.\n * @param args.creator The account that mints the digital asset.\n * @param args.digitalAssetAddress The address of the digital asset.\n * @param args.propertyKey The property key for storing on-chain properties.\n * @param args.propertyType The type of property value.\n * @param args.propertyValue The property value to be stored on-chain.\n * @param args.digitalAssetType Optional. The type of the digital asset.\n * @param args.options Optional. Additional options for generating the transaction.\n *\n * @returns A SimpleTransaction that can be simulated or submitted to the chain.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Update a digital asset property\n * const transaction = await aptos.updateDigitalAssetPropertyTransaction({\n * creator: Account.generate(), // replace with a real account\n * propertyKey: \"newKey\",\n * propertyType: \"BOOLEAN\",\n * propertyValue: false,\n * digitalAssetAddress: \"0x123\", // replace with a real digital asset address\n * });\n *\n * console.log(transaction);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async updateDigitalAssetPropertyTransaction(args: {\n creator: Account;\n propertyKey: string;\n propertyType: PropertyType;\n propertyValue: PropertyValue;\n digitalAssetAddress: AccountAddressInput;\n digitalAssetType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }) {\n return updateDigitalAssetPropertyTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Add a typed digital asset property to the blockchain.\n * This function allows you to define and store a specific property for a digital asset, enabling better categorization and\n * management of digital assets.\n *\n * @param args - The parameters for adding the typed property.\n * @param args.creator - The account that mints the digital asset.\n * @param args.propertyKey - The property key for storing on-chain properties.\n * @param args.propertyType - The type of property value.\n * @param args.propertyValue - The property value to be stored on-chain.\n * @param args.digitalAssetAddress - The digital asset address.\n * @param args.digitalAssetType - The optional type of the digital asset.\n * @param args.options - Optional transaction generation options.\n *\n * @returns A SimpleTransaction that can be simulated or submitted to the chain.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Adding a typed digital asset property\n * const transaction = await aptos.addDigitalAssetTypedPropertyTransaction({\n * creator: Account.generate(), // replace with a real account\n * propertyKey: \"typedKey\",\n * propertyType: \"STRING\",\n * propertyValue: \"hello\",\n * digitalAssetAddress: \"0x123\", // replace with a real digital asset address\n * });\n *\n * console.log(transaction);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async addDigitalAssetTypedPropertyTransaction(args: {\n creator: Account;\n propertyKey: string;\n propertyType: PropertyType;\n propertyValue: PropertyValue;\n digitalAssetAddress: AccountAddressInput;\n digitalAssetType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }) {\n return addDigitalAssetTypedPropertyTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Update a typed digital asset property on-chain.\n * This function allows you to modify the properties of a digital asset, enabling dynamic updates to its attributes.\n *\n * @param args - The arguments for updating the digital asset property.\n * @param args.creator - The account that mints the digital asset.\n * @param args.propertyKey - The property key for storing on-chain properties.\n * @param args.propertyType - The type of property value.\n * @param args.propertyValue - The property value to be stored on-chain.\n * @param args.digitalAssetAddress - The digital asset address.\n * @param args.digitalAssetType - (Optional) The type of the digital asset.\n * @param args.options - (Optional) Additional options for generating the transaction.\n *\n * @returns A SimpleTransaction that can be simulated or submitted to the chain.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Update a typed digital asset property\n * const transaction = await aptos.updateDigitalAssetTypedPropertyTransaction({\n * creator: Account.generate(), // replace with a real account\n * propertyKey: \"typedKey\",\n * propertyType: \"U8\",\n * propertyValue: 2,\n * digitalAssetAddress: \"0x123\", // replace with a real digital asset address\n * });\n *\n * console.log(transaction);\n * }\n * runExample().catch(console.error);\n * ```\n */\n async updateDigitalAssetTypedPropertyTransaction(args: {\n creator: Account;\n propertyKey: string;\n propertyType: PropertyType;\n propertyValue: PropertyValue;\n digitalAssetAddress: AccountAddressInput;\n digitalAssetType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }) {\n return updateDigitalAssetTypedPropertyTransaction({ aptosConfig: this.config, ...args });\n }\n}\n"],"mappings":"kRAuDO,IAAMA,EAAN,KAAmB,CAuBxB,YAAqBC,EAAqB,CAArB,YAAAA,CAAsB,CAoC3C,MAAM,kBAAkBC,EAKe,CACrC,MAAMC,EAAwB,CAC5B,OAAQ,KAAK,OACb,qBAAsBD,EAAK,qBAC3B,kCACF,CAAC,EAED,GAAM,CAAE,eAAAE,EAAgB,eAAAC,EAAgB,QAAAC,CAAQ,EAAIJ,EAC9CK,EAAUC,EAAe,KAAKJ,CAAc,EAE5CK,EAAsB,CAC1B,gBAAiB,CAAE,IAAKJ,CAAe,EACvC,gBAAiB,CAAE,IAAKE,EAAQ,aAAa,CAAE,CACjD,EACA,OAAID,GAAS,gBACXG,EAAe,eAAiB,CAAE,IAAKH,GAAS,eAAiB,IAAK,GAGjEI,EAAkB,CAAE,YAAa,KAAK,OAAQ,QAAS,CAAE,MAAOD,CAAe,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CAsCA,MAAM,mCAAmCA,EAQtC,CACD,OAAO2B,EAAmC,CAAE,YAAa,KAAK,OAAQ,GAAG3B,CAAK,CAAC,CACjF,CAuCA,MAAM,sCAAsCA,EAQzC,CACD,OAAO4B,EAAsC,CAAE,YAAa,KAAK,OAAQ,GAAG5B,CAAK,CAAC,CACpF,CAsCA,MAAM,sCAAsCA,EAQzC,CACD,OAAO6B,EAAsC,CAAE,YAAa,KAAK,OAAQ,GAAG7B,CAAK,CAAC,CACpF,CAwCA,MAAM,wCAAwCA,EAQ3C,CACD,OAAO8B,EAAwC,CAAE,YAAa,KAAK,OAAQ,GAAG9B,CAAK,CAAC,CACtF,CAuCA,MAAM,2CAA2CA,EAQ9C,CACD,OAAO+B,EAA2C,CAAE,YAAa,KAAK,OAAQ,GAAG/B,CAAK,CAAC,CACzF,CACF","names":["DigitalAsset","config","args","waitForIndexerOnVersion","creatorAddress","collectionName","options","address","AccountAddress","whereCondition","getCollectionData","getCollectionDataByCreatorAddressAndCollectionName","getCollectionDataByCreatorAddress","getCollectionDataByCollectionId","getCollectionId","getDigitalAssetData","getCurrentDigitalAssetOwnership","getOwnedDigitalAssets","getDigitalAssetActivity","createCollectionTransaction","mintDigitalAssetTransaction","transferDigitalAssetTransaction","mintSoulBoundTransaction","burnDigitalAssetTransaction","freezeDigitalAssetTransferTransaction","unfreezeDigitalAssetTransferTransaction","setDigitalAssetDescriptionTransaction","setDigitalAssetNameTransaction","setDigitalAssetURITransaction","addDigitalAssetPropertyTransaction","removeDigitalAssetPropertyTransaction","updateDigitalAssetPropertyTransaction","addDigitalAssetTypedPropertyTransaction","updateDigitalAssetTypedPropertyTransaction"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as K,b as w}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as K,b as w}from"./chunk-VQTEGTUQ.mjs";import{d as h}from"./chunk-IFHQSZLK.mjs";import{a,b as c}from"./chunk-S3FVA55H.mjs";import{j as m,k as g,n as P}from"./chunk-5CCHECTE.mjs";import{d as y}from"./chunk-LEKBJ2EG.mjs";import{b as d}from"./chunk-KM6UXNC7.mjs";import{a as n}from"./chunk-QQIVWB6G.mjs";import{b as f}from"./chunk-KFNDDPOW.mjs";import v from"eventemitter3";var o=class o extends n{constructor(e){super();let{address:r,ephemeralKeyPair:t,publicKey:i,uidKey:F,uidVal:b,aud:E,pepper:A,proof:s,proofFetchCallback:l,jwt:x}=e;if(this.ephemeralKeyPair=t,this.publicKey=i,this.accountAddress=r?d.from(r):this.publicKey.authKey().derivedAddress(),this.uidKey=F,this.uidVal=b,this.aud=E,this.jwt=x,this.emitter=new v,this.proofOrPromise=s,s instanceof P)this.proof=s;else{if(l===void 0)throw new Error("Must provide callback for async proof fetch");this.emitter.on("proofFetchFinish",async T=>{await l(T),this.emitter.removeAllListeners()}),this.init(s)}this.signingScheme=2;let u=f.fromHexInput(A).toUint8Array();if(u.length!==o.PEPPER_LENGTH)throw new Error(`Pepper length in bytes should be ${o.PEPPER_LENGTH}`);this.pepper=u}async init(e){try{this.proof=await e,this.emitter.emit("proofFetchFinish",{status:"Success"})}catch(r){r instanceof Error?this.emitter.emit("proofFetchFinish",{status:"Failed",error:r.toString()}):this.emitter.emit("proofFetchFinish",{status:"Failed",error:"Unknown"})}}serialize(e){if(e.serializeStr(this.jwt),e.serializeStr(this.uidKey),e.serializeFixedBytes(this.pepper),this.ephemeralKeyPair.serialize(e),this.proof===void 0)throw new Error("Cannot serialize - proof undefined");this.proof.serialize(e)}isExpired(){return this.ephemeralKeyPair.isExpired()}signWithAuthenticator(e){let r=new c(this.sign(e)),t=new a(this.publicKey);return new h(t,r)}signTransactionWithAuthenticator(e){let r=new c(this.signTransaction(e)),t=new a(this.publicKey);return new h(t,r)}async waitForProofFetch(){this.proofOrPromise instanceof Promise&&await this.proofOrPromise}sign(e){let{expiryDateSecs:r}=this.ephemeralKeyPair;if(this.isExpired())throw new Error("EphemeralKeyPair is expired");if(this.proof===void 0)throw new Error("Proof not found - make sure to call `await account.waitForProofFetch()` before signing.");let t=this.ephemeralKeyPair.getPublicKey(),i=this.ephemeralKeyPair.sign(e);return new m({jwtHeader:y(this.jwt.split(".")[0]),ephemeralCertificate:new g(this.proof,0),expiryDateSecs:r,ephemeralPublicKey:t,ephemeralSignature:i})}signTransaction(e){if(this.proof===void 0)throw new Error("Proof not found - make sure to call `await account.waitForProofFetch()` before signing.");let r=K(e),i=new p(r,this.proof.proof).hash();return this.sign(i)}verifySignature(e){let{message:r,signature:t}=e;return!(this.isExpired()||!this.ephemeralKeyPair.getPublicKey().verifySignature({message:r,signature:t.ephemeralSignature}))}};o.PEPPER_LENGTH=31;var S=o,p=class extends n{constructor(r,t){super();this.domainSeparator="APTOS::TransactionAndProof";this.transaction=r,this.proof=t}serialize(r){r.serializeFixedBytes(this.transaction.bcsToBytes()),r.serializeOption(this.proof)}hash(){return w(this.bcsToBytes(),this.domainSeparator)}};export{S as a,p as b};
|
|
2
|
+
//# sourceMappingURL=chunk-5ZBHIUWG.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/account/AbstractKeylessAccount.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport EventEmitter from \"eventemitter3\";\nimport { EphemeralCertificateVariant, HexInput, SigningScheme } from \"../types\";\nimport { AccountAddress } from \"../core/accountAddress\";\nimport {\n AnyPublicKey,\n AnySignature,\n KeylessPublicKey,\n KeylessSignature,\n EphemeralCertificate,\n ZeroKnowledgeSig,\n ZkProof,\n} from \"../core/crypto\";\n\nimport { Account } from \"./Account\";\nimport { EphemeralKeyPair } from \"./EphemeralKeyPair\";\nimport { Hex } from \"../core/hex\";\nimport { AccountAuthenticatorSingleKey } from \"../transactions/authenticator/account\";\nimport { Serializable, Serializer } from \"../bcs\";\nimport { deriveTransactionType, generateSigningMessage } from \"../transactions/transactionBuilder/signingMessage\";\nimport { AnyRawTransaction, AnyRawTransactionInstance } from \"../transactions/types\";\nimport { base64UrlDecode } from \"../utils/helpers\";\nimport { FederatedKeylessPublicKey } from \"../core/crypto/federatedKeyless\";\n\n/**\n * Account implementation for the Keyless authentication scheme. This abstract class is used for standard Keyless Accounts\n * and Federated Keyless Accounts.\n */\nexport abstract class AbstractKeylessAccount extends Serializable implements Account {\n static readonly PEPPER_LENGTH: number = 31;\n\n /**\n * The KeylessPublicKey associated with the account\n */\n readonly publicKey: KeylessPublicKey | FederatedKeylessPublicKey;\n\n /**\n * The EphemeralKeyPair used to generate sign.\n */\n readonly ephemeralKeyPair: EphemeralKeyPair;\n\n /**\n * The claim on the JWT to identify a user. This is typically 'sub' or 'email'.\n */\n readonly uidKey: string;\n\n /**\n * The value of the uidKey claim on the JWT. This intended to be a stable user identifier.\n */\n readonly uidVal: string;\n\n /**\n * The value of the 'aud' claim on the JWT, also known as client ID. This is the identifier for the dApp's\n * OIDC registration with the identity provider.\n */\n readonly aud: string;\n\n /**\n * A value contains 31 bytes of entropy that preserves privacy of the account. Typically fetched from a pepper provider.\n */\n readonly pepper: Uint8Array;\n\n /**\n * Account address associated with the account\n */\n readonly accountAddress: AccountAddress;\n\n /**\n * The zero knowledge signature (if ready) which contains the proof used to validate the EphemeralKeyPair.\n */\n proof: ZeroKnowledgeSig | undefined;\n\n /**\n * The proof of the EphemeralKeyPair or a promise that provides the proof. This is used to allow for awaiting on\n * fetching the proof.\n */\n readonly proofOrPromise: ZeroKnowledgeSig | Promise<ZeroKnowledgeSig>;\n\n /**\n * Signing scheme used to sign transactions\n */\n readonly signingScheme: SigningScheme;\n\n /**\n * The JWT token used to derive the account\n */\n readonly jwt: string;\n\n /**\n * An event emitter used to assist in handling asynchronous proof fetching.\n */\n private readonly emitter: EventEmitter<ProofFetchEvents>;\n\n // Use the static constructor 'create' instead.\n protected constructor(args: {\n address?: AccountAddress;\n publicKey: KeylessPublicKey | FederatedKeylessPublicKey;\n ephemeralKeyPair: EphemeralKeyPair;\n iss: string;\n uidKey: string;\n uidVal: string;\n aud: string;\n pepper: HexInput;\n proof: ZeroKnowledgeSig | Promise<ZeroKnowledgeSig>;\n proofFetchCallback?: ProofFetchCallback;\n jwt: string;\n }) {\n super();\n const { address, ephemeralKeyPair, publicKey, uidKey, uidVal, aud, pepper, proof, proofFetchCallback, jwt } = args;\n this.ephemeralKeyPair = ephemeralKeyPair;\n this.publicKey = publicKey;\n this.accountAddress = address ? AccountAddress.from(address) : this.publicKey.authKey().derivedAddress();\n this.uidKey = uidKey;\n this.uidVal = uidVal;\n this.aud = aud;\n this.jwt = jwt;\n this.emitter = new EventEmitter<ProofFetchEvents>();\n this.proofOrPromise = proof;\n if (proof instanceof ZeroKnowledgeSig) {\n this.proof = proof;\n } else {\n if (proofFetchCallback === undefined) {\n throw new Error(\"Must provide callback for async proof fetch\");\n }\n this.emitter.on(\"proofFetchFinish\", async (status) => {\n await proofFetchCallback(status);\n this.emitter.removeAllListeners();\n });\n // Note, this is purposely not awaited to be non-blocking. The caller should await on the proofFetchCallback.\n this.init(proof);\n }\n this.signingScheme = SigningScheme.SingleKey;\n const pepperBytes = Hex.fromHexInput(pepper).toUint8Array();\n if (pepperBytes.length !== AbstractKeylessAccount.PEPPER_LENGTH) {\n throw new Error(`Pepper length in bytes should be ${AbstractKeylessAccount.PEPPER_LENGTH}`);\n }\n this.pepper = pepperBytes;\n }\n\n /**\n * This initializes the asynchronous proof fetch\n * @return\n */\n async init(promise: Promise<ZeroKnowledgeSig>) {\n try {\n this.proof = await promise;\n this.emitter.emit(\"proofFetchFinish\", { status: \"Success\" });\n } catch (error) {\n if (error instanceof Error) {\n this.emitter.emit(\"proofFetchFinish\", { status: \"Failed\", error: error.toString() });\n } else {\n this.emitter.emit(\"proofFetchFinish\", { status: \"Failed\", error: \"Unknown\" });\n }\n }\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeStr(this.jwt);\n serializer.serializeStr(this.uidKey);\n serializer.serializeFixedBytes(this.pepper);\n this.ephemeralKeyPair.serialize(serializer);\n if (this.proof === undefined) {\n throw new Error(\"Cannot serialize - proof undefined\");\n }\n this.proof.serialize(serializer);\n }\n\n /**\n * Checks if the proof is expired. If so the account must be re-derived with a new EphemeralKeyPair\n * and JWT token.\n * @return boolean\n */\n isExpired(): boolean {\n return this.ephemeralKeyPair.isExpired();\n }\n\n /**\n * Sign a message using Keyless.\n * @param message the message to sign, as binary input\n * @return the AccountAuthenticator containing the signature, together with the account's public key\n */\n signWithAuthenticator(message: HexInput): AccountAuthenticatorSingleKey {\n const signature = new AnySignature(this.sign(message));\n const publicKey = new AnyPublicKey(this.publicKey);\n return new AccountAuthenticatorSingleKey(publicKey, signature);\n }\n\n /**\n * Sign a transaction using Keyless.\n * @param transaction the raw transaction\n * @return the AccountAuthenticator containing the signature of the transaction, together with the account's public key\n */\n signTransactionWithAuthenticator(transaction: AnyRawTransaction): AccountAuthenticatorSingleKey {\n const signature = new AnySignature(this.signTransaction(transaction));\n const publicKey = new AnyPublicKey(this.publicKey);\n return new AccountAuthenticatorSingleKey(publicKey, signature);\n }\n\n /**\n * Waits for asynchronous proof fetching to finish.\n * @return\n */\n async waitForProofFetch() {\n if (this.proofOrPromise instanceof Promise) {\n await this.proofOrPromise;\n }\n }\n\n /**\n * Sign the given message using Keyless.\n * @param message in HexInput format\n * @returns Signature\n */\n sign(message: HexInput): KeylessSignature {\n const { expiryDateSecs } = this.ephemeralKeyPair;\n if (this.isExpired()) {\n throw new Error(\"EphemeralKeyPair is expired\");\n }\n if (this.proof === undefined) {\n throw new Error(\"Proof not found - make sure to call `await account.waitForProofFetch()` before signing.\");\n }\n const ephemeralPublicKey = this.ephemeralKeyPair.getPublicKey();\n const ephemeralSignature = this.ephemeralKeyPair.sign(message);\n\n return new KeylessSignature({\n jwtHeader: base64UrlDecode(this.jwt.split(\".\")[0]),\n ephemeralCertificate: new EphemeralCertificate(this.proof, EphemeralCertificateVariant.ZkProof),\n expiryDateSecs,\n ephemeralPublicKey,\n ephemeralSignature,\n });\n }\n\n /**\n * Sign the given transaction with Keyless.\n * Signs the transaction and proof to guard against proof malleability.\n * @param transaction the transaction to be signed\n * @returns KeylessSignature\n */\n signTransaction(transaction: AnyRawTransaction): KeylessSignature {\n if (this.proof === undefined) {\n throw new Error(\"Proof not found - make sure to call `await account.waitForProofFetch()` before signing.\");\n }\n const raw = deriveTransactionType(transaction);\n const txnAndProof = new TransactionAndProof(raw, this.proof.proof);\n const signMess = txnAndProof.hash();\n return this.sign(signMess);\n }\n\n /**\n * Note - This function is currently incomplete and should only be used to verify ownership of the KeylessAccount\n *\n * Verifies a signature given the message.\n *\n * TODO: Groth16 proof verification\n *\n * @param args.message the message that was signed.\n * @param args.signature the KeylessSignature to verify\n * @returns boolean\n */\n verifySignature(args: { message: HexInput; signature: KeylessSignature }): boolean {\n const { message, signature } = args;\n if (this.isExpired()) {\n return false;\n }\n if (!this.ephemeralKeyPair.getPublicKey().verifySignature({ message, signature: signature.ephemeralSignature })) {\n return false;\n }\n return true;\n }\n}\n\n/**\n * A container class to hold a transaction and a proof. It implements CryptoHashable which is used to create\n * the signing message for Keyless transactions. We sign over the proof to ensure non-malleability.\n */\nexport class TransactionAndProof extends Serializable {\n /**\n * The transaction to sign.\n */\n transaction: AnyRawTransactionInstance;\n\n /**\n * The zero knowledge proof used in signing the transaction.\n */\n proof?: ZkProof;\n\n /**\n * The domain separator prefix used when hashing.\n */\n readonly domainSeparator = \"APTOS::TransactionAndProof\";\n\n constructor(transaction: AnyRawTransactionInstance, proof?: ZkProof) {\n super();\n this.transaction = transaction;\n this.proof = proof;\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeFixedBytes(this.transaction.bcsToBytes());\n serializer.serializeOption(this.proof);\n }\n\n /**\n * Hashes the bcs serialized from of the class. This is the typescript corollary to the BCSCryptoHash macro in aptos-core.\n *\n * @returns Uint8Array\n */\n hash(): Uint8Array {\n return generateSigningMessage(this.bcsToBytes(), this.domainSeparator);\n }\n}\n\nexport type ProofFetchSuccess = {\n status: \"Success\";\n};\n\nexport type ProofFetchFailure = {\n status: \"Failed\";\n error: string;\n};\n\nexport type ProofFetchStatus = ProofFetchSuccess | ProofFetchFailure;\n\nexport type ProofFetchCallback = (status: ProofFetchStatus) => Promise<void>;\n\nexport interface ProofFetchEvents {\n proofFetchFinish: (status: ProofFetchStatus) => void;\n}\n"],"mappings":"+VAGA,OAAOA,MAAkB,gBA2BlB,IAAeC,EAAf,MAAeA,UAA+BC,CAAgC,CAkEzE,YAAYC,EAYnB,CACD,MAAM,EACN,GAAM,CAAE,QAAAC,EAAS,iBAAAC,EAAkB,UAAAC,EAAW,OAAAC,EAAQ,OAAAC,EAAQ,IAAAC,EAAK,OAAAC,EAAQ,MAAAC,EAAO,mBAAAC,EAAoB,IAAAC,CAAI,EAAIV,EAU9G,GATA,KAAK,iBAAmBE,EACxB,KAAK,UAAYC,EACjB,KAAK,eAAiBF,EAAUU,EAAe,KAAKV,CAAO,EAAI,KAAK,UAAU,QAAQ,EAAE,eAAe,EACvG,KAAK,OAASG,EACd,KAAK,OAASC,EACd,KAAK,IAAMC,EACX,KAAK,IAAMI,EACX,KAAK,QAAU,IAAIE,EACnB,KAAK,eAAiBJ,EAClBA,aAAiBK,EACnB,KAAK,MAAQL,MACR,CACL,GAAIC,IAAuB,OACzB,MAAM,IAAI,MAAM,6CAA6C,EAE/D,KAAK,QAAQ,GAAG,mBAAoB,MAAOK,GAAW,CACpD,MAAML,EAAmBK,CAAM,EAC/B,KAAK,QAAQ,mBAAmB,CAClC,CAAC,EAED,KAAK,KAAKN,CAAK,CACjB,CACA,KAAK,cAAgB,EACrB,IAAMO,EAAcC,EAAI,aAAaT,CAAM,EAAE,aAAa,EAC1D,GAAIQ,EAAY,SAAWjB,EAAuB,cAChD,MAAM,IAAI,MAAM,oCAAoCA,EAAuB,aAAa,EAAE,EAE5F,KAAK,OAASiB,CAChB,CAMA,MAAM,KAAKE,EAAoC,CAC7C,GAAI,CACF,KAAK,MAAQ,MAAMA,EACnB,KAAK,QAAQ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AO,IAAIS,EAAiB,CAC1B,UAAWC,EAAgB,KAAK,IAAI,MAAM,GAAG,EAAE,CAAC,CAAC,EACjD,qBAAsB,IAAIC,EAAqB,KAAK,OAA0C,EAC9F,eAAAL,EACA,mBAAAC,EACA,mBAAAC,CACF,CAAC,CACH,CAQA,gBAAgBH,EAAkD,CAChE,GAAI,KAAK,QAAU,OACjB,MAAM,IAAI,MAAM,yFAAyF,EAE3G,IAAMO,EAAMC,EAAsBR,CAAW,EAEvCS,EADc,IAAIC,EAAoBH,EAAK,KAAK,MAAM,KAAK,EACpC,KAAK,EAClC,OAAO,KAAK,KAAKE,CAAQ,CAC3B,CAaA,gBAAgBlC,EAAmE,CACjF,GAAM,CAAE,QAAAoB,EAAS,UAAAC,CAAU,EAAIrB,EAI/B,MAHI,OAAK,UAAU,GAGf,CAAC,KAAK,iBAAiB,aAAa,EAAE,gBAAgB,CAAE,QAAAoB,EAAS,UAAWC,EAAU,kBAAmB,CAAC,EAIhH,CACF,EAlPsBvB,EACJ,cAAwB,GADnC,IAAesC,EAAftC,EAwPMqC,EAAN,cAAkCpC,CAAa,CAgBpD,YAAY0B,EAAwCjB,EAAiB,CACnE,MAAM,EAHR,KAAS,gBAAkB,6BAIzB,KAAK,YAAciB,EACnB,KAAK,MAAQjB,CACf,CAEA,UAAUW,EAA8B,CACtCA,EAAW,oBAAoB,KAAK,YAAY,WAAW,CAAC,EAC5DA,EAAW,gBAAgB,KAAK,KAAK,CACvC,CAOA,MAAmB,CACjB,OAAOkB,EAAuB,KAAK,WAAW,EAAG,KAAK,eAAe,CACvE,CACF","names":["EventEmitter","_AbstractKeylessAccount","Serializable","args","address","ephemeralKeyPair","publicKey","uidKey","uidVal","aud","pepper","proof","proofFetchCallback","jwt","AccountAddress","EventEmitter","ZeroKnowledgeSig","status","pepperBytes","Hex","promise","error","serializer","message","signature","AnySignature","AnyPublicKey","AccountAuthenticatorSingleKey","transaction","expiryDateSecs","ephemeralPublicKey","ephemeralSignature","KeylessSignature","base64UrlDecode","EphemeralCertificate","raw","deriveTransactionType","signMess","TransactionAndProof","AbstractKeylessAccount","generateSigningMessage"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as o,b as l}from"./chunk-S3FVA55H.mjs";import{b as m}from"./chunk-4OV7QU2U.mjs";import{a as g}from"./chunk-IBLZ6MZU.mjs";import{a as y}from"./chunk-PRZ7AIGA.mjs";function d(h){let e=h;return e-=e>>1&1431655765,e=(e&858993459)+(e>>2&858993459),(e+(e>>4)&252645135)*16843009>>24}var p=class h extends m{constructor(e){super();let{publicKeys:r,signaturesRequired:t}=e;if(t<1)throw new Error("The number of required signatures needs to be greater than 0");if(r.length<t)throw new Error(`Provided ${r.length} public keys is smaller than the ${t} required signatures`);this.publicKeys=r.map(i=>i instanceof o?i:new o(i)),this.signaturesRequired=t}verifySignature(e){throw new Error("not implemented")}authKey(){return y.fromSchemeAndBytes({scheme:3,input:this.toUint8Array()})}serialize(e){e.serializeVector(this.publicKeys),e.serializeU8(this.signaturesRequired)}static deserialize(e){let r=e.deserializeVector(o),t=e.deserializeU8();return new h({publicKeys:r,signaturesRequired:t})}createBitmap(e){let{bits:r}=e,t=128,i=new Uint8Array([0,0,0,0]),a=new Set;return r.forEach((n,u)=>{if(u+1>this.publicKeys.length)throw new Error(`Signature index ${u+1} is out of public keys range, ${this.publicKeys.length}.`);if(a.has(n))throw new Error(`Duplicate bit ${n} detected.`);a.add(n);let c=Math.floor(n/8),b=i[c];b|=t>>n%8,i[c]=b}),i}getIndex(e){let r=e instanceof o?e:new o(e),t=this.publicKeys.findIndex(i=>i.toString()===r.toString());if(t!==-1)return t;throw new Error("Public key not found in MultiKey")}static isInstance(e){return"publicKeys"in e&&"signaturesRequired"in e}},s=class s extends g{constructor(e){super();let{signatures:r,bitmap:t}=e;if(r.length>s.MAX_SIGNATURES_SUPPORTED)throw new Error(`The number of signatures cannot be greater than ${s.MAX_SIGNATURES_SUPPORTED}`);if(this.signatures=r.map(a=>a instanceof l?a:new l(a)),!(t instanceof Uint8Array))this.bitmap=s.createBitmap({bits:t});else{if(t.length!==s.BITMAP_LEN)throw new Error(`"bitmap" length should be ${s.BITMAP_LEN}`);this.bitmap=t}let i=this.bitmap.reduce((a,n)=>a+d(n),0);if(i!==this.signatures.length)throw new Error(`Expecting ${i} signatures from the bitmap, but got ${this.signatures.length}`)}static createBitmap(e){let{bits:r}=e,t=128,i=new Uint8Array([0,0,0,0]),a=new Set;return r.forEach(n=>{if(n>=s.MAX_SIGNATURES_SUPPORTED)throw new Error(`Cannot have a signature larger than ${s.MAX_SIGNATURES_SUPPORTED-1}.`);if(a.has(n))throw new Error("Duplicate bits detected.");a.add(n);let u=Math.floor(n/8),c=i[u];c|=t>>n%8,i[u]=c}),i}serialize(e){e.serializeVector(this.signatures),e.serializeBytes(this.bitmap)}static deserialize(e){let r=e.deserializeVector(l),t=e.deserializeBytes();return new s({signatures:r,bitmap:t})}};s.BITMAP_LEN=4,s.MAX_SIGNATURES_SUPPORTED=s.BITMAP_LEN*8;var f=s;export{p as a,f as b};
|
|
2
|
+
//# sourceMappingURL=chunk-6AGTDRNM.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/core/crypto/multiKey.ts"],"sourcesContent":["import { SigningScheme as AuthenticationKeyScheme } from \"../../types\";\nimport { Deserializer } from \"../../bcs/deserializer\";\nimport { Serializer } from \"../../bcs/serializer\";\nimport { AuthenticationKey } from \"../authenticationKey\";\nimport { AccountPublicKey, PublicKey, VerifySignatureArgs } from \"./publicKey\";\nimport { Signature } from \"./signature\";\nimport { AnyPublicKey, AnySignature } from \"./singleKey\";\n\n/**\n * Counts the number of set bits (1s) in a byte.\n * This function can help you determine the population count of a given byte value.\n *\n * @param byte - The byte value for which to count the number of set bits.\n */\n/* eslint-disable no-bitwise */\nfunction bitCount(byte: number) {\n let n = byte;\n n -= (n >> 1) & 0x55555555;\n n = (n & 0x33333333) + ((n >> 2) & 0x33333333);\n return (((n + (n >> 4)) & 0xf0f0f0f) * 0x1010101) >> 24;\n}\n/* eslint-enable no-bitwise */\n\n/**\n * Represents a multi-key authentication scheme for accounts, allowing multiple public keys\n * to be associated with a single account. This class enforces a minimum number of valid signatures\n * required to authorize actions, ensuring enhanced security for multi-agent accounts.\n *\n * The public keys of each individual agent can be any type of public key supported by Aptos.\n * Since [AIP-55](https://github.com/aptos-foundation/AIPs/pull/263), Aptos supports\n * `Legacy` and `Unified` authentication keys.\n */\nexport class MultiKey extends AccountPublicKey {\n /**\n * List of any public keys\n */\n public readonly publicKeys: AnyPublicKey[];\n\n /**\n * The minimum number of valid signatures required, for the number of public keys specified\n */\n public readonly signaturesRequired: number;\n\n /**\n * Signature for a K-of-N multi-sig transaction.\n * This constructor initializes a multi-signature transaction with the provided signatures and bitmap.\n *\n * @param args An object containing the parameters for the multi-signature transaction.\n * @param args.signatures A list of signatures.\n * @param args.bitmap A bitmap represented as a Uint8Array or an array of numbers, where each bit indicates whether a\n * corresponding signature is present. A maximum of 32 signatures is supported, and the length of the bitmap must be 4 bytes.\n *\n * @throws Error if the number of signatures exceeds the maximum supported, if the bitmap length is incorrect, or if the number\n * of signatures does not match the bitmap.\n */\n // region Constructors\n constructor(args: { publicKeys: Array<PublicKey>; signaturesRequired: number }) {\n super();\n const { publicKeys, signaturesRequired } = args;\n\n // Validate number of public keys is greater than signature required\n if (signaturesRequired < 1) {\n throw new Error(\"The number of required signatures needs to be greater than 0\");\n }\n\n // Validate number of public keys is greater than signature required\n if (publicKeys.length < signaturesRequired) {\n throw new Error(\n `Provided ${publicKeys.length} public keys is smaller than the ${signaturesRequired} required signatures`,\n );\n }\n\n // Make sure that all keys are normalized to the SingleKey authentication scheme\n this.publicKeys = publicKeys.map((publicKey) =>\n publicKey instanceof AnyPublicKey ? publicKey : new AnyPublicKey(publicKey),\n );\n\n this.signaturesRequired = signaturesRequired;\n }\n\n // endregion\n\n // region AccountPublicKey\n\n /**\n * Verifies the provided signature against the given message.\n * This function helps ensure the integrity and authenticity of the message by checking if the signature is valid.\n *\n * @param args - The arguments for verifying the signature.\n * @param args.message - The message that was signed.\n * @param args.signature - The signature to verify.\n */\n // eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars\n verifySignature(args: VerifySignatureArgs): boolean {\n throw new Error(\"not implemented\");\n }\n\n /**\n * Generates an authentication key based on the current instance's byte representation.\n * This key can be used for secure authentication processes within the system.\n *\n * @returns {AuthenticationKey} The generated authentication key.\n */\n authKey(): AuthenticationKey {\n return AuthenticationKey.fromSchemeAndBytes({\n scheme: AuthenticationKeyScheme.MultiKey,\n input: this.toUint8Array(),\n });\n }\n\n // endregion\n\n // region Serializable\n\n /**\n * Serializes the object by writing its signatures and bitmap to the provided serializer.\n * This allows the object to be converted into a format suitable for transmission or storage.\n *\n * @param serializer - The serializer instance used to perform the serialization.\n */\n serialize(serializer: Serializer): void {\n serializer.serializeVector(this.publicKeys);\n serializer.serializeU8(this.signaturesRequired);\n }\n\n /**\n * Deserializes a MultiKeySignature from the provided deserializer.\n * This function retrieves the signatures and bitmap necessary for creating a MultiKeySignature object.\n *\n * @param deserializer - The deserializer instance used to read the serialized data.\n */\n static deserialize(deserializer: Deserializer): MultiKey {\n const keys = deserializer.deserializeVector(AnyPublicKey);\n const signaturesRequired = deserializer.deserializeU8();\n\n return new MultiKey({ publicKeys: keys, signaturesRequired });\n }\n\n // endregion\n\n /**\n * Create a bitmap that holds the mapping from the original public keys\n * to the signatures passed in\n *\n * @param args.bits array of the index mapping to the matching public keys\n * @returns Uint8array bit map\n */\n createBitmap(args: { bits: number[] }): Uint8Array {\n const { bits } = args;\n // Bits are read from left to right. e.g. 0b10000000 represents the first bit is set in one byte.\n // The decimal value of 0b10000000 is 128.\n const firstBitInByte = 128;\n const bitmap = new Uint8Array([0, 0, 0, 0]);\n\n // Check if duplicates exist in bits\n const dupCheckSet = new Set();\n\n bits.forEach((bit: number, idx: number) => {\n if (idx + 1 > this.publicKeys.length) {\n throw new Error(`Signature index ${idx + 1} is out of public keys range, ${this.publicKeys.length}.`);\n }\n\n if (dupCheckSet.has(bit)) {\n throw new Error(`Duplicate bit ${bit} detected.`);\n }\n\n dupCheckSet.add(bit);\n\n const byteOffset = Math.floor(bit / 8);\n\n let byte = bitmap[byteOffset];\n\n // eslint-disable-next-line no-bitwise\n byte |= firstBitInByte >> bit % 8;\n\n bitmap[byteOffset] = byte;\n });\n\n return bitmap;\n }\n\n /**\n * Get the index of the provided public key.\n *\n * This function retrieves the index of a specified public key within the MultiKey.\n * If the public key does not exist, it throws an error.\n *\n * @param publicKey - The public key to find the index for.\n * @returns The corresponding index of the public key, if it exists.\n * @throws Error - If the public key is not found in the MultiKey.\n */\n getIndex(publicKey: PublicKey): number {\n const anyPublicKey = publicKey instanceof AnyPublicKey ? publicKey : new AnyPublicKey(publicKey);\n const index = this.publicKeys.findIndex((pk) => pk.toString() === anyPublicKey.toString());\n\n if (index !== -1) {\n return index;\n }\n throw new Error(\"Public key not found in MultiKey\");\n }\n\n public static isInstance(value: PublicKey): value is MultiKey {\n return \"publicKeys\" in value && \"signaturesRequired\" in value;\n }\n}\n\n/**\n * Represents a multi-signature transaction using Ed25519 signatures.\n * This class allows for the creation and management of a K-of-N multi-signature scheme,\n * where a specified number of signatures are required to authorize a transaction.\n *\n * It includes functionality to validate the number of signatures against a bitmap,\n * which indicates which public keys have signed the transaction.\n */\nexport class MultiKeySignature extends Signature {\n /**\n * Number of bytes in the bitmap representing who signed the transaction (32-bits)\n */\n static BITMAP_LEN: number = 4;\n\n /**\n * Maximum number of Ed25519 signatures supported\n */\n static MAX_SIGNATURES_SUPPORTED = MultiKeySignature.BITMAP_LEN * 8;\n\n /**\n * The list of underlying Ed25519 signatures\n */\n public readonly signatures: AnySignature[];\n\n /**\n * 32-bit Bitmap representing who signed the transaction\n *\n * This is represented where each public key can be masked to determine whether the message was signed by that key.\n */\n public readonly bitmap: Uint8Array;\n\n /**\n * Signature for a K-of-N multi-sig transaction.\n *\n * @see {@link\n * https://aptos.dev/integration/creating-a-signed-transaction/#multisignature-transactions | Creating a Signed Transaction}\n *\n * @param args.signatures A list of signatures\n * @param args.bitmap 4 bytes, at most 32 signatures are supported. If Nth bit value is `1`, the Nth\n * signature should be provided in `signatures`. Bits are read from left to right\n */\n constructor(args: { signatures: Array<Signature | AnySignature>; bitmap: Uint8Array | number[] }) {\n super();\n const { signatures, bitmap } = args;\n\n if (signatures.length > MultiKeySignature.MAX_SIGNATURES_SUPPORTED) {\n throw new Error(`The number of signatures cannot be greater than ${MultiKeySignature.MAX_SIGNATURES_SUPPORTED}`);\n }\n\n // Make sure that all signatures are normalized to the SingleKey authentication scheme\n this.signatures = signatures.map((signature) =>\n signature instanceof AnySignature ? signature : new AnySignature(signature),\n );\n\n if (!(bitmap instanceof Uint8Array)) {\n this.bitmap = MultiKeySignature.createBitmap({ bits: bitmap });\n } else if (bitmap.length !== MultiKeySignature.BITMAP_LEN) {\n throw new Error(`\"bitmap\" length should be ${MultiKeySignature.BITMAP_LEN}`);\n } else {\n this.bitmap = bitmap;\n }\n\n const nSignatures = this.bitmap.reduce((acc, byte) => acc + bitCount(byte), 0);\n if (nSignatures !== this.signatures.length) {\n throw new Error(`Expecting ${nSignatures} signatures from the bitmap, but got ${this.signatures.length}`);\n }\n }\n\n /**\n * Helper method to create a bitmap out of the specified bit positions\n * @param args.bits The bitmap positions that should be set. A position starts at index 0.\n * Valid position should range between 0 and 31.\n * @example\n * Here's an example of valid `bits`\n * ```\n * [0, 2, 31]\n * ```\n * `[0, 2, 31]` means the 1st, 3rd and 32nd bits should be set in the bitmap.\n * The result bitmap should be 0b1010000000000000000000000000001\n *\n * @returns bitmap that is 32bit long\n */\n static createBitmap(args: { bits: number[] }): Uint8Array {\n const { bits } = args;\n // Bits are read from left to right. e.g. 0b10000000 represents the first bit is set in one byte.\n // The decimal value of 0b10000000 is 128.\n const firstBitInByte = 128;\n const bitmap = new Uint8Array([0, 0, 0, 0]);\n\n // Check if duplicates exist in bits\n const dupCheckSet = new Set();\n\n bits.forEach((bit: number) => {\n if (bit >= MultiKeySignature.MAX_SIGNATURES_SUPPORTED) {\n throw new Error(`Cannot have a signature larger than ${MultiKeySignature.MAX_SIGNATURES_SUPPORTED - 1}.`);\n }\n\n if (dupCheckSet.has(bit)) {\n throw new Error(\"Duplicate bits detected.\");\n }\n\n dupCheckSet.add(bit);\n\n const byteOffset = Math.floor(bit / 8);\n\n let byte = bitmap[byteOffset];\n\n // eslint-disable-next-line no-bitwise\n byte |= firstBitInByte >> bit % 8;\n\n bitmap[byteOffset] = byte;\n });\n\n return bitmap;\n }\n\n // region Serializable\n\n serialize(serializer: Serializer): void {\n // Note: we should not need to serialize the vector length, as it can be derived from the bitmap\n serializer.serializeVector(this.signatures);\n serializer.serializeBytes(this.bitmap);\n }\n\n static deserialize(deserializer: Deserializer): MultiKeySignature {\n const signatures = deserializer.deserializeVector(AnySignature);\n const bitmap = deserializer.deserializeBytes();\n return new MultiKeySignature({ signatures, bitmap });\n }\n\n // endregion\n}\n"],"mappings":"2KAeA,SAASA,EAASC,EAAc,CAC9B,IAAIC,EAAID,EACR,OAAAC,GAAMA,GAAK,EAAK,WAChBA,GAAKA,EAAI,YAAgBA,GAAK,EAAK,YACzBA,GAAKA,GAAK,GAAM,WAAa,UAAc,EACvD,CAYO,IAAMC,EAAN,MAAMC,UAAiBC,CAAiB,CAwB7C,YAAYC,EAAoE,CAC9E,MAAM,EACN,GAAM,CAAE,WAAAC,EAAY,mBAAAC,CAAmB,EAAIF,EAG3C,GAAIE,EAAqB,EACvB,MAAM,IAAI,MAAM,8DAA8D,EAIhF,GAAID,EAAW,OAASC,EACtB,MAAM,IAAI,MACR,YAAYD,EAAW,MAAM,oCAAoCC,CAAkB,sBACrF,EAIF,KAAK,WAAaD,EAAW,IAAKE,GAChCA,aAAqBC,EAAeD,EAAY,IAAIC,EAAaD,CAAS,CAC5E,EAEA,KAAK,mBAAqBD,CAC5B,CAeA,gBAAgBF,EAAoC,CAClD,MAAM,IAAI,MAA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,EAAOI,CAAU,EAAIpB,CACvB,CAAC,EAEMgB,CACT,CAIA,UAAUL,EAA8B,CAEtCA,EAAW,gBAAgB,KAAK,UAAU,EAC1CA,EAAW,eAAe,KAAK,MAAM,CACvC,CAEA,OAAO,YAAYC,EAA+C,CAChE,IAAMe,EAAaf,EAAa,kBAAkBiB,CAAY,EACxDb,EAASJ,EAAa,iBAAiB,EAC7C,OAAO,IAAIa,EAAkB,CAAE,WAAAE,EAAY,OAAAX,CAAO,CAAC,CACrD,CAGF,EA3HaS,EAIJ,WAAqB,EAJjBA,EASJ,yBAA2BA,EAAkB,WAAa,EAT5D,IAAMO,EAANP","names":["bitCount","byte","n","MultiKey","_MultiKey","AccountPublicKey","args","publicKeys","signaturesRequired","publicKey","AnyPublicKey","AuthenticationKey","serializer","deserializer","keys","bits","firstBitInByte","bitmap","dupCheckSet","bit","idx","byteOffset","anyPublicKey","index","pk","value","_MultiKeySignature","Signature","signatures","signature","AnySignature","nSignatures","acc","MultiKeySignature"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as s,c as d,e as t}from"./chunk-QQIVWB6G.mjs";import{a as l,b as n,c as o,d as z,e as c,f as u}from"./chunk-56CNRT2K.mjs";var U=class i extends s{constructor(e){super(),d(e),this.value=e}serialize(e){e.serializeBool(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(5),e.serialize(this)}deserialize(e){return new a(e.deserializeU256())}static deserialize(e){return new i(e.deserializeBool())}},p=class i extends s{constructor(e){super(),t(e,0,l),this.value=e}serialize(e){e.serializeU8(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(0),e.serialize(this)}static deserialize(e){return new i(e.deserializeU8())}},b=class i extends s{constructor(e){super(),t(e,0,n),this.value=e}serialize(e){e.serializeU16(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(6),e.serialize(this)}static deserialize(e){return new i(e.deserializeU16())}},y=class i extends s{constructor(e){super(),t(e,0,o),this.value=e}serialize(e){e.serializeU32(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(7),e.serialize(this)}static deserialize(e){return new i(e.deserializeU32())}},m=class i extends s{constructor(e){super(),t(e,BigInt(0),z),this.value=BigInt(e)}serialize(e){e.serializeU64(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(1),e.serialize(this)}static deserialize(e){return new i(e.deserializeU64())}},B=class i extends s{constructor(e){super(),t(e,BigInt(0),c),this.value=BigInt(e)}serialize(e){e.serializeU128(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(2),e.serialize(this)}static deserialize(e){return new i(e.deserializeU128())}},a=class i extends s{constructor(e){super(),t(e,BigInt(0),u),this.value=BigInt(e)}serialize(e){e.serializeU256(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(8),e.serialize(this)}static deserialize(e){return new i(e.deserializeU256())}};export{U as a,p as b,b as c,y as d,m as e,B as f,a as g};
|
|
2
|
+
//# sourceMappingURL=chunk-6FLHGOKP.mjs.map
|