@aptos-labs/ts-sdk 1.29.1 → 1.31.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 +5919 -1627
- package/dist/common/index.js +11 -9
- 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 +448 -161
- package/dist/esm/api/account.mjs +1 -1
- package/dist/esm/api/ans.d.mts +369 -122
- package/dist/esm/api/ans.mjs +1 -1
- package/dist/esm/api/aptos.d.mts +40 -7
- package/dist/esm/api/aptos.mjs +1 -1
- package/dist/esm/api/aptosConfig.d.mts +102 -14
- package/dist/esm/api/aptosConfig.mjs +1 -1
- package/dist/esm/api/coin.d.mts +52 -15
- package/dist/esm/api/coin.mjs +1 -1
- package/dist/esm/api/digitalAsset.d.mts +710 -300
- package/dist/esm/api/digitalAsset.mjs +1 -1
- package/dist/esm/api/event.d.mts +129 -26
- package/dist/esm/api/event.mjs +1 -1
- package/dist/esm/api/faucet.d.mts +44 -7
- package/dist/esm/api/faucet.mjs +1 -1
- package/dist/esm/api/fungibleAsset.d.mts +152 -49
- package/dist/esm/api/fungibleAsset.mjs +1 -1
- package/dist/esm/api/general.d.mts +171 -55
- package/dist/esm/api/general.mjs +1 -1
- package/dist/esm/api/index.d.mts +2 -2
- package/dist/esm/api/index.mjs +1 -1
- package/dist/esm/api/keyless.d.mts +86 -14
- package/dist/esm/api/keyless.mjs +1 -1
- package/dist/esm/api/object.d.mts +51 -7
- package/dist/esm/api/object.mjs +1 -1
- package/dist/esm/api/staking.d.mts +86 -17
- package/dist/esm/api/staking.mjs +1 -1
- package/dist/esm/api/table.d.mts +118 -38
- package/dist/esm/api/table.mjs +1 -1
- package/dist/esm/api/transaction.d.mts +440 -109
- package/dist/esm/api/transaction.mjs +1 -1
- package/dist/esm/api/transactionSubmission/build.d.mts +99 -13
- package/dist/esm/api/transactionSubmission/build.mjs +1 -1
- package/dist/esm/api/transactionSubmission/helpers.d.mts +79 -0
- package/dist/esm/api/transactionSubmission/helpers.mjs +1 -1
- package/dist/esm/api/transactionSubmission/management.d.mts +111 -12
- package/dist/esm/api/transactionSubmission/management.mjs +1 -1
- package/dist/esm/api/transactionSubmission/sign.d.mts +97 -3
- package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
- package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -1
- package/dist/esm/api/transactionSubmission/simulate.d.mts +140 -15
- package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
- package/dist/esm/api/transactionSubmission/submit.d.mts +104 -13
- package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
- package/dist/esm/api/utils.d.mts +26 -3
- package/dist/esm/api/utils.mjs +1 -1
- package/dist/esm/bcs/consts.mjs +1 -1
- package/dist/esm/bcs/deserializer.d.mts +82 -32
- package/dist/esm/bcs/deserializer.mjs +1 -1
- package/dist/esm/bcs/index.mjs +1 -1
- package/dist/esm/bcs/serializable/entryFunctionBytes.d.mts +25 -6
- package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -1
- package/dist/esm/bcs/serializable/fixedBytes.d.mts +51 -21
- package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -1
- package/dist/esm/bcs/serializable/movePrimitives.d.mts +79 -0
- package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
- package/dist/esm/bcs/serializable/moveStructs.d.mts +119 -32
- package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
- package/dist/esm/bcs/serializer.d.mts +111 -76
- package/dist/esm/bcs/serializer.mjs +1 -1
- package/dist/esm/chunk-22ZSW5EN.mjs +2 -0
- package/dist/esm/chunk-22ZSW5EN.mjs.map +1 -0
- package/dist/esm/{chunk-7V6DEA7G.mjs → chunk-2652SPOM.mjs} +2 -2
- package/dist/esm/chunk-2652SPOM.mjs.map +1 -0
- package/dist/esm/chunk-2CGJLPHP.mjs +2 -0
- package/dist/esm/{chunk-555I4YHP.mjs.map → chunk-2CGJLPHP.mjs.map} +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-PUZ25PTD.mjs → chunk-2GEIHUHT.mjs} +2 -2
- package/dist/esm/chunk-2GEIHUHT.mjs.map +1 -0
- package/dist/esm/{chunk-FRGXKOU5.mjs → chunk-3H5DGQKX.mjs} +2 -2
- package/dist/esm/chunk-3H5DGQKX.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-L5NY7TMI.mjs → chunk-4JXB6V5O.mjs} +2 -2
- package/dist/esm/chunk-4JXB6V5O.mjs.map +1 -0
- package/dist/esm/{chunk-5655UVIK.mjs → chunk-4LKLOUMG.mjs} +2 -2
- package/dist/esm/chunk-4LKLOUMG.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-4VU2ABLU.mjs +2 -0
- package/dist/esm/chunk-4VU2ABLU.mjs.map +1 -0
- package/dist/esm/{chunk-25NSCK4Q.mjs → chunk-4ZK3JNQT.mjs} +2 -2
- package/dist/esm/chunk-4ZK3JNQT.mjs.map +1 -0
- package/dist/esm/{chunk-SWHLSREF.mjs → chunk-5N6KJ7KS.mjs} +2 -2
- package/dist/esm/chunk-5N6KJ7KS.mjs.map +1 -0
- package/dist/esm/{chunk-WWZ3METZ.mjs → chunk-5S3Z7MT4.mjs} +2 -2
- package/dist/esm/chunk-5S3Z7MT4.mjs.map +1 -0
- package/dist/esm/{chunk-46D5QX3G.mjs → chunk-5SGSPCOY.mjs} +2 -2
- package/dist/esm/chunk-5SGSPCOY.mjs.map +1 -0
- package/dist/esm/chunk-6DMDYBV6.mjs +2 -0
- package/dist/esm/chunk-6DMDYBV6.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-BRFHAO2Y.mjs → chunk-73GCGRFW.mjs} +2 -2
- package/dist/esm/chunk-73GCGRFW.mjs.map +1 -0
- package/dist/esm/{chunk-XK3JFCP3.mjs → chunk-7JK7UG4E.mjs} +2 -2
- package/dist/esm/chunk-7JK7UG4E.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-RNTXQYJQ.mjs → chunk-A2AEFKXS.mjs} +2 -2
- package/dist/esm/chunk-A2AEFKXS.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-AITN3DO4.mjs +2 -0
- package/dist/esm/chunk-AITN3DO4.mjs.map +1 -0
- package/dist/esm/{chunk-OY2IX7HW.mjs → chunk-AT2ZGTXQ.mjs} +2 -2
- package/dist/esm/chunk-AT2ZGTXQ.mjs.map +1 -0
- package/dist/esm/{chunk-TVFIUUVY.mjs → chunk-AZ6LVQEG.mjs} +2 -2
- package/dist/esm/chunk-AZ6LVQEG.mjs.map +1 -0
- package/dist/esm/chunk-BAGUHYFD.mjs +2 -0
- package/dist/esm/chunk-BAGUHYFD.mjs.map +1 -0
- package/dist/esm/{chunk-EWZ2M5BW.mjs → chunk-BG2TZI3H.mjs} +2 -2
- package/dist/esm/chunk-BG2TZI3H.mjs.map +1 -0
- package/dist/esm/chunk-BOWPP6YG.mjs +2 -0
- package/dist/esm/chunk-BOWPP6YG.mjs.map +1 -0
- package/dist/esm/{chunk-GFGX3QDP.mjs → chunk-BVVHGSWC.mjs} +2 -2
- package/dist/esm/chunk-BVVHGSWC.mjs.map +1 -0
- package/dist/esm/{chunk-BD6BJETG.mjs → chunk-CC7VOPYH.mjs} +2 -2
- package/dist/esm/chunk-CC7VOPYH.mjs.map +1 -0
- package/dist/esm/{chunk-K2O24YLZ.mjs → chunk-CDQGPCHU.mjs} +2 -2
- package/dist/esm/chunk-CDQGPCHU.mjs.map +1 -0
- package/dist/esm/{chunk-HSPBA2TZ.mjs → chunk-CL6EEMSL.mjs} +2 -2
- package/dist/esm/chunk-CL6EEMSL.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-NNRAQP36.mjs → chunk-DMSHPWA5.mjs} +2 -2
- package/dist/esm/chunk-DMSHPWA5.mjs.map +1 -0
- package/dist/esm/{chunk-STGYDB5E.mjs → chunk-EE7GDBA5.mjs} +2 -2
- package/dist/esm/chunk-EE7GDBA5.mjs.map +1 -0
- package/dist/esm/{chunk-CPPBQDHB.mjs → chunk-EUGLLGYW.mjs} +2 -2
- package/dist/esm/chunk-EUGLLGYW.mjs.map +1 -0
- package/dist/esm/{chunk-CVDR5SJR.mjs → chunk-F2RY4YQ7.mjs} +2 -2
- package/dist/esm/chunk-F2RY4YQ7.mjs.map +1 -0
- package/dist/esm/chunk-FTZGP6XW.mjs +2 -0
- package/dist/esm/chunk-FTZGP6XW.mjs.map +1 -0
- package/dist/esm/{chunk-6RZZIOGH.mjs → chunk-GLATLXF6.mjs} +2 -2
- package/dist/esm/chunk-GLATLXF6.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-TDGQGILY.mjs → chunk-GQABU3RQ.mjs} +1 -1
- package/dist/esm/chunk-GQABU3RQ.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-HM5HITUC.mjs +4 -0
- package/dist/esm/chunk-HM5HITUC.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-NH2S6SB2.mjs → chunk-IAVI3H4V.mjs} +2 -2
- package/dist/esm/chunk-IAVI3H4V.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-3YKAGVHZ.mjs → chunk-IFXUWUP2.mjs} +2 -2
- package/dist/esm/chunk-IFXUWUP2.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-MS4MRLGA.mjs → chunk-JGNMNCQB.mjs} +2 -2
- package/dist/esm/chunk-JGNMNCQB.mjs.map +1 -0
- package/dist/esm/{chunk-SR24OGHJ.mjs → chunk-JN36BNWA.mjs} +2 -2
- package/dist/esm/chunk-JN36BNWA.mjs.map +1 -0
- package/dist/esm/{chunk-DAXKRXRK.mjs → chunk-JNRMHDRA.mjs} +2 -2
- package/dist/esm/chunk-JNRMHDRA.mjs.map +1 -0
- package/dist/esm/{chunk-SAPUZZEU.mjs → chunk-JVTDP4KV.mjs} +2 -2
- package/dist/esm/chunk-JVTDP4KV.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-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-XH7YKEYR.mjs → chunk-KW4FVBDD.mjs} +2 -2
- package/dist/esm/chunk-KW4FVBDD.mjs.map +1 -0
- package/dist/esm/{chunk-AFOPNDOJ.mjs → chunk-KYJU5PWF.mjs} +2 -2
- package/dist/esm/chunk-KYJU5PWF.mjs.map +1 -0
- package/dist/esm/{chunk-X4KEZTUQ.mjs → chunk-L5J3V3HW.mjs} +2 -2
- package/dist/esm/chunk-L5J3V3HW.mjs.map +1 -0
- package/dist/esm/{chunk-LDFTE4MM.mjs → chunk-LDZPO76C.mjs} +2 -2
- package/dist/esm/chunk-LDZPO76C.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-YHAPZP5A.mjs → chunk-M22UGFQ5.mjs} +2 -2
- package/dist/esm/chunk-M22UGFQ5.mjs.map +1 -0
- package/dist/esm/{chunk-TMW2HIXC.mjs → chunk-MK2QAHXC.mjs} +2 -2
- package/dist/esm/chunk-MK2QAHXC.mjs.map +1 -0
- package/dist/esm/{chunk-QCUFTD7K.mjs → chunk-MSHZ4FWB.mjs} +2 -2
- package/dist/esm/chunk-MSHZ4FWB.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-OAEDFM7T.mjs +2 -0
- package/dist/esm/chunk-OAEDFM7T.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-OTY3NO7Q.mjs +2 -0
- package/dist/esm/chunk-OTY3NO7Q.mjs.map +1 -0
- package/dist/esm/{chunk-ZGO2SK6F.mjs → chunk-OXM4BVAY.mjs} +2 -2
- package/dist/esm/chunk-OXM4BVAY.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-DAJOX4PL.mjs → chunk-P3J54CQG.mjs} +2 -2
- package/dist/esm/chunk-P3J54CQG.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-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-QQIVWB6G.mjs +2 -0
- package/dist/esm/chunk-QQIVWB6G.mjs.map +1 -0
- package/dist/esm/{chunk-TS3PYRAT.mjs → chunk-RAJTNQNL.mjs} +2 -2
- package/dist/esm/chunk-RAJTNQNL.mjs.map +1 -0
- package/dist/esm/{chunk-XONG5JZ4.mjs → chunk-RBJNSUSU.mjs} +2 -2
- package/dist/esm/chunk-RBJNSUSU.mjs.map +1 -0
- package/dist/esm/{chunk-EV2USF7B.mjs → chunk-RNJHULIT.mjs} +2 -2
- package/dist/esm/chunk-RNJHULIT.mjs.map +1 -0
- package/dist/esm/{chunk-IYQISVDX.mjs → chunk-RNRNGJDA.mjs} +2 -2
- package/dist/esm/chunk-RNRNGJDA.mjs.map +1 -0
- package/dist/esm/{chunk-N5JNKD5F.mjs → chunk-SGQFWWLQ.mjs} +2 -2
- package/dist/esm/chunk-SGQFWWLQ.mjs.map +1 -0
- package/dist/esm/{chunk-7ZLBJUVZ.mjs → chunk-SOLWFAUY.mjs} +2 -2
- package/dist/esm/chunk-SOLWFAUY.mjs.map +1 -0
- package/dist/esm/{chunk-MO4IZXLK.mjs → chunk-T5BCTWGK.mjs} +2 -2
- package/dist/esm/chunk-T5BCTWGK.mjs.map +1 -0
- package/dist/esm/{chunk-U67PFBTL.mjs → chunk-TPJLAYW6.mjs} +2 -2
- package/dist/esm/chunk-TPJLAYW6.mjs.map +1 -0
- package/dist/esm/{chunk-XXHW3ZT3.mjs → chunk-UCRROMZN.mjs} +2 -2
- package/dist/esm/chunk-UCRROMZN.mjs.map +1 -0
- package/dist/esm/{chunk-QLN2URFX.mjs → chunk-UGL2GPGK.mjs} +2 -2
- package/dist/esm/chunk-UGL2GPGK.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-KYSDF3CA.mjs → chunk-VYMRIKUV.mjs} +2 -2
- package/dist/esm/chunk-VYMRIKUV.mjs.map +1 -0
- package/dist/esm/{chunk-KXBIA4KR.mjs → chunk-WSZCPSV4.mjs} +2 -2
- package/dist/esm/chunk-WSZCPSV4.mjs.map +1 -0
- package/dist/esm/{chunk-B2CXRZL5.mjs → chunk-WV2VJQDS.mjs} +2 -2
- package/dist/esm/chunk-WV2VJQDS.mjs.map +1 -0
- package/dist/esm/{chunk-B6M7QBUO.mjs → chunk-WZCKSN2U.mjs} +2 -2
- package/dist/esm/chunk-WZCKSN2U.mjs.map +1 -0
- package/dist/esm/{chunk-25TIHDS6.mjs → chunk-XFJD6QIP.mjs} +2 -2
- package/dist/esm/chunk-XFJD6QIP.mjs.map +1 -0
- package/dist/esm/{chunk-ECWOLU5T.mjs → chunk-XFY4O2S3.mjs} +2 -2
- package/dist/esm/chunk-XFY4O2S3.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-TL7DR54X.mjs → chunk-XQ7ONNII.mjs} +2 -2
- package/dist/esm/chunk-XQ7ONNII.mjs.map +1 -0
- package/dist/esm/chunk-Y267I7DC.mjs +2 -0
- package/dist/esm/chunk-Y267I7DC.mjs.map +1 -0
- package/dist/esm/{chunk-G7MWTE2J.mjs → chunk-YZ5BCOGI.mjs} +2 -2
- package/dist/esm/{chunk-LXLISEQ4.mjs → chunk-ZINOJTLU.mjs} +2 -2
- package/dist/esm/chunk-ZINOJTLU.mjs.map +1 -0
- package/dist/esm/{chunk-2TQIU7CG.mjs → chunk-ZPIMARUG.mjs} +2 -2
- package/dist/esm/chunk-ZPIMARUG.mjs.map +1 -0
- package/dist/esm/chunk-ZPQUCT22.mjs +2 -0
- package/dist/esm/chunk-ZPQUCT22.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 +41 -4
- 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 +454 -160
- 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 +119 -22
- 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 +135 -137
- 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 +41 -3
- 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 +0 -2
- 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 +0 -2
- 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-YZ5BCOGI.mjs.map} +0 -0
package/src/client/post.ts
CHANGED
|
@@ -7,6 +7,9 @@ import { AptosResponse } from "./types";
|
|
|
7
7
|
import { AnyNumber, ClientConfig, MimeType } from "../types";
|
|
8
8
|
import { AptosApiType } from "../utils/const";
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* Options for making a POST request, including the API client configuration.
|
|
12
|
+
*/
|
|
10
13
|
export type PostRequestOptions = {
|
|
11
14
|
/**
|
|
12
15
|
* The config for the API client
|
|
@@ -46,13 +49,25 @@ export type PostRequestOptions = {
|
|
|
46
49
|
overrides?: ClientConfig;
|
|
47
50
|
};
|
|
48
51
|
|
|
52
|
+
/**
|
|
53
|
+
* Options for posting a request to Aptos, excluding the type field.
|
|
54
|
+
*/
|
|
49
55
|
export type PostAptosRequestOptions = Omit<PostRequestOptions, "type">;
|
|
50
56
|
|
|
51
57
|
/**
|
|
52
|
-
*
|
|
58
|
+
* Executes a POST request to the specified URL with the provided options.
|
|
53
59
|
*
|
|
54
|
-
* @param options
|
|
55
|
-
* @
|
|
60
|
+
* @param options - The options for the POST request.
|
|
61
|
+
* @param options.type - The type of the request.
|
|
62
|
+
* @param options.originMethod - The original method that initiated the request.
|
|
63
|
+
* @param options.path - The path for the request.
|
|
64
|
+
* @param options.body - The body content to be sent with the request.
|
|
65
|
+
* @param options.acceptType - The type of response expected from the server.
|
|
66
|
+
* @param options.contentType - The content type of the request body.
|
|
67
|
+
* @param options.params - Additional parameters to include in the request.
|
|
68
|
+
* @param options.aptosConfig - Configuration settings for the Aptos request.
|
|
69
|
+
* @param options.overrides - Any overrides for the default request behavior.
|
|
70
|
+
* @returns The response from the POST request.
|
|
56
71
|
*/
|
|
57
72
|
export async function post<Req extends {}, Res extends {}>(
|
|
58
73
|
options: PostRequestOptions,
|
|
@@ -77,6 +92,16 @@ export async function post<Req extends {}, Res extends {}>(
|
|
|
77
92
|
);
|
|
78
93
|
}
|
|
79
94
|
|
|
95
|
+
/**
|
|
96
|
+
* Sends a request to the Aptos full node using the specified options.
|
|
97
|
+
* This function allows you to interact with the Aptos blockchain by sending requests to the full node.
|
|
98
|
+
*
|
|
99
|
+
* @param options - The options for the request.
|
|
100
|
+
* @param options.aptosConfig - Configuration settings for the Aptos client.
|
|
101
|
+
* @param options.aptosConfig.clientConfig - Client-specific configuration settings.
|
|
102
|
+
* @param options.aptosConfig.fullnodeConfig - Full node-specific configuration settings.
|
|
103
|
+
* @param options.overrides - Additional overrides for the request.
|
|
104
|
+
*/
|
|
80
105
|
export async function postAptosFullNode<Req extends {}, Res extends {}>(
|
|
81
106
|
options: PostAptosRequestOptions,
|
|
82
107
|
): Promise<AptosResponse<Req, Res>> {
|
|
@@ -94,6 +119,17 @@ export async function postAptosFullNode<Req extends {}, Res extends {}>(
|
|
|
94
119
|
});
|
|
95
120
|
}
|
|
96
121
|
|
|
122
|
+
/**
|
|
123
|
+
* Sends a request to the Aptos indexer with the specified options.
|
|
124
|
+
* This function allows you to interact with the Aptos indexer and customize the request using various configurations.
|
|
125
|
+
*
|
|
126
|
+
* @param options - The options for the request to the Aptos indexer.
|
|
127
|
+
* @param options.aptosConfig - Configuration settings specific to the Aptos client and indexer.
|
|
128
|
+
* @param options.aptosConfig.clientConfig - The client configuration settings.
|
|
129
|
+
* @param options.aptosConfig.indexerConfig - The indexer configuration settings.
|
|
130
|
+
* @param options.overrides - Additional overrides for the request.
|
|
131
|
+
* @param options.overrides.HEADERS - Custom headers to include in the request.
|
|
132
|
+
*/
|
|
97
133
|
export async function postAptosIndexer<Req extends {}, Res extends {}>(
|
|
98
134
|
options: PostAptosRequestOptions,
|
|
99
135
|
): Promise<AptosResponse<Req, Res>> {
|
|
@@ -111,6 +147,17 @@ export async function postAptosIndexer<Req extends {}, Res extends {}>(
|
|
|
111
147
|
});
|
|
112
148
|
}
|
|
113
149
|
|
|
150
|
+
/**
|
|
151
|
+
* Sends a request to the Aptos faucet to obtain test tokens.
|
|
152
|
+
* This function modifies the provided configuration to ensure that the API_KEY is not included in the request.
|
|
153
|
+
*
|
|
154
|
+
* @param options - The options for the request.
|
|
155
|
+
* @param options.aptosConfig - The configuration settings for the Aptos client.
|
|
156
|
+
* @param options.aptosConfig.clientConfig - The client-specific configuration settings.
|
|
157
|
+
* @param options.aptosConfig.clientConfig.HEADERS - Optional headers to include in the request.
|
|
158
|
+
* @param options.aptosConfig.faucetConfig - The configuration settings specific to the faucet.
|
|
159
|
+
* @param options.overrides - Additional overrides for the request configuration.
|
|
160
|
+
*/
|
|
114
161
|
export async function postAptosFaucet<Req extends {}, Res extends {}>(
|
|
115
162
|
options: PostAptosRequestOptions,
|
|
116
163
|
): Promise<AptosResponse<Req, Res>> {
|
|
@@ -137,10 +184,13 @@ export async function postAptosFaucet<Req extends {}, Res extends {}>(
|
|
|
137
184
|
}
|
|
138
185
|
|
|
139
186
|
/**
|
|
140
|
-
* Makes a post request to the pepper service
|
|
187
|
+
* Makes a post request to the pepper service.
|
|
141
188
|
*
|
|
142
|
-
* @param options
|
|
143
|
-
* @
|
|
189
|
+
* @param options - The options for the request.
|
|
190
|
+
* @param options.url - The URL to which the request is sent.
|
|
191
|
+
* @param options.headers - The headers to include in the request.
|
|
192
|
+
* @param options.body - The body of the request.
|
|
193
|
+
* @returns A promise that resolves to the response from the pepper service.
|
|
144
194
|
*/
|
|
145
195
|
export async function postAptosPepperService<Req extends {}, Res extends {}>(
|
|
146
196
|
options: PostAptosRequestOptions,
|
|
@@ -148,6 +198,13 @@ export async function postAptosPepperService<Req extends {}, Res extends {}>(
|
|
|
148
198
|
return post<Req, Res>({ ...options, type: AptosApiType.PEPPER });
|
|
149
199
|
}
|
|
150
200
|
|
|
201
|
+
/**
|
|
202
|
+
* Sends a request to the Aptos proving service with the specified options.
|
|
203
|
+
*
|
|
204
|
+
* @param options - The options for the request to the Aptos proving service.
|
|
205
|
+
* @param options.type - The type of the request, which should be set to AptosApiType.PROVER.
|
|
206
|
+
* @param options.data - The data to be included in the request.
|
|
207
|
+
*/
|
|
151
208
|
export async function postAptosProvingService<Req extends {}, Res extends {}>(
|
|
152
209
|
options: PostAptosRequestOptions,
|
|
153
210
|
): Promise<AptosResponse<Req, Res>> {
|
package/src/client/types.ts
CHANGED
|
@@ -25,6 +25,9 @@ export interface AptosResponse<Req, Res> {
|
|
|
25
25
|
request?: Req;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
/**
|
|
29
|
+
* Options for handling errors in the Aptos API.
|
|
30
|
+
*/
|
|
28
31
|
type AptosApiErrorOpts = {
|
|
29
32
|
apiType: AptosApiType;
|
|
30
33
|
aptosRequest: AptosRequest;
|
|
@@ -32,14 +35,15 @@ type AptosApiErrorOpts = {
|
|
|
32
35
|
};
|
|
33
36
|
|
|
34
37
|
/**
|
|
35
|
-
*
|
|
38
|
+
* Represents an error returned from the Aptos API.
|
|
39
|
+
* This class encapsulates the details of the error, including the request URL, response status, and additional data.
|
|
36
40
|
*
|
|
37
|
-
* @param name - the error
|
|
38
|
-
* @param url
|
|
39
|
-
* @param status -
|
|
40
|
-
* @param statusText - the response
|
|
41
|
-
* @param data
|
|
42
|
-
* @param request - the
|
|
41
|
+
* @param name - The name of the error, which is always "AptosApiError".
|
|
42
|
+
* @param url - The URL to which the request was made.
|
|
43
|
+
* @param status - The HTTP response status code (e.g., 400).
|
|
44
|
+
* @param statusText - The message associated with the response status.
|
|
45
|
+
* @param data - The response data returned from the API.
|
|
46
|
+
* @param request - The original AptosRequest that triggered the error.
|
|
43
47
|
*/
|
|
44
48
|
export class AptosApiError extends Error {
|
|
45
49
|
readonly url: string;
|
|
@@ -52,7 +56,16 @@ export class AptosApiError extends Error {
|
|
|
52
56
|
|
|
53
57
|
readonly request: AptosRequest;
|
|
54
58
|
|
|
55
|
-
/**
|
|
59
|
+
/**
|
|
60
|
+
* Constructs an instance of AptosApiError with relevant error details.
|
|
61
|
+
*
|
|
62
|
+
* @param opts - The options for creating the AptosApiError.
|
|
63
|
+
* @param opts.apiType - The type of API that generated the error.
|
|
64
|
+
* @param opts.aptosRequest - The request object that caused the error.
|
|
65
|
+
* @param opts.aptosResponse - The response object containing error details.
|
|
66
|
+
*
|
|
67
|
+
* @internal This constructor is for SDK internal use - do not instantiate outside the SDK codebase.
|
|
68
|
+
*/
|
|
56
69
|
constructor({ apiType, aptosRequest, aptosResponse }: AptosApiErrorOpts) {
|
|
57
70
|
super(deriveErrorMessage({ apiType, aptosRequest, aptosResponse }));
|
|
58
71
|
|
|
@@ -65,8 +78,17 @@ export class AptosApiError extends Error {
|
|
|
65
78
|
}
|
|
66
79
|
}
|
|
67
80
|
|
|
81
|
+
/**
|
|
82
|
+
* Derives an error message from the Aptos API response, providing context for debugging.
|
|
83
|
+
* This function helps in understanding the nature of the error encountered during an API request.
|
|
84
|
+
*
|
|
85
|
+
* @param {AptosApiErrorOpts} opts - The options for deriving the error message.
|
|
86
|
+
* @param {AptosApiType} opts.apiType - The type of API being called.
|
|
87
|
+
* @param {AptosRequest} opts.aptosRequest - The original request made to the Aptos API.
|
|
88
|
+
* @param {AptosResponse} opts.aptosResponse - The response received from the Aptos API.
|
|
89
|
+
*/
|
|
68
90
|
function deriveErrorMessage({ apiType, aptosRequest, aptosResponse }: AptosApiErrorOpts): string {
|
|
69
|
-
// extract the W3C trace_id from the response headers if it exists. Some services set this in the response and it's useful for debugging.
|
|
91
|
+
// extract the W3C trace_id from the response headers if it exists. Some services set this in the response, and it's useful for debugging.
|
|
70
92
|
// See https://www.w3.org/TR/trace-context/#relationship-between-the-headers .
|
|
71
93
|
const traceId = aptosResponse.headers?.traceparent?.split("-")[1];
|
|
72
94
|
const traceIdString = traceId ? `(trace_id:${traceId}) ` : "";
|
|
@@ -86,7 +108,7 @@ function deriveErrorMessage({ apiType, aptosRequest, aptosResponse }: AptosApiEr
|
|
|
86
108
|
return `${errorPrelude}: ${JSON.stringify(aptosResponse.data)}`;
|
|
87
109
|
}
|
|
88
110
|
|
|
89
|
-
// This is the generic/catch-all case. We received some response from the API but it doesn't appear to be a well-known structure.
|
|
111
|
+
// This is the generic/catch-all case. We received some response from the API, but it doesn't appear to be a well-known structure.
|
|
90
112
|
// We print http status codes and the response body (after some trimming),
|
|
91
113
|
// in the hope that this gives enough context what went wrong without printing overly huge messages.
|
|
92
114
|
return `${errorPrelude} status: ${aptosResponse.statusText}(code:${
|
|
@@ -96,9 +118,14 @@ function deriveErrorMessage({ apiType, aptosRequest, aptosResponse }: AptosApiEr
|
|
|
96
118
|
|
|
97
119
|
const SERIALIZED_PAYLOAD_TRIM_TO_MAX_LENGTH = 400;
|
|
98
120
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
121
|
+
/**
|
|
122
|
+
* This function accepts a payload of any type (probably an object) and serializes it to a string
|
|
123
|
+
* Since we don't know the type or size of the payload, and we don't want to add a huge object in full to the error message
|
|
124
|
+
* we limit the to the first 200 and last 200 characters of the serialized payload and put a "..." in the middle.
|
|
125
|
+
* @param payload - The payload to serialize, which can be of any type.
|
|
126
|
+
*
|
|
127
|
+
* @returns A string representation of the serialized payload, potentially truncated.
|
|
128
|
+
*/
|
|
102
129
|
function serializeAnyPayloadForErrorMessage(payload: any): string {
|
|
103
130
|
const serializedPayload = JSON.stringify(payload);
|
|
104
131
|
if (serializedPayload.length <= SERIALIZED_PAYLOAD_TRIM_TO_MAX_LENGTH) {
|
|
@@ -21,7 +21,7 @@ export const createObjectAddress = (creatorAddress: AccountAddress, seed: Uint8A
|
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
|
-
* Creates
|
|
24
|
+
* Creates a resource address from creator address and seed
|
|
25
25
|
*
|
|
26
26
|
* @param creatorAddress The creator account address
|
|
27
27
|
* @param seed The seed in either Uint8Array | string type
|
|
@@ -9,7 +9,7 @@ import { TransactionArgument } from "../transactions/instances/transactionArgume
|
|
|
9
9
|
import { HexInput, ScriptTransactionArgumentVariants } from "../types";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* Provides reasons for an address was invalid.
|
|
13
13
|
*/
|
|
14
14
|
export enum AddressInvalidReason {
|
|
15
15
|
INCORRECT_NUMBER_OF_BYTES = "incorrect_number_of_bytes",
|
|
@@ -21,6 +21,9 @@ export enum AddressInvalidReason {
|
|
|
21
21
|
INVALID_PADDING_ZEROES = "INVALID_PADDING_ZEROES",
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
/**
|
|
25
|
+
* The input for an account address, which can be either a hexadecimal string or a standard account address.
|
|
26
|
+
*/
|
|
24
27
|
export type AccountAddressInput = HexInput | AccountAddress;
|
|
25
28
|
|
|
26
29
|
/**
|
|
@@ -70,7 +73,10 @@ export class AccountAddress extends Serializable implements TransactionArgument
|
|
|
70
73
|
/**
|
|
71
74
|
* Creates an instance of AccountAddress from a Uint8Array.
|
|
72
75
|
*
|
|
73
|
-
*
|
|
76
|
+
* This function ensures that the input data is exactly 32 bytes long, which is required for a valid account address.
|
|
77
|
+
*
|
|
78
|
+
* @param input A Uint8Array representing an account address.
|
|
79
|
+
* @throws ParsingError if the input length is not equal to 32 bytes.
|
|
74
80
|
*/
|
|
75
81
|
constructor(input: Uint8Array) {
|
|
76
82
|
super();
|
|
@@ -84,21 +90,20 @@ export class AccountAddress extends Serializable implements TransactionArgument
|
|
|
84
90
|
}
|
|
85
91
|
|
|
86
92
|
/**
|
|
87
|
-
*
|
|
88
|
-
*
|
|
93
|
+
* Determines if the address is classified as special, which is defined as 0x0 to 0xf inclusive.
|
|
94
|
+
* In other words, the last byte of the address must be < 0b10000 (16)
|
|
89
95
|
* and every other byte must be zero.
|
|
90
96
|
*
|
|
91
|
-
* For more information on how special addresses are defined see AIP-40:
|
|
97
|
+
* For more information on how special addresses are defined, see AIP-40:
|
|
92
98
|
* https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.
|
|
93
99
|
*
|
|
94
|
-
* @returns true if the address is special, false
|
|
100
|
+
* @returns true if the address is special, false otherwise.
|
|
95
101
|
*/
|
|
96
102
|
isSpecial(): boolean {
|
|
97
103
|
return (
|
|
98
104
|
this.data.slice(0, this.data.length - 1).every((byte) => byte === 0) && this.data[this.data.length - 1] < 0b10000
|
|
99
105
|
);
|
|
100
106
|
}
|
|
101
|
-
|
|
102
107
|
// ===
|
|
103
108
|
// Methods for representing an instance of AccountAddress as other types.
|
|
104
109
|
// ===
|
|
@@ -106,10 +111,8 @@ export class AccountAddress extends Serializable implements TransactionArgument
|
|
|
106
111
|
/**
|
|
107
112
|
* Return the AccountAddress as a string as per AIP-40.
|
|
108
113
|
* https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
* 0x0 through to 0xf inclusive, and every other address is represented in LONG form,
|
|
112
|
-
* meaning 0x + 64 hex characters.
|
|
114
|
+
* This representation returns special addresses in SHORT form (0xf)
|
|
115
|
+
* and other addresses in LONG form (0x + 64 characters).
|
|
113
116
|
*
|
|
114
117
|
* @returns AccountAddress as a string conforming to AIP-40.
|
|
115
118
|
*/
|
|
@@ -118,13 +121,11 @@ export class AccountAddress extends Serializable implements TransactionArgument
|
|
|
118
121
|
}
|
|
119
122
|
|
|
120
123
|
/**
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
* Return the AccountAddress as a string as per AIP-40 but without the leading 0x.
|
|
124
|
+
* Return the AccountAddress as a string conforming to AIP-40 but without the leading 0x.
|
|
124
125
|
*
|
|
125
|
-
*
|
|
126
|
+
* NOTE: Prefer to use `toString` where possible.
|
|
126
127
|
*
|
|
127
|
-
* @returns AccountAddress as a string
|
|
128
|
+
* @returns AccountAddress as a string without the leading 0x.
|
|
128
129
|
*/
|
|
129
130
|
toStringWithoutPrefix(): string {
|
|
130
131
|
let hex = bytesToHex(this.data);
|
|
@@ -135,13 +136,9 @@ export class AccountAddress extends Serializable implements TransactionArgument
|
|
|
135
136
|
}
|
|
136
137
|
|
|
137
138
|
/**
|
|
138
|
-
*
|
|
139
|
-
*
|
|
140
|
-
* Whereas toString will format special addresses (as defined by isSpecial) using the
|
|
141
|
-
* SHORT form (no leading 0s), this format the address in the LONG format
|
|
142
|
-
* unconditionally.
|
|
139
|
+
* Convert the account address to a string in LONG format, which is always 0x followed by 64 hex characters.
|
|
143
140
|
*
|
|
144
|
-
*
|
|
141
|
+
* NOTE: Prefer to use `toString` where possible, as it formats special addresses using the SHORT form (no leading 0s).
|
|
145
142
|
*
|
|
146
143
|
* @returns AccountAddress as a string in LONG form.
|
|
147
144
|
*/
|
|
@@ -150,23 +147,20 @@ export class AccountAddress extends Serializable implements TransactionArgument
|
|
|
150
147
|
}
|
|
151
148
|
|
|
152
149
|
/**
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
* Whereas toString will format special addresses (as defined by isSpecial) using the
|
|
156
|
-
* SHORT form (no leading 0s), this function will include leading zeroes. The string
|
|
157
|
-
* will not have a leading zero.
|
|
150
|
+
* Returns the account address as a string in LONG form without a leading 0x.
|
|
151
|
+
* This function will include leading zeroes and will produce a string of 64 hex characters.
|
|
158
152
|
*
|
|
159
|
-
*
|
|
153
|
+
* NOTE: Prefer to use `toString` where possible, as it formats special addresses using the SHORT form (no leading 0s).
|
|
160
154
|
*
|
|
161
|
-
* @returns
|
|
155
|
+
* @returns {string} The account address in LONG form.
|
|
162
156
|
*/
|
|
163
157
|
toStringLongWithoutPrefix(): string {
|
|
164
158
|
return bytesToHex(this.data);
|
|
165
159
|
}
|
|
166
160
|
|
|
167
161
|
/**
|
|
168
|
-
* Get the inner
|
|
169
|
-
* is
|
|
162
|
+
* Get the inner data as a Uint8Array.
|
|
163
|
+
* The inner data is already a Uint8Array, so no conversion takes place.
|
|
170
164
|
*
|
|
171
165
|
* @returns Hex data as Uint8Array
|
|
172
166
|
*/
|
|
@@ -189,11 +183,23 @@ export class AccountAddress extends Serializable implements TransactionArgument
|
|
|
189
183
|
serializer.serializeFixedBytes(this.data);
|
|
190
184
|
}
|
|
191
185
|
|
|
186
|
+
/**
|
|
187
|
+
* Serializes the current instance into a byte sequence suitable for entry functions.
|
|
188
|
+
* This allows for the proper encoding of data when interacting with entry functions in the blockchain.
|
|
189
|
+
*
|
|
190
|
+
* @param serializer - The serializer instance used to convert the data into bytes.
|
|
191
|
+
*/
|
|
192
192
|
serializeForEntryFunction(serializer: Serializer): void {
|
|
193
193
|
const bcsBytes = this.bcsToBytes();
|
|
194
194
|
serializer.serializeBytes(bcsBytes);
|
|
195
195
|
}
|
|
196
196
|
|
|
197
|
+
/**
|
|
198
|
+
* Serializes the current instance for use in a script function by encoding it into a byte sequence.
|
|
199
|
+
* This process involves serializing the variant index and the instance data, making it suitable for transmission.
|
|
200
|
+
*
|
|
201
|
+
* @param serializer - The serializer instance used to perform the serialization.
|
|
202
|
+
*/
|
|
197
203
|
serializeForScriptFunction(serializer: Serializer): void {
|
|
198
204
|
serializer.serializeU32AsUleb128(ScriptTransactionArgumentVariants.Address);
|
|
199
205
|
serializer.serialize(this);
|
|
@@ -201,6 +207,7 @@ export class AccountAddress extends Serializable implements TransactionArgument
|
|
|
201
207
|
|
|
202
208
|
/**
|
|
203
209
|
* Deserialize an AccountAddress from the byte buffer in a Deserializer instance.
|
|
210
|
+
* This function allows you to convert a byte representation of an AccountAddress into an instance of AccountAddress.
|
|
204
211
|
* @param deserializer The deserializer to deserialize the AccountAddress from.
|
|
205
212
|
* @returns An instance of AccountAddress.
|
|
206
213
|
* @example
|
|
@@ -238,10 +245,14 @@ export class AccountAddress extends Serializable implements TransactionArgument
|
|
|
238
245
|
* - SHORT for non-special addresses.
|
|
239
246
|
* - Any address without a leading 0x.
|
|
240
247
|
*
|
|
241
|
-
*
|
|
242
|
-
*
|
|
248
|
+
* @param input - A hex string representing an account address.
|
|
249
|
+
*
|
|
250
|
+
* @throws {ParsingError} If the hex string does not start with 0x or is not in a valid format.
|
|
251
|
+
*
|
|
252
|
+
* @note This function has strict parsing behavior. For relaxed behavior, please use the `fromString` function.
|
|
243
253
|
*
|
|
244
|
-
* @
|
|
254
|
+
* @see AIP-40 documentation for more details on address formats:
|
|
255
|
+
* https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.
|
|
245
256
|
*
|
|
246
257
|
* @returns An instance of AccountAddress.
|
|
247
258
|
*/
|
|
@@ -295,9 +306,11 @@ export class AccountAddress extends Serializable implements TransactionArgument
|
|
|
295
306
|
* Learn more about the different address formats by reading AIP-40:
|
|
296
307
|
* https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.
|
|
297
308
|
*
|
|
298
|
-
* @param input A hex string representing an account address.
|
|
309
|
+
* @param input - A hex string representing an account address.
|
|
299
310
|
*
|
|
300
311
|
* @returns An instance of AccountAddress.
|
|
312
|
+
*
|
|
313
|
+
* @throws ParsingError if the hex string is too short, too long, or contains invalid characters.
|
|
301
314
|
*/
|
|
302
315
|
static fromString(input: string): AccountAddress {
|
|
303
316
|
let parsedInput = input;
|
|
@@ -338,10 +351,12 @@ export class AccountAddress extends Serializable implements TransactionArgument
|
|
|
338
351
|
}
|
|
339
352
|
|
|
340
353
|
/**
|
|
341
|
-
* Convenience method for creating an AccountAddress from
|
|
354
|
+
* Convenience method for creating an AccountAddress from various input types.
|
|
355
|
+
* This function accepts a string, Uint8Array, or an existing AccountAddress instance and returns the corresponding
|
|
356
|
+
* AccountAddress.
|
|
342
357
|
*
|
|
343
|
-
* This
|
|
344
|
-
*
|
|
358
|
+
* @param input - The input to convert into an AccountAddress. This can be a string representation of an address, a Uint8Array,
|
|
359
|
+
* or an existing AccountAddress.
|
|
345
360
|
*/
|
|
346
361
|
static from(input: AccountAddressInput): AccountAddress {
|
|
347
362
|
if (typeof input === "string") {
|
|
@@ -354,10 +369,9 @@ export class AccountAddress extends Serializable implements TransactionArgument
|
|
|
354
369
|
}
|
|
355
370
|
|
|
356
371
|
/**
|
|
357
|
-
*
|
|
372
|
+
* Create an AccountAddress from various input types, including strings, Uint8Array, and AccountAddress instances.
|
|
358
373
|
*
|
|
359
|
-
*
|
|
360
|
-
* @param input
|
|
374
|
+
* @param input - The input to convert into an AccountAddress, which can be a string, a Uint8Array, or an AccountAddress.
|
|
361
375
|
*/
|
|
362
376
|
static fromStrict(input: AccountAddressInput): AccountAddress {
|
|
363
377
|
if (typeof input === "string") {
|
|
@@ -368,19 +382,19 @@ export class AccountAddress extends Serializable implements TransactionArgument
|
|
|
368
382
|
}
|
|
369
383
|
return input;
|
|
370
384
|
}
|
|
371
|
-
|
|
372
385
|
// ===
|
|
373
386
|
// Methods for checking validity.
|
|
374
387
|
// ===
|
|
375
388
|
|
|
376
389
|
/**
|
|
377
|
-
* Check if the
|
|
390
|
+
* Check if the provided input is a valid AccountAddress.
|
|
378
391
|
*
|
|
379
|
-
* @param args
|
|
380
|
-
* @param args.
|
|
392
|
+
* @param args - The arguments for validation.
|
|
393
|
+
* @param args.input - A hex string representing an account address.
|
|
394
|
+
* @param args.strict - If true, use strict parsing behavior; if false, use relaxed parsing behavior.
|
|
381
395
|
*
|
|
382
|
-
* @returns
|
|
383
|
-
* is
|
|
396
|
+
* @returns An object indicating whether the address is valid. If valid, valid = true; if not, valid = false with additional details.
|
|
397
|
+
* If the address is invalid, invalidReason will explain why it is invalid, and invalidReasonMessage will provide the error message.
|
|
384
398
|
*/
|
|
385
399
|
static isValid(args: { input: AccountAddressInput; strict?: boolean }): ParsingResult<AddressInvalidReason> {
|
|
386
400
|
try {
|
|
@@ -400,10 +414,9 @@ export class AccountAddress extends Serializable implements TransactionArgument
|
|
|
400
414
|
}
|
|
401
415
|
|
|
402
416
|
/**
|
|
403
|
-
*
|
|
404
|
-
* if their underlying byte data is identical.
|
|
417
|
+
* Determine if two AccountAddresses are equal based on their underlying byte data.
|
|
405
418
|
*
|
|
406
|
-
* @param other The AccountAddress to compare to.
|
|
419
|
+
* @param other - The AccountAddress to compare to.
|
|
407
420
|
* @returns true if the AccountAddresses are equal, false if not.
|
|
408
421
|
*/
|
|
409
422
|
equals(other: AccountAddress): boolean {
|
|
@@ -10,11 +10,13 @@ import { Serializable, Serializer } from "../bcs/serializer";
|
|
|
10
10
|
import { Deserializer } from "../bcs/deserializer";
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
* Each account stores an authentication key
|
|
14
|
-
* their private key(s)
|
|
13
|
+
* Represents an authentication key used for account management. Each account stores an authentication key that enables account
|
|
14
|
+
* owners to rotate their private key(s) without changing the address that hosts their account. The authentication key is a
|
|
15
|
+
* SHA3-256 hash of data and is always 32 bytes in length.
|
|
16
|
+
*
|
|
15
17
|
* @see {@link https://aptos.dev/concepts/accounts | Account Basics}
|
|
16
18
|
*
|
|
17
|
-
* Account addresses can be derived from AuthenticationKey
|
|
19
|
+
* Account addresses can be derived from the AuthenticationKey.
|
|
18
20
|
*/
|
|
19
21
|
export class AuthenticationKey extends Serializable {
|
|
20
22
|
/**
|
|
@@ -29,6 +31,15 @@ export class AuthenticationKey extends Serializable {
|
|
|
29
31
|
*/
|
|
30
32
|
public readonly data: Hex;
|
|
31
33
|
|
|
34
|
+
/**
|
|
35
|
+
* Creates an instance of the AuthenticationKey using the provided hex input.
|
|
36
|
+
* This ensures that the hex input is valid and conforms to the required length for an Authentication Key.
|
|
37
|
+
*
|
|
38
|
+
* @param args - The arguments for constructing the AuthenticationKey.
|
|
39
|
+
* @param args.data - The hex input data to be used for the Authentication Key.
|
|
40
|
+
* @throws {Error} Throws an error if the length of the provided hex input is not equal to the required Authentication Key
|
|
41
|
+
* length.
|
|
42
|
+
*/
|
|
32
43
|
constructor(args: { data: HexInput }) {
|
|
33
44
|
super();
|
|
34
45
|
const { data } = args;
|
|
@@ -39,13 +50,18 @@ export class AuthenticationKey extends Serializable {
|
|
|
39
50
|
this.data = hex;
|
|
40
51
|
}
|
|
41
52
|
|
|
53
|
+
/**
|
|
54
|
+
* Serializes the fixed bytes data into a format suitable for transmission or storage.
|
|
55
|
+
*
|
|
56
|
+
* @param serializer - The serializer instance used to perform the serialization.
|
|
57
|
+
*/
|
|
42
58
|
serialize(serializer: Serializer): void {
|
|
43
59
|
serializer.serializeFixedBytes(this.data.toUint8Array());
|
|
44
60
|
}
|
|
45
61
|
|
|
46
62
|
/**
|
|
47
63
|
* Deserialize an AuthenticationKey from the byte buffer in a Deserializer instance.
|
|
48
|
-
* @param deserializer The deserializer to deserialize the AuthenticationKey from.
|
|
64
|
+
* @param deserializer - The deserializer to deserialize the AuthenticationKey from.
|
|
49
65
|
* @returns An instance of AuthenticationKey.
|
|
50
66
|
*/
|
|
51
67
|
static deserialize(deserializer: Deserializer): AuthenticationKey {
|
|
@@ -53,14 +69,26 @@ export class AuthenticationKey extends Serializable {
|
|
|
53
69
|
return new AuthenticationKey({ data: bytes });
|
|
54
70
|
}
|
|
55
71
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
72
|
+
/**
|
|
73
|
+
* Convert the internal data representation to a Uint8Array.
|
|
74
|
+
*
|
|
75
|
+
* This function is useful for obtaining a byte representation of the data, which can be utilized for serialization or transmission.
|
|
76
|
+
*
|
|
77
|
+
* @returns Uint8Array representation of the internal data.
|
|
78
|
+
*/
|
|
60
79
|
toUint8Array(): Uint8Array {
|
|
61
80
|
return this.data.toUint8Array();
|
|
62
81
|
}
|
|
63
82
|
|
|
83
|
+
/**
|
|
84
|
+
* Generates an AuthenticationKey from the specified scheme and input bytes.
|
|
85
|
+
* This function is essential for creating a valid authentication key based on a given scheme.
|
|
86
|
+
*
|
|
87
|
+
* @param args - The arguments for generating the AuthenticationKey.
|
|
88
|
+
* @param args.scheme - The authentication key scheme to use.
|
|
89
|
+
* @param args.input - The input data in hexadecimal format to derive the key.
|
|
90
|
+
* @returns An instance of AuthenticationKey containing the generated key data.
|
|
91
|
+
*/
|
|
64
92
|
static fromSchemeAndBytes(args: { scheme: AuthenticationKeyScheme; input: HexInput }): AuthenticationKey {
|
|
65
93
|
const { scheme, input } = args;
|
|
66
94
|
const inputBytes = Hex.fromHexInput(input).toUint8Array();
|
|
@@ -72,12 +100,12 @@ export class AuthenticationKey extends Serializable {
|
|
|
72
100
|
}
|
|
73
101
|
|
|
74
102
|
/**
|
|
75
|
-
*
|
|
76
|
-
* Derives an AuthenticationKey from the public key seed bytes and an explicit derivation scheme.
|
|
77
|
-
*
|
|
78
|
-
* This facilitates targeting a specific scheme for deriving an authentication key from a public key.
|
|
103
|
+
* Derives an AuthenticationKey from the provided public key using a specified derivation scheme.
|
|
79
104
|
*
|
|
80
|
-
* @
|
|
105
|
+
* @deprecated Use `fromPublicKey` instead.
|
|
106
|
+
* @param args - The arguments for deriving the authentication key.
|
|
107
|
+
* @param args.publicKey - The public key used for the derivation.
|
|
108
|
+
* @param args.scheme - The scheme to use for deriving the authentication key.
|
|
81
109
|
*/
|
|
82
110
|
public static fromPublicKeyAndScheme(args: { publicKey: AccountPublicKey; scheme: AuthenticationKeyScheme }) {
|
|
83
111
|
const { publicKey } = args;
|
|
@@ -85,11 +113,11 @@ export class AuthenticationKey extends Serializable {
|
|
|
85
113
|
}
|
|
86
114
|
|
|
87
115
|
/**
|
|
88
|
-
* Converts a PublicKey
|
|
89
|
-
* instance of the PublicKey type passed in.
|
|
116
|
+
* Converts a PublicKey to an AuthenticationKey using the derivation scheme inferred from the provided PublicKey instance.
|
|
90
117
|
*
|
|
91
|
-
* @param args.
|
|
92
|
-
* @
|
|
118
|
+
* @param args - The arguments for the function.
|
|
119
|
+
* @param args.publicKey - The PublicKey to be converted.
|
|
120
|
+
* @returns AuthenticationKey - The derived AuthenticationKey.
|
|
93
121
|
*/
|
|
94
122
|
static fromPublicKey(args: { publicKey: AccountPublicKey }): AuthenticationKey {
|
|
95
123
|
const { publicKey } = args;
|
|
@@ -97,10 +125,9 @@ export class AuthenticationKey extends Serializable {
|
|
|
97
125
|
}
|
|
98
126
|
|
|
99
127
|
/**
|
|
100
|
-
* Derives an account address from an AuthenticationKey
|
|
101
|
-
* the AuthenticationKey bytes are directly translated to an AccountAddress.
|
|
128
|
+
* Derives an account address from an AuthenticationKey by translating the AuthenticationKey bytes directly to an AccountAddress.
|
|
102
129
|
*
|
|
103
|
-
* @returns AccountAddress
|
|
130
|
+
* @returns AccountAddress - The derived account address.
|
|
104
131
|
*/
|
|
105
132
|
derivedAddress(): AccountAddress {
|
|
106
133
|
return new AccountAddress(this.data.toUint8Array());
|
package/src/core/common.ts
CHANGED
|
@@ -12,6 +12,12 @@ export class ParsingError<T> extends Error {
|
|
|
12
12
|
*/
|
|
13
13
|
public invalidReason: T;
|
|
14
14
|
|
|
15
|
+
/**
|
|
16
|
+
* Creates an instance of the error with a specified message and invalid reason.
|
|
17
|
+
*
|
|
18
|
+
* @param message The error message that describes the issue.
|
|
19
|
+
* @param invalidReason The reason why the input is considered invalid.
|
|
20
|
+
*/
|
|
15
21
|
constructor(message: string, invalidReason: T) {
|
|
16
22
|
super(message);
|
|
17
23
|
this.invalidReason = invalidReason;
|