@aptos-labs/ts-sdk 1.31.0 → 1.32.1
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 +1 -1
- package/dist/common/{accountAddress-DnSqjhSl.d.ts → accountAddress-6RqI8Aam.d.ts} +144 -63
- package/dist/common/chunk-F43XVDYJ.js +2 -0
- package/dist/common/chunk-F43XVDYJ.js.map +1 -0
- package/dist/common/cli/index.d.ts +1 -1
- package/dist/common/cli/index.js +1 -1
- package/dist/common/cli/index.js.map +1 -1
- package/dist/common/index.d.ts +446 -111
- package/dist/common/index.js +36 -29
- package/dist/common/index.js.map +1 -1
- package/dist/esm/{Ed25519Account-DpH9qAcg.d.mts → Ed25519Account-B3xHXAQe.d.mts} +2 -2
- package/dist/esm/account/AbstractKeylessAccount.d.mts +85 -14
- package/dist/esm/account/AbstractKeylessAccount.mjs +1 -1
- package/dist/esm/account/Account.d.mts +4 -4
- package/dist/esm/account/Account.mjs +1 -1
- package/dist/esm/account/Ed25519Account.d.mts +4 -4
- package/dist/esm/account/Ed25519Account.mjs +1 -1
- package/dist/esm/account/EphemeralKeyPair.d.mts +3 -3
- package/dist/esm/account/EphemeralKeyPair.mjs +1 -1
- package/dist/esm/account/FederatedKeylessAccount.d.mts +56 -8
- package/dist/esm/account/FederatedKeylessAccount.mjs +1 -1
- package/dist/esm/account/KeylessAccount.d.mts +28 -11
- package/dist/esm/account/KeylessAccount.mjs +1 -1
- package/dist/esm/account/MultiKeyAccount.d.mts +22 -10
- package/dist/esm/account/MultiKeyAccount.mjs +1 -1
- package/dist/esm/account/SingleKeyAccount.d.mts +4 -4
- package/dist/esm/account/SingleKeyAccount.mjs +1 -1
- package/dist/esm/account/index.d.mts +5 -5
- package/dist/esm/account/index.mjs +1 -1
- package/dist/esm/api/account.d.mts +5 -5
- package/dist/esm/api/account.mjs +1 -1
- package/dist/esm/api/ans.d.mts +3 -3
- package/dist/esm/api/ans.mjs +1 -1
- package/dist/esm/api/aptos.d.mts +4 -4
- package/dist/esm/api/aptos.mjs +1 -1
- package/dist/esm/api/aptosConfig.d.mts +1 -1
- package/dist/esm/api/aptosConfig.mjs +1 -1
- package/dist/esm/api/coin.d.mts +5 -5
- package/dist/esm/api/coin.mjs +1 -1
- package/dist/esm/api/digitalAsset.d.mts +5 -5
- package/dist/esm/api/digitalAsset.mjs +1 -1
- package/dist/esm/api/event.d.mts +3 -3
- package/dist/esm/api/event.mjs +1 -1
- package/dist/esm/api/faucet.d.mts +2 -2
- package/dist/esm/api/faucet.mjs +1 -1
- package/dist/esm/api/fungibleAsset.d.mts +5 -5
- package/dist/esm/api/fungibleAsset.mjs +1 -1
- package/dist/esm/api/general.d.mts +3 -3
- package/dist/esm/api/general.mjs +1 -1
- package/dist/esm/api/index.d.mts +4 -4
- package/dist/esm/api/index.mjs +1 -1
- package/dist/esm/api/keyless.d.mts +7 -7
- package/dist/esm/api/keyless.mjs +1 -1
- package/dist/esm/api/object.d.mts +3 -3
- package/dist/esm/api/object.mjs +1 -1
- package/dist/esm/api/staking.d.mts +3 -3
- package/dist/esm/api/staking.mjs +1 -1
- package/dist/esm/api/table.d.mts +3 -3
- package/dist/esm/api/table.mjs +1 -1
- package/dist/esm/api/transaction.d.mts +3 -3
- package/dist/esm/api/transaction.mjs +1 -1
- package/dist/esm/api/transactionSubmission/build.d.mts +3 -3
- package/dist/esm/api/transactionSubmission/build.mjs +1 -1
- package/dist/esm/api/transactionSubmission/management.d.mts +4 -4
- package/dist/esm/api/transactionSubmission/management.mjs +1 -1
- package/dist/esm/api/transactionSubmission/sign.d.mts +4 -4
- 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 +3 -3
- package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
- package/dist/esm/api/transactionSubmission/submit.d.mts +3 -3
- package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
- package/dist/esm/api/utils.d.mts +2 -2
- package/dist/esm/api/utils.mjs +1 -1
- package/dist/esm/bcs/consts.d.mts +2 -2
- package/dist/esm/bcs/deserializer.d.mts +35 -27
- package/dist/esm/bcs/deserializer.mjs +1 -1
- package/dist/esm/bcs/index.d.mts +2 -2
- package/dist/esm/bcs/index.mjs +1 -1
- package/dist/esm/bcs/serializable/entryFunctionBytes.d.mts +2 -2
- package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -1
- package/dist/esm/bcs/serializable/fixedBytes.d.mts +2 -2
- package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -1
- package/dist/esm/bcs/serializable/movePrimitives.d.mts +2 -2
- package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
- package/dist/esm/bcs/serializable/moveStructs.d.mts +11 -12
- package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
- package/dist/esm/bcs/serializer.d.mts +13 -13
- package/dist/esm/bcs/serializer.mjs +1 -1
- package/dist/esm/{chunk-22ZSW5EN.mjs → chunk-26WX3UFP.mjs} +2 -2
- package/dist/esm/{chunk-A2AEFKXS.mjs → chunk-2E3BT4YW.mjs} +2 -2
- package/dist/esm/{chunk-VYMRIKUV.mjs → chunk-2LQ4FTSR.mjs} +2 -2
- package/dist/esm/{chunk-L5J3V3HW.mjs → chunk-2REHS35S.mjs} +2 -2
- package/dist/esm/{chunk-CC7VOPYH.mjs → chunk-2YTHKFJZ.mjs} +2 -2
- package/dist/esm/{chunk-6FLHGOKP.mjs → chunk-42H7WETG.mjs} +2 -2
- package/dist/esm/{chunk-RBJNSUSU.mjs → chunk-4IQZOAN7.mjs} +2 -2
- package/dist/esm/{chunk-ZPQUCT22.mjs → chunk-4J2JYRV3.mjs} +2 -2
- package/dist/esm/chunk-4O5XDQDO.mjs +2 -0
- package/dist/esm/chunk-5B3SMBXQ.mjs +2 -0
- package/dist/esm/{chunk-5N6KJ7KS.mjs → chunk-5KCKWL2C.mjs} +2 -2
- package/dist/esm/{chunk-IFXUWUP2.mjs → chunk-5O3RHPER.mjs} +2 -2
- package/dist/esm/{chunk-PCLU4KLY.mjs → chunk-6ZOVTYLJ.mjs} +2 -2
- package/dist/esm/chunk-7ECCT6PK.mjs +1 -0
- package/dist/esm/{chunk-RAJTNQNL.mjs → chunk-7OHMMGS6.mjs} +2 -2
- package/dist/esm/{chunk-ZPIMARUG.mjs → chunk-A3USS2NC.mjs} +2 -2
- package/dist/esm/{chunk-NODYW7DM.mjs → chunk-ACVIE7IE.mjs} +2 -2
- package/dist/esm/{chunk-RNRNGJDA.mjs → chunk-AGEJNSEX.mjs} +2 -2
- package/dist/esm/{chunk-QQIVWB6G.mjs → chunk-AJ5JHBAE.mjs} +2 -2
- package/dist/esm/{chunk-QQIVWB6G.mjs.map → chunk-AJ5JHBAE.mjs.map} +1 -1
- package/dist/esm/{chunk-PRZ7AIGA.mjs → chunk-AKIO3OIT.mjs} +2 -2
- package/dist/esm/{chunk-KRVLR3L4.mjs → chunk-AOROYJ74.mjs} +2 -2
- package/dist/esm/chunk-AVZYJAXR.mjs +2 -0
- package/dist/esm/chunk-AVZYJAXR.mjs.map +1 -0
- package/dist/esm/{chunk-BG2TZI3H.mjs → chunk-BP45UJII.mjs} +2 -2
- package/dist/esm/{chunk-JGNMNCQB.mjs → chunk-BRV3RLKW.mjs} +2 -2
- package/dist/esm/{chunk-EE7GDBA5.mjs → chunk-CEW2NI3K.mjs} +2 -2
- package/dist/esm/{chunk-RNJHULIT.mjs → chunk-CPKG25HX.mjs} +2 -2
- package/dist/esm/chunk-CPKG25HX.mjs.map +1 -0
- package/dist/esm/chunk-D52UKPQF.mjs +2 -0
- package/dist/esm/chunk-D52UKPQF.mjs.map +1 -0
- package/dist/esm/{chunk-4LKLOUMG.mjs → chunk-D54FD6XE.mjs} +2 -2
- package/dist/esm/{chunk-MK2QAHXC.mjs → chunk-DYELAVMR.mjs} +2 -2
- package/dist/esm/{chunk-MSHZ4FWB.mjs → chunk-E2GPZCQI.mjs} +2 -2
- package/dist/esm/{chunk-MSHZ4FWB.mjs.map → chunk-E2GPZCQI.mjs.map} +1 -1
- package/dist/esm/chunk-EJKX6MGV.mjs +2 -0
- package/dist/esm/{chunk-WV2VJQDS.mjs.map → chunk-EJKX6MGV.mjs.map} +1 -1
- package/dist/esm/{chunk-OXM4BVAY.mjs → chunk-ERDYU5YQ.mjs} +2 -2
- package/dist/esm/{chunk-7JK7UG4E.mjs → chunk-ETF76XA3.mjs} +2 -2
- package/dist/esm/chunk-F45G3GP3.mjs +7 -0
- package/dist/esm/chunk-F45G3GP3.mjs.map +1 -0
- package/dist/esm/chunk-FD6FGKYY.mjs +1 -0
- package/dist/esm/{chunk-LDZPO76C.mjs → chunk-FFCCBAEZ.mjs} +2 -2
- package/dist/esm/chunk-FYYTCJS4.mjs +2 -0
- package/dist/esm/chunk-FYYTCJS4.mjs.map +1 -0
- package/dist/esm/{chunk-OAEDFM7T.mjs → chunk-GX4CYRK4.mjs} +2 -2
- package/dist/esm/{chunk-UCRROMZN.mjs → chunk-GZBVXXUL.mjs} +2 -2
- package/dist/esm/{chunk-AT2ZGTXQ.mjs → chunk-H7AALSJ7.mjs} +2 -2
- package/dist/esm/{chunk-EUGLLGYW.mjs → chunk-HBWIDPNN.mjs} +2 -2
- package/dist/esm/{chunk-BVVHGSWC.mjs → chunk-HPZQGMSH.mjs} +2 -2
- package/dist/esm/{chunk-T5BCTWGK.mjs → chunk-I5GENJBA.mjs} +2 -2
- package/dist/esm/chunk-I5GENJBA.mjs.map +1 -0
- package/dist/esm/{chunk-73GCGRFW.mjs → chunk-II26BNYA.mjs} +2 -2
- package/dist/esm/{chunk-BOWPP6YG.mjs → chunk-IQ4SCMB6.mjs} +2 -2
- package/dist/esm/chunk-IUSAYAEI.mjs +4 -0
- package/dist/esm/{chunk-HM5HITUC.mjs.map → chunk-IUSAYAEI.mjs.map} +1 -1
- package/dist/esm/{chunk-J245N3XF.mjs → chunk-J7PJSK3J.mjs} +2 -2
- package/dist/esm/{chunk-J245N3XF.mjs.map → chunk-J7PJSK3J.mjs.map} +1 -1
- package/dist/esm/{chunk-CL6EEMSL.mjs → chunk-JGLEKXFP.mjs} +2 -2
- package/dist/esm/{chunk-SOLWFAUY.mjs → chunk-JIT2FYGE.mjs} +2 -2
- package/dist/esm/chunk-JIT2FYGE.mjs.map +1 -0
- package/dist/esm/chunk-JNO7KPMG.mjs +4 -0
- package/dist/esm/chunk-JNO7KPMG.mjs.map +1 -0
- package/dist/esm/{chunk-AZ6LVQEG.mjs → chunk-JONEH52T.mjs} +2 -2
- package/dist/esm/chunk-K62JTXWQ.mjs +2 -0
- package/dist/esm/chunk-K62JTXWQ.mjs.map +1 -0
- package/dist/esm/{chunk-IAVI3H4V.mjs → chunk-KCEI5JYS.mjs} +2 -2
- package/dist/esm/{chunk-XFY4O2S3.mjs → chunk-KM6IOJ6Y.mjs} +2 -2
- package/dist/esm/{chunk-DMSHPWA5.mjs → chunk-KTM6KVUJ.mjs} +2 -2
- package/dist/esm/chunk-KX43GEAB.mjs +2 -0
- package/dist/esm/chunk-KX43GEAB.mjs.map +1 -0
- package/dist/esm/{chunk-KYJU5PWF.mjs → chunk-L25CRR2W.mjs} +2 -2
- package/dist/esm/{chunk-2652SPOM.mjs → chunk-LGHPJTF3.mjs} +2 -2
- package/dist/esm/chunk-LGHPJTF3.mjs.map +1 -0
- package/dist/esm/{chunk-AGBA3Y7A.mjs → chunk-LGTOOAQI.mjs} +2 -2
- package/dist/esm/chunk-LHBMBCFC.mjs +2 -0
- package/dist/esm/chunk-LHBMBCFC.mjs.map +1 -0
- package/dist/esm/{chunk-F2RY4YQ7.mjs → chunk-LYO22HMF.mjs} +2 -2
- package/dist/esm/{chunk-KW4FVBDD.mjs → chunk-MBEWPBGN.mjs} +2 -2
- package/dist/esm/chunk-MHN6XY4Z.mjs +2 -0
- package/dist/esm/{chunk-JVTDP4KV.mjs → chunk-ML7D2CVG.mjs} +2 -2
- package/dist/esm/chunk-NF7ZQQE3.mjs +2 -0
- package/dist/esm/chunk-NF7ZQQE3.mjs.map +1 -0
- package/dist/esm/{chunk-XQ7ONNII.mjs → chunk-O4MRRWRI.mjs} +2 -2
- package/dist/esm/{chunk-PHP47DI4.mjs → chunk-OIOGOW6I.mjs} +1 -1
- package/dist/esm/{chunk-PHP47DI4.mjs.map → chunk-OIOGOW6I.mjs.map} +1 -1
- package/dist/esm/{chunk-ZINOJTLU.mjs → chunk-OPO5EYF7.mjs} +2 -2
- package/dist/esm/{chunk-6DMDYBV6.mjs → chunk-OVI7L7OG.mjs} +2 -2
- package/dist/esm/{chunk-TPJLAYW6.mjs → chunk-P2FTRAK3.mjs} +2 -2
- package/dist/esm/{chunk-IECDO22V.mjs → chunk-Q3CWUEXI.mjs} +2 -2
- package/dist/esm/chunk-Q3CWUEXI.mjs.map +1 -0
- package/dist/esm/{chunk-4JXB6V5O.mjs → chunk-RC43EXC4.mjs} +2 -2
- package/dist/esm/{chunk-WZCKSN2U.mjs → chunk-RLH25IDA.mjs} +2 -2
- package/dist/esm/{chunk-UGL2GPGK.mjs → chunk-RSO5YIDW.mjs} +2 -2
- package/dist/esm/chunk-RZGTHCJY.mjs +2 -0
- package/dist/esm/{chunk-2CGJLPHP.mjs.map → chunk-RZGTHCJY.mjs.map} +1 -1
- package/dist/esm/chunk-SPRNSFUV.mjs +2 -0
- package/dist/esm/chunk-SPRNSFUV.mjs.map +1 -0
- package/dist/esm/{chunk-2GEIHUHT.mjs → chunk-SPX2YFZN.mjs} +2 -2
- package/dist/esm/chunk-SPX2YFZN.mjs.map +1 -0
- package/dist/esm/chunk-SY4HK6CC.mjs +2 -0
- package/dist/esm/chunk-SY4HK6CC.mjs.map +1 -0
- package/dist/esm/{chunk-OTY3NO7Q.mjs → chunk-T6ADNZE5.mjs} +2 -2
- package/dist/esm/{chunk-3H5DGQKX.mjs → chunk-TGW36YOD.mjs} +2 -2
- package/dist/esm/{chunk-WSZCPSV4.mjs → chunk-TQA6HY6A.mjs} +2 -2
- package/dist/esm/{chunk-XFJD6QIP.mjs → chunk-U3GE6IPF.mjs} +2 -2
- package/dist/esm/chunk-UGTIALNW.mjs +2 -0
- package/dist/esm/{chunk-JNRMHDRA.mjs → chunk-UKVH4UGL.mjs} +2 -2
- package/dist/esm/chunk-UWLW2VLZ.mjs +2 -0
- package/dist/esm/chunk-UWLW2VLZ.mjs.map +1 -0
- package/dist/esm/chunk-UZTJWOLS.mjs +2 -0
- package/dist/esm/chunk-V4FKFCBL.mjs +2 -0
- package/dist/esm/chunk-V4FKFCBL.mjs.map +1 -0
- package/dist/esm/{chunk-4ZK3JNQT.mjs → chunk-VGITSRT6.mjs} +2 -2
- package/dist/esm/chunk-VGJIATTB.mjs +2 -0
- package/dist/esm/chunk-VGJIATTB.mjs.map +1 -0
- package/dist/esm/{chunk-XOCRDV2V.mjs → chunk-VQZMI3EZ.mjs} +2 -2
- package/dist/esm/chunk-WQF3IOXC.mjs +2 -0
- package/dist/esm/chunk-WQF3IOXC.mjs.map +1 -0
- package/dist/esm/chunk-WYOFF5DJ.mjs +2 -0
- package/dist/esm/chunk-WYOFF5DJ.mjs.map +1 -0
- package/dist/esm/{chunk-YZ5BCOGI.mjs → chunk-X7JNNNMC.mjs} +2 -2
- package/dist/esm/{chunk-JN36BNWA.mjs → chunk-XIB6LX22.mjs} +2 -2
- package/dist/esm/chunk-YIQ3JFHW.mjs +2 -0
- package/dist/esm/chunk-YIQ3JFHW.mjs.map +1 -0
- package/dist/esm/chunk-YP3VO6GM.mjs +2 -0
- package/dist/esm/chunk-YP3VO6GM.mjs.map +1 -0
- package/dist/esm/{chunk-OZN3OOJV.mjs → chunk-ZMBXHMVQ.mjs} +2 -2
- package/dist/esm/cli/index.d.mts +2 -2
- package/dist/esm/cli/index.mjs +1 -1
- package/dist/esm/cli/localNode.mjs +1 -1
- package/dist/esm/cli/move.d.mts +1 -1
- package/dist/esm/client/core.d.mts +1 -2
- package/dist/esm/client/core.mjs +1 -1
- package/dist/esm/client/get.d.mts +1 -2
- package/dist/esm/client/get.mjs +1 -1
- package/dist/esm/client/index.d.mts +2 -3
- package/dist/esm/client/index.mjs +1 -1
- package/dist/esm/client/post.d.mts +1 -2
- package/dist/esm/client/post.mjs +1 -1
- package/dist/esm/core/account/index.d.mts +2 -2
- package/dist/esm/core/account/index.mjs +1 -1
- package/dist/esm/core/account/utils/address.d.mts +2 -2
- package/dist/esm/core/account/utils/address.mjs +1 -1
- package/dist/esm/core/account/utils/index.d.mts +2 -2
- package/dist/esm/core/account/utils/index.mjs +1 -1
- package/dist/esm/core/accountAddress.d.mts +19 -10
- package/dist/esm/core/accountAddress.mjs +1 -1
- package/dist/esm/core/authenticationKey.d.mts +3 -3
- package/dist/esm/core/authenticationKey.mjs +1 -1
- package/dist/esm/core/crypto/ed25519.d.mts +26 -12
- package/dist/esm/core/crypto/ed25519.mjs +1 -1
- package/dist/esm/core/crypto/ephemeral.d.mts +3 -3
- package/dist/esm/core/crypto/ephemeral.mjs +1 -1
- package/dist/esm/core/crypto/federatedKeyless.d.mts +4 -4
- package/dist/esm/core/crypto/federatedKeyless.mjs +1 -1
- package/dist/esm/core/crypto/hdKey.d.mts +0 -1
- package/dist/esm/core/crypto/hdKey.mjs +1 -1
- package/dist/esm/core/crypto/index.d.mts +4 -4
- package/dist/esm/core/crypto/index.mjs +1 -1
- package/dist/esm/core/crypto/keyless.d.mts +72 -11
- package/dist/esm/core/crypto/keyless.mjs +1 -1
- package/dist/esm/core/crypto/multiEd25519.d.mts +3 -3
- package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
- package/dist/esm/core/crypto/multiKey.d.mts +3 -3
- package/dist/esm/core/crypto/multiKey.mjs +1 -1
- package/dist/esm/core/crypto/privateKey.d.mts +37 -10
- package/dist/esm/core/crypto/privateKey.mjs +1 -1
- package/dist/esm/core/crypto/proof.d.mts +2 -2
- package/dist/esm/core/crypto/proof.mjs +1 -1
- package/dist/esm/core/crypto/publicKey.d.mts +3 -3
- package/dist/esm/core/crypto/publicKey.mjs +1 -1
- package/dist/esm/core/crypto/secp256k1.d.mts +23 -9
- package/dist/esm/core/crypto/secp256k1.mjs +1 -1
- package/dist/esm/core/crypto/signature.d.mts +2 -2
- package/dist/esm/core/crypto/signature.mjs +1 -1
- package/dist/esm/core/crypto/singleKey.d.mts +3 -3
- package/dist/esm/core/crypto/singleKey.mjs +1 -1
- package/dist/esm/core/crypto/utils.d.mts +2 -2
- package/dist/esm/core/crypto/utils.mjs +1 -1
- package/dist/esm/core/hex.d.mts +39 -3
- package/dist/esm/core/hex.mjs +1 -1
- package/dist/esm/core/index.d.mts +5 -5
- package/dist/esm/core/index.mjs +1 -1
- package/dist/esm/errors/index.d.mts +122 -0
- package/dist/esm/errors/index.mjs +2 -0
- package/dist/esm/index.d.mts +10 -10
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/internal/account.d.mts +4 -4
- package/dist/esm/internal/account.mjs +1 -1
- package/dist/esm/internal/ans.d.mts +4 -4
- package/dist/esm/internal/ans.mjs +1 -1
- package/dist/esm/internal/coin.d.mts +2 -2
- package/dist/esm/internal/coin.mjs +1 -1
- package/dist/esm/internal/digitalAsset.d.mts +4 -4
- package/dist/esm/internal/digitalAsset.mjs +1 -1
- package/dist/esm/internal/event.d.mts +2 -2
- package/dist/esm/internal/event.mjs +1 -1
- package/dist/esm/internal/faucet.d.mts +1 -1
- package/dist/esm/internal/faucet.mjs +1 -1
- package/dist/esm/internal/fungibleAsset.d.mts +4 -4
- package/dist/esm/internal/fungibleAsset.mjs +1 -1
- package/dist/esm/internal/general.d.mts +2 -2
- package/dist/esm/internal/general.mjs +1 -1
- package/dist/esm/internal/keyless.d.mts +9 -5
- package/dist/esm/internal/keyless.mjs +1 -1
- package/dist/esm/internal/object.d.mts +2 -2
- package/dist/esm/internal/object.mjs +1 -1
- package/dist/esm/internal/staking.d.mts +1 -1
- package/dist/esm/internal/staking.mjs +1 -1
- package/dist/esm/internal/table.d.mts +2 -2
- package/dist/esm/internal/table.mjs +1 -1
- package/dist/esm/internal/transaction.d.mts +1 -1
- package/dist/esm/internal/transaction.mjs +1 -1
- package/dist/esm/internal/transactionSubmission.d.mts +3 -3
- package/dist/esm/internal/transactionSubmission.mjs +1 -1
- package/dist/esm/internal/view.d.mts +3 -3
- package/dist/esm/internal/view.mjs +1 -1
- package/dist/esm/{publicKey-_tPa99ea.d.mts → publicKey-BVXX1nVl.d.mts} +2 -2
- package/dist/esm/transactions/authenticator/account.d.mts +3 -3
- package/dist/esm/transactions/authenticator/account.mjs +1 -1
- package/dist/esm/transactions/authenticator/index.d.mts +3 -3
- package/dist/esm/transactions/authenticator/index.mjs +1 -1
- package/dist/esm/transactions/authenticator/transaction.d.mts +9 -4
- package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
- package/dist/esm/transactions/index.d.mts +3 -3
- package/dist/esm/transactions/index.mjs +1 -1
- package/dist/esm/transactions/instances/chainId.d.mts +2 -2
- package/dist/esm/transactions/instances/chainId.mjs +1 -1
- package/dist/esm/transactions/instances/identifier.d.mts +2 -2
- package/dist/esm/transactions/instances/identifier.mjs +1 -1
- package/dist/esm/transactions/instances/index.d.mts +3 -3
- package/dist/esm/transactions/instances/index.mjs +1 -1
- package/dist/esm/transactions/instances/moduleId.d.mts +2 -2
- package/dist/esm/transactions/instances/moduleId.mjs +1 -1
- package/dist/esm/transactions/instances/multiAgentTransaction.d.mts +2 -2
- package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/rawTransaction.d.mts +2 -2
- package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/rotationProofChallenge.d.mts +3 -3
- package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
- package/dist/esm/transactions/instances/signedTransaction.d.mts +3 -3
- package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/simpleTransaction.d.mts +2 -2
- package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/transactionArgument.d.mts +2 -2
- package/dist/esm/transactions/instances/transactionPayload.d.mts +2 -2
- package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
- package/dist/esm/transactions/management/accountSequenceNumber.d.mts +4 -4
- package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
- package/dist/esm/transactions/management/index.d.mts +4 -4
- package/dist/esm/transactions/management/index.mjs +1 -1
- package/dist/esm/transactions/management/transactionWorker.d.mts +4 -4
- package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/helpers.d.mts +2 -2
- package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/index.d.mts +3 -3
- package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +3 -3
- package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/signingMessage.d.mts +3 -3
- package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +3 -3
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
- package/dist/esm/transactions/typeTag/index.d.mts +2 -2
- package/dist/esm/transactions/typeTag/index.mjs +1 -1
- package/dist/esm/transactions/typeTag/parser.d.mts +2 -2
- package/dist/esm/transactions/typeTag/parser.mjs +1 -1
- package/dist/esm/transactions/types.d.mts +2 -2
- package/dist/esm/types/index.d.mts +3 -1260
- package/dist/esm/types/index.mjs +1 -1
- package/dist/esm/types/keyless.d.mts +22 -1
- package/dist/esm/types/types.d.mts +1289 -0
- package/dist/esm/types/types.mjs +2 -0
- package/dist/esm/types/types.mjs.map +1 -0
- package/dist/esm/utils/const.d.mts +7 -1
- package/dist/esm/utils/const.mjs +1 -1
- package/dist/esm/utils/helpers.d.mts +10 -3
- package/dist/esm/utils/helpers.mjs +1 -1
- package/dist/esm/utils/index.d.mts +3 -3
- package/dist/esm/utils/index.mjs +1 -1
- package/dist/esm/utils/normalizeBundle.d.mts +2 -2
- 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 +1 -1
- package/src/account/AbstractKeylessAccount.ts +203 -10
- package/src/account/FederatedKeylessAccount.ts +83 -35
- package/src/account/KeylessAccount.ts +44 -37
- package/src/account/MultiKeyAccount.ts +18 -5
- package/src/api/keyless.ts +2 -2
- package/src/bcs/deserializer.ts +53 -30
- package/src/bcs/serializable/moveStructs.ts +16 -17
- package/src/bcs/serializer.ts +22 -12
- package/src/client/core.ts +2 -2
- package/src/client/get.ts +1 -2
- package/src/client/index.ts +0 -1
- package/src/client/post.ts +1 -2
- package/src/core/accountAddress.ts +36 -9
- package/src/core/crypto/ed25519.ts +34 -14
- package/src/core/crypto/hdKey.ts +0 -1
- package/src/core/crypto/keyless.ts +245 -38
- package/src/core/crypto/privateKey.ts +81 -5
- package/src/core/crypto/secp256k1.ts +31 -11
- package/src/core/hex.ts +47 -0
- package/src/errors/index.ts +406 -0
- package/src/index.ts +1 -0
- package/src/internal/account.ts +6 -6
- package/src/internal/ans.ts +2 -1
- package/src/internal/keyless.ts +57 -19
- package/src/internal/transaction.ts +2 -1
- package/src/internal/transactionSubmission.ts +36 -18
- package/src/transactions/authenticator/transaction.ts +20 -0
- package/src/types/index.ts +1 -1483
- package/src/types/keyless.ts +19 -0
- package/src/types/types.ts +1512 -0
- package/src/utils/const.ts +7 -0
- package/src/utils/helpers.ts +10 -0
- package/src/version.ts +1 -1
- package/dist/common/chunk-7IYTZDXV.js +0 -2
- package/dist/common/chunk-7IYTZDXV.js.map +0 -1
- package/dist/esm/chunk-2652SPOM.mjs.map +0 -1
- package/dist/esm/chunk-2CGJLPHP.mjs +0 -2
- package/dist/esm/chunk-2GEIHUHT.mjs.map +0 -1
- package/dist/esm/chunk-4CDDWSKZ.mjs +0 -2
- package/dist/esm/chunk-4OV7QU2U.mjs +0 -2
- package/dist/esm/chunk-4VU2ABLU.mjs +0 -2
- package/dist/esm/chunk-4VU2ABLU.mjs.map +0 -1
- package/dist/esm/chunk-5S3Z7MT4.mjs +0 -2
- package/dist/esm/chunk-5S3Z7MT4.mjs.map +0 -1
- package/dist/esm/chunk-5SGSPCOY.mjs +0 -2
- package/dist/esm/chunk-5SGSPCOY.mjs.map +0 -1
- package/dist/esm/chunk-7XS45O6M.mjs +0 -2
- package/dist/esm/chunk-7XS45O6M.mjs.map +0 -1
- package/dist/esm/chunk-BAGUHYFD.mjs +0 -2
- package/dist/esm/chunk-BAGUHYFD.mjs.map +0 -1
- package/dist/esm/chunk-CDQGPCHU.mjs +0 -2
- package/dist/esm/chunk-CDQGPCHU.mjs.map +0 -1
- package/dist/esm/chunk-FTZGP6XW.mjs +0 -2
- package/dist/esm/chunk-FTZGP6XW.mjs.map +0 -1
- package/dist/esm/chunk-GLATLXF6.mjs +0 -2
- package/dist/esm/chunk-GLATLXF6.mjs.map +0 -1
- package/dist/esm/chunk-GQABU3RQ.mjs +0 -2
- package/dist/esm/chunk-GQABU3RQ.mjs.map +0 -1
- package/dist/esm/chunk-HM5HITUC.mjs +0 -4
- package/dist/esm/chunk-IBLZ6MZU.mjs +0 -2
- package/dist/esm/chunk-IECDO22V.mjs.map +0 -1
- package/dist/esm/chunk-KFNDDPOW.mjs +0 -2
- package/dist/esm/chunk-KFNDDPOW.mjs.map +0 -1
- package/dist/esm/chunk-KIW54KWR.mjs +0 -2
- package/dist/esm/chunk-KM6UXNC7.mjs +0 -2
- package/dist/esm/chunk-KM6UXNC7.mjs.map +0 -1
- package/dist/esm/chunk-KUX6GQ2E.mjs +0 -1
- package/dist/esm/chunk-LEKBJ2EG.mjs +0 -2
- package/dist/esm/chunk-LEKBJ2EG.mjs.map +0 -1
- package/dist/esm/chunk-M22UGFQ5.mjs +0 -2
- package/dist/esm/chunk-M22UGFQ5.mjs.map +0 -1
- package/dist/esm/chunk-N2FKVZ4D.mjs +0 -1
- package/dist/esm/chunk-N47FTRYO.mjs +0 -2
- package/dist/esm/chunk-N47FTRYO.mjs.map +0 -1
- package/dist/esm/chunk-ONBFUPEC.mjs +0 -2
- package/dist/esm/chunk-P3J54CQG.mjs +0 -2
- package/dist/esm/chunk-P3J54CQG.mjs.map +0 -1
- package/dist/esm/chunk-RNJHULIT.mjs.map +0 -1
- package/dist/esm/chunk-SGQFWWLQ.mjs +0 -2
- package/dist/esm/chunk-SGQFWWLQ.mjs.map +0 -1
- package/dist/esm/chunk-SOLWFAUY.mjs.map +0 -1
- package/dist/esm/chunk-T5BCTWGK.mjs.map +0 -1
- package/dist/esm/chunk-WV2VJQDS.mjs +0 -2
- package/dist/esm/chunk-Y267I7DC.mjs +0 -2
- package/dist/esm/chunk-Y267I7DC.mjs.map +0 -1
- package/dist/esm/client/types.d.mts +0 -66
- package/dist/esm/client/types.mjs +0 -2
- package/src/client/types.ts +0 -138
- /package/dist/esm/{chunk-22ZSW5EN.mjs.map → chunk-26WX3UFP.mjs.map} +0 -0
- /package/dist/esm/{chunk-A2AEFKXS.mjs.map → chunk-2E3BT4YW.mjs.map} +0 -0
- /package/dist/esm/{chunk-VYMRIKUV.mjs.map → chunk-2LQ4FTSR.mjs.map} +0 -0
- /package/dist/esm/{chunk-L5J3V3HW.mjs.map → chunk-2REHS35S.mjs.map} +0 -0
- /package/dist/esm/{chunk-CC7VOPYH.mjs.map → chunk-2YTHKFJZ.mjs.map} +0 -0
- /package/dist/esm/{chunk-6FLHGOKP.mjs.map → chunk-42H7WETG.mjs.map} +0 -0
- /package/dist/esm/{chunk-RBJNSUSU.mjs.map → chunk-4IQZOAN7.mjs.map} +0 -0
- /package/dist/esm/{chunk-ZPQUCT22.mjs.map → chunk-4J2JYRV3.mjs.map} +0 -0
- /package/dist/esm/{chunk-IBLZ6MZU.mjs.map → chunk-4O5XDQDO.mjs.map} +0 -0
- /package/dist/esm/{chunk-KIW54KWR.mjs.map → chunk-5B3SMBXQ.mjs.map} +0 -0
- /package/dist/esm/{chunk-5N6KJ7KS.mjs.map → chunk-5KCKWL2C.mjs.map} +0 -0
- /package/dist/esm/{chunk-IFXUWUP2.mjs.map → chunk-5O3RHPER.mjs.map} +0 -0
- /package/dist/esm/{chunk-PCLU4KLY.mjs.map → chunk-6ZOVTYLJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-KUX6GQ2E.mjs.map → chunk-7ECCT6PK.mjs.map} +0 -0
- /package/dist/esm/{chunk-RAJTNQNL.mjs.map → chunk-7OHMMGS6.mjs.map} +0 -0
- /package/dist/esm/{chunk-ZPIMARUG.mjs.map → chunk-A3USS2NC.mjs.map} +0 -0
- /package/dist/esm/{chunk-NODYW7DM.mjs.map → chunk-ACVIE7IE.mjs.map} +0 -0
- /package/dist/esm/{chunk-RNRNGJDA.mjs.map → chunk-AGEJNSEX.mjs.map} +0 -0
- /package/dist/esm/{chunk-PRZ7AIGA.mjs.map → chunk-AKIO3OIT.mjs.map} +0 -0
- /package/dist/esm/{chunk-KRVLR3L4.mjs.map → chunk-AOROYJ74.mjs.map} +0 -0
- /package/dist/esm/{chunk-BG2TZI3H.mjs.map → chunk-BP45UJII.mjs.map} +0 -0
- /package/dist/esm/{chunk-JGNMNCQB.mjs.map → chunk-BRV3RLKW.mjs.map} +0 -0
- /package/dist/esm/{chunk-EE7GDBA5.mjs.map → chunk-CEW2NI3K.mjs.map} +0 -0
- /package/dist/esm/{chunk-4LKLOUMG.mjs.map → chunk-D54FD6XE.mjs.map} +0 -0
- /package/dist/esm/{chunk-MK2QAHXC.mjs.map → chunk-DYELAVMR.mjs.map} +0 -0
- /package/dist/esm/{chunk-OXM4BVAY.mjs.map → chunk-ERDYU5YQ.mjs.map} +0 -0
- /package/dist/esm/{chunk-7JK7UG4E.mjs.map → chunk-ETF76XA3.mjs.map} +0 -0
- /package/dist/esm/{chunk-N2FKVZ4D.mjs.map → chunk-FD6FGKYY.mjs.map} +0 -0
- /package/dist/esm/{chunk-LDZPO76C.mjs.map → chunk-FFCCBAEZ.mjs.map} +0 -0
- /package/dist/esm/{chunk-OAEDFM7T.mjs.map → chunk-GX4CYRK4.mjs.map} +0 -0
- /package/dist/esm/{chunk-UCRROMZN.mjs.map → chunk-GZBVXXUL.mjs.map} +0 -0
- /package/dist/esm/{chunk-AT2ZGTXQ.mjs.map → chunk-H7AALSJ7.mjs.map} +0 -0
- /package/dist/esm/{chunk-EUGLLGYW.mjs.map → chunk-HBWIDPNN.mjs.map} +0 -0
- /package/dist/esm/{chunk-BVVHGSWC.mjs.map → chunk-HPZQGMSH.mjs.map} +0 -0
- /package/dist/esm/{chunk-73GCGRFW.mjs.map → chunk-II26BNYA.mjs.map} +0 -0
- /package/dist/esm/{chunk-BOWPP6YG.mjs.map → chunk-IQ4SCMB6.mjs.map} +0 -0
- /package/dist/esm/{chunk-CL6EEMSL.mjs.map → chunk-JGLEKXFP.mjs.map} +0 -0
- /package/dist/esm/{chunk-AZ6LVQEG.mjs.map → chunk-JONEH52T.mjs.map} +0 -0
- /package/dist/esm/{chunk-IAVI3H4V.mjs.map → chunk-KCEI5JYS.mjs.map} +0 -0
- /package/dist/esm/{chunk-XFY4O2S3.mjs.map → chunk-KM6IOJ6Y.mjs.map} +0 -0
- /package/dist/esm/{chunk-DMSHPWA5.mjs.map → chunk-KTM6KVUJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-KYJU5PWF.mjs.map → chunk-L25CRR2W.mjs.map} +0 -0
- /package/dist/esm/{chunk-AGBA3Y7A.mjs.map → chunk-LGTOOAQI.mjs.map} +0 -0
- /package/dist/esm/{chunk-F2RY4YQ7.mjs.map → chunk-LYO22HMF.mjs.map} +0 -0
- /package/dist/esm/{chunk-KW4FVBDD.mjs.map → chunk-MBEWPBGN.mjs.map} +0 -0
- /package/dist/esm/{chunk-4OV7QU2U.mjs.map → chunk-MHN6XY4Z.mjs.map} +0 -0
- /package/dist/esm/{chunk-JVTDP4KV.mjs.map → chunk-ML7D2CVG.mjs.map} +0 -0
- /package/dist/esm/{chunk-XQ7ONNII.mjs.map → chunk-O4MRRWRI.mjs.map} +0 -0
- /package/dist/esm/{chunk-ZINOJTLU.mjs.map → chunk-OPO5EYF7.mjs.map} +0 -0
- /package/dist/esm/{chunk-6DMDYBV6.mjs.map → chunk-OVI7L7OG.mjs.map} +0 -0
- /package/dist/esm/{chunk-TPJLAYW6.mjs.map → chunk-P2FTRAK3.mjs.map} +0 -0
- /package/dist/esm/{chunk-4JXB6V5O.mjs.map → chunk-RC43EXC4.mjs.map} +0 -0
- /package/dist/esm/{chunk-WZCKSN2U.mjs.map → chunk-RLH25IDA.mjs.map} +0 -0
- /package/dist/esm/{chunk-UGL2GPGK.mjs.map → chunk-RSO5YIDW.mjs.map} +0 -0
- /package/dist/esm/{chunk-OTY3NO7Q.mjs.map → chunk-T6ADNZE5.mjs.map} +0 -0
- /package/dist/esm/{chunk-3H5DGQKX.mjs.map → chunk-TGW36YOD.mjs.map} +0 -0
- /package/dist/esm/{chunk-WSZCPSV4.mjs.map → chunk-TQA6HY6A.mjs.map} +0 -0
- /package/dist/esm/{chunk-XFJD6QIP.mjs.map → chunk-U3GE6IPF.mjs.map} +0 -0
- /package/dist/esm/{chunk-ONBFUPEC.mjs.map → chunk-UGTIALNW.mjs.map} +0 -0
- /package/dist/esm/{chunk-JNRMHDRA.mjs.map → chunk-UKVH4UGL.mjs.map} +0 -0
- /package/dist/esm/{chunk-4CDDWSKZ.mjs.map → chunk-UZTJWOLS.mjs.map} +0 -0
- /package/dist/esm/{chunk-4ZK3JNQT.mjs.map → chunk-VGITSRT6.mjs.map} +0 -0
- /package/dist/esm/{chunk-XOCRDV2V.mjs.map → chunk-VQZMI3EZ.mjs.map} +0 -0
- /package/dist/esm/{chunk-YZ5BCOGI.mjs.map → chunk-X7JNNNMC.mjs.map} +0 -0
- /package/dist/esm/{chunk-JN36BNWA.mjs.map → chunk-XIB6LX22.mjs.map} +0 -0
- /package/dist/esm/{chunk-OZN3OOJV.mjs.map → chunk-ZMBXHMVQ.mjs.map} +0 -0
- /package/dist/esm/{client/types.mjs.map → errors/index.mjs.map} +0 -0
|
@@ -0,0 +1,1512 @@
|
|
|
1
|
+
// Copyright © Aptos Foundation
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import { Network } from "../utils/apiEndpoints";
|
|
5
|
+
import { OrderBy, TokenStandard } from "./indexer";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Different MIME types used for data interchange in transactions and responses.
|
|
9
|
+
*/
|
|
10
|
+
export enum MimeType {
|
|
11
|
+
/**
|
|
12
|
+
* JSON representation, used for transaction submission and accept type JSON output
|
|
13
|
+
*/
|
|
14
|
+
JSON = "application/json",
|
|
15
|
+
/**
|
|
16
|
+
* BCS representation, used for accept type BCS output
|
|
17
|
+
*/
|
|
18
|
+
BCS = "application/x-bcs",
|
|
19
|
+
/**
|
|
20
|
+
* BCS representation, used for transaction submission in BCS input
|
|
21
|
+
*/
|
|
22
|
+
BCS_SIGNED_TRANSACTION = "application/x.aptos.signed_transaction+bcs",
|
|
23
|
+
BCS_VIEW_FUNCTION = "application/x.aptos.view_function+bcs",
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Hexadecimal data input for functions, supporting both string and Uint8Array formats.
|
|
28
|
+
*/
|
|
29
|
+
export type HexInput = string | Uint8Array;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Variants of type tags used in the system, encompassing various data types and structures.
|
|
33
|
+
* {@link https://github.com/aptos-labs/aptos-core/blob/main/third_party/move/move-core/types/src/language_storage.rs#L27}
|
|
34
|
+
*/
|
|
35
|
+
export enum TypeTagVariants {
|
|
36
|
+
Bool = 0,
|
|
37
|
+
U8 = 1,
|
|
38
|
+
U64 = 2,
|
|
39
|
+
U128 = 3,
|
|
40
|
+
Address = 4,
|
|
41
|
+
Signer = 5,
|
|
42
|
+
Vector = 6,
|
|
43
|
+
Struct = 7,
|
|
44
|
+
U16 = 8,
|
|
45
|
+
U32 = 9,
|
|
46
|
+
U256 = 10,
|
|
47
|
+
Reference = 254, // This is specifically a placeholder and does not represent a real type
|
|
48
|
+
Generic = 255, // This is specifically a placeholder and does not represent a real type
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Variants of script transaction arguments used in Rust, encompassing various data types for transaction processing.
|
|
53
|
+
* {@link https://github.com/aptos-labs/aptos-core/blob/main/third_party/move/move-core/types/src/transaction_argument.rs#L11}
|
|
54
|
+
*/
|
|
55
|
+
export enum ScriptTransactionArgumentVariants {
|
|
56
|
+
U8 = 0,
|
|
57
|
+
U64 = 1,
|
|
58
|
+
U128 = 2,
|
|
59
|
+
Address = 3,
|
|
60
|
+
U8Vector = 4,
|
|
61
|
+
Bool = 5,
|
|
62
|
+
U16 = 6,
|
|
63
|
+
U32 = 7,
|
|
64
|
+
U256 = 8,
|
|
65
|
+
Serialized = 9,
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* The payload for various transaction types in the system.
|
|
70
|
+
* {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/mod.rs#L478}
|
|
71
|
+
*/
|
|
72
|
+
export enum TransactionPayloadVariants {
|
|
73
|
+
Script = 0,
|
|
74
|
+
EntryFunction = 2,
|
|
75
|
+
Multisig = 3,
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Variants of transactions used in the system.
|
|
80
|
+
* {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/mod.rs#L440}
|
|
81
|
+
*/
|
|
82
|
+
export enum TransactionVariants {
|
|
83
|
+
MultiAgentTransaction = 0,
|
|
84
|
+
FeePayerTransaction = 1,
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Variants of transaction authenticators used in the system.
|
|
89
|
+
* {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/authenticator.rs#L44}
|
|
90
|
+
*/
|
|
91
|
+
export enum TransactionAuthenticatorVariant {
|
|
92
|
+
Ed25519 = 0,
|
|
93
|
+
MultiEd25519 = 1,
|
|
94
|
+
MultiAgent = 2,
|
|
95
|
+
FeePayer = 3,
|
|
96
|
+
SingleSender = 4,
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Variants of account authenticators used in transactions.
|
|
101
|
+
* {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/authenticator.rs#L414}
|
|
102
|
+
*/
|
|
103
|
+
export enum AccountAuthenticatorVariant {
|
|
104
|
+
Ed25519 = 0,
|
|
105
|
+
MultiEd25519 = 1,
|
|
106
|
+
SingleKey = 2,
|
|
107
|
+
MultiKey = 3,
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Variants of private keys that can comply with the AIP-80 standard.
|
|
112
|
+
* {@link https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-80.md}
|
|
113
|
+
*/
|
|
114
|
+
export enum PrivateKeyVariants {
|
|
115
|
+
Ed25519 = "ed25519",
|
|
116
|
+
Secp256k1 = "secp256k1",
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Variants of public keys used in cryptographic operations.
|
|
121
|
+
*/
|
|
122
|
+
export enum AnyPublicKeyVariant {
|
|
123
|
+
Ed25519 = 0,
|
|
124
|
+
Secp256k1 = 1,
|
|
125
|
+
Keyless = 3,
|
|
126
|
+
FederatedKeyless = 4,
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Variants of signature types used for cryptographic operations.
|
|
131
|
+
*/
|
|
132
|
+
export enum AnySignatureVariant {
|
|
133
|
+
Ed25519 = 0,
|
|
134
|
+
Secp256k1 = 1,
|
|
135
|
+
Keyless = 3,
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Variants of ephemeral public keys used in cryptographic operations.
|
|
140
|
+
*/
|
|
141
|
+
export enum EphemeralPublicKeyVariant {
|
|
142
|
+
Ed25519 = 0,
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Variants of ephemeral signatures used for secure communication.
|
|
147
|
+
*/
|
|
148
|
+
export enum EphemeralSignatureVariant {
|
|
149
|
+
Ed25519 = 0,
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Variants of ephemeral certificates used in secure transactions.
|
|
154
|
+
*/
|
|
155
|
+
export enum EphemeralCertificateVariant {
|
|
156
|
+
ZkProof = 0,
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Variants of zero-knowledge proofs used in cryptographic operations.
|
|
161
|
+
*/
|
|
162
|
+
export enum ZkpVariant {
|
|
163
|
+
Groth16 = 0,
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* BCS types
|
|
168
|
+
*/
|
|
169
|
+
export type Uint8 = number;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* A 16-bit unsigned integer.
|
|
173
|
+
*/
|
|
174
|
+
export type Uint16 = number;
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* A 32-bit unsigned integer.
|
|
178
|
+
*/
|
|
179
|
+
export type Uint32 = number;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* A 64-bit unsigned integer value.
|
|
183
|
+
*/
|
|
184
|
+
export type Uint64 = bigint;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* A 128-bit unsigned integer used for precise arithmetic operations.
|
|
188
|
+
*/
|
|
189
|
+
export type Uint128 = bigint;
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* A 256-bit unsigned integer used for precise numerical calculations.
|
|
193
|
+
*/
|
|
194
|
+
export type Uint256 = bigint;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* A number or a bigint value.
|
|
198
|
+
*/
|
|
199
|
+
export type AnyNumber = number | bigint;
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Configuration options for initializing the SDK, allowing customization of its behavior and interaction with the Aptos network.
|
|
203
|
+
*/
|
|
204
|
+
export type AptosSettings = {
|
|
205
|
+
readonly network?: Network;
|
|
206
|
+
|
|
207
|
+
readonly fullnode?: string;
|
|
208
|
+
|
|
209
|
+
readonly faucet?: string;
|
|
210
|
+
|
|
211
|
+
readonly indexer?: string;
|
|
212
|
+
|
|
213
|
+
readonly pepper?: string;
|
|
214
|
+
|
|
215
|
+
readonly prover?: string;
|
|
216
|
+
|
|
217
|
+
readonly clientConfig?: ClientConfig;
|
|
218
|
+
|
|
219
|
+
readonly client?: Client;
|
|
220
|
+
|
|
221
|
+
readonly fullnodeConfig?: FullNodeConfig;
|
|
222
|
+
|
|
223
|
+
readonly indexerConfig?: IndexerConfig;
|
|
224
|
+
|
|
225
|
+
readonly faucetConfig?: FaucetConfig;
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Defines the parameters for paginating query results, including the starting position and maximum number of items to return.
|
|
230
|
+
* @param offset Specifies the starting position of the query result. Default is 0.
|
|
231
|
+
* @param limit Specifies the maximum number of items to return. Default is 25.
|
|
232
|
+
*/
|
|
233
|
+
export interface PaginationArgs {
|
|
234
|
+
offset?: AnyNumber;
|
|
235
|
+
limit?: number;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Represents the arguments for specifying a token standard.
|
|
240
|
+
*
|
|
241
|
+
* @param tokenStandard - Optional standard of the token.
|
|
242
|
+
*/
|
|
243
|
+
export interface TokenStandardArg {
|
|
244
|
+
tokenStandard?: TokenStandard;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
export interface OrderByArg<T extends {}> {
|
|
248
|
+
orderBy?: OrderBy<T>;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
export interface WhereArg<T extends {}> {
|
|
252
|
+
where?: T;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* QUERY TYPES
|
|
257
|
+
*/
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* A configuration object for requests to the server, including API key, extra headers, and cookie handling options.
|
|
261
|
+
*/
|
|
262
|
+
export type ClientConfig = ClientHeadersType & {
|
|
263
|
+
WITH_CREDENTIALS?: boolean;
|
|
264
|
+
API_KEY?: string;
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* A configuration object for a Fullnode, allowing for the inclusion of extra headers in requests.
|
|
269
|
+
*/
|
|
270
|
+
export type FullNodeConfig = ClientHeadersType;
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* An Indexer configuration object for sending requests with additional headers.
|
|
274
|
+
*/
|
|
275
|
+
export type IndexerConfig = ClientHeadersType;
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* A configuration object for a faucet, including optional authentication and headers for requests.
|
|
279
|
+
*/
|
|
280
|
+
export type FaucetConfig = ClientHeadersType & {
|
|
281
|
+
AUTH_TOKEN?: string;
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* General type definition for client headers.
|
|
286
|
+
*/
|
|
287
|
+
export type ClientHeadersType = {
|
|
288
|
+
HEADERS?: Record<string, string | number | boolean>;
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* Represents a client for making requests to a service provider.
|
|
293
|
+
*
|
|
294
|
+
* @param Req - The type of the request payload.
|
|
295
|
+
* @param Res - The type of the response payload.
|
|
296
|
+
*/
|
|
297
|
+
export interface ClientRequest<Req> {
|
|
298
|
+
url: string;
|
|
299
|
+
method: "GET" | "POST";
|
|
300
|
+
originMethod?: string;
|
|
301
|
+
body?: Req;
|
|
302
|
+
contentType?: string;
|
|
303
|
+
params?: any;
|
|
304
|
+
overrides?: ClientConfig & FullNodeConfig & IndexerConfig & FaucetConfig;
|
|
305
|
+
headers?: Record<string, any>;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
export interface ClientResponse<Res> {
|
|
309
|
+
status: number;
|
|
310
|
+
statusText: string;
|
|
311
|
+
data: Res;
|
|
312
|
+
config?: any;
|
|
313
|
+
request?: any;
|
|
314
|
+
response?: any;
|
|
315
|
+
headers?: any;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
export interface Client {
|
|
319
|
+
/**
|
|
320
|
+
* Sends a request to the specified URL with the given options.
|
|
321
|
+
*
|
|
322
|
+
* @param requestOptions - The options for the request.
|
|
323
|
+
* @param requestOptions.url - The URL to send the request to.
|
|
324
|
+
* @param requestOptions.method - The HTTP method to use, either "GET" or "POST".
|
|
325
|
+
* @param requestOptions.path - An optional path to append to the URL.
|
|
326
|
+
* @param requestOptions.body - The body of the request, applicable for POST requests.
|
|
327
|
+
* @param requestOptions.contentType - The content type of the request body.
|
|
328
|
+
* @param requestOptions.acceptType - The expected content type of the response.
|
|
329
|
+
* @param requestOptions.params - Optional parameters to include in the request.
|
|
330
|
+
* @param requestOptions.originMethod - An optional method to specify the origin of the request.
|
|
331
|
+
* @param requestOptions.overrides - Optional configuration overrides for the request.
|
|
332
|
+
*/
|
|
333
|
+
provider<Req, Res>(requestOptions: ClientRequest<Req>): Promise<ClientResponse<Res>>;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* The API request type
|
|
338
|
+
*
|
|
339
|
+
* @param url - the url to make the request to, i.e. https://fullnode.devnet.aptoslabs.com/v1
|
|
340
|
+
* @param method - the request method "GET" | "POST"
|
|
341
|
+
* @param endpoint (optional) - the endpoint to make the request to, i.e. transactions
|
|
342
|
+
* @param body (optional) - the body of the request
|
|
343
|
+
* @param contentType (optional) - the content type to set the `content-type` header to,
|
|
344
|
+
* by default is set to `application/json`
|
|
345
|
+
* @param params (optional) - query params to add to the request
|
|
346
|
+
* @param originMethod (optional) - the local method the request came from
|
|
347
|
+
* @param overrides (optional) - a `ClientConfig` object type to override request data
|
|
348
|
+
*/
|
|
349
|
+
export type AptosRequest = {
|
|
350
|
+
url: string;
|
|
351
|
+
method: "GET" | "POST";
|
|
352
|
+
path?: string;
|
|
353
|
+
body?: any;
|
|
354
|
+
contentType?: string;
|
|
355
|
+
acceptType?: string;
|
|
356
|
+
params?: Record<string, string | AnyNumber | boolean | undefined>;
|
|
357
|
+
originMethod?: string;
|
|
358
|
+
overrides?: ClientConfig & FullNodeConfig & IndexerConfig & FaucetConfig;
|
|
359
|
+
};
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* The API response type
|
|
363
|
+
*
|
|
364
|
+
* @param status - the response status. i.e. 200
|
|
365
|
+
* @param statusText - the response message
|
|
366
|
+
* @param data the response data
|
|
367
|
+
* @param url the url the request was made to
|
|
368
|
+
* @param headers the response headers
|
|
369
|
+
* @param config (optional) - the request object
|
|
370
|
+
* @param request (optional) - the request object
|
|
371
|
+
*/
|
|
372
|
+
export interface AptosResponse<Req, Res> {
|
|
373
|
+
status: number;
|
|
374
|
+
statusText: string;
|
|
375
|
+
data: Res;
|
|
376
|
+
url: string;
|
|
377
|
+
headers: any;
|
|
378
|
+
config?: any;
|
|
379
|
+
request?: Req;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* The ledger version of transactions, defaulting to the latest version if not specified.
|
|
384
|
+
*/
|
|
385
|
+
export type LedgerVersionArg = {
|
|
386
|
+
ledgerVersion?: AnyNumber;
|
|
387
|
+
};
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* RESPONSE TYPES
|
|
391
|
+
*/
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* The output of the estimate gas API, including the deprioritized estimate for the gas unit price.
|
|
395
|
+
*/
|
|
396
|
+
export type GasEstimation = {
|
|
397
|
+
/**
|
|
398
|
+
* The deprioritized estimate for the gas unit price
|
|
399
|
+
*/
|
|
400
|
+
deprioritized_gas_estimate?: number;
|
|
401
|
+
/**
|
|
402
|
+
* The current estimate for the gas unit price
|
|
403
|
+
*/
|
|
404
|
+
gas_estimate: number;
|
|
405
|
+
/**
|
|
406
|
+
* The prioritized estimate for the gas unit price
|
|
407
|
+
*/
|
|
408
|
+
prioritized_gas_estimate?: number;
|
|
409
|
+
};
|
|
410
|
+
|
|
411
|
+
export type MoveResource<T = {}> = {
|
|
412
|
+
type: MoveStructId;
|
|
413
|
+
data: T;
|
|
414
|
+
};
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* The data associated with an account, including its sequence number.
|
|
418
|
+
*/
|
|
419
|
+
export type AccountData = {
|
|
420
|
+
sequence_number: string;
|
|
421
|
+
authentication_key: string;
|
|
422
|
+
};
|
|
423
|
+
|
|
424
|
+
/**
|
|
425
|
+
* A Move module containing an address.
|
|
426
|
+
*/
|
|
427
|
+
export type MoveModuleBytecode = {
|
|
428
|
+
bytecode: string;
|
|
429
|
+
abi?: MoveModule;
|
|
430
|
+
};
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* TRANSACTION TYPES
|
|
434
|
+
*/
|
|
435
|
+
|
|
436
|
+
/**
|
|
437
|
+
* Different types of transaction responses that can occur in the system.
|
|
438
|
+
*/
|
|
439
|
+
export enum TransactionResponseType {
|
|
440
|
+
Pending = "pending_transaction",
|
|
441
|
+
User = "user_transaction",
|
|
442
|
+
Genesis = "genesis_transaction",
|
|
443
|
+
BlockMetadata = "block_metadata_transaction",
|
|
444
|
+
StateCheckpoint = "state_checkpoint_transaction",
|
|
445
|
+
Validator = "validator_transaction",
|
|
446
|
+
BlockEpilogue = "block_epilogue_transaction",
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
/**
|
|
450
|
+
* The response for a transaction, which can be either pending or committed.
|
|
451
|
+
*/
|
|
452
|
+
export type TransactionResponse = PendingTransactionResponse | CommittedTransactionResponse;
|
|
453
|
+
|
|
454
|
+
/**
|
|
455
|
+
* The response for a committed transaction, which can be one of several transaction types.
|
|
456
|
+
*/
|
|
457
|
+
export type CommittedTransactionResponse =
|
|
458
|
+
| UserTransactionResponse
|
|
459
|
+
| GenesisTransactionResponse
|
|
460
|
+
| BlockMetadataTransactionResponse
|
|
461
|
+
| StateCheckpointTransactionResponse
|
|
462
|
+
| ValidatorTransactionResponse
|
|
463
|
+
| BlockEpilogueTransactionResponse;
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* Determine if the given transaction response is currently pending.
|
|
467
|
+
*
|
|
468
|
+
* @param response - The transaction response to evaluate.
|
|
469
|
+
* @returns A boolean indicating whether the transaction is pending.
|
|
470
|
+
*/
|
|
471
|
+
export function isPendingTransactionResponse(response: TransactionResponse): response is PendingTransactionResponse {
|
|
472
|
+
return response.type === TransactionResponseType.Pending;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
/**
|
|
476
|
+
* Determines if the given transaction response is a user transaction.
|
|
477
|
+
*
|
|
478
|
+
* @param response - The transaction response to evaluate.
|
|
479
|
+
* @returns A boolean indicating whether the transaction is of type User.
|
|
480
|
+
*/
|
|
481
|
+
export function isUserTransactionResponse(response: TransactionResponse): response is UserTransactionResponse {
|
|
482
|
+
return response.type === TransactionResponseType.User;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
/**
|
|
486
|
+
* Determines if the given transaction response is a Genesis transaction.
|
|
487
|
+
*
|
|
488
|
+
* @param response - The transaction response to evaluate.
|
|
489
|
+
* @returns A boolean indicating whether the transaction is a Genesis transaction.
|
|
490
|
+
*/
|
|
491
|
+
export function isGenesisTransactionResponse(response: TransactionResponse): response is GenesisTransactionResponse {
|
|
492
|
+
return response.type === TransactionResponseType.Genesis;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
/**
|
|
496
|
+
* Determine if the given transaction response is of type BlockMetadata.
|
|
497
|
+
*
|
|
498
|
+
* @param response - The transaction response to evaluate.
|
|
499
|
+
* @returns A boolean indicating whether the response is a BlockMetadata transaction.
|
|
500
|
+
*/
|
|
501
|
+
export function isBlockMetadataTransactionResponse(
|
|
502
|
+
response: TransactionResponse,
|
|
503
|
+
): response is BlockMetadataTransactionResponse {
|
|
504
|
+
return response.type === TransactionResponseType.BlockMetadata;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
/**
|
|
508
|
+
* Determines if the provided transaction response is a state checkpoint transaction.
|
|
509
|
+
*
|
|
510
|
+
* @param response - The transaction response to evaluate.
|
|
511
|
+
* @returns A boolean indicating whether the transaction response is of type StateCheckpoint.
|
|
512
|
+
*/
|
|
513
|
+
export function isStateCheckpointTransactionResponse(
|
|
514
|
+
response: TransactionResponse,
|
|
515
|
+
): response is StateCheckpointTransactionResponse {
|
|
516
|
+
return response.type === TransactionResponseType.StateCheckpoint;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
/**
|
|
520
|
+
* Determine if the given transaction response is of type Validator.
|
|
521
|
+
*
|
|
522
|
+
* @param response - The transaction response to evaluate.
|
|
523
|
+
* @returns A boolean indicating whether the transaction response is a Validator type.
|
|
524
|
+
*/
|
|
525
|
+
export function isValidatorTransactionResponse(
|
|
526
|
+
response: TransactionResponse,
|
|
527
|
+
): response is ValidatorTransactionResponse {
|
|
528
|
+
return response.type === TransactionResponseType.Validator;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
/**
|
|
532
|
+
* Determines if the given transaction response is of the type Block Epilogue.
|
|
533
|
+
*
|
|
534
|
+
* @param response - The transaction response to evaluate.
|
|
535
|
+
* @returns A boolean indicating whether the response is a Block Epilogue transaction.
|
|
536
|
+
*/
|
|
537
|
+
export function isBlockEpilogueTransactionResponse(
|
|
538
|
+
response: TransactionResponse,
|
|
539
|
+
): response is BlockEpilogueTransactionResponse {
|
|
540
|
+
return response.type === TransactionResponseType.BlockEpilogue;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
/**
|
|
544
|
+
* The response for a pending transaction, indicating that the transaction is still being processed.
|
|
545
|
+
*/
|
|
546
|
+
export type PendingTransactionResponse = {
|
|
547
|
+
type: TransactionResponseType.Pending;
|
|
548
|
+
hash: string;
|
|
549
|
+
sender: string;
|
|
550
|
+
sequence_number: string;
|
|
551
|
+
max_gas_amount: string;
|
|
552
|
+
gas_unit_price: string;
|
|
553
|
+
expiration_timestamp_secs: string;
|
|
554
|
+
payload: TransactionPayloadResponse;
|
|
555
|
+
signature?: TransactionSignature;
|
|
556
|
+
};
|
|
557
|
+
|
|
558
|
+
/**
|
|
559
|
+
* The response structure for a user transaction.
|
|
560
|
+
*/
|
|
561
|
+
export type UserTransactionResponse = {
|
|
562
|
+
type: TransactionResponseType.User;
|
|
563
|
+
version: string;
|
|
564
|
+
hash: string;
|
|
565
|
+
state_change_hash: string;
|
|
566
|
+
event_root_hash: string;
|
|
567
|
+
state_checkpoint_hash: string | null;
|
|
568
|
+
gas_used: string;
|
|
569
|
+
/**
|
|
570
|
+
* Whether the transaction was successful
|
|
571
|
+
*/
|
|
572
|
+
success: boolean;
|
|
573
|
+
/**
|
|
574
|
+
* The VM status of the transaction, can tell useful information in a failure
|
|
575
|
+
*/
|
|
576
|
+
vm_status: string;
|
|
577
|
+
accumulator_root_hash: string;
|
|
578
|
+
/**
|
|
579
|
+
* Final state of resources changed by the transaction
|
|
580
|
+
*/
|
|
581
|
+
changes: Array<WriteSetChange>;
|
|
582
|
+
sender: string;
|
|
583
|
+
sequence_number: string;
|
|
584
|
+
max_gas_amount: string;
|
|
585
|
+
gas_unit_price: string;
|
|
586
|
+
expiration_timestamp_secs: string;
|
|
587
|
+
payload: TransactionPayloadResponse;
|
|
588
|
+
signature?: TransactionSignature;
|
|
589
|
+
/**
|
|
590
|
+
* Events generated by the transaction
|
|
591
|
+
*/
|
|
592
|
+
events: Array<Event>;
|
|
593
|
+
timestamp: string;
|
|
594
|
+
};
|
|
595
|
+
|
|
596
|
+
/**
|
|
597
|
+
* The response for a genesis transaction, indicating the type of transaction.
|
|
598
|
+
*/
|
|
599
|
+
export type GenesisTransactionResponse = {
|
|
600
|
+
type: TransactionResponseType.Genesis;
|
|
601
|
+
version: string;
|
|
602
|
+
hash: string;
|
|
603
|
+
state_change_hash: string;
|
|
604
|
+
event_root_hash: string;
|
|
605
|
+
state_checkpoint_hash?: string;
|
|
606
|
+
gas_used: string;
|
|
607
|
+
/**
|
|
608
|
+
* Whether the transaction was successful
|
|
609
|
+
*/
|
|
610
|
+
success: boolean;
|
|
611
|
+
/**
|
|
612
|
+
* The VM status of the transaction, can tell useful information in a failure
|
|
613
|
+
*/
|
|
614
|
+
vm_status: string;
|
|
615
|
+
accumulator_root_hash: string;
|
|
616
|
+
/**
|
|
617
|
+
* Final state of resources changed by the transaction
|
|
618
|
+
*/
|
|
619
|
+
changes: Array<WriteSetChange>;
|
|
620
|
+
payload: GenesisPayload;
|
|
621
|
+
/**
|
|
622
|
+
* Events emitted during genesis
|
|
623
|
+
*/
|
|
624
|
+
events: Array<Event>;
|
|
625
|
+
};
|
|
626
|
+
|
|
627
|
+
/**
|
|
628
|
+
* The structure representing a blockchain block with its height.
|
|
629
|
+
*/
|
|
630
|
+
export type BlockMetadataTransactionResponse = {
|
|
631
|
+
type: TransactionResponseType.BlockMetadata;
|
|
632
|
+
version: string;
|
|
633
|
+
hash: string;
|
|
634
|
+
state_change_hash: string;
|
|
635
|
+
event_root_hash: string;
|
|
636
|
+
state_checkpoint_hash: string | null;
|
|
637
|
+
gas_used: string;
|
|
638
|
+
/**
|
|
639
|
+
* Whether the transaction was successful
|
|
640
|
+
*/
|
|
641
|
+
success: boolean;
|
|
642
|
+
/**
|
|
643
|
+
* The VM status of the transaction, can tell useful information in a failure
|
|
644
|
+
*/
|
|
645
|
+
vm_status: string;
|
|
646
|
+
accumulator_root_hash: string;
|
|
647
|
+
/**
|
|
648
|
+
* Final state of resources changed by the transaction
|
|
649
|
+
*/
|
|
650
|
+
changes: Array<WriteSetChange>;
|
|
651
|
+
id: string;
|
|
652
|
+
epoch: string;
|
|
653
|
+
round: string;
|
|
654
|
+
/**
|
|
655
|
+
* The events emitted at the block creation
|
|
656
|
+
*/
|
|
657
|
+
events: Array<Event>;
|
|
658
|
+
/**
|
|
659
|
+
* Previous block votes
|
|
660
|
+
*/
|
|
661
|
+
previous_block_votes_bitvec: Array<number>;
|
|
662
|
+
proposer: string;
|
|
663
|
+
/**
|
|
664
|
+
* The indices of the proposers who failed to propose
|
|
665
|
+
*/
|
|
666
|
+
failed_proposer_indices: Array<number>;
|
|
667
|
+
timestamp: string;
|
|
668
|
+
};
|
|
669
|
+
|
|
670
|
+
/**
|
|
671
|
+
* The response for a state checkpoint transaction, indicating the type of transaction.
|
|
672
|
+
*/
|
|
673
|
+
export type StateCheckpointTransactionResponse = {
|
|
674
|
+
type: TransactionResponseType.StateCheckpoint;
|
|
675
|
+
version: string;
|
|
676
|
+
hash: string;
|
|
677
|
+
state_change_hash: string;
|
|
678
|
+
event_root_hash: string;
|
|
679
|
+
state_checkpoint_hash: string | null;
|
|
680
|
+
gas_used: string;
|
|
681
|
+
/**
|
|
682
|
+
* Whether the transaction was successful
|
|
683
|
+
*/
|
|
684
|
+
success: boolean;
|
|
685
|
+
/**
|
|
686
|
+
* The VM status of the transaction, can tell useful information in a failure
|
|
687
|
+
*/
|
|
688
|
+
vm_status: string;
|
|
689
|
+
accumulator_root_hash: string;
|
|
690
|
+
/**
|
|
691
|
+
* Final state of resources changed by the transaction
|
|
692
|
+
*/
|
|
693
|
+
changes: Array<WriteSetChange>;
|
|
694
|
+
timestamp: string;
|
|
695
|
+
};
|
|
696
|
+
|
|
697
|
+
/**
|
|
698
|
+
* The response for a validator transaction, indicating the type of transaction.
|
|
699
|
+
*/
|
|
700
|
+
export type ValidatorTransactionResponse = {
|
|
701
|
+
type: TransactionResponseType.Validator;
|
|
702
|
+
version: string;
|
|
703
|
+
hash: string;
|
|
704
|
+
state_change_hash: string;
|
|
705
|
+
event_root_hash: string;
|
|
706
|
+
state_checkpoint_hash: string | null;
|
|
707
|
+
gas_used: string;
|
|
708
|
+
/**
|
|
709
|
+
* Whether the transaction was successful
|
|
710
|
+
*/
|
|
711
|
+
success: boolean;
|
|
712
|
+
/**
|
|
713
|
+
* The VM status of the transaction, can tell useful information in a failure
|
|
714
|
+
*/
|
|
715
|
+
vm_status: string;
|
|
716
|
+
accumulator_root_hash: string;
|
|
717
|
+
/**
|
|
718
|
+
* Final state of resources changed by the transaction
|
|
719
|
+
*/
|
|
720
|
+
changes: Array<WriteSetChange>;
|
|
721
|
+
/**
|
|
722
|
+
* The events emitted by the validator transaction
|
|
723
|
+
*/
|
|
724
|
+
events: Array<Event>;
|
|
725
|
+
timestamp: string;
|
|
726
|
+
};
|
|
727
|
+
|
|
728
|
+
/**
|
|
729
|
+
* Describes the gas state of the block, indicating whether the block gas limit has been reached.
|
|
730
|
+
*/
|
|
731
|
+
export type BlockEndInfo = {
|
|
732
|
+
block_gas_limit_reached: boolean;
|
|
733
|
+
block_output_limit_reached: boolean;
|
|
734
|
+
block_effective_block_gas_units: number;
|
|
735
|
+
block_approx_output_size: number;
|
|
736
|
+
};
|
|
737
|
+
|
|
738
|
+
/**
|
|
739
|
+
* A transaction executed at the end of a block that tracks data from the entire block.
|
|
740
|
+
*/
|
|
741
|
+
export type BlockEpilogueTransactionResponse = {
|
|
742
|
+
type: TransactionResponseType.BlockEpilogue;
|
|
743
|
+
version: string;
|
|
744
|
+
hash: string;
|
|
745
|
+
state_change_hash: string;
|
|
746
|
+
event_root_hash: string;
|
|
747
|
+
state_checkpoint_hash: string | null;
|
|
748
|
+
gas_used: string;
|
|
749
|
+
/**
|
|
750
|
+
* Whether the transaction was successful
|
|
751
|
+
*/
|
|
752
|
+
success: boolean;
|
|
753
|
+
/**
|
|
754
|
+
* The VM status of the transaction, can tell useful information in a failure
|
|
755
|
+
*/
|
|
756
|
+
vm_status: string;
|
|
757
|
+
accumulator_root_hash: string;
|
|
758
|
+
/**
|
|
759
|
+
* Final state of resources changed by the transaction
|
|
760
|
+
*/
|
|
761
|
+
changes: Array<WriteSetChange>;
|
|
762
|
+
timestamp: string;
|
|
763
|
+
block_end_info: BlockEndInfo | null;
|
|
764
|
+
};
|
|
765
|
+
|
|
766
|
+
/**
|
|
767
|
+
* WRITESET CHANGE TYPES
|
|
768
|
+
*/
|
|
769
|
+
|
|
770
|
+
/**
|
|
771
|
+
* A union type that encompasses both script and direct write sets for data operations.
|
|
772
|
+
*/
|
|
773
|
+
export type WriteSetChange =
|
|
774
|
+
| WriteSetChangeDeleteModule
|
|
775
|
+
| WriteSetChangeDeleteResource
|
|
776
|
+
| WriteSetChangeDeleteTableItem
|
|
777
|
+
| WriteSetChangeWriteModule
|
|
778
|
+
| WriteSetChangeWriteResource
|
|
779
|
+
| WriteSetChangeWriteTableItem;
|
|
780
|
+
|
|
781
|
+
/**
|
|
782
|
+
* The structure for a module deletion change in a write set.
|
|
783
|
+
*/
|
|
784
|
+
export type WriteSetChangeDeleteModule = {
|
|
785
|
+
type: string;
|
|
786
|
+
address: string;
|
|
787
|
+
/**
|
|
788
|
+
* State key hash
|
|
789
|
+
*/
|
|
790
|
+
state_key_hash: string;
|
|
791
|
+
module: MoveModuleId;
|
|
792
|
+
};
|
|
793
|
+
|
|
794
|
+
/**
|
|
795
|
+
* The payload for a resource deletion in a write set change.
|
|
796
|
+
*/
|
|
797
|
+
export type WriteSetChangeDeleteResource = {
|
|
798
|
+
type: string;
|
|
799
|
+
address: string;
|
|
800
|
+
state_key_hash: string;
|
|
801
|
+
resource: string;
|
|
802
|
+
};
|
|
803
|
+
|
|
804
|
+
/**
|
|
805
|
+
* The payload for a write set change that deletes a table item.
|
|
806
|
+
*/
|
|
807
|
+
export type WriteSetChangeDeleteTableItem = {
|
|
808
|
+
type: string;
|
|
809
|
+
state_key_hash: string;
|
|
810
|
+
handle: string;
|
|
811
|
+
key: string;
|
|
812
|
+
data?: DeletedTableData;
|
|
813
|
+
};
|
|
814
|
+
|
|
815
|
+
/**
|
|
816
|
+
* The structure for a write module change in a write set.
|
|
817
|
+
*/
|
|
818
|
+
export type WriteSetChangeWriteModule = {
|
|
819
|
+
type: string;
|
|
820
|
+
address: string;
|
|
821
|
+
state_key_hash: string;
|
|
822
|
+
data: MoveModuleBytecode;
|
|
823
|
+
};
|
|
824
|
+
|
|
825
|
+
/**
|
|
826
|
+
* The resource associated with a write set change, identified by its type.
|
|
827
|
+
*/
|
|
828
|
+
export type WriteSetChangeWriteResource = {
|
|
829
|
+
type: string;
|
|
830
|
+
address: string;
|
|
831
|
+
state_key_hash: string;
|
|
832
|
+
data: MoveResource;
|
|
833
|
+
};
|
|
834
|
+
|
|
835
|
+
/**
|
|
836
|
+
* The structure for a write operation on a table in a write set change.
|
|
837
|
+
*/
|
|
838
|
+
export type WriteSetChangeWriteTableItem = {
|
|
839
|
+
type: string;
|
|
840
|
+
state_key_hash: string;
|
|
841
|
+
handle: string;
|
|
842
|
+
key: string;
|
|
843
|
+
value: string;
|
|
844
|
+
data?: DecodedTableData;
|
|
845
|
+
};
|
|
846
|
+
|
|
847
|
+
/**
|
|
848
|
+
* The decoded data for a table, including its key in JSON format.
|
|
849
|
+
*/
|
|
850
|
+
export type DecodedTableData = {
|
|
851
|
+
/**
|
|
852
|
+
* Key of table in JSON
|
|
853
|
+
*/
|
|
854
|
+
key: any;
|
|
855
|
+
/**
|
|
856
|
+
* Type of key
|
|
857
|
+
*/
|
|
858
|
+
key_type: string;
|
|
859
|
+
/**
|
|
860
|
+
* Value of table in JSON
|
|
861
|
+
*/
|
|
862
|
+
value: any;
|
|
863
|
+
/**
|
|
864
|
+
* Type of value
|
|
865
|
+
*/
|
|
866
|
+
value_type: string;
|
|
867
|
+
};
|
|
868
|
+
|
|
869
|
+
/**
|
|
870
|
+
* Data for a deleted table entry.
|
|
871
|
+
*/
|
|
872
|
+
export type DeletedTableData = {
|
|
873
|
+
/**
|
|
874
|
+
* Deleted key
|
|
875
|
+
*/
|
|
876
|
+
key: any;
|
|
877
|
+
/**
|
|
878
|
+
* Deleted key type
|
|
879
|
+
*/
|
|
880
|
+
key_type: string;
|
|
881
|
+
};
|
|
882
|
+
|
|
883
|
+
/**
|
|
884
|
+
* The payload for a transaction response, which can be an entry function, script, or multisig payload.
|
|
885
|
+
*/
|
|
886
|
+
export type TransactionPayloadResponse = EntryFunctionPayloadResponse | ScriptPayloadResponse | MultisigPayloadResponse;
|
|
887
|
+
|
|
888
|
+
/**
|
|
889
|
+
* The response payload for an entry function, containing the type of the entry.
|
|
890
|
+
*/
|
|
891
|
+
export type EntryFunctionPayloadResponse = {
|
|
892
|
+
type: string;
|
|
893
|
+
function: MoveFunctionId;
|
|
894
|
+
/**
|
|
895
|
+
* Type arguments of the function
|
|
896
|
+
*/
|
|
897
|
+
type_arguments: Array<string>;
|
|
898
|
+
/**
|
|
899
|
+
* Arguments of the function
|
|
900
|
+
*/
|
|
901
|
+
arguments: Array<any>;
|
|
902
|
+
};
|
|
903
|
+
|
|
904
|
+
/**
|
|
905
|
+
* The payload for a script response, containing the type of the script.
|
|
906
|
+
*/
|
|
907
|
+
export type ScriptPayloadResponse = {
|
|
908
|
+
type: string;
|
|
909
|
+
code: MoveScriptBytecode;
|
|
910
|
+
/**
|
|
911
|
+
* Type arguments of the function
|
|
912
|
+
*/
|
|
913
|
+
type_arguments: Array<string>;
|
|
914
|
+
/**
|
|
915
|
+
* Arguments of the function
|
|
916
|
+
*/
|
|
917
|
+
arguments: Array<any>;
|
|
918
|
+
};
|
|
919
|
+
|
|
920
|
+
/**
|
|
921
|
+
* The response payload for a multisig transaction, containing the type of the transaction.
|
|
922
|
+
*/
|
|
923
|
+
export type MultisigPayloadResponse = {
|
|
924
|
+
type: string;
|
|
925
|
+
multisig_address: string;
|
|
926
|
+
transaction_payload?: EntryFunctionPayloadResponse;
|
|
927
|
+
};
|
|
928
|
+
|
|
929
|
+
/**
|
|
930
|
+
* The payload for the genesis block containing the type of the payload.
|
|
931
|
+
*/
|
|
932
|
+
export type GenesisPayload = {
|
|
933
|
+
type: string;
|
|
934
|
+
write_set: WriteSet;
|
|
935
|
+
};
|
|
936
|
+
|
|
937
|
+
/**
|
|
938
|
+
* The bytecode for a Move script.
|
|
939
|
+
*/
|
|
940
|
+
export type MoveScriptBytecode = {
|
|
941
|
+
bytecode: string;
|
|
942
|
+
abi?: MoveFunction;
|
|
943
|
+
};
|
|
944
|
+
|
|
945
|
+
/**
|
|
946
|
+
* JSON representations of transaction signatures returned from the node API.
|
|
947
|
+
*/
|
|
948
|
+
export type TransactionSignature =
|
|
949
|
+
| TransactionEd25519Signature
|
|
950
|
+
| TransactionSecp256k1Signature
|
|
951
|
+
| TransactionMultiEd25519Signature
|
|
952
|
+
| TransactionMultiAgentSignature
|
|
953
|
+
| TransactionFeePayerSignature;
|
|
954
|
+
|
|
955
|
+
/**
|
|
956
|
+
* Determine if the provided signature is an Ed25519 signature.
|
|
957
|
+
* This function checks for the presence of the "signature" property
|
|
958
|
+
* and verifies that its value is "ed25519_signature".
|
|
959
|
+
*
|
|
960
|
+
* @param signature - The transaction signature to be checked.
|
|
961
|
+
* @returns A boolean indicating whether the signature is an Ed25519 signature.
|
|
962
|
+
*/
|
|
963
|
+
export function isEd25519Signature(signature: TransactionSignature): signature is TransactionFeePayerSignature {
|
|
964
|
+
return "signature" in signature && signature.signature === "ed25519_signature";
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
/**
|
|
968
|
+
* Determine if the provided signature is a valid secp256k1 ECDSA signature.
|
|
969
|
+
*
|
|
970
|
+
* @param signature - The transaction signature to validate.
|
|
971
|
+
* @returns A boolean indicating whether the signature is a secp256k1 ECDSA signature.
|
|
972
|
+
*/
|
|
973
|
+
export function isSecp256k1Signature(signature: TransactionSignature): signature is TransactionFeePayerSignature {
|
|
974
|
+
return "signature" in signature && signature.signature === "secp256k1_ecdsa_signature";
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
/**
|
|
978
|
+
* Determine if the provided transaction signature is a multi-agent signature.
|
|
979
|
+
*
|
|
980
|
+
* @param signature - The transaction signature to evaluate.
|
|
981
|
+
* @returns A boolean indicating whether the signature is a multi-agent signature.
|
|
982
|
+
*/
|
|
983
|
+
export function isMultiAgentSignature(signature: TransactionSignature): signature is TransactionMultiAgentSignature {
|
|
984
|
+
return signature.type === "multi_agent_signature";
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
/**
|
|
988
|
+
* Determine if the provided signature is a fee payer signature.
|
|
989
|
+
*
|
|
990
|
+
* @param signature - The transaction signature to evaluate.
|
|
991
|
+
* @returns A boolean indicating whether the signature is a fee payer signature.
|
|
992
|
+
*/
|
|
993
|
+
export function isFeePayerSignature(signature: TransactionSignature): signature is TransactionFeePayerSignature {
|
|
994
|
+
return signature.type === "fee_payer_signature";
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
/**
|
|
998
|
+
* Determine if the provided signature is of type "multi_ed25519_signature".
|
|
999
|
+
*
|
|
1000
|
+
* @param signature - The transaction signature to check.
|
|
1001
|
+
* @returns A boolean indicating whether the signature is a multi-ed25519 signature.
|
|
1002
|
+
*/
|
|
1003
|
+
export function isMultiEd25519Signature(
|
|
1004
|
+
signature: TransactionSignature,
|
|
1005
|
+
): signature is TransactionMultiEd25519Signature {
|
|
1006
|
+
return signature.type === "multi_ed25519_signature";
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
/**
|
|
1010
|
+
* The signature for a transaction using the Ed25519 algorithm.
|
|
1011
|
+
*/
|
|
1012
|
+
export type TransactionEd25519Signature = {
|
|
1013
|
+
type: string;
|
|
1014
|
+
public_key: string;
|
|
1015
|
+
signature: "ed25519_signature";
|
|
1016
|
+
};
|
|
1017
|
+
|
|
1018
|
+
/**
|
|
1019
|
+
* The structure for a Secp256k1 signature in a transaction.
|
|
1020
|
+
*/
|
|
1021
|
+
export type TransactionSecp256k1Signature = {
|
|
1022
|
+
type: string;
|
|
1023
|
+
public_key: string;
|
|
1024
|
+
signature: "secp256k1_ecdsa_signature";
|
|
1025
|
+
};
|
|
1026
|
+
|
|
1027
|
+
/**
|
|
1028
|
+
* The structure for a multi-signature transaction using Ed25519.
|
|
1029
|
+
*/
|
|
1030
|
+
export type TransactionMultiEd25519Signature = {
|
|
1031
|
+
type: "multi_ed25519_signature";
|
|
1032
|
+
/**
|
|
1033
|
+
* The public keys for the Ed25519 signature
|
|
1034
|
+
*/
|
|
1035
|
+
public_keys: Array<string>;
|
|
1036
|
+
/**
|
|
1037
|
+
* Signature associated with the public keys in the same order
|
|
1038
|
+
*/
|
|
1039
|
+
signatures: Array<string>;
|
|
1040
|
+
/**
|
|
1041
|
+
* The number of signatures required for a successful transaction
|
|
1042
|
+
*/
|
|
1043
|
+
threshold: number;
|
|
1044
|
+
bitmap: string;
|
|
1045
|
+
};
|
|
1046
|
+
|
|
1047
|
+
/**
|
|
1048
|
+
* The structure for a multi-agent signature in a transaction.
|
|
1049
|
+
*/
|
|
1050
|
+
export type TransactionMultiAgentSignature = {
|
|
1051
|
+
type: "multi_agent_signature";
|
|
1052
|
+
sender: AccountSignature;
|
|
1053
|
+
/**
|
|
1054
|
+
* The other involved parties' addresses
|
|
1055
|
+
*/
|
|
1056
|
+
secondary_signer_addresses: Array<string>;
|
|
1057
|
+
/**
|
|
1058
|
+
* The associated signatures, in the same order as the secondary addresses
|
|
1059
|
+
*/
|
|
1060
|
+
secondary_signers: Array<AccountSignature>;
|
|
1061
|
+
};
|
|
1062
|
+
|
|
1063
|
+
/**
|
|
1064
|
+
* The signature of the fee payer in a transaction.
|
|
1065
|
+
*/
|
|
1066
|
+
export type TransactionFeePayerSignature = {
|
|
1067
|
+
type: "fee_payer_signature";
|
|
1068
|
+
sender: AccountSignature;
|
|
1069
|
+
/**
|
|
1070
|
+
* The other involved parties' addresses
|
|
1071
|
+
*/
|
|
1072
|
+
secondary_signer_addresses: Array<string>;
|
|
1073
|
+
/**
|
|
1074
|
+
* The associated signatures, in the same order as the secondary addresses
|
|
1075
|
+
*/
|
|
1076
|
+
secondary_signers: Array<AccountSignature>;
|
|
1077
|
+
fee_payer_address: string;
|
|
1078
|
+
fee_payer_signer: AccountSignature;
|
|
1079
|
+
};
|
|
1080
|
+
|
|
1081
|
+
/**
|
|
1082
|
+
* The union of all single account signatures, including Ed25519, Secp256k1, and MultiEd25519 signatures.
|
|
1083
|
+
*/
|
|
1084
|
+
export type AccountSignature =
|
|
1085
|
+
| TransactionEd25519Signature
|
|
1086
|
+
| TransactionSecp256k1Signature
|
|
1087
|
+
| TransactionMultiEd25519Signature;
|
|
1088
|
+
|
|
1089
|
+
export type WriteSet = ScriptWriteSet | DirectWriteSet;
|
|
1090
|
+
|
|
1091
|
+
/**
|
|
1092
|
+
* The set of properties for writing scripts, including the type of script.
|
|
1093
|
+
*/
|
|
1094
|
+
export type ScriptWriteSet = {
|
|
1095
|
+
type: string;
|
|
1096
|
+
execute_as: string;
|
|
1097
|
+
script: ScriptPayloadResponse;
|
|
1098
|
+
};
|
|
1099
|
+
|
|
1100
|
+
/**
|
|
1101
|
+
* The set of direct write operations, identified by a type string.
|
|
1102
|
+
*/
|
|
1103
|
+
export type DirectWriteSet = {
|
|
1104
|
+
type: string;
|
|
1105
|
+
changes: Array<WriteSetChange>;
|
|
1106
|
+
events: Array<Event>;
|
|
1107
|
+
};
|
|
1108
|
+
|
|
1109
|
+
/**
|
|
1110
|
+
* The structure for an event's unique identifier, including its creation number.
|
|
1111
|
+
*/
|
|
1112
|
+
|
|
1113
|
+
/**
|
|
1114
|
+
* The structure for an event, identified by a unique GUID.
|
|
1115
|
+
*/
|
|
1116
|
+
export type EventGuid = {
|
|
1117
|
+
creation_number: string;
|
|
1118
|
+
account_address: string;
|
|
1119
|
+
};
|
|
1120
|
+
|
|
1121
|
+
export type Event = {
|
|
1122
|
+
guid: EventGuid;
|
|
1123
|
+
sequence_number: string;
|
|
1124
|
+
type: string;
|
|
1125
|
+
/**
|
|
1126
|
+
* The JSON representation of the event
|
|
1127
|
+
*/
|
|
1128
|
+
data: any;
|
|
1129
|
+
};
|
|
1130
|
+
|
|
1131
|
+
/**
|
|
1132
|
+
* A number representing a Move uint8 type.
|
|
1133
|
+
*/
|
|
1134
|
+
export type MoveUint8Type = number;
|
|
1135
|
+
|
|
1136
|
+
/**
|
|
1137
|
+
* A 16-bit unsigned integer used in the Move programming language.
|
|
1138
|
+
*/
|
|
1139
|
+
export type MoveUint16Type = number;
|
|
1140
|
+
|
|
1141
|
+
/**
|
|
1142
|
+
* A 32-bit unsigned integer type used in Move programming.
|
|
1143
|
+
*/
|
|
1144
|
+
export type MoveUint32Type = number;
|
|
1145
|
+
|
|
1146
|
+
/**
|
|
1147
|
+
* A string representation of a 64-bit unsigned integer used in Move programming.
|
|
1148
|
+
*/
|
|
1149
|
+
export type MoveUint64Type = string;
|
|
1150
|
+
|
|
1151
|
+
/**
|
|
1152
|
+
* A string representing a 128-bit unsigned integer in the Move programming language.
|
|
1153
|
+
*/
|
|
1154
|
+
export type MoveUint128Type = string;
|
|
1155
|
+
|
|
1156
|
+
/**
|
|
1157
|
+
* A string representation of a 256-bit unsigned integer used in Move programming.
|
|
1158
|
+
*/
|
|
1159
|
+
export type MoveUint256Type = string;
|
|
1160
|
+
|
|
1161
|
+
/**
|
|
1162
|
+
* A string representing a Move address.
|
|
1163
|
+
*/
|
|
1164
|
+
export type MoveAddressType = string;
|
|
1165
|
+
|
|
1166
|
+
/**
|
|
1167
|
+
* The type for identifying objects to be moved within the system.
|
|
1168
|
+
*/
|
|
1169
|
+
export type MoveObjectType = string;
|
|
1170
|
+
|
|
1171
|
+
/**
|
|
1172
|
+
* The type for move options, which can be a MoveType, null, or undefined.
|
|
1173
|
+
*/
|
|
1174
|
+
export type MoveOptionType = MoveType | null | undefined;
|
|
1175
|
+
|
|
1176
|
+
/**
|
|
1177
|
+
* A structure representing a move with a name.
|
|
1178
|
+
*/
|
|
1179
|
+
export type MoveStructId = `${string}::${string}::${string}`;
|
|
1180
|
+
|
|
1181
|
+
/**
|
|
1182
|
+
* The move function containing its name. Same as MoveStructId since it reads weird to take a StructId for a Function.
|
|
1183
|
+
*/
|
|
1184
|
+
export type MoveFunctionId = MoveStructId;
|
|
1185
|
+
|
|
1186
|
+
// TODO: Add support for looking up ABI to add proper typing
|
|
1187
|
+
export type MoveStructType = {};
|
|
1188
|
+
|
|
1189
|
+
/**
|
|
1190
|
+
* A union type that encompasses various data types used in Move, including primitive types, address types, object types, and
|
|
1191
|
+
* arrays of MoveType.
|
|
1192
|
+
*/
|
|
1193
|
+
export type MoveType =
|
|
1194
|
+
| boolean
|
|
1195
|
+
| string
|
|
1196
|
+
| MoveUint8Type
|
|
1197
|
+
| MoveUint16Type
|
|
1198
|
+
| MoveUint32Type
|
|
1199
|
+
| MoveUint64Type
|
|
1200
|
+
| MoveUint128Type
|
|
1201
|
+
| MoveUint256Type
|
|
1202
|
+
| MoveAddressType
|
|
1203
|
+
| MoveObjectType
|
|
1204
|
+
| MoveStructType
|
|
1205
|
+
| Array<MoveType>;
|
|
1206
|
+
|
|
1207
|
+
/**
|
|
1208
|
+
* Possible Move values acceptable by move functions (entry, view)
|
|
1209
|
+
*
|
|
1210
|
+
* Map of a Move value to the corresponding TypeScript value
|
|
1211
|
+
*
|
|
1212
|
+
* `Bool -> boolean`
|
|
1213
|
+
*
|
|
1214
|
+
* `u8, u16, u32 -> number`
|
|
1215
|
+
*
|
|
1216
|
+
* `u64, u128, u256 -> string`
|
|
1217
|
+
*
|
|
1218
|
+
* `String -> string`
|
|
1219
|
+
*
|
|
1220
|
+
* `Address -> 0x${string}`
|
|
1221
|
+
*
|
|
1222
|
+
* `Struct - 0x${string}::${string}::${string}`
|
|
1223
|
+
*
|
|
1224
|
+
* `Object -> 0x${string}`
|
|
1225
|
+
*
|
|
1226
|
+
* `Vector -> Array<MoveValue>`
|
|
1227
|
+
*
|
|
1228
|
+
* `Option -> MoveValue | null | undefined`
|
|
1229
|
+
*/
|
|
1230
|
+
export type MoveValue =
|
|
1231
|
+
| boolean
|
|
1232
|
+
| string
|
|
1233
|
+
| MoveUint8Type
|
|
1234
|
+
| MoveUint16Type
|
|
1235
|
+
| MoveUint32Type
|
|
1236
|
+
| MoveUint64Type
|
|
1237
|
+
| MoveUint128Type
|
|
1238
|
+
| MoveUint256Type
|
|
1239
|
+
| MoveAddressType
|
|
1240
|
+
| MoveObjectType
|
|
1241
|
+
| MoveStructId
|
|
1242
|
+
| MoveOptionType
|
|
1243
|
+
| Array<MoveValue>;
|
|
1244
|
+
|
|
1245
|
+
/**
|
|
1246
|
+
* A string representation of a Move module, formatted as `module_name::function_name`.
|
|
1247
|
+
* Module names are case-sensitive.
|
|
1248
|
+
*/
|
|
1249
|
+
export type MoveModuleId = `${string}::${string}`;
|
|
1250
|
+
|
|
1251
|
+
/**
|
|
1252
|
+
* Specifies the visibility levels for move functions, controlling access permissions.
|
|
1253
|
+
*/
|
|
1254
|
+
export enum MoveFunctionVisibility {
|
|
1255
|
+
PRIVATE = "private",
|
|
1256
|
+
PUBLIC = "public",
|
|
1257
|
+
FRIEND = "friend",
|
|
1258
|
+
}
|
|
1259
|
+
|
|
1260
|
+
/**
|
|
1261
|
+
* Abilities related to moving items within the system.
|
|
1262
|
+
*/
|
|
1263
|
+
export enum MoveAbility {
|
|
1264
|
+
STORE = "store",
|
|
1265
|
+
DROP = "drop",
|
|
1266
|
+
KEY = "key",
|
|
1267
|
+
COPY = "copy",
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1270
|
+
/**
|
|
1271
|
+
* Move abilities associated with the generic type parameter of a function.
|
|
1272
|
+
*/
|
|
1273
|
+
export type MoveFunctionGenericTypeParam = {
|
|
1274
|
+
constraints: Array<MoveAbility>;
|
|
1275
|
+
};
|
|
1276
|
+
|
|
1277
|
+
/**
|
|
1278
|
+
* A field in a Move struct, identified by its name.
|
|
1279
|
+
*/
|
|
1280
|
+
export type MoveStructField = {
|
|
1281
|
+
name: string;
|
|
1282
|
+
type: string;
|
|
1283
|
+
};
|
|
1284
|
+
|
|
1285
|
+
/**
|
|
1286
|
+
* A Move module
|
|
1287
|
+
*/
|
|
1288
|
+
export type MoveModule = {
|
|
1289
|
+
address: string;
|
|
1290
|
+
name: string;
|
|
1291
|
+
/**
|
|
1292
|
+
* Friends of the module
|
|
1293
|
+
*/
|
|
1294
|
+
friends: Array<MoveModuleId>;
|
|
1295
|
+
/**
|
|
1296
|
+
* Public functions of the module
|
|
1297
|
+
*/
|
|
1298
|
+
exposed_functions: Array<MoveFunction>;
|
|
1299
|
+
/**
|
|
1300
|
+
* Structs of the module
|
|
1301
|
+
*/
|
|
1302
|
+
structs: Array<MoveStruct>;
|
|
1303
|
+
};
|
|
1304
|
+
|
|
1305
|
+
/**
|
|
1306
|
+
* A move struct
|
|
1307
|
+
*/
|
|
1308
|
+
export type MoveStruct = {
|
|
1309
|
+
name: string;
|
|
1310
|
+
/**
|
|
1311
|
+
* Whether the struct is a native struct of Move
|
|
1312
|
+
*/
|
|
1313
|
+
is_native: boolean;
|
|
1314
|
+
/**
|
|
1315
|
+
* Whether the struct is a module event (aka v2 event). This will be false for v1
|
|
1316
|
+
* events because the value is derived from the #[event] attribute on the struct in
|
|
1317
|
+
* the Move source code. This attribute is only relevant for v2 events.
|
|
1318
|
+
*/
|
|
1319
|
+
is_event: boolean;
|
|
1320
|
+
/**
|
|
1321
|
+
* Abilities associated with the struct
|
|
1322
|
+
*/
|
|
1323
|
+
abilities: Array<MoveAbility>;
|
|
1324
|
+
/**
|
|
1325
|
+
* Generic types associated with the struct
|
|
1326
|
+
*/
|
|
1327
|
+
generic_type_params: Array<MoveFunctionGenericTypeParam>;
|
|
1328
|
+
/**
|
|
1329
|
+
* Fields associated with the struct
|
|
1330
|
+
*/
|
|
1331
|
+
fields: Array<MoveStructField>;
|
|
1332
|
+
};
|
|
1333
|
+
|
|
1334
|
+
/**
|
|
1335
|
+
* Move function
|
|
1336
|
+
*/
|
|
1337
|
+
export type MoveFunction = {
|
|
1338
|
+
name: string;
|
|
1339
|
+
visibility: MoveFunctionVisibility;
|
|
1340
|
+
/**
|
|
1341
|
+
* Whether the function can be called as an entry function directly in a transaction
|
|
1342
|
+
*/
|
|
1343
|
+
is_entry: boolean;
|
|
1344
|
+
/**
|
|
1345
|
+
* Whether the function is a view function or not
|
|
1346
|
+
*/
|
|
1347
|
+
is_view: boolean;
|
|
1348
|
+
/**
|
|
1349
|
+
* Generic type params associated with the Move function
|
|
1350
|
+
*/
|
|
1351
|
+
generic_type_params: Array<MoveFunctionGenericTypeParam>;
|
|
1352
|
+
/**
|
|
1353
|
+
* Parameters associated with the move function
|
|
1354
|
+
*/
|
|
1355
|
+
params: Array<string>;
|
|
1356
|
+
/**
|
|
1357
|
+
* Return type of the function
|
|
1358
|
+
*/
|
|
1359
|
+
return: Array<string>;
|
|
1360
|
+
};
|
|
1361
|
+
|
|
1362
|
+
/**
|
|
1363
|
+
* Roles that can be assigned within the system, indicating different levels of access and functionality.
|
|
1364
|
+
*/
|
|
1365
|
+
export enum RoleType {
|
|
1366
|
+
VALIDATOR = "validator",
|
|
1367
|
+
FULL_NODE = "full_node",
|
|
1368
|
+
}
|
|
1369
|
+
|
|
1370
|
+
/**
|
|
1371
|
+
* Information about the current blockchain ledger, including its chain ID.
|
|
1372
|
+
*/
|
|
1373
|
+
export type LedgerInfo = {
|
|
1374
|
+
/**
|
|
1375
|
+
* Chain ID of the current chain
|
|
1376
|
+
*/
|
|
1377
|
+
chain_id: number;
|
|
1378
|
+
epoch: string;
|
|
1379
|
+
ledger_version: string;
|
|
1380
|
+
oldest_ledger_version: string;
|
|
1381
|
+
ledger_timestamp: string;
|
|
1382
|
+
node_role: RoleType;
|
|
1383
|
+
oldest_block_height: string;
|
|
1384
|
+
block_height: string;
|
|
1385
|
+
/**
|
|
1386
|
+
* Git hash of the build of the API endpoint. Can be used to determine the exact
|
|
1387
|
+
* software version used by the API endpoint.
|
|
1388
|
+
*/
|
|
1389
|
+
git_hash?: string;
|
|
1390
|
+
};
|
|
1391
|
+
|
|
1392
|
+
/**
|
|
1393
|
+
* A Block type
|
|
1394
|
+
*/
|
|
1395
|
+
export type Block = {
|
|
1396
|
+
block_height: string;
|
|
1397
|
+
block_hash: string;
|
|
1398
|
+
block_timestamp: string;
|
|
1399
|
+
first_version: string;
|
|
1400
|
+
last_version: string;
|
|
1401
|
+
/**
|
|
1402
|
+
* The transactions in the block in sequential order
|
|
1403
|
+
*/
|
|
1404
|
+
transactions?: Array<TransactionResponse>;
|
|
1405
|
+
};
|
|
1406
|
+
|
|
1407
|
+
// REQUEST TYPES
|
|
1408
|
+
|
|
1409
|
+
/**
|
|
1410
|
+
* The request payload for the GetTableItem API.
|
|
1411
|
+
*/
|
|
1412
|
+
export type TableItemRequest = {
|
|
1413
|
+
key_type: MoveValue;
|
|
1414
|
+
value_type: MoveValue;
|
|
1415
|
+
/**
|
|
1416
|
+
* The value of the table item's key
|
|
1417
|
+
*/
|
|
1418
|
+
key: any;
|
|
1419
|
+
};
|
|
1420
|
+
|
|
1421
|
+
/**
|
|
1422
|
+
* A list of supported Authentication Key schemes in Aptos, consisting of combinations of signing schemes and derive schemes.
|
|
1423
|
+
*/
|
|
1424
|
+
export type AuthenticationKeyScheme = SigningScheme | DeriveScheme;
|
|
1425
|
+
|
|
1426
|
+
/**
|
|
1427
|
+
* Different schemes for signing keys used in cryptographic operations.
|
|
1428
|
+
*/
|
|
1429
|
+
export enum SigningScheme {
|
|
1430
|
+
/**
|
|
1431
|
+
* For Ed25519PublicKey
|
|
1432
|
+
*/
|
|
1433
|
+
Ed25519 = 0,
|
|
1434
|
+
/**
|
|
1435
|
+
* For MultiEd25519PublicKey
|
|
1436
|
+
*/
|
|
1437
|
+
MultiEd25519 = 1,
|
|
1438
|
+
/**
|
|
1439
|
+
* For SingleKey ecdsa
|
|
1440
|
+
*/
|
|
1441
|
+
SingleKey = 2,
|
|
1442
|
+
|
|
1443
|
+
MultiKey = 3,
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1446
|
+
/**
|
|
1447
|
+
* Specifies the signing schemes available for cryptographic operations.
|
|
1448
|
+
*/
|
|
1449
|
+
export enum SigningSchemeInput {
|
|
1450
|
+
/**
|
|
1451
|
+
* For Ed25519PublicKey
|
|
1452
|
+
*/
|
|
1453
|
+
Ed25519 = 0,
|
|
1454
|
+
/**
|
|
1455
|
+
* For Secp256k1Ecdsa
|
|
1456
|
+
*/
|
|
1457
|
+
Secp256k1Ecdsa = 2,
|
|
1458
|
+
}
|
|
1459
|
+
|
|
1460
|
+
/**
|
|
1461
|
+
* Specifies the schemes for deriving account addresses from various data sources.
|
|
1462
|
+
*/
|
|
1463
|
+
export enum DeriveScheme {
|
|
1464
|
+
/**
|
|
1465
|
+
* Derives an address using an AUID, used for objects
|
|
1466
|
+
*/
|
|
1467
|
+
DeriveAuid = 251,
|
|
1468
|
+
/**
|
|
1469
|
+
* Derives an address from another object address
|
|
1470
|
+
*/
|
|
1471
|
+
DeriveObjectAddressFromObject = 252,
|
|
1472
|
+
/**
|
|
1473
|
+
* Derives an address from a GUID, used for objects
|
|
1474
|
+
*/
|
|
1475
|
+
DeriveObjectAddressFromGuid = 253,
|
|
1476
|
+
/**
|
|
1477
|
+
* Derives an address from seed bytes, used for named objects
|
|
1478
|
+
*/
|
|
1479
|
+
DeriveObjectAddressFromSeed = 254,
|
|
1480
|
+
/**
|
|
1481
|
+
* Derives an address from seed bytes, used for resource accounts
|
|
1482
|
+
*/
|
|
1483
|
+
DeriveResourceAccountAddress = 255,
|
|
1484
|
+
}
|
|
1485
|
+
|
|
1486
|
+
/**
|
|
1487
|
+
* Options for configuring the behavior of the waitForTransaction() function.
|
|
1488
|
+
*/
|
|
1489
|
+
export type WaitForTransactionOptions = {
|
|
1490
|
+
timeoutSecs?: number;
|
|
1491
|
+
checkSuccess?: boolean;
|
|
1492
|
+
// Default behavior is to wait for the indexer. Set this to false to disable waiting.
|
|
1493
|
+
waitForIndexer?: boolean;
|
|
1494
|
+
};
|
|
1495
|
+
|
|
1496
|
+
/**
|
|
1497
|
+
* Input type to generate an account using the Ed25519 signing scheme.
|
|
1498
|
+
*/
|
|
1499
|
+
export type GenerateAccountWithEd25519 = {
|
|
1500
|
+
scheme: SigningSchemeInput.Ed25519;
|
|
1501
|
+
legacy: boolean;
|
|
1502
|
+
};
|
|
1503
|
+
|
|
1504
|
+
/**
|
|
1505
|
+
* Input type to generate an account with a Single Signer using Secp256k1.
|
|
1506
|
+
*/
|
|
1507
|
+
export type GenerateAccountWithSingleSignerSecp256k1Key = {
|
|
1508
|
+
scheme: SigningSchemeInput.Secp256k1Ecdsa;
|
|
1509
|
+
legacy?: false;
|
|
1510
|
+
};
|
|
1511
|
+
|
|
1512
|
+
export type GenerateAccount = GenerateAccountWithEd25519 | GenerateAccountWithSingleSignerSecp256k1Key;
|