@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
|
@@ -9,20 +9,13 @@
|
|
|
9
9
|
import { sha3_256 as sha3Hash } from "@noble/hashes/sha3";
|
|
10
10
|
import { AptosConfig } from "../../api/aptosConfig";
|
|
11
11
|
import { AccountAddress, AccountAddressInput, Hex, PublicKey } from "../../core";
|
|
12
|
-
import {
|
|
13
|
-
import { AnyPublicKey, AnySignature } from "../../core/crypto";
|
|
12
|
+
import { AnyPublicKey, AnySignature, Secp256k1PublicKey, Secp256k1Signature } from "../../core/crypto";
|
|
14
13
|
import { Ed25519PublicKey, Ed25519Signature } from "../../core/crypto/ed25519";
|
|
15
|
-
import { Secp256k1PublicKey, Secp256k1Signature } from "../../core/crypto/secp256k1";
|
|
16
14
|
import { getInfo } from "../../internal/account";
|
|
17
15
|
import { getLedgerInfo } from "../../internal/general";
|
|
18
16
|
import { getGasPriceEstimation } from "../../internal/transaction";
|
|
19
17
|
import { NetworkToChainId } from "../../utils/apiEndpoints";
|
|
20
|
-
import {
|
|
21
|
-
DEFAULT_MAX_GAS_AMOUNT,
|
|
22
|
-
DEFAULT_TXN_EXP_SEC_FROM_NOW,
|
|
23
|
-
RAW_TRANSACTION_SALT,
|
|
24
|
-
RAW_TRANSACTION_WITH_DATA_SALT,
|
|
25
|
-
} from "../../utils/const";
|
|
18
|
+
import { DEFAULT_MAX_GAS_AMOUNT, DEFAULT_TXN_EXP_SEC_FROM_NOW } from "../../utils/const";
|
|
26
19
|
import { normalizeBundle } from "../../utils/normalizeBundle";
|
|
27
20
|
import {
|
|
28
21
|
AccountAuthenticator,
|
|
@@ -53,7 +46,6 @@ import { SignedTransaction } from "../instances/signedTransaction";
|
|
|
53
46
|
import {
|
|
54
47
|
AnyRawTransaction,
|
|
55
48
|
AnyTransactionPayloadInstance,
|
|
56
|
-
AnyRawTransactionInstance,
|
|
57
49
|
EntryFunctionArgumentTypes,
|
|
58
50
|
InputGenerateMultiAgentRawTransactionArgs,
|
|
59
51
|
InputGenerateRawTransactionArgs,
|
|
@@ -466,24 +458,6 @@ export function getAuthenticatorForSimulation(publicKey: PublicKey) {
|
|
|
466
458
|
);
|
|
467
459
|
}
|
|
468
460
|
|
|
469
|
-
/**
|
|
470
|
-
* Sign a transaction that can later be submitted to chain
|
|
471
|
-
*
|
|
472
|
-
* @param args.signer The signer account to sign the transaction
|
|
473
|
-
* @param args.transaction A aptos transaction type to sign
|
|
474
|
-
*
|
|
475
|
-
* @return The signer AccountAuthenticator
|
|
476
|
-
*/
|
|
477
|
-
export function sign(args: { signer: Account; transaction: AnyRawTransaction }): AccountAuthenticator {
|
|
478
|
-
const { signer, transaction } = args;
|
|
479
|
-
|
|
480
|
-
// get the signing message
|
|
481
|
-
const message = generateSigningMessage(transaction);
|
|
482
|
-
|
|
483
|
-
// account.signMessage
|
|
484
|
-
return signer.signWithAuthenticator(message);
|
|
485
|
-
}
|
|
486
|
-
|
|
487
461
|
/**
|
|
488
462
|
* Prepare a transaction to be submitted to chain
|
|
489
463
|
*
|
|
@@ -564,53 +538,6 @@ export function generateUserTransactionHash(args: InputSubmitTransactionData): s
|
|
|
564
538
|
return new Hex(hashValues([TRANSACTION_PREFIX, new Uint8Array([0]), signedTransaction])).toString();
|
|
565
539
|
}
|
|
566
540
|
|
|
567
|
-
/**
|
|
568
|
-
* Derive the raw transaction type - FeePayerRawTransaction or MultiAgentRawTransaction or RawTransaction
|
|
569
|
-
*
|
|
570
|
-
* @param transaction A aptos transaction type
|
|
571
|
-
*
|
|
572
|
-
* @returns FeePayerRawTransaction | MultiAgentRawTransaction | RawTransaction
|
|
573
|
-
*/
|
|
574
|
-
export function deriveTransactionType(transaction: AnyRawTransaction): AnyRawTransactionInstance {
|
|
575
|
-
if (transaction.feePayerAddress) {
|
|
576
|
-
return new FeePayerRawTransaction(
|
|
577
|
-
transaction.rawTransaction,
|
|
578
|
-
transaction.secondarySignerAddresses ?? [],
|
|
579
|
-
transaction.feePayerAddress,
|
|
580
|
-
);
|
|
581
|
-
}
|
|
582
|
-
if (transaction.secondarySignerAddresses) {
|
|
583
|
-
return new MultiAgentRawTransaction(transaction.rawTransaction, transaction.secondarySignerAddresses);
|
|
584
|
-
}
|
|
585
|
-
|
|
586
|
-
return transaction.rawTransaction;
|
|
587
|
-
}
|
|
588
|
-
|
|
589
|
-
export function generateSigningMessage(transaction: AnyRawTransaction): Uint8Array {
|
|
590
|
-
const rawTxn = deriveTransactionType(transaction);
|
|
591
|
-
const hash = sha3Hash.create();
|
|
592
|
-
|
|
593
|
-
if (rawTxn instanceof RawTransaction) {
|
|
594
|
-
hash.update(RAW_TRANSACTION_SALT);
|
|
595
|
-
} else if (rawTxn instanceof MultiAgentRawTransaction) {
|
|
596
|
-
hash.update(RAW_TRANSACTION_WITH_DATA_SALT);
|
|
597
|
-
} else if (rawTxn instanceof FeePayerRawTransaction) {
|
|
598
|
-
hash.update(RAW_TRANSACTION_WITH_DATA_SALT);
|
|
599
|
-
} else {
|
|
600
|
-
throw new Error(`Unknown transaction type to sign on: ${rawTxn}`);
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
const prefix = hash.digest();
|
|
604
|
-
|
|
605
|
-
const body = rawTxn.bcsToBytes();
|
|
606
|
-
|
|
607
|
-
const mergedArray = new Uint8Array(prefix.length + body.length);
|
|
608
|
-
mergedArray.set(prefix);
|
|
609
|
-
mergedArray.set(body, prefix.length);
|
|
610
|
-
|
|
611
|
-
return mergedArray;
|
|
612
|
-
}
|
|
613
|
-
|
|
614
541
|
/**
|
|
615
542
|
* Fetches and caches ABIs with allowing for pass-through on provided ABIs
|
|
616
543
|
* @param key
|
package/src/types/index.ts
CHANGED
|
@@ -108,11 +108,29 @@ export enum AccountAuthenticatorVariant {
|
|
|
108
108
|
export enum AnyPublicKeyVariant {
|
|
109
109
|
Ed25519 = 0,
|
|
110
110
|
Secp256k1 = 1,
|
|
111
|
+
Keyless = 3,
|
|
111
112
|
}
|
|
112
113
|
|
|
113
114
|
export enum AnySignatureVariant {
|
|
114
115
|
Ed25519 = 0,
|
|
115
116
|
Secp256k1 = 1,
|
|
117
|
+
Keyless = 3,
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export enum EphemeralPublicKeyVariant {
|
|
121
|
+
Ed25519 = 0,
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export enum EphemeralSignatureVariant {
|
|
125
|
+
Ed25519 = 0,
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export enum EphemeralCertificateVariant {
|
|
129
|
+
ZkProof = 0,
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export enum ZkpVariant {
|
|
133
|
+
Groth16 = 0,
|
|
116
134
|
}
|
|
117
135
|
|
|
118
136
|
/**
|
|
@@ -140,6 +158,10 @@ export type AptosSettings = {
|
|
|
140
158
|
|
|
141
159
|
readonly indexer?: string;
|
|
142
160
|
|
|
161
|
+
readonly pepper?: string;
|
|
162
|
+
|
|
163
|
+
readonly prover?: string;
|
|
164
|
+
|
|
143
165
|
readonly clientConfig?: ClientConfig;
|
|
144
166
|
|
|
145
167
|
readonly client?: Client;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { KeylessAccount } from "../account";
|
|
2
|
+
import { AptosApiError } from "../client/types";
|
|
3
|
+
|
|
4
|
+
export type ProverResponse = {
|
|
5
|
+
proof: { a: string; b: string; c: string };
|
|
6
|
+
public_inputs_hash: string;
|
|
7
|
+
training_wheels_signature: string;
|
|
8
|
+
};
|
|
9
|
+
export type PepperFetchResponse = { signature: string; pepper: string; address: string };
|
|
10
|
+
|
|
11
|
+
export enum KeylessErrorType {
|
|
12
|
+
JWK_EXPIRED,
|
|
13
|
+
EPK_EXPIRED,
|
|
14
|
+
UNKNOWN_INVALID_SIGNATURE,
|
|
15
|
+
UNKNOWN,
|
|
16
|
+
}
|
|
17
|
+
export class KeylessError extends Error {
|
|
18
|
+
readonly type: KeylessErrorType;
|
|
19
|
+
|
|
20
|
+
private constructor(type: KeylessErrorType) {
|
|
21
|
+
super();
|
|
22
|
+
this.type = type;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
static async fromAptosApiError(error: AptosApiError, signer: KeylessAccount): Promise<KeylessError> {
|
|
26
|
+
if (!error.data.message.includes("INVALID_SIGNATURE")) {
|
|
27
|
+
return new KeylessError(KeylessErrorType.UNKNOWN);
|
|
28
|
+
}
|
|
29
|
+
if (signer.isExpired()) {
|
|
30
|
+
return new KeylessError(KeylessErrorType.EPK_EXPIRED);
|
|
31
|
+
}
|
|
32
|
+
if (!(await signer.checkJwkValidity())) {
|
|
33
|
+
return new KeylessError(KeylessErrorType.JWK_EXPIRED);
|
|
34
|
+
}
|
|
35
|
+
return new KeylessError(KeylessErrorType.UNKNOWN_INVALID_SIGNATURE);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -5,7 +5,6 @@ export const NetworkToIndexerAPI: Record<string, string> = {
|
|
|
5
5
|
mainnet: "https://api.mainnet.aptoslabs.com/v1/graphql",
|
|
6
6
|
testnet: "https://api.testnet.aptoslabs.com/v1/graphql",
|
|
7
7
|
devnet: "https://api.devnet.aptoslabs.com/v1/graphql",
|
|
8
|
-
randomnet: "https://indexer-randomnet.hasura.app/v1/graphql",
|
|
9
8
|
local: "http://127.0.0.1:8090/v1/graphql",
|
|
10
9
|
};
|
|
11
10
|
|
|
@@ -13,7 +12,6 @@ export const NetworkToNodeAPI: Record<string, string> = {
|
|
|
13
12
|
mainnet: "https://api.mainnet.aptoslabs.com/v1",
|
|
14
13
|
testnet: "https://api.testnet.aptoslabs.com/v1",
|
|
15
14
|
devnet: "https://api.devnet.aptoslabs.com/v1",
|
|
16
|
-
randomnet: "https://fullnode.random.aptoslabs.com/v1",
|
|
17
15
|
local: "http://127.0.0.1:8080/v1",
|
|
18
16
|
};
|
|
19
17
|
|
|
@@ -21,15 +19,27 @@ export const NetworkToFaucetAPI: Record<string, string> = {
|
|
|
21
19
|
mainnet: "https://faucet.mainnet.aptoslabs.com",
|
|
22
20
|
testnet: "https://faucet.testnet.aptoslabs.com",
|
|
23
21
|
devnet: "https://faucet.devnet.aptoslabs.com",
|
|
24
|
-
randomnet: "https://faucet.random.aptoslabs.com",
|
|
25
22
|
local: "http://127.0.0.1:8081",
|
|
26
23
|
};
|
|
27
24
|
|
|
25
|
+
export const NetworkToPepperAPI: Record<string, string> = {
|
|
26
|
+
mainnet: "https://pepper.keyless.mainnet.aptoslabs.com/v0",
|
|
27
|
+
testnet: "https://pepper.keyless.testnet.aptoslabs.com/v0",
|
|
28
|
+
devnet: "https://api.devnet.aptoslabs.com/keyless/pepper/v0",
|
|
29
|
+
local: "http://127.0.0.1:8000/v0",
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const NetworkToProverAPI: Record<string, string> = {
|
|
33
|
+
mainnet: "https://prover.keyless.mainnet.aptoslabs.com/v0",
|
|
34
|
+
testnet: "https://prover.keyless.testnet.aptoslabs.com/v0",
|
|
35
|
+
devnet: "https://api.devnet.aptoslabs.com/keyless/prover/v0",
|
|
36
|
+
local: "http://127.0.0.1:8083/v0",
|
|
37
|
+
};
|
|
38
|
+
|
|
28
39
|
export enum Network {
|
|
29
40
|
MAINNET = "mainnet",
|
|
30
41
|
TESTNET = "testnet",
|
|
31
42
|
DEVNET = "devnet",
|
|
32
|
-
RANDOMNET = "randomnet",
|
|
33
43
|
LOCAL = "local",
|
|
34
44
|
CUSTOM = "custom",
|
|
35
45
|
}
|
|
@@ -37,7 +47,6 @@ export enum Network {
|
|
|
37
47
|
export const NetworkToChainId: Record<string, number> = {
|
|
38
48
|
mainnet: 1,
|
|
39
49
|
testnet: 2,
|
|
40
|
-
randomnet: 70,
|
|
41
50
|
local: 4,
|
|
42
51
|
};
|
|
43
52
|
|
|
@@ -45,7 +54,6 @@ export const NetworkToNetworkName: Record<string, Network> = {
|
|
|
45
54
|
mainnet: Network.MAINNET,
|
|
46
55
|
testnet: Network.TESTNET,
|
|
47
56
|
devnet: Network.DEVNET,
|
|
48
|
-
randomnet: Network.RANDOMNET,
|
|
49
57
|
local: Network.LOCAL,
|
|
50
58
|
custom: Network.CUSTOM,
|
|
51
59
|
};
|
package/src/utils/const.ts
CHANGED
package/src/version.ts
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var i=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var l=(r,n,s,o)=>{for(var e=o>1?void 0:o?m(n,s):n,t=r.length-1,u;t>=0;t--)(u=r[t])&&(e=(o?u(n,s,e):u(e))||e);return o&&e&&i(n,s,e),e};async function p(r){return new Promise(n=>{setTimeout(n,r)})}exports.a = l; exports.b = p;
|
|
2
|
-
//# sourceMappingURL=chunk-KSEUZTKY.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/helpers.ts"],"names":["sleep","timeMs","resolve"],"mappings":"wMAOA,eAAsBA,EAAMC,EAA+B,CACzD,OAAO,IAAI,QAASC,GAAY,CAC9B,WAAWA,EAASD,CAAM,CAC5B,CAAC,CACH","sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * Sleep the current thread for the given amount of time\n * @param timeMs time in milliseconds to sleep\n */\nexport async function sleep(timeMs: number): Promise<null> {\n return new Promise((resolve) => {\n setTimeout(resolve, timeMs);\n });\n}\n"]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as d}from"./chunk-Q3TZGQVC.mjs";import{a as A}from"./chunk-CTIN3GTP.mjs";import{a as T}from"./chunk-ZZZZVONX.mjs";import{a as y}from"./chunk-V3Q2KXJU.mjs";import{d as g,e as o,h as m,i as p,j as f}from"./chunk-YFRXBEOC.mjs";import{a as i,b as s,c as r,d as e,e as c,g as u}from"./chunk-7QJ6YJXP.mjs";var h=class{constructor(n){this.config=n,this.build=new y(this.config),this.simulate=new A(this.config),this.submit=new T(this.config),this.batch=new d(this.config)}async getTransactions(n){return i({aptosConfig:this.config,...n})}async getTransactionByVersion(n){return r({aptosConfig:this.config,...n})}async getTransactionByHash(n){return e({aptosConfig:this.config,...n})}async isPendingTransaction(n){return c({aptosConfig:this.config,...n})}async waitForTransaction(n){return u({aptosConfig:this.config,...n})}async getGasPriceEstimation(){return s({aptosConfig:this.config})}getSigningMessage(n){return g(n)}async publishPackageTransaction(n){return p({aptosConfig:this.config,...n})}async rotateAuthKey(n){return f({aptosConfig:this.config,...n})}sign(n){return o({...n})}signAsFeePayer(n){let{signer:t,transaction:a}=n;if(!a.feePayerAddress)throw new Error(`Transaction ${a} is not a Fee Payer transaction`);return a.feePayerAddress=t.accountAddress,o({signer:t,transaction:a})}async batchTransactionsForSingleAccount(n){try{let{sender:t,data:a,options:P}=n;this.batch.forSingleAccount({sender:t,data:a,options:P})}catch(t){throw new Error(`failed to submit transactions with error: ${t}`)}}async signAndSubmitTransaction(n){let{signer:t,transaction:a}=n;return m({aptosConfig:this.config,signer:t,transaction:a})}};export{h as a};
|
|
2
|
-
//# sourceMappingURL=chunk-24IKVZBK.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
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, Account, PrivateKey } from \"../core\";\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":"qTA0CO,IAAMA,EAAN,KAAkB,CAWvB,YAAYC,EAAqB,CAC/B,KAAK,OAASA,EACd,KAAK,MAAQ,IAAIC,EAAM,KAAK,MAAM,EAClC,KAAK,SAAW,IAAIC,EAAS,KAAK,MAAM,EACxC,KAAK,OAAS,IAAIC,EAAO,KAAK,MAAM,EACpC,KAAK,MAAQ,IAAIC,EAAsB,KAAK,MAAM,CACpD,CAcA,MAAM,gBAAgBC,EAAqE,CACzF,OAAOC,EAAgB,CACrB,YAAa,KAAK,OAClB,GAAGD,CACL,CAAC,CACH,CAYA,MAAM,wBAAwBA,EAAkE,CAC9F,OAAOE,EAAwB,CAC7B,YAAa,KAAK,OAClB,GAAGF,CACL,CAAC,CACH,CAWA,MAAM,qBAAqBA,EAAmE,CAC5F,OAAOG,EAAqB,CAC1B,YAAa,KAAK,OAClB,GAAGH,CACL,CAAC,CACH,CAiBA,MAAM,qBAAqBA,EAAuD,CAChF,OAAOI,EAAqB,CAC1B,YAAa,KAAK,OAClB,GAAGJ,CACL,CAAC,CACH,CA0BA,MAAM,mBAAmBA,EAGiB,CACxC,OAAOK,EAAmB,CACxB,YAAa,KAAK,OAClB,GAAGL,CACL,CAAC,CACH,CAYA,MAAM,uBAAgD,CACpD,OAAOM,EAAsB,CAC3B,YAAa,KAAK,MACpB,CAAC,CACH,CAeA,kBAAkBN,EAAsD,CACtE,OAAOO,EAAkBP,CAAI,CAC/B,CAsBA,MAAM,0BAA0BA,EAKD,CAC7B,OAAOQ,EAAyB,CAAE,YAAa,KAAK,OAAQ,GAAGR,CAAK,CAAC,CACvE,CAmBA,MAAM,cAAcA,EAA2F,CAC7G,OAAOS,EAAc,CAAE,YAAa,KAAK,OAAQ,GAAGT,CAAK,CAAC,CAC5D,CAkBA,KAAKA,EAAiF,CACpF,OAAOU,EAAgB,CACrB,GAAGV,CACL,CAAC,CACH,CAkBA,eAAeA,EAAiF,CAC9F,GAAM,CAAE,OAAAW,EAAQ,YAAAC,CAAY,EAAIZ,EAIhC,GAAI,CAACY,EAAY,gBACf,MAAM,IAAI,MAAM,eAAeA,CAAW,iCAAiC,EAI7E,OAAAA,EAAY,gBAAkBD,EAAO,eAE9BD,EAAgB,CACrB,OAAAC,EACA,YAAAC,CACF,CAAC,CACH,CAsBA,MAAM,kCAAkCZ,EAItB,CAChB,GAAI,CACF,GAAM,CAAE,OAAAa,EAAQ,KAAAC,EAAM,QAAAC,CAAQ,EAAIf,EAClC,KAAK,MAAM,iBAAiB,CAAE,OAAAa,EAAQ,KAAAC,EAAM,QAAAC,CAAQ,CAAC,CACvD,OAASC,EAAY,CACnB,MAAM,IAAI,MAAM,6CAA6CA,CAAK,EAAE,CACtE,CACF,CAiBA,MAAM,yBAAyBhB,EAGS,CACtC,GAAM,CAAE,OAAAW,EAAQ,YAAAC,CAAY,EAAIZ,EAChC,OAAOiB,EAAyB,CAC9B,YAAa,KAAK,OAClB,OAAAN,EACA,YAAAC,CACF,CAAC,CACH,CACF","names":["Transaction","config","Build","Simulate","Submit","TransactionManagement","args","getTransactions","getTransactionByVersion","getTransactionByHash","isTransactionPending","waitForTransaction","getGasPriceEstimation","getSigningMessage","publicPackageTransaction","rotateAuthKey","signTransaction","signer","transaction","sender","data","options","error","signAndSubmitTransaction"]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as h,b as l}from"./chunk-V4SRNEV3.mjs";import{a as p}from"./chunk-R5QUBEH6.mjs";import{b as g}from"./chunk-WFZDFFBM.mjs";import{a as m}from"./chunk-NPFNYP75.mjs";function f(y){let o=y;return o-=o>>1&1431655765,o=(o&858993459)+(o>>2&858993459),(o+(o>>4)&252645135)*16843009>>24}var A=class y extends g{constructor(e){super();let{publicKeys:s,signaturesRequired:t}=e;if(t<1)throw new Error("The number of required signatures needs to be greater than 0");if(s.length<t)throw new Error(`Provided ${s.length} public keys is smaller than the ${t} required signatures`);this.publicKeys=s.map(r=>r instanceof h?r:new h(r)),this.signaturesRequired=t}verifySignature(e){throw new Error("not implemented")}authKey(){return m.fromSchemeAndBytes({scheme:3,input:this.toUint8Array()})}toUint8Array(){return this.bcsToBytes()}serialize(e){e.serializeVector(this.publicKeys),e.serializeU8(this.signaturesRequired)}static deserialize(e){let s=e.deserializeVector(h),t=e.deserializeU8();return new y({publicKeys:s,signaturesRequired:t})}createBitmap(e){let{bits:s}=e,t=128,r=new Uint8Array([0,0,0,0]),n=new Set;return s.forEach((i,u)=>{if(u+1>this.publicKeys.length)throw new Error(`Signature index ${u+1} is out of public keys range, ${this.publicKeys.length}.`);if(n.has(i))throw new Error(`Duplicate bit ${i} detected.`);n.add(i);let c=Math.floor(i/8),b=r[c];b|=t>>i%8,r[c]=b}),r}},a=class a extends p{constructor(e){super();let{signatures:s,bitmap:t}=e;if(s.length>a.MAX_SIGNATURES_SUPPORTED)throw new Error(`The number of signatures cannot be greater than ${a.MAX_SIGNATURES_SUPPORTED}`);if(this.signatures=s.map(n=>n instanceof l?n:new l(n)),!(t instanceof Uint8Array))this.bitmap=a.createBitmap({bits:t});else{if(t.length!==a.BITMAP_LEN)throw new Error(`"bitmap" length should be ${a.BITMAP_LEN}`);this.bitmap=t}let r=this.bitmap.reduce((n,i)=>n+f(i),0);if(r!==this.signatures.length)throw new Error(`Expecting ${r} signatures from the bitmap, but got ${this.signatures.length}`)}static createBitmap(e){let{bits:s}=e,t=128,r=new Uint8Array([0,0,0,0]),n=new Set;return s.forEach(i=>{if(i>=a.MAX_SIGNATURES_SUPPORTED)throw new Error(`Cannot have a signature larger than ${a.MAX_SIGNATURES_SUPPORTED-1}.`);if(n.has(i))throw new Error("Duplicate bits detected.");n.add(i);let u=Math.floor(i/8),c=r[u];c|=t>>i%8,r[u]=c}),r}toUint8Array(){return this.bcsToBytes()}serialize(e){e.serializeVector(this.signatures),e.serializeBytes(this.bitmap)}static deserialize(e){let s=e.deserializeBytes(),t=s.reduce((n,i)=>n+f(i),0),r=[];for(let n=0;n<t;n+=1){let i=l.deserialize(e);r.push(i)}return new a({signatures:r,bitmap:s})}};a.BITMAP_LEN=4,a.MAX_SIGNATURES_SUPPORTED=a.BITMAP_LEN*8;var d=a;export{A as a,d as b};
|
|
2
|
-
//# sourceMappingURL=chunk-2HISPUZZ.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/crypto/multiKey.ts"],"sourcesContent":["import { SigningScheme as AuthenticationKeyScheme } from \"../../types\";\nimport { Deserializer } from \"../../bcs/deserializer\";\nimport { Serializer } from \"../../bcs/serializer\";\nimport { AuthenticationKey } from \"../authenticationKey\";\nimport { AccountPublicKey, PublicKey, VerifySignatureArgs } from \"./publicKey\";\nimport { Signature } from \"./signature\";\nimport { AnyPublicKey, AnySignature } from \"./singleKey\";\n\n/* eslint-disable no-bitwise */\n\nfunction bitCount(byte: number) {\n let n = byte;\n n -= (n >> 1) & 0x55555555;\n n = (n & 0x33333333) + ((n >> 2) & 0x33333333);\n return (((n + (n >> 4)) & 0xf0f0f0f) * 0x1010101) >> 24;\n}\n\n/* eslint-enable no-bitwise */\n\n/**\n * Represents the public key of a multi-agent account.\n *\n * The public keys of each individual agent can be any type of public key supported by Aptos.\n * Since [AIP-55](https://github.com/aptos-foundation/AIPs/pull/263) Aptos supports\n * `Legacy` and `Unified` authentication keys.\n */\nexport class MultiKey extends AccountPublicKey {\n /**\n * List of any public keys\n */\n public readonly publicKeys: AnyPublicKey[];\n\n /**\n * The minimum number of valid signatures required, for the number of public keys specified\n */\n public readonly signaturesRequired: number;\n\n // region Constructors\n\n constructor(args: { publicKeys: Array<PublicKey>; signaturesRequired: number }) {\n super();\n const { publicKeys, signaturesRequired } = args;\n\n // Validate number of public keys is greater than signature required\n if (signaturesRequired < 1) {\n throw new Error(\"The number of required signatures needs to be greater than 0\");\n }\n\n // Validate number of public keys is greater than signature required\n if (publicKeys.length < signaturesRequired) {\n throw new Error(\n `Provided ${publicKeys.length} public keys is smaller than the ${signaturesRequired} required signatures`,\n );\n }\n\n // Make sure that all keys are normalized to the SingleKey authentication scheme\n this.publicKeys = publicKeys.map((publicKey) =>\n publicKey instanceof AnyPublicKey ? publicKey : new AnyPublicKey(publicKey),\n );\n\n this.signaturesRequired = signaturesRequired;\n }\n\n // endregion\n\n // region AccountPublicKey\n\n // eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars\n verifySignature(args: VerifySignatureArgs): boolean {\n throw new Error(\"not implemented\");\n }\n\n authKey(): AuthenticationKey {\n return AuthenticationKey.fromSchemeAndBytes({\n scheme: AuthenticationKeyScheme.MultiKey,\n input: this.toUint8Array(),\n });\n }\n\n toUint8Array(): Uint8Array {\n return this.bcsToBytes();\n }\n\n // endregion\n\n // region Serializable\n\n serialize(serializer: Serializer): void {\n serializer.serializeVector(this.publicKeys);\n serializer.serializeU8(this.signaturesRequired);\n }\n\n static deserialize(deserializer: Deserializer): MultiKey {\n const keys = deserializer.deserializeVector(AnyPublicKey);\n const signaturesRequired = deserializer.deserializeU8();\n\n return new MultiKey({ publicKeys: keys, signaturesRequired });\n }\n\n // endregion\n\n /**\n * Create a bitmap that holds the mapping from the original public keys\n * to the signatures passed in\n *\n * @param args.bits array of the index mapping to the matching public keys\n * @returns Uint8array bit map\n */\n createBitmap(args: { bits: number[] }): Uint8Array {\n const { bits } = args;\n // Bits are read from left to right. e.g. 0b10000000 represents the first bit is set in one byte.\n // The decimal value of 0b10000000 is 128.\n const firstBitInByte = 128;\n const bitmap = new Uint8Array([0, 0, 0, 0]);\n\n // Check if duplicates exist in bits\n const dupCheckSet = new Set();\n\n bits.forEach((bit: number, idx: number) => {\n if (idx + 1 > this.publicKeys.length) {\n throw new Error(`Signature index ${idx + 1} is out of public keys range, ${this.publicKeys.length}.`);\n }\n\n if (dupCheckSet.has(bit)) {\n throw new Error(`Duplicate bit ${bit} detected.`);\n }\n\n dupCheckSet.add(bit);\n\n const byteOffset = Math.floor(bit / 8);\n\n let byte = bitmap[byteOffset];\n\n // eslint-disable-next-line no-bitwise\n byte |= firstBitInByte >> bit % 8;\n\n bitmap[byteOffset] = byte;\n });\n\n return bitmap;\n }\n}\n\nexport class MultiKeySignature extends Signature {\n /**\n * Number of bytes in the bitmap representing who signed the transaction (32-bits)\n */\n static BITMAP_LEN: number = 4;\n\n /**\n * Maximum number of Ed25519 signatures supported\n */\n static MAX_SIGNATURES_SUPPORTED = MultiKeySignature.BITMAP_LEN * 8;\n\n /**\n * The list of underlying Ed25519 signatures\n */\n public readonly signatures: AnySignature[];\n\n /**\n * 32-bit Bitmap representing who signed the transaction\n *\n * This is represented where each public key can be masked to determine whether the message was signed by that key.\n */\n public readonly bitmap: Uint8Array;\n\n /**\n * Signature for a K-of-N multi-sig transaction.\n *\n * @see {@link\n * https://aptos.dev/integration/creating-a-signed-transaction/#multisignature-transactions | Creating a Signed Transaction}\n *\n * @param args.signatures A list of signatures\n * @param args.bitmap 4 bytes, at most 32 signatures are supported. If Nth bit value is `1`, the Nth\n * signature should be provided in `signatures`. Bits are read from left to right\n */\n constructor(args: { signatures: Array<Signature | AnySignature>; bitmap: Uint8Array | number[] }) {\n super();\n const { signatures, bitmap } = args;\n\n if (signatures.length > MultiKeySignature.MAX_SIGNATURES_SUPPORTED) {\n throw new Error(`The number of signatures cannot be greater than ${MultiKeySignature.MAX_SIGNATURES_SUPPORTED}`);\n }\n\n // Make sure that all signatures are normalized to the SingleKey authentication scheme\n this.signatures = signatures.map((signature) =>\n signature instanceof AnySignature ? signature : new AnySignature(signature),\n );\n\n if (!(bitmap instanceof Uint8Array)) {\n this.bitmap = MultiKeySignature.createBitmap({ bits: bitmap });\n } else if (bitmap.length !== MultiKeySignature.BITMAP_LEN) {\n throw new Error(`\"bitmap\" length should be ${MultiKeySignature.BITMAP_LEN}`);\n } else {\n this.bitmap = bitmap;\n }\n\n const nSignatures = this.bitmap.reduce((acc, byte) => acc + bitCount(byte), 0);\n if (nSignatures !== this.signatures.length) {\n throw new Error(`Expecting ${nSignatures} signatures from the bitmap, but got ${this.signatures.length}`);\n }\n }\n\n /**\n * Helper method to create a bitmap out of the specified bit positions\n * @param args.bits The bitmap positions that should be set. A position starts at index 0.\n * Valid position should range between 0 and 31.\n * @example\n * Here's an example of valid `bits`\n * ```\n * [0, 2, 31]\n * ```\n * `[0, 2, 31]` means the 1st, 3rd and 32nd bits should be set in the bitmap.\n * The result bitmap should be 0b1010000000000000000000000000001\n *\n * @returns bitmap that is 32bit long\n */\n static createBitmap(args: { bits: number[] }): Uint8Array {\n const { bits } = args;\n // Bits are read from left to right. e.g. 0b10000000 represents the first bit is set in one byte.\n // The decimal value of 0b10000000 is 128.\n const firstBitInByte = 128;\n const bitmap = new Uint8Array([0, 0, 0, 0]);\n\n // Check if duplicates exist in bits\n const dupCheckSet = new Set();\n\n bits.forEach((bit: number) => {\n if (bit >= MultiKeySignature.MAX_SIGNATURES_SUPPORTED) {\n throw new Error(`Cannot have a signature larger than ${MultiKeySignature.MAX_SIGNATURES_SUPPORTED - 1}.`);\n }\n\n if (dupCheckSet.has(bit)) {\n throw new Error(\"Duplicate bits detected.\");\n }\n\n dupCheckSet.add(bit);\n\n const byteOffset = Math.floor(bit / 8);\n\n let byte = bitmap[byteOffset];\n\n // eslint-disable-next-line no-bitwise\n byte |= firstBitInByte >> bit % 8;\n\n bitmap[byteOffset] = byte;\n });\n\n return bitmap;\n }\n\n // region Signature\n\n toUint8Array(): Uint8Array {\n return this.bcsToBytes();\n }\n\n // endregion\n\n // region Serializable\n\n serialize(serializer: Serializer): void {\n // Note: we should not need to serialize the vector length, as it can be derived from the bitmap\n serializer.serializeVector(this.signatures);\n serializer.serializeBytes(this.bitmap);\n }\n\n static deserialize(deserializer: Deserializer): MultiKeySignature {\n const bitmap = deserializer.deserializeBytes();\n const nSignatures = bitmap.reduce((acc, byte) => acc + bitCount(byte), 0);\n const signatures: AnySignature[] = [];\n for (let i = 0; i < nSignatures; i += 1) {\n const signature = AnySignature.deserialize(deserializer);\n signatures.push(signature);\n }\n return new MultiKeySignature({ signatures, bitmap });\n }\n\n // endregion\n}\n"],"mappings":"2KAUA,SAASA,EAASC,EAAc,CAC9B,IAAIC,EAAID,EACR,OAAAC,GAAMA,GAAK,EAAK,WAChBA,GAAKA,EAAI,YAAgBA,GAAK,EAAK,YACzBA,GAAKA,GAAK,GAAM,WAAa,UAAc,EACvD,CAWO,IAAMC,EAAN,MAAMC,UAAiBC,CAAiB,CAa7C,YAAYC,EAAoE,CAC9E,MAAM,EACN,GAAM,CAAE,WAAAC,EAAY,mBAAAC,CAAmB,EAAIF,EAG3C,GAAIE,EAAqB,EACvB,MAAM,IAAI,MAAM,8DAA8D,EAIhF,GAAID,EAAW,OAASC,EACtB,MAAM,IAAI,MACR,YAAYD,EAAW,MAAM,oCAAoCC,CAAkB,sBACrF,EAIF,KAAK,WAAaD,EAAW,IAAKE,GAChCA,aAAqBC,EAAeD,EAAY,IAAIC,EAAaD,CAAS,CAC5E,EAEA,KAAK,mBAAqBD,CAC5B,CAOA,gBAAgBF,EAAoC,CAClD,MAAM,IAAI,MAAM,iBAAiB,CACnC,CAEA,SAA6B,CAC3B,OAAOK,EAAkB,mBAAmB,CAC1C,SACA,MAAO,KAAK,aAAa,CAC3B,CAAC,CACH,CAEA,cAA2B,CACzB,OAAO,KAAK,WAAW,CACzB,CAMA,UAAUC,EAA8B,CACtCA,EAAW,gBAAgB,KAAK,UAAU,EAC1CA,EAAW,YAAY,KAAK,kBAAkB,CAChD,CAEA,OAAO,YAAYC,EAAsC,CACvD,IAAMC,EAAOD,EAAa,kBAAkBH,CAAY,EAClDF,EAAqBK,EAAa,cAAc,EAEtD,OAAO,IAAIT,EAAS,CAAE,WAAYU,EAAM,mBAAAN,CAAmB,CAAC,CAC9D,CAWA,aAAaF,EAAsC,CACjD,GAAM,CAAE,KAAAS,CAAK,EAAIT,EAGXU,EAAiB,IACjBC,EAAS,IAAI,WAAW,CAAC,EAAG,EAAG,EAAG,CAAC,CAAC,EAGpCC,EAAc,IAAI,IAExB,OAAAH,EAAK,QAAQ,CAACI,EAAaC,IAAgB,CACzC,GAAIA,EAAM,EAAI,KAAK,WAAW,OAC5B,MAAM,IAAI,MAAM,mBAAmBA,EAAM,CAAC,iCAAiC,KAAK,WAAW,MAAM,GAAG,EAGtG,GAAIF,EAAY,IAAIC,CAAG,EACrB,MAAM,IAAI,MAAM,iBAAiBA,CAAG,YAAY,EAGlDD,EAAY,IAAIC,CAAG,EAEnB,IAAME,EAAa,KAAK,MAAMF,EAAM,CAAC,EAEjClB,EAAOgB,EAAOI,CAAU,EAG5BpB,GAAQe,GAAkBG,EAAM,EAEhCF,EAAOI,CAAU,EAAIpB,CACvB,CAAC,EAEMgB,CACT,CACF,EAEaK,EAAN,MAAMA,UAA0BC,CAAU,CAiC/C,YAAYjB,EAAsF,CAChG,MAAM,EACN,GAAM,CAAE,WAAAkB,EAAY,OAAAP,CAAO,EAAIX,EAE/B,GAAIkB,EAAW,OAASF,EAAkB,yBACxC,MAAM,IAAI,MAAM,mDAAmDA,EAAkB,wBAAwB,EAAE,EAQjH,GAJA,KAAK,WAAaE,EAAW,IAAKC,GAChCA,aAAqBC,EAAeD,EAAY,IAAIC,EAAaD,CAAS,CAC5E,EAEI,EAAER,aAAkB,YACtB,KAAK,OAASK,EAAkB,aAAa,CAAE,KAAML,CAAO,CAAC,MACxD,IAAIA,EAAO,SAAWK,EAAkB,WAC7C,MAAM,IAAI,MAAM,6BAA6BA,EAAkB,UAAU,EAAE,EAE3E,KAAK,OAASL,EAGhB,IAAMU,EAAc,KAAK,OAAO,OAAO,CAACC,EAAK3B,IAAS2B,EAAM5B,EAASC,CAAI,EAAG,CAAC,EAC7E,GAAI0B,IAAgB,KAAK,WAAW,OAClC,MAAM,IAAI,MAAM,aAAaA,CAAW,wCAAwC,KAAK,WAAW,MAAM,EAAE,CAE5G,CAgBA,OAAO,aAAarB,EAAsC,CACxD,GAAM,CAAE,KAAAS,CAAK,EAAIT,EAGXU,EAAiB,IACjBC,EAAS,IAAI,WAAW,CAAC,EAAG,EAAG,EAAG,CAAC,CAAC,EAGpCC,EAAc,IAAI,IAExB,OAAAH,EAAK,QAASI,GAAgB,CAC5B,GAAIA,GAAOG,EAAkB,yBAC3B,MAAM,IAAI,MAAM,uCAAuCA,EAAkB,yBAA2B,CAAC,GAAG,EAG1G,GAAIJ,EAAY,IAAIC,CAAG,EACrB,MAAM,IAAI,MAAM,0BAA0B,EAG5CD,EAAY,IAAIC,CAAG,EAEnB,IAAME,EAAa,KAAK,MAAMF,EAAM,CAAC,EAEjClB,EAAOgB,EAAOI,CAAU,EAG5BpB,GAAQe,GAAkBG,EAAM,EAEhCF,EAAOI,CAAU,EAAIpB,CACvB,CAAC,EAEMgB,CACT,CAIA,cAA2B,CACzB,OAAO,KAAK,WAAW,CACzB,CAMA,UAAUL,EAA8B,CAEtCA,EAAW,gBAAgB,KAAK,UAAU,EAC1CA,EAAW,eAAe,KAAK,MAAM,CACvC,CAEA,OAAO,YAAYC,EAA+C,CAChE,IAAMI,EAASJ,EAAa,iBAAiB,EACvCc,EAAcV,EAAO,OAAO,CAACW,EAAK3B,IAAS2B,EAAM5B,EAASC,CAAI,EAAG,CAAC,EAClEuB,EAA6B,CAAC,EACpC,QAASK,EAAI,EAAGA,EAAIF,EAAaE,GAAK,EAAG,CACvC,IAAMJ,EAAYC,EAAa,YAAYb,CAAY,EACvDW,EAAW,KAAKC,CAAS,CAC3B,CACA,OAAO,IAAIH,EAAkB,CAAE,WAAAE,EAAY,OAAAP,CAAO,CAAC,CACrD,CAGF,EAxIaK,EAIJ,WAAqB,EAJjBA,EASJ,yBAA2BA,EAAkB,WAAa,EAT5D,IAAMQ,EAANR","names":["bitCount","byte","n","MultiKey","_MultiKey","AccountPublicKey","args","publicKeys","signaturesRequired","publicKey","AnyPublicKey","AuthenticationKey","serializer","deserializer","keys","bits","firstBitInByte","bitmap","dupCheckSet","bit","idx","byteOffset","_MultiKeySignature","Signature","signatures","signature","AnySignature","nSignatures","acc","i","MultiKeySignature"]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as r}from"./chunk-EOFJFE4T.mjs";import{b as i}from"./chunk-QMURTXFM.mjs";import{b as t}from"./chunk-52C73T26.mjs";async function v(a){let{aptosConfig:o,payload:n,options:s}=a,p=await r({...n,aptosConfig:o}),e=new t;p.serialize(e);let l=e.toUint8Array(),{data:d}=await i({aptosConfig:o,path:"view",originMethod:"view",contentType:"application/x.aptos.view_function+bcs",params:{ledger_version:s?.ledgerVersion},body:l});return d}export{v as a};
|
|
2
|
-
//# sourceMappingURL=chunk-3WUGR46O.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as c}from"./chunk-AOCNYMMX.mjs";import{a as U,b,c as f,d as u,e as h,f as y}from"./chunk-56CNRT2K.mjs";import{a as s}from"./chunk-FVA2OPG4.mjs";var B=class{bcsToBytes(){let e=new n;return this.serialize(e),e.toUint8Array()}bcsToHex(){let e=this.bcsToBytes();return c.fromHexInput(e)}},n=class{constructor(e=64){if(e<=0)throw new Error("Length needs to be greater than 0");this.buffer=new ArrayBuffer(e),this.offset=0}ensureBufferWillHandleSize(e){for(;this.buffer.byteLength<this.offset+e;){let t=new ArrayBuffer(this.buffer.byteLength*2);new Uint8Array(t).set(new Uint8Array(this.buffer)),this.buffer=t}}appendToBuffer(e){this.ensureBufferWillHandleSize(e.length),new Uint8Array(this.buffer,this.offset).set(e),this.offset+=e.length}serializeWithFunction(e,t,i){this.ensureBufferWillHandleSize(t);let a=new DataView(this.buffer,this.offset);e.apply(a,[0,i,!0]),this.offset+=t}serializeStr(e){let t=new TextEncoder;this.serializeBytes(t.encode(e))}serializeBytes(e){this.serializeU32AsUleb128(e.length),this.appendToBuffer(e)}serializeFixedBytes(e){this.appendToBuffer(e)}serializeBool(e){A(e);let t=e?1:0;this.appendToBuffer(new Uint8Array([t]))}serializeU8(e){this.appendToBuffer(new Uint8Array([e]))}serializeU16(e){this.serializeWithFunction(DataView.prototype.setUint16,2,e)}serializeU32(e){this.serializeWithFunction(DataView.prototype.setUint32,4,e)}serializeU64(e){let t=BigInt(e)&BigInt(f),i=BigInt(e)>>BigInt(32);this.serializeU32(Number(t)),this.serializeU32(Number(i))}serializeU128(e){let t=BigInt(e)&u,i=BigInt(e)>>BigInt(64);this.serializeU64(t),this.serializeU64(i)}serializeU256(e){let t=BigInt(e)&h,i=BigInt(e)>>BigInt(128);this.serializeU128(t),this.serializeU128(i)}serializeU32AsUleb128(e){let t=e,i=[];for(;t>>>7;)i.push(t&127|128),t>>>=7;i.push(t),this.appendToBuffer(new Uint8Array(i))}toUint8Array(){return new Uint8Array(this.buffer).slice(0,this.offset)}serialize(e){e.serialize(this)}serializeVector(e){this.serializeU32AsUleb128(e.length),e.forEach(t=>{t.serialize(this)})}};s([o(0,U)],n.prototype,"serializeU8",1),s([o(0,b)],n.prototype,"serializeU16",1),s([o(0,f)],n.prototype,"serializeU32",1),s([o(BigInt(0),u)],n.prototype,"serializeU64",1),s([o(BigInt(0),h)],n.prototype,"serializeU128",1),s([o(BigInt(0),y)],n.prototype,"serializeU256",1),s([o(0,f)],n.prototype,"serializeU32AsUleb128",1);function A(r){if(typeof r!="boolean")throw new Error(`${r} is not a boolean value`)}var g=(r,e,t)=>`${r} is out of range: [${e}, ${t}]`;function w(r,e,t){let i=BigInt(r);if(i>BigInt(t)||i<BigInt(e))throw new Error(g(r,e,t))}function o(r,e){return(t,i,a)=>{let p=a.value;return a.value=function(l){return w(l,r,e),p.apply(this,[l])},a}}export{B as a,n as b,A as c,g as d,w as e};
|
|
2
|
-
//# sourceMappingURL=chunk-52C73T26.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as i}from"./chunk-NNQJBFRB.mjs";import{h as t}from"./chunk-7QJ6YJXP.mjs";var r=class{constructor(o){this.config=o}async fundAccount(o){let n=await i({aptosConfig:this.config,...o});return o.options?.waitForIndexer!==!1&&await t({aptosConfig:this.config,minimumLedgerVersion:BigInt(n.version)}),n}};export{r as a};
|
|
2
|
-
//# sourceMappingURL=chunk-5P2S2SZZ.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as n,b as s,c as r,d as i,e as o,f as a,g as c,h as p,i as d,j as g,k as u,l as A,m as y,n as l,o as m,p as T,q as f,r as I,s as C,t as O,u as P,v as D}from"./chunk-MC6G725U.mjs";import{a as e}from"./chunk-MACC2BLE.mjs";var V=class{constructor(t){this.config=t}async getCollectionData(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),a({aptosConfig:this.config,...t})}async getCollectionDataByCollectionId(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),c({aptosConfig:this.config,...t})}async getCollectionId(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),p({aptosConfig:this.config,...t})}async getDigitalAssetData(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),n({aptosConfig:this.config,...t})}async getCurrentDigitalAssetOwnership(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),s({aptosConfig:this.config,...t})}async getOwnedDigitalAssets(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),r({aptosConfig:this.config,...t})}async getDigitalAssetActivity(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),i({aptosConfig:this.config,...t})}async createCollectionTransaction(t){return o({aptosConfig:this.config,...t})}async mintDigitalAssetTransaction(t){return d({aptosConfig:this.config,...t})}async transferDigitalAssetTransaction(t){return g({aptosConfig:this.config,...t})}async mintSoulBoundTransaction(t){return u({aptosConfig:this.config,...t})}async burnDigitalAssetTransaction(t){return A({aptosConfig:this.config,...t})}async freezeDigitalAssetTransaferTransaction(t){return y({aptosConfig:this.config,...t})}async unfreezeDigitalAssetTransaferTransaction(t){return l({aptosConfig:this.config,...t})}async setDigitalAssetDescriptionTransaction(t){return m({aptosConfig:this.config,...t})}async setDigitalAssetNameTransaction(t){return T({aptosConfig:this.config,...t})}async setDigitalAssetURITransaction(t){return f({aptosConfig:this.config,...t})}async addDigitalAssetPropertyTransaction(t){return I({aptosConfig:this.config,...t})}async removeDigitalAssetPropertyTransaction(t){return C({aptosConfig:this.config,...t})}async updateDigitalAssetPropertyTransaction(t){return O({aptosConfig:this.config,...t})}async addDigitalAssetTypedPropertyTransaction(t){return P({aptosConfig:this.config,...t})}async updateDigitalAssetTypedPropertyTransaction(t){return D({aptosConfig:this.config,...t})}};export{V as a};
|
|
2
|
-
//# sourceMappingURL=chunk-6CFRW26C.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/api/digitalAsset.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n AnyNumber,\n GetCollectionDataResponse,\n GetCurrentTokenOwnershipResponse,\n GetOwnedTokensResponse,\n GetTokenActivityResponse,\n GetTokenDataResponse,\n MoveStructId,\n OrderByArg,\n PaginationArgs,\n TokenStandardArg,\n} from \"../types\";\nimport { Account, AccountAddress, AccountAddressInput } from \"../core\";\nimport { InputGenerateTransactionOptions } from \"../transactions/types\";\nimport {\n addDigitalAssetPropertyTransaction,\n addDigitalAssetTypedPropertyTransaction,\n burnDigitalAssetTransaction,\n CreateCollectionOptions,\n createCollectionTransaction,\n freezeDigitalAssetTransferTransaction,\n getCollectionData,\n getCollectionDataByCollectionId,\n getCollectionId,\n getCurrentDigitalAssetOwnership,\n getDigitalAssetActivity,\n getDigitalAssetData,\n getOwnedDigitalAssets,\n mintDigitalAssetTransaction,\n mintSoulBoundTransaction,\n PropertyType,\n PropertyValue,\n removeDigitalAssetPropertyTransaction,\n setDigitalAssetDescriptionTransaction,\n setDigitalAssetNameTransaction,\n setDigitalAssetURITransaction,\n transferDigitalAssetTransaction,\n unfreezeDigitalAssetTransferTransaction,\n updateDigitalAssetPropertyTransaction,\n updateDigitalAssetTypedPropertyTransaction,\n} from \"../internal/digitalAsset\";\nimport { ProcessorType } from \"../utils/const\";\nimport { AptosConfig } from \"./aptosConfig\";\nimport { waitForIndexerOnVersion } from \"./utils\";\nimport { SimpleTransaction } from \"../transactions/instances/simpleTransaction\";\n\n/**\n * A class to query all `DigitalAsset` related queries on Aptos.\n */\nexport class DigitalAsset {\n constructor(readonly config: AptosConfig) {}\n\n /**\n * Queries data of a specific collection by the collection creator address and the collection name.\n *\n * If, for some reason, a creator account has 2 collections with the same name in v1 and v2,\n * can pass an optional `tokenStandard` parameter to query a specific standard\n *\n * @example\n * const collection = await aptos.getCollectionData({creatorAddress:\"0x123\",collectionName:\"myCollection\"})\n *\n * @param args.creatorAddress the address of the collection's creator\n * @param args.collectionName the name of the collection\n * @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying\n * @param args.options.tokenStandard the token standard to query\n * @returns GetCollectionDataResponse response type\n */\n async getCollectionData(args: {\n creatorAddress: AccountAddressInput;\n collectionName: string;\n minimumLedgerVersion?: AnyNumber;\n options?: TokenStandardArg;\n }): Promise<GetCollectionDataResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.TOKEN_V2_PROCESSOR,\n });\n return getCollectionData({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries data of a specific collection by the collection ID.\n *\n * @example\n * const collection = await aptos.getCollectionDataByCollectionId({collectionId:\"0x123\"})\n *\n * @param args.collectionId the ID of the collection, it's the same thing as the address of the collection object\n * @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying\n * @returns GetCollectionDataResponse response type\n */\n async getCollectionDataByCollectionId(args: {\n collectionId: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n }): Promise<GetCollectionDataResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.TOKEN_V2_PROCESSOR,\n });\n return getCollectionDataByCollectionId({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries a collection's ID.\n *\n * This is the same as the collection's object address in V2, but V1 does\n * not use objects, and does not have an address\n *\n * @example\n * const collection = await aptos.getCollectionId({creatorAddress:\"0x123\",collectionName:\"myCollection\"})\n *\n * @param args.creatorAddress the address of the collection's creator\n * @param args.collectionName the name of the collection\n * @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying\n * @param args.options.tokenStandard the token standard to query\n * @returns the collection id\n */\n async getCollectionId(args: {\n creatorAddress: AccountAddressInput;\n collectionName: string;\n minimumLedgerVersion?: AnyNumber;\n options?: TokenStandardArg;\n }): Promise<string> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.TOKEN_V2_PROCESSOR,\n });\n return getCollectionId({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Gets digital asset data given the address of a digital asset.\n *\n * @example\n * const digitalAsset = await aptos.getDigitalAssetData({digitalAssetAddress:\"0x123\"})\n *\n * @param args.tokenAddress The address of the digital asset\n * @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying\n * @returns GetTokenDataResponse containing relevant data to the digital asset.\n */\n async getDigitalAssetData(args: {\n digitalAssetAddress: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n }): Promise<GetTokenDataResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.TOKEN_V2_PROCESSOR,\n });\n return getDigitalAssetData({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Gets digital asset ownership data given the address of a digital asset.\n *\n * @example\n * const digitalAssetOwner = await aptos.getCurrentDigitalAssetOwnership({digitalAssetAddress:\"0x123\"})\n *\n * @param args.tokenAddress The address of the digital asset\n * @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying\n *\n * @returns GetCurrentTokenOwnershipResponse containing relevant ownership data of the digital asset.\n */\n async getCurrentDigitalAssetOwnership(args: {\n digitalAssetAddress: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n }): Promise<GetCurrentTokenOwnershipResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.TOKEN_V2_PROCESSOR,\n });\n return getCurrentDigitalAssetOwnership({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Gets the digital assets that the given address owns.\n *\n * @example\n * const digitalAssets = await aptos.getOwnedDigitalAssets({ownerAddress:\"0x123\"})\n *\n * @param args.ownerAddress The address of the owner\n * @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying\n *\n * @returns GetOwnedTokensResponse containing ownership data of the digital assets belonging to the ownerAddresss.\n */\n async getOwnedDigitalAssets(args: {\n ownerAddress: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n options?: PaginationArgs & OrderByArg<GetOwnedTokensResponse[0]>;\n }): Promise<GetOwnedTokensResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.TOKEN_V2_PROCESSOR,\n });\n return getOwnedDigitalAssets({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Gets the activity data given the address of a digital asset.\n *\n * @example\n * const digitalAssetActivity = await aptos.getDigitalAssetActivity({digitalAssetAddress:\"0x123\"})\n *\n * @param args.tokenAddress The address of the digital asset\n * @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying\n *\n * @returns GetTokenActivityResponse containing relevant activity data to the digital asset.\n */\n async getDigitalAssetActivity(args: {\n digitalAssetAddress: AccountAddressInput;\n minimumLedgerVersion?: AnyNumber;\n options?: PaginationArgs & OrderByArg<GetTokenActivityResponse[0]>;\n }): Promise<GetTokenActivityResponse> {\n await waitForIndexerOnVersion({\n config: this.config,\n minimumLedgerVersion: args.minimumLedgerVersion,\n processorType: ProcessorType.TOKEN_V2_PROCESSOR,\n });\n return getDigitalAssetActivity({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Creates a new collection within the specified account\n *\n * @example\n * const transaction = await aptos.createCollectionTransaction({\n * creator: alice,\n * description: \"collectionDescription\",\n * name: \"collectionName\",\n * uri: \"collection-uri.com\",\n * });\n *\n * @param args.creator the account of the collection's creator\n * @param args.description the description of the collection\n * @param args.name the name of the collection\n * @param args.uri the URI to additional info about the collection\n *\n * The parameters below are optional.\n * @param args.maxSupply controls the max supply of the digital assets - defaults MAX_U64_BIG_INT\n * @param args.mutableDescription controls mutability of the collection's description - defaults true\n * @param args.mutableRoyalty controls mutability of the collection's description - defaults true\n * @param args.mutableUri controls mutability of the collection's URI - defaults true\n * @param args.mutableTokenDescription controls mutability of the digital asset's description - defaults true\n * @param args.mutableTokenName controls mutability of the digital asset's name - defaults true\n * @param args.mutableTokenProperties controls mutability of digital asset's properties - defaults true\n * @param args.mutableTokenUri controls mutability of the digital asset's URI - defaults true\n * @param args.tokensBurnableByCreator controls whether digital assets can be burnable by the creator - defaults true\n * @param args.tokensFreezableByCreator controls whether digital assets can be frozen by the creator - defaults true\n * @param args.royaltyNumerator the numerator of the royalty to be paid to the creator when\n * a digital asset is transferred - defaults 0\n * @param args.royaltyDenominator the denominator of the royalty to be paid to the creator\n * when a digital asset is transferred - defaults 1\n *\n * @returns A SimpleTransaction that when submitted will create the collection.\n */\n async createCollectionTransaction(\n args: {\n creator: Account;\n description: string;\n name: string;\n uri: string;\n options?: InputGenerateTransactionOptions;\n } & CreateCollectionOptions,\n ): Promise<SimpleTransaction> {\n return createCollectionTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Create a transaction to mint a digital asset into the creators account within an existing collection.\n *\n * @example\n * const transaction = await aptos.mintDigitalAssetTransaction({\n * creator: alice,\n * description: \"collectionDescription\",\n * collection: \"collectionName\",\n * name: \"digitalAssetName\",\n * uri: \"digital-asset-uri.com\",\n * });\n *\n * @param args.creator the creator of the collection\n * @param args.collection the name of the collection the digital asset belongs to\n * @param args.description the description of the digital asset\n * @param args.name the name of the digital asset\n * @param args.uri the URI to additional info about the digital asset\n *\n * @returns A SimpleTransaction that can be simulated or submitted to chain\n */\n async mintDigitalAssetTransaction(args: {\n creator: Account;\n collection: string;\n description: string;\n name: string;\n uri: string;\n propertyKeys?: Array<string>;\n propertyTypes?: Array<PropertyType>;\n propertyValues?: Array<PropertyValue>;\n options?: InputGenerateTransactionOptions;\n }): Promise<SimpleTransaction> {\n return mintDigitalAssetTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Transfer a digital asset (non fungible digital asset) ownership.\n *\n * We can transfer a digital asset only when the digital asset is not frozen\n * (i.e. owner transfer is not disabled such as for soul bound digital assets)\n *\n * @example\n * const transaction = await aptos.transferDigitalAssetTransaction({\n * sender: alice,\n * digitalAssetAddress: \"0x123\",\n * recipient: \"0x456\",\n * });\n *\n * @param args.sender The sender account of the current digital asset owner\n * @param args.digitalAssetAddress The digital asset address\n * @param args.recipient The recipient account address\n * @param args.digitalAssetType optional. The digital asset type, default to \"0x4::token::Token\"\n *\n * @returns A SimpleTransaction that can be simulated or submitted to chain\n */\n async transferDigitalAssetTransaction(args: {\n sender: Account;\n digitalAssetAddress: AccountAddressInput;\n recipient: AccountAddress;\n digitalAssetType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }): Promise<SimpleTransaction> {\n return transferDigitalAssetTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Mint a soul bound digital asset into a recipient's account\n *\n * @example\n * const transaction = await aptos.mintSoulBoundTransaction({\n * account: alice,\n * collection: \"collectionName\",\n * description: \"collectionDescription\",\n * name: \"digitalAssetName\",\n * uri: \"digital-asset-uri.com\",\n * recipient: \"0x123\"\n * });\n *\n * @param args.account The account that mints the digital asset\n * @param args.collection The collection name that the digital asset belongs to\n * @param args.description The digital asset description\n * @param args.name The digital asset name\n * @param args.uri The digital asset URL\n * @param args.recipient The account address where the digital asset will be created\n * @param args.propertyKeys The property keys for storing on-chain properties\n * @param args.propertyTypes The type of property values\n * @param args.propertyValues The property values to be stored on-chain\n *\n * @returns A SimpleTransaction that can be simulated or submitted to chain\n */\n async mintSoulBoundTransaction(args: {\n account: Account;\n collection: string;\n description: string;\n name: string;\n uri: string;\n recipient: AccountAddressInput;\n propertyKeys?: Array<string>;\n propertyTypes?: Array<PropertyType>;\n propertyValues?: Array<PropertyValue>;\n options?: InputGenerateTransactionOptions;\n }): Promise<SimpleTransaction> {\n return mintSoulBoundTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Burn a digital asset by its creator\n *\n * @example\n * const transaction = await aptos.burnDigitalAssetTransaction({\n * creator: alice,\n * digitalAssetAddress: \"0x123\",\n * });\n *\n * @param args.creator The creator account\n * @param args.digitalAssetAddress The digital asset address\n *\n * @returns A SimpleTransaction that can be simulated or submitted to chain\n */\n async burnDigitalAssetTransaction(args: {\n creator: Account;\n digitalAssetAddress: AccountAddressInput;\n digitalAssetType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }) {\n return burnDigitalAssetTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Freeze digital asset transfer ability\n *\n * @example\n * const transaction = await aptos.freezeDigitalAssetTransaferTransaction({\n * creator: alice,\n * digitalAssetAddress: \"0x123\",\n * });\n *\n * @param args.creator The creator account\n * @param args.digitalAssetAddress The digital asset address\n *\n * @returns A SimpleTransaction that can be simulated or submitted to chain\n */\n async freezeDigitalAssetTransaferTransaction(args: {\n creator: Account;\n digitalAssetAddress: AccountAddressInput;\n digitalAssetType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }) {\n return freezeDigitalAssetTransferTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Unfreeze digital asset transfer ability\n *\n * @example\n * const transaction = await aptos.unfreezeDigitalAssetTransaferTransaction({\n * creator: alice,\n * digitalAssetAddress: \"0x123\",\n * });\n *\n * @param args.creator The creator account\n * @param args.digitalAssetAddress The digital asset address\n *\n * @returns A SimpleTransaction that can be simulated or submitted to chain\n */\n async unfreezeDigitalAssetTransaferTransaction(args: {\n creator: Account;\n digitalAssetAddress: AccountAddressInput;\n digitalAssetType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }) {\n return unfreezeDigitalAssetTransferTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Set the digital asset description\n *\n * @example\n * const transaction = await aptos.setDigitalAssetDescriptionTransaction({\n * creator: alice,\n * description: \"digitalAssetDescription\",\n * digitalAssetAddress: \"0x123\",\n * });\n *\n * @param args.creator The creator account\n * @param args.description The digital asset description\n * @param args.digitalAssetAddress The digital asset address\n *\n * @returns A SimpleTransaction that can be simulated or submitted to chain\n */\n async setDigitalAssetDescriptionTransaction(args: {\n creator: Account;\n description: string;\n digitalAssetAddress: AccountAddressInput;\n digitalAssetType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }) {\n return setDigitalAssetDescriptionTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Set the digital asset name\n *\n * @example\n * const transaction = await aptos.setDigitalAssetNameTransaction({\n * creator: alice,\n * name: \"digitalAssetName\",\n * digitalAssetAddress: \"0x123\",\n * });\n *\n * @param args.creator The creator account\n * @param args.name The digital asset name\n * @param args.digitalAssetAddress The digital asset address\n *\n * @returns A SimpleTransaction that can be simulated or submitted to chain\n */\n async setDigitalAssetNameTransaction(args: {\n creator: Account;\n name: string;\n digitalAssetAddress: AccountAddressInput;\n digitalAssetType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }) {\n return setDigitalAssetNameTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Set the digital asset name\n *\n * @example\n * const transaction = await aptos.setDigitalAssetURITransaction({\n * creator: alice,\n * uri: \"digital-asset-uri.com\",\n * digitalAssetAddress: \"0x123\",\n * });\n *\n * @param args.creator The creator account\n * @param args.uri The digital asset uri\n * @param args.digitalAssetAddress The digital asset address\n *\n * @returns A SimpleTransaction that can be simulated or submitted to chain\n */\n async setDigitalAssetURITransaction(args: {\n creator: Account;\n uri: string;\n digitalAssetAddress: AccountAddressInput;\n digitalAssetType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }) {\n return setDigitalAssetURITransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Add a digital asset property\n *\n * @example\n * const transaction = await aptos.addDigitalAssetPropertyTransaction({\n * creator: alice,\n * propertyKey: \"newKey\",\n * propertyType: \"BOOLEAN\",\n * propertyValue: true,\n * digitalAssetAddress: \"0x123\",\n * });\n *\n * @param args.account The account that mints the digital asset\n * @param args.digitalAssetAddress The digital asset address\n * @param args.propertyKey The property key for storing on-chain properties\n * @param args.propertyType The type of property value\n * @param args.propertyValue The property value to be stored on-chain\n *\n * @returns A SimpleTransaction that can be simulated or submitted to chain\n */\n async addDigitalAssetPropertyTransaction(args: {\n creator: Account;\n propertyKey: string;\n propertyType: PropertyType;\n propertyValue: PropertyValue;\n digitalAssetAddress: AccountAddressInput;\n digitalAssetType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }) {\n return addDigitalAssetPropertyTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Remove a digital asset property\n *\n * @example\n * const transaction = await aptos.removeDigitalAssetPropertyTransaction({\n * creator: alice,\n * propertyKey: \"newKey\",\n * propertyType: \"BOOLEAN\",\n * propertyValue: true,\n * digitalAssetAddress: \"0x123\",\n * });\n *\n * @param args.account The account that mints the digital asset\n * @param args.digitalAssetAddress The digital asset address\n * @param args.propertyKey The property key for storing on-chain properties\n * @param args.propertyType The type of property value\n * @param args.propertyValue The property value to be stored on-chain\n *\n * @returns A SimpleTransaction that can be simulated or submitted to chain\n */\n async removeDigitalAssetPropertyTransaction(args: {\n creator: Account;\n propertyKey: string;\n propertyType: PropertyType;\n propertyValue: PropertyValue;\n digitalAssetAddress: AccountAddressInput;\n digitalAssetType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }) {\n return removeDigitalAssetPropertyTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Update a digital asset property\n *\n * @example\n * const transaction = await aptos.updateDigitalAssetPropertyTransaction({\n * creator: alice,\n * propertyKey: \"newKey\",\n * propertyType: \"BOOLEAN\",\n * propertyValue: false,\n * digitalAssetAddress: \"0x123\",\n * });\n *\n * @param args.account The account that mints the digital asset\n * @param args.digitalAssetAddress The digital asset address\n * @param args.propertyKey The property key for storing on-chain properties\n * @param args.propertyType The type of property value\n * @param args.propertyValue The property value to be stored on-chain\n *\n * @returns A SimpleTransaction that can be simulated or submitted to chain\n */\n async updateDigitalAssetPropertyTransaction(args: {\n creator: Account;\n propertyKey: string;\n propertyType: PropertyType;\n propertyValue: PropertyValue;\n digitalAssetAddress: AccountAddressInput;\n digitalAssetType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }) {\n return updateDigitalAssetPropertyTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Add a typed digital asset property\n *\n * @example\n * const transaction = await aptos.addDigitalAssetTypedPropertyTransaction({\n * creator: alice,\n * propertyKey: \"typedKey\",\n * propertyType: \"STRING\",\n * propertyValue: \"hello\",\n * digitalAssetAddress: \"0x123\",\n * });\n *\n * @param args.account The account that mints the digital asset\n * @param args.digitalAssetAddress The digital asset address\n * @param args.propertyKey The property key for storing on-chain properties\n * @param args.propertyType The type of property value\n * @param args.propertyValue The property value to be stored on-chain\n *\n * @returns A SimpleTransaction that can be simulated or submitted to chain\n */\n async addDigitalAssetTypedPropertyTransaction(args: {\n creator: Account;\n propertyKey: string;\n propertyType: PropertyType;\n propertyValue: PropertyValue;\n digitalAssetAddress: AccountAddressInput;\n digitalAssetType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }) {\n return addDigitalAssetTypedPropertyTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Update a typed digital asset property\n *\n * @example\n * const transaction = await aptos.updateDigitalAssetTypedPropertyTransaction({\n * creator: alice,\n * propertyKey: \"typedKey\",\n * propertyType: \"U8\",\n * propertyValue: 2,\n * digitalAssetAddress: \"0x123\",\n * });\n *\n * @param args.account The account that mints the digital asset\n * @param args.digitalAssetAddress The digital asset address\n * @param args.propertyKey The property key for storing on-chain properties\n * @param args.propertyType The type of property value\n * @param args.propertyValue The property value to be stored on-chain\n *\n * @returns A SimpleTransaction that can be simulated or submitted to chain\n */\n async updateDigitalAssetTypedPropertyTransaction(args: {\n creator: Account;\n propertyKey: string;\n propertyType: PropertyType;\n propertyValue: PropertyValue;\n digitalAssetAddress: AccountAddressInput;\n digitalAssetType?: MoveStructId;\n options?: InputGenerateTransactionOptions;\n }) {\n return updateDigitalAssetTypedPropertyTransaction({ aptosConfig: this.config, ...args });\n }\n}\n"],"mappings":"qOAoDO,IAAMA,EAAN,KAAmB,CACxB,YAAqBC,EAAqB,CAArB,YAAAA,CAAsB,CAiB3C,MAAM,kBAAkBC,EAKe,CACrC,aAAMC,EAAwB,CAC5B,OAAQ,KAAK,OACb,qBAAsBD,EAAK,qBAC3B,kCACF,CAAC,EACME,EAAkB,CAAE,YAAa,KAAK,OAAQ,GAAGF,CAAK,CAAC,CAChE,CAYA,MAAM,gCAAgCA,EAGC,CACrC,aAAMC,EAAwB,CAC5B,OAAQ,KAAK,OACb,qBAAsBD,EAAK,qBAC3B,kCACF,CAAC,EACMG,EAAgC,CAAE,YAAa,KAAK,OAAQ,GAAGH,CAAK,CAAC,CAC9E,CAiBA,MAAM,gBAAgBA,EAKF,CAClB,aAAMC,EAAwB,CAC5B,OAAQ,KAAK,OACb,qBAAsBD,EAAK,qBAC3B,kCACF,CAAC,EACMI,EAAgB,CAAE,YAAa,KAAK,OAAQ,GAAGJ,CAAK,CAAC,CAC9D,CAYA,MAAM,oBAAoBA,EAGQ,CAChC,aAAMC,EAAwB,CAC5B,OAAQ,KAAK,OACb,qBAAsBD,EAAK,qBAC3B,kCACF,CAAC,EACMK,EAAoB,CAAE,YAAa,KAAK,OAAQ,GAAGL,CAAK,CAAC,CAClE,CAaA,MAAM,gCAAgCA,EAGQ,CAC5C,aAAMC,EAAwB,CAC5B,OAAQ,KAAK,OACb,qBAAsBD,EAAK,qBAC3B,kCACF,CAAC,EACMM,EAAgC,CAAE,YAAa,KAAK,OAAQ,GAAGN,CAAK,CAAC,CAC9E,CAaA,MAAM,sBAAsBA,EAIQ,CAClC,aAAMC,EAAwB,CAC5B,OAAQ,KAAK,OACb,qBAAsBD,EAAK,qBAC3B,kCACF,CAAC,EACMO,EAAsB,CAAE,YAAa,KAAK,OAAQ,GAAGP,CAAK,CAAC,CACpE,CAaA,MAAM,wBAAwBA,EAIQ,CACpC,aAAMC,EAAwB,CAC5B,OAAQ,KAAK,OACb,qBAAsBD,EAAK,qBAC3B,kCACF,CAAC,EACMQ,EAAwB,CAAE,YAAa,KAAK,OAAQ,GAAGR,CAAK,CAAC,CACtE,CAoCA,MAAM,4BACJA,EAO4B,CAC5B,OAAOS,EAA4B,CAAE,YAAa,KAAK,OAAQ,GAAGT,CAAK,CAAC,CAC1E,CAsBA,MAAM,4BAA4BA,EAUH,CAC7B,OAAOU,EAA4B,CAAE,YAAa,KAAK,OAAQ,GAAGV,CAAK,CAAC,CAC1E,CAsBA,MAAM,gCAAgCA,EAMP,CAC7B,OAAOW,EAAgC,CAAE,YAAa,KAAK,OAAQ,GAAGX,CAAK,CAAC,CAC9E,CA2BA,MAAM,yBAAyBA,EAWA,CAC7B,OAAOY,EAAyB,CAAE,YAAa,KAAK,OAAQ,GAAGZ,CAAK,CAAC,CACvE,CAgBA,MAAM,4BAA4BA,EAK/B,CACD,OAAOa,EAA4B,CAAE,YAAa,KAAK,OAAQ,GAAGb,CAAK,CAAC,CAC1E,CAgBA,MAAM,uCAAuCA,EAK1C,CACD,OAAOc,EAAsC,CAAE,YAAa,KAAK,OAAQ,GAAGd,CAAK,CAAC,CACpF,CAgBA,MAAM,yCAAyCA,EAK5C,CACD,OAAOe,EAAwC,CAAE,YAAa,KAAK,OAAQ,GAAGf,CAAK,CAAC,CACtF,CAkBA,MAAM,sCAAsCA,EAMzC,CACD,OAAOgB,EAAsC,CAAE,YAAa,KAAK,OAAQ,GAAGhB,CAAK,CAAC,CACpF,CAkBA,MAAM,+BAA+BA,EAMlC,CACD,OAAOiB,EAA+B,CAAE,YAAa,KAAK,OAAQ,GAAGjB,CAAK,CAAC,CAC7E,CAkBA,MAAM,8BAA8BA,EAMjC,CACD,OAAOkB,EAA8B,CAAE,YAAa,KAAK,OAAQ,GAAGlB,CAAK,CAAC,CAC5E,CAsBA,MAAM,mCAAmCA,EAQtC,CACD,OAAOmB,EAAmC,CAAE,YAAa,KAAK,OAAQ,GAAGnB,CAAK,CAAC,CACjF,CAsBA,MAAM,sCAAsCA,EAQzC,CACD,OAAOoB,EAAsC,CAAE,YAAa,KAAK,OAAQ,GAAGpB,CAAK,CAAC,CACpF,CAsBA,MAAM,sCAAsCA,EAQzC,CACD,OAAOqB,EAAsC,CAAE,YAAa,KAAK,OAAQ,GAAGrB,CAAK,CAAC,CACpF,CAsBA,MAAM,wCAAwCA,EAQ3C,CACD,OAAOsB,EAAwC,CAAE,YAAa,KAAK,OAAQ,GAAGtB,CAAK,CAAC,CACtF,CAsBA,MAAM,2CAA2CA,EAQ9C,CACD,OAAOuB,EAA2C,CAAE,YAAa,KAAK,OAAQ,GAAGvB,CAAK,CAAC,CACzF,CACF","names":["DigitalAsset","config","args","waitForIndexerOnVersion","getCollectionData","getCollectionDataByCollectionId","getCollectionId","getDigitalAssetData","getCurrentDigitalAssetOwnership","getOwnedDigitalAssets","getDigitalAssetActivity","createCollectionTransaction","mintDigitalAssetTransaction","transferDigitalAssetTransaction","mintSoulBoundTransaction","burnDigitalAssetTransaction","freezeDigitalAssetTransferTransaction","unfreezeDigitalAssetTransferTransaction","setDigitalAssetDescriptionTransaction","setDigitalAssetNameTransaction","setDigitalAssetURITransaction","addDigitalAssetPropertyTransaction","removeDigitalAssetPropertyTransaction","updateDigitalAssetPropertyTransaction","addDigitalAssetTypedPropertyTransaction","updateDigitalAssetTypedPropertyTransaction"]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function o(a,i,e){let r=e.value;return e.value=async function(...t){let[n]=t;if(n.transaction.feePayerAddress&&!n.feePayerAuthenticator)throw new Error("You are submitting a Fee Payer transaction but missing the feePayerAuthenticator");return r.apply(this,t)},e}function u(a,i,e){let r=e.value;return e.value=async function(...t){let[n]=t;if(n.transaction.feePayerAddress&&!n.feePayerPublicKey)throw new Error("You are simulating a Fee Payer transaction but missing the feePayerPublicKey");return r.apply(this,t)},e}export{o as a,u as b};
|
|
2
|
-
//# sourceMappingURL=chunk-6EMN3BOV.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as t}from"./chunk-56CNRT2K.mjs";var n=class{constructor(e){this.buffer=new ArrayBuffer(e.length),new Uint8Array(this.buffer).set(e,0),this.offset=0}read(e){if(this.offset+e>this.buffer.byteLength)throw new Error("Reached to the end of buffer");let i=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,i}deserializeStr(){let e=this.deserializeBytes();return new TextDecoder().decode(e)}deserializeBytes(){let e=this.deserializeUleb128AsU32();return new Uint8Array(this.read(e))}deserializeFixedBytes(e){return new Uint8Array(this.read(e))}deserializeBool(){let e=new Uint8Array(this.read(1))[0];if(e!==1&&e!==0)throw new Error("Invalid boolean value");return e===1}deserializeU8(){return new DataView(this.read(1)).getUint8(0)}deserializeU16(){return new DataView(this.read(2)).getUint16(0,!0)}deserializeU32(){return new DataView(this.read(4)).getUint32(0,!0)}deserializeU64(){let e=this.deserializeU32(),i=this.deserializeU32();return BigInt(BigInt(i)<<BigInt(32)|BigInt(e))}deserializeU128(){let e=this.deserializeU64(),i=this.deserializeU64();return BigInt(i<<BigInt(64)|e)}deserializeU256(){let e=this.deserializeU128(),i=this.deserializeU128();return BigInt(i<<BigInt(128)|e)}deserializeUleb128AsU32(){let e=BigInt(0),i=0;for(;e<t;){let r=this.deserializeU8();if(e|=BigInt(r&127)<<BigInt(i),!(r&128))break;i+=7}if(e>t)throw new Error("Overflow while parsing uleb128-encoded uint32 value");return Number(e)}deserialize(e){return e.deserialize(this)}deserializeVector(e){let i=this.deserializeUleb128AsU32(),r=new Array;for(let s=0;s<i;s+=1)r.push(this.deserialize(e));return r}};export{n as a};
|
|
2
|
-
//# sourceMappingURL=chunk-6IFMQ5AS.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/bcs/deserializer.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/* eslint-disable no-bitwise */\nimport { MAX_U32_NUMBER } from \"./consts\";\nimport { Uint8, Uint16, Uint32, Uint64, Uint128, Uint256 } from \"../types\";\n\n/**\n * This interface exists to define Deserializable<T> inputs for functions that\n * deserialize a byte buffer into a type T.\n * It is not intended to be implemented or extended, because Typescript has no support\n * for static methods in interfaces.\n */\nexport interface Deserializable<T> {\n deserialize(deserializer: Deserializer): T;\n}\n\nexport class Deserializer {\n private buffer: ArrayBuffer;\n\n private offset: number;\n\n constructor(data: Uint8Array) {\n // copies data to prevent outside mutation of buffer.\n this.buffer = new ArrayBuffer(data.length);\n new Uint8Array(this.buffer).set(data, 0);\n this.offset = 0;\n }\n\n private read(length: number): ArrayBuffer {\n if (this.offset + length > this.buffer.byteLength) {\n throw new Error(\"Reached to the end of buffer\");\n }\n\n const bytes = this.buffer.slice(this.offset, this.offset + length);\n this.offset += length;\n return bytes;\n }\n\n /**\n * Deserializes a string. UTF8 string is supported. Reads the string's bytes length \"l\" first,\n * and then reads \"l\" bytes of content. Decodes the byte array into a string.\n *\n * BCS layout for \"string\": string_length | string_content\n * where string_length is a u32 integer encoded as a uleb128 integer, equal to the number of bytes in string_content.\n *\n * @example\n * ```ts\n * const deserializer = new Deserializer(new Uint8Array([8, 49, 50, 51, 52, 97, 98, 99, 100]));\n * assert(deserializer.deserializeStr() === \"1234abcd\");\n * ```\n */\n deserializeStr(): string {\n const value = this.deserializeBytes();\n const textDecoder = new TextDecoder();\n return textDecoder.decode(value);\n }\n\n /**\n * Deserializes an array of bytes.\n *\n * BCS layout for \"bytes\": bytes_length | bytes\n * where bytes_length is a u32 integer encoded as a uleb128 integer, equal to the length of the bytes array.\n */\n deserializeBytes(): Uint8Array {\n const len = this.deserializeUleb128AsU32();\n return new Uint8Array(this.read(len));\n }\n\n /**\n * Deserializes an array of bytes. The number of bytes to read is already known.\n *\n */\n deserializeFixedBytes(len: number): Uint8Array {\n return new Uint8Array(this.read(len));\n }\n\n /**\n * Deserializes a boolean value.\n *\n * BCS layout for \"boolean\": One byte. \"0x01\" for true and \"0x00\" for false.\n */\n deserializeBool(): boolean {\n const bool = new Uint8Array(this.read(1))[0];\n if (bool !== 1 && bool !== 0) {\n throw new Error(\"Invalid boolean value\");\n }\n return bool === 1;\n }\n\n /**\n * Deserializes a uint8 number.\n *\n * BCS layout for \"uint8\": One byte. Binary format in little-endian representation.\n */\n deserializeU8(): Uint8 {\n return new DataView(this.read(1)).getUint8(0);\n }\n\n /**\n * Deserializes a uint16 number.\n *\n * BCS layout for \"uint16\": Two bytes. Binary format in little-endian representation.\n * @example\n * ```ts\n * const deserializer = new Deserializer(new Uint8Array([0x34, 0x12]));\n * assert(deserializer.deserializeU16() === 4660);\n * ```\n */\n deserializeU16(): Uint16 {\n return new DataView(this.read(2)).getUint16(0, true);\n }\n\n /**\n * Deserializes a uint32 number.\n *\n * BCS layout for \"uint32\": Four bytes. Binary format in little-endian representation.\n * @example\n * ```ts\n * const deserializer = new Deserializer(new Uint8Array([0x78, 0x56, 0x34, 0x12]));\n * assert(deserializer.deserializeU32() === 305419896);\n * ```\n */\n deserializeU32(): Uint32 {\n return new DataView(this.read(4)).getUint32(0, true);\n }\n\n /**\n * Deserializes a uint64 number.\n *\n * BCS layout for \"uint64\": Eight bytes. Binary format in little-endian representation.\n * @example\n * ```ts\n * const deserializer = new Deserializer(new Uint8Array([0x00, 0xEF, 0xCD, 0xAB, 0x78, 0x56, 0x34, 0x12]));\n * assert(deserializer.deserializeU64() === 1311768467750121216);\n * ```\n */\n deserializeU64(): Uint64 {\n const low = this.deserializeU32();\n const high = this.deserializeU32();\n\n // combine the two 32-bit values and return (little endian)\n return BigInt((BigInt(high) << BigInt(32)) | BigInt(low));\n }\n\n /**\n * Deserializes a uint128 number.\n *\n * BCS layout for \"uint128\": Sixteen bytes. Binary format in little-endian representation.\n */\n deserializeU128(): Uint128 {\n const low = this.deserializeU64();\n const high = this.deserializeU64();\n\n // combine the two 64-bit values and return (little endian)\n return BigInt((high << BigInt(64)) | low);\n }\n\n /**\n * Deserializes a uint256 number.\n *\n * BCS layout for \"uint256\": Thirty-two bytes. Binary format in little-endian representation.\n */\n deserializeU256(): Uint256 {\n const low = this.deserializeU128();\n const high = this.deserializeU128();\n\n // combine the two 128-bit values and return (little endian)\n return BigInt((high << BigInt(128)) | low);\n }\n\n /**\n * Deserializes a uleb128 encoded uint32 number.\n *\n * BCS use uleb128 encoding in two cases: (1) lengths of variable-length sequences and (2) tags of enum values\n */\n deserializeUleb128AsU32(): Uint32 {\n let value: bigint = BigInt(0);\n let shift = 0;\n\n while (value < MAX_U32_NUMBER) {\n const byte = this.deserializeU8();\n value |= BigInt(byte & 0x7f) << BigInt(shift);\n\n if ((byte & 0x80) === 0) {\n break;\n }\n shift += 7;\n }\n\n if (value > MAX_U32_NUMBER) {\n throw new Error(\"Overflow while parsing uleb128-encoded uint32 value\");\n }\n\n return Number(value);\n }\n\n /**\n * Helper function that primarily exists to support alternative syntax for deserialization.\n * That is, if we have a `const deserializer: new Deserializer(...)`, instead of having to use\n * `MyClass.deserialize(deserializer)`, we can call `deserializer.deserialize(MyClass)`.\n *\n * @example const deserializer = new Deserializer(new Uint8Array([1, 2, 3]));\n * const value = deserializer.deserialize(MyClass); // where MyClass has a `deserialize` function\n * // value is now an instance of MyClass\n * // equivalent to `const value = MyClass.deserialize(deserializer)`\n * @param cls The BCS-deserializable class to deserialize the buffered bytes into.\n *\n * @returns the deserialized value of class type T\n */\n deserialize<T>(cls: Deserializable<T>): T {\n // NOTE: `deserialize` in `cls.deserialize(this)` here is a static method defined in `cls`,\n // It is separate from the `deserialize` instance method defined here in Deserializer.\n return cls.deserialize(this);\n }\n\n /**\n * Deserializes an array of BCS Deserializable values given an existing Deserializer\n * instance with a loaded byte buffer.\n *\n * @param cls The BCS-deserializable class to deserialize the buffered bytes into.\n * @example\n * // serialize a vector of addresses\n * const addresses = new Array<AccountAddress>(\n * AccountAddress.from(\"0x1\"),\n * AccountAddress.from(\"0x2\"),\n * AccountAddress.from(\"0xa\"),\n * AccountAddress.from(\"0xb\"),\n * );\n * const serializer = new Serializer();\n * serializer.serializeVector(addresses);\n * const serializedBytes = serializer.toUint8Array();\n *\n * // deserialize the bytes into an array of addresses\n * const deserializer = new Deserializer(serializedBytes);\n * const deserializedAddresses = deserializer.deserializeVector(AccountAddress);\n * // deserializedAddresses is now an array of AccountAddress instances\n * @returns an array of deserialized values of type T\n */\n deserializeVector<T>(cls: Deserializable<T>): Array<T> {\n const length = this.deserializeUleb128AsU32();\n const vector = new Array<T>();\n for (let i = 0; i < length; i += 1) {\n vector.push(this.deserialize(cls));\n }\n return vector;\n }\n}\n"],"mappings":"yCAiBO,IAAMA,EAAN,KAAmB,CAKxB,YAAYC,EAAkB,CAE5B,KAAK,OAAS,IAAI,YAAYA,EAAK,MAAM,EACzC,IAAI,WAAW,KAAK,MAAM,EAAE,IAAIA,EAAM,CAAC,EACvC,KAAK,OAAS,CAChB,CAEQ,KAAKC,EAA6B,CACxC,GAAI,KAAK,OAASA,EAAS,KAAK,OAAO,WACrC,MAAM,IAAI,MAAM,8BAA8B,EAGhD,IAAMC,EAAQ,KAAK,OAAO,MAAM,KAAK,OAAQ,KAAK,OAASD,CAAM,EACjE,YAAK,QAAUA,EACRC,CACT,CAeA,gBAAyB,CACvB,IAAMC,EAAQ,KAAK,iBAAiB,EAEpC,OADoB,IAAI,YAAY,EACjB,OAAOA,CAAK,CACjC,CAQA,kBAA+B,CAC7B,IAAMC,EAAM,KAAK,wBAAwB,EACzC,OAAO,IAAI,WAAW,KAAK,KAAKA,CAAG,CAAC,CACtC,CAMA,sBAAsBA,EAAyB,CAC7C,OAAO,IAAI,WAAW,KAAK,KAAKA,CAAG,CAAC,CACtC,CAOA,iBAA2B,CACzB,IAAMC,EAAO,IAAI,WAAW,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC,EAC3C,GAAIA,IAAS,GAAKA,IAAS,EACzB,MAAM,IAAI,MAAM,uBAAuB,EAEzC,OAAOA,IAAS,CAClB,CAOA,eAAuB,CACrB,OAAO,IAAI,SAAS,KAAK,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAC9C,CAYA,gBAAyB,CACvB,OAAO,IAAI,SAAS,KAAK,KAAK,CAAC,CAAC,EAAE,UAAU,EAAG,EAAI,CACrD,CAYA,gBAAyB,CACvB,OAAO,IAAI,SAAS,KAAK,KAAK,CAAC,CAAC,EAAE,UAAU,EAAG,EAAI,CACrD,CAYA,gBAAyB,CACvB,IAAMC,EAAM,KAAK,eAAe,EAC1BC,EAAO,KAAK,eAAe,EAGjC,OAAO,OAAQ,OAAOA,CAAI,GAAK,OAAO,EAAE,EAAK,OAAOD,CAAG,CAAC,CAC1D,CAOA,iBAA2B,CACzB,IAAMA,EAAM,KAAK,eAAe,EAC1BC,EAAO,KAAK,eAAe,EAGjC,OAAO,OAAQA,GAAQ,OAAO,EAAE,EAAKD,CAAG,CAC1C,CAOA,iBAA2B,CACzB,IAAMA,EAAM,KAAK,gBAAgB,EAC3BC,EAAO,KAAK,gBAAgB,EAGlC,OAAO,OAAQA,GAAQ,OAAO,GAAG,EAAKD,CAAG,CAC3C,CAOA,yBAAkC,CAChC,IAAIH,EAAgB,OAAO,CAAC,EACxBK,EAAQ,EAEZ,KAAOL,EAAQM,GAAgB,CAC7B,IAAMC,EAAO,KAAK,cAAc,EAGhC,GAFAP,GAAS,OAAOO,EAAO,GAAI,GAAK,OAAOF,CAAK,EAEvC,EAAAE,EAAO,KACV,MAEFF,GAAS,CACX,CAEA,GAAIL,EAAQM,EACV,MAAM,IAAI,MAAM,qDAAqD,EAGvE,OAAO,OAAON,CAAK,CACrB,CAeA,YAAeQ,EAA2B,CAGxC,OAAOA,EAAI,YAAY,IAAI,CAC7B,CAyBA,kBAAqBA,EAAkC,CACrD,IAAMV,EAAS,KAAK,wBAAwB,EACtCW,EAAS,IAAI,MACnB,QAASC,EAAI,EAAGA,EAAIZ,EAAQY,GAAK,EAC/BD,EAAO,KAAK,KAAK,YAAYD,CAAG,CAAC,EAEnC,OAAOC,CACT,CACF","names":["Deserializer","data","length","bytes","value","len","bool","low","high","shift","MAX_U32_NUMBER","byte","cls","vector","i"]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as d}from"./chunk-6FBKUTGF.mjs";import{a as R}from"./chunk-B7TQGVGL.mjs";var l={400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",429:"Too Many Requests",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable"};async function c(s,p){let{url:n,method:a,body:i,contentType:u,params:t,overrides:e,originMethod:o}=s,r={...e?.HEADERS,"x-aptos-client":`aptos-typescript-sdk/${R}`,"content-type":u??"application/json","x-aptos-typescript-sdk-origin-method":o};return e?.AUTH_TOKEN&&(r.Authorization=`Bearer ${e?.AUTH_TOKEN}`),e?.API_KEY&&(r.Authorization=`Bearer ${e?.API_KEY}`),p.provider({url:n,method:a,body:i,params:t,headers:r,overrides:e})}async function w(s,p,n){let{url:a,path:i}=s,u=i?`${a}/${i}`:a,t=await c({...s,url:u},p.client),e={status:t.status,statusText:t.statusText,data:t.data,headers:t.headers,config:t.config,request:t.request,url:u};if(e.status===401)throw new d(s,e,`Error: ${e.data}`);if(n==="Indexer"){let r=e.data;if(r.errors)throw new d(s,e,`Indexer error: ${r.errors[0].message}`??`Indexer unhandled Error ${t.status} : ${t.statusText}`);e.data=r.data}if(e.status>=200&&e.status<300)return e;let o;throw e&&e.data&&"message"in e.data&&"error_code"in e.data?o=JSON.stringify(e.data):e.status in l?o=l[e.status]:o=`Unhandled Error ${e.status} : ${e.statusText}`,new d(s,e,`${n} error: ${o}`)}export{c as a,w as b};
|
|
2
|
-
//# sourceMappingURL=chunk-734YX27W.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as R}from"./chunk-AH44UPM4.mjs";import{h as x,i as P}from"./chunk-W4ZW7QHA.mjs";import{a as h}from"./chunk-3JPVQHOR.mjs";import{b as c,c as A}from"./chunk-TLOPIURC.mjs";import{a as w}from"./chunk-6FBKUTGF.mjs";import{d as C}from"./chunk-CYNQRMO5.mjs";async function v(s){let{aptosConfig:n,options:t}=s;return A({aptosConfig:n,originMethod:"getTransactions",path:"transactions",params:{start:t?.offset,limit:t?.limit}})}async function D(s){let{aptosConfig:n}=s;return R(async()=>{let{data:t}=await c({aptosConfig:n,originMethod:"getGasPriceEstimation",path:"estimate_gas_price"});return t},`gas-price-${n.network}`,1e3*60*5)()}async function N(s){let{aptosConfig:n,ledgerVersion:t}=s,{data:o}=await c({aptosConfig:n,originMethod:"getTransactionByVersion",path:`transactions/by_version/${t}`});return o}async function T(s){let{aptosConfig:n,transactionHash:t}=s,{data:o}=await c({aptosConfig:n,path:`transactions/by_hash/${t}`,originMethod:"getTransactionByHash"});return o}async function G(s){let{aptosConfig:n,transactionHash:t}=s;try{return(await T({aptosConfig:n,transactionHash:t})).type==="pending_transaction"}catch(o){if(o?.status===404)return!0;throw o}}async function b(s){let{aptosConfig:n,transactionHash:t}=s,{data:o}=await c({aptosConfig:n,path:`transactions/wait_by_hash/${t}`,originMethod:"longWaitForTransaction"});return o}async function W(s){let{aptosConfig:n,transactionHash:t,options:o}=s,r=o?.timeoutSecs??20,u=o?.checkSuccess??!0,a=!0,p=0,e,g,m=200,E=1.5;function d(i){if(!(i instanceof w)||(g=i,i.status!==404&&i.status>=400&&i.status<500))throw i}try{e=await T({aptosConfig:n,transactionHash:t}),a=e.type==="pending_transaction"}catch(i){d(i)}if(a){let i=Date.now();try{e=await b({aptosConfig:n,transactionHash:t}),a=e.type==="pending_transaction"}catch(l){d(l)}p=(Date.now()-i)/1e3}for(;a&&!(p>=r);){try{if(e=await T({aptosConfig:n,transactionHash:t}),a=e.type==="pending_transaction",!a)break}catch(i){d(i)}await h(m),p+=m/1e3,m*=E}if(e===void 0)throw g||new f(`Fetching transaction ${t} failed and timed out after ${r} seconds`,e);if(e.type==="pending_transaction")throw new f(`Transaction ${t} timed out in pending state after ${r} seconds`,e);if(!u)return e;if(!e.success)throw new y(`Transaction ${t} failed with an error: ${e.vm_status}`,e);return e}async function O(s){let{aptosConfig:n,processorType:t}=s,o=BigInt(s.minimumLedgerVersion),r=3e3,u=new Date().getTime(),a=BigInt(-1);for(;a<o;){if(new Date().getTime()-u>r)throw new Error("waitForLastSuccessIndexerVersionSync timeout");if(t===void 0?a=await x({aptosConfig:n}):a=(await P({aptosConfig:n,processorType:t})).last_success_version,a>=o)break;await h(200)}}var f=class extends Error{constructor(t,o){super(t);this.lastSubmittedTransaction=o}},y=class extends Error{constructor(t,o){super(t);this.transaction=o}};export{v as a,D as b,N as c,T as d,G as e,b as f,W as g,O as h,f as i,y as j};
|
|
2
|
-
//# sourceMappingURL=chunk-7QJ6YJXP.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as c}from"./chunk-SG4MAOCF.mjs";import{a as g}from"./chunk-5P2S2SZZ.mjs";import{a as f}from"./chunk-Z5YFM2AW.mjs";import{a as l}from"./chunk-V6OS74OS.mjs";import{a as u}from"./chunk-O2F53NKI.mjs";import{a as h}from"./chunk-24IKVZBK.mjs";import{a as s}from"./chunk-B3R6G6QP.mjs";import{a as p}from"./chunk-ODRO4CSA.mjs";import{a as y}from"./chunk-OVJQWQ2N.mjs";import{a as r}from"./chunk-DPV25ZKR.mjs";import{a}from"./chunk-6CFRW26C.mjs";var t=class{constructor(i){this.config=new y(i),this.account=new s(this.config),this.ans=new p(this.config),this.coin=new r(this.config),this.digitalAsset=new a(this.config),this.event=new c(this.config),this.faucet=new g(this.config),this.fungibleAsset=new f(this.config),this.general=new l(this.config),this.staking=new u(this.config),this.transaction=new h(this.config)}};function n(m,i,A){Object.getOwnPropertyNames(i.prototype).forEach(e=>{let o=Object.getOwnPropertyDescriptor(i.prototype,e);o&&(o.value=function(...d){return this[A][e](...d)},Object.defineProperty(m.prototype,e,o))})}n(t,s,"account");n(t,p,"ans");n(t,r,"coin");n(t,a,"digitalAsset");n(t,c,"event");n(t,g,"faucet");n(t,f,"fungibleAsset");n(t,l,"general");n(t,u,"staking");n(t,h,"transaction");export{t as a};
|
|
2
|
-
//# sourceMappingURL=chunk-AD3VLZ7I.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/api/aptos.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Account } from \"./account\";\nimport { AptosConfig } from \"./aptosConfig\";\nimport { Coin } from \"./coin\";\nimport { DigitalAsset } from \"./digitalAsset\";\nimport { Event } from \"./event\";\nimport { Faucet } from \"./faucet\";\nimport { FungibleAsset } from \"./fungibleAsset\";\nimport { General } from \"./general\";\nimport { ANS } from \"./ans\";\nimport { Staking } from \"./staking\";\nimport { Transaction } from \"./transaction\";\n\n/**\n * This class is the main entry point into Aptos's\n * APIs and separates functionality into different namespaces.\n *\n * To use the SDK, create a new Aptos instance to get access\n * to all the sdk functionality.\n *\n * @example\n *\n * const aptos = new Aptos();\n */\nexport class Aptos {\n readonly config: AptosConfig;\n\n readonly account: Account;\n\n readonly ans: ANS;\n\n readonly coin: Coin;\n\n readonly digitalAsset: DigitalAsset;\n\n readonly event: Event;\n\n readonly faucet: Faucet;\n\n readonly fungibleAsset: FungibleAsset;\n\n readonly general: General;\n\n readonly staking: Staking;\n\n readonly transaction: Transaction;\n\n constructor(settings?: AptosConfig) {\n this.config = new AptosConfig(settings);\n this.account = new Account(this.config);\n this.ans = new ANS(this.config);\n this.coin = new Coin(this.config);\n this.digitalAsset = new DigitalAsset(this.config);\n this.event = new Event(this.config);\n this.faucet = new Faucet(this.config);\n this.fungibleAsset = new FungibleAsset(this.config);\n this.general = new General(this.config);\n this.staking = new Staking(this.config);\n this.transaction = new Transaction(this.config);\n }\n}\n\n// extends Aptos interface so all the methods and properties\n// from the other classes will be recognized by typescript.\nexport interface Aptos\n extends Account,\n ANS,\n Coin,\n DigitalAsset,\n Event,\n Faucet,\n FungibleAsset,\n General,\n Staking,\n Omit<Transaction, \"build\" | \"simulate\" | \"submit\" | \"batch\"> {}\n\n/**\nIn TypeScript, we can’t inherit or extend from more than one class,\nMixins helps us to get around that by creating a partial classes\nthat we can combine to form a single class that contains all the methods and properties from the partial classes.\n{@link https://www.typescriptlang.org/docs/handbook/mixins.html#alternative-pattern}\n\nHere, we combine any subclass and the Aptos class.\n*/\nfunction applyMixin(targetClass: any, baseClass: any, baseClassProp: string) {\n // Mixin instance methods\n Object.getOwnPropertyNames(baseClass.prototype).forEach((propertyName) => {\n const propertyDescriptor = Object.getOwnPropertyDescriptor(baseClass.prototype, propertyName);\n if (!propertyDescriptor) return;\n // eslint-disable-next-line func-names\n propertyDescriptor.value = function (...args: any) {\n return (this as any)[baseClassProp][propertyName](...args);\n };\n Object.defineProperty(targetClass.prototype, propertyName, propertyDescriptor);\n });\n}\n\napplyMixin(Aptos, Account, \"account\");\napplyMixin(Aptos, ANS, \"ans\");\napplyMixin(Aptos, Coin, \"coin\");\napplyMixin(Aptos, DigitalAsset, \"digitalAsset\");\napplyMixin(Aptos, Event, \"event\");\napplyMixin(Aptos, Faucet, \"faucet\");\napplyMixin(Aptos, FungibleAsset, \"fungibleAsset\");\napplyMixin(Aptos, General, \"general\");\napplyMixin(Aptos, Staking, \"staking\");\napplyMixin(Aptos, Transaction, \"transaction\");\n"],"mappings":"8bA0BO,IAAMA,EAAN,KAAY,CAuBjB,YAAYC,EAAwB,CAClC,KAAK,OAAS,IAAIC,EAAYD,CAAQ,EACtC,KAAK,QAAU,IAAIE,EAAQ,KAAK,MAAM,EACtC,KAAK,IAAM,IAAIC,EAAI,KAAK,MAAM,EAC9B,KAAK,KAAO,IAAIC,EAAK,KAAK,MAAM,EAChC,KAAK,aAAe,IAAIC,EAAa,KAAK,MAAM,EAChD,KAAK,MAAQ,IAAIC,EAAM,KAAK,MAAM,EAClC,KAAK,OAAS,IAAIC,EAAO,KAAK,MAAM,EACpC,KAAK,cAAgB,IAAIC,EAAc,KAAK,MAAM,EAClD,KAAK,QAAU,IAAIC,EAAQ,KAAK,MAAM,EACtC,KAAK,QAAU,IAAIC,EAAQ,KAAK,MAAM,EACtC,KAAK,YAAc,IAAIC,EAAY,KAAK,MAAM,CAChD,CACF,EAwBA,SAASC,EAAWC,EAAkBC,EAAgBC,EAAuB,CAE3E,OAAO,oBAAoBD,EAAU,SAAS,EAAE,QAASE,GAAiB,CACxE,IAAMC,EAAqB,OAAO,yBAAyBH,EAAU,UAAWE,CAAY,EACvFC,IAELA,EAAmB,MAAQ,YAAaC,EAAW,CACjD,OAAQ,KAAaH,CAAa,EAAEC,CAAY,EAAE,GAAGE,CAAI,CAC3D,EACA,OAAO,eAAeL,EAAY,UAAWG,EAAcC,CAAkB,EAC/E,CAAC,CACH,CAEAL,EAAWb,EAAOG,EAAS,SAAS,EACpCU,EAAWb,EAAOI,EAAK,KAAK,EAC5BS,EAAWb,EAAOK,EAAM,MAAM,EAC9BQ,EAAWb,EAAOM,EAAc,cAAc,EAC9CO,EAAWb,EAAOO,EAAO,OAAO,EAChCM,EAAWb,EAAOQ,EAAQ,QAAQ,EAClCK,EAAWb,EAAOS,EAAe,eAAe,EAChDI,EAAWb,EAAOU,EAAS,SAAS,EACpCG,EAAWb,EAAOW,EAAS,SAAS,EACpCE,EAAWb,EAAOY,EAAa,aAAa","names":["Aptos","settings","AptosConfig","Account","ANS","Coin","DigitalAsset","Event","Faucet","FungibleAsset","General","Staking","Transaction","applyMixin","targetClass","baseClass","baseClassProp","propertyName","propertyDescriptor","args"]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var n=new Map;function m(r,e,t){return async(...s)=>{if(n.has(e)){let{value:i,timestamp:u}=n.get(e);if(t===void 0||Date.now()-u<=t)return i}let a=await r(...s);return n.set(e,{value:a,timestamp:Date.now()}),a}}function o(r,e,t){return(...s)=>{if(n.has(e)){let{value:i,timestamp:u}=n.get(e);if(t===void 0||Date.now()-u<=t)return i}let a=r(...s);return n.set(e,{value:a,timestamp:Date.now()}),a}}export{m as a,o as b};
|
|
2
|
-
//# sourceMappingURL=chunk-AH44UPM4.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a}from"./chunk-FBPNHF54.mjs";import{bytesToHex as s,hexToBytes as o}from"@noble/hashes/utils";var l=(e=>(e.TOO_SHORT="too_short",e.INVALID_LENGTH="invalid_length",e.INVALID_HEX_CHARS="invalid_hex_chars",e))(l||{}),i=class n{constructor(t){this.data=t}toUint8Array(){return this.data}toStringWithoutPrefix(){return s(this.data)}toString(){return`0x${this.toStringWithoutPrefix()}`}static fromHexString(t){let r=t;if(r.startsWith("0x")&&(r=r.slice(2)),r.length===0)throw new a("Hex string is too short, must be at least 1 char long, excluding the optional leading 0x.","too_short");if(r.length%2!==0)throw new a("Hex string must be an even number of hex characters.","invalid_length");try{return new n(o(r))}catch(e){throw new a(`Hex string contains invalid hex characters: ${e?.message}`,"invalid_hex_chars")}}static fromHexInput(t){return t instanceof Uint8Array?new n(t):n.fromHexString(t)}static isValid(t){try{return n.fromHexString(t),{valid:!0}}catch(r){return{valid:!1,invalidReason:r?.invalidReason,invalidReasonMessage:r?.message}}}equals(t){return this.data.length!==t.data.length?!1:this.data.every((r,e)=>r===t.data[e])}};export{l as a,i as b};
|
|
2
|
-
//# sourceMappingURL=chunk-AOCNYMMX.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as n}from"./chunk-PZGLV5UQ.mjs";import{b as a}from"./chunk-IOSQVDZI.mjs";import{a as i}from"./chunk-52C73T26.mjs";var o=class t extends i{constructor(e,r){super();this.rawTransaction=e,this.feePayerAddress=r}serialize(e){this.rawTransaction.serialize(e),this.feePayerAddress===void 0?e.serializeBool(!1):(e.serializeBool(!0),this.feePayerAddress.serialize(e))}static deserialize(e){let r=n.deserialize(e),d=e.deserializeBool(),s;return d&&(s=a.deserialize(e)),new t(r,s)}};export{o as a};
|
|
2
|
-
//# sourceMappingURL=chunk-AU6W5OIH.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as n}from"./chunk-MACC2BLE.mjs";import{a as s,b as t,c as r,d as i,e as c,f as u,g as d,h as A,i as g,j as m,k as a,l as p,m as f,n as y,o as C,p as O,q as T}from"./chunk-IIPYR7PF.mjs";import{e as o}from"./chunk-CYNQRMO5.mjs";var l=class{constructor(e){this.config=e}async getAccountInfo(e){return s({aptosConfig:this.config,...e})}async getAccountModules(e){return t({aptosConfig:this.config,...e})}async getAccountModule(e){return r({aptosConfig:this.config,...e})}async getAccountTransactions(e){return i({aptosConfig:this.config,...e})}async getAccountResources(e){return c({aptosConfig:this.config,...e})}async getAccountResource(e){return u({aptosConfig:this.config,...e})}async lookupOriginalAccountAddress(e){return d({aptosConfig:this.config,...e})}async getAccountTokensCount(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"account_transactions_processor"}),A({aptosConfig:this.config,...e})}async getAccountOwnedTokens(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),g({aptosConfig:this.config,...e})}async getAccountOwnedTokensFromCollectionAddress(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),m({aptosConfig:this.config,...e})}async getAccountCollectionsWithOwnedTokens(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),a({aptosConfig:this.config,...e})}async getAccountTransactionsCount(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"account_transactions_processor"}),p({aptosConfig:this.config,...e})}async getAccountCoinsData(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"fungible_asset_processor"}),y({aptosConfig:this.config,...e})}async getAccountCoinsCount(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"fungible_asset_processor"}),C({aptosConfig:this.config,...e})}async getAccountAPTAmount(e){return this.getAccountCoinAmount({coinType:o,...e})}async getAccountCoinAmount(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"fungible_asset_processor"}),f({aptosConfig:this.config,...e})}async getAccountOwnedObjects(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"default_processor"}),O({aptosConfig:this.config,...e})}async deriveAccountFromPrivateKey(e){return T({aptosConfig:this.config,...e})}};export{l as a};
|
|
2
|
-
//# sourceMappingURL=chunk-B3R6G6QP.mjs.map
|