@aptos-labs/ts-sdk 1.14.0-zeta.0 → 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-NPQwRmxn.d.ts → accountAddress-u9wEan9p.d.ts} +32 -4
- package/dist/common/chunk-QRI7EC4T.js +24 -0
- package/dist/common/chunk-QRI7EC4T.js.map +1 -0
- package/dist/common/cli/index.d.ts +1 -1
- package/dist/common/cli/index.js +245 -1
- package/dist/common/cli/index.js.map +1 -1
- package/dist/common/index.d.ts +290 -171
- package/dist/common/index.js +11786 -374
- package/dist/common/index.js.map +1 -1
- package/dist/esm/account/Account.mjs +55 -1
- package/dist/esm/account/Ed25519Account.mjs +53 -1
- package/dist/esm/account/EphemeralKeyPair.d.mts +38 -5
- package/dist/esm/account/EphemeralKeyPair.mjs +36 -1
- package/dist/esm/account/KeylessAccount.d.mts +75 -37
- package/dist/esm/account/KeylessAccount.mjs +56 -1
- package/dist/esm/account/MultiKeyAccount.d.mts +4 -0
- package/dist/esm/account/MultiKeyAccount.mjs +55 -1
- package/dist/esm/account/SingleKeyAccount.mjs +53 -1
- package/dist/esm/account/index.d.mts +2 -1
- package/dist/esm/account/index.mjs +76 -1
- package/dist/esm/api/account.mjs +76 -1
- package/dist/esm/api/ans.mjs +87 -1
- package/dist/esm/api/aptos.d.mts +1 -0
- package/dist/esm/api/aptos.mjs +116 -1
- package/dist/esm/api/aptosConfig.mjs +9 -1
- package/dist/esm/api/coin.mjs +86 -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.mjs +87 -1
- package/dist/esm/api/general.mjs +84 -1
- package/dist/esm/api/index.d.mts +1 -0
- package/dist/esm/api/index.mjs +120 -1
- package/dist/esm/api/keyless.d.mts +19 -5
- package/dist/esm/api/keyless.mjs +70 -1
- package/dist/esm/api/staking.mjs +54 -1
- package/dist/esm/api/transaction.mjs +94 -1
- package/dist/esm/api/transactionSubmission/build.mjs +85 -1
- package/dist/esm/api/transactionSubmission/helpers.mjs +9 -1
- package/dist/esm/api/transactionSubmission/management.mjs +89 -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.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.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-7WJTKYRG.mjs.map → chunk-2OQW7BMN.mjs.map} +1 -1
- package/dist/esm/chunk-2TJJWII2.mjs +23 -0
- package/dist/esm/{chunk-MGOHPDX4.mjs.map → chunk-2TJJWII2.mjs.map} +1 -1
- package/dist/esm/chunk-2ZEGJU43.mjs +252 -0
- package/dist/esm/{chunk-KWNBC5MF.mjs.map → chunk-2ZEGJU43.mjs.map} +1 -1
- 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-G4XSNSOT.mjs.map → chunk-55NODGHC.mjs.map} +1 -1
- package/dist/esm/chunk-6LRQSBRH.mjs +130 -0
- package/dist/esm/{chunk-C5UVSNZW.mjs.map → chunk-6LRQSBRH.mjs.map} +1 -1
- package/dist/esm/chunk-6MSZMIFW.mjs +23 -0
- package/dist/esm/{chunk-MWUJCP27.mjs.map → chunk-6MSZMIFW.mjs.map} +1 -1
- package/dist/esm/chunk-76TSTAU4.mjs +120 -0
- package/dist/esm/{chunk-FLYEALDB.mjs.map → chunk-76TSTAU4.mjs.map} +1 -1
- package/dist/esm/chunk-7FO3S6IZ.mjs +324 -0
- package/dist/esm/{chunk-3VGX3TXH.mjs.map → chunk-7FO3S6IZ.mjs.map} +1 -1
- package/dist/esm/chunk-7FUHWL6A.mjs +42 -0
- package/dist/esm/{chunk-SRPTQ4VV.mjs.map → chunk-7FUHWL6A.mjs.map} +1 -1
- package/dist/esm/chunk-7IDBB4J4.mjs +33 -0
- package/dist/esm/{chunk-PINF6ZWP.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-AC3OGAL6.mjs +87 -0
- package/dist/esm/{chunk-U6Z4FNB7.mjs.map → chunk-AC3OGAL6.mjs.map} +1 -1
- package/dist/esm/chunk-AR7X6GWQ.mjs +356 -0
- package/dist/esm/{chunk-EB7AI4B4.mjs.map → chunk-AR7X6GWQ.mjs.map} +1 -1
- package/dist/esm/chunk-ASF2VWOX.mjs +142 -0
- package/dist/esm/{chunk-O34EOOVF.mjs.map → chunk-ASF2VWOX.mjs.map} +1 -1
- package/dist/esm/chunk-ATVFVXR6.mjs +43 -0
- package/dist/esm/{chunk-IXYXFDJZ.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-DLTC6PJP.mjs.map → chunk-BXMHDQHW.mjs.map} +1 -1
- package/dist/esm/chunk-CC4DQ6NH.mjs +19 -0
- package/dist/esm/{chunk-H3TFQ7K4.mjs.map → chunk-CC4DQ6NH.mjs.map} +1 -1
- package/dist/esm/chunk-CMNJG4NN.mjs +345 -0
- package/dist/esm/{chunk-T23OVRNF.mjs.map → chunk-CMNJG4NN.mjs.map} +1 -1
- package/dist/esm/chunk-CTJSZT5V.mjs +87 -0
- package/dist/esm/{chunk-J7J7ZTBF.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-EKABTHUZ.mjs.map → chunk-CXUGZXED.mjs.map} +1 -1
- package/dist/esm/chunk-D2BVBXWO.mjs +7 -0
- package/dist/esm/{chunk-7PSX4LCV.mjs.map → chunk-D2BVBXWO.mjs.map} +1 -1
- package/dist/esm/chunk-DGV7DYU4.mjs +413 -0
- package/dist/esm/{chunk-7Q2NVO5M.mjs.map → chunk-DGV7DYU4.mjs.map} +1 -1
- package/dist/esm/chunk-DIYZRGR6.mjs +242 -0
- package/dist/esm/{chunk-UVOU6BW2.mjs.map → chunk-DIYZRGR6.mjs.map} +1 -1
- package/dist/esm/chunk-DNPMS2OF.mjs +236 -0
- package/dist/esm/{chunk-PFFAQZHT.mjs.map → chunk-DNPMS2OF.mjs.map} +1 -1
- package/dist/esm/chunk-DVPQGCFT.mjs +74 -0
- package/dist/esm/{chunk-RBPGL6YB.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-RTSEMQCK.mjs.map → chunk-F2ZWA7B7.mjs.map} +1 -1
- package/dist/esm/chunk-FDWJNY4U.mjs +22 -0
- package/dist/esm/{chunk-STYDBDYL.mjs.map → chunk-FDWJNY4U.mjs.map} +1 -1
- package/dist/esm/chunk-FF4JPDKD.mjs +315 -0
- package/dist/esm/{chunk-5DW2AJPI.mjs.map → chunk-FF4JPDKD.mjs.map} +1 -1
- package/dist/esm/chunk-FQQW55X7.mjs +288 -0
- package/dist/esm/{chunk-TVRJ3M7B.mjs.map → chunk-FQQW55X7.mjs.map} +1 -1
- package/dist/esm/chunk-FXKSE3ZP.mjs +25 -0
- package/dist/esm/{chunk-COW5IGYC.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-WOLIXKOK.mjs.map → chunk-GSVQ6EUD.mjs.map} +1 -1
- package/dist/esm/chunk-HBNSRCZN.mjs +100 -0
- package/dist/esm/{chunk-FKSACFCB.mjs.map → chunk-HBNSRCZN.mjs.map} +1 -1
- package/dist/esm/chunk-IC56GQFJ.mjs +127 -0
- package/dist/esm/{chunk-XN4SQWI5.mjs.map → chunk-IC56GQFJ.mjs.map} +1 -1
- 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-JVKMQ64G.mjs.map → chunk-JHDHNGJ3.mjs.map} +1 -1
- package/dist/esm/chunk-JL2JHVS4.mjs +49 -0
- package/dist/esm/{chunk-ZNEBMSNC.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-KK2BSALW.mjs +32 -0
- package/dist/esm/{chunk-3FVRXELT.mjs.map → chunk-KK2BSALW.mjs.map} +1 -1
- package/dist/esm/chunk-KMXSRHJ6.mjs +93 -0
- package/dist/esm/{chunk-NMECYE3D.mjs.map → chunk-KMXSRHJ6.mjs.map} +1 -1
- package/dist/esm/chunk-KVSQ57HU.mjs +45 -0
- package/dist/esm/{chunk-NNW6HWIO.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-QNHDS64I.mjs.map → chunk-LLLQJWRZ.mjs.map} +1 -1
- package/dist/esm/chunk-LYK4TQZO.mjs +70 -0
- package/dist/esm/{chunk-OZC3FCJP.mjs.map → chunk-LYK4TQZO.mjs.map} +1 -1
- package/dist/esm/chunk-LYMY63SO.mjs +124 -0
- package/dist/esm/{chunk-UGIJHLL3.mjs.map → chunk-LYMY63SO.mjs.map} +1 -1
- package/dist/esm/chunk-MZZLEY6O.mjs +92 -0
- package/dist/esm/{chunk-NKCZ4KGO.mjs.map → chunk-MZZLEY6O.mjs.map} +1 -1
- package/dist/esm/chunk-N4WKFNQ6.mjs +156 -0
- package/dist/esm/{chunk-LDQ6JFEF.mjs.map → chunk-N4WKFNQ6.mjs.map} +1 -1
- package/dist/esm/chunk-NFJCQRVK.mjs +37 -0
- package/dist/esm/{chunk-YE5B2S5L.mjs.map → chunk-NFJCQRVK.mjs.map} +1 -1
- 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-V7P6MLSY.mjs.map → chunk-NW45SCPY.mjs.map} +1 -1
- package/dist/esm/chunk-NXFO2W4G.mjs +84 -0
- package/dist/esm/{chunk-D22EMNIY.mjs.map → chunk-NXFO2W4G.mjs.map} +1 -1
- package/dist/esm/chunk-NYL77J4X.mjs +97 -0
- package/dist/esm/{chunk-43WARVT3.mjs.map → chunk-NYL77J4X.mjs.map} +1 -1
- package/dist/esm/chunk-O6PSHSN3.mjs +53 -0
- package/dist/esm/{chunk-6LOTZ4GY.mjs.map → chunk-O6PSHSN3.mjs.map} +1 -1
- package/dist/esm/chunk-OR7TEZ25.mjs +16 -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-C3L4ETUF.mjs.map → chunk-PIMQHG2J.mjs.map} +1 -1
- package/dist/esm/chunk-PU5AFUX3.mjs +52 -0
- package/dist/esm/chunk-PU5AFUX3.mjs.map +1 -0
- package/dist/esm/chunk-PYLOAMR2.mjs +29 -0
- package/dist/esm/{chunk-HGZGTBA4.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-RJ4PSGZ4.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-TXMPXZBG.mjs.map → chunk-RCQMWXEW.mjs.map} +1 -1
- package/dist/esm/chunk-RX4VG2AT.mjs +314 -0
- package/dist/esm/chunk-RX4VG2AT.mjs.map +1 -0
- 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-XMFPKHB5.mjs.map → chunk-ST4QXIMI.mjs.map} +1 -1
- package/dist/esm/chunk-TBHU6ZW6.mjs +215 -0
- package/dist/esm/{chunk-QHVZL3LZ.mjs.map → chunk-TBHU6ZW6.mjs.map} +1 -1
- package/dist/esm/chunk-TLNHRJB2.mjs +155 -0
- package/dist/esm/{chunk-H6LYW7HG.mjs.map → chunk-TLNHRJB2.mjs.map} +1 -1
- package/dist/esm/chunk-U3IUCR2G.mjs +54 -0
- package/dist/esm/{chunk-52ECIIIH.mjs.map → chunk-U3IUCR2G.mjs.map} +1 -1
- package/dist/esm/chunk-U7QBZ6PP.mjs +400 -0
- package/dist/esm/{chunk-ZM436N3W.mjs.map → chunk-U7QBZ6PP.mjs.map} +1 -1
- package/dist/esm/chunk-UEBBLQJ5.mjs +94 -0
- package/dist/esm/{chunk-7STYQ5ZE.mjs.map → chunk-UEBBLQJ5.mjs.map} +1 -1
- package/dist/esm/chunk-UKU6A2W2.mjs +232 -0
- package/dist/esm/{chunk-HXSW6X7K.mjs.map → chunk-UKU6A2W2.mjs.map} +1 -1
- package/dist/esm/chunk-UX5NSZEN.mjs +134 -0
- package/dist/esm/{chunk-WVIPPU2C.mjs.map → chunk-UX5NSZEN.mjs.map} +1 -1
- package/dist/esm/chunk-VDJBDX3A.mjs +79 -0
- package/dist/esm/{chunk-25N7RLBW.mjs.map → chunk-VDJBDX3A.mjs.map} +1 -1
- package/dist/esm/chunk-VJP2VWMF.mjs +58 -0
- package/dist/esm/{chunk-56NB52W6.mjs.map → chunk-VJP2VWMF.mjs.map} +1 -1
- package/dist/esm/chunk-VKJQORON.mjs +93 -0
- package/dist/esm/{chunk-3OELNIC6.mjs.map → chunk-VKJQORON.mjs.map} +1 -1
- package/dist/esm/chunk-VPWUODU4.mjs +51 -0
- package/dist/esm/{chunk-NNIHTVLA.mjs.map → chunk-VPWUODU4.mjs.map} +1 -1
- package/dist/esm/chunk-VZQXLVEP.mjs +197 -0
- package/dist/esm/{chunk-VJJN3GFD.mjs.map → chunk-VZQXLVEP.mjs.map} +1 -1
- package/dist/esm/chunk-W76MGKZB.mjs +33 -0
- package/dist/esm/{chunk-CLVAGDXO.mjs.map → chunk-W76MGKZB.mjs.map} +1 -1
- package/dist/esm/chunk-WDRH2URB.mjs +91 -0
- package/dist/esm/{chunk-65UZZNN2.mjs.map → chunk-WDRH2URB.mjs.map} +1 -1
- package/dist/esm/chunk-WHBWEN6N.mjs +206 -0
- package/dist/esm/{chunk-NGNETNK2.mjs.map → chunk-WHBWEN6N.mjs.map} +1 -1
- package/dist/esm/chunk-WK5ZSNE2.mjs +173 -0
- package/dist/esm/{chunk-6RBUXB5I.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-OLGSIKFB.mjs.map → chunk-WVGO4D7K.mjs.map} +1 -1
- package/dist/esm/chunk-XANFAUBD.mjs +44 -0
- package/dist/esm/{chunk-NC5HHEEM.mjs.map → chunk-XANFAUBD.mjs.map} +1 -1
- package/dist/esm/chunk-Y2LV3S5W.mjs +410 -0
- package/dist/esm/{chunk-6SHLLRJA.mjs.map → chunk-Y2LV3S5W.mjs.map} +1 -1
- 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-Z5KKUXYI.mjs.map → chunk-ZAHJ7KXB.mjs.map} +1 -1
- package/dist/esm/chunk-ZMFKQUHL.mjs +117 -0
- package/dist/esm/{chunk-TICM455H.mjs.map → chunk-ZMFKQUHL.mjs.map} +1 -1
- package/dist/esm/cli/index.mjs +12 -1
- package/dist/esm/cli/localNode.mjs +8 -1
- package/dist/esm/cli/move.mjs +7 -1
- package/dist/esm/client/core.mjs +27 -1
- package/dist/esm/client/get.mjs +32 -1
- package/dist/esm/client/index.mjs +55 -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.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.d.mts +10 -0
- package/dist/esm/core/crypto/ed25519.mjs +29 -1
- package/dist/esm/core/crypto/ephemeral.d.mts +16 -20
- package/dist/esm/core/crypto/ephemeral.mjs +28 -1
- package/dist/esm/core/crypto/hdKey.d.mts +1 -15
- package/dist/esm/core/crypto/hdKey.mjs +25 -1
- package/dist/esm/core/crypto/index.d.mts +3 -2
- package/dist/esm/core/crypto/index.mjs +124 -1
- package/dist/esm/core/crypto/keyless.d.mts +121 -106
- package/dist/esm/core/crypto/keyless.mjs +55 -1
- package/dist/esm/core/crypto/multiEd25519.mjs +28 -1
- package/dist/esm/core/crypto/multiKey.mjs +34 -1
- package/dist/esm/core/crypto/poseidon.mjs +15 -1
- 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 +3 -2
- package/dist/esm/core/index.mjs +141 -1
- package/dist/esm/index.d.mts +5 -4
- package/dist/esm/index.mjs +635 -1
- package/dist/esm/internal/account.mjs +106 -1
- package/dist/esm/internal/ans.mjs +120 -1
- package/dist/esm/internal/coin.mjs +85 -1
- package/dist/esm/internal/digitalAsset.mjs +127 -1
- package/dist/esm/internal/event.mjs +55 -1
- package/dist/esm/internal/faucet.mjs +52 -1
- package/dist/esm/internal/fungibleAsset.mjs +91 -1
- package/dist/esm/internal/general.mjs +46 -1
- package/dist/esm/internal/keyless.d.mts +4 -3
- package/dist/esm/internal/keyless.mjs +73 -1
- package/dist/esm/internal/staking.mjs +53 -1
- package/dist/esm/internal/transaction.mjs +51 -1
- package/dist/esm/internal/transactionSubmission.mjs +102 -1
- package/dist/esm/internal/view.mjs +83 -1
- 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.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.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.mjs +56 -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.mjs +95 -1
- package/dist/esm/transactions/management/transactionWorker.mjs +91 -1
- package/dist/esm/transactions/transactionBuilder/helpers.mjs +75 -1
- package/dist/esm/transactions/transactionBuilder/index.mjs +162 -1
- package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +85 -1
- package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +58 -1
- 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.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 +6 -4
- package/dist/esm/types/index.mjs +68 -1
- package/dist/esm/types/indexer.mjs +1 -1
- package/dist/esm/types/keyless.d.mts +54 -1
- package/dist/esm/types/keyless.mjs +9 -0
- package/dist/esm/utils/apiEndpoints.mjs +21 -1
- package/dist/esm/utils/const.mjs +21 -1
- package/dist/esm/utils/helpers.mjs +7 -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 +5 -2
- package/src/account/EphemeralKeyPair.ts +45 -7
- package/src/account/KeylessAccount.ts +152 -113
- package/src/account/MultiKeyAccount.ts +4 -0
- package/src/api/keyless.ts +17 -4
- package/src/bcs/deserializer.ts +40 -0
- package/src/client/core.ts +1 -1
- package/src/client/types.ts +1 -1
- package/src/core/account/index.ts +0 -1
- package/src/core/crypto/ed25519.ts +24 -4
- package/src/core/crypto/ephemeral.ts +17 -28
- package/src/core/crypto/hdKey.ts +0 -31
- package/src/core/crypto/keyless.ts +231 -286
- package/src/core/crypto/proof.ts +16 -0
- package/src/internal/keyless.ts +16 -15
- package/src/internal/transactionSubmission.ts +16 -6
- package/src/transactions/management/transactionWorker.ts +1 -7
- package/src/types/index.ts +5 -2
- package/src/types/keyless.ts +31 -0
- package/src/utils/apiEndpoints.ts +6 -6
- 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-25N7RLBW.mjs +0 -2
- package/dist/esm/chunk-32355KGV.mjs +0 -2
- package/dist/esm/chunk-32355KGV.mjs.map +0 -1
- package/dist/esm/chunk-3FVRXELT.mjs +0 -2
- package/dist/esm/chunk-3JPVQHOR.mjs +0 -2
- package/dist/esm/chunk-3OELNIC6.mjs +0 -2
- package/dist/esm/chunk-3U5VRZLS.mjs +0 -2
- package/dist/esm/chunk-3U5VRZLS.mjs.map +0 -1
- package/dist/esm/chunk-3VGX3TXH.mjs +0 -2
- package/dist/esm/chunk-43WARVT3.mjs +0 -2
- package/dist/esm/chunk-52ECIIIH.mjs +0 -2
- package/dist/esm/chunk-56CNRT2K.mjs +0 -2
- package/dist/esm/chunk-56NB52W6.mjs +0 -2
- package/dist/esm/chunk-5DW2AJPI.mjs +0 -2
- package/dist/esm/chunk-5QWUIVAQ.mjs +0 -2
- package/dist/esm/chunk-5QWUIVAQ.mjs.map +0 -1
- package/dist/esm/chunk-6456EI2E.mjs +0 -2
- package/dist/esm/chunk-6456EI2E.mjs.map +0 -1
- package/dist/esm/chunk-65UZZNN2.mjs +0 -2
- 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-6LOTZ4GY.mjs +0 -2
- package/dist/esm/chunk-6RBUXB5I.mjs +0 -2
- package/dist/esm/chunk-6SHLLRJA.mjs +0 -2
- package/dist/esm/chunk-73Y4NTDU.mjs +0 -2
- package/dist/esm/chunk-73Y4NTDU.mjs.map +0 -1
- package/dist/esm/chunk-7PSX4LCV.mjs +0 -2
- package/dist/esm/chunk-7Q2NVO5M.mjs +0 -2
- package/dist/esm/chunk-7STYQ5ZE.mjs +0 -2
- package/dist/esm/chunk-7WJTKYRG.mjs +0 -2
- package/dist/esm/chunk-AH44UPM4.mjs +0 -2
- package/dist/esm/chunk-AOCNYMMX.mjs +0 -2
- package/dist/esm/chunk-C3L4ETUF.mjs +0 -2
- package/dist/esm/chunk-C5UVSNZW.mjs +0 -2
- package/dist/esm/chunk-CLVAGDXO.mjs +0 -2
- package/dist/esm/chunk-COW5IGYC.mjs +0 -2
- package/dist/esm/chunk-D22EMNIY.mjs +0 -2
- package/dist/esm/chunk-DLTC6PJP.mjs +0 -2
- package/dist/esm/chunk-EB7AI4B4.mjs +0 -2
- package/dist/esm/chunk-EKABTHUZ.mjs +0 -2
- package/dist/esm/chunk-EOMDZYSJ.mjs +0 -2
- package/dist/esm/chunk-EOMDZYSJ.mjs.map +0 -1
- package/dist/esm/chunk-FBPNHF54.mjs +0 -2
- package/dist/esm/chunk-FKSACFCB.mjs +0 -2
- package/dist/esm/chunk-FLYEALDB.mjs +0 -2
- package/dist/esm/chunk-FVA2OPG4.mjs +0 -2
- package/dist/esm/chunk-G4XSNSOT.mjs +0 -2
- package/dist/esm/chunk-H3TFQ7K4.mjs +0 -2
- package/dist/esm/chunk-H6LYW7HG.mjs +0 -2
- package/dist/esm/chunk-HCGWCB5E.mjs +0 -2
- package/dist/esm/chunk-HCGWCB5E.mjs.map +0 -1
- package/dist/esm/chunk-HGZGTBA4.mjs +0 -2
- package/dist/esm/chunk-HXSW6X7K.mjs +0 -2
- package/dist/esm/chunk-IXYXFDJZ.mjs +0 -2
- package/dist/esm/chunk-J7J7ZTBF.mjs +0 -2
- package/dist/esm/chunk-JVKMQ64G.mjs +0 -2
- package/dist/esm/chunk-KWNBC5MF.mjs +0 -2
- package/dist/esm/chunk-L54P6EGN.mjs +0 -2
- package/dist/esm/chunk-LDQ6JFEF.mjs +0 -2
- package/dist/esm/chunk-MGOHPDX4.mjs +0 -2
- package/dist/esm/chunk-MWUJCP27.mjs +0 -2
- package/dist/esm/chunk-NC5HHEEM.mjs +0 -2
- package/dist/esm/chunk-NGNETNK2.mjs +0 -2
- package/dist/esm/chunk-NKCZ4KGO.mjs +0 -2
- package/dist/esm/chunk-NMECYE3D.mjs +0 -2
- package/dist/esm/chunk-NNIHTVLA.mjs +0 -2
- package/dist/esm/chunk-NNW6HWIO.mjs +0 -2
- package/dist/esm/chunk-O34EOOVF.mjs +0 -2
- package/dist/esm/chunk-OBEVVLF7.mjs +0 -2
- package/dist/esm/chunk-OBEVVLF7.mjs.map +0 -1
- package/dist/esm/chunk-OKRUEVF3.mjs +0 -2
- package/dist/esm/chunk-OKRUEVF3.mjs.map +0 -1
- package/dist/esm/chunk-OLGSIKFB.mjs +0 -2
- package/dist/esm/chunk-OZC3FCJP.mjs +0 -2
- package/dist/esm/chunk-PFFAQZHT.mjs +0 -2
- package/dist/esm/chunk-PINF6ZWP.mjs +0 -2
- package/dist/esm/chunk-PJXRQBF6.mjs +0 -2
- package/dist/esm/chunk-PJXRQBF6.mjs.map +0 -1
- package/dist/esm/chunk-QHVZL3LZ.mjs +0 -2
- package/dist/esm/chunk-QNHDS64I.mjs +0 -2
- package/dist/esm/chunk-RBPGL6YB.mjs +0 -2
- package/dist/esm/chunk-RJ4PSGZ4.mjs +0 -2
- package/dist/esm/chunk-ROXFCLDT.mjs +0 -2
- package/dist/esm/chunk-RTSEMQCK.mjs +0 -2
- package/dist/esm/chunk-SRPTQ4VV.mjs +0 -2
- package/dist/esm/chunk-STYDBDYL.mjs +0 -2
- package/dist/esm/chunk-T23OVRNF.mjs +0 -2
- package/dist/esm/chunk-TICM455H.mjs +0 -2
- package/dist/esm/chunk-TJDC5PWD.mjs +0 -2
- package/dist/esm/chunk-TVRJ3M7B.mjs +0 -2
- package/dist/esm/chunk-TXMPXZBG.mjs +0 -2
- package/dist/esm/chunk-U6Z4FNB7.mjs +0 -2
- package/dist/esm/chunk-UGIJHLL3.mjs +0 -2
- package/dist/esm/chunk-UVOU6BW2.mjs +0 -2
- package/dist/esm/chunk-V7P6MLSY.mjs +0 -2
- package/dist/esm/chunk-VJJN3GFD.mjs +0 -2
- package/dist/esm/chunk-WOLIXKOK.mjs +0 -2
- package/dist/esm/chunk-WVIPPU2C.mjs +0 -2
- package/dist/esm/chunk-XCR3YNHW.mjs +0 -2
- package/dist/esm/chunk-XCR3YNHW.mjs.map +0 -1
- package/dist/esm/chunk-XMFPKHB5.mjs +0 -2
- package/dist/esm/chunk-XN4SQWI5.mjs +0 -2
- package/dist/esm/chunk-YE5B2S5L.mjs +0 -2
- package/dist/esm/chunk-Z5KKUXYI.mjs +0 -2
- package/dist/esm/chunk-ZM436N3W.mjs +0 -2
- package/dist/esm/chunk-ZNEBMSNC.mjs +0 -2
- /package/dist/esm/{chunk-FVA2OPG4.mjs.map → chunk-OR7TEZ25.mjs.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/api/general.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { AptosConfig } from \"./aptosConfig\";\nimport {\n getBlockByHeight,\n getBlockByVersion,\n getChainTopUserTransactions,\n getIndexerLastSuccessVersion,\n getLedgerInfo,\n getProcessorStatus,\n getTableItem,\n queryIndexer,\n} from \"../internal/general\";\nimport { view } from \"../internal/view\";\nimport {\n AnyNumber,\n Block,\n GetChainTopUserTransactionsResponse,\n GetProcessorStatusResponse,\n GraphqlQuery,\n LedgerInfo,\n LedgerVersionArg,\n MoveValue,\n TableItemRequest,\n} from \"../types\";\nimport { ProcessorType } from \"../utils/const\";\nimport { InputViewFunctionData } from \"../transactions\";\n\n/**\n * A class to query all `General` Aptos related queries\n */\nexport class General {\n readonly config: AptosConfig;\n\n constructor(config: AptosConfig) {\n this.config = config;\n }\n\n /**\n * Queries for the Aptos ledger info\n *\n * @returns Aptos Ledger Info\n *\n * @example\n * const ledgerInfo = await aptos.getLedgerInfo()\n * // an example of the returned data\n * ```\n * {\n * \"chain_id\": 4,\n * \"epoch\": \"8\",\n * \"ledger_version\": \"714\",\n * \"oldest_ledger_version\": \"0\",\n * \"ledger_timestamp\": \"1694695496521775\",\n * \"node_role\": \"validator\",\n * \"oldest_block_height\": \"0\",\n * \"block_height\": \"359\",\n * \"git_hash\": \"c82193f36f4e185fed9f68c4ad21f6c6dd390c6e\"\n * }\n * ```\n */\n async getLedgerInfo(): Promise<LedgerInfo> {\n return getLedgerInfo({ aptosConfig: this.config });\n }\n\n /**\n * Queries for the chain id\n *\n * @example\n * const chainId = await aptos.getChainId()\n *\n * @returns The chain id\n */\n async getChainId(): Promise<number> {\n const result = await this.getLedgerInfo();\n return result.chain_id;\n }\n\n /**\n * Queries for block by transaction version\n *\n * @example\n * const block = await aptos.getBlockByVersion({ledgerVersion:5})\n *\n * @param args.ledgerVersion Ledger version to lookup block information for\n * @param args.options.withTransactions If set to true, include all transactions in the block\n *\n * @returns Block information with optional transactions\n */\n async getBlockByVersion(args: {\n ledgerVersion: AnyNumber;\n options?: { withTransactions?: boolean };\n }): Promise<Block> {\n return getBlockByVersion({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Get block by block height\n *\n * @example\n * const block = await aptos.getBlockByVersion({blockHeight:5})\n *\n * @param args.blockHeight Block height to lookup. Starts at 0\n * @param args.options.withTransactions If set to true, include all transactions in the block\n *\n * @returns Block with optional transactions\n */\n async getBlockByHeight(args: { blockHeight: AnyNumber; options?: { withTransactions?: boolean } }): Promise<Block> {\n return getBlockByHeight({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries for a table item for a table identified by the handle and the key for the item.\n * Key and value types need to be passed in to help with key serialization and value deserialization.\n *\n * @example https://api.devnet.aptoslabs.com/v1/accounts/0x1/resource/0x1::coin::CoinInfo%3C0x1::aptos_coin::AptosCoin%3E\n * const tableItem = await aptos.getTableItem({\n * handle: \"0x123\",\n * data: {\n * key_type: \"address\", // Move type of table key\n * value_type: \"u128\", // Move type of table value\n * key: \"0x619dc29a0aac8fa146714058e8dd6d2d0f3bdf5f6331907bf91f3acd81e6935\" // Value of table key\n * },\n * })\n *\n * @param args.handle A pointer to where that table is stored\n * @param args.data Object that describes table item\n * @param args.options.ledgerVersion The ledger version to query, if not provided it will get the latest version\n *\n * @returns Table item value rendered in JSON\n */\n async getTableItem<T>(args: { handle: string; data: TableItemRequest; options?: LedgerVersionArg }): Promise<T> {\n return getTableItem<T>({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries for a Move view function\n * @param args.payload Payload for the view function\n * @param args.options.ledgerVersion The ledger version to query, if not provided it will get the latest version\n *\n * @example\n * const data = await aptos.view({\n * payload: {\n * function: \"0x1::coin::balance\",\n * typeArguments: [\"0x1::aptos_coin::AptosCoin\"],\n * functionArguments: [accountAddress],\n * }\n * })\n *\n * @returns an array of Move values\n */\n async view<T extends Array<MoveValue>>(args: {\n payload: InputViewFunctionData;\n options?: LedgerVersionArg;\n }): Promise<T> {\n return view<T>({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries top user transactions\n *\n * @example\n * const topUserTransactions = await aptos.getChainTopUserTransactions({limit:5})\n *\n * @param args.limit The number of transactions to return\n * @returns GetChainTopUserTransactionsResponse\n */\n async getChainTopUserTransactions(args: { limit: number }): Promise<GetChainTopUserTransactionsResponse> {\n return getChainTopUserTransactions({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * A generic function for retrieving data from Aptos Indexer.\n * For more detailed queries specification see\n * {@link https://cloud.hasura.io/public/graphiql?endpoint=https://api.mainnet.aptoslabs.com/v1/graphql}\n *\n * @example\n * const topUserTransactions = await aptos.queryIndexer({\n * query: `query MyQuery {\n * ledger_infos {\n * chain_id\n * }}`;\n * })\n *\n * @param args.query.query A GraphQL query\n * @param args.query.variables The variables for the query\n *\n * @return The provided T type\n */\n async queryIndexer<T extends {}>(args: { query: GraphqlQuery }): Promise<T> {\n return queryIndexer<T>({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Queries for the last successful indexer version\n *\n * This is useful to tell what ledger version the indexer is updated to, as it can be behind the full nodes.\n *\n * @example\n * const version = await aptos.getIndexerLastSuccessVersion()\n */\n async getIndexerLastSuccessVersion(): Promise<bigint> {\n return getIndexerLastSuccessVersion({ aptosConfig: this.config });\n }\n\n /**\n * Query the processor status for a specific processor type.\n *\n * @example\n * const status = await aptos.getProcessorStatus({processorType:\"account_transactions_processor\"})\n *\n * @param processorType The processor type to query\n * @returns\n */\n async getProcessorStatus(processorType: ProcessorType): Promise<GetProcessorStatusResponse[0]> {\n return getProcessorStatus({ aptosConfig: this.config, processorType });\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/api/general.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { AptosConfig } from \"./aptosConfig\";\nimport {\n getBlockByHeight,\n getBlockByVersion,\n getChainTopUserTransactions,\n getIndexerLastSuccessVersion,\n getLedgerInfo,\n getProcessorStatus,\n getTableItem,\n queryIndexer,\n} from \"../internal/general\";\nimport { view } from \"../internal/view\";\nimport {\n AnyNumber,\n Block,\n GetChainTopUserTransactionsResponse,\n GetProcessorStatusResponse,\n GraphqlQuery,\n LedgerInfo,\n LedgerVersionArg,\n MoveValue,\n TableItemRequest,\n} from \"../types\";\nimport { ProcessorType } from \"../utils/const\";\nimport { InputViewFunctionData } from \"../transactions\";\n\n/**\n * A class to query all `General` Aptos related queries\n */\nexport class General {\n readonly config: AptosConfig;\n\n constructor(config: AptosConfig) {\n this.config = config;\n }\n\n /**\n * Queries for the Aptos ledger info\n *\n * @returns Aptos Ledger Info\n *\n * @example\n * const ledgerInfo = await aptos.getLedgerInfo()\n * // an example of the returned data\n * ```\n * {\n * \"chain_id\": 4,\n * \"epoch\": \"8\",\n * \"ledger_version\": \"714\",\n * \"oldest_ledger_version\": \"0\",\n * \"ledger_timestamp\": \"1694695496521775\",\n * \"node_role\": \"validator\",\n * \"oldest_block_height\": \"0\",\n * \"block_height\": \"359\",\n * \"git_hash\": \"c82193f36f4e185fed9f68c4ad21f6c6dd390c6e\"\n * }\n * ```\n */\n async getLedgerInfo(): Promise<LedgerInfo> {\n return getLedgerInfo({ aptosConfig: this.config });\n }\n\n /**\n * Queries for the chain id\n *\n * @example\n * const chainId = await aptos.getChainId()\n *\n * @returns The chain id\n */\n async getChainId(): Promise<number> {\n const result = await this.getLedgerInfo();\n return result.chain_id;\n }\n\n /**\n * Queries for block by transaction version\n *\n * @example\n * const block = await aptos.getBlockByVersion({ledgerVersion:5})\n *\n * @param args.ledgerVersion Ledger version to lookup block information for\n * @param args.options.withTransactions If set to true, include all transactions in the block\n *\n * @returns Block information with optional transactions\n */\n async getBlockByVersion(args: {\n ledgerVersion: AnyNumber;\n options?: { withTransactions?: boolean };\n }): Promise<Block> {\n return getBlockByVersion({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Get block by block height\n *\n * @example\n * const block = await aptos.getBlockByVersion({blockHeight:5})\n *\n * @param args.blockHeight Block height to lookup. Starts at 0\n * @param args.options.withTransactions If set to true, include all transactions in the block\n *\n * @returns Block with optional transactions\n */\n async getBlockByHeight(args: { blockHeight: AnyNumber; options?: { withTransactions?: boolean } }): Promise<Block> {\n return getBlockByHeight({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries for a table item for a table identified by the handle and the key for the item.\n * Key and value types need to be passed in to help with key serialization and value deserialization.\n *\n * @example https://api.devnet.aptoslabs.com/v1/accounts/0x1/resource/0x1::coin::CoinInfo%3C0x1::aptos_coin::AptosCoin%3E\n * const tableItem = await aptos.getTableItem({\n * handle: \"0x123\",\n * data: {\n * key_type: \"address\", // Move type of table key\n * value_type: \"u128\", // Move type of table value\n * key: \"0x619dc29a0aac8fa146714058e8dd6d2d0f3bdf5f6331907bf91f3acd81e6935\" // Value of table key\n * },\n * })\n *\n * @param args.handle A pointer to where that table is stored\n * @param args.data Object that describes table item\n * @param args.options.ledgerVersion The ledger version to query, if not provided it will get the latest version\n *\n * @returns Table item value rendered in JSON\n */\n async getTableItem<T>(args: { handle: string; data: TableItemRequest; options?: LedgerVersionArg }): Promise<T> {\n return getTableItem<T>({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries for a Move view function\n * @param args.payload Payload for the view function\n * @param args.options.ledgerVersion The ledger version to query, if not provided it will get the latest version\n *\n * @example\n * const data = await aptos.view({\n * payload: {\n * function: \"0x1::coin::balance\",\n * typeArguments: [\"0x1::aptos_coin::AptosCoin\"],\n * functionArguments: [accountAddress],\n * }\n * })\n *\n * @returns an array of Move values\n */\n async view<T extends Array<MoveValue>>(args: {\n payload: InputViewFunctionData;\n options?: LedgerVersionArg;\n }): Promise<T> {\n return view<T>({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Queries top user transactions\n *\n * @example\n * const topUserTransactions = await aptos.getChainTopUserTransactions({limit:5})\n *\n * @param args.limit The number of transactions to return\n * @returns GetChainTopUserTransactionsResponse\n */\n async getChainTopUserTransactions(args: { limit: number }): Promise<GetChainTopUserTransactionsResponse> {\n return getChainTopUserTransactions({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * A generic function for retrieving data from Aptos Indexer.\n * For more detailed queries specification see\n * {@link https://cloud.hasura.io/public/graphiql?endpoint=https://api.mainnet.aptoslabs.com/v1/graphql}\n *\n * @example\n * const topUserTransactions = await aptos.queryIndexer({\n * query: `query MyQuery {\n * ledger_infos {\n * chain_id\n * }}`;\n * })\n *\n * @param args.query.query A GraphQL query\n * @param args.query.variables The variables for the query\n *\n * @return The provided T type\n */\n async queryIndexer<T extends {}>(args: { query: GraphqlQuery }): Promise<T> {\n return queryIndexer<T>({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Queries for the last successful indexer version\n *\n * This is useful to tell what ledger version the indexer is updated to, as it can be behind the full nodes.\n *\n * @example\n * const version = await aptos.getIndexerLastSuccessVersion()\n */\n async getIndexerLastSuccessVersion(): Promise<bigint> {\n return getIndexerLastSuccessVersion({ aptosConfig: this.config });\n }\n\n /**\n * Query the processor status for a specific processor type.\n *\n * @example\n * const status = await aptos.getProcessorStatus({processorType:\"account_transactions_processor\"})\n *\n * @param processorType The processor type to query\n * @returns\n */\n async getProcessorStatus(processorType: ProcessorType): Promise<GetProcessorStatusResponse[0]> {\n return getProcessorStatus({ aptosConfig: this.config, processorType });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAgCO,IAAM,UAAN,MAAc;AAAA,EAGnB,YAAY,QAAqB;AAC/B,SAAK,SAAS;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAwBA,MAAM,gBAAqC;AACzC,WAAO,cAAc,EAAE,aAAa,KAAK,OAAO,CAAC;AAAA,EACnD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAM,aAA8B;AAClC,UAAM,SAAS,MAAM,KAAK,cAAc;AACxC,WAAO,OAAO;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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A,MAAM,+BAAgD;AACpD,WAAO,6BAA6B,EAAE,aAAa,KAAK,OAAO,CAAC;AAAA,EAClE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWA,MAAM,mBAAmB,eAAsE;AAC7F,WAAO,mBAAmB,EAAE,aAAa,KAAK,QAAQ,cAAc,CAAC;AAAA,EACvE;AACF;","names":[]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ValidateFeePayerDataOnSimulation
|
|
3
|
+
} from "./chunk-SIJELMDP.mjs";
|
|
4
|
+
import {
|
|
5
|
+
simulateTransaction
|
|
6
|
+
} from "./chunk-IHNPN5CQ.mjs";
|
|
7
|
+
import {
|
|
8
|
+
__decorateClass
|
|
9
|
+
} from "./chunk-OR7TEZ25.mjs";
|
|
10
|
+
|
|
11
|
+
// src/api/transactionSubmission/simulate.ts
|
|
12
|
+
var Simulate = class {
|
|
13
|
+
constructor(config) {
|
|
14
|
+
this.config = config;
|
|
15
|
+
}
|
|
16
|
+
async simple(args) {
|
|
17
|
+
return simulateTransaction({ aptosConfig: this.config, ...args });
|
|
18
|
+
}
|
|
19
|
+
async multiAgent(args) {
|
|
20
|
+
return simulateTransaction({ aptosConfig: this.config, ...args });
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
__decorateClass([
|
|
24
|
+
ValidateFeePayerDataOnSimulation
|
|
25
|
+
], Simulate.prototype, "simple", 1);
|
|
26
|
+
__decorateClass([
|
|
27
|
+
ValidateFeePayerDataOnSimulation
|
|
28
|
+
], Simulate.prototype, "multiAgent", 1);
|
|
29
|
+
|
|
30
|
+
export {
|
|
31
|
+
Simulate
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=chunk-W76MGKZB.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/api/transactionSubmission/simulate.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { PublicKey } from \"../../core\";\nimport { simulateTransaction } from \"../../internal/transactionSubmission\";\nimport { AnyRawTransaction, InputSimulateTransactionOptions } from \"../../transactions\";\nimport { UserTransactionResponse } from \"../../types\";\nimport { AptosConfig } from \"../aptosConfig\";\nimport { ValidateFeePayerDataOnSimulation } from \"./helpers\";\n\n/**\n * A class to handle all `Simulate` transaction operations\n */\nexport class Simulate {\n readonly config: AptosConfig;\n\n constructor(config: AptosConfig) {\n this.config = config;\n }\n\n /**\n * Simulate a simple transaction\n *\n * @param args.signerPublicKey The signer public key\n * @param args.transaction An instance of a raw transaction\n * @param args.options optional. Optional transaction configurations\n * @param args.feePayerPublicKey optional. The fee payer public key if it is a fee payer transaction\n *\n * @returns Array<UserTransactionResponse>\n */\n @ValidateFeePayerDataOnSimulation\n async simple(args: {\n signerPublicKey: PublicKey;\n transaction: AnyRawTransaction;\n feePayerPublicKey?: PublicKey;\n options?: InputSimulateTransactionOptions;\n }): Promise<Array<UserTransactionResponse>> {\n return simulateTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Simulate a multi agent transaction\n *\n * @param args.signerPublicKey The signer public key\n * @param args.transaction An instance of a raw transaction\n * @param args.secondarySignersPublicKeys An array of the secondary signers public keys\n * @param args.options optional. Optional transaction configurations\n * @param args.feePayerPublicKey optional. The fee payer public key if it is a fee payer transaction\n *\n * @returns Array<UserTransactionResponse>\n */\n @ValidateFeePayerDataOnSimulation\n async multiAgent(args: {\n signerPublicKey: PublicKey;\n transaction: AnyRawTransaction;\n secondarySignersPublicKeys: Array<PublicKey>;\n feePayerPublicKey?: PublicKey;\n options?: InputSimulateTransactionOptions;\n }): Promise<Array<UserTransactionResponse>> {\n return simulateTransaction({ aptosConfig: this.config, ...args });\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/api/transactionSubmission/simulate.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { PublicKey } from \"../../core\";\nimport { simulateTransaction } from \"../../internal/transactionSubmission\";\nimport { AnyRawTransaction, InputSimulateTransactionOptions } from \"../../transactions\";\nimport { UserTransactionResponse } from \"../../types\";\nimport { AptosConfig } from \"../aptosConfig\";\nimport { ValidateFeePayerDataOnSimulation } from \"./helpers\";\n\n/**\n * A class to handle all `Simulate` transaction operations\n */\nexport class Simulate {\n readonly config: AptosConfig;\n\n constructor(config: AptosConfig) {\n this.config = config;\n }\n\n /**\n * Simulate a simple transaction\n *\n * @param args.signerPublicKey The signer public key\n * @param args.transaction An instance of a raw transaction\n * @param args.options optional. Optional transaction configurations\n * @param args.feePayerPublicKey optional. The fee payer public key if it is a fee payer transaction\n *\n * @returns Array<UserTransactionResponse>\n */\n @ValidateFeePayerDataOnSimulation\n async simple(args: {\n signerPublicKey: PublicKey;\n transaction: AnyRawTransaction;\n feePayerPublicKey?: PublicKey;\n options?: InputSimulateTransactionOptions;\n }): Promise<Array<UserTransactionResponse>> {\n return simulateTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Simulate a multi agent transaction\n *\n * @param args.signerPublicKey The signer public key\n * @param args.transaction An instance of a raw transaction\n * @param args.secondarySignersPublicKeys An array of the secondary signers public keys\n * @param args.options optional. Optional transaction configurations\n * @param args.feePayerPublicKey optional. The fee payer public key if it is a fee payer transaction\n *\n * @returns Array<UserTransactionResponse>\n */\n @ValidateFeePayerDataOnSimulation\n async multiAgent(args: {\n signerPublicKey: PublicKey;\n transaction: AnyRawTransaction;\n secondarySignersPublicKeys: Array<PublicKey>;\n feePayerPublicKey?: PublicKey;\n options?: InputSimulateTransactionOptions;\n }): Promise<Array<UserTransactionResponse>> {\n return simulateTransaction({ aptosConfig: this.config, ...args });\n }\n}\n"],"mappings":";;;;;;;;;;;AAaO,IAAM,WAAN,MAAe;AAAA,EAGpB,YAAY,QAAqB;AAC/B,SAAK,SAAS;AAAA,EAChB;AAAA,EAaA,MAAM,OAAO,MAK+B;AAC1C,WAAO,oBAAoB,EAAE,aAAa,KAAK,QAAQ,GAAG,KAAK,CAAC;AAAA,EAClE;AAAA,EAcA,MAAM,WAAW,MAM2B;AAC1C,WAAO,oBAAoB,EAAE,aAAa,KAAK,QAAQ,GAAG,KAAK,CAAC;AAAA,EAClE;AACF;AA9BQ;AAAA,EADL;AAAA,GAjBU,SAkBL;AAqBA;AAAA,EADL;AAAA,GAtCU,SAuCL;","names":[]}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TransactionWorker
|
|
3
|
+
} from "./chunk-WVGO4D7K.mjs";
|
|
4
|
+
|
|
5
|
+
// src/api/transactionSubmission/management.ts
|
|
6
|
+
import EventEmitter from "eventemitter3";
|
|
7
|
+
var TransactionManagement = class extends EventEmitter {
|
|
8
|
+
constructor(config) {
|
|
9
|
+
super();
|
|
10
|
+
this.config = config;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Internal function to start the transaction worker and
|
|
14
|
+
* listen to worker events
|
|
15
|
+
*
|
|
16
|
+
* @param args.sender The sender account to sign and submit the transaction
|
|
17
|
+
*/
|
|
18
|
+
start(args) {
|
|
19
|
+
const { sender } = args;
|
|
20
|
+
this.account = sender;
|
|
21
|
+
this.transactionWorker = new TransactionWorker(this.config, sender);
|
|
22
|
+
this.transactionWorker.start();
|
|
23
|
+
this.registerToEvents();
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Internal function to push transaction data to the transaction worker.
|
|
27
|
+
*
|
|
28
|
+
* @param args.data An array of transaction payloads
|
|
29
|
+
* @param args.options optional. Transaction generation configurations (excluding accountSequenceNumber)
|
|
30
|
+
*
|
|
31
|
+
* TODO - make this public once worker supports adding transactions to existing queue
|
|
32
|
+
*/
|
|
33
|
+
push(args) {
|
|
34
|
+
const { data, options } = args;
|
|
35
|
+
for (const d of data) {
|
|
36
|
+
this.transactionWorker.push(d, options);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Internal function to start listening to transaction worker events
|
|
41
|
+
*
|
|
42
|
+
* TODO - should we ask events to listen to as an input?
|
|
43
|
+
*/
|
|
44
|
+
registerToEvents() {
|
|
45
|
+
this.transactionWorker.on("transactionSent" /* TransactionSent */, async (data) => {
|
|
46
|
+
this.emit("transactionSent" /* TransactionSent */, data);
|
|
47
|
+
});
|
|
48
|
+
this.transactionWorker.on("transactionSendFailed" /* TransactionSendFailed */, async (data) => {
|
|
49
|
+
this.emit("transactionSendFailed" /* TransactionSendFailed */, data);
|
|
50
|
+
});
|
|
51
|
+
this.transactionWorker.on("transactionExecuted" /* TransactionExecuted */, async (data) => {
|
|
52
|
+
this.emit("transactionExecuted" /* TransactionExecuted */, data);
|
|
53
|
+
});
|
|
54
|
+
this.transactionWorker.on("transactionExecutionFailed" /* TransactionExecutionFailed */, async (data) => {
|
|
55
|
+
this.emit("transactionExecutionFailed" /* TransactionExecutionFailed */, data);
|
|
56
|
+
});
|
|
57
|
+
this.transactionWorker.on("executionFinish" /* ExecutionFinish */, async (data) => {
|
|
58
|
+
this.emit("executionFinish" /* ExecutionFinish */, data);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Send batch transactions for a single account.
|
|
63
|
+
*
|
|
64
|
+
* This function uses a transaction worker that receives payloads to be processed
|
|
65
|
+
* and submitted to chain.
|
|
66
|
+
* Note that this process is best for submitting multiple transactions that
|
|
67
|
+
* dont rely on each other, i.e batch funds, batch token mints, etc.
|
|
68
|
+
*
|
|
69
|
+
* If any worker failure, the functions throws an error.
|
|
70
|
+
*
|
|
71
|
+
* @param args.sender The sender account to sign and submit the transaction
|
|
72
|
+
* @param args.data An array of transaction payloads
|
|
73
|
+
* @param args.options optional. Transaction generation configurations (excluding accountSequenceNumber)
|
|
74
|
+
*
|
|
75
|
+
* @return void. Throws if any error
|
|
76
|
+
*/
|
|
77
|
+
forSingleAccount(args) {
|
|
78
|
+
try {
|
|
79
|
+
const { sender, data, options } = args;
|
|
80
|
+
this.start({ sender });
|
|
81
|
+
this.push({ data, options });
|
|
82
|
+
} catch (error) {
|
|
83
|
+
throw new Error(`failed to submit transactions with error: ${error}`);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export {
|
|
89
|
+
TransactionManagement
|
|
90
|
+
};
|
|
91
|
+
//# sourceMappingURL=chunk-WDRH2URB.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/api/transactionSubmission/management.ts"],"sourcesContent":["import EventEmitter from \"eventemitter3\";\nimport { TransactionWorkerEvents, TransactionWorker, TransactionWorkerEventsEnum } from \"../../transactions/management\";\nimport { InputGenerateTransactionPayloadData, InputGenerateTransactionOptions } from \"../../transactions\";\nimport { AptosConfig } from \"../aptosConfig\";\nimport { Account } from \"../../account\";\n\nexport class TransactionManagement extends EventEmitter<TransactionWorkerEvents> {\n account!: Account;\n\n transactionWorker!: TransactionWorker;\n\n readonly config: AptosConfig;\n\n constructor(config: AptosConfig) {\n super();\n this.config = config;\n }\n\n /**\n * Internal function to start the transaction worker and\n * listen to worker events\n *\n * @param args.sender The sender account to sign and submit the transaction\n */\n private start(args: { sender: Account }): void {\n const { sender } = args;\n this.account = sender;\n this.transactionWorker = new TransactionWorker(this.config, sender);\n\n this.transactionWorker.start();\n this.registerToEvents();\n }\n\n /**\n * Internal function to push transaction data to the transaction worker.\n *\n * @param args.data An array of transaction payloads\n * @param args.options optional. Transaction generation configurations (excluding accountSequenceNumber)\n *\n * TODO - make this public once worker supports adding transactions to existing queue\n */\n private push(args: {\n data: InputGenerateTransactionPayloadData[];\n options?: Omit<InputGenerateTransactionOptions, \"accountSequenceNumber\">;\n }): void {\n const { data, options } = args;\n\n for (const d of data) {\n this.transactionWorker.push(d, options);\n }\n }\n\n /**\n * Internal function to start listening to transaction worker events\n *\n * TODO - should we ask events to listen to as an input?\n */\n private registerToEvents() {\n this.transactionWorker.on(TransactionWorkerEventsEnum.TransactionSent, async (data) => {\n this.emit(TransactionWorkerEventsEnum.TransactionSent, data);\n });\n this.transactionWorker.on(TransactionWorkerEventsEnum.TransactionSendFailed, async (data) => {\n this.emit(TransactionWorkerEventsEnum.TransactionSendFailed, data);\n });\n this.transactionWorker.on(TransactionWorkerEventsEnum.TransactionExecuted, async (data) => {\n this.emit(TransactionWorkerEventsEnum.TransactionExecuted, data);\n });\n this.transactionWorker.on(TransactionWorkerEventsEnum.TransactionExecutionFailed, async (data) => {\n this.emit(TransactionWorkerEventsEnum.TransactionExecutionFailed, data);\n });\n this.transactionWorker.on(TransactionWorkerEventsEnum.ExecutionFinish, async (data) => {\n this.emit(TransactionWorkerEventsEnum.ExecutionFinish, data);\n });\n }\n\n /**\n * Send batch transactions for a single account.\n *\n * This function uses a transaction worker that receives payloads to be processed\n * and submitted to chain.\n * Note that this process is best for submitting multiple transactions that\n * dont rely on each other, i.e batch funds, batch token mints, etc.\n *\n * If any worker failure, the functions throws an error.\n *\n * @param args.sender The sender account to sign and submit the transaction\n * @param args.data An array of transaction payloads\n * @param args.options optional. Transaction generation configurations (excluding accountSequenceNumber)\n *\n * @return void. Throws if any error\n */\n forSingleAccount(args: {\n sender: Account;\n data: InputGenerateTransactionPayloadData[];\n options?: Omit<InputGenerateTransactionOptions, \"accountSequenceNumber\">;\n }): void {\n try {\n const { sender, data, options } = args;\n this.start({ sender });\n\n this.push({ data, options });\n } catch (error: any) {\n throw new Error(`failed to submit transactions with error: ${error}`);\n }\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/api/transactionSubmission/management.ts"],"sourcesContent":["import EventEmitter from \"eventemitter3\";\nimport { TransactionWorkerEvents, TransactionWorker, TransactionWorkerEventsEnum } from \"../../transactions/management\";\nimport { InputGenerateTransactionPayloadData, InputGenerateTransactionOptions } from \"../../transactions\";\nimport { AptosConfig } from \"../aptosConfig\";\nimport { Account } from \"../../account\";\n\nexport class TransactionManagement extends EventEmitter<TransactionWorkerEvents> {\n account!: Account;\n\n transactionWorker!: TransactionWorker;\n\n readonly config: AptosConfig;\n\n constructor(config: AptosConfig) {\n super();\n this.config = config;\n }\n\n /**\n * Internal function to start the transaction worker and\n * listen to worker events\n *\n * @param args.sender The sender account to sign and submit the transaction\n */\n private start(args: { sender: Account }): void {\n const { sender } = args;\n this.account = sender;\n this.transactionWorker = new TransactionWorker(this.config, sender);\n\n this.transactionWorker.start();\n this.registerToEvents();\n }\n\n /**\n * Internal function to push transaction data to the transaction worker.\n *\n * @param args.data An array of transaction payloads\n * @param args.options optional. Transaction generation configurations (excluding accountSequenceNumber)\n *\n * TODO - make this public once worker supports adding transactions to existing queue\n */\n private push(args: {\n data: InputGenerateTransactionPayloadData[];\n options?: Omit<InputGenerateTransactionOptions, \"accountSequenceNumber\">;\n }): void {\n const { data, options } = args;\n\n for (const d of data) {\n this.transactionWorker.push(d, options);\n }\n }\n\n /**\n * Internal function to start listening to transaction worker events\n *\n * TODO - should we ask events to listen to as an input?\n */\n private registerToEvents() {\n this.transactionWorker.on(TransactionWorkerEventsEnum.TransactionSent, async (data) => {\n this.emit(TransactionWorkerEventsEnum.TransactionSent, data);\n });\n this.transactionWorker.on(TransactionWorkerEventsEnum.TransactionSendFailed, async (data) => {\n this.emit(TransactionWorkerEventsEnum.TransactionSendFailed, data);\n });\n this.transactionWorker.on(TransactionWorkerEventsEnum.TransactionExecuted, async (data) => {\n this.emit(TransactionWorkerEventsEnum.TransactionExecuted, data);\n });\n this.transactionWorker.on(TransactionWorkerEventsEnum.TransactionExecutionFailed, async (data) => {\n this.emit(TransactionWorkerEventsEnum.TransactionExecutionFailed, data);\n });\n this.transactionWorker.on(TransactionWorkerEventsEnum.ExecutionFinish, async (data) => {\n this.emit(TransactionWorkerEventsEnum.ExecutionFinish, data);\n });\n }\n\n /**\n * Send batch transactions for a single account.\n *\n * This function uses a transaction worker that receives payloads to be processed\n * and submitted to chain.\n * Note that this process is best for submitting multiple transactions that\n * dont rely on each other, i.e batch funds, batch token mints, etc.\n *\n * If any worker failure, the functions throws an error.\n *\n * @param args.sender The sender account to sign and submit the transaction\n * @param args.data An array of transaction payloads\n * @param args.options optional. Transaction generation configurations (excluding accountSequenceNumber)\n *\n * @return void. Throws if any error\n */\n forSingleAccount(args: {\n sender: Account;\n data: InputGenerateTransactionPayloadData[];\n options?: Omit<InputGenerateTransactionOptions, \"accountSequenceNumber\">;\n }): void {\n try {\n const { sender, data, options } = args;\n this.start({ sender });\n\n this.push({ data, options });\n } catch (error: any) {\n throw new Error(`failed to submit transactions with error: ${error}`);\n }\n }\n}\n"],"mappings":";;;;;AAAA,OAAO,kBAAkB;AAMlB,IAAM,wBAAN,cAAoC,aAAsC;AAAA,EAO/E,YAAY,QAAqB;AAC/B,UAAM;AACN,SAAK,SAAS;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQQ,MAAM,MAAiC;AAC7C,UAAM,EAAE,OAAO,IAAI;AACnB,SAAK,UAAU;AACf,SAAK,oBAAoB,IAAI,kBAAkB,KAAK,QAAQ,MAAM;AAElE,SAAK,kBAAkB,MAAM;AAC7B,SAAK,iBAAiB;AAAA,EACxB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUQ,KAAK,MAGJ;AACP,UAAM,EAAE,MAAM,QAAQ,IAAI;AAE1B,eAAW,KAAK,MAAM;AACpB,WAAK,kBAAkB,KAAK,GAAG,OAAO;AAAA,IACxC;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOQ,mBAAmB;AACzB,SAAK,kBAAkB,4CAAgD,OAAO,SAAS;AACrF,WAAK,8CAAkD,IAAI;AAAA,IAC7D,CAAC;AACD,SAAK,kBAAkB,wDAAsD,OAAO,SAAS;AAC3F,WAAK,0DAAwD,IAAI;AAAA,IACnE,CAAC;AACD,SAAK,kBAAkB,oDAAoD,OAAO,SAAS;AACzF,WAAK,sDAAsD,IAAI;AAAA,IACjE,CAAC;AACD,SAAK,kBAAkB,kEAA2D,OAAO,SAAS;AAChG,WAAK,oEAA6D,IAAI;AAAA,IACxE,CAAC;AACD,SAAK,kBAAkB,4CAAgD,OAAO,SAAS;AACrF,WAAK,8CAAkD,IAAI;AAAA,IAC7D,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAkBA,iBAAiB,MAIR;AACP,QAAI;AACF,YAAM,EAAE,QAAQ,MAAM,QAAQ,IAAI;AAClC,WAAK,MAAM,EAAE,OAAO,CAAC;AAErB,WAAK,KAAK,EAAE,MAAM,QAAQ,CAAC;AAAA,IAC7B,SAAS,OAAY;AACnB,YAAM,IAAI,MAAM,6CAA6C,KAAK,EAAE;AAAA,IACtE;AAAA,EACF;AACF;","names":[]}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AnyPublicKey,
|
|
3
|
+
AnySignature
|
|
4
|
+
} from "./chunk-TLNHRJB2.mjs";
|
|
5
|
+
import {
|
|
6
|
+
Signature
|
|
7
|
+
} from "./chunk-FDWJNY4U.mjs";
|
|
8
|
+
import {
|
|
9
|
+
AccountPublicKey
|
|
10
|
+
} from "./chunk-FXKSE3ZP.mjs";
|
|
11
|
+
import {
|
|
12
|
+
AuthenticationKey
|
|
13
|
+
} from "./chunk-UEBBLQJ5.mjs";
|
|
14
|
+
|
|
15
|
+
// src/core/crypto/multiKey.ts
|
|
16
|
+
function bitCount(byte) {
|
|
17
|
+
let n = byte;
|
|
18
|
+
n -= n >> 1 & 1431655765;
|
|
19
|
+
n = (n & 858993459) + (n >> 2 & 858993459);
|
|
20
|
+
return (n + (n >> 4) & 252645135) * 16843009 >> 24;
|
|
21
|
+
}
|
|
22
|
+
var MultiKey = class _MultiKey extends AccountPublicKey {
|
|
23
|
+
// region Constructors
|
|
24
|
+
constructor(args) {
|
|
25
|
+
super();
|
|
26
|
+
const { publicKeys, signaturesRequired } = args;
|
|
27
|
+
if (signaturesRequired < 1) {
|
|
28
|
+
throw new Error("The number of required signatures needs to be greater than 0");
|
|
29
|
+
}
|
|
30
|
+
if (publicKeys.length < signaturesRequired) {
|
|
31
|
+
throw new Error(
|
|
32
|
+
`Provided ${publicKeys.length} public keys is smaller than the ${signaturesRequired} required signatures`
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
this.publicKeys = publicKeys.map(
|
|
36
|
+
(publicKey) => publicKey instanceof AnyPublicKey ? publicKey : new AnyPublicKey(publicKey)
|
|
37
|
+
);
|
|
38
|
+
this.signaturesRequired = signaturesRequired;
|
|
39
|
+
}
|
|
40
|
+
// endregion
|
|
41
|
+
// region AccountPublicKey
|
|
42
|
+
// eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars
|
|
43
|
+
verifySignature(args) {
|
|
44
|
+
throw new Error("not implemented");
|
|
45
|
+
}
|
|
46
|
+
authKey() {
|
|
47
|
+
return AuthenticationKey.fromSchemeAndBytes({
|
|
48
|
+
scheme: 3 /* MultiKey */,
|
|
49
|
+
input: this.toUint8Array()
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
toUint8Array() {
|
|
53
|
+
return this.bcsToBytes();
|
|
54
|
+
}
|
|
55
|
+
// endregion
|
|
56
|
+
// region Serializable
|
|
57
|
+
serialize(serializer) {
|
|
58
|
+
serializer.serializeVector(this.publicKeys);
|
|
59
|
+
serializer.serializeU8(this.signaturesRequired);
|
|
60
|
+
}
|
|
61
|
+
static deserialize(deserializer) {
|
|
62
|
+
const keys = deserializer.deserializeVector(AnyPublicKey);
|
|
63
|
+
const signaturesRequired = deserializer.deserializeU8();
|
|
64
|
+
return new _MultiKey({ publicKeys: keys, signaturesRequired });
|
|
65
|
+
}
|
|
66
|
+
// endregion
|
|
67
|
+
/**
|
|
68
|
+
* Create a bitmap that holds the mapping from the original public keys
|
|
69
|
+
* to the signatures passed in
|
|
70
|
+
*
|
|
71
|
+
* @param args.bits array of the index mapping to the matching public keys
|
|
72
|
+
* @returns Uint8array bit map
|
|
73
|
+
*/
|
|
74
|
+
createBitmap(args) {
|
|
75
|
+
const { bits } = args;
|
|
76
|
+
const firstBitInByte = 128;
|
|
77
|
+
const bitmap = new Uint8Array([0, 0, 0, 0]);
|
|
78
|
+
const dupCheckSet = /* @__PURE__ */ new Set();
|
|
79
|
+
bits.forEach((bit, idx) => {
|
|
80
|
+
if (idx + 1 > this.publicKeys.length) {
|
|
81
|
+
throw new Error(`Signature index ${idx + 1} is out of public keys range, ${this.publicKeys.length}.`);
|
|
82
|
+
}
|
|
83
|
+
if (dupCheckSet.has(bit)) {
|
|
84
|
+
throw new Error(`Duplicate bit ${bit} detected.`);
|
|
85
|
+
}
|
|
86
|
+
dupCheckSet.add(bit);
|
|
87
|
+
const byteOffset = Math.floor(bit / 8);
|
|
88
|
+
let byte = bitmap[byteOffset];
|
|
89
|
+
byte |= firstBitInByte >> bit % 8;
|
|
90
|
+
bitmap[byteOffset] = byte;
|
|
91
|
+
});
|
|
92
|
+
return bitmap;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Get the index of the provided public key.
|
|
96
|
+
*
|
|
97
|
+
* @param publicKey array of the index mapping to the matching public keys
|
|
98
|
+
* @returns the corresponding index of the publicKey, if it exists
|
|
99
|
+
*/
|
|
100
|
+
getIndex(publicKey) {
|
|
101
|
+
const anyPublicKey = publicKey instanceof AnyPublicKey ? publicKey : new AnyPublicKey(publicKey);
|
|
102
|
+
const index = this.publicKeys.findIndex((pk) => pk.toString() === anyPublicKey.toString());
|
|
103
|
+
if (index !== -1) {
|
|
104
|
+
return index;
|
|
105
|
+
}
|
|
106
|
+
throw new Error("Public key not found in MultiKey");
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
var _MultiKeySignature = class _MultiKeySignature extends Signature {
|
|
110
|
+
/**
|
|
111
|
+
* Signature for a K-of-N multi-sig transaction.
|
|
112
|
+
*
|
|
113
|
+
* @see {@link
|
|
114
|
+
* https://aptos.dev/integration/creating-a-signed-transaction/#multisignature-transactions | Creating a Signed Transaction}
|
|
115
|
+
*
|
|
116
|
+
* @param args.signatures A list of signatures
|
|
117
|
+
* @param args.bitmap 4 bytes, at most 32 signatures are supported. If Nth bit value is `1`, the Nth
|
|
118
|
+
* signature should be provided in `signatures`. Bits are read from left to right
|
|
119
|
+
*/
|
|
120
|
+
constructor(args) {
|
|
121
|
+
super();
|
|
122
|
+
const { signatures, bitmap } = args;
|
|
123
|
+
if (signatures.length > _MultiKeySignature.MAX_SIGNATURES_SUPPORTED) {
|
|
124
|
+
throw new Error(`The number of signatures cannot be greater than ${_MultiKeySignature.MAX_SIGNATURES_SUPPORTED}`);
|
|
125
|
+
}
|
|
126
|
+
this.signatures = signatures.map(
|
|
127
|
+
(signature) => signature instanceof AnySignature ? signature : new AnySignature(signature)
|
|
128
|
+
);
|
|
129
|
+
if (!(bitmap instanceof Uint8Array)) {
|
|
130
|
+
this.bitmap = _MultiKeySignature.createBitmap({ bits: bitmap });
|
|
131
|
+
} else if (bitmap.length !== _MultiKeySignature.BITMAP_LEN) {
|
|
132
|
+
throw new Error(`"bitmap" length should be ${_MultiKeySignature.BITMAP_LEN}`);
|
|
133
|
+
} else {
|
|
134
|
+
this.bitmap = bitmap;
|
|
135
|
+
}
|
|
136
|
+
const nSignatures = this.bitmap.reduce((acc, byte) => acc + bitCount(byte), 0);
|
|
137
|
+
if (nSignatures !== this.signatures.length) {
|
|
138
|
+
throw new Error(`Expecting ${nSignatures} signatures from the bitmap, but got ${this.signatures.length}`);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Helper method to create a bitmap out of the specified bit positions
|
|
143
|
+
* @param args.bits The bitmap positions that should be set. A position starts at index 0.
|
|
144
|
+
* Valid position should range between 0 and 31.
|
|
145
|
+
* @example
|
|
146
|
+
* Here's an example of valid `bits`
|
|
147
|
+
* ```
|
|
148
|
+
* [0, 2, 31]
|
|
149
|
+
* ```
|
|
150
|
+
* `[0, 2, 31]` means the 1st, 3rd and 32nd bits should be set in the bitmap.
|
|
151
|
+
* The result bitmap should be 0b1010000000000000000000000000001
|
|
152
|
+
*
|
|
153
|
+
* @returns bitmap that is 32bit long
|
|
154
|
+
*/
|
|
155
|
+
static createBitmap(args) {
|
|
156
|
+
const { bits } = args;
|
|
157
|
+
const firstBitInByte = 128;
|
|
158
|
+
const bitmap = new Uint8Array([0, 0, 0, 0]);
|
|
159
|
+
const dupCheckSet = /* @__PURE__ */ new Set();
|
|
160
|
+
bits.forEach((bit) => {
|
|
161
|
+
if (bit >= _MultiKeySignature.MAX_SIGNATURES_SUPPORTED) {
|
|
162
|
+
throw new Error(`Cannot have a signature larger than ${_MultiKeySignature.MAX_SIGNATURES_SUPPORTED - 1}.`);
|
|
163
|
+
}
|
|
164
|
+
if (dupCheckSet.has(bit)) {
|
|
165
|
+
throw new Error("Duplicate bits detected.");
|
|
166
|
+
}
|
|
167
|
+
dupCheckSet.add(bit);
|
|
168
|
+
const byteOffset = Math.floor(bit / 8);
|
|
169
|
+
let byte = bitmap[byteOffset];
|
|
170
|
+
byte |= firstBitInByte >> bit % 8;
|
|
171
|
+
bitmap[byteOffset] = byte;
|
|
172
|
+
});
|
|
173
|
+
return bitmap;
|
|
174
|
+
}
|
|
175
|
+
// region Signature
|
|
176
|
+
toUint8Array() {
|
|
177
|
+
return this.bcsToBytes();
|
|
178
|
+
}
|
|
179
|
+
// endregion
|
|
180
|
+
// region Serializable
|
|
181
|
+
serialize(serializer) {
|
|
182
|
+
serializer.serializeVector(this.signatures);
|
|
183
|
+
serializer.serializeBytes(this.bitmap);
|
|
184
|
+
}
|
|
185
|
+
static deserialize(deserializer) {
|
|
186
|
+
const signatures = deserializer.deserializeVector(AnySignature);
|
|
187
|
+
const bitmap = deserializer.deserializeBytes();
|
|
188
|
+
return new _MultiKeySignature({ signatures, bitmap });
|
|
189
|
+
}
|
|
190
|
+
// endregion
|
|
191
|
+
};
|
|
192
|
+
/**
|
|
193
|
+
* Number of bytes in the bitmap representing who signed the transaction (32-bits)
|
|
194
|
+
*/
|
|
195
|
+
_MultiKeySignature.BITMAP_LEN = 4;
|
|
196
|
+
/**
|
|
197
|
+
* Maximum number of Ed25519 signatures supported
|
|
198
|
+
*/
|
|
199
|
+
_MultiKeySignature.MAX_SIGNATURES_SUPPORTED = _MultiKeySignature.BITMAP_LEN * 8;
|
|
200
|
+
var MultiKeySignature = _MultiKeySignature;
|
|
201
|
+
|
|
202
|
+
export {
|
|
203
|
+
MultiKey,
|
|
204
|
+
MultiKeySignature
|
|
205
|
+
};
|
|
206
|
+
//# sourceMappingURL=chunk-WHBWEN6N.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/crypto/multiKey.ts"],"sourcesContent":["import { SigningScheme as AuthenticationKeyScheme } from \"../../types\";\nimport { Deserializer } from \"../../bcs/deserializer\";\nimport { Serializer } from \"../../bcs/serializer\";\nimport { AuthenticationKey } from \"../authenticationKey\";\nimport { AccountPublicKey, PublicKey, VerifySignatureArgs } from \"./publicKey\";\nimport { Signature } from \"./signature\";\nimport { AnyPublicKey, AnySignature } from \"./singleKey\";\n\n/* eslint-disable no-bitwise */\n\nfunction bitCount(byte: number) {\n let n = byte;\n n -= (n >> 1) & 0x55555555;\n n = (n & 0x33333333) + ((n >> 2) & 0x33333333);\n return (((n + (n >> 4)) & 0xf0f0f0f) * 0x1010101) >> 24;\n}\n\n/* eslint-enable no-bitwise */\n\n/**\n * Represents the public key of a multi-agent account.\n *\n * The public keys of each individual agent can be any type of public key supported by Aptos.\n * Since [AIP-55](https://github.com/aptos-foundation/AIPs/pull/263) Aptos supports\n * `Legacy` and `Unified` authentication keys.\n */\nexport class MultiKey extends AccountPublicKey {\n /**\n * List of any public keys\n */\n public readonly publicKeys: AnyPublicKey[];\n\n /**\n * The minimum number of valid signatures required, for the number of public keys specified\n */\n public readonly signaturesRequired: number;\n\n // region Constructors\n\n constructor(args: { publicKeys: Array<PublicKey>; signaturesRequired: number }) {\n super();\n const { publicKeys, signaturesRequired } = args;\n\n // Validate number of public keys is greater than signature required\n if (signaturesRequired < 1) {\n throw new Error(\"The number of required signatures needs to be greater than 0\");\n }\n\n // Validate number of public keys is greater than signature required\n if (publicKeys.length < signaturesRequired) {\n throw new Error(\n `Provided ${publicKeys.length} public keys is smaller than the ${signaturesRequired} required signatures`,\n );\n }\n\n // Make sure that all keys are normalized to the SingleKey authentication scheme\n this.publicKeys = publicKeys.map((publicKey) =>\n publicKey instanceof AnyPublicKey ? publicKey : new AnyPublicKey(publicKey),\n );\n\n this.signaturesRequired = signaturesRequired;\n }\n\n // endregion\n\n // region AccountPublicKey\n\n // eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars\n verifySignature(args: VerifySignatureArgs): boolean {\n throw new Error(\"not implemented\");\n }\n\n authKey(): AuthenticationKey {\n return AuthenticationKey.fromSchemeAndBytes({\n scheme: AuthenticationKeyScheme.MultiKey,\n input: this.toUint8Array(),\n });\n }\n\n toUint8Array(): Uint8Array {\n return this.bcsToBytes();\n }\n\n // endregion\n\n // region Serializable\n\n serialize(serializer: Serializer): void {\n serializer.serializeVector(this.publicKeys);\n serializer.serializeU8(this.signaturesRequired);\n }\n\n static deserialize(deserializer: Deserializer): MultiKey {\n const keys = deserializer.deserializeVector(AnyPublicKey);\n const signaturesRequired = deserializer.deserializeU8();\n\n return new MultiKey({ publicKeys: keys, signaturesRequired });\n }\n\n // endregion\n\n /**\n * Create a bitmap that holds the mapping from the original public keys\n * to the signatures passed in\n *\n * @param args.bits array of the index mapping to the matching public keys\n * @returns Uint8array bit map\n */\n createBitmap(args: { bits: number[] }): Uint8Array {\n const { bits } = args;\n // Bits are read from left to right. e.g. 0b10000000 represents the first bit is set in one byte.\n // The decimal value of 0b10000000 is 128.\n const firstBitInByte = 128;\n const bitmap = new Uint8Array([0, 0, 0, 0]);\n\n // Check if duplicates exist in bits\n const dupCheckSet = new Set();\n\n bits.forEach((bit: number, idx: number) => {\n if (idx + 1 > this.publicKeys.length) {\n throw new Error(`Signature index ${idx + 1} is out of public keys range, ${this.publicKeys.length}.`);\n }\n\n if (dupCheckSet.has(bit)) {\n throw new Error(`Duplicate bit ${bit} detected.`);\n }\n\n dupCheckSet.add(bit);\n\n const byteOffset = Math.floor(bit / 8);\n\n let byte = bitmap[byteOffset];\n\n // eslint-disable-next-line no-bitwise\n byte |= firstBitInByte >> bit % 8;\n\n bitmap[byteOffset] = byte;\n });\n\n return bitmap;\n }\n\n /**\n * Get the index of the provided public key.\n *\n * @param publicKey array of the index mapping to the matching public keys\n * @returns the corresponding index of the publicKey, if it exists\n */\n getIndex(publicKey: PublicKey): number {\n const anyPublicKey = publicKey instanceof AnyPublicKey ? publicKey : new AnyPublicKey(publicKey);\n const index = this.publicKeys.findIndex((pk) => pk.toString() === anyPublicKey.toString());\n\n if (index !== -1) {\n return index;\n }\n throw new Error(\"Public key not found in MultiKey\");\n }\n}\n\nexport class MultiKeySignature extends Signature {\n /**\n * Number of bytes in the bitmap representing who signed the transaction (32-bits)\n */\n static BITMAP_LEN: number = 4;\n\n /**\n * Maximum number of Ed25519 signatures supported\n */\n static MAX_SIGNATURES_SUPPORTED = MultiKeySignature.BITMAP_LEN * 8;\n\n /**\n * The list of underlying Ed25519 signatures\n */\n public readonly signatures: AnySignature[];\n\n /**\n * 32-bit Bitmap representing who signed the transaction\n *\n * This is represented where each public key can be masked to determine whether the message was signed by that key.\n */\n public readonly bitmap: Uint8Array;\n\n /**\n * Signature for a K-of-N multi-sig transaction.\n *\n * @see {@link\n * https://aptos.dev/integration/creating-a-signed-transaction/#multisignature-transactions | Creating a Signed Transaction}\n *\n * @param args.signatures A list of signatures\n * @param args.bitmap 4 bytes, at most 32 signatures are supported. If Nth bit value is `1`, the Nth\n * signature should be provided in `signatures`. Bits are read from left to right\n */\n constructor(args: { signatures: Array<Signature | AnySignature>; bitmap: Uint8Array | number[] }) {\n super();\n const { signatures, bitmap } = args;\n\n if (signatures.length > MultiKeySignature.MAX_SIGNATURES_SUPPORTED) {\n throw new Error(`The number of signatures cannot be greater than ${MultiKeySignature.MAX_SIGNATURES_SUPPORTED}`);\n }\n\n // Make sure that all signatures are normalized to the SingleKey authentication scheme\n this.signatures = signatures.map((signature) =>\n signature instanceof AnySignature ? signature : new AnySignature(signature),\n );\n\n if (!(bitmap instanceof Uint8Array)) {\n this.bitmap = MultiKeySignature.createBitmap({ bits: bitmap });\n } else if (bitmap.length !== MultiKeySignature.BITMAP_LEN) {\n throw new Error(`\"bitmap\" length should be ${MultiKeySignature.BITMAP_LEN}`);\n } else {\n this.bitmap = bitmap;\n }\n\n const nSignatures = this.bitmap.reduce((acc, byte) => acc + bitCount(byte), 0);\n if (nSignatures !== this.signatures.length) {\n throw new Error(`Expecting ${nSignatures} signatures from the bitmap, but got ${this.signatures.length}`);\n }\n }\n\n /**\n * Helper method to create a bitmap out of the specified bit positions\n * @param args.bits The bitmap positions that should be set. A position starts at index 0.\n * Valid position should range between 0 and 31.\n * @example\n * Here's an example of valid `bits`\n * ```\n * [0, 2, 31]\n * ```\n * `[0, 2, 31]` means the 1st, 3rd and 32nd bits should be set in the bitmap.\n * The result bitmap should be 0b1010000000000000000000000000001\n *\n * @returns bitmap that is 32bit long\n */\n static createBitmap(args: { bits: number[] }): Uint8Array {\n const { bits } = args;\n // Bits are read from left to right. e.g. 0b10000000 represents the first bit is set in one byte.\n // The decimal value of 0b10000000 is 128.\n const firstBitInByte = 128;\n const bitmap = new Uint8Array([0, 0, 0, 0]);\n\n // Check if duplicates exist in bits\n const dupCheckSet = new Set();\n\n bits.forEach((bit: number) => {\n if (bit >= MultiKeySignature.MAX_SIGNATURES_SUPPORTED) {\n throw new Error(`Cannot have a signature larger than ${MultiKeySignature.MAX_SIGNATURES_SUPPORTED - 1}.`);\n }\n\n if (dupCheckSet.has(bit)) {\n throw new Error(\"Duplicate bits detected.\");\n }\n\n dupCheckSet.add(bit);\n\n const byteOffset = Math.floor(bit / 8);\n\n let byte = bitmap[byteOffset];\n\n // eslint-disable-next-line no-bitwise\n byte |= firstBitInByte >> bit % 8;\n\n bitmap[byteOffset] = byte;\n });\n\n return bitmap;\n }\n\n // region Signature\n\n toUint8Array(): Uint8Array {\n return this.bcsToBytes();\n }\n\n // endregion\n\n // region Serializable\n\n serialize(serializer: Serializer): void {\n // Note: we should not need to serialize the vector length, as it can be derived from the bitmap\n serializer.serializeVector(this.signatures);\n serializer.serializeBytes(this.bitmap);\n }\n\n static deserialize(deserializer: Deserializer): MultiKeySignature {\n const signatures = deserializer.deserializeVector(AnySignature);\n const bitmap = deserializer.deserializeBytes();\n return new MultiKeySignature({ signatures, bitmap });\n }\n\n // endregion\n}\n"],"mappings":"2KAUA,SAASA,EAASC,EAAc,CAC9B,IAAIC,EAAID,EACR,OAAAC,GAAMA,GAAK,EAAK,WAChBA,GAAKA,EAAI,YAAgBA,GAAK,EAAK,YACzBA,GAAKA,GAAK,GAAM,WAAa,UAAc,EACvD,CAWO,IAAMC,EAAN,MAAMC,UAAiBC,CAAiB,CAa7C,YAAYC,EAAoE,CAC9E,MAAM,EACN,GAAM,CAAE,WAAAC,EAAY,mBAAAC,CAAmB,EAAIF,EAG3C,GAAIE,EAAqB,EACvB,MAAM,IAAI,MAAM,8DAA8D,EAIhF,GAAID,EAAW,OAASC,EACtB,MAAM,IAAI,MACR,YAAYD,EAAW,MAAM,oCAAoCC,CAAkB,sBACrF,EAIF,KAAK,WAAaD,EAAW,IAAKE,GAChCA,aAAqBC,EAAeD,EAAY,IAAIC,EAAaD,CAAS,CAC5E,EAEA,KAAK,mBAAqBD,CAC5B,CAOA,gBAAgBF,EAAoC,CAClD,MAAM,IAAI,MAAM,iBAAiB,CACnC,CAEA,SAA6B,CAC3B,OAAOK,EAAkB,mBAAmB,CAC1C,SACA,MAAO,KAAK,aAAa,CAC3B,CAAC,CACH,CAEA,cAA2B,CACzB,OAAO,KAAK,WAAW,CACzB,CAMA,UAAUC,EAA8B,CACtCA,EAAW,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,CAChE,IAAMc,EAAad,EAAa,kBAAkBgB,CAAY,EACxDZ,EAASJ,EAAa,iBAAiB,EAC7C,OAAO,IAAIY,EAAkB,CAAE,WAAAE,EAAY,OAAAV,CAAO,CAAC,CACrD,CAGF,EAnIaQ,EAIJ,WAAqB,EAJjBA,EASJ,yBAA2BA,EAAkB,WAAa,EAT5D,IAAMO,EAANP","names":["bitCount","byte","n","MultiKey","_MultiKey","AccountPublicKey","args","publicKeys","signaturesRequired","publicKey","AnyPublicKey","AuthenticationKey","serializer","deserializer","keys","bits","firstBitInByte","bitmap","dupCheckSet","bit","idx","byteOffset","anyPublicKey","index","pk","_MultiKeySignature","Signature","signatures","signature","AnySignature","nSignatures","acc","MultiKeySignature"]}
|
|
1
|
+
{"version":3,"sources":["../../src/core/crypto/multiKey.ts"],"sourcesContent":["import { SigningScheme as AuthenticationKeyScheme } from \"../../types\";\nimport { Deserializer } from \"../../bcs/deserializer\";\nimport { Serializer } from \"../../bcs/serializer\";\nimport { AuthenticationKey } from \"../authenticationKey\";\nimport { AccountPublicKey, PublicKey, VerifySignatureArgs } from \"./publicKey\";\nimport { Signature } from \"./signature\";\nimport { AnyPublicKey, AnySignature } from \"./singleKey\";\n\n/* eslint-disable no-bitwise */\n\nfunction bitCount(byte: number) {\n let n = byte;\n n -= (n >> 1) & 0x55555555;\n n = (n & 0x33333333) + ((n >> 2) & 0x33333333);\n return (((n + (n >> 4)) & 0xf0f0f0f) * 0x1010101) >> 24;\n}\n\n/* eslint-enable no-bitwise */\n\n/**\n * Represents the public key of a multi-agent account.\n *\n * The public keys of each individual agent can be any type of public key supported by Aptos.\n * Since [AIP-55](https://github.com/aptos-foundation/AIPs/pull/263) Aptos supports\n * `Legacy` and `Unified` authentication keys.\n */\nexport class MultiKey extends AccountPublicKey {\n /**\n * List of any public keys\n */\n public readonly publicKeys: AnyPublicKey[];\n\n /**\n * The minimum number of valid signatures required, for the number of public keys specified\n */\n public readonly signaturesRequired: number;\n\n // region Constructors\n\n constructor(args: { publicKeys: Array<PublicKey>; signaturesRequired: number }) {\n super();\n const { publicKeys, signaturesRequired } = args;\n\n // Validate number of public keys is greater than signature required\n if (signaturesRequired < 1) {\n throw new Error(\"The number of required signatures needs to be greater than 0\");\n }\n\n // Validate number of public keys is greater than signature required\n if (publicKeys.length < signaturesRequired) {\n throw new Error(\n `Provided ${publicKeys.length} public keys is smaller than the ${signaturesRequired} required signatures`,\n );\n }\n\n // Make sure that all keys are normalized to the SingleKey authentication scheme\n this.publicKeys = publicKeys.map((publicKey) =>\n publicKey instanceof AnyPublicKey ? publicKey : new AnyPublicKey(publicKey),\n );\n\n this.signaturesRequired = signaturesRequired;\n }\n\n // endregion\n\n // region AccountPublicKey\n\n // eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars\n verifySignature(args: VerifySignatureArgs): boolean {\n throw new Error(\"not implemented\");\n }\n\n authKey(): AuthenticationKey {\n return AuthenticationKey.fromSchemeAndBytes({\n scheme: AuthenticationKeyScheme.MultiKey,\n input: this.toUint8Array(),\n });\n }\n\n toUint8Array(): Uint8Array {\n return this.bcsToBytes();\n }\n\n // endregion\n\n // region Serializable\n\n serialize(serializer: Serializer): void {\n serializer.serializeVector(this.publicKeys);\n serializer.serializeU8(this.signaturesRequired);\n }\n\n static deserialize(deserializer: Deserializer): MultiKey {\n const keys = deserializer.deserializeVector(AnyPublicKey);\n const signaturesRequired = deserializer.deserializeU8();\n\n return new MultiKey({ publicKeys: keys, signaturesRequired });\n }\n\n // endregion\n\n /**\n * Create a bitmap that holds the mapping from the original public keys\n * to the signatures passed in\n *\n * @param args.bits array of the index mapping to the matching public keys\n * @returns Uint8array bit map\n */\n createBitmap(args: { bits: number[] }): Uint8Array {\n const { bits } = args;\n // Bits are read from left to right. e.g. 0b10000000 represents the first bit is set in one byte.\n // The decimal value of 0b10000000 is 128.\n const firstBitInByte = 128;\n const bitmap = new Uint8Array([0, 0, 0, 0]);\n\n // Check if duplicates exist in bits\n const dupCheckSet = new Set();\n\n bits.forEach((bit: number, idx: number) => {\n if (idx + 1 > this.publicKeys.length) {\n throw new Error(`Signature index ${idx + 1} is out of public keys range, ${this.publicKeys.length}.`);\n }\n\n if (dupCheckSet.has(bit)) {\n throw new Error(`Duplicate bit ${bit} detected.`);\n }\n\n dupCheckSet.add(bit);\n\n const byteOffset = Math.floor(bit / 8);\n\n let byte = bitmap[byteOffset];\n\n // eslint-disable-next-line no-bitwise\n byte |= firstBitInByte >> bit % 8;\n\n bitmap[byteOffset] = byte;\n });\n\n return bitmap;\n }\n\n /**\n * Get the index of the provided public key.\n *\n * @param publicKey array of the index mapping to the matching public keys\n * @returns the corresponding index of the publicKey, if it exists\n */\n getIndex(publicKey: PublicKey): number {\n const anyPublicKey = publicKey instanceof AnyPublicKey ? publicKey : new AnyPublicKey(publicKey);\n const index = this.publicKeys.findIndex((pk) => pk.toString() === anyPublicKey.toString());\n\n if (index !== -1) {\n return index;\n }\n throw new Error(\"Public key not found in MultiKey\");\n }\n}\n\nexport class MultiKeySignature extends Signature {\n /**\n * Number of bytes in the bitmap representing who signed the transaction (32-bits)\n */\n static BITMAP_LEN: number = 4;\n\n /**\n * Maximum number of Ed25519 signatures supported\n */\n static MAX_SIGNATURES_SUPPORTED = MultiKeySignature.BITMAP_LEN * 8;\n\n /**\n * The list of underlying Ed25519 signatures\n */\n public readonly signatures: AnySignature[];\n\n /**\n * 32-bit Bitmap representing who signed the transaction\n *\n * This is represented where each public key can be masked to determine whether the message was signed by that key.\n */\n public readonly bitmap: Uint8Array;\n\n /**\n * Signature for a K-of-N multi-sig transaction.\n *\n * @see {@link\n * https://aptos.dev/integration/creating-a-signed-transaction/#multisignature-transactions | Creating a Signed Transaction}\n *\n * @param args.signatures A list of signatures\n * @param args.bitmap 4 bytes, at most 32 signatures are supported. If Nth bit value is `1`, the Nth\n * signature should be provided in `signatures`. Bits are read from left to right\n */\n constructor(args: { signatures: Array<Signature | AnySignature>; bitmap: Uint8Array | number[] }) {\n super();\n const { signatures, bitmap } = args;\n\n if (signatures.length > MultiKeySignature.MAX_SIGNATURES_SUPPORTED) {\n throw new Error(`The number of signatures cannot be greater than ${MultiKeySignature.MAX_SIGNATURES_SUPPORTED}`);\n }\n\n // Make sure that all signatures are normalized to the SingleKey authentication scheme\n this.signatures = signatures.map((signature) =>\n signature instanceof AnySignature ? signature : new AnySignature(signature),\n );\n\n if (!(bitmap instanceof Uint8Array)) {\n this.bitmap = MultiKeySignature.createBitmap({ bits: bitmap });\n } else if (bitmap.length !== MultiKeySignature.BITMAP_LEN) {\n throw new Error(`\"bitmap\" length should be ${MultiKeySignature.BITMAP_LEN}`);\n } else {\n this.bitmap = bitmap;\n }\n\n const nSignatures = this.bitmap.reduce((acc, byte) => acc + bitCount(byte), 0);\n if (nSignatures !== this.signatures.length) {\n throw new Error(`Expecting ${nSignatures} signatures from the bitmap, but got ${this.signatures.length}`);\n }\n }\n\n /**\n * Helper method to create a bitmap out of the specified bit positions\n * @param args.bits The bitmap positions that should be set. A position starts at index 0.\n * Valid position should range between 0 and 31.\n * @example\n * Here's an example of valid `bits`\n * ```\n * [0, 2, 31]\n * ```\n * `[0, 2, 31]` means the 1st, 3rd and 32nd bits should be set in the bitmap.\n * The result bitmap should be 0b1010000000000000000000000000001\n *\n * @returns bitmap that is 32bit long\n */\n static createBitmap(args: { bits: number[] }): Uint8Array {\n const { bits } = args;\n // Bits are read from left to right. e.g. 0b10000000 represents the first bit is set in one byte.\n // The decimal value of 0b10000000 is 128.\n const firstBitInByte = 128;\n const bitmap = new Uint8Array([0, 0, 0, 0]);\n\n // Check if duplicates exist in bits\n const dupCheckSet = new Set();\n\n bits.forEach((bit: number) => {\n if (bit >= MultiKeySignature.MAX_SIGNATURES_SUPPORTED) {\n throw new Error(`Cannot have a signature larger than ${MultiKeySignature.MAX_SIGNATURES_SUPPORTED - 1}.`);\n }\n\n if (dupCheckSet.has(bit)) {\n throw new Error(\"Duplicate bits detected.\");\n }\n\n dupCheckSet.add(bit);\n\n const byteOffset = Math.floor(bit / 8);\n\n let byte = bitmap[byteOffset];\n\n // eslint-disable-next-line no-bitwise\n byte |= firstBitInByte >> bit % 8;\n\n bitmap[byteOffset] = byte;\n });\n\n return bitmap;\n }\n\n // region Signature\n\n toUint8Array(): Uint8Array {\n return this.bcsToBytes();\n }\n\n // endregion\n\n // region Serializable\n\n serialize(serializer: Serializer): void {\n // Note: we should not need to serialize the vector length, as it can be derived from the bitmap\n serializer.serializeVector(this.signatures);\n serializer.serializeBytes(this.bitmap);\n }\n\n static deserialize(deserializer: Deserializer): MultiKeySignature {\n const signatures = deserializer.deserializeVector(AnySignature);\n const bitmap = deserializer.deserializeBytes();\n return new MultiKeySignature({ signatures, bitmap });\n }\n\n // endregion\n}\n"],"mappings":";;;;;;;;;;;;;;;AAUA,SAAS,SAAS,MAAc;AAC9B,MAAI,IAAI;AACR,OAAM,KAAK,IAAK;AAChB,OAAK,IAAI,cAAgB,KAAK,IAAK;AACnC,UAAU,KAAK,KAAK,KAAM,aAAa,YAAc;AACvD;AAWO,IAAM,WAAN,MAAM,kBAAiB,iBAAiB;AAAA;AAAA,EAa7C,YAAY,MAAoE;AAC9E,UAAM;AACN,UAAM,EAAE,YAAY,mBAAmB,IAAI;AAG3C,QAAI,qBAAqB,GAAG;AAC1B,YAAM,IAAI,MAAM,8DAA8D;AAAA,IAChF;AAGA,QAAI,WAAW,SAAS,oBAAoB;AAC1C,YAAM,IAAI;AAAA,QACR,YAAY,WAAW,MAAM,oCAAoC,kBAAkB;AAAA,MACrF;AAAA,IACF;AAGA,SAAK,aAAa,WAAW;AAAA,MAAI,CAAC,cAChC,qBAAqB,eAAe,YAAY,IAAI,aAAa,SAAS;AAAA,IAC5E;AAEA,SAAK,qBAAqB;AAAA,EAC5B;AAAA;AAAA;AAAA;AAAA,EAOA,gBAAgB,MAAoC;AAClD,UAAM,IAAI,MAAM,iBAAiB;AAAA,EACnC;AAAA,EAEA,UAA6B;AAC3B,WAAO,kBAAkB,mBAAmB;AAAA,MAC1C;A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