@aptos-labs/ts-sdk 1.13.3 → 1.14.0-zeta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/accountAddress-u9wEan9p.d.ts +2149 -0
- package/dist/common/chunk-QRI7EC4T.js +24 -0
- package/dist/common/chunk-QRI7EC4T.js.map +1 -0
- package/dist/common/cli/index.d.ts +94 -1
- package/dist/common/cli/index.js +245 -1
- package/dist/common/cli/index.js.map +1 -1
- package/dist/common/index.d.ts +2699 -4119
- package/dist/common/index.js +11786 -374
- package/dist/common/index.js.map +1 -1
- package/dist/esm/{Ed25519Account--qjfup2u.d.mts → Ed25519Account-9zBaZEnp.d.mts} +76 -9
- package/dist/esm/account/Account.d.mts +34 -0
- package/dist/esm/account/Account.mjs +56 -0
- package/dist/esm/account/Ed25519Account.d.mts +34 -0
- package/dist/esm/account/Ed25519Account.mjs +54 -0
- package/dist/esm/account/EphemeralKeyPair.d.mts +80 -0
- package/dist/esm/account/EphemeralKeyPair.mjs +37 -0
- package/dist/esm/account/KeylessAccount.d.mts +145 -0
- package/dist/esm/account/KeylessAccount.mjs +57 -0
- package/dist/esm/account/MultiKeyAccount.d.mts +138 -0
- package/dist/esm/account/MultiKeyAccount.mjs +56 -0
- package/dist/esm/account/SingleKeyAccount.d.mts +34 -0
- package/dist/esm/account/SingleKeyAccount.mjs +54 -0
- package/dist/esm/account/index.d.mts +41 -0
- package/dist/esm/account/index.mjs +77 -0
- package/dist/esm/api/account.d.mts +13 -1
- package/dist/esm/api/account.mjs +76 -1
- package/dist/esm/api/ans.d.mts +2 -2
- package/dist/esm/api/ans.mjs +87 -1
- package/dist/esm/api/aptos.d.mts +15 -8
- package/dist/esm/api/aptos.mjs +116 -1
- package/dist/esm/api/aptosConfig.d.mts +20 -0
- package/dist/esm/api/aptosConfig.mjs +9 -1
- package/dist/esm/api/coin.d.mts +7 -7
- package/dist/esm/api/coin.mjs +86 -1
- package/dist/esm/api/digitalAsset.d.mts +1 -1
- package/dist/esm/api/digitalAsset.mjs +87 -1
- package/dist/esm/api/event.mjs +54 -1
- package/dist/esm/api/faucet.mjs +53 -1
- package/dist/esm/api/fungibleAsset.d.mts +5 -5
- package/dist/esm/api/fungibleAsset.mjs +87 -1
- package/dist/esm/api/general.d.mts +7 -7
- package/dist/esm/api/general.mjs +84 -1
- package/dist/esm/api/index.d.mts +14 -8
- package/dist/esm/api/index.mjs +120 -1
- package/dist/esm/api/keyless.d.mts +81 -0
- package/dist/esm/api/keyless.mjs +71 -0
- package/dist/esm/api/staking.mjs +54 -1
- package/dist/esm/api/transaction.d.mts +1 -1
- package/dist/esm/api/transaction.mjs +94 -1
- package/dist/esm/api/transactionSubmission/build.d.mts +2 -2
- package/dist/esm/api/transactionSubmission/build.mjs +85 -1
- package/dist/esm/api/transactionSubmission/helpers.mjs +9 -1
- package/dist/esm/api/transactionSubmission/management.d.mts +8 -8
- package/dist/esm/api/transactionSubmission/management.mjs +89 -1
- package/dist/esm/api/transactionSubmission/sign.d.mts +1 -1
- package/dist/esm/api/transactionSubmission/sign.mjs +109 -1
- package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -1
- package/dist/esm/api/transactionSubmission/simulate.d.mts +6 -6
- package/dist/esm/api/transactionSubmission/simulate.mjs +86 -1
- package/dist/esm/api/transactionSubmission/submit.mjs +86 -1
- package/dist/esm/api/utils.mjs +34 -1
- package/dist/esm/bcs/consts.mjs +17 -1
- package/dist/esm/bcs/deserializer.d.mts +26 -0
- package/dist/esm/bcs/deserializer.mjs +8 -1
- package/dist/esm/bcs/index.mjs +57 -1
- package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +12 -1
- package/dist/esm/bcs/serializable/fixedBytes.mjs +11 -1
- package/dist/esm/bcs/serializable/movePrimitives.mjs +25 -1
- package/dist/esm/bcs/serializable/moveStructs.mjs +18 -1
- package/dist/esm/bcs/serializer.d.mts +2 -0
- package/dist/esm/bcs/serializer.mjs +18 -1
- package/dist/esm/chunk-2JOCR2VL.mjs +32 -0
- package/dist/esm/chunk-2JOCR2VL.mjs.map +1 -0
- package/dist/esm/chunk-2OQW7BMN.mjs +129 -0
- package/dist/esm/{chunk-PZGLV5UQ.mjs.map → chunk-2OQW7BMN.mjs.map} +1 -1
- package/dist/esm/chunk-2TJJWII2.mjs +23 -0
- package/dist/esm/{chunk-DSTKXJMA.mjs.map → chunk-2TJJWII2.mjs.map} +1 -1
- package/dist/esm/chunk-2ZEGJU43.mjs +252 -0
- package/dist/esm/chunk-2ZEGJU43.mjs.map +1 -0
- package/dist/esm/chunk-4OYYOYSO.mjs +336 -0
- package/dist/esm/chunk-4OYYOYSO.mjs.map +1 -0
- package/dist/esm/{chunk-S4SEFF4K.mjs → chunk-4PJ5FYGQ.mjs} +302 -27
- package/dist/esm/{chunk-S4SEFF4K.mjs.map → chunk-4PJ5FYGQ.mjs.map} +1 -1
- package/dist/esm/chunk-55NODGHC.mjs +135 -0
- package/dist/esm/chunk-55NODGHC.mjs.map +1 -0
- package/dist/esm/chunk-6LRQSBRH.mjs +130 -0
- package/dist/esm/chunk-6LRQSBRH.mjs.map +1 -0
- package/dist/esm/chunk-6MSZMIFW.mjs +23 -0
- package/dist/esm/{chunk-BWFJHFBQ.mjs.map → chunk-6MSZMIFW.mjs.map} +1 -1
- package/dist/esm/chunk-76TSTAU4.mjs +120 -0
- package/dist/esm/chunk-76TSTAU4.mjs.map +1 -0
- package/dist/esm/chunk-7FO3S6IZ.mjs +324 -0
- package/dist/esm/{chunk-DMKUAQB7.mjs.map → chunk-7FO3S6IZ.mjs.map} +1 -1
- package/dist/esm/chunk-7FUHWL6A.mjs +42 -0
- package/dist/esm/{chunk-V3Q2KXJU.mjs.map → chunk-7FUHWL6A.mjs.map} +1 -1
- package/dist/esm/chunk-7IDBB4J4.mjs +33 -0
- package/dist/esm/{chunk-ZZZZVONX.mjs.map → chunk-7IDBB4J4.mjs.map} +1 -1
- package/dist/esm/chunk-7JRMOHBP.mjs +247 -0
- package/dist/esm/chunk-7JRMOHBP.mjs.map +1 -0
- package/dist/esm/chunk-7REUIYF4.mjs +63 -0
- package/dist/esm/chunk-7REUIYF4.mjs.map +1 -0
- package/dist/esm/chunk-7Z6DYLCA.mjs +1 -0
- package/dist/esm/chunk-7Z6DYLCA.mjs.map +1 -0
- package/dist/esm/chunk-AC3OGAL6.mjs +87 -0
- package/dist/esm/{chunk-U6Z4FNB7.mjs.map → chunk-AC3OGAL6.mjs.map} +1 -1
- package/dist/esm/chunk-AQ4I7VVB.mjs +1 -0
- package/dist/esm/chunk-AQ4I7VVB.mjs.map +1 -0
- package/dist/esm/chunk-AR7X6GWQ.mjs +356 -0
- package/dist/esm/{chunk-FS3NSGBF.mjs.map → chunk-AR7X6GWQ.mjs.map} +1 -1
- package/dist/esm/chunk-ASF2VWOX.mjs +142 -0
- package/dist/esm/{chunk-G2O323HP.mjs.map → chunk-ASF2VWOX.mjs.map} +1 -1
- package/dist/esm/chunk-ATVFVXR6.mjs +43 -0
- package/dist/esm/{chunk-VVIG4E7Q.mjs.map → chunk-ATVFVXR6.mjs.map} +1 -1
- package/dist/esm/chunk-B5S6DDUD.mjs +120 -0
- package/dist/esm/chunk-B5S6DDUD.mjs.map +1 -0
- package/dist/esm/chunk-BXMHDQHW.mjs +512 -0
- package/dist/esm/chunk-BXMHDQHW.mjs.map +1 -0
- package/dist/esm/chunk-CC4DQ6NH.mjs +19 -0
- package/dist/esm/{chunk-MACC2BLE.mjs.map → chunk-CC4DQ6NH.mjs.map} +1 -1
- package/dist/esm/chunk-CMNJG4NN.mjs +345 -0
- package/dist/esm/{chunk-IOSQVDZI.mjs.map → chunk-CMNJG4NN.mjs.map} +1 -1
- package/dist/esm/chunk-CTJSZT5V.mjs +87 -0
- package/dist/esm/{chunk-UFT7US42.mjs.map → chunk-CTJSZT5V.mjs.map} +1 -1
- package/dist/esm/chunk-CX3NAVRD.mjs +205 -0
- package/dist/esm/chunk-CX3NAVRD.mjs.map +1 -0
- package/dist/esm/chunk-CXUGZXED.mjs +307 -0
- package/dist/esm/{chunk-YU3KB3UV.mjs.map → chunk-CXUGZXED.mjs.map} +1 -1
- package/dist/esm/chunk-D2BVBXWO.mjs +7 -0
- package/dist/esm/{chunk-B7TQGVGL.mjs.map → chunk-D2BVBXWO.mjs.map} +1 -1
- package/dist/esm/chunk-DGV7DYU4.mjs +413 -0
- package/dist/esm/chunk-DGV7DYU4.mjs.map +1 -0
- package/dist/esm/chunk-DIYZRGR6.mjs +242 -0
- package/dist/esm/{chunk-O4JRPZZM.mjs.map → chunk-DIYZRGR6.mjs.map} +1 -1
- package/dist/esm/chunk-DNPMS2OF.mjs +236 -0
- package/dist/esm/{chunk-U43IJHQN.mjs.map → chunk-DNPMS2OF.mjs.map} +1 -1
- package/dist/esm/chunk-DVPQGCFT.mjs +74 -0
- package/dist/esm/{chunk-O2F53NKI.mjs.map → chunk-DVPQGCFT.mjs.map} +1 -1
- package/dist/esm/chunk-EYHRMZPO.mjs +34 -0
- package/dist/esm/{chunk-AH44UPM4.mjs.map → chunk-EYHRMZPO.mjs.map} +1 -1
- package/dist/esm/chunk-F2ZWA7B7.mjs +412 -0
- package/dist/esm/chunk-F2ZWA7B7.mjs.map +1 -0
- package/dist/esm/chunk-FDWJNY4U.mjs +22 -0
- package/dist/esm/{chunk-R5QUBEH6.mjs.map → chunk-FDWJNY4U.mjs.map} +1 -1
- package/dist/esm/chunk-FF4JPDKD.mjs +315 -0
- package/dist/esm/chunk-FF4JPDKD.mjs.map +1 -0
- package/dist/esm/chunk-FQQW55X7.mjs +288 -0
- package/dist/esm/{chunk-52C73T26.mjs.map → chunk-FQQW55X7.mjs.map} +1 -1
- package/dist/esm/chunk-FXKSE3ZP.mjs +25 -0
- package/dist/esm/{chunk-WFZDFFBM.mjs.map → chunk-FXKSE3ZP.mjs.map} +1 -1
- package/dist/esm/chunk-GBEVD2VM.mjs +99 -0
- package/dist/esm/chunk-GBEVD2VM.mjs.map +1 -0
- package/dist/esm/chunk-GGMTQAQP.mjs +11 -0
- package/dist/esm/{chunk-3JPVQHOR.mjs.map → chunk-GGMTQAQP.mjs.map} +1 -1
- package/dist/esm/chunk-GSVQ6EUD.mjs +649 -0
- package/dist/esm/chunk-GSVQ6EUD.mjs.map +1 -0
- package/dist/esm/chunk-HBNSRCZN.mjs +100 -0
- package/dist/esm/{chunk-SG4MAOCF.mjs.map → chunk-HBNSRCZN.mjs.map} +1 -1
- package/dist/esm/chunk-IC56GQFJ.mjs +127 -0
- package/dist/esm/chunk-IC56GQFJ.mjs.map +1 -0
- package/dist/esm/chunk-IHNPN5CQ.mjs +256 -0
- package/dist/esm/chunk-IHNPN5CQ.mjs.map +1 -0
- package/dist/esm/chunk-JHDHNGJ3.mjs +126 -0
- package/dist/esm/chunk-JHDHNGJ3.mjs.map +1 -0
- package/dist/esm/chunk-JL2JHVS4.mjs +49 -0
- package/dist/esm/{chunk-RHBCVCOS.mjs.map → chunk-JL2JHVS4.mjs.map} +1 -1
- package/dist/esm/chunk-JV3GSIJW.mjs +268 -0
- package/dist/esm/chunk-JV3GSIJW.mjs.map +1 -0
- package/dist/esm/chunk-JXCZTOYC.mjs +1 -0
- package/dist/esm/chunk-JXCZTOYC.mjs.map +1 -0
- package/dist/esm/chunk-KK2BSALW.mjs +32 -0
- package/dist/esm/{chunk-TBMAJ6AW.mjs.map → chunk-KK2BSALW.mjs.map} +1 -1
- package/dist/esm/chunk-KMXSRHJ6.mjs +93 -0
- package/dist/esm/chunk-KMXSRHJ6.mjs.map +1 -0
- package/dist/esm/chunk-KVSQ57HU.mjs +45 -0
- package/dist/esm/{chunk-NNQJBFRB.mjs.map → chunk-KVSQ57HU.mjs.map} +1 -1
- package/dist/esm/chunk-LI2QV6RU.mjs +129 -0
- package/dist/esm/chunk-LI2QV6RU.mjs.map +1 -0
- package/dist/esm/chunk-LLLQJWRZ.mjs +35 -0
- package/dist/esm/{chunk-DPV25ZKR.mjs.map → chunk-LLLQJWRZ.mjs.map} +1 -1
- package/dist/esm/chunk-LYK4TQZO.mjs +70 -0
- package/dist/esm/chunk-LYK4TQZO.mjs.map +1 -0
- package/dist/esm/chunk-LYMY63SO.mjs +124 -0
- package/dist/esm/{chunk-W4ZW7QHA.mjs.map → chunk-LYMY63SO.mjs.map} +1 -1
- package/dist/esm/chunk-MZZLEY6O.mjs +92 -0
- package/dist/esm/chunk-MZZLEY6O.mjs.map +1 -0
- package/dist/esm/chunk-N4WKFNQ6.mjs +156 -0
- package/dist/esm/chunk-N4WKFNQ6.mjs.map +1 -0
- package/dist/esm/chunk-NFJCQRVK.mjs +37 -0
- package/dist/esm/chunk-NFJCQRVK.mjs.map +1 -0
- package/dist/esm/chunk-NMKCJNQM.mjs +20 -0
- package/dist/esm/{chunk-TJDC5PWD.mjs.map → chunk-NMKCJNQM.mjs.map} +1 -1
- package/dist/esm/chunk-NW45SCPY.mjs +36 -0
- package/dist/esm/{chunk-GSD4OOM3.mjs.map → chunk-NW45SCPY.mjs.map} +1 -1
- package/dist/esm/chunk-NXFO2W4G.mjs +84 -0
- package/dist/esm/{chunk-QMURTXFM.mjs.map → chunk-NXFO2W4G.mjs.map} +1 -1
- package/dist/esm/chunk-NYL77J4X.mjs +97 -0
- package/dist/esm/chunk-NYL77J4X.mjs.map +1 -0
- package/dist/esm/chunk-O6PSHSN3.mjs +53 -0
- package/dist/esm/{chunk-MFKMAAWA.mjs.map → chunk-O6PSHSN3.mjs.map} +1 -1
- package/dist/esm/chunk-OR7TEZ25.mjs +16 -0
- package/dist/esm/chunk-OR7TEZ25.mjs.map +1 -0
- package/dist/esm/chunk-PCLNX6FS.mjs +17 -0
- package/dist/esm/{chunk-6FBKUTGF.mjs.map → chunk-PCLNX6FS.mjs.map} +1 -1
- package/dist/esm/chunk-PIMQHG2J.mjs +49 -0
- package/dist/esm/{chunk-ZYYK3UXP.mjs.map → chunk-PIMQHG2J.mjs.map} +1 -1
- package/dist/esm/chunk-PU5AFUX3.mjs +52 -0
- package/dist/esm/{chunk-LR65XHSF.mjs.map → chunk-PU5AFUX3.mjs.map} +1 -1
- package/dist/esm/chunk-PYLOAMR2.mjs +29 -0
- package/dist/esm/{chunk-UML2VQZT.mjs.map → chunk-PYLOAMR2.mjs.map} +1 -1
- package/dist/esm/chunk-QBBTUC66.mjs +15 -0
- package/dist/esm/{chunk-ROXFCLDT.mjs.map → chunk-QBBTUC66.mjs.map} +1 -1
- package/dist/esm/chunk-QFOG4LIN.mjs +319 -0
- package/dist/esm/{chunk-DM44OGQH.mjs.map → chunk-QFOG4LIN.mjs.map} +1 -1
- package/dist/esm/chunk-QMM2KL6C.mjs +12 -0
- package/dist/esm/{chunk-FBPNHF54.mjs.map → chunk-QMM2KL6C.mjs.map} +1 -1
- package/dist/esm/chunk-RCQMWXEW.mjs +35 -0
- package/dist/esm/{chunk-3WUGR46O.mjs.map → chunk-RCQMWXEW.mjs.map} +1 -1
- package/dist/esm/chunk-RFSO3JRG.mjs +1 -0
- package/dist/esm/chunk-RFSO3JRG.mjs.map +1 -0
- package/dist/esm/chunk-RX4VG2AT.mjs +314 -0
- package/dist/esm/{chunk-CNMQNPNV.mjs.map → chunk-RX4VG2AT.mjs.map} +1 -1
- package/dist/esm/chunk-SBB4YEPT.mjs +17 -0
- package/dist/esm/{chunk-56CNRT2K.mjs.map → chunk-SBB4YEPT.mjs.map} +1 -1
- package/dist/esm/chunk-SIJELMDP.mjs +29 -0
- package/dist/esm/{chunk-6EMN3BOV.mjs.map → chunk-SIJELMDP.mjs.map} +1 -1
- package/dist/esm/chunk-SS3NUM5L.mjs +94 -0
- package/dist/esm/{chunk-L54P6EGN.mjs.map → chunk-SS3NUM5L.mjs.map} +1 -1
- package/dist/esm/chunk-ST4QXIMI.mjs +37 -0
- package/dist/esm/{chunk-5P2S2SZZ.mjs.map → chunk-ST4QXIMI.mjs.map} +1 -1
- package/dist/esm/chunk-TBHU6ZW6.mjs +215 -0
- package/dist/esm/{chunk-7QJ6YJXP.mjs.map → chunk-TBHU6ZW6.mjs.map} +1 -1
- package/dist/esm/chunk-TLNHRJB2.mjs +155 -0
- package/dist/esm/chunk-TLNHRJB2.mjs.map +1 -0
- package/dist/esm/chunk-U3IUCR2G.mjs +54 -0
- package/dist/esm/{chunk-CU67XZNB.mjs.map → chunk-U3IUCR2G.mjs.map} +1 -1
- package/dist/esm/chunk-U7QBZ6PP.mjs +400 -0
- package/dist/esm/chunk-U7QBZ6PP.mjs.map +1 -0
- package/dist/esm/chunk-UEBBLQJ5.mjs +94 -0
- package/dist/esm/{chunk-NPFNYP75.mjs.map → chunk-UEBBLQJ5.mjs.map} +1 -1
- package/dist/esm/chunk-UKU6A2W2.mjs +232 -0
- package/dist/esm/{chunk-XO3HHRJV.mjs.map → chunk-UKU6A2W2.mjs.map} +1 -1
- package/dist/esm/chunk-UX5NSZEN.mjs +134 -0
- package/dist/esm/chunk-UX5NSZEN.mjs.map +1 -0
- package/dist/esm/chunk-VDJBDX3A.mjs +79 -0
- package/dist/esm/chunk-VDJBDX3A.mjs.map +1 -0
- package/dist/esm/chunk-VJP2VWMF.mjs +58 -0
- package/dist/esm/chunk-VJP2VWMF.mjs.map +1 -0
- package/dist/esm/chunk-VKJQORON.mjs +93 -0
- package/dist/esm/{chunk-734YX27W.mjs.map → chunk-VKJQORON.mjs.map} +1 -1
- package/dist/esm/chunk-VPWUODU4.mjs +51 -0
- package/dist/esm/{chunk-AU6W5OIH.mjs.map → chunk-VPWUODU4.mjs.map} +1 -1
- package/dist/esm/chunk-VZQXLVEP.mjs +197 -0
- package/dist/esm/{chunk-V6OS74OS.mjs.map → chunk-VZQXLVEP.mjs.map} +1 -1
- package/dist/esm/chunk-W76MGKZB.mjs +33 -0
- package/dist/esm/{chunk-CTIN3GTP.mjs.map → chunk-W76MGKZB.mjs.map} +1 -1
- package/dist/esm/chunk-WDRH2URB.mjs +91 -0
- package/dist/esm/chunk-WDRH2URB.mjs.map +1 -0
- package/dist/esm/chunk-WHBWEN6N.mjs +206 -0
- package/dist/esm/chunk-WHBWEN6N.mjs.map +1 -0
- package/dist/esm/chunk-WK5ZSNE2.mjs +173 -0
- package/dist/esm/{chunk-QIAHBEEW.mjs.map → chunk-WK5ZSNE2.mjs.map} +1 -1
- package/dist/esm/chunk-WLTBF4DF.mjs +22 -0
- package/dist/esm/chunk-WLTBF4DF.mjs.map +1 -0
- package/dist/esm/chunk-WVGO4D7K.mjs +254 -0
- package/dist/esm/chunk-WVGO4D7K.mjs.map +1 -0
- package/dist/esm/chunk-XANFAUBD.mjs +44 -0
- package/dist/esm/{chunk-QTRYMRYK.mjs.map → chunk-XANFAUBD.mjs.map} +1 -1
- package/dist/esm/chunk-Y2LV3S5W.mjs +410 -0
- package/dist/esm/chunk-Y2LV3S5W.mjs.map +1 -0
- package/dist/esm/chunk-YV7M4CFP.mjs +137 -0
- package/dist/esm/{chunk-AOCNYMMX.mjs.map → chunk-YV7M4CFP.mjs.map} +1 -1
- package/dist/esm/chunk-YYOPNUX5.mjs +41 -0
- package/dist/esm/chunk-YYOPNUX5.mjs.map +1 -0
- package/dist/esm/chunk-ZAHJ7KXB.mjs +81 -0
- package/dist/esm/chunk-ZAHJ7KXB.mjs.map +1 -0
- package/dist/esm/chunk-ZMFKQUHL.mjs +117 -0
- package/dist/esm/{chunk-RIUZPGI5.mjs.map → chunk-ZMFKQUHL.mjs.map} +1 -1
- package/dist/esm/cli/index.d.mts +12 -0
- package/dist/esm/cli/index.mjs +12 -1
- package/dist/esm/cli/localNode.mjs +8 -1
- package/dist/esm/cli/move.d.mts +105 -0
- package/dist/esm/cli/move.mjs +8 -0
- package/dist/esm/cli/move.mjs.map +1 -0
- package/dist/esm/client/core.mjs +27 -1
- package/dist/esm/client/get.d.mts +2 -1
- package/dist/esm/client/get.mjs +32 -1
- package/dist/esm/client/index.d.mts +2 -2
- package/dist/esm/client/index.mjs +55 -1
- package/dist/esm/client/post.d.mts +3 -1
- package/dist/esm/client/post.mjs +36 -1
- package/dist/esm/client/types.d.mts +5 -1
- package/dist/esm/client/types.mjs +7 -1
- package/dist/esm/core/account/index.d.mts +5 -14
- package/dist/esm/core/account/index.mjs +19 -1
- package/dist/esm/core/account/utils/address.mjs +18 -1
- package/dist/esm/core/account/utils/index.mjs +19 -1
- package/dist/esm/core/accountAddress.mjs +15 -1
- package/dist/esm/core/authenticationKey.mjs +14 -1
- package/dist/esm/core/common.mjs +7 -1
- package/dist/esm/core/crypto/ed25519.mjs +29 -1
- package/dist/esm/core/crypto/ephemeral.d.mts +73 -0
- package/dist/esm/core/crypto/ephemeral.mjs +29 -0
- package/dist/esm/core/crypto/ephemeral.mjs.map +1 -0
- package/dist/esm/core/crypto/hdKey.mjs +25 -1
- package/dist/esm/core/crypto/index.d.mts +6 -3
- package/dist/esm/core/crypto/index.mjs +124 -1
- package/dist/esm/core/crypto/keyless.d.mts +232 -0
- package/dist/esm/core/crypto/keyless.mjs +56 -0
- package/dist/esm/core/crypto/keyless.mjs.map +1 -0
- package/dist/esm/core/crypto/multiEd25519.mjs +28 -1
- package/dist/esm/core/crypto/multiKey.d.mts +7 -0
- package/dist/esm/core/crypto/multiKey.mjs +34 -1
- package/dist/esm/core/crypto/poseidon.d.mts +7 -0
- package/dist/esm/core/crypto/poseidon.mjs +16 -0
- package/dist/esm/core/crypto/poseidon.mjs.map +1 -0
- package/dist/esm/core/crypto/privateKey.mjs +1 -1
- package/dist/esm/core/crypto/proof.d.mts +21 -0
- package/dist/esm/core/crypto/proof.mjs +20 -0
- package/dist/esm/core/crypto/proof.mjs.map +1 -0
- package/dist/esm/core/crypto/publicKey.mjs +21 -1
- package/dist/esm/core/crypto/secp256k1.mjs +27 -1
- package/dist/esm/core/crypto/signature.mjs +19 -1
- package/dist/esm/core/crypto/singleKey.mjs +33 -1
- package/dist/esm/core/crypto/utils.mjs +9 -1
- package/dist/esm/core/hex.mjs +10 -1
- package/dist/esm/core/index.d.mts +5 -5
- package/dist/esm/core/index.mjs +141 -1
- package/dist/esm/index.d.mts +15 -8
- package/dist/esm/index.mjs +635 -1
- package/dist/esm/internal/account.d.mts +13 -1
- package/dist/esm/internal/account.mjs +106 -1
- package/dist/esm/internal/ans.d.mts +1 -1
- package/dist/esm/internal/ans.mjs +120 -1
- package/dist/esm/internal/coin.d.mts +7 -7
- package/dist/esm/internal/coin.mjs +85 -1
- package/dist/esm/internal/digitalAsset.d.mts +2 -2
- package/dist/esm/internal/digitalAsset.mjs +127 -1
- package/dist/esm/internal/event.d.mts +1 -1
- package/dist/esm/internal/event.mjs +55 -1
- package/dist/esm/internal/faucet.d.mts +1 -1
- package/dist/esm/internal/faucet.mjs +52 -1
- package/dist/esm/internal/fungibleAsset.d.mts +5 -5
- package/dist/esm/internal/fungibleAsset.mjs +91 -1
- package/dist/esm/internal/general.mjs +46 -1
- package/dist/esm/internal/keyless.d.mts +68 -0
- package/dist/esm/internal/keyless.mjs +74 -0
- package/dist/esm/internal/keyless.mjs.map +1 -0
- package/dist/esm/internal/staking.d.mts +1 -1
- package/dist/esm/internal/staking.mjs +53 -1
- package/dist/esm/internal/transaction.mjs +51 -1
- package/dist/esm/internal/transactionSubmission.d.mts +1 -1
- package/dist/esm/internal/transactionSubmission.mjs +102 -1
- package/dist/esm/internal/view.d.mts +7 -7
- package/dist/esm/internal/view.mjs +83 -1
- package/dist/esm/transactions/authenticator/account.d.mts +3 -4
- package/dist/esm/transactions/authenticator/account.mjs +44 -1
- package/dist/esm/transactions/authenticator/index.mjs +60 -1
- package/dist/esm/transactions/authenticator/transaction.mjs +48 -1
- package/dist/esm/transactions/index.d.mts +2 -2
- package/dist/esm/transactions/index.mjs +284 -1
- package/dist/esm/transactions/instances/chainId.mjs +11 -1
- package/dist/esm/transactions/instances/identifier.mjs +11 -1
- package/dist/esm/transactions/instances/index.mjs +96 -1
- package/dist/esm/transactions/instances/moduleId.d.mts +1 -1
- package/dist/esm/transactions/instances/moduleId.mjs +38 -1
- package/dist/esm/transactions/instances/multiAgentTransaction.mjs +43 -1
- package/dist/esm/transactions/instances/rawTransaction.mjs +48 -1
- package/dist/esm/transactions/instances/rotationProofChallenge.mjs +20 -1
- package/dist/esm/transactions/instances/signedTransaction.mjs +45 -1
- package/dist/esm/transactions/instances/simpleTransaction.mjs +43 -1
- package/dist/esm/transactions/instances/transactionArgument.mjs +1 -1
- package/dist/esm/transactions/instances/transactionPayload.d.mts +1 -1
- package/dist/esm/transactions/instances/transactionPayload.mjs +56 -1
- package/dist/esm/transactions/management/accountSequenceNumber.d.mts +13 -1
- package/dist/esm/transactions/management/accountSequenceNumber.mjs +74 -1
- package/dist/esm/transactions/management/asyncQueue.mjs +9 -1
- package/dist/esm/transactions/management/index.d.mts +2 -2
- package/dist/esm/transactions/management/index.mjs +95 -1
- package/dist/esm/transactions/management/transactionWorker.d.mts +1 -1
- package/dist/esm/transactions/management/transactionWorker.mjs +91 -1
- package/dist/esm/transactions/transactionBuilder/helpers.d.mts +9 -9
- package/dist/esm/transactions/transactionBuilder/helpers.mjs +75 -1
- package/dist/esm/transactions/transactionBuilder/index.d.mts +9 -9
- package/dist/esm/transactions/transactionBuilder/index.mjs +162 -1
- package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +6 -6
- package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +85 -1
- package/dist/esm/transactions/transactionBuilder/signingMessage.d.mts +72 -0
- package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +59 -0
- package/dist/esm/transactions/transactionBuilder/signingMessage.mjs.map +1 -0
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +6 -28
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +98 -1
- package/dist/esm/transactions/typeTag/index.mjs +74 -1
- package/dist/esm/transactions/typeTag/parser.mjs +43 -1
- package/dist/esm/transactions/types.d.mts +6 -6
- package/dist/esm/transactions/types.mjs +1 -1
- package/dist/esm/types/generated/queries.mjs +57 -1
- package/dist/esm/types/generated/types.mjs +809 -1
- package/dist/esm/types/generated/types.mjs.map +1 -1
- package/dist/esm/types/index.d.mts +19 -3
- package/dist/esm/types/index.mjs +68 -1
- package/dist/esm/types/indexer.mjs +1 -1
- package/dist/esm/types/keyless.d.mts +69 -0
- package/dist/esm/types/keyless.mjs +10 -0
- package/dist/esm/types/keyless.mjs.map +1 -0
- package/dist/esm/utils/apiEndpoints.d.mts +3 -2
- package/dist/esm/utils/apiEndpoints.mjs +21 -1
- package/dist/esm/utils/const.d.mts +3 -1
- package/dist/esm/utils/const.mjs +21 -1
- package/dist/esm/utils/helpers.mjs +7 -1
- package/dist/esm/utils/index.d.mts +1 -1
- package/dist/esm/utils/index.mjs +56 -1
- package/dist/esm/utils/memoize.mjs +9 -1
- package/dist/esm/utils/normalizeBundle.mjs +19 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +7 -1
- package/package.json +11 -3
- package/src/{core/account → account}/Account.ts +25 -15
- package/src/{core/account → account}/Ed25519Account.ts +45 -9
- package/src/account/EphemeralKeyPair.ts +161 -0
- package/src/account/KeylessAccount.ts +342 -0
- package/src/account/MultiKeyAccount.ts +186 -0
- package/src/{core/account → account}/SingleKeyAccount.ts +45 -10
- package/src/account/index.ts +6 -0
- package/src/api/account.ts +2 -1
- package/src/api/ans.ts +2 -1
- package/src/api/aptos.ts +6 -0
- package/src/api/aptosConfig.ts +46 -1
- package/src/api/digitalAsset.ts +2 -1
- package/src/api/fungibleAsset.ts +2 -1
- package/src/api/keyless.ts +48 -0
- package/src/api/transaction.ts +2 -1
- package/src/api/transactionSubmission/management.ts +1 -1
- package/src/api/transactionSubmission/sign.ts +1 -1
- package/src/bcs/deserializer.ts +40 -0
- package/src/bcs/serializer.ts +18 -0
- package/src/cli/index.ts +1 -0
- package/src/cli/move.ts +183 -0
- package/src/client/core.ts +8 -0
- package/src/client/get.ts +6 -0
- package/src/client/post.ts +12 -0
- package/src/client/types.ts +1 -1
- package/src/core/account/index.ts +0 -3
- package/src/core/crypto/ephemeral.ts +138 -0
- package/src/core/crypto/index.ts +2 -0
- package/src/core/crypto/keyless.ts +453 -0
- package/src/core/crypto/multiKey.ts +17 -6
- package/src/core/crypto/poseidon.ts +134 -0
- package/src/core/crypto/proof.ts +16 -0
- package/src/core/crypto/singleKey.ts +11 -0
- package/src/core/index.ts +0 -1
- package/src/index.ts +1 -0
- package/src/internal/account.ts +1 -1
- package/src/internal/ans.ts +2 -2
- package/src/internal/digitalAsset.ts +2 -1
- package/src/internal/fungibleAsset.ts +3 -2
- package/src/internal/keyless.ts +119 -0
- package/src/internal/transactionSubmission.ts +24 -13
- package/src/transactions/authenticator/account.ts +6 -11
- package/src/transactions/management/accountSequenceNumber.ts +1 -1
- package/src/transactions/management/transactionWorker.ts +1 -1
- package/src/transactions/transactionBuilder/index.ts +1 -0
- package/src/transactions/transactionBuilder/signingMessage.ts +93 -0
- package/src/transactions/transactionBuilder/transactionBuilder.ts +2 -75
- package/src/types/index.ts +22 -0
- package/src/types/keyless.ts +37 -0
- package/src/utils/apiEndpoints.ts +14 -6
- package/src/utils/const.ts +2 -0
- package/src/version.ts +1 -1
- package/dist/common/chunk-KSEUZTKY.js +0 -2
- package/dist/common/chunk-KSEUZTKY.js.map +0 -1
- package/dist/esm/chunk-24IKVZBK.mjs +0 -2
- package/dist/esm/chunk-24IKVZBK.mjs.map +0 -1
- package/dist/esm/chunk-2HISPUZZ.mjs +0 -2
- package/dist/esm/chunk-2HISPUZZ.mjs.map +0 -1
- package/dist/esm/chunk-3JPVQHOR.mjs +0 -2
- package/dist/esm/chunk-3WUGR46O.mjs +0 -2
- package/dist/esm/chunk-52C73T26.mjs +0 -2
- package/dist/esm/chunk-56CNRT2K.mjs +0 -2
- package/dist/esm/chunk-5P2S2SZZ.mjs +0 -2
- package/dist/esm/chunk-6CFRW26C.mjs +0 -2
- package/dist/esm/chunk-6CFRW26C.mjs.map +0 -1
- package/dist/esm/chunk-6EMN3BOV.mjs +0 -2
- package/dist/esm/chunk-6FBKUTGF.mjs +0 -2
- package/dist/esm/chunk-6IFMQ5AS.mjs +0 -2
- package/dist/esm/chunk-6IFMQ5AS.mjs.map +0 -1
- package/dist/esm/chunk-734YX27W.mjs +0 -2
- package/dist/esm/chunk-7QJ6YJXP.mjs +0 -2
- package/dist/esm/chunk-AD3VLZ7I.mjs +0 -2
- package/dist/esm/chunk-AD3VLZ7I.mjs.map +0 -1
- package/dist/esm/chunk-AH44UPM4.mjs +0 -2
- package/dist/esm/chunk-AOCNYMMX.mjs +0 -2
- package/dist/esm/chunk-AU6W5OIH.mjs +0 -2
- package/dist/esm/chunk-B3R6G6QP.mjs +0 -2
- package/dist/esm/chunk-B3R6G6QP.mjs.map +0 -1
- package/dist/esm/chunk-B7TQGVGL.mjs +0 -2
- package/dist/esm/chunk-BWFJHFBQ.mjs +0 -2
- package/dist/esm/chunk-CNMQNPNV.mjs +0 -2
- package/dist/esm/chunk-CTIN3GTP.mjs +0 -2
- package/dist/esm/chunk-CU67XZNB.mjs +0 -2
- package/dist/esm/chunk-CYNQRMO5.mjs +0 -2
- package/dist/esm/chunk-CYNQRMO5.mjs.map +0 -1
- package/dist/esm/chunk-DM44OGQH.mjs +0 -2
- package/dist/esm/chunk-DMKUAQB7.mjs +0 -2
- package/dist/esm/chunk-DPV25ZKR.mjs +0 -2
- package/dist/esm/chunk-DSTKXJMA.mjs +0 -2
- package/dist/esm/chunk-E7FWVXGX.mjs +0 -1
- package/dist/esm/chunk-EOFJFE4T.mjs +0 -2
- package/dist/esm/chunk-EOFJFE4T.mjs.map +0 -1
- package/dist/esm/chunk-FATWMUXK.mjs +0 -2
- package/dist/esm/chunk-FATWMUXK.mjs.map +0 -1
- package/dist/esm/chunk-FBPNHF54.mjs +0 -2
- package/dist/esm/chunk-FS3NSGBF.mjs +0 -2
- package/dist/esm/chunk-FVA2OPG4.mjs +0 -2
- package/dist/esm/chunk-G2O323HP.mjs +0 -2
- package/dist/esm/chunk-GSD4OOM3.mjs +0 -2
- package/dist/esm/chunk-HQ5I4Q3H.mjs +0 -2
- package/dist/esm/chunk-HQ5I4Q3H.mjs.map +0 -1
- package/dist/esm/chunk-IIPYR7PF.mjs +0 -2
- package/dist/esm/chunk-IIPYR7PF.mjs.map +0 -1
- package/dist/esm/chunk-IKYIJYBY.mjs +0 -2
- package/dist/esm/chunk-IKYIJYBY.mjs.map +0 -1
- package/dist/esm/chunk-IOSQVDZI.mjs +0 -2
- package/dist/esm/chunk-KVZ4XMZS.mjs +0 -2
- package/dist/esm/chunk-KVZ4XMZS.mjs.map +0 -1
- package/dist/esm/chunk-L54P6EGN.mjs +0 -2
- package/dist/esm/chunk-LR65XHSF.mjs +0 -2
- package/dist/esm/chunk-MACC2BLE.mjs +0 -2
- package/dist/esm/chunk-MC6G725U.mjs +0 -2
- package/dist/esm/chunk-MC6G725U.mjs.map +0 -1
- package/dist/esm/chunk-MFKMAAWA.mjs +0 -2
- package/dist/esm/chunk-MLWIHWNH.mjs +0 -1
- package/dist/esm/chunk-NNQJBFRB.mjs +0 -2
- package/dist/esm/chunk-NPFNYP75.mjs +0 -2
- package/dist/esm/chunk-O2F53NKI.mjs +0 -2
- package/dist/esm/chunk-O4JRPZZM.mjs +0 -2
- package/dist/esm/chunk-ODRO4CSA.mjs +0 -2
- package/dist/esm/chunk-ODRO4CSA.mjs.map +0 -1
- package/dist/esm/chunk-OVJQWQ2N.mjs +0 -2
- package/dist/esm/chunk-OVJQWQ2N.mjs.map +0 -1
- package/dist/esm/chunk-OWW6SIDP.mjs +0 -2
- package/dist/esm/chunk-OWW6SIDP.mjs.map +0 -1
- package/dist/esm/chunk-PFIMEXNN.mjs +0 -2
- package/dist/esm/chunk-PFIMEXNN.mjs.map +0 -1
- package/dist/esm/chunk-PZGLV5UQ.mjs +0 -2
- package/dist/esm/chunk-Q3TZGQVC.mjs +0 -2
- package/dist/esm/chunk-Q3TZGQVC.mjs.map +0 -1
- package/dist/esm/chunk-QIAHBEEW.mjs +0 -2
- package/dist/esm/chunk-QMURTXFM.mjs +0 -2
- package/dist/esm/chunk-QTRYMRYK.mjs +0 -2
- package/dist/esm/chunk-R5QUBEH6.mjs +0 -2
- package/dist/esm/chunk-R7G3CLRI.mjs +0 -1
- package/dist/esm/chunk-RHBCVCOS.mjs +0 -2
- package/dist/esm/chunk-RIUZPGI5.mjs +0 -2
- package/dist/esm/chunk-ROXFCLDT.mjs +0 -2
- package/dist/esm/chunk-SG4MAOCF.mjs +0 -2
- package/dist/esm/chunk-SUAKPNKQ.mjs +0 -2
- package/dist/esm/chunk-SUAKPNKQ.mjs.map +0 -1
- package/dist/esm/chunk-TBMAJ6AW.mjs +0 -2
- package/dist/esm/chunk-TJDC5PWD.mjs +0 -2
- package/dist/esm/chunk-TLOPIURC.mjs +0 -2
- package/dist/esm/chunk-TLOPIURC.mjs.map +0 -1
- package/dist/esm/chunk-U43IJHQN.mjs +0 -2
- package/dist/esm/chunk-U6Z4FNB7.mjs +0 -2
- package/dist/esm/chunk-UFT7US42.mjs +0 -2
- package/dist/esm/chunk-UML2VQZT.mjs +0 -2
- package/dist/esm/chunk-UVSRX4SV.mjs +0 -1
- package/dist/esm/chunk-V3Q2KXJU.mjs +0 -2
- package/dist/esm/chunk-V4SRNEV3.mjs +0 -2
- package/dist/esm/chunk-V4SRNEV3.mjs.map +0 -1
- package/dist/esm/chunk-V6OS74OS.mjs +0 -2
- package/dist/esm/chunk-VVIG4E7Q.mjs +0 -2
- package/dist/esm/chunk-W4ZW7QHA.mjs +0 -2
- package/dist/esm/chunk-WFZDFFBM.mjs +0 -2
- package/dist/esm/chunk-WLF5YQM4.mjs +0 -2
- package/dist/esm/chunk-WLF5YQM4.mjs.map +0 -1
- package/dist/esm/chunk-XDGQTMDV.mjs +0 -2
- package/dist/esm/chunk-XDGQTMDV.mjs.map +0 -1
- package/dist/esm/chunk-XO3HHRJV.mjs +0 -2
- package/dist/esm/chunk-YFRXBEOC.mjs +0 -2
- package/dist/esm/chunk-YFRXBEOC.mjs.map +0 -1
- package/dist/esm/chunk-YPTF6MLX.mjs +0 -2
- package/dist/esm/chunk-YPTF6MLX.mjs.map +0 -1
- package/dist/esm/chunk-YU3KB3UV.mjs +0 -2
- package/dist/esm/chunk-Z5YFM2AW.mjs +0 -2
- package/dist/esm/chunk-Z5YFM2AW.mjs.map +0 -1
- package/dist/esm/chunk-ZYYK3UXP.mjs +0 -2
- package/dist/esm/chunk-ZZZZVONX.mjs +0 -2
- package/dist/esm/core/account/Account.d.mts +0 -20
- package/dist/esm/core/account/Account.mjs +0 -2
- package/dist/esm/core/account/Ed25519Account.d.mts +0 -20
- package/dist/esm/core/account/Ed25519Account.mjs +0 -2
- package/dist/esm/core/account/SingleKeyAccount.d.mts +0 -20
- package/dist/esm/core/account/SingleKeyAccount.mjs +0 -2
- /package/dist/esm/{core/account → account}/Account.mjs.map +0 -0
- /package/dist/esm/{core/account → account}/Ed25519Account.mjs.map +0 -0
- /package/dist/esm/{chunk-E7FWVXGX.mjs.map → account/EphemeralKeyPair.mjs.map} +0 -0
- /package/dist/esm/{chunk-FVA2OPG4.mjs.map → account/KeylessAccount.mjs.map} +0 -0
- /package/dist/esm/{chunk-MLWIHWNH.mjs.map → account/MultiKeyAccount.mjs.map} +0 -0
- /package/dist/esm/{core/account → account}/SingleKeyAccount.mjs.map +0 -0
- /package/dist/esm/{chunk-R7G3CLRI.mjs.map → account/index.mjs.map} +0 -0
- /package/dist/esm/{chunk-UVSRX4SV.mjs.map → api/keyless.mjs.map} +0 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import {
|
|
2
|
+
queryIndexer
|
|
3
|
+
} from "./chunk-LYMY63SO.mjs";
|
|
4
|
+
import {
|
|
5
|
+
GetDelegatedStakingActivities,
|
|
6
|
+
GetNumberOfDelegators
|
|
7
|
+
} from "./chunk-4PJ5FYGQ.mjs";
|
|
8
|
+
import {
|
|
9
|
+
AccountAddress
|
|
10
|
+
} from "./chunk-CMNJG4NN.mjs";
|
|
11
|
+
|
|
12
|
+
// src/internal/staking.ts
|
|
13
|
+
async function getNumberOfDelegators(args) {
|
|
14
|
+
const { aptosConfig, poolAddress } = args;
|
|
15
|
+
const address = AccountAddress.from(poolAddress).toStringLong();
|
|
16
|
+
const query = {
|
|
17
|
+
query: GetNumberOfDelegators,
|
|
18
|
+
variables: { where_condition: { pool_address: { _eq: address } } }
|
|
19
|
+
};
|
|
20
|
+
const data = await queryIndexer({ aptosConfig, query });
|
|
21
|
+
return data.num_active_delegator_per_pool[0] ? data.num_active_delegator_per_pool[0].num_active_delegator : 0;
|
|
22
|
+
}
|
|
23
|
+
async function getNumberOfDelegatorsForAllPools(args) {
|
|
24
|
+
const { aptosConfig, options } = args;
|
|
25
|
+
const query = {
|
|
26
|
+
query: GetNumberOfDelegators,
|
|
27
|
+
variables: { order_by: options?.orderBy }
|
|
28
|
+
};
|
|
29
|
+
const data = await queryIndexer({
|
|
30
|
+
aptosConfig,
|
|
31
|
+
query
|
|
32
|
+
});
|
|
33
|
+
return data.num_active_delegator_per_pool;
|
|
34
|
+
}
|
|
35
|
+
async function getDelegatedStakingActivities(args) {
|
|
36
|
+
const { aptosConfig, delegatorAddress, poolAddress } = args;
|
|
37
|
+
const query = {
|
|
38
|
+
query: GetDelegatedStakingActivities,
|
|
39
|
+
variables: {
|
|
40
|
+
delegatorAddress: AccountAddress.from(delegatorAddress).toStringLong(),
|
|
41
|
+
poolAddress: AccountAddress.from(poolAddress).toStringLong()
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
const data = await queryIndexer({ aptosConfig, query });
|
|
45
|
+
return data.delegated_staking_activities;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export {
|
|
49
|
+
getNumberOfDelegators,
|
|
50
|
+
getNumberOfDelegatorsForAllPools,
|
|
51
|
+
getDelegatedStakingActivities
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=chunk-O6PSHSN3.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/internal/staking.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * This file contains the underlying implementations for exposed API surface in\n * the {@link api/staking}. By moving the methods out into a separate file,\n * other namespaces and processes can access these methods without depending on the entire\n * faucet namespace and without having a dependency cycle error.\n */\n\nimport { AptosConfig } from \"../api/aptosConfig\";\nimport { AccountAddress, AccountAddressInput } from \"../core\";\nimport { GetDelegatedStakingActivitiesResponse, GetNumberOfDelegatorsResponse, OrderByArg } from \"../types\";\nimport { GetDelegatedStakingActivitiesQuery, GetNumberOfDelegatorsQuery } from \"../types/generated/operations\";\nimport { GetDelegatedStakingActivities, GetNumberOfDelegators } from \"../types/generated/queries\";\nimport { queryIndexer } from \"./general\";\n\nexport async function getNumberOfDelegators(args: {\n aptosConfig: AptosConfig;\n poolAddress: AccountAddressInput;\n}): Promise<number> {\n const { aptosConfig, poolAddress } = args;\n const address = AccountAddress.from(poolAddress).toStringLong();\n const query = {\n query: GetNumberOfDelegators,\n variables: { where_condition: { pool_address: { _eq: address } } },\n };\n const data = await queryIndexer<GetNumberOfDelegatorsQuery>({ aptosConfig, query });\n\n // commonjs (aka cjs) doesnt handle Nullish Coalescing for some reason\n // might be because of how ts infer the graphql generated scheme type\n return data.num_active_delegator_per_pool[0] ? data.num_active_delegator_per_pool[0].num_active_delegator : 0;\n}\n\nexport async function getNumberOfDelegatorsForAllPools(args: {\n aptosConfig: AptosConfig;\n options?: OrderByArg<GetNumberOfDelegatorsResponse[0]>;\n}): Promise<GetNumberOfDelegatorsResponse> {\n const { aptosConfig, options } = args;\n const query = {\n query: GetNumberOfDelegators,\n variables: { order_by: options?.orderBy },\n };\n const data = await queryIndexer<GetNumberOfDelegatorsQuery>({\n aptosConfig,\n query,\n });\n return data.num_active_delegator_per_pool;\n}\n\nexport async function getDelegatedStakingActivities(args: {\n aptosConfig: AptosConfig;\n delegatorAddress: AccountAddressInput;\n poolAddress: AccountAddressInput;\n}): Promise<GetDelegatedStakingActivitiesResponse> {\n const { aptosConfig, delegatorAddress, poolAddress } = args;\n const query = {\n query: GetDelegatedStakingActivities,\n variables: {\n delegatorAddress: AccountAddress.from(delegatorAddress).toStringLong(),\n poolAddress: AccountAddress.from(poolAddress).toStringLong(),\n },\n };\n const data = await queryIndexer<GetDelegatedStakingActivitiesQuery>({ aptosConfig, query });\n return data.delegated_staking_activities;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/internal/staking.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * This file contains the underlying implementations for exposed API surface in\n * the {@link api/staking}. By moving the methods out into a separate file,\n * other namespaces and processes can access these methods without depending on the entire\n * faucet namespace and without having a dependency cycle error.\n */\n\nimport { AptosConfig } from \"../api/aptosConfig\";\nimport { AccountAddress, AccountAddressInput } from \"../core\";\nimport { GetDelegatedStakingActivitiesResponse, GetNumberOfDelegatorsResponse, OrderByArg } from \"../types\";\nimport { GetDelegatedStakingActivitiesQuery, GetNumberOfDelegatorsQuery } from \"../types/generated/operations\";\nimport { GetDelegatedStakingActivities, GetNumberOfDelegators } from \"../types/generated/queries\";\nimport { queryIndexer } from \"./general\";\n\nexport async function getNumberOfDelegators(args: {\n aptosConfig: AptosConfig;\n poolAddress: AccountAddressInput;\n}): Promise<number> {\n const { aptosConfig, poolAddress } = args;\n const address = AccountAddress.from(poolAddress).toStringLong();\n const query = {\n query: GetNumberOfDelegators,\n variables: { where_condition: { pool_address: { _eq: address } } },\n };\n const data = await queryIndexer<GetNumberOfDelegatorsQuery>({ aptosConfig, query });\n\n // commonjs (aka cjs) doesnt handle Nullish Coalescing for some reason\n // might be because of how ts infer the graphql generated scheme type\n return data.num_active_delegator_per_pool[0] ? data.num_active_delegator_per_pool[0].num_active_delegator : 0;\n}\n\nexport async function getNumberOfDelegatorsForAllPools(args: {\n aptosConfig: AptosConfig;\n options?: OrderByArg<GetNumberOfDelegatorsResponse[0]>;\n}): Promise<GetNumberOfDelegatorsResponse> {\n const { aptosConfig, options } = args;\n const query = {\n query: GetNumberOfDelegators,\n variables: { order_by: options?.orderBy },\n };\n const data = await queryIndexer<GetNumberOfDelegatorsQuery>({\n aptosConfig,\n query,\n });\n return data.num_active_delegator_per_pool;\n}\n\nexport async function getDelegatedStakingActivities(args: {\n aptosConfig: AptosConfig;\n delegatorAddress: AccountAddressInput;\n poolAddress: AccountAddressInput;\n}): Promise<GetDelegatedStakingActivitiesResponse> {\n const { aptosConfig, delegatorAddress, poolAddress } = args;\n const query = {\n query: GetDelegatedStakingActivities,\n variables: {\n delegatorAddress: AccountAddress.from(delegatorAddress).toStringLong(),\n poolAddress: AccountAddress.from(poolAddress).toStringLong(),\n },\n };\n const data = await queryIndexer<GetDelegatedStakingActivitiesQuery>({ aptosConfig, query });\n return data.delegated_staking_activities;\n}\n"],"mappings":";;;;;;;;;;;;AAiBA,eAAsB,sBAAsB,MAGxB;AAClB,QAAM,EAAE,aAAa,YAAY,IAAI;AACrC,QAAM,UAAU,eAAe,KAAK,WAAW,EAAE,aAAa;AAC9D,QAAM,QAAQ;AAAA,IACZ,OAAO;AAAA,IACP,WAAW,EAAE,iBAAiB,EAAE,cAAc,EAAE,KAAK,QAAQ,EAAE,EAAE;AAAA,EACnE;AACA,QAAM,OAAO,MAAM,aAAyC,EAAE,aAAa,MAAM,CAAC;AAIlF,SAAO,KAAK,8BAA8B,CAAC,IAAI,KAAK,8BAA8B,CAAC,EAAE,uBAAuB;AAC9G;AAEA,eAAsB,iCAAiC,MAGZ;AACzC,QAAM,EAAE,aAAa,QAAQ,IAAI;AACjC,QAAM,QAAQ;AAAA,IACZ,OAAO;AAAA,IACP,WAAW,EAAE,UAAU,SAAS,QAAQ;AAAA,EAC1C;AACA,QAAM,OAAO,MAAM,aAAyC;AAAA,IAC1D;AAAA,IACA;AAAA,EACF,CAAC;AACD,SAAO,KAAK;AACd;AAEA,eAAsB,8BAA8B,MAID;AACjD,QAAM,EAAE,aAAa,kBAAkB,YAAY,IAAI;AACvD,QAAM,QAAQ;AAAA,IACZ,OAAO;AAAA,IACP,WAAW;AAAA,MACT,kBAAkB,eAAe,KAAK,gBAAgB,EAAE,aAAa;AAAA,MACrE,aAAa,eAAe,KAAK,WAAW,EAAE,aAAa;AAAA,IAC7D;AAAA,EACF;AACA,QAAM,OAAO,MAAM,aAAiD,EAAE,aAAa,MAAM,CAAC;AAC1F,SAAO,KAAK;AACd;","names":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
4
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
5
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6
|
+
if (decorator = decorators[i])
|
|
7
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8
|
+
if (kind && result)
|
|
9
|
+
__defProp(target, key, result);
|
|
10
|
+
return result;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export {
|
|
14
|
+
__decorateClass
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=chunk-OR7TEZ25.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// src/client/types.ts
|
|
2
|
+
var AptosApiError = class extends Error {
|
|
3
|
+
constructor(request, response, message) {
|
|
4
|
+
super(message);
|
|
5
|
+
this.name = "AptosApiError";
|
|
6
|
+
this.url = response.url;
|
|
7
|
+
this.status = response.status;
|
|
8
|
+
this.statusText = response.statusText;
|
|
9
|
+
this.data = response.data;
|
|
10
|
+
this.request = request;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export {
|
|
15
|
+
AptosApiError
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=chunk-PCLNX6FS.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/client/types.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { AptosRequest } from \"../types\";\n\n/**\n * The API response type\n *\n * @param status - the response status. i.e. 200\n * @param statusText - the response message\n * @param data the response data\n * @param url the url the request was made to\n * @param headers the response headers\n * @param config (optional) - the request object\n * @param request (optional) - the request object\n */\nexport interface AptosResponse<Req, Res> {\n status: number;\n statusText: string;\n data: Res;\n url: string;\n headers: any;\n config?: any;\n request?: Req;\n}\n\n/**\n * The type returned from an API error\n *\n * @param name - the error name \"AptosApiError\"\n * @param url the url the request was made to\n * @param status - the response status. i.e. 400\n * @param statusText - the response message\n * @param data the response data\n * @param request - the AptosRequest\n */\nexport class AptosApiError extends Error {\n readonly url: string;\n\n readonly status: number;\n\n readonly statusText: string;\n\n readonly data:
|
|
1
|
+
{"version":3,"sources":["../../src/client/types.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { AptosRequest } from \"../types\";\n\n/**\n * The API response type\n *\n * @param status - the response status. i.e. 200\n * @param statusText - the response message\n * @param data the response data\n * @param url the url the request was made to\n * @param headers the response headers\n * @param config (optional) - the request object\n * @param request (optional) - the request object\n */\nexport interface AptosResponse<Req, Res> {\n status: number;\n statusText: string;\n data: Res;\n url: string;\n headers: any;\n config?: any;\n request?: Req;\n}\n\n/**\n * The type returned from an API error\n *\n * @param name - the error name \"AptosApiError\"\n * @param url the url the request was made to\n * @param status - the response status. i.e. 400\n * @param statusText - the response message\n * @param data the response data\n * @param request - the AptosRequest\n */\nexport class AptosApiError extends Error {\n readonly url: string;\n\n readonly status: number;\n\n readonly statusText: string;\n\n readonly data: { message: string; error_code?: string; vm_error_code?: number };\n\n readonly request: AptosRequest;\n\n constructor(request: AptosRequest, response: AptosResponse<any, any>, message: string) {\n super(message);\n\n this.name = \"AptosApiError\";\n this.url = response.url;\n this.status = response.status;\n this.statusText = response.statusText;\n this.data = response.data;\n this.request = request;\n }\n}\n"],"mappings":";AAoCO,IAAM,gBAAN,cAA4B,MAAM;AAAA,EAWvC,YAAY,SAAuB,UAAmC,SAAiB;AACrF,UAAM,OAAO;AAEb,SAAK,OAAO;AACZ,SAAK,MAAM,SAAS;AACpB,SAAK,SAAS,SAAS;AACvB,SAAK,aAAa,SAAS;AAC3B,SAAK,OAAO,SAAS;AACrB,SAAK,UAAU;AAAA,EACjB;AACF;","names":[]}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FixedBytes
|
|
3
|
+
} from "./chunk-KK2BSALW.mjs";
|
|
4
|
+
import {
|
|
5
|
+
Serializable
|
|
6
|
+
} from "./chunk-FQQW55X7.mjs";
|
|
7
|
+
|
|
8
|
+
// src/bcs/serializable/entryFunctionBytes.ts
|
|
9
|
+
var EntryFunctionBytes = class _EntryFunctionBytes extends Serializable {
|
|
10
|
+
constructor(value) {
|
|
11
|
+
super();
|
|
12
|
+
this.value = new FixedBytes(value);
|
|
13
|
+
}
|
|
14
|
+
// Note that to see the Move, BCS-serialized representation of the underlying fixed byte vector,
|
|
15
|
+
// we must not serialize the length prefix.
|
|
16
|
+
//
|
|
17
|
+
// In other words, this class is only used to represent a sequence of bytes that are already
|
|
18
|
+
// BCS-serialized as a type. To represent those bytes accurately, the BCS-serialized form is the same exact
|
|
19
|
+
// representation.
|
|
20
|
+
serialize(serializer) {
|
|
21
|
+
serializer.serialize(this.value);
|
|
22
|
+
}
|
|
23
|
+
// When we serialize these bytes as an entry function argument, we need to
|
|
24
|
+
// serialize the length prefix. This essentially converts the underlying fixed byte vector to a type-agnostic
|
|
25
|
+
// byte vector to an `any` type.
|
|
26
|
+
// NOTE: This, and the lack of a `serializeForScriptFunction`, is the only meaningful difference between this
|
|
27
|
+
// class and FixedBytes.
|
|
28
|
+
serializeForEntryFunction(serializer) {
|
|
29
|
+
serializer.serializeU32AsUleb128(this.value.value.length);
|
|
30
|
+
serializer.serialize(this);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The only way to create an instance of this class is to use this static method.
|
|
34
|
+
*
|
|
35
|
+
* This function should only be used when deserializing a sequence of EntryFunctionPayload arguments.
|
|
36
|
+
* @param deserializer the deserializer instance with the buffered bytes
|
|
37
|
+
* @param length the length of the bytes to deserialize
|
|
38
|
+
* @returns an instance of this class, which will now only be usable as an EntryFunctionArgument
|
|
39
|
+
*/
|
|
40
|
+
static deserialize(deserializer, length) {
|
|
41
|
+
const fixedBytes = FixedBytes.deserialize(deserializer, length);
|
|
42
|
+
return new _EntryFunctionBytes(fixedBytes.value);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export {
|
|
47
|
+
EntryFunctionBytes
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=chunk-PIMQHG2J.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/bcs/serializable/entryFunctionBytes.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Serializer, Serializable } from \"../serializer\";\nimport { Deserializer } from \"../deserializer\";\nimport { FixedBytes } from \"./fixedBytes\";\nimport { EntryFunctionArgument } from \"../../transactions/instances/transactionArgument\";\nimport { HexInput } from \"../../types\";\n\n/**\n * This class exists solely to represent a sequence of fixed bytes as a serialized entry function, because\n * serializing an entry function appends a prefix that's *only* used for entry function arguments.\n *\n * NOTE: Attempting to use this class for a serialized script function will result in erroneous\n * and unexpected behavior.\n *\n * If you wish to convert this class back to a TransactionArgument, you must know the type\n * of the argument beforehand, and use the appropriate class to deserialize the bytes within\n * an instance of this class.\n */\nexport class EntryFunctionBytes extends Serializable implements EntryFunctionArgument {\n public readonly value: FixedBytes;\n\n private constructor(value: HexInput) {\n super();\n this.value = new FixedBytes(value);\n }\n\n // Note that to see the Move, BCS-serialized representation of the underlying fixed byte vector,\n // we must not serialize the length prefix.\n //\n // In other words, this class is only used to represent a sequence of bytes that are already\n // BCS-serialized as a type. To represent those bytes accurately, the BCS-serialized form is the same exact\n // representation.\n serialize(serializer: Serializer): void {\n serializer.serialize(this.value);\n }\n\n // When we serialize these bytes as an entry function argument, we need to\n // serialize the length prefix. This essentially converts the underlying fixed byte vector to a type-agnostic\n // byte vector to an `any` type.\n // NOTE: This, and the lack of a `serializeForScriptFunction`, is the only meaningful difference between this\n // class and FixedBytes.\n serializeForEntryFunction(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(this.value.value.length);\n serializer.serialize(this);\n }\n\n /**\n * The only way to create an instance of this class is to use this static method.\n *\n * This function should only be used when deserializing a sequence of EntryFunctionPayload arguments.\n * @param deserializer the deserializer instance with the buffered bytes\n * @param length the length of the bytes to deserialize\n * @returns an instance of this class, which will now only be usable as an EntryFunctionArgument\n */\n static deserialize(deserializer: Deserializer, length: number): EntryFunctionBytes {\n const fixedBytes = FixedBytes.deserialize(deserializer, length);\n return new EntryFunctionBytes(fixedBytes.value);\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/bcs/serializable/entryFunctionBytes.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Serializer, Serializable } from \"../serializer\";\nimport { Deserializer } from \"../deserializer\";\nimport { FixedBytes } from \"./fixedBytes\";\nimport { EntryFunctionArgument } from \"../../transactions/instances/transactionArgument\";\nimport { HexInput } from \"../../types\";\n\n/**\n * This class exists solely to represent a sequence of fixed bytes as a serialized entry function, because\n * serializing an entry function appends a prefix that's *only* used for entry function arguments.\n *\n * NOTE: Attempting to use this class for a serialized script function will result in erroneous\n * and unexpected behavior.\n *\n * If you wish to convert this class back to a TransactionArgument, you must know the type\n * of the argument beforehand, and use the appropriate class to deserialize the bytes within\n * an instance of this class.\n */\nexport class EntryFunctionBytes extends Serializable implements EntryFunctionArgument {\n public readonly value: FixedBytes;\n\n private constructor(value: HexInput) {\n super();\n this.value = new FixedBytes(value);\n }\n\n // Note that to see the Move, BCS-serialized representation of the underlying fixed byte vector,\n // we must not serialize the length prefix.\n //\n // In other words, this class is only used to represent a sequence of bytes that are already\n // BCS-serialized as a type. To represent those bytes accurately, the BCS-serialized form is the same exact\n // representation.\n serialize(serializer: Serializer): void {\n serializer.serialize(this.value);\n }\n\n // When we serialize these bytes as an entry function argument, we need to\n // serialize the length prefix. This essentially converts the underlying fixed byte vector to a type-agnostic\n // byte vector to an `any` type.\n // NOTE: This, and the lack of a `serializeForScriptFunction`, is the only meaningful difference between this\n // class and FixedBytes.\n serializeForEntryFunction(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(this.value.value.length);\n serializer.serialize(this);\n }\n\n /**\n * The only way to create an instance of this class is to use this static method.\n *\n * This function should only be used when deserializing a sequence of EntryFunctionPayload arguments.\n * @param deserializer the deserializer instance with the buffered bytes\n * @param length the length of the bytes to deserialize\n * @returns an instance of this class, which will now only be usable as an EntryFunctionArgument\n */\n static deserialize(deserializer: Deserializer, length: number): EntryFunctionBytes {\n const fixedBytes = FixedBytes.deserialize(deserializer, length);\n return new EntryFunctionBytes(fixedBytes.value);\n }\n}\n"],"mappings":";;;;;;;;AAoBO,IAAM,qBAAN,MAAM,4BAA2B,aAA8C;AAAA,EAG5E,YAAY,OAAiB;AACnC,UAAM;AACN,SAAK,QAAQ,IAAI,WAAW,KAAK;AAAA,EACnC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,UAAU,YAA8B;AACtC,eAAW,UAAU,KAAK,KAAK;AAAA,EACjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,0BAA0B,YAA8B;AACtD,eAAW,sBAAsB,KAAK,MAAM,MAAM,MAAM;AACxD,eAAW,UAAU,IAAI;AAAA,EAC3B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,OAAO,YAAY,cAA4B,QAAoC;AACjF,UAAM,aAAa,WAAW,YAAY,cAAc,MAAM;AAC9D,WAAO,IAAI,oBAAmB,WAAW,KAAK;AAAA,EAChD;AACF;","names":[]}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// src/core/crypto/hdKey.ts
|
|
2
|
+
import { hmac } from "@noble/hashes/hmac";
|
|
3
|
+
import { sha512 } from "@noble/hashes/sha512";
|
|
4
|
+
import * as bip39 from "@scure/bip39";
|
|
5
|
+
var APTOS_HARDENED_REGEX = /^m\/44'\/637'\/[0-9]+'\/[0-9]+'\/[0-9]+'?$/;
|
|
6
|
+
var APTOS_BIP44_REGEX = /^m\/44'\/637'\/[0-9]+'\/[0-9]+\/[0-9]+$/;
|
|
7
|
+
var KeyType = /* @__PURE__ */ ((KeyType2) => {
|
|
8
|
+
KeyType2["ED25519"] = "ed25519 seed";
|
|
9
|
+
return KeyType2;
|
|
10
|
+
})(KeyType || {});
|
|
11
|
+
var HARDENED_OFFSET = 2147483648;
|
|
12
|
+
function isValidBIP44Path(path) {
|
|
13
|
+
return APTOS_BIP44_REGEX.test(path);
|
|
14
|
+
}
|
|
15
|
+
function isValidHardenedPath(path) {
|
|
16
|
+
return APTOS_HARDENED_REGEX.test(path);
|
|
17
|
+
}
|
|
18
|
+
var deriveKey = (hashSeed, data) => {
|
|
19
|
+
const digest = hmac.create(sha512, hashSeed).update(data).digest();
|
|
20
|
+
return {
|
|
21
|
+
key: digest.slice(0, 32),
|
|
22
|
+
chainCode: digest.slice(32)
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
var CKDPriv = ({ key, chainCode }, index) => {
|
|
26
|
+
const buffer = new ArrayBuffer(4);
|
|
27
|
+
new DataView(buffer).setUint32(0, index);
|
|
28
|
+
const indexBytes = new Uint8Array(buffer);
|
|
29
|
+
const zero = new Uint8Array([0]);
|
|
30
|
+
const data = new Uint8Array([...zero, ...key, ...indexBytes]);
|
|
31
|
+
return deriveKey(chainCode, data);
|
|
32
|
+
};
|
|
33
|
+
var removeApostrophes = (val) => val.replace("'", "");
|
|
34
|
+
var splitPath = (path) => path.split("/").slice(1).map(removeApostrophes);
|
|
35
|
+
var mnemonicToSeed = (mnemonic) => {
|
|
36
|
+
const normalizedMnemonic = mnemonic.trim().split(/\s+/).map((part) => part.toLowerCase()).join(" ");
|
|
37
|
+
return bip39.mnemonicToSeedSync(normalizedMnemonic);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export {
|
|
41
|
+
APTOS_HARDENED_REGEX,
|
|
42
|
+
APTOS_BIP44_REGEX,
|
|
43
|
+
KeyType,
|
|
44
|
+
HARDENED_OFFSET,
|
|
45
|
+
isValidBIP44Path,
|
|
46
|
+
isValidHardenedPath,
|
|
47
|
+
deriveKey,
|
|
48
|
+
CKDPriv,
|
|
49
|
+
splitPath,
|
|
50
|
+
mnemonicToSeed
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=chunk-PU5AFUX3.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/crypto/hdKey.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { hmac } from \"@noble/hashes/hmac\";\nimport { sha512 } from \"@noble/hashes/sha512\";\nimport * as bip39 from \"@scure/bip39\";\n\nexport type DerivedKeys = {\n key: Uint8Array;\n chainCode: Uint8Array;\n};\n\n/**\n * Aptos derive path is 637\n */\nexport const APTOS_HARDENED_REGEX = /^m\\/44'\\/637'\\/[0-9]+'\\/[0-9]+'\\/[0-9]+'?$/;\nexport const APTOS_BIP44_REGEX = /^m\\/44'\\/637'\\/[0-9]+'\\/[0-9]+\\/[0-9]+$/;\n\n/**\n * A list of supported key types and associated seeds\n */\nexport enum KeyType {\n ED25519 = \"ed25519 seed\",\n}\n\nexport const HARDENED_OFFSET = 0x80000000;\n\n/**\n * Aptos derive path is 637\n *\n * Parse and validate a path that is compliant to BIP-44 in form m/44'/637'/{account_index}'/{change_index}/{address_index}\n * for Secp256k1\n *\n * Note that for secp256k1, last two components must be non-hardened.\n *\n * @param path path string (e.g. `m/44'/637'/0'/0/0`).\n */\nexport function isValidBIP44Path(path: string): boolean {\n return APTOS_BIP44_REGEX.test(path);\n}\n\n/**\n * Aptos derive path is 637\n *\n * Parse and validate a path that is compliant to SLIP-0010 and BIP-44\n * in form m/44'/637'/{account_index}'/{change_index}'/{address_index}'.\n * See SLIP-0010 {@link https://github.com/satoshilabs/slips/blob/master/slip-0044.md}\n * See BIP-44 {@link https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki}\n *\n * Note that for Ed25519, all components must be hardened.\n * This is because non-hardened [PK] derivation would not work due to Ed25519's lack of a key homomorphism.\n * Specifically, you cannot derive the PK associated with derivation path a/b/c given the PK of a/b.\n * This is because the PK in Ed25519 is, more or less, computed as 𝑔𝐻(𝑠𝑘),\n * with the hash function breaking the homomorphism.\n *\n * @param path path string (e.g. `m/44'/637'/0'/0'/0'`).\n */\nexport function isValidHardenedPath(path: string): boolean {\n return APTOS_HARDENED_REGEX.test(path);\n}\n\nexport const deriveKey = (hashSeed: Uint8Array | string, data: Uint8Array | string): DerivedKeys => {\n const digest = hmac.create(sha512, hashSeed).update(data).digest();\n return {\n key: digest.slice(0, 32),\n chainCode: digest.slice(32),\n };\n};\n\n/**\n * Derive a child key from the private key\n * @param key\n * @param chainCode\n * @param index\n * @constructor\n */\nexport const CKDPriv = ({ key, chainCode }: DerivedKeys, index: number): DerivedKeys => {\n const buffer = new ArrayBuffer(4);\n new DataView(buffer).setUint32(0, index);\n const indexBytes = new Uint8Array(buffer);\n const zero = new Uint8Array([0]);\n const data = new Uint8Array([...zero, ...key, ...indexBytes]);\n return deriveKey(chainCode, data);\n};\n\nconst removeApostrophes = (val: string): string => val.replace(\"'\", \"\");\n\n/**\n * Splits derive path into segments\n * @param path\n */\nexport const splitPath = (path: string): Array<string> => path.split(\"/\").slice(1).map(removeApostrophes);\n\n/**\n * Normalizes the mnemonic by removing extra whitespace and making it lowercase\n * @param mnemonic the mnemonic seed phrase\n */\nexport const mnemonicToSeed = (mnemonic: string): Uint8Array => {\n const normalizedMnemonic = mnemonic\n .trim()\n .split(/\\s+/)\n .map((part) => part.toLowerCase())\n .join(\" \");\n return bip39.mnemonicToSeedSync(normalizedMnemonic);\n};\n"],"mappings":"AAGA,
|
|
1
|
+
{"version":3,"sources":["../../src/core/crypto/hdKey.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { hmac } from \"@noble/hashes/hmac\";\nimport { sha512 } from \"@noble/hashes/sha512\";\nimport * as bip39 from \"@scure/bip39\";\n\nexport type DerivedKeys = {\n key: Uint8Array;\n chainCode: Uint8Array;\n};\n\n/**\n * Aptos derive path is 637\n */\nexport const APTOS_HARDENED_REGEX = /^m\\/44'\\/637'\\/[0-9]+'\\/[0-9]+'\\/[0-9]+'?$/;\nexport const APTOS_BIP44_REGEX = /^m\\/44'\\/637'\\/[0-9]+'\\/[0-9]+\\/[0-9]+$/;\n\n/**\n * A list of supported key types and associated seeds\n */\nexport enum KeyType {\n ED25519 = \"ed25519 seed\",\n}\n\nexport const HARDENED_OFFSET = 0x80000000;\n\n/**\n * Aptos derive path is 637\n *\n * Parse and validate a path that is compliant to BIP-44 in form m/44'/637'/{account_index}'/{change_index}/{address_index}\n * for Secp256k1\n *\n * Note that for secp256k1, last two components must be non-hardened.\n *\n * @param path path string (e.g. `m/44'/637'/0'/0/0`).\n */\nexport function isValidBIP44Path(path: string): boolean {\n return APTOS_BIP44_REGEX.test(path);\n}\n\n/**\n * Aptos derive path is 637\n *\n * Parse and validate a path that is compliant to SLIP-0010 and BIP-44\n * in form m/44'/637'/{account_index}'/{change_index}'/{address_index}'.\n * See SLIP-0010 {@link https://github.com/satoshilabs/slips/blob/master/slip-0044.md}\n * See BIP-44 {@link https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki}\n *\n * Note that for Ed25519, all components must be hardened.\n * This is because non-hardened [PK] derivation would not work due to Ed25519's lack of a key homomorphism.\n * Specifically, you cannot derive the PK associated with derivation path a/b/c given the PK of a/b.\n * This is because the PK in Ed25519 is, more or less, computed as 𝑔𝐻(𝑠𝑘),\n * with the hash function breaking the homomorphism.\n *\n * @param path path string (e.g. `m/44'/637'/0'/0'/0'`).\n */\nexport function isValidHardenedPath(path: string): boolean {\n return APTOS_HARDENED_REGEX.test(path);\n}\n\nexport const deriveKey = (hashSeed: Uint8Array | string, data: Uint8Array | string): DerivedKeys => {\n const digest = hmac.create(sha512, hashSeed).update(data).digest();\n return {\n key: digest.slice(0, 32),\n chainCode: digest.slice(32),\n };\n};\n\n/**\n * Derive a child key from the private key\n * @param key\n * @param chainCode\n * @param index\n * @constructor\n */\nexport const CKDPriv = ({ key, chainCode }: DerivedKeys, index: number): DerivedKeys => {\n const buffer = new ArrayBuffer(4);\n new DataView(buffer).setUint32(0, index);\n const indexBytes = new Uint8Array(buffer);\n const zero = new Uint8Array([0]);\n const data = new Uint8Array([...zero, ...key, ...indexBytes]);\n return deriveKey(chainCode, data);\n};\n\nconst removeApostrophes = (val: string): string => val.replace(\"'\", \"\");\n\n/**\n * Splits derive path into segments\n * @param path\n */\nexport const splitPath = (path: string): Array<string> => path.split(\"/\").slice(1).map(removeApostrophes);\n\n/**\n * Normalizes the mnemonic by removing extra whitespace and making it lowercase\n * @param mnemonic the mnemonic seed phrase\n */\nexport const mnemonicToSeed = (mnemonic: string): Uint8Array => {\n const normalizedMnemonic = mnemonic\n .trim()\n .split(/\\s+/)\n .map((part) => part.toLowerCase())\n .join(\" \");\n return bip39.mnemonicToSeedSync(normalizedMnemonic);\n};\n"],"mappings":";AAGA,SAAS,YAAY;AACrB,SAAS,cAAc;AACvB,YAAY,WAAW;AAUhB,IAAM,uBAAuB;AAC7B,IAAM,oBAAoB;AAK1B,IAAK,UAAL,kBAAKA,aAAL;AACL,EAAAA,SAAA,aAAU;AADA,SAAAA;AAAA,GAAA;AAIL,IAAM,kBAAkB;AAYxB,SAAS,iBAAiB,MAAuB;AACtD,SAAO,kBAAkB,KAAK,IAAI;AACpC;AAkBO,SAAS,oBAAoB,MAAuB;AACzD,SAAO,qBAAqB,KAAK,IAAI;AACvC;AAEO,IAAM,YAAY,CAAC,UAA+B,SAA2C;AAClG,QAAM,SAAS,KAAK,OAAO,QAAQ,QAAQ,EAAE,OAAO,IAAI,EAAE,OAAO;AACjE,SAAO;AAAA,IACL,KAAK,OAAO,MAAM,GAAG,EAAE;AAAA,IACvB,WAAW,OAAO,MAAM,EAAE;AAAA,EAC5B;AACF;AASO,IAAM,UAAU,CAAC,EAAE,KAAK,UAAU,GAAgB,UAA+B;AACtF,QAAM,SAAS,IAAI,YAAY,CAAC;AAChC,MAAI,SAAS,MAAM,EAAE,UAAU,GAAG,KAAK;AACvC,QAAM,aAAa,IAAI,WAAW,MAAM;AACxC,QAAM,OAAO,IAAI,WAAW,CAAC,CAAC,CAAC;AAC/B,QAAM,OAAO,IAAI,WAAW,CAAC,GAAG,MAAM,GAAG,KAAK,GAAG,UAAU,CAAC;AAC5D,SAAO,UAAU,WAAW,IAAI;AAClC;AAEA,IAAM,oBAAoB,CAAC,QAAwB,IAAI,QAAQ,KAAK,EAAE;AAM/D,IAAM,YAAY,CAAC,SAAgC,KAAK,MAAM,GAAG,EAAE,MAAM,CAAC,EAAE,IAAI,iBAAiB;AAMjG,IAAM,iBAAiB,CAAC,aAAiC;AAC9D,QAAM,qBAAqB,SACxB,KAAK,EACL,MAAM,KAAK,EACX,IAAI,CAAC,SAAS,KAAK,YAAY,CAAC,EAChC,KAAK,GAAG;AACX,SAAa,yBAAmB,kBAAkB;AACpD;","names":["KeyType"]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AccountAddress
|
|
3
|
+
} from "./chunk-CMNJG4NN.mjs";
|
|
4
|
+
|
|
5
|
+
// src/core/account/utils/address.ts
|
|
6
|
+
import { sha3_256 } from "@noble/hashes/sha3";
|
|
7
|
+
var createObjectAddress = (creatorAddress, seed) => {
|
|
8
|
+
const creatorBytes = creatorAddress.bcsToBytes();
|
|
9
|
+
const seedBytes = typeof seed === "string" ? Buffer.from(seed, "utf8") : seed;
|
|
10
|
+
const bytes = new Uint8Array([...creatorBytes, ...seedBytes, 254 /* DeriveObjectAddressFromSeed */]);
|
|
11
|
+
return new AccountAddress(sha3_256(bytes));
|
|
12
|
+
};
|
|
13
|
+
var createResourceAddress = (creatorAddress, seed) => {
|
|
14
|
+
const creatorBytes = creatorAddress.bcsToBytes();
|
|
15
|
+
const seedBytes = typeof seed === "string" ? Buffer.from(seed, "utf8") : seed;
|
|
16
|
+
const bytes = new Uint8Array([...creatorBytes, ...seedBytes, 255 /* DeriveResourceAccountAddress */]);
|
|
17
|
+
return new AccountAddress(sha3_256(bytes));
|
|
18
|
+
};
|
|
19
|
+
var createTokenAddress = (creatorAddress, collectionName, tokenName) => {
|
|
20
|
+
const seed = `${collectionName}::${tokenName}`;
|
|
21
|
+
return createObjectAddress(creatorAddress, seed);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export {
|
|
25
|
+
createObjectAddress,
|
|
26
|
+
createResourceAddress,
|
|
27
|
+
createTokenAddress
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=chunk-PYLOAMR2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/account/utils/address.ts"],"sourcesContent":["import { sha3_256 } from \"@noble/hashes/sha3\";\nimport { AccountAddress } from \"../../accountAddress\";\nimport { DeriveScheme } from \"../../../types\";\n\n/**\n * Creates an object address from creator address and seed\n *\n * @param creatorAddress The object creator account address\n * @param seed The seed in either Uint8Array | string type\n *\n * @returns The object account address\n */\nexport const createObjectAddress = (creatorAddress: AccountAddress, seed: Uint8Array | string): AccountAddress => {\n const creatorBytes = creatorAddress.bcsToBytes();\n\n const seedBytes = typeof seed === \"string\" ? Buffer.from(seed, \"utf8\") : seed;\n\n const bytes = new Uint8Array([...creatorBytes, ...seedBytes, DeriveScheme.DeriveObjectAddressFromSeed]);\n\n return new AccountAddress(sha3_256(bytes));\n};\n\n/**\n * Creates an resource address from creator address and seed\n *\n * @param creatorAddress The creator account address\n * @param seed The seed in either Uint8Array | string type\n *\n * @returns The resource account address\n */\nexport const createResourceAddress = (creatorAddress: AccountAddress, seed: Uint8Array | string): AccountAddress => {\n const creatorBytes = creatorAddress.bcsToBytes();\n\n const seedBytes = typeof seed === \"string\" ? Buffer.from(seed, \"utf8\") : seed;\n\n const bytes = new Uint8Array([...creatorBytes, ...seedBytes, DeriveScheme.DeriveResourceAccountAddress]);\n\n return new AccountAddress(sha3_256(bytes));\n};\n\n/**\n * Creates a token object address from creator address, collection name and token name\n *\n * @param creatorAddress The token creator account address\n * @param collectionName The collection name\n * @param tokenName The token name\n *\n * @returns The token account address\n */\nexport const createTokenAddress = (\n creatorAddress: AccountAddress,\n collectionName: string,\n tokenName: string,\n): AccountAddress => {\n const seed = `${collectionName}::${tokenName}`;\n return createObjectAddress(creatorAddress, seed);\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/core/account/utils/address.ts"],"sourcesContent":["import { sha3_256 } from \"@noble/hashes/sha3\";\nimport { AccountAddress } from \"../../accountAddress\";\nimport { DeriveScheme } from \"../../../types\";\n\n/**\n * Creates an object address from creator address and seed\n *\n * @param creatorAddress The object creator account address\n * @param seed The seed in either Uint8Array | string type\n *\n * @returns The object account address\n */\nexport const createObjectAddress = (creatorAddress: AccountAddress, seed: Uint8Array | string): AccountAddress => {\n const creatorBytes = creatorAddress.bcsToBytes();\n\n const seedBytes = typeof seed === \"string\" ? Buffer.from(seed, \"utf8\") : seed;\n\n const bytes = new Uint8Array([...creatorBytes, ...seedBytes, DeriveScheme.DeriveObjectAddressFromSeed]);\n\n return new AccountAddress(sha3_256(bytes));\n};\n\n/**\n * Creates an resource address from creator address and seed\n *\n * @param creatorAddress The creator account address\n * @param seed The seed in either Uint8Array | string type\n *\n * @returns The resource account address\n */\nexport const createResourceAddress = (creatorAddress: AccountAddress, seed: Uint8Array | string): AccountAddress => {\n const creatorBytes = creatorAddress.bcsToBytes();\n\n const seedBytes = typeof seed === \"string\" ? Buffer.from(seed, \"utf8\") : seed;\n\n const bytes = new Uint8Array([...creatorBytes, ...seedBytes, DeriveScheme.DeriveResourceAccountAddress]);\n\n return new AccountAddress(sha3_256(bytes));\n};\n\n/**\n * Creates a token object address from creator address, collection name and token name\n *\n * @param creatorAddress The token creator account address\n * @param collectionName The collection name\n * @param tokenName The token name\n *\n * @returns The token account address\n */\nexport const createTokenAddress = (\n creatorAddress: AccountAddress,\n collectionName: string,\n tokenName: string,\n): AccountAddress => {\n const seed = `${collectionName}::${tokenName}`;\n return createObjectAddress(creatorAddress, seed);\n};\n"],"mappings":";;;;;AAAA,SAAS,gBAAgB;AAYlB,IAAM,sBAAsB,CAAC,gBAAgC,SAA8C;AAChH,QAAM,eAAe,eAAe,WAAW;AAE/C,QAAM,YAAY,OAAO,SAAS,WAAW,OAAO,KAAK,MAAM,MAAM,IAAI;AAEzE,QAAM,QAAQ,IAAI,WAAW,CAAC,GAAG,cAAc,GAAG,gDAAmD,CAAC;AAEtG,SAAO,IAAI,eAAe,SAAS,KAAK,CAAC;AAC3C;AAUO,IAAM,wBAAwB,CAAC,gBAAgC,SAA8C;AAClH,QAAM,eAAe,eAAe,WAAW;AAE/C,QAAM,YAAY,OAAO,SAAS,WAAW,OAAO,KAAK,MAAM,MAAM,IAAI;AAEzE,QAAM,QAAQ,IAAI,WAAW,CAAC,GAAG,cAAc,GAAG,iDAAoD,CAAC;AAEvG,SAAO,IAAI,eAAe,SAAS,KAAK,CAAC;AAC3C;AAWO,IAAM,qBAAqB,CAChC,gBACA,gBACA,cACmB;AACnB,QAAM,OAAO,GAAG,cAAc,KAAK,SAAS;AAC5C,SAAO,oBAAoB,gBAAgB,IAAI;AACjD;","names":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Deserializer
|
|
3
|
+
} from "./chunk-7JRMOHBP.mjs";
|
|
4
|
+
|
|
5
|
+
// src/utils/normalizeBundle.ts
|
|
6
|
+
function normalizeBundle(cls, value) {
|
|
7
|
+
const serializedBytes = value.bcsToBytes();
|
|
8
|
+
const deserializer = new Deserializer(serializedBytes);
|
|
9
|
+
return cls.deserialize(deserializer);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export {
|
|
13
|
+
normalizeBundle
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=chunk-QBBTUC66.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/normalizeBundle.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Deserializer, Serializable } from \"../bcs\";\n\nexport type DeserializableClass<T extends Serializable> = {\n deserialize(deserializer: Deserializer): T;\n};\n\n/**\n * Utility function that serializes and deserialize an object back into the same bundle as the sdk.\n * This is a workaround to have the `instanceof` operator work when input objects come from a different\n * bundle.\n * @param cls The class of the object to normalize\n * @param value the instance to normalize\n */\nexport function normalizeBundle<T extends Serializable>(cls: DeserializableClass<T>, value: T) {\n const serializedBytes = value.bcsToBytes();\n const deserializer = new Deserializer(serializedBytes);\n return cls.deserialize(deserializer);\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/utils/normalizeBundle.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Deserializer, Serializable } from \"../bcs\";\n\nexport type DeserializableClass<T extends Serializable> = {\n deserialize(deserializer: Deserializer): T;\n};\n\n/**\n * Utility function that serializes and deserialize an object back into the same bundle as the sdk.\n * This is a workaround to have the `instanceof` operator work when input objects come from a different\n * bundle.\n * @param cls The class of the object to normalize\n * @param value the instance to normalize\n */\nexport function normalizeBundle<T extends Serializable>(cls: DeserializableClass<T>, value: T) {\n const serializedBytes = value.bcsToBytes();\n const deserializer = new Deserializer(serializedBytes);\n return cls.deserialize(deserializer);\n}\n"],"mappings":";;;;;AAgBO,SAAS,gBAAwC,KAA6B,OAAU;AAC7F,QAAM,kBAAkB,MAAM,WAAW;AACzC,QAAM,eAAe,IAAI,aAAa,eAAe;AACrD,SAAO,IAAI,YAAY,YAAY;AACrC;","names":[]}
|