@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
|
@@ -3,6 +3,9 @@ declare const NetworkToNodeAPI: Record<string, string>;
|
|
|
3
3
|
declare const NetworkToFaucetAPI: Record<string, string>;
|
|
4
4
|
declare const NetworkToPepperAPI: Record<string, string>;
|
|
5
5
|
declare const NetworkToProverAPI: Record<string, string>;
|
|
6
|
+
/**
|
|
7
|
+
* Different network environments for connecting to services, ranging from production to development setups.
|
|
8
|
+
*/
|
|
6
9
|
declare enum Network {
|
|
7
10
|
MAINNET = "mainnet",
|
|
8
11
|
TESTNET = "testnet",
|
|
@@ -449,25 +452,85 @@ type GetTokenDataQuery = {
|
|
|
449
452
|
* that calls the function that queries the server (usually under the /api/ folder)
|
|
450
453
|
*/
|
|
451
454
|
type GetObjectDataQueryResponse = GetObjectDataQuery["current_objects"];
|
|
455
|
+
/**
|
|
456
|
+
* The response structure for querying tokens owned by an account.
|
|
457
|
+
*/
|
|
452
458
|
type GetAccountOwnedTokensQueryResponse = GetAccountOwnedTokensQuery["current_token_ownerships_v2"];
|
|
459
|
+
/**
|
|
460
|
+
* The response containing the current token ownerships for an account from a specific collection.
|
|
461
|
+
*/
|
|
453
462
|
type GetAccountOwnedTokensFromCollectionResponse = GetAccountOwnedTokensFromCollectionQuery["current_token_ownerships_v2"];
|
|
463
|
+
/**
|
|
464
|
+
* The response structure for retrieving account collections associated with owned tokens.
|
|
465
|
+
*/
|
|
454
466
|
type GetAccountCollectionsWithOwnedTokenResponse = GetAccountCollectionsWithOwnedTokensQuery["current_collection_ownership_v2_view"];
|
|
467
|
+
/**
|
|
468
|
+
* The current balances of fungible assets for an account.
|
|
469
|
+
*/
|
|
455
470
|
type GetAccountCoinsDataResponse = GetAccountCoinsDataQuery["current_fungible_asset_balances"];
|
|
471
|
+
/**
|
|
472
|
+
* The response structure for retrieving user transactions from the top of the blockchain.
|
|
473
|
+
*/
|
|
456
474
|
type GetChainTopUserTransactionsResponse = GetChainTopUserTransactionsQuery["user_transactions"];
|
|
475
|
+
/**
|
|
476
|
+
* The response containing the events from the GetEventsQuery.
|
|
477
|
+
*/
|
|
457
478
|
type GetEventsResponse = GetEventsQuery["events"];
|
|
479
|
+
/**
|
|
480
|
+
* The number of active delegators per pool in response to a query.
|
|
481
|
+
*/
|
|
458
482
|
type GetNumberOfDelegatorsResponse = GetNumberOfDelegatorsQuery["num_active_delegator_per_pool"];
|
|
483
|
+
/**
|
|
484
|
+
* The response containing the delegated staking activities from the query.
|
|
485
|
+
*/
|
|
459
486
|
type GetDelegatedStakingActivitiesResponse = GetDelegatedStakingActivitiesQuery["delegated_staking_activities"];
|
|
487
|
+
/**
|
|
488
|
+
* The response structure for retrieving data from the current collections.
|
|
489
|
+
*/
|
|
460
490
|
type GetCollectionDataResponse = GetCollectionDataQuery["current_collections_v2"][0];
|
|
491
|
+
/**
|
|
492
|
+
* The response structure for retrieving token data, containing the current token information.
|
|
493
|
+
*/
|
|
461
494
|
type GetTokenDataResponse = GetTokenDataQuery["current_token_datas_v2"][0];
|
|
495
|
+
/**
|
|
496
|
+
* The status of the processor as returned by the GetProcessorStatusQuery.
|
|
497
|
+
*/
|
|
462
498
|
type GetProcessorStatusResponse = GetProcessorStatusQuery["processor_status"];
|
|
499
|
+
/**
|
|
500
|
+
* The response containing metadata for a fungible asset.
|
|
501
|
+
*/
|
|
463
502
|
type GetFungibleAssetMetadataResponse = GetFungibleAssetMetadataQuery["fungible_asset_metadata"];
|
|
503
|
+
/**
|
|
504
|
+
* The response containing the activities related to fungible assets.
|
|
505
|
+
*/
|
|
464
506
|
type GetFungibleAssetActivitiesResponse = GetFungibleAssetActivitiesQuery["fungible_asset_activities"];
|
|
507
|
+
/**
|
|
508
|
+
* The current balances of fungible assets for a specific query.
|
|
509
|
+
*/
|
|
465
510
|
type GetCurrentFungibleAssetBalancesResponse = GetCurrentFungibleAssetBalancesQuery["current_fungible_asset_balances"];
|
|
511
|
+
/**
|
|
512
|
+
* The response structure for retrieving token activity data.
|
|
513
|
+
*/
|
|
466
514
|
type GetTokenActivityResponse = GetTokenActivityQuery["token_activities_v2"];
|
|
515
|
+
/**
|
|
516
|
+
* The response structure for retrieving the current token ownership details.
|
|
517
|
+
*/
|
|
467
518
|
type GetCurrentTokenOwnershipResponse = GetCurrentTokenOwnershipQuery["current_token_ownerships_v2"][0];
|
|
519
|
+
/**
|
|
520
|
+
* The response containing the current token ownerships for a user.
|
|
521
|
+
*/
|
|
468
522
|
type GetOwnedTokensResponse = GetCurrentTokenOwnershipQuery["current_token_ownerships_v2"];
|
|
523
|
+
/**
|
|
524
|
+
* The response structure for retrieving items from a table.
|
|
525
|
+
*/
|
|
469
526
|
type GetTableItemsDataResponse = GetTableItemsDataQuery["table_items"];
|
|
527
|
+
/**
|
|
528
|
+
* The metadata for table items retrieved from a query.
|
|
529
|
+
*/
|
|
470
530
|
type GetTableItemsMetadataResponse = GetTableItemsMetadataQuery["table_metadatas"];
|
|
531
|
+
/**
|
|
532
|
+
* The response containing the current Aptos names from the GetNamesQuery.
|
|
533
|
+
*/
|
|
471
534
|
type GetANSNameResponse = GetNamesQuery["current_aptos_names"];
|
|
472
535
|
/**
|
|
473
536
|
* A generic type that being passed by each function and holds an
|
|
@@ -476,19 +539,25 @@ type GetANSNameResponse = GetNamesQuery["current_aptos_names"];
|
|
|
476
539
|
type OrderBy<T> = Array<{
|
|
477
540
|
[K in keyof T]?: OrderByValue;
|
|
478
541
|
}>;
|
|
542
|
+
/**
|
|
543
|
+
* Specifies the order direction for sorting, including options for handling null values.
|
|
544
|
+
*/
|
|
479
545
|
type OrderByValue = "asc" | "asc_nulls_first" | "asc_nulls_last" | "desc" | "desc_nulls_first" | "desc_nulls_last";
|
|
480
546
|
/**
|
|
481
|
-
*
|
|
547
|
+
* The token standard to query for, which can be either version "v1" or "v2".
|
|
482
548
|
*/
|
|
483
549
|
type TokenStandard = "v1" | "v2";
|
|
484
550
|
/**
|
|
485
|
-
* The
|
|
551
|
+
* The GraphQL query to pass into the `queryIndexer` function.
|
|
486
552
|
*/
|
|
487
553
|
type GraphqlQuery = {
|
|
488
554
|
query: string;
|
|
489
555
|
variables?: {};
|
|
490
556
|
};
|
|
491
557
|
|
|
558
|
+
/**
|
|
559
|
+
* Different MIME types used for data interchange in transactions and responses.
|
|
560
|
+
*/
|
|
492
561
|
declare enum MimeType {
|
|
493
562
|
/**
|
|
494
563
|
* JSON representation, used for transaction submission and accept type JSON output
|
|
@@ -505,11 +574,11 @@ declare enum MimeType {
|
|
|
505
574
|
BCS_VIEW_FUNCTION = "application/x.aptos.view_function+bcs"
|
|
506
575
|
}
|
|
507
576
|
/**
|
|
508
|
-
*
|
|
577
|
+
* Hexadecimal data input for functions, supporting both string and Uint8Array formats.
|
|
509
578
|
*/
|
|
510
579
|
type HexInput = string | Uint8Array;
|
|
511
580
|
/**
|
|
512
|
-
*
|
|
581
|
+
* Variants of type tags used in the system, encompassing various data types and structures.
|
|
513
582
|
* {@link https://github.com/aptos-labs/aptos-core/blob/main/third_party/move/move-core/types/src/language_storage.rs#L27}
|
|
514
583
|
*/
|
|
515
584
|
declare enum TypeTagVariants {
|
|
@@ -528,7 +597,7 @@ declare enum TypeTagVariants {
|
|
|
528
597
|
Generic = 255
|
|
529
598
|
}
|
|
530
599
|
/**
|
|
531
|
-
*
|
|
600
|
+
* Variants of script transaction arguments used in Rust, encompassing various data types for transaction processing.
|
|
532
601
|
* {@link https://github.com/aptos-labs/aptos-core/blob/main/third_party/move/move-core/types/src/transaction_argument.rs#L11}
|
|
533
602
|
*/
|
|
534
603
|
declare enum ScriptTransactionArgumentVariants {
|
|
@@ -544,7 +613,7 @@ declare enum ScriptTransactionArgumentVariants {
|
|
|
544
613
|
Serialized = 9
|
|
545
614
|
}
|
|
546
615
|
/**
|
|
547
|
-
*
|
|
616
|
+
* The payload for various transaction types in the system.
|
|
548
617
|
* {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/mod.rs#L478}
|
|
549
618
|
*/
|
|
550
619
|
declare enum TransactionPayloadVariants {
|
|
@@ -553,7 +622,7 @@ declare enum TransactionPayloadVariants {
|
|
|
553
622
|
Multisig = 3
|
|
554
623
|
}
|
|
555
624
|
/**
|
|
556
|
-
*
|
|
625
|
+
* Variants of transactions used in the system.
|
|
557
626
|
* {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/mod.rs#L440}
|
|
558
627
|
*/
|
|
559
628
|
declare enum TransactionVariants {
|
|
@@ -561,7 +630,7 @@ declare enum TransactionVariants {
|
|
|
561
630
|
FeePayerTransaction = 1
|
|
562
631
|
}
|
|
563
632
|
/**
|
|
564
|
-
*
|
|
633
|
+
* Variants of transaction authenticators used in the system.
|
|
565
634
|
* {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/authenticator.rs#L44}
|
|
566
635
|
*/
|
|
567
636
|
declare enum TransactionAuthenticatorVariant {
|
|
@@ -572,7 +641,7 @@ declare enum TransactionAuthenticatorVariant {
|
|
|
572
641
|
SingleSender = 4
|
|
573
642
|
}
|
|
574
643
|
/**
|
|
575
|
-
*
|
|
644
|
+
* Variants of account authenticators used in transactions.
|
|
576
645
|
* {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/authenticator.rs#L414}
|
|
577
646
|
*/
|
|
578
647
|
declare enum AccountAuthenticatorVariant {
|
|
@@ -581,26 +650,44 @@ declare enum AccountAuthenticatorVariant {
|
|
|
581
650
|
SingleKey = 2,
|
|
582
651
|
MultiKey = 3
|
|
583
652
|
}
|
|
653
|
+
/**
|
|
654
|
+
* Variants of public keys used in cryptographic operations.
|
|
655
|
+
*/
|
|
584
656
|
declare enum AnyPublicKeyVariant {
|
|
585
657
|
Ed25519 = 0,
|
|
586
658
|
Secp256k1 = 1,
|
|
587
659
|
Keyless = 3,
|
|
588
660
|
FederatedKeyless = 4
|
|
589
661
|
}
|
|
662
|
+
/**
|
|
663
|
+
* Variants of signature types used for cryptographic operations.
|
|
664
|
+
*/
|
|
590
665
|
declare enum AnySignatureVariant {
|
|
591
666
|
Ed25519 = 0,
|
|
592
667
|
Secp256k1 = 1,
|
|
593
668
|
Keyless = 3
|
|
594
669
|
}
|
|
670
|
+
/**
|
|
671
|
+
* Variants of ephemeral public keys used in cryptographic operations.
|
|
672
|
+
*/
|
|
595
673
|
declare enum EphemeralPublicKeyVariant {
|
|
596
674
|
Ed25519 = 0
|
|
597
675
|
}
|
|
676
|
+
/**
|
|
677
|
+
* Variants of ephemeral signatures used for secure communication.
|
|
678
|
+
*/
|
|
598
679
|
declare enum EphemeralSignatureVariant {
|
|
599
680
|
Ed25519 = 0
|
|
600
681
|
}
|
|
682
|
+
/**
|
|
683
|
+
* Variants of ephemeral certificates used in secure transactions.
|
|
684
|
+
*/
|
|
601
685
|
declare enum EphemeralCertificateVariant {
|
|
602
686
|
ZkProof = 0
|
|
603
687
|
}
|
|
688
|
+
/**
|
|
689
|
+
* Variants of zero-knowledge proofs used in cryptographic operations.
|
|
690
|
+
*/
|
|
604
691
|
declare enum ZkpVariant {
|
|
605
692
|
Groth16 = 0
|
|
606
693
|
}
|
|
@@ -608,16 +695,32 @@ declare enum ZkpVariant {
|
|
|
608
695
|
* BCS types
|
|
609
696
|
*/
|
|
610
697
|
type Uint8 = number;
|
|
698
|
+
/**
|
|
699
|
+
* A 16-bit unsigned integer.
|
|
700
|
+
*/
|
|
611
701
|
type Uint16 = number;
|
|
702
|
+
/**
|
|
703
|
+
* A 32-bit unsigned integer.
|
|
704
|
+
*/
|
|
612
705
|
type Uint32 = number;
|
|
706
|
+
/**
|
|
707
|
+
* A 64-bit unsigned integer value.
|
|
708
|
+
*/
|
|
613
709
|
type Uint64 = bigint;
|
|
710
|
+
/**
|
|
711
|
+
* A 128-bit unsigned integer used for precise arithmetic operations.
|
|
712
|
+
*/
|
|
614
713
|
type Uint128 = bigint;
|
|
714
|
+
/**
|
|
715
|
+
* A 256-bit unsigned integer used for precise numerical calculations.
|
|
716
|
+
*/
|
|
615
717
|
type Uint256 = bigint;
|
|
718
|
+
/**
|
|
719
|
+
* A number or a bigint value.
|
|
720
|
+
*/
|
|
616
721
|
type AnyNumber = number | bigint;
|
|
617
722
|
/**
|
|
618
|
-
*
|
|
619
|
-
* The purpose of these options is to configure various aspects of the SDK's
|
|
620
|
-
* behavior and interaction with the Aptos network
|
|
723
|
+
* Configuration options for initializing the SDK, allowing customization of its behavior and interaction with the Aptos network.
|
|
621
724
|
*/
|
|
622
725
|
type AptosSettings = {
|
|
623
726
|
readonly network?: Network;
|
|
@@ -633,15 +736,19 @@ type AptosSettings = {
|
|
|
633
736
|
readonly faucetConfig?: FaucetConfig;
|
|
634
737
|
};
|
|
635
738
|
/**
|
|
636
|
-
*
|
|
637
|
-
*
|
|
638
|
-
* @param
|
|
639
|
-
* @param limit specifies the maximum number of items or records to return in a query result. Default is 25.
|
|
739
|
+
* Defines the parameters for paginating query results, including the starting position and maximum number of items to return.
|
|
740
|
+
* @param offset Specifies the starting position of the query result. Default is 0.
|
|
741
|
+
* @param limit Specifies the maximum number of items to return. Default is 25.
|
|
640
742
|
*/
|
|
641
743
|
interface PaginationArgs {
|
|
642
744
|
offset?: AnyNumber;
|
|
643
745
|
limit?: number;
|
|
644
746
|
}
|
|
747
|
+
/**
|
|
748
|
+
* Represents the arguments for specifying a token standard.
|
|
749
|
+
*
|
|
750
|
+
* @param tokenStandard - Optional standard of the token.
|
|
751
|
+
*/
|
|
645
752
|
interface TokenStandardArg {
|
|
646
753
|
tokenStandard?: TokenStandard;
|
|
647
754
|
}
|
|
@@ -655,43 +762,38 @@ interface WhereArg<T extends {}> {
|
|
|
655
762
|
* QUERY TYPES
|
|
656
763
|
*/
|
|
657
764
|
/**
|
|
658
|
-
* A configuration object
|
|
659
|
-
*
|
|
660
|
-
* @param API_KEY - api key generated from developer portal {@link https://developers.aptoslabs.com/manage/api-keys}}
|
|
661
|
-
* @param HEADERS - extra headers we want to send with the request
|
|
662
|
-
* @param WITH_CREDENTIALS - whether to carry cookies. By default, it is set to true and cookies will be sent
|
|
765
|
+
* A configuration object for requests to the server, including API key, extra headers, and cookie handling options.
|
|
663
766
|
*/
|
|
664
767
|
type ClientConfig = ClientHeadersType & {
|
|
665
768
|
WITH_CREDENTIALS?: boolean;
|
|
666
769
|
API_KEY?: string;
|
|
667
770
|
};
|
|
668
771
|
/**
|
|
669
|
-
* A Fullnode
|
|
670
|
-
*
|
|
671
|
-
* @param HEADERS - extra headers we want to send with the request
|
|
772
|
+
* A configuration object for a Fullnode, allowing for the inclusion of extra headers in requests.
|
|
672
773
|
*/
|
|
673
774
|
type FullNodeConfig = ClientHeadersType;
|
|
674
775
|
/**
|
|
675
|
-
* An Indexer
|
|
676
|
-
*
|
|
677
|
-
* @param HEADERS - extra headers we want to send with the request
|
|
776
|
+
* An Indexer configuration object for sending requests with additional headers.
|
|
678
777
|
*/
|
|
679
778
|
type IndexerConfig = ClientHeadersType;
|
|
680
779
|
/**
|
|
681
|
-
* A
|
|
682
|
-
*
|
|
683
|
-
* @param HEADERS - extra headers we want to send with the request
|
|
684
|
-
* @param AUTH_TOKEN - an auth token to send with a faucet request
|
|
780
|
+
* A configuration object for a faucet, including optional authentication and headers for requests.
|
|
685
781
|
*/
|
|
686
782
|
type FaucetConfig = ClientHeadersType & {
|
|
687
783
|
AUTH_TOKEN?: string;
|
|
688
784
|
};
|
|
689
785
|
/**
|
|
690
|
-
* General type definition for client
|
|
786
|
+
* General type definition for client headers.
|
|
691
787
|
*/
|
|
692
788
|
type ClientHeadersType = {
|
|
693
789
|
HEADERS?: Record<string, string | number | boolean>;
|
|
694
790
|
};
|
|
791
|
+
/**
|
|
792
|
+
* Represents a client for making requests to a service provider.
|
|
793
|
+
*
|
|
794
|
+
* @param Req - The type of the request payload.
|
|
795
|
+
* @param Res - The type of the response payload.
|
|
796
|
+
*/
|
|
695
797
|
interface ClientRequest<Req> {
|
|
696
798
|
url: string;
|
|
697
799
|
method: "GET" | "POST";
|
|
@@ -712,14 +814,28 @@ interface ClientResponse<Res> {
|
|
|
712
814
|
headers?: any;
|
|
713
815
|
}
|
|
714
816
|
interface Client {
|
|
817
|
+
/**
|
|
818
|
+
* Sends a request to the specified URL with the given options.
|
|
819
|
+
*
|
|
820
|
+
* @param requestOptions - The options for the request.
|
|
821
|
+
* @param requestOptions.url - The URL to send the request to.
|
|
822
|
+
* @param requestOptions.method - The HTTP method to use, either "GET" or "POST".
|
|
823
|
+
* @param requestOptions.path - An optional path to append to the URL.
|
|
824
|
+
* @param requestOptions.body - The body of the request, applicable for POST requests.
|
|
825
|
+
* @param requestOptions.contentType - The content type of the request body.
|
|
826
|
+
* @param requestOptions.acceptType - The expected content type of the response.
|
|
827
|
+
* @param requestOptions.params - Optional parameters to include in the request.
|
|
828
|
+
* @param requestOptions.originMethod - An optional method to specify the origin of the request.
|
|
829
|
+
* @param requestOptions.overrides - Optional configuration overrides for the request.
|
|
830
|
+
*/
|
|
715
831
|
provider<Req, Res>(requestOptions: ClientRequest<Req>): Promise<ClientResponse<Res>>;
|
|
716
832
|
}
|
|
717
833
|
/**
|
|
718
834
|
* The API request type
|
|
719
835
|
*
|
|
720
|
-
* @param url - the url to make the request to, i.e https://fullnode.devnet.aptoslabs.com/v1
|
|
836
|
+
* @param url - the url to make the request to, i.e. https://fullnode.devnet.aptoslabs.com/v1
|
|
721
837
|
* @param method - the request method "GET" | "POST"
|
|
722
|
-
* @param endpoint (optional) - the endpoint to make the request to, i.e transactions
|
|
838
|
+
* @param endpoint (optional) - the endpoint to make the request to, i.e. transactions
|
|
723
839
|
* @param body (optional) - the body of the request
|
|
724
840
|
* @param contentType (optional) - the content type to set the `content-type` header to,
|
|
725
841
|
* by default is set to `application/json`
|
|
@@ -739,7 +855,7 @@ type AptosRequest = {
|
|
|
739
855
|
overrides?: ClientConfig & FullNodeConfig & IndexerConfig & FaucetConfig;
|
|
740
856
|
};
|
|
741
857
|
/**
|
|
742
|
-
*
|
|
858
|
+
* The ledger version of transactions, defaulting to the latest version if not specified.
|
|
743
859
|
*/
|
|
744
860
|
type LedgerVersionArg = {
|
|
745
861
|
ledgerVersion?: AnyNumber;
|
|
@@ -748,7 +864,7 @@ type LedgerVersionArg = {
|
|
|
748
864
|
* RESPONSE TYPES
|
|
749
865
|
*/
|
|
750
866
|
/**
|
|
751
|
-
*
|
|
867
|
+
* The output of the estimate gas API, including the deprioritized estimate for the gas unit price.
|
|
752
868
|
*/
|
|
753
869
|
type GasEstimation = {
|
|
754
870
|
/**
|
|
@@ -768,10 +884,16 @@ type MoveResource<T = {}> = {
|
|
|
768
884
|
type: MoveStructId;
|
|
769
885
|
data: T;
|
|
770
886
|
};
|
|
887
|
+
/**
|
|
888
|
+
* The data associated with an account, including its sequence number.
|
|
889
|
+
*/
|
|
771
890
|
type AccountData = {
|
|
772
891
|
sequence_number: string;
|
|
773
892
|
authentication_key: string;
|
|
774
893
|
};
|
|
894
|
+
/**
|
|
895
|
+
* A Move module containing an address.
|
|
896
|
+
*/
|
|
775
897
|
type MoveModuleBytecode = {
|
|
776
898
|
bytecode: string;
|
|
777
899
|
abi?: MoveModule;
|
|
@@ -779,6 +901,9 @@ type MoveModuleBytecode = {
|
|
|
779
901
|
/**
|
|
780
902
|
* TRANSACTION TYPES
|
|
781
903
|
*/
|
|
904
|
+
/**
|
|
905
|
+
* Different types of transaction responses that can occur in the system.
|
|
906
|
+
*/
|
|
782
907
|
declare enum TransactionResponseType {
|
|
783
908
|
Pending = "pending_transaction",
|
|
784
909
|
User = "user_transaction",
|
|
@@ -788,15 +913,66 @@ declare enum TransactionResponseType {
|
|
|
788
913
|
Validator = "validator_transaction",
|
|
789
914
|
BlockEpilogue = "block_epilogue_transaction"
|
|
790
915
|
}
|
|
916
|
+
/**
|
|
917
|
+
* The response for a transaction, which can be either pending or committed.
|
|
918
|
+
*/
|
|
791
919
|
type TransactionResponse = PendingTransactionResponse | CommittedTransactionResponse;
|
|
920
|
+
/**
|
|
921
|
+
* The response for a committed transaction, which can be one of several transaction types.
|
|
922
|
+
*/
|
|
792
923
|
type CommittedTransactionResponse = UserTransactionResponse | GenesisTransactionResponse | BlockMetadataTransactionResponse | StateCheckpointTransactionResponse | ValidatorTransactionResponse | BlockEpilogueTransactionResponse;
|
|
924
|
+
/**
|
|
925
|
+
* Determine if the given transaction response is currently pending.
|
|
926
|
+
*
|
|
927
|
+
* @param response - The transaction response to evaluate.
|
|
928
|
+
* @returns A boolean indicating whether the transaction is pending.
|
|
929
|
+
*/
|
|
793
930
|
declare function isPendingTransactionResponse(response: TransactionResponse): response is PendingTransactionResponse;
|
|
931
|
+
/**
|
|
932
|
+
* Determines if the given transaction response is a user transaction.
|
|
933
|
+
*
|
|
934
|
+
* @param response - The transaction response to evaluate.
|
|
935
|
+
* @returns A boolean indicating whether the transaction is of type User.
|
|
936
|
+
*/
|
|
794
937
|
declare function isUserTransactionResponse(response: TransactionResponse): response is UserTransactionResponse;
|
|
938
|
+
/**
|
|
939
|
+
* Determines if the given transaction response is a Genesis transaction.
|
|
940
|
+
*
|
|
941
|
+
* @param response - The transaction response to evaluate.
|
|
942
|
+
* @returns A boolean indicating whether the transaction is a Genesis transaction.
|
|
943
|
+
*/
|
|
795
944
|
declare function isGenesisTransactionResponse(response: TransactionResponse): response is GenesisTransactionResponse;
|
|
945
|
+
/**
|
|
946
|
+
* Determine if the given transaction response is of type BlockMetadata.
|
|
947
|
+
*
|
|
948
|
+
* @param response - The transaction response to evaluate.
|
|
949
|
+
* @returns A boolean indicating whether the response is a BlockMetadata transaction.
|
|
950
|
+
*/
|
|
796
951
|
declare function isBlockMetadataTransactionResponse(response: TransactionResponse): response is BlockMetadataTransactionResponse;
|
|
952
|
+
/**
|
|
953
|
+
* Determines if the provided transaction response is a state checkpoint transaction.
|
|
954
|
+
*
|
|
955
|
+
* @param response - The transaction response to evaluate.
|
|
956
|
+
* @returns A boolean indicating whether the transaction response is of type StateCheckpoint.
|
|
957
|
+
*/
|
|
797
958
|
declare function isStateCheckpointTransactionResponse(response: TransactionResponse): response is StateCheckpointTransactionResponse;
|
|
959
|
+
/**
|
|
960
|
+
* Determine if the given transaction response is of type Validator.
|
|
961
|
+
*
|
|
962
|
+
* @param response - The transaction response to evaluate.
|
|
963
|
+
* @returns A boolean indicating whether the transaction response is a Validator type.
|
|
964
|
+
*/
|
|
798
965
|
declare function isValidatorTransactionResponse(response: TransactionResponse): response is ValidatorTransactionResponse;
|
|
966
|
+
/**
|
|
967
|
+
* Determines if the given transaction response is of the type Block Epilogue.
|
|
968
|
+
*
|
|
969
|
+
* @param response - The transaction response to evaluate.
|
|
970
|
+
* @returns A boolean indicating whether the response is a Block Epilogue transaction.
|
|
971
|
+
*/
|
|
799
972
|
declare function isBlockEpilogueTransactionResponse(response: TransactionResponse): response is BlockEpilogueTransactionResponse;
|
|
973
|
+
/**
|
|
974
|
+
* The response for a pending transaction, indicating that the transaction is still being processed.
|
|
975
|
+
*/
|
|
800
976
|
type PendingTransactionResponse = {
|
|
801
977
|
type: TransactionResponseType.Pending;
|
|
802
978
|
hash: string;
|
|
@@ -808,6 +984,9 @@ type PendingTransactionResponse = {
|
|
|
808
984
|
payload: TransactionPayloadResponse;
|
|
809
985
|
signature?: TransactionSignature;
|
|
810
986
|
};
|
|
987
|
+
/**
|
|
988
|
+
* The response structure for a user transaction.
|
|
989
|
+
*/
|
|
811
990
|
type UserTransactionResponse = {
|
|
812
991
|
type: TransactionResponseType.User;
|
|
813
992
|
version: string;
|
|
@@ -842,6 +1021,9 @@ type UserTransactionResponse = {
|
|
|
842
1021
|
events: Array<Event>;
|
|
843
1022
|
timestamp: string;
|
|
844
1023
|
};
|
|
1024
|
+
/**
|
|
1025
|
+
* The response for a genesis transaction, indicating the type of transaction.
|
|
1026
|
+
*/
|
|
845
1027
|
type GenesisTransactionResponse = {
|
|
846
1028
|
type: TransactionResponseType.Genesis;
|
|
847
1029
|
version: string;
|
|
@@ -869,6 +1051,9 @@ type GenesisTransactionResponse = {
|
|
|
869
1051
|
*/
|
|
870
1052
|
events: Array<Event>;
|
|
871
1053
|
};
|
|
1054
|
+
/**
|
|
1055
|
+
* The structure representing a blockchain block with its height.
|
|
1056
|
+
*/
|
|
872
1057
|
type BlockMetadataTransactionResponse = {
|
|
873
1058
|
type: TransactionResponseType.BlockMetadata;
|
|
874
1059
|
version: string;
|
|
@@ -908,6 +1093,9 @@ type BlockMetadataTransactionResponse = {
|
|
|
908
1093
|
failed_proposer_indices: Array<number>;
|
|
909
1094
|
timestamp: string;
|
|
910
1095
|
};
|
|
1096
|
+
/**
|
|
1097
|
+
* The response for a state checkpoint transaction, indicating the type of transaction.
|
|
1098
|
+
*/
|
|
911
1099
|
type StateCheckpointTransactionResponse = {
|
|
912
1100
|
type: TransactionResponseType.StateCheckpoint;
|
|
913
1101
|
version: string;
|
|
@@ -931,6 +1119,9 @@ type StateCheckpointTransactionResponse = {
|
|
|
931
1119
|
changes: Array<WriteSetChange>;
|
|
932
1120
|
timestamp: string;
|
|
933
1121
|
};
|
|
1122
|
+
/**
|
|
1123
|
+
* The response for a validator transaction, indicating the type of transaction.
|
|
1124
|
+
*/
|
|
934
1125
|
type ValidatorTransactionResponse = {
|
|
935
1126
|
type: TransactionResponseType.Validator;
|
|
936
1127
|
version: string;
|
|
@@ -959,7 +1150,7 @@ type ValidatorTransactionResponse = {
|
|
|
959
1150
|
timestamp: string;
|
|
960
1151
|
};
|
|
961
1152
|
/**
|
|
962
|
-
*
|
|
1153
|
+
* Describes the gas state of the block, indicating whether the block gas limit has been reached.
|
|
963
1154
|
*/
|
|
964
1155
|
type BlockEndInfo = {
|
|
965
1156
|
block_gas_limit_reached: boolean;
|
|
@@ -968,8 +1159,7 @@ type BlockEndInfo = {
|
|
|
968
1159
|
block_approx_output_size: number;
|
|
969
1160
|
};
|
|
970
1161
|
/**
|
|
971
|
-
*
|
|
972
|
-
* the whole block
|
|
1162
|
+
* A transaction executed at the end of a block that tracks data from the entire block.
|
|
973
1163
|
*/
|
|
974
1164
|
type BlockEpilogueTransactionResponse = {
|
|
975
1165
|
type: TransactionResponseType.BlockEpilogue;
|
|
@@ -998,7 +1188,13 @@ type BlockEpilogueTransactionResponse = {
|
|
|
998
1188
|
/**
|
|
999
1189
|
* WRITESET CHANGE TYPES
|
|
1000
1190
|
*/
|
|
1191
|
+
/**
|
|
1192
|
+
* A union type that encompasses both script and direct write sets for data operations.
|
|
1193
|
+
*/
|
|
1001
1194
|
type WriteSetChange = WriteSetChangeDeleteModule | WriteSetChangeDeleteResource | WriteSetChangeDeleteTableItem | WriteSetChangeWriteModule | WriteSetChangeWriteResource | WriteSetChangeWriteTableItem;
|
|
1195
|
+
/**
|
|
1196
|
+
* The structure for a module deletion change in a write set.
|
|
1197
|
+
*/
|
|
1002
1198
|
type WriteSetChangeDeleteModule = {
|
|
1003
1199
|
type: string;
|
|
1004
1200
|
address: string;
|
|
@@ -1008,12 +1204,18 @@ type WriteSetChangeDeleteModule = {
|
|
|
1008
1204
|
state_key_hash: string;
|
|
1009
1205
|
module: MoveModuleId;
|
|
1010
1206
|
};
|
|
1207
|
+
/**
|
|
1208
|
+
* The payload for a resource deletion in a write set change.
|
|
1209
|
+
*/
|
|
1011
1210
|
type WriteSetChangeDeleteResource = {
|
|
1012
1211
|
type: string;
|
|
1013
1212
|
address: string;
|
|
1014
1213
|
state_key_hash: string;
|
|
1015
1214
|
resource: string;
|
|
1016
1215
|
};
|
|
1216
|
+
/**
|
|
1217
|
+
* The payload for a write set change that deletes a table item.
|
|
1218
|
+
*/
|
|
1017
1219
|
type WriteSetChangeDeleteTableItem = {
|
|
1018
1220
|
type: string;
|
|
1019
1221
|
state_key_hash: string;
|
|
@@ -1021,18 +1223,27 @@ type WriteSetChangeDeleteTableItem = {
|
|
|
1021
1223
|
key: string;
|
|
1022
1224
|
data?: DeletedTableData;
|
|
1023
1225
|
};
|
|
1226
|
+
/**
|
|
1227
|
+
* The structure for a write module change in a write set.
|
|
1228
|
+
*/
|
|
1024
1229
|
type WriteSetChangeWriteModule = {
|
|
1025
1230
|
type: string;
|
|
1026
1231
|
address: string;
|
|
1027
1232
|
state_key_hash: string;
|
|
1028
1233
|
data: MoveModuleBytecode;
|
|
1029
1234
|
};
|
|
1235
|
+
/**
|
|
1236
|
+
* The resource associated with a write set change, identified by its type.
|
|
1237
|
+
*/
|
|
1030
1238
|
type WriteSetChangeWriteResource = {
|
|
1031
1239
|
type: string;
|
|
1032
1240
|
address: string;
|
|
1033
1241
|
state_key_hash: string;
|
|
1034
1242
|
data: MoveResource;
|
|
1035
1243
|
};
|
|
1244
|
+
/**
|
|
1245
|
+
* The structure for a write operation on a table in a write set change.
|
|
1246
|
+
*/
|
|
1036
1247
|
type WriteSetChangeWriteTableItem = {
|
|
1037
1248
|
type: string;
|
|
1038
1249
|
state_key_hash: string;
|
|
@@ -1041,6 +1252,9 @@ type WriteSetChangeWriteTableItem = {
|
|
|
1041
1252
|
value: string;
|
|
1042
1253
|
data?: DecodedTableData;
|
|
1043
1254
|
};
|
|
1255
|
+
/**
|
|
1256
|
+
* The decoded data for a table, including its key in JSON format.
|
|
1257
|
+
*/
|
|
1044
1258
|
type DecodedTableData = {
|
|
1045
1259
|
/**
|
|
1046
1260
|
* Key of table in JSON
|
|
@@ -1060,7 +1274,7 @@ type DecodedTableData = {
|
|
|
1060
1274
|
value_type: string;
|
|
1061
1275
|
};
|
|
1062
1276
|
/**
|
|
1063
|
-
*
|
|
1277
|
+
* Data for a deleted table entry.
|
|
1064
1278
|
*/
|
|
1065
1279
|
type DeletedTableData = {
|
|
1066
1280
|
/**
|
|
@@ -1072,7 +1286,13 @@ type DeletedTableData = {
|
|
|
1072
1286
|
*/
|
|
1073
1287
|
key_type: string;
|
|
1074
1288
|
};
|
|
1289
|
+
/**
|
|
1290
|
+
* The payload for a transaction response, which can be an entry function, script, or multisig payload.
|
|
1291
|
+
*/
|
|
1075
1292
|
type TransactionPayloadResponse = EntryFunctionPayloadResponse | ScriptPayloadResponse | MultisigPayloadResponse;
|
|
1293
|
+
/**
|
|
1294
|
+
* The response payload for an entry function, containing the type of the entry.
|
|
1295
|
+
*/
|
|
1076
1296
|
type EntryFunctionPayloadResponse = {
|
|
1077
1297
|
type: string;
|
|
1078
1298
|
function: MoveFunctionId;
|
|
@@ -1085,6 +1305,9 @@ type EntryFunctionPayloadResponse = {
|
|
|
1085
1305
|
*/
|
|
1086
1306
|
arguments: Array<any>;
|
|
1087
1307
|
};
|
|
1308
|
+
/**
|
|
1309
|
+
* The payload for a script response, containing the type of the script.
|
|
1310
|
+
*/
|
|
1088
1311
|
type ScriptPayloadResponse = {
|
|
1089
1312
|
type: string;
|
|
1090
1313
|
code: MoveScriptBytecode;
|
|
@@ -1097,41 +1320,88 @@ type ScriptPayloadResponse = {
|
|
|
1097
1320
|
*/
|
|
1098
1321
|
arguments: Array<any>;
|
|
1099
1322
|
};
|
|
1323
|
+
/**
|
|
1324
|
+
* The response payload for a multisig transaction, containing the type of the transaction.
|
|
1325
|
+
*/
|
|
1100
1326
|
type MultisigPayloadResponse = {
|
|
1101
1327
|
type: string;
|
|
1102
1328
|
multisig_address: string;
|
|
1103
1329
|
transaction_payload?: EntryFunctionPayloadResponse;
|
|
1104
1330
|
};
|
|
1331
|
+
/**
|
|
1332
|
+
* The payload for the genesis block containing the type of the payload.
|
|
1333
|
+
*/
|
|
1105
1334
|
type GenesisPayload = {
|
|
1106
1335
|
type: string;
|
|
1107
1336
|
write_set: WriteSet;
|
|
1108
1337
|
};
|
|
1109
1338
|
/**
|
|
1110
|
-
* Move script
|
|
1339
|
+
* The bytecode for a Move script.
|
|
1111
1340
|
*/
|
|
1112
1341
|
type MoveScriptBytecode = {
|
|
1113
1342
|
bytecode: string;
|
|
1114
1343
|
abi?: MoveFunction;
|
|
1115
1344
|
};
|
|
1116
1345
|
/**
|
|
1117
|
-
*
|
|
1346
|
+
* JSON representations of transaction signatures returned from the node API.
|
|
1118
1347
|
*/
|
|
1119
1348
|
type TransactionSignature = TransactionEd25519Signature | TransactionSecp256k1Signature | TransactionMultiEd25519Signature | TransactionMultiAgentSignature | TransactionFeePayerSignature;
|
|
1349
|
+
/**
|
|
1350
|
+
* Determine if the provided signature is an Ed25519 signature.
|
|
1351
|
+
* This function checks for the presence of the "signature" property
|
|
1352
|
+
* and verifies that its value is "ed25519_signature".
|
|
1353
|
+
*
|
|
1354
|
+
* @param signature - The transaction signature to be checked.
|
|
1355
|
+
* @returns A boolean indicating whether the signature is an Ed25519 signature.
|
|
1356
|
+
*/
|
|
1120
1357
|
declare function isEd25519Signature(signature: TransactionSignature): signature is TransactionFeePayerSignature;
|
|
1358
|
+
/**
|
|
1359
|
+
* Determine if the provided signature is a valid secp256k1 ECDSA signature.
|
|
1360
|
+
*
|
|
1361
|
+
* @param signature - The transaction signature to validate.
|
|
1362
|
+
* @returns A boolean indicating whether the signature is a secp256k1 ECDSA signature.
|
|
1363
|
+
*/
|
|
1121
1364
|
declare function isSecp256k1Signature(signature: TransactionSignature): signature is TransactionFeePayerSignature;
|
|
1365
|
+
/**
|
|
1366
|
+
* Determine if the provided transaction signature is a multi-agent signature.
|
|
1367
|
+
*
|
|
1368
|
+
* @param signature - The transaction signature to evaluate.
|
|
1369
|
+
* @returns A boolean indicating whether the signature is a multi-agent signature.
|
|
1370
|
+
*/
|
|
1122
1371
|
declare function isMultiAgentSignature(signature: TransactionSignature): signature is TransactionMultiAgentSignature;
|
|
1372
|
+
/**
|
|
1373
|
+
* Determine if the provided signature is a fee payer signature.
|
|
1374
|
+
*
|
|
1375
|
+
* @param signature - The transaction signature to evaluate.
|
|
1376
|
+
* @returns A boolean indicating whether the signature is a fee payer signature.
|
|
1377
|
+
*/
|
|
1123
1378
|
declare function isFeePayerSignature(signature: TransactionSignature): signature is TransactionFeePayerSignature;
|
|
1379
|
+
/**
|
|
1380
|
+
* Determine if the provided signature is of type "multi_ed25519_signature".
|
|
1381
|
+
*
|
|
1382
|
+
* @param signature - The transaction signature to check.
|
|
1383
|
+
* @returns A boolean indicating whether the signature is a multi-ed25519 signature.
|
|
1384
|
+
*/
|
|
1124
1385
|
declare function isMultiEd25519Signature(signature: TransactionSignature): signature is TransactionMultiEd25519Signature;
|
|
1386
|
+
/**
|
|
1387
|
+
* The signature for a transaction using the Ed25519 algorithm.
|
|
1388
|
+
*/
|
|
1125
1389
|
type TransactionEd25519Signature = {
|
|
1126
1390
|
type: string;
|
|
1127
1391
|
public_key: string;
|
|
1128
1392
|
signature: "ed25519_signature";
|
|
1129
1393
|
};
|
|
1394
|
+
/**
|
|
1395
|
+
* The structure for a Secp256k1 signature in a transaction.
|
|
1396
|
+
*/
|
|
1130
1397
|
type TransactionSecp256k1Signature = {
|
|
1131
1398
|
type: string;
|
|
1132
1399
|
public_key: string;
|
|
1133
1400
|
signature: "secp256k1_ecdsa_signature";
|
|
1134
1401
|
};
|
|
1402
|
+
/**
|
|
1403
|
+
* The structure for a multi-signature transaction using Ed25519.
|
|
1404
|
+
*/
|
|
1135
1405
|
type TransactionMultiEd25519Signature = {
|
|
1136
1406
|
type: "multi_ed25519_signature";
|
|
1137
1407
|
/**
|
|
@@ -1148,6 +1418,9 @@ type TransactionMultiEd25519Signature = {
|
|
|
1148
1418
|
threshold: number;
|
|
1149
1419
|
bitmap: string;
|
|
1150
1420
|
};
|
|
1421
|
+
/**
|
|
1422
|
+
* The structure for a multi-agent signature in a transaction.
|
|
1423
|
+
*/
|
|
1151
1424
|
type TransactionMultiAgentSignature = {
|
|
1152
1425
|
type: "multi_agent_signature";
|
|
1153
1426
|
sender: AccountSignature;
|
|
@@ -1160,6 +1433,9 @@ type TransactionMultiAgentSignature = {
|
|
|
1160
1433
|
*/
|
|
1161
1434
|
secondary_signers: Array<AccountSignature>;
|
|
1162
1435
|
};
|
|
1436
|
+
/**
|
|
1437
|
+
* The signature of the fee payer in a transaction.
|
|
1438
|
+
*/
|
|
1163
1439
|
type TransactionFeePayerSignature = {
|
|
1164
1440
|
type: "fee_payer_signature";
|
|
1165
1441
|
sender: AccountSignature;
|
|
@@ -1175,20 +1451,32 @@ type TransactionFeePayerSignature = {
|
|
|
1175
1451
|
fee_payer_signer: AccountSignature;
|
|
1176
1452
|
};
|
|
1177
1453
|
/**
|
|
1178
|
-
* The union of all single account signatures.
|
|
1454
|
+
* The union of all single account signatures, including Ed25519, Secp256k1, and MultiEd25519 signatures.
|
|
1179
1455
|
*/
|
|
1180
1456
|
type AccountSignature = TransactionEd25519Signature | TransactionSecp256k1Signature | TransactionMultiEd25519Signature;
|
|
1181
1457
|
type WriteSet = ScriptWriteSet | DirectWriteSet;
|
|
1458
|
+
/**
|
|
1459
|
+
* The set of properties for writing scripts, including the type of script.
|
|
1460
|
+
*/
|
|
1182
1461
|
type ScriptWriteSet = {
|
|
1183
1462
|
type: string;
|
|
1184
1463
|
execute_as: string;
|
|
1185
1464
|
script: ScriptPayloadResponse;
|
|
1186
1465
|
};
|
|
1466
|
+
/**
|
|
1467
|
+
* The set of direct write operations, identified by a type string.
|
|
1468
|
+
*/
|
|
1187
1469
|
type DirectWriteSet = {
|
|
1188
1470
|
type: string;
|
|
1189
1471
|
changes: Array<WriteSetChange>;
|
|
1190
1472
|
events: Array<Event>;
|
|
1191
1473
|
};
|
|
1474
|
+
/**
|
|
1475
|
+
* The structure for an event's unique identifier, including its creation number.
|
|
1476
|
+
*/
|
|
1477
|
+
/**
|
|
1478
|
+
* The structure for an event, identified by a unique GUID.
|
|
1479
|
+
*/
|
|
1192
1480
|
type EventGuid = {
|
|
1193
1481
|
creation_number: string;
|
|
1194
1482
|
account_address: string;
|
|
@@ -1203,23 +1491,54 @@ type Event = {
|
|
|
1203
1491
|
data: any;
|
|
1204
1492
|
};
|
|
1205
1493
|
/**
|
|
1206
|
-
*
|
|
1494
|
+
* A number representing a Move uint8 type.
|
|
1207
1495
|
*/
|
|
1208
1496
|
type MoveUint8Type = number;
|
|
1497
|
+
/**
|
|
1498
|
+
* A 16-bit unsigned integer used in the Move programming language.
|
|
1499
|
+
*/
|
|
1209
1500
|
type MoveUint16Type = number;
|
|
1501
|
+
/**
|
|
1502
|
+
* A 32-bit unsigned integer type used in Move programming.
|
|
1503
|
+
*/
|
|
1210
1504
|
type MoveUint32Type = number;
|
|
1505
|
+
/**
|
|
1506
|
+
* A string representation of a 64-bit unsigned integer used in Move programming.
|
|
1507
|
+
*/
|
|
1211
1508
|
type MoveUint64Type = string;
|
|
1509
|
+
/**
|
|
1510
|
+
* A string representing a 128-bit unsigned integer in the Move programming language.
|
|
1511
|
+
*/
|
|
1212
1512
|
type MoveUint128Type = string;
|
|
1513
|
+
/**
|
|
1514
|
+
* A string representation of a 256-bit unsigned integer used in Move programming.
|
|
1515
|
+
*/
|
|
1213
1516
|
type MoveUint256Type = string;
|
|
1517
|
+
/**
|
|
1518
|
+
* A string representing a Move address.
|
|
1519
|
+
*/
|
|
1214
1520
|
type MoveAddressType = string;
|
|
1521
|
+
/**
|
|
1522
|
+
* The type for identifying objects to be moved within the system.
|
|
1523
|
+
*/
|
|
1215
1524
|
type MoveObjectType = string;
|
|
1525
|
+
/**
|
|
1526
|
+
* The type for move options, which can be a MoveType, null, or undefined.
|
|
1527
|
+
*/
|
|
1216
1528
|
type MoveOptionType = MoveType | null | undefined;
|
|
1217
1529
|
/**
|
|
1218
|
-
*
|
|
1530
|
+
* A structure representing a move with a name.
|
|
1219
1531
|
*/
|
|
1220
1532
|
type MoveStructId = `${string}::${string}::${string}`;
|
|
1533
|
+
/**
|
|
1534
|
+
* The move function containing its name. Same as MoveStructId since it reads weird to take a StructId for a Function.
|
|
1535
|
+
*/
|
|
1221
1536
|
type MoveFunctionId = MoveStructId;
|
|
1222
1537
|
type MoveStructType = {};
|
|
1538
|
+
/**
|
|
1539
|
+
* A union type that encompasses various data types used in Move, including primitive types, address types, object types, and
|
|
1540
|
+
* arrays of MoveType.
|
|
1541
|
+
*/
|
|
1223
1542
|
type MoveType = boolean | string | MoveUint8Type | MoveUint16Type | MoveUint32Type | MoveUint64Type | MoveUint128Type | MoveUint256Type | MoveAddressType | MoveObjectType | MoveStructType | Array<MoveType>;
|
|
1224
1543
|
/**
|
|
1225
1544
|
* Possible Move values acceptable by move functions (entry, view)
|
|
@@ -1246,12 +1565,12 @@ type MoveType = boolean | string | MoveUint8Type | MoveUint16Type | MoveUint32Ty
|
|
|
1246
1565
|
*/
|
|
1247
1566
|
type MoveValue = boolean | string | MoveUint8Type | MoveUint16Type | MoveUint32Type | MoveUint64Type | MoveUint128Type | MoveUint256Type | MoveAddressType | MoveObjectType | MoveStructId | MoveOptionType | Array<MoveValue>;
|
|
1248
1567
|
/**
|
|
1249
|
-
*
|
|
1250
|
-
* Module
|
|
1568
|
+
* A string representation of a Move module, formatted as `module_name::function_name`.
|
|
1569
|
+
* Module names are case-sensitive.
|
|
1251
1570
|
*/
|
|
1252
1571
|
type MoveModuleId = `${string}::${string}`;
|
|
1253
1572
|
/**
|
|
1254
|
-
*
|
|
1573
|
+
* Specifies the visibility levels for move functions, controlling access permissions.
|
|
1255
1574
|
*/
|
|
1256
1575
|
declare enum MoveFunctionVisibility {
|
|
1257
1576
|
PRIVATE = "private",
|
|
@@ -1259,7 +1578,7 @@ declare enum MoveFunctionVisibility {
|
|
|
1259
1578
|
FRIEND = "friend"
|
|
1260
1579
|
}
|
|
1261
1580
|
/**
|
|
1262
|
-
*
|
|
1581
|
+
* Abilities related to moving items within the system.
|
|
1263
1582
|
*/
|
|
1264
1583
|
declare enum MoveAbility {
|
|
1265
1584
|
STORE = "store",
|
|
@@ -1268,13 +1587,13 @@ declare enum MoveAbility {
|
|
|
1268
1587
|
COPY = "copy"
|
|
1269
1588
|
}
|
|
1270
1589
|
/**
|
|
1271
|
-
* Move abilities
|
|
1590
|
+
* Move abilities associated with the generic type parameter of a function.
|
|
1272
1591
|
*/
|
|
1273
1592
|
type MoveFunctionGenericTypeParam = {
|
|
1274
1593
|
constraints: Array<MoveAbility>;
|
|
1275
1594
|
};
|
|
1276
1595
|
/**
|
|
1277
|
-
* Move struct
|
|
1596
|
+
* A field in a Move struct, identified by its name.
|
|
1278
1597
|
*/
|
|
1279
1598
|
type MoveStructField = {
|
|
1280
1599
|
name: string;
|
|
@@ -1354,10 +1673,16 @@ type MoveFunction = {
|
|
|
1354
1673
|
*/
|
|
1355
1674
|
return: Array<string>;
|
|
1356
1675
|
};
|
|
1676
|
+
/**
|
|
1677
|
+
* Roles that can be assigned within the system, indicating different levels of access and functionality.
|
|
1678
|
+
*/
|
|
1357
1679
|
declare enum RoleType {
|
|
1358
1680
|
VALIDATOR = "validator",
|
|
1359
1681
|
FULL_NODE = "full_node"
|
|
1360
1682
|
}
|
|
1683
|
+
/**
|
|
1684
|
+
* Information about the current blockchain ledger, including its chain ID.
|
|
1685
|
+
*/
|
|
1361
1686
|
type LedgerInfo = {
|
|
1362
1687
|
/**
|
|
1363
1688
|
* Chain ID of the current chain
|
|
@@ -1391,7 +1716,7 @@ type Block = {
|
|
|
1391
1716
|
transactions?: Array<TransactionResponse>;
|
|
1392
1717
|
};
|
|
1393
1718
|
/**
|
|
1394
|
-
*
|
|
1719
|
+
* The request payload for the GetTableItem API.
|
|
1395
1720
|
*/
|
|
1396
1721
|
type TableItemRequest = {
|
|
1397
1722
|
key_type: MoveValue;
|
|
@@ -1402,11 +1727,12 @@ type TableItemRequest = {
|
|
|
1402
1727
|
key: any;
|
|
1403
1728
|
};
|
|
1404
1729
|
/**
|
|
1405
|
-
* A list of Authentication Key schemes
|
|
1406
|
-
*
|
|
1407
|
-
* They are combinations of signing schemes and derive schemes.
|
|
1730
|
+
* A list of supported Authentication Key schemes in Aptos, consisting of combinations of signing schemes and derive schemes.
|
|
1408
1731
|
*/
|
|
1409
1732
|
type AuthenticationKeyScheme = SigningScheme | DeriveScheme;
|
|
1733
|
+
/**
|
|
1734
|
+
* Different schemes for signing keys used in cryptographic operations.
|
|
1735
|
+
*/
|
|
1410
1736
|
declare enum SigningScheme {
|
|
1411
1737
|
/**
|
|
1412
1738
|
* For Ed25519PublicKey
|
|
@@ -1422,6 +1748,9 @@ declare enum SigningScheme {
|
|
|
1422
1748
|
SingleKey = 2,
|
|
1423
1749
|
MultiKey = 3
|
|
1424
1750
|
}
|
|
1751
|
+
/**
|
|
1752
|
+
* Specifies the signing schemes available for cryptographic operations.
|
|
1753
|
+
*/
|
|
1425
1754
|
declare enum SigningSchemeInput {
|
|
1426
1755
|
/**
|
|
1427
1756
|
* For Ed25519PublicKey
|
|
@@ -1433,7 +1762,7 @@ declare enum SigningSchemeInput {
|
|
|
1433
1762
|
Secp256k1Ecdsa = 2
|
|
1434
1763
|
}
|
|
1435
1764
|
/**
|
|
1436
|
-
*
|
|
1765
|
+
* Specifies the schemes for deriving account addresses from various data sources.
|
|
1437
1766
|
*/
|
|
1438
1767
|
declare enum DeriveScheme {
|
|
1439
1768
|
/**
|
|
@@ -1458,7 +1787,7 @@ declare enum DeriveScheme {
|
|
|
1458
1787
|
DeriveResourceAccountAddress = 255
|
|
1459
1788
|
}
|
|
1460
1789
|
/**
|
|
1461
|
-
*
|
|
1790
|
+
* Options for configuring the behavior of the waitForTransaction() function.
|
|
1462
1791
|
*/
|
|
1463
1792
|
type WaitForTransactionOptions = {
|
|
1464
1793
|
timeoutSecs?: number;
|
|
@@ -1466,16 +1795,14 @@ type WaitForTransactionOptions = {
|
|
|
1466
1795
|
waitForIndexer?: boolean;
|
|
1467
1796
|
};
|
|
1468
1797
|
/**
|
|
1469
|
-
* Input type to generate an account using
|
|
1470
|
-
* Ed25519 or Legacy Ed25519
|
|
1798
|
+
* Input type to generate an account using the Ed25519 signing scheme.
|
|
1471
1799
|
*/
|
|
1472
1800
|
type GenerateAccountWithEd25519 = {
|
|
1473
1801
|
scheme: SigningSchemeInput.Ed25519;
|
|
1474
1802
|
legacy: boolean;
|
|
1475
1803
|
};
|
|
1476
1804
|
/**
|
|
1477
|
-
* Input type to generate an account
|
|
1478
|
-
* Secp256k1
|
|
1805
|
+
* Input type to generate an account with a Single Signer using Secp256k1.
|
|
1479
1806
|
*/
|
|
1480
1807
|
type GenerateAccountWithSingleSignerSecp256k1Key = {
|
|
1481
1808
|
scheme: SigningSchemeInput.Secp256k1Ecdsa;
|
|
@@ -1488,41 +1815,77 @@ type GenerateAccount = GenerateAccountWithEd25519 | GenerateAccountWithSingleSig
|
|
|
1488
1815
|
* deserialize a byte buffer into a type T.
|
|
1489
1816
|
* It is not intended to be implemented or extended, because Typescript has no support
|
|
1490
1817
|
* for static methods in interfaces.
|
|
1818
|
+
*
|
|
1819
|
+
* @template T - The type that this will deserialize into.
|
|
1491
1820
|
*/
|
|
1492
1821
|
interface Deserializable<T> {
|
|
1822
|
+
/**
|
|
1823
|
+
* Deserializes the buffered bytes into an instance of the specified class type.
|
|
1824
|
+
* This function provides an alternative syntax for deserialization, allowing users to call
|
|
1825
|
+
* `deserializer.deserialize(MyClass)` instead of `MyClass.deserialize(deserializer)`.
|
|
1826
|
+
*
|
|
1827
|
+
* @param deserializer - The deserializer instance with the buffered bytes.
|
|
1828
|
+
* @returns The deserialized value of class type T.
|
|
1829
|
+
* @example
|
|
1830
|
+
* ```typescript
|
|
1831
|
+
* const deserializer = new Deserializer(new Uint8Array([1, 2, 3]));
|
|
1832
|
+
* const value = deserializer.deserialize(MyClass); // where MyClass has a `deserialize` function
|
|
1833
|
+
* // value is now an instance of MyClass
|
|
1834
|
+
* // equivalent to `const value = MyClass.deserialize(deserializer)`
|
|
1835
|
+
* ```
|
|
1836
|
+
*/
|
|
1493
1837
|
deserialize(deserializer: Deserializer): T;
|
|
1494
1838
|
}
|
|
1839
|
+
/**
|
|
1840
|
+
* A class that provides methods for deserializing various data types from a byte buffer.
|
|
1841
|
+
* It supports deserialization of primitive types, strings, and complex objects using a BCS (Binary Common Serialization) layout.
|
|
1842
|
+
*/
|
|
1495
1843
|
declare class Deserializer {
|
|
1496
1844
|
private buffer;
|
|
1497
1845
|
private offset;
|
|
1846
|
+
/**
|
|
1847
|
+
* Creates a new instance of the class with a copy of the provided data buffer.
|
|
1848
|
+
* This prevents outside mutation of the buffer.
|
|
1849
|
+
*
|
|
1850
|
+
* @param data - The data to be copied into the internal buffer as a Uint8Array.
|
|
1851
|
+
*/
|
|
1498
1852
|
constructor(data: Uint8Array);
|
|
1853
|
+
/**
|
|
1854
|
+
* Reads a specified number of bytes from the buffer and advances the offset.
|
|
1855
|
+
*
|
|
1856
|
+
* @param length - The number of bytes to read from the buffer.
|
|
1857
|
+
* @throws Throws an error if the read operation exceeds the buffer's length.
|
|
1858
|
+
*/
|
|
1499
1859
|
private read;
|
|
1500
1860
|
/**
|
|
1501
1861
|
* Returns the number of bytes remaining in the buffer.
|
|
1502
1862
|
*
|
|
1503
|
-
*
|
|
1863
|
+
* This information is useful to determine if there's more data to be read.
|
|
1864
|
+
*
|
|
1865
|
+
* @returns The number of bytes remaining in the buffer.
|
|
1504
1866
|
*/
|
|
1505
1867
|
remaining(): number;
|
|
1506
1868
|
/**
|
|
1507
|
-
* Deserializes a
|
|
1508
|
-
*
|
|
1869
|
+
* Deserializes a UTF-8 encoded string from a byte array. It first reads the length of the string in bytes,
|
|
1870
|
+
* followed by the actual byte content, and decodes it into a string.
|
|
1509
1871
|
*
|
|
1510
1872
|
* BCS layout for "string": string_length | string_content
|
|
1511
1873
|
* where string_length is a u32 integer encoded as a uleb128 integer, equal to the number of bytes in string_content.
|
|
1512
1874
|
*
|
|
1513
1875
|
* @example
|
|
1514
|
-
* ```
|
|
1876
|
+
* ```typescript
|
|
1515
1877
|
* const deserializer = new Deserializer(new Uint8Array([8, 49, 50, 51, 52, 97, 98, 99, 100]));
|
|
1516
1878
|
* assert(deserializer.deserializeStr() === "1234abcd");
|
|
1517
1879
|
* ```
|
|
1518
1880
|
*/
|
|
1519
1881
|
deserializeStr(): string;
|
|
1520
1882
|
/**
|
|
1521
|
-
* Deserializes
|
|
1883
|
+
* Deserializes an optional string.
|
|
1522
1884
|
*
|
|
1523
|
-
* BCS layout for Optional<String
|
|
1885
|
+
* The BCS layout for Optional<String> is 0 if none, else 1 followed by the string length and string content.
|
|
1886
|
+
* @returns The deserialized string if it exists, otherwise undefined.
|
|
1524
1887
|
* @example
|
|
1525
|
-
* ```
|
|
1888
|
+
* ```typescript
|
|
1526
1889
|
* const deserializer = new Deserializer(new Uint8Array([0x00]));
|
|
1527
1890
|
* assert(deserializer.deserializeOptionStr() === undefined);
|
|
1528
1891
|
* const deserializer = new Deserializer(new Uint8Array([1, 8, 49, 50, 51, 52, 97, 98, 99, 100]));
|
|
@@ -1531,9 +1894,9 @@ declare class Deserializer {
|
|
|
1531
1894
|
*/
|
|
1532
1895
|
deserializeOptionStr(): string | undefined;
|
|
1533
1896
|
/**
|
|
1534
|
-
* Deserializes
|
|
1897
|
+
* Deserializes an optional deserializable class.
|
|
1535
1898
|
*
|
|
1536
|
-
* BCS layout for Optional<T>: 0 if none, else 1 |
|
|
1899
|
+
* BCS layout for Optional<T>: 0 if none, else 1 | BCS representation of class.
|
|
1537
1900
|
*
|
|
1538
1901
|
* @example
|
|
1539
1902
|
* const deserializer = new Deserializer(new Uint8Array([1, 2, 3]));
|
|
@@ -1546,50 +1909,59 @@ declare class Deserializer {
|
|
|
1546
1909
|
*
|
|
1547
1910
|
* @param cls The BCS-deserializable class to deserialize the buffered bytes into.
|
|
1548
1911
|
*
|
|
1549
|
-
* @returns
|
|
1912
|
+
* @returns The deserialized value of class type T or undefined if no value exists.
|
|
1550
1913
|
*/
|
|
1551
1914
|
deserializeOption<T>(cls: Deserializable<T>): T | undefined;
|
|
1552
1915
|
/**
|
|
1553
1916
|
* Deserializes an array of bytes.
|
|
1554
1917
|
*
|
|
1555
|
-
* BCS layout for "bytes"
|
|
1556
|
-
*
|
|
1918
|
+
* The BCS layout for "bytes" consists of a bytes_length followed by the bytes themselves, where bytes_length is a u32 integer
|
|
1919
|
+
* encoded as a uleb128 integer, indicating the length of the bytes array.
|
|
1920
|
+
*
|
|
1921
|
+
* @returns {Uint8Array} The deserialized array of bytes.
|
|
1557
1922
|
*/
|
|
1558
1923
|
deserializeBytes(): Uint8Array;
|
|
1559
1924
|
/**
|
|
1560
|
-
* Deserializes an array of bytes
|
|
1925
|
+
* Deserializes an array of bytes of a specified length.
|
|
1561
1926
|
*
|
|
1927
|
+
* @param len - The number of bytes to read from the source.
|
|
1562
1928
|
*/
|
|
1563
1929
|
deserializeFixedBytes(len: number): Uint8Array;
|
|
1564
1930
|
/**
|
|
1565
|
-
* Deserializes a boolean value.
|
|
1931
|
+
* Deserializes a boolean value from a byte stream.
|
|
1932
|
+
*
|
|
1933
|
+
* The BCS layout for a boolean uses one byte, where "0x01" represents true and "0x00" represents false.
|
|
1934
|
+
* An error is thrown if the byte value is not valid.
|
|
1566
1935
|
*
|
|
1567
|
-
*
|
|
1936
|
+
* @returns The deserialized boolean value.
|
|
1937
|
+
* @throws Throws an error if the boolean value is invalid.
|
|
1568
1938
|
*/
|
|
1569
1939
|
deserializeBool(): boolean;
|
|
1570
1940
|
/**
|
|
1571
|
-
* Deserializes a uint8 number.
|
|
1941
|
+
* Deserializes a uint8 number from the binary data.
|
|
1572
1942
|
*
|
|
1573
1943
|
* BCS layout for "uint8": One byte. Binary format in little-endian representation.
|
|
1944
|
+
*
|
|
1945
|
+
* @returns {number} The deserialized uint8 number.
|
|
1574
1946
|
*/
|
|
1575
1947
|
deserializeU8(): Uint8;
|
|
1576
1948
|
/**
|
|
1577
|
-
* Deserializes a uint16 number.
|
|
1949
|
+
* Deserializes a uint16 number from a binary format in little-endian representation.
|
|
1578
1950
|
*
|
|
1579
|
-
* BCS layout for "uint16": Two bytes.
|
|
1951
|
+
* BCS layout for "uint16": Two bytes.
|
|
1580
1952
|
* @example
|
|
1581
|
-
* ```
|
|
1953
|
+
* ```typescript
|
|
1582
1954
|
* const deserializer = new Deserializer(new Uint8Array([0x34, 0x12]));
|
|
1583
1955
|
* assert(deserializer.deserializeU16() === 4660);
|
|
1584
1956
|
* ```
|
|
1585
1957
|
*/
|
|
1586
1958
|
deserializeU16(): Uint16;
|
|
1587
1959
|
/**
|
|
1588
|
-
* Deserializes a uint32 number.
|
|
1960
|
+
* Deserializes a uint32 number from a binary format in little-endian representation.
|
|
1589
1961
|
*
|
|
1590
|
-
* BCS layout for "uint32": Four bytes.
|
|
1962
|
+
* BCS layout for "uint32": Four bytes.
|
|
1591
1963
|
* @example
|
|
1592
|
-
* ```
|
|
1964
|
+
* ```typescript
|
|
1593
1965
|
* const deserializer = new Deserializer(new Uint8Array([0x78, 0x56, 0x34, 0x12]));
|
|
1594
1966
|
* assert(deserializer.deserializeU32() === 305419896);
|
|
1595
1967
|
* ```
|
|
@@ -1598,30 +1970,36 @@ declare class Deserializer {
|
|
|
1598
1970
|
/**
|
|
1599
1971
|
* Deserializes a uint64 number.
|
|
1600
1972
|
*
|
|
1601
|
-
*
|
|
1973
|
+
* This function combines two 32-bit values to return a 64-bit unsigned integer in little-endian representation.
|
|
1602
1974
|
* @example
|
|
1603
|
-
* ```
|
|
1975
|
+
* ```typescript
|
|
1604
1976
|
* const deserializer = new Deserializer(new Uint8Array([0x00, 0xEF, 0xCD, 0xAB, 0x78, 0x56, 0x34, 0x12]));
|
|
1605
1977
|
* assert(deserializer.deserializeU64() === 1311768467750121216);
|
|
1606
1978
|
* ```
|
|
1607
1979
|
*/
|
|
1608
1980
|
deserializeU64(): Uint64;
|
|
1609
1981
|
/**
|
|
1610
|
-
* Deserializes a uint128 number.
|
|
1982
|
+
* Deserializes a uint128 number from its binary representation.
|
|
1983
|
+
* This function combines two 64-bit values to return a single uint128 value in little-endian format.
|
|
1611
1984
|
*
|
|
1612
|
-
*
|
|
1985
|
+
* @returns {BigInt} The deserialized uint128 number.
|
|
1613
1986
|
*/
|
|
1614
1987
|
deserializeU128(): Uint128;
|
|
1615
1988
|
/**
|
|
1616
|
-
* Deserializes a uint256 number.
|
|
1989
|
+
* Deserializes a uint256 number from its binary representation.
|
|
1990
|
+
*
|
|
1991
|
+
* The BCS layout for "uint256" consists of thirty-two bytes in little-endian format.
|
|
1617
1992
|
*
|
|
1618
|
-
*
|
|
1993
|
+
* @returns {BigInt} The deserialized uint256 number.
|
|
1619
1994
|
*/
|
|
1620
1995
|
deserializeU256(): Uint256;
|
|
1621
1996
|
/**
|
|
1622
1997
|
* Deserializes a uleb128 encoded uint32 number.
|
|
1623
1998
|
*
|
|
1624
|
-
*
|
|
1999
|
+
* This function is used for interpreting lengths of variable-length sequences and tags of enum values in BCS encoding.
|
|
2000
|
+
*
|
|
2001
|
+
* @throws {Error} Throws an error if the parsed value exceeds the maximum uint32 number.
|
|
2002
|
+
* @returns {number} The deserialized uint32 value.
|
|
1625
2003
|
*/
|
|
1626
2004
|
deserializeUleb128AsU32(): Uint32;
|
|
1627
2005
|
/**
|
|
@@ -1639,10 +2017,10 @@ declare class Deserializer {
|
|
|
1639
2017
|
*/
|
|
1640
2018
|
deserialize<T>(cls: Deserializable<T>): T;
|
|
1641
2019
|
/**
|
|
1642
|
-
* Deserializes an array of BCS Deserializable values given an existing Deserializer
|
|
1643
|
-
* instance with a loaded byte buffer.
|
|
2020
|
+
* Deserializes an array of BCS Deserializable values given an existing Deserializer instance with a loaded byte buffer.
|
|
1644
2021
|
*
|
|
1645
2022
|
* @param cls The BCS-deserializable class to deserialize the buffered bytes into.
|
|
2023
|
+
* @returns An array of deserialized values of type T.
|
|
1646
2024
|
* @example
|
|
1647
2025
|
* // serialize a vector of addresses
|
|
1648
2026
|
* const addresses = new Array<AccountAddress>(
|
|
@@ -1659,7 +2037,6 @@ declare class Deserializer {
|
|
|
1659
2037
|
* const deserializer = new Deserializer(serializedBytes);
|
|
1660
2038
|
* const deserializedAddresses = deserializer.deserializeVector(AccountAddress);
|
|
1661
2039
|
* // deserializedAddresses is now an array of AccountAddress instances
|
|
1662
|
-
* @returns an array of deserialized values of type T
|
|
1663
2040
|
*/
|
|
1664
2041
|
deserializeVector<T>(cls: Deserializable<T>): Array<T>;
|
|
1665
2042
|
}
|
|
@@ -1674,6 +2051,12 @@ declare class ParsingError<T> extends Error {
|
|
|
1674
2051
|
* messages are not suitable for their use case. This should be an enum.
|
|
1675
2052
|
*/
|
|
1676
2053
|
invalidReason: T;
|
|
2054
|
+
/**
|
|
2055
|
+
* Creates an instance of the error with a specified message and invalid reason.
|
|
2056
|
+
*
|
|
2057
|
+
* @param message The error message that describes the issue.
|
|
2058
|
+
* @param invalidReason The reason why the input is considered invalid.
|
|
2059
|
+
*/
|
|
1677
2060
|
constructor(message: string, invalidReason: T);
|
|
1678
2061
|
}
|
|
1679
2062
|
/**
|
|
@@ -1696,7 +2079,7 @@ type ParsingResult<T> = {
|
|
|
1696
2079
|
};
|
|
1697
2080
|
|
|
1698
2081
|
/**
|
|
1699
|
-
*
|
|
2082
|
+
* Provides reasons for parsing failures related to hexadecimal values.
|
|
1700
2083
|
*/
|
|
1701
2084
|
declare enum HexInvalidReason {
|
|
1702
2085
|
TOO_SHORT = "too_short",
|
|
@@ -1704,28 +2087,26 @@ declare enum HexInvalidReason {
|
|
|
1704
2087
|
INVALID_HEX_CHARS = "invalid_hex_chars"
|
|
1705
2088
|
}
|
|
1706
2089
|
/**
|
|
1707
|
-
* NOTE: Do not use this class when working with account addresses
|
|
2090
|
+
* NOTE: Do not use this class when working with account addresses; use AccountAddress instead.
|
|
2091
|
+
* When accepting hex data as input to a function, prefer to accept HexInput and
|
|
2092
|
+
*
|
|
2093
|
+
* A helper class for working with hex data. Hex data, when represented as a string,
|
|
2094
|
+
* generally looks like this, for example: 0xaabbcc, 45cd32, etc.
|
|
1708
2095
|
*
|
|
1709
|
-
* NOTE: When accepting hex data as input to a function, prefer to accept HexInput and
|
|
1710
2096
|
* then use the static helper methods of this class to convert it into the desired
|
|
1711
2097
|
* format. This enables the greatest flexibility for the developer.
|
|
1712
2098
|
*
|
|
1713
|
-
*
|
|
1714
|
-
*
|
|
1715
|
-
*
|
|
1716
|
-
* You might use this class like this:
|
|
1717
|
-
*
|
|
1718
|
-
* ```ts
|
|
2099
|
+
* Example usage:
|
|
2100
|
+
* ```typescript
|
|
1719
2101
|
* getTransactionByHash(txnHash: HexInput): Promise<Transaction> {
|
|
1720
2102
|
* const txnHashString = Hex.fromHexInput(txnHash).toString();
|
|
1721
2103
|
* return await getTransactionByHashInner(txnHashString);
|
|
1722
2104
|
* }
|
|
1723
2105
|
* ```
|
|
1724
|
-
*
|
|
1725
2106
|
* This call to `Hex.fromHexInput().toString()` converts the HexInput to a hex string
|
|
1726
2107
|
* with a leading 0x prefix, regardless of what the input format was.
|
|
1727
2108
|
*
|
|
1728
|
-
*
|
|
2109
|
+
* Other ways to chain the functions together:
|
|
1729
2110
|
* - `Hex.fromHexString({ hexInput: "0x1f" }).toUint8Array()`
|
|
1730
2111
|
* - `new Hex([1, 3]).toStringWithoutPrefix()`
|
|
1731
2112
|
*/
|
|
@@ -1734,12 +2115,11 @@ declare class Hex {
|
|
|
1734
2115
|
/**
|
|
1735
2116
|
* Create a new Hex instance from a Uint8Array.
|
|
1736
2117
|
*
|
|
1737
|
-
* @param data Uint8Array
|
|
2118
|
+
* @param data - The Uint8Array containing the data to initialize the Hex instance.
|
|
1738
2119
|
*/
|
|
1739
2120
|
constructor(data: Uint8Array);
|
|
1740
2121
|
/**
|
|
1741
|
-
* Get the inner hex data. The inner data is already a Uint8Array so no conversion
|
|
1742
|
-
* is taking place here, it just returns the inner data.
|
|
2122
|
+
* Get the inner hex data as a Uint8Array. The inner data is already a Uint8Array, so no conversion takes place.
|
|
1743
2123
|
*
|
|
1744
2124
|
* @returns Hex data as Uint8Array
|
|
1745
2125
|
*/
|
|
@@ -1757,34 +2137,36 @@ declare class Hex {
|
|
|
1757
2137
|
*/
|
|
1758
2138
|
toString(): string;
|
|
1759
2139
|
/**
|
|
1760
|
-
*
|
|
2140
|
+
* Converts a hex string into a Hex instance, allowing for both prefixed and non-prefixed formats.
|
|
1761
2141
|
*
|
|
1762
|
-
* @param str A hex string, with or without the 0x prefix
|
|
2142
|
+
* @param str - A hex string, with or without the 0x prefix.
|
|
1763
2143
|
*
|
|
1764
|
-
* @
|
|
2144
|
+
* @throws ParsingError - If the hex string is too short, has an odd number of characters, or contains invalid hex characters.
|
|
2145
|
+
*
|
|
2146
|
+
* @returns Hex - The resulting Hex instance created from the provided string.
|
|
1765
2147
|
*/
|
|
1766
2148
|
static fromHexString(str: string): Hex;
|
|
1767
2149
|
/**
|
|
1768
|
-
*
|
|
1769
|
-
*
|
|
1770
|
-
* @param hexInput A HexInput (string or Uint8Array)
|
|
2150
|
+
* Converts an instance of HexInput, which can be a string or a Uint8Array, into a Hex instance.
|
|
2151
|
+
* This function is useful for transforming hexadecimal representations into a structured Hex object for further manipulation.
|
|
1771
2152
|
*
|
|
1772
|
-
* @
|
|
2153
|
+
* @param hexInput - A HexInput which can be a string or Uint8Array.
|
|
2154
|
+
* @returns A Hex instance created from the provided hexInput.
|
|
1773
2155
|
*/
|
|
1774
2156
|
static fromHexInput(hexInput: HexInput): Hex;
|
|
1775
2157
|
/**
|
|
1776
|
-
* Check if the string is valid
|
|
2158
|
+
* Check if the provided string is a valid hexadecimal representation.
|
|
1777
2159
|
*
|
|
1778
|
-
* @param str A hex string representing byte data.
|
|
2160
|
+
* @param str - A hex string representing byte data.
|
|
1779
2161
|
*
|
|
1780
|
-
* @returns
|
|
1781
|
-
* valid
|
|
1782
|
-
*
|
|
2162
|
+
* @returns An object containing:
|
|
2163
|
+
* - valid: A boolean indicating whether the string is valid.
|
|
2164
|
+
* - invalidReason: The reason for invalidity if the string is not valid.
|
|
2165
|
+
* - invalidReasonMessage: A message explaining why the string is invalid.
|
|
1783
2166
|
*/
|
|
1784
2167
|
static isValid(str: string): ParsingResult<HexInvalidReason>;
|
|
1785
2168
|
/**
|
|
1786
|
-
*
|
|
1787
|
-
* their underlying byte data is identical.
|
|
2169
|
+
* Determine if two Hex instances are equal by comparing their underlying byte data.
|
|
1788
2170
|
*
|
|
1789
2171
|
* @param other The Hex instance to compare to.
|
|
1790
2172
|
* @returns true if the Hex instances are equal, false if not.
|
|
@@ -1792,38 +2174,86 @@ declare class Hex {
|
|
|
1792
2174
|
equals(other: Hex): boolean;
|
|
1793
2175
|
}
|
|
1794
2176
|
|
|
2177
|
+
/**
|
|
2178
|
+
* This class serves as a base class for all serializable types. It facilitates
|
|
2179
|
+
* composable serialization of complex types and enables the serialization of
|
|
2180
|
+
* instances to their BCS (Binary Canonical Serialization) representation.
|
|
2181
|
+
*/
|
|
1795
2182
|
declare abstract class Serializable {
|
|
1796
2183
|
abstract serialize(serializer: Serializer): void;
|
|
1797
2184
|
/**
|
|
1798
2185
|
* Serializes a `Serializable` value to its BCS representation.
|
|
1799
|
-
* This function is the
|
|
1800
|
-
* @returns the BCS representation of the Serializable instance as a byte buffer
|
|
2186
|
+
* This function is the TypeScript SDK equivalent of `bcs::to_bytes` in Move.
|
|
2187
|
+
* @returns the BCS representation of the Serializable instance as a byte buffer.
|
|
1801
2188
|
*/
|
|
1802
2189
|
bcsToBytes(): Uint8Array;
|
|
1803
2190
|
/**
|
|
1804
|
-
*
|
|
1805
|
-
*
|
|
2191
|
+
* Converts the BCS-serialized bytes of a value into a Hex instance.
|
|
2192
|
+
* This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
|
|
2193
|
+
* @returns A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
|
|
1806
2194
|
*/
|
|
1807
2195
|
bcsToHex(): Hex;
|
|
2196
|
+
/**
|
|
2197
|
+
* Returns the hex string representation of the `Serializable` value without the 0x prefix.
|
|
2198
|
+
* @returns the hex format as a string without `0x` prefix.
|
|
2199
|
+
*/
|
|
2200
|
+
toStringWithoutPrefix(): string;
|
|
2201
|
+
/**
|
|
2202
|
+
* Returns the hex string representation of the `Serializable` value with the 0x prefix.
|
|
2203
|
+
* @returns the hex formatas a string prefixed by `0x`.
|
|
2204
|
+
*/
|
|
2205
|
+
toString(): string;
|
|
1808
2206
|
}
|
|
2207
|
+
/**
|
|
2208
|
+
* A class for serializing various data types into a binary format.
|
|
2209
|
+
* It provides methods to serialize strings, bytes, numbers, and other serializable objects
|
|
2210
|
+
* using the Binary Coded Serialization (BCS) layout. The serialized data can be retrieved as a
|
|
2211
|
+
* Uint8Array.
|
|
2212
|
+
*/
|
|
1809
2213
|
declare class Serializer {
|
|
1810
2214
|
private buffer;
|
|
1811
2215
|
private offset;
|
|
2216
|
+
/**
|
|
2217
|
+
* Constructs a serializer with a buffer of size `length` bytes, 64 bytes by default.
|
|
2218
|
+
* The `length` must be greater than 0.
|
|
2219
|
+
*
|
|
2220
|
+
* @param length - The size of the buffer in bytes.
|
|
2221
|
+
*/
|
|
1812
2222
|
constructor(length?: number);
|
|
2223
|
+
/**
|
|
2224
|
+
* Ensures that the internal buffer can accommodate the specified number of bytes.
|
|
2225
|
+
* This function dynamically resizes the buffer if the current size is insufficient.
|
|
2226
|
+
*
|
|
2227
|
+
* @param bytes - The number of bytes to ensure the buffer can handle.
|
|
2228
|
+
*/
|
|
1813
2229
|
private ensureBufferWillHandleSize;
|
|
2230
|
+
/**
|
|
2231
|
+
* Appends the specified values to the buffer, ensuring that the buffer can accommodate the new data.
|
|
2232
|
+
*
|
|
2233
|
+
* @param {Uint8Array} values - The values to be appended to the buffer.
|
|
2234
|
+
*/
|
|
1814
2235
|
protected appendToBuffer(values: Uint8Array): void;
|
|
2236
|
+
/**
|
|
2237
|
+
* Serializes a value into the buffer using the provided function, ensuring the buffer can accommodate the size.
|
|
2238
|
+
*
|
|
2239
|
+
* @param fn - The function to serialize the value, which takes a byte offset, the value to serialize, and an optional little-endian flag.
|
|
2240
|
+
* @param fn.byteOffset - The byte offset at which to write the value.
|
|
2241
|
+
* @param fn.value - The numeric value to serialize into the buffer.
|
|
2242
|
+
* @param fn.littleEndian - Optional flag indicating whether to use little-endian byte order (defaults to true).
|
|
2243
|
+
*/
|
|
1815
2244
|
private serializeWithFunction;
|
|
1816
2245
|
/**
|
|
1817
2246
|
* Serializes a string. UTF8 string is supported.
|
|
1818
|
-
*
|
|
1819
2247
|
* The number of bytes in the string content is serialized first, as a uleb128-encoded u32 integer.
|
|
1820
2248
|
* Then the string content is serialized as UTF8 encoded bytes.
|
|
1821
2249
|
*
|
|
1822
2250
|
* BCS layout for "string": string_length | string_content
|
|
1823
2251
|
* where string_length is a u32 integer encoded as a uleb128 integer, equal to the number of bytes in string_content.
|
|
1824
2252
|
*
|
|
2253
|
+
* @param value - The string to serialize.
|
|
2254
|
+
*
|
|
1825
2255
|
* @example
|
|
1826
|
-
* ```
|
|
2256
|
+
* ```typescript
|
|
1827
2257
|
* const serializer = new Serializer();
|
|
1828
2258
|
* serializer.serializeStr("1234abcd");
|
|
1829
2259
|
* assert(serializer.toUint8Array() === new Uint8Array([8, 49, 50, 51, 52, 97, 98, 99, 100]));
|
|
@@ -1833,35 +2263,47 @@ declare class Serializer {
|
|
|
1833
2263
|
/**
|
|
1834
2264
|
* Serializes an array of bytes.
|
|
1835
2265
|
*
|
|
2266
|
+
* This function encodes the length of the byte array as a u32 integer in uleb128 format, followed by the byte array itself.
|
|
1836
2267
|
* BCS layout for "bytes": bytes_length | bytes
|
|
1837
2268
|
* where bytes_length is a u32 integer encoded as a uleb128 integer, equal to the length of the bytes array.
|
|
2269
|
+
* @param value - The byte array to serialize.
|
|
1838
2270
|
*/
|
|
1839
2271
|
serializeBytes(value: Uint8Array): void;
|
|
1840
2272
|
/**
|
|
1841
|
-
* Serializes an array of bytes with known length
|
|
1842
|
-
*
|
|
1843
|
-
*
|
|
2273
|
+
* Serializes an array of bytes with a known length, allowing for efficient deserialization without needing to serialize the
|
|
2274
|
+
* length itself.
|
|
1844
2275
|
* When deserializing, the number of bytes to deserialize needs to be passed in.
|
|
2276
|
+
|
|
2277
|
+
* @param value - The Uint8Array to be serialized.
|
|
1845
2278
|
*/
|
|
1846
2279
|
serializeFixedBytes(value: Uint8Array): void;
|
|
1847
2280
|
/**
|
|
1848
|
-
* Serializes a boolean value.
|
|
2281
|
+
* Serializes a boolean value into a byte representation.
|
|
2282
|
+
*
|
|
2283
|
+
* The BCS layout for a boolean uses one byte, where "0x01" represents true and "0x00" represents false.
|
|
1849
2284
|
*
|
|
1850
|
-
*
|
|
2285
|
+
* @param value - The boolean value to serialize.
|
|
1851
2286
|
*/
|
|
1852
2287
|
serializeBool(value: boolean): void;
|
|
1853
2288
|
/**
|
|
1854
|
-
* Serializes a
|
|
1855
|
-
*
|
|
2289
|
+
* Serializes a Uint8 value and appends it to the buffer.
|
|
1856
2290
|
* BCS layout for "uint8": One byte. Binary format in little-endian representation.
|
|
2291
|
+
*
|
|
2292
|
+
* @param value - The Uint8 value to serialize.
|
|
1857
2293
|
*/
|
|
1858
2294
|
serializeU8(value: Uint8): void;
|
|
1859
2295
|
/**
|
|
1860
2296
|
* Serializes a uint16 number.
|
|
1861
2297
|
*
|
|
2298
|
+
|
|
2299
|
+
*/
|
|
2300
|
+
/**
|
|
2301
|
+
* Serializes a 16-bit unsigned integer value into a binary format.
|
|
1862
2302
|
* BCS layout for "uint16": Two bytes. Binary format in little-endian representation.
|
|
2303
|
+
*
|
|
2304
|
+
* @param value - The 16-bit unsigned integer value to serialize.
|
|
1863
2305
|
* @example
|
|
1864
|
-
* ```
|
|
2306
|
+
* ```typescript
|
|
1865
2307
|
* const serializer = new Serializer();
|
|
1866
2308
|
* serializer.serializeU16(4660);
|
|
1867
2309
|
* assert(serializer.toUint8Array() === new Uint8Array([0x34, 0x12]));
|
|
@@ -1869,21 +2311,22 @@ declare class Serializer {
|
|
|
1869
2311
|
*/
|
|
1870
2312
|
serializeU16(value: Uint16): void;
|
|
1871
2313
|
/**
|
|
1872
|
-
* Serializes a
|
|
1873
|
-
*
|
|
1874
|
-
* BCS layout for "uint32": Four bytes. Binary format in little-endian representation.
|
|
2314
|
+
* Serializes a 32-bit unsigned integer value into a binary format.
|
|
2315
|
+
* This function is useful for encoding data that needs to be stored or transmitted in a compact form.
|
|
1875
2316
|
* @example
|
|
1876
|
-
* ```
|
|
2317
|
+
* ```typescript
|
|
1877
2318
|
* const serializer = new Serializer();
|
|
1878
2319
|
* serializer.serializeU32(305419896);
|
|
1879
2320
|
* assert(serializer.toUint8Array() === new Uint8Array([0x78, 0x56, 0x34, 0x12]));
|
|
1880
2321
|
* ```
|
|
2322
|
+
* @param value - The 32-bit unsigned integer value to serialize.
|
|
1881
2323
|
*/
|
|
1882
2324
|
serializeU32(value: Uint32): void;
|
|
1883
2325
|
/**
|
|
1884
|
-
* Serializes a
|
|
2326
|
+
* Serializes a 64-bit unsigned integer into a format suitable for storage or transmission.
|
|
2327
|
+
* This function breaks down the value into two 32-bit components and writes them in little-endian order.
|
|
1885
2328
|
*
|
|
1886
|
-
*
|
|
2329
|
+
* @param value - The 64-bit unsigned integer to serialize, represented as a number.
|
|
1887
2330
|
* @example
|
|
1888
2331
|
* ```ts
|
|
1889
2332
|
* const serializer = new Serializer();
|
|
@@ -1893,66 +2336,44 @@ declare class Serializer {
|
|
|
1893
2336
|
*/
|
|
1894
2337
|
serializeU64(value: AnyNumber): void;
|
|
1895
2338
|
/**
|
|
1896
|
-
* Serializes a
|
|
2339
|
+
* Serializes a U128 value into a format suitable for storage or transmission.
|
|
1897
2340
|
*
|
|
1898
|
-
*
|
|
2341
|
+
* @param value - The U128 value to serialize, represented as a number.
|
|
1899
2342
|
*/
|
|
1900
2343
|
serializeU128(value: AnyNumber): void;
|
|
1901
2344
|
/**
|
|
1902
|
-
* Serializes a
|
|
2345
|
+
* Serializes a U256 value into a byte representation.
|
|
2346
|
+
* This function is essential for encoding large numbers in a compact format suitable for transmission or storage.
|
|
1903
2347
|
*
|
|
1904
|
-
*
|
|
2348
|
+
* @param value - The U256 value to serialize, represented as an AnyNumber.
|
|
1905
2349
|
*/
|
|
1906
2350
|
serializeU256(value: AnyNumber): void;
|
|
1907
2351
|
/**
|
|
1908
|
-
* Serializes a
|
|
1909
|
-
*
|
|
2352
|
+
* Serializes a 32-bit unsigned integer as a variable-length ULEB128 encoded byte array.
|
|
1910
2353
|
* BCS uses uleb128 encoding in two cases: (1) lengths of variable-length sequences and (2) tags of enum values
|
|
2354
|
+
*
|
|
2355
|
+
* @param val - The 32-bit unsigned integer value to be serialized.
|
|
1911
2356
|
*/
|
|
1912
2357
|
serializeU32AsUleb128(val: Uint32): void;
|
|
1913
2358
|
/**
|
|
1914
|
-
* Returns the buffered bytes
|
|
2359
|
+
* Returns the buffered bytes as a Uint8Array.
|
|
2360
|
+
*
|
|
2361
|
+
* This function allows you to retrieve the byte representation of the buffer up to the current offset.
|
|
2362
|
+
*
|
|
2363
|
+
* @returns Uint8Array - The byte array representation of the buffer.
|
|
1915
2364
|
*/
|
|
1916
2365
|
toUint8Array(): Uint8Array;
|
|
1917
2366
|
/**
|
|
1918
2367
|
* Serializes a `Serializable` value, facilitating composable serialization.
|
|
1919
2368
|
*
|
|
1920
|
-
* @param value The Serializable value to serialize
|
|
1921
|
-
*
|
|
1922
|
-
* @example
|
|
1923
|
-
* // Define the MoveStruct class that implements the Serializable interface
|
|
1924
|
-
* class MoveStruct extends Serializable {
|
|
1925
|
-
* constructor(
|
|
1926
|
-
* public creatorAddress: AccountAddress, // where AccountAddress extends Serializable
|
|
1927
|
-
* public collectionName: string,
|
|
1928
|
-
* public tokenName: string
|
|
1929
|
-
* ) {}
|
|
1930
|
-
*
|
|
1931
|
-
* serialize(serializer: Serializer): void {
|
|
1932
|
-
* serializer.serialize(this.creatorAddress); // Composable serialization of another Serializable object
|
|
1933
|
-
* serializer.serializeStr(this.collectionName);
|
|
1934
|
-
* serializer.serializeStr(this.tokenName);
|
|
1935
|
-
* }
|
|
1936
|
-
* }
|
|
1937
|
-
*
|
|
1938
|
-
* // Construct a MoveStruct
|
|
1939
|
-
* const moveStruct = new MoveStruct(new AccountAddress(...), "MyCollection", "TokenA");
|
|
1940
|
-
*
|
|
1941
|
-
* // Serialize a string, a u64 number, and a MoveStruct instance.
|
|
1942
|
-
* const serializer = new Serializer();
|
|
1943
|
-
* serializer.serializeStr("ExampleString");
|
|
1944
|
-
* serializer.serializeU64(12345678);
|
|
1945
|
-
* serializer.serialize(moveStruct);
|
|
1946
|
-
*
|
|
1947
|
-
* // Get the bytes from the Serializer instance
|
|
1948
|
-
* const serializedBytes = serializer.toUint8Array();
|
|
2369
|
+
* @param value The Serializable value to serialize.
|
|
1949
2370
|
*
|
|
1950
2371
|
* @returns the serializer instance
|
|
1951
2372
|
*/
|
|
1952
2373
|
serialize<T extends Serializable>(value: T): void;
|
|
1953
2374
|
/**
|
|
1954
2375
|
* Serializes an array of BCS Serializable values to a serializer instance.
|
|
1955
|
-
*
|
|
2376
|
+
* The bytes are added to the serializer instance's byte buffer.
|
|
1956
2377
|
*
|
|
1957
2378
|
* @param values The array of BCS Serializable values
|
|
1958
2379
|
* @example
|
|
@@ -1971,13 +2392,13 @@ declare class Serializer {
|
|
|
1971
2392
|
*/
|
|
1972
2393
|
serializeVector<T extends Serializable>(values: Array<T>): void;
|
|
1973
2394
|
/**
|
|
1974
|
-
* Serializes a BCS Serializable
|
|
1975
|
-
*
|
|
2395
|
+
* Serializes a BCS Serializable value into a serializer instance or handles the case when the value is undefined.
|
|
2396
|
+
* This function allows you to efficiently add serialized data to the serializer's byte buffer.
|
|
1976
2397
|
*
|
|
1977
|
-
* @param
|
|
2398
|
+
* @param value The BCS Serializable value to serialize, or undefined if there is no value.
|
|
1978
2399
|
*
|
|
1979
2400
|
* @example
|
|
1980
|
-
* ```
|
|
2401
|
+
* ```typescript
|
|
1981
2402
|
* const serializer = new Serializer();
|
|
1982
2403
|
* serializer.serializeOption(new AccountAddress(...));
|
|
1983
2404
|
* const serializedBytes = serializer.toUint8Array();
|
|
@@ -1990,48 +2411,67 @@ declare class Serializer {
|
|
|
1990
2411
|
*/
|
|
1991
2412
|
serializeOption<T extends Serializable>(value?: T): void;
|
|
1992
2413
|
/**
|
|
1993
|
-
* Serializes an optional string
|
|
1994
|
-
*
|
|
1995
|
-
* The existence of the string is encoded first, 0 if undefined and 1 if it exists.
|
|
1996
|
-
* Them the number of bytes in the string content is serialized, as a uleb128-encoded u32 integer.
|
|
1997
|
-
* Then the string content is serialized as UTF8 encoded bytes.
|
|
2414
|
+
* Serializes an optional string, supporting UTF8 encoding.
|
|
2415
|
+
* The function encodes the existence of the string first, followed by the length and content if it exists.
|
|
1998
2416
|
*
|
|
1999
2417
|
* BCS layout for optional "string": 1 | string_length | string_content
|
|
2000
2418
|
* where string_length is a u32 integer encoded as a uleb128 integer, equal to the number of bytes in string_content.
|
|
2001
|
-
*
|
|
2002
2419
|
* BCS layout for undefined: 0
|
|
2003
|
-
* @example
|
|
2004
|
-
* ```ts
|
|
2005
|
-
* const serializer = new Serializer();
|
|
2006
|
-
* serializer.serializeOptionStr("1234abcd");
|
|
2007
|
-
* assert(serializer.toUint8Array() === new Uint8Array([1, 8, 49, 50, 51, 52, 97, 98, 99, 100]));
|
|
2008
2420
|
*
|
|
2009
|
-
*
|
|
2010
|
-
* serializer.serializeOptionStr(undefined);
|
|
2011
|
-
* assert(serializer.toUint8Array() === new Uint8Array([0]));
|
|
2012
|
-
* ```
|
|
2421
|
+
* @param value - The optional string to serialize. If undefined, it will serialize as 0.
|
|
2013
2422
|
*/
|
|
2014
2423
|
serializeOptionStr(value?: string): void;
|
|
2015
2424
|
}
|
|
2016
2425
|
declare function ensureBoolean(value: unknown): asserts value is boolean;
|
|
2017
2426
|
declare const outOfRangeErrorMessage: (value: AnyNumber, min: AnyNumber, max: AnyNumber) => string;
|
|
2427
|
+
/**
|
|
2428
|
+
* Validates that a given number is within a specified range.
|
|
2429
|
+
* This function throws an error if the value is outside the defined minimum and maximum bounds.
|
|
2430
|
+
*
|
|
2431
|
+
* @param value - The number to validate.
|
|
2432
|
+
* @param minValue - The minimum allowable value (inclusive).
|
|
2433
|
+
* @param maxValue - The maximum allowable value (inclusive).
|
|
2434
|
+
*/
|
|
2018
2435
|
declare function validateNumberInRange<T extends AnyNumber>(value: T, minValue: T, maxValue: T): void;
|
|
2019
2436
|
|
|
2020
2437
|
interface TransactionArgument extends EntryFunctionArgument, ScriptFunctionArgument {
|
|
2021
2438
|
}
|
|
2439
|
+
/**
|
|
2440
|
+
* Represents an argument for entry functions, providing methods to serialize the argument
|
|
2441
|
+
* to BCS-serialized bytes and convert it to different formats.
|
|
2442
|
+
*/
|
|
2022
2443
|
interface EntryFunctionArgument {
|
|
2023
2444
|
/**
|
|
2024
2445
|
* Serialize an argument to BCS-serialized bytes.
|
|
2446
|
+
*
|
|
2447
|
+
* @param serializer - The serializer instance used for serialization.
|
|
2025
2448
|
*/
|
|
2026
2449
|
serialize(serializer: Serializer): void;
|
|
2027
2450
|
/**
|
|
2451
|
+
* Serialize an argument to BCS-serialized bytes.
|
|
2028
2452
|
* Serialize an argument as a type-agnostic, fixed byte sequence. The byte sequence contains
|
|
2029
2453
|
* the number of the following bytes followed by the BCS-serialized bytes for a typed argument.
|
|
2454
|
+
*
|
|
2455
|
+
* @param serializer - The serializer used to convert the argument.
|
|
2030
2456
|
*/
|
|
2031
2457
|
serializeForEntryFunction(serializer: Serializer): void;
|
|
2458
|
+
/**
|
|
2459
|
+
* Convert the argument to BCS-serialized bytes.
|
|
2460
|
+
*
|
|
2461
|
+
* @returns Uint8Array representing the BCS-serialized bytes of the argument.
|
|
2462
|
+
*/
|
|
2032
2463
|
bcsToBytes(): Uint8Array;
|
|
2464
|
+
/**
|
|
2465
|
+
* Converts the BCS-serialized bytes of an argument into a hexadecimal representation.
|
|
2466
|
+
* This function is useful for obtaining a Hex instance that encapsulates the BCS-serialized bytes,
|
|
2467
|
+
* allowing for easier manipulation and representation of the data.
|
|
2468
|
+
* @returns A Hex instance containing the BCS-serialized bytes.
|
|
2469
|
+
*/
|
|
2033
2470
|
bcsToHex(): Hex;
|
|
2034
2471
|
}
|
|
2472
|
+
/**
|
|
2473
|
+
* Represents an argument for script functions, providing methods to serialize and convert to bytes.
|
|
2474
|
+
*/
|
|
2035
2475
|
interface ScriptFunctionArgument {
|
|
2036
2476
|
/**
|
|
2037
2477
|
* Serialize an argument to BCS-serialized bytes.
|
|
@@ -2048,7 +2488,7 @@ interface ScriptFunctionArgument {
|
|
|
2048
2488
|
}
|
|
2049
2489
|
|
|
2050
2490
|
/**
|
|
2051
|
-
*
|
|
2491
|
+
* Provides reasons for an address was invalid.
|
|
2052
2492
|
*/
|
|
2053
2493
|
declare enum AddressInvalidReason {
|
|
2054
2494
|
INCORRECT_NUMBER_OF_BYTES = "incorrect_number_of_bytes",
|
|
@@ -2059,6 +2499,9 @@ declare enum AddressInvalidReason {
|
|
|
2059
2499
|
LONG_FORM_REQUIRED_UNLESS_SPECIAL = "long_form_required_unless_special",
|
|
2060
2500
|
INVALID_PADDING_ZEROES = "INVALID_PADDING_ZEROES"
|
|
2061
2501
|
}
|
|
2502
|
+
/**
|
|
2503
|
+
* The input for an account address, which can be either a hexadecimal string or a standard account address.
|
|
2504
|
+
*/
|
|
2062
2505
|
type AccountAddressInput = HexInput | AccountAddress;
|
|
2063
2506
|
/**
|
|
2064
2507
|
* NOTE: Only use this class for account addresses. For other hex data, e.g. transaction
|
|
@@ -2098,68 +2541,60 @@ declare class AccountAddress extends Serializable implements TransactionArgument
|
|
|
2098
2541
|
/**
|
|
2099
2542
|
* Creates an instance of AccountAddress from a Uint8Array.
|
|
2100
2543
|
*
|
|
2101
|
-
*
|
|
2544
|
+
* This function ensures that the input data is exactly 32 bytes long, which is required for a valid account address.
|
|
2545
|
+
*
|
|
2546
|
+
* @param input A Uint8Array representing an account address.
|
|
2547
|
+
* @throws ParsingError if the input length is not equal to 32 bytes.
|
|
2102
2548
|
*/
|
|
2103
2549
|
constructor(input: Uint8Array);
|
|
2104
2550
|
/**
|
|
2105
|
-
*
|
|
2106
|
-
*
|
|
2551
|
+
* Determines if the address is classified as special, which is defined as 0x0 to 0xf inclusive.
|
|
2552
|
+
* In other words, the last byte of the address must be < 0b10000 (16)
|
|
2107
2553
|
* and every other byte must be zero.
|
|
2108
2554
|
*
|
|
2109
|
-
* For more information on how special addresses are defined see AIP-40:
|
|
2555
|
+
* For more information on how special addresses are defined, see AIP-40:
|
|
2110
2556
|
* https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.
|
|
2111
2557
|
*
|
|
2112
|
-
* @returns true if the address is special, false
|
|
2558
|
+
* @returns true if the address is special, false otherwise.
|
|
2113
2559
|
*/
|
|
2114
2560
|
isSpecial(): boolean;
|
|
2115
2561
|
/**
|
|
2116
2562
|
* Return the AccountAddress as a string as per AIP-40.
|
|
2117
2563
|
* https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.
|
|
2118
|
-
*
|
|
2119
|
-
*
|
|
2120
|
-
* 0x0 through to 0xf inclusive, and every other address is represented in LONG form,
|
|
2121
|
-
* meaning 0x + 64 hex characters.
|
|
2564
|
+
* This representation returns special addresses in SHORT form (0xf)
|
|
2565
|
+
* and other addresses in LONG form (0x + 64 characters).
|
|
2122
2566
|
*
|
|
2123
2567
|
* @returns AccountAddress as a string conforming to AIP-40.
|
|
2124
2568
|
*/
|
|
2125
2569
|
toString(): `0x${string}`;
|
|
2126
2570
|
/**
|
|
2127
|
-
*
|
|
2571
|
+
* Return the AccountAddress as a string conforming to AIP-40 but without the leading 0x.
|
|
2128
2572
|
*
|
|
2129
|
-
*
|
|
2130
|
-
*
|
|
2131
|
-
* Learn more by reading the docstring of `toString`.
|
|
2573
|
+
* NOTE: Prefer to use `toString` where possible.
|
|
2132
2574
|
*
|
|
2133
|
-
* @returns AccountAddress as a string
|
|
2575
|
+
* @returns AccountAddress as a string without the leading 0x.
|
|
2134
2576
|
*/
|
|
2135
2577
|
toStringWithoutPrefix(): string;
|
|
2136
2578
|
/**
|
|
2137
|
-
*
|
|
2579
|
+
* Convert the account address to a string in LONG format, which is always 0x followed by 64 hex characters.
|
|
2138
2580
|
*
|
|
2139
|
-
*
|
|
2140
|
-
* SHORT form (no leading 0s), this format the address in the LONG format
|
|
2141
|
-
* unconditionally.
|
|
2142
|
-
*
|
|
2143
|
-
* This means it will be 0x + 64 hex characters.
|
|
2581
|
+
* NOTE: Prefer to use `toString` where possible, as it formats special addresses using the SHORT form (no leading 0s).
|
|
2144
2582
|
*
|
|
2145
2583
|
* @returns AccountAddress as a string in LONG form.
|
|
2146
2584
|
*/
|
|
2147
2585
|
toStringLong(): `0x${string}`;
|
|
2148
2586
|
/**
|
|
2149
|
-
*
|
|
2150
|
-
*
|
|
2151
|
-
* Whereas toString will format special addresses (as defined by isSpecial) using the
|
|
2152
|
-
* SHORT form (no leading 0s), this function will include leading zeroes. The string
|
|
2153
|
-
* will not have a leading zero.
|
|
2587
|
+
* Returns the account address as a string in LONG form without a leading 0x.
|
|
2588
|
+
* This function will include leading zeroes and will produce a string of 64 hex characters.
|
|
2154
2589
|
*
|
|
2155
|
-
*
|
|
2590
|
+
* NOTE: Prefer to use `toString` where possible, as it formats special addresses using the SHORT form (no leading 0s).
|
|
2156
2591
|
*
|
|
2157
|
-
* @returns
|
|
2592
|
+
* @returns {string} The account address in LONG form.
|
|
2158
2593
|
*/
|
|
2159
2594
|
toStringLongWithoutPrefix(): string;
|
|
2160
2595
|
/**
|
|
2161
|
-
* Get the inner
|
|
2162
|
-
* is
|
|
2596
|
+
* Get the inner data as a Uint8Array.
|
|
2597
|
+
* The inner data is already a Uint8Array, so no conversion takes place.
|
|
2163
2598
|
*
|
|
2164
2599
|
* @returns Hex data as Uint8Array
|
|
2165
2600
|
*/
|
|
@@ -2176,10 +2611,23 @@ declare class AccountAddress extends Serializable implements TransactionArgument
|
|
|
2176
2611
|
* // `bytes` is now the BCS-serialized address.
|
|
2177
2612
|
*/
|
|
2178
2613
|
serialize(serializer: Serializer): void;
|
|
2614
|
+
/**
|
|
2615
|
+
* Serializes the current instance into a byte sequence suitable for entry functions.
|
|
2616
|
+
* This allows for the proper encoding of data when interacting with entry functions in the blockchain.
|
|
2617
|
+
*
|
|
2618
|
+
* @param serializer - The serializer instance used to convert the data into bytes.
|
|
2619
|
+
*/
|
|
2179
2620
|
serializeForEntryFunction(serializer: Serializer): void;
|
|
2621
|
+
/**
|
|
2622
|
+
* Serializes the current instance for use in a script function by encoding it into a byte sequence.
|
|
2623
|
+
* This process involves serializing the variant index and the instance data, making it suitable for transmission.
|
|
2624
|
+
*
|
|
2625
|
+
* @param serializer - The serializer instance used to perform the serialization.
|
|
2626
|
+
*/
|
|
2180
2627
|
serializeForScriptFunction(serializer: Serializer): void;
|
|
2181
2628
|
/**
|
|
2182
2629
|
* Deserialize an AccountAddress from the byte buffer in a Deserializer instance.
|
|
2630
|
+
* This function allows you to convert a byte representation of an AccountAddress into an instance of AccountAddress.
|
|
2183
2631
|
* @param deserializer The deserializer to deserialize the AccountAddress from.
|
|
2184
2632
|
* @returns An instance of AccountAddress.
|
|
2185
2633
|
* @example
|
|
@@ -2209,10 +2657,14 @@ declare class AccountAddress extends Serializable implements TransactionArgument
|
|
|
2209
2657
|
* - SHORT for non-special addresses.
|
|
2210
2658
|
* - Any address without a leading 0x.
|
|
2211
2659
|
*
|
|
2212
|
-
*
|
|
2213
|
-
*
|
|
2660
|
+
* @param input - A hex string representing an account address.
|
|
2661
|
+
*
|
|
2662
|
+
* @throws {ParsingError} If the hex string does not start with 0x or is not in a valid format.
|
|
2214
2663
|
*
|
|
2215
|
-
* @
|
|
2664
|
+
* @note This function has strict parsing behavior. For relaxed behavior, please use the `fromString` function.
|
|
2665
|
+
*
|
|
2666
|
+
* @see AIP-40 documentation for more details on address formats:
|
|
2667
|
+
* https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.
|
|
2216
2668
|
*
|
|
2217
2669
|
* @returns An instance of AccountAddress.
|
|
2218
2670
|
*/
|
|
@@ -2238,43 +2690,46 @@ declare class AccountAddress extends Serializable implements TransactionArgument
|
|
|
2238
2690
|
* Learn more about the different address formats by reading AIP-40:
|
|
2239
2691
|
* https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.
|
|
2240
2692
|
*
|
|
2241
|
-
* @param input A hex string representing an account address.
|
|
2693
|
+
* @param input - A hex string representing an account address.
|
|
2242
2694
|
*
|
|
2243
2695
|
* @returns An instance of AccountAddress.
|
|
2696
|
+
*
|
|
2697
|
+
* @throws ParsingError if the hex string is too short, too long, or contains invalid characters.
|
|
2244
2698
|
*/
|
|
2245
2699
|
static fromString(input: string): AccountAddress;
|
|
2246
2700
|
/**
|
|
2247
|
-
* Convenience method for creating an AccountAddress from
|
|
2701
|
+
* Convenience method for creating an AccountAddress from various input types.
|
|
2702
|
+
* This function accepts a string, Uint8Array, or an existing AccountAddress instance and returns the corresponding
|
|
2703
|
+
* AccountAddress.
|
|
2248
2704
|
*
|
|
2249
|
-
* This
|
|
2250
|
-
*
|
|
2705
|
+
* @param input - The input to convert into an AccountAddress. This can be a string representation of an address, a Uint8Array,
|
|
2706
|
+
* or an existing AccountAddress.
|
|
2251
2707
|
*/
|
|
2252
2708
|
static from(input: AccountAddressInput): AccountAddress;
|
|
2253
2709
|
/**
|
|
2254
|
-
*
|
|
2710
|
+
* Create an AccountAddress from various input types, including strings, Uint8Array, and AccountAddress instances.
|
|
2255
2711
|
*
|
|
2256
|
-
*
|
|
2257
|
-
* @param input
|
|
2712
|
+
* @param input - The input to convert into an AccountAddress, which can be a string, a Uint8Array, or an AccountAddress.
|
|
2258
2713
|
*/
|
|
2259
2714
|
static fromStrict(input: AccountAddressInput): AccountAddress;
|
|
2260
2715
|
/**
|
|
2261
|
-
* Check if the
|
|
2716
|
+
* Check if the provided input is a valid AccountAddress.
|
|
2262
2717
|
*
|
|
2263
|
-
* @param args
|
|
2264
|
-
* @param args.
|
|
2718
|
+
* @param args - The arguments for validation.
|
|
2719
|
+
* @param args.input - A hex string representing an account address.
|
|
2720
|
+
* @param args.strict - If true, use strict parsing behavior; if false, use relaxed parsing behavior.
|
|
2265
2721
|
*
|
|
2266
|
-
* @returns
|
|
2267
|
-
* is
|
|
2722
|
+
* @returns An object indicating whether the address is valid. If valid, valid = true; if not, valid = false with additional details.
|
|
2723
|
+
* If the address is invalid, invalidReason will explain why it is invalid, and invalidReasonMessage will provide the error message.
|
|
2268
2724
|
*/
|
|
2269
2725
|
static isValid(args: {
|
|
2270
2726
|
input: AccountAddressInput;
|
|
2271
2727
|
strict?: boolean;
|
|
2272
2728
|
}): ParsingResult<AddressInvalidReason>;
|
|
2273
2729
|
/**
|
|
2274
|
-
*
|
|
2275
|
-
* if their underlying byte data is identical.
|
|
2730
|
+
* Determine if two AccountAddresses are equal based on their underlying byte data.
|
|
2276
2731
|
*
|
|
2277
|
-
* @param other The AccountAddress to compare to.
|
|
2732
|
+
* @param other - The AccountAddress to compare to.
|
|
2278
2733
|
* @returns true if the AccountAddresses are equal, false if not.
|
|
2279
2734
|
*/
|
|
2280
2735
|
equals(other: AccountAddress): boolean;
|