@aptos-labs/ts-sdk 1.14.0-zeta.2 → 1.14.0-zeta.4
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/chunk-KSEUZTKY.js +2 -0
- package/dist/common/chunk-KSEUZTKY.js.map +1 -0
- package/dist/common/cli/index.js +1 -245
- package/dist/common/cli/index.js.map +1 -1
- package/dist/common/index.js +390 -11802
- package/dist/common/index.js.map +1 -1
- package/dist/esm/account/Account.mjs +1 -55
- package/dist/esm/account/Ed25519Account.mjs +1 -53
- package/dist/esm/account/EphemeralKeyPair.mjs +1 -36
- package/dist/esm/account/KeylessAccount.mjs +1 -56
- package/dist/esm/account/MultiKeyAccount.mjs +1 -55
- package/dist/esm/account/SingleKeyAccount.mjs +1 -53
- package/dist/esm/account/index.mjs +1 -76
- package/dist/esm/api/account.mjs +1 -76
- package/dist/esm/api/ans.mjs +1 -87
- package/dist/esm/api/aptos.mjs +1 -116
- package/dist/esm/api/aptosConfig.mjs +1 -9
- package/dist/esm/api/coin.mjs +1 -86
- package/dist/esm/api/digitalAsset.mjs +1 -87
- package/dist/esm/api/event.mjs +1 -54
- package/dist/esm/api/faucet.mjs +1 -53
- package/dist/esm/api/fungibleAsset.mjs +1 -87
- package/dist/esm/api/general.mjs +1 -84
- package/dist/esm/api/index.mjs +1 -120
- package/dist/esm/api/keyless.mjs +1 -70
- package/dist/esm/api/staking.mjs +1 -54
- package/dist/esm/api/transaction.mjs +1 -94
- package/dist/esm/api/transactionSubmission/build.mjs +1 -85
- package/dist/esm/api/transactionSubmission/helpers.mjs +1 -9
- package/dist/esm/api/transactionSubmission/management.mjs +1 -89
- package/dist/esm/api/transactionSubmission/sign.mjs +1 -109
- package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -1
- package/dist/esm/api/transactionSubmission/simulate.mjs +1 -86
- package/dist/esm/api/transactionSubmission/submit.mjs +1 -86
- package/dist/esm/api/utils.mjs +1 -34
- package/dist/esm/bcs/consts.mjs +1 -17
- package/dist/esm/bcs/deserializer.mjs +1 -8
- package/dist/esm/bcs/index.mjs +1 -57
- package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -12
- package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -11
- package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -25
- package/dist/esm/bcs/serializable/moveStructs.mjs +1 -18
- package/dist/esm/bcs/serializer.mjs +1 -18
- package/dist/esm/chunk-3COVJN6Z.mjs +2 -0
- package/dist/esm/{chunk-2JOCR2VL.mjs.map → chunk-3COVJN6Z.mjs.map} +1 -1
- package/dist/esm/chunk-3FVRXELT.mjs +2 -0
- package/dist/esm/{chunk-KK2BSALW.mjs.map → chunk-3FVRXELT.mjs.map} +1 -1
- package/dist/esm/chunk-3JPVQHOR.mjs +2 -0
- package/dist/esm/{chunk-GGMTQAQP.mjs.map → chunk-3JPVQHOR.mjs.map} +1 -1
- package/dist/esm/chunk-3VGX3TXH.mjs +2 -0
- package/dist/esm/{chunk-7FO3S6IZ.mjs.map → chunk-3VGX3TXH.mjs.map} +1 -1
- package/dist/esm/chunk-4D5QYFL7.mjs +2 -0
- package/dist/esm/{chunk-VZQXLVEP.mjs.map → chunk-4D5QYFL7.mjs.map} +1 -1
- package/dist/esm/chunk-4SZSI7QT.mjs +2 -0
- package/dist/esm/{chunk-2ZEGJU43.mjs.map → chunk-4SZSI7QT.mjs.map} +1 -1
- package/dist/esm/chunk-52ECIIIH.mjs +2 -0
- package/dist/esm/{chunk-U3IUCR2G.mjs.map → chunk-52ECIIIH.mjs.map} +1 -1
- package/dist/esm/chunk-53T2VRZA.mjs +2 -0
- package/dist/esm/{chunk-7IDBB4J4.mjs.map → chunk-53T2VRZA.mjs.map} +1 -1
- package/dist/esm/chunk-56CNRT2K.mjs +2 -0
- package/dist/esm/{chunk-SBB4YEPT.mjs.map → chunk-56CNRT2K.mjs.map} +1 -1
- package/dist/esm/chunk-56NB52W6.mjs +2 -0
- package/dist/esm/{chunk-VJP2VWMF.mjs.map → chunk-56NB52W6.mjs.map} +1 -1
- package/dist/esm/chunk-5JGWZSNG.mjs +2 -0
- package/dist/esm/{chunk-LYK4TQZO.mjs.map → chunk-5JGWZSNG.mjs.map} +1 -1
- package/dist/esm/chunk-6EMN3BOV.mjs +2 -0
- package/dist/esm/{chunk-SIJELMDP.mjs.map → chunk-6EMN3BOV.mjs.map} +1 -1
- package/dist/esm/chunk-6JT3CUFA.mjs +2 -0
- package/dist/esm/{chunk-ST4QXIMI.mjs.map → chunk-6JT3CUFA.mjs.map} +1 -1
- package/dist/esm/chunk-6KGDQGT2.mjs +2 -0
- package/dist/esm/{chunk-GBEVD2VM.mjs.map → chunk-6KGDQGT2.mjs.map} +1 -1
- package/dist/esm/chunk-6OETO7Q7.mjs +2 -0
- package/dist/esm/{chunk-UX5NSZEN.mjs.map → chunk-6OETO7Q7.mjs.map} +1 -1
- package/dist/esm/chunk-6RBUXB5I.mjs +2 -0
- package/dist/esm/{chunk-WK5ZSNE2.mjs.map → chunk-6RBUXB5I.mjs.map} +1 -1
- package/dist/esm/chunk-6YFCRKVC.mjs +2 -0
- package/dist/esm/{chunk-YYOPNUX5.mjs.map → chunk-6YFCRKVC.mjs.map} +1 -1
- package/dist/esm/chunk-7STYQ5ZE.mjs +2 -0
- package/dist/esm/{chunk-UEBBLQJ5.mjs.map → chunk-7STYQ5ZE.mjs.map} +1 -1
- package/dist/esm/chunk-7WJTKYRG.mjs +2 -0
- package/dist/esm/{chunk-2OQW7BMN.mjs.map → chunk-7WJTKYRG.mjs.map} +1 -1
- package/dist/esm/chunk-AFGTRMOR.mjs +2 -0
- package/dist/esm/{chunk-KMXSRHJ6.mjs.map → chunk-AFGTRMOR.mjs.map} +1 -1
- package/dist/esm/chunk-AH44UPM4.mjs +2 -0
- package/dist/esm/{chunk-EYHRMZPO.mjs.map → chunk-AH44UPM4.mjs.map} +1 -1
- package/dist/esm/chunk-AOCNYMMX.mjs +2 -0
- package/dist/esm/{chunk-YV7M4CFP.mjs.map → chunk-AOCNYMMX.mjs.map} +1 -1
- package/dist/esm/chunk-B3BLP5DP.mjs +2 -0
- package/dist/esm/{chunk-W76MGKZB.mjs.map → chunk-B3BLP5DP.mjs.map} +1 -1
- package/dist/esm/chunk-BTTXZYBD.mjs +2 -0
- package/dist/esm/{chunk-LI2QV6RU.mjs.map → chunk-BTTXZYBD.mjs.map} +1 -1
- package/dist/esm/chunk-C34M4T77.mjs +2 -0
- package/dist/esm/{chunk-UKU6A2W2.mjs.map → chunk-C34M4T77.mjs.map} +1 -1
- package/dist/esm/chunk-C3L4ETUF.mjs +2 -0
- package/dist/esm/{chunk-PIMQHG2J.mjs.map → chunk-C3L4ETUF.mjs.map} +1 -1
- package/dist/esm/chunk-CO53EOHE.mjs +2 -0
- package/dist/esm/{chunk-MZZLEY6O.mjs.map → chunk-CO53EOHE.mjs.map} +1 -1
- package/dist/esm/chunk-COW5IGYC.mjs +2 -0
- package/dist/esm/{chunk-FXKSE3ZP.mjs.map → chunk-COW5IGYC.mjs.map} +1 -1
- package/dist/esm/chunk-CPBGL37X.mjs +2 -0
- package/dist/esm/{chunk-D2BVBXWO.mjs.map → chunk-CPBGL37X.mjs.map} +1 -1
- package/dist/esm/chunk-CSP3V4UZ.mjs +2 -0
- package/dist/esm/{chunk-DGV7DYU4.mjs.map → chunk-CSP3V4UZ.mjs.map} +1 -1
- package/dist/esm/chunk-D4J3MCOI.mjs +2 -0
- package/dist/esm/{chunk-JV3GSIJW.mjs.map → chunk-D4J3MCOI.mjs.map} +1 -1
- package/dist/esm/chunk-EB7AI4B4.mjs +2 -0
- package/dist/esm/{chunk-AR7X6GWQ.mjs.map → chunk-EB7AI4B4.mjs.map} +1 -1
- package/dist/esm/chunk-EIXCAYQM.mjs +2 -0
- package/dist/esm/{chunk-O6PSHSN3.mjs.map → chunk-EIXCAYQM.mjs.map} +1 -1
- package/dist/esm/chunk-F3HH6U3Z.mjs +2 -0
- package/dist/esm/{chunk-IC56GQFJ.mjs.map → chunk-F3HH6U3Z.mjs.map} +1 -1
- package/dist/esm/chunk-FBPNHF54.mjs +2 -0
- package/dist/esm/{chunk-QMM2KL6C.mjs.map → chunk-FBPNHF54.mjs.map} +1 -1
- package/dist/esm/chunk-FHNW3DEN.mjs +2 -0
- package/dist/esm/{chunk-ATVFVXR6.mjs.map → chunk-FHNW3DEN.mjs.map} +1 -1
- package/dist/esm/chunk-FLYEALDB.mjs +2 -0
- package/dist/esm/{chunk-76TSTAU4.mjs.map → chunk-FLYEALDB.mjs.map} +1 -1
- package/dist/esm/chunk-FMBZNFEA.mjs +2 -0
- package/dist/esm/{chunk-ZAHJ7KXB.mjs.map → chunk-FMBZNFEA.mjs.map} +1 -1
- package/dist/esm/chunk-FVA2OPG4.mjs +2 -0
- package/dist/esm/chunk-GUO5GDBN.mjs +2 -0
- package/dist/esm/{chunk-HBNSRCZN.mjs.map → chunk-GUO5GDBN.mjs.map} +1 -1
- package/dist/esm/chunk-HGZGTBA4.mjs +2 -0
- package/dist/esm/{chunk-PYLOAMR2.mjs.map → chunk-HGZGTBA4.mjs.map} +1 -1
- package/dist/esm/chunk-HX5246EM.mjs +2 -0
- package/dist/esm/{chunk-JHDHNGJ3.mjs.map → chunk-HX5246EM.mjs.map} +1 -1
- package/dist/esm/chunk-HY5E66FY.mjs +2 -0
- package/dist/esm/{chunk-7FUHWL6A.mjs.map → chunk-HY5E66FY.mjs.map} +1 -1
- package/dist/esm/chunk-IBQWYF23.mjs +2 -0
- package/dist/esm/{chunk-WDRH2URB.mjs.map → chunk-IBQWYF23.mjs.map} +1 -1
- package/dist/esm/chunk-IWBLSSVA.mjs +2 -0
- package/dist/esm/{chunk-TBHU6ZW6.mjs.map → chunk-IWBLSSVA.mjs.map} +1 -1
- package/dist/esm/chunk-JJIANJE3.mjs +2 -0
- package/dist/esm/{chunk-GSVQ6EUD.mjs.map → chunk-JJIANJE3.mjs.map} +1 -1
- package/dist/esm/chunk-JM2B5E2I.mjs +2 -0
- package/dist/esm/{chunk-CX3NAVRD.mjs.map → chunk-JM2B5E2I.mjs.map} +1 -1
- package/dist/esm/chunk-JM544NRW.mjs +2 -0
- package/dist/esm/{chunk-7REUIYF4.mjs.map → chunk-JM544NRW.mjs.map} +1 -1
- package/dist/esm/chunk-JYUTX5G7.mjs +2 -0
- package/dist/esm/{chunk-LYMY63SO.mjs.map → chunk-JYUTX5G7.mjs.map} +1 -1
- package/dist/esm/chunk-K247GPES.mjs +2 -0
- package/dist/esm/{chunk-NYL77J4X.mjs.map → chunk-K247GPES.mjs.map} +1 -1
- package/dist/esm/chunk-KW2KIYJE.mjs +2 -0
- package/dist/esm/{chunk-BXMHDQHW.mjs.map → chunk-KW2KIYJE.mjs.map} +1 -1
- package/dist/esm/chunk-KYZCH7IK.mjs +2 -0
- package/dist/esm/{chunk-NXFO2W4G.mjs.map → chunk-KYZCH7IK.mjs.map} +1 -1
- package/dist/esm/chunk-L54P6EGN.mjs +2 -0
- package/dist/esm/{chunk-SS3NUM5L.mjs.map → chunk-L54P6EGN.mjs.map} +1 -1
- package/dist/esm/chunk-LDQ6JFEF.mjs +2 -0
- package/dist/esm/{chunk-N4WKFNQ6.mjs.map → chunk-LDQ6JFEF.mjs.map} +1 -1
- package/dist/esm/chunk-LR5YOJG2.mjs +2 -0
- package/dist/esm/{chunk-6LRQSBRH.mjs.map → chunk-LR5YOJG2.mjs.map} +1 -1
- package/dist/esm/chunk-LR65XHSF.mjs +2 -0
- package/dist/esm/{chunk-PU5AFUX3.mjs.map → chunk-LR65XHSF.mjs.map} +1 -1
- package/dist/esm/chunk-MC6O2XME.mjs +2 -0
- package/dist/esm/{chunk-RCQMWXEW.mjs.map → chunk-MC6O2XME.mjs.map} +1 -1
- package/dist/esm/chunk-MGOHPDX4.mjs +2 -0
- package/dist/esm/{chunk-2TJJWII2.mjs.map → chunk-MGOHPDX4.mjs.map} +1 -1
- package/dist/esm/chunk-MTLETLKV.mjs +2 -0
- package/dist/esm/{chunk-DIYZRGR6.mjs.map → chunk-MTLETLKV.mjs.map} +1 -1
- package/dist/esm/chunk-MWUJCP27.mjs +2 -0
- package/dist/esm/{chunk-6MSZMIFW.mjs.map → chunk-MWUJCP27.mjs.map} +1 -1
- package/dist/esm/chunk-N466X3S6.mjs +2 -0
- package/dist/esm/{chunk-WLTBF4DF.mjs.map → chunk-N466X3S6.mjs.map} +1 -1
- package/dist/esm/chunk-NC5HHEEM.mjs +2 -0
- package/dist/esm/{chunk-XANFAUBD.mjs.map → chunk-NC5HHEEM.mjs.map} +1 -1
- package/dist/esm/chunk-NNIHTVLA.mjs +2 -0
- package/dist/esm/{chunk-VPWUODU4.mjs.map → chunk-NNIHTVLA.mjs.map} +1 -1
- package/dist/esm/chunk-NT47KB7Y.mjs +2 -0
- package/dist/esm/{chunk-Y2LV3S5W.mjs.map → chunk-NT47KB7Y.mjs.map} +1 -1
- package/dist/esm/chunk-NWGBV3YO.mjs +2 -0
- package/dist/esm/{chunk-F2ZWA7B7.mjs.map → chunk-NWGBV3YO.mjs.map} +1 -1
- package/dist/esm/chunk-NWWXZ7EW.mjs +2 -0
- package/dist/esm/{chunk-B5S6DDUD.mjs.map → chunk-NWWXZ7EW.mjs.map} +1 -1
- package/dist/esm/chunk-NYTZPISE.mjs +2 -0
- package/dist/esm/{chunk-KVSQ57HU.mjs.map → chunk-NYTZPISE.mjs.map} +1 -1
- package/dist/esm/chunk-O6LITRY2.mjs +2 -0
- package/dist/esm/{chunk-CTJSZT5V.mjs.map → chunk-O6LITRY2.mjs.map} +1 -1
- package/dist/esm/chunk-OJFMOV2O.mjs +2 -0
- package/dist/esm/{chunk-TLNHRJB2.mjs.map → chunk-OJFMOV2O.mjs.map} +1 -1
- package/dist/esm/chunk-OMD4G3E6.mjs +2 -0
- package/dist/esm/{chunk-FF4JPDKD.mjs.map → chunk-OMD4G3E6.mjs.map} +1 -1
- package/dist/esm/chunk-PBDEW4TN.mjs +2 -0
- package/dist/esm/{chunk-IHNPN5CQ.mjs.map → chunk-PBDEW4TN.mjs.map} +1 -1
- package/dist/esm/chunk-PFFAQZHT.mjs +2 -0
- package/dist/esm/{chunk-DNPMS2OF.mjs.map → chunk-PFFAQZHT.mjs.map} +1 -1
- package/dist/esm/chunk-PTRUUJCS.mjs +2 -0
- package/dist/esm/{chunk-LLLQJWRZ.mjs.map → chunk-PTRUUJCS.mjs.map} +1 -1
- package/dist/esm/chunk-PYUU4OEL.mjs +2 -0
- package/dist/esm/{chunk-RX4VG2AT.mjs.map → chunk-PYUU4OEL.mjs.map} +1 -1
- package/dist/esm/chunk-QDJN5HCB.mjs +2 -0
- package/dist/esm/{chunk-CC4DQ6NH.mjs.map → chunk-QDJN5HCB.mjs.map} +1 -1
- package/dist/esm/chunk-QFMUMZXR.mjs +2 -0
- package/dist/esm/{chunk-ASF2VWOX.mjs.map → chunk-QFMUMZXR.mjs.map} +1 -1
- package/dist/esm/chunk-RJ4PSGZ4.mjs +2 -0
- package/dist/esm/{chunk-QFOG4LIN.mjs.map → chunk-RJ4PSGZ4.mjs.map} +1 -1
- package/dist/esm/chunk-RKHPXZM6.mjs +2 -0
- package/dist/esm/{chunk-PCLNX6FS.mjs.map → chunk-RKHPXZM6.mjs.map} +1 -1
- package/dist/esm/{chunk-4PJ5FYGQ.mjs → chunk-S4SEFF4K.mjs} +27 -302
- package/dist/esm/{chunk-4PJ5FYGQ.mjs.map → chunk-S4SEFF4K.mjs.map} +1 -1
- package/dist/esm/chunk-S4YEK4LM.mjs +2 -0
- package/dist/esm/{chunk-WVGO4D7K.mjs.map → chunk-S4YEK4LM.mjs.map} +1 -1
- package/dist/esm/chunk-STYDBDYL.mjs +2 -0
- package/dist/esm/{chunk-FDWJNY4U.mjs.map → chunk-STYDBDYL.mjs.map} +1 -1
- package/dist/esm/chunk-SXOQWGMT.mjs +2 -0
- package/dist/esm/{chunk-VDJBDX3A.mjs.map → chunk-SXOQWGMT.mjs.map} +1 -1
- package/dist/esm/chunk-T23OVRNF.mjs +2 -0
- package/dist/esm/{chunk-CMNJG4NN.mjs.map → chunk-T23OVRNF.mjs.map} +1 -1
- package/dist/esm/chunk-TBGRYIFW.mjs +2 -0
- package/dist/esm/{chunk-NW45SCPY.mjs.map → chunk-TBGRYIFW.mjs.map} +1 -1
- package/dist/esm/chunk-TICM455H.mjs +2 -0
- package/dist/esm/{chunk-ZMFKQUHL.mjs.map → chunk-TICM455H.mjs.map} +1 -1
- package/dist/esm/chunk-TJDC5PWD.mjs +2 -0
- package/dist/esm/{chunk-NMKCJNQM.mjs.map → chunk-TJDC5PWD.mjs.map} +1 -1
- package/dist/esm/chunk-TVRJ3M7B.mjs +2 -0
- package/dist/esm/{chunk-FQQW55X7.mjs.map → chunk-TVRJ3M7B.mjs.map} +1 -1
- package/dist/esm/chunk-U6Z4FNB7.mjs +2 -0
- package/dist/esm/{chunk-AC3OGAL6.mjs.map → chunk-U6Z4FNB7.mjs.map} +1 -1
- package/dist/esm/chunk-UAL7TX7O.mjs +2 -0
- package/dist/esm/{chunk-DVPQGCFT.mjs.map → chunk-UAL7TX7O.mjs.map} +1 -1
- package/dist/esm/chunk-UTXJOB3O.mjs +2 -0
- package/dist/esm/{chunk-QBBTUC66.mjs.map → chunk-UTXJOB3O.mjs.map} +1 -1
- package/dist/esm/chunk-VDMVO4R4.mjs +2 -0
- package/dist/esm/{chunk-4OYYOYSO.mjs.map → chunk-VDMVO4R4.mjs.map} +1 -1
- package/dist/esm/chunk-VT6XJSRO.mjs +2 -0
- package/dist/esm/{chunk-7JRMOHBP.mjs.map → chunk-VT6XJSRO.mjs.map} +1 -1
- package/dist/esm/chunk-VXZDDYG7.mjs +2 -0
- package/dist/esm/{chunk-55NODGHC.mjs.map → chunk-VXZDDYG7.mjs.map} +1 -1
- package/dist/esm/chunk-WOPMZAWX.mjs +2 -0
- package/dist/esm/{chunk-VKJQORON.mjs.map → chunk-WOPMZAWX.mjs.map} +1 -1
- package/dist/esm/chunk-XOTF6PQ7.mjs +2 -0
- package/dist/esm/{chunk-CXUGZXED.mjs.map → chunk-XOTF6PQ7.mjs.map} +1 -1
- package/dist/esm/chunk-YE5B2S5L.mjs +2 -0
- package/dist/esm/{chunk-NFJCQRVK.mjs.map → chunk-YE5B2S5L.mjs.map} +1 -1
- package/dist/esm/chunk-ZJDNONEP.mjs +2 -0
- package/dist/esm/{chunk-U7QBZ6PP.mjs.map → chunk-ZJDNONEP.mjs.map} +1 -1
- package/dist/esm/chunk-ZLLU4XK7.mjs +2 -0
- package/dist/esm/{chunk-WHBWEN6N.mjs.map → chunk-ZLLU4XK7.mjs.map} +1 -1
- package/dist/esm/chunk-ZNEBMSNC.mjs +2 -0
- package/dist/esm/{chunk-JL2JHVS4.mjs.map → chunk-ZNEBMSNC.mjs.map} +1 -1
- package/dist/esm/cli/index.mjs +1 -12
- package/dist/esm/cli/localNode.mjs +1 -8
- package/dist/esm/cli/move.mjs +1 -7
- package/dist/esm/client/core.mjs +1 -27
- package/dist/esm/client/get.mjs +1 -32
- package/dist/esm/client/index.mjs +1 -55
- package/dist/esm/client/post.mjs +1 -36
- package/dist/esm/client/types.mjs +1 -7
- package/dist/esm/core/account/index.mjs +1 -19
- package/dist/esm/core/account/utils/address.mjs +1 -18
- package/dist/esm/core/account/utils/index.mjs +1 -19
- package/dist/esm/core/accountAddress.mjs +1 -15
- package/dist/esm/core/authenticationKey.mjs +1 -14
- package/dist/esm/core/common.mjs +1 -7
- package/dist/esm/core/crypto/ed25519.mjs +1 -29
- package/dist/esm/core/crypto/ephemeral.mjs +1 -28
- package/dist/esm/core/crypto/hdKey.mjs +1 -25
- package/dist/esm/core/crypto/index.mjs +1 -124
- package/dist/esm/core/crypto/keyless.mjs +1 -55
- package/dist/esm/core/crypto/multiEd25519.mjs +1 -28
- package/dist/esm/core/crypto/multiKey.mjs +1 -34
- package/dist/esm/core/crypto/poseidon.mjs +1 -15
- package/dist/esm/core/crypto/privateKey.mjs +1 -1
- package/dist/esm/core/crypto/proof.mjs +1 -19
- package/dist/esm/core/crypto/publicKey.mjs +1 -21
- package/dist/esm/core/crypto/secp256k1.mjs +1 -27
- package/dist/esm/core/crypto/signature.mjs +1 -19
- package/dist/esm/core/crypto/singleKey.mjs +1 -33
- package/dist/esm/core/crypto/utils.mjs +1 -9
- package/dist/esm/core/hex.mjs +1 -10
- package/dist/esm/core/index.mjs +1 -141
- package/dist/esm/index.mjs +1 -635
- package/dist/esm/internal/account.mjs +1 -106
- package/dist/esm/internal/ans.mjs +1 -120
- package/dist/esm/internal/coin.mjs +1 -85
- package/dist/esm/internal/digitalAsset.mjs +1 -127
- package/dist/esm/internal/event.mjs +1 -55
- package/dist/esm/internal/faucet.mjs +1 -52
- package/dist/esm/internal/fungibleAsset.mjs +1 -91
- package/dist/esm/internal/general.mjs +1 -46
- package/dist/esm/internal/keyless.mjs +1 -73
- package/dist/esm/internal/staking.mjs +1 -53
- package/dist/esm/internal/transaction.mjs +1 -51
- package/dist/esm/internal/transactionSubmission.mjs +1 -102
- package/dist/esm/internal/view.mjs +1 -83
- package/dist/esm/transactions/authenticator/account.mjs +1 -44
- package/dist/esm/transactions/authenticator/index.mjs +1 -60
- package/dist/esm/transactions/authenticator/transaction.mjs +1 -48
- package/dist/esm/transactions/index.mjs +1 -284
- package/dist/esm/transactions/instances/chainId.mjs +1 -11
- package/dist/esm/transactions/instances/identifier.mjs +1 -11
- package/dist/esm/transactions/instances/index.mjs +1 -96
- package/dist/esm/transactions/instances/moduleId.mjs +1 -38
- package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -43
- package/dist/esm/transactions/instances/rawTransaction.mjs +1 -48
- package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -20
- package/dist/esm/transactions/instances/signedTransaction.mjs +1 -45
- package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -43
- package/dist/esm/transactions/instances/transactionArgument.mjs +1 -1
- package/dist/esm/transactions/instances/transactionPayload.mjs +1 -56
- package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -74
- package/dist/esm/transactions/management/asyncQueue.mjs +1 -9
- package/dist/esm/transactions/management/index.mjs +1 -95
- package/dist/esm/transactions/management/transactionWorker.mjs +1 -91
- package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -75
- package/dist/esm/transactions/transactionBuilder/index.mjs +1 -162
- package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -85
- package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -58
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -98
- package/dist/esm/transactions/typeTag/index.mjs +1 -74
- package/dist/esm/transactions/typeTag/parser.mjs +1 -43
- package/dist/esm/transactions/types.mjs +1 -1
- package/dist/esm/types/generated/queries.mjs +1 -57
- package/dist/esm/types/generated/types.mjs +1 -809
- package/dist/esm/types/generated/types.mjs.map +1 -1
- package/dist/esm/types/index.mjs +1 -68
- package/dist/esm/types/indexer.mjs +1 -1
- package/dist/esm/types/keyless.mjs +1 -9
- package/dist/esm/utils/apiEndpoints.mjs +1 -21
- package/dist/esm/utils/const.mjs +1 -21
- package/dist/esm/utils/helpers.mjs +1 -7
- package/dist/esm/utils/index.mjs +1 -56
- package/dist/esm/utils/memoize.mjs +1 -9
- package/dist/esm/utils/normalizeBundle.mjs +1 -19
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -7
- package/package.json +1 -1
- package/src/version.ts +1 -1
- package/dist/common/chunk-QRI7EC4T.js +0 -24
- package/dist/common/chunk-QRI7EC4T.js.map +0 -1
- package/dist/esm/chunk-2JOCR2VL.mjs +0 -32
- package/dist/esm/chunk-2OQW7BMN.mjs +0 -129
- package/dist/esm/chunk-2TJJWII2.mjs +0 -23
- package/dist/esm/chunk-2ZEGJU43.mjs +0 -252
- package/dist/esm/chunk-4OYYOYSO.mjs +0 -336
- package/dist/esm/chunk-55NODGHC.mjs +0 -135
- package/dist/esm/chunk-6LRQSBRH.mjs +0 -130
- package/dist/esm/chunk-6MSZMIFW.mjs +0 -23
- package/dist/esm/chunk-76TSTAU4.mjs +0 -120
- package/dist/esm/chunk-7FO3S6IZ.mjs +0 -324
- package/dist/esm/chunk-7FUHWL6A.mjs +0 -42
- package/dist/esm/chunk-7IDBB4J4.mjs +0 -33
- package/dist/esm/chunk-7JRMOHBP.mjs +0 -247
- package/dist/esm/chunk-7REUIYF4.mjs +0 -63
- package/dist/esm/chunk-AC3OGAL6.mjs +0 -87
- package/dist/esm/chunk-AR7X6GWQ.mjs +0 -356
- package/dist/esm/chunk-ASF2VWOX.mjs +0 -142
- package/dist/esm/chunk-ATVFVXR6.mjs +0 -43
- package/dist/esm/chunk-B5S6DDUD.mjs +0 -120
- package/dist/esm/chunk-BXMHDQHW.mjs +0 -512
- package/dist/esm/chunk-CC4DQ6NH.mjs +0 -19
- package/dist/esm/chunk-CMNJG4NN.mjs +0 -345
- package/dist/esm/chunk-CTJSZT5V.mjs +0 -87
- package/dist/esm/chunk-CX3NAVRD.mjs +0 -205
- package/dist/esm/chunk-CXUGZXED.mjs +0 -307
- package/dist/esm/chunk-D2BVBXWO.mjs +0 -7
- package/dist/esm/chunk-DGV7DYU4.mjs +0 -413
- package/dist/esm/chunk-DIYZRGR6.mjs +0 -242
- package/dist/esm/chunk-DNPMS2OF.mjs +0 -236
- package/dist/esm/chunk-DVPQGCFT.mjs +0 -74
- package/dist/esm/chunk-EYHRMZPO.mjs +0 -34
- package/dist/esm/chunk-F2ZWA7B7.mjs +0 -412
- package/dist/esm/chunk-FDWJNY4U.mjs +0 -22
- package/dist/esm/chunk-FF4JPDKD.mjs +0 -315
- package/dist/esm/chunk-FQQW55X7.mjs +0 -288
- package/dist/esm/chunk-FXKSE3ZP.mjs +0 -25
- package/dist/esm/chunk-GBEVD2VM.mjs +0 -99
- package/dist/esm/chunk-GGMTQAQP.mjs +0 -11
- package/dist/esm/chunk-GSVQ6EUD.mjs +0 -649
- package/dist/esm/chunk-HBNSRCZN.mjs +0 -100
- package/dist/esm/chunk-IC56GQFJ.mjs +0 -127
- package/dist/esm/chunk-IHNPN5CQ.mjs +0 -256
- package/dist/esm/chunk-JHDHNGJ3.mjs +0 -126
- package/dist/esm/chunk-JL2JHVS4.mjs +0 -49
- package/dist/esm/chunk-JV3GSIJW.mjs +0 -268
- package/dist/esm/chunk-KK2BSALW.mjs +0 -32
- package/dist/esm/chunk-KMXSRHJ6.mjs +0 -93
- package/dist/esm/chunk-KVSQ57HU.mjs +0 -45
- package/dist/esm/chunk-LI2QV6RU.mjs +0 -129
- package/dist/esm/chunk-LLLQJWRZ.mjs +0 -35
- package/dist/esm/chunk-LYK4TQZO.mjs +0 -70
- package/dist/esm/chunk-LYMY63SO.mjs +0 -124
- package/dist/esm/chunk-MZZLEY6O.mjs +0 -92
- package/dist/esm/chunk-N4WKFNQ6.mjs +0 -156
- package/dist/esm/chunk-NFJCQRVK.mjs +0 -37
- package/dist/esm/chunk-NMKCJNQM.mjs +0 -20
- package/dist/esm/chunk-NW45SCPY.mjs +0 -36
- package/dist/esm/chunk-NXFO2W4G.mjs +0 -84
- package/dist/esm/chunk-NYL77J4X.mjs +0 -97
- package/dist/esm/chunk-O6PSHSN3.mjs +0 -53
- package/dist/esm/chunk-OR7TEZ25.mjs +0 -16
- package/dist/esm/chunk-PCLNX6FS.mjs +0 -17
- package/dist/esm/chunk-PIMQHG2J.mjs +0 -49
- package/dist/esm/chunk-PU5AFUX3.mjs +0 -52
- package/dist/esm/chunk-PYLOAMR2.mjs +0 -29
- package/dist/esm/chunk-QBBTUC66.mjs +0 -15
- package/dist/esm/chunk-QFOG4LIN.mjs +0 -319
- package/dist/esm/chunk-QMM2KL6C.mjs +0 -12
- package/dist/esm/chunk-RCQMWXEW.mjs +0 -35
- package/dist/esm/chunk-RX4VG2AT.mjs +0 -314
- package/dist/esm/chunk-SBB4YEPT.mjs +0 -17
- package/dist/esm/chunk-SIJELMDP.mjs +0 -29
- package/dist/esm/chunk-SS3NUM5L.mjs +0 -94
- package/dist/esm/chunk-ST4QXIMI.mjs +0 -37
- package/dist/esm/chunk-TBHU6ZW6.mjs +0 -215
- package/dist/esm/chunk-TLNHRJB2.mjs +0 -155
- package/dist/esm/chunk-U3IUCR2G.mjs +0 -54
- package/dist/esm/chunk-U7QBZ6PP.mjs +0 -400
- package/dist/esm/chunk-UEBBLQJ5.mjs +0 -94
- package/dist/esm/chunk-UKU6A2W2.mjs +0 -232
- package/dist/esm/chunk-UX5NSZEN.mjs +0 -134
- package/dist/esm/chunk-VDJBDX3A.mjs +0 -79
- package/dist/esm/chunk-VJP2VWMF.mjs +0 -58
- package/dist/esm/chunk-VKJQORON.mjs +0 -93
- package/dist/esm/chunk-VPWUODU4.mjs +0 -51
- package/dist/esm/chunk-VZQXLVEP.mjs +0 -197
- package/dist/esm/chunk-W76MGKZB.mjs +0 -33
- package/dist/esm/chunk-WDRH2URB.mjs +0 -91
- package/dist/esm/chunk-WHBWEN6N.mjs +0 -206
- package/dist/esm/chunk-WK5ZSNE2.mjs +0 -173
- package/dist/esm/chunk-WLTBF4DF.mjs +0 -22
- package/dist/esm/chunk-WVGO4D7K.mjs +0 -254
- package/dist/esm/chunk-XANFAUBD.mjs +0 -44
- package/dist/esm/chunk-Y2LV3S5W.mjs +0 -410
- package/dist/esm/chunk-YV7M4CFP.mjs +0 -137
- package/dist/esm/chunk-YYOPNUX5.mjs +0 -41
- package/dist/esm/chunk-ZAHJ7KXB.mjs +0 -81
- package/dist/esm/chunk-ZMFKQUHL.mjs +0 -117
- /package/dist/esm/{chunk-OR7TEZ25.mjs.map → chunk-FVA2OPG4.mjs.map} +0 -0
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
KeylessPublicKey,
|
|
3
|
-
KeylessSignature
|
|
4
|
-
} from "./chunk-4OYYOYSO.mjs";
|
|
5
|
-
import {
|
|
6
|
-
Secp256k1PublicKey,
|
|
7
|
-
Secp256k1Signature
|
|
8
|
-
} from "./chunk-DIYZRGR6.mjs";
|
|
9
|
-
import {
|
|
10
|
-
Ed25519PublicKey,
|
|
11
|
-
Ed25519Signature
|
|
12
|
-
} from "./chunk-RX4VG2AT.mjs";
|
|
13
|
-
import {
|
|
14
|
-
Signature
|
|
15
|
-
} from "./chunk-FDWJNY4U.mjs";
|
|
16
|
-
import {
|
|
17
|
-
AccountPublicKey
|
|
18
|
-
} from "./chunk-FXKSE3ZP.mjs";
|
|
19
|
-
import {
|
|
20
|
-
AuthenticationKey
|
|
21
|
-
} from "./chunk-UEBBLQJ5.mjs";
|
|
22
|
-
|
|
23
|
-
// src/core/crypto/singleKey.ts
|
|
24
|
-
var AnyPublicKey = class _AnyPublicKey extends AccountPublicKey {
|
|
25
|
-
// region Constructors
|
|
26
|
-
constructor(publicKey) {
|
|
27
|
-
super();
|
|
28
|
-
this.publicKey = publicKey;
|
|
29
|
-
if (publicKey instanceof Ed25519PublicKey) {
|
|
30
|
-
this.variant = 0 /* Ed25519 */;
|
|
31
|
-
} else if (publicKey instanceof Secp256k1PublicKey) {
|
|
32
|
-
this.variant = 1 /* Secp256k1 */;
|
|
33
|
-
} else if (publicKey instanceof KeylessPublicKey) {
|
|
34
|
-
this.variant = 3 /* Keyless */;
|
|
35
|
-
} else {
|
|
36
|
-
throw new Error("Unsupported public key type");
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
// endregion
|
|
40
|
-
// region AccountPublicKey
|
|
41
|
-
verifySignature(args) {
|
|
42
|
-
const { message, signature } = args;
|
|
43
|
-
if (!(signature instanceof AnySignature)) {
|
|
44
|
-
return false;
|
|
45
|
-
}
|
|
46
|
-
return this.publicKey.verifySignature({
|
|
47
|
-
message,
|
|
48
|
-
signature: signature.signature
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
authKey() {
|
|
52
|
-
return AuthenticationKey.fromSchemeAndBytes({
|
|
53
|
-
scheme: 2 /* SingleKey */,
|
|
54
|
-
input: this.toUint8Array()
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
toUint8Array() {
|
|
58
|
-
return this.bcsToBytes();
|
|
59
|
-
}
|
|
60
|
-
// endregion
|
|
61
|
-
// region Serializable
|
|
62
|
-
serialize(serializer) {
|
|
63
|
-
serializer.serializeU32AsUleb128(this.variant);
|
|
64
|
-
this.publicKey.serialize(serializer);
|
|
65
|
-
}
|
|
66
|
-
static deserialize(deserializer) {
|
|
67
|
-
const variantIndex = deserializer.deserializeUleb128AsU32();
|
|
68
|
-
let publicKey;
|
|
69
|
-
switch (variantIndex) {
|
|
70
|
-
case 0 /* Ed25519 */:
|
|
71
|
-
publicKey = Ed25519PublicKey.deserialize(deserializer);
|
|
72
|
-
break;
|
|
73
|
-
case 1 /* Secp256k1 */:
|
|
74
|
-
publicKey = Secp256k1PublicKey.deserialize(deserializer);
|
|
75
|
-
break;
|
|
76
|
-
case 3 /* Keyless */:
|
|
77
|
-
publicKey = KeylessPublicKey.deserialize(deserializer);
|
|
78
|
-
break;
|
|
79
|
-
default:
|
|
80
|
-
throw new Error(`Unknown variant index for AnyPublicKey: ${variantIndex}`);
|
|
81
|
-
}
|
|
82
|
-
return new _AnyPublicKey(publicKey);
|
|
83
|
-
}
|
|
84
|
-
// endregion
|
|
85
|
-
/**
|
|
86
|
-
* @deprecated use `instanceof AnyPublicKey` instead.
|
|
87
|
-
*/
|
|
88
|
-
static isPublicKey(publicKey) {
|
|
89
|
-
return publicKey instanceof _AnyPublicKey;
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* @deprecated use `publicKey instanceof Ed25519PublicKey` instead.
|
|
93
|
-
*/
|
|
94
|
-
isEd25519() {
|
|
95
|
-
return this.publicKey instanceof Ed25519PublicKey;
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* @deprecated use `publicKey instanceof Secp256k1PublicKey` instead.
|
|
99
|
-
*/
|
|
100
|
-
isSecp256k1PublicKey() {
|
|
101
|
-
return this.publicKey instanceof Secp256k1PublicKey;
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
var AnySignature = class _AnySignature extends Signature {
|
|
105
|
-
// region Constructors
|
|
106
|
-
constructor(signature) {
|
|
107
|
-
super();
|
|
108
|
-
this.signature = signature;
|
|
109
|
-
if (signature instanceof Ed25519Signature) {
|
|
110
|
-
this.variant = 0 /* Ed25519 */;
|
|
111
|
-
} else if (signature instanceof Secp256k1Signature) {
|
|
112
|
-
this.variant = 1 /* Secp256k1 */;
|
|
113
|
-
} else if (signature instanceof KeylessSignature) {
|
|
114
|
-
this.variant = 3 /* Keyless */;
|
|
115
|
-
} else {
|
|
116
|
-
throw new Error("Unsupported signature type");
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
// endregion
|
|
120
|
-
// region AccountSignature
|
|
121
|
-
toUint8Array() {
|
|
122
|
-
return this.bcsToBytes();
|
|
123
|
-
}
|
|
124
|
-
// endregion
|
|
125
|
-
// region Serializable
|
|
126
|
-
serialize(serializer) {
|
|
127
|
-
serializer.serializeU32AsUleb128(this.variant);
|
|
128
|
-
this.signature.serialize(serializer);
|
|
129
|
-
}
|
|
130
|
-
static deserialize(deserializer) {
|
|
131
|
-
const variantIndex = deserializer.deserializeUleb128AsU32();
|
|
132
|
-
let signature;
|
|
133
|
-
switch (variantIndex) {
|
|
134
|
-
case 0 /* Ed25519 */:
|
|
135
|
-
signature = Ed25519Signature.deserialize(deserializer);
|
|
136
|
-
break;
|
|
137
|
-
case 1 /* Secp256k1 */:
|
|
138
|
-
signature = Secp256k1Signature.deserialize(deserializer);
|
|
139
|
-
break;
|
|
140
|
-
case 3 /* Keyless */:
|
|
141
|
-
signature = KeylessSignature.deserialize(deserializer);
|
|
142
|
-
break;
|
|
143
|
-
default:
|
|
144
|
-
throw new Error(`Unknown variant index for AnySignature: ${variantIndex}`);
|
|
145
|
-
}
|
|
146
|
-
return new _AnySignature(signature);
|
|
147
|
-
}
|
|
148
|
-
// endregion
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
export {
|
|
152
|
-
AnyPublicKey,
|
|
153
|
-
AnySignature
|
|
154
|
-
};
|
|
155
|
-
//# sourceMappingURL=chunk-TLNHRJB2.mjs.map
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
RawTransaction
|
|
3
|
-
} from "./chunk-2OQW7BMN.mjs";
|
|
4
|
-
import {
|
|
5
|
-
AccountAddress
|
|
6
|
-
} from "./chunk-CMNJG4NN.mjs";
|
|
7
|
-
import {
|
|
8
|
-
Serializable
|
|
9
|
-
} from "./chunk-FQQW55X7.mjs";
|
|
10
|
-
|
|
11
|
-
// src/transactions/instances/multiAgentTransaction.ts
|
|
12
|
-
var MultiAgentTransaction = class _MultiAgentTransaction extends Serializable {
|
|
13
|
-
/**
|
|
14
|
-
* SimpleTransaction represents a simple transaction type of a single signer that
|
|
15
|
-
* can be submitted to Aptos chain for execution.
|
|
16
|
-
*
|
|
17
|
-
* SimpleTransaction metadata contains the Raw Transaction and an optional
|
|
18
|
-
* sponsor Account Address to pay the gas fees.
|
|
19
|
-
*
|
|
20
|
-
* @param rawTransaction The Raw Tranasaction
|
|
21
|
-
* @param feePayerAddress The sponsor Account Address
|
|
22
|
-
*/
|
|
23
|
-
constructor(rawTransaction, secondarySignerAddresses, feePayerAddress) {
|
|
24
|
-
super();
|
|
25
|
-
this.rawTransaction = rawTransaction;
|
|
26
|
-
this.feePayerAddress = feePayerAddress;
|
|
27
|
-
this.secondarySignerAddresses = secondarySignerAddresses;
|
|
28
|
-
}
|
|
29
|
-
serialize(serializer) {
|
|
30
|
-
this.rawTransaction.serialize(serializer);
|
|
31
|
-
serializer.serializeVector(this.secondarySignerAddresses);
|
|
32
|
-
if (this.feePayerAddress === void 0) {
|
|
33
|
-
serializer.serializeBool(false);
|
|
34
|
-
} else {
|
|
35
|
-
serializer.serializeBool(true);
|
|
36
|
-
this.feePayerAddress.serialize(serializer);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
static deserialize(deserializer) {
|
|
40
|
-
const rawTransaction = RawTransaction.deserialize(deserializer);
|
|
41
|
-
const secondarySignerAddresses = deserializer.deserializeVector(AccountAddress);
|
|
42
|
-
const feepayerPresent = deserializer.deserializeBool();
|
|
43
|
-
let feePayerAddress;
|
|
44
|
-
if (feepayerPresent) {
|
|
45
|
-
feePayerAddress = AccountAddress.deserialize(deserializer);
|
|
46
|
-
}
|
|
47
|
-
return new _MultiAgentTransaction(rawTransaction, secondarySignerAddresses, feePayerAddress);
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export {
|
|
52
|
-
MultiAgentTransaction
|
|
53
|
-
};
|
|
54
|
-
//# sourceMappingURL=chunk-U3IUCR2G.mjs.map
|
|
@@ -1,400 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
convertArgument,
|
|
3
|
-
fetchEntryFunctionAbi,
|
|
4
|
-
fetchViewFunctionAbi,
|
|
5
|
-
standardizeTypeTags
|
|
6
|
-
} from "./chunk-CXUGZXED.mjs";
|
|
7
|
-
import {
|
|
8
|
-
getFunctionParts,
|
|
9
|
-
isScriptDataInput
|
|
10
|
-
} from "./chunk-ZMFKQUHL.mjs";
|
|
11
|
-
import {
|
|
12
|
-
getInfo
|
|
13
|
-
} from "./chunk-Y2LV3S5W.mjs";
|
|
14
|
-
import {
|
|
15
|
-
getGasPriceEstimation
|
|
16
|
-
} from "./chunk-TBHU6ZW6.mjs";
|
|
17
|
-
import {
|
|
18
|
-
memoizeAsync
|
|
19
|
-
} from "./chunk-EYHRMZPO.mjs";
|
|
20
|
-
import {
|
|
21
|
-
getLedgerInfo
|
|
22
|
-
} from "./chunk-LYMY63SO.mjs";
|
|
23
|
-
import {
|
|
24
|
-
normalizeBundle
|
|
25
|
-
} from "./chunk-QBBTUC66.mjs";
|
|
26
|
-
import {
|
|
27
|
-
NetworkToChainId
|
|
28
|
-
} from "./chunk-7REUIYF4.mjs";
|
|
29
|
-
import {
|
|
30
|
-
MultiAgentTransaction
|
|
31
|
-
} from "./chunk-U3IUCR2G.mjs";
|
|
32
|
-
import {
|
|
33
|
-
SignedTransaction
|
|
34
|
-
} from "./chunk-ATVFVXR6.mjs";
|
|
35
|
-
import {
|
|
36
|
-
SimpleTransaction
|
|
37
|
-
} from "./chunk-VPWUODU4.mjs";
|
|
38
|
-
import {
|
|
39
|
-
FeePayerRawTransaction,
|
|
40
|
-
MultiAgentRawTransaction,
|
|
41
|
-
RawTransaction
|
|
42
|
-
} from "./chunk-2OQW7BMN.mjs";
|
|
43
|
-
import {
|
|
44
|
-
EntryFunction,
|
|
45
|
-
MultiSig,
|
|
46
|
-
MultiSigTransactionPayload,
|
|
47
|
-
Script,
|
|
48
|
-
TransactionPayloadEntryFunction,
|
|
49
|
-
TransactionPayloadMultiSig,
|
|
50
|
-
TransactionPayloadScript
|
|
51
|
-
} from "./chunk-QFOG4LIN.mjs";
|
|
52
|
-
import {
|
|
53
|
-
TransactionAuthenticatorEd25519,
|
|
54
|
-
TransactionAuthenticatorFeePayer,
|
|
55
|
-
TransactionAuthenticatorMultiAgent,
|
|
56
|
-
TransactionAuthenticatorSingleSender
|
|
57
|
-
} from "./chunk-ASF2VWOX.mjs";
|
|
58
|
-
import {
|
|
59
|
-
AccountAuthenticator,
|
|
60
|
-
AccountAuthenticatorEd25519,
|
|
61
|
-
AccountAuthenticatorSingleKey
|
|
62
|
-
} from "./chunk-IC56GQFJ.mjs";
|
|
63
|
-
import {
|
|
64
|
-
ChainId
|
|
65
|
-
} from "./chunk-6MSZMIFW.mjs";
|
|
66
|
-
import {
|
|
67
|
-
DEFAULT_MAX_GAS_AMOUNT,
|
|
68
|
-
DEFAULT_TXN_EXP_SEC_FROM_NOW
|
|
69
|
-
} from "./chunk-NFJCQRVK.mjs";
|
|
70
|
-
import {
|
|
71
|
-
AnyPublicKey,
|
|
72
|
-
AnySignature
|
|
73
|
-
} from "./chunk-TLNHRJB2.mjs";
|
|
74
|
-
import {
|
|
75
|
-
Secp256k1PublicKey,
|
|
76
|
-
Secp256k1Signature
|
|
77
|
-
} from "./chunk-DIYZRGR6.mjs";
|
|
78
|
-
import {
|
|
79
|
-
Ed25519PublicKey,
|
|
80
|
-
Ed25519Signature
|
|
81
|
-
} from "./chunk-RX4VG2AT.mjs";
|
|
82
|
-
import {
|
|
83
|
-
AccountAddress
|
|
84
|
-
} from "./chunk-CMNJG4NN.mjs";
|
|
85
|
-
import {
|
|
86
|
-
Hex
|
|
87
|
-
} from "./chunk-YV7M4CFP.mjs";
|
|
88
|
-
|
|
89
|
-
// src/transactions/transactionBuilder/transactionBuilder.ts
|
|
90
|
-
import { sha3_256 as sha3Hash } from "@noble/hashes/sha3";
|
|
91
|
-
async function generateTransactionPayload(args) {
|
|
92
|
-
if (isScriptDataInput(args)) {
|
|
93
|
-
return generateTransactionPayloadScript(args);
|
|
94
|
-
}
|
|
95
|
-
const { moduleAddress, moduleName, functionName } = getFunctionParts(args.function);
|
|
96
|
-
const functionAbi = await fetchAbi({
|
|
97
|
-
key: "entry-function",
|
|
98
|
-
moduleAddress,
|
|
99
|
-
moduleName,
|
|
100
|
-
functionName,
|
|
101
|
-
aptosConfig: args.aptosConfig,
|
|
102
|
-
abi: args.abi,
|
|
103
|
-
fetch: fetchEntryFunctionAbi
|
|
104
|
-
});
|
|
105
|
-
return generateTransactionPayloadWithABI({ ...args, abi: functionAbi });
|
|
106
|
-
}
|
|
107
|
-
function generateTransactionPayloadWithABI(args) {
|
|
108
|
-
const functionAbi = args.abi;
|
|
109
|
-
const { moduleAddress, moduleName, functionName } = getFunctionParts(args.function);
|
|
110
|
-
const typeArguments = standardizeTypeTags(args.typeArguments);
|
|
111
|
-
if (typeArguments.length !== functionAbi.typeParameters.length) {
|
|
112
|
-
throw new Error(
|
|
113
|
-
`Type argument count mismatch, expected ${functionAbi.typeParameters.length}, received ${typeArguments.length}`
|
|
114
|
-
);
|
|
115
|
-
}
|
|
116
|
-
const functionArguments = args.functionArguments.map(
|
|
117
|
-
(arg, i) => convertArgument(args.function, functionAbi, arg, i, typeArguments)
|
|
118
|
-
);
|
|
119
|
-
if (functionArguments.length !== functionAbi.parameters.length) {
|
|
120
|
-
throw new Error(
|
|
121
|
-
// eslint-disable-next-line max-len
|
|
122
|
-
`Too few arguments for '${moduleAddress}::${moduleName}::${functionName}', expected ${functionAbi.parameters.length} but got ${functionArguments.length}`
|
|
123
|
-
);
|
|
124
|
-
}
|
|
125
|
-
const entryFunctionPayload = EntryFunction.build(
|
|
126
|
-
`${moduleAddress}::${moduleName}`,
|
|
127
|
-
functionName,
|
|
128
|
-
typeArguments,
|
|
129
|
-
functionArguments
|
|
130
|
-
);
|
|
131
|
-
if ("multisigAddress" in args) {
|
|
132
|
-
const multisigAddress = AccountAddress.from(args.multisigAddress);
|
|
133
|
-
return new TransactionPayloadMultiSig(
|
|
134
|
-
new MultiSig(multisigAddress, new MultiSigTransactionPayload(entryFunctionPayload))
|
|
135
|
-
);
|
|
136
|
-
}
|
|
137
|
-
return new TransactionPayloadEntryFunction(entryFunctionPayload);
|
|
138
|
-
}
|
|
139
|
-
async function generateViewFunctionPayload(args) {
|
|
140
|
-
const { moduleAddress, moduleName, functionName } = getFunctionParts(args.function);
|
|
141
|
-
const functionAbi = await fetchAbi({
|
|
142
|
-
key: "view-function",
|
|
143
|
-
moduleAddress,
|
|
144
|
-
moduleName,
|
|
145
|
-
functionName,
|
|
146
|
-
aptosConfig: args.aptosConfig,
|
|
147
|
-
abi: args.abi,
|
|
148
|
-
fetch: fetchViewFunctionAbi
|
|
149
|
-
});
|
|
150
|
-
return generateViewFunctionPayloadWithABI({ abi: functionAbi, ...args });
|
|
151
|
-
}
|
|
152
|
-
function generateViewFunctionPayloadWithABI(args) {
|
|
153
|
-
const functionAbi = args.abi;
|
|
154
|
-
const { moduleAddress, moduleName, functionName } = getFunctionParts(args.function);
|
|
155
|
-
const typeArguments = standardizeTypeTags(args.typeArguments);
|
|
156
|
-
if (typeArguments.length !== functionAbi.typeParameters.length) {
|
|
157
|
-
throw new Error(
|
|
158
|
-
`Type argument count mismatch, expected ${functionAbi.typeParameters.length}, received ${typeArguments.length}`
|
|
159
|
-
);
|
|
160
|
-
}
|
|
161
|
-
const functionArguments = args?.functionArguments?.map((arg, i) => convertArgument(args.function, functionAbi, arg, i, typeArguments)) ?? [];
|
|
162
|
-
if (functionArguments.length !== functionAbi.parameters.length) {
|
|
163
|
-
throw new Error(
|
|
164
|
-
// eslint-disable-next-line max-len
|
|
165
|
-
`Too few arguments for '${moduleAddress}::${moduleName}::${functionName}', expected ${functionAbi.parameters.length} but got ${functionArguments.length}`
|
|
166
|
-
);
|
|
167
|
-
}
|
|
168
|
-
return EntryFunction.build(`${moduleAddress}::${moduleName}`, functionName, typeArguments, functionArguments);
|
|
169
|
-
}
|
|
170
|
-
function generateTransactionPayloadScript(args) {
|
|
171
|
-
return new TransactionPayloadScript(
|
|
172
|
-
new Script(Hex.fromHexInput(args.bytecode).toUint8Array(), args.typeArguments ?? [], args.functionArguments)
|
|
173
|
-
);
|
|
174
|
-
}
|
|
175
|
-
async function generateRawTransaction(args) {
|
|
176
|
-
const { aptosConfig, sender, payload, options, feePayerAddress } = args;
|
|
177
|
-
const getChainId = async () => {
|
|
178
|
-
if (NetworkToChainId[aptosConfig.network]) {
|
|
179
|
-
return { chainId: NetworkToChainId[aptosConfig.network] };
|
|
180
|
-
}
|
|
181
|
-
const info = await getLedgerInfo({ aptosConfig });
|
|
182
|
-
return { chainId: info.chain_id };
|
|
183
|
-
};
|
|
184
|
-
const getGasUnitPrice = async () => {
|
|
185
|
-
if (options?.gasUnitPrice) {
|
|
186
|
-
return { gasEstimate: options.gasUnitPrice };
|
|
187
|
-
}
|
|
188
|
-
const estimation = await getGasPriceEstimation({ aptosConfig });
|
|
189
|
-
return { gasEstimate: estimation.gas_estimate };
|
|
190
|
-
};
|
|
191
|
-
const getSequenceNumberForAny = async () => {
|
|
192
|
-
const getSequenceNumber = async () => {
|
|
193
|
-
if (options?.accountSequenceNumber !== void 0) {
|
|
194
|
-
return options.accountSequenceNumber;
|
|
195
|
-
}
|
|
196
|
-
return (await getInfo({ aptosConfig, accountAddress: sender })).sequence_number;
|
|
197
|
-
};
|
|
198
|
-
if (feePayerAddress && AccountAddress.from(feePayerAddress).equals(AccountAddress.ZERO)) {
|
|
199
|
-
try {
|
|
200
|
-
return await getSequenceNumber();
|
|
201
|
-
} catch (e) {
|
|
202
|
-
return 0;
|
|
203
|
-
}
|
|
204
|
-
} else {
|
|
205
|
-
return getSequenceNumber();
|
|
206
|
-
}
|
|
207
|
-
};
|
|
208
|
-
const [{ chainId }, { gasEstimate }, sequenceNumber] = await Promise.all([
|
|
209
|
-
getChainId(),
|
|
210
|
-
getGasUnitPrice(),
|
|
211
|
-
getSequenceNumberForAny()
|
|
212
|
-
]);
|
|
213
|
-
const { maxGasAmount, gasUnitPrice, expireTimestamp } = {
|
|
214
|
-
maxGasAmount: options?.maxGasAmount ? BigInt(options.maxGasAmount) : BigInt(DEFAULT_MAX_GAS_AMOUNT),
|
|
215
|
-
gasUnitPrice: options?.gasUnitPrice ?? BigInt(gasEstimate),
|
|
216
|
-
expireTimestamp: options?.expireTimestamp ?? BigInt(Math.floor(Date.now() / 1e3) + DEFAULT_TXN_EXP_SEC_FROM_NOW)
|
|
217
|
-
};
|
|
218
|
-
return new RawTransaction(
|
|
219
|
-
AccountAddress.from(sender),
|
|
220
|
-
BigInt(sequenceNumber),
|
|
221
|
-
payload,
|
|
222
|
-
BigInt(maxGasAmount),
|
|
223
|
-
BigInt(gasUnitPrice),
|
|
224
|
-
BigInt(expireTimestamp),
|
|
225
|
-
new ChainId(chainId)
|
|
226
|
-
);
|
|
227
|
-
}
|
|
228
|
-
async function buildTransaction(args) {
|
|
229
|
-
const { aptosConfig, sender, payload, options, feePayerAddress } = args;
|
|
230
|
-
const rawTxn = await generateRawTransaction({
|
|
231
|
-
aptosConfig,
|
|
232
|
-
sender,
|
|
233
|
-
payload,
|
|
234
|
-
options,
|
|
235
|
-
feePayerAddress
|
|
236
|
-
});
|
|
237
|
-
if ("secondarySignerAddresses" in args) {
|
|
238
|
-
const signers = args.secondarySignerAddresses?.map((signer) => AccountAddress.from(signer)) ?? [];
|
|
239
|
-
return new MultiAgentTransaction(
|
|
240
|
-
rawTxn,
|
|
241
|
-
signers,
|
|
242
|
-
args.feePayerAddress ? AccountAddress.from(args.feePayerAddress) : void 0
|
|
243
|
-
);
|
|
244
|
-
}
|
|
245
|
-
return new SimpleTransaction(rawTxn, args.feePayerAddress ? AccountAddress.from(args.feePayerAddress) : void 0);
|
|
246
|
-
}
|
|
247
|
-
function generateSignedTransactionForSimulation(args) {
|
|
248
|
-
const { signerPublicKey, transaction, secondarySignersPublicKeys, feePayerPublicKey } = args;
|
|
249
|
-
const accountAuthenticator = getAuthenticatorForSimulation(signerPublicKey);
|
|
250
|
-
if (transaction.feePayerAddress) {
|
|
251
|
-
const transactionToSign = new FeePayerRawTransaction(
|
|
252
|
-
transaction.rawTransaction,
|
|
253
|
-
transaction.secondarySignerAddresses ?? [],
|
|
254
|
-
transaction.feePayerAddress
|
|
255
|
-
);
|
|
256
|
-
let secondaryAccountAuthenticators = [];
|
|
257
|
-
if (secondarySignersPublicKeys) {
|
|
258
|
-
secondaryAccountAuthenticators = secondarySignersPublicKeys.map(
|
|
259
|
-
(publicKey) => getAuthenticatorForSimulation(publicKey)
|
|
260
|
-
);
|
|
261
|
-
}
|
|
262
|
-
const feePayerAuthenticator = getAuthenticatorForSimulation(feePayerPublicKey);
|
|
263
|
-
const transactionAuthenticator2 = new TransactionAuthenticatorFeePayer(
|
|
264
|
-
accountAuthenticator,
|
|
265
|
-
transaction.secondarySignerAddresses ?? [],
|
|
266
|
-
secondaryAccountAuthenticators,
|
|
267
|
-
{
|
|
268
|
-
address: transaction.feePayerAddress,
|
|
269
|
-
authenticator: feePayerAuthenticator
|
|
270
|
-
}
|
|
271
|
-
);
|
|
272
|
-
return new SignedTransaction(transactionToSign.raw_txn, transactionAuthenticator2).bcsToBytes();
|
|
273
|
-
}
|
|
274
|
-
if (transaction.secondarySignerAddresses) {
|
|
275
|
-
const transactionToSign = new MultiAgentRawTransaction(
|
|
276
|
-
transaction.rawTransaction,
|
|
277
|
-
transaction.secondarySignerAddresses
|
|
278
|
-
);
|
|
279
|
-
let secondaryAccountAuthenticators = [];
|
|
280
|
-
secondaryAccountAuthenticators = secondarySignersPublicKeys.map(
|
|
281
|
-
(publicKey) => getAuthenticatorForSimulation(publicKey)
|
|
282
|
-
);
|
|
283
|
-
const transactionAuthenticator2 = new TransactionAuthenticatorMultiAgent(
|
|
284
|
-
accountAuthenticator,
|
|
285
|
-
transaction.secondarySignerAddresses,
|
|
286
|
-
secondaryAccountAuthenticators
|
|
287
|
-
);
|
|
288
|
-
return new SignedTransaction(transactionToSign.raw_txn, transactionAuthenticator2).bcsToBytes();
|
|
289
|
-
}
|
|
290
|
-
let transactionAuthenticator;
|
|
291
|
-
if (accountAuthenticator instanceof AccountAuthenticatorEd25519) {
|
|
292
|
-
transactionAuthenticator = new TransactionAuthenticatorEd25519(
|
|
293
|
-
accountAuthenticator.public_key,
|
|
294
|
-
accountAuthenticator.signature
|
|
295
|
-
);
|
|
296
|
-
} else if (accountAuthenticator instanceof AccountAuthenticatorSingleKey) {
|
|
297
|
-
transactionAuthenticator = new TransactionAuthenticatorSingleSender(accountAuthenticator);
|
|
298
|
-
} else {
|
|
299
|
-
throw new Error("Invalid public key");
|
|
300
|
-
}
|
|
301
|
-
return new SignedTransaction(transaction.rawTransaction, transactionAuthenticator).bcsToBytes();
|
|
302
|
-
}
|
|
303
|
-
function getAuthenticatorForSimulation(publicKey) {
|
|
304
|
-
if (publicKey instanceof AnyPublicKey) {
|
|
305
|
-
if (publicKey.publicKey instanceof Ed25519PublicKey) {
|
|
306
|
-
return new AccountAuthenticatorSingleKey(publicKey, new AnySignature(new Ed25519Signature(new Uint8Array(64))));
|
|
307
|
-
}
|
|
308
|
-
if (publicKey.publicKey instanceof Secp256k1PublicKey) {
|
|
309
|
-
return new AccountAuthenticatorSingleKey(publicKey, new AnySignature(new Secp256k1Signature(new Uint8Array(64))));
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
return new AccountAuthenticatorEd25519(
|
|
313
|
-
new Ed25519PublicKey(publicKey.toUint8Array()),
|
|
314
|
-
new Ed25519Signature(new Uint8Array(64))
|
|
315
|
-
);
|
|
316
|
-
}
|
|
317
|
-
function generateSignedTransaction(args) {
|
|
318
|
-
const { transaction, feePayerAuthenticator, additionalSignersAuthenticators } = args;
|
|
319
|
-
const senderAuthenticator = normalizeBundle(AccountAuthenticator, args.senderAuthenticator);
|
|
320
|
-
let txnAuthenticator;
|
|
321
|
-
if (transaction.feePayerAddress) {
|
|
322
|
-
if (!feePayerAuthenticator) {
|
|
323
|
-
throw new Error("Must provide a feePayerAuthenticator argument to generate a signed fee payer transaction");
|
|
324
|
-
}
|
|
325
|
-
txnAuthenticator = new TransactionAuthenticatorFeePayer(
|
|
326
|
-
senderAuthenticator,
|
|
327
|
-
transaction.secondarySignerAddresses ?? [],
|
|
328
|
-
additionalSignersAuthenticators ?? [],
|
|
329
|
-
{
|
|
330
|
-
address: transaction.feePayerAddress,
|
|
331
|
-
authenticator: feePayerAuthenticator
|
|
332
|
-
}
|
|
333
|
-
);
|
|
334
|
-
} else if (transaction.secondarySignerAddresses) {
|
|
335
|
-
if (!additionalSignersAuthenticators) {
|
|
336
|
-
throw new Error(
|
|
337
|
-
"Must provide a additionalSignersAuthenticators argument to generate a signed multi agent transaction"
|
|
338
|
-
);
|
|
339
|
-
}
|
|
340
|
-
txnAuthenticator = new TransactionAuthenticatorMultiAgent(
|
|
341
|
-
senderAuthenticator,
|
|
342
|
-
transaction.secondarySignerAddresses,
|
|
343
|
-
additionalSignersAuthenticators
|
|
344
|
-
);
|
|
345
|
-
} else if (senderAuthenticator instanceof AccountAuthenticatorEd25519) {
|
|
346
|
-
txnAuthenticator = new TransactionAuthenticatorEd25519(
|
|
347
|
-
senderAuthenticator.public_key,
|
|
348
|
-
senderAuthenticator.signature
|
|
349
|
-
);
|
|
350
|
-
} else {
|
|
351
|
-
txnAuthenticator = new TransactionAuthenticatorSingleSender(senderAuthenticator);
|
|
352
|
-
}
|
|
353
|
-
return new SignedTransaction(transaction.rawTransaction, txnAuthenticator).bcsToBytes();
|
|
354
|
-
}
|
|
355
|
-
function hashValues(input) {
|
|
356
|
-
const hash = sha3Hash.create();
|
|
357
|
-
for (const item of input) {
|
|
358
|
-
hash.update(item);
|
|
359
|
-
}
|
|
360
|
-
return hash.digest();
|
|
361
|
-
}
|
|
362
|
-
var TRANSACTION_PREFIX = hashValues(["APTOS::Transaction"]);
|
|
363
|
-
function generateUserTransactionHash(args) {
|
|
364
|
-
const signedTransaction = generateSignedTransaction(args);
|
|
365
|
-
return new Hex(hashValues([TRANSACTION_PREFIX, new Uint8Array([0]), signedTransaction])).toString();
|
|
366
|
-
}
|
|
367
|
-
async function fetchAbi({
|
|
368
|
-
key,
|
|
369
|
-
moduleAddress,
|
|
370
|
-
moduleName,
|
|
371
|
-
functionName,
|
|
372
|
-
aptosConfig,
|
|
373
|
-
abi,
|
|
374
|
-
fetch
|
|
375
|
-
}) {
|
|
376
|
-
if (abi !== void 0) {
|
|
377
|
-
return abi;
|
|
378
|
-
}
|
|
379
|
-
return memoizeAsync(
|
|
380
|
-
async () => fetch(moduleAddress, moduleName, functionName, aptosConfig),
|
|
381
|
-
`${key}-${aptosConfig.network}-${moduleAddress}-${moduleName}-${functionName}`,
|
|
382
|
-
1e3 * 60 * 5
|
|
383
|
-
// 5 minutes
|
|
384
|
-
)();
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
export {
|
|
388
|
-
generateTransactionPayload,
|
|
389
|
-
generateTransactionPayloadWithABI,
|
|
390
|
-
generateViewFunctionPayload,
|
|
391
|
-
generateViewFunctionPayloadWithABI,
|
|
392
|
-
generateRawTransaction,
|
|
393
|
-
buildTransaction,
|
|
394
|
-
generateSignedTransactionForSimulation,
|
|
395
|
-
getAuthenticatorForSimulation,
|
|
396
|
-
generateSignedTransaction,
|
|
397
|
-
hashValues,
|
|
398
|
-
generateUserTransactionHash
|
|
399
|
-
};
|
|
400
|
-
//# sourceMappingURL=chunk-U7QBZ6PP.mjs.map
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AccountAddress
|
|
3
|
-
} from "./chunk-CMNJG4NN.mjs";
|
|
4
|
-
import {
|
|
5
|
-
Serializable
|
|
6
|
-
} from "./chunk-FQQW55X7.mjs";
|
|
7
|
-
import {
|
|
8
|
-
Hex
|
|
9
|
-
} from "./chunk-YV7M4CFP.mjs";
|
|
10
|
-
|
|
11
|
-
// src/core/authenticationKey.ts
|
|
12
|
-
import { sha3_256 as sha3Hash } from "@noble/hashes/sha3";
|
|
13
|
-
var _AuthenticationKey = class _AuthenticationKey extends Serializable {
|
|
14
|
-
constructor(args) {
|
|
15
|
-
super();
|
|
16
|
-
const { data } = args;
|
|
17
|
-
const hex = Hex.fromHexInput(data);
|
|
18
|
-
if (hex.toUint8Array().length !== _AuthenticationKey.LENGTH) {
|
|
19
|
-
throw new Error(`Authentication Key length should be ${_AuthenticationKey.LENGTH}`);
|
|
20
|
-
}
|
|
21
|
-
this.data = hex;
|
|
22
|
-
}
|
|
23
|
-
serialize(serializer) {
|
|
24
|
-
serializer.serializeFixedBytes(this.data.toUint8Array());
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Deserialize an AuthenticationKey from the byte buffer in a Deserializer instance.
|
|
28
|
-
* @param deserializer The deserializer to deserialize the AuthenticationKey from.
|
|
29
|
-
* @returns An instance of AuthenticationKey.
|
|
30
|
-
*/
|
|
31
|
-
static deserialize(deserializer) {
|
|
32
|
-
const bytes = deserializer.deserializeFixedBytes(_AuthenticationKey.LENGTH);
|
|
33
|
-
return new _AuthenticationKey({ data: bytes });
|
|
34
|
-
}
|
|
35
|
-
toString() {
|
|
36
|
-
return this.data.toString();
|
|
37
|
-
}
|
|
38
|
-
toUint8Array() {
|
|
39
|
-
return this.data.toUint8Array();
|
|
40
|
-
}
|
|
41
|
-
static fromSchemeAndBytes(args) {
|
|
42
|
-
const { scheme, input } = args;
|
|
43
|
-
const inputBytes = Hex.fromHexInput(input).toUint8Array();
|
|
44
|
-
const hashInput = new Uint8Array([...inputBytes, scheme]);
|
|
45
|
-
const hash = sha3Hash.create();
|
|
46
|
-
hash.update(hashInput);
|
|
47
|
-
const hashDigest = hash.digest();
|
|
48
|
-
return new _AuthenticationKey({ data: hashDigest });
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* @deprecated Use `fromPublicKey` instead
|
|
52
|
-
* Derives an AuthenticationKey from the public key seed bytes and an explicit derivation scheme.
|
|
53
|
-
*
|
|
54
|
-
* This facilitates targeting a specific scheme for deriving an authentication key from a public key.
|
|
55
|
-
*
|
|
56
|
-
* @param args - the public key and scheme to use for the derivation
|
|
57
|
-
*/
|
|
58
|
-
static fromPublicKeyAndScheme(args) {
|
|
59
|
-
const { publicKey } = args;
|
|
60
|
-
return publicKey.authKey();
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Converts a PublicKey(s) to an AuthenticationKey, using the derivation scheme inferred from the
|
|
64
|
-
* instance of the PublicKey type passed in.
|
|
65
|
-
*
|
|
66
|
-
* @param args.publicKey
|
|
67
|
-
* @returns AuthenticationKey
|
|
68
|
-
*/
|
|
69
|
-
static fromPublicKey(args) {
|
|
70
|
-
const { publicKey } = args;
|
|
71
|
-
return publicKey.authKey();
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Derives an account address from an AuthenticationKey. Since an AccountAddress is also 32 bytes,
|
|
75
|
-
* the AuthenticationKey bytes are directly translated to an AccountAddress.
|
|
76
|
-
*
|
|
77
|
-
* @returns AccountAddress
|
|
78
|
-
*/
|
|
79
|
-
derivedAddress() {
|
|
80
|
-
return new AccountAddress(this.data.toUint8Array());
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
/**
|
|
84
|
-
* An authentication key is always a SHA3-256 hash of data, and is always 32 bytes.
|
|
85
|
-
*
|
|
86
|
-
* The data to hash depends on the underlying public key type and the derivation scheme.
|
|
87
|
-
*/
|
|
88
|
-
_AuthenticationKey.LENGTH = 32;
|
|
89
|
-
var AuthenticationKey = _AuthenticationKey;
|
|
90
|
-
|
|
91
|
-
export {
|
|
92
|
-
AuthenticationKey
|
|
93
|
-
};
|
|
94
|
-
//# sourceMappingURL=chunk-UEBBLQJ5.mjs.map
|