@aptos-labs/ts-sdk 1.13.3 → 1.14.0-zeta.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/dist/common/accountAddress-u9wEan9p.d.ts +2149 -0
- package/dist/common/chunk-QRI7EC4T.js +24 -0
- package/dist/common/chunk-QRI7EC4T.js.map +1 -0
- package/dist/common/cli/index.d.ts +94 -1
- package/dist/common/cli/index.js +245 -1
- package/dist/common/cli/index.js.map +1 -1
- package/dist/common/index.d.ts +2699 -4119
- package/dist/common/index.js +11786 -374
- package/dist/common/index.js.map +1 -1
- package/dist/esm/{Ed25519Account--qjfup2u.d.mts → Ed25519Account-9zBaZEnp.d.mts} +76 -9
- package/dist/esm/account/Account.d.mts +34 -0
- package/dist/esm/account/Account.mjs +56 -0
- package/dist/esm/account/Ed25519Account.d.mts +34 -0
- package/dist/esm/account/Ed25519Account.mjs +54 -0
- package/dist/esm/account/EphemeralKeyPair.d.mts +80 -0
- package/dist/esm/account/EphemeralKeyPair.mjs +37 -0
- package/dist/esm/account/KeylessAccount.d.mts +145 -0
- package/dist/esm/account/KeylessAccount.mjs +57 -0
- package/dist/esm/account/MultiKeyAccount.d.mts +138 -0
- package/dist/esm/account/MultiKeyAccount.mjs +56 -0
- package/dist/esm/account/SingleKeyAccount.d.mts +34 -0
- package/dist/esm/account/SingleKeyAccount.mjs +54 -0
- package/dist/esm/account/index.d.mts +41 -0
- package/dist/esm/account/index.mjs +77 -0
- package/dist/esm/api/account.d.mts +13 -1
- package/dist/esm/api/account.mjs +76 -1
- package/dist/esm/api/ans.d.mts +2 -2
- package/dist/esm/api/ans.mjs +87 -1
- package/dist/esm/api/aptos.d.mts +15 -8
- package/dist/esm/api/aptos.mjs +116 -1
- package/dist/esm/api/aptosConfig.d.mts +20 -0
- package/dist/esm/api/aptosConfig.mjs +9 -1
- package/dist/esm/api/coin.d.mts +7 -7
- package/dist/esm/api/coin.mjs +86 -1
- package/dist/esm/api/digitalAsset.d.mts +1 -1
- package/dist/esm/api/digitalAsset.mjs +87 -1
- package/dist/esm/api/event.mjs +54 -1
- package/dist/esm/api/faucet.mjs +53 -1
- package/dist/esm/api/fungibleAsset.d.mts +5 -5
- package/dist/esm/api/fungibleAsset.mjs +87 -1
- package/dist/esm/api/general.d.mts +7 -7
- package/dist/esm/api/general.mjs +84 -1
- package/dist/esm/api/index.d.mts +14 -8
- package/dist/esm/api/index.mjs +120 -1
- package/dist/esm/api/keyless.d.mts +81 -0
- package/dist/esm/api/keyless.mjs +71 -0
- package/dist/esm/api/staking.mjs +54 -1
- package/dist/esm/api/transaction.d.mts +1 -1
- package/dist/esm/api/transaction.mjs +94 -1
- package/dist/esm/api/transactionSubmission/build.d.mts +2 -2
- package/dist/esm/api/transactionSubmission/build.mjs +85 -1
- package/dist/esm/api/transactionSubmission/helpers.mjs +9 -1
- package/dist/esm/api/transactionSubmission/management.d.mts +8 -8
- package/dist/esm/api/transactionSubmission/management.mjs +89 -1
- package/dist/esm/api/transactionSubmission/sign.d.mts +1 -1
- package/dist/esm/api/transactionSubmission/sign.mjs +109 -1
- package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -1
- package/dist/esm/api/transactionSubmission/simulate.d.mts +6 -6
- package/dist/esm/api/transactionSubmission/simulate.mjs +86 -1
- package/dist/esm/api/transactionSubmission/submit.mjs +86 -1
- package/dist/esm/api/utils.mjs +34 -1
- package/dist/esm/bcs/consts.mjs +17 -1
- package/dist/esm/bcs/deserializer.d.mts +26 -0
- package/dist/esm/bcs/deserializer.mjs +8 -1
- package/dist/esm/bcs/index.mjs +57 -1
- package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +12 -1
- package/dist/esm/bcs/serializable/fixedBytes.mjs +11 -1
- package/dist/esm/bcs/serializable/movePrimitives.mjs +25 -1
- package/dist/esm/bcs/serializable/moveStructs.mjs +18 -1
- package/dist/esm/bcs/serializer.d.mts +2 -0
- package/dist/esm/bcs/serializer.mjs +18 -1
- package/dist/esm/chunk-2JOCR2VL.mjs +32 -0
- package/dist/esm/chunk-2JOCR2VL.mjs.map +1 -0
- package/dist/esm/chunk-2OQW7BMN.mjs +129 -0
- package/dist/esm/{chunk-PZGLV5UQ.mjs.map → chunk-2OQW7BMN.mjs.map} +1 -1
- package/dist/esm/chunk-2TJJWII2.mjs +23 -0
- package/dist/esm/{chunk-DSTKXJMA.mjs.map → chunk-2TJJWII2.mjs.map} +1 -1
- package/dist/esm/chunk-2ZEGJU43.mjs +252 -0
- package/dist/esm/chunk-2ZEGJU43.mjs.map +1 -0
- package/dist/esm/chunk-4OYYOYSO.mjs +336 -0
- package/dist/esm/chunk-4OYYOYSO.mjs.map +1 -0
- package/dist/esm/{chunk-S4SEFF4K.mjs → chunk-4PJ5FYGQ.mjs} +302 -27
- package/dist/esm/{chunk-S4SEFF4K.mjs.map → chunk-4PJ5FYGQ.mjs.map} +1 -1
- package/dist/esm/chunk-55NODGHC.mjs +135 -0
- package/dist/esm/chunk-55NODGHC.mjs.map +1 -0
- package/dist/esm/chunk-6LRQSBRH.mjs +130 -0
- package/dist/esm/chunk-6LRQSBRH.mjs.map +1 -0
- package/dist/esm/chunk-6MSZMIFW.mjs +23 -0
- package/dist/esm/{chunk-BWFJHFBQ.mjs.map → chunk-6MSZMIFW.mjs.map} +1 -1
- package/dist/esm/chunk-76TSTAU4.mjs +120 -0
- package/dist/esm/chunk-76TSTAU4.mjs.map +1 -0
- package/dist/esm/chunk-7FO3S6IZ.mjs +324 -0
- package/dist/esm/{chunk-DMKUAQB7.mjs.map → chunk-7FO3S6IZ.mjs.map} +1 -1
- package/dist/esm/chunk-7FUHWL6A.mjs +42 -0
- package/dist/esm/{chunk-V3Q2KXJU.mjs.map → chunk-7FUHWL6A.mjs.map} +1 -1
- package/dist/esm/chunk-7IDBB4J4.mjs +33 -0
- package/dist/esm/{chunk-ZZZZVONX.mjs.map → chunk-7IDBB4J4.mjs.map} +1 -1
- package/dist/esm/chunk-7JRMOHBP.mjs +247 -0
- package/dist/esm/chunk-7JRMOHBP.mjs.map +1 -0
- package/dist/esm/chunk-7REUIYF4.mjs +63 -0
- package/dist/esm/chunk-7REUIYF4.mjs.map +1 -0
- package/dist/esm/chunk-7Z6DYLCA.mjs +1 -0
- package/dist/esm/chunk-7Z6DYLCA.mjs.map +1 -0
- package/dist/esm/chunk-AC3OGAL6.mjs +87 -0
- package/dist/esm/{chunk-U6Z4FNB7.mjs.map → chunk-AC3OGAL6.mjs.map} +1 -1
- package/dist/esm/chunk-AQ4I7VVB.mjs +1 -0
- package/dist/esm/chunk-AQ4I7VVB.mjs.map +1 -0
- package/dist/esm/chunk-AR7X6GWQ.mjs +356 -0
- package/dist/esm/{chunk-FS3NSGBF.mjs.map → chunk-AR7X6GWQ.mjs.map} +1 -1
- package/dist/esm/chunk-ASF2VWOX.mjs +142 -0
- package/dist/esm/{chunk-G2O323HP.mjs.map → chunk-ASF2VWOX.mjs.map} +1 -1
- package/dist/esm/chunk-ATVFVXR6.mjs +43 -0
- package/dist/esm/{chunk-VVIG4E7Q.mjs.map → chunk-ATVFVXR6.mjs.map} +1 -1
- package/dist/esm/chunk-B5S6DDUD.mjs +120 -0
- package/dist/esm/chunk-B5S6DDUD.mjs.map +1 -0
- package/dist/esm/chunk-BXMHDQHW.mjs +512 -0
- package/dist/esm/chunk-BXMHDQHW.mjs.map +1 -0
- package/dist/esm/chunk-CC4DQ6NH.mjs +19 -0
- package/dist/esm/{chunk-MACC2BLE.mjs.map → chunk-CC4DQ6NH.mjs.map} +1 -1
- package/dist/esm/chunk-CMNJG4NN.mjs +345 -0
- package/dist/esm/{chunk-IOSQVDZI.mjs.map → chunk-CMNJG4NN.mjs.map} +1 -1
- package/dist/esm/chunk-CTJSZT5V.mjs +87 -0
- package/dist/esm/{chunk-UFT7US42.mjs.map → chunk-CTJSZT5V.mjs.map} +1 -1
- package/dist/esm/chunk-CX3NAVRD.mjs +205 -0
- package/dist/esm/chunk-CX3NAVRD.mjs.map +1 -0
- package/dist/esm/chunk-CXUGZXED.mjs +307 -0
- package/dist/esm/{chunk-YU3KB3UV.mjs.map → chunk-CXUGZXED.mjs.map} +1 -1
- package/dist/esm/chunk-D2BVBXWO.mjs +7 -0
- package/dist/esm/{chunk-B7TQGVGL.mjs.map → chunk-D2BVBXWO.mjs.map} +1 -1
- package/dist/esm/chunk-DGV7DYU4.mjs +413 -0
- package/dist/esm/chunk-DGV7DYU4.mjs.map +1 -0
- package/dist/esm/chunk-DIYZRGR6.mjs +242 -0
- package/dist/esm/{chunk-O4JRPZZM.mjs.map → chunk-DIYZRGR6.mjs.map} +1 -1
- package/dist/esm/chunk-DNPMS2OF.mjs +236 -0
- package/dist/esm/{chunk-U43IJHQN.mjs.map → chunk-DNPMS2OF.mjs.map} +1 -1
- package/dist/esm/chunk-DVPQGCFT.mjs +74 -0
- package/dist/esm/{chunk-O2F53NKI.mjs.map → chunk-DVPQGCFT.mjs.map} +1 -1
- package/dist/esm/chunk-EYHRMZPO.mjs +34 -0
- package/dist/esm/{chunk-AH44UPM4.mjs.map → chunk-EYHRMZPO.mjs.map} +1 -1
- package/dist/esm/chunk-F2ZWA7B7.mjs +412 -0
- package/dist/esm/chunk-F2ZWA7B7.mjs.map +1 -0
- package/dist/esm/chunk-FDWJNY4U.mjs +22 -0
- package/dist/esm/{chunk-R5QUBEH6.mjs.map → chunk-FDWJNY4U.mjs.map} +1 -1
- package/dist/esm/chunk-FF4JPDKD.mjs +315 -0
- package/dist/esm/chunk-FF4JPDKD.mjs.map +1 -0
- package/dist/esm/chunk-FQQW55X7.mjs +288 -0
- package/dist/esm/{chunk-52C73T26.mjs.map → chunk-FQQW55X7.mjs.map} +1 -1
- package/dist/esm/chunk-FXKSE3ZP.mjs +25 -0
- package/dist/esm/{chunk-WFZDFFBM.mjs.map → chunk-FXKSE3ZP.mjs.map} +1 -1
- package/dist/esm/chunk-GBEVD2VM.mjs +99 -0
- package/dist/esm/chunk-GBEVD2VM.mjs.map +1 -0
- package/dist/esm/chunk-GGMTQAQP.mjs +11 -0
- package/dist/esm/{chunk-3JPVQHOR.mjs.map → chunk-GGMTQAQP.mjs.map} +1 -1
- package/dist/esm/chunk-GSVQ6EUD.mjs +649 -0
- package/dist/esm/chunk-GSVQ6EUD.mjs.map +1 -0
- package/dist/esm/chunk-HBNSRCZN.mjs +100 -0
- package/dist/esm/{chunk-SG4MAOCF.mjs.map → chunk-HBNSRCZN.mjs.map} +1 -1
- package/dist/esm/chunk-IC56GQFJ.mjs +127 -0
- package/dist/esm/chunk-IC56GQFJ.mjs.map +1 -0
- package/dist/esm/chunk-IHNPN5CQ.mjs +256 -0
- package/dist/esm/chunk-IHNPN5CQ.mjs.map +1 -0
- package/dist/esm/chunk-JHDHNGJ3.mjs +126 -0
- package/dist/esm/chunk-JHDHNGJ3.mjs.map +1 -0
- package/dist/esm/chunk-JL2JHVS4.mjs +49 -0
- package/dist/esm/{chunk-RHBCVCOS.mjs.map → chunk-JL2JHVS4.mjs.map} +1 -1
- package/dist/esm/chunk-JV3GSIJW.mjs +268 -0
- package/dist/esm/chunk-JV3GSIJW.mjs.map +1 -0
- package/dist/esm/chunk-JXCZTOYC.mjs +1 -0
- package/dist/esm/chunk-JXCZTOYC.mjs.map +1 -0
- package/dist/esm/chunk-KK2BSALW.mjs +32 -0
- package/dist/esm/{chunk-TBMAJ6AW.mjs.map → chunk-KK2BSALW.mjs.map} +1 -1
- package/dist/esm/chunk-KMXSRHJ6.mjs +93 -0
- package/dist/esm/chunk-KMXSRHJ6.mjs.map +1 -0
- package/dist/esm/chunk-KVSQ57HU.mjs +45 -0
- package/dist/esm/{chunk-NNQJBFRB.mjs.map → chunk-KVSQ57HU.mjs.map} +1 -1
- package/dist/esm/chunk-LI2QV6RU.mjs +129 -0
- package/dist/esm/chunk-LI2QV6RU.mjs.map +1 -0
- package/dist/esm/chunk-LLLQJWRZ.mjs +35 -0
- package/dist/esm/{chunk-DPV25ZKR.mjs.map → chunk-LLLQJWRZ.mjs.map} +1 -1
- package/dist/esm/chunk-LYK4TQZO.mjs +70 -0
- package/dist/esm/chunk-LYK4TQZO.mjs.map +1 -0
- package/dist/esm/chunk-LYMY63SO.mjs +124 -0
- package/dist/esm/{chunk-W4ZW7QHA.mjs.map → chunk-LYMY63SO.mjs.map} +1 -1
- package/dist/esm/chunk-MZZLEY6O.mjs +92 -0
- package/dist/esm/chunk-MZZLEY6O.mjs.map +1 -0
- package/dist/esm/chunk-N4WKFNQ6.mjs +156 -0
- package/dist/esm/chunk-N4WKFNQ6.mjs.map +1 -0
- package/dist/esm/chunk-NFJCQRVK.mjs +37 -0
- package/dist/esm/chunk-NFJCQRVK.mjs.map +1 -0
- package/dist/esm/chunk-NMKCJNQM.mjs +20 -0
- package/dist/esm/{chunk-TJDC5PWD.mjs.map → chunk-NMKCJNQM.mjs.map} +1 -1
- package/dist/esm/chunk-NW45SCPY.mjs +36 -0
- package/dist/esm/{chunk-GSD4OOM3.mjs.map → chunk-NW45SCPY.mjs.map} +1 -1
- package/dist/esm/chunk-NXFO2W4G.mjs +84 -0
- package/dist/esm/{chunk-QMURTXFM.mjs.map → chunk-NXFO2W4G.mjs.map} +1 -1
- package/dist/esm/chunk-NYL77J4X.mjs +97 -0
- package/dist/esm/chunk-NYL77J4X.mjs.map +1 -0
- package/dist/esm/chunk-O6PSHSN3.mjs +53 -0
- package/dist/esm/{chunk-MFKMAAWA.mjs.map → chunk-O6PSHSN3.mjs.map} +1 -1
- package/dist/esm/chunk-OR7TEZ25.mjs +16 -0
- package/dist/esm/chunk-OR7TEZ25.mjs.map +1 -0
- package/dist/esm/chunk-PCLNX6FS.mjs +17 -0
- package/dist/esm/{chunk-6FBKUTGF.mjs.map → chunk-PCLNX6FS.mjs.map} +1 -1
- package/dist/esm/chunk-PIMQHG2J.mjs +49 -0
- package/dist/esm/{chunk-ZYYK3UXP.mjs.map → chunk-PIMQHG2J.mjs.map} +1 -1
- package/dist/esm/chunk-PU5AFUX3.mjs +52 -0
- package/dist/esm/{chunk-LR65XHSF.mjs.map → chunk-PU5AFUX3.mjs.map} +1 -1
- package/dist/esm/chunk-PYLOAMR2.mjs +29 -0
- package/dist/esm/{chunk-UML2VQZT.mjs.map → chunk-PYLOAMR2.mjs.map} +1 -1
- package/dist/esm/chunk-QBBTUC66.mjs +15 -0
- package/dist/esm/{chunk-ROXFCLDT.mjs.map → chunk-QBBTUC66.mjs.map} +1 -1
- package/dist/esm/chunk-QFOG4LIN.mjs +319 -0
- package/dist/esm/{chunk-DM44OGQH.mjs.map → chunk-QFOG4LIN.mjs.map} +1 -1
- package/dist/esm/chunk-QMM2KL6C.mjs +12 -0
- package/dist/esm/{chunk-FBPNHF54.mjs.map → chunk-QMM2KL6C.mjs.map} +1 -1
- package/dist/esm/chunk-RCQMWXEW.mjs +35 -0
- package/dist/esm/{chunk-3WUGR46O.mjs.map → chunk-RCQMWXEW.mjs.map} +1 -1
- package/dist/esm/chunk-RFSO3JRG.mjs +1 -0
- package/dist/esm/chunk-RFSO3JRG.mjs.map +1 -0
- package/dist/esm/chunk-RX4VG2AT.mjs +314 -0
- package/dist/esm/{chunk-CNMQNPNV.mjs.map → chunk-RX4VG2AT.mjs.map} +1 -1
- package/dist/esm/chunk-SBB4YEPT.mjs +17 -0
- package/dist/esm/{chunk-56CNRT2K.mjs.map → chunk-SBB4YEPT.mjs.map} +1 -1
- package/dist/esm/chunk-SIJELMDP.mjs +29 -0
- package/dist/esm/{chunk-6EMN3BOV.mjs.map → chunk-SIJELMDP.mjs.map} +1 -1
- package/dist/esm/chunk-SS3NUM5L.mjs +94 -0
- package/dist/esm/{chunk-L54P6EGN.mjs.map → chunk-SS3NUM5L.mjs.map} +1 -1
- package/dist/esm/chunk-ST4QXIMI.mjs +37 -0
- package/dist/esm/{chunk-5P2S2SZZ.mjs.map → chunk-ST4QXIMI.mjs.map} +1 -1
- package/dist/esm/chunk-TBHU6ZW6.mjs +215 -0
- package/dist/esm/{chunk-7QJ6YJXP.mjs.map → chunk-TBHU6ZW6.mjs.map} +1 -1
- package/dist/esm/chunk-TLNHRJB2.mjs +155 -0
- package/dist/esm/chunk-TLNHRJB2.mjs.map +1 -0
- package/dist/esm/chunk-U3IUCR2G.mjs +54 -0
- package/dist/esm/{chunk-CU67XZNB.mjs.map → chunk-U3IUCR2G.mjs.map} +1 -1
- package/dist/esm/chunk-U7QBZ6PP.mjs +400 -0
- package/dist/esm/chunk-U7QBZ6PP.mjs.map +1 -0
- package/dist/esm/chunk-UEBBLQJ5.mjs +94 -0
- package/dist/esm/{chunk-NPFNYP75.mjs.map → chunk-UEBBLQJ5.mjs.map} +1 -1
- package/dist/esm/chunk-UKU6A2W2.mjs +232 -0
- package/dist/esm/{chunk-XO3HHRJV.mjs.map → chunk-UKU6A2W2.mjs.map} +1 -1
- package/dist/esm/chunk-UX5NSZEN.mjs +134 -0
- package/dist/esm/chunk-UX5NSZEN.mjs.map +1 -0
- package/dist/esm/chunk-VDJBDX3A.mjs +79 -0
- package/dist/esm/chunk-VDJBDX3A.mjs.map +1 -0
- package/dist/esm/chunk-VJP2VWMF.mjs +58 -0
- package/dist/esm/chunk-VJP2VWMF.mjs.map +1 -0
- package/dist/esm/chunk-VKJQORON.mjs +93 -0
- package/dist/esm/{chunk-734YX27W.mjs.map → chunk-VKJQORON.mjs.map} +1 -1
- package/dist/esm/chunk-VPWUODU4.mjs +51 -0
- package/dist/esm/{chunk-AU6W5OIH.mjs.map → chunk-VPWUODU4.mjs.map} +1 -1
- package/dist/esm/chunk-VZQXLVEP.mjs +197 -0
- package/dist/esm/{chunk-V6OS74OS.mjs.map → chunk-VZQXLVEP.mjs.map} +1 -1
- package/dist/esm/chunk-W76MGKZB.mjs +33 -0
- package/dist/esm/{chunk-CTIN3GTP.mjs.map → chunk-W76MGKZB.mjs.map} +1 -1
- package/dist/esm/chunk-WDRH2URB.mjs +91 -0
- package/dist/esm/chunk-WDRH2URB.mjs.map +1 -0
- package/dist/esm/chunk-WHBWEN6N.mjs +206 -0
- package/dist/esm/chunk-WHBWEN6N.mjs.map +1 -0
- package/dist/esm/chunk-WK5ZSNE2.mjs +173 -0
- package/dist/esm/{chunk-QIAHBEEW.mjs.map → chunk-WK5ZSNE2.mjs.map} +1 -1
- package/dist/esm/chunk-WLTBF4DF.mjs +22 -0
- package/dist/esm/chunk-WLTBF4DF.mjs.map +1 -0
- package/dist/esm/chunk-WVGO4D7K.mjs +254 -0
- package/dist/esm/chunk-WVGO4D7K.mjs.map +1 -0
- package/dist/esm/chunk-XANFAUBD.mjs +44 -0
- package/dist/esm/{chunk-QTRYMRYK.mjs.map → chunk-XANFAUBD.mjs.map} +1 -1
- package/dist/esm/chunk-Y2LV3S5W.mjs +410 -0
- package/dist/esm/chunk-Y2LV3S5W.mjs.map +1 -0
- package/dist/esm/chunk-YV7M4CFP.mjs +137 -0
- package/dist/esm/{chunk-AOCNYMMX.mjs.map → chunk-YV7M4CFP.mjs.map} +1 -1
- package/dist/esm/chunk-YYOPNUX5.mjs +41 -0
- package/dist/esm/chunk-YYOPNUX5.mjs.map +1 -0
- package/dist/esm/chunk-ZAHJ7KXB.mjs +81 -0
- package/dist/esm/chunk-ZAHJ7KXB.mjs.map +1 -0
- package/dist/esm/chunk-ZMFKQUHL.mjs +117 -0
- package/dist/esm/{chunk-RIUZPGI5.mjs.map → chunk-ZMFKQUHL.mjs.map} +1 -1
- package/dist/esm/cli/index.d.mts +12 -0
- package/dist/esm/cli/index.mjs +12 -1
- package/dist/esm/cli/localNode.mjs +8 -1
- package/dist/esm/cli/move.d.mts +105 -0
- package/dist/esm/cli/move.mjs +8 -0
- package/dist/esm/cli/move.mjs.map +1 -0
- package/dist/esm/client/core.mjs +27 -1
- package/dist/esm/client/get.d.mts +2 -1
- package/dist/esm/client/get.mjs +32 -1
- package/dist/esm/client/index.d.mts +2 -2
- package/dist/esm/client/index.mjs +55 -1
- package/dist/esm/client/post.d.mts +3 -1
- package/dist/esm/client/post.mjs +36 -1
- package/dist/esm/client/types.d.mts +5 -1
- package/dist/esm/client/types.mjs +7 -1
- package/dist/esm/core/account/index.d.mts +5 -14
- package/dist/esm/core/account/index.mjs +19 -1
- package/dist/esm/core/account/utils/address.mjs +18 -1
- package/dist/esm/core/account/utils/index.mjs +19 -1
- package/dist/esm/core/accountAddress.mjs +15 -1
- package/dist/esm/core/authenticationKey.mjs +14 -1
- package/dist/esm/core/common.mjs +7 -1
- package/dist/esm/core/crypto/ed25519.mjs +29 -1
- package/dist/esm/core/crypto/ephemeral.d.mts +73 -0
- package/dist/esm/core/crypto/ephemeral.mjs +29 -0
- package/dist/esm/core/crypto/ephemeral.mjs.map +1 -0
- package/dist/esm/core/crypto/hdKey.mjs +25 -1
- package/dist/esm/core/crypto/index.d.mts +6 -3
- package/dist/esm/core/crypto/index.mjs +124 -1
- package/dist/esm/core/crypto/keyless.d.mts +232 -0
- package/dist/esm/core/crypto/keyless.mjs +56 -0
- package/dist/esm/core/crypto/keyless.mjs.map +1 -0
- package/dist/esm/core/crypto/multiEd25519.mjs +28 -1
- package/dist/esm/core/crypto/multiKey.d.mts +7 -0
- package/dist/esm/core/crypto/multiKey.mjs +34 -1
- package/dist/esm/core/crypto/poseidon.d.mts +7 -0
- package/dist/esm/core/crypto/poseidon.mjs +16 -0
- package/dist/esm/core/crypto/poseidon.mjs.map +1 -0
- package/dist/esm/core/crypto/privateKey.mjs +1 -1
- package/dist/esm/core/crypto/proof.d.mts +21 -0
- package/dist/esm/core/crypto/proof.mjs +20 -0
- package/dist/esm/core/crypto/proof.mjs.map +1 -0
- package/dist/esm/core/crypto/publicKey.mjs +21 -1
- package/dist/esm/core/crypto/secp256k1.mjs +27 -1
- package/dist/esm/core/crypto/signature.mjs +19 -1
- package/dist/esm/core/crypto/singleKey.mjs +33 -1
- package/dist/esm/core/crypto/utils.mjs +9 -1
- package/dist/esm/core/hex.mjs +10 -1
- package/dist/esm/core/index.d.mts +5 -5
- package/dist/esm/core/index.mjs +141 -1
- package/dist/esm/index.d.mts +15 -8
- package/dist/esm/index.mjs +635 -1
- package/dist/esm/internal/account.d.mts +13 -1
- package/dist/esm/internal/account.mjs +106 -1
- package/dist/esm/internal/ans.d.mts +1 -1
- package/dist/esm/internal/ans.mjs +120 -1
- package/dist/esm/internal/coin.d.mts +7 -7
- package/dist/esm/internal/coin.mjs +85 -1
- package/dist/esm/internal/digitalAsset.d.mts +2 -2
- package/dist/esm/internal/digitalAsset.mjs +127 -1
- package/dist/esm/internal/event.d.mts +1 -1
- package/dist/esm/internal/event.mjs +55 -1
- package/dist/esm/internal/faucet.d.mts +1 -1
- package/dist/esm/internal/faucet.mjs +52 -1
- package/dist/esm/internal/fungibleAsset.d.mts +5 -5
- package/dist/esm/internal/fungibleAsset.mjs +91 -1
- package/dist/esm/internal/general.mjs +46 -1
- package/dist/esm/internal/keyless.d.mts +68 -0
- package/dist/esm/internal/keyless.mjs +74 -0
- package/dist/esm/internal/keyless.mjs.map +1 -0
- package/dist/esm/internal/staking.d.mts +1 -1
- package/dist/esm/internal/staking.mjs +53 -1
- package/dist/esm/internal/transaction.mjs +51 -1
- package/dist/esm/internal/transactionSubmission.d.mts +1 -1
- package/dist/esm/internal/transactionSubmission.mjs +102 -1
- package/dist/esm/internal/view.d.mts +7 -7
- package/dist/esm/internal/view.mjs +83 -1
- package/dist/esm/transactions/authenticator/account.d.mts +3 -4
- package/dist/esm/transactions/authenticator/account.mjs +44 -1
- package/dist/esm/transactions/authenticator/index.mjs +60 -1
- package/dist/esm/transactions/authenticator/transaction.mjs +48 -1
- package/dist/esm/transactions/index.d.mts +2 -2
- package/dist/esm/transactions/index.mjs +284 -1
- package/dist/esm/transactions/instances/chainId.mjs +11 -1
- package/dist/esm/transactions/instances/identifier.mjs +11 -1
- package/dist/esm/transactions/instances/index.mjs +96 -1
- package/dist/esm/transactions/instances/moduleId.d.mts +1 -1
- package/dist/esm/transactions/instances/moduleId.mjs +38 -1
- package/dist/esm/transactions/instances/multiAgentTransaction.mjs +43 -1
- package/dist/esm/transactions/instances/rawTransaction.mjs +48 -1
- package/dist/esm/transactions/instances/rotationProofChallenge.mjs +20 -1
- package/dist/esm/transactions/instances/signedTransaction.mjs +45 -1
- package/dist/esm/transactions/instances/simpleTransaction.mjs +43 -1
- package/dist/esm/transactions/instances/transactionArgument.mjs +1 -1
- package/dist/esm/transactions/instances/transactionPayload.d.mts +1 -1
- package/dist/esm/transactions/instances/transactionPayload.mjs +56 -1
- package/dist/esm/transactions/management/accountSequenceNumber.d.mts +13 -1
- package/dist/esm/transactions/management/accountSequenceNumber.mjs +74 -1
- package/dist/esm/transactions/management/asyncQueue.mjs +9 -1
- package/dist/esm/transactions/management/index.d.mts +2 -2
- package/dist/esm/transactions/management/index.mjs +95 -1
- package/dist/esm/transactions/management/transactionWorker.d.mts +1 -1
- package/dist/esm/transactions/management/transactionWorker.mjs +91 -1
- package/dist/esm/transactions/transactionBuilder/helpers.d.mts +9 -9
- package/dist/esm/transactions/transactionBuilder/helpers.mjs +75 -1
- package/dist/esm/transactions/transactionBuilder/index.d.mts +9 -9
- package/dist/esm/transactions/transactionBuilder/index.mjs +162 -1
- package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +6 -6
- package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +85 -1
- package/dist/esm/transactions/transactionBuilder/signingMessage.d.mts +72 -0
- package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +59 -0
- package/dist/esm/transactions/transactionBuilder/signingMessage.mjs.map +1 -0
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +6 -28
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +98 -1
- package/dist/esm/transactions/typeTag/index.mjs +74 -1
- package/dist/esm/transactions/typeTag/parser.mjs +43 -1
- package/dist/esm/transactions/types.d.mts +6 -6
- package/dist/esm/transactions/types.mjs +1 -1
- package/dist/esm/types/generated/queries.mjs +57 -1
- package/dist/esm/types/generated/types.mjs +809 -1
- package/dist/esm/types/generated/types.mjs.map +1 -1
- package/dist/esm/types/index.d.mts +19 -3
- package/dist/esm/types/index.mjs +68 -1
- package/dist/esm/types/indexer.mjs +1 -1
- package/dist/esm/types/keyless.d.mts +69 -0
- package/dist/esm/types/keyless.mjs +10 -0
- package/dist/esm/types/keyless.mjs.map +1 -0
- package/dist/esm/utils/apiEndpoints.d.mts +3 -2
- package/dist/esm/utils/apiEndpoints.mjs +21 -1
- package/dist/esm/utils/const.d.mts +3 -1
- package/dist/esm/utils/const.mjs +21 -1
- package/dist/esm/utils/helpers.mjs +7 -1
- package/dist/esm/utils/index.d.mts +1 -1
- package/dist/esm/utils/index.mjs +56 -1
- package/dist/esm/utils/memoize.mjs +9 -1
- package/dist/esm/utils/normalizeBundle.mjs +19 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +7 -1
- package/package.json +11 -3
- package/src/{core/account → account}/Account.ts +25 -15
- package/src/{core/account → account}/Ed25519Account.ts +45 -9
- package/src/account/EphemeralKeyPair.ts +161 -0
- package/src/account/KeylessAccount.ts +342 -0
- package/src/account/MultiKeyAccount.ts +186 -0
- package/src/{core/account → account}/SingleKeyAccount.ts +45 -10
- package/src/account/index.ts +6 -0
- package/src/api/account.ts +2 -1
- package/src/api/ans.ts +2 -1
- package/src/api/aptos.ts +6 -0
- package/src/api/aptosConfig.ts +46 -1
- package/src/api/digitalAsset.ts +2 -1
- package/src/api/fungibleAsset.ts +2 -1
- package/src/api/keyless.ts +48 -0
- package/src/api/transaction.ts +2 -1
- package/src/api/transactionSubmission/management.ts +1 -1
- package/src/api/transactionSubmission/sign.ts +1 -1
- package/src/bcs/deserializer.ts +40 -0
- package/src/bcs/serializer.ts +18 -0
- package/src/cli/index.ts +1 -0
- package/src/cli/move.ts +183 -0
- package/src/client/core.ts +8 -0
- package/src/client/get.ts +6 -0
- package/src/client/post.ts +12 -0
- package/src/client/types.ts +1 -1
- package/src/core/account/index.ts +0 -3
- package/src/core/crypto/ephemeral.ts +138 -0
- package/src/core/crypto/index.ts +2 -0
- package/src/core/crypto/keyless.ts +453 -0
- package/src/core/crypto/multiKey.ts +17 -6
- package/src/core/crypto/poseidon.ts +134 -0
- package/src/core/crypto/proof.ts +16 -0
- package/src/core/crypto/singleKey.ts +11 -0
- package/src/core/index.ts +0 -1
- package/src/index.ts +1 -0
- package/src/internal/account.ts +1 -1
- package/src/internal/ans.ts +2 -2
- package/src/internal/digitalAsset.ts +2 -1
- package/src/internal/fungibleAsset.ts +3 -2
- package/src/internal/keyless.ts +119 -0
- package/src/internal/transactionSubmission.ts +24 -13
- package/src/transactions/authenticator/account.ts +6 -11
- package/src/transactions/management/accountSequenceNumber.ts +1 -1
- package/src/transactions/management/transactionWorker.ts +1 -1
- package/src/transactions/transactionBuilder/index.ts +1 -0
- package/src/transactions/transactionBuilder/signingMessage.ts +93 -0
- package/src/transactions/transactionBuilder/transactionBuilder.ts +2 -75
- package/src/types/index.ts +22 -0
- package/src/types/keyless.ts +37 -0
- package/src/utils/apiEndpoints.ts +14 -6
- package/src/utils/const.ts +2 -0
- package/src/version.ts +1 -1
- package/dist/common/chunk-KSEUZTKY.js +0 -2
- package/dist/common/chunk-KSEUZTKY.js.map +0 -1
- package/dist/esm/chunk-24IKVZBK.mjs +0 -2
- package/dist/esm/chunk-24IKVZBK.mjs.map +0 -1
- package/dist/esm/chunk-2HISPUZZ.mjs +0 -2
- package/dist/esm/chunk-2HISPUZZ.mjs.map +0 -1
- package/dist/esm/chunk-3JPVQHOR.mjs +0 -2
- package/dist/esm/chunk-3WUGR46O.mjs +0 -2
- package/dist/esm/chunk-52C73T26.mjs +0 -2
- package/dist/esm/chunk-56CNRT2K.mjs +0 -2
- package/dist/esm/chunk-5P2S2SZZ.mjs +0 -2
- package/dist/esm/chunk-6CFRW26C.mjs +0 -2
- package/dist/esm/chunk-6CFRW26C.mjs.map +0 -1
- package/dist/esm/chunk-6EMN3BOV.mjs +0 -2
- package/dist/esm/chunk-6FBKUTGF.mjs +0 -2
- package/dist/esm/chunk-6IFMQ5AS.mjs +0 -2
- package/dist/esm/chunk-6IFMQ5AS.mjs.map +0 -1
- package/dist/esm/chunk-734YX27W.mjs +0 -2
- package/dist/esm/chunk-7QJ6YJXP.mjs +0 -2
- package/dist/esm/chunk-AD3VLZ7I.mjs +0 -2
- package/dist/esm/chunk-AD3VLZ7I.mjs.map +0 -1
- package/dist/esm/chunk-AH44UPM4.mjs +0 -2
- package/dist/esm/chunk-AOCNYMMX.mjs +0 -2
- package/dist/esm/chunk-AU6W5OIH.mjs +0 -2
- package/dist/esm/chunk-B3R6G6QP.mjs +0 -2
- package/dist/esm/chunk-B3R6G6QP.mjs.map +0 -1
- package/dist/esm/chunk-B7TQGVGL.mjs +0 -2
- package/dist/esm/chunk-BWFJHFBQ.mjs +0 -2
- package/dist/esm/chunk-CNMQNPNV.mjs +0 -2
- package/dist/esm/chunk-CTIN3GTP.mjs +0 -2
- package/dist/esm/chunk-CU67XZNB.mjs +0 -2
- package/dist/esm/chunk-CYNQRMO5.mjs +0 -2
- package/dist/esm/chunk-CYNQRMO5.mjs.map +0 -1
- package/dist/esm/chunk-DM44OGQH.mjs +0 -2
- package/dist/esm/chunk-DMKUAQB7.mjs +0 -2
- package/dist/esm/chunk-DPV25ZKR.mjs +0 -2
- package/dist/esm/chunk-DSTKXJMA.mjs +0 -2
- package/dist/esm/chunk-E7FWVXGX.mjs +0 -1
- package/dist/esm/chunk-EOFJFE4T.mjs +0 -2
- package/dist/esm/chunk-EOFJFE4T.mjs.map +0 -1
- package/dist/esm/chunk-FATWMUXK.mjs +0 -2
- package/dist/esm/chunk-FATWMUXK.mjs.map +0 -1
- package/dist/esm/chunk-FBPNHF54.mjs +0 -2
- package/dist/esm/chunk-FS3NSGBF.mjs +0 -2
- package/dist/esm/chunk-FVA2OPG4.mjs +0 -2
- package/dist/esm/chunk-G2O323HP.mjs +0 -2
- package/dist/esm/chunk-GSD4OOM3.mjs +0 -2
- package/dist/esm/chunk-HQ5I4Q3H.mjs +0 -2
- package/dist/esm/chunk-HQ5I4Q3H.mjs.map +0 -1
- package/dist/esm/chunk-IIPYR7PF.mjs +0 -2
- package/dist/esm/chunk-IIPYR7PF.mjs.map +0 -1
- package/dist/esm/chunk-IKYIJYBY.mjs +0 -2
- package/dist/esm/chunk-IKYIJYBY.mjs.map +0 -1
- package/dist/esm/chunk-IOSQVDZI.mjs +0 -2
- package/dist/esm/chunk-KVZ4XMZS.mjs +0 -2
- package/dist/esm/chunk-KVZ4XMZS.mjs.map +0 -1
- package/dist/esm/chunk-L54P6EGN.mjs +0 -2
- package/dist/esm/chunk-LR65XHSF.mjs +0 -2
- package/dist/esm/chunk-MACC2BLE.mjs +0 -2
- package/dist/esm/chunk-MC6G725U.mjs +0 -2
- package/dist/esm/chunk-MC6G725U.mjs.map +0 -1
- package/dist/esm/chunk-MFKMAAWA.mjs +0 -2
- package/dist/esm/chunk-MLWIHWNH.mjs +0 -1
- package/dist/esm/chunk-NNQJBFRB.mjs +0 -2
- package/dist/esm/chunk-NPFNYP75.mjs +0 -2
- package/dist/esm/chunk-O2F53NKI.mjs +0 -2
- package/dist/esm/chunk-O4JRPZZM.mjs +0 -2
- package/dist/esm/chunk-ODRO4CSA.mjs +0 -2
- package/dist/esm/chunk-ODRO4CSA.mjs.map +0 -1
- package/dist/esm/chunk-OVJQWQ2N.mjs +0 -2
- package/dist/esm/chunk-OVJQWQ2N.mjs.map +0 -1
- package/dist/esm/chunk-OWW6SIDP.mjs +0 -2
- package/dist/esm/chunk-OWW6SIDP.mjs.map +0 -1
- package/dist/esm/chunk-PFIMEXNN.mjs +0 -2
- package/dist/esm/chunk-PFIMEXNN.mjs.map +0 -1
- package/dist/esm/chunk-PZGLV5UQ.mjs +0 -2
- package/dist/esm/chunk-Q3TZGQVC.mjs +0 -2
- package/dist/esm/chunk-Q3TZGQVC.mjs.map +0 -1
- package/dist/esm/chunk-QIAHBEEW.mjs +0 -2
- package/dist/esm/chunk-QMURTXFM.mjs +0 -2
- package/dist/esm/chunk-QTRYMRYK.mjs +0 -2
- package/dist/esm/chunk-R5QUBEH6.mjs +0 -2
- package/dist/esm/chunk-R7G3CLRI.mjs +0 -1
- package/dist/esm/chunk-RHBCVCOS.mjs +0 -2
- package/dist/esm/chunk-RIUZPGI5.mjs +0 -2
- package/dist/esm/chunk-ROXFCLDT.mjs +0 -2
- package/dist/esm/chunk-SG4MAOCF.mjs +0 -2
- package/dist/esm/chunk-SUAKPNKQ.mjs +0 -2
- package/dist/esm/chunk-SUAKPNKQ.mjs.map +0 -1
- package/dist/esm/chunk-TBMAJ6AW.mjs +0 -2
- package/dist/esm/chunk-TJDC5PWD.mjs +0 -2
- package/dist/esm/chunk-TLOPIURC.mjs +0 -2
- package/dist/esm/chunk-TLOPIURC.mjs.map +0 -1
- package/dist/esm/chunk-U43IJHQN.mjs +0 -2
- package/dist/esm/chunk-U6Z4FNB7.mjs +0 -2
- package/dist/esm/chunk-UFT7US42.mjs +0 -2
- package/dist/esm/chunk-UML2VQZT.mjs +0 -2
- package/dist/esm/chunk-UVSRX4SV.mjs +0 -1
- package/dist/esm/chunk-V3Q2KXJU.mjs +0 -2
- package/dist/esm/chunk-V4SRNEV3.mjs +0 -2
- package/dist/esm/chunk-V4SRNEV3.mjs.map +0 -1
- package/dist/esm/chunk-V6OS74OS.mjs +0 -2
- package/dist/esm/chunk-VVIG4E7Q.mjs +0 -2
- package/dist/esm/chunk-W4ZW7QHA.mjs +0 -2
- package/dist/esm/chunk-WFZDFFBM.mjs +0 -2
- package/dist/esm/chunk-WLF5YQM4.mjs +0 -2
- package/dist/esm/chunk-WLF5YQM4.mjs.map +0 -1
- package/dist/esm/chunk-XDGQTMDV.mjs +0 -2
- package/dist/esm/chunk-XDGQTMDV.mjs.map +0 -1
- package/dist/esm/chunk-XO3HHRJV.mjs +0 -2
- package/dist/esm/chunk-YFRXBEOC.mjs +0 -2
- package/dist/esm/chunk-YFRXBEOC.mjs.map +0 -1
- package/dist/esm/chunk-YPTF6MLX.mjs +0 -2
- package/dist/esm/chunk-YPTF6MLX.mjs.map +0 -1
- package/dist/esm/chunk-YU3KB3UV.mjs +0 -2
- package/dist/esm/chunk-Z5YFM2AW.mjs +0 -2
- package/dist/esm/chunk-Z5YFM2AW.mjs.map +0 -1
- package/dist/esm/chunk-ZYYK3UXP.mjs +0 -2
- package/dist/esm/chunk-ZZZZVONX.mjs +0 -2
- package/dist/esm/core/account/Account.d.mts +0 -20
- package/dist/esm/core/account/Account.mjs +0 -2
- package/dist/esm/core/account/Ed25519Account.d.mts +0 -20
- package/dist/esm/core/account/Ed25519Account.mjs +0 -2
- package/dist/esm/core/account/SingleKeyAccount.d.mts +0 -20
- package/dist/esm/core/account/SingleKeyAccount.mjs +0 -2
- /package/dist/esm/{core/account → account}/Account.mjs.map +0 -0
- /package/dist/esm/{core/account → account}/Ed25519Account.mjs.map +0 -0
- /package/dist/esm/{chunk-E7FWVXGX.mjs.map → account/EphemeralKeyPair.mjs.map} +0 -0
- /package/dist/esm/{chunk-FVA2OPG4.mjs.map → account/KeylessAccount.mjs.map} +0 -0
- /package/dist/esm/{chunk-MLWIHWNH.mjs.map → account/MultiKeyAccount.mjs.map} +0 -0
- /package/dist/esm/{core/account → account}/SingleKeyAccount.mjs.map +0 -0
- /package/dist/esm/{chunk-R7G3CLRI.mjs.map → account/index.mjs.map} +0 -0
- /package/dist/esm/{chunk-UVSRX4SV.mjs.map → api/keyless.mjs.map} +0 -0
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Simulate
|
|
3
|
+
} from "./chunk-W76MGKZB.mjs";
|
|
4
|
+
import {
|
|
5
|
+
Submit
|
|
6
|
+
} from "./chunk-7IDBB4J4.mjs";
|
|
7
|
+
import {
|
|
8
|
+
Build
|
|
9
|
+
} from "./chunk-7FUHWL6A.mjs";
|
|
10
|
+
import {
|
|
11
|
+
TransactionManagement
|
|
12
|
+
} from "./chunk-WDRH2URB.mjs";
|
|
13
|
+
import {
|
|
14
|
+
getSigningMessage,
|
|
15
|
+
publicPackageTransaction,
|
|
16
|
+
rotateAuthKey,
|
|
17
|
+
signAndSubmitTransaction,
|
|
18
|
+
signTransaction
|
|
19
|
+
} from "./chunk-IHNPN5CQ.mjs";
|
|
20
|
+
import {
|
|
21
|
+
getGasPriceEstimation,
|
|
22
|
+
getTransactionByHash,
|
|
23
|
+
getTransactionByVersion,
|
|
24
|
+
getTransactions,
|
|
25
|
+
isTransactionPending,
|
|
26
|
+
waitForTransaction
|
|
27
|
+
} from "./chunk-TBHU6ZW6.mjs";
|
|
28
|
+
|
|
29
|
+
// src/api/transaction.ts
|
|
30
|
+
var Transaction = class {
|
|
31
|
+
constructor(config) {
|
|
32
|
+
this.config = config;
|
|
33
|
+
this.build = new Build(this.config);
|
|
34
|
+
this.simulate = new Simulate(this.config);
|
|
35
|
+
this.submit = new Submit(this.config);
|
|
36
|
+
this.batch = new TransactionManagement(this.config);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Queries on-chain transactions. This function will not return pending
|
|
40
|
+
* transactions. For that, use `getTransactionsByHash`.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* const transactions = await aptos.getTransactions()
|
|
44
|
+
*
|
|
45
|
+
* @param args.options.offset The number transaction to start with
|
|
46
|
+
* @param args.options.limit Number of results to return
|
|
47
|
+
*
|
|
48
|
+
* @returns Array of on-chain transactions
|
|
49
|
+
*/
|
|
50
|
+
async getTransactions(args) {
|
|
51
|
+
return getTransactions({
|
|
52
|
+
aptosConfig: this.config,
|
|
53
|
+
...args
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Queries on-chain transaction by version. This function will not return pending transactions.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* const transaction = await aptos.getTransactions({ledgerVersion:1})
|
|
61
|
+
*
|
|
62
|
+
* @param args.ledgerVersion - Transaction version is an unsigned 64-bit number.
|
|
63
|
+
* @returns On-chain transaction. Only on-chain transactions have versions, so this
|
|
64
|
+
* function cannot be used to query pending transactions.
|
|
65
|
+
*/
|
|
66
|
+
async getTransactionByVersion(args) {
|
|
67
|
+
return getTransactionByVersion({
|
|
68
|
+
aptosConfig: this.config,
|
|
69
|
+
...args
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Queries on-chain transaction by transaction hash. This function will return pending transactions.
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* const transaction = await aptos.getTransactionByHash({transactionHash:"0x123"})
|
|
77
|
+
*
|
|
78
|
+
* @param args.transactionHash - Transaction hash should be hex-encoded bytes string with 0x prefix.
|
|
79
|
+
* @returns Transaction from mempool (pending) or on-chain (committed) transaction
|
|
80
|
+
*/
|
|
81
|
+
async getTransactionByHash(args) {
|
|
82
|
+
return getTransactionByHash({
|
|
83
|
+
aptosConfig: this.config,
|
|
84
|
+
...args
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Defines if specified transaction is currently in pending state
|
|
89
|
+
*
|
|
90
|
+
* To create a transaction hash:
|
|
91
|
+
*
|
|
92
|
+
* 1. Create a hash message from the bytes: "Aptos::Transaction" bytes + the BCS-serialized Transaction bytes.
|
|
93
|
+
* 2. Apply hash algorithm SHA3-256 to the hash message bytes.
|
|
94
|
+
* 3. Hex-encode the hash bytes with 0x prefix.
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* const isPendingTransaction = await aptos.isPendingTransaction({transactionHash:"0x123"})
|
|
98
|
+
*
|
|
99
|
+
* @param args.transactionHash A hash of transaction
|
|
100
|
+
* @returns `true` if transaction is in pending state and `false` otherwise
|
|
101
|
+
*/
|
|
102
|
+
async isPendingTransaction(args) {
|
|
103
|
+
return isTransactionPending({
|
|
104
|
+
aptosConfig: this.config,
|
|
105
|
+
...args
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Waits for a transaction to move past the pending state.
|
|
110
|
+
*
|
|
111
|
+
* There are 4 cases.
|
|
112
|
+
* 1. Transaction is successfully processed and committed to the chain.
|
|
113
|
+
* - The function will resolve with the transaction response from the API.
|
|
114
|
+
* 2. Transaction is rejected for some reason, and is therefore not committed to the blockchain.
|
|
115
|
+
* - The function will throw an AptosApiError with an HTTP status code indicating some problem with the request.
|
|
116
|
+
* 3. Transaction is committed but execution failed, meaning no changes were
|
|
117
|
+
* written to the blockchain state.
|
|
118
|
+
* - If `checkSuccess` is true, the function will throw a FailedTransactionError
|
|
119
|
+
* If `checkSuccess` is false, the function will resolve with the transaction response where the `success` field is false.
|
|
120
|
+
* 4. Transaction does not move past the pending state within `args.options.timeoutSecs` seconds.
|
|
121
|
+
* - The function will throw a WaitForTransactionError
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* const transaction = await aptos.waitForTransaction({transactionHash:"0x123"})
|
|
125
|
+
*
|
|
126
|
+
* @param args.transactionHash The hash of a transaction previously submitted to the blockchain.
|
|
127
|
+
* @param args.options.timeoutSecs Timeout in seconds. Defaults to 20 seconds.
|
|
128
|
+
* @param args.options.checkSuccess A boolean which controls whether the function will error if the transaction failed.
|
|
129
|
+
* Defaults to true. See case 3 above.
|
|
130
|
+
* @returns The transaction on-chain. See above for more details.
|
|
131
|
+
*/
|
|
132
|
+
async waitForTransaction(args) {
|
|
133
|
+
return waitForTransaction({
|
|
134
|
+
aptosConfig: this.config,
|
|
135
|
+
...args
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Gives an estimate of the gas unit price required to get a
|
|
140
|
+
* transaction on chain in a reasonable amount of time.
|
|
141
|
+
* For more information {@link https://api.mainnet.aptoslabs.com/v1/spec#/operations/estimate_gas_price}
|
|
142
|
+
*
|
|
143
|
+
* @returns Object holding the outputs of the estimate gas API
|
|
144
|
+
*
|
|
145
|
+
* @example
|
|
146
|
+
* const gasPrice = await aptos.waitForTransaction()
|
|
147
|
+
*/
|
|
148
|
+
async getGasPriceEstimation() {
|
|
149
|
+
return getGasPriceEstimation({
|
|
150
|
+
aptosConfig: this.config
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Returns a signing message for a transaction.
|
|
155
|
+
*
|
|
156
|
+
* This allows a user to sign a transaction using their own preferred signing method, and
|
|
157
|
+
* then submit it to the network.
|
|
158
|
+
*
|
|
159
|
+
* @example
|
|
160
|
+
* const transaction = await aptos.transaction.build.simple({...})
|
|
161
|
+
* const message = await aptos.getSigningMessage({transaction})
|
|
162
|
+
*
|
|
163
|
+
* @param args.transaction A raw transaction for signing elsewhere
|
|
164
|
+
*/
|
|
165
|
+
// eslint-disable-next-line class-methods-use-this
|
|
166
|
+
getSigningMessage(args) {
|
|
167
|
+
return getSigningMessage(args);
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Generates a transaction to publish a move package to chain.
|
|
171
|
+
*
|
|
172
|
+
* To get the `metadataBytes` and `byteCode`, can compile using Aptos CLI with command
|
|
173
|
+
* `aptos move compile --save-metadata ...`,
|
|
174
|
+
* For more info {@link https://aptos.dev/tutorials/your-first-dapp/#step-4-publish-a-move-module}
|
|
175
|
+
*
|
|
176
|
+
* @example
|
|
177
|
+
* const transaction = await aptos.publishPackageTransaction({
|
|
178
|
+
* account: alice,
|
|
179
|
+
* metadataBytes,
|
|
180
|
+
* moduleBytecode: [byteCode],
|
|
181
|
+
* })
|
|
182
|
+
*
|
|
183
|
+
* @param args.account The publisher account
|
|
184
|
+
* @param args.metadataBytes The package metadata bytes
|
|
185
|
+
* @param args.moduleBytecode An array of the bytecode of each module in the package in compiler output order
|
|
186
|
+
*
|
|
187
|
+
* @returns A SimpleTransaction that can be simulated or submitted to chain
|
|
188
|
+
*/
|
|
189
|
+
async publishPackageTransaction(args) {
|
|
190
|
+
return publicPackageTransaction({ aptosConfig: this.config, ...args });
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Rotate an account's auth key. After rotation, only the new private key can be used to sign txns for
|
|
194
|
+
* the account.
|
|
195
|
+
* Note: Only legacy Ed25519 scheme is supported for now.
|
|
196
|
+
* More info: {@link https://aptos.dev/guides/account-management/key-rotation/}
|
|
197
|
+
*
|
|
198
|
+
* @example
|
|
199
|
+
* const response = await aptos.rotateAuthKey({
|
|
200
|
+
* fromAccount: alice,
|
|
201
|
+
* toNewPrivateKey: new ED25519PublicKey("0x123"),
|
|
202
|
+
* })
|
|
203
|
+
*
|
|
204
|
+
* @param args.fromAccount The account to rotate the auth key for
|
|
205
|
+
* @param args.toNewPrivateKey The new private key to rotate to
|
|
206
|
+
*
|
|
207
|
+
* @returns PendingTransactionResponse
|
|
208
|
+
*/
|
|
209
|
+
async rotateAuthKey(args) {
|
|
210
|
+
return rotateAuthKey({ aptosConfig: this.config, ...args });
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Sign a transaction that can later be submitted to chain
|
|
214
|
+
*
|
|
215
|
+
* @example
|
|
216
|
+
* const transaction = await aptos.transaction.build.simple({...})
|
|
217
|
+
* const transaction = await aptos.transaction.sign({
|
|
218
|
+
* signer: alice,
|
|
219
|
+
* transaction
|
|
220
|
+
* })
|
|
221
|
+
*
|
|
222
|
+
* @param args.signer The signer account
|
|
223
|
+
* @param args.transaction A raw transaction to sign on
|
|
224
|
+
*
|
|
225
|
+
* @returns AccountAuthenticator
|
|
226
|
+
*/
|
|
227
|
+
// eslint-disable-next-line class-methods-use-this
|
|
228
|
+
sign(args) {
|
|
229
|
+
return signTransaction({
|
|
230
|
+
...args
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Sign a transaction as a fee payer that can later be submitted to chain
|
|
235
|
+
*
|
|
236
|
+
* @example
|
|
237
|
+
* const transaction = await aptos.transaction.build.simple({...})
|
|
238
|
+
* const transaction = await aptos.transaction.signAsFeePayer({
|
|
239
|
+
* signer: alice,
|
|
240
|
+
* transaction
|
|
241
|
+
* })
|
|
242
|
+
*
|
|
243
|
+
* @param args.signer The fee payer signer account
|
|
244
|
+
* @param args.transaction A raw transaction to sign on
|
|
245
|
+
*
|
|
246
|
+
* @returns AccountAuthenticator
|
|
247
|
+
*/
|
|
248
|
+
// eslint-disable-next-line class-methods-use-this
|
|
249
|
+
signAsFeePayer(args) {
|
|
250
|
+
const { signer, transaction } = args;
|
|
251
|
+
if (!transaction.feePayerAddress) {
|
|
252
|
+
throw new Error(`Transaction ${transaction} is not a Fee Payer transaction`);
|
|
253
|
+
}
|
|
254
|
+
transaction.feePayerAddress = signer.accountAddress;
|
|
255
|
+
return signTransaction({
|
|
256
|
+
signer,
|
|
257
|
+
transaction
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
// TRANSACTION SUBMISSION //
|
|
261
|
+
/**
|
|
262
|
+
* @deprecated Prefer to use `aptos.transaction.batch.forSingleAccount()`
|
|
263
|
+
*
|
|
264
|
+
* Batch transactions for a single account.
|
|
265
|
+
*
|
|
266
|
+
* This function uses a transaction worker that receives payloads to be processed
|
|
267
|
+
* and submitted to chain.
|
|
268
|
+
* Note that this process is best for submitting multiple transactions that
|
|
269
|
+
* dont rely on each other, i.e batch funds, batch token mints, etc.
|
|
270
|
+
*
|
|
271
|
+
* If any worker failure, the functions throws an error.
|
|
272
|
+
*
|
|
273
|
+
* @param args.sender The sender account to sign and submit the transaction
|
|
274
|
+
* @param args.data An array of transaction payloads
|
|
275
|
+
* @param args.options optional. Transaction generation configurations (excluding accountSequenceNumber)
|
|
276
|
+
*
|
|
277
|
+
* @return void. Throws if any error
|
|
278
|
+
*/
|
|
279
|
+
async batchTransactionsForSingleAccount(args) {
|
|
280
|
+
try {
|
|
281
|
+
const { sender, data, options } = args;
|
|
282
|
+
this.batch.forSingleAccount({ sender, data, options });
|
|
283
|
+
} catch (error) {
|
|
284
|
+
throw new Error(`failed to submit transactions with error: ${error}`);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Sign and submit a single signer transaction to chain
|
|
289
|
+
*
|
|
290
|
+
* @param args.signer The signer account to sign the transaction
|
|
291
|
+
* @param args.transaction An instance of a RawTransaction, plus optional secondary/fee payer addresses
|
|
292
|
+
*
|
|
293
|
+
* @example
|
|
294
|
+
* const transaction = await aptos.transaction.build.simple({...})
|
|
295
|
+
* const transaction = await aptos.signAndSubmitTransaction({
|
|
296
|
+
* signer: alice,
|
|
297
|
+
* transaction
|
|
298
|
+
* })
|
|
299
|
+
*
|
|
300
|
+
* @return PendingTransactionResponse
|
|
301
|
+
*/
|
|
302
|
+
async signAndSubmitTransaction(args) {
|
|
303
|
+
const { signer, transaction } = args;
|
|
304
|
+
return signAndSubmitTransaction({
|
|
305
|
+
aptosConfig: this.config,
|
|
306
|
+
signer,
|
|
307
|
+
transaction
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
export {
|
|
313
|
+
Transaction
|
|
314
|
+
};
|
|
315
|
+
//# sourceMappingURL=chunk-FF4JPDKD.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/api/transaction.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { AptosConfig } from \"./aptosConfig\";\nimport {\n getGasPriceEstimation,\n getTransactionByHash,\n getTransactionByVersion,\n getTransactions,\n isTransactionPending,\n waitForTransaction,\n} from \"../internal/transaction\";\nimport {\n AnyNumber,\n CommittedTransactionResponse,\n GasEstimation,\n HexInput,\n PaginationArgs,\n PendingTransactionResponse,\n TransactionResponse,\n WaitForTransactionOptions,\n} from \"../types\";\nimport {\n getSigningMessage,\n publicPackageTransaction,\n rotateAuthKey,\n signAndSubmitTransaction,\n signTransaction,\n} from \"../internal/transactionSubmission\";\nimport {\n AccountAuthenticator,\n AnyRawTransaction,\n InputGenerateTransactionOptions,\n InputGenerateTransactionPayloadData,\n} from \"../transactions\";\nimport { AccountAddressInput, PrivateKey } from \"../core\";\nimport { Account } from \"../account\";\nimport { Build } from \"./transactionSubmission/build\";\nimport { Simulate } from \"./transactionSubmission/simulate\";\nimport { Submit } from \"./transactionSubmission/submit\";\nimport { TransactionManagement } from \"./transactionSubmission/management\";\nimport { SimpleTransaction } from \"../transactions/instances/simpleTransaction\";\n\nexport class Transaction {\n readonly config: AptosConfig;\n\n readonly build: Build;\n\n readonly simulate: Simulate;\n\n readonly submit: Submit;\n\n readonly batch: TransactionManagement;\n\n constructor(config: AptosConfig) {\n this.config = config;\n this.build = new Build(this.config);\n this.simulate = new Simulate(this.config);\n this.submit = new Submit(this.config);\n this.batch = new TransactionManagement(this.config);\n }\n\n /**\n * Queries on-chain transactions. This function will not return pending\n * transactions. For that, use `getTransactionsByHash`.\n *\n * @example\n * const transactions = await aptos.getTransactions()\n *\n * @param args.options.offset The number transaction to start with\n * @param args.options.limit Number of results to return\n *\n * @returns Array of on-chain transactions\n */\n async getTransactions(args?: { options?: PaginationArgs }): Promise<TransactionResponse[]> {\n return getTransactions({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Queries on-chain transaction by version. This function will not return pending transactions.\n *\n * @example\n * const transaction = await aptos.getTransactions({ledgerVersion:1})\n *\n * @param args.ledgerVersion - Transaction version is an unsigned 64-bit number.\n * @returns On-chain transaction. Only on-chain transactions have versions, so this\n * function cannot be used to query pending transactions.\n */\n async getTransactionByVersion(args: { ledgerVersion: AnyNumber }): Promise<TransactionResponse> {\n return getTransactionByVersion({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Queries on-chain transaction by transaction hash. This function will return pending transactions.\n *\n * @example\n * const transaction = await aptos.getTransactionByHash({transactionHash:\"0x123\"})\n *\n * @param args.transactionHash - Transaction hash should be hex-encoded bytes string with 0x prefix.\n * @returns Transaction from mempool (pending) or on-chain (committed) transaction\n */\n async getTransactionByHash(args: { transactionHash: HexInput }): Promise<TransactionResponse> {\n return getTransactionByHash({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Defines if specified transaction is currently in pending state\n *\n * To create a transaction hash:\n *\n * 1. Create a hash message from the bytes: \"Aptos::Transaction\" bytes + the BCS-serialized Transaction bytes.\n * 2. Apply hash algorithm SHA3-256 to the hash message bytes.\n * 3. Hex-encode the hash bytes with 0x prefix.\n *\n * @example\n * const isPendingTransaction = await aptos.isPendingTransaction({transactionHash:\"0x123\"})\n *\n * @param args.transactionHash A hash of transaction\n * @returns `true` if transaction is in pending state and `false` otherwise\n */\n async isPendingTransaction(args: { transactionHash: HexInput }): Promise<boolean> {\n return isTransactionPending({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Waits for a transaction to move past the pending state.\n *\n * There are 4 cases.\n * 1. Transaction is successfully processed and committed to the chain.\n * - The function will resolve with the transaction response from the API.\n * 2. Transaction is rejected for some reason, and is therefore not committed to the blockchain.\n * - The function will throw an AptosApiError with an HTTP status code indicating some problem with the request.\n * 3. Transaction is committed but execution failed, meaning no changes were\n * written to the blockchain state.\n * - If `checkSuccess` is true, the function will throw a FailedTransactionError\n * If `checkSuccess` is false, the function will resolve with the transaction response where the `success` field is false.\n * 4. Transaction does not move past the pending state within `args.options.timeoutSecs` seconds.\n * - The function will throw a WaitForTransactionError\n *\n * @example\n * const transaction = await aptos.waitForTransaction({transactionHash:\"0x123\"})\n *\n * @param args.transactionHash The hash of a transaction previously submitted to the blockchain.\n * @param args.options.timeoutSecs Timeout in seconds. Defaults to 20 seconds.\n * @param args.options.checkSuccess A boolean which controls whether the function will error if the transaction failed.\n * Defaults to true. See case 3 above.\n * @returns The transaction on-chain. See above for more details.\n */\n async waitForTransaction(args: {\n transactionHash: HexInput;\n options?: WaitForTransactionOptions;\n }): Promise<CommittedTransactionResponse> {\n return waitForTransaction({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Gives an estimate of the gas unit price required to get a\n * transaction on chain in a reasonable amount of time.\n * For more information {@link https://api.mainnet.aptoslabs.com/v1/spec#/operations/estimate_gas_price}\n *\n * @returns Object holding the outputs of the estimate gas API\n *\n * @example\n * const gasPrice = await aptos.waitForTransaction()\n */\n async getGasPriceEstimation(): Promise<GasEstimation> {\n return getGasPriceEstimation({\n aptosConfig: this.config,\n });\n }\n\n /**\n * Returns a signing message for a transaction.\n *\n * This allows a user to sign a transaction using their own preferred signing method, and\n * then submit it to the network.\n *\n * @example\n * const transaction = await aptos.transaction.build.simple({...})\n * const message = await aptos.getSigningMessage({transaction})\n *\n * @param args.transaction A raw transaction for signing elsewhere\n */\n // eslint-disable-next-line class-methods-use-this\n getSigningMessage(args: { transaction: AnyRawTransaction }): Uint8Array {\n return getSigningMessage(args);\n }\n\n /**\n * Generates a transaction to publish a move package to chain.\n *\n * To get the `metadataBytes` and `byteCode`, can compile using Aptos CLI with command\n * `aptos move compile --save-metadata ...`,\n * For more info {@link https://aptos.dev/tutorials/your-first-dapp/#step-4-publish-a-move-module}\n *\n * @example\n * const transaction = await aptos.publishPackageTransaction({\n * account: alice,\n * metadataBytes,\n * moduleBytecode: [byteCode],\n * })\n *\n * @param args.account The publisher account\n * @param args.metadataBytes The package metadata bytes\n * @param args.moduleBytecode An array of the bytecode of each module in the package in compiler output order\n *\n * @returns A SimpleTransaction that can be simulated or submitted to chain\n */\n async publishPackageTransaction(args: {\n account: AccountAddressInput;\n metadataBytes: HexInput;\n moduleBytecode: Array<HexInput>;\n options?: InputGenerateTransactionOptions;\n }): Promise<SimpleTransaction> {\n return publicPackageTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Rotate an account's auth key. After rotation, only the new private key can be used to sign txns for\n * the account.\n * Note: Only legacy Ed25519 scheme is supported for now.\n * More info: {@link https://aptos.dev/guides/account-management/key-rotation/}\n *\n * @example\n * const response = await aptos.rotateAuthKey({\n * fromAccount: alice,\n * toNewPrivateKey: new ED25519PublicKey(\"0x123\"),\n * })\n *\n * @param args.fromAccount The account to rotate the auth key for\n * @param args.toNewPrivateKey The new private key to rotate to\n *\n * @returns PendingTransactionResponse\n */\n async rotateAuthKey(args: { fromAccount: Account; toNewPrivateKey: PrivateKey }): Promise<TransactionResponse> {\n return rotateAuthKey({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Sign a transaction that can later be submitted to chain\n *\n * @example\n * const transaction = await aptos.transaction.build.simple({...})\n * const transaction = await aptos.transaction.sign({\n * signer: alice,\n * transaction\n * })\n *\n * @param args.signer The signer account\n * @param args.transaction A raw transaction to sign on\n *\n * @returns AccountAuthenticator\n */\n // eslint-disable-next-line class-methods-use-this\n sign(args: { signer: Account; transaction: AnyRawTransaction }): AccountAuthenticator {\n return signTransaction({\n ...args,\n });\n }\n\n /**\n * Sign a transaction as a fee payer that can later be submitted to chain\n *\n * @example\n * const transaction = await aptos.transaction.build.simple({...})\n * const transaction = await aptos.transaction.signAsFeePayer({\n * signer: alice,\n * transaction\n * })\n *\n * @param args.signer The fee payer signer account\n * @param args.transaction A raw transaction to sign on\n *\n * @returns AccountAuthenticator\n */\n // eslint-disable-next-line class-methods-use-this\n signAsFeePayer(args: { signer: Account; transaction: AnyRawTransaction }): AccountAuthenticator {\n const { signer, transaction } = args;\n\n // if transaction doesnt hold a \"feePayerAddress\" prop it means\n // this is not a fee payer transaction\n if (!transaction.feePayerAddress) {\n throw new Error(`Transaction ${transaction} is not a Fee Payer transaction`);\n }\n\n // Set the feePayerAddress to the signer account address\n transaction.feePayerAddress = signer.accountAddress;\n\n return signTransaction({\n signer,\n transaction,\n });\n }\n\n // TRANSACTION SUBMISSION //\n\n /**\n * @deprecated Prefer to use `aptos.transaction.batch.forSingleAccount()`\n *\n * Batch transactions for a single account.\n *\n * This function uses a transaction worker that receives payloads to be processed\n * and submitted to chain.\n * Note that this process is best for submitting multiple transactions that\n * dont rely on each other, i.e batch funds, batch token mints, etc.\n *\n * If any worker failure, the functions throws an error.\n *\n * @param args.sender The sender account to sign and submit the transaction\n * @param args.data An array of transaction payloads\n * @param args.options optional. Transaction generation configurations (excluding accountSequenceNumber)\n *\n * @return void. Throws if any error\n */\n async batchTransactionsForSingleAccount(args: {\n sender: Account;\n data: InputGenerateTransactionPayloadData[];\n options?: Omit<InputGenerateTransactionOptions, \"accountSequenceNumber\">;\n }): Promise<void> {\n try {\n const { sender, data, options } = args;\n this.batch.forSingleAccount({ sender, data, options });\n } catch (error: any) {\n throw new Error(`failed to submit transactions with error: ${error}`);\n }\n }\n\n /**\n * Sign and submit a single signer transaction to chain\n *\n * @param args.signer The signer account to sign the transaction\n * @param args.transaction An instance of a RawTransaction, plus optional secondary/fee payer addresses\n *\n * @example\n * const transaction = await aptos.transaction.build.simple({...})\n * const transaction = await aptos.signAndSubmitTransaction({\n * signer: alice,\n * transaction\n * })\n *\n * @return PendingTransactionResponse\n */\n async signAndSubmitTransaction(args: {\n signer: Account;\n transaction: AnyRawTransaction;\n }): Promise<PendingTransactionResponse> {\n const { signer, transaction } = args;\n return signAndSubmitTransaction({\n aptosConfig: this.config,\n signer,\n transaction,\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CO,IAAM,cAAN,MAAkB;AAAA,EAWvB,YAAY,QAAqB;AAC/B,SAAK,SAAS;AACd,SAAK,QAAQ,IAAI,MAAM,KAAK,MAAM;AAClC,SAAK,WAAW,IAAI,SAAS,KAAK,MAAM;AACxC,SAAK,SAAS,IAAI,OAAO,KAAK,MAAM;AACpC,SAAK,QAAQ,IAAI,sBAAsB,KAAK,MAAM;AAAA,EACpD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcA,MAAM,gBAAgB,MAAqE;AACzF,WAAO,gBAAgB;AAAA,MACrB,aAAa,KAAK;AAAA,MAClB,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,MAAM,wBAAwB,MAAkE;AAC9F,WAAO,wBAAwB;AAAA,MAC7B,aAAa,KAAK;AAAA,MAClB,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWA,MAAM,qBAAqB,MAAmE;AAC5F,WAAO,qBAAqB;AAAA,MAC1B,aAAa,KAAK;AAAA,MAClB,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAiBA,MAAM,qBAAqB,MAAuD;AAChF,WAAO,qBAAqB;AAAA,MAC1B,aAAa,KAAK;AAAA,MAClB,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA0BA,MAAM,mBAAmB,MAGiB;AACxC,WAAO,mBAAmB;AAAA,MACxB,aAAa,KAAK;AAAA,MAClB,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,MAAM,wBAAgD;AACpD,WAAO,sBAAsB;AAAA,MAC3B,aAAa,KAAK;AAAA,IACpB,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAeA,kBAAkB,MAAsD;AACtE,WAAO,kBAAkB,IAAI;AAAA,EAC/B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAsBA,MAAM,0BAA0B,MAKD;AAC7B,WAAO,yBAAyB,EAAE,aAAa,KAAK,QAAQ,GAAG,KAAK,CAAC;AAAA,EACvE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAmBA,MAAM,cAAc,MAA2F;AAC7G,WAAO,cAAc,EAAE,aAAa,KAAK,QAAQ,GAAG,KAAK,CAAC;AAAA,EAC5D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAkBA,KAAK,MAAiF;AACpF,WAAO,gBAAgB;AAAA,MACrB,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAkBA,eAAe,MAAiF;AAC9F,UAAM,EAAE,QAAQ,YAAY,IAAI;AAIhC,QAAI,CAAC,YAAY,iBAAiB;AAChC,YAAM,IAAI,MAAM,eAAe,WAAW,iCAAiC;AAAA,IAC7E;AAGA,gBAAY,kBAAkB,OAAO;AAErC,WAAO,gBAAgB;AAAA,MACrB;AAAA,MACA;AAAA,IACF,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAsBA,MAAM,kCAAkC,MAItB;AAChB,QAAI;AACF,YAAM,EAAE,QAAQ,MAAM,QAAQ,IAAI;AAClC,WAAK,MAAM,iBAAiB,EAAE,QAAQ,MAAM,QAAQ,CAAC;AAAA,IACvD,SAAS,OAAY;AACnB,YAAM,IAAI,MAAM,6CAA6C,KAAK,EAAE;AAAA,IACtE;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAiBA,MAAM,yBAAyB,MAGS;AACtC,UAAM,EAAE,QAAQ,YAAY,IAAI;AAChC,WAAO,yBAAyB;AAAA,MAC9B,aAAa,KAAK;AAAA,MAClB;AAAA,MACA;AAAA,IACF,CAAC;AAAA,EACH;AACF;","names":[]}
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Hex
|
|
3
|
+
} from "./chunk-YV7M4CFP.mjs";
|
|
4
|
+
import {
|
|
5
|
+
MAX_U128_BIG_INT,
|
|
6
|
+
MAX_U16_NUMBER,
|
|
7
|
+
MAX_U256_BIG_INT,
|
|
8
|
+
MAX_U32_NUMBER,
|
|
9
|
+
MAX_U64_BIG_INT,
|
|
10
|
+
MAX_U8_NUMBER
|
|
11
|
+
} from "./chunk-SBB4YEPT.mjs";
|
|
12
|
+
import {
|
|
13
|
+
__decorateClass
|
|
14
|
+
} from "./chunk-OR7TEZ25.mjs";
|
|
15
|
+
|
|
16
|
+
// src/bcs/serializer.ts
|
|
17
|
+
var Serializable = class {
|
|
18
|
+
/**
|
|
19
|
+
* Serializes a `Serializable` value to its BCS representation.
|
|
20
|
+
* This function is the Typescript SDK equivalent of `bcs::to_bytes` in Move.
|
|
21
|
+
* @returns the BCS representation of the Serializable instance as a byte buffer
|
|
22
|
+
*/
|
|
23
|
+
bcsToBytes() {
|
|
24
|
+
const serializer = new Serializer();
|
|
25
|
+
this.serialize(serializer);
|
|
26
|
+
return serializer.toUint8Array();
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Helper function to get a value's BCS-serialized bytes as a Hex instance.
|
|
30
|
+
* @returns a Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array
|
|
31
|
+
*/
|
|
32
|
+
bcsToHex() {
|
|
33
|
+
const bcsBytes = this.bcsToBytes();
|
|
34
|
+
return Hex.fromHexInput(bcsBytes);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
var Serializer = class {
|
|
38
|
+
// Constructs a serializer with a buffer of size `length` bytes, 64 bytes by default.
|
|
39
|
+
// `length` must be greater than 0.
|
|
40
|
+
constructor(length = 64) {
|
|
41
|
+
if (length <= 0) {
|
|
42
|
+
throw new Error("Length needs to be greater than 0");
|
|
43
|
+
}
|
|
44
|
+
this.buffer = new ArrayBuffer(length);
|
|
45
|
+
this.offset = 0;
|
|
46
|
+
}
|
|
47
|
+
ensureBufferWillHandleSize(bytes) {
|
|
48
|
+
while (this.buffer.byteLength < this.offset + bytes) {
|
|
49
|
+
const newBuffer = new ArrayBuffer(this.buffer.byteLength * 2);
|
|
50
|
+
new Uint8Array(newBuffer).set(new Uint8Array(this.buffer));
|
|
51
|
+
this.buffer = newBuffer;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
appendToBuffer(values) {
|
|
55
|
+
this.ensureBufferWillHandleSize(values.length);
|
|
56
|
+
new Uint8Array(this.buffer, this.offset).set(values);
|
|
57
|
+
this.offset += values.length;
|
|
58
|
+
}
|
|
59
|
+
serializeWithFunction(fn, bytesLength, value) {
|
|
60
|
+
this.ensureBufferWillHandleSize(bytesLength);
|
|
61
|
+
const dv = new DataView(this.buffer, this.offset);
|
|
62
|
+
fn.apply(dv, [0, value, true]);
|
|
63
|
+
this.offset += bytesLength;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Serializes a string. UTF8 string is supported.
|
|
67
|
+
*
|
|
68
|
+
* The number of bytes in the string content is serialized first, as a uleb128-encoded u32 integer.
|
|
69
|
+
* Then the string content is serialized as UTF8 encoded bytes.
|
|
70
|
+
*
|
|
71
|
+
* BCS layout for "string": string_length | string_content
|
|
72
|
+
* where string_length is a u32 integer encoded as a uleb128 integer, equal to the number of bytes in string_content.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```ts
|
|
76
|
+
* const serializer = new Serializer();
|
|
77
|
+
* serializer.serializeStr("1234abcd");
|
|
78
|
+
* assert(serializer.toUint8Array() === new Uint8Array([8, 49, 50, 51, 52, 97, 98, 99, 100]));
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
serializeStr(value) {
|
|
82
|
+
const textEncoder = new TextEncoder();
|
|
83
|
+
this.serializeBytes(textEncoder.encode(value));
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Serializes an array of bytes.
|
|
87
|
+
*
|
|
88
|
+
* BCS layout for "bytes": bytes_length | bytes
|
|
89
|
+
* where bytes_length is a u32 integer encoded as a uleb128 integer, equal to the length of the bytes array.
|
|
90
|
+
*/
|
|
91
|
+
serializeBytes(value) {
|
|
92
|
+
this.serializeU32AsUleb128(value.length);
|
|
93
|
+
this.appendToBuffer(value);
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Serializes an array of bytes with known length. Therefore, length doesn't need to be
|
|
97
|
+
* serialized to help deserialization.
|
|
98
|
+
*
|
|
99
|
+
* When deserializing, the number of bytes to deserialize needs to be passed in.
|
|
100
|
+
*/
|
|
101
|
+
serializeFixedBytes(value) {
|
|
102
|
+
this.appendToBuffer(value);
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Serializes a boolean value.
|
|
106
|
+
*
|
|
107
|
+
* BCS layout for "boolean": One byte. "0x01" for true and "0x00" for false.
|
|
108
|
+
*/
|
|
109
|
+
serializeBool(value) {
|
|
110
|
+
ensureBoolean(value);
|
|
111
|
+
const byteValue = value ? 1 : 0;
|
|
112
|
+
this.appendToBuffer(new Uint8Array([byteValue]));
|
|
113
|
+
}
|
|
114
|
+
serializeU8(value) {
|
|
115
|
+
this.appendToBuffer(new Uint8Array([value]));
|
|
116
|
+
}
|
|
117
|
+
serializeU16(value) {
|
|
118
|
+
this.serializeWithFunction(DataView.prototype.setUint16, 2, value);
|
|
119
|
+
}
|
|
120
|
+
serializeU32(value) {
|
|
121
|
+
this.serializeWithFunction(DataView.prototype.setUint32, 4, value);
|
|
122
|
+
}
|
|
123
|
+
serializeU64(value) {
|
|
124
|
+
const low = BigInt(value) & BigInt(MAX_U32_NUMBER);
|
|
125
|
+
const high = BigInt(value) >> BigInt(32);
|
|
126
|
+
this.serializeU32(Number(low));
|
|
127
|
+
this.serializeU32(Number(high));
|
|
128
|
+
}
|
|
129
|
+
serializeU128(value) {
|
|
130
|
+
const low = BigInt(value) & MAX_U64_BIG_INT;
|
|
131
|
+
const high = BigInt(value) >> BigInt(64);
|
|
132
|
+
this.serializeU64(low);
|
|
133
|
+
this.serializeU64(high);
|
|
134
|
+
}
|
|
135
|
+
serializeU256(value) {
|
|
136
|
+
const low = BigInt(value) & MAX_U128_BIG_INT;
|
|
137
|
+
const high = BigInt(value) >> BigInt(128);
|
|
138
|
+
this.serializeU128(low);
|
|
139
|
+
this.serializeU128(high);
|
|
140
|
+
}
|
|
141
|
+
serializeU32AsUleb128(val) {
|
|
142
|
+
let value = val;
|
|
143
|
+
const valueArray = [];
|
|
144
|
+
while (value >>> 7 !== 0) {
|
|
145
|
+
valueArray.push(value & 127 | 128);
|
|
146
|
+
value >>>= 7;
|
|
147
|
+
}
|
|
148
|
+
valueArray.push(value);
|
|
149
|
+
this.appendToBuffer(new Uint8Array(valueArray));
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Returns the buffered bytes
|
|
153
|
+
*/
|
|
154
|
+
toUint8Array() {
|
|
155
|
+
return new Uint8Array(this.buffer).slice(0, this.offset);
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Serializes a `Serializable` value, facilitating composable serialization.
|
|
159
|
+
*
|
|
160
|
+
* @param value The Serializable value to serialize
|
|
161
|
+
*
|
|
162
|
+
* @example
|
|
163
|
+
* // Define the MoveStruct class that implements the Serializable interface
|
|
164
|
+
* class MoveStruct extends Serializable {
|
|
165
|
+
* constructor(
|
|
166
|
+
* public creatorAddress: AccountAddress, // where AccountAddress extends Serializable
|
|
167
|
+
* public collectionName: string,
|
|
168
|
+
* public tokenName: string
|
|
169
|
+
* ) {}
|
|
170
|
+
*
|
|
171
|
+
* serialize(serializer: Serializer): void {
|
|
172
|
+
* serializer.serialize(this.creatorAddress); // Composable serialization of another Serializable object
|
|
173
|
+
* serializer.serializeStr(this.collectionName);
|
|
174
|
+
* serializer.serializeStr(this.tokenName);
|
|
175
|
+
* }
|
|
176
|
+
* }
|
|
177
|
+
*
|
|
178
|
+
* // Construct a MoveStruct
|
|
179
|
+
* const moveStruct = new MoveStruct(new AccountAddress(...), "MyCollection", "TokenA");
|
|
180
|
+
*
|
|
181
|
+
* // Serialize a string, a u64 number, and a MoveStruct instance.
|
|
182
|
+
* const serializer = new Serializer();
|
|
183
|
+
* serializer.serializeStr("ExampleString");
|
|
184
|
+
* serializer.serializeU64(12345678);
|
|
185
|
+
* serializer.serialize(moveStruct);
|
|
186
|
+
*
|
|
187
|
+
* // Get the bytes from the Serializer instance
|
|
188
|
+
* const serializedBytes = serializer.toUint8Array();
|
|
189
|
+
*
|
|
190
|
+
* @returns the serializer instance
|
|
191
|
+
*/
|
|
192
|
+
serialize(value) {
|
|
193
|
+
value.serialize(this);
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Serializes an array of BCS Serializable values to a serializer instance.
|
|
197
|
+
* Note that this does not return anything. The bytes are added to the serializer instance's byte buffer.
|
|
198
|
+
*
|
|
199
|
+
* @param values The array of BCS Serializable values
|
|
200
|
+
* @example
|
|
201
|
+
* const addresses = new Array<AccountAddress>(
|
|
202
|
+
* AccountAddress.from("0x1"),
|
|
203
|
+
* AccountAddress.from("0x2"),
|
|
204
|
+
* AccountAddress.from("0xa"),
|
|
205
|
+
* AccountAddress.from("0xb"),
|
|
206
|
+
* );
|
|
207
|
+
* const serializer = new Serializer();
|
|
208
|
+
* serializer.serializeVector(addresses);
|
|
209
|
+
* const serializedBytes = serializer.toUint8Array();
|
|
210
|
+
* // serializedBytes is now the BCS-serialized bytes
|
|
211
|
+
* // The equivalent value in Move would be:
|
|
212
|
+
* // `bcs::to_bytes(&vector<address> [@0x1, @0x2, @0xa, @0xb])`;
|
|
213
|
+
*/
|
|
214
|
+
serializeVector(values) {
|
|
215
|
+
this.serializeU32AsUleb128(values.length);
|
|
216
|
+
values.forEach((item) => {
|
|
217
|
+
item.serialize(this);
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
serializeOption(value) {
|
|
221
|
+
if (value === void 0) {
|
|
222
|
+
this.serializeU32AsUleb128(0);
|
|
223
|
+
} else {
|
|
224
|
+
this.serializeU32AsUleb128(1);
|
|
225
|
+
value.serialize(this);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
serializeOptionStr(value) {
|
|
229
|
+
if (value === void 0) {
|
|
230
|
+
this.serializeU32AsUleb128(0);
|
|
231
|
+
} else {
|
|
232
|
+
this.serializeU32AsUleb128(1);
|
|
233
|
+
this.serializeStr(value);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
__decorateClass([
|
|
238
|
+
checkNumberRange(0, MAX_U8_NUMBER)
|
|
239
|
+
], Serializer.prototype, "serializeU8", 1);
|
|
240
|
+
__decorateClass([
|
|
241
|
+
checkNumberRange(0, MAX_U16_NUMBER)
|
|
242
|
+
], Serializer.prototype, "serializeU16", 1);
|
|
243
|
+
__decorateClass([
|
|
244
|
+
checkNumberRange(0, MAX_U32_NUMBER)
|
|
245
|
+
], Serializer.prototype, "serializeU32", 1);
|
|
246
|
+
__decorateClass([
|
|
247
|
+
checkNumberRange(BigInt(0), MAX_U64_BIG_INT)
|
|
248
|
+
], Serializer.prototype, "serializeU64", 1);
|
|
249
|
+
__decorateClass([
|
|
250
|
+
checkNumberRange(BigInt(0), MAX_U128_BIG_INT)
|
|
251
|
+
], Serializer.prototype, "serializeU128", 1);
|
|
252
|
+
__decorateClass([
|
|
253
|
+
checkNumberRange(BigInt(0), MAX_U256_BIG_INT)
|
|
254
|
+
], Serializer.prototype, "serializeU256", 1);
|
|
255
|
+
__decorateClass([
|
|
256
|
+
checkNumberRange(0, MAX_U32_NUMBER)
|
|
257
|
+
], Serializer.prototype, "serializeU32AsUleb128", 1);
|
|
258
|
+
function ensureBoolean(value) {
|
|
259
|
+
if (typeof value !== "boolean") {
|
|
260
|
+
throw new Error(`${value} is not a boolean value`);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
var outOfRangeErrorMessage = (value, min, max) => `${value} is out of range: [${min}, ${max}]`;
|
|
264
|
+
function validateNumberInRange(value, minValue, maxValue) {
|
|
265
|
+
const valueBigInt = BigInt(value);
|
|
266
|
+
if (valueBigInt > BigInt(maxValue) || valueBigInt < BigInt(minValue)) {
|
|
267
|
+
throw new Error(outOfRangeErrorMessage(value, minValue, maxValue));
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
function checkNumberRange(minValue, maxValue) {
|
|
271
|
+
return (target, propertyKey, descriptor) => {
|
|
272
|
+
const childFunction = descriptor.value;
|
|
273
|
+
descriptor.value = function deco(value) {
|
|
274
|
+
validateNumberInRange(value, minValue, maxValue);
|
|
275
|
+
return childFunction.apply(this, [value]);
|
|
276
|
+
};
|
|
277
|
+
return descriptor;
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
export {
|
|
282
|
+
Serializable,
|
|
283
|
+
Serializer,
|
|
284
|
+
ensureBoolean,
|
|
285
|
+
outOfRangeErrorMessage,
|
|
286
|
+
validateNumberInRange
|
|
287
|
+
};
|
|
288
|
+
//# sourceMappingURL=chunk-FQQW55X7.mjs.map
|